diff --git a/Makefile b/Makefile index 8007f98..484ca0b 100644 --- a/Makefile +++ b/Makefile @@ -190,7 +190,7 @@ NGUNIX_OBJS = \ $(BUILDDIR)/snd_mem.o \ $(BUILDDIR)/snd_mix.o \ $(BUILDDIR)/snd_linux.o \ - $(BUILDDIR)/bot.o \ + $(BUILDDIR)/cl_bot.o \ $(BUILDDIR)/nvs_client.o \ $(BUILDDIR)/nvs_common.o \ $(BUILDDIR)/nvs_server.o \ @@ -563,7 +563,7 @@ $(BUILDDIR)/snd_mix.o : $(MOUNT_DIR)/../audio/snd_mix.c $(BUILDDIR)/snd_linux.o :$(MOUNT_DIR)/../audio/snd_linux.c $(DO_CC) -$(BUILDDIR)/bot.o :$(MOUNT_DIR)/bot.c +$(BUILDDIR)/cl_bot.o :$(MOUNT_DIR)/cl_bot.c $(DO_CC) $(BUILDDIR)/nvs_client.o :$(MOUNT_DIR)/../network/nvs_client.c diff --git a/engine/bot.c b/engine/cl_bot.c similarity index 95% rename from engine/bot.c rename to engine/cl_bot.c index c94088e..6df375f 100644 --- a/engine/bot.c +++ b/engine/cl_bot.c @@ -650,13 +650,13 @@ void Bot_Init (void) Cmd_AddCommand ("addbot", NextFreeClient); // eukara - loading botnames start - printf("Looking for botnames.cfg...\n"); + printf("[CLIENT] Looking for botnames.cfg...\n"); sprintf (name, "%s/botnames.cfg", com_gamedir); FILE *fd = fopen(name,"r"); if (fd == NULL) { - printf("No bot definition file found.\n"); + printf("[CLIENT] No bot definition file found.\n"); qUsesBotnames = false; return; } @@ -670,7 +670,7 @@ void Bot_Init (void) if(iMaxBotnames < svs.maxclients) // Just to be safe. { - printf("Not enough bot names in botnames.cfg\n"); + printf("[CLIENT] Not enough bot names in botnames.cfg\n"); qUsesBotnames = false; } // eukara - loading botnames end diff --git a/engine/cl_demo.c b/engine/cl_demo.c index 6f0b338..39c2fef 100644 --- a/engine/cl_demo.c +++ b/engine/cl_demo.c @@ -67,12 +67,12 @@ void CL_DemoPause_f (void) { if (!cls.demorecording) { - Con_Printf ("Not recording a demo.\n"); + Con_Printf ("[DEMO] Not recording a demo.\n"); return; } CL_DemoPaused = 1 - CL_DemoPaused; - Con_Printf(CL_DemoPaused == 1 ? "Recording Paused\n" : "Recording Resumed\n"); + Con_Printf(CL_DemoPaused == 1 ? "[DEMO] Recording Paused\n" : "[DEMO] Recording Resumed\n"); } @@ -150,7 +150,7 @@ int CL_GetMessage (void) // 2001-12-16 Various crashes changed to host errors by Maddes start // Sys_Error ("Demo message > MAX_MSGLEN"); { - Host_Error ("Demo message > MAX_MSGLEN: %i > %i", net_message.cursize, MAX_MSGLEN); + Host_Error ("[DEMO] Demo message > MAX_MSGLEN: %i > %i", net_message.cursize, MAX_MSGLEN); CL_StopPlayback (); return 0; } @@ -200,7 +200,7 @@ void CL_Stop_f (void) if (!cls.demorecording) { - Con_Printf ("Not recording a demo.\n"); + Con_Printf ("[DEMO] Not recording a demo.\n"); return; } @@ -215,7 +215,7 @@ void CL_Stop_f (void) fclose (cls.demofile); cls.demofile = NULL; cls.demorecording = false; - Con_Printf ("Completed demo\n"); + Con_Printf ("[DEMO] Completed demo\n"); } /* @@ -237,19 +237,19 @@ void CL_Record_f (void) c = Cmd_Argc(); if (c != 2 && c != 3 && c != 4) { - Con_Printf ("record [ [cd track]]\n"); + Con_Printf ("[CMD] record [ [cd track]]\n"); return; } if (strstr(Cmd_Argv(1), "..")) { - Con_Printf ("Relative pathnames are not allowed.\n"); + Con_Printf ("[CMD] Relative pathnames are not allowed.\n"); return; } if (c == 2 && cls.state == ca_connected) { - Con_Printf("Can not record - already connected to server\nClient demo recording must be started before connecting\n"); + Con_Printf("[CMD] Can not record - already connected to server\nClient demo recording must be started before connecting\n"); return; } @@ -257,7 +257,7 @@ void CL_Record_f (void) if (c == 4) { track = atoi(Cmd_Argv(3)); - Con_Printf ("Forcing CD track to %i\n", cls.forcetrack); + Con_Printf ("[CMD] Forcing CD track to %i\n", cls.forcetrack); } else track = -1; @@ -279,7 +279,7 @@ void CL_Record_f (void) cls.demofile = fopen (name, "wb"); if (!cls.demofile) { - Con_Printf ("ERROR: couldn't open.\n"); + Con_Printf ("[DEMO] ERROR: couldn't open.\n"); return; } @@ -309,7 +309,7 @@ void CL_PlayDemo_f (void) if (Cmd_Argc() != 2) { - Con_Printf ("demo_play : plays a demo\n"); // 2000-01-21 Typo correction by Maddes + Con_Printf ("[CMD] demo_play : plays a demo\n"); // 2000-01-21 Typo correction by Maddes return; } @@ -324,11 +324,11 @@ void CL_PlayDemo_f (void) strcpy (name, Cmd_Argv(1)); COM_DefaultExtension (name, ".dem"); - Con_Printf ("Playing demo from %s.\n", name); + Con_Printf ("[DEMO] Playing demo from %s.\n", name); COM_FOpenFile (name, &cls.demofile, NULL); // 2001-09-12 Returning from which searchpath a file was loaded by Maddes if (!cls.demofile) { - Con_Printf ("ERROR: couldn't open.\n"); + Con_Printf ("[DEMO] ERROR: couldn't open.\n"); cls.demonum = -1; // stop demo loop return; } @@ -367,10 +367,10 @@ void CL_FinishTimeDemo (void) time = realtime - cls.td_starttime; if (!time) time = 1; - Con_Printf ("%i frames %5.1f seconds %5.1f fps\n", frames, time, frames/time); + Con_Printf ("[DEMO] %i frames %5.1f seconds %5.1f fps\n", frames, time, frames/time); #ifdef BENCH // lei - bomb to the prompt with results - Sys_Error ("%i frames %5.1f seconds %5.1f fps\n", frames, time, frames/time); + Sys_Error ("[DEMO] %i frames %5.1f seconds %5.1f fps\n", frames, time, frames/time); #endif } @@ -388,7 +388,7 @@ void CL_TimeDemo_f (void) if (Cmd_Argc() != 2) { - Con_Printf ("timedemo : gets demo speeds\n"); + Con_Printf ("[CMD] timedemo : gets demo speeds\n"); return; } diff --git a/engine/cl_input.c b/engine/cl_input.c index f3c028e..bebdc6e 100644 --- a/engine/cl_input.c +++ b/engine/cl_input.c @@ -500,7 +500,7 @@ void CL_SendMove (usercmd_t *cmd) if (NET_SendUnreliableMessage (cls.netcon, &buf) == -1) { - Con_Printf ("CL_SendMove: lost server connection\n"); + Con_Printf ("[ENGINE] SendMove: lost server connection\n"); CL_Disconnect (); } } diff --git a/engine/cl_main.c b/engine/cl_main.c index 54ef844..d86c4f1 100644 --- a/engine/cl_main.c +++ b/engine/cl_main.c @@ -144,7 +144,7 @@ void CL_Disconnect (void) if (cls.demorecording) CL_Stop_f (); - Con_DPrintf ("Sending clc_disconnect\n"); + Con_DPrintf ("[CLIENT] Sending disconnect message\n"); SZ_Clear (&cls.message); MSG_WriteByte (&cls.message, clc_disconnect); NET_SendUnreliableMessage (cls.netcon, &cls.message); @@ -189,8 +189,8 @@ void CL_EstablishConnection (char *host) cls.netcon = NET_Connect (host); if (!cls.netcon) - Host_Error ("CL_Connect: connect failed"); - Con_DPrintf ("CL_EstablishConnection: connected to %s\n", host); + Host_Error ("[CLIENT] Connect failed"); + Con_DPrintf ("[CLIENT] Connected to %s\n", host); cls.demonum = -1; // not in the demo loop now cls.state = ca_connected; @@ -209,7 +209,7 @@ void CL_SignonReply (void) { char str[8192]; - Con_DPrintf ("CL_SignonReply: %i\n", cls.signon); + Con_DPrintf ("[CLIENT] Sign on reply %i\n", cls.signon); switch (cls.signon) { @@ -297,7 +297,7 @@ void CL_NextDemo (void) cls.demonum = 0; if (!cls.demos[cls.demonum][0]) { - Con_Printf ("No demos listed with startdemos\n"); + Con_DPrintf ("[DEMO] No demos listed with startdemos\n"); cls.demonum = -1; return; } @@ -1115,7 +1115,7 @@ int CL_ReadFromServer (void) { ret = CL_GetMessage (); if (ret == -1) - Host_Error ("CL_ReadFromServer: lost server connection"); + Host_Error ("[CLIENT] Lost server connection"); if (!ret) break; @@ -1172,12 +1172,12 @@ void CL_SendCmd (void) if (!NET_CanSendMessage (cls.netcon)) { - Con_DPrintf ("CL_WriteToServer: can't send\n"); + Con_DPrintf ("[CLIENT] Can't send message to server\n"); return; } if (NET_SendMessage (cls.netcon, &cls.message) == -1) - Host_Error ("CL_WriteToServer: lost server connection"); + Host_Error ("[CLIENT] Lost server connection"); SZ_Clear (&cls.message); } diff --git a/engine/cl_parse.c b/engine/cl_parse.c index 2f25709..8ba8f32 100644 --- a/engine/cl_parse.c +++ b/engine/cl_parse.c @@ -106,7 +106,7 @@ entity_t *CL_EntityNum (int num) { cl.max_edicts = cl_entities_min->value; } - Con_DPrintf("Allocating memory for %i entities.\n", cl.max_edicts); + Con_DPrintf("[ENGINE] Allocating memory for %i entities.\n", cl.max_edicts); cl_entities = Hunk_AllocName (cl.max_edicts*sizeof(entity_t), "cl_edicts"); memset (cl_entities, 0, cl.max_edicts*sizeof(entity_t)); @@ -120,7 +120,7 @@ entity_t *CL_EntityNum (int num) // if (num >= MAX_EDICTS) if (num >= cl.max_edicts) // 2001-09-20 Configurable entity limits by Maddes end - Host_Error ("CL_EntityNum: %i is an invalid number",num); + Host_Error ("%i is an invalid entity number",num); while (cl.num_entities<=num) { cl_entities[cl.num_entities].colormap = vid.colormap; @@ -169,7 +169,7 @@ void CL_ParseStartSoundPacket(void) // if (ent > MAX_EDICTS) if (ent > cl.max_edicts) // 2001-09-20 Configurable entity limits by Maddes end - Host_Error ("CL_ParseStartSoundPacket: ent = %i", ent); + Host_Error ("Parse Sound Packet ent = %i > %i", ent, cl.max_edicts); for (i=0 ; i<3 ; i++) pos[i] = MSG_ReadCoord (); @@ -223,7 +223,7 @@ void CL_ParseStartSoundPacket2(void) pitch = 255; if (ent > cl.max_edicts) - Host_Error ("CL_ParseStartSoundPacket2: ent = %i", ent); + Host_Error ("Parse Sound Packet ent = %i > %i", ent, cl.max_edicts); for (i=0 ; i<3 ; i++) pos[i] = MSG_ReadCoord (); @@ -261,15 +261,15 @@ void CL_KeepaliveMessage (void) switch (ret) { default: - Host_Error ("CL_KeepaliveMessage: CL_GetMessage failed"); + Host_Error ("CL_GetMessage failed"); case 0: break; // nothing waiting case 1: - Host_Error ("CL_KeepaliveMessage: received a message"); + Host_Error ("CL_KeepaliveMessage received"); break; case 2: if (MSG_ReadByte() != svc_nop) - Host_Error ("CL_KeepaliveMessage: datagram wasn't a nop"); + Host_Error ("Keepalive datagram wasn't a nop"); break; } } while (ret); @@ -284,7 +284,7 @@ void CL_KeepaliveMessage (void) lastmsg = time; // write out a nop - Con_Printf ("--> client to server keepalive\n"); + Con_Printf ("[CLIENT] .... keepalive ....\n"); MSG_WriteByte (&cls.message, clc_nop); NET_SendMessage (cls.netcon, &cls.message); @@ -375,7 +375,7 @@ void CL_ParseServerInfo (void) char model_precache[MAX_MODELS][MAX_QPATH]; char sound_precache[MAX_SOUNDS][MAX_QPATH]; - Con_DPrintf ("Serverinfo packet received.\n"); + Con_DPrintf ("[CLIENT] Serverinfo packet received\n"); // // wipe the client_state_t struct // @@ -384,7 +384,7 @@ void CL_ParseServerInfo (void) i = MSG_ReadLong (); if (i != PROTOCOL_VERSION && i != DPPROTOCOL_VERSION && i != 250) { - Con_Printf ("Server returned version %i, not %i or %i", i, DPPROTOCOL_VERSION, PROTOCOL_VERSION); + Con_Printf ("[CLIENT] Server returned version %i, not %i or %i", i, DPPROTOCOL_VERSION, PROTOCOL_VERSION); return; } // Nehahrademcompatibility = false; @@ -399,7 +399,7 @@ void CL_ParseServerInfo (void) i = MSG_ReadLong (); if (i != PROTOCOL_VERSION) { - Con_Printf ("Server returned version %i, not %i\n", i, PROTOCOL_VERSION); // 2000-01-08 Missing linefeeds fix by Maddes + Con_Printf ("[CLIENT] Server returned version %i, not %i\n", i, PROTOCOL_VERSION); // 2000-01-08 Missing linefeeds fix by Maddes return; } #endif @@ -407,7 +407,7 @@ void CL_ParseServerInfo (void) cl.maxclients = MSG_ReadByte (); if (cl.maxclients < 1 || cl.maxclients > MAX_SCOREBOARD) { - Con_Printf("Bad maxclients (%u) from server\n", cl.maxclients); + Con_Printf("[CLIENT] Bad maxclients (%u) from server\n", cl.maxclients); return; } cl.scores = Hunk_AllocName (cl.maxclients*sizeof(*cl.scores), "scores"); @@ -438,7 +438,7 @@ void CL_ParseServerInfo (void) break; if (nummodels==MAX_MODELS) { - Con_Printf ("Server sent too many model precaches\n"); + Con_Printf ("[CLIENT] WARNING: Too many model precaches\n"); return; } strcpy (model_precache[nummodels], str); @@ -454,7 +454,7 @@ void CL_ParseServerInfo (void) break; if (numsounds==MAX_SOUNDS) { - Con_Printf ("Server sent too many sound precaches\n"); + Con_Printf ("[CLIENT] WARNING: Too many sound precaches\n"); return; } strcpy (sound_precache[numsounds], str); @@ -470,7 +470,7 @@ void CL_ParseServerInfo (void) cl.model_precache[i] = Mod_ForName (model_precache[i], false); if (cl.model_precache[i] == NULL) { - Con_Printf("Model %s not found\n", model_precache[i]); + Con_Printf("[CLIENT] Model %s not found\n", model_precache[i]); return; } CL_KeepaliveMessage (); @@ -629,7 +629,7 @@ void CL_ParseUpdate (int bits) // 2001-12-16 Various crashes changed to host errors by Maddes start // Sys_Error ("i >= cl.maxclients"); { - Host_Error ("CL_ParseUpdate: i > cl.maxclients: %i > %i", i, cl.maxclients); + Host_Error ("CL_ParseUpdate %i > %i", i, cl.maxclients); return; } // 2001-12-16 Various crashes changed to host errors by Maddes end @@ -927,7 +927,7 @@ void CL_NewTranslation (int slot) // 2001-12-16 Various crashes changed to host errors by Maddes start // Sys_Error ("CL_NewTranslation: slot > cl.maxclients"); { - Host_Error ("CL_NewTranslation: slot > cl.maxclients: %i > %i", slot, cl.maxclients); + Host_Error ("CL_NewTranslation %i > %i", slot, cl.maxclients); return; } // 2001-12-16 Various crashes changed to host errors by Maddes end @@ -975,7 +975,7 @@ void CL_ParseStatic (void) { cl.max_static_edicts = cl_entities_min_static->value; } - Con_DPrintf("Allocating memory for %i static entities.\n", cl.max_static_edicts); + Con_DPrintf("[CLIENT] Allocating memory for %i static ents\n", cl.max_static_edicts); cl_static_entities = Hunk_AllocName (cl.max_static_edicts*sizeof(entity_t), "cl_ed_static"); memset (cl_static_entities, 0, cl.max_static_edicts*sizeof(entity_t)); @@ -987,7 +987,7 @@ void CL_ParseStatic (void) // if (i >= MAX_STATIC_ENTITIES) // Host_Error ("Too many static entities"); if (i >= cl.max_static_edicts) - Host_Error ("Too many static entities, max is %i", cl.max_static_edicts); + Host_Error ("Too many static ents, max is %i", cl.max_static_edicts); // 2001-09-20 Configurable entity limits by Maddes end ent = &cl_static_entities[i]; cl.num_statics++; @@ -1127,11 +1127,11 @@ void CL_ParseLimit (void) cl.max_edicts = MSG_ReadShort (); cl.max_static_edicts = MSG_ReadShort (); cl.max_temp_edicts = MSG_ReadShort (); - Con_DPrintf("Server runs with %i normal, %i static and %i temp edicts.\n", cl.max_edicts, cl.max_static_edicts, cl.max_temp_edicts); + Con_DPrintf("[INFO] MAX %i normal, %i static and %i temp edicts\n", cl.max_edicts, cl.max_static_edicts, cl.max_temp_edicts); // check values: only the normal entities are send with their index number, the others are send without indexes if (cl.max_edicts > MAX_EDICTS) { - Host_Error ("CL_ParseLimit: %i entities can not be handled, max is %i", cl.max_edicts, MAX_EDICTS); + Host_Error ("CL_ParseLimit: %i ents, max is %i", cl.max_edicts, MAX_EDICTS); } break; // 2001-09-20 Configurable entity limits by Maddes end @@ -1145,41 +1145,6 @@ void CL_ParseLimit (void) #define SHOWNET(x) if(cl_shownet->value==2)Con_Printf ("%3i:%s\n", msg_readcount-1, x); -int whatamiplaying; -void MIDIHIJACK(int i, qboolean loop) -{ - // no allegro, no midi. - - - // or is it? - -#ifdef ASS_MIDI - char trackname[512]; - loadedfile_t *fileinfo; - - - // Load our MIDI file into memory - sprintf(trackname, "sound/cdtracks/track%03i.mid", i); - fileinfo = COM_LoadHunkFile(trackname); - if (!fileinfo){ - Con_SafePrintf ("Can't load MIDI file %s\n", trackname); - MUSIC_StopSong(); // stop the dam music - whatamiplaying = 666; - return;} - - - - - whatamiplaying = i; - - - MUSIC_PlaySong( fileinfo->data, 1 ); - Con_DPrintf ("MIDI system - %s\n", MUSIC_ErrorString( MUSIC_Error ) ); - - -#endif - -} void Host_Autosavegame_f(void); extern cvar_t *autosaver; /* @@ -1268,7 +1233,7 @@ void CL_ParseServerMessage (void) break; case svc_disconnect: - Host_EndGame ("Server disconnected\n"); + Host_EndGame ("[CLIENT] Server disconnected\n"); case svc_print: Con_Printf ("%s", MSG_ReadString ()); diff --git a/engine/cmd.c b/engine/cmd.c index ec829ae..2cc30a8 100644 --- a/engine/cmd.c +++ b/engine/cmd.c @@ -291,7 +291,7 @@ void Cmd_Exec_f (void) if (Cmd_Argc () != 2) { - Con_Printf ("exec : execute a script file\n"); + Con_Printf ("[CMD] exec : execute a script file\n"); return; } @@ -305,11 +305,11 @@ void Cmd_Exec_f (void) if (!fileinfo) // 2001-09-12 Returning information about loaded file by Maddes end { - Con_Printf ("[ENGINE] Couldn't exec %s\n",Cmd_Argv(1)); + Con_Printf ("[CMD] Couldn't exec %s\n",Cmd_Argv(1)); return; } f = (char *)fileinfo->data; // 2001-09-12 Returning information about loaded file by Maddes - Con_Printf ("[ENGINE] Execing %s\n",Cmd_Argv(1)); + Con_Printf ("[CMD] Execing %s\n",Cmd_Argv(1)); Cbuf_InsertText (f); Hunk_FreeToLowMark (mark); @@ -463,16 +463,16 @@ void Cmd_List_f (void) { continue; } - Con_Printf ("%s\n", cmd->name); + Con_Printf (" %s\n", cmd->name); count++; } Con_Printf ("------------\n"); if (partial) { - Con_Printf ("%i beginning with \"%s\" out of ", count, partial); + Con_Printf ("[CMD] %i beginning with \"%s\" out of ", count, partial); } - Con_Printf ("%i commands\n", i); + Con_Printf ("[CMD] %i commands\n", i); } // 2000-01-09 CmdList command by Maddes end @@ -610,7 +610,7 @@ void Cmd_AddCommand (char *cmd_name, xcommand_t function) { if (!Q_strcasecmp (cmd_name, cmd->name)) { - Con_Printf ("Cmd_AddCommand: %s already defined\n", cmd_name); + Con_Printf ("[CMD] Can't add cmd, %s already defined\n", cmd_name); return; } } @@ -918,7 +918,7 @@ void Cmd_ExecuteString (char *text, cmd_source_t src) // check cvars if (!Cvar_Command ()) - Con_Printf ("Unknown command \"%s\"\n", Cmd_Argv(0)); + Con_Printf ("[CMD] \"%s\" unknown\n", Cmd_Argv(0)); } @@ -934,7 +934,7 @@ void Cmd_ForwardToServer (void) { if (cls.state != ca_connected) { - Con_Printf ("Can't \"%s\", not connected\n", Cmd_Argv(0)); + Con_Printf ("[CMD] Can't \"%s\", not connected\n", Cmd_Argv(0)); return; } diff --git a/engine/common.c b/engine/common.c index d97a0c0..b729c57 100644 --- a/engine/common.c +++ b/engine/common.c @@ -1185,7 +1185,6 @@ void COM_Init_Cvars (void) { registered = Cvar_Get ("registered", "0", CVAR_ORIGINAL); cmdline = Cvar_Get ("cmdline", "0", CVAR_NOTIFY|CVAR_SERVERINFO|CVAR_ORIGINAL); - Sys_Printf ("COM_Init_Cvars\n"); } // 2001-09-18 New cvar system by Maddes (Init) end @@ -1344,7 +1343,7 @@ void COM_Path_f (void) { searchpath_t *s; - Con_Printf ("Current search path:\n"); + Con_Printf ("[FILESYSTEM] Current search path:\n"); for (s=com_searchpaths ; s ; s=s->next) { if (s->pack) @@ -1373,11 +1372,11 @@ void COM_WriteFile (char *filename, void *data, int len) handle = Sys_FileOpenWrite (name); if (handle == -1) { - Sys_Printf ("[ENGINE] Failed to write to %s\n", name); + Sys_Printf ("[FILESYSTEM] Failed to write to %s\n", name); return; } - Sys_Printf ("[ENGINE] Written data to %s\n", name); + Sys_Printf ("[FILESYSTEM] Written data to %s\n", name); Sys_FileWrite (handle, data, len); Sys_FileClose (handle); } @@ -1481,7 +1480,7 @@ int COM_FindFile (char *filename, int *handle, FILE **file, searchpath_t **found for (i=0 ; inumfiles ; i++) if (!strcmp (pak->files[i].name, filename)) { // found it! - Sys_Printf ("[ENGINE] Found in PAK: %s : %s\n",pak->filename, filename); + Sys_Printf ("[FILESYSTEM] Found in PAK: %s : %s\n",pak->filename, filename); if (handle) { *handle = pak->handle; @@ -1541,7 +1540,7 @@ int COM_FindFile (char *filename, int *handle, FILE **file, searchpath_t **found strcpy (netpath, cachepath); } - Sys_Printf ("[ENGINE] Found: %s\n",netpath); + Sys_Printf ("[FILESYSTEM] Found: %s\n",netpath); com_filesize = Sys_FileOpenRead (netpath, &i); if (handle) *handle = i; @@ -1563,7 +1562,7 @@ int COM_FindFile (char *filename, int *handle, FILE **file, searchpath_t **found } - Sys_Printf ("[ENGINE] Can't find %s\n", filename); + Sys_Printf ("[FILESYSTEM] Can't find %s\n", filename); if (handle) *handle = -1; @@ -1896,7 +1895,7 @@ pack_t *COM_LoadPackFile (char *packfile) pack->numfiles = numpackfiles; pack->files = newfiles; - Con_Printf ("Added packfile %s (%i files)\n", packfile, numpackfiles); + Con_Printf ("[FILESYSTEM] Added packfile %s (%i files)\n", packfile, numpackfiles); return pack; } @@ -1977,7 +1976,7 @@ void COM_InitFilesystem (void) basedir[j-1] = 0; } - printf("Base directory set to '%s'.\n", basedir); + printf("[FILESYSTEM] Base directory set to '%s'.\n", basedir); // // -cachedir // Overrides the system supplied cache directory (NULL or /qcache) @@ -2050,7 +2049,7 @@ void COM_InitFilesystem (void) { search->pack = COM_LoadPackFile (com_argv[i]); if (!search->pack) - Sys_Error ("[ENGINE] Couldn't load PAK file: %s", com_argv[i]); + Sys_Error ("[FILESYSTEM] Couldn't load PAK file: %s", com_argv[i]); } else strcpy (search->filename, com_argv[i]); diff --git a/engine/draw.c b/engine/draw.c index be30df6..7e88dab 100644 --- a/engine/draw.c +++ b/engine/draw.c @@ -1175,13 +1175,13 @@ void MassiveLookupTablesInit (void) Sys_FileOpenRead (va("%s/tab_tint.lmp",com_gamedir), &iTablefile); if(iTablefile != -1) { - printf("\n[ENGINE] Reading alpha table... "); + printf("\n[ENGINE] Reading alpha table... "); Sys_FileRead(iTablefile, transTable, sizeof(transTable)); printf("[DONE]"); } else { - printf("\n[ENGINE] Generating alpha table... "); + printf("\n[ENGINE] Generating alpha table... "); for (l=0;l<255;l++) { for (c=0 ; c<255 ; c++) @@ -1208,7 +1208,7 @@ void MassiveLookupTablesInit (void) Sys_FileOpenRead (va("%s/tab_pal.lmp",com_gamedir), &iTablefile); if(iTablefile != -1) { - printf("\n[ENGINE] Reading 15-bit palmap... "); + printf("\n[ENGINE] Reading 15-bit palmap... "); Sys_FileRead(iTablefile, palmap, sizeof(palmap)); printf("[DONE]"); } @@ -1234,7 +1234,7 @@ void MassiveLookupTablesInit (void) Sys_FileOpenRead (va("%s/tab_dith.lmp",com_gamedir), &iTablefile); if(iTablefile != -1) { - printf("\n[ENGINE] Reading 15-bit lookup table... "); + printf("\n[ENGINE] Reading 15-bit lookup table... "); Sys_FileRead(iTablefile, ditherTable, sizeof(ditherTable)); printf("[DONE]"); } @@ -1295,7 +1295,7 @@ void MassiveLookupTablesInit (void) Sys_FileOpenRead (va("%s/tab_pal2.lmp",com_gamedir), &iTablefile); if(iTablefile != -1) { - printf("\n[ENGINE] Reading 18-bit lookup table... "); + printf("\n[ENGINE] Reading 18-bit lookup table... "); Sys_FileRead(iTablefile, palmap2, sizeof(palmap2)); printf("[DONE]"); } @@ -1326,13 +1326,13 @@ void MassiveLookupTablesInit (void) Sys_FileOpenRead (va("%s/tab_add.lmp",com_gamedir), &iTablefile); if(iTablefile != -1) { - printf("\n[ENGINE] Reading additive table... "); + printf("\n[ENGINE] Reading additive table... "); Sys_FileRead(iTablefile, addTable, sizeof(addTable)); - printf(" [DONE]"); + printf("[DONE]"); } else { - printf("\n[ENGINE] Generating additive table... "); + printf("\n[ENGINE] Generating additive table... "); for (l=0;l<255;l++) { for (c=0 ; c<255 ; c++) @@ -1345,14 +1345,14 @@ void MassiveLookupTablesInit (void) addTable[l][c] = BestColor(red,green,blue, 0, 254); } } - printf(" [DONE]\n"); + printf("[DONE]\n"); COM_WriteFile ("tab_add.lmp", addTable, sizeof(addTable)); } Sys_FileOpenRead (va("%s/tab_mul.lmp",com_gamedir), &iTablefile); if(iTablefile != -1) { - printf("\n[ENGINE] Reading multiply blend table... "); + printf("\n[ENGINE] Reading multiply blend table... "); Sys_FileRead(iTablefile, mulTable, sizeof(mulTable)); printf("[DONE]\n"); } diff --git a/engine/host.c b/engine/host.c index c545c11..67ea65b 100644 --- a/engine/host.c +++ b/engine/host.c @@ -208,7 +208,7 @@ void Host_Error (char *error, ...) static qboolean inerror = false; if (inerror) - Sys_Error ("Host_Error: recursively entered"); + Sys_Error ("[ERROR] Recursively entered"); inerror = true; SCR_EndLoadingPlaque (); // reenable screen updates @@ -216,13 +216,13 @@ void Host_Error (char *error, ...) va_start (argptr,error); vsprintf (string,error,argptr); va_end (argptr); - Con_Printf ("Host_Error: %s\n",string); + Con_Printf ("[ERROR] %s\n",string); if (sv.active) Host_ShutdownServer (false); if (cls.state == ca_dedicated) - Sys_Error ("Host_Error: %s",string); // dedicated servers exit + Sys_Error ("[ERROR] %s",string); // dedicated servers exit CL_Disconnect (); cls.demonum = -1; @@ -398,7 +398,7 @@ void Host_WriteConfiguration (void) f = fopen (va("%s/config.cfg",com_gamedir), "w"); if (!f) { - Con_Printf ("Couldn't write config.cfg.\n"); + Con_Printf ("[ENGINE] Couldn't write config.cfg.\n"); return; } @@ -408,7 +408,7 @@ void Host_WriteConfiguration (void) f = fopen (va("%s/ngunix.rc",com_gamedir), "w"); if (!f) { - Con_Printf ("Couldn't write ngunix.rc.\n"); + Con_Printf ("[ENGINE] Couldn't write ngunix.rc.\n"); return; } @@ -517,7 +517,7 @@ void SV_DropClient (qboolean crash) pr_global_struct->self = saveSelf; } - Sys_Printf ("Client %s removed\n",host_client->name); + Sys_Printf ("[SERVER] Client %s removed\n",host_client->name); } // break the net connection @@ -628,7 +628,7 @@ not reinitialize anything. */ void Host_ClearMemory (void) { - Con_DPrintf ("Clearing memory\n"); + Con_DPrintf ("[HOST] Clearing memory\n"); D_FlushCaches (); Mod_ClearAll (); if (host_hunklevel) @@ -1077,7 +1077,7 @@ void VID_SetPalette2 (unsigned char *palette) Sys_FileOpenRead (va("%s/tab_8to24.lmp",com_gamedir), &iTablefile); if(iTablefile != -1) { - printf("\n[ENGINE] Reading 8to24 lookup table... "); + printf("\n[ENGINE] Reading 8to24 lookup table... "); Sys_FileRead(iTablefile, d_8to24table, sizeof(d_8to24table)); printf("[DONE]"); } diff --git a/engine/host_cmd.c b/engine/host_cmd.c index e4821e0..419505a 100644 --- a/engine/host_cmd.c +++ b/engine/host_cmd.c @@ -60,13 +60,13 @@ void Host_QC_Exec_f (void) if (!developer->value) { - print ("Developer only functionality\n"); + print ("[CMD] qcexec: developer 1 only\n"); return; } if (Cmd_Argc() < 2) { - print ("Syntax: qcexec [self [other]]\n-1 is this client\n%i Entities available\n", sv.num_edicts); + print ("[CMD] qcexec [self [other]]\n-1 is this client\n%i Entities available\n", sv.num_edicts); return; } @@ -83,7 +83,7 @@ void Host_QC_Exec_f (void) { if (cmd_source == src_command) // called from dedicated server console { - print ("Parameter -1 only valid from clients\n", num); + print ("[CMD] Parameter -1 only valid from clients\n", num); return; } @@ -91,7 +91,7 @@ void Host_QC_Exec_f (void) } else if (num < 0 || num >= sv.num_edicts) { - print ("Entity %i for self does not exist\n", num); + print ("[CMD] qcexec: ent %i for self doesn't exist\n", num); return; } else @@ -108,7 +108,7 @@ void Host_QC_Exec_f (void) { if (cmd_source == src_command) // called from dedicated server console { - print ("Parameter -1 only valid from clients\n", num); + print ("[CMD] Parameter -1 only valid from clients\n", num); return; } @@ -116,7 +116,7 @@ void Host_QC_Exec_f (void) } else if (num < 0 || num >= sv.num_edicts) { - print ("Entity %i for other does not exist\n", num); + print ("[CMD] qcexec: ent %i for self doesn't exist\n", num); return; } else @@ -186,6 +186,7 @@ void Host_Status_f (void) else print = SV_ClientPrintf; + print ("================\n"); print ("Host: %s\n", hostname->string); // 2001-09-18 New cvar system by Maddes print ("Version: %s\n", VERSION); // 2001-10-25 QIP version in the console background by Maddes if (tcpipAvailable) @@ -215,6 +216,7 @@ void Host_Status_f (void) // 2000-04-30 NVS COMMON by Maddes end print (" %s\n", client->netconnection->address); } + print ("================\n"); } @@ -337,7 +339,7 @@ void Host_Ping_f (void) return; } - SV_ClientPrintf ("Client ping times:\n"); + SV_ClientPrintf ("[INFO] Client ping times:\n"); for (i=0, client = svs.clients ; iactive) @@ -482,12 +484,12 @@ void Host_Changelevel_f (void) if (Cmd_Argc() < 2) { - Con_Printf ("changelevel : continue game on a new level\n"); + Con_Printf ("[CMD] changelevel : continue game on a new level\n"); return; } if (!sv.active || cls.demoplayback) { - Con_Printf ("Only the server may changelevel\n"); + Con_Printf ("[CMD] Only the server may changelevel\n"); return; } @@ -507,12 +509,12 @@ void Host_Changelevel_f (void) if (Cmd_Argc() != 2) { - Con_Printf ("changelevel : continue game on a new level\n"); + Con_Printf ("[CMD] changelevel : continue game on a new level\n"); return; } if (!sv.active || cls.demoplayback) { - Con_Printf ("Only the server may changelevel\n"); + Con_Printf ("[CMD] Only the server may changelevel\n"); return; } safesaved = 0; // leilei - deprecate our autosave @@ -645,31 +647,31 @@ void Host_Savegame_f (void) if (!sv.active) { - Con_Printf ("Not playing a local game.\n"); + Con_Printf ("[CMD] save: Not playing a local game.\n"); return; } if (cl.intermission) { - Con_Printf ("Can't save in intermission.\n"); + Con_Printf ("[CMD] save: Can't save in intermission.\n"); return; } if (svs.maxclients != 1) { - Con_Printf ("Can't save multiplayer games.\n"); + Con_Printf ("[CMD] save: Can't save multiplayer games.\n"); return; } if (Cmd_Argc() != 2) { - Con_Printf ("save : save a game\n"); + Con_Printf ("[CMD] save : save a game\n"); return; } if (strstr(Cmd_Argv(1), "..")) { - Con_Printf ("Relative pathnames are not allowed.\n"); + Con_Printf ("[CMD] save: Relative pathnames are not allowed.\n"); return; } @@ -677,7 +679,7 @@ void Host_Savegame_f (void) { if (svs.clients[i].active && (svs.clients[i].edict->v.health <= 0) ) { - Con_Printf ("Can't savegame with a dead player\n"); + Con_Printf ("[SAVE] Won't save game with a dead client\n"); return; } } @@ -685,11 +687,11 @@ void Host_Savegame_f (void) sprintf (name, "%s/%s", com_gamedir, Cmd_Argv(1)); COM_DefaultExtension (name, ".sav"); - Con_Printf ("Saving game to %s...\n", name); + Con_Printf ("== Saving game to %s... ==\n", name); f = fopen (name, "w"); if (!f) { - Con_Printf ("ERROR: couldn't open.\n"); + Con_Printf ("[SAVE] ERROR: couldn't open.\n"); return; } imsaving = 1; @@ -761,7 +763,7 @@ void Host_Autosavegame_f (void) { if (svs.clients[i].active && (svs.clients[i].edict->v.health <= 0) ) { - Con_Printf ("Somehow, I tried to autosave when dead. WHAT?\n"); + Con_Printf ("[SAVE] Skipping autosave when dead...\n"); return; } } @@ -769,12 +771,12 @@ void Host_Autosavegame_f (void) sprintf (name, "%s/%s", com_gamedir, autosavename); COM_DefaultExtension (name, ".sav"); - Con_Printf ("Autosaving...\n"); + Con_Printf ("== Autosaving... ==\n"); imsaving = 1; f = fopen (name, "w"); if (!f) { - Con_Printf ("ERROR: couldn't open.\n"); + Con_Printf ("[SAVE] ERROR: couldn't open.\n"); return; } @@ -847,13 +849,13 @@ void Host_Loadgame_f (void) if (loadscreen->value > 1) SCR_BeginLoadingPlaque (); - Con_Printf ("Loading game from %s...\n", name); + Con_Printf ("== Loading game from %s... ==\n", name); imsaving = 1; f = fopen (name, "r"); if (!f) { - Con_Printf ("ERROR: couldn't open.\n"); + Con_Printf ("[SAVE] ERROR: couldn't open.\n"); return; } @@ -861,7 +863,7 @@ void Host_Loadgame_f (void) if (version != SAVEGAME_VERSION) { fclose (f); - Con_Printf ("Savegame is version %i, not %i\n", version, SAVEGAME_VERSION); + Con_Printf ("[SAVE] Savegame is version %i, not %i\n", version, SAVEGAME_VERSION); return; } fscanf (f, "%s\n", str); @@ -999,11 +1001,11 @@ void Host_LoadAutosave_f (void) if (loadscreen->value > 1) SCR_BeginLoadingPlaque (); - Con_Printf ("Loading game from %s...\n", lastsavename); + Con_Printf ("== Loading game from %s... ==\n", lastsavename); f = fopen (lastsavename, "r"); if (!f) { - Con_Printf ("ERROR: couldn't open.\n"); + Con_Printf ("[SAVE] ERROR: couldn't open.\n"); return; } @@ -1011,7 +1013,7 @@ void Host_LoadAutosave_f (void) if (version != SAVEGAME_VERSION) { fclose (f); - Con_Printf ("Savegame is version %i, not %i\n", version, SAVEGAME_VERSION); + Con_Printf ("[SAVE] Savegame is version %i, not %i\n", version, SAVEGAME_VERSION); return; } fscanf (f, "%s\n", str); @@ -1040,10 +1042,10 @@ void Host_LoadAutosave_f (void) #endif if (!sv.active) { - Con_Printf ("Couldn't load map\n"); + Con_Printf ("[SAVE] Couldn't load map\n"); return; } - sv.paused = true; // pause until all clients connect + sv.paused = true; // pause until all clients connect sv.loadgame = true; // load the light styles @@ -1183,11 +1185,11 @@ int LoadGamestate(char *level, char *startspot) sprintf (name, "%s/%s.gip", com_gamedir, level); - Con_Printf ("Loading game from %s...\n", name); + Con_Printf ("== Loading game from %s... ==\n", name); f = fopen (name, "r"); if (!f) { - Con_Printf ("ERROR: couldn't open.\n"); + Con_Printf ("[SAVE] ERROR: couldn't open.\n"); return -1; } @@ -1195,7 +1197,7 @@ int LoadGamestate(char *level, char *startspot) if (version != SAVEGAME_VERSION) { fclose (f); - Con_Printf ("Savegame is version %i, not %i\n", version, SAVEGAME_VERSION); + Con_Printf ("[ERROR] Savegame is version %i, not %i\n", version, SAVEGAME_VERSION); return -1; } fscanf (f, "%s\n", str); @@ -1280,12 +1282,12 @@ void Host_Changelevel2_f (void) if (Cmd_Argc() < 2) { - Con_Printf ("changelevel2 : continue game on a new level in the unit\n"); + Con_Printf ("[CMD] changelevel2 : continue game on a new level\n"); return; } if (!sv.active || cls.demoplayback) { - Con_Printf ("Only the server may changelevel\n"); + Con_Printf ("[CMD] Only the server may changelevel\n"); return; } @@ -1325,7 +1327,7 @@ void Host_Name_f (void) if (Cmd_Argc () == 1) { - Con_Printf ("\"name\" is \"%s\"\n", cl_name->string); + Con_Printf ("[CMD] \"name\" is \"%s\"\n", cl_name->string); return; } if (Cmd_Argc () == 2) @@ -1356,7 +1358,7 @@ void Host_Name_f (void) if (host_client->name[0] && strcmp(host_client->name, "unconnected") ) if (strcmp(host_client->name, newName) != 0) - Con_Printf ("%s renamed to %s\n", host_client->name, newName); + Con_Printf ("== %s renamed to %s ==\n", host_client->name, newName); strcpy (host_client->name, newName); host_client->edict->v.netname = host_client->name - pr_strings; @@ -1370,56 +1372,38 @@ void Host_Name_f (void) void Host_Version_f (void) { -// 2000-01-20 Enhanced version command by Maddes start void (*print) (char *fmt, ...); -// Con_Printf ("Version %4.2f\n", VERSION); -// Con_Printf ("Exe: "__TIME__" "__DATE__"\n"); - - if (cmd_source == src_command) // called on this machine + if (cmd_source == src_command) { print = Con_Printf; + print ("[INFO] Version: %s\n", VERSION); } - else // called from client + else { print = SV_ClientPrintf; - print ("Server "); + print ("[INFO] Server version: %s\n", VERSION); } - print ("Version: %s\n", VERSION); // 2001-10-25 QIP version in the console background by Maddes - print ("Exe: "__TIME__" "__DATE__"\n"); -// print ("Engine homepage: %s\n", QIP_URL); // 2001-10-25 QIP version in the console background by Maddes + print ("[INFO] Exe: "__TIME__" "__DATE__"\n"); + print ("[INFO] Highest supported NVS version: %1.2f\n", MAX_NVS_VERSION); - print ("Highest supported NVS version: %1.2f\n", MAX_NVS_VERSION); // 2000-04-30 NVS COMMON by Maddes - -// 2000-01-31 Contact cvar by Maddes start if (sv.active) { -// 2000-04-30 NVS COMMON by Maddes start if ((nvs_current_ssvc->value) || (nvs_required->value)) { print ("\n"); if (nvs_current_ssvc->value) - { - print ("Current game (PROGS.DAT) runs with NVS version %1.2f.\n", nvs_current_ssvc->value); - } - + print ("[INFO] Current game runs with NVS version %1.2f.\n", nvs_current_ssvc->value); if (nvs_required->value) - { - print ("This server only accepts %1.2f NVS compliant clients and higher.\n", nvs_required->value); - } + print ("[INFO] This server only accepts %1.2f NVS compliant clients and higher.\n", nvs_required->value); } -// 2000-04-30 NVS COMMON by Maddes end if (strlen(contact->string)) - { - print ("\nContact server admin through %s\n", contact->string); - } + + print ("\n[INFO] Contact server admin through %s\n", contact->string); } -// 2000-01-31 Contact cvar by Maddes end - -// 2000-01-20 Enhanced version command by Maddes end } #ifdef IDGODS @@ -1553,20 +1537,12 @@ void Host_Say_Team_f(void) void Host_Tell_f(void) { -// 2001-09-09 Tell command accepts player number by Maddes start char *who; char *message = NULL; qboolean byNumber = false; -// 2001-09-09 Tell command accepts player number by Maddes end client_t *client; client_t *save; int j; -// 2001-09-09 Tell command accepts player number by Maddes start -/* - char *p; - char text[64]; -*/ -// 2001-09-09 Tell command accepts player number by Maddes end if (cmd_source == src_command) { @@ -1574,14 +1550,13 @@ void Host_Tell_f(void) return; } -// 2001-09-09 Tell command accepts player number by Maddes start if (Cmd_Argc () < 3) { - SV_ClientPrintf ("Syntax: tell \n"); + SV_ClientPrintf ("[CMD] tell \n"); return; } - if (strcmp(Cmd_Argv(1), "#") == 0) // user stated a player number + if (strcmp(Cmd_Argv(1), "#") == 0) { if (Cmd_Argc() < 4) { @@ -1598,58 +1573,22 @@ void Host_Tell_f(void) } else { -// 2001-09-09 Tell command accepts player number by Maddes end if (Cmd_Argc () < 3) return; -// 2001-09-09 Tell command accepts player number by Maddes start -/* - strcpy(text, host_client->name); - strcat(text, ": "); - - p = Cmd_Args(); - -// remove quotes if present - if (*p == '"') - { - p++; - p[strlen(p)-1] = 0; - } - -// check length & truncate if necessary - j = sizeof(text) - 2 - strlen(text); // -2 for /n and null terminator - if (strlen(p) > j) - p[j] = 0; - - strcat (text, p); - strcat (text, "\n"); - - save = host_client; -*/ -// 2001-09-09 Tell command accepts player number by Maddes end for (j = 0, client = svs.clients; j < svs.maxclients; j++, client++) { if (!client->active || !client->spawned) continue; if (Q_strcasecmp(client->name, Cmd_Argv(1))) continue; -// 2001-09-09 Tell command accepts player number by Maddes start -/* - host_client = client; - SV_ClientPrintf("%s", text); -*/ -// 2001-09-09 Tell command accepts player number by Maddes end + break; } -// 2001-09-09 Tell command accepts player number by Maddes start } if (j >= svs.maxclients) - { return; - } - - // can't tell yourself! if (host_client == client) return; @@ -1658,8 +1597,8 @@ void Host_Tell_f(void) message = COM_Parse(Cmd_Args()); if (byNumber) { - message++; // skip the # - while (*message == ' ') // skip white space + message++; // skip the # + while (*message == ' ') // skip white space message++; message += strlen(Cmd_Argv(2)); // skip the number } @@ -1669,8 +1608,7 @@ void Host_Tell_f(void) save = host_client; host_client = client; - SV_ClientPrintf ("%s: %s\n", who, message); -// 2001-09-09 Tell command accepts player number by Maddes end + SV_ClientPrintf ("[%s] %s\n", who, message); host_client = save; } @@ -1741,12 +1679,9 @@ void Host_Kill_f (void) return; } -// 2001-09-09 Kill command does not work for zombie players fix by Maddes start -// if (sv_player->v.health <= 0) if ((sv_player->v.health <= 0) && (sv_player->v.deadflag != DEAD_NO)) -// 2001-09-09 Kill command does not work for zombie players fix by Maddes end { - SV_ClientPrintf ("Can't suicide -- already dead!\n"); + SV_ClientPrintf ("[HOST] Can't kill a corpse\n"); return; } @@ -1770,18 +1705,18 @@ void Host_Pause_f (void) return; } if (!pausable->value) - SV_ClientPrintf ("Pause not allowed.\n"); + SV_ClientPrintf ("[HOST] Pause not allowed\n"); else { sv.paused ^= 1; if (sv.paused) { - SV_BroadcastPrintf ("%s paused the game\n", pr_strings + sv_player->v.netname); + SV_BroadcastPrintf ("== %s paused the game ==\n", pr_strings + sv_player->v.netname); } else { - SV_BroadcastPrintf ("%s unpaused the game\n",pr_strings + sv_player->v.netname); + SV_BroadcastPrintf ("== %s unpaused the game ==\n",pr_strings + sv_player->v.netname); } // send notification to all clients @@ -1802,13 +1737,13 @@ void Host_PreSpawn_f (void) { if (cmd_source == src_command) { - Con_Printf ("prespawn is not valid from the console\n"); + Con_Printf ("[CMD] prespawn: not valid from console\n"); return; } if (host_client->spawned) { - Con_Printf ("prespawn not valid -- already spawned\n"); + Con_Printf ("[CMD] prespawn: already spawned\n"); return; } @@ -1840,13 +1775,13 @@ void Host_Spawn_f (void) if (cmd_source == src_command) { - Con_Printf ("spawn is not valid from the console\n"); + Con_Printf ("[CMD] spawn: not valid from console\n"); return; } if (host_client->spawned) { - Con_Printf ("Spawn not valid -- already spawned\n"); + Con_Printf ("[CMD] spawn: already spawned\n"); return; } @@ -1893,7 +1828,7 @@ void Host_Spawn_f (void) PR_ExecuteProgram (pr_global_struct->ClientConnect); if ((Sys_FloatTime() - host_client->netconnection->connecttime) <= sv.time) - Sys_Printf ("%s entered the game\n", host_client->name); + Sys_Printf ("== %s entered the game ==\n", host_client->name); PR_ExecuteProgram (pr_global_struct->PutClientInServer); } @@ -1994,7 +1929,7 @@ void Host_Begin_f (void) { if (cmd_source == src_command) { - Con_Printf ("begin is not valid from the console\n"); + Con_Printf ("[CMD] begin is not valid from console\n"); return; } @@ -2087,9 +2022,9 @@ void Host_Kick_f (void) message++; } if (message) - SV_ClientPrintf ("Kicked by %s: %s\n", who, message); + SV_ClientPrintf ("[HOST] Kicked by %s: %s\n", who, message); else - SV_ClientPrintf ("Kicked by %s\n", who); + SV_ClientPrintf ("[HOST] Kicked by %s\n", who); SV_DropClient (false); } @@ -2112,10 +2047,7 @@ Host_Give_f void Host_Give_f (void) { char *t; -// 2000-07-30 DJGPP compiler warning fix by Norberto Alfredo Bensa start -// int v, w; int v; -// 2000-07-30 DJGPP compiler warning fix by Norberto Alfredo Bensa end eval_t *val; if (cmd_source == src_command) @@ -2238,7 +2170,7 @@ void PrintFrameName (model_t *m, int frame) return; pframedesc = &hdr->frames[frame]; - Con_Printf ("frame %i: %s\n", frame, pframedesc->name); + Con_Printf ("[HOST] Model frame %i: %s\n", frame, pframedesc->name); } /* @@ -2314,10 +2246,10 @@ void Host_Startdemos_f (void) c = Cmd_Argc() - 1; if (c > MAX_DEMOS) { - Con_Printf ("Max %i demos in demoloop\n", MAX_DEMOS); + Con_Printf ("[DEMO] Max %i demos in demoloop\n", MAX_DEMOS); c = MAX_DEMOS; } - Con_Printf ("%i demo(s) in loop\n", c); + Con_Printf ("[DEMO] %i demo(s) in loop\n", c); for (i=1 ; ispawned) { - SV_ClientPrintf ("%s not valid -- already spawned\n", Cmd_Argv(0)); + SV_ClientPrintf ("[ENGINE] %s not valid -- already spawned\n", Cmd_Argv(0)); return; } @@ -2411,30 +2343,12 @@ void Host_Limit_Request_f (void) //============================================================================= void Fog_FogCommand_f (void); -void UselessCommand_f (void){ - int are; - - for(are=0; are<10000; are++) - Con_Printf("%%%i\n", are); - -} void MassiveLookupTablesInit (void); void InitSmooth(void); void GrabColorMapNoFB(void); void GrabColorMapAlternative(void); void GrabColorMapSaturation(void); -void Host_HideViewModel_f (void) -{ - if (cmd_source == src_command) - { - Cmd_ForwardToServer (); - return; - } - - sv_player->v.weaponmodel = ""; -} - /* ================== Host_InitCommands @@ -2475,20 +2389,15 @@ void Host_InitCommands (void) Cmd_AddCommand ("load", Host_Loadgame_f); Cmd_AddCommand ("save", Host_Savegame_f); Cmd_AddCommand ("give", Host_Give_f); - Cmd_AddCommand ("startdemos", Host_Startdemos_f); Cmd_AddCommand ("demos", Host_Demos_f); Cmd_AddCommand ("stopdemo", Host_Stopdemo_f); - Cmd_AddCommand ("viewmodel", Host_Viewmodel_f); Cmd_AddCommand ("viewframe", Host_Viewframe_f); Cmd_AddCommand ("viewnext", Host_Viewnext_f); Cmd_AddCommand ("viewprev", Host_Viewprev_f); - Cmd_AddCommand ("mcache", Mod_Print); - Cmd_AddCommand ("qcexec", Host_QC_Exec_f); // 2000-01-09 QCExec by FrikaC/Maddes - Cmd_AddCommand ("limit_request", Host_Limit_Request_f); // 2001-09-20 Configurable limits by Maddes // leilei - fog @@ -2502,5 +2411,4 @@ void Host_InitCommands (void) Cmd_AddCommand ("ng_altcolormap", GrabColorMapAlternative); Cmd_AddCommand ("ng_satcolormap", GrabColorMapSaturation); Cmd_AddCommand ("model", Host_Model_f); - Cmd_AddCommand ("hideviewmodel", Host_HideViewModel_f); } diff --git a/engine/model_common.c b/engine/model_common.c index 60d4499..f61b400 100644 --- a/engine/model_common.c +++ b/engine/model_common.c @@ -1068,31 +1068,20 @@ void Fog_ParseWorldspawn (void) } -void FogStuffs (void){ - if (fogthick){ +void FogStuffs (void) +{ + if (fogthick) fogenabled = 1; - } -else { + else + { fogenabled = 0; return; -} -// Sys_Error("YEA"); + } if (foguse) - FogTableRefresh(); - + FogTableRefresh(); } - -/* -============= -Fog_FogCommand_f - -handle the 'fog' console command -============= -*/ - - /* ============= Fog_Update @@ -1153,6 +1142,13 @@ void Fog_Update (float density, float red, float green, float blue, float time) FogTableRefresh(); } +/* +============= +Fog_FogCommand_f + +handle the 'fog' console command +============= +*/ void Fog_FogCommand_f (void) { @@ -1160,7 +1156,7 @@ void Fog_FogCommand_f (void) { default: case 1: - Con_Printf("usage:\n"); + Con_Printf("[CMD] fog usage:\n"); Con_Printf(" fog \n"); Con_Printf(" fog \n"); Con_Printf(" fog \n"); diff --git a/engine/zone.c b/engine/zone.c index ae86d2e..20cdf64 100644 --- a/engine/zone.c +++ b/engine/zone.c @@ -21,31 +21,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "globaldef.h" -//#define DYNAMIC_SIZE 0xc000 // 48K // 2001-09-20 Increased default zone by Maddes - #define ZONEID 0x1d4a11 #define MINFRAGMENT 64 -// 2001-09-20 Enhanced zone handling by Maddes start -/* -typedef struct memblock_s -{ - int size; // including the header and possibly tiny fragments - int tag; // a tag of 0 is a free block - int id; // should be ZONEID - struct memblock_s *next, *prev; - int pad; // pad to 64 bit boundary -} memblock_t; - -typedef struct -{ - int size; // total bytes malloced, including header - memblock_t blocklist; // start / end cap for linked list - memblock_t *rover; -} memzone_t; -*/ -// 2001-09-20 Enhanced zone handling by Maddes end - void Cache_FreeLow (int new_low_hunk); void Cache_FreeHigh (int new_high_hunk); @@ -66,17 +44,12 @@ all big things are allocated on the hunk. */ memzone_t *mainzone; - -//void Z_ClearZone (memzone_t *zone, int size); // 2001-09-20 Enhanced zone handling by Maddes - -// 2001-09-20 Enhanced zone handling by Maddes start typedef struct { int sentinal; int size; // including sizeof(hunk_t), -1 = not allocated char name[8]; } hunk_t; -// 2001-09-20 Enhanced zone handling by Maddes end /* ======================== @@ -107,47 +80,31 @@ void Z_ClearZone (memzone_t *zone, int size) Z_Free ======================== */ -void Z_Free (memzone_t *zone, void *ptr) // 2001-09-20 Enhanced zone handling by Maddes +void Z_Free (memzone_t *zone, void *ptr) { memblock_t *block, *other; -// 2001-09-20 Enhanced zone handling by Maddes start hunk_t *h; - h = (hunk_t *)zone; h--; -// 2001-09-20 Enhanced zone handling by Maddes end if (!ptr) - Sys_Error ("Z_Free: NULL pointer"); + Sys_Error ("[ZONE] Free: NULL pointer"); block = (memblock_t *) ( (byte *)ptr - sizeof(memblock_t)); if (block->id != ZONEID) -// 2001-09-20 Enhanced zone handling by Maddes start { -// Sys_Error ("Z_Free: freed a pointer without ZONEID"); -// 2001-09-20 QuakeC string manipulation by FrikaC/Maddes start -// Sys_Error ("Z_Free: freed a pointer without ZONEID in \"%s\"", h->name); - Con_DPrintf("Z_Free: freed a pointer without ZONEID in \"%s\"\n", h->name); + Con_DPrintf("[ZONE] Free: freed a pointer without ZONEID in \"%s\"\n", h->name); return; -// 2001-09-20 QuakeC string manipulation by FrikaC/Maddes end + } -// 2001-09-20 Enhanced zone handling by Maddes end + if (block->tag == 0) -// 2001-09-20 Enhanced zone handling by Maddes start - { -// Sys_Error ("Z_Free: freed a freed pointer"); - Sys_Error ("Z_Free: freed a freed pointer in \"%s\"", h->name); - } -// 2001-09-20 Enhanced zone handling by Maddes end - -// 2001-09-20 Enhanced zone handling by Maddes start + Sys_Error ("[ZONE] Free: freed a freed pointer in \"%s\"", h->name); if (block->zone != zone) - { - Sys_Error ("Z_Free: freed a foreign pointer in \"%s\"\n", h->name); - } -// 2001-09-20 Enhanced zone handling by Maddes end + Sys_Error ("[ZONE] Free: freed a foreign pointer in \"%s\"\n", h->name); + - block->tag = 0; // mark as free + block->tag = 0; other = block->prev; if (!other->tag) @@ -155,8 +112,8 @@ void Z_Free (memzone_t *zone, void *ptr) // 2001-09-20 Enhanced zone handling by other->size += block->size; other->next = block->next; other->next->prev = other; - if (block == zone->rover) // 2001-09-20 Enhanced zone handling by Maddes - zone->rover = other; // 2001-09-20 Enhanced zone handling by Maddes + if (block == zone->rover) + zone->rover = other; block = other; } @@ -166,8 +123,8 @@ void Z_Free (memzone_t *zone, void *ptr) // 2001-09-20 Enhanced zone handling by block->size += other->size; block->next = other->next; block->next->prev = block; - if (other == zone->rover) // 2001-09-20 Enhanced zone handling by Maddes - zone->rover = block; // 2001-09-20 Enhanced zone handling by Maddes + if (other == zone->rover) + zone->rover = block; } } @@ -177,24 +134,21 @@ void Z_Free (memzone_t *zone, void *ptr) // 2001-09-20 Enhanced zone handling by Z_Malloc ======================== */ -void *Z_Malloc (memzone_t *zone, int size) // 2001-09-20 Enhanced zone handling by Maddes +void *Z_Malloc (memzone_t *zone, int size) { void *buf; - Z_CheckHeap (zone); // DEBUG // 2001-09-20 Enhanced zone handling by Maddes - buf = Z_TagMalloc (zone, size, 1); // 2001-09-20 Enhanced zone handling by Maddes + Z_CheckHeap (zone); // DEBUG + buf = Z_TagMalloc (zone, size, 1); if (!buf) -// 2001-09-20 Enhanced zone handling by Maddes start { hunk_t *h; h = (hunk_t *)zone; h--; -// Sys_Error ("Z_Malloc: failed on allocation of %i bytes",size); - Sys_Error ("Z_Malloc: failed on allocation of %i bytes in \"%s\"", size, h->name); + Sys_Error ("[ZONE] Malloc: failed on allocation of %i bytes in \"%s\"", size, h->name); } -// 2001-09-20 Enhanced zone handling by Maddes end Q_memset (buf, 0, size); @@ -203,13 +157,13 @@ void *Z_Malloc (memzone_t *zone, int size) // 2001-09-20 Enhanced zone handling -void *Z_TagMalloc (memzone_t *zone, int size, int tag) // 2001-09-20 Enhanced zone handling by Maddes +void *Z_TagMalloc (memzone_t *zone, int size, int tag) { int extra; memblock_t *start, *rover, *new, *base; if (!tag) - Sys_Error ("Z_TagMalloc: tried to use a 0 tag"); + Sys_Error ("[ZONE] Tried to use a 0 tag"); // // scan through the block list looking for the first free block @@ -219,7 +173,7 @@ void *Z_TagMalloc (memzone_t *zone, int size, int tag) // 2001-09-20 Enhanced zo size += 4; // space for memory trash tester size = (size + 7) & ~7; // align to 8-byte boundary - base = rover = zone->rover; // 2001-09-20 Enhanced zone handling by Maddes + base = rover = zone->rover; start = base->prev; do @@ -250,13 +204,9 @@ void *Z_TagMalloc (memzone_t *zone, int size, int tag) // 2001-09-20 Enhanced zo } base->tag = tag; // no longer a free block - zone->rover = base->next; // next allocation will start looking here - // 2001-09-20 Enhanced zone handling by Maddes - base->id = ZONEID; - - base->zone = zone; // 2001-09-20 Enhanced zone handling by Maddes + base->zone = zone; // marker for memory trash testing *(int *)((byte *)base + base->size - 4) = ZONEID; @@ -274,7 +224,7 @@ void Z_Print (memzone_t *zone) { memblock_t *block; - Con_Printf ("zone size: %i location: %p\n", zone->size, zone); // 2001-09-20 Enhanced zone handling by Maddes + Con_Printf ("[ZONE] zone size: %i location: %p\n", zone->size, zone); for (block = zone->blocklist.next ; ; block = block->next) { @@ -284,11 +234,11 @@ void Z_Print (memzone_t *zone) if (block->next == &zone->blocklist) break; // all blocks have been hit if ( (byte *)block + block->size != (byte *)block->next) - Con_Printf ("ERROR: block size does not touch the next block\n"); + Con_Printf ("[ZONE] ERROR: block size does not touch the next block\n"); if ( block->next->prev != block) - Con_Printf ("ERROR: next block doesn't have proper back link\n"); + Con_Printf ("[ZONE] ERROR: next block doesn't have proper back link\n"); if (!block->tag && !block->next->tag) - Con_Printf ("ERROR: two consecutive free blocks\n"); + Con_Printf ("[ZONE] ERROR: two consecutive free blocks\n"); } } @@ -298,38 +248,26 @@ void Z_Print (memzone_t *zone) Z_CheckHeap ======================== */ -void Z_CheckHeap (memzone_t *zone) // 2001-09-20 Enhanced zone handling by Maddes +void Z_CheckHeap (memzone_t *zone) { memblock_t *block; - for (block = zone->blocklist.next ; ; block = block->next) // 2001-09-20 Enhanced zone handling by Maddes + for (block = zone->blocklist.next ; ; block = block->next) { - if (block->next == &zone->blocklist) // 2001-09-20 Enhanced zone handling by Maddes - break; // all blocks have been hit + if (block->next == &zone->blocklist) + break; // all blocks have been hit if ( (byte *)block + block->size != (byte *)block->next) - Sys_Error ("Z_CheckHeap: block size does not touch the next block\n"); + Sys_Error ("[ZONE] Block size does not touch the next block\n"); if ( block->next->prev != block) - Sys_Error ("Z_CheckHeap: next block doesn't have proper back link\n"); + Sys_Error ("[ZONE] Next block doesn't have proper back link\n"); if (!block->tag && !block->next->tag) - Sys_Error ("Z_CheckHeap: two consecutive free blocks\n"); + Sys_Error ("[ZONE] Two consecutive free blocks\n"); } } //============================================================================ #define HUNK_SENTINAL 0x1df001ed - -// 2001-09-20 Enhanced zone handling by Maddes start -/* -typedef struct -{ - int sentinal; - int size; // including sizeof(hunk_t), -1 = not allocated - char name[8]; -} hunk_t; -*/ -// 2001-09-20 Enhanced zone handling by Maddes end - byte *hunk_base; int hunk_size; @@ -355,9 +293,9 @@ void Hunk_Check (void) for (h = (hunk_t *)hunk_base ; (byte *)h != hunk_base + hunk_low_used ; ) { if (h->sentinal != HUNK_SENTINAL) - Sys_Error ("Hunk_Check: trashed sentinal"); + Sys_Error ("[ZONE] Hunk_Check: trashed sentinal"); if (h->size < 16 || h->size + (byte *)h - hunk_base > hunk_size) - Sys_Error ("Hunk_Check: bad size"); + Sys_Error ("[ZONE] Hunk_Check: bad size"); h = (hunk_t *)((byte *)h+h->size); } } @@ -413,9 +351,9 @@ void Hunk_Print (qboolean all) // run consistancy checks // if (h->sentinal != HUNK_SENTINAL) - Sys_Error ("Hunk_Check: trashed sentinal"); + Sys_Error ("[ZONE] Hunk_Check: trashed sentinal"); if (h->size < 16 || h->size + (byte *)h - hunk_base > hunk_size) - Sys_Error ("Hunk_Check: bad size"); + Sys_Error ("[ZONE] Hunk_Check: bad size"); next = (hunk_t *)((byte *)h+h->size); count++; @@ -448,7 +386,6 @@ void Hunk_Print (qboolean all) Con_Printf ("%8i total blocks\n", totalblocks); } -// 2001-09-20 Hunklist command by Maddes start /* =================== Hunk_Print_f @@ -466,7 +403,6 @@ void Hunk_Print_f(void) Hunk_Print(showall); } -// 2001-09-20 Hunklist command by Maddes end /* =================== @@ -482,12 +418,12 @@ void *Hunk_AllocName (int size, char *name) #endif if (size < 0) - Sys_Error ("Hunk_Alloc: bad size: %i", size); + Sys_Error ("[ZONE] Alloc: bad size: %i", size); size = sizeof(hunk_t) + ((size+15)&~15); if (hunk_size - hunk_low_used - hunk_high_used < size) - Sys_Error ("Hunk_Alloc: failed on %i bytes",size); + Sys_Error ("[ZONE] Alloc: failed on %i bytes",size); h = (hunk_t *)(hunk_base + hunk_low_used); hunk_low_used += size; @@ -523,7 +459,7 @@ int Hunk_LowMark (void) void Hunk_FreeToLowMark (int mark) { if (mark < 0 || mark > hunk_low_used) - Sys_Error ("Hunk_FreeToLowMark: bad mark %i", mark); + Sys_Error ("[ZONE] Bad hunk, low mark %i", mark); memset (hunk_base + mark, 0, hunk_low_used - mark); hunk_low_used = mark; } @@ -547,7 +483,7 @@ void Hunk_FreeToHighMark (int mark) Hunk_FreeToHighMark (hunk_tempmark); } if (mark < 0 || mark > hunk_high_used) - Sys_Error ("Hunk_FreeToHighMark: bad mark %i", mark); + Sys_Error ("[ZONE] Bad hunk, high mark %i", mark); memset (hunk_base + hunk_size - hunk_high_used, 0, hunk_high_used - mark); hunk_high_used = mark; } @@ -563,7 +499,7 @@ void *Hunk_HighAllocName (int size, char *name) hunk_t *h; if (size < 0) - Sys_Error ("Hunk_HighAllocName: bad size: %i", size); + Sys_Error ("[ZONE] Bad alloc name size: %i", size); if (hunk_tempactive) { @@ -579,7 +515,7 @@ void *Hunk_HighAllocName (int size, char *name) if (hunk_size - hunk_low_used - hunk_high_used < size) { - Con_Printf ("Hunk_HighAlloc: failed on %i bytes\n",size); + Con_Printf ("[ZONE] High alloc failed on %i bytes\n",size); return NULL; } @@ -729,7 +665,7 @@ void Cache_FreeHigh (int new_high_hunk) void Cache_UnlinkLRU (cache_system_t *cs) { if (!cs->lru_next || !cs->lru_prev) - Sys_Error ("Cache_UnlinkLRU: NULL link"); + Sys_Error ("[ZONE] Cache_UnlinkLRU: NULL link"); cs->lru_next->lru_prev = cs->lru_prev; cs->lru_prev->lru_next = cs->lru_next; @@ -740,7 +676,7 @@ void Cache_UnlinkLRU (cache_system_t *cs) void Cache_MakeLRU (cache_system_t *cs) { if (cs->lru_next || cs->lru_prev) - Sys_Error ("Cache_MakeLRU: active link"); + Sys_Error ("[ZONE] Cache_MakeLRU: active link"); cache_head.lru_next->lru_prev = cs; cs->lru_next = cache_head.lru_next; @@ -765,7 +701,7 @@ cache_system_t *Cache_TryAlloc (int size, qboolean nobottom) if (!nobottom && cache_head.prev == &cache_head) { if (hunk_size - hunk_high_used - hunk_low_used < size) - Sys_Error ("Cache_TryAlloc: %i is greater then free hunk", size); + Sys_Error ("[ZONE] Cache_TryAlloc: %i is greater then free hunk", size); new = (cache_system_t *) (hunk_base + hunk_low_used); memset (new, 0, sizeof(*new)); @@ -866,7 +802,7 @@ Cache_Report */ void Cache_Report (void) { - Con_DPrintf ("%4.1f megabyte data cache\n", (hunk_size - hunk_high_used - hunk_low_used) / (float)(1024*1024) ); + Con_DPrintf ("[ZONE] %4.1f megabyte data cache\n", (hunk_size - hunk_high_used - hunk_low_used) / (float)(1024*1024) ); } /* @@ -905,7 +841,7 @@ void Cache_Free (cache_user_t *c) cache_system_t *cs; if (!c->data) - Sys_Error ("Cache_Free: not allocated"); + Sys_Error ("[ZONE] Cache_Free: not allocated"); cs = ((cache_system_t *)c->data) - 1; @@ -952,10 +888,10 @@ void *Cache_Alloc (cache_user_t *c, int size, char *name) cache_system_t *cs; if (c->data) - Sys_Error ("Cache_Alloc: already allocated"); + Sys_Error ("[ZONE] Cache_Alloc: already allocated"); if (size <= 0) - Sys_Error ("Cache_Alloc: size %i", size); + Sys_Error ("[ZONE] Cache_Alloc: size %i", size); size = (size + sizeof(cache_system_t) + 15) & ~15; @@ -973,8 +909,7 @@ void *Cache_Alloc (cache_user_t *c, int size, char *name) // free the least recently used cahedat if (cache_head.lru_prev == &cache_head) - Sys_Error ("Cache_Alloc: out of memory"); - // not enough memory at all + Sys_Error ("[ZONE] Cache_Alloc: out of memory"); // not enough memory at all Cache_Free ( cache_head.lru_prev->user ); } @@ -992,10 +927,8 @@ Memory_Init void Memory_Init (void *buf, int size) { int p; -// 2001-09-20 Increased default zone by Maddes start -// int zonesize = DYNAMIC_SIZE; int zonesize = ZONE_MIN_SIZE; -// 2001-09-20 Increased default zone by Maddes end + hunk_base = buf; hunk_size = size; @@ -1007,29 +940,24 @@ void Memory_Init (void *buf, int size) if (p) { if (p < com_argc-1) - { // 2001-09-20 Increased default zone by Maddes + { zonesize = Q_atoi (com_argv[p+1]) * 1024; -// 2001-09-20 Increased default zone by Maddes start if (zonesize < ZONE_MIN_SIZE) { zonesize = ZONE_MIN_SIZE; } } -// 2001-09-20 Increased default zone by Maddes end else - Sys_Error ("Memory_Init: you must specify a size in KB after -zone"); + Sys_Error ("[ZONE] You must specify a size in KB after -zone"); } mainzone = Hunk_AllocName (zonesize, "zone"); // note only 8 chars copied Z_ClearZone (mainzone, zonesize); - Cmd_AddCommand ("hunklist", Hunk_Print_f); // 2001-09-20 Hunklist command by Maddes - Cmd_AddCommand ("cachelist", Cache_Print); // 2001-09-20 Cachelist command by Maddes + Cmd_AddCommand ("hunklist", Hunk_Print_f); + Cmd_AddCommand ("cachelist", Cache_Print); } -//allocates without clearing previous temp. -//safer than my hack that fuh moaned about... - //allocates without clearing previous temp. //safer than my hack that fuh moaned about... void *Hunk_TempAllocMore (int size) diff --git a/include/d_iface.h b/include/d_iface.h index 7a37b4c..64f08bb 100644 --- a/include/d_iface.h +++ b/include/d_iface.h @@ -171,9 +171,6 @@ void D_UpdateRects (vrect_t *prect); // FIXME: this should go away void D_PolysetUpdateTables (void); -// these are currently for internal use only, and should not be used by drivers -extern int r_skydirect; - // transparency types for D_DrawRect () #define DR_SOLID 0 #define DR_TRANSPARENT 1 diff --git a/renderer/d_init.c b/renderer/d_init.c index 05e59bd..cd222cf 100644 --- a/renderer/d_init.c +++ b/renderer/d_init.c @@ -55,9 +55,6 @@ D_Init extern cvar_t *engoo_lookuppalette; void D_Init (void) { - - r_skydirect = 1; - d_subdiv16 = Cvar_Get ("d_subdiv16", "1", CVAR_ORIGINAL); d_mipcap = Cvar_Get ("d_mipcap", "0", CVAR_ORIGINAL); d_mipscale = Cvar_Get ("d_mipscale", "1", CVAR_ORIGINAL); diff --git a/renderer/d_part.c b/renderer/d_part.c index 84a47cb..4ea65b4 100644 --- a/renderer/d_part.c +++ b/renderer/d_part.c @@ -247,9 +247,7 @@ void D_TestOurFlare (flare_t *pparticle) for (i=0 ; iamiseen = 1; - } else pparticle->amiseen = 0; } @@ -969,12 +967,8 @@ void D_DrawParticle_Add (particle_t *pparticle) for ( ; count ; count--, pz += d_zwidth, pdest += screenwidth) { - if (pz[0] <= izi) - { - + if (pz[0] <= izi) pdest[0] = addTable[pdest[0]][col]; - - } } break; @@ -984,16 +978,9 @@ void D_DrawParticle_Add (particle_t *pparticle) for ( ; count ; count--, pz += d_zwidth, pdest += screenwidth) { if (pz[0] <= izi) - { - pdest[0] = addTable[pdest[0]][col]; - } - if (pz[1] <= izi) - { - pdest[1] = addTable[pdest[1]][col]; - } } break; @@ -1003,22 +990,11 @@ void D_DrawParticle_Add (particle_t *pparticle) for ( ; count ; count--, pz += d_zwidth, pdest += screenwidth) { if (pz[0] <= izi) - { - pdest[0] = addTable[pdest[0]][col]; - } - if (pz[1] <= izi) - { - pdest[1] = addTable[pdest[1]][col]; - } - if (pz[2] <= izi) - { - pdest[2] = addTable[pdest[2]][col]; - } } break; @@ -1028,28 +1004,13 @@ void D_DrawParticle_Add (particle_t *pparticle) for ( ; count ; count--, pz += d_zwidth, pdest += screenwidth) { if (pz[0] <= izi) - { - pdest[0] =addTable[pdest[0]][col]; - } - if (pz[1] <= izi) - { - pdest[1] = addTable[pdest[1]][col]; - } - if (pz[2] <= izi) - { - pdest[2] =addTable[pdest[2]][col]; - } - if (pz[3] <= izi) - { - pdest[3] = addTable[pdest[3]][col]; - } } break; @@ -1061,17 +1022,14 @@ void D_DrawParticle_Add (particle_t *pparticle) for (i=0 ; i