Skip to content

Commit

Permalink
Fix double to float assignments by forcing fixed numbers to float.
Browse files Browse the repository at this point in the history
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@698 4a71c877-e1ca-e34f-864e-861f7616d084
  • Loading branch information
devurandom committed Sep 8, 2006
1 parent dcd97ac commit 78be6bc
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion lib/framework/SDL_framerate.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ void SDL_initFramerate(FPSmanager * manager)
*/
manager->framecount = 0;
manager->rate = FPS_DEFAULT;
manager->rateticks = (1000.0 / (float) FPS_DEFAULT);
manager->rateticks = (1000.0f / (float) FPS_DEFAULT);
manager->lastticks = SDL_GetTicks();
}

Expand Down
8 changes: 4 additions & 4 deletions lib/ivis_opengl/piedraw.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,10 @@ static BOOL shadows = FALSE;

void pie_BeginLighting(float x, float y, float z) {
float pos[4];
float zero[4] = {0, 0, 0, 0};
float ambient[4] = {0.2, 0.2, 0.2, 0};
float diffuse[4] = {0.5, 0.5, 0.5, 0};
float specular[4] = {1, 1, 1, 0};
float zero[4] = {0.0f, 0.0f, 0.0f, 0.0f};
float ambient[4] = {0.2f, 0.2f, 0.2f, 0.0f};
float diffuse[4] = {0.5f, 0.5f, 0.5f, 0.0f};
float specular[4] = {1.0f, 1.0f, 1.0f, 0.0f};

pos[0] = x;
pos[1] = y;
Expand Down
10 changes: 5 additions & 5 deletions lib/ivis_opengl/piestate.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@ void pie_SetFogStatus(BOOL val)

if (rendStates.fog) {
fog.argb = pie_GetFogColour();
fog_colour[0] = fog.byte.r/255.0;
fog_colour[1] = fog.byte.g/255.0;
fog_colour[2] = fog.byte.b/255.0;
fog_colour[3] = fog.byte.a/255.0;
fog_colour[0] = fog.byte.r/255.0f;
fog_colour[1] = fog.byte.g/255.0f;
fog_colour[2] = fog.byte.b/255.0f;
fog_colour[3] = fog.byte.a/255.0f;

glFogi(GL_FOG_MODE, GL_LINEAR);
glFogfv(GL_FOG_COLOR, fog_colour);
Expand Down Expand Up @@ -132,7 +132,7 @@ void pie_SetColourKeyedBlack(BOOL keyingOn)

if (keyingOn == TRUE) {
glEnable(GL_ALPHA_TEST);
glAlphaFunc(GL_GREATER, 0.1);
glAlphaFunc(GL_GREATER, 0.1f);
} else {
glDisable(GL_ALPHA_TEST);
}
Expand Down
2 changes: 1 addition & 1 deletion src/display3d.c
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,7 @@ void drawTiles(iView *camera, iView *player)
pie_MatRotY(player->r.y);
/* Translate */
pie_TRANSLATE(-rx,-player->p.y,rz);
angle += 0.01;
angle += 0.01f;
// RODZ uncomment the following line to see an OpenGL lighting demo
if (getDrawShadows()) {
pie_BeginLighting(50, -300, -300);
Expand Down

0 comments on commit 78be6bc

Please sign in to comment.