demo
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@997 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
+31
-2
@@ -228,7 +228,36 @@ COMMAND(trypitch, ARG_1INT);
|
||||
|
||||
void recomputecamera()
|
||||
{
|
||||
if(editmode || player1->state!=CS_DEAD)
|
||||
if(demoplayback && demoplayer)
|
||||
{
|
||||
static physent democam;
|
||||
extern bool firstpersondemo;
|
||||
|
||||
if(demoplayer == player1 && firstpersondemo)
|
||||
{
|
||||
democam = *(physent *)player1;
|
||||
}
|
||||
else
|
||||
{
|
||||
static playerent *lastplayer = NULL;
|
||||
if(lastplayer != demoplayer)
|
||||
{
|
||||
lastplayer = demoplayer;
|
||||
democam = *(physent *)demoplayer;
|
||||
democam.type = ENT_CAMERA;
|
||||
democam.reset();
|
||||
democam.roll = 0;
|
||||
democam.move = -1;
|
||||
camera1 = &democam;
|
||||
}
|
||||
democam.o = demoplayer->o;
|
||||
democam.o.x -= (float)(cosf(RAD*(demoplayer->yaw-90)))*demoplayer->radius*1.5f;
|
||||
democam.o.y -= (float)(sinf(RAD*(demoplayer->yaw-90)))*demoplayer->radius*1.5f;
|
||||
democam.o.z += demoplayer->eyeheight/3.0f;
|
||||
if(!demopaused) democam.yaw = demoplayer->yaw;
|
||||
}
|
||||
}
|
||||
else if(editmode || player1->state!=CS_DEAD)
|
||||
{
|
||||
camera1 = player1;
|
||||
}
|
||||
@@ -505,7 +534,7 @@ void drawhudgun(int w, int h, float aspect, int farplane)
|
||||
gluPerspective((float)100.0f*h/w, aspect, 0.3f, farplane); // fov fixed at 100°
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
|
||||
if(player1->state!=CS_DEAD) renderhudgun();
|
||||
if(player1->state!=CS_DEAD && (!demoplayback || localdemoplayer1st())) renderhudgun();
|
||||
rendermenumdl();
|
||||
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
|
||||
Reference in New Issue
Block a user