From 0afe8f9dc56ef121368ba0660c55bc2f7b89b83f Mon Sep 17 00:00:00 2001 From: Spoike Date: Sun, 24 May 2009 10:28:26 +0000 Subject: [PATCH] Didn't test all targets. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3196 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/client/cl_parse.c | 12 ++++++++++-- engine/client/m_multi.c | 2 +- engine/client/pr_csqc.c | 6 +++--- engine/common/common.c | 6 +++++- engine/common/fs_win32.c | 2 ++ engine/gl/gl_ppl.c | 3 +++ engine/gl/gl_rsurf.c | 2 +- 7 files changed, 25 insertions(+), 8 deletions(-) diff --git a/engine/client/cl_parse.c b/engine/client/cl_parse.c index e360af8a4..f6281458e 100644 --- a/engine/client/cl_parse.c +++ b/engine/client/cl_parse.c @@ -4289,7 +4289,11 @@ void CL_PrintChat(player_info_t *plr, char *rawmsg, char *msg, int plrflags) Q_strncatz(fullchatmessage, va("%s", msg), sizeof(fullchatmessage)); } - CSQC_ParsePrint(fullchatmessage, PRINT_CHAT); +#ifdef CSQC_DAT + if (CSQC_ParsePrint(fullchatmessage, PRINT_CHAT)) + return; +#endif + Con_Printf("%s", fullchatmessage); } // CL_PrintStandardMessage: takes non-chat net messages and performs name coloring @@ -4369,7 +4373,11 @@ void CL_PrintStandardMessage(char *msg, int printlevel) // print final chunk Q_strncatz(fullmessage, msg, sizeof(fullmessage)); - CSQC_ParsePrint(fullmessage, printlevel); +#ifdef CSQC_DAT + if (CSQC_ParsePrint(fullmessage, printlevel)) + return; +#endif + Con_Printf("%s", fullmessage); } char stufftext[4096]; diff --git a/engine/client/m_multi.c b/engine/client/m_multi.c index 2c8fe6c26..1b37ada5e 100644 --- a/engine/client/m_multi.c +++ b/engine/client/m_multi.c @@ -282,7 +282,7 @@ void MSetup_TransDraw (int x, int y, menucustom_t *option, menu_t *menu) { info->tiwidth = ((int*)f)[0]; info->tiheight = ((int*)f)[1]; - memcpy(info->translationimage, f+8, info->tiwidth*info->tiheight); + memcpy(info->translationimage, (char*)f+8, info->tiwidth*info->tiheight); FS_FreeFile(f); } } diff --git a/engine/client/pr_csqc.c b/engine/client/pr_csqc.c index 03592cf70..33584bd24 100644 --- a/engine/client/pr_csqc.c +++ b/engine/client/pr_csqc.c @@ -6025,7 +6025,7 @@ qboolean CSQC_LoadResource(char *resname, char *restype) return !!G_FLOAT(OFS_RETURN); } -void CSQC_ParsePrint(char *message, int printlevel) +qboolean CSQC_ParsePrint(char *message, int printlevel) { void *pr_globals; int bufferpos; @@ -6033,8 +6033,7 @@ void CSQC_ParsePrint(char *message, int printlevel) qboolean doflush; if (!csqcprogs || !csqcg.parse_print) { - Con_Printf("%s", message); - return; + return false; } bufferpos = strlen(csqc_printbuffer); @@ -6081,6 +6080,7 @@ void CSQC_ParsePrint(char *message, int printlevel) csqc_printbuffer[bufferpos] = 0; } } + return true; } qboolean CSQC_StuffCmd(int lplayernum, char *cmd) diff --git a/engine/common/common.c b/engine/common/common.c index 544da1399..8a13375ef 100644 --- a/engine/common/common.c +++ b/engine/common/common.c @@ -2874,7 +2874,11 @@ void COM_Version_f (void) else if (_MSC_VER == 1500) { Con_Printf("Visual C++ 2008, version 9.0\n"); } else { - Con_Printf("Unknown Microsoft C++ compiler: %i %i %i \n",_MSC_VER, _MSC_FULL_VER, _MSC_BUILD); +#ifdef _MSC_BUILD + Con_Printf("Unknown Microsoft C++ compiler: %i %i %i\n",_MSC_VER, _MSC_FULL_VER, _MSC_BUILD); +#else + Con_Printf("Unknown Microsoft C++ compiler: %i %i\n",_MSC_VER, _MSC_FULL_VER); +#endif } #endif } diff --git a/engine/common/fs_win32.c b/engine/common/fs_win32.c index 26886a996..3b10185e0 100644 --- a/engine/common/fs_win32.c +++ b/engine/common/fs_win32.c @@ -119,6 +119,8 @@ vfsfile_t *VFSW32_Open(const char *osname, const char *mode) h = CreateFileA(osname, GENERIC_READ|GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); else if (read) h = CreateFileA(osname, GENERIC_READ, FILE_SHARE_READ|FILE_SHARE_DELETE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + else + h = INVALID_HANDLE_VALUE; if (h == INVALID_HANDLE_VALUE) return NULL; diff --git a/engine/gl/gl_ppl.c b/engine/gl/gl_ppl.c index d528f88a8..34901a3b1 100644 --- a/engine/gl/gl_ppl.c +++ b/engine/gl/gl_ppl.c @@ -1651,7 +1651,10 @@ static void PPL_BaseChain_NPR_Sketch(msurface_t *first) static void PPL_BaseTextureChain(msurface_t *first) { texture_t *t; +#ifdef Q3SHADERS shader_t *shader; +#endif + if (r_drawflat.value||!r_lightmapintensity) { if (r_drawflat.value == 2) diff --git a/engine/gl/gl_rsurf.c b/engine/gl/gl_rsurf.c index 534a3bf02..38b9085b7 100644 --- a/engine/gl/gl_rsurf.c +++ b/engine/gl/gl_rsurf.c @@ -3553,7 +3553,7 @@ void GL_GenBrushModelVBO(model_t *mod) void *vbovdata; index_t *vboedata; mesh_t *m; -#define VBOSTRIDE (3+2+2)*4 + if (!qglGenBuffersARB || !mod->numsurfaces) return;