X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=Source%2FOpenGL_Windows.cpp;h=365e48a900e7e9eb37f49e6b8aad2d26952331ca;hb=1aef858f5ecb3dc8fd816e0155635371ed3632f2;hp=2510aa675d08a60657f46d9fe1c7bec542c322a2;hpb=1df9856bb875811f00e685eb185c54fd0a828276;p=lugaru.git diff --git a/Source/OpenGL_Windows.cpp b/Source/OpenGL_Windows.cpp index 2510aa6..365e48a 100644 --- a/Source/OpenGL_Windows.cpp +++ b/Source/OpenGL_Windows.cpp @@ -70,9 +70,7 @@ extern float terraindetail; extern float texdetail; extern bool osx; -extern int numplayers; extern bool freeze; -extern Person player[maxplayers]; extern bool stillloading; extern int mainmenu; /*extern*/ bool gameFocused; @@ -230,8 +228,6 @@ Boolean SetUp (Game & game) LOGFUNC; - randSeed = UpTime().lo; - osx = 0; cellophane=0; texdetail=4; @@ -415,7 +411,7 @@ Boolean SetUp (Game & game) static void DoMouse(Game & game) { - if(mainmenu||(abs(game.deltah)<10*realmultiplier*1000&&abs(game.deltav)<10*realmultiplier*1000)) + if(mainmenu|| ( (abs(game.deltah)<10*realmultiplier*1000) && (abs(game.deltav)<10*realmultiplier*1000) )) { game.deltah *= usermousesensitivity; game.deltav *= usermousesensitivity; @@ -482,7 +478,6 @@ void DoUpdate (Game & game) count = multiplier*sps; if(count<2)count=2; - //if(count>10)count=10; realmultiplier=multiplier; multiplier*=gamespeed; @@ -490,9 +485,7 @@ void DoUpdate (Game & game) if(difficulty==0)multiplier*=.8; if(game.loading==4)multiplier*=.00001; - //multiplier*.9; if(slomo&&!mainmenu)multiplier*=slomospeed; - //if(freeze)multiplier*=0.00001; oldmult=multiplier; multiplier/=(float)count; @@ -569,29 +562,6 @@ static bool IsFocused() } -static void launch_web_browser(const char *url) -{ -#ifdef WIN32 - ShellExecute(NULL, "open", url, NULL, NULL, SW_SHOWNORMAL); - -#elif (defined(__APPLE__) && defined(__MACH__)) - const char *fmt = "open '%s'"; - const size_t len = strlen(fmt) + strlen(url) + 16; - char *buf = new char[len]; - snprintf(buf, len, fmt, url); - system(buf); - delete[] buf; - -#elif PLATFORM_LINUX - const char *fmt = "PATH=$PATH:. xdg-open '%s'"; - const size_t len = strlen(fmt) + strlen(url) + 16; - char *buf = new char[len]; - snprintf(buf, len, fmt, url); - system(buf); - delete[] buf; -#endif -} - #ifndef WIN32 // (code lifted from physfs: http://icculus.org/physfs/ ... zlib license.) @@ -775,7 +745,7 @@ int main(int argc, char **argv) pgame = 0; CleanUp (); - + return 0; } catch (const std::exception& error) @@ -799,62 +769,6 @@ int main(int argc, char **argv) // -------------------------------------------------------------------------- -extern int channels[100]; -extern OPENAL_SAMPLE * samp[100]; -extern OPENAL_STREAM * strm[20]; - -extern "C" void PlaySoundEx(int chan, OPENAL_SAMPLE *sptr, OPENAL_DSPUNIT *dsp, signed char startpaused) -{ - const OPENAL_SAMPLE * currSample = OPENAL_GetCurrentSample(channels[chan]); - if (currSample && currSample == samp[chan]) - { - if (OPENAL_GetPaused(channels[chan])) - { - OPENAL_StopSound(channels[chan]); - channels[chan] = OPENAL_FREE; - } - else if (OPENAL_IsPlaying(channels[chan])) - { - int loop_mode = OPENAL_GetLoopMode(channels[chan]); - if (loop_mode & OPENAL_LOOP_OFF) - { - channels[chan] = OPENAL_FREE; - } - } - } - else - { - channels[chan] = OPENAL_FREE; - } - - channels[chan] = OPENAL_PlaySoundEx(channels[chan], sptr, dsp, startpaused); - if (channels[chan] < 0) - { - channels[chan] = OPENAL_PlaySoundEx(OPENAL_FREE, sptr, dsp, startpaused); - } -} - -extern "C" void PlayStreamEx(int chan, OPENAL_STREAM *sptr, OPENAL_DSPUNIT *dsp, signed char startpaused) -{ - const OPENAL_SAMPLE * currSample = OPENAL_GetCurrentSample(channels[chan]); - if (currSample && currSample == OPENAL_Stream_GetSample(sptr)) - { - OPENAL_StopSound(channels[chan]); - OPENAL_Stream_Stop(sptr); - } - else - { - OPENAL_Stream_Stop(sptr); - channels[chan] = OPENAL_FREE; - } - - channels[chan] = OPENAL_Stream_PlayEx(channels[chan], sptr, dsp, startpaused); - if (channels[chan] < 0) - { - channels[chan] = OPENAL_Stream_PlayEx(OPENAL_FREE, sptr, dsp, startpaused); - } -} - bool LoadImage(const char * fname, TGAImageRec & tex) {