From b697f9adeb076e3c251b663cad93302df23bf355 Mon Sep 17 00:00:00 2001 From: Lee Salzman Date: Thu, 16 Nov 2006 18:02:41 +0000 Subject: [PATCH] *** empty log message *** git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@690 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/cube.h | 3 --- source/src/entities.cpp | 6 +++--- source/src/hudgun.cpp | 10 +++++----- source/src/rendercubes.cpp | 6 +++--- source/src/renderextras.cpp | 4 ++-- source/src/rendergl.cpp | 4 ++-- source/src/rndmap.cpp | 2 +- 7 files changed, 16 insertions(+), 19 deletions(-) diff --git a/source/src/cube.h b/source/src/cube.h index 9f27931b..ea4bb133 100644 --- a/source/src/cube.h +++ b/source/src/cube.h @@ -23,13 +23,10 @@ #endif #ifdef WIN32 - #define strcasecmp strcmp // fixme #define WIN32_LEAN_AND_MEAN #include "windows.h" #define _WINDOWS #define ZLIB_DLL - #define cos(x) cos((float)(x)) - #define sin(x) sin((float)(x)) #else #include #endif diff --git a/source/src/entities.cpp b/source/src/entities.cpp index b755e2f5..1b1774a6 100644 --- a/source/src/entities.cpp +++ b/source/src/entities.cpp @@ -45,7 +45,7 @@ void renderentities() { if(f.actor == player1) continue; s_sprintfd(path)("pickups/flags/small_%s", rb_team_string(e.attr2)); - rendermodel(path, ANIM_FLAG|ANIM_START, 0, 1.1f, f.actor->o.x, f.actor->o.z+0.3f+(sin(lastmillis/100.0f)+1)/10, f.actor->o.y, lastmillis/2.5f, 0, 120.0f); + rendermodel(path, ANIM_FLAG|ANIM_START, 0, 1.1f, f.actor->o.x, f.actor->o.z+0.3f+(sinf(lastmillis/100.0f)+1)/10, f.actor->o.y, lastmillis/2.5f, 0, 120.0f); } else { @@ -60,7 +60,7 @@ void renderentities() { if(!e.spawned) continue; if(e.typeI_AKIMBO) continue; - renderent(e, entmdlnames[e.type-I_CLIPS], (float)(1+sin(lastmillis/100.0+e.x+e.y)/20), lastmillis/10.0f); + renderent(e, entmdlnames[e.type-I_CLIPS], (float)(1+sinf(lastmillis/100.0+e.x+e.y)/20), lastmillis/10.0f); } else switch(e.attr2) { @@ -71,7 +71,7 @@ void renderentities() case 2: case 0: if(!e.spawned) continue; - renderent(e, "carrot", (float)(1+sin(lastmillis/100.0+e.x+e.y)/20), lastmillis/(e.attr2 ? 1.0f : 10.0f)); + renderent(e, "carrot", (float)(1+sinf(lastmillis/100.0+e.x+e.y)/20), lastmillis/(e.attr2 ? 1.0f : 10.0f)); break; case 4: renderent(e, "switch2", 3, (float)e.attr3*90, triggeranim(e), triggertime); break; diff --git a/source/src/hudgun.cpp b/source/src/hudgun.cpp index bc988340..8a1839c2 100644 --- a/source/src/hudgun.cpp +++ b/source/src/hudgun.cpp @@ -33,14 +33,14 @@ struct weaponmove anim = ANIM_GUN_RELOAD; float percent_done = (float)(timediff)*100.0f/(float) WEAPONCHANGE_TIME; if(percent_done>=100 || percent_done<0) percent_done = 100; - k_rot = -(sin((float)(percent_done*2/100.0f*90.0f)*PI/180.0f)*90); + k_rot = -(sinf((float)(percent_done*2/100.0f*90.0f)*PI/180.0f)*90); } else if(player1->reloading) { anim = ANIM_GUN_RELOAD; float percent_done = (float)(timediff)*100.0f/(float)rtime; if(percent_done>=100 || percent_done<0) percent_done = 100; - k_rot = -(sin((float)(percent_done*2/100.0f*90.0f)*PI/180.0f)*90); + k_rot = -(sinf((float)(percent_done*2/100.0f*90.0f)*PI/180.0f)*90); } else { @@ -53,7 +53,7 @@ struct weaponmove percent_done = timediff*100.0f/(float)animtime; if(percent_done > 100.0f) percent_done = 100.0f; // f(x) = -sin(x-1.5)^3 - kick = -sin(pow((1.5f/100.0f*percent_done)-1.5f,3)); + kick = -sinf(pow((1.5f/100.0f*percent_done)-1.5f,3)); }; if(player1->lastaction && player1->lastattackgun==player1->gunselect) @@ -69,8 +69,8 @@ struct weaponmove k_back = kick_back(player1->gunselect)*kick/10; }; - float swayspeed = (float) (sin((float)lastmillis/swayspeeddiv))/(swaymovediv/10.0f); - float swayupspeed = (float) (sin((float)lastmillis/swayupspeeddiv-90))/(swayupmovediv/10.0f); + float swayspeed = (float) (sinf((float)lastmillis/swayspeeddiv))/(swaymovediv/10.0f); + float swayupspeed = (float) (sinf((float)lastmillis/swayupspeeddiv-90))/(swayupmovediv/10.0f); float plspeed = min(1.0f, sqrt(fabs(player1->vel.x*player1->vel.x) + fabs(player1->vel.y*player1->vel.y))); diff --git a/source/src/rendercubes.cpp b/source/src/rendercubes.cpp index 067d180d..f0592c58 100644 --- a/source/src/rendercubes.cpp +++ b/source/src/rendercubes.cpp @@ -267,11 +267,11 @@ VARF(waterlevel, -128, -128, 127, if(!noteditmode()) hdr.waterlevel = waterlevel inline void vertw(int v1, float v2, int v3, float t1, float t2, float t) { glTexCoord2f(t1, t2); - glVertex3f((float)v1, v2-(float)sin(v1*v3*0.1+t)*0.2f, (float)v3); + glVertex3f((float)v1, v2-sinf(v1*v3*0.1+t)*0.2f, (float)v3); }; -inline float dx(float x) { return x+(float)sin(x*2+lastmillis/1000.0f)*0.04f; }; -inline float dy(float x) { return x+(float)sin(x*2+lastmillis/900.0f+PI/5)*0.05f; }; +inline float dx(float x) { return x+sinf(x*2+lastmillis/1000.0f)*0.04f; }; +inline float dy(float x) { return x+sinf(x*2+lastmillis/900.0f+PI/5)*0.05f; }; // renders water for bounding rect area that contains water... simple but very inefficient diff --git a/source/src/renderextras.cpp b/source/src/renderextras.cpp index ff281142..aad66ec0 100644 --- a/source/src/renderextras.cpp +++ b/source/src/renderextras.cpp @@ -472,7 +472,7 @@ void gl_drawhud(int w, int h, int curfps, int nquads, int curvert, bool underwat glPushMatrix(); glOrtho(0, VIRTW/2, VIRTH/2, 0, -1, 1); glBlendFunc(GL_SRC_ALPHA, GL_ONE); - glColor4f(1.0f, 1.0f, 1.0f, (float)(sin(lastmillis / 100.0) + 1) / 2); + glColor4f(1.0f, 1.0f, 1.0f, (sinf(lastmillis / 100.0f) + 1.0f) / 2.0f); glEnable(GL_BLEND); drawicon((float)(rb_opposite(rb_team_int(player1->team))*128*ctf_scl),(float)(128*ctf_scl), 1065, VIRTH/2/3*2, flagtex, 1.0/2.0); glPopMatrix(); @@ -484,7 +484,7 @@ void gl_drawhud(int w, int h, int curfps, int nquads, int curvert, bool underwat glDisable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - glColor4f(1.0f, 1.0f, 1.0f, (float) 0.2f+(sin(lastmillis/100)+1)/2); + glColor4f(1.0f, 1.0f, 1.0f, 0.2f+(sinf(lastmillis/100.0f)+1.0f)/2.0f); if(player1->health <= 20 && !m_osok) { diff --git a/source/src/rendergl.cpp b/source/src/rendergl.cpp index b477fc3b..979c8c05 100644 --- a/source/src/rendergl.cpp +++ b/source/src/rendergl.cpp @@ -361,8 +361,8 @@ void gl_drawframe(int w, int h, float changelod, float curfps) if(underwater) { - fovy += (float)sin(lastmillis/1000.0)*2.0f; - aspect += (float)sin(lastmillis/1000.0+PI)*0.1f; + fovy += sinf(lastmillis/1000.0f)*2.0f; + aspect += sinf(lastmillis/1000.0f+PI)*0.1f; glFogi(GL_FOG_START, 0); glFogi(GL_FOG_END, (fog+96)/8); }; diff --git a/source/src/rndmap.cpp b/source/src/rndmap.cpp index 5b56a61c..6dd695ee 100644 --- a/source/src/rndmap.cpp +++ b/source/src/rndmap.cpp @@ -20,7 +20,7 @@ float smoothednoise(int x, int y, int seed) float interpolate(float a, float b, float x) { float ft = x*3.1415927f; - float f = (1.0f-(float)cos(ft))*0.5f; + float f = (1.0f-cosf(ft))*0.5f; return a*(1-f)+b*f; }