]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
Too many fixes to mention. (sys_ticrate now controls packet rates, and other stuff)
authorlordhavoc <lordhavoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 23 Aug 2000 11:26:56 +0000 (11:26 +0000)
committerlordhavoc <lordhavoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 23 Aug 2000 11:26:56 +0000 (11:26 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9 d7cf8633-e32d-0410-b094-e92efae38249

24 files changed:
cl_demo.c
cl_input.c
cl_main.c
cl_parse.c
cl_tent.c
common.c
gl_draw.c
gl_poly.c
gl_rmain.c
gl_screen.c
host.c
image.c
model_alias.c
model_brush.c
model_shared.c
model_sprite.c
pr_cmds.c
pr_edict.c
pr_exec.c
snd_dma.c
snd_mem.c
sv_main.c
sv_phys.c
sys_win.c

index aaca270442332edf6bc04cfaecbada62f42e039c..13fbed5b0ad43a0fcec26737b500c0da129bc92d 100644 (file)
--- a/cl_demo.c
+++ b/cl_demo.c
@@ -130,7 +130,7 @@ int CL_GetMessage (void)
                
                net_message.cursize = LittleLong (net_message.cursize);
                if (net_message.cursize > MAX_MSGLEN)
-                       Sys_Error ("Demo message > MAX_MSGLEN");
+                       Host_Error ("Demo message > MAX_MSGLEN");
                r = fread (net_message.data, net_message.cursize, 1, cls.demofile);
                if (r != 1)
                {
index 9fa51fa7d48f4c59ca558e170195b5ed54f34135..305bc226f331b0ae545c046bc89026ab28d2eaa9 100644 (file)
@@ -343,7 +343,24 @@ void CL_SendMove (usercmd_t *cmd)
        int             bits;
        sizebuf_t       buf;
        byte    data[128];
-       
+       static double lastmovetime;
+       static float forwardmove, sidemove, upmove, total; // accumulation
+
+       forwardmove += cmd->forwardmove;
+       sidemove += cmd->sidemove;
+       upmove += cmd->upmove;
+       total++;
+       // LordHavoc: cap outgoing movement messages to sys_ticrate
+       if (realtime - lastmovetime < sys_ticrate.value)
+               return;
+       lastmovetime = realtime;
+       // average what has happened during this time
+       total = 1.0f / total;
+       forwardmove *= total;
+       sidemove *= total;
+       upmove *= total;
+       total = 0;
+
        buf.maxsize = 128;
        buf.cursize = 0;
        buf.data = data;
@@ -360,9 +377,9 @@ void CL_SendMove (usercmd_t *cmd)
        for (i=0 ; i<3 ; i++)
                MSG_WriteAngle (&buf, cl.viewangles[i]);
        
-    MSG_WriteShort (&buf, cmd->forwardmove);
-    MSG_WriteShort (&buf, cmd->sidemove);
-    MSG_WriteShort (&buf, cmd->upmove);
+    MSG_WriteShort (&buf, forwardmove);
+    MSG_WriteShort (&buf, sidemove);
+    MSG_WriteShort (&buf, upmove);
 
 //
 // send button bits
@@ -401,7 +418,7 @@ void CL_SendMove (usercmd_t *cmd)
 //
        if (++cl.movemessages <= 2)
                return;
-       
+
        if (NET_SendUnreliableMessage (cls.netcon, &buf) == -1)
        {
                Con_Printf ("CL_SendMove: lost server connection\n");
index cb2ea33079ed8adb3c123c32527f0395e76cee3e..bcd3e47c96a98f69f9d32f2db65fcef60c795d3c 100644 (file)
--- a/cl_main.c
+++ b/cl_main.c
@@ -31,8 +31,6 @@ cvar_t        cl_color = {"_cl_color", "0", true};
 cvar_t cl_shownet = {"cl_shownet","0"};        // can be 0, 1, or 2
 cvar_t cl_nolerp = {"cl_nolerp","0"};
 
-cvar_t maxfps = {"maxfps", "100"};
-
 cvar_t lookspring = {"lookspring","0", true};
 cvar_t lookstrafe = {"lookstrafe","0", true};
 cvar_t sensitivity = {"sensitivity","3", true};
@@ -803,7 +801,6 @@ void CL_Init (void)
        Cvar_RegisterVariable (&cl_anglespeedkey);
        Cvar_RegisterVariable (&cl_shownet);
        Cvar_RegisterVariable (&cl_nolerp);
-       Cvar_RegisterVariable (&maxfps);
        Cvar_RegisterVariable (&lookspring);
        Cvar_RegisterVariable (&lookstrafe);
        Cvar_RegisterVariable (&sensitivity);
index d7520d5fafbceaf4bacb8c96ab23b5a1b6d09c34..38a5751e58b7d18b269e175b0dbca405c659704f 100644 (file)
@@ -520,7 +520,7 @@ void CL_ParseUpdate (int bits)
        else
        {
                if (i > cl.maxclients)
-                       Sys_Error ("i >= cl.maxclients");
+                       Host_Error ("i >= cl.maxclients");
                ent->colormap = cl.scores[i-1].translations;
        }
 
@@ -752,7 +752,7 @@ void CL_NewTranslation (int slot)
        byte    *dest, *source;
        
        if (slot > cl.maxclients)
-               Sys_Error ("CL_NewTranslation: slot > cl.maxclients");
+               Host_Error ("CL_NewTranslation: slot > cl.maxclients");
        dest = cl.scores[slot].translations;
        source = vid.colormap;
        memcpy (dest, vid.colormap, sizeof(cl.scores[slot].translations));
@@ -956,7 +956,7 @@ void CL_ParseServerMessage (void)
                case svc_lightstyle:
                        i = MSG_ReadByte ();
                        if (i >= MAX_LIGHTSTYLES)
-                               Sys_Error ("svc_lightstyle > MAX_LIGHTSTYLES");
+                               Host_Error ("svc_lightstyle > MAX_LIGHTSTYLES");
                        strcpy (cl_lightstyle[i].map,  MSG_ReadString());
                        cl_lightstyle[i].length = strlen(cl_lightstyle[i].map);
                        break;
@@ -1051,7 +1051,7 @@ void CL_ParseServerMessage (void)
                case svc_updatestat:
                        i = MSG_ReadByte ();
                        if (i < 0 || i >= MAX_CL_STATS)
-                               Sys_Error ("svc_updatestat: %i is invalid", i);
+                               Host_Error ("svc_updatestat: %i is invalid", i);
                        cl.stats[i] = MSG_ReadLong ();;
                        break;
                        
index bbb48121066c68f142bf5d2de79843e4c151b6bc..573dc59383fda3c126fbffbf65e88ad0ac928229 100644 (file)
--- a/cl_tent.c
+++ b/cl_tent.c
@@ -470,7 +470,7 @@ void CL_ParseTEnt (void)
                break;
                
        default:
-               Sys_Error ("CL_ParseTEnt: bad type");
+               Host_Error ("CL_ParseTEnt: bad type %d", type);
        }
 }
 
index 11778fa66f1817261e5e087c1787590d81e611c6..533cf6cb46e25960a624e17f43e57b5328fab74a 100644 (file)
--- a/common.c
+++ b/common.c
@@ -768,10 +768,10 @@ void *SZ_GetSpace (sizebuf_t *buf, int length)
        if (buf->cursize + length > buf->maxsize)
        {
                if (!buf->allowoverflow)
-                       Sys_Error ("SZ_GetSpace: overflow without allowoverflow set - use -zone on the commandline for more zone memory, default: 512k (quake original default was 48k)");
+                       Host_Error ("SZ_GetSpace: overflow without allowoverflow set - use -zone on the commandline for more zone memory, default: 512k (quake original default was 48k)");
                
                if (length > buf->maxsize)
-                       Sys_Error ("SZ_GetSpace: %i is > full buffer size", length);
+                       Host_Error ("SZ_GetSpace: %i is > full buffer size", length);
                        
                buf->overflowed = true;
                Con_Printf ("SZ_GetSpace: overflow");
index 61aaf7a1ac260c1fdd34b426e00dc1859cd1487a..160ff6861e2b4481f2ccc4300c13371f8ba1846d 100644 (file)
--- a/gl_draw.c
+++ b/gl_draw.c
@@ -1100,6 +1100,18 @@ void GL_Upload32 (void *data, int width, int height,  qboolean mipmap, qboolean
        if (scaled_height > gl_max_size.value)
                scaled_height = gl_max_size.value;
 
+       if (alpha)
+       {
+               alpha = false;
+               in = data;
+               for (i = 3;i < width*height*4;i += 4)
+                       if (in[i] != 255)
+                       {
+                               alpha = true;
+                               break;
+                       }
+       }
+
        samples = alpha ? gl_alpha_format : gl_solid_format;
 
 #if 0
index 08af798dc1bee321910c9be667e8b65b70c9d673..9dad35b38306d7e40d7517a7a2331d2a6092ff69 100644 (file)
--- a/gl_poly.c
+++ b/gl_poly.c
@@ -286,7 +286,8 @@ void transpolyrender()
        //// offset by 16 depth units so decal sprites appear infront of walls
        //glPolygonOffset(1, -16);
        //glEnable(GL_POLYGON_OFFSET_FILL);
-       tpolytype = -1;
+       glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+       tpolytype = TPOLYTYPE_ALPHA;
        texnum = -1;
        /*
        if (gl_vertexarrays.value)
index dd27928cedc6ecf1d8a04678f4dbc1cb13757927..523e0920d727dbe64ca5348335e39f8347d2cd27 100644 (file)
@@ -446,7 +446,6 @@ void R_GetSpriteFrame (entity_t *currententity, mspriteframe_t **oldframe, mspri
 void GL_DrawSpriteImage (mspriteframe_t *frame, vec3_t origin, vec3_t up, vec3_t right, int red, int green, int blue, int alpha)
 {
        // LordHavoc: rewrote this to use the transparent poly system
-       // FIXME: need to use uncolored fog sprite
        transpolybegin(frame->gl_texturenum, 0, frame->gl_fogtexturenum, currententity->effects & EF_ADDITIVE ? TPOLYTYPE_ADD : TPOLYTYPE_ALPHA);
        transpolyvert(origin[0] + frame->down * up[0] + frame->left * right[0], origin[1] + frame->down * up[1] + frame->left * right[1], origin[2] + frame->down * up[2] + frame->left * right[2], 0, 1, red, green, blue, alpha);
        transpolyvert(origin[0] + frame->up * up[0] + frame->left * right[0], origin[1] + frame->up * up[1] + frame->left * right[1], origin[2] + frame->up * up[2] + frame->left * right[2], 0, 0, red, green, blue, alpha);
index a7a03d4fc5813fff1ce416381101c33e1e2c8aba..1c27259ff09c12d62d59a159f985e8372ffa7f62 100644 (file)
@@ -89,6 +89,7 @@ cvar_t                scr_showturtle = {"showturtle","0"};
 cvar_t         scr_showpause = {"showpause","1"};
 cvar_t         scr_printspeed = {"scr_printspeed","8"};
 cvar_t         gl_triplebuffer = {"gl_triplebuffer", "1", true };
+cvar_t         showfps = {"showfps", "0", true};
 
 extern cvar_t  crosshair;
 
@@ -390,6 +391,7 @@ void SCR_Init (void)
        Cvar_RegisterVariable (&scr_centertime);
        Cvar_RegisterVariable (&scr_printspeed);
        Cvar_RegisterVariable (&gl_triplebuffer);
+       Cvar_RegisterVariable (&showfps);
 
 //
 // register our commands
@@ -967,6 +969,19 @@ void SCR_UpdateScreen (void)
                M_Draw ();
        }
 
+       if (showfps.value)
+       {
+               static double currtime;
+               double newtime;
+               char temp[32];
+               int calc;
+               newtime = Sys_FloatTime();
+               calc = (int) (100.0 / (newtime - currtime));
+               sprintf(temp, "% 4i.%02i fps", calc / 100, calc % 100);
+               currtime = newtime;
+               Draw_String(vid.width - (12*8), 0, temp, 9999);
+       }
+
        V_UpdatePalette ();
 
        GL_BrightenScreen();
@@ -976,7 +991,7 @@ void SCR_UpdateScreen (void)
        if (r_speeds.value)
        {
                time2 = Sys_FloatTime ();
-               Con_Printf ("%3i ms  %4i wpoly %4i epoly %4i BSPnodes\n", (int)((time2-time1)*1000), c_brush_polys, c_alias_polys, c_nodes); 
+               Con_Printf ("%3i ms  %4i wpoly %4i epoly %4i transpoly %4i BSPnodes\n", (int)((time2-time1)*1000), c_brush_polys, c_alias_polys, currenttranspoly, c_nodes); 
        }
        GL_EndRendering ();
 }
diff --git a/host.c b/host.c
index 292f5222687334b67d28db8b88ebde26929e3b29..416d4be0f696b39d95c5d84f1b24a8d6fd88e48e 100644 (file)
--- a/host.c
+++ b/host.c
@@ -487,8 +487,6 @@ void Host_ClearMemory (void)
 
 //============================================================================
 
-extern cvar_t maxfps;
-
 /*
 ===================
 Host_FilterTime
@@ -500,12 +498,8 @@ qboolean Host_FilterTime (float time)
 {
        realtime += time;
 
-       if (maxfps.value < 5) // LordHavoc: sanity checking
-               maxfps.value = 5;
-       if (maxfps.value > 1000) // LordHavoc: sanity checking
-               maxfps.value = 1000;
-       if (!cls.timedemo && realtime - oldrealtime < (1.0 / maxfps.value))
-               return false;           // framerate is too high
+//     if (!cls.timedemo && realtime - oldrealtime < (1.0 / 72.0))
+//             return false;           // framerate is too high
 
        host_frametime = (realtime - oldrealtime) * slowmo.value; // LordHavoc: slowmo cvar
        oldrealtime = realtime;
@@ -619,10 +613,17 @@ void Host_ServerFrame (void)
 
 #else
 
+double frametimetotal = 0, lastservertime = 0;
 void Host_ServerFrame (void)
 {
-// run the world state 
-       pr_global_struct->frametime = host_frametime;
+       frametimetotal += host_frametime;
+       // LordHavoc: cap server at sys_ticrate in listen games
+       if (!isDedicated && ((realtime - lastservertime) < sys_ticrate.value))
+               return;
+// run the world state
+       pr_global_struct->frametime = frametimetotal;
+       frametimetotal = 0;
+//     pr_global_struct->frametime = host_frametime;
 
 // set the time and clear the general datagram
        SV_ClearDatagram ();
diff --git a/image.c b/image.c
index a32d58a40599b498b156a612e48136450fd01aaf..f30487dee41c1e3bf496ba3572168057c0d73c20 100644 (file)
--- a/image.c
+++ b/image.c
@@ -180,11 +180,11 @@ byte* LoadTGA (FILE *fin, int matchwidth, int matchheight)
 
        if (targa_header.image_type!=2 
                && targa_header.image_type!=10) 
-               Sys_Error ("LoadTGA: Only type 2 and 10 targa RGB images supported\n");
+               Host_Error ("LoadTGA: Only type 2 and 10 targa RGB images supported\n");
 
        if (targa_header.colormap_type !=0 
                || (targa_header.pixel_size!=32 && targa_header.pixel_size!=24))
-               Sys_Error ("Texture_LoadTGA: Only 32 or 24 bit images supported (no colormaps)\n");
+               Host_Error ("Texture_LoadTGA: Only 32 or 24 bit images supported (no colormaps)\n");
 
        columns = targa_header.width;
        rows = targa_header.height;
index 05a61b0826fd8832ebac3be1a233272d59659fc4..4ea3403bb2972390cb017d1ba74d063a98a1e34e 100644 (file)
@@ -288,7 +288,7 @@ void *Mod_LoadAllSkins (int numskins, daliasskintype_t *pskintype, int bytesperp
        skin = (byte *)(pskintype + 1);
 
        if (numskins < 1 || numskins > MAX_SKINS)
-               Sys_Error ("Mod_LoadAliasModel: Invalid # of skins: %d\n", numskins);
+               Host_Error ("Mod_LoadAliasModel: Invalid # of skins: %d\n", numskins);
 
        s = pheader->skinwidth * pheader->skinheight;
 
@@ -656,9 +656,9 @@ void Mod_LoadQ2AliasModel (model_t *mod, void *buffer)
                        tris->v[j] = pouttriangles->index_xyz[j] = LittleShort (pintriangles->index_xyz[j]);
                        pouttriangles->index_st[j] = LittleShort (pintriangles->index_st[j]);
                        if (pouttriangles->index_xyz[j] >= pheader->num_xyz)
-                               Sys_Error ("%s has invalid vertex indices", mod->name);
+                               Host_Error ("%s has invalid vertex indices", mod->name);
                        if (pouttriangles->index_st[j] >= pheader->num_st)
-                               Sys_Error ("%s has invalid vertex indices", mod->name);
+                               Host_Error ("%s has invalid vertex indices", mod->name);
                }
                pintriangles++;
                pouttriangles++;
index 4fa418f3710256877a559e7c94bebccab59ac885..e62b5272bfd0491aa021b5ef6edf59f8ab600660 100644 (file)
@@ -166,7 +166,7 @@ void Mod_LoadTextures (lump_t *l)
                        mt->offsets[j] = LittleLong (mt->offsets[j]);
                
                if ( (mt->width & 15) || (mt->height & 15) )
-                       Sys_Error ("Texture %s is not 16 aligned", mt->name);
+                       Host_Error ("Texture %s is not 16 aligned", mt->name);
                // LordHavoc: rewriting the map texture loader for GLQuake
                tx = Hunk_AllocName (sizeof(texture_t), loadname );
                loadmodel->textures[i] = tx;
@@ -179,11 +179,12 @@ void Mod_LoadTextures (lump_t *l)
                freeimage = TRUE;
                bytesperpixel = 4;
                fullbrights = FALSE;
-               transparent = FALSE;
-               data = loadimagepixels(mt->name, FALSE, tx->width, tx->height);
+               transparent = TRUE;
+               data = loadimagepixels(mt->name, FALSE, 0, 0); //tx->width, tx->height);
                if (!data) // no external texture found
                {
                        freeimage = FALSE;
+                       transparent = FALSE;
                        bytesperpixel = 1;
                        if (!hlbsp && mt->offsets[0]) // texture included
                        {
@@ -206,14 +207,10 @@ void Mod_LoadTextures (lump_t *l)
                }
                else
                {
-                       for (j = 0;j < image_width*image_height;j++)
-                               if (data[j*4+3] < 255)
-                               {
-                                       transparent = TRUE;
-                                       break;
-                               }
+                       tx->width = image_width;
+                       tx->height = image_height;
                }
-               if (!hlbsp && !strncmp(mt->name,"sky",3)) // LordHavoc: HL sky textures are entirely unrelated
+               if (!hlbsp && !strncmp(mt->name,"sky",3) && tx->width == 256 && tx->height == 128) // LordHavoc: HL sky textures are entirely unrelated
                {
                        tx->transparent = FALSE;
                        R_InitSky (data, bytesperpixel);
@@ -328,7 +325,7 @@ void Mod_LoadTextures (lump_t *l)
                                        altmax = num+1;
                        }
                        else
-                               Sys_Error ("Bad animating texture %s", tx->name);
+                               Host_Error ("Bad animating texture %s", tx->name);
                }
                
 #define        ANIM_CYCLE      2
@@ -337,7 +334,7 @@ void Mod_LoadTextures (lump_t *l)
                {
                        tx2 = anims[j];
                        if (!tx2)
-                               Sys_Error ("Missing frame %i of %s",j, tx->name);
+                               Host_Error ("Missing frame %i of %s",j, tx->name);
                        tx2->anim_total = max * ANIM_CYCLE;
                        tx2->anim_min = j * ANIM_CYCLE;
                        tx2->anim_max = (j+1) * ANIM_CYCLE;
@@ -349,7 +346,7 @@ void Mod_LoadTextures (lump_t *l)
                {
                        tx2 = altanims[j];
                        if (!tx2)
-                               Sys_Error ("Missing frame %i of %s",j, tx->name);
+                               Host_Error ("Missing frame %i of %s",j, tx->name);
                        tx2->anim_total = altmax * ANIM_CYCLE;
                        tx2->anim_min = j * ANIM_CYCLE;
                        tx2->anim_max = (j+1) * ANIM_CYCLE;
@@ -471,7 +468,7 @@ void Mod_LoadVertexes (lump_t *l)
 
        in = (void *)(mod_base + l->fileofs);
        if (l->filelen % sizeof(*in))
-               Sys_Error ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
+               Host_Error ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
        count = l->filelen / sizeof(*in);
        out = Hunk_AllocName ( count*sizeof(*out), loadname);   
 
@@ -499,7 +496,7 @@ void Mod_LoadSubmodels (lump_t *l)
 
        in = (void *)(mod_base + l->fileofs);
        if (l->filelen % sizeof(*in))
-               Sys_Error ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
+               Host_Error ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
        count = l->filelen / sizeof(*in);
        out = Hunk_AllocName ( count*sizeof(*out), loadname);   
 
@@ -535,7 +532,7 @@ void Mod_LoadEdges (lump_t *l)
 
        in = (void *)(mod_base + l->fileofs);
        if (l->filelen % sizeof(*in))
-               Sys_Error ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
+               Host_Error ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
        count = l->filelen / sizeof(*in);
        out = Hunk_AllocName ( (count + 1) * sizeof(*out), loadname);   
 
@@ -564,7 +561,7 @@ void Mod_LoadTexinfo (lump_t *l)
 
        in = (void *)(mod_base + l->fileofs);
        if (l->filelen % sizeof(*in))
-               Sys_Error ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
+               Host_Error ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
        count = l->filelen / sizeof(*in);
        out = Hunk_AllocName ( count*sizeof(*out), loadname);   
 
@@ -604,7 +601,7 @@ void Mod_LoadTexinfo (lump_t *l)
                else
                {
                        if (miptex >= loadmodel->numtextures)
-                               Sys_Error ("miptex >= loadmodel->numtextures");
+                               Host_Error ("miptex >= loadmodel->numtextures");
                        out->texture = loadmodel->textures[miptex];
                        if (!out->texture)
                        {
@@ -666,7 +663,7 @@ void CalcSurfaceExtents (msurface_t *s)
                s->texturemins[i] = bmins[i] * 16;
                s->extents[i] = (bmaxs[i] - bmins[i]) * 16;
                if ( !(tex->flags & TEX_SPECIAL) && s->extents[i] > 512 /* 256 */ )
-                       Sys_Error ("Bad surface extents");
+                       Host_Error ("Bad surface extents");
        }
 }
 
@@ -688,7 +685,7 @@ void Mod_LoadFaces (lump_t *l)
 
        in = (void *)(mod_base + l->fileofs);
        if (l->filelen % sizeof(*in))
-               Sys_Error ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
+               Host_Error ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
        count = l->filelen / sizeof(*in);
        out = Hunk_AllocName ( count*sizeof(*out), loadname);   
 
@@ -787,7 +784,7 @@ void Mod_LoadNodes (lump_t *l)
 
        in = (void *)(mod_base + l->fileofs);
        if (l->filelen % sizeof(*in))
-               Sys_Error ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
+               Host_Error ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
        count = l->filelen / sizeof(*in);
        out = Hunk_AllocName ( count*sizeof(*out), loadname);   
 
@@ -834,7 +831,7 @@ void Mod_LoadLeafs (lump_t *l)
 
        in = (void *)(mod_base + l->fileofs);
        if (l->filelen % sizeof(*in))
-               Sys_Error ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
+               Host_Error ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
        count = l->filelen / sizeof(*in);
        out = Hunk_AllocName ( count*sizeof(*out), loadname);   
 
@@ -891,7 +888,7 @@ void Mod_LoadClipnodes (lump_t *l)
 
        in = (void *)(mod_base + l->fileofs);
        if (l->filelen % sizeof(*in))
-               Sys_Error ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
+               Host_Error ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
        count = l->filelen / sizeof(*in);
        out = Hunk_AllocName ( count*sizeof(*out), loadname);   
 
@@ -982,7 +979,7 @@ void Mod_LoadMarksurfaces (lump_t *l)
        
        in = (void *)(mod_base + l->fileofs);
        if (l->filelen % sizeof(*in))
-               Sys_Error ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
+               Host_Error ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
        count = l->filelen / sizeof(*in);
        out = Hunk_AllocName ( count*sizeof(*out), loadname);   
 
@@ -993,7 +990,7 @@ void Mod_LoadMarksurfaces (lump_t *l)
        {
                j = LittleShort(in[i]);
                if (j >= loadmodel->numsurfaces)
-                       Sys_Error ("Mod_ParseMarksurfaces: bad surface number");
+                       Host_Error ("Mod_ParseMarksurfaces: bad surface number");
                out[i] = loadmodel->surfaces + j;
        }
 }
@@ -1010,7 +1007,7 @@ void Mod_LoadSurfedges (lump_t *l)
        
        in = (void *)(mod_base + l->fileofs);
        if (l->filelen % sizeof(*in))
-               Sys_Error ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
+               Host_Error ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
        count = l->filelen / sizeof(*in);
        out = Hunk_AllocName ( count*sizeof(*out), loadname);   
 
@@ -1037,7 +1034,7 @@ void Mod_LoadPlanes (lump_t *l)
        
        in = (void *)(mod_base + l->fileofs);
        if (l->filelen % sizeof(*in))
-               Sys_Error ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
+               Host_Error ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
        count = l->filelen / sizeof(*in);
        out = Hunk_AllocName ( count*2*sizeof(*out), loadname); 
 
@@ -1078,7 +1075,7 @@ void Mod_LoadBrushModel (model_t *mod, void *buffer)
 
        i = LittleLong (header->version);
        if (i != BSPVERSION & i != 30)
-               Sys_Error ("Mod_LoadBrushModel: %s has wrong version number (%i should be %i or 30 (HalfLife))", mod->name, i, BSPVERSION);
+               Host_Error ("Mod_LoadBrushModel: %s has wrong version number (%i should be %i or 30 (HalfLife))", mod->name, i, BSPVERSION);
        hlbsp = i == 30;
        halflifebsp.value = hlbsp;
 
index 9d16ee22101694e3746df9b9dd4b2959f55c32aa..ea85c5891d5f84cf6af494466701605c183f7aa2 100644 (file)
@@ -71,7 +71,7 @@ void *Mod_Extradata (model_t *mod)
        Mod_LoadModel (mod, true);
        
        if (!mod->cache.data)
-               Sys_Error ("Mod_Extradata: caching failed");
+               Host_Error ("Mod_Extradata: caching failed");
        return mod->cache.data;
 }
 
@@ -102,7 +102,7 @@ model_t *Mod_FindName (char *name)
        model_t *mod;
        
        if (!name[0])
-               Sys_Error ("Mod_ForName: NULL name");
+               Host_Error ("Mod_ForName: NULL name");
                
 //
 // search the currently loaded models
@@ -114,7 +114,7 @@ model_t *Mod_FindName (char *name)
        if (i == mod_numknown)
        {
                if (mod_numknown == MAX_MOD_KNOWN)
-                       Sys_Error ("mod_numknown == MAX_MOD_KNOWN");
+                       Host_Error ("mod_numknown == MAX_MOD_KNOWN");
                strcpy (mod->name, name);
                mod->needload = true;
                mod_numknown++;
index 6e2d784056bc7d0bd9ddcb73f76d866513ef3087..430b18fb42aaff809088cd158e78d638224d390f 100644 (file)
@@ -226,7 +226,7 @@ void Mod_LoadSpriteModel (model_t *mod, void *buffer)
 // load the frames
 //
        if (numframes < 1)
-               Sys_Error ("Mod_LoadSpriteModel: Invalid # of frames: %d\n", numframes);
+               Host_Error ("Mod_LoadSpriteModel: Invalid # of frames: %d\n", numframes);
 
        mod->numframes = numframes;
 
index d8b63930fc4d03b0fee22a30aeb771d0b6613a91..861054f6c67b25eded772c11d6f95d50de85e760 100644 (file)
--- a/pr_cmds.c
+++ b/pr_cmds.c
@@ -652,13 +652,13 @@ void PF_sound (void)
        attenuation = G_FLOAT(OFS_PARM4);
        
        if (volume < 0 || volume > 255)
-               Sys_Error ("SV_StartSound: volume = %i", volume);
+               Host_Error ("SV_StartSound: volume = %i", volume);
 
        if (attenuation < 0 || attenuation > 4)
-               Sys_Error ("SV_StartSound: attenuation = %f", attenuation);
+               Host_Error ("SV_StartSound: attenuation = %f", attenuation);
 
        if (channel < 0 || channel > 7)
-               Sys_Error ("SV_StartSound: channel = %i", channel);
+               Host_Error ("SV_StartSound: channel = %i", channel);
 
        SV_StartSound (entity, channel, sample, volume, attenuation);
 }
index d327821d53e3ff2fac629424604ad21082a69936..27c924c30f62d83113e7ed1ba778af86d0917cf7 100644 (file)
@@ -207,7 +207,7 @@ edict_t *ED_Alloc (void)
        }
        
        if (i == MAX_EDICTS)
-               Sys_Error ("ED_Alloc: no free edicts");
+               Host_Error ("ED_Alloc: no free edicts");
                
        sv.num_edicts++;
        e = EDICT_NUM(i);
@@ -1033,7 +1033,7 @@ void ED_LoadFromFile (char *data)
                if (!data)
                        break;
                if (com_token[0] != '{')
-                       Sys_Error ("ED_LoadFromFile: found %s when expecting {",com_token);
+                       Host_Error ("ED_LoadFromFile: found %s when expecting {",com_token);
 
                if (!ent)
                        ent = EDICT_NUM(0);
@@ -1323,7 +1323,7 @@ void PR_Init (void)
 // LordHavoc: turned EDICT_NUM into a #define for speed reasons
 edict_t *EDICT_NUM_ERROR(int n)
 {
-       Sys_Error ("EDICT_NUM: bad number %i", n);
+       Host_Error ("EDICT_NUM: bad number %i", n);
        return NULL;
 }
 /*
@@ -1343,6 +1343,6 @@ int NUM_FOR_EDICT(edict_t *e)
        b = b / pr_edict_size;
        
        if (b < 0 || b >= sv.num_edicts)
-               Sys_Error ("NUM_FOR_EDICT: bad pointer");
+               Host_Error ("NUM_FOR_EDICT: bad pointer");
        return b;
 }
index 4a319e6966b177f53094bafd1262c33d75d8d303..64abde5aab613476719e03fca55130f211c8b5d8 100644 (file)
--- a/pr_exec.c
+++ b/pr_exec.c
@@ -335,7 +335,7 @@ int PR_LeaveFunction (void)
        int             i, c;
 
        if (pr_depth <= 0)
-               Sys_Error ("prog stack underflow");
+               Host_Error ("prog stack underflow");
 
 // restore locals from the stack
        c = pr_xfunction->locals;
index b04c1a3085ce0ac6522e29ce257557e1e6ab467b..e5f69677923383002d10219dfed67651f1d31018 100644 (file)
--- a/snd_dma.c
+++ b/snd_dma.c
@@ -286,10 +286,10 @@ sfx_t *S_FindName (char *name)
        sfx_t   *sfx;
 
        if (!name)
-               Sys_Error ("S_FindName: NULL\n");
+               Host_Error ("S_FindName: NULL\n");
 
        if (strlen(name) >= MAX_QPATH)
-               Sys_Error ("Sound name too long: %s", name);
+               Host_Error ("Sound name too long: %s", name);
 
 // see if already loaded
        for (i=0 ; i < num_sfx ; i++)
index 5ddef73217335bb7548cdf80c78ecdf2b58498a8..be03af6ae5a14fb4a961ea86001b50d8dd137271 100644 (file)
--- a/snd_mem.c
+++ b/snd_mem.c
@@ -391,7 +391,7 @@ wavinfo_t GetWavinfo (char *name, byte *wav, int wavlength)
        if (info.samples)
        {
                if (samples < info.samples)
-                       Sys_Error ("Sound %s has a bad loop length", name);
+                       Host_Error ("Sound %s has a bad loop length", name);
        }
        else
                info.samples = samples;
index aa8d21ef8d89a9daa2ebe867943e587a24a63821..96c1f9ec741083120bba6a5d7a9467b8d1483448 100644 (file)
--- a/sv_main.c
+++ b/sv_main.c
@@ -124,13 +124,13 @@ void SV_StartSound (edict_t *entity, int channel, char *sample, int volume,
        int                     ent;
        
        if (volume < 0 || volume > 255)
-               Sys_Error ("SV_StartSound: volume = %i", volume);
+               Host_Error ("SV_StartSound: volume = %i", volume);
 
        if (attenuation < 0 || attenuation > 4)
-               Sys_Error ("SV_StartSound: attenuation = %f", attenuation);
+               Host_Error ("SV_StartSound: attenuation = %f", attenuation);
 
        if (channel < 0 || channel > 7)
-               Sys_Error ("SV_StartSound: channel = %i", channel);
+               Host_Error ("SV_StartSound: channel = %i", channel);
 
        if (sv.datagram.cursize > MAX_DATAGRAM-16)
                return; 
@@ -1055,7 +1055,7 @@ int SV_ModelIndex (char *name)
                if (!strcmp(sv.model_precache[i], name))
                        return i;
        if (i==MAX_MODELS || !sv.model_precache[i])
-               Sys_Error ("SV_ModelIndex: model %s not precached", name);
+               Host_Error ("SV_ModelIndex: model %s not precached", name);
        return i;
 }
 
index d6ad3d263dc8ee6f245f26661397d392e0b091f4..4b0d99b8fdb167ef533ad9a7f3caf1cd10bc09d7 100644 (file)
--- a/sv_phys.c
+++ b/sv_phys.c
@@ -287,7 +287,7 @@ int SV_FlyMove (edict_t *ent, float time, trace_t *steptrace)
                         break;         // moved the entire distance
 
                if (!trace.ent)
-                       Sys_Error ("SV_FlyMove: !trace.ent");
+                       Host_Error ("SV_FlyMove: !trace.ent");
 
                if (trace.plane.normal[2] > 0.7)
                {
@@ -1093,7 +1093,7 @@ void SV_Physics_Client (edict_t   *ent, int num)
                break;
                
        default:
-               Sys_Error ("SV_Physics_client: bad movetype %i", (int)ent->v.movetype);
+               Host_Error ("SV_Physics_client: bad movetype %i", (int)ent->v.movetype);
        }
 
 //
@@ -1391,7 +1391,7 @@ void SV_Physics (void)
                || ent->v.movetype == MOVETYPE_FLYMISSILE)
                        SV_Physics_Toss (ent);
                else
-                       Sys_Error ("SV_Physics: bad movetype %i", (int)ent->v.movetype);                        
+                       Host_Error ("SV_Physics: bad movetype %i", (int)ent->v.movetype);                       
        }
        
        if (pr_global_struct->force_retouch)
index 7a9d682ed30ff5dd94395bda406152aa4eeff204..d87240bd83ce164b61fbcbbabebff84b92bac968 100644 (file)
--- a/sys_win.c
+++ b/sys_win.c
@@ -176,7 +176,7 @@ int Sys_FileOpenWrite (char *path)
 
        f = fopen(path, "wb");
        if (!f)
-               Sys_Error ("Error opening %s: %s", path,strerror(errno));
+               Host_Error ("Error opening %s: %s", path,strerror(errno));
        sys_handles[i] = f;
        
        VID_ForceLockState (t);
@@ -270,7 +270,7 @@ void Sys_MakeCodeWriteable (unsigned long startaddr, unsigned long length)
        DWORD  flOldProtect;
 
        if (!VirtualProtect((LPVOID)startaddr, length, PAGE_READWRITE, &flOldProtect))
-               Sys_Error("Protection change failed\n");
+               Sys_Error("Protection change failed\n");
 }
 
 
@@ -680,8 +680,6 @@ void SleepUntilInput (int time)
 }
 
 
-extern cvar_t maxfps;
-
 /*
 ==================
 WinMain
@@ -697,7 +695,7 @@ HWND                hwnd_dialog;
 int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
 {
        quakeparms_t    parms;
-       double                  time, oldtime, newtime, timediff;
+       double                  time, oldtime, newtime/*, timediff*/;
        MEMORYSTATUS    lpBuffer;
        static  char    cwd[1024];
        int                             t;
@@ -874,10 +872,6 @@ int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLin
     /* main window message loop */
        while (1)
        {
-               if (maxfps.value < 5) // LordHavoc: sanity checking
-                       maxfps.value = 5;
-               if (maxfps.value > 1000) // LordHavoc: sanity checking
-                       maxfps.value = 1000;
                if (isDedicated)
                {
                        newtime = Sys_FloatTime ();
@@ -902,6 +896,7 @@ int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLin
                        {
                                SleepUntilInput (NOT_FOCUS_SLEEP);
                        }
+                       /*
                        else if (!cls.timedemo && time < (timediff = 1.0 / maxfps.value))
                        {
                                newtime = Sys_FloatTime ();
@@ -914,6 +909,7 @@ int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLin
                                        time = newtime - oldtime;
                                }
                        }
+                       */
 
                        newtime = Sys_FloatTime ();
                        time = newtime - oldtime;