*** empty log message ***
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@908 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user