Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision

Target

Select target project
  • STJr/SRB2
  • Sryder/SRB2
  • wolfy852/SRB2
  • Alpha2244/SRB2
  • Inuyasha/SRB2
  • yoshibot/SRB2
  • TehRealSalt/SRB2
  • PrisimaTF/SRB2
  • Hatninja/SRB2
  • SteelT/SRB2
  • james/SRB2
  • ShaderWraith/SRB2
  • SinnamonLat/SRB2
  • mazmazz_/SRB2
  • filpAM/SRB2
  • chaoloveicemdboy/SRB2
  • Whooa21/SRB2
  • Machturne/SRB2
  • Golden/SRB2
  • Tatsuru/SRB2
  • Snu/SRB2
  • Zwip-Zwap_Zapony/SRB2
  • fickleheart/SRB2
  • alphaRexJames/SRB2
  • JJK/SRB2
  • diskpoppy/SRB2
  • Hannu_Hanhi/SRB2
  • ZipperQR/SRB2
  • kays/SRB2
  • spherallic/SRB2
  • Zippy_Zolton/SRB2
  • namiishere/SRB2
  • Ors/SRB2
  • SMS_Alfredo/SRB2
  • sonic_edge/SRB2
  • lavla/SRB2
  • ashi/SRB2
  • X.organic/SRB2
  • Fafabis/SRB2
  • Meziu/SRB2
  • v-rob/SRB2
  • tertu/SRB2
  • bitten2up/SRB2
  • flarn2006/SRB2
  • Krabs/SRB2
  • clairebun/SRB2
  • Lactozilla/SRB2
  • thehackstack/SRB2
  • Spice/SRB2
  • win8linux/SRB2
  • JohnFrostFox/SRB2
  • talktoneon726/SRB2
  • Wane/SRB2
  • Lamibe/SRB2
  • spectrumuk2/srb-2
  • nerdyminer18/srb-2
  • 256nil/SRB2
  • ARJr/SRB2
  • Alam/SRB2
  • Zenya/srb-2-marathon-demos
  • Acelite/srb-2-archivedmodifications
  • MIDIMan/SRB2
  • Lach/SRB2
  • Frostiikin/bounce-tweaks
  • Jaden/SRB2
  • Tyron/SRB2
  • Astronight/SRB2
  • Mari0shi06/SRB2
  • aiire/SRB2
  • Galactice/SRB2
  • srb2-ports/srb2-dreamcast
  • sdasdas/SRB2
  • chreas/srb-2-vr
  • StarManiaKG/the-story-of-sinically-rocketing-and-botching-the-2nd
  • LoganAir/SRB2
  • NepDisk/srb-2
  • alufolie91/SRB2
  • Felicia.iso/SRB2
  • twi/SRB2
  • BarrelsOFun/SRB2
  • Speed2411/SRB2
  • Leather_Realms/SRB2
  • Ayemar/SRB2
  • Acelite/SRB2
  • VladDoc/SRB2
  • kaldrum/model-features
  • strawberryfox417/SRB2
  • Lugent/SRB2
  • Jisk/SRB2
  • Rem/SRB2
  • Refrag/SRB2
  • Henry_3230/srb-3230
  • TehPuertoRicanSpartan2/tprs-srb2
  • Leminn/srb-2-marathon-stuff
  • chromaticpipe2/SRB2
  • MiguelGustavo15/SRB2
  • Maru/srb-2-tests
  • SilicDev/SRB2
  • UnmatchedBracket/SRB2
  • HybridDog/SRB2
  • xordspar0/SRB2
  • jsjhbewfhh/SRB2
  • Fancy2209/SRB2
  • Lorsoen/SRB2
  • shindoukin/SRB2
  • GamerOfDays/SRB2
  • Craftyawesome/SRB2
  • tenshi-tensai-tennoji/SRB2
  • Scarfdudebalder/SRB2
  • luigi-budd/srb-2-fix-interplag-lockon
  • mskluesner/SRB2
  • johnpetersa19/SRB2
  • Pheazant/SRB2
  • chromaticpipe2/srb2classic
  • romoney5/SRB2
  • PAS/SRB2Classic
  • BlueStaggo/SRB2
117 results
Select Git revision
Show changes
Commits on Source (227)
...@@ -9,7 +9,7 @@ environment: ...@@ -9,7 +9,7 @@ environment:
# c:\mingw-w64 i686 has gcc 6.3.0, so use c:\msys64 7.3.0 instead # c:\mingw-w64 i686 has gcc 6.3.0, so use c:\msys64 7.3.0 instead
MINGW_SDK: c:\msys64\mingw32 MINGW_SDK: c:\msys64\mingw32
# c:\msys64 x86_64 has gcc 8.2.0, so use c:\mingw-w64 7.3.0 instead # c:\msys64 x86_64 has gcc 8.2.0, so use c:\mingw-w64 7.3.0 instead
MINGW_SDK_64: C:\mingw-w64\x86_64-7.3.0-posix-seh-rt_v5-rev0\mingw64 MINGW_SDK_64: C:\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64
CFLAGS: -Wall -W -Werror -Wno-error=implicit-fallthrough -Wimplicit-fallthrough=3 -Wno-tautological-compare -Wno-error=suggest-attribute=noreturn CFLAGS: -Wall -W -Werror -Wno-error=implicit-fallthrough -Wimplicit-fallthrough=3 -Wno-tautological-compare -Wno-error=suggest-attribute=noreturn
NASM_ZIP: nasm-2.12.01 NASM_ZIP: nasm-2.12.01
NASM_URL: http://www.nasm.us/pub/nasm/releasebuilds/2.12.01/win64/nasm-2.12.01-win64.zip NASM_URL: http://www.nasm.us/pub/nasm/releasebuilds/2.12.01/win64/nasm-2.12.01-win64.zip
...@@ -55,8 +55,6 @@ cache: ...@@ -55,8 +55,6 @@ cache:
install: install:
- if [%CONFIGURATION%] == [SDL64] ( set "X86_64=1" ) - if [%CONFIGURATION%] == [SDL64] ( set "X86_64=1" )
- if [%CONFIGURATION%] == [SDL64] ( set "CONFIGURATION=SDL" ) - if [%CONFIGURATION%] == [SDL64] ( set "CONFIGURATION=SDL" )
- if [%CONFIGURATION%] == [DD64] ( set "X86_64=1" )
- if [%CONFIGURATION%] == [DD64] ( set "CONFIGURATION=DD" )
- if [%X86_64%] == [1] ( set "MINGW_SDK=%MINGW_SDK_64%" ) - if [%X86_64%] == [1] ( set "MINGW_SDK=%MINGW_SDK_64%" )
- if [%X86_64%] == [1] ( set "CCACHE_CC=%CCACHE_CC_64%" ) - if [%X86_64%] == [1] ( set "CCACHE_CC=%CCACHE_CC_64%" )
...@@ -75,13 +73,6 @@ install: ...@@ -75,13 +73,6 @@ install:
configuration: configuration:
- SDL - SDL
- SDL64 - SDL64
- DD
- DD64
matrix:
allow_failures:
- configuration: DD
- configuration: DD64
before_build: before_build:
- set "Path=%MINGW_SDK%\bin;%Path%" - set "Path=%MINGW_SDK%\bin;%Path%"
...@@ -92,8 +83,8 @@ before_build: ...@@ -92,8 +83,8 @@ before_build:
- ccache -V - ccache -V
- ccache -s - ccache -s
- if [%NOUPX%] == [1] ( set "NOUPX=NOUPX=1" ) else ( set "NOUPX=" ) - if [%NOUPX%] == [1] ( set "NOUPX=NOUPX=1" ) else ( set "NOUPX=" )
- set "SRB2_MFLAGS=-C src WARNINGMODE=1 CCACHE=1 GCC73=1 NOOBJDUMP=1 %NOUPX%" - set "SRB2_MFLAGS=-C src WARNINGMODE=1 CCACHE=1 NOOBJDUMP=1 %NOUPX%"
- if [%X86_64%] == [1] ( set "MINGW_FLAGS=MINGW64=1 X86_64=1" ) else ( set "MINGW_FLAGS=MINGW=1 GCC91=1" ) - if [%X86_64%] == [1] ( set "MINGW_FLAGS=MINGW64=1 X86_64=1 GCC81=1" ) else ( set "MINGW_FLAGS=MINGW=1 GCC91=1" )
- set "SRB2_MFLAGS=%SRB2_MFLAGS% %MINGW_FLAGS% %CONFIGURATION%=1" - set "SRB2_MFLAGS=%SRB2_MFLAGS% %MINGW_FLAGS% %CONFIGURATION%=1"
build_script: build_script:
......
...@@ -690,9 +690,9 @@ linedeftypes ...@@ -690,9 +690,9 @@ linedeftypes
title = "Chain Parameters"; title = "Chain Parameters";
prefix = "(9)"; prefix = "(9)";
flags32text = "[5] Swing instead of spin"; flags32text = "[5] Swing instead of spin";
flags128text = "[7] Make chain from end item";
flags64text = "[6] Player-turnable chain"; flags64text = "[6] Player-turnable chain";
flags128text = "[7] Make chain from maces"; flags256text = "[8] Spawn link at origin";
flags256text = "[8] Spawn mace at origin";
flags512text = "[9] Don't clip inside ground"; flags512text = "[9] Don't clip inside ground";
flags1024text = "[10] No distance check"; flags1024text = "[10] No distance check";
} }
......
...@@ -245,6 +245,8 @@ void I_GetJoystick2Events(void){} ...@@ -245,6 +245,8 @@ void I_GetJoystick2Events(void){}
void I_GetMouseEvents(void){} void I_GetMouseEvents(void){}
void I_UpdateMouseGrab(void){}
char *I_GetEnv(const char *name) char *I_GetEnv(const char *name)
{ {
LOGW("I_GetEnv() called?!"); LOGW("I_GetEnv() called?!");
......
...@@ -19,6 +19,7 @@ boolean allow_fullscreen = false; ...@@ -19,6 +19,7 @@ boolean allow_fullscreen = false;
consvar_t cv_vidwait = {"vid_wait", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_vidwait = {"vid_wait", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
void I_StartupGraphics(void){} void I_StartupGraphics(void){}
void I_StartupHardwareGraphics(void){}
void I_ShutdownGraphics(void){} void I_ShutdownGraphics(void){}
...@@ -51,6 +52,11 @@ INT32 VID_SetMode(INT32 modenum) ...@@ -51,6 +52,11 @@ INT32 VID_SetMode(INT32 modenum)
return 0; return 0;
} }
void VID_CheckRenderer(void)
{
// ..............
}
const char *VID_GetModeName(INT32 modenum) const char *VID_GetModeName(INT32 modenum)
{ {
return "A320x240"; return "A320x240";
......
...@@ -61,6 +61,8 @@ static consvar_t *consvar_vars; // list of registered console variables ...@@ -61,6 +61,8 @@ static consvar_t *consvar_vars; // list of registered console variables
static char com_token[1024]; static char com_token[1024];
static char *COM_Parse(char *data); static char *COM_Parse(char *data);
static char * COM_Purge (char *text, int *lenp);
CV_PossibleValue_t CV_OnOff[] = {{0, "Off"}, {1, "On"}, {0, NULL}}; CV_PossibleValue_t CV_OnOff[] = {{0, "Off"}, {1, "On"}, {0, NULL}};
CV_PossibleValue_t CV_YesNo[] = {{0, "No"}, {1, "Yes"}, {0, NULL}}; CV_PossibleValue_t CV_YesNo[] = {{0, "No"}, {1, "Yes"}, {0, NULL}};
CV_PossibleValue_t CV_Unsigned[] = {{0, "MIN"}, {999999999, "MAX"}, {0, NULL}}; CV_PossibleValue_t CV_Unsigned[] = {{0, "MIN"}, {999999999, "MAX"}, {0, NULL}};
...@@ -100,31 +102,61 @@ static cmdalias_t *com_alias; // aliases list ...@@ -100,31 +102,61 @@ static cmdalias_t *com_alias; // aliases list
static vsbuf_t com_text; // variable sized buffer static vsbuf_t com_text; // variable sized buffer
/** Purges control characters out of some text.
*
* \param s The text.
* \param np Optionally a pointer to fill with the new string length.
* \return The text.
* \sa COM_ExecuteString
*/
static char *
COM_Purge (char *s, int *np)
{
char *t;
char *p;
int n;
n = strlen(s);
t = s + n + 1;
p = s;
while (( p = strchr(p, '\033') ))
{
memmove(p, &p[1], t - p - 1);
n--;
}
if (np)
(*np) = n;
return s;
}
/** Adds text into the command buffer for later execution. /** Adds text into the command buffer for later execution.
* *
* \param ptext The text to add. * \param ptext The text to add.
* \sa COM_BufInsertText * \sa COM_BufInsertTextEx
*/ */
void COM_BufAddText(const char *ptext) void COM_BufAddTextEx(const char *ptext, int flags)
{ {
size_t l; int l;
char *text;
l = strlen(ptext); text = COM_Purge(Z_StrDup(ptext), &l);
if (com_text.cursize + l >= com_text.maxsize) if (com_text.cursize + 2 + l >= com_text.maxsize)
{ {
CONS_Alert(CONS_WARNING, M_GetText("Command buffer full!\n")); CONS_Alert(CONS_WARNING, M_GetText("Command buffer full!\n"));
return; return;
} }
VS_Write(&com_text, ptext, l);
VS_WriteEx(&com_text, text, l, flags);
Z_Free(text);
} }
/** Adds command text and executes it immediately. /** Adds command text and executes it immediately.
* *
* \param ptext The text to execute. A newline is automatically added. * \param ptext The text to execute. A newline is automatically added.
* \sa COM_BufAddText * \sa COM_BufAddTextEx
*/ */
void COM_BufInsertText(const char *ptext) void COM_BufInsertTextEx(const char *ptext, int flags)
{ {
char *temp = NULL; char *temp = NULL;
size_t templen; size_t templen;
...@@ -138,7 +170,7 @@ void COM_BufInsertText(const char *ptext) ...@@ -138,7 +170,7 @@ void COM_BufInsertText(const char *ptext)
} }
// add the entire text of the file (or alias) // add the entire text of the file (or alias)
COM_BufAddText(ptext); COM_BufAddTextEx(ptext, flags);
COM_BufExecute(); // do it right away COM_BufExecute(); // do it right away
// add the copied off data // add the copied off data
...@@ -272,6 +304,7 @@ static size_t com_argc; ...@@ -272,6 +304,7 @@ static size_t com_argc;
static char *com_argv[MAX_ARGS]; static char *com_argv[MAX_ARGS];
static const char *com_null_string = ""; static const char *com_null_string = "";
static char *com_args = NULL; // current command args or NULL static char *com_args = NULL; // current command args or NULL
static int com_flags;
static void Got_NetVar(UINT8 **p, INT32 playernum); static void Got_NetVar(UINT8 **p, INT32 playernum);
...@@ -394,12 +427,21 @@ static void COM_TokenizeString(char *ptext) ...@@ -394,12 +427,21 @@ static void COM_TokenizeString(char *ptext)
com_argc = 0; com_argc = 0;
com_args = NULL; com_args = NULL;
com_flags = 0;
while (com_argc < MAX_ARGS) while (com_argc < MAX_ARGS)
{ {
// Skip whitespace up to a newline. // Skip whitespace up to a newline.
while (*ptext != '\0' && *ptext <= ' ' && *ptext != '\n') while (*ptext != '\0' && *ptext <= ' ' && *ptext != '\n')
ptext++; {
if (ptext[0] == '\033')
{
com_flags = (unsigned)ptext[1];
ptext += 2;
}
else
ptext++;
}
// A newline means end of command in buffer, // A newline means end of command in buffer,
// thus end of this command's args too. // thus end of this command's args too.
...@@ -1016,6 +1058,15 @@ void VS_Write(vsbuf_t *buf, const void *data, size_t length) ...@@ -1016,6 +1058,15 @@ void VS_Write(vsbuf_t *buf, const void *data, size_t length)
M_Memcpy(VS_GetSpace(buf, length), data, length); M_Memcpy(VS_GetSpace(buf, length), data, length);
} }
void VS_WriteEx(vsbuf_t *buf, const void *data, size_t length, int flags)
{
char *p;
p = VS_GetSpace(buf, 2 + length);
p[0] = '\033';
p[1] = flags;
M_Memcpy(&p[2], data, length);
}
/** Prints text in a variable buffer. Like VS_Write() plus a /** Prints text in a variable buffer. Like VS_Write() plus a
* trailing NUL. * trailing NUL.
* *
...@@ -1406,15 +1457,8 @@ static void Got_NetVar(UINT8 **p, INT32 playernum) ...@@ -1406,15 +1457,8 @@ static void Got_NetVar(UINT8 **p, INT32 playernum)
{ {
// not from server or remote admin, must be hacked/buggy client // not from server or remote admin, must be hacked/buggy client
CONS_Alert(CONS_WARNING, M_GetText("Illegal netvar command received from %s\n"), player_names[playernum]); CONS_Alert(CONS_WARNING, M_GetText("Illegal netvar command received from %s\n"), player_names[playernum]);
if (server) if (server)
{ SendKick(playernum, KICK_MSG_CON_FAIL);
UINT8 buf[2];
buf[0] = (UINT8)playernum;
buf[1] = KICK_MSG_CON_FAIL;
SendNetXCmd(XD_KICK, &buf, 2);
}
return; return;
} }
netid = READUINT16(*p); netid = READUINT16(*p);
...@@ -2015,6 +2059,9 @@ static boolean CV_Command(void) ...@@ -2015,6 +2059,9 @@ static boolean CV_Command(void)
if (!v) if (!v)
return false; return false;
if (( com_flags & COM_SAFE ) && ( v->flags & CV_NOLUA ))
return false;
// perform a variable print or set // perform a variable print or set
if (COM_Argc() == 1) if (COM_Argc() == 1)
{ {
...@@ -2116,8 +2163,13 @@ skipwhite: ...@@ -2116,8 +2163,13 @@ skipwhite:
com_token[len] = 0; com_token[len] = 0;
return data; return data;
} }
com_token[len] = c; if (c == '\033')
len++; data++;
else
{
com_token[len] = c;
len++;
}
} }
} }
...@@ -2133,10 +2185,22 @@ skipwhite: ...@@ -2133,10 +2185,22 @@ skipwhite:
// parse a regular word // parse a regular word
do do
{ {
com_token[len] = c; if (c == '\033')
data++; {
len++; do
c = *data; {
data += 2;
c = *data;
}
while (c == '\033') ;
}
else
{
com_token[len] = c;
data++;
len++;
c = *data;
}
if (c == '{' || c == '}' || c == ')'|| c == '(' || c == '\'') if (c == '{' || c == '}' || c == ')'|| c == '(' || c == '\'')
break; break;
} while (c > 32); } while (c > 32);
......
...@@ -20,6 +20,11 @@ ...@@ -20,6 +20,11 @@
// Command buffer & command execution // Command buffer & command execution
//=================================== //===================================
enum
{
COM_SAFE = 1,
};
typedef void (*com_func_t)(void); typedef void (*com_func_t)(void);
void COM_AddCommand(const char *name, com_func_t func); void COM_AddCommand(const char *name, com_func_t func);
...@@ -36,10 +41,12 @@ size_t COM_FirstOption(void); ...@@ -36,10 +41,12 @@ size_t COM_FirstOption(void);
const char *COM_CompleteCommand(const char *partial, INT32 skips); const char *COM_CompleteCommand(const char *partial, INT32 skips);
// insert at queu (at end of other command) // insert at queu (at end of other command)
void COM_BufAddText(const char *btext); #define COM_BufAddText(s) COM_BufAddTextEx(s, 0)
void COM_BufAddTextEx(const char *btext, int flags);
// insert in head (before other command) // insert in head (before other command)
void COM_BufInsertText(const char *btext); #define COM_BufInsertText(s) COM_BufInsertTextEx(s, 0)
void COM_BufInsertTextEx(const char *btext, int flags);
// don't bother inserting, just do immediately // don't bother inserting, just do immediately
void COM_ImmedExecute(const char *ptext); void COM_ImmedExecute(const char *ptext);
...@@ -71,6 +78,7 @@ void VS_Free(vsbuf_t *buf); ...@@ -71,6 +78,7 @@ void VS_Free(vsbuf_t *buf);
void VS_Clear(vsbuf_t *buf); void VS_Clear(vsbuf_t *buf);
void *VS_GetSpace(vsbuf_t *buf, size_t length); void *VS_GetSpace(vsbuf_t *buf, size_t length);
void VS_Write(vsbuf_t *buf, const void *data, size_t length); void VS_Write(vsbuf_t *buf, const void *data, size_t length);
void VS_WriteEx(vsbuf_t *buf, const void *data, size_t length, int flags);
void VS_Print(vsbuf_t *buf, const char *data); // strcats onto the sizebuf void VS_Print(vsbuf_t *buf, const char *data); // strcats onto the sizebuf
//================== //==================
...@@ -100,7 +108,8 @@ typedef enum ...@@ -100,7 +108,8 @@ typedef enum
CV_HIDEN = 1024, // variable is not part of the cvar list so cannot be accessed by the console CV_HIDEN = 1024, // variable is not part of the cvar list so cannot be accessed by the console
// can only be set when we have the pointer to it // can only be set when we have the pointer to it
// used on menus // used on menus
CV_CHEAT = 2048 // Don't let this be used in multiplayer unless cheats are on. CV_CHEAT = 2048, // Don't let this be used in multiplayer unless cheats are on.
CV_NOLUA = 4096,/* don't let this be called from Lua */
} cvflags_t; } cvflags_t;
typedef struct CV_PossibleValue_s typedef struct CV_PossibleValue_s
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include "g_input.h" #include "g_input.h"
#include "hu_stuff.h" #include "hu_stuff.h"
#include "keys.h" #include "keys.h"
#include "r_main.h"
#include "r_defs.h" #include "r_defs.h"
#include "sounds.h" #include "sounds.h"
#include "st_stuff.h" #include "st_stuff.h"
...@@ -591,6 +592,8 @@ void CON_ToggleOff(void) ...@@ -591,6 +592,8 @@ void CON_ToggleOff(void)
CON_ClearHUD(); CON_ClearHUD();
con_forcepic = 0; con_forcepic = 0;
con_clipviewtop = -1; // remove console clipping of view con_clipviewtop = -1; // remove console clipping of view
I_UpdateMouseGrab();
} }
boolean CON_Ready(void) boolean CON_Ready(void)
...@@ -609,14 +612,6 @@ void CON_Ticker(void) ...@@ -609,14 +612,6 @@ void CON_Ticker(void)
con_tick++; con_tick++;
con_tick &= 7; con_tick &= 7;
// if the menu is open then close the console.
if (menuactive && con_destlines)
{
consoletoggle = false;
con_destlines = 0;
CON_ClearHUD();
}
// console key was pushed // console key was pushed
if (consoletoggle) if (consoletoggle)
{ {
...@@ -627,6 +622,7 @@ void CON_Ticker(void) ...@@ -627,6 +622,7 @@ void CON_Ticker(void)
{ {
con_destlines = 0; con_destlines = 0;
CON_ClearHUD(); CON_ClearHUD();
I_UpdateMouseGrab();
} }
else else
CON_ChangeHeight(); CON_ChangeHeight();
...@@ -772,7 +768,7 @@ boolean CON_Responder(event_t *ev) ...@@ -772,7 +768,7 @@ boolean CON_Responder(event_t *ev)
// check for console toggle key // check for console toggle key
if (ev->type != ev_console) if (ev->type != ev_console)
{ {
if (modeattacking || metalrecording) if (modeattacking || metalrecording || menuactive)
return false; return false;
if (key == gamecontrol[gc_console][0] || key == gamecontrol[gc_console][1]) if (key == gamecontrol[gc_console][0] || key == gamecontrol[gc_console][1])
...@@ -787,7 +783,7 @@ boolean CON_Responder(event_t *ev) ...@@ -787,7 +783,7 @@ boolean CON_Responder(event_t *ev)
// check other keys only if console prompt is active // check other keys only if console prompt is active
if (!consoleready && key < NUMINPUTS) // metzgermeister: boundary check!! if (!consoleready && key < NUMINPUTS) // metzgermeister: boundary check!!
{ {
if (bindtable[key]) if (! menuactive && bindtable[key])
{ {
COM_BufAddText(bindtable[key]); COM_BufAddText(bindtable[key]);
COM_BufAddText("\n"); COM_BufAddText("\n");
...@@ -1285,10 +1281,10 @@ void CONS_Printf(const char *fmt, ...) ...@@ -1285,10 +1281,10 @@ void CONS_Printf(const char *fmt, ...)
con_scrollup = 0; con_scrollup = 0;
// if not in display loop, force screen update // if not in display loop, force screen update
if (con_startup) if (con_startup && (!setrenderneeded))
{ {
#ifdef _WINDOWS #ifdef _WINDOWS
patch_t *con_backpic = W_CachePatchName("CONSBACK", PU_CACHE); patch_t *con_backpic = W_CachePatchName("CONSBACK", PU_PATCH);
// Jimita: CON_DrawBackpic just called V_DrawScaledPatch // Jimita: CON_DrawBackpic just called V_DrawScaledPatch
V_DrawScaledPatch(0, 0, 0, con_backpic); V_DrawScaledPatch(0, 0, 0, con_backpic);
...@@ -1545,10 +1541,15 @@ static void CON_DrawConsole(void) ...@@ -1545,10 +1541,15 @@ static void CON_DrawConsole(void)
// draw console background // draw console background
if (cons_backpic.value || con_forcepic) if (cons_backpic.value || con_forcepic)
{ {
patch_t *con_backpic = W_CachePatchName("CONSBACK", PU_CACHE); patch_t *con_backpic = W_CachePatchName("CONSBACK", PU_PATCH);
int h;
h = con_curlines/vid.dupy;
// Jimita: CON_DrawBackpic just called V_DrawScaledPatch // Jimita: CON_DrawBackpic just called V_DrawScaledPatch
V_DrawScaledPatch(0, 0, 0, con_backpic); //V_DrawScaledPatch(0, 0, 0, con_backpic);
V_DrawCroppedPatch(0, 0, FRACUNIT, 0, con_backpic,
0, ( BASEVIDHEIGHT - h ), BASEVIDWIDTH, h);
W_UnlockCachedPatch(con_backpic); W_UnlockCachedPatch(con_backpic);
} }
...@@ -1602,8 +1603,18 @@ void CON_Drawer(void) ...@@ -1602,8 +1603,18 @@ void CON_Drawer(void)
if (!con_started || !graphics_started) if (!con_started || !graphics_started)
return; return;
if (needpatchrecache)
{
W_FlushCachedPatches();
HU_LoadGraphics();
}
if (con_recalc) if (con_recalc)
{
CON_RecalcSize(); CON_RecalcSize();
if (con_curlines <= 0)
CON_ClearHUD();
}
if (con_curlines > 0) if (con_curlines > 0)
CON_DrawConsole(); CON_DrawConsole();
......
...@@ -391,11 +391,7 @@ static void ExtraDataTicker(void) ...@@ -391,11 +391,7 @@ static void ExtraDataTicker(void)
{ {
if (server) if (server)
{ {
UINT8 buf[3]; SendKick(i, KICK_MSG_CON_FAIL);
buf[0] = (UINT8)i;
buf[1] = KICK_MSG_CON_FAIL;
SendNetXCmd(XD_KICK, &buf, 2);
DEBFILE(va("player %d kicked [gametic=%u] reason as follows:\n", i, gametic)); DEBFILE(va("player %d kicked [gametic=%u] reason as follows:\n", i, gametic));
} }
CONS_Alert(CONS_WARNING, M_GetText("Got unknown net command [%s]=%d (max %d)\n"), sizeu1(curpos - bufferstart), *curpos, bufferstart[0]); CONS_Alert(CONS_WARNING, M_GetText("Got unknown net command [%s]=%d (max %d)\n"), sizeu1(curpos - bufferstart), *curpos, bufferstart[0]);
...@@ -437,6 +433,15 @@ void D_ResetTiccmds(void) ...@@ -437,6 +433,15 @@ void D_ResetTiccmds(void)
D_Clearticcmd(textcmds[i]->tic); D_Clearticcmd(textcmds[i]->tic);
} }
void SendKick(UINT8 playernum, UINT8 msg)
{
UINT8 buf[2];
buf[0] = playernum;
buf[1] = msg;
SendNetXCmd(XD_KICK, &buf, 2);
}
// ----------------------------------------------------------------- // -----------------------------------------------------------------
// end of extra data function // end of extra data function
// ----------------------------------------------------------------- // -----------------------------------------------------------------
...@@ -1059,10 +1064,7 @@ static void SV_SendResynch(INT32 node) ...@@ -1059,10 +1064,7 @@ static void SV_SendResynch(INT32 node)
if (resynch_score[node] > (unsigned)cv_resynchattempts.value*250) if (resynch_score[node] > (unsigned)cv_resynchattempts.value*250)
{ {
UINT8 buf[2]; SendKick(nodetoplayer[node], KICK_MSG_CON_FAIL);
buf[0] = (UINT8)nodetoplayer[node];
buf[1] = KICK_MSG_CON_FAIL;
SendNetXCmd(XD_KICK, &buf, 2);
resynch_score[node] = 0; resynch_score[node] = 0;
} }
} }
...@@ -1343,11 +1345,11 @@ static void SV_SendPlayerInfo(INT32 node) ...@@ -1343,11 +1345,11 @@ static void SV_SendPlayerInfo(INT32 node)
{ {
if (!playeringame[i]) if (!playeringame[i])
{ {
netbuffer->u.playerinfo[i].node = 255; // This slot is empty. netbuffer->u.playerinfo[i].num = 255; // This slot is empty.
continue; continue;
} }
netbuffer->u.playerinfo[i].node = i; netbuffer->u.playerinfo[i].num = i;
strncpy(netbuffer->u.playerinfo[i].name, (const char *)&player_names[i], MAXPLAYERNAME+1); strncpy(netbuffer->u.playerinfo[i].name, (const char *)&player_names[i], MAXPLAYERNAME+1);
netbuffer->u.playerinfo[i].name[MAXPLAYERNAME] = '\0'; netbuffer->u.playerinfo[i].name[MAXPLAYERNAME] = '\0';
...@@ -1622,6 +1624,7 @@ static void CL_LoadReceivedSavegame(void) ...@@ -1622,6 +1624,7 @@ static void CL_LoadReceivedSavegame(void)
paused = false; paused = false;
demoplayback = false; demoplayback = false;
titlemapinaction = TITLEMAP_OFF;
titledemo = false; titledemo = false;
automapactive = false; automapactive = false;
...@@ -2985,8 +2988,8 @@ static void Got_KickCmd(UINT8 **p, INT32 playernum) ...@@ -2985,8 +2988,8 @@ static void Got_KickCmd(UINT8 **p, INT32 playernum)
CL_RemovePlayer(pnum, kickreason); CL_RemovePlayer(pnum, kickreason);
} }
consvar_t cv_allownewplayer = {"allowjoin", "On", CV_SAVE|CV_NETVAR, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL }; consvar_t cv_allownewplayer = {"allowjoin", "On", CV_NETVAR, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL };
consvar_t cv_joinnextround = {"joinnextround", "Off", CV_SAVE|CV_NETVAR, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; /// \todo not done consvar_t cv_joinnextround = {"joinnextround", "Off", CV_NETVAR, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; /// \todo not done
static CV_PossibleValue_t maxplayers_cons_t[] = {{2, "MIN"}, {32, "MAX"}, {0, NULL}}; static CV_PossibleValue_t maxplayers_cons_t[] = {{2, "MIN"}, {32, "MAX"}, {0, NULL}};
consvar_t cv_maxplayers = {"maxplayers", "8", CV_SAVE, maxplayers_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_maxplayers = {"maxplayers", "8", CV_SAVE, maxplayers_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
static CV_PossibleValue_t resynchattempts_cons_t[] = {{1, "MIN"}, {20, "MAX"}, {0, "No"}, {0, NULL}}; static CV_PossibleValue_t resynchattempts_cons_t[] = {{1, "MIN"}, {20, "MAX"}, {0, "No"}, {0, NULL}};
...@@ -3199,13 +3202,7 @@ static void Got_AddPlayer(UINT8 **p, INT32 playernum) ...@@ -3199,13 +3202,7 @@ static void Got_AddPlayer(UINT8 **p, INT32 playernum)
// protect against hacked/buggy client // protect against hacked/buggy client
CONS_Alert(CONS_WARNING, M_GetText("Illegal add player command received from %s\n"), player_names[playernum]); CONS_Alert(CONS_WARNING, M_GetText("Illegal add player command received from %s\n"), player_names[playernum]);
if (server) if (server)
{ SendKick(playernum, KICK_MSG_CON_FAIL);
UINT8 buf[2];
buf[0] = (UINT8)playernum;
buf[1] = KICK_MSG_CON_FAIL;
SendNetXCmd(XD_KICK, &buf, 2);
}
return; return;
} }
...@@ -3388,14 +3385,10 @@ void CL_AddSplitscreenPlayer(void) ...@@ -3388,14 +3385,10 @@ void CL_AddSplitscreenPlayer(void)
void CL_RemoveSplitscreenPlayer(void) void CL_RemoveSplitscreenPlayer(void)
{ {
UINT8 buf[2];
if (cl_mode != CL_CONNECTED) if (cl_mode != CL_CONNECTED)
return; return;
buf[0] = (UINT8)secondarydisplayplayer; SendKick(secondarydisplayplayer, KICK_MSG_PLAYER_QUIT);
buf[1] = KICK_MSG_PLAYER_QUIT;
SendNetXCmd(XD_KICK, &buf, 2);
} }
// is there a game running // is there a game running
...@@ -3924,13 +3917,10 @@ static void HandlePacketFromPlayer(SINT8 node) ...@@ -3924,13 +3917,10 @@ static void HandlePacketFromPlayer(SINT8 node)
if (netcmds[maketic%BACKUPTICS][netconsole].forwardmove > MAXPLMOVE || netcmds[maketic%BACKUPTICS][netconsole].forwardmove < -MAXPLMOVE if (netcmds[maketic%BACKUPTICS][netconsole].forwardmove > MAXPLMOVE || netcmds[maketic%BACKUPTICS][netconsole].forwardmove < -MAXPLMOVE
|| netcmds[maketic%BACKUPTICS][netconsole].sidemove > MAXPLMOVE || netcmds[maketic%BACKUPTICS][netconsole].sidemove < -MAXPLMOVE) || netcmds[maketic%BACKUPTICS][netconsole].sidemove > MAXPLMOVE || netcmds[maketic%BACKUPTICS][netconsole].sidemove < -MAXPLMOVE)
{ {
char buf[2];
CONS_Alert(CONS_WARNING, M_GetText("Illegal movement value received from node %d\n"), netconsole); CONS_Alert(CONS_WARNING, M_GetText("Illegal movement value received from node %d\n"), netconsole);
//D_Clearticcmd(k); //D_Clearticcmd(k);
buf[0] = (char)netconsole; SendKick(netconsole, KICK_MSG_CON_FAIL);
buf[1] = KICK_MSG_CON_FAIL;
SendNetXCmd(XD_KICK, &buf, 2);
break; break;
} }
...@@ -3967,11 +3957,7 @@ static void HandlePacketFromPlayer(SINT8 node) ...@@ -3967,11 +3957,7 @@ static void HandlePacketFromPlayer(SINT8 node)
} }
else else
{ {
UINT8 buf[3]; SendKick(netconsole, KICK_MSG_CON_FAIL);
buf[0] = (UINT8)netconsole;
buf[1] = KICK_MSG_CON_FAIL;
SendNetXCmd(XD_KICK, &buf, 2);
DEBFILE(va("player %d kicked (synch failure) [%u] %d!=%d\n", DEBFILE(va("player %d kicked (synch failure) [%u] %d!=%d\n",
netconsole, realstart, consistancy[realstart%BACKUPTICS], netconsole, realstart, consistancy[realstart%BACKUPTICS],
SHORT(netbuffer->u.clientpak.consistancy))); SHORT(netbuffer->u.clientpak.consistancy)));
...@@ -4084,19 +4070,20 @@ static void HandlePacketFromPlayer(SINT8 node) ...@@ -4084,19 +4070,20 @@ static void HandlePacketFromPlayer(SINT8 node)
nodewaiting[node] = 0; nodewaiting[node] = 0;
if (netconsole != -1 && playeringame[netconsole]) if (netconsole != -1 && playeringame[netconsole])
{ {
UINT8 buf[2]; UINT8 kickmsg;
buf[0] = (UINT8)netconsole;
if (netbuffer->packettype == PT_NODETIMEOUT) if (netbuffer->packettype == PT_NODETIMEOUT)
buf[1] = KICK_MSG_TIMEOUT; kickmsg = KICK_MSG_TIMEOUT;
else else
buf[1] = KICK_MSG_PLAYER_QUIT; kickmsg = KICK_MSG_PLAYER_QUIT;
SendNetXCmd(XD_KICK, &buf, 2);
SendKick(netconsole, kickmsg);
nodetoplayer[node] = -1; nodetoplayer[node] = -1;
if (nodetoplayer2[node] != -1 && nodetoplayer2[node] >= 0 if (nodetoplayer2[node] != -1 && nodetoplayer2[node] >= 0
&& playeringame[(UINT8)nodetoplayer2[node]]) && playeringame[(UINT8)nodetoplayer2[node]])
{ {
buf[0] = nodetoplayer2[node]; SendKick(nodetoplayer2[node], kickmsg);
SendNetXCmd(XD_KICK, &buf, 2);
nodetoplayer2[node] = -1; nodetoplayer2[node] = -1;
} }
} }
...@@ -4109,15 +4096,8 @@ static void HandlePacketFromPlayer(SINT8 node) ...@@ -4109,15 +4096,8 @@ static void HandlePacketFromPlayer(SINT8 node)
if (node != servernode) if (node != servernode)
{ {
CONS_Alert(CONS_WARNING, M_GetText("%s received from non-host %d\n"), "PT_RESYNCHEND", node); CONS_Alert(CONS_WARNING, M_GetText("%s received from non-host %d\n"), "PT_RESYNCHEND", node);
if (server) if (server)
{ SendKick(netconsole, KICK_MSG_CON_FAIL);
UINT8 buf[2];
buf[0] = (UINT8)node;
buf[1] = KICK_MSG_CON_FAIL;
SendNetXCmd(XD_KICK, &buf, 2);
}
break; break;
} }
resynch_local_inprogress = false; resynch_local_inprogress = false;
...@@ -4134,15 +4114,8 @@ static void HandlePacketFromPlayer(SINT8 node) ...@@ -4134,15 +4114,8 @@ static void HandlePacketFromPlayer(SINT8 node)
if (node != servernode) if (node != servernode)
{ {
CONS_Alert(CONS_WARNING, M_GetText("%s received from non-host %d\n"), "PT_SERVERTICS", node); CONS_Alert(CONS_WARNING, M_GetText("%s received from non-host %d\n"), "PT_SERVERTICS", node);
if (server) if (server)
{ SendKick(netconsole, KICK_MSG_CON_FAIL);
UINT8 buf[2];
buf[0] = (UINT8)node;
buf[1] = KICK_MSG_CON_FAIL;
SendNetXCmd(XD_KICK, &buf, 2);
}
break; break;
} }
...@@ -4201,15 +4174,8 @@ static void HandlePacketFromPlayer(SINT8 node) ...@@ -4201,15 +4174,8 @@ static void HandlePacketFromPlayer(SINT8 node)
if (node != servernode) if (node != servernode)
{ {
CONS_Alert(CONS_WARNING, M_GetText("%s received from non-host %d\n"), "PT_RESYNCHING", node); CONS_Alert(CONS_WARNING, M_GetText("%s received from non-host %d\n"), "PT_RESYNCHING", node);
if (server) if (server)
{ SendKick(netconsole, KICK_MSG_CON_FAIL);
char buf[2];
buf[0] = (char)node;
buf[1] = KICK_MSG_CON_FAIL;
SendNetXCmd(XD_KICK, &buf, 2);
}
break; break;
} }
resynch_local_inprogress = true; resynch_local_inprogress = true;
...@@ -4220,15 +4186,8 @@ static void HandlePacketFromPlayer(SINT8 node) ...@@ -4220,15 +4186,8 @@ static void HandlePacketFromPlayer(SINT8 node)
if (node != servernode) if (node != servernode)
{ {
CONS_Alert(CONS_WARNING, M_GetText("%s received from non-host %d\n"), "PT_PING", node); CONS_Alert(CONS_WARNING, M_GetText("%s received from non-host %d\n"), "PT_PING", node);
if (server) if (server)
{ SendKick(netconsole, KICK_MSG_CON_FAIL);
char buf[2];
buf[0] = (char)node;
buf[1] = KICK_MSG_CON_FAIL;
SendNetXCmd(XD_KICK, &buf, 2);
}
break; break;
} }
...@@ -4251,15 +4210,8 @@ static void HandlePacketFromPlayer(SINT8 node) ...@@ -4251,15 +4210,8 @@ static void HandlePacketFromPlayer(SINT8 node)
if (node != servernode) if (node != servernode)
{ {
CONS_Alert(CONS_WARNING, M_GetText("%s received from non-host %d\n"), "PT_FILEFRAGMENT", node); CONS_Alert(CONS_WARNING, M_GetText("%s received from non-host %d\n"), "PT_FILEFRAGMENT", node);
if (server) if (server)
{ SendKick(netconsole, KICK_MSG_CON_FAIL);
UINT8 buf[2];
buf[0] = (UINT8)node;
buf[1] = KICK_MSG_CON_FAIL;
SendNetXCmd(XD_KICK, &buf, 2);
}
break; break;
} }
if (client) if (client)
...@@ -4806,13 +4758,8 @@ static inline void PingUpdate(void) ...@@ -4806,13 +4758,8 @@ static inline void PingUpdate(void)
if (pingtimeout[i] > cv_pingtimeout.value) if (pingtimeout[i] > cv_pingtimeout.value)
// ok your net has been bad for too long, you deserve to die. // ok your net has been bad for too long, you deserve to die.
{ {
char buf[2];
pingtimeout[i] = 0; pingtimeout[i] = 0;
SendKick(i, KICK_MSG_PING_HIGH);
buf[0] = (char)i;
buf[1] = KICK_MSG_PING_HIGH;
SendNetXCmd(XD_KICK, &buf, 2);
} }
} }
/* /*
......
...@@ -375,7 +375,7 @@ typedef struct ...@@ -375,7 +375,7 @@ typedef struct
// Shorter player information for external use. // Shorter player information for external use.
typedef struct typedef struct
{ {
UINT8 node; UINT8 num;
char name[MAXPLAYERNAME+1]; char name[MAXPLAYERNAME+1];
UINT8 address[4]; // sending another string would run us up against MAXPACKETLENGTH UINT8 address[4]; // sending another string would run us up against MAXPACKETLENGTH
UINT8 team; UINT8 team;
...@@ -500,6 +500,7 @@ void D_ClientServerInit(void); ...@@ -500,6 +500,7 @@ void D_ClientServerInit(void);
void RegisterNetXCmd(netxcmd_t id, void (*cmd_f)(UINT8 **p, INT32 playernum)); void RegisterNetXCmd(netxcmd_t id, void (*cmd_f)(UINT8 **p, INT32 playernum));
void SendNetXCmd(netxcmd_t id, const void *param, size_t nparam); void SendNetXCmd(netxcmd_t id, const void *param, size_t nparam);
void SendNetXCmd2(netxcmd_t id, const void *param, size_t nparam); // splitsreen player void SendNetXCmd2(netxcmd_t id, const void *param, size_t nparam); // splitsreen player
void SendKick(UINT8 playernum, UINT8 msg);
// Create any new ticcmds and broadcast to other players. // Create any new ticcmds and broadcast to other players.
void NetUpdate(void); void NetUpdate(void);
......
...@@ -108,6 +108,8 @@ boolean devparm = false; // started game with -devparm ...@@ -108,6 +108,8 @@ boolean devparm = false; // started game with -devparm
boolean singletics = false; // timedemo boolean singletics = false; // timedemo
boolean lastdraw = false; boolean lastdraw = false;
static void D_CheckRendererState(void);
postimg_t postimgtype = postimg_none; postimg_t postimgtype = postimg_none;
INT32 postimgparam; INT32 postimgparam;
postimg_t postimgtype2 = postimg_none; postimg_t postimgtype2 = postimg_none;
...@@ -186,14 +188,14 @@ void D_ProcessEvents(void) ...@@ -186,14 +188,14 @@ void D_ProcessEvents(void)
continue; continue;
} }
// Menu input
if (M_Responder(ev))
continue; // menu ate the event
// console input // console input
if (CON_Responder(ev)) if (CON_Responder(ev))
continue; // ate the event continue; // ate the event
// Menu input
if (M_Responder(ev))
continue; // menu ate the event
G_Responder(ev); G_Responder(ev);
} }
} }
...@@ -212,6 +214,7 @@ INT16 wipetypepost = -1; ...@@ -212,6 +214,7 @@ INT16 wipetypepost = -1;
static void D_Display(void) static void D_Display(void)
{ {
INT32 setrenderstillneeded = 0;
boolean forcerefresh = false; boolean forcerefresh = false;
static boolean wipe = false; static boolean wipe = false;
INT32 wipedefindex = 0; INT32 wipedefindex = 0;
...@@ -222,11 +225,38 @@ static void D_Display(void) ...@@ -222,11 +225,38 @@ static void D_Display(void)
if (nodrawers) if (nodrawers)
return; // for comparative timing/profiling return; // for comparative timing/profiling
// check for change of screen size (video mode) // Lactozilla: Switching renderers works by checking
if (setmodeneeded && !wipe) // if the game has to do it right when the frame
// needs to render. If so, five things will happen:
// 1. Interface functions will be called so
// that switching to OpenGL creates a
// GL context, and switching to Software
// allocates screen buffers.
// 2. Software will set drawer functions,
// and OpenGL will load textures and
// create plane polygons, if necessary.
// 3. Functions related to switching video
// modes (resolution) are called.
// 4. Patch data is freed from memory,
// and recached if necessary.
// 5. The frame is ready to be drawn!
// stop movie if needs to change renderer
if (setrenderneeded && (moviemode == MM_APNG))
M_StopMovie();
// check for change of renderer or screen size (video mode)
if ((setrenderneeded || setmodeneeded) && !wipe)
{
if (setrenderneeded)
{
CONS_Debug(DBG_RENDER, "setrenderneeded set (%d)\n", setrenderneeded);
setrenderstillneeded = setrenderneeded;
}
SCR_SetMode(); // change video mode SCR_SetMode(); // change video mode
}
if (vid.recalc) if (vid.recalc || setrenderstillneeded)
{ {
SCR_Recalc(); // NOTE! setsizeneeded is set by SCR_Recalc() SCR_Recalc(); // NOTE! setsizeneeded is set by SCR_Recalc()
#ifdef HWRENDER #ifdef HWRENDER
...@@ -237,12 +267,15 @@ static void D_Display(void) ...@@ -237,12 +267,15 @@ static void D_Display(void)
} }
// change the view size if needed // change the view size if needed
if (setsizeneeded) if (setsizeneeded || setrenderstillneeded)
{ {
R_ExecuteSetViewSize(); R_ExecuteSetViewSize();
forcerefresh = true; // force background redraw forcerefresh = true; // force background redraw
} }
// Lactozilla: Renderer switching
D_CheckRendererState();
// draw buffered stuff to screen // draw buffered stuff to screen
// Used only by linux GGI version // Used only by linux GGI version
I_UpdateNoBlit(); I_UpdateNoBlit();
...@@ -274,7 +307,10 @@ static void D_Display(void) ...@@ -274,7 +307,10 @@ static void D_Display(void)
&& wipetypepre != UINT8_MAX) && wipetypepre != UINT8_MAX)
{ {
F_WipeStartScreen(); F_WipeStartScreen();
F_WipeColorFill(31); // Check for Mega Genesis fade
wipestyleflags = WSF_FADEOUT;
if (F_TryColormapFade(31))
wipetypepost = -1; // Don't run the fade below this one
F_WipeEndScreen(); F_WipeEndScreen();
F_RunWipe(wipetypepre, gamestate != GS_TIMEATTACK && gamestate != GS_TITLESCREEN); F_RunWipe(wipetypepre, gamestate != GS_TIMEATTACK && gamestate != GS_TITLESCREEN);
} }
...@@ -454,7 +490,7 @@ static void D_Display(void) ...@@ -454,7 +490,7 @@ static void D_Display(void)
py = 4; py = 4;
else else
py = viewwindowy + 4; py = viewwindowy + 4;
patch = W_CachePatchName("M_PAUSE", PU_CACHE); patch = W_CachePatchName("M_PAUSE", PU_PATCH);
V_DrawScaledPatch(viewwindowx + (BASEVIDWIDTH - SHORT(patch->width))/2, py, 0, patch); V_DrawScaledPatch(viewwindowx + (BASEVIDWIDTH - SHORT(patch->width))/2, py, 0, patch);
#else #else
INT32 y = ((automapactive) ? (32) : (BASEVIDHEIGHT/2)); INT32 y = ((automapactive) ? (32) : (BASEVIDHEIGHT/2));
...@@ -466,13 +502,12 @@ static void D_Display(void) ...@@ -466,13 +502,12 @@ static void D_Display(void)
// vid size change is now finished if it was on... // vid size change is now finished if it was on...
vid.recalc = 0; vid.recalc = 0;
// FIXME: draw either console or menu, not the two
if (gamestate != GS_TIMEATTACK)
CON_Drawer();
M_Drawer(); // menu is drawn even on top of everything M_Drawer(); // menu is drawn even on top of everything
// focus lost moved to M_Drawer // focus lost moved to M_Drawer
if (gamestate != GS_TIMEATTACK)
CON_Drawer();
// //
// wipe update // wipe update
// //
...@@ -488,6 +523,7 @@ static void D_Display(void) ...@@ -488,6 +523,7 @@ static void D_Display(void)
if (rendermode != render_none) if (rendermode != render_none)
{ {
F_WipeEndScreen(); F_WipeEndScreen();
// Funny. // Funny.
if (WipeStageTitle && st_overlay) if (WipeStageTitle && st_overlay)
{ {
...@@ -497,6 +533,14 @@ static void D_Display(void) ...@@ -497,6 +533,14 @@ static void D_Display(void)
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, levelfadecol); V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, levelfadecol);
F_WipeStartScreen(); F_WipeStartScreen();
} }
// Check for Mega Genesis fade
if (F_ShouldColormapFade())
{
wipestyleflags |= WSF_FADEIN;
wipestyleflags &= ~WSF_FADEOUT;
}
F_RunWipe(wipetypepost, gamestate != GS_TIMEATTACK && gamestate != GS_TITLESCREEN); F_RunWipe(wipetypepost, gamestate != GS_TIMEATTACK && gamestate != GS_TITLESCREEN);
} }
...@@ -545,6 +589,25 @@ static void D_Display(void) ...@@ -545,6 +589,25 @@ static void D_Display(void)
I_FinishUpdate(); // page flip or blit buffer I_FinishUpdate(); // page flip or blit buffer
} }
needpatchflush = false;
needpatchrecache = false;
}
// Lactozilla: Check the renderer's state
// after a possible renderer switch.
void D_CheckRendererState(void)
{
// flush all patches from memory
// (also frees memory tagged with PU_CACHE)
// (which are not necessarily patches but I don't care)
if (needpatchflush)
Z_FlushCachedPatches();
// some patches have been freed,
// so cache them again
if (needpatchrecache)
R_ReloadHUDGraphics();
} }
// ========================================================================= // =========================================================================
...@@ -562,9 +625,6 @@ void D_SRB2Loop(void) ...@@ -562,9 +625,6 @@ void D_SRB2Loop(void)
// Pushing of + parameters is now done back in D_SRB2Main, not here. // Pushing of + parameters is now done back in D_SRB2Main, not here.
CONS_Printf("I_StartupKeyboard()...\n");
I_StartupKeyboard();
#ifdef _WINDOWS #ifdef _WINDOWS
CONS_Printf("I_StartupMouse()...\n"); CONS_Printf("I_StartupMouse()...\n");
I_DoStartupMouse(); I_DoStartupMouse();
...@@ -591,8 +651,7 @@ void D_SRB2Loop(void) ...@@ -591,8 +651,7 @@ void D_SRB2Loop(void)
// hack to start on a nice clear console screen. // hack to start on a nice clear console screen.
COM_ImmedExecute("cls;version"); COM_ImmedExecute("cls;version");
if (rendermode == render_soft) V_DrawScaledPatch(0, 0, 0, W_CachePatchNum(W_GetNumForName("CONSBACK"), PU_CACHE));
V_DrawScaledPatch(0, 0, 0, (patch_t *)W_CacheLumpNum(W_GetNumForName("CONSBACK"), PU_CACHE));
I_FinishUpdate(); // page flip or blit buffer I_FinishUpdate(); // page flip or blit buffer
for (;;) for (;;)
...@@ -986,10 +1045,8 @@ void D_SRB2Main(void) ...@@ -986,10 +1045,8 @@ void D_SRB2Main(void)
I_OutputMsg("setvbuf didnt work\n"); I_OutputMsg("setvbuf didnt work\n");
#endif #endif
#ifdef GETTEXT
// initialise locale code // initialise locale code
M_StartupLocale(); M_StartupLocale();
#endif
// get parameters from a response file (eg: srb2 @parms.txt) // get parameters from a response file (eg: srb2 @parms.txt)
M_FindResponseFile(); M_FindResponseFile();
...@@ -1109,26 +1166,6 @@ void D_SRB2Main(void) ...@@ -1109,26 +1166,6 @@ void D_SRB2Main(void)
if (M_CheckParm("-server") || dedicated) if (M_CheckParm("-server") || dedicated)
netgame = server = true; netgame = server = true;
if (M_CheckParm("-warp") && M_IsNextParm())
{
const char *word = M_GetNextParm();
char ch; // use this with sscanf to catch non-digits with
if (fastncmp(word, "MAP", 3)) // MAPxx name
pstartmap = M_MapNumber(word[3], word[4]);
else if (sscanf(word, "%d%c", &pstartmap, &ch) != 1) // a plain number
I_Error("Cannot warp to map %s (invalid map name)\n", word);
// Don't check if lump exists just yet because the wads haven't been loaded!
// Just do a basic range check here.
if (pstartmap < 1 || pstartmap > NUMMAPS)
I_Error("Cannot warp to map %d (out of range)\n", pstartmap);
else
{
if (!M_CheckParm("-server"))
G_SetGameModified(true);
autostart = true;
}
}
CONS_Printf("Z_Init(): Init zone memory allocation daemon. \n"); CONS_Printf("Z_Init(): Init zone memory allocation daemon. \n");
Z_Init(); Z_Init();
...@@ -1185,6 +1222,20 @@ void D_SRB2Main(void) ...@@ -1185,6 +1222,20 @@ void D_SRB2Main(void)
mainwadstally = packetsizetally; // technically not accurate atm, remember to port the two-stage -file process from kart in 2.2.x mainwadstally = packetsizetally; // technically not accurate atm, remember to port the two-stage -file process from kart in 2.2.x
if (M_CheckParm("-warp") && M_IsNextParm())
{
const char *word = M_GetNextParm();
pstartmap = G_FindMapByNameOrCode(word, 0);
if (! pstartmap)
I_Error("Cannot find a map remotely named '%s'\n", word);
else
{
if (!M_CheckParm("-server"))
G_SetGameModified(true);
autostart = true;
}
}
cht_Init(); cht_Init();
//---------------------------------------------------- READY SCREEN //---------------------------------------------------- READY SCREEN
...@@ -1230,6 +1281,16 @@ void D_SRB2Main(void) ...@@ -1230,6 +1281,16 @@ void D_SRB2Main(void)
// set user default mode or mode set at cmdline // set user default mode or mode set at cmdline
SCR_CheckDefaultMode(); SCR_CheckDefaultMode();
// Lactozilla: Does the render mode need to change?
if ((setrenderneeded != 0) && (setrenderneeded != rendermode))
{
needpatchflush = true;
needpatchrecache = true;
VID_CheckRenderer();
SCR_ChangeRendererCVars(setrenderneeded);
}
D_CheckRendererState();
wipegamestate = gamestate; wipegamestate = gamestate;
savedata.lives = 0; // flag this as not-used savedata.lives = 0; // flag this as not-used
...@@ -1288,9 +1349,10 @@ void D_SRB2Main(void) ...@@ -1288,9 +1349,10 @@ void D_SRB2Main(void)
I_StartupSound(); I_StartupSound();
I_InitMusic(); I_InitMusic();
S_InitSfxChannels(cv_soundvolume.value); S_InitSfxChannels(cv_soundvolume.value);
S_InitMusicDefs();
} }
S_InitMusicDefs();
CONS_Printf("ST_Init(): Init status bar.\n"); CONS_Printf("ST_Init(): Init status bar.\n");
ST_Init(); ST_Init();
......
...@@ -841,6 +841,10 @@ void D_RegisterClientCommands(void) ...@@ -841,6 +841,10 @@ void D_RegisterClientCommands(void)
// screen.c // screen.c
CV_RegisterVar(&cv_fullscreen); CV_RegisterVar(&cv_fullscreen);
CV_RegisterVar(&cv_renderview); CV_RegisterVar(&cv_renderview);
CV_RegisterVar(&cv_renderer);
#ifdef HWRENDER
CV_RegisterVar(&cv_newrenderer);
#endif
CV_RegisterVar(&cv_scr_depth); CV_RegisterVar(&cv_scr_depth);
CV_RegisterVar(&cv_scr_width); CV_RegisterVar(&cv_scr_width);
CV_RegisterVar(&cv_scr_height); CV_RegisterVar(&cv_scr_height);
...@@ -1095,13 +1099,7 @@ static void SetPlayerName(INT32 playernum, char *newname) ...@@ -1095,13 +1099,7 @@ static void SetPlayerName(INT32 playernum, char *newname)
{ {
CONS_Printf(M_GetText("Player %d sent a bad name change\n"), playernum+1); CONS_Printf(M_GetText("Player %d sent a bad name change\n"), playernum+1);
if (server && netgame) if (server && netgame)
{ SendKick(playernum, KICK_MSG_CON_FAIL);
UINT8 buf[2];
buf[0] = (UINT8)playernum;
buf[1] = KICK_MSG_CON_FAIL;
SendNetXCmd(XD_KICK, &buf, 2);
}
} }
} }
...@@ -1458,12 +1456,8 @@ static void Got_NameAndColor(UINT8 **cp, INT32 playernum) ...@@ -1458,12 +1456,8 @@ static void Got_NameAndColor(UINT8 **cp, INT32 playernum)
if (kick) if (kick)
{ {
UINT8 buf[2];
CONS_Alert(CONS_WARNING, M_GetText("Illegal color change received from %s (team: %d), color: %d)\n"), player_names[playernum], p->ctfteam, p->skincolor); CONS_Alert(CONS_WARNING, M_GetText("Illegal color change received from %s (team: %d), color: %d)\n"), player_names[playernum], p->ctfteam, p->skincolor);
SendKick(playernum, KICK_MSG_CON_FAIL);
buf[0] = (UINT8)playernum;
buf[1] = KICK_MSG_CON_FAIL;
SendNetXCmd(XD_KICK, &buf, 2);
return; return;
} }
} }
...@@ -1802,18 +1796,15 @@ static void Command_Map_f(void) ...@@ -1802,18 +1796,15 @@ static void Command_Map_f(void)
boolean newresetplayers; boolean newresetplayers;
boolean mustmodifygame; boolean mustmodifygame;
boolean usemapcode = false;
INT32 newmapnum; INT32 newmapnum;
char * mapname; char * mapname;
size_t mapnamelen;
char *realmapname = NULL; char *realmapname = NULL;
INT32 newgametype = gametype; INT32 newgametype = gametype;
INT32 d; INT32 d;
char *p;
if (client && !IsPlayerAdmin(consoleplayer)) if (client && !IsPlayerAdmin(consoleplayer))
{ {
...@@ -1873,43 +1864,8 @@ static void Command_Map_f(void) ...@@ -1873,43 +1864,8 @@ static void Command_Map_f(void)
} }
mapname = ConcatCommandArgv(1, first_option); mapname = ConcatCommandArgv(1, first_option);
mapnamelen = strlen(mapname);
if (mapnamelen == 2)/* maybe two digit code */ newmapnum = G_FindMapByNameOrCode(mapname, &realmapname);
{
if (( newmapnum = M_MapNumber(mapname[0], mapname[1]) ))
usemapcode = true;
}
else if (mapnamelen == 5 && strnicmp(mapname, "MAP", 3) == 0)
{
if (( newmapnum = M_MapNumber(mapname[3], mapname[4]) ) == 0)
{
CONS_Alert(CONS_ERROR, M_GetText("Invalid map code '%s'.\n"), mapname);
Z_Free(mapname);
return;
}
usemapcode = true;
}
if (!usemapcode)
{
/* Now detect map number in base 10, which no one asked for. */
newmapnum = strtol(mapname, &p, 10);
if (*p == '\0')/* we got it */
{
if (newmapnum < 1 || newmapnum > NUMMAPS)
{
CONS_Alert(CONS_ERROR, M_GetText("Invalid map number %d.\n"), newmapnum);
Z_Free(mapname);
return;
}
usemapcode = true;
}
else
{
newmapnum = G_FindMap(mapname, &realmapname, NULL, NULL);
}
}
if (newmapnum == 0) if (newmapnum == 0)
{ {
...@@ -1918,11 +1874,6 @@ static void Command_Map_f(void) ...@@ -1918,11 +1874,6 @@ static void Command_Map_f(void)
return; return;
} }
if (usemapcode)
{
realmapname = G_BuildMapTitle(newmapnum);
}
if (mustmodifygame && option_force) if (mustmodifygame && option_force)
{ {
G_SetGameModified(false); G_SetGameModified(false);
...@@ -2046,13 +1997,7 @@ static void Got_Mapcmd(UINT8 **cp, INT32 playernum) ...@@ -2046,13 +1997,7 @@ static void Got_Mapcmd(UINT8 **cp, INT32 playernum)
{ {
CONS_Alert(CONS_WARNING, M_GetText("Illegal map change received from %s\n"), player_names[playernum]); CONS_Alert(CONS_WARNING, M_GetText("Illegal map change received from %s\n"), player_names[playernum]);
if (server) if (server)
{ SendKick(playernum, KICK_MSG_CON_FAIL);
UINT8 buf[2];
buf[0] = (UINT8)playernum;
buf[1] = KICK_MSG_CON_FAIL;
SendNetXCmd(XD_KICK, &buf, 2);
}
return; return;
} }
...@@ -2162,13 +2107,7 @@ static void Got_Pause(UINT8 **cp, INT32 playernum) ...@@ -2162,13 +2107,7 @@ static void Got_Pause(UINT8 **cp, INT32 playernum)
{ {
CONS_Alert(CONS_WARNING, M_GetText("Illegal pause command received from %s\n"), player_names[playernum]); CONS_Alert(CONS_WARNING, M_GetText("Illegal pause command received from %s\n"), player_names[playernum]);
if (server) if (server)
{ SendKick(playernum, KICK_MSG_CON_FAIL);
UINT8 buf[2];
buf[0] = (UINT8)playernum;
buf[1] = KICK_MSG_CON_FAIL;
SendNetXCmd(XD_KICK, &buf, 2);
}
return; return;
} }
...@@ -2201,6 +2140,8 @@ static void Got_Pause(UINT8 **cp, INT32 playernum) ...@@ -2201,6 +2140,8 @@ static void Got_Pause(UINT8 **cp, INT32 playernum)
else else
S_ResumeAudio(); S_ResumeAudio();
} }
I_UpdateMouseGrab();
} }
// Command for stuck characters in netgames, griefing, etc. // Command for stuck characters in netgames, griefing, etc.
...@@ -2241,13 +2182,7 @@ static void Got_Suicide(UINT8 **cp, INT32 playernum) ...@@ -2241,13 +2182,7 @@ static void Got_Suicide(UINT8 **cp, INT32 playernum)
{ {
CONS_Alert(CONS_WARNING, M_GetText("Illegal suicide command received from %s\n"), player_names[playernum]); CONS_Alert(CONS_WARNING, M_GetText("Illegal suicide command received from %s\n"), player_names[playernum]);
if (server) if (server)
{ SendKick(playernum, KICK_MSG_CON_FAIL);
UINT8 buf[2];
buf[0] = (UINT8)playernum;
buf[1] = KICK_MSG_CON_FAIL;
SendNetXCmd(XD_KICK, &buf, 2);
}
return; return;
} }
...@@ -2310,13 +2245,7 @@ static void Got_Clearscores(UINT8 **cp, INT32 playernum) ...@@ -2310,13 +2245,7 @@ static void Got_Clearscores(UINT8 **cp, INT32 playernum)
{ {
CONS_Alert(CONS_WARNING, M_GetText("Illegal clear scores command received from %s\n"), player_names[playernum]); CONS_Alert(CONS_WARNING, M_GetText("Illegal clear scores command received from %s\n"), player_names[playernum]);
if (server) if (server)
{ SendKick(playernum, KICK_MSG_CON_FAIL);
UINT8 buf[2];
buf[0] = (UINT8)playernum;
buf[1] = KICK_MSG_CON_FAIL;
SendNetXCmd(XD_KICK, &buf, 2);
}
return; return;
} }
...@@ -2663,13 +2592,7 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum) ...@@ -2663,13 +2592,7 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum)
// this should never happen unless the client is hacked/buggy // this should never happen unless the client is hacked/buggy
CONS_Alert(CONS_WARNING, M_GetText("Illegal team change received from player %s\n"), player_names[playernum]); CONS_Alert(CONS_WARNING, M_GetText("Illegal team change received from player %s\n"), player_names[playernum]);
if (server) if (server)
{ SendKick(playernum, KICK_MSG_CON_FAIL);
UINT8 buf[2];
buf[0] = (UINT8)playernum;
buf[1] = KICK_MSG_CON_FAIL;
SendNetXCmd(XD_KICK, &buf, 2);
}
} }
if (NetPacket.packet.verification) // Special marker that the server sent the request if (NetPacket.packet.verification) // Special marker that the server sent the request
...@@ -2678,13 +2601,7 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum) ...@@ -2678,13 +2601,7 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum)
{ {
CONS_Alert(CONS_WARNING, M_GetText("Illegal team change received from player %s\n"), player_names[playernum]); CONS_Alert(CONS_WARNING, M_GetText("Illegal team change received from player %s\n"), player_names[playernum]);
if (server) if (server)
{ SendKick(playernum, KICK_MSG_CON_FAIL);
UINT8 buf[2];
buf[0] = (UINT8)playernum;
buf[1] = KICK_MSG_CON_FAIL;
SendNetXCmd(XD_KICK, &buf, 2);
}
return; return;
} }
playernum = NetPacket.packet.playernum; playernum = NetPacket.packet.playernum;
...@@ -2717,13 +2634,7 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum) ...@@ -2717,13 +2634,7 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum)
{ {
CONS_Alert(CONS_WARNING, M_GetText("Illegal team change received from player %s\n"), player_names[playernum]); CONS_Alert(CONS_WARNING, M_GetText("Illegal team change received from player %s\n"), player_names[playernum]);
if (server) if (server)
{ SendKick(playernum, KICK_MSG_CON_FAIL);
UINT8 buf[2];
buf[0] = (UINT8)playernum;
buf[1] = KICK_MSG_CON_FAIL;
SendNetXCmd(XD_KICK, &buf, 2);
}
} }
return; return;
} }
...@@ -2771,12 +2682,8 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum) ...@@ -2771,12 +2682,8 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum)
if (server && ((NetPacket.packet.newteam < 0 || NetPacket.packet.newteam > 3) || error)) if (server && ((NetPacket.packet.newteam < 0 || NetPacket.packet.newteam > 3) || error))
{ {
UINT8 buf[2];
buf[0] = (UINT8)playernum;
buf[1] = KICK_MSG_CON_FAIL;
CONS_Alert(CONS_WARNING, M_GetText("Illegal team change received from player %s\n"), player_names[playernum]); CONS_Alert(CONS_WARNING, M_GetText("Illegal team change received from player %s\n"), player_names[playernum]);
SendNetXCmd(XD_KICK, &buf, 2); SendKick(playernum, KICK_MSG_CON_FAIL);
} }
//Safety first! //Safety first!
...@@ -3060,13 +2967,7 @@ static void Got_Verification(UINT8 **cp, INT32 playernum) ...@@ -3060,13 +2967,7 @@ static void Got_Verification(UINT8 **cp, INT32 playernum)
{ {
CONS_Alert(CONS_WARNING, M_GetText("Illegal verification received from %s (serverplayer is %s)\n"), player_names[playernum], player_names[serverplayer]); CONS_Alert(CONS_WARNING, M_GetText("Illegal verification received from %s (serverplayer is %s)\n"), player_names[playernum], player_names[serverplayer]);
if (server) if (server)
{ SendKick(playernum, KICK_MSG_CON_FAIL);
UINT8 buf[2];
buf[0] = (UINT8)playernum;
buf[1] = KICK_MSG_CON_FAIL;
SendNetXCmd(XD_KICK, &buf, 2);
}
return; return;
} }
...@@ -3116,13 +3017,7 @@ static void Got_Removal(UINT8 **cp, INT32 playernum) ...@@ -3116,13 +3017,7 @@ static void Got_Removal(UINT8 **cp, INT32 playernum)
{ {
CONS_Alert(CONS_WARNING, M_GetText("Illegal demotion received from %s (serverplayer is %s)\n"), player_names[playernum], player_names[serverplayer]); CONS_Alert(CONS_WARNING, M_GetText("Illegal demotion received from %s (serverplayer is %s)\n"), player_names[playernum], player_names[serverplayer]);
if (server) if (server)
{ SendKick(playernum, KICK_MSG_CON_FAIL);
UINT8 buf[2];
buf[0] = (UINT8)playernum;
buf[1] = KICK_MSG_CON_FAIL;
SendNetXCmd(XD_KICK, &buf, 2);
}
return; return;
} }
...@@ -3196,14 +3091,7 @@ static void Got_MotD_f(UINT8 **cp, INT32 playernum) ...@@ -3196,14 +3091,7 @@ static void Got_MotD_f(UINT8 **cp, INT32 playernum)
{ {
CONS_Alert(CONS_WARNING, M_GetText("Illegal motd change received from %s\n"), player_names[playernum]); CONS_Alert(CONS_WARNING, M_GetText("Illegal motd change received from %s\n"), player_names[playernum]);
if (server) if (server)
{ SendKick(playernum, KICK_MSG_CON_FAIL);
UINT8 buf[2];
buf[0] = (UINT8)playernum;
buf[1] = KICK_MSG_CON_FAIL;
SendNetXCmd(XD_KICK, &buf, 2);
}
Z_Free(mymotd); Z_Free(mymotd);
return; return;
} }
...@@ -3259,13 +3147,7 @@ static void Got_RunSOCcmd(UINT8 **cp, INT32 playernum) ...@@ -3259,13 +3147,7 @@ static void Got_RunSOCcmd(UINT8 **cp, INT32 playernum)
{ {
CONS_Alert(CONS_WARNING, M_GetText("Illegal runsoc command received from %s\n"), player_names[playernum]); CONS_Alert(CONS_WARNING, M_GetText("Illegal runsoc command received from %s\n"), player_names[playernum]);
if (server) if (server)
{ SendKick(playernum, KICK_MSG_CON_FAIL);
UINT8 buf[2];
buf[0] = (UINT8)playernum;
buf[1] = KICK_MSG_CON_FAIL;
SendNetXCmd(XD_KICK, &buf, 2);
}
return; return;
} }
...@@ -3422,13 +3304,8 @@ static void Got_RequestAddfilecmd(UINT8 **cp, INT32 playernum) ...@@ -3422,13 +3304,8 @@ static void Got_RequestAddfilecmd(UINT8 **cp, INT32 playernum)
if ((playernum != serverplayer && !IsPlayerAdmin(playernum)) || kick) if ((playernum != serverplayer && !IsPlayerAdmin(playernum)) || kick)
{ {
UINT8 buf[2];
CONS_Alert(CONS_WARNING, M_GetText("Illegal addfile command received from %s\n"), player_names[playernum]); CONS_Alert(CONS_WARNING, M_GetText("Illegal addfile command received from %s\n"), player_names[playernum]);
SendKick(playernum, KICK_MSG_CON_FAIL);
buf[0] = (UINT8)playernum;
buf[1] = KICK_MSG_CON_FAIL;
SendNetXCmd(XD_KICK, &buf, 2);
return; return;
} }
...@@ -3477,13 +3354,7 @@ static void Got_Addfilecmd(UINT8 **cp, INT32 playernum) ...@@ -3477,13 +3354,7 @@ static void Got_Addfilecmd(UINT8 **cp, INT32 playernum)
{ {
CONS_Alert(CONS_WARNING, M_GetText("Illegal addfile command received from %s\n"), player_names[playernum]); CONS_Alert(CONS_WARNING, M_GetText("Illegal addfile command received from %s\n"), player_names[playernum]);
if (server) if (server)
{ SendKick(playernum, KICK_MSG_CON_FAIL);
UINT8 buf[2];
buf[0] = (UINT8)playernum;
buf[1] = KICK_MSG_CON_FAIL;
SendNetXCmd(XD_KICK, &buf, 2);
}
return; return;
} }
...@@ -4266,13 +4137,7 @@ static void Got_ExitLevelcmd(UINT8 **cp, INT32 playernum) ...@@ -4266,13 +4137,7 @@ static void Got_ExitLevelcmd(UINT8 **cp, INT32 playernum)
{ {
CONS_Alert(CONS_WARNING, M_GetText("Illegal exitlevel command received from %s\n"), player_names[playernum]); CONS_Alert(CONS_WARNING, M_GetText("Illegal exitlevel command received from %s\n"), player_names[playernum]);
if (server) if (server)
{ SendKick(playernum, KICK_MSG_CON_FAIL);
UINT8 buf[2];
buf[0] = (UINT8)playernum;
buf[1] = KICK_MSG_CON_FAIL;
SendNetXCmd(XD_KICK, &buf, 2);
}
return; return;
} }
......
...@@ -4462,20 +4462,34 @@ static void DEH_LoadDehackedFile(MYFILE *f, boolean mainfile) ...@@ -4462,20 +4462,34 @@ static void DEH_LoadDehackedFile(MYFILE *f, boolean mainfile)
ignorelines(f); ignorelines(f);
} }
} }
// Last I heard this crashes the game if you try to use it else if (fastcmp(word, "SRB2"))
// so this is disabled for now
// -- Monster Iestyn
/* else if (fastcmp(word, "SRB2"))
{ {
INT32 ver = searchvalue(strtok(NULL, "\n")); if (isdigit(word2[0]))
if (ver != PATCHVERSION) {
deh_warning("Patch is for SRB2 version %d,\nonly version %d is supported", ver, PATCHVERSION); i = atoi(word2);
if (i != PATCHVERSION)
{
deh_warning(
"Patch is for SRB2 version %d, "
"only version %d is supported",
i,
PATCHVERSION
);
}
}
else
{
deh_warning(
"SRB2 version definition has incorrect format, "
"use \"SRB2 %d\"",
PATCHVERSION
);
}
} }
// Clear all data in certain locations (mostly for unlocks) // Clear all data in certain locations (mostly for unlocks)
// Unless you REALLY want to piss people off, // Unless you REALLY want to piss people off,
// define a custom gamedata /before/ doing this!! // define a custom gamedata /before/ doing this!!
// (then again, modifiedgame will prevent game data saving anyway) // (then again, modifiedgame will prevent game data saving anyway)
*/
else if (fastcmp(word, "CLEAR")) else if (fastcmp(word, "CLEAR"))
{ {
boolean clearall = (fastcmp(word2, "ALL")); boolean clearall = (fastcmp(word2, "ALL"));
...@@ -4525,11 +4539,13 @@ static void DEH_LoadDehackedFile(MYFILE *f, boolean mainfile) ...@@ -4525,11 +4539,13 @@ static void DEH_LoadDehackedFile(MYFILE *f, boolean mainfile)
if (introchanged) if (introchanged)
{ {
menuactive = false; menuactive = false;
I_UpdateMouseGrab();
COM_BufAddText("playintro"); COM_BufAddText("playintro");
} }
else if (titlechanged) else if (titlechanged)
{ {
menuactive = false; menuactive = false;
I_UpdateMouseGrab();
COM_BufAddText("exitgame"); // Command_ExitGame_f() but delayed COM_BufAddText("exitgame"); // Command_ExitGame_f() but delayed
} }
} }
...@@ -9448,6 +9464,7 @@ struct { ...@@ -9448,6 +9464,7 @@ struct {
{"CV_HIDEN",CV_HIDEN}, {"CV_HIDEN",CV_HIDEN},
{"CV_HIDDEN",CV_HIDEN}, {"CV_HIDDEN",CV_HIDEN},
{"CV_CHEAT",CV_CHEAT}, {"CV_CHEAT",CV_CHEAT},
{"CV_NOLUA",CV_NOLUA},
// v_video flags // v_video flags
{"V_NOSCALEPATCH",V_NOSCALEPATCH}, {"V_NOSCALEPATCH",V_NOSCALEPATCH},
......
...@@ -47,7 +47,7 @@ extern const char *superactions[MAXRECURSION]; ...@@ -47,7 +47,7 @@ extern const char *superactions[MAXRECURSION];
extern UINT8 superstack; extern UINT8 superstack;
// If the dehacked patch does not match this version, we throw a warning // If the dehacked patch does not match this version, we throw a warning
#define PATCHVERSION 210 #define PATCHVERSION 220
#define MAXLINELEN 1024 #define MAXLINELEN 1024
......
...@@ -338,3 +338,8 @@ void I_StartupGraphics(void) ...@@ -338,3 +338,8 @@ void I_StartupGraphics(void)
graphics_started = true; graphics_started = true;
} }
void I_StartupHardwareGraphics(void)
{
// oh yeah woo yeah oh yeah woo yeah oh yeah woo yeah oh yeah woo yeah oh yeah woo yeah oh yeah woo yeah oh yeah woo y
}
...@@ -378,6 +378,11 @@ INT32 VID_SetMode (INT32 modenum) //, UINT8 *palette) ...@@ -378,6 +378,11 @@ INT32 VID_SetMode (INT32 modenum) //, UINT8 *palette)
return 1; return 1;
} }
void VID_CheckRenderer(void)
{
// ..............
}
// converts a segm:offs 32bit pair to a 32bit flat ptr // converts a segm:offs 32bit pair to a 32bit flat ptr
......
...@@ -98,8 +98,8 @@ ...@@ -98,8 +98,8 @@
#ifdef GETTEXT #ifdef GETTEXT
#include <libintl.h> #include <libintl.h>
#include <locale.h>
#endif #endif
#include <locale.h> // locale should not be dependent on GETTEXT -- 11/01/20 Monster Iestyn
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
...@@ -127,6 +127,7 @@ ...@@ -127,6 +127,7 @@
#ifdef LOGMESSAGES #ifdef LOGMESSAGES
extern FILE *logstream; extern FILE *logstream;
extern char logfilename[1024];
#endif #endif
//#define DEVELOP // Disable this for release builds to remove excessive cheat commands and enable MD5 checking and stuff, all in one go. :3 //#define DEVELOP // Disable this for release builds to remove excessive cheat commands and enable MD5 checking and stuff, all in one go. :3
...@@ -450,12 +451,12 @@ char savegamename[256]; ...@@ -450,12 +451,12 @@ char savegamename[256];
// m_misc.h // m_misc.h
#ifdef GETTEXT #ifdef GETTEXT
#define M_GetText(String) gettext(String) #define M_GetText(String) gettext(String)
void M_StartupLocale(void);
#else #else
// If no translations are to be used, make a stub // If no translations are to be used, make a stub
// M_GetText function that just returns the string. // M_GetText function that just returns the string.
#define M_GetText(x) (x) #define M_GetText(x) (x)
#endif #endif
void M_StartupLocale(void);
extern void *(*M_Memcpy)(void* dest, const void* src, size_t n) FUNCNONNULL; extern void *(*M_Memcpy)(void* dest, const void* src, size_t n) FUNCNONNULL;
char *va(const char *format, ...) FUNCPRINTF; char *va(const char *format, ...) FUNCPRINTF;
char *M_GetToken(const char *inputString); char *M_GetToken(const char *inputString);
...@@ -623,6 +624,9 @@ extern const char *compdate, *comptime, *comprevision, *compbranch; ...@@ -623,6 +624,9 @@ extern const char *compdate, *comptime, *comprevision, *compbranch;
/// SRB2CB itself ported this from PrBoom+ /// SRB2CB itself ported this from PrBoom+
#define NEWCLIP #define NEWCLIP
/// Cache patches in Lua in a way that renderer switching will work flawlessly.
//#define LUA_PATCH_SAFETY
/// Sprite rotation /// Sprite rotation
#define ROTSPRITE #define ROTSPRITE
#define ROTANGLES 24 // Needs to be a divisor of 360 (45, 60, 90, 120...) #define ROTANGLES 24 // Needs to be a divisor of 360 (45, 60, 90, 120...)
......
...@@ -150,6 +150,8 @@ void I_GetJoystick2Events(void){} ...@@ -150,6 +150,8 @@ void I_GetJoystick2Events(void){}
void I_GetMouseEvents(void){} void I_GetMouseEvents(void){}
void I_UpdateMouseGrab(void){}
char *I_GetEnv(const char *name) char *I_GetEnv(const char *name)
{ {
(void)name; (void)name;
......
...@@ -11,6 +11,7 @@ boolean allow_fullscreen = false; ...@@ -11,6 +11,7 @@ boolean allow_fullscreen = false;
consvar_t cv_vidwait = {"vid_wait", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_vidwait = {"vid_wait", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
void I_StartupGraphics(void){} void I_StartupGraphics(void){}
void I_StartupHardwareGraphics(void){}
void I_ShutdownGraphics(void){} void I_ShutdownGraphics(void){}
...@@ -39,6 +40,11 @@ INT32 VID_SetMode(INT32 modenum) ...@@ -39,6 +40,11 @@ INT32 VID_SetMode(INT32 modenum)
return 0; return 0;
} }
void VID_CheckRenderer(void)
{
// ..............
}
const char *VID_GetModeName(INT32 modenum) const char *VID_GetModeName(INT32 modenum)
{ {
(void)modenum; (void)modenum;
......
This diff is collapsed.
...@@ -146,7 +146,7 @@ extern boolean WipeStageTitle; ...@@ -146,7 +146,7 @@ extern boolean WipeStageTitle;
typedef enum typedef enum
{ {
WIPESTYLE_NORMAL, WIPESTYLE_NORMAL,
WIPESTYLE_LEVEL WIPESTYLE_COLORMAP
} wipestyle_t; } wipestyle_t;
extern wipestyle_t wipestyle; extern wipestyle_t wipestyle;
...@@ -159,6 +159,11 @@ typedef enum ...@@ -159,6 +159,11 @@ typedef enum
} wipestyleflags_t; } wipestyleflags_t;
extern wipestyleflags_t wipestyleflags; extern wipestyleflags_t wipestyleflags;
// Even my function names are borderline
boolean F_ShouldColormapFade(void);
boolean F_TryColormapFade(UINT8 wipecolor);
void F_DecideWipeStyle(void);
#define FADECOLORMAPDIV 8 #define FADECOLORMAPDIV 8
#define FADECOLORMAPROWS (256/FADECOLORMAPDIV) #define FADECOLORMAPROWS (256/FADECOLORMAPDIV)
......