From 5ad9d2a9ec89a271aee0d21f6a97c86bd3ef8203 Mon Sep 17 00:00:00 2001 From: Lee Salzman Date: Tue, 3 Apr 2007 20:17:45 +0000 Subject: [PATCH] *** empty log message *** git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@908 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/clientgame.cpp | 2 ++ source/src/console.cpp | 12 +++++++----- source/src/renderhud.cpp | 10 +++++----- source/src/rendermodel.cpp | 33 --------------------------------- source/src/weapon.cpp | 33 +++++++++++++++++++++++++++++++++ 5 files changed, 47 insertions(+), 43 deletions(-) diff --git a/source/src/clientgame.cpp b/source/src/clientgame.cpp index 7d335786..5b6c2fa3 100644 --- a/source/src/clientgame.cpp +++ b/source/src/clientgame.cpp @@ -146,9 +146,11 @@ botent *newbotent() // create a new blank player loopv(players) if(i!=getclientnum() && !players[i]) { players[i] = d; + d->clientnum = i; return d; } if(players.length()==getclientnum()) players.add(NULL); + d->clientnum = players.length(); players.add(d); return d; } diff --git a/source/src/console.cpp b/source/src/console.cpp index eb11c594..4fd44248 100644 --- a/source/src/console.cpp +++ b/source/src/console.cpp @@ -40,13 +40,15 @@ void conline(const char *sf, bool highlight) // add a line to the console } } +const int CONSPAD = FONTH/3; + void conoutf(const char *s, ...) { s_sprintfdv(sf, s); puts(sf); s = sf; int n = 0, visible; - while((visible = text_visible(s, (VIRTW-VIRTH/6-10-FONTH)*2))) // cut strings to fit on screen + while((visible = text_visible(s, VIRTW*2-2*CONSPAD-2*FONTH/3))) // cut strings to fit on screen { const char *newline = (const char *)memchr(s, '\n', visible); if(newline) visible = newline+1-s; @@ -73,11 +75,11 @@ void renderconsole() // render buffer taking into { if(fullconsole) { - int w = VIRTW*4/3, h = VIRTH*4/3; - int numl = h/2/(FONTH*5/4); + int w = VIRTW*2, h = VIRTH*2; + int numl = (h*2/5)/(FONTH*5/4); int offset = min(conskip, max(conlines.length() - numl, 0)); - blendbox(0, 0, w, (numl+1)*FONTH*5/4, true); - loopi(numl) draw_text(offset+i>=conlines.length() ? "" : conlines[offset+i].cref, FONTH/3, (FONTH*5/4)*(numl-i-1)+FONTH/3); + blendbox(CONSPAD, CONSPAD, w-CONSPAD, CONSPAD+(numl+1)*FONTH*5/4, true); + loopi(numl) draw_text(offset+i>=conlines.length() ? "" : conlines[offset+i].cref, CONSPAD+FONTH/3, CONSPAD+(FONTH*5/4)*(numl-i-1)+FONTH/3); } else { diff --git a/source/src/renderhud.cpp b/source/src/renderhud.cpp index a3ab0b2e..3e41fcb6 100644 --- a/source/src/renderhud.cpp +++ b/source/src/renderhud.cpp @@ -251,16 +251,16 @@ void gl_drawhud(int w, int h, int curfps, int nquads, int curvert, bool underwat if(!hideradar) drawradar(w, h); + char *infostr = editinfo(); + if(getcurcommand()) rendercommand(20, 1570); + else if(infostr) draw_text(infostr, 20, 1570); + else if(targetplayer) draw_text(targetplayer->name, 20, 1570); + glPopMatrix(); glPushMatrix(); glOrtho(0, VIRTW*2, VIRTH*2, 0, -1, 1); - char *infostr = editinfo(); - if(getcurcommand()) rendercommand(40, 3140); - else if(infostr) draw_text(infostr, 40, 3140); - else if(targetplayer) draw_text(targetplayer->name, 40, 3140); - renderconsole(); if(!hidestats) { diff --git a/source/src/rendermodel.cpp b/source/src/rendermodel.cpp index 77e783d6..12064d42 100644 --- a/source/src/rendermodel.cpp +++ b/source/src/rendermodel.cpp @@ -245,36 +245,3 @@ void renderclients() if(player1->state==CS_DEAD) renderplayer(player1); } -void renderbounceents() -{ - loopv(bounceents) - { - bounceent *p = bounceents[i]; - if(!p) continue; - string model; - float z = p->o.z; - - switch(p->bouncestate) - { - case NADE_THROWED: - s_strcpy(model, "weapons/grenade/static"); - break; - case GIB: - default: - { - uint n = (((4*(uint)(size_t)p)+(uint)p->timetolife)%3)+1; - s_sprintf(model)("misc/gib0%u", n); - int t = lastmillis-p->millis; - if(t>p->timetolife-2000) - { - t -= p->timetolife-2000; - z -= t*t/4000000000.0f*t; - } - break; - } - } - path(model); - rendermodel(model, ANIM_MAPMODEL|ANIM_LOOP, 0, 1.1f, p->o.x, z, p->o.y, p->yaw, p->pitch, 10.0f); - } -} - diff --git a/source/src/weapon.cpp b/source/src/weapon.cpp index 0cb0f2b9..c575921f 100644 --- a/source/src/weapon.cpp +++ b/source/src/weapon.cpp @@ -380,6 +380,39 @@ void clearbounceents() loopv(bounceents) if(bounceents[i]) { delete bounceents[i]; bounceents.remove(i); } } +void renderbounceents() +{ + loopv(bounceents) + { + bounceent *p = bounceents[i]; + if(!p) continue; + string model; + float z = p->o.z; + + switch(p->bouncestate) + { + case NADE_THROWED: + s_strcpy(model, "weapons/grenade/static"); + break; + case GIB: + default: + { + uint n = (((4*(uint)(size_t)p)+(uint)p->timetolife)%3)+1; + s_sprintf(model)("misc/gib0%u", n); + int t = lastmillis-p->millis; + if(t>p->timetolife-2000) + { + t -= p->timetolife-2000; + z -= t*t/4000000000.0f*t; + } + break; + } + } + path(model); + rendermodel(model, ANIM_MAPMODEL|ANIM_LOOP, 0, 1.1f, p->o.x, z, p->o.y, p->yaw, p->pitch, 10.0f); + } +} + VARP(gibnum, 0, 6, 1000); VARP(gibttl, 0, 5000, 15000); VARP(gibspeed, 1, 30, 100);