X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=Source%2FGameDraw.cpp;h=f2c59ae71e7361e9061b92afb85c10cd9c84558e;hb=d37fbfc90748851561e9ebee88a274985a1f1546;hp=e3cd41b028fcc9783ed9f9618a260fad5bcd3e38;hpb=0cca0c495c7dc29d134a10d7eed5de1f377c99bf;p=lugaru.git diff --git a/Source/GameDraw.cpp b/Source/GameDraw.cpp index e3cd41b..f2c59ae 100644 --- a/Source/GameDraw.cpp +++ b/Source/GameDraw.cpp @@ -15,8 +15,12 @@ extern float fadestart; extern float screenwidth,screenheight; #ifdef WIN32 extern HDC hDC; -#else +#elif PLATFORM_MACOSX extern AGLContext gaglContext; +#elif USE_SDL +extern SDL_Surface *sdlscreen; +#else +#error please define your platform. #endif extern int kTextureSize; extern FRUSTUM frustum; @@ -162,6 +166,12 @@ extern FSOUND_SAMPLE *samp[100]; extern int channels[100]; extern "C" void PlaySoundEx(int channel, FSOUND_SAMPLE *sptr, FSOUND_DSPUNIT *dsp, signed char startpaused); +#ifdef __GNUC__ +#define LONGLONGCONST(x) (x##ll) +#else +#define LONGLONGCONST(x) (x) +#endif + /*********************> DrawGLScene() <*****/ long long Game::MD5_string (char *string){ char temp[256]=""; @@ -178,14 +188,14 @@ long long Game::MD5_string (char *string){ i++; } - num=abs(num); + num=longlongabs(num); if(num==0)num+=1452; - while(num<5000000000000000){ + while(num9900000000000000){ + while(num>LONGLONGCONST(9900000000000000)){ num/=1.235421521; } @@ -282,7 +292,7 @@ int Game::DrawGLScene(GLvoid) color2.red=0; color2.green=0; color2.blue=0; -#ifndef WIN32 +#if PLATFORM_MACOSX DSpContext_FadeGamma(NULL,200,&color2); #endif } @@ -3948,8 +3958,12 @@ int Game::DrawGLScene(GLvoid) if(drawmode!=motionblurmode||mainmenu){ #ifdef WIN32 if(drawmode!=motionblurmode) SwapBuffers( hDC); -#else +#elif PLATFORM_MACOSX if(drawmode!=motionblurmode)aglSwapBuffers(gaglContext); // send swap command +#elif USE_SDL + if(drawmode!=motionblurmode)SDL_GL_SwapBuffers(); +#else + #error define your platform. #endif // send swap command }