X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=Source%2FOpenGL_Windows.cpp;h=5dbf5c4548616f93e4c6841e9029f28f6d776497;hb=14a1f983de1723c52b252c161997651cecbef2e1;hp=36998186c323d4351157336184096481115cedd5;hpb=705156dced26432e41deada8d9811c05d52b44ce;p=lugaru.git diff --git a/Source/OpenGL_Windows.cpp b/Source/OpenGL_Windows.cpp index 3699818..5dbf5c4 100644 --- a/Source/OpenGL_Windows.cpp +++ b/Source/OpenGL_Windows.cpp @@ -230,8 +230,6 @@ Boolean SetUp (Game & game) LOGFUNC; - randSeed = UpTime().lo; - osx = 0; cellophane=0; texdetail=4; @@ -566,29 +564,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.) @@ -772,7 +747,7 @@ int main(int argc, char **argv) pgame = 0; CleanUp (); - + return 0; } catch (const std::exception& error) @@ -796,62 +771,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) {