16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-23 02:49:19 +02:00

pre-merge syncs

This commit is contained in:
tmj-fstate
2018-02-03 17:37:46 +01:00
parent b3e7b88bbc
commit e8bb25454e
20 changed files with 53 additions and 82 deletions

View File

@@ -27,8 +27,8 @@ class sound_source;
class TEventLauncher; class TEventLauncher;
class TTraction; // drut class TTraction; // drut
class TTractionPowerSource; // zasilanie drutów class TTractionPowerSource; // zasilanie drutów
class TCamera;
class TWorld; class TWorld;
class TCamera;
class simulation_time; class simulation_time;
class TMoverParameters; class TMoverParameters;

View File

@@ -84,7 +84,7 @@ TKeyTrans Console::ktTable[4 * 256];
// Ra: bajer do migania LED-ami w klawiaturze // Ra: bajer do migania LED-ami w klawiaturze
void SetLedState( unsigned char Code, bool bOn ) { void SetLedState( unsigned char Code, bool bOn ) {
#ifdef _WINDOWS #ifdef _WIN32
if( bOn != ( ::GetKeyState( Code ) != 0 ) ) { if( bOn != ( ::GetKeyState( Code ) != 0 ) ) {
keybd_event( Code, MapVirtualKey( Code, 0 ), KEYEVENTF_EXTENDEDKEY | 0, 0 ); keybd_event( Code, MapVirtualKey( Code, 0 ), KEYEVENTF_EXTENDEDKEY | 0, 0 );
keybd_event( Code, MapVirtualKey( Code, 0 ), KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP, 0 ); keybd_event( Code, MapVirtualKey( Code, 0 ), KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP, 0 );

View File

@@ -3833,24 +3833,6 @@ void TDynamicObject::RenderSounds() {
// special events // special events
if( MoverParameters->EventFlag ) { if( MoverParameters->EventFlag ) {
// TODO: dedicated sound, played alongside regular noise
if( true == TestFlag( MoverParameters->DamageFlag, dtrain_wheelwear ) ) {
#ifdef EU07_USE_OLD_SOUNDCODE
if( rsOuterNoise.AM != 0 ) {
rsOuterNoise.Stop();
float am = rsOuterNoise.AM;
float fa = rsOuterNoise.FA;
float fm = rsOuterNoise.FM;
rsOuterNoise.Init( "lomotpodkucia.wav", -1, 0, 0, 0, true ); // MC: zmiana szumu na lomot
if( rsOuterNoise.AM == 1 )
rsOuterNoise.AM = am;
rsOuterNoise.AA = 0.7;
rsOuterNoise.FA = fa;
rsOuterNoise.FM = fm;
}
#else
#endif
}
// McZapkie: w razie wykolejenia // McZapkie: w razie wykolejenia
if( true == TestFlag( MoverParameters->DamageFlag, dtrain_out ) ) { if( true == TestFlag( MoverParameters->DamageFlag, dtrain_out ) ) {
if( GetVelocity() > 0 ) { if( GetVelocity() > 0 ) {
@@ -5441,7 +5423,7 @@ void TDynamicObject::DestinationSet(std::string to, std::string numer)
for( auto const &destination : destinations ) { for( auto const &destination : destinations ) {
auto material = TextureTest( destination ); auto material = TextureTest( ToLower( destination ) );
if( false == material.empty() ) { if( false == material.empty() ) {
m_materialdata.replacable_skins[ 4 ] = GfxRenderer.Fetch_Material( material ); m_materialdata.replacable_skins[ 4 ] = GfxRenderer.Fetch_Material( material );
break; break;

View File

@@ -38,7 +38,7 @@ Stele, firleju, szociu, hunter, ZiomalCl, OLI_EU and others
#pragma comment( lib, "glfw3.lib" ) #pragma comment( lib, "glfw3.lib" )
#pragma comment( lib, "glew32s.lib" ) #pragma comment( lib, "glew32s.lib" )
#else #else
#ifdef _WINDOWS #ifdef _WIN32
#pragma comment( lib, "glfw3dll.lib" ) #pragma comment( lib, "glfw3dll.lib" )
#else #else
#pragma comment( lib, "glfw3.lib" ) #pragma comment( lib, "glfw3.lib" )
@@ -47,9 +47,7 @@ Stele, firleju, szociu, hunter, ZiomalCl, OLI_EU and others
#endif // build_static #endif // build_static
#pragma comment( lib, "opengl32.lib" ) #pragma comment( lib, "opengl32.lib" )
#pragma comment( lib, "glu32.lib" ) #pragma comment( lib, "glu32.lib" )
#pragma comment( lib, "dsound.lib" )
#pragma comment( lib, "openal32.lib") #pragma comment( lib, "openal32.lib")
#pragma comment( lib, "winmm.lib" )
#pragma comment( lib, "setupapi.lib" ) #pragma comment( lib, "setupapi.lib" )
#pragma comment( lib, "python27.lib" ) #pragma comment( lib, "python27.lib" )
#pragma comment (lib, "dbghelp.lib") #pragma comment (lib, "dbghelp.lib")
@@ -218,7 +216,7 @@ void scroll_callback( GLFWwindow* window, double xoffset, double yoffset ) {
} }
} }
#ifdef _WINDOWS #ifdef _WIN32
extern "C" extern "C"
{ {
GLFWAPI HWND glfwGetWin32Window(GLFWwindow* window); GLFWAPI HWND glfwGetWin32Window(GLFWwindow* window);
@@ -241,14 +239,14 @@ int main(int argc, char *argv[])
// this will turn on FPE for #IND and zerodiv // this will turn on FPE for #IND and zerodiv
state = _control87( state & ~( _EM_ZERODIVIDE | _EM_INVALID ), _MCW_EM ); state = _control87( state & ~( _EM_ZERODIVIDE | _EM_INVALID ), _MCW_EM );
#endif #endif
#ifdef _WINDOWS #ifdef _WIN32
::SetUnhandledExceptionFilter( unhandled_handler ); ::SetUnhandledExceptionFilter( unhandled_handler );
#endif #endif
if (!glfwInit()) if (!glfwInit())
return -1; return -1;
#ifdef _WINDOWS #ifdef _WIN32
DeleteFile( "log.txt" ); DeleteFile( "log.txt" );
DeleteFile( "errors.txt" ); DeleteFile( "errors.txt" );
_mkdir("logs"); _mkdir("logs");
@@ -394,7 +392,7 @@ int main(int argc, char *argv[])
return -1; return -1;
} }
#ifdef _WINDOWS #ifdef _WIN32
// setup wrapper for base glfw window proc, to handle copydata messages // setup wrapper for base glfw window proc, to handle copydata messages
Hwnd = glfwGetWin32Window( window ); Hwnd = glfwGetWin32Window( window );
BaseWindowProc = (WNDPROC)::SetWindowLongPtr( Hwnd, GWLP_WNDPROC, (LONG_PTR)WndProc ); BaseWindowProc = (WNDPROC)::SetWindowLongPtr( Hwnd, GWLP_WNDPROC, (LONG_PTR)WndProc );
@@ -426,7 +424,7 @@ int main(int argc, char *argv[])
ErrorLog( "Critical error, memory allocation failure: " + std::string( Error.what() ) ); ErrorLog( "Critical error, memory allocation failure: " + std::string( Error.what() ) );
return -1; return -1;
} }
#ifdef _WINDOWS #ifdef _WIN32
Console *pConsole = new Console(); // Ra: nie wiem, czy ma to sens, ale jakoś zainicjowac trzeba Console *pConsole = new Console(); // Ra: nie wiem, czy ma to sens, ale jakoś zainicjowac trzeba
#endif #endif
if( Global.iConvertModels < 0 ) { if( Global.iConvertModels < 0 ) {
@@ -434,7 +432,7 @@ int main(int argc, char *argv[])
World.CreateE3D( "models\\" ); // rekurencyjne przeglądanie katalogów World.CreateE3D( "models\\" ); // rekurencyjne przeglądanie katalogów
World.CreateE3D( "dynamic\\", true ); World.CreateE3D( "dynamic\\", true );
} // po zrobieniu E3D odpalamy normalnie scenerię, by ją zobaczyć } // po zrobieniu E3D odpalamy normalnie scenerię, by ją zobaczyć
#ifdef _WINDOWS #ifdef _WIN32
Console::On(); // włączenie konsoli Console::On(); // włączenie konsoli
#endif #endif
try { try {
@@ -454,7 +452,7 @@ int main(int argc, char *argv[])
} }
TPythonInterpreter::killInstance(); TPythonInterpreter::killInstance();
#ifdef _WINDOWS #ifdef _WIN32
Console::Off(); // wyłączenie konsoli (komunikacji zwrotnej) Console::Off(); // wyłączenie konsoli (komunikacji zwrotnej)
SafeDelete( pConsole ); SafeDelete( pConsole );
#endif #endif

View File

@@ -32,7 +32,7 @@ http://mozilla.org/MPL/2.0/.
// and the high byte holds modifiers: 0x1 = shift, 0x2 = ctrl, 0x4 = alt // and the high byte holds modifiers: 0x1 = shift, 0x2 = ctrl, 0x4 = alt
int vk_to_glfw_key( int const Keycode ) { int vk_to_glfw_key( int const Keycode ) {
#ifdef _WINDOWS #ifdef _WIN32
auto const code = VkKeyScan( Keycode ); auto const code = VkKeyScan( Keycode );
char key = code & 0xff; char key = code & 0xff;
char shiftstate = ( code & 0xff00 ) >> 8; char shiftstate = ( code & 0xff00 ) >> 8;

View File

@@ -50,10 +50,10 @@ TEvent::~TEvent() {
SafeDeleteArray(Params[10].asText); SafeDeleteArray(Params[10].asText);
break; break;
case tp_Animation: // nic case tp_Animation: // nic
// SafeDeleteArray(Params[9].asText); //nie usuwać - nazwa jest zamieniana na wskaźnik do // SafeDeleteArray(Params[9].asText); //nie usuwać - nazwa jest zamieniana na wskaźnik do submodelu
// submodelu
if (Params[0].asInt == 4) // jeśli z pliku VMD if (Params[0].asInt == 4) // jeśli z pliku VMD
SafeDeleteArray( Params[8].asPointer ); // zwolnić obszar SafeDeleteArray( Params[8].asPointer ); // zwolnić obszar
break;
case tp_GetValues: // nic case tp_GetValues: // nic
break; break;
case tp_PutValues: // params[0].astext stores the token case tp_PutValues: // params[0].astext stores the token

View File

@@ -72,11 +72,7 @@ union TParam
bool asBool; bool asBool;
double asdouble; double asdouble;
int asInt; int asInt;
#ifdef EU07_USE_OLD_SOUNDCODE
TTextSound *tsTextSound;
#else
sound_source *tsTextSound; sound_source *tsTextSound;
#endif
char *asText; char *asText;
TCommandType asCommand; TCommandType asCommand;
TTractionPowerSource *psPower; TTractionPowerSource *psPower;

View File

@@ -704,7 +704,7 @@ global_settings::ConfigParse(cParser &Parser) {
// TBD: remove, or launch depending on passed flag? // TBD: remove, or launch depending on passed flag?
if (qp) if (qp)
{ // to poniżej wykonywane tylko raz, jedynie po wczytaniu eu07.ini*/ { // to poniżej wykonywane tylko raz, jedynie po wczytaniu eu07.ini*/
#ifdef _WINDOWS #ifdef _WIN32
Console::ModeSet(iFeedbackMode, iFeedbackPort); // tryb pracy konsoli sterowniczej Console::ModeSet(iFeedbackMode, iFeedbackPort); // tryb pracy konsoli sterowniczej
#endif #endif
/*iFpsRadiusMax = 0.000025 * fFpsRadiusMax * /*iFpsRadiusMax = 0.000025 * fFpsRadiusMax *

View File

@@ -1111,7 +1111,6 @@ TModel3d::~TModel3d() {
if (iFlags & 0x0200) { if (iFlags & 0x0200) {
// wczytany z pliku tekstowego, submodele sprzątają same // wczytany z pliku tekstowego, submodele sprzątają same
SafeDelete( Root ); SafeDelete( Root );
// Root = nullptr;
} }
else { else {
// wczytano z pliku binarnego (jest właścicielem tablic) // wczytano z pliku binarnego (jest właścicielem tablic)
@@ -1121,17 +1120,19 @@ TModel3d::~TModel3d() {
TSubModel *TModel3d::AddToNamed(const char *Name, TSubModel *SubModel) TSubModel *TModel3d::AddToNamed(const char *Name, TSubModel *SubModel)
{ {
TSubModel *sm = Name ? GetFromName(Name) : NULL; TSubModel *sm = Name ? GetFromName(Name) : nullptr;
if( ( sm == nullptr )
&& ( Name != nullptr ) && ( std::strcmp( Name, "none" ) != 0 ) ) {
ErrorLog( "Bad model: parent for sub-model \"" + SubModel->pName +"\" doesn't exist or is located after in the model data", logtype::model );
}
AddTo(sm, SubModel); // szukanie nadrzędnego AddTo(sm, SubModel); // szukanie nadrzędnego
return sm; // zwracamy wskaźnik do nadrzędnego submodelu return sm; // zwracamy wskaźnik do nadrzędnego submodelu
}; };
void TModel3d::AddTo(TSubModel *tmp, TSubModel *SubModel) // jedyny poprawny sposób dodawania submodeli, inaczej mogą zginąć przy zapisie E3D
{ // jedyny poprawny sposób dodawania void TModel3d::AddTo(TSubModel *tmp, TSubModel *SubModel) {
// submodeli, inaczej mogą zginąć if (tmp) {
// przy zapisie E3D // jeśli znaleziony, podłączamy mu jako potomny
if (tmp)
{ // jeśli znaleziony, podłączamy mu jako potomny
tmp->ChildAdd(SubModel); tmp->ChildAdd(SubModel);
} }
else else

View File

@@ -596,8 +596,7 @@ void TWorld::OnKeyDown(int cKey) {
{ // i potwierdzenie { // i potwierdzenie
if( cKey == GLFW_KEY_Y ) { if( cKey == GLFW_KEY_Y ) {
// flaga wyjścia z programu // flaga wyjścia z programu
::PostQuitMessage( 0 ); glfwSetWindowShouldClose( window, 1 );
// Global.iTextMode = -1;
} }
return; // nie przekazujemy do pociągu return; // nie przekazujemy do pociągu
} }
@@ -1921,7 +1920,7 @@ void TWorld::CreateE3D(std::string const &Path, bool Dynamic)
double at{ 0.0 }; double at{ 0.0 };
double shift{ 0.0 }; double shift{ 0.0 };
#ifdef _WINDOWS #ifdef _WIN32
std::string searchpattern( "*.*" ); std::string searchpattern( "*.*" );

View File

@@ -127,7 +127,7 @@ class matrix4x4
public: public:
matrix4x4(void) matrix4x4(void)
{ {
::SecureZeroMemory( e, sizeof( e ) ); memset( e, 0, sizeof( e ) );
} }
// When defining matrices in C arrays, it is easiest to define them with // When defining matrices in C arrays, it is easiest to define them with

View File

@@ -15,26 +15,30 @@ http://mozilla.org/MPL/2.0/.
#include "mtable.h" #include "mtable.h"
#include "logs.h" #include "logs.h"
#ifdef _WIN32
extern "C" extern "C"
{ {
GLFWAPI HWND glfwGetWin32Window( GLFWwindow* window ); //m7todo: potrzebne do directsound GLFWAPI HWND glfwGetWin32Window( GLFWwindow* window ); //m7todo: potrzebne do directsound
} }
#endif
namespace multiplayer { namespace multiplayer {
#ifdef _WINDOWS
void void
Navigate(std::string const &ClassName, UINT Msg, WPARAM wParam, LPARAM lParam) { Navigate(std::string const &ClassName, UINT Msg, WPARAM wParam, LPARAM lParam) {
#ifdef _WIN32
// wysłanie komunikatu do sterującego // wysłanie komunikatu do sterującego
HWND h = FindWindow(ClassName.c_str(), 0); // można by to zapamiętać HWND h = FindWindow(ClassName.c_str(), 0); // można by to zapamiętać
if (h == 0) if (h == 0)
h = FindWindow(0, ClassName.c_str()); // można by to zapamiętać h = FindWindow(0, ClassName.c_str()); // można by to zapamiętać
SendMessage(h, Msg, wParam, lParam); SendMessage(h, Msg, wParam, lParam);
#endif
} }
void void
WyslijEvent(const std::string &e, const std::string &d) WyslijEvent(const std::string &e, const std::string &d)
{ // Ra: jeszcze do wyczyszczenia { // Ra: jeszcze do wyczyszczenia
#ifdef _WIN32
DaneRozkaz r; DaneRozkaz r;
r.iSygn = MAKE_ID4( 'E', 'U', '0', '7' ); r.iSygn = MAKE_ID4( 'E', 'U', '0', '7' );
r.iComm = 2; // 2 - event r.iComm = 2; // 2 - event
@@ -49,12 +53,14 @@ WyslijEvent(const std::string &e, const std::string &d)
cData.lpData = &r; cData.lpData = &r;
Navigate( "TEU07SRK", WM_COPYDATA, (WPARAM)glfwGetWin32Window( Global.window ), (LPARAM)&cData ); Navigate( "TEU07SRK", WM_COPYDATA, (WPARAM)glfwGetWin32Window( Global.window ), (LPARAM)&cData );
CommLog( Now() + " " + std::to_string(r.iComm) + " " + e + " sent" ); CommLog( Now() + " " + std::to_string(r.iComm) + " " + e + " sent" );
#endif
} }
void void
WyslijUszkodzenia(const std::string &t, char fl) WyslijUszkodzenia(const std::string &t, char fl)
{ // wysłanie informacji w postaci pojedynczego tekstu { // wysłanie informacji w postaci pojedynczego tekstu
DaneRozkaz r; #ifdef _WIN32
DaneRozkaz r;
r.iSygn = MAKE_ID4( 'E', 'U', '0', '7' ); r.iSygn = MAKE_ID4( 'E', 'U', '0', '7' );
r.iComm = 13; // numer komunikatu r.iComm = 13; // numer komunikatu
size_t i = t.length(); size_t i = t.length();
@@ -67,11 +73,13 @@ WyslijUszkodzenia(const std::string &t, char fl)
cData.lpData = &r; cData.lpData = &r;
Navigate( "TEU07SRK", WM_COPYDATA, (WPARAM)glfwGetWin32Window( Global.window ), (LPARAM)&cData ); Navigate( "TEU07SRK", WM_COPYDATA, (WPARAM)glfwGetWin32Window( Global.window ), (LPARAM)&cData );
CommLog( Now() + " " + std::to_string(r.iComm) + " " + t + " sent"); CommLog( Now() + " " + std::to_string(r.iComm) + " " + t + " sent");
#endif
} }
void void
WyslijString(const std::string &t, int n) WyslijString(const std::string &t, int n)
{ // wysłanie informacji w postaci pojedynczego tekstu { // wysłanie informacji w postaci pojedynczego tekstu
#ifdef _WIN32
DaneRozkaz r; DaneRozkaz r;
r.iSygn = MAKE_ID4( 'E', 'U', '0', '7' ); r.iSygn = MAKE_ID4( 'E', 'U', '0', '7' );
r.iComm = n; // numer komunikatu r.iComm = n; // numer komunikatu
@@ -84,6 +92,7 @@ WyslijString(const std::string &t, int n)
cData.lpData = &r; cData.lpData = &r;
Navigate( "TEU07SRK", WM_COPYDATA, (WPARAM)glfwGetWin32Window( Global.window ), (LPARAM)&cData ); Navigate( "TEU07SRK", WM_COPYDATA, (WPARAM)glfwGetWin32Window( Global.window ), (LPARAM)&cData );
CommLog( Now() + " " + std::to_string(r.iComm) + " " + t + " sent"); CommLog( Now() + " " + std::to_string(r.iComm) + " " + t + " sent");
#endif
} }
void void
@@ -95,7 +104,8 @@ WyslijWolny(const std::string &t)
void void
WyslijNamiary(TDynamicObject const *Vehicle) WyslijNamiary(TDynamicObject const *Vehicle)
{ // wysłanie informacji o pojeździe - (float), długość ramki będzie zwiększana w miarę potrzeby { // wysłanie informacji o pojeździe - (float), długość ramki będzie zwiększana w miarę potrzeby
// WriteLog("Wysylam pojazd"); #ifdef _WIN32
// WriteLog("Wysylam pojazd");
DaneRozkaz r; DaneRozkaz r;
r.iSygn = MAKE_ID4( 'E', 'U', '0', '7' ); r.iSygn = MAKE_ID4( 'E', 'U', '0', '7' );
r.iComm = 7; // 7 - dane pojazdu r.iComm = 7; // 7 - dane pojazdu
@@ -167,12 +177,14 @@ WyslijNamiary(TDynamicObject const *Vehicle)
Navigate( "TEU07SRK", WM_COPYDATA, (WPARAM)glfwGetWin32Window( Global.window ), (LPARAM)&cData ); Navigate( "TEU07SRK", WM_COPYDATA, (WPARAM)glfwGetWin32Window( Global.window ), (LPARAM)&cData );
// WriteLog("Ramka poszla!"); // WriteLog("Ramka poszla!");
CommLog( Now() + " " + std::to_string(r.iComm) + " " + Vehicle->asName + " sent"); CommLog( Now() + " " + std::to_string(r.iComm) + " " + Vehicle->asName + " sent");
#endif
} }
void void
WyslijObsadzone() WyslijObsadzone()
{ // wysłanie informacji o pojeździe { // wysłanie informacji o pojeździe
DaneRozkaz2 r; #ifdef _WIN32
DaneRozkaz2 r;
r.iSygn = MAKE_ID4( 'E', 'U', '0', '7' ); r.iSygn = MAKE_ID4( 'E', 'U', '0', '7' );
r.iComm = 12; // kod 12 r.iComm = 12; // kod 12
for (int i=0; i<1984; ++i) r.cString[i] = 0; for (int i=0; i<1984; ++i) r.cString[i] = 0;
@@ -213,11 +225,13 @@ WyslijObsadzone()
// WriteLog("Ramka gotowa"); // WriteLog("Ramka gotowa");
Navigate( "TEU07SRK", WM_COPYDATA, (WPARAM)glfwGetWin32Window( Global.window ), (LPARAM)&cData ); Navigate( "TEU07SRK", WM_COPYDATA, (WPARAM)glfwGetWin32Window( Global.window ), (LPARAM)&cData );
CommLog( Now() + " " + std::to_string(r.iComm) + " obsadzone" + " sent"); CommLog( Now() + " " + std::to_string(r.iComm) + " obsadzone" + " sent");
#endif
} }
void void
WyslijParam(int nr, int fl) WyslijParam(int nr, int fl)
{ // wysłanie parametrów symulacji w ramce (nr) z flagami (fl) { // wysłanie parametrów symulacji w ramce (nr) z flagami (fl)
#ifdef _WIN32
DaneRozkaz r; DaneRozkaz r;
r.iSygn = MAKE_ID4( 'E', 'U', '0', '7' ); r.iSygn = MAKE_ID4( 'E', 'U', '0', '7' );
r.iComm = nr; // zwykle 5 r.iComm = nr; // zwykle 5
@@ -236,8 +250,8 @@ WyslijParam(int nr, int fl)
cData.cbData = 12 + i; // 12+rozmiar danych cData.cbData = 12 + i; // 12+rozmiar danych
cData.lpData = &r; cData.lpData = &r;
Navigate( "TEU07SRK", WM_COPYDATA, (WPARAM)glfwGetWin32Window( Global.window ), (LPARAM)&cData ); Navigate( "TEU07SRK", WM_COPYDATA, (WPARAM)glfwGetWin32Window( Global.window ), (LPARAM)&cData );
}
#endif #endif
}
} // multiplayer } // multiplayer

View File

@@ -21,14 +21,13 @@ extern TWorld World;
bool bool
mouse_input::init() { mouse_input::init() {
#ifdef _WINDOWS #ifdef _WIN32
DWORD systemkeyboardspeed; DWORD systemkeyboardspeed;
::SystemParametersInfo( SPI_GETKEYBOARDSPEED, 0, &systemkeyboardspeed, 0 ); ::SystemParametersInfo( SPI_GETKEYBOARDSPEED, 0, &systemkeyboardspeed, 0 );
m_updaterate = interpolate( 0.5, 0.04, systemkeyboardspeed / 31.0 ); m_updaterate = interpolate( 0.5, 0.04, systemkeyboardspeed / 31.0 );
DWORD systemkeyboarddelay; DWORD systemkeyboarddelay;
::SystemParametersInfo( SPI_GETKEYBOARDDELAY, 0, &systemkeyboarddelay, 0 ); ::SystemParametersInfo( SPI_GETKEYBOARDDELAY, 0, &systemkeyboarddelay, 0 );
m_updatedelay = interpolate( 0.25, 1.0, systemkeyboarddelay / 3.0 ); m_updatedelay = interpolate( 0.25, 1.0, systemkeyboarddelay / 3.0 );
#endif #endif
return true; return true;
} }

View File

@@ -13,7 +13,7 @@ http://mozilla.org/MPL/2.0/.
#include <glm/glm.hpp> #include <glm/glm.hpp>
#include <glm/gtc/type_ptr.hpp> #include <glm/gtc/type_ptr.hpp>
#include "GL/glew.h" #include "GL/glew.h"
#ifdef _WINDOWS #ifdef _WIN32
#include "GL/wglew.h" #include "GL/wglew.h"
#endif #endif
#include "ResourceManager.h" #include "ResourceManager.h"

View File

@@ -15,7 +15,7 @@ http://mozilla.org/MPL/2.0/.
#include <glm/gtc/matrix_transform.hpp> #include <glm/gtc/matrix_transform.hpp>
#include <glm/gtc/type_ptr.hpp> #include <glm/gtc/type_ptr.hpp>
#include "GL/glew.h" #include "GL/glew.h"
#ifdef _WINDOWS #ifdef _WIN32
#include "GL/wglew.h" #include "GL/wglew.h"
#endif #endif

View File

@@ -105,11 +105,7 @@ public:
insert( TAnimModel *Instance ); insert( TAnimModel *Instance );
// adds provided sound instance to the cell // adds provided sound instance to the cell
void void
#ifdef EU07_USE_OLD_SOUNDCODE
insert( TTextSound *Sound );
#else
insert( sound_source *Sound ); insert( sound_source *Sound );
#endif
// adds provided event launcher to the cell // adds provided event launcher to the cell
void void
insert( TEventLauncher *Launcher ); insert( TEventLauncher *Launcher );

View File

@@ -832,11 +832,7 @@ state_manager::deserialize_dynamic( cParser &Input, scene::scratch_data &Scratch
return vehicle; return vehicle;
} }
#ifdef EU07_USE_OLD_SOUNDCODE
TTextSound *
#else
sound_source * sound_source *
#endif
state_manager::deserialize_sound( cParser &Input, scene::scratch_data &Scratchpad, scene::node_data const &Nodedata ) { state_manager::deserialize_sound( cParser &Input, scene::scratch_data &Scratchpad, scene::node_data const &Nodedata ) {
glm::dvec3 location; glm::dvec3 location;
@@ -848,16 +844,10 @@ state_manager::deserialize_sound( cParser &Input, scene::scratch_data &Scratchpa
// adjust location // adjust location
location = transform( location, Scratchpad ); location = transform( location, Scratchpad );
#ifdef EU07_USE_OLD_SOUNDCODE
auto const soundname { Input.getToken<std::string>() };
auto *sound = new TTextSound( soundname, Nodedata.range_max, location.x, location.y, location.z, false, false, Nodedata.range_min );
sound->name( Nodedata.name );
#else
auto *sound = new sound_source( sound_placement::external, Nodedata.range_max ); auto *sound = new sound_source( sound_placement::external, Nodedata.range_max );
sound->offset( location ); sound->offset( location );
sound->name( Nodedata.name ); sound->name( Nodedata.name );
sound->deserialize( Input, sound_type::single ); sound->deserialize( Input, sound_type::single );
#endif
skip_until( Input, "endsound" ); skip_until( Input, "endsound" );

View File

@@ -64,11 +64,7 @@ private:
TEventLauncher * deserialize_eventlauncher( cParser &Input, scene::scratch_data &Scratchpad, scene::node_data const &Nodedata ); TEventLauncher * deserialize_eventlauncher( cParser &Input, scene::scratch_data &Scratchpad, scene::node_data const &Nodedata );
TAnimModel * deserialize_model( cParser &Input, scene::scratch_data &Scratchpad, scene::node_data const &Nodedata ); TAnimModel * deserialize_model( cParser &Input, scene::scratch_data &Scratchpad, scene::node_data const &Nodedata );
TDynamicObject * deserialize_dynamic( cParser &Input, scene::scratch_data &Scratchpad, scene::node_data const &Nodedata ); TDynamicObject * deserialize_dynamic( cParser &Input, scene::scratch_data &Scratchpad, scene::node_data const &Nodedata );
#ifdef EU07_USE_OLD_SOUNDCODE
TTextSound * deserialize_sound( cParser &Input, scene::scratch_data &Scratchpad, scene::node_data const &Nodedata );
#else
sound_source * deserialize_sound( cParser &Input, scene::scratch_data &Scratchpad, scene::node_data const &Nodedata ); sound_source * deserialize_sound( cParser &Input, scene::scratch_data &Scratchpad, scene::node_data const &Nodedata );
#endif
// skips content of stream until specified token // skips content of stream until specified token
void skip_until( cParser &Input, std::string const &Token ); void skip_until( cParser &Input, std::string const &Token );
// transforms provided location by specifed rotation and offset // transforms provided location by specifed rotation and offset

View File

@@ -18,7 +18,7 @@
#endif // _DEBUG #endif // _DEBUG
#endif #endif
// operating system // operating system
#ifdef _WINDOWS #ifdef _WIN32
#include "targetver.h" #include "targetver.h"
#define NOMINMAX #define NOMINMAX
#include <windows.h> #include <windows.h>
@@ -73,12 +73,12 @@
#ifdef EU07_BUILD_STATIC #ifdef EU07_BUILD_STATIC
#define GLEW_STATIC #define GLEW_STATIC
#else #else
#ifdef _WINDOWS #ifdef _WIN32
#define GLFW_DLL #define GLFW_DLL
#endif // _windows #endif // _windows
#endif // build_static #endif // build_static
#include "GL/glew.h" #include "GL/glew.h"
#ifdef _WINDOWS #ifdef _WIN32
#include "GL/wglew.h" #include "GL/wglew.h"
#endif #endif
#define GLFW_INCLUDE_GLU #define GLFW_INCLUDE_GLU

View File

@@ -84,7 +84,7 @@ bool ClearFlag( int &Flag, int const Value ) {
} }
} }
inline double Random(double a, double b) double Random(double a, double b)
{ {
std::uniform_real_distribution<> dis(a, b); std::uniform_real_distribution<> dis(a, b);
return dis(Global.random_engine); return dis(Global.random_engine);