From ef008c0646c70abb1818595ad3df6978f1d5ff4e Mon Sep 17 00:00:00 2001 From: Lee Salzman Date: Sun, 23 Dec 2007 03:11:23 +0000 Subject: [PATCH] *** empty log message *** git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@1472 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/clientgame.cpp | 6 ++++-- source/src/command.cpp | 3 ++- source/src/console.h | 2 ++ source/src/entity.h | 4 +++- source/src/renderhud.cpp | 2 +- source/src/sound.cpp | 2 +- 6 files changed, 13 insertions(+), 6 deletions(-) diff --git a/source/src/clientgame.cpp b/source/src/clientgame.cpp index c4814f91..409b73df 100644 --- a/source/src/clientgame.cpp +++ b/source/src/clientgame.cpp @@ -132,7 +132,8 @@ void deathstate(playerent *pl) { pl->state = CS_DEAD; pl->lastpain = pl->lastaction = lastmillis; - pl->move = pl->pitch = pl->strafe = pl->roll = 0; + pl->move = pl->strafe = 0; + pl->pitch = pl->roll = 0; pl->attacking = false; if(pl == player1) @@ -833,4 +834,5 @@ COMMAND(followplayer, ARG_1INT); COMMAND(toggledeathcam, ARG_NONE); int isalive() { return player1->state==CS_ALIVE ? 1 : 0; } -COMMANDN(alive, isalive, ARG_1EXP); \ No newline at end of file +COMMANDN(alive, isalive, ARG_1EXP); + diff --git a/source/src/command.cpp b/source/src/command.cpp index 1df7de69..2e490b3e 100644 --- a/source/src/command.cpp +++ b/source/src/command.cpp @@ -402,4 +402,5 @@ void scriptcontext(char *context, char *idname) void sealcontexts() { contextsealed = true; } COMMAND(scriptcontext, ARG_2STR); -COMMAND(sealcontexts, ARG_NONE); \ No newline at end of file +COMMAND(sealcontexts, ARG_NONE); + diff --git a/source/src/console.h b/source/src/console.h index 37ae687a..09cedfce 100644 --- a/source/src/console.h +++ b/source/src/console.h @@ -23,6 +23,8 @@ struct consolebuffer } } + virtual ~consolebuffer() {} + virtual void render() = 0; }; diff --git a/source/src/entity.h b/source/src/entity.h index 052d7dd4..ae1364cd 100644 --- a/source/src/entity.h +++ b/source/src/entity.h @@ -95,7 +95,6 @@ struct physent float maxspeed; // cubes per second, 24 for player int timeinair; // used for fake gravity float radius, eyeheight, aboveeye; // bounding box size - virtual float dyneyeheight() { return crouching ? eyeheight*3.0f/4.0f : eyeheight; } bool inwater; bool onfloor, onladder, jumpnext, crouching; char move, strafe; @@ -106,6 +105,7 @@ struct physent { reset(); } + virtual ~physent() {} void reset() { @@ -114,6 +114,8 @@ struct physent timeinair = 0; onfloor = onladder = inwater = jumpnext = crouching = false; } + + virtual float dyneyeheight() { return crouching ? eyeheight*3.0f/4.0f : eyeheight; } }; struct dynent : physent // animated ent diff --git a/source/src/renderhud.cpp b/source/src/renderhud.cpp index 08ebf4f2..f933e47b 100644 --- a/source/src/renderhud.cpp +++ b/source/src/renderhud.cpp @@ -175,7 +175,7 @@ struct hudmessages : consolebuffer { cline &c = conlines[i]; int tw = text_width(c.cref); - draw_text(c.cref, tw > VIRTW*0.8f ? 0 : (VIRTW*0.8f-tw)/2, ((VIRTH*0.8f)/4*3)+FONTH*i+pow((lastmillis-c.millis)/(float)dispmillis, 4)*VIRTH*0.8f/4.0f); + draw_text(c.cref, int(tw > VIRTW*0.8f ? 0 : (VIRTW*0.8f-tw)/2), int(((VIRTH*0.8f)/4*3)+FONTH*i+pow((lastmillis-c.millis)/(float)dispmillis, 4)*VIRTH*0.8f/4.0f)); } } }; diff --git a/source/src/sound.cpp b/source/src/sound.cpp index 3c5083ff..f1cbcefe 100644 --- a/source/src/sound.cpp +++ b/source/src/sound.cpp @@ -291,7 +291,7 @@ void checkplayerloopsounds() // sync to model animation int basetime = -((int)(size_t)p&0xFFF); int time = lastmillis-basetime; - int speed = 1860/p->maxspeed; + int speed = int(1860/p->maxspeed); // TODO: share with model code if(time%speed < footstepalign) playsound(S_FOOTSTEPS, p); }