diff --git a/changelog.log b/changelog.log index 71ee0948..e248e5ec 100644 --- a/changelog.log +++ b/changelog.log @@ -13,24 +13,7 @@ SV_ClipToLinks SV_ClipMoveToEntities 1. Полная отладка PRVM 2. Пофиксить зависание bsplib при работе 3. Отладка и имплементация физики (physic.dll) - - -Текущие задачи: -1. Добавить поддержку текстур mip (Quake1) ОК -2. Включить все фичи нового компилера -{ - OP_POWER_I - добавить XOR для right result - разобраться с autoprototype - - корежится crc при автопрототипинге - - Препроцессинг для автопрототипинга: - 1. найти главный файл с описанием структур - - в этом файле должны быть ключевые слова end_sys_fields - и end_sys_globals (или это два различных файла) - -} +4. написать новый кастомный таймер игрового цикла studioframeadvance studiorewindframe @@ -38,6 +21,7 @@ studiorewindframe //================================================== // то, что уже готово //================================================== ++исправлен баг с проигрыванием видео и демок +исправлен баг с записью сжатых исходников в готовый файл +добавлен новый тип критичных ошибок - internal error +консольные приложения могут использовать расширенные пути, типа ./ или ..\ diff --git a/common/common.plg b/common/common.plg deleted file mode 100644 index 0d811cc0..00000000 --- a/common/common.plg +++ /dev/null @@ -1,87 +0,0 @@ - - -
-

Build Log

-

---------------------Configuration: common - Win32 Debug-------------------- -

-

Command Lines

-Creating temporary file "C:\DOCUME~1\МИША\LOCALS~1\Temp\RSP14F9.tmp" with contents -[ -/nologo /MDd /W3 /Gm /Gi /GX /ZI /I "./" /I "../public" /I "./bsplib/" /I "./qcclib" /I "./common" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FR"..\temp\common\!debug/" /Fo"..\temp\common\!debug/" /Fd"..\temp\common\!debug/" /FD /GZ /c -"D:\XASH3D\src_main\!source\common\platform.c" -"D:\XASH3D\src_main\!source\common\qcclib\pr_comp.c" -"D:\XASH3D\src_main\!source\common\qcclib\pr_lex.c" -"D:\XASH3D\src_main\!source\common\qcclib\pr_main.c" -"D:\XASH3D\src_main\!source\common\qcclib\pr_utils.c" -"D:\XASH3D\src_main\!source\common\common\utils.c" -] -Creating command line "cl.exe @"C:\DOCUME~1\МИША\LOCALS~1\Temp\RSP14F9.tmp"" -Creating temporary file "C:\DOCUME~1\МИША\LOCALS~1\Temp\RSP14FA.tmp" with contents -[ -common/zlib.lib winmm.lib user32.lib /nologo /dll /incremental:yes /pdb:"..\temp\common\!debug/common.pdb" /debug /machine:I386 /nodefaultlib:"libc.lib" /out:"..\temp\common\!debug/common.dll" /implib:"..\temp\common\!debug/common.lib" /pdbtype:sept -"\XASH3D\src_main\!source\temp\common\!debug\brushbsp.obj" -"\XASH3D\src_main\!source\temp\common\!debug\bspfile.obj" -"\XASH3D\src_main\!source\temp\common\!debug\csg.obj" -"\XASH3D\src_main\!source\temp\common\!debug\faces.obj" -"\XASH3D\src_main\!source\temp\common\!debug\filesystem.obj" -"\XASH3D\src_main\!source\temp\common\!debug\flow.obj" -"\XASH3D\src_main\!source\temp\common\!debug\image.obj" -"\XASH3D\src_main\!source\temp\common\!debug\imglib.obj" -"\XASH3D\src_main\!source\temp\common\!debug\leakfile.obj" -"\XASH3D\src_main\!source\temp\common\!debug\lightmap.obj" -"\XASH3D\src_main\!source\temp\common\!debug\map.obj" -"\XASH3D\src_main\!source\temp\common\!debug\memory.obj" -"\XASH3D\src_main\!source\temp\common\!debug\patches.obj" -"\XASH3D\src_main\!source\temp\common\!debug\platform.obj" -"\XASH3D\src_main\!source\temp\common\!debug\portals.obj" -"\XASH3D\src_main\!source\temp\common\!debug\pr_comp.obj" -"\XASH3D\src_main\!source\temp\common\!debug\pr_lex.obj" -"\XASH3D\src_main\!source\temp\common\!debug\pr_main.obj" -"\XASH3D\src_main\!source\temp\common\!debug\pr_utils.obj" -"\XASH3D\src_main\!source\temp\common\!debug\prtfile.obj" -"\XASH3D\src_main\!source\temp\common\!debug\qbsp3.obj" -"\XASH3D\src_main\!source\temp\common\!debug\qrad3.obj" -"\XASH3D\src_main\!source\temp\common\!debug\qvis3.obj" -"\XASH3D\src_main\!source\temp\common\!debug\shaders.obj" -"\XASH3D\src_main\!source\temp\common\!debug\spritegen.obj" -"\XASH3D\src_main\!source\temp\common\!debug\studio.obj" -"\XASH3D\src_main\!source\temp\common\!debug\studio_utils.obj" -"\XASH3D\src_main\!source\temp\common\!debug\textures.obj" -"\XASH3D\src_main\!source\temp\common\!debug\trace.obj" -"\XASH3D\src_main\!source\temp\common\!debug\tree.obj" -"\XASH3D\src_main\!source\temp\common\!debug\utils.obj" -"\XASH3D\src_main\!source\temp\common\!debug\winding.obj" -"\XASH3D\src_main\!source\temp\common\!debug\writebsp.obj" -] -Creating command line "link.exe @"C:\DOCUME~1\МИША\LOCALS~1\Temp\RSP14FA.tmp"" -Creating temporary file "C:\DOCUME~1\МИША\LOCALS~1\Temp\RSP14FB.bat" with contents -[ -@echo off -copy \XASH3D\src_main\!source\temp\common\!debug\common.dll "D:\Xash3D\bin\common.dll" -] -Creating command line ""C:\DOCUME~1\МИША\LOCALS~1\Temp\RSP14FB.bat"" -Compiling... -platform.c -pr_comp.c -d:\xash3d\src_main\!source\common\qcclib\pr_comp.c(6719) : error C2039: 'numfilename' : is not a member of 'search_s' - d:\xash3d\src_main\!source\public\ref_system.h(382) : see declaration of 'search_s' -d:\xash3d\src_main\!source\common\qcclib\pr_comp.c(6723) : error C2001: newline in constant -d:\xash3d\src_main\!source\common\qcclib\pr_comp.c(6723) : error C2015: too many characters in constant -d:\xash3d\src_main\!source\common\qcclib\pr_comp.c(6724) : error C2143: syntax error : missing ')' before '}' -d:\xash3d\src_main\!source\common\qcclib\pr_comp.c(6748) : fatal error C1004: unexpected end of file found -pr_lex.c -pr_main.c -pr_utils.c -utils.c -Generating Code... -Error executing cl.exe. -

Output Window

- - - -

Results

-common.dll - 5 error(s), 0 warning(s) -
- - diff --git a/common/common/filesystem.c b/common/common/filesystem.c index fcd7a416..2f929efb 100644 --- a/common/common/filesystem.c +++ b/common/common/filesystem.c @@ -1105,8 +1105,7 @@ void FS_LoadGameInfo( const char *filename ) // create default gameinfo if(!FS_FileExists( filename )) FS_CreateGameInfo( filename ); - - //now we have use search path and can load gameinfo.txt + // now we have use search path and can load gameinfo.txt load = FS_LoadScript( filename, NULL, 0 ); while( load ) @@ -1181,19 +1180,25 @@ void FS_Init( int argc, char **argv ) // checked nasty path if(FS_CheckNastyPath(gs_basedir, true ) || !stricmp("bin", gs_basedir )) // "bin" it's a reserved word { - Msg("FS_Init: invalid game directory \"%s\". Reset to default.\n", gs_basedir ); + MsgWarn("FS_Init: invalid game directory \"%s\". Use default gamedir \"xash\".\n", gs_basedir ); strcpy(gs_basedir, "xash" );//default dir } - //validate directories + // validate directories for (i = 0; i < dirs.numstrings; i++) { if(!stricmp(gs_basedir, dirs.strings[i])) break; } - if(i == dirs.numstrings) strcpy(gs_basedir, "xash" );//default dir + if(i == dirs.numstrings) + { + MsgWarn("FS_Init: game directory \"%s\" not exist. Use default gamedir \"xash\".\n", gs_basedir ); + strcpy(gs_basedir, "xash" );//default dir + } + stringlistfreecontents(&dirs); + MsgDev(D_INFO, "FS_Init: done\n"); } void FS_InitRootDir( char *path ) diff --git a/editor/editor.plg b/editor/editor.plg deleted file mode 100644 index 8c9fafb2..00000000 --- a/editor/editor.plg +++ /dev/null @@ -1,16 +0,0 @@ - - -
-

Build Log

-

---------------------Configuration: editor - Win32 Debug-------------------- -

-

Command Lines

- - - -

Results

-editor.dll - 0 error(s), 0 warning(s) -
- - diff --git a/engine/client/cl_cin.c b/engine/client/cl_cin.c index 42d5fb08..e83acc13 100644 --- a/engine/client/cl_cin.c +++ b/engine/client/cl_cin.c @@ -22,7 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. typedef struct { byte *data; - int count; + int count; } cblock_t; typedef struct diff --git a/engine/client/cl_ents.c b/engine/client/cl_ents.c index e0042f73..2eec3af5 100644 --- a/engine/client/cl_ents.c +++ b/engine/client/cl_ents.c @@ -644,7 +644,7 @@ void CL_ParseFrame (void) { int cmd; int len; - frame_t *old; + frame_t *old; memset (&cl.frame, 0, sizeof(cl.frame)); @@ -682,7 +682,8 @@ void CL_ParseFrame (void) Msg ("Delta from invalid frame (not supposed to happen!).\n"); } if (old->serverframe != cl.frame.deltaframe) - { // The frame that the server did the delta from + { + // The frame that the server did the delta from // is too old, so we can't reconstruct it properly. Msg ("Delta frame too old.\n"); } @@ -690,8 +691,7 @@ void CL_ParseFrame (void) { Msg ("Delta parse_entities too old.\n"); } - else - cl.frame.valid = true; // valid delta parse + else cl.frame.valid = true; // valid delta parse } // clamp time @@ -727,13 +727,12 @@ void CL_ParseFrame (void) { cls.state = ca_active; cl.force_refdef = true; - cl.predicted_origin[0] = cl.frame.playerstate.pmove.origin[0]*0.125; - cl.predicted_origin[1] = cl.frame.playerstate.pmove.origin[1]*0.125; - cl.predicted_origin[2] = cl.frame.playerstate.pmove.origin[2]*0.125; + cl.predicted_origin[0] = cl.frame.playerstate.pmove.origin[0]*CL_COORD_FRAC; + cl.predicted_origin[1] = cl.frame.playerstate.pmove.origin[1]*CL_COORD_FRAC; + cl.predicted_origin[2] = cl.frame.playerstate.pmove.origin[2]*CL_COORD_FRAC; VectorCopy (cl.frame.playerstate.viewangles, cl.predicted_angles); - if (cls.disable_servercount != cl.servercount - && cl.refresh_prepped) - SCR_EndLoadingPlaque (); // get rid of loading plaque + if (cls.disable_servercount != cl.servercount && cl.refresh_prepped) + SCR_EndLoadingPlaque (); // get rid of loading plaque } cl.sound_prepped = true; // can start mixing ambient sounds @@ -1159,9 +1158,9 @@ void CL_CalcViewValues (void) ops = &oldframe->playerstate; // see if the player entity was teleported this frame - if ( fabs(ops->pmove.origin[0] - ps->pmove.origin[0]) > 256*8 - || abs(ops->pmove.origin[1] - ps->pmove.origin[1]) > 256*8 - || abs(ops->pmove.origin[2] - ps->pmove.origin[2]) > 256*8) + if ( fabs(ops->pmove.origin[0] - ps->pmove.origin[0]) > 256*SV_COORD_FRAC + || abs(ops->pmove.origin[1] - ps->pmove.origin[1]) > 256*SV_COORD_FRAC + || abs(ops->pmove.origin[2] - ps->pmove.origin[2]) > 256*SV_COORD_FRAC) ops = ps; // don't interpolate ent = &cl_entities[cl.playernum+1]; @@ -1187,9 +1186,9 @@ void CL_CalcViewValues (void) else { // just use interpolated values for (i=0 ; i<3 ; i++) - cl.refdef.vieworg[i] = ops->pmove.origin[i]*0.125 + ops->viewoffset[i] - + lerp * (ps->pmove.origin[i]*0.125 + ps->viewoffset[i] - - (ops->pmove.origin[i]*0.125 + ops->viewoffset[i]) ); + cl.refdef.vieworg[i] = ops->pmove.origin[i]*CL_COORD_FRAC + ops->viewoffset[i] + + lerp * (ps->pmove.origin[i]*CL_COORD_FRAC + ps->viewoffset[i] + - (ops->pmove.origin[i]*CL_COORD_FRAC + ops->viewoffset[i]) ); } // if not running a demo or on a locked frame, add the local angle movement diff --git a/engine/client/cl_fx.c b/engine/client/cl_fx.c index 60d1108b..310751ee 100644 --- a/engine/client/cl_fx.c +++ b/engine/client/cl_fx.c @@ -904,12 +904,12 @@ void CL_ItemRespawnParticles (vec3_t org) p->color = 0xd4 + (rand()&3); // green - p->org[0] = org[0] + crand()*8; - p->org[1] = org[1] + crand()*8; - p->org[2] = org[2] + crand()*8; + p->org[0] = org[0] + crand()*SV_COORD_FRAC; + p->org[1] = org[1] + crand()*SV_COORD_FRAC; + p->org[2] = org[2] + crand()*SV_COORD_FRAC; for (j=0 ; j<3 ; j++) - p->vel[j] = crand()*8; + p->vel[j] = crand()*SV_COORD_FRAC; p->accel[0] = p->accel[1] = 0; p->accel[2] = -PARTICLE_GRAVITY*0.2; @@ -1670,9 +1670,9 @@ void CL_TrapParticles (entity_t *ent) p->org[1] = org[1] + j + ((rand()&23) * crand()); p->org[2] = org[2] + k + ((rand()&23) * crand()); - dir[0] = j * 8; - dir[1] = i * 8; - dir[2] = k * 8; + dir[0] = j * SV_COORD_FRAC; + dir[1] = i * SV_COORD_FRAC; + dir[2] = k * SV_COORD_FRAC; VectorNormalize (dir); vel = 50 + rand()&63; @@ -1757,9 +1757,9 @@ void CL_TeleportParticles (vec3_t org) p->org[1] = org[1] + j + (rand()&3); p->org[2] = org[2] + k + (rand()&3); - dir[0] = j*8; - dir[1] = i*8; - dir[2] = k*8; + dir[0] = j*SV_COORD_FRAC; + dir[1] = i*SV_COORD_FRAC; + dir[2] = k*SV_COORD_FRAC; VectorNormalize (dir); vel = 50 + (rand()&63); diff --git a/engine/client/cl_main.c b/engine/client/cl_main.c index ee9a3e55..93d61839 100644 --- a/engine/client/cl_main.c +++ b/engine/client/cl_main.c @@ -990,7 +990,7 @@ void CL_ReadPackets (void) { while (NET_GetPacket (NS_CLIENT, &net_from, &net_message)) { -// Msg ("packet\n"); + //Msg ("packet\n"); // // remote command packet // @@ -1018,7 +1018,7 @@ void CL_ReadPackets (void) continue; } if (!Netchan_Process(&cls.netchan, &net_message)) - continue; // wasn't accepted for some reason + continue; // wasn't accepted for some reason CL_ParseServerMessage (); } @@ -1027,7 +1027,7 @@ void CL_ReadPackets (void) // if (cls.state >= ca_connected && cls.realtime - cls.netchan.last_received > cl_timeout->value) { - if (++cl.timeoutcount > 5) // timeoutcount saves debugger + if (++cl.timeoutcount > 5) // timeoutcount saves debugger { Msg ("\nServer connection timed out.\n"); CL_Disconnect (); @@ -1711,27 +1711,6 @@ void CL_Frame (float time) SCR_RunConsole (); cls.framecount++; - - if ( log_stats->value ) - { - if ( cls.state == ca_active ) - { - if ( !lasttimecalled ) - { - lasttimecalled = Sys_DoubleTime(); - if ( log_stats_file ) - FS_Printf( log_stats_file, "0\n" ); - } - else - { - float now = Sys_DoubleTime(); - - if ( log_stats_file ) - FS_Printf( log_stats_file, "%g\n", now - lasttimecalled ); - lasttimecalled = now; - } - } - } } diff --git a/engine/client/cl_parse.c b/engine/client/cl_parse.c index d610699d..a784a686 100644 --- a/engine/client/cl_parse.c +++ b/engine/client/cl_parse.c @@ -295,7 +295,8 @@ void CL_ParseServerData (void) { char *str; int i; - + + //Sys_Error("Serverdata packet received.\n"); MsgDev (D_INFO, "Serverdata packet received.\n"); // wipe the client_state_t struct diff --git a/engine/client/cl_pred.c b/engine/client/cl_pred.c index 3955854b..fd3e903d 100644 --- a/engine/client/cl_pred.c +++ b/engine/client/cl_pred.c @@ -59,7 +59,7 @@ void CL_CheckPredictionError (void) // save for error itnerpolation for (i=0 ; i<3 ; i++) - cl.prediction_error[i] = delta[i]*0.125; + cl.prediction_error[i] = delta[i]*CL_COORD_FRAC; } } @@ -263,15 +263,15 @@ void CL_PredictMovement (void) step = pm.s.origin[2] - oldz; if (step > 63 && step < 160 && (pm.s.pm_flags & PMF_ON_GROUND)) { - cl.predicted_step = step * 0.125; + cl.predicted_step = step * CL_COORD_FRAC; cl.predicted_step_time = cls.realtime - cls.frametime * 0.5f; } // copy results out for rendering - cl.predicted_origin[0] = pm.s.origin[0]*0.125; - cl.predicted_origin[1] = pm.s.origin[1]*0.125; - cl.predicted_origin[2] = pm.s.origin[2]*0.125; + cl.predicted_origin[0] = pm.s.origin[0]*CL_COORD_FRAC; + cl.predicted_origin[1] = pm.s.origin[1]*CL_COORD_FRAC; + cl.predicted_origin[2] = pm.s.origin[2]*CL_COORD_FRAC; VectorCopy (pm.viewangles, cl.predicted_angles); } diff --git a/engine/client/cl_view.c b/engine/client/cl_view.c index 123cccb3..cb06c740 100644 --- a/engine/client/cl_view.c +++ b/engine/client/cl_view.c @@ -531,9 +531,6 @@ void V_RenderView( float stereo_separation ) re->RenderFrame (&cl.refdef); if (cl_stats->value) Msg ("ent:%i lt:%i part:%i\n", r_numentities, r_numdlights, r_numparticles); - if ( log_stats->value && ( log_stats_file != 0 ) ) - FS_Printf( log_stats_file, "%i,%i,%i,",r_numentities, r_numdlights, r_numparticles); - SCR_AddDirtyPoint (scr_vrect.x, scr_vrect.y); SCR_AddDirtyPoint (scr_vrect.x+scr_vrect.width-1, diff --git a/engine/common.h b/engine/common.h index bc2adff7..47c1c215 100644 --- a/engine/common.h +++ b/engine/common.h @@ -604,9 +604,6 @@ float crand(void); // -1 to 1 extern cvar_t *developer; extern cvar_t *dedicated; extern cvar_t *host_speeds; -extern cvar_t *log_stats; - -extern file_t *log_stats_file; // host_speeds times extern float time_before_game; diff --git a/engine/common/cmodel.c b/engine/common/cmodel.c index 6922b2f5..a12808e6 100644 --- a/engine/common/cmodel.c +++ b/engine/common/cmodel.c @@ -110,11 +110,8 @@ int floodvalid; byte portalopen[MAX_MAP_AREAPORTALS]; - cvar_t *map_noareas; -int c_pointcontents; -int c_traces, c_brush_traces; /* @@ -776,9 +773,6 @@ int CM_PointLeafnum_r (vec3_t p, int num) else num = node->children[0]; } - - c_pointcontents++; // optimize counter - return -1 - num; } @@ -964,8 +958,6 @@ void CM_ClipBoxToBrush (vec3_t mins, vec3_t maxs, vec3_t p1, vec3_t p2, if (!brush->numsides) return; - c_brush_traces++; - getout = false; startout = false; leadside = NULL; @@ -1313,8 +1305,6 @@ trace_t CM_BoxTrace (vec3_t start, vec3_t end, checkcount++; // for multi-check avoidance - c_traces++; // for statistics, may be zeroed - // fill in a default trace memset (&trace_trace, 0, sizeof(trace_trace)); trace_trace.fraction = 1; diff --git a/engine/common/common.c b/engine/common/common.c index 43ef05e1..3f25786c 100644 --- a/engine/common/common.c +++ b/engine/common/common.c @@ -27,10 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. int com_argc; char *com_argv[MAX_NUM_ARGVS+1]; -file_t *log_stats_file; - cvar_t *host_speeds; -cvar_t *log_stats; cvar_t *developer; cvar_t *dedicated; diff --git a/engine/common/net_chan.c b/engine/common/net_chan.c index 464f4130..76b0d1bb 100644 --- a/engine/common/net_chan.c +++ b/engine/common/net_chan.c @@ -213,11 +213,11 @@ A 0 length will still generate a packet and deal with the reliable messages. void Netchan_Transmit (netchan_t *chan, int length, byte *data) { sizebuf_t send; - byte send_buf[MAX_MSGLEN]; + byte send_buf[MAX_MSGLEN]; bool send_reliable; - unsigned w1, w2; + uint w1, w2; -// check for message overflow + // check for message overflow if (chan->message.overflowed) { chan->fatal_error = true; @@ -237,7 +237,7 @@ void Netchan_Transmit (netchan_t *chan, int length, byte *data) } -// write the packet header + // write the packet header SZ_Init (&send, send_buf, sizeof(send_buf)); w1 = ( chan->outgoing_sequence & ~(1<<31) ) | (send_reliable<<31); @@ -260,7 +260,7 @@ void Netchan_Transmit (netchan_t *chan, int length, byte *data) } // add the unreliable part if space is available - if (send.maxsize - send.cursize >= length) + if (send.maxsize - send.cursize >= length) SZ_Write (&send, data, length); else MsgWarn("Netchan_Transmit: dumped unreliable\n"); @@ -295,11 +295,11 @@ modifies net_message so that it points to the packet payload */ bool Netchan_Process (netchan_t *chan, sizebuf_t *msg) { - unsigned sequence, sequence_ack; - unsigned reliable_ack, reliable_message; - int qport; + uint sequence, sequence_ack; + uint reliable_ack, reliable_message; + int qport; -// get sequence numbers + // get sequence numbers MSG_BeginReading (msg); sequence = MSG_ReadLong (msg); sequence_ack = MSG_ReadLong (msg); @@ -331,9 +331,7 @@ bool Netchan_Process (netchan_t *chan, sizebuf_t *msg) , reliable_ack); } -// -// discard stale or duplicated packets -// + // discard stale or duplicated packets if (sequence <= chan->incoming_sequence) { if (showdrop->value) @@ -344,9 +342,7 @@ bool Netchan_Process (netchan_t *chan, sizebuf_t *msg) return false; } -// -// dropped packets don't keep the message from being used -// + // dropped packets don't keep the message from being used chan->dropped = sequence - (chan->incoming_sequence+1); if (chan->dropped > 0) { diff --git a/engine/common/net_wins.c b/engine/common/net_wins.c index 2b55114e..7958bd31 100644 --- a/engine/common/net_wins.c +++ b/engine/common/net_wins.c @@ -370,7 +370,7 @@ void NET_SendLoopPacket (netsrc_t sock, int length, void *data, netadr_t to) i = loop->send & (MAX_LOOPBACK-1); loop->send++; - memcpy (loop->msgs[i].data, data, length); + Mem_Copy(loop->msgs[i].data, data, length); loop->msgs[i].datalen = length; } @@ -490,7 +490,7 @@ void NET_SendPacket (netsrc_t sock, int length, void *data, netadr_t to) if ((err == WSAEADDRNOTAVAIL) && ((to.type == NA_BROADCAST) || (to.type == NA_BROADCAST_IPX))) return; - if (dedicated->value) // let dedicated servers continue after errors + if (dedicated->value) // let dedicated servers continue after errors { Msg ("NET_SendPacket ERROR: %s to %s\n", NET_ErrorString(), NET_AdrToString (to)); } diff --git a/engine/common/pmove.c b/engine/common/pmove.c index 33a73f4a..7cb83d60 100644 --- a/engine/common/pmove.c +++ b/engine/common/pmove.c @@ -964,7 +964,7 @@ bool PM_GoodPosition (void) if (pm->s.pm_type == PM_SPECTATOR) return true; - for (i = 0; i < 3; i++) origin[i] = end[i] = pm->s.origin[i] * 0.125; + for (i = 0; i < 3; i++) origin[i] = end[i] = pm->s.origin[i] * CL_COORD_FRAC; trace = pm->trace (origin, pm->mins, pm->maxs, end); return !trace.allsolid; @@ -974,7 +974,7 @@ bool PM_GoodPosition (void) ================ PM_SnapPosition -On exit, the origin will have a value that is pre-quantized to the 0.125 +On exit, the origin will have a value that is pre-quantized to the CL_COORD_FRAC precision of the network channel and in a valid position. ================ */ @@ -987,14 +987,14 @@ void PM_SnapPosition (void) static int jitterbits[8] = {0,4,1,2,3,5,6,7}; // snap velocity to eigths - for (i = 0; i < 3; i++) pm->s.velocity[i] = (int)(pml.velocity[i]*8); + for (i = 0; i < 3; i++) pm->s.velocity[i] = (int)(pml.velocity[i]*SV_COORD_FRAC); for (i = 0; i < 3; i++) { if (pml.origin[i] >= 0) sign[i] = 1; else sign[i] = -1; - pm->s.origin[i] = (int)(pml.origin[i]*8); - if (pm->s.origin[i]*0.125 == pml.origin[i]) sign[i] = 0; + pm->s.origin[i] = (int)(pml.origin[i]*SV_COORD_FRAC); + if (pm->s.origin[i] * CL_COORD_FRAC == pml.origin[i]) sign[i] = 0; } VectorCopy (pm->s.origin, base); @@ -1039,9 +1039,9 @@ void PM_InitialSnapPosition(void) pm->s.origin[0] = base[0] + offset[ x ]; if (PM_GoodPosition ()) { - pml.origin[0] = pm->s.origin[0]*0.125; - pml.origin[1] = pm->s.origin[1]*0.125; - pml.origin[2] = pm->s.origin[2]*0.125; + pml.origin[0] = pm->s.origin[0]*CL_COORD_FRAC; + pml.origin[1] = pm->s.origin[1]*CL_COORD_FRAC; + pml.origin[2] = pm->s.origin[2]*CL_COORD_FRAC; VectorCopy (pm->s.origin, pml.previous_origin); return; } @@ -1109,13 +1109,13 @@ void Pmove (pmove_t *pmove) memset (&pml, 0, sizeof(pml)); // convert origin and velocity to float values - pml.origin[0] = pm->s.origin[0]*0.125; - pml.origin[1] = pm->s.origin[1]*0.125; - pml.origin[2] = pm->s.origin[2]*0.125; + pml.origin[0] = pm->s.origin[0]*CL_COORD_FRAC; + pml.origin[1] = pm->s.origin[1]*CL_COORD_FRAC; + pml.origin[2] = pm->s.origin[2]*CL_COORD_FRAC; - pml.velocity[0] = pm->s.velocity[0]*0.125; - pml.velocity[1] = pm->s.velocity[1]*0.125; - pml.velocity[2] = pm->s.velocity[2]*0.125; + pml.velocity[0] = pm->s.velocity[0]*CL_COORD_FRAC; + pml.velocity[1] = pm->s.velocity[1]*CL_COORD_FRAC; + pml.velocity[2] = pm->s.velocity[2]*CL_COORD_FRAC; // save old org in case we get stuck VectorCopy (pm->s.origin, pml.previous_origin); diff --git a/engine/common/vm_cmds.c b/engine/common/vm_cmds.c index 1a4a87df..c75f8b5c 100644 --- a/engine/common/vm_cmds.c +++ b/engine/common/vm_cmds.c @@ -181,7 +181,7 @@ void VM_bprint (void) VM_VarString(0, string, sizeof(string)); - if(sv.state != ss_game) + if(sv.state == ss_loading) { Con_Print( string ); return; diff --git a/engine/engine.plg b/engine/engine.plg deleted file mode 100644 index 45d2c2f7..00000000 --- a/engine/engine.plg +++ /dev/null @@ -1,16 +0,0 @@ - - -
-

Build Log

-

---------------------Configuration: engine - Win32 Debug-------------------- -

-

Command Lines

- - - -

Results

-engine.dll - 0 error(s), 0 warning(s) -
- - diff --git a/engine/host.c b/engine/host.c index 91b44d3e..32ec4b51 100644 --- a/engine/host.c +++ b/engine/host.c @@ -25,7 +25,6 @@ dll_info_t common_dll = { "common.dll", NULL, "CreateAPI", NULL, NULL, true, COM cvar_t *timescale; cvar_t *fixedtime; -cvar_t *showtrace; void Host_InitCommon( char *funcname, int argc, char **argv ) { @@ -122,11 +121,9 @@ void Host_Init (char *funcname, int argc, char **argv) Cmd_AddCommand ("error", Host_Error_f); host_speeds = Cvar_Get ("host_speeds", "0", 0); - log_stats = Cvar_Get ("log_stats", "0", 0); developer = Cvar_Get ("developer", "0", 0); timescale = Cvar_Get ("timescale", "1", 0); fixedtime = Cvar_Get ("fixedtime", "0", 0); - showtrace = Cvar_Get ("showtrace", "0", 0); if(host.type == HOST_DEDICATED) dedicated = Cvar_Get ("dedicated", "1", CVAR_NOSET); else dedicated = Cvar_Get ("dedicated", "0", CVAR_NOSET); @@ -169,42 +166,6 @@ void Host_Frame (double time) if (setjmp(host.abortframe)) return; - if ( log_stats->modified ) - { - log_stats->modified = false; - if ( log_stats->value ) - { - if ( log_stats_file ) - { - FS_Close( log_stats_file ); - log_stats_file = 0; - } - log_stats_file = FS_Open( "stats.log", "w" ); - if ( log_stats_file ) - FS_Printf( log_stats_file, "entities,dlights,parts,frame time\n" ); - } - else - { - if ( log_stats_file ) - { - FS_Close( log_stats_file ); - log_stats_file = 0; - } - } - } - - if (showtrace->value) - { - extern int c_traces, c_brush_traces; - extern int c_pointcontents; - - Msg ("%4i traces %4i points\n", c_traces, c_pointcontents); - c_traces = 0; - c_brush_traces = 0; - c_pointcontents = 0; - } - - rand(); // keep the random time dependent do diff --git a/engine/server/sv_ccmds.c b/engine/server/sv_ccmds.c index 5a009355..a1e48c80 100644 --- a/engine/server/sv_ccmds.c +++ b/engine/server/sv_ccmds.c @@ -148,6 +148,12 @@ Puts the server in demo mode on a specific map/cinematic */ void SV_DemoMap_f (void) { + if (Cmd_Argc() != 2) + { + Msg ("USAGE: demomap \n"); + return; + } + SV_Map (true, Cmd_Argv(1), NULL, false ); } diff --git a/engine/server/sv_ents.c b/engine/server/sv_ents.c index b9575b4f..863f6004 100644 --- a/engine/server/sv_ents.c +++ b/engine/server/sv_ents.c @@ -170,40 +170,22 @@ void SV_WritePlayerstateToClient (client_frame_t *from, client_frame_t *to, size if (ps->pmove.pm_type != ops->pmove.pm_type) pflags |= PS_M_TYPE; - if (ps->pmove.origin[0] != ops->pmove.origin[0] - || ps->pmove.origin[1] != ops->pmove.origin[1] - || ps->pmove.origin[2] != ops->pmove.origin[2] ) - pflags |= PS_M_ORIGIN; + if(!VectorICompare(ps->pmove.origin, ops->pmove.origin)) pflags |= PS_M_ORIGIN; + if(!VectorICompare(ps->pmove.velocity, ops->pmove.velocity)) pflags |= PS_M_VELOCITY; + if (ps->pmove.pm_time != ops->pmove.pm_time) pflags |= PS_M_TIME; + if (ps->pmove.pm_flags != ops->pmove.pm_flags) pflags |= PS_M_FLAGS; + if (ps->pmove.gravity != ops->pmove.gravity) pflags |= PS_M_GRAVITY; - if (ps->pmove.velocity[0] != ops->pmove.velocity[0] - || ps->pmove.velocity[1] != ops->pmove.velocity[1] - || ps->pmove.velocity[2] != ops->pmove.velocity[2] ) - pflags |= PS_M_VELOCITY; - - if (ps->pmove.pm_time != ops->pmove.pm_time) - pflags |= PS_M_TIME; - - if (ps->pmove.pm_flags != ops->pmove.pm_flags) - pflags |= PS_M_FLAGS; - - if (ps->pmove.gravity != ops->pmove.gravity) - pflags |= PS_M_GRAVITY; - - if (ps->pmove.delta_angles[0] != ops->pmove.delta_angles[0] - || ps->pmove.delta_angles[1] != ops->pmove.delta_angles[1] - || ps->pmove.delta_angles[2] != ops->pmove.delta_angles[2] ) + if(!VectorICompare(ps->pmove.delta_angles, ops->pmove.delta_angles)) + { + Msg("update delta angles\n"); pflags |= PS_M_DELTA_ANGLES; + } - - if (ps->viewoffset[0] != ops->viewoffset[0] - || ps->viewoffset[1] != ops->viewoffset[1] - || ps->viewoffset[2] != ops->viewoffset[2] ) + if(!VectorCompare(ps->viewoffset, ops->viewoffset)) pflags |= PS_VIEWOFFSET; - if (ps->viewangles[0] != ops->viewangles[0] - || ps->viewangles[1] != ops->viewangles[1] - || ps->viewangles[2] != ops->viewangles[2] ) - pflags |= PS_VIEWANGLES; + if(!VectorCompare(ps->viewangles, ops->viewangles)) pflags |= PS_VIEWANGLES; if (ps->kick_angles[0] != ops->kick_angles[0] || ps->kick_angles[1] != ops->kick_angles[1] @@ -216,29 +198,16 @@ void SV_WritePlayerstateToClient (client_frame_t *from, client_frame_t *to, size || ps->blend[3] != ops->blend[3] ) pflags |= PS_BLEND; - if (ps->fov != ops->fov) - pflags |= PS_FOV; - - if (ps->rdflags != ops->rdflags) - pflags |= PS_RDFLAGS; - - if (ps->gunframe != ops->gunframe) - pflags |= PS_WEAPONFRAME; - - if (ps->sequence != ops->sequence) - pflags |= PS_WEAPONSEQUENCE; - - if (ps->gunbody != ops->gunbody) - pflags |= PS_WEAPONBODY; - - if (ps->gunskin != ops->gunskin) - pflags |= PS_WEAPONSKIN; + if (ps->fov != ops->fov) pflags |= PS_FOV; + if (ps->rdflags != ops->rdflags) pflags |= PS_RDFLAGS; + if (ps->gunframe != ops->gunframe) pflags |= PS_WEAPONFRAME; + if (ps->sequence != ops->sequence) pflags |= PS_WEAPONSEQUENCE; + if (ps->gunbody != ops->gunbody) pflags |= PS_WEAPONBODY; + if (ps->gunskin != ops->gunskin) pflags |= PS_WEAPONSKIN; pflags |= PS_WEAPONINDEX; - // // write it - // MSG_WriteByte (msg, svc_playerinfo); MSG_WriteLong (msg, pflags); @@ -434,8 +403,8 @@ void SV_FatPVS (vec3_t org) for (i = 0; i < 3; i++) { - mins[i] = org[i] - 8; - maxs[i] = org[i] + 8; + mins[i] = org[i] - SV_COORD_FRAC; + maxs[i] = org[i] + SV_COORD_FRAC; } count = CM_BoxLeafnums (mins, maxs, leafs, 64, NULL); @@ -495,7 +464,7 @@ void SV_BuildClientFrame (client_t *client) // find the client's PVS for (i = 0; i < 3; i++) - org[i] = clent->priv.sv->client->ps.pmove.origin[i]*0.125 + clent->priv.sv->client->ps.viewoffset[i]; + org[i] = clent->priv.sv->client->ps.pmove.origin[i]*CL_COORD_FRAC + clent->priv.sv->client->ps.viewoffset[i]; leafnum = CM_PointLeafnum (org); clientarea = CM_LeafArea (leafnum); @@ -615,15 +584,14 @@ Used for recording footage for merged or assembled demos */ void SV_RecordDemoMessage (void) { - int e; + int e; edict_t *ent; entity_state_t nostate; sizebuf_t buf; byte buf_data[32768]; - int len; + int len; - if (!svs.demofile) - return; + if (!svs.demofile) return; memset (&nostate, 0, sizeof(nostate)); SZ_Init (&buf, buf_data, sizeof(buf_data)); @@ -631,7 +599,6 @@ void SV_RecordDemoMessage (void) // write a frame message that doesn't contain a player_state_t MSG_WriteByte (&buf, svc_frame); MSG_WriteLong (&buf, sv.framenum); - MSG_WriteByte (&buf, svc_packetentities); e = 1; @@ -639,10 +606,11 @@ void SV_RecordDemoMessage (void) while (e < prog->num_edicts) { // ignore ents without visible models unless they have an effect - if (!ent->priv.sv->free && ent->priv.sv->serialnumber && - (ent->priv.sv->s.modelindex || ent->progs.sv->effects || ent->progs.sv->noise3 || ent->priv.sv->event)) + if (!ent->priv.sv->free && ent->priv.sv->serialnumber && (ent->priv.sv->s.modelindex || ent->progs.sv->effects || ent->progs.sv->noise3 || ent->priv.sv->event)) + { + SV_UpdateEntityState( ent ); MSG_WriteDeltaEntity (&nostate, &ent->priv.sv->s, &buf, false, true); - + } e++; ent = PRVM_EDICT_NUM(e); } diff --git a/engine/server/sv_main.c b/engine/server/sv_main.c index eea14a89..17af9ee3 100644 --- a/engine/server/sv_main.c +++ b/engine/server/sv_main.c @@ -421,7 +421,7 @@ gotnewcl: newcl->state = cs_connected; SZ_Init (&newcl->datagram, newcl->datagram_buf, sizeof(newcl->datagram_buf) ); - newcl->lastmessage = svs.realtime; // don't timeout + newcl->lastmessage = svs.realtime; // don't timeout newcl->lastconnect = svs.realtime; } @@ -615,33 +615,28 @@ void SV_ReadPackets (void) qport = MSG_ReadShort (&net_message) & 0xffff; // check for packets from connected clients - for (i=0, cl=svs.clients ; ivalue ; i++,cl++) + for (i = 0, cl = svs.clients; i < maxclients->value; i++, cl++) { - if (cl->state == cs_free) - continue; - if (!NET_CompareBaseAdr (net_from, cl->netchan.remote_address)) - continue; - if (cl->netchan.qport != qport) - continue; + if (cl->state == cs_free) continue; + if (!NET_CompareBaseAdr (net_from, cl->netchan.remote_address)) continue; + if (cl->netchan.qport != qport) continue; if (cl->netchan.remote_address.port != net_from.port) { - Msg ("SV_ReadPackets: fixing up a translated port\n"); + MsgDev(D_INFO, "SV_ReadPackets: fixing up a translated port\n"); cl->netchan.remote_address.port = net_from.port; } - if (Netchan_Process(&cl->netchan, &net_message)) - { // this is a valid, sequenced packet, so process it + { + // this is a valid, sequenced packet, so process it if (cl->state != cs_zombie) { - cl->lastmessage = svs.realtime; // don't timeout + cl->lastmessage = svs.realtime; // don't timeout SV_ExecuteClientMessage (cl); } } break; } - - if (i != maxclients->value) - continue; + if (i != maxclients->value) continue; } } @@ -727,7 +722,7 @@ void SV_RunGameFrame (void) // compression can get confused when a client // has the "current" frame sv.framenum++; - sv.frametime = 0.001f;//1000 fps + sv.frametime = 0.1f;//1000 fps sv.time = sv.framenum * sv.frametime; // don't run if paused diff --git a/engine/server/sv_phys.c b/engine/server/sv_phys.c index bf4fa5a9..58629bba 100644 --- a/engine/server/sv_phys.c +++ b/engine/server/sv_phys.c @@ -632,8 +632,8 @@ bool SV_MoveStep (edict_t *ent, vec3_t move, bool relink) if (i == 0 && enemy != prog->edicts) { dz = ent->progs.sv->origin[2] - PRVM_PROG_TO_EDICT(ent->progs.sv->enemy)->progs.sv->origin[2]; - if (dz > 40) neworg[2] -= 8; - if (dz < 30) neworg[2] += 8; + if (dz > 40) neworg[2] -= SV_COORD_FRAC; + if (dz < 30) neworg[2] += SV_COORD_FRAC; } trace = SV_Trace(ent->progs.sv->origin, ent->progs.sv->mins, ent->progs.sv->maxs, neworg, ent, MASK_SOLID); diff --git a/engine/server/sv_send.c b/engine/server/sv_send.c index 526e85d3..4b1ca86c 100644 --- a/engine/server/sv_send.c +++ b/engine/server/sv_send.c @@ -489,9 +489,9 @@ SV_SendClientMessages */ void SV_SendClientMessages (void) { - int i; - client_t *c; - int msglen; + int i; + client_t *c; + int msglen; byte msgbuf[MAX_MSGLEN]; msglen = 0; diff --git a/engine/server/sv_spawn.c b/engine/server/sv_spawn.c index 0701a4b4..1465d36e 100644 --- a/engine/server/sv_spawn.c +++ b/engine/server/sv_spawn.c @@ -40,9 +40,9 @@ void SV_PutClientInServer (edict_t *ent) memset (&ent->priv.sv->client->ps, 0, sizeof(client->ps)); // info_player_start - client->ps.pmove.origin[0] = ent->progs.sv->origin[0] * 8; - client->ps.pmove.origin[1] = ent->progs.sv->origin[1] * 8; - client->ps.pmove.origin[2] = ent->progs.sv->origin[2] * 8; + client->ps.pmove.origin[0] = ent->progs.sv->origin[0] * SV_COORD_FRAC; + client->ps.pmove.origin[1] = ent->progs.sv->origin[1] * SV_COORD_FRAC; + client->ps.pmove.origin[2] = ent->progs.sv->origin[2] * SV_COORD_FRAC; client->ps.fov = 90; @@ -277,7 +277,7 @@ void SV_CalcViewOffset (edict_t *ent) // base angles angles = ent->priv.sv->client->ps.kick_angles; - + VectorCopy(ent->progs.sv->punchangle, angles); // add angles based on velocity delta = DotProduct (ent->progs.sv->velocity, forward); angles[PITCH] += delta * 0.002; @@ -341,8 +341,8 @@ void ClientEndServerFrame (edict_t *ent) // for (i = 0; i < 3; i++) { - current_client->ps.pmove.origin[i] = ent->progs.sv->origin[i]*8.0; - current_client->ps.pmove.velocity[i] = ent->progs.sv->velocity[i]*8.0; + current_client->ps.pmove.origin[i] = ent->progs.sv->origin[i]*SV_COORD_FRAC; + current_client->ps.pmove.velocity[i] = ent->progs.sv->velocity[i]*SV_COORD_FRAC; } AngleVectors (ent->priv.sv->client->v_angle, forward, right, up); @@ -351,12 +351,14 @@ void ClientEndServerFrame (edict_t *ent) // set model angles from view angles so other things in // the world can tell which direction you are looking // - if (ent->priv.sv->client->v_angle[PITCH] > 180) ent->progs.sv->angles[PITCH] = (-360 + ent->priv.sv->client->v_angle[PITCH])/3; + if (ent->priv.sv->client->v_angle[PITCH] > 180) + ent->progs.sv->angles[PITCH] = (-360 + ent->priv.sv->client->v_angle[PITCH])/3; else ent->progs.sv->angles[PITCH] = ent->priv.sv->client->v_angle[PITCH]/3; ent->progs.sv->angles[YAW] = ent->priv.sv->client->v_angle[YAW]; ent->progs.sv->angles[ROLL] = 0; ent->progs.sv->angles[ROLL] = SV_CalcRoll (ent->progs.sv->angles, ent->progs.sv->velocity)*4; + ent->priv.sv->client->ps.pmove.pm_time = ent->progs.sv->teleport_time * 1000; //in msecs // // calculate speed and cycle to be used for @@ -369,11 +371,11 @@ void ClientEndServerFrame (edict_t *ent) bobmove = 0; current_client->bobtime = 0; // start at beginning of cycle again } - else + else if (ent->progs.sv->groundentity) { // so bobbing only cycles when on ground if (xyspeed > 210) bobmove = 0.25; - else if (xyspeed > 100) bobmove = 0.125; + else if (xyspeed > 100) bobmove = CL_COORD_FRAC; else bobmove = 0.0625; } @@ -392,6 +394,11 @@ void ClientEndServerFrame (edict_t *ent) SV_CalcGunOffset (ent); SV_SetStats( ent ); + + // if the scoreboard is up, update it + if (!(sv.framenum & 31)) + { + } } /* @@ -402,16 +409,13 @@ ClientEndServerFrames void ClientEndServerFrames (void) { int i; - edict_t *ent; // calc the player views now that all pushing // and damage has been added for (i = 0; i < maxclients->value; i++) { - ent = PRVM_EDICT_NUM(i); - if (ent->priv.sv->free || !ent->priv.sv->client) - continue; - ClientEndServerFrame (ent); + if(svs.clients[i].state != cs_spawned) continue; + ClientEndServerFrame (svs.clients[i].edict); } } @@ -577,8 +581,8 @@ void ClientThink (edict_t *ent, usercmd_t *ucmd) for (i = 0; i < 3; i++) { - pm.s.origin[i] = ent->progs.sv->origin[i]*8; - pm.s.velocity[i] = ent->progs.sv->velocity[i]*8; + pm.s.origin[i] = ent->progs.sv->origin[i]*SV_COORD_FRAC; + pm.s.velocity[i] = ent->progs.sv->velocity[i]*SV_COORD_FRAC; } if (memcmp(&client->old_pmove, &pm.s, sizeof(pm.s))) @@ -598,11 +602,13 @@ void ClientThink (edict_t *ent, usercmd_t *ucmd) for (i = 0; i < 3; i++) { - ent->progs.sv->origin[i] = pm.s.origin[i]*0.125; - ent->progs.sv->velocity[i] = pm.s.velocity[i]*0.125; + ent->progs.sv->origin[i] = pm.s.origin[i]*CL_COORD_FRAC; + ent->progs.sv->velocity[i] = pm.s.velocity[i]*CL_COORD_FRAC; } VectorCopy (pm.mins, ent->progs.sv->mins); VectorCopy (pm.maxs, ent->progs.sv->maxs); + VectorCopy (pm.viewangles, client->v_angle); + VectorCopy (pm.viewangles, client->ps.viewangles); SV_LinkEdict(ent); diff --git a/engine/server/sv_user.c b/engine/server/sv_user.c index f37cda3f..c5827ea2 100644 --- a/engine/server/sv_user.c +++ b/engine/server/sv_user.c @@ -70,7 +70,7 @@ void SV_New_f (void) // demo servers just dump the file message if (sv.state == ss_demo) { - SV_BeginDemoserver (); + SV_BeginDemoserver(); return; } diff --git a/engine/server/sv_utils.c b/engine/server/sv_utils.c index 86b1d6d2..5b331804 100644 --- a/engine/server/sv_utils.c +++ b/engine/server/sv_utils.c @@ -437,6 +437,14 @@ void PF_sound (void) SV_StartSound (NULL, entity, channel, sound_idx, volume / 255.0f, attenuation, 0 ); } +void PF_event( void ) +{ + edict_t *ent = PRVM_G_EDICT(OFS_PARM0); + + // event effects + ent->priv.sv->event = (int)PRVM_G_FLOAT(OFS_PARM1); +} + /* ================= PF_ambientsound @@ -1298,7 +1306,7 @@ PF_setstats, // #104 void setstats(entity e, float f, string stats) PF_configstring, // #105 void configstring(float num, string s) PF_makestatic, // #106 void makestatic(entity e) PF_modelframes, // #107 float model_frames(float modelindex) -NULL, // #108 +PF_event, // #108 void set_effect( entity e, float effect ) NULL, // #109 NULL, // #110 NULL, // #111 diff --git a/engine/server/sv_world.c b/engine/server/sv_world.c index 8c3ef615..c8fb695c 100644 --- a/engine/server/sv_world.c +++ b/engine/server/sv_world.c @@ -176,17 +176,17 @@ void SV_LinkEdict (edict_t *ent) if (ent->progs.sv->solid == SOLID_BBOX && !((int)ent->progs.sv->flags & FL_DEADMONSTER)) { // assume that x/y are equal and symetric - i = ent->progs.sv->maxs[0]/8; + i = ent->progs.sv->maxs[0]/SV_COORD_FRAC; if (i<1) i = 1; if (i>31) i = 31; // z is not symetric - j = (-ent->progs.sv->mins[2])/8; + j = (-ent->progs.sv->mins[2])/SV_COORD_FRAC; if (j < 1) j = 1; if (j > 31) j = 31; // and z maxs can be negative... - k = (ent->progs.sv->maxs[2]+32)/8; + k = (ent->progs.sv->maxs[2]+32)/SV_COORD_FRAC; if (k<1) k = 1; if (k>63) k = 63; ent->priv.sv->solid = (k<<10) | (j<<5) | i; diff --git a/launch/launch.plg b/launch/launch.plg deleted file mode 100644 index 7d3da586..00000000 --- a/launch/launch.plg +++ /dev/null @@ -1,16 +0,0 @@ - - -
-

Build Log

-

---------------------Configuration: launch - Win32 Debug-------------------- -

-

Command Lines

- - - -

Results

-launch.dll - 0 error(s), 0 warning(s) -
- - diff --git a/render/gl_draw.c b/render/gl_draw.c index d74eed49..5ae53713 100644 --- a/render/gl_draw.c +++ b/render/gl_draw.c @@ -279,8 +279,6 @@ void Draw_FadeScreen (void) //==================================================================== - - /* ============= Draw_StretchRaw diff --git a/render/gl_warp.c b/render/gl_warp.c index 4739d357..ef5e384f 100644 --- a/render/gl_warp.c +++ b/render/gl_warp.c @@ -228,11 +228,11 @@ void EmitWaterPolys (msurface_t *fa) os = v[3]; ot = v[4]; - s = os + r_turbsin[(int)((ot * 0.125 + rdt) * TURBSCALE) & 255]; + s = os + r_turbsin[(int)((ot * CL_COORD_FRAC + rdt) * TURBSCALE) & 255]; s += scroll; s *= (1.0/64); - t = ot + r_turbsin[(int)((os * 0.125 + rdt) * TURBSCALE) & 255]; + t = ot + r_turbsin[(int)((os * CL_COORD_FRAC + rdt) * TURBSCALE) & 255]; t *= (1.0/64); qglTexCoord2f (s, t); diff --git a/render/render.plg b/render/render.plg deleted file mode 100644 index c5158a88..00000000 --- a/render/render.plg +++ /dev/null @@ -1,16 +0,0 @@ - - -
-

Build Log

-

---------------------Configuration: render - Win32 Debug-------------------- -

-

Command Lines

- - - -

Results

-render.dll - 0 error(s), 0 warning(s) -
- - diff --git a/vprogs/compile.log b/vprogs/compile.log index 9be01d51..3cd0b589 100644 --- a/vprogs/compile.log +++ b/vprogs/compile.log @@ -1,5 +1,5 @@ ======================================================================= - Xash3D QuakeC Compiler started at Oct18 2007 [00:11:54] + Xash3D QuakeC Compiler started at Oct19 2007 [19:34:42] ======================================================================= ------------Configuration: server - Vm16 Release------------ Compiling... @@ -39,8 +39,8 @@ Linking... ‘Є®ЇЁа®ў ­® д ©«®ў: 1. server.dat - 0 error(s), 0 warning(s) -0.435 seconds elapsed +0.450 seconds elapsed ======================================================================= - Xash3D QuakeC Compiler stopped at Oct18 2007 [00:11:55] + Xash3D QuakeC Compiler stopped at Oct19 2007 [19:34:43] ======================================================================= \ No newline at end of file diff --git a/vprogs/defs.c b/vprogs/defs.c index 98e6026f..0c670211 100644 --- a/vprogs/defs.c +++ b/vprogs/defs.c @@ -323,6 +323,18 @@ vector VEC_HULL2_MAX = '32 32 64'; #define SVC_LAYOUT 4 #define SVC_INVENTORY 5 +enum +{ + EV_NONE, + EV_ITEM_RESPAWN, + EV_FOOTSTEP, + EV_FALLSHORT, + EV_FALL, + EV_FALLFAR, + EV_PLAYER_TELEPORT, + EV_OTHER_TELEPORT +}; + float TE_SPIKE = 0; float TE_SUPERSPIKE = 1; float TE_GUNSHOT = 2; diff --git a/vprogs/ents/ccam.c b/vprogs/ents/ccam.c index 8b92909d..98d80fdf 100644 --- a/vprogs/ents/ccam.c +++ b/vprogs/ents/ccam.c @@ -24,12 +24,12 @@ void () CCam = if (pev->aflag == FALSE) { pev->aflag = TRUE; - camera = create("camera", "progs/eyes.mdl", trace_endpos ); + camera = create("camera", "models/supp1.mdl", trace_endpos ); pev->trigger_field = camera; camera.classname = "camera"; camera.movetype = MOVETYPE_FLY; camera.solid = SOLID_NOT; - setmodel (camera,"progs/eyes.mdl"); + setmodel (camera,"models/supp1.mdl"); setsize (camera,'0 0 0','0 0 0'); makevectors (pev->v_angle); traceline ((pev->origin + pev->view_ofs),(((pev->origin + pev->view_ofs) + (v_forward * -64.000))), FALSE, pev); diff --git a/vprogs/ents/internal.c b/vprogs/ents/internal.c index 9b2dd042..8bbcb50f 100644 --- a/vprogs/ents/internal.c +++ b/vprogs/ents/internal.c @@ -64,14 +64,4 @@ void() IEM_usetarget = } } -}; - -void(float effect_type, vector effect_org) IEM_effects = -{ - MsgBegin(SVC_TEMP_ENTITY); - WriteByte(effect_type); - WriteCoord(effect_org_x); - WriteCoord(effect_org_y); - WriteCoord(effect_org_z); - MsgEnd( MSG_BROADCAST, effect_org, pev ); }; \ No newline at end of file diff --git a/vprogs/ents/triggers/trigger_teleport.c b/vprogs/ents/triggers/trigger_teleport.c index c648a8a3..d8be4971 100644 --- a/vprogs/ents/triggers/trigger_teleport.c +++ b/vprogs/ents/triggers/trigger_teleport.c @@ -59,15 +59,16 @@ void() trigger_teleport_think = t = find (world, targetname, pev->target); if (!t) Error("couldn't find target\n"); - - IEM_effects(TE_TELEPORT, pev->triggerer.origin); + + set_effect( t, EV_OTHER_TELEPORT ); spawn_tdeath(t.origin, pev->triggerer); setorigin(pev->triggerer, t.origin); setangles(pev->triggerer, t); + pev->triggerer->teleport_time = 0.014; - IEM_effects(TE_TELEPORT, t.origin); + set_effect( pev->triggerer, EV_PLAYER_TELEPORT ); if(pev->message) centerprint(pev->triggerer, pev->message); diff --git a/vprogs/impulses.c b/vprogs/impulses.c index 514962ef..821f32d9 100644 --- a/vprogs/impulses.c +++ b/vprogs/impulses.c @@ -28,8 +28,8 @@ void() CheckImpulses = if(pev->impulse == 150) { - IEM_effects(TE_TELEPORT, pev->origin); + set_effect( pev, EV_PLAYER_TELEPORT ); } - pev->impulse = 0; // Clear impulse list. + pev->impulse = 0; // Clear impulse list. }; \ No newline at end of file diff --git a/vprogs/main.c b/vprogs/main.c index 27c5e2cc..3a84ab2f 100644 --- a/vprogs/main.c +++ b/vprogs/main.c @@ -123,13 +123,12 @@ Precaches for the game. void() precaches = { - precache_model ("models/player.mdl"); - precache_model("progs/s_bubble.spr"); - precache_model("progs/eyes.mdl"); + precache_model ("models/player.mdl"); + precache_model("models/supp1.mdl"); // pain sounds precache_sound ("player/drown1.wav"); // drowning pain - precache_sound ("player/drown2.wav"); // drowning pain + precache_sound ("player/drown2.wav"); // drowning pain precache_sound ("player/lburn1.wav"); // slime/lava burn precache_sound ("player/lburn2.wav"); // slime/lava burn precache_sound ("player/pain1.wav"); diff --git a/vprogs/server.dat b/vprogs/server.dat deleted file mode 100644 index 0294b520..00000000 Binary files a/vprogs/server.dat and /dev/null differ diff --git a/vprogs/utils.h b/vprogs/utils.h index 0198c194..ff6c6151 100644 --- a/vprogs/utils.h +++ b/vprogs/utils.h @@ -113,5 +113,5 @@ void setstats(entity e, float f, string stats) = #104; void configstring(float num, string s) = #105; void makestatic(entity e) = #106; float model_frames(float modelindex) = #107; - +void set_effect( entity e, float effect ) = #108; \ No newline at end of file