]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - console.c
sys_win: Delete sys_win and conproc. We no longer use these.
[xonotic/darkplaces.git] / console.c
index ad20495cd9e47df86eb7f5e54fb0b386d42497e6..034cac0c262cb83432dcb6d952d64ecd9da95bf1 100644 (file)
--- a/console.c
+++ b/console.c
@@ -1,5 +1,6 @@
 /*
 Copyright (C) 1996-1997 Id Software, Inc.
+Copyright (C) 2000-2020 DarkPlaces contributors
 
 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License
@@ -930,9 +931,7 @@ void Con_Init (void)
        Cmd_AddCommand(CF_SHARED, "condump", Con_ConDump_f, "output console history to a file (see also log_file)");
 
        con_initialized = true;
-       // initialize console window (only used by sys_win.c)
-       Sys_InitConsole();
-       
+
        Con_Print("Console initialized.\n");
 }
 
@@ -1360,11 +1359,11 @@ void Con_MaskPrint(int additionalmask, const char *msg)
                                                *out++ = 'm';
                                        }
                                        *out++ = 0;
-                                       Sys_PrintToTerminal(printline);
+                                       Sys_Print(printline);
                                }
                                else if(sys_colortranslation.integer == 2) // Quake
                                {
-                                       Sys_PrintToTerminal(line);
+                                       Sys_Print(line);
                                }
                                else // strip
                                {
@@ -1415,7 +1414,7 @@ void Con_MaskPrint(int additionalmask, const char *msg)
                                                }
                                        }
                                        *out++ = 0;
-                                       Sys_PrintToTerminal(printline);
+                                       Sys_Print(printline);
                                }
                        }
                        // empty the line buffer
@@ -1526,7 +1525,7 @@ Modified by EvilTypeGuy eviltypeguy@qeradiant.com
 */
 static void Con_DrawInput(qbool is_console, float x, float v, float inputsize)
 {
-       int y, i, col_out, linepos, text_start, prefix_start;
+       int y, i, col_out, linepos, text_start, prefix_start = 0;
        char text[MAX_INPUTLINE + 5 + 9 + 1]; // space for ^xRGB, "say_team:" and \0
        float xo;
        size_t len_out;
@@ -1666,7 +1665,7 @@ static float Con_WordWidthFunc(void *passthrough, const char *w, size_t *length,
                return DrawQ_TextWidth(w, *length, ti->fontsize, ti->fontsize, false, ti->font);
        else
        {
-               Sys_PrintfToTerminal("Con_WordWidthFunc: can't get here (maxWidth should never be %f)\n", maxWidth);
+               Sys_Printf("Con_WordWidthFunc: can't get here (maxWidth should never be %f)\n", maxWidth);
                // Note: this is NOT a Con_Printf, as it could print recursively
                return 0;
        }
@@ -2205,10 +2204,15 @@ qbool GetMapList (const char *s, char *completedname, int completednamebufferlen
                                lumplen = BuffLittleLong(buf + 4 + 8 * LUMP_ENTITIES + 4);
                                dpsnprintf(desc, sizeof(desc), "BSP2RMQe");
                        }
-                       else
+                       else if(!memcmp(buf, "VBSP", 4))
                        {
-                               dpsnprintf(desc, sizeof(desc), "unknown%i", BuffLittleLong(buf));
+                               hl2dheader_t *header = (hl2dheader_t *)buf;
+                               lumpofs = LittleLong(header->lumps[HL2LUMP_ENTITIES].fileofs);
+                               lumplen = LittleLong(header->lumps[HL2LUMP_ENTITIES].filelen);
+                               dpsnprintf(desc, sizeof(desc), "VBSP%i", LittleLong(((int *)buf)[1]));
                        }
+                       else
+                               dpsnprintf(desc, sizeof(desc), "unknown%i", BuffLittleLong(buf));
                        strlcpy(entfilename, t->filenames[i], sizeof(entfilename));
                        memcpy(entfilename + strlen(entfilename) - 4, ".ent", 5);
                        entities = (char *)FS_LoadFile(entfilename, tempmempool, true, NULL);