From 245e9d8e3dbe10eef5ed45182c75d3de7438bb9e Mon Sep 17 00:00:00 2001 From: driAn Date: Sun, 20 Aug 2006 15:33:36 +0000 Subject: [PATCH] no message git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@344 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/clientgame.cpp | 5 ++-- source/src/entities.cpp | 4 +-- source/src/main.cpp | 3 ++ source/src/protos.h | 1 + source/src/renderextras.cpp | 57 ++++++++++++++++++++++++++++--------- source/src/rendergl.cpp | 3 +- source/src/rendermd3.cpp | 6 ---- source/src/savegamedemo.cpp | 5 ++-- source/src/weapon.cpp | 6 ++-- source/src/worldio.cpp | 1 + 10 files changed, 60 insertions(+), 31 deletions(-) diff --git a/source/src/clientgame.cpp b/source/src/clientgame.cpp index 74da09f5..a6625e59 100644 --- a/source/src/clientgame.cpp +++ b/source/src/clientgame.cpp @@ -139,7 +139,7 @@ void respawnself() void respawn() { - if(player1->state==CS_DEAD) + if(player1->state==CS_DEAD && lastmillis>player1->lastaction+3000) { player1->attacking = false; if(m_arena) { conoutf("waiting for new round to start..."); return; }; @@ -392,7 +392,8 @@ void attack(bool on) { if(intermission) return; if(editmode) editdrag(on); - else if(player1->attacking = on) respawn(); + else if(player1->state==CS_DEAD) respawn(); + else player1->attacking = on; }; void jumpn(bool on) { if(!intermission && (player1->jumpnext = on) ) respawn(); }; diff --git a/source/src/entities.cpp b/source/src/entities.cpp index 5385ae77..02f006cc 100644 --- a/source/src/entities.cpp +++ b/source/src/entities.cpp @@ -126,7 +126,7 @@ void realpickup(int n, dynent *d) player1->thrownademillis = 0; break; case I_HEALTH: - radditem(n, d->health, 7); + radditem(n, d->health, 7); break; case I_ARMOUR: radditem(n, d->armour, 8); @@ -146,7 +146,7 @@ void realpickup(int n, dynent *d) void additem(int i, int &v, int spawnsec, int t) { - if(vo.z; switch(p->state) { - case NADE_THROWED: - strcpy_s(model, "weapons/grenade/static"); - break; - case GIB: - default: - sprintf_s(model)("misc/gib0%i", (((int)p)%2)+1); - printf("%i\n", (((int)p)%3)+1); - break; + case NADE_THROWED: + strcpy_s(model, "weapons/grenade/static"); + break; + case GIB: + default: + sprintf_s(model)("misc/gib0%i", (((4*(int)p))%3)+1); + 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, 0, 1, 0, 0, p->o.x, p->o.z, p->o.y, p->yaw, p->pitch, false, 2.0f, 100.0f, 0, 0); + rendermodel(model, 0, 1, 0, 0, p->o.x, z, p->o.y, p->yaw, p->pitch, false, 2.0f, 100.0f, 0, 0); }; }; -VAR(numgibs, 0, 10, 100); +VAR(numgibs, 0, 6, 100); void addgib(dynent *d) { @@ -629,7 +633,7 @@ void addgib(dynent *d) physent *p = new_physent(); p->owner = d; p->millis = lastmillis; - p->timetolife = 4000; + p->timetolife = 5000+rnd(10)*100; p->state = GIB; p->isphysent = true; @@ -648,3 +652,30 @@ void addgib(dynent *d) } }; +void loadingscreen() +{ + glPushMatrix(); + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + glOrtho(0, VIRTW, VIRTH, 0, -1, 1); + + glDisable(GL_DEPTH_TEST); + glEnable(GL_TEXTURE_2D); + glDisable(GL_BLEND); + + glBindTexture(GL_TEXTURE_2D, 8); + glBegin(GL_QUADS); + + glTexCoord2f(0, 0); glVertex2i(0, 0); + glTexCoord2f(1, 0); glVertex2i(VIRTW, 0); + glTexCoord2f(1, 1); glVertex2i(VIRTW, VIRTH); + glTexCoord2f(0, 1); glVertex2i(0, VIRTH); + + glEnd(); + + SDL_GL_SwapBuffers(); + + glDisable(GL_TEXTURE_2D); + glDisable(GL_BLEND); + + glPopMatrix(); +} diff --git a/source/src/rendergl.cpp b/source/src/rendergl.cpp index f08e06dd..b136ac4a 100644 --- a/source/src/rendergl.cpp +++ b/source/src/rendergl.cpp @@ -298,7 +298,7 @@ void drawhudgun(int w, int h, float aspect, int farplane) glMatrixMode(GL_MODELVIEW); rendermd3gun(); - rendermenumdl(); // lazy bastard + rendermenumdl(); glMatrixMode(GL_PROJECTION); glLoadIdentity(); @@ -415,4 +415,3 @@ void gl_drawframe(int w, int h, float changelod, float curfps) glEnable(GL_CULL_FACE); glEnable(GL_FOG); }; - diff --git a/source/src/rendermd3.cpp b/source/src/rendermd3.cpp index a69bec14..2a37efda 100644 --- a/source/src/rendermd3.cpp +++ b/source/src/rendermd3.cpp @@ -423,12 +423,6 @@ struct weaponmove 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); } - /*else if(throwingnade && timediff>animtime+rtime/2 && timedifflastaction && player1->lastattackgun==player1->gunselect) - { - anim = MDL_GUN_IDLE; - float percent_done = (float)50.0f+(timediff-(animtime-rtime/2))*100.0f/rtime; - k_rot = -(sin((float)(percent_done*2/100.0f*90.0f)*PI/180.0f)*90); - }*/ else { vec sway = base; diff --git a/source/src/savegamedemo.cpp b/source/src/savegamedemo.cpp index 882019a2..77204647 100644 --- a/source/src/savegamedemo.cpp +++ b/source/src/savegamedemo.cpp @@ -342,9 +342,10 @@ void demoplaybackstep() void stopn() { if(demoplayback) stopreset(); else stop(); conoutf("demo stopped"); }; -COMMAND(record, ARG_1STR); +// sorry :/ +/*COMMAND(record, ARG_1STR); COMMAND(demo, ARG_1STR); -COMMANDN(stop, stopn, ARG_NONE); +COMMANDN(stop, stopn, ARG_NONE);*/ COMMAND(savegame, ARG_1STR); COMMAND(loadgame, ARG_1STR); diff --git a/source/src/weapon.cpp b/source/src/weapon.cpp index 11bd65dd..725b6758 100644 --- a/source/src/weapon.cpp +++ b/source/src/weapon.cpp @@ -443,7 +443,6 @@ void throw_nade(dynent *d, vec &to, physent *p) if(d==player1) { player1->lastaction = lastmillis; - conoutf("throw %i\n", lastmillis-p->millis); addmsg(1, 9, SV_SHOT, d->gunselect, (int)(from.x*DMF), (int)(from.y*DMF), (int)(from.z*DMF), (int)(to.x*DMF), (int)(to.y*DMF), (int)(to.z*DMF), lastmillis-p->millis); }; }; @@ -454,7 +453,6 @@ physent *new_nade(dynent *d, int millis = 0) p->owner = d; p->millis = lastmillis; p->timetolife = 2000-millis; - conoutf("newnade %i", p->timetolife); p->state = NADE_ACTIVATED; d->inhandnade = p; @@ -622,6 +620,7 @@ void shoot(dynent *d, vec &targ) if(d->weaponchanging || attacktimegunwait) return; d->gunwait = 0; + d->reloading = false; if(d->attacking && !d->inhandnade) // activate { @@ -631,7 +630,6 @@ void shoot(dynent *d, vec &targ) d->gunwait = grenadepulltime; d->lastaction = lastmillis; d->lastattackgun = d->gunselect; - d->reloading = false; } else if(!d->attacking && d->inhandnade && attacktime>grenadepulltime) // throw { @@ -643,13 +641,13 @@ void shoot(dynent *d, vec &targ) { if(d->weaponchanging || attacktimegunwait) return; d->gunwait = 0; + d->reloading = false; if(!d->attacking) { d->shots = 0; return; }; d->lastaction = lastmillis; d->lastattackgun = d->gunselect; if(!hasammo(d)) { d->shots = 0; return; }; - d->reloading = false; if(guns[d->gunselect].isauto) d->shots++; else d->attacking = false; diff --git a/source/src/worldio.cpp b/source/src/worldio.cpp index 6120abdf..26b56ea2 100644 --- a/source/src/worldio.cpp +++ b/source/src/worldio.cpp @@ -211,6 +211,7 @@ extern void preload_mapmodels(); void load_world(char *mname) // still supports all map formats that have existed since the earliest cube betas! { + loadingscreen(); preparectf(true); stopifrecording(); cleardlights();