diff --git a/engine/client/cl_input.c b/engine/client/cl_input.c index 46c3e80f..ec9b655a 100644 --- a/engine/client/cl_input.c +++ b/engine/client/cl_input.c @@ -220,7 +220,7 @@ void IN_Impulse (void) int best, i, imp, items; - + char *c; int pnum; c = Cmd_Argv(0); @@ -275,7 +275,7 @@ void IN_Impulse (void) best = 8; } } - + if (best) newimp = best; } diff --git a/engine/client/cl_parse.c b/engine/client/cl_parse.c index 68a97277..c66b58d3 100644 --- a/engine/client/cl_parse.c +++ b/engine/client/cl_parse.c @@ -3591,10 +3591,16 @@ extern cvar_t cl_chatsound, cl_nofake; return true; } -char printtext[1024]; +char printtext[2048]; void CL_ParsePrint(char *msg, int level) { - strncat(printtext, msg, sizeof(printtext)-1); + if (strlen(printtext) + strlen(msg) >= sizeof(printtext)) + { + Con_Printf("%s", printtext); + Q_strncpyz(printtext, msg, sizeof(printtext)); + } + else + strcat(printtext, msg); //safe due to size on if. while((msg = strchr(printtext, '\n'))) { *msg = '\0'; diff --git a/engine/client/clq2_ents.c b/engine/client/clq2_ents.c index a105bcb5..555e043e 100644 --- a/engine/client/clq2_ents.c +++ b/engine/client/clq2_ents.c @@ -941,7 +941,7 @@ struct model_s *S_RegisterSexedModel (entity_state_t *ent, char *base) void V_AddLight (vec3_t org, float quant, float r, float g, float b) { - CL_NewDlightRGB (0, org[0], org[1], org[2], quant, 0, r, g, b); + CL_NewDlightRGB (0, org[0], org[1], org[2], quant, -0.1, r, g, b); } /* =============== diff --git a/engine/client/menu.c b/engine/client/menu.c index b673ab5e..146be26a 100644 --- a/engine/client/menu.c +++ b/engine/client/menu.c @@ -892,8 +892,6 @@ void M_Init (void) M_Serverlist_Init(); #endif M_Script_Init(); - - XWindows_Init(); } @@ -966,10 +964,6 @@ void M_Draw (int uimenu) M_Media_Draw (); break; - case m_xwindows: - XWindows_Draw(); - break; - case m_complex: M_Complex_Draw (); break; @@ -1021,10 +1015,6 @@ void M_Keydown (int key) M_Media_Key (key); return; - case m_xwindows: - XWindows_Key(key); - return; - case m_complex: M_Complex_Key (key); return; @@ -1046,9 +1036,6 @@ void M_Keyup (int key) { switch (m_state) { - case m_xwindows: - XWindows_Keyup(key); - return; #ifdef PLUGINS case m_plugin: Plug_Menu_Event (2, key); diff --git a/engine/client/menu.h b/engine/client/menu.h index 8362d400..d2707c01 100644 --- a/engine/client/menu.h +++ b/engine/client/menu.h @@ -28,7 +28,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. //m_slist - serverbrowser. Takes full control of screen. //m_media - an mp3 player type thing. It was never really compleate. // It should perhaps either be fixed or removed. -//m_xwindows- Run an X windowing syatem. Fixme: make plugin. //m_plugin - A QVM based or DLL based plugin. //m_menu_dat- A QC based version of m_plugin. This should be compatable with DP's menu.dat stuff. @@ -114,15 +113,7 @@ void M_Menu_Quit_f (void); struct menu_s; - -void XWindows_Draw(void); -void XWindows_Key(int key); -void XWindows_Keyup(int key); -void XWindows_Init(void); - - - -typedef enum {m_none, m_complex, m_help, m_keys, m_slist, m_media, m_xwindows, m_plugin, m_menu_dat} m_state_t; +typedef enum {m_none, m_complex, m_help, m_keys, m_slist, m_media, m_plugin, m_menu_dat} m_state_t; extern m_state_t m_state; typedef enum {mt_childwindow, mt_button, mt_buttonbigfont, mt_box, mt_colouredbox, mt_line, mt_edit, mt_text, mt_slider, mt_combo, mt_bind, mt_checkbox, mt_picture, mt_menudot, mt_custom} menutype_t; diff --git a/engine/client/pr_csqc.c b/engine/client/pr_csqc.c index 537ff151..9e89b02e 100644 --- a/engine/client/pr_csqc.c +++ b/engine/client/pr_csqc.c @@ -1367,7 +1367,10 @@ void CSQC_ParseEntities(void) void *pr_globals; if (!csqcprogs) - Host_EndGame("CSQC needs to be initialized on this server.\n"); + Host_EndGame("CSQC needs to be initialized for this server.\n"); + + if (!csqcg.ent_update) + Host_EndGame("CSQC is unable to parse entities\n"); pr_globals = PR_globals(csqcprogs, PR_CURRENT); diff --git a/engine/common/plugin.c b/engine/common/plugin.c index c334350b..99be860c 100644 --- a/engine/common/plugin.c +++ b/engine/common/plugin.c @@ -211,6 +211,10 @@ int Plug_Sys_Error(void *offset, unsigned int mask, const long *arg) Sys_Error("%s", (char*)offset+arg[0]); return 0; } +int Plug_Sys_Milliseconds(void *offset, unsigned int mask, const long *arg) +{ + return Sys_DoubleTime()*1000; +} int Plug_ExportToEngine(void *offset, unsigned int mask, const long *arg) { char *name = (char*)VM_POINTER(arg[0]); @@ -550,6 +554,20 @@ int Plug_Draw_Colour4f(void *offset, unsigned int mask, const long *arg) return 0; } +int Plug_Media_ShowFrameRGBA_32(void *offset, unsigned int mask, const long *arg) +{ + void *src = VM_POINTER(arg[0]); + int srcwidth = VM_LONG(arg[1]); + int srcheight = VM_LONG(arg[2]); + int x = VM_LONG(arg[3]); + int y = VM_LONG(arg[4]); + int width = VM_LONG(arg[5]); + int height = VM_LONG(arg[6]); + + Media_ShowFrameRGBA_32(src, srcwidth, srcheight); + return 0; +} + int Plug_Key_GetKeyCode(void *offset, unsigned int mask, const long *arg) { int modifier; @@ -757,11 +775,303 @@ int Plug_Con_RenameSub(void *offset, unsigned int mask, const long *arg) return 1; } + +#ifdef _WIN32 +#define EWOULDBLOCK WSAEWOULDBLOCK +#define EMSGSIZE WSAEMSGSIZE +#define ECONNRESET WSAECONNRESET +#define ECONNABORTED WSAECONNABORTED +#define ECONNREFUSED WSAECONNREFUSED +#define EADDRNOTAVAIL WSAEADDRNOTAVAIL + +#define qerrno WSAGetLastError() +#else + + +#define qerrno errno + +#define MSG_PARTIAL 0 +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#define closesocket close +#define ioctlsocket ioctl +#endif + +typedef enum{ + STREAM_NONE, + STREAM_SOCKET, + STREAM_FILE +} plugstream_e; + +typedef struct { + plugin_t *plugin; + plugstream_e type; + int socket; + FILE *handle; +} pluginstream_t; +pluginstream_t *pluginstreamarray; +int pluginstreamarraylen; + +int Plug_NewStreamHandle(plugstream_e type) +{ + int i; + for (i = 0; i < pluginstreamarraylen; i++) + { + if (!pluginstreamarray[i].plugin) + break; + } + if (i == pluginstreamarraylen) + { + pluginstreamarraylen++; + pluginstreamarray = BZ_Realloc(pluginstreamarray, pluginstreamarraylen*sizeof(pluginstream_t)); + } + + memset(&pluginstreamarray[i], 0, sizeof(pluginstream_t)); + pluginstreamarray[i].plugin = currentplug; + pluginstreamarray[i].type = type; + pluginstreamarray[i].socket = -1; + + return i; +} + +//EBUILTIN(int, NET_TCPListen, (char *ip, int port, int maxcount)); +//returns a new socket with listen enabled. +int Plug_Net_TCPListen(void *offset, unsigned int mask, const long *arg) +{ + int handle; + int sock; + struct sockaddr_qstorage address; + int _true = 1; + + char *localip = VM_POINTER(arg[0]); + unsigned short localport = VM_LONG(arg[1]); + int maxcount = VM_LONG(arg[2]); + + netadr_t a; + if (localip) + { + if (!NET_StringToAdr(localip, &a)) + return -1; + NetadrToSockadr(&a, &address); + } + else + { + memset(&address, 0, sizeof(address)); + ((struct sockaddr_in*)&address)->sin_family = AF_INET; + } + + if (((struct sockaddr_in*)&address)->sin_family == AF_INET && !((struct sockaddr_in*)&address)->sin_port) + ((struct sockaddr_in*)&address)->sin_port = htons(localport); +#ifdef IPPROTO_IPV6 + else if (((struct sockaddr_in*)&address)->sin6_family == AF_INET6 && !((struct sockaddr_in6*)&address)->sin6_port) + ((struct sockaddr_in6*)&address)->sin6_port = htons(localport); +#endif + + if ((sock = socket(((struct sockaddr*)&address)->sa_family, SOCK_STREAM, 0)) == -1) + { + Con_Printf("Failed to create socket\n"); + return -2; + } + if (ioctlsocket (sock, FIONBIO, &_true) == -1) + { + closesocket(sock); + return -2; + } + + if( bind (sock, (void *)&address, sizeof(address)) == -1) + { + closesocket(sock); + return -2; + } + if( listen (sock, maxcount) == -1) + { + closesocket(sock); + return -2; + } + + handle = Plug_NewStreamHandle(STREAM_SOCKET); + pluginstreamarray[handle].socket = sock; + + return handle; + +} +int Plug_Net_Accept(void *offset, unsigned int mask, const long *arg) +{ + int handle = VM_LONG(arg[0]); + struct sockaddr_in address; + int addrlen; + int sock; + int _true = 1; + + if (handle < 0 || handle >= pluginstreamarraylen || pluginstreamarray[handle].plugin != currentplug || pluginstreamarray[handle].type != STREAM_SOCKET) + return -2; + sock = pluginstreamarray[handle].socket; + + addrlen = sizeof(address); + sock = accept(sock, (struct sockaddr *)&address, &addrlen); + + if (sock < 0) + return -1; + + if (ioctlsocket (sock, FIONBIO, &_true) == -1) //now make it non blocking. + { + closesocket(sock); + return -1; + } + + if (arg[2] && !VM_OOB(arg[1], arg[2])) + { + netadr_t a; + char *s; + SockadrToNetadr((struct sockaddr_qstorage *)&address, &a); + s = NET_AdrToString(a); + Q_strncpyz(VM_POINTER(arg[1]), s, addrlen); + } + + handle = Plug_NewStreamHandle(STREAM_SOCKET); + pluginstreamarray[handle].socket = sock; + + return handle; +} +//EBUILTIN(int, NET_TCPConnect, (char *ip, int port)); +int Plug_Net_TCPConnect(void *offset, unsigned int mask, const long *arg) +{ + char *localip = VM_POINTER(arg[0]); + unsigned short localport = VM_LONG(arg[1]); + + int handle; + struct sockaddr_qstorage to, from; + int sock; + int _true = 1; + + netadr_t a; + + NET_StringToAdr(localip, &a); + NetadrToSockadr(&a, &to); + if (((struct sockaddr_in*)&to)->sin_family == AF_INET && !((struct sockaddr_in*)&to)->sin_port) + ((struct sockaddr_in*)&to)->sin_port = htons(localport); +#ifdef IPPROTO_IPV6 + else if (((struct sockaddr_in*)&to)->sin6_family == AF_INET6 && !((struct sockaddr_in6*)&to)->sin6_port) + ((struct sockaddr_in6*)&to)->sin6_port = htons(localport); +#endif + + + if ((sock = socket (PF_INET, SOCK_STREAM, IPPROTO_TCP)) == -1) + { + return -2; + } + + memset(&from, 0, sizeof(from)); + ((struct sockaddr*)&from)->sa_family = ((struct sockaddr*)&to)->sa_family; + if (bind(sock, (struct sockaddr *)&from, sizeof(from)) == -1) + { + return -2; + } + + //not yet blocking. So no frequent attempts please... + //non blocking prevents connect from returning worthwhile sensible value. + if (connect(sock, (struct sockaddr *)&to, sizeof(to)) == -1) + { + closesocket(sock); + return -2; + } + + if (ioctlsocket (sock, FIONBIO, &_true) == -1) //now make it non blocking. + { + return -1; + } + + handle = Plug_NewStreamHandle(STREAM_SOCKET); + pluginstreamarray[handle].socket = sock; + + return handle; +} +int Plug_Net_Recv(void *offset, unsigned int mask, const long *arg) +{ + int read; + int handle = VM_LONG(arg[0]); + void *dest = VM_POINTER(arg[1]); + int destlen = VM_LONG(arg[2]); + + if (VM_OOB(arg[1], arg[2])) + return -2; + + if (handle < 0 || handle >= pluginstreamarraylen || pluginstreamarray[handle].plugin != currentplug) + return -2; + switch(pluginstreamarray[handle].type) + { + case STREAM_SOCKET: + read = recv(pluginstreamarray[handle].socket, dest, destlen, 0); + if (read < 0) + { + if (qerrno == EWOULDBLOCK) + return -1; + else + return -2; + } + else if (read == 0) + return -2; //closed by remote connection. + return read; + default: + return -2; + } +} +int Plug_Net_Send(void *offset, unsigned int mask, const long *arg) +{ + int written; + int handle = VM_LONG(arg[0]); + void *src = VM_POINTER(arg[1]); + int srclen = VM_LONG(arg[2]); + if (handle < 0 || handle >= pluginstreamarraylen || pluginstreamarray[handle].plugin != currentplug) + return -2; + switch(pluginstreamarray[handle].type) + { + case STREAM_SOCKET: + written = send(pluginstreamarray[handle].socket, src, srclen, 0); + if (written < 0) + { + if (qerrno == EWOULDBLOCK) + return -1; + else + return -2; + } + else if (written == 0) + return -2; //closed by remote connection. + return written; + default: + return -2; + } +} +int Plug_Net_Close(void *offset, unsigned int mask, const long *arg) +{ + int handle = VM_LONG(arg[0]); + if (handle < 0 || handle >= pluginstreamarraylen || pluginstreamarray[handle].plugin != currentplug || pluginstreamarray[handle].type != STREAM_SOCKET) + return -2; + + closesocket(pluginstreamarray[handle].socket); + + pluginstreamarray[handle].plugin = NULL; + + return 0; +} + void Plug_CloseAll_f(void); +void Plug_List_f(void); void Plug_Close_f(void); void Plug_Load_f(void) { - Plug_Load(Cmd_Argv(1)); + if (!Plug_Load(Cmd_Argv(1))) + Con_Printf("Couldn't load plugin %s\n", Cmd_Argv(1)); } void Plug_Init(void) @@ -771,11 +1081,13 @@ void Plug_Init(void) Cmd_AddCommand("plug_closeall", Plug_CloseAll_f); Cmd_AddCommand("plug_close", Plug_Close_f); Cmd_AddCommand("plug_load", Plug_Load_f); + Cmd_AddCommand("plug_list", Plug_List_f); Plug_RegisterBuiltin("Plug_GetEngineFunction", Plug_FindBuiltin, 0);//plugin wishes to find a builtin number. Plug_RegisterBuiltin("Plug_ExportToEngine", Plug_ExportToEngine, 0); //plugin has a call back that we might be interested in. Plug_RegisterBuiltin("Con_Print", Plug_Con_Print, 0); //printf is not possible - qvm floats are never doubles, vararg floats in a cdecl call are always converted to doubles. Plug_RegisterBuiltin("Sys_Error", Plug_Sys_Error, 0); + Plug_RegisterBuiltin("Sys_Milliseconds", Plug_Sys_Milliseconds, 0); Plug_RegisterBuiltin("Com_Error", Plug_Sys_Error, 0); //make zquake programmers happy. Plug_RegisterBuiltin("Cmd_AddCommand", Plug_Cmd_AddCommand, 0); @@ -806,6 +1118,15 @@ void Plug_Init(void) Plug_RegisterBuiltin("Con_SubPrint", Plug_Con_SubPrint, 0); Plug_RegisterBuiltin("Con_RenameSub", Plug_Con_RenameSub, 0); + Plug_RegisterBuiltin("Net_TCPListen", Plug_Net_TCPListen, 0); + Plug_RegisterBuiltin("Net_Accept", Plug_Net_Accept, 0); + Plug_RegisterBuiltin("Net_TCPConnect", Plug_Net_TCPConnect, 0); + Plug_RegisterBuiltin("Net_Recv", Plug_Net_Recv, 0); + Plug_RegisterBuiltin("Net_Send", Plug_Net_Send, 0); + Plug_RegisterBuiltin("Net_Close", Plug_Net_Close, 0); + + Plug_RegisterBuiltin("Media_ShowFrameRGBA_32", Plug_Media_ShowFrameRGBA_32, 0); + #ifdef _WIN32 COM_EnumerateFiles("plugins/*x86.dll", Plug_Emumerated, "x86.dll"); #elif defined(__linux__) @@ -994,6 +1315,15 @@ void Plug_CloseAll_f(void) } } +void Plug_List_f(void) +{ + plugin_t *plug; + for (plug = plugs; plug; plug = plug->next) + { + Con_Printf("%s\n", plug->name); + } +} + void Plug_Shutdown(void) { while(plugs) diff --git a/engine/common/protocol.h b/engine/common/protocol.h index 6e36b201..a731d198 100644 --- a/engine/common/protocol.h +++ b/engine/common/protocol.h @@ -60,11 +60,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define PEXT_CHUNKEDDOWNLOADS 0x20000000 //alternate file download method. Hopefully it'll give quadroupled download speed, especially on higher pings. #endif -#ifdef _DEBUG #ifdef CSQC_DAT #define PEXT_CSQC 0x40000000 //csqc additions #endif -#endif diff --git a/engine/ftequake/ftequake.dsw b/engine/ftequake/ftequake.dsw index d8b44115..92f3187f 100644 --- a/engine/ftequake/ftequake.dsw +++ b/engine/ftequake/ftequake.dsw @@ -75,6 +75,18 @@ Package=<4> ############################################################################### +Project: "xsv"=..\..\PLUGINS\xsv\xsv.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + Global: Package=<5> diff --git a/engine/qclib/gui.h b/engine/qclib/gui.h index 7042f389..381ed3d3 100644 --- a/engine/qclib/gui.h +++ b/engine/qclib/gui.h @@ -18,3 +18,4 @@ extern pbool fl_hexen2; extern pbool fl_autohighlight; extern pbool fl_compileonstart; extern pbool fl_showall; +extern pbool fl_log; diff --git a/engine/qclib/hash.c b/engine/qclib/hash.c index 0081a43e..5d23f0aa 100644 --- a/engine/qclib/hash.c +++ b/engine/qclib/hash.c @@ -1,4 +1,7 @@ -#include "qcc.h" +#include "hash.h" +#include +#include + void Hash_InitTable(hashtable_t *table, int numbucks, void *mem) { table->numbuckets = numbucks; @@ -159,23 +162,7 @@ void *Hash_AddInsensative(hashtable_t *table, char *name, void *data, bucket_t * return buck; } -#ifndef MINIMAL -void *Hash_AddKey(hashtable_t *table, int key, void *data) -{ - int bucknum = key%table->numbuckets; - bucket_t *buck; - - buck = qccHunkAlloc(sizeof(bucket_t)); - - buck->data = data; - buck->keystring = (char*)key; - buck->next = table->bucket[bucknum]; - table->bucket[bucknum] = buck; - - return buck; -} -#endif -void *Hash_AddKey2(hashtable_t *table, int key, void *data, bucket_t *buck) +void *Hash_AddKey(hashtable_t *table, int key, void *data, bucket_t *buck) { int bucknum = key%table->numbuckets; diff --git a/engine/qclib/hash.h b/engine/qclib/hash.h index 9ec66d2e..af55d444 100644 --- a/engine/qclib/hash.h +++ b/engine/qclib/hash.h @@ -24,6 +24,7 @@ void *Hash_GetNext(hashtable_t *table, char *name, void *old); void *Hash_GetNextInsensative(hashtable_t *table, char *name, void *old); void *Hash_Add(hashtable_t *table, char *name, void *data, bucket_t *buck); void *Hash_AddInsensative(hashtable_t *table, char *name, void *data, bucket_t *buck); -void *Hash_AddKey(hashtable_t *table, int key, void *data); void Hash_Remove(hashtable_t *table, char *name); void Hash_RemoveData(hashtable_t *table, char *name, void *data); +void Hash_RemoveKey(hashtable_t *table, int key); +void *Hash_AddKey(hashtable_t *table, int key, void *data, bucket_t *buck); diff --git a/engine/qclib/qcc_pr_comp.c b/engine/qclib/qcc_pr_comp.c index f95e4cf9..92bd233f 100644 --- a/engine/qclib/qcc_pr_comp.c +++ b/engine/qclib/qcc_pr_comp.c @@ -2868,7 +2868,7 @@ QCC_def_t *QCC_MakeFloatDef(float value) // copy the immediate to the global area cn->ofs = QCC_GetFreeOffsetSpace (type_size[type_integer->type]); - Hash_AddKey(&floatconstdefstable, fi.i, cn); + Hash_AddKey(&floatconstdefstable, fi.i, cn, qccHunkAlloc(sizeof(bucket_t))); G_FLOAT(cn->ofs) = value; diff --git a/engine/qclib/qccgui.c b/engine/qclib/qccgui.c index a2a995b7..27b945c3 100644 --- a/engine/qclib/qccgui.c +++ b/engine/qclib/qccgui.c @@ -38,6 +38,8 @@ HWND mdibox; HWND outputwindow; HWND outputbox; +FILE *logfile; + struct{ char *text; HWND hwnd; @@ -1628,6 +1630,10 @@ int GUIprintf(const char *msg, ...) args = QC_vsnprintf (buf,sizeof(buf)-1, msg,argptr); va_end (argptr); + printf("%s", buf); + if (logfile) + fprintf(logfile, "%s", buf); + if (!*buf) { SetWindowText(outputbox,""); @@ -1689,7 +1695,6 @@ int GUIprintf(const char *msg, ...) #undef Sys_Error - void Sys_Error(const char *text, ...); void RunCompiler(char *args) { @@ -1708,10 +1713,19 @@ void RunCompiler(char *args) funcs.parms->Sys_Error = Sys_Error; GUIprintf(""); + if (logfile) + fclose(logfile); + if (fl_log) + logfile = fopen("fteqcc.log", "wb"); + else + logfile = NULL; argc = GUI_BuildParms(args, argv); CompileParams(&funcs, true, argc, argv); + + if (logfile) + fclose(logfile); } @@ -1767,6 +1781,7 @@ int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLin if(strstr(lpCmdLine, "-stdout")) { + GUI_ParseCommandLine(lpCmdLine); RunCompiler(lpCmdLine); return 0; } diff --git a/engine/qclib/qccguistuff.c b/engine/qclib/qccguistuff.c index 991fb97c..8215894e 100644 --- a/engine/qclib/qccguistuff.c +++ b/engine/qclib/qccguistuff.c @@ -7,6 +7,7 @@ pbool fl_hexen2; pbool fl_autohighlight; pbool fl_compileonstart; pbool fl_showall; +pbool fl_log; char parameters[16384]; char progssrcname[256]; @@ -155,6 +156,10 @@ void GUI_ParseCommandLine(char *args) { fl_compileonstart = true; } + else if (!strnicmp(parameters+paramlen, "-log", 4) || !strnicmp(parameters+paramlen, "/log", 4)) + { + fl_log = true; + } else if (!strnicmp(parameters+paramlen, "-T", 2) || !strnicmp(parameters+paramlen, "/T", 2)) //the target { if (!strnicmp(parameters+paramlen+2, "h2", 2)) diff --git a/engine/qclib/qccmain.c b/engine/qclib/qccmain.c index bc61e2ef..a42cebbb 100644 --- a/engine/qclib/qccmain.c +++ b/engine/qclib/qccmain.c @@ -1778,7 +1778,24 @@ unsigned short QCC_PR_WriteProgdefs (char *filename) if (ForcedCRC) - return ForcedCRC; + crc = ForcedCRC; + + switch (crc) + { + case 54730: + printf("Recognised progs as QuakeWorld\n"); + break; + case 5927: + printf("Recognised progs as regular Quake\n"); + break; + case 38488: + printf("Recognised progs as origional Hexen2\n"); + break; + case 26905: + printf("Recognised progs as Hexen2 Mission Pack\n"); + break; + } + return crc; } diff --git a/engine/qux/x.h b/engine/qux/x.h deleted file mode 100644 index ffeea80e..00000000 --- a/engine/qux/x.h +++ /dev/null @@ -1,717 +0,0 @@ -/* - * $Xorg: X.h,v 1.4 2001/02/09 02:03:22 xorgcvs Exp $ - */ - -/* Definitions for the X window system likely to be used by applications */ - -#ifndef X_H -#define X_H - -/*********************************************************** - -Copyright 1987, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ -/* $XFree86: xc/include/X.h,v 1.5 2001/12/14 19:53:25 dawes Exp $ */ - -#define X_PROTOCOL 11 /* current protocol version */ -#define X_PROTOCOL_REVISION 0 /* current minor version */ - -/* Resources */ - -/* - * _XSERVER64 must ONLY be defined when compiling X server sources on - * systems where unsigned long is not 32 bits, must NOT be used in - * client or library code. - */ -#ifndef _XSERVER64 -# ifndef _XTYPEDEF_XID -# define _XTYPEDEF_XID -typedef unsigned long XID; -# endif -# ifndef _XTYPEDEF_MASK -# define _XTYPEDEF_MASK -typedef unsigned long Mask; -# endif -# ifndef _XTYPEDEF_ATOM -# define _XTYPEDEF_ATOM -typedef unsigned long Atom; /* Also in Xdefs.h */ -# endif -typedef unsigned long VisualID; -typedef unsigned long Time; -#else -# include -# ifndef _XTYPEDEF_XID -# define _XTYPEDEF_XID -typedef CARD32 XID; -# endif -# ifndef _XTYPEDEF_MASK -# define _XTYPEDEF_MASK -typedef CARD32 Mask; -# endif -# ifndef _XTYPEDEF_ATOM -# define _XTYPEDEF_ATOM -typedef CARD32 Atom; -# endif -typedef CARD32 VisualID; -typedef CARD32 Time; -#endif - -typedef XID Window; -typedef XID Drawable; -#ifndef _XTYPEDEF_FONT -# define _XTYPEDEF_FONT -typedef XID Font; -#endif -typedef XID Pixmap; -typedef XID Cursor; -typedef XID Colormap; -typedef XID GContext; -typedef XID KeySym; - -typedef unsigned char KeyCode; - -/***************************************************************** - * RESERVED RESOURCE AND CONSTANT DEFINITIONS - *****************************************************************/ - -#ifndef None -#define None 0L /* universal null resource or null atom */ -#endif - -#define ParentRelative 1L /* background pixmap in CreateWindow - and ChangeWindowAttributes */ - -#define CopyFromParent 0L /* border pixmap in CreateWindow - and ChangeWindowAttributes - special VisualID and special window - class passed to CreateWindow */ - -#define PointerWindow 0L /* destination window in SendEvent */ -#define InputFocus 1L /* destination window in SendEvent */ - -#define PointerRoot 1L /* focus window in SetInputFocus */ - -#define AnyPropertyType 0L /* special Atom, passed to GetProperty */ - -#define AnyKey 0L /* special Key Code, passed to GrabKey */ - -#define AnyButton 0L /* special Button Code, passed to GrabButton */ - -#define AllTemporary 0L /* special Resource ID passed to KillClient */ - -#define CurrentTime 0L /* special Time */ - -#define NoSymbol 0L /* special KeySym */ - -/***************************************************************** - * EVENT DEFINITIONS - *****************************************************************/ - -/* Input Event Masks. Used as event-mask window attribute and as arguments - to Grab requests. Not to be confused with event names. */ - -#define NoEventMask 0L -#define KeyPressMask (1L<<0) -#define KeyReleaseMask (1L<<1) -#define ButtonPressMask (1L<<2) -#define ButtonReleaseMask (1L<<3) -#define EnterWindowMask (1L<<4) -#define LeaveWindowMask (1L<<5) -#define PointerMotionMask (1L<<6) -#define PointerMotionHintMask (1L<<7) -#define Button1MotionMask (1L<<8) -#define Button2MotionMask (1L<<9) -#define Button3MotionMask (1L<<10) -#define Button4MotionMask (1L<<11) -#define Button5MotionMask (1L<<12) -#define ButtonMotionMask (1L<<13) -#define KeymapStateMask (1L<<14) -#define ExposureMask (1L<<15) -#define VisibilityChangeMask (1L<<16) -#define StructureNotifyMask (1L<<17) -#define ResizeRedirectMask (1L<<18) -#define SubstructureNotifyMask (1L<<19) -#define SubstructureRedirectMask (1L<<20) -#define FocusChangeMask (1L<<21) -#define PropertyChangeMask (1L<<22) -#define ColormapChangeMask (1L<<23) -#define OwnerGrabButtonMask (1L<<24) - -/* Event names. Used in "type" field in XEvent structures. Not to be -confused with event masks above. They start from 2 because 0 and 1 -are reserved in the protocol for errors and replies. */ - -#define KeyPress 2 -#define KeyRelease 3 -#define ButtonPress 4 -#define ButtonRelease 5 -#define MotionNotify 6 -#define EnterNotify 7 -#define LeaveNotify 8 -#define FocusIn 9 -#define FocusOut 10 -#define KeymapNotify 11 -#define Expose 12 -#define GraphicsExpose 13 -#define NoExpose 14 -#define VisibilityNotify 15 -#define CreateNotify 16 -#define DestroyNotify 17 -#define UnmapNotify 18 -#define MapNotify 19 -#define MapRequest 20 -#define ReparentNotify 21 -#define ConfigureNotify 22 -#define ConfigureRequest 23 -#define GravityNotify 24 -#define ResizeRequest 25 -#define CirculateNotify 26 -#define CirculateRequest 27 -#define PropertyNotify 28 -#define SelectionClear 29 -#define SelectionRequest 30 -#define SelectionNotify 31 -#define ColormapNotify 32 -#define ClientMessage 33 -#define MappingNotify 34 -#define LASTEvent 35 /* must be bigger than any event # */ - - -/* Key masks. Used as modifiers to GrabButton and GrabKey, results of QueryPointer, - state in various key-, mouse-, and button-related events. */ - -#define ShiftMask (1<<0) -#define LockMask (1<<1) -#define ControlMask (1<<2) -#define Mod1Mask (1<<3) -#define Mod2Mask (1<<4) -#define Mod3Mask (1<<5) -#define Mod4Mask (1<<6) -#define Mod5Mask (1<<7) - -/* modifier names. Used to build a SetModifierMapping request or - to read a GetModifierMapping request. These correspond to the - masks defined above. */ -#define ShiftMapIndex 0 -#define LockMapIndex 1 -#define ControlMapIndex 2 -#define Mod1MapIndex 3 -#define Mod2MapIndex 4 -#define Mod3MapIndex 5 -#define Mod4MapIndex 6 -#define Mod5MapIndex 7 - - -/* button masks. Used in same manner as Key masks above. Not to be confused - with button names below. */ - -#define Button1Mask (1<<8) -#define Button2Mask (1<<9) -#define Button3Mask (1<<10) -#define Button4Mask (1<<11) -#define Button5Mask (1<<12) - -#define AnyModifier (1<<15) /* used in GrabButton, GrabKey */ - - -/* button names. Used as arguments to GrabButton and as detail in ButtonPress - and ButtonRelease events. Not to be confused with button masks above. - Note that 0 is already defined above as "AnyButton". */ - -#define Button1 1 -#define Button2 2 -#define Button3 3 -#define Button4 4 -#define Button5 5 - -/* Notify modes */ - -#define NotifyNormal 0 -#define NotifyGrab 1 -#define NotifyUngrab 2 -#define NotifyWhileGrabbed 3 - -#define NotifyHint 1 /* for MotionNotify events */ - -/* Notify detail */ - -#define NotifyAncestor 0 -#define NotifyVirtual 1 -#define NotifyInferior 2 -#define NotifyNonlinear 3 -#define NotifyNonlinearVirtual 4 -#define NotifyPointer 5 -#define NotifyPointerRoot 6 -#define NotifyDetailNone 7 - -/* Visibility notify */ - -#define VisibilityUnobscured 0 -#define VisibilityPartiallyObscured 1 -#define VisibilityFullyObscured 2 - -/* Circulation request */ - -#define PlaceOnTop 0 -#define PlaceOnBottom 1 - -/* protocol families */ - -#define FamilyInternet 0 -#define FamilyDECnet 1 -#define FamilyChaos 2 - -/* Property notification */ - -#define PropertyNewValue 0 -#define PropertyDelete 1 - -/* Color Map notification */ - -#define ColormapUninstalled 0 -#define ColormapInstalled 1 - -/* GrabPointer, GrabButton, GrabKeyboard, GrabKey Modes */ - -#define GrabModeSync 0 -#define GrabModeAsync 1 - -/* GrabPointer, GrabKeyboard reply status */ - -#define GrabSuccess 0 -#define AlreadyGrabbed 1 -#define GrabInvalidTime 2 -#define GrabNotViewable 3 -#define GrabFrozen 4 - -/* AllowEvents modes */ - -#define AsyncPointer 0 -#define SyncPointer 1 -#define ReplayPointer 2 -#define AsyncKeyboard 3 -#define SyncKeyboard 4 -#define ReplayKeyboard 5 -#define AsyncBoth 6 -#define SyncBoth 7 - -/* Used in SetInputFocus, GetInputFocus */ - -#define RevertToNone (int)None -#define RevertToPointerRoot (int)PointerRoot -#define RevertToParent 2 - -/***************************************************************** - * ERROR CODES - *****************************************************************/ - -#define Success 0 /* everything's okay */ -#define BadRequest 1 /* bad request code */ -#define BadValue 2 /* int parameter out of range */ -#define BadWindow 3 /* parameter not a Window */ -#define BadPixmap 4 /* parameter not a Pixmap */ -#define BadAtom 5 /* parameter not an Atom */ -#define BadCursor 6 /* parameter not a Cursor */ -#define BadFont 7 /* parameter not a Font */ -#define BadMatch 8 /* parameter mismatch */ -#define BadDrawable 9 /* parameter not a Pixmap or Window */ -#define BadAccess 10 /* depending on context: - - key/button already grabbed - - attempt to free an illegal - cmap entry - - attempt to store into a read-only - color map entry. - - attempt to modify the access control - list from other than the local host. - */ -#define BadAlloc 11 /* insufficient resources */ -#define BadColor 12 /* no such colormap */ -#define BadGC 13 /* parameter not a GC */ -#define BadIDChoice 14 /* choice not in range or already used */ -#define BadName 15 /* font or color name doesn't exist */ -#define BadLength 16 /* Request length incorrect */ -#define BadImplementation 17 /* server is defective */ - -#define FirstExtensionError 128 -#define LastExtensionError 255 - -/***************************************************************** - * WINDOW DEFINITIONS - *****************************************************************/ - -/* Window classes used by CreateWindow */ -/* Note that CopyFromParent is already defined as 0 above */ - -#define InputOutput 1 -#define InputOnly 2 - -/* Window attributes for CreateWindow and ChangeWindowAttributes */ - -#define CWBackPixmap (1L<<0) -#define CWBackPixel (1L<<1) -#define CWBorderPixmap (1L<<2) -#define CWBorderPixel (1L<<3) -#define CWBitGravity (1L<<4) -#define CWWinGravity (1L<<5) -#define CWBackingStore (1L<<6) -#define CWBackingPlanes (1L<<7) -#define CWBackingPixel (1L<<8) -#define CWOverrideRedirect (1L<<9) -#define CWSaveUnder (1L<<10) -#define CWEventMask (1L<<11) -#define CWDontPropagate (1L<<12) -#define CWColormap (1L<<13) -#define CWCursor (1L<<14) - -/* ConfigureWindow structure */ - -#define CWX (1<<0) -#define CWY (1<<1) -#define CWWidth (1<<2) -#define CWHeight (1<<3) -#define CWBorderWidth (1<<4) -#define CWSibling (1<<5) -#define CWStackMode (1<<6) - - -/* Bit Gravity */ - -#define ForgetGravity 0 -#define NorthWestGravity 1 -#define NorthGravity 2 -#define NorthEastGravity 3 -#define WestGravity 4 -#define CenterGravity 5 -#define EastGravity 6 -#define SouthWestGravity 7 -#define SouthGravity 8 -#define SouthEastGravity 9 -#define StaticGravity 10 - -/* Window gravity + bit gravity above */ - -#define UnmapGravity 0 - -/* Used in CreateWindow for backing-store hint */ - -#define NotUseful 0 -#define WhenMapped 1 -#define Always 2 - -/* Used in GetWindowAttributes reply */ - -#define IsUnmapped 0 -#define IsUnviewable 1 -#define IsViewable 2 - -/* Used in ChangeSaveSet */ - -#define SetModeInsert 0 -#define SetModeDelete 1 - -/* Used in ChangeCloseDownMode */ - -#define DestroyAll 0 -#define RetainPermanent 1 -#define RetainTemporary 2 - -/* Window stacking method (in configureWindow) */ - -#define Above 0 -#define Below 1 -#define TopIf 2 -#define BottomIf 3 -#define Opposite 4 - -/* Circulation direction */ - -#define RaiseLowest 0 -#define LowerHighest 1 - -/* Property modes */ - -#define PropModeReplace 0 -#define PropModePrepend 1 -#define PropModeAppend 2 - -/***************************************************************** - * GRAPHICS DEFINITIONS - *****************************************************************/ - -/* graphics functions, as in GC.alu */ - -#define GXclear 0x0 /* 0 */ -#define GXand 0x1 /* src AND dst */ -#define GXandReverse 0x2 /* src AND NOT dst */ -#define GXcopy 0x3 /* src */ -#define GXandInverted 0x4 /* NOT src AND dst */ -#define GXnoop 0x5 /* dst */ -#define GXxor 0x6 /* src XOR dst */ -#define GXor 0x7 /* src OR dst */ -#define GXnor 0x8 /* NOT src AND NOT dst */ -#define GXequiv 0x9 /* NOT src XOR dst */ -#define GXinvert 0xa /* NOT dst */ -#define GXorReverse 0xb /* src OR NOT dst */ -#define GXcopyInverted 0xc /* NOT src */ -#define GXorInverted 0xd /* NOT src OR dst */ -#define GXnand 0xe /* NOT src OR NOT dst */ -#define GXset 0xf /* 1 */ - -/* LineStyle */ - -#define LineSolid 0 -#define LineOnOffDash 1 -#define LineDoubleDash 2 - -/* capStyle */ - -#define CapNotLast 0 -#define CapButt 1 -#define CapRound 2 -#define CapProjecting 3 - -/* joinStyle */ - -#define JoinMiter 0 -#define JoinRound 1 -#define JoinBevel 2 - -/* fillStyle */ - -#define FillSolid 0 -#define FillTiled 1 -#define FillStippled 2 -#define FillOpaqueStippled 3 - -/* fillRule */ - -#define EvenOddRule 0 -#define WindingRule 1 - -/* subwindow mode */ - -#define ClipByChildren 0 -#define IncludeInferiors 1 - -/* SetClipRectangles ordering */ - -#define Unsorted 0 -#define YSorted 1 -#define YXSorted 2 -#define YXBanded 3 - -/* CoordinateMode for drawing routines */ - -#define CoordModeOrigin 0 /* relative to the origin */ -#define CoordModePrevious 1 /* relative to previous point */ - -/* Polygon shapes */ - -#define Complex 0 /* paths may intersect */ -#define Nonconvex 1 /* no paths intersect, but not convex */ -#define Convex 2 /* wholly convex */ - -/* Arc modes for PolyFillArc */ - -#define ArcChord 0 /* join endpoints of arc */ -#define ArcPieSlice 1 /* join endpoints to center of arc */ - -/* GC components: masks used in CreateGC, CopyGC, ChangeGC, OR'ed into - GC.stateChanges */ - -#define GCFunction (1L<<0) -#define GCPlaneMask (1L<<1) -#define GCForeground (1L<<2) -#define GCBackground (1L<<3) -#define GCLineWidth (1L<<4) -#define GCLineStyle (1L<<5) -#define GCCapStyle (1L<<6) -#define GCJoinStyle (1L<<7) -#define GCFillStyle (1L<<8) -#define GCFillRule (1L<<9) -#define GCTile (1L<<10) -#define GCStipple (1L<<11) -#define GCTileStipXOrigin (1L<<12) -#define GCTileStipYOrigin (1L<<13) -#define GCFont (1L<<14) -#define GCSubwindowMode (1L<<15) -#define GCGraphicsExposures (1L<<16) -#define GCClipXOrigin (1L<<17) -#define GCClipYOrigin (1L<<18) -#define GCClipMask (1L<<19) -#define GCDashOffset (1L<<20) -#define GCDashList (1L<<21) -#define GCArcMode (1L<<22) - -#define GCLastBit 22 -/***************************************************************** - * FONTS - *****************************************************************/ - -/* used in QueryFont -- draw direction */ - -#define FontLeftToRight 0 -#define FontRightToLeft 1 - -#define FontChange 255 - -/***************************************************************** - * IMAGING - *****************************************************************/ - -/* ImageFormat -- PutImage, GetImage */ - -#define XYBitmap 0 /* depth 1, XYFormat */ -#define XYPixmap 1 /* depth == drawable depth */ -#define ZPixmap 2 /* depth == drawable depth */ - -/***************************************************************** - * COLOR MAP STUFF - *****************************************************************/ - -/* For CreateColormap */ - -#define AllocNone 0 /* create map with no entries */ -#define AllocAll 1 /* allocate entire map writeable */ - - -/* Flags used in StoreNamedColor, StoreColors */ - -#define DoRed (1<<0) -#define DoGreen (1<<1) -#define DoBlue (1<<2) - -/***************************************************************** - * CURSOR STUFF - *****************************************************************/ - -/* QueryBestSize Class */ - -#define CursorShape 0 /* largest size that can be displayed */ -#define TileShape 1 /* size tiled fastest */ -#define StippleShape 2 /* size stippled fastest */ - -/***************************************************************** - * KEYBOARD/POINTER STUFF - *****************************************************************/ - -#define AutoRepeatModeOff 0 -#define AutoRepeatModeOn 1 -#define AutoRepeatModeDefault 2 - -#define LedModeOff 0 -#define LedModeOn 1 - -/* masks for ChangeKeyboardControl */ - -#define KBKeyClickPercent (1L<<0) -#define KBBellPercent (1L<<1) -#define KBBellPitch (1L<<2) -#define KBBellDuration (1L<<3) -#define KBLed (1L<<4) -#define KBLedMode (1L<<5) -#define KBKey (1L<<6) -#define KBAutoRepeatMode (1L<<7) - -#define MappingSuccess 0 -#define MappingBusy 1 -#define MappingFailed 2 - -#define MappingModifier 0 -#define MappingKeyboard 1 -#define MappingPointer 2 - -/***************************************************************** - * SCREEN SAVER STUFF - *****************************************************************/ - -#define DontPreferBlanking 0 -#define PreferBlanking 1 -#define DefaultBlanking 2 - -#define DisableScreenSaver 0 -#define DisableScreenInterval 0 - -#define DontAllowExposures 0 -#define AllowExposures 1 -#define DefaultExposures 2 - -/* for ForceScreenSaver */ - -#define ScreenSaverReset 0 -#define ScreenSaverActive 1 - -/***************************************************************** - * HOSTS AND CONNECTIONS - *****************************************************************/ - -/* for ChangeHosts */ - -#define HostInsert 0 -#define HostDelete 1 - -/* for ChangeAccessControl */ - -#define EnableAccess 1 -#define DisableAccess 0 - -/* Display classes used in opening the connection - * Note that the statically allocated ones are even numbered and the - * dynamically changeable ones are odd numbered */ - -#define StaticGray 0 -#define GrayScale 1 -#define StaticColor 2 -#define PseudoColor 3 -#define TrueColor 4 -#define DirectColor 5 - - -/* Byte order used in imageByteOrder and bitmapBitOrder */ - -#define LSBFirst 0 -#define MSBFirst 1 - -#endif /* X_H */ diff --git a/engine/server/net_preparse.c b/engine/server/net_preparse.c index bf2745e0..ebc94978 100644 --- a/engine/server/net_preparse.c +++ b/engine/server/net_preparse.c @@ -943,6 +943,7 @@ void NPP_QWWriteByte(int dest, qbyte data) //replacement write func (nq to qw) case svc_finale: protocollen = 2; break; + case svc_updatepl: case svc_muzzleflash: protocollen = 3; break; diff --git a/engine/server/pr_cmds.c b/engine/server/pr_cmds.c index 603a2ac6..e1da28bf 100644 --- a/engine/server/pr_cmds.c +++ b/engine/server/pr_cmds.c @@ -173,6 +173,7 @@ pbool ED_CanFree (edict_t *ed) ed->v.think = 0; ed->v.solid = 0; + ed->v.SendEntity = 0; sv.csqcentversion[ed->entnum] = ed->v.Version+1; return true; @@ -2514,8 +2515,11 @@ void PF_LocalSound(progfuncs_t *prinst, struct globalvars_s *pr_globals) float chan = G_FLOAT(OFS_PARM1); float vol = G_FLOAT(OFS_PARM2); - if ((sfx = S_PrecacheSound(s))) - S_StartSound(cl.playernum[0], chan, sfx, cl.simorg[0], vol, 0.0); + if (!isDedicated) + { + if ((sfx = S_PrecacheSound(s))) + S_StartSound(cl.playernum[0], chan, sfx, cl.simorg[0], vol, 0.0); + } #endif }; diff --git a/engine/server/sv_ents.c b/engine/server/sv_ents.c index 40fac0ef..2ca218c0 100644 --- a/engine/server/sv_ents.c +++ b/engine/server/sv_ents.c @@ -2116,7 +2116,7 @@ void SV_WriteEntitiesToClient (client_t *client, sizebuf_t *msg, qboolean ignore ent = EDICT_NUM(svprogfuncs, e); // ignore ents without visible models - if (!ent->v.modelindex || !*PR_GetString(svprogfuncs, ent->v.model)) + if (!ent->v.SendEntity && (!ent->v.modelindex || !*PR_GetString(svprogfuncs, ent->v.model))) continue; if (progstype != PROG_QW) diff --git a/engine/sw/d_draw.s b/engine/sw/d_draw.s index f0a6e2aa..9a061244 100644 --- a/engine/sw/d_draw.s +++ b/engine/sw/d_draw.s @@ -21,7 +21,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // d_draw.s // x86 assembly-language horizontal 8-bpp span-drawing code. // - +#define SWQUAKE #include "asm_i386.h" #include "quakeasm.h" #include "asm_draw.h" diff --git a/engine/sw/d_draw16.s b/engine/sw/d_draw16.s index de2b72f3..0bddcc0a 100644 --- a/engine/sw/d_draw16.s +++ b/engine/sw/d_draw16.s @@ -22,7 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // x86 assembly-language horizontal 16-bpp span-drawing code, with 16-pixel // subdivision. // - +#define SWQUAKE #include "asm_i386.h" #include "quakeasm.h" #include "asm_draw.h" diff --git a/engine/sw/d_parta.s b/engine/sw/d_parta.s index b32f1bcb..d694f5db 100644 --- a/engine/sw/d_parta.s +++ b/engine/sw/d_parta.s @@ -21,7 +21,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // d_parta.s // x86 assembly-language 8-bpp particle-drawing code. // - +#define SWQUAKE #include "asm_i386.h" #include "quakeasm.h" #include "d_ifacea.h" diff --git a/engine/sw/d_polysa.s b/engine/sw/d_polysa.s index 6746a8a8..ba479465 100644 --- a/engine/sw/d_polysa.s +++ b/engine/sw/d_polysa.s @@ -21,7 +21,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // d_polysa.s // x86 assembly-language polygon model drawing code // - +#define SWQUAKE #include "asm_i386.h" #include "quakeasm.h" #include "asm_draw.h" diff --git a/engine/sw/d_polyse.c b/engine/sw/d_polyse.c index 3e38949f..f37e53de 100644 --- a/engine/sw/d_polyse.c +++ b/engine/sw/d_polyse.c @@ -1409,6 +1409,9 @@ void D_DrawNonSubdiv (void) int i; int lnumtriangles; + mstvert_t *pst, *st0, *st1, *st2; + + pst = r_affinetridesc.pstverts; pfv = r_affinetridesc.pfinalverts; ptri = r_affinetridesc.ptriangles; lnumtriangles = r_affinetridesc.numtriangles; @@ -1437,24 +1440,28 @@ void D_DrawNonSubdiv (void) continue; } + st0 = pst + ptri->st_index[0]; + st1 = pst + ptri->st_index[1]; + st2 = pst + ptri->st_index[2]; + r_p0[0] = index0->v[0]; // u r_p0[1] = index0->v[1]; // v - r_p0[2] = index0->v[2]; // s - r_p0[3] = index0->v[3]; // t + r_p0[2] = st0->s; // s + r_p0[3] = st0->t; // t r_p0[4] = index0->v[4]; // light r_p0[5] = index0->v[5]; // iz r_p1[0] = index1->v[0]; r_p1[1] = index1->v[1]; - r_p1[2] = index1->v[2]; - r_p1[3] = index1->v[3]; + r_p1[2] = st1->s; + r_p1[3] = st1->t; r_p1[4] = index1->v[4]; r_p1[5] = index1->v[5]; r_p2[0] = index2->v[0]; r_p2[1] = index2->v[1]; - r_p2[2] = index2->v[2]; - r_p2[3] = index2->v[3]; + r_p2[2] = st2->s; + r_p2[3] = st2->t; r_p2[4] = index2->v[4]; r_p2[5] = index2->v[5]; @@ -1481,24 +1488,28 @@ void D_DrawNonSubdiv (void) continue; } + st0 = pst + ptri->st_index[0]; + st1 = pst + ptri->st_index[1]; + st2 = pst + ptri->st_index[2]; + r_p0[0] = index0->v[0]; // u r_p0[1] = index0->v[1]; // v - r_p0[2] = index0->v[2]; // s - r_p0[3] = index0->v[3]; // t + r_p0[2] = st0->s; // s + r_p0[3] = st0->t; // t r_p0[4] = index0->v[4]; // light r_p0[5] = index0->v[5]; // iz r_p1[0] = index1->v[0]; r_p1[1] = index1->v[1]; - r_p1[2] = index1->v[2]; - r_p1[3] = index1->v[3]; + r_p1[2] = st1->s; + r_p1[3] = st1->t; r_p1[4] = index1->v[4]; r_p1[5] = index1->v[5]; r_p2[0] = index2->v[0]; r_p2[1] = index2->v[1]; - r_p2[2] = index2->v[2]; - r_p2[3] = index2->v[3]; + r_p2[2] = st2->s; + r_p2[3] = st2->t; r_p2[4] = index2->v[4]; r_p2[5] = index2->v[5]; diff --git a/engine/sw/d_scana.s b/engine/sw/d_scana.s index bd4fd744..d29ef4b8 100644 --- a/engine/sw/d_scana.s +++ b/engine/sw/d_scana.s @@ -21,7 +21,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // d_scana.s // x86 assembly-language turbulent texture mapping code // - +#define SWQUAKE #include "asm_i386.h" #include "quakeasm.h" #include "asm_draw.h" diff --git a/engine/sw/d_spr8.s b/engine/sw/d_spr8.s index 37c81c5e..7debf9de 100644 --- a/engine/sw/d_spr8.s +++ b/engine/sw/d_spr8.s @@ -21,6 +21,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // d_spr8.s // x86 assembly-language horizontal 8-bpp transparent span-drawing code. // +#define SWQUAKE #include "asm_i386.h" #include "quakeasm.h" #include "asm_draw.h" diff --git a/engine/sw/r_aclipa.s b/engine/sw/r_aclipa.s index aee9837b..113fedb4 100644 --- a/engine/sw/r_aclipa.s +++ b/engine/sw/r_aclipa.s @@ -21,7 +21,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // r_aliasa.s // x86 assembly-language Alias model transform and project code. // - +#define SWQUAKE #include "asm_i386.h" #include "quakeasm.h" #include "asm_draw.h" diff --git a/engine/sw/r_alias.c b/engine/sw/r_alias.c index cf01dfe0..1b21ff5b 100644 --- a/engine/sw/r_alias.c +++ b/engine/sw/r_alias.c @@ -270,7 +270,7 @@ qboolean R_AliasCheckBBox (void) { if (minz > (r_aliastransition + (pmdl->size * r_resfudge))) { - // currententity->trivial_accept |= 2; +// currententity->trivial_accept |= 2; } } @@ -510,7 +510,7 @@ void R_AliasTransformFinalVert (finalvert_t *fv, auxvert_t *av, } -#if !id386 //since stvert_t was changed. +//#if !id386 //since stvert_t was changed. /* ================ @@ -571,7 +571,7 @@ void R_AliasTransformAndProjectFinalVerts (finalvert_t *fv)//, stvert_t *pstvert } } -#endif +//#endif /* @@ -600,20 +600,16 @@ R_AliasPrepareUnclippedPoints */ void R_AliasPrepareUnclippedPoints (void) { - finalvert_t *fv; - r_anumverts = pmdl->numverts; -// FIXME: just use pfinalverts directly? - fv = pfinalverts; - R_AliasTransformAndProjectFinalVerts (fv); + R_AliasTransformAndProjectFinalVerts (pfinalverts); if (r_affinetridesc.drawtype) { if (r_pixbytes == 4) - D_PolysetDrawFinalVerts32Trans (fv, r_anumverts); + D_PolysetDrawFinalVerts32Trans (pfinalverts, r_anumverts); else - D_PolysetDrawFinalVerts (fv, r_anumverts); + D_PolysetDrawFinalVerts (pfinalverts, r_anumverts); } r_affinetridesc.pfinalverts = pfinalverts; diff --git a/engine/sw/r_aliasa.s b/engine/sw/r_aliasa.s index b3bca82d..24dd520c 100644 --- a/engine/sw/r_aliasa.s +++ b/engine/sw/r_aliasa.s @@ -1,33 +1,38 @@ /* -Copyright (C) 1996-1997 Id Software, Inc. + r_aliasa.S -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. + (description) -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + Copyright (C) 1996-1997 Id Software, Inc. -See the GNU General Public License for more details. + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to: + + Free Software Foundation, Inc. + 59 Temple Place - Suite 330 + Boston, MA 02111-1307, USA */ -// // r_aliasa.s // x86 assembly-language Alias model transform and project code. -// #include "asm_i386.h" #include "quakeasm.h" #include "asm_draw.h" #include "d_ifacea.h" -#if id386 +#if 0 //def id386 .data @@ -42,7 +47,7 @@ Lcoords: .long 0, 0, 0 .globl C(R_AliasTransformAndProjectFinalVerts) C(R_AliasTransformAndProjectFinalVerts): - pushl %ebp // preserve caller's stack frame +// pushl %ebp //Spike was here. // preserve caller's stack frame pushl %edi pushl %esi // preserve register variables @@ -55,7 +60,7 @@ C(R_AliasTransformAndProjectFinalVerts): // for (i=0 ; ilightnormalindex]; @@ -102,11 +109,12 @@ Lloop: // fv->v[2] = pstverts->s; // fv->v[3] = pstverts->t; // fv->flags = pstverts->onseam; -// movl stv_onseam(%ebp),%eax -// movl %eax,fv_flags(%edi) +// movl stv_onseam(%ebp),%eax //Spike was here. +// movl %eax,fv_flags(%edi) //Spike was here. + movl $0,fv_flags(%edi) //Spike was here. - movl fv_size(%edi),%eax - movl stv_size(%ebp),%eax +// movl fv_size(%edi),%eax //Spike was here. +// movl stv_size(%ebp),%eax //Spike was here. movl 4(%esi),%eax leal (%edx,%edx,2),%eax // index*3 @@ -204,7 +212,7 @@ Lp1: addl $(tv_size),%esi faddp %st(0),%st(2) // yaccum | x | yaccum3 | zi faddp %st(0),%st(2) // x | y | zi - addl $(stv_size),%ebp +// addl $(stv_size),%ebp //Spike was here fmul %st(2),%st(0) // x/z | y | zi fxch %st(1) // y | x/z | zi fmul %st(2),%st(0) // y/z | x/z | zi @@ -226,7 +234,7 @@ Lp1: popl %esi // restore register variables popl %edi - popl %ebp // restore the caller's stack frame +// popl %ebp //Spike was here. // restore the caller's stack frame ret Lsavelight: @@ -234,4 +242,3 @@ Lsavelight: jmp Lp1 #endif // id386 - diff --git a/engine/sw/r_drawa.s b/engine/sw/r_drawa.s index 3cb22394..ed1fa92f 100644 --- a/engine/sw/r_drawa.s +++ b/engine/sw/r_drawa.s @@ -22,6 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // x86 assembly-language edge clipping and emission code // +#define SWQUAKE #include "asm_i386.h" #include "quakeasm.h" #include "asm_draw.h" diff --git a/engine/sw/r_edgea.s b/engine/sw/r_edgea.s index f67130f1..b7ee5d1a 100644 --- a/engine/sw/r_edgea.s +++ b/engine/sw/r_edgea.s @@ -22,6 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // x86 assembly-language edge-processing code. // +#define SWQUAKE #include "asm_i386.h" #include "quakeasm.h" #include "asm_draw.h" diff --git a/engine/sw/surf16.s b/engine/sw/surf16.s index c0812a3b..b2c87ddd 100644 --- a/engine/sw/surf16.s +++ b/engine/sw/surf16.s @@ -22,6 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // x86 assembly-language 16 bpp surface block drawing code. // +#define SWQUAKE #include "asm_i386.h" #include "quakeasm.h" #include "asm_draw.h" diff --git a/engine/sw/surf8.s b/engine/sw/surf8.s index a079f1d0..3beacb8c 100644 --- a/engine/sw/surf8.s +++ b/engine/sw/surf8.s @@ -21,7 +21,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // surf8.s // x86 assembly-language 8 bpp surface block drawing code. // - +#define SWQUAKE #include "asm_i386.h" #include "quakeasm.h" #include "asm_draw.h" diff --git a/engine/sw/sw_model.c b/engine/sw/sw_model.c index cafa6d78..57f5d63e 100644 --- a/engine/sw/sw_model.c +++ b/engine/sw/sw_model.c @@ -2286,12 +2286,11 @@ void SWMod_LoadAliasModel (model_t *mod, void *buffer) !strcmp(loadmodel->name, "progs/player.mdl") ? pmodel_name : emodel_name, st, MAX_INFO_STRING); - if (cls.state >= ca_connected) { - MSG_WriteByte (&cls.netchan.message, clc_stringcmd); - sprintf(st, "setinfo %s %d", + if (cls.state >= ca_connected) + { + CL_SendClientCommand("setinfo %s %d", !strcmp(loadmodel->name, "progs/player.mdl") ? pmodel_name : emodel_name, (int)crc); - SZ_Print (&cls.netchan.message, st); } } @@ -2564,12 +2563,11 @@ void SWMod_LoadAlias2Model (model_t *mod, void *buffer) !strcmp(loadmodel->name, "progs/player.mdl") ? pmodel_name : emodel_name, st, MAX_INFO_STRING); - if (cls.state >= ca_connected) { - MSG_WriteByte (&cls.netchan.message, clc_stringcmd); - sprintf(st, "setinfo %s %d", + if (cls.state >= ca_connected) + { + CL_SendClientCommand("setinfo %s %d", !strcmp(loadmodel->name, "progs/player.mdl") ? pmodel_name : emodel_name, (int)crc); - SZ_Print (&cls.netchan.message, st); } } @@ -2942,12 +2940,11 @@ void SWMod_LoadAlias3Model (model_t *mod, void *buffer) !strcmp(loadmodel->name, "progs/player.mdl") ? pmodel_name : emodel_name, st, MAX_INFO_STRING); - if (cls.state >= ca_connected) { - MSG_WriteByte (&cls.netchan.message, clc_stringcmd); - sprintf(st, "setinfo %s %d", + if (cls.state >= ca_connected) + { + CL_SendClientCommand("setinfo %s %d", !strcmp(loadmodel->name, "progs/player.mdl") ? pmodel_name : emodel_name, (int)crc); - SZ_Print (&cls.netchan.message, st); } } diff --git a/engine/sw/vid_sdl.c b/engine/sw/vid_sdl.c index 11aae568..a1b45b5c 100755 --- a/engine/sw/vid_sdl.c +++ b/engine/sw/vid_sdl.c @@ -5,6 +5,12 @@ extern qboolean vid_isfullscreen; extern qboolean ActiveApp; +#ifdef _WIN32 +#include +HWND mainwindow; +#endif + +qboolean Minimized; extern SDL_Surface *sdlsurf; @@ -39,7 +45,9 @@ qboolean SWVID_Init (rendererstate_t *info, unsigned char *palette) int flags; Con_Printf("SDL SWVID_Init\n"); - SDL_Init(SDL_INIT_VIDEO | SDL_INIT_NOPARACHUTE); + info->bpp = 8; //I don't know thier card details I'm afraid. + + SDL_InitSubSystem(SDL_INIT_VIDEO | SDL_INIT_NOPARACHUTE); if (info->fullscreen) { @@ -52,6 +60,8 @@ qboolean SWVID_Init (rendererstate_t *info, unsigned char *palette) vid_isfullscreen = false; } +flags |= SDL_SWSURFACE; + sdlsurf = SDL_SetVideoMode(info->width, info->height, info->bpp, flags|SDL_DOUBLEBUF); if (!sdlsurf) return false; //bummer. @@ -73,6 +83,7 @@ qboolean SWVID_Init (rendererstate_t *info, unsigned char *palette) r_pixbytes = info->bpp/8; SWVID_LockBuffer(); //make sure our buffer and pitch are set up right. + SWVID_UnlockBuffer(); ResetFrameBuffers(); return true; @@ -123,6 +134,7 @@ void SWVID_ForceLockState (int lk) //I detest these functions. FIXME: Remove void SWVID_UnlockBuffer (void) { SDL_UnlockSurface(sdlsurf); + vid.buffer = NULL; } int SWVID_ForceUnlockedAndReturnState(void) //FIXME: Remove