more compiler warning cleanup.

This commit is contained in:
wrenczes@gmail.com
2011-06-02 05:48:37 +00:00
parent 382fb5969d
commit 4018d17370
3 changed files with 15 additions and 16 deletions
+10 -11
View File
@@ -88,22 +88,22 @@ class SdlApp {
if ((GLfloat)width / (GLfloat)height <= ACTUAL_RATIO) if ((GLfloat)width / (GLfloat)height <= ACTUAL_RATIO)
{ {
viewPort.x = 0; viewPort.x = 0;
viewPort.y = -((width/ACTUAL_RATIO)-height)/2; viewPort.y = -(static_cast<int>(width / ACTUAL_RATIO) - height) / 2;
viewPort.w = width; viewPort.w = width;
viewPort.h = width / ACTUAL_RATIO; viewPort.h = static_cast<int>(width / ACTUAL_RATIO);
} }
else else
{ {
viewPort.x = -(height*ACTUAL_RATIO-width)/2; viewPort.x = -(static_cast<int>(height * ACTUAL_RATIO) - width) / 2;
viewPort.y = 0; viewPort.y = 0;
viewPort.w = height * ACTUAL_RATIO; viewPort.w = static_cast<int>(height * ACTUAL_RATIO);
viewPort.h = height; viewPort.h = height;
} }
glViewport(viewPort.x, viewPort.y, viewPort.w, viewPort.h); glViewport(viewPort.x, viewPort.y, viewPort.w, viewPort.h);
JRenderer::GetInstance()->SetActualWidth(viewPort.w); JRenderer::GetInstance()->SetActualWidth(static_cast<float>(viewPort.w));
JRenderer::GetInstance()->SetActualHeight(viewPort.h); JRenderer::GetInstance()->SetActualHeight(static_cast<float>(viewPort.h));
glScissor(0, 0, width, height); glScissor(0, 0, width, height);
#if (!defined GL_ES_VERSION_2_0) && (!defined GL_VERSION_2_0) #if (!defined GL_ES_VERSION_2_0) && (!defined GL_VERSION_2_0)
@@ -331,11 +331,10 @@ void DestroyGame(void)
g_engine = NULL; g_engine = NULL;
} }
void SdlApp::OnUpdate() { void SdlApp::OnUpdate()
static int tickCount; {
Uint32 dt; static int tickCount = JGEGetTime();
tickCount = JGEGetTime(); int64_t dt = (tickCount - lastTickCount);
dt = (tickCount - lastTickCount);
lastTickCount = tickCount; lastTickCount = tickCount;
if(g_engine->IsDone()) { if(g_engine->IsDone()) {
+4 -4
View File
@@ -32,7 +32,7 @@ void JMusic::Update(){
int JMusic::getPlayTime(){ int JMusic::getPlayTime(){
#ifdef WITH_FMOD #ifdef WITH_FMOD
return FSOUND_GetCurrentPosition(JSoundSystem::GetInstance()->mChannel)/44.1; //todo more generic, here it's only 44kHz return static_cast<int>(FSOUND_GetCurrentPosition(JSoundSystem::GetInstance()->mChannel) / 44.1); //todo more generic, here it's only 44kHz
#else #else
return 0; return 0;
#endif #endif
@@ -238,7 +238,7 @@ void JSoundSystem::SetVolume(int volume)
void JSoundSystem::SetMusicVolume(int volume) void JSoundSystem::SetMusicVolume(int volume)
{ {
#ifdef WITH_FMOD #ifdef WITH_FMOD
if (mChannel != FSOUND_FREE) FSOUND_SetVolumeAbsolute(mChannel,volume * 2.55); if (mChannel != FSOUND_FREE) FSOUND_SetVolumeAbsolute(mChannel, static_cast<int>(volume * 2.55));
#endif #endif
mVolume = volume; mVolume = volume;
} }
@@ -247,7 +247,7 @@ void JSoundSystem::SetSfxVolume(int volume){
//this sets the volume to all channels then reverts back the volume for music.. //this sets the volume to all channels then reverts back the volume for music..
//that's a bit dirty but it works //that's a bit dirty but it works
#ifdef WITH_FMOD #ifdef WITH_FMOD
FSOUND_SetVolumeAbsolute(FSOUND_ALL, volume * 2.55); FSOUND_SetVolumeAbsolute(FSOUND_ALL, static_cast<int>(volume * 2.55));
#endif #endif
mSampleVolume = volume; mSampleVolume = volume;
SetMusicVolume(mVolume); SetMusicVolume(mVolume);
@@ -305,7 +305,7 @@ void JSoundSystem::PlaySample(JSample *sample)
#ifdef WITH_FMOD #ifdef WITH_FMOD
if (sample && sample->mSample){ if (sample && sample->mSample){
int channel = FSOUND_PlaySound(FSOUND_FREE, sample->mSample); int channel = FSOUND_PlaySound(FSOUND_FREE, sample->mSample);
FSOUND_SetVolumeAbsolute(channel,mSampleVolume * 2.55); FSOUND_SetVolumeAbsolute(channel, static_cast<int>(mSampleVolume * 2.55));
} }
#endif #endif
#endif #endif
+1 -1
View File
@@ -126,7 +126,7 @@ u32 ramAvailable(void);
#ifdef WIN32 #ifdef WIN32
#include <direct.h> #include <direct.h>
#define MAKEDIR(name) mkdir(name) #define MAKEDIR(name) _mkdir(name)
#else #else
#include <sys/stat.h> #include <sys/stat.h>
#define MAKEDIR(name) mkdir(name, 0777) #define MAKEDIR(name) mkdir(name, 0777)