*** empty log message ***

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@690 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
Lee Salzman
2006-11-16 18:02:41 +00:00
parent 3f9b7af2ac
commit b697f9adeb
7 changed files with 16 additions and 19 deletions
-3
View File
@@ -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 <dlfcn.h>
#endif
+3 -3
View File
@@ -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.type<I_CLIPS || e.type>I_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;
+5 -5
View File
@@ -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)));
+3 -3
View File
@@ -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
+2 -2
View File
@@ -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)
{
+2 -2
View File
@@ -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);
};
+1 -1
View File
@@ -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;
}