mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-31 21:50:48 +00:00
Merge branch 'next' of https://git.magicalgirl.moe/STJr/SRB2.git into resend-gamestate
This commit is contained in:
commit
29d8389461
200 changed files with 2722 additions and 1108 deletions
|
@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.0)
|
|||
# DO NOT CHANGE THIS SRB2 STRING! Some variable names depend on this string.
|
||||
# Version change is fine.
|
||||
project(SRB2
|
||||
VERSION 2.2.0
|
||||
VERSION 2.2.2
|
||||
LANGUAGES C)
|
||||
|
||||
if(${PROJECT_SOURCE_DIR} MATCHES ${PROJECT_BINARY_DIR})
|
||||
|
|
17
appveyor.yml
17
appveyor.yml
|
@ -1,4 +1,4 @@
|
|||
version: 2.2.0.{branch}-{build}
|
||||
version: 2.2.2.{branch}-{build}
|
||||
os: MinGW
|
||||
|
||||
environment:
|
||||
|
@ -83,7 +83,14 @@ before_build:
|
|||
- ccache -V
|
||||
- ccache -s
|
||||
- if [%NOUPX%] == [1] ( set "NOUPX=NOUPX=1" ) else ( set "NOUPX=" )
|
||||
- set "SRB2_MFLAGS=-C src WARNINGMODE=1 CCACHE=1 NOOBJDUMP=1 %NOUPX%"
|
||||
- if defined [%APPVEYOR_PULL_REQUEST_HEAD_COMMIT%] ( set "COMMIT=%APPVEYOR_PULL_REQUEST_HEAD_COMMIT%" ) else ( set "COMMIT=%APPVEYOR_REPO_COMMIT%" )
|
||||
- cmd: git rev-parse --short %COMMIT%>%TMP%/gitshort.txt
|
||||
- cmd: set /P GITSHORT=<%TMP%/gitshort.txt
|
||||
# for pull requests, take the owner's name only, if this isn't the same repo of course
|
||||
- set "REPO=%APPVEYOR_REPO_BRANCH%"
|
||||
- if not [%APPVEYOR_PULL_REQUEST_HEAD_REPO_NAME%] == [] ( if not [%APPVEYOR_PULL_REQUEST_HEAD_REPO_NAME%] == [%APPVEYOR_REPO_NAME%] ( for /f "delims=/" %%a in ("%APPVEYOR_PULL_REQUEST_HEAD_REPO_NAME%") do set "REPO=%%a-%APPVEYOR_PULL_REQUEST_HEAD_REPO_BRANCH%" ) )
|
||||
- set "EXENAME=EXENAME=srb2win-%REPO%-%GITSHORT%.exe"
|
||||
- set "SRB2_MFLAGS=-C src WARNINGMODE=1 CCACHE=1 NOOBJDUMP=1 %NOUPX% %EXENAME%"
|
||||
- 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"
|
||||
|
||||
|
@ -99,10 +106,8 @@ after_build:
|
|||
)
|
||||
- if [%X86_64%] == [1] ( set "CONFIGURATION=%CONFIGURATION%64" )
|
||||
- ccache -s
|
||||
- cmd: git rev-parse --short %APPVEYOR_REPO_COMMIT%>%TMP%/gitshort.txt
|
||||
- cmd: set /P GITSHORT=<%TMP%/gitshort.txt
|
||||
- set BUILD_ARCHIVE=%APPVEYOR_REPO_BRANCH%-%GITSHORT%-%CONFIGURATION%.7z
|
||||
- set BUILDSARCHIVE=%APPVEYOR_REPO_BRANCH%-%CONFIGURATION%.7z
|
||||
- set BUILD_ARCHIVE=%REPO%-%GITSHORT%-%CONFIGURATION%.7z
|
||||
- set BUILDSARCHIVE=%REPO%-%CONFIGURATION%.7z
|
||||
- cmd: 7z a %BUILD_ARCHIVE% %BUILD_PATH% -xr!.gitignore
|
||||
- appveyor PushArtifact %BUILD_ARCHIVE%
|
||||
- cmd: copy %BUILD_ARCHIVE% %BUILDSARCHIVE%
|
||||
|
|
|
@ -19,7 +19,8 @@ set(SRB2_ASSET_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/installer"
|
|||
set(SRB2_ASSET_HASHED
|
||||
"srb2.pk3;\
|
||||
player.dta;\
|
||||
zones.pk3"
|
||||
zones.pk3;\
|
||||
patch.pk3"
|
||||
CACHE STRING "Asset filenames to apply MD5 checks. No spaces between entries!"
|
||||
)
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
# GNU Make makefile for SRB2
|
||||
#############################################################################
|
||||
# Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
# Copyright (C) 2003-2019 by Sonic Team Junior.
|
||||
# Copyright (C) 2003-2020 by Sonic Team Junior.
|
||||
#
|
||||
# This program is free software distributed under the
|
||||
# terms of the GNU General Public License, version 2.
|
||||
|
|
126
src/am_map.c
126
src/am_map.c
|
@ -2,7 +2,7 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1993-1996 by id Software, Inc.
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2019 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2020 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
@ -160,6 +160,7 @@ static boolean am_stopped = true;
|
|||
static INT32 f_x, f_y; // location of window on screen (always zero for both)
|
||||
static INT32 f_w, f_h; // size of window on screen (always the screen width and height respectively)
|
||||
|
||||
static boolean m_keydown[4]; // which window panning keys are being pressed down?
|
||||
static mpoint_t m_paninc; // how far the window pans each tic (map coords)
|
||||
static fixed_t mtof_zoommul; // how far the window zooms in each tic (map coords)
|
||||
static fixed_t ftom_zoommul; // how far the window zooms in each tic (fb coords)
|
||||
|
@ -205,6 +206,7 @@ static boolean followplayer = true; // specifies whether to follow the player ar
|
|||
typedef void (*AMDRAWFLINEFUNC) (const fline_t *fl, INT32 color);
|
||||
static AMDRAWFLINEFUNC AM_drawFline;
|
||||
|
||||
static void AM_drawPixel(INT32 xx, INT32 yy, INT32 cc);
|
||||
static void AM_drawFline_soft(const fline_t *fl, INT32 color);
|
||||
|
||||
static void AM_activateNewScale(void)
|
||||
|
@ -344,22 +346,22 @@ static void AM_initVariables(void)
|
|||
old_m_h = m_h;
|
||||
}
|
||||
|
||||
//
|
||||
// Called when the screen size changes.
|
||||
//
|
||||
static void AM_FrameBufferInit(void)
|
||||
{
|
||||
f_x = f_y = 0;
|
||||
f_w = vid.width;
|
||||
f_h = vid.height;
|
||||
}
|
||||
|
||||
//
|
||||
// should be called at the start of every level
|
||||
// right now, i figure it out myself
|
||||
//
|
||||
static void AM_LevelInit(void)
|
||||
{
|
||||
f_x = f_y = 0;
|
||||
f_w = vid.width;
|
||||
f_h = vid.height;
|
||||
|
||||
AM_drawFline = AM_drawFline_soft;
|
||||
#ifdef HWRENDER
|
||||
if (rendermode == render_opengl)
|
||||
AM_drawFline = HWR_drawAMline;
|
||||
#endif
|
||||
|
||||
AM_findMinMaxBoundaries();
|
||||
scale_mtof = FixedDiv(min_scale_mtof*10, 7*FRACUNIT);
|
||||
if (scale_mtof > max_scale_mtof)
|
||||
|
@ -381,7 +383,7 @@ void AM_Stop(void)
|
|||
*
|
||||
* \sa AM_Stop
|
||||
*/
|
||||
static inline void AM_Start(void)
|
||||
void AM_Start(void)
|
||||
{
|
||||
static INT32 lastlevel = -1;
|
||||
|
||||
|
@ -390,8 +392,12 @@ static inline void AM_Start(void)
|
|||
am_stopped = false;
|
||||
if (lastlevel != gamemap || am_recalc) // screen size changed
|
||||
{
|
||||
AM_LevelInit();
|
||||
lastlevel = gamemap;
|
||||
AM_FrameBufferInit();
|
||||
if (lastlevel != gamemap)
|
||||
{
|
||||
AM_LevelInit();
|
||||
lastlevel = gamemap;
|
||||
}
|
||||
am_recalc = false;
|
||||
}
|
||||
AM_initVariables();
|
||||
|
@ -417,6 +423,28 @@ static void AM_maxOutWindowScale(void)
|
|||
AM_activateNewScale();
|
||||
}
|
||||
|
||||
//
|
||||
// set window panning
|
||||
//
|
||||
static void AM_setWindowPanning(void)
|
||||
{
|
||||
// up and down
|
||||
if (m_keydown[2]) // pan up
|
||||
m_paninc.y = FTOM(F_PANINC);
|
||||
else if (m_keydown[3]) // pan down
|
||||
m_paninc.y = -FTOM(F_PANINC);
|
||||
else
|
||||
m_paninc.y = 0;
|
||||
|
||||
// left and right
|
||||
if (m_keydown[0]) // pan right
|
||||
m_paninc.x = FTOM(F_PANINC);
|
||||
else if (m_keydown[1]) // pan left
|
||||
m_paninc.x = -FTOM(F_PANINC);
|
||||
else
|
||||
m_paninc.x = 0;
|
||||
}
|
||||
|
||||
/** Responds to user inputs in automap mode.
|
||||
*
|
||||
* \param ev Event to possibly respond to.
|
||||
|
@ -449,35 +477,49 @@ boolean AM_Responder(event_t *ev)
|
|||
{
|
||||
case AM_PANRIGHTKEY: // pan right
|
||||
if (!followplayer)
|
||||
m_paninc.x = FTOM(F_PANINC);
|
||||
{
|
||||
m_keydown[0] = true;
|
||||
AM_setWindowPanning();
|
||||
}
|
||||
else
|
||||
rc = false;
|
||||
break;
|
||||
case AM_PANLEFTKEY: // pan left
|
||||
if (!followplayer)
|
||||
m_paninc.x = -FTOM(F_PANINC);
|
||||
{
|
||||
m_keydown[1] = true;
|
||||
AM_setWindowPanning();
|
||||
}
|
||||
else
|
||||
rc = false;
|
||||
break;
|
||||
case AM_PANUPKEY: // pan up
|
||||
if (!followplayer)
|
||||
m_paninc.y = FTOM(F_PANINC);
|
||||
{
|
||||
m_keydown[2] = true;
|
||||
AM_setWindowPanning();
|
||||
}
|
||||
else
|
||||
rc = false;
|
||||
break;
|
||||
case AM_PANDOWNKEY: // pan down
|
||||
if (!followplayer)
|
||||
m_paninc.y = -FTOM(F_PANINC);
|
||||
{
|
||||
m_keydown[3] = true;
|
||||
AM_setWindowPanning();
|
||||
}
|
||||
else
|
||||
rc = false;
|
||||
break;
|
||||
case AM_ZOOMOUTKEY: // zoom out
|
||||
mtof_zoommul = M_ZOOMOUT;
|
||||
ftom_zoommul = M_ZOOMIN;
|
||||
AM_setWindowPanning();
|
||||
break;
|
||||
case AM_ZOOMINKEY: // zoom in
|
||||
mtof_zoommul = M_ZOOMIN;
|
||||
ftom_zoommul = M_ZOOMOUT;
|
||||
AM_setWindowPanning();
|
||||
break;
|
||||
case AM_TOGGLEKEY:
|
||||
AM_Stop();
|
||||
|
@ -491,6 +533,7 @@ boolean AM_Responder(event_t *ev)
|
|||
}
|
||||
else
|
||||
AM_restoreScaleAndLoc();
|
||||
AM_setWindowPanning();
|
||||
break;
|
||||
case AM_FOLLOWKEY:
|
||||
followplayer = !followplayer;
|
||||
|
@ -510,14 +553,32 @@ boolean AM_Responder(event_t *ev)
|
|||
switch (ev->data1)
|
||||
{
|
||||
case AM_PANRIGHTKEY:
|
||||
if (!followplayer)
|
||||
{
|
||||
m_keydown[0] = false;
|
||||
AM_setWindowPanning();
|
||||
}
|
||||
break;
|
||||
case AM_PANLEFTKEY:
|
||||
if (!followplayer)
|
||||
m_paninc.x = 0;
|
||||
{
|
||||
m_keydown[1] = false;
|
||||
AM_setWindowPanning();
|
||||
}
|
||||
break;
|
||||
case AM_PANUPKEY:
|
||||
if (!followplayer)
|
||||
{
|
||||
m_keydown[2] = false;
|
||||
AM_setWindowPanning();
|
||||
}
|
||||
break;
|
||||
case AM_PANDOWNKEY:
|
||||
if (!followplayer)
|
||||
m_paninc.y = 0;
|
||||
{
|
||||
m_keydown[3] = false;
|
||||
AM_setWindowPanning();
|
||||
}
|
||||
break;
|
||||
case AM_ZOOMOUTKEY:
|
||||
case AM_ZOOMINKEY:
|
||||
|
@ -718,6 +779,17 @@ static boolean AM_clipMline(const mline_t *ml, fline_t *fl)
|
|||
}
|
||||
#undef DOOUTCODE
|
||||
|
||||
//
|
||||
// Draws a pixel.
|
||||
//
|
||||
static void AM_drawPixel(INT32 xx, INT32 yy, INT32 cc)
|
||||
{
|
||||
UINT8 *dest = screens[0];
|
||||
if (xx < 0 || yy < 0 || xx >= vid.width || yy >= vid.height)
|
||||
return; // off the screen
|
||||
dest[(yy*vid.width) + xx] = cc;
|
||||
}
|
||||
|
||||
//
|
||||
// Classic Bresenham w/ whatever optimizations needed for speed
|
||||
//
|
||||
|
@ -739,8 +811,6 @@ static void AM_drawFline_soft(const fline_t *fl, INT32 color)
|
|||
}
|
||||
#endif
|
||||
|
||||
#define PUTDOT(xx,yy,cc) V_DrawFill(xx,yy,1,1,cc|V_NOSCALESTART);
|
||||
|
||||
dx = fl->b.x - fl->a.x;
|
||||
ax = 2 * (dx < 0 ? -dx : dx);
|
||||
sx = dx < 0 ? -1 : 1;
|
||||
|
@ -757,7 +827,7 @@ static void AM_drawFline_soft(const fline_t *fl, INT32 color)
|
|||
d = ay - ax/2;
|
||||
for (;;)
|
||||
{
|
||||
PUTDOT(x, y, color)
|
||||
AM_drawPixel(x, y, color);
|
||||
if (x == fl->b.x)
|
||||
return;
|
||||
if (d >= 0)
|
||||
|
@ -774,7 +844,7 @@ static void AM_drawFline_soft(const fline_t *fl, INT32 color)
|
|||
d = ax - ay/2;
|
||||
for (;;)
|
||||
{
|
||||
PUTDOT(x, y, color)
|
||||
AM_drawPixel(x, y, color);
|
||||
if (y == fl->b.y)
|
||||
return;
|
||||
if (d >= 0)
|
||||
|
@ -786,8 +856,6 @@ static void AM_drawFline_soft(const fline_t *fl, INT32 color)
|
|||
d += ax;
|
||||
}
|
||||
}
|
||||
|
||||
#undef PUTDOT
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -1100,6 +1168,12 @@ void AM_Drawer(void)
|
|||
if (!automapactive)
|
||||
return;
|
||||
|
||||
AM_drawFline = AM_drawFline_soft;
|
||||
#ifdef HWRENDER
|
||||
if (rendermode == render_opengl)
|
||||
AM_drawFline = HWR_drawAMline;
|
||||
#endif
|
||||
|
||||
AM_clearFB(BACKGROUND);
|
||||
if (draw_grid) AM_drawGrid(GRIDCOLORS);
|
||||
AM_drawWalls();
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1993-1996 by id Software, Inc.
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2019 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2020 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
@ -38,6 +38,9 @@ void AM_Ticker(void);
|
|||
// Called by main loop, instead of view drawer if automap is active.
|
||||
void AM_Drawer(void);
|
||||
|
||||
// Enables the automap.
|
||||
void AM_Start(void);
|
||||
|
||||
// Called to force the automap to quit if the level is completed while it is up.
|
||||
void AM_Stop(void);
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Copyright 2019, James R.
|
||||
Copyright 2019-2020, James R.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Copyright 2019, James R.
|
||||
Copyright 2019-2020, James R.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2019 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2020 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 2007-2016 by John "JTE" Muniz.
|
||||
// Copyright (C) 2011-2019 by Sonic Team Junior.
|
||||
// Copyright (C) 2011-2020 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 2007-2016 by John "JTE" Muniz.
|
||||
// Copyright (C) 2012-2019 by Sonic Team Junior.
|
||||
// Copyright (C) 2012-2020 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2019 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2020 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2019 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2020 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
@ -823,8 +823,13 @@ static void COM_Help_f(void)
|
|||
if (!stricmp(cvar->PossibleValue[MINVAL].strvalue, "MIN"))
|
||||
{
|
||||
if (floatmode)
|
||||
CONS_Printf(" range from %f to %f\n", FIXED_TO_FLOAT(cvar->PossibleValue[MINVAL].value),
|
||||
FIXED_TO_FLOAT(cvar->PossibleValue[MAXVAL].value));
|
||||
{
|
||||
float fu = FIXED_TO_FLOAT(cvar->PossibleValue[MINVAL].value);
|
||||
float ck = FIXED_TO_FLOAT(cvar->PossibleValue[MAXVAL].value);
|
||||
CONS_Printf(" range from %ld%s to %ld%s\n",
|
||||
(long)fu, M_Ftrim(fu),
|
||||
(long)ck, M_Ftrim(ck));
|
||||
}
|
||||
else
|
||||
CONS_Printf(" range from %d to %d\n", cvar->PossibleValue[MINVAL].value,
|
||||
cvar->PossibleValue[MAXVAL].value);
|
||||
|
@ -973,7 +978,10 @@ static void COM_Add_f(void)
|
|||
}
|
||||
|
||||
if (( cvar->flags & CV_FLOAT ))
|
||||
CV_Set(cvar, va("%f", FIXED_TO_FLOAT (cvar->value) + atof(COM_Argv(2))));
|
||||
{
|
||||
float n =FIXED_TO_FLOAT (cvar->value) + atof(COM_Argv(2));
|
||||
CV_Set(cvar, va("%ld%s", (long)n, M_Ftrim(n)));
|
||||
}
|
||||
else
|
||||
CV_AddValue(cvar, atoi(COM_Argv(2)));
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2019 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2020 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -26,14 +26,14 @@
|
|||
#else
|
||||
|
||||
/* Manually defined asset hashes for non-CMake builds
|
||||
* Last updated 2019 / 12 / 06 - v2.2.0 - main assets
|
||||
* Last updated 20?? / ?? / ?? - v2.2.? - patch.pk3
|
||||
* Last updated 2020 / 02 / 15 - v2.2.1 - main assets
|
||||
* Last updated 2020 / 02 / 22 - v2.2.2 - patch.pk3
|
||||
*/
|
||||
#define ASSET_HASH_SRB2_PK3 "51419a33b4982d840c6772c159ba7c0a"
|
||||
#define ASSET_HASH_ZONES_PK3 "df74843919fd51af26a0baa8e21e4c19"
|
||||
#define ASSET_HASH_PLAYER_DTA "56a247e074dd0dc794b6617efef1e918"
|
||||
#define ASSET_HASH_SRB2_PK3 "0277c9416756627004e83cbb5b2e3e28"
|
||||
#define ASSET_HASH_ZONES_PK3 "f7e88afb6af7996a834c7d663144bead"
|
||||
#define ASSET_HASH_PLAYER_DTA "ad49e07b17cc662f1ad70c454910b4ae"
|
||||
#ifdef USE_PATCH_DTA
|
||||
#define ASSET_HASH_PATCH_PK3 "there is no patch.pk3, only zuul"
|
||||
#define ASSET_HASH_PATCH_PK3 "ee54330ecb743314c5f962af4db731ff"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2019 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2020 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
@ -769,7 +769,7 @@ boolean CON_Responder(event_t *ev)
|
|||
// check for console toggle key
|
||||
if (ev->type != ev_console)
|
||||
{
|
||||
if (modeattacking || metalrecording || menuactive)
|
||||
if (modeattacking || metalrecording)
|
||||
return false;
|
||||
|
||||
if (key == gamecontrol[gc_console][0] || key == gamecontrol[gc_console][1])
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2019 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2020 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2019 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2020 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
@ -405,8 +405,8 @@ static void ExtraDataTicker(void)
|
|||
}
|
||||
|
||||
// If you are a client, you can safely forget the net commands for this tic
|
||||
// If you are the server, you need to remember them until every client has been aknowledged,
|
||||
// because if you need to resend a PT_SERVERTICS packet, you need to put the commands in it
|
||||
// If you are the server, you need to remember them until every client has been acknowledged,
|
||||
// because if you need to resend a PT_SERVERTICS packet, you will need to put the commands in it
|
||||
if (client)
|
||||
D_FreeTextcmd(gametic);
|
||||
}
|
||||
|
@ -1245,8 +1245,14 @@ static boolean CL_SendJoin(void)
|
|||
netbuffer->u.clientcfg.subversion = SUBVERSION;
|
||||
strncpy(netbuffer->u.clientcfg.application, SRB2APPLICATION,
|
||||
sizeof netbuffer->u.clientcfg.application);
|
||||
|
||||
CleanupPlayerName(consoleplayer, cv_playername.zstring);
|
||||
if (splitscreen)
|
||||
CleanupPlayerName(1, cv_playername2.zstring);/* 1 is a HACK? oh no */
|
||||
|
||||
strncpy(netbuffer->u.clientcfg.names[0], cv_playername.zstring, MAXPLAYERNAME);
|
||||
strncpy(netbuffer->u.clientcfg.names[1], cv_playername2.zstring, MAXPLAYERNAME);
|
||||
|
||||
return HSendPacket(servernode, true, 0, sizeof (clientconfig_pak));
|
||||
}
|
||||
|
||||
|
@ -3952,7 +3958,9 @@ static void HandlePacketFromPlayer(SINT8 node)
|
|||
INT32 netconsole;
|
||||
tic_t realend, realstart;
|
||||
UINT8 *pak, *txtpak, numtxtpak;
|
||||
#ifndef NOMD5
|
||||
UINT8 finalmd5[16];/* Well, it's the cool thing to do? */
|
||||
#endif
|
||||
|
||||
txtpak = NULL;
|
||||
|
||||
|
@ -4526,7 +4534,7 @@ static void CL_SendClientCmd(void)
|
|||
packetsize = sizeof (clientcmd_pak) - sizeof (ticcmd_t) - sizeof (INT16);
|
||||
HSendPacket(servernode, false, 0, packetsize);
|
||||
}
|
||||
else if (gamestate != GS_NULL && addedtogame)
|
||||
else if (gamestate != GS_NULL && (addedtogame || dedicated))
|
||||
{
|
||||
G_MoveTiccmd(&netbuffer->u.clientpak.cmd, &localcmds, 1);
|
||||
netbuffer->u.clientpak.consistancy = SHORT(consistancy[gametic%BACKUPTICS]);
|
||||
|
@ -4700,6 +4708,7 @@ static void Local_Maketic(INT32 realtics)
|
|||
G_BuildTiccmd(&localcmds2, realtics, 2);
|
||||
|
||||
localcmds.angleturn |= TICCMD_RECEIVED;
|
||||
localcmds2.angleturn |= TICCMD_RECEIVED;
|
||||
}
|
||||
|
||||
// This function is utter bullshit and is responsible for
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2019 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2020 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1993-1996 by id Software, Inc.
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2019 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2020 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
75
src/d_main.c
75
src/d_main.c
|
@ -2,7 +2,7 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1993-1996 by id Software, Inc.
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2019 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2020 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
@ -188,14 +188,14 @@ void D_ProcessEvents(void)
|
|||
continue;
|
||||
}
|
||||
|
||||
// console input
|
||||
if (CON_Responder(ev))
|
||||
continue; // ate the event
|
||||
|
||||
// Menu input
|
||||
if (M_Responder(ev))
|
||||
continue; // menu ate the event
|
||||
|
||||
// console input
|
||||
if (CON_Responder(ev))
|
||||
continue; // ate the event
|
||||
|
||||
G_Responder(ev);
|
||||
}
|
||||
}
|
||||
|
@ -266,6 +266,9 @@ static void D_Display(void)
|
|||
#endif
|
||||
}
|
||||
|
||||
if (rendermode == render_soft && !splitscreen)
|
||||
R_CheckViewMorph();
|
||||
|
||||
// change the view size if needed
|
||||
if (setsizeneeded || setrenderstillneeded)
|
||||
{
|
||||
|
@ -446,6 +449,9 @@ static void D_Display(void)
|
|||
// Image postprocessing effect
|
||||
if (rendermode == render_soft)
|
||||
{
|
||||
if (!splitscreen)
|
||||
R_ApplyViewMorph();
|
||||
|
||||
if (postimgtype)
|
||||
V_DoPostProcessor(0, postimgtype, postimgparam);
|
||||
if (postimgtype2)
|
||||
|
@ -505,8 +511,7 @@ static void D_Display(void)
|
|||
M_Drawer(); // menu is drawn even on top of everything
|
||||
// focus lost moved to M_Drawer
|
||||
|
||||
if (gamestate != GS_TIMEATTACK)
|
||||
CON_Drawer();
|
||||
CON_Drawer();
|
||||
|
||||
//
|
||||
// wipe update
|
||||
|
@ -651,8 +656,14 @@ void D_SRB2Loop(void)
|
|||
// hack to start on a nice clear console screen.
|
||||
COM_ImmedExecute("cls;version");
|
||||
|
||||
V_DrawScaledPatch(0, 0, 0, W_CachePatchNum(W_GetNumForName("CONSBACK"), PU_CACHE));
|
||||
I_FinishUpdate(); // page flip or blit buffer
|
||||
/*
|
||||
LMFAO this was showing garbage under OpenGL
|
||||
because I_FinishUpdate was called afterward
|
||||
*/
|
||||
/* Smells like a hack... Don't fade Sonic's ass into the title screen. */
|
||||
if (gamestate != GS_TITLESCREEN)
|
||||
V_DrawScaledPatch(0, 0, 0, W_CachePatchNum(W_GetNumForName("CONSBACK"), PU_CACHE));
|
||||
|
||||
for (;;)
|
||||
{
|
||||
|
@ -1028,7 +1039,7 @@ void D_SRB2Main(void)
|
|||
// Print GPL notice for our console users (Linux)
|
||||
CONS_Printf(
|
||||
"\n\nSonic Robo Blast 2\n"
|
||||
"Copyright (C) 1998-2019 by Sonic Team Junior\n\n"
|
||||
"Copyright (C) 1998-2020 by Sonic Team Junior\n\n"
|
||||
"This program comes with ABSOLUTELY NO WARRANTY.\n\n"
|
||||
"This is free software, and you are welcome to redistribute it\n"
|
||||
"and/or modify it under the terms of the GNU General Public License\n"
|
||||
|
@ -1199,22 +1210,17 @@ void D_SRB2Main(void)
|
|||
|
||||
// load wad, including the main wad file
|
||||
CONS_Printf("W_InitMultipleFiles(): Adding IWAD and main PWADs.\n");
|
||||
if (!W_InitMultipleFiles(startupwadfiles, mainwads))
|
||||
#ifdef _DEBUG
|
||||
CONS_Error("A WAD file was not found or not valid.\nCheck the log to see which ones.\n");
|
||||
#else
|
||||
I_Error("A WAD file was not found or not valid.\nCheck the log to see which ones.\n");
|
||||
#endif
|
||||
W_InitMultipleFiles(startupwadfiles, mainwads);
|
||||
D_CleanFile();
|
||||
|
||||
#ifndef DEVELOP // md5s last updated 06/12/19 (ddmmyy)
|
||||
#ifndef DEVELOP // md5s last updated 22/02/20 (ddmmyy)
|
||||
|
||||
// Check MD5s of autoloaded files
|
||||
W_VerifyFileMD5(0, ASSET_HASH_SRB2_PK3); // srb2.pk3
|
||||
W_VerifyFileMD5(1, ASSET_HASH_ZONES_PK3); // zones.pk3
|
||||
W_VerifyFileMD5(2, ASSET_HASH_PLAYER_DTA); // player.dta
|
||||
#ifdef USE_PATCH_DTA
|
||||
W_VerifyFileMD5(3, ASSET_HASH_PATCH_DTA); // patch.pk3
|
||||
W_VerifyFileMD5(3, ASSET_HASH_PATCH_PK3); // patch.pk3
|
||||
#endif
|
||||
// don't check music.dta because people like to modify it, and it doesn't matter if they do
|
||||
// ...except it does if they slip maps in there, and that's what W_VerifyNMUSlumps is for.
|
||||
|
@ -1222,20 +1228,6 @@ void D_SRB2Main(void)
|
|||
|
||||
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();
|
||||
|
||||
//---------------------------------------------------- READY SCREEN
|
||||
|
@ -1284,12 +1276,14 @@ void D_SRB2Main(void)
|
|||
// Lactozilla: Does the render mode need to change?
|
||||
if ((setrenderneeded != 0) && (setrenderneeded != rendermode))
|
||||
{
|
||||
CONS_Printf("Switching the renderer...\n");
|
||||
needpatchflush = true;
|
||||
needpatchrecache = true;
|
||||
VID_CheckRenderer();
|
||||
SCR_ChangeRendererCVars(setrenderneeded);
|
||||
D_CheckRendererState();
|
||||
setrenderneeded = 0;
|
||||
}
|
||||
D_CheckRendererState();
|
||||
|
||||
wipegamestate = gamestate;
|
||||
|
||||
|
@ -1297,6 +1291,23 @@ void D_SRB2Main(void)
|
|||
|
||||
//------------------------------------------------ COMMAND LINE PARAMS
|
||||
|
||||
// this must be done after loading gamedata,
|
||||
// to avoid setting off the corrupted gamedata code in G_LoadGameData if a SOC with custom gamedata is added
|
||||
// -- Monster Iestyn 20/02/20
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
// Initialize CD-Audio
|
||||
if (M_CheckParm("-usecd") && !dedicated)
|
||||
I_InitCD();
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1993-1996 by id Software, Inc.
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2019 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2020 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1993-1996 by id Software, Inc.
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2019 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2020 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1993-1996 by id Software, Inc.
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2019 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2020 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2019 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2020 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
@ -370,7 +370,7 @@ consvar_t cv_advancemap = {"advancemap", "Next", CV_NETVAR, advancemap_cons_t, N
|
|||
static CV_PossibleValue_t playersforexit_cons_t[] = {{0, "One"}, {1, "1/4"}, {2, "Half"}, {3, "3/4"}, {4, "All"}, {0, NULL}};
|
||||
consvar_t cv_playersforexit = {"playersforexit", "All", CV_NETVAR, playersforexit_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
consvar_t cv_exitmove = {"exitmove", "Off", CV_NETVAR|CV_CALL, CV_OnOff, ExitMove_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_exitmove = {"exitmove", "On", CV_NETVAR|CV_CALL, CV_OnOff, ExitMove_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
consvar_t cv_runscripts = {"runscripts", "Yes", 0, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
|
@ -632,7 +632,7 @@ void D_RegisterClientCommands(void)
|
|||
// Set default player names
|
||||
// Monster Iestyn (12/08/19): not sure where else I could have actually put this, but oh well
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
sprintf(player_names[i], "Player %d", i);
|
||||
sprintf(player_names[i], "Player %d", 1 + i);
|
||||
|
||||
if (dedicated)
|
||||
return;
|
||||
|
@ -677,6 +677,7 @@ void D_RegisterClientCommands(void)
|
|||
// GIF variables
|
||||
CV_RegisterVar(&cv_gif_optimize);
|
||||
CV_RegisterVar(&cv_gif_downscale);
|
||||
CV_RegisterVar(&cv_gif_localcolortable);
|
||||
|
||||
#ifdef WALLSPLATS
|
||||
CV_RegisterVar(&cv_splats);
|
||||
|
@ -1008,7 +1009,7 @@ boolean EnsurePlayerNameIsGood(char *name, INT32 playernum)
|
|||
* SetPlayerName
|
||||
* \author Graue <graue@oceanbase.org>
|
||||
*/
|
||||
static void CleanupPlayerName(INT32 playernum, const char *newname)
|
||||
void CleanupPlayerName(INT32 playernum, const char *newname)
|
||||
{
|
||||
char *buf;
|
||||
char *p;
|
||||
|
@ -1036,6 +1037,17 @@ static void CleanupPlayerName(INT32 playernum, const char *newname)
|
|||
|
||||
tmpname = p;
|
||||
|
||||
do
|
||||
{
|
||||
/* from EnsurePlayerNameIsGood */
|
||||
if (!isprint(*p) || *p == ';' || (UINT8)*p >= 0x80)
|
||||
break;
|
||||
}
|
||||
while (*++p) ;
|
||||
|
||||
if (*p)/* bad char found */
|
||||
break;
|
||||
|
||||
// Remove trailing spaces.
|
||||
p = &tmpname[strlen(tmpname)-1]; // last character
|
||||
while (*p == ' ' && p >= tmpname)
|
||||
|
@ -3737,9 +3749,15 @@ static void ExitMove_OnChange(void)
|
|||
if (cv_exitmove.value)
|
||||
{
|
||||
for (i = 0; i < MAXPLAYERS; ++i)
|
||||
if (playeringame[i] && players[i].mo
|
||||
&& players[i].mo->target && players[i].mo->target->type == MT_SIGN)
|
||||
P_SetTarget(&players[i].mo->target, NULL);
|
||||
if (playeringame[i] && players[i].mo)
|
||||
{
|
||||
if (players[i].mo->target && players[i].mo->target->type == MT_SIGN)
|
||||
P_SetTarget(&players[i].mo->target, NULL);
|
||||
|
||||
if (players[i].pflags & PF_FINISHED)
|
||||
P_GiveFinishFlags(&players[i]);
|
||||
}
|
||||
|
||||
CONS_Printf(M_GetText("Players can now move after completing the level.\n"));
|
||||
}
|
||||
else
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2019 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2020 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
@ -194,6 +194,7 @@ typedef union {
|
|||
// add game commands, needs cleanup
|
||||
void D_RegisterServerCommands(void);
|
||||
void D_RegisterClientCommands(void);
|
||||
void CleanupPlayerName(INT32 playernum, const char *newname);
|
||||
boolean EnsurePlayerNameIsGood(char *name, INT32 playernum);
|
||||
void D_SendPlayerConfig(void);
|
||||
void Command_ExitGame_f(void);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2019 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2020 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2019 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2020 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1993-1996 by id Software, Inc.
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2019 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2020 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
@ -278,6 +278,7 @@ typedef enum
|
|||
pw_nights_linkfreeze,
|
||||
|
||||
pw_nocontrol, //for linedef exec 427
|
||||
pw_justlaunched, // Launched off a slope this tic (0=none, 1=standard launch, 2=half-pipe launch)
|
||||
|
||||
NUMPOWERS
|
||||
} powertype_t;
|
||||
|
@ -324,6 +325,8 @@ typedef struct player_s
|
|||
// bounded/scaled total momentum.
|
||||
fixed_t bob;
|
||||
|
||||
angle_t viewrollangle;
|
||||
|
||||
// Mouse aiming, where the guy is looking at!
|
||||
// It is updated with cmd->aiming.
|
||||
angle_t aiming;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1993-1996 by id Software, Inc.
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2019 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2020 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1993-1996 by id Software, Inc.
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2019 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2020 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
200
src/dehacked.c
200
src/dehacked.c
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2019 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2020 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
@ -585,21 +585,30 @@ static void readfreeslots(MYFILE *f)
|
|||
continue;
|
||||
// Copy in the spr2 name and increment free_spr2.
|
||||
if (free_spr2 < NUMPLAYERSPRITES) {
|
||||
CONS_Printf("Sprite SPR2_%s allocated.\n",word);
|
||||
strncpy(spr2names[free_spr2],word,4);
|
||||
spr2defaults[free_spr2] = 0;
|
||||
spr2names[free_spr2++][4] = 0;
|
||||
} else
|
||||
CONS_Alert(CONS_WARNING, "Ran out of free SPR2 slots!\n");
|
||||
deh_warning("Ran out of free SPR2 slots!\n");
|
||||
}
|
||||
else if (fastcmp(type, "TOL"))
|
||||
{
|
||||
if (lastcustomtol > 31)
|
||||
CONS_Alert(CONS_WARNING, "Ran out of free typeoflevel slots!\n");
|
||||
// Search if we already have a typeoflevel by that name...
|
||||
for (i = 0; TYPEOFLEVEL[i].name; i++)
|
||||
if (fastcmp(word, TYPEOFLEVEL[i].name))
|
||||
break;
|
||||
|
||||
// We found it? Then don't allocate another one.
|
||||
if (TYPEOFLEVEL[i].name)
|
||||
continue;
|
||||
|
||||
// We don't, so freeslot it.
|
||||
if (lastcustomtol == (UINT32)MAXTOL) // Unless you have way too many, since they're flags.
|
||||
deh_warning("Ran out of free typeoflevel slots!\n");
|
||||
else
|
||||
{
|
||||
G_AddTOL((1<<lastcustomtol), word);
|
||||
lastcustomtol++;
|
||||
G_AddTOL(lastcustomtol, word);
|
||||
lastcustomtol <<= 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -1105,38 +1114,7 @@ static void readsprite2(MYFILE *f, INT32 num)
|
|||
Z_Free(s);
|
||||
}
|
||||
|
||||
INT32 numtolinfo = NUMBASETOL;
|
||||
UINT32 lastcustomtol = 13;
|
||||
|
||||
tolinfo_t TYPEOFLEVEL[NUMMAXTOL] = {
|
||||
{"SOLO",TOL_SP},
|
||||
{"SP",TOL_SP},
|
||||
{"SINGLEPLAYER",TOL_SP},
|
||||
{"SINGLE",TOL_SP},
|
||||
|
||||
{"COOP",TOL_COOP},
|
||||
{"CO-OP",TOL_COOP},
|
||||
|
||||
{"COMPETITION",TOL_COMPETITION},
|
||||
{"RACE",TOL_RACE},
|
||||
|
||||
{"MATCH",TOL_MATCH},
|
||||
{"TAG",TOL_TAG},
|
||||
{"CTF",TOL_CTF},
|
||||
|
||||
{"2D",TOL_2D},
|
||||
{"MARIO",TOL_MARIO},
|
||||
{"NIGHTS",TOL_NIGHTS},
|
||||
{"OLDBRAK",TOL_ERZ3},
|
||||
|
||||
{"XMAS",TOL_XMAS},
|
||||
{"CHRISTMAS",TOL_XMAS},
|
||||
{"WINTER",TOL_XMAS},
|
||||
|
||||
{NULL, 0}
|
||||
};
|
||||
|
||||
// copypasted from readPlayer :sleep:
|
||||
// copypasted from readPlayer :]
|
||||
static const char *const GAMETYPERULE_LIST[];
|
||||
static void readgametype(MYFILE *f, char *gtname)
|
||||
{
|
||||
|
@ -1293,10 +1271,7 @@ static void readgametype(MYFILE *f, char *gtname)
|
|||
UINT32 wordgt = 0;
|
||||
for (j = 0; GAMETYPERULE_LIST[j]; j++)
|
||||
if (fastcmp(word, GAMETYPERULE_LIST[j])) {
|
||||
if (!j) // GTR_CAMPAIGN
|
||||
wordgt |= 1;
|
||||
else
|
||||
wordgt |= (1<<j);
|
||||
wordgt |= (1<<j);
|
||||
if (i || word2[0] == 'T' || word2[0] == 'Y')
|
||||
newgtrules |= wordgt;
|
||||
break;
|
||||
|
@ -1831,6 +1806,24 @@ static void readlevelheader(MYFILE *f, INT32 num)
|
|||
else
|
||||
mapheaderinfo[num-1]->levelflags &= ~LF_NOTITLECARD;
|
||||
}
|
||||
else if (fastcmp(word, "SHOWTITLECARDFOR"))
|
||||
{
|
||||
mapheaderinfo[num-1]->levelflags |= LF_NOTITLECARD;
|
||||
tmp = strtok(word2,",");
|
||||
do {
|
||||
if (fastcmp(tmp, "FIRST"))
|
||||
mapheaderinfo[num-1]->levelflags &= ~LF_NOTITLECARDFIRST;
|
||||
else if (fastcmp(tmp, "RESPAWN"))
|
||||
mapheaderinfo[num-1]->levelflags &= ~LF_NOTITLECARDRESPAWN;
|
||||
else if (fastcmp(tmp, "RECORDATTACK"))
|
||||
mapheaderinfo[num-1]->levelflags &= ~LF_NOTITLECARDRECORDATTACK;
|
||||
else if (fastcmp(tmp, "ALL"))
|
||||
mapheaderinfo[num-1]->levelflags &= ~LF_NOTITLECARD;
|
||||
else if (!fastcmp(tmp, "NONE"))
|
||||
deh_warning("Level header %d: unknown titlecard show option %s\n", num, tmp);
|
||||
|
||||
} while((tmp = strtok(NULL,",")) != NULL);
|
||||
}
|
||||
|
||||
// Individual triggers for menu flags
|
||||
else if (fastcmp(word, "HIDDEN"))
|
||||
|
@ -4945,19 +4938,19 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit
|
|||
"S_PLAY_SUPER_TRANS3",
|
||||
"S_PLAY_SUPER_TRANS4",
|
||||
"S_PLAY_SUPER_TRANS5",
|
||||
"S_PLAY_SUPER_TRANS6", // This has special significance in the code. If you add more frames, search for it and make the appropriate changes.
|
||||
"S_PLAY_SUPER_TRANS6",
|
||||
|
||||
// technically the player goes here but it's an infinite tic state
|
||||
"S_OBJPLACE_DUMMY",
|
||||
|
||||
// 1-Up Box Sprites (uses player sprite)
|
||||
// 1-Up Box Sprites overlay (uses player sprite)
|
||||
"S_PLAY_BOX1",
|
||||
"S_PLAY_BOX2",
|
||||
"S_PLAY_ICON1",
|
||||
"S_PLAY_ICON2",
|
||||
"S_PLAY_ICON3",
|
||||
|
||||
// Level end sign (uses player sprite)
|
||||
// Level end sign overlay (uses player sprite)
|
||||
"S_PLAY_SIGN",
|
||||
|
||||
// NiGHTS character (uses player sprite)
|
||||
|
@ -5205,7 +5198,7 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit
|
|||
"S_ROBOHOOD_JUMP2",
|
||||
"S_ROBOHOOD_JUMP3",
|
||||
|
||||
// CastleBot FaceStabber
|
||||
// Castlebot Facestabber
|
||||
"S_FACESTABBER_STND1",
|
||||
"S_FACESTABBER_STND2",
|
||||
"S_FACESTABBER_STND3",
|
||||
|
@ -5425,6 +5418,7 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit
|
|||
"S_EGGMOBILE_FLEE2",
|
||||
"S_EGGMOBILE_BALL",
|
||||
"S_EGGMOBILE_TARGET",
|
||||
|
||||
"S_BOSSEGLZ1",
|
||||
"S_BOSSEGLZ2",
|
||||
|
||||
|
@ -5477,7 +5471,7 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit
|
|||
"S_EGGMOBILE3_FLEE1",
|
||||
"S_EGGMOBILE3_FLEE2",
|
||||
|
||||
// Boss 3 pinch
|
||||
// Boss 3 Pinch
|
||||
"S_FAKEMOBILE_INIT",
|
||||
"S_FAKEMOBILE",
|
||||
"S_FAKEMOBILE_ATK1",
|
||||
|
@ -5493,7 +5487,6 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit
|
|||
"S_BOSSSEBH2",
|
||||
|
||||
// Boss 3 Shockwave
|
||||
|
||||
"S_SHOCKWAVE1",
|
||||
"S_SHOCKWAVE2",
|
||||
|
||||
|
@ -5530,9 +5523,9 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit
|
|||
"S_JETFLAME",
|
||||
|
||||
// Boss 4 Spectator Eggrobo
|
||||
"S_EGGROBO1_IDLE",
|
||||
"S_EGGROBO1_STND",
|
||||
"S_EGGROBO1_BSLAP1",
|
||||
"S_EGGROBO2_BSLAP2",
|
||||
"S_EGGROBO1_BSLAP2",
|
||||
"S_EGGROBO1_PISSED",
|
||||
|
||||
// Boss 4 Spectator Eggrobo jet flame
|
||||
|
@ -5776,7 +5769,7 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit
|
|||
"S_CYBRAKDEMON_NAPALM_ATTACK1",
|
||||
"S_CYBRAKDEMON_NAPALM_ATTACK2",
|
||||
"S_CYBRAKDEMON_NAPALM_ATTACK3",
|
||||
"S_CYBRAKDEMON_FINISH_ATTACK", // If just attacked, remove MF2_FRET w/out going back to spawnstate
|
||||
"S_CYBRAKDEMON_FINISH_ATTACK1", // If just attacked, remove MF2_FRET w/out going back to spawnstate
|
||||
"S_CYBRAKDEMON_FINISH_ATTACK2", // Force a delay between attacks so you don't get bombarded with them back-to-back
|
||||
"S_CYBRAKDEMON_PAIN1",
|
||||
"S_CYBRAKDEMON_PAIN2",
|
||||
|
@ -6470,7 +6463,7 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit
|
|||
"S_LITTLETUMBLEWEED_ROLL7",
|
||||
"S_LITTLETUMBLEWEED_ROLL8",
|
||||
|
||||
// Cacti Sprites
|
||||
// Cacti
|
||||
"S_CACTI1",
|
||||
"S_CACTI2",
|
||||
"S_CACTI3",
|
||||
|
@ -6485,7 +6478,7 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit
|
|||
"S_CACTITINYSEG",
|
||||
"S_CACTISMALLSEG",
|
||||
|
||||
// Warning signs sprites
|
||||
// Warning signs
|
||||
"S_ARIDSIGN_CAUTION",
|
||||
"S_ARIDSIGN_CACTI",
|
||||
"S_ARIDSIGN_SHARPTURN",
|
||||
|
@ -6502,6 +6495,7 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit
|
|||
"S_TNTBARREL_EXPL4",
|
||||
"S_TNTBARREL_EXPL5",
|
||||
"S_TNTBARREL_EXPL6",
|
||||
"S_TNTBARREL_EXPL7",
|
||||
"S_TNTBARREL_FLYING",
|
||||
|
||||
// TNT proximity shell
|
||||
|
@ -7047,7 +7041,7 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit
|
|||
"S_ZAPSB10",
|
||||
"S_ZAPSB11", // blank frame
|
||||
|
||||
// Thunder spark
|
||||
//Thunder spark
|
||||
"S_THUNDERCOIN_SPARK",
|
||||
|
||||
// Invincibility Sparkles
|
||||
|
@ -7348,6 +7342,7 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit
|
|||
"S_BHORIZ7",
|
||||
"S_BHORIZ8",
|
||||
|
||||
// Booster
|
||||
"S_BOOSTERSOUND",
|
||||
"S_YELLOWBOOSTERROLLER",
|
||||
"S_YELLOWBOOSTERSEG_LEFT",
|
||||
|
@ -7378,7 +7373,7 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit
|
|||
"S_SPLISH8",
|
||||
"S_SPLISH9",
|
||||
|
||||
// Lava splish
|
||||
// Lava Splish
|
||||
"S_LAVASPLISH",
|
||||
|
||||
// added water splash
|
||||
|
@ -7482,6 +7477,9 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit
|
|||
|
||||
// Got Flag Sign
|
||||
"S_GOTFLAG",
|
||||
|
||||
// Finish flag
|
||||
"S_FINISHFLAG",
|
||||
|
||||
"S_CORK",
|
||||
"S_LHRT",
|
||||
|
@ -7974,6 +7972,8 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit
|
|||
"S_ROCKCRUMBLEN",
|
||||
"S_ROCKCRUMBLEO",
|
||||
"S_ROCKCRUMBLEP",
|
||||
|
||||
// Level debris
|
||||
"S_GFZDEBRIS",
|
||||
"S_BRICKDEBRIS",
|
||||
"S_WOODDEBRIS",
|
||||
|
@ -7993,7 +7993,7 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s
|
|||
"MT_THOK", // Thok! mobj
|
||||
"MT_PLAYER",
|
||||
"MT_TAILSOVERLAY", // c:
|
||||
"MT_METALJETFUME", // [:
|
||||
"MT_METALJETFUME",
|
||||
|
||||
// Enemies
|
||||
"MT_BLUECRAWLA", // Crawla (Blue)
|
||||
|
@ -8110,7 +8110,7 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s
|
|||
"MT_CYBRAKDEMON_NAPALM_FLAMES",
|
||||
"MT_CYBRAKDEMON_VILE_EXPLOSION",
|
||||
|
||||
// Metal Sonic
|
||||
// Metal Sonic (Boss 9)
|
||||
"MT_METALSONIC_RACE",
|
||||
"MT_METALSONIC_BATTLE",
|
||||
"MT_MSSHIELD_FRONT",
|
||||
|
@ -8124,7 +8124,7 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s
|
|||
"MT_BOMBSPHERE",
|
||||
"MT_REDTEAMRING", //Rings collectable by red team.
|
||||
"MT_BLUETEAMRING", //Rings collectable by blue team.
|
||||
"MT_TOKEN", // Special Stage Token
|
||||
"MT_TOKEN", // Special Stage token for special stage
|
||||
"MT_REDFLAG", // Red CTF Flag
|
||||
"MT_BLUEFLAG", // Blue CTF Flag
|
||||
"MT_EMBLEM",
|
||||
|
@ -8350,22 +8350,22 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s
|
|||
// Arid Canyon Scenery
|
||||
"MT_BIGTUMBLEWEED",
|
||||
"MT_LITTLETUMBLEWEED",
|
||||
"MT_CACTI1",
|
||||
"MT_CACTI2",
|
||||
"MT_CACTI3",
|
||||
"MT_CACTI4",
|
||||
"MT_CACTI5",
|
||||
"MT_CACTI6",
|
||||
"MT_CACTI7",
|
||||
"MT_CACTI8",
|
||||
"MT_CACTI9",
|
||||
"MT_CACTI10",
|
||||
"MT_CACTI11",
|
||||
"MT_CACTITINYSEG",
|
||||
"MT_CACTISMALLSEG",
|
||||
"MT_ARIDSIGN_CAUTION",
|
||||
"MT_ARIDSIGN_CACTI",
|
||||
"MT_ARIDSIGN_SHARPTURN",
|
||||
"MT_CACTI1", // Tiny Red Flower Cactus
|
||||
"MT_CACTI2", // Small Red Flower Cactus
|
||||
"MT_CACTI3", // Tiny Blue Flower Cactus
|
||||
"MT_CACTI4", // Small Blue Flower Cactus
|
||||
"MT_CACTI5", // Prickly Pear
|
||||
"MT_CACTI6", // Barrel Cactus
|
||||
"MT_CACTI7", // Tall Barrel Cactus
|
||||
"MT_CACTI8", // Armed Cactus
|
||||
"MT_CACTI9", // Ball Cactus
|
||||
"MT_CACTI10", // Tiny Cactus
|
||||
"MT_CACTI11", // Small Cactus
|
||||
"MT_CACTITINYSEG", // Tiny Cactus Segment
|
||||
"MT_CACTISMALLSEG", // Small Cactus Segment
|
||||
"MT_ARIDSIGN_CAUTION", // Caution Sign
|
||||
"MT_ARIDSIGN_CACTI", // Cacti Sign
|
||||
"MT_ARIDSIGN_SHARPTURN", // Sharp Turn Sign
|
||||
"MT_OILLAMP",
|
||||
"MT_TNTBARREL",
|
||||
"MT_PROXIMITYTNT",
|
||||
|
@ -8420,7 +8420,7 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s
|
|||
"MT_GLAREGOYLEUP",
|
||||
"MT_GLAREGOYLEDOWN",
|
||||
"MT_GLAREGOYLELONG",
|
||||
"MT_TARGET",
|
||||
"MT_TARGET", // AKA Red Crystal
|
||||
"MT_GREENFLAME",
|
||||
"MT_BLUEGARGOYLE",
|
||||
|
||||
|
@ -8471,7 +8471,7 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s
|
|||
"MT_HHZSTALAGMITE_TALL",
|
||||
"MT_HHZSTALAGMITE_SHORT",
|
||||
|
||||
// Botanic Serenity
|
||||
// Botanic Serenity scenery
|
||||
"MT_BSZTALLFLOWER_RED",
|
||||
"MT_BSZTALLFLOWER_PURPLE",
|
||||
"MT_BSZTALLFLOWER_BLUE",
|
||||
|
@ -8601,6 +8601,7 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s
|
|||
"MT_LOCKONINF", // In-level Target
|
||||
"MT_TAG", // Tag Sign
|
||||
"MT_GOTFLAG", // Got Flag sign
|
||||
"MT_FINISHFLAG", // Finish flag
|
||||
|
||||
// Ambient Sounds
|
||||
"MT_AWATERA", // Ambient Water Sound 1
|
||||
|
@ -8751,6 +8752,8 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s
|
|||
"MT_ROCKCRUMBLE14",
|
||||
"MT_ROCKCRUMBLE15",
|
||||
"MT_ROCKCRUMBLE16",
|
||||
|
||||
// Level debris
|
||||
"MT_GFZDEBRIS",
|
||||
"MT_BRICKDEBRIS",
|
||||
"MT_WOODDEBRIS",
|
||||
|
@ -8989,9 +8992,11 @@ static const char *COLOR_ENUMS[] = {
|
|||
// Desaturated
|
||||
"AETHER", // SKINCOLOR_AETHER,
|
||||
"SLATE", // SKINCOLOR_SLATE,
|
||||
"BLUEBELL", // SKINCOLOR_BLUEBELL,
|
||||
"PINK", // SKINCOLOR_PINK,
|
||||
"YOGURT", // SKINCOLOR_YOGURT,
|
||||
"BROWN", // SKINCOLOR_BROWN,
|
||||
"BRONZE", // SKINCOLOR_BRONZE,
|
||||
"TAN", // SKINCOLOR_TAN,
|
||||
"BEIGE", // SKINCOLOR_BEIGE,
|
||||
"MOSS", // SKINCOLOR_MOSS,
|
||||
|
@ -9004,9 +9009,11 @@ static const char *COLOR_ENUMS[] = {
|
|||
"RED", // SKINCOLOR_RED,
|
||||
"CRIMSON", // SKINCOLOR_CRIMSON,
|
||||
"FLAME", // SKINCOLOR_FLAME,
|
||||
"KETCHUP", // SKINCOLOR_KETCHUP,
|
||||
"PEACHY", // SKINCOLOR_PEACHY,
|
||||
"QUAIL", // SKINCOLOR_QUAIL,
|
||||
"SUNSET", // SKINCOLOR_SUNSET,
|
||||
"COPPER", // SKINCOLOR_COPPER,
|
||||
"APRICOT", // SKINCOLOR_APRICOT,
|
||||
"ORANGE", // SKINCOLOR_ORANGE,
|
||||
"RUST", // SKINCOLOR_RUST,
|
||||
|
@ -9016,6 +9023,7 @@ static const char *COLOR_ENUMS[] = {
|
|||
"OLIVE", // SKINCOLOR_OLIVE,
|
||||
"LIME", // SKINCOLOR_LIME,
|
||||
"PERIDOT", // SKINCOLOR_PERIDOT,
|
||||
"APPLE", // SKINCOLOR_APPLE,
|
||||
"GREEN", // SKINCOLOR_GREEN,
|
||||
"FOREST", // SKINCOLOR_FOREST,
|
||||
"EMERALD", // SKINCOLOR_EMERALD,
|
||||
|
@ -9042,6 +9050,7 @@ static const char *COLOR_ENUMS[] = {
|
|||
"VIOLET", // SKINCOLOR_VIOLET,
|
||||
"LILAC", // SKINCOLOR_LILAC,
|
||||
"PLUM", // SKINCOLOR_PLUM,
|
||||
"RASPBERRY", // SKINCOLOR_RASPBERRY,
|
||||
"ROSY", // SKINCOLOR_ROSY,
|
||||
|
||||
// Super special awesome Super flashing colors!
|
||||
|
@ -9135,7 +9144,8 @@ static const char *const POWERS_LIST[] = {
|
|||
"NIGHTS_LINKFREEZE",
|
||||
|
||||
//for linedef exec 427
|
||||
"NOCONTROL"
|
||||
"NOCONTROL",
|
||||
"JUSTLAUNCHED",
|
||||
};
|
||||
|
||||
static const char *const HUDITEMS_LIST[] = {
|
||||
|
@ -9143,6 +9153,7 @@ static const char *const HUDITEMS_LIST[] = {
|
|||
|
||||
"RINGS",
|
||||
"RINGSNUM",
|
||||
"RINGSNUMTICS",
|
||||
|
||||
"SCORE",
|
||||
"SCORENUM",
|
||||
|
@ -9162,8 +9173,7 @@ static const char *const HUDITEMS_LIST[] = {
|
|||
"TIMELEFTNUM",
|
||||
"TIMEUP",
|
||||
"HUNTPICS",
|
||||
"POWERUPS",
|
||||
"LAP"
|
||||
"POWERUPS"
|
||||
};
|
||||
|
||||
static const char *const MENUTYPES_LIST[] = {
|
||||
|
@ -9372,6 +9382,9 @@ struct {
|
|||
{"LF_NOZONE",LF_NOZONE},
|
||||
{"LF_SAVEGAME",LF_SAVEGAME},
|
||||
{"LF_MIXNIGHTSCOUNTDOWN",LF_MIXNIGHTSCOUNTDOWN},
|
||||
{"LF_NOTITLECARDFIRST",LF_NOTITLECARDFIRST},
|
||||
{"LF_NOTITLECARDRESPAWN",LF_NOTITLECARDRESPAWN},
|
||||
{"LF_NOTITLECARDRECORDATTACK",LF_NOTITLECARDRECORDATTACK},
|
||||
{"LF_NOTITLECARD",LF_NOTITLECARD},
|
||||
{"LF_WARNINGTITLE",LF_WARNINGTITLE},
|
||||
// And map flags
|
||||
|
@ -10465,16 +10478,23 @@ static inline int lib_freeslot(lua_State *L)
|
|||
}
|
||||
else if (fastcmp(type, "TOL"))
|
||||
{
|
||||
if (lastcustomtol > 31)
|
||||
CONS_Alert(CONS_WARNING, "Ran out of free typeoflevel slots!\n");
|
||||
else
|
||||
{
|
||||
UINT32 newtol = (1<<lastcustomtol);
|
||||
CONS_Printf("TypeOfLevel TOL_%s allocated.\n",word);
|
||||
G_AddTOL(newtol, word);
|
||||
lua_pushinteger(L, newtol);
|
||||
lastcustomtol++;
|
||||
r++;
|
||||
// Search if we already have a typeoflevel by that name...
|
||||
int i;
|
||||
for (i = 0; TYPEOFLEVEL[i].name; i++)
|
||||
if (fastcmp(word, TYPEOFLEVEL[i].name))
|
||||
break;
|
||||
|
||||
// We don't, so allocate a new one.
|
||||
if (TYPEOFLEVEL[i].name == NULL) {
|
||||
if (lastcustomtol == (UINT32)MAXTOL) // Unless you have way too many, since they're flags.
|
||||
CONS_Alert(CONS_WARNING, "Ran out of free typeoflevel slots!\n");
|
||||
else {
|
||||
CONS_Printf("TypeOfLevel TOL_%s allocated.\n",word);
|
||||
G_AddTOL(lastcustomtol, word);
|
||||
lua_pushinteger(L, lastcustomtol);
|
||||
lastcustomtol <<= 1;
|
||||
r++;
|
||||
}
|
||||
}
|
||||
}
|
||||
Z_Free(s);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2019 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2020 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// Emacs style mode select -*- C++ -*-
|
||||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// Copyright (C) 2005-2019 by Sonic Team Junior.
|
||||
// Copyright (C) 2005-2020 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1993-1996 by id Software, Inc.
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2019 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2020 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1993-1996 by id Software, Inc.
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2019 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2020 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
@ -143,16 +143,16 @@ extern char logfilename[1024];
|
|||
// we use comprevision and compbranch instead.
|
||||
#else
|
||||
#define VERSION 202 // Game version
|
||||
#define SUBVERSION 0 // more precise version number
|
||||
#define VERSIONSTRING "v2.2.0"
|
||||
#define VERSIONSTRINGW L"v2.2.0"
|
||||
#define SUBVERSION 2 // more precise version number
|
||||
#define VERSIONSTRING "v2.2.2"
|
||||
#define VERSIONSTRINGW L"v2.2.2"
|
||||
// Hey! If you change this, add 1 to the MODVERSION below!
|
||||
// Otherwise we can't force updates!
|
||||
#endif
|
||||
|
||||
// Does this version require an added patch file?
|
||||
// Comment or uncomment this as necessary.
|
||||
//#define USE_PATCH_DTA
|
||||
#define USE_PATCH_DTA
|
||||
|
||||
// Use .kart extension addons
|
||||
//#define USE_KART
|
||||
|
@ -210,7 +210,7 @@ extern char logfilename[1024];
|
|||
// it's only for detection of the version the player is using so the MS can alert them of an update.
|
||||
// Only set it higher, not lower, obviously.
|
||||
// Note that we use this to help keep internal testing in check; this is why v2.2.0 is not version "1".
|
||||
#define MODVERSION 40
|
||||
#define MODVERSION 42
|
||||
|
||||
// To version config.cfg, MAJOREXECVERSION is set equal to MODVERSION automatically.
|
||||
// Increment MINOREXECVERSION whenever a config change is needed that does not correspond
|
||||
|
@ -253,9 +253,11 @@ typedef enum
|
|||
// Desaturated
|
||||
SKINCOLOR_AETHER,
|
||||
SKINCOLOR_SLATE,
|
||||
SKINCOLOR_BLUEBELL,
|
||||
SKINCOLOR_PINK,
|
||||
SKINCOLOR_YOGURT,
|
||||
SKINCOLOR_BROWN,
|
||||
SKINCOLOR_BRONZE,
|
||||
SKINCOLOR_TAN,
|
||||
SKINCOLOR_BEIGE,
|
||||
SKINCOLOR_MOSS,
|
||||
|
@ -268,9 +270,11 @@ typedef enum
|
|||
SKINCOLOR_RED,
|
||||
SKINCOLOR_CRIMSON,
|
||||
SKINCOLOR_FLAME,
|
||||
SKINCOLOR_KETCHUP,
|
||||
SKINCOLOR_PEACHY,
|
||||
SKINCOLOR_QUAIL,
|
||||
SKINCOLOR_SUNSET,
|
||||
SKINCOLOR_COPPER,
|
||||
SKINCOLOR_APRICOT,
|
||||
SKINCOLOR_ORANGE,
|
||||
SKINCOLOR_RUST,
|
||||
|
@ -280,6 +284,7 @@ typedef enum
|
|||
SKINCOLOR_OLIVE,
|
||||
SKINCOLOR_LIME,
|
||||
SKINCOLOR_PERIDOT,
|
||||
SKINCOLOR_APPLE,
|
||||
SKINCOLOR_GREEN,
|
||||
SKINCOLOR_FOREST,
|
||||
SKINCOLOR_EMERALD,
|
||||
|
@ -306,6 +311,7 @@ typedef enum
|
|||
SKINCOLOR_VIOLET,
|
||||
SKINCOLOR_LILAC,
|
||||
SKINCOLOR_PLUM,
|
||||
SKINCOLOR_RASPBERRY,
|
||||
SKINCOLOR_ROSY,
|
||||
|
||||
// SKINCOLOR_? - one left before we bump up against 0x39, which isn't a HARD limit anymore but would be excessive
|
||||
|
@ -490,6 +496,7 @@ extern INT32 cv_debug;
|
|||
#define DBG_SETUP 0x0400
|
||||
#define DBG_LUA 0x0800
|
||||
#define DBG_RANDOMIZER 0x1000
|
||||
#define DBG_VIEWMORPH 0x2000
|
||||
|
||||
// =======================
|
||||
// Misc stuff for later...
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1993-1996 by id Software, Inc.
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2019 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2020 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
@ -351,15 +351,19 @@ typedef struct
|
|||
} mapheader_t;
|
||||
|
||||
// level flags
|
||||
#define LF_SCRIPTISFILE 1 ///< True if the script is a file, not a lump.
|
||||
#define LF_SPEEDMUSIC 2 ///< Speed up act music for super sneakers
|
||||
#define LF_NOSSMUSIC 4 ///< Disable Super Sonic music
|
||||
#define LF_NORELOAD 8 ///< Don't reload level on death
|
||||
#define LF_NOZONE 16 ///< Don't include "ZONE" on level title
|
||||
#define LF_SAVEGAME 32 ///< Save the game upon loading this level
|
||||
#define LF_MIXNIGHTSCOUNTDOWN 64 ///< Play sfx_timeup instead of music change for NiGHTS countdown
|
||||
#define LF_WARNINGTITLE 128 ///< WARNING! WARNING! WARNING! WARNING!
|
||||
#define LF_NOTITLECARD 256 ///< Don't start the title card
|
||||
#define LF_SCRIPTISFILE (1<<0) ///< True if the script is a file, not a lump.
|
||||
#define LF_SPEEDMUSIC (1<<1) ///< Speed up act music for super sneakers
|
||||
#define LF_NOSSMUSIC (1<<2) ///< Disable Super Sonic music
|
||||
#define LF_NORELOAD (1<<3) ///< Don't reload level on death
|
||||
#define LF_NOZONE (1<<4) ///< Don't include "ZONE" on level title
|
||||
#define LF_SAVEGAME (1<<5) ///< Save the game upon loading this level
|
||||
#define LF_MIXNIGHTSCOUNTDOWN (1<<6) ///< Play sfx_timeup instead of music change for NiGHTS countdown
|
||||
#define LF_WARNINGTITLE (1<<7) ///< WARNING! WARNING! WARNING! WARNING!
|
||||
|
||||
#define LF_NOTITLECARDFIRST (1<<8)
|
||||
#define LF_NOTITLECARDRESPAWN (1<<9)
|
||||
#define LF_NOTITLECARDRECORDATTACK (1<<10)
|
||||
#define LF_NOTITLECARD (LF_NOTITLECARDFIRST|LF_NOTITLECARDRESPAWN|LF_NOTITLECARDRECORDATTACK) ///< Don't start the title card at all
|
||||
|
||||
#define LF2_HIDEINMENU 1 ///< Hide in the multiplayer menu
|
||||
#define LF2_HIDEINSTATS 2 ///< Hide in the statistics screen
|
||||
|
@ -437,6 +441,7 @@ extern const char *Gametype_ConstantNames[NUMGAMETYPES];
|
|||
extern INT32 pointlimits[NUMGAMETYPES];
|
||||
extern INT32 timelimits[NUMGAMETYPES];
|
||||
|
||||
// TypeOfLevel things
|
||||
enum TypeOfLevel
|
||||
{
|
||||
TOL_SP = 0x01, ///< Single Player
|
||||
|
@ -461,16 +466,16 @@ enum TypeOfLevel
|
|||
TOL_XMAS = 0x1000, ///< Christmas NiGHTS
|
||||
};
|
||||
|
||||
#define NUMBASETOL 18
|
||||
#define NUMMAXTOL (18 + NUMGAMETYPEFREESLOTS)
|
||||
#define MAXTOL (1<<31)
|
||||
#define NUMBASETOLNAMES (19)
|
||||
#define NUMTOLNAMES (NUMBASETOLNAMES + NUMGAMETYPEFREESLOTS)
|
||||
|
||||
typedef struct
|
||||
{
|
||||
const char *name;
|
||||
UINT32 flag;
|
||||
} tolinfo_t;
|
||||
extern tolinfo_t TYPEOFLEVEL[NUMMAXTOL];
|
||||
extern INT32 numtolinfo;
|
||||
extern tolinfo_t TYPEOFLEVEL[NUMTOLNAMES];
|
||||
extern UINT32 lastcustomtol;
|
||||
|
||||
extern tic_t totalplaytime;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1993-1996 by id Software, Inc.
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2019 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2020 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 2014-2019 by Sonic Team Junior.
|
||||
// Copyright (C) 2014-2020 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1993-1996 by id Software, Inc.
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2019 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2020 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
@ -1120,6 +1120,9 @@ static const char *credits[] = {
|
|||
"\1Sonic Robo Blast II",
|
||||
"\1Credits",
|
||||
"",
|
||||
"\1Producer",
|
||||
"Rob Tisdell",
|
||||
"",
|
||||
"\1Game Design",
|
||||
"Ben \"Mystic\" Geyer",
|
||||
"\"SSNTails\"",
|
||||
|
@ -1234,7 +1237,7 @@ static const char *credits[] = {
|
|||
"Thomas \"Shadow Hog\" Igoe",
|
||||
"Alexander \"DrTapeworm\" Moench-Ford",
|
||||
"\"Kaito Sinclaire\"",
|
||||
"\"QueenDelta\"",
|
||||
"Anna \"QueenDelta\" Sandlin",
|
||||
"Wessel \"sphere\" Smit",
|
||||
"\"Spazzo\"",
|
||||
"\"SSNTails\"",
|
||||
|
@ -1258,7 +1261,7 @@ static const char *credits[] = {
|
|||
"Cody \"SRB2 Playah\" Koester",
|
||||
"Skye \"OmegaVelocity\" Meredith",
|
||||
"Stephen \"HEDGESMFG\" Moellering",
|
||||
"Nick \"ST218\" Molina",
|
||||
"Rosalie \"ST218\" Molina",
|
||||
"Samuel \"Prime 2.0\" Peters",
|
||||
"Colin \"Sonict\" Pfaff",
|
||||
"Bill \"Tets\" Reed",
|
||||
|
@ -2695,8 +2698,18 @@ static void F_FigureActiveTtScale(void)
|
|||
SINT8 newttscale = max(1, min(6, vid.dupx));
|
||||
SINT8 oldttscale = activettscale;
|
||||
|
||||
if (newttscale == testttscale)
|
||||
return;
|
||||
if (needpatchrecache)
|
||||
ttloaded[0] = ttloaded[1] = ttloaded[2] = ttloaded[3] = ttloaded[4] = ttloaded[5] = 0;
|
||||
else
|
||||
{
|
||||
if (newttscale == testttscale)
|
||||
return;
|
||||
|
||||
// We have a new ttscale, so load gfx
|
||||
if(oldttscale > 0)
|
||||
F_UnloadAlacroixGraphics(oldttscale);
|
||||
}
|
||||
|
||||
testttscale = newttscale;
|
||||
|
||||
// If ttscale is unavailable: look for lower scales, then higher scales.
|
||||
|
@ -2714,10 +2727,6 @@ static void F_FigureActiveTtScale(void)
|
|||
|
||||
activettscale = (newttscale >= 1 && newttscale <= 6) ? newttscale : 0;
|
||||
|
||||
// We have a new ttscale, so load gfx
|
||||
if(oldttscale > 0)
|
||||
F_UnloadAlacroixGraphics(oldttscale);
|
||||
|
||||
if(activettscale > 0)
|
||||
F_LoadAlacroixGraphics(activettscale);
|
||||
}
|
||||
|
@ -2759,12 +2768,6 @@ void F_TitleScreenDrawer(void)
|
|||
return;
|
||||
#endif
|
||||
|
||||
if (needpatchrecache && (curttmode == TTMODE_ALACROIX))
|
||||
{
|
||||
ttloaded[0] = ttloaded[1] = ttloaded[2] = ttloaded[3] = ttloaded[4] = ttloaded[5] = 0;
|
||||
F_LoadAlacroixGraphics(activettscale);
|
||||
}
|
||||
|
||||
switch(curttmode)
|
||||
{
|
||||
case TTMODE_OLD:
|
||||
|
@ -3630,7 +3633,6 @@ void F_StartContinue(void)
|
|||
}
|
||||
|
||||
wipestyleflags = WSF_FADEOUT;
|
||||
F_TryColormapFade(31);
|
||||
G_SetGamestate(GS_CONTINUING);
|
||||
gameaction = ga_nothing;
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1993-1996 by id Software, Inc.
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2019 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2020 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
// Copyright (C) 1993-1996 by id Software, Inc.
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 2013-2016 by Matthew "Kaito Sinclaire" Walsh.
|
||||
// Copyright (C) 1999-2019 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2020 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
@ -192,8 +192,7 @@ void F_WipeStageTitle(void)
|
|||
// draw level title
|
||||
if ((WipeStageTitle && st_overlay)
|
||||
&& (wipestyle == WIPESTYLE_COLORMAP)
|
||||
&& !(mapheaderinfo[gamemap-1]->levelflags & LF_NOTITLECARD)
|
||||
&& *mapheaderinfo[gamemap-1]->lvlttl != '\0')
|
||||
&& G_IsTitleCardAvailable())
|
||||
{
|
||||
ST_runTitleCard();
|
||||
ST_drawWipeTitleCard();
|
||||
|
|
78
src/g_game.c
78
src/g_game.c
|
@ -2,7 +2,7 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1993-1996 by id Software, Inc.
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2019 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2020 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
@ -1928,19 +1928,32 @@ void G_PreLevelTitleCard(void)
|
|||
wipestyleflags = WSF_CROSSFADE;
|
||||
}
|
||||
|
||||
static boolean titlecardforreload = false;
|
||||
|
||||
//
|
||||
// Returns true if the current level has a title card.
|
||||
//
|
||||
boolean G_IsTitleCardAvailable(void)
|
||||
{
|
||||
// The current level header explicitly disabled the title card.
|
||||
if (mapheaderinfo[gamemap-1]->levelflags & LF_NOTITLECARD)
|
||||
UINT16 titleflag = LF_NOTITLECARDFIRST;
|
||||
|
||||
if (modeattacking != ATTACKING_NONE)
|
||||
titleflag = LF_NOTITLECARDRECORDATTACK;
|
||||
else if (titlecardforreload)
|
||||
titleflag = LF_NOTITLECARDRESPAWN;
|
||||
|
||||
if (mapheaderinfo[gamemap-1]->levelflags & titleflag)
|
||||
return false;
|
||||
|
||||
// The current gametype doesn't have a title card.
|
||||
if (gametyperules & GTR_NOTITLECARD)
|
||||
return false;
|
||||
|
||||
// The current level has no name.
|
||||
if (!mapheaderinfo[gamemap-1]->lvlttl[0])
|
||||
return false;
|
||||
|
||||
// The title card is available.
|
||||
return true;
|
||||
}
|
||||
|
@ -3020,7 +3033,9 @@ void G_DoReborn(INT32 playernum)
|
|||
#ifdef HAVE_BLUA
|
||||
LUAh_MapChange(gamemap);
|
||||
#endif
|
||||
titlecardforreload = true;
|
||||
G_DoLoadLevel(true);
|
||||
titlecardforreload = false;
|
||||
if (metalrecording)
|
||||
G_BeginMetal();
|
||||
return;
|
||||
|
@ -3199,17 +3214,17 @@ UINT32 gametypedefaultrules[NUMGAMETYPES] =
|
|||
GTR_RACE|GTR_SPAWNENEMIES|GTR_SPAWNINVUL|GTR_ALLOWEXIT,
|
||||
|
||||
// Match
|
||||
GTR_RINGSLINGER|GTR_FIRSTPERSON|GTR_SPECTATORS|GTR_POINTLIMIT|GTR_TIMELIMIT|GTR_POWERSTONES|GTR_DEATHMATCHSTARTS|GTR_SPAWNINVUL|GTR_RESPAWNDELAY|GTR_PITYSHIELD|GTR_DEATHPENALTY,
|
||||
GTR_RINGSLINGER|GTR_FIRSTPERSON|GTR_SPECTATORS|GTR_POINTLIMIT|GTR_TIMELIMIT|GTR_OVERTIME|GTR_POWERSTONES|GTR_DEATHMATCHSTARTS|GTR_SPAWNINVUL|GTR_RESPAWNDELAY|GTR_PITYSHIELD|GTR_DEATHPENALTY,
|
||||
// Team Match
|
||||
GTR_RINGSLINGER|GTR_FIRSTPERSON|GTR_SPECTATORS|GTR_TEAMS|GTR_POINTLIMIT|GTR_TIMELIMIT|GTR_DEATHMATCHSTARTS|GTR_SPAWNINVUL|GTR_RESPAWNDELAY|GTR_PITYSHIELD,
|
||||
GTR_RINGSLINGER|GTR_FIRSTPERSON|GTR_SPECTATORS|GTR_TEAMS|GTR_POINTLIMIT|GTR_TIMELIMIT|GTR_OVERTIME|GTR_DEATHMATCHSTARTS|GTR_SPAWNINVUL|GTR_RESPAWNDELAY|GTR_PITYSHIELD,
|
||||
|
||||
// Tag
|
||||
GTR_RINGSLINGER|GTR_FIRSTPERSON|GTR_TAG|GTR_SPECTATORS|GTR_POINTLIMIT|GTR_TIMELIMIT|GTR_STARTCOUNTDOWN|GTR_BLINDFOLDED|GTR_DEATHMATCHSTARTS|GTR_SPAWNINVUL|GTR_RESPAWNDELAY,
|
||||
GTR_RINGSLINGER|GTR_FIRSTPERSON|GTR_TAG|GTR_SPECTATORS|GTR_POINTLIMIT|GTR_TIMELIMIT|GTR_OVERTIME|GTR_STARTCOUNTDOWN|GTR_BLINDFOLDED|GTR_DEATHMATCHSTARTS|GTR_SPAWNINVUL|GTR_RESPAWNDELAY,
|
||||
// Hide and Seek
|
||||
GTR_RINGSLINGER|GTR_FIRSTPERSON|GTR_TAG|GTR_SPECTATORS|GTR_POINTLIMIT|GTR_TIMELIMIT|GTR_STARTCOUNTDOWN|GTR_BLINDFOLDED|GTR_DEATHMATCHSTARTS|GTR_SPAWNINVUL|GTR_RESPAWNDELAY,
|
||||
GTR_RINGSLINGER|GTR_FIRSTPERSON|GTR_TAG|GTR_SPECTATORS|GTR_POINTLIMIT|GTR_TIMELIMIT|GTR_OVERTIME|GTR_STARTCOUNTDOWN|GTR_BLINDFOLDED|GTR_DEATHMATCHSTARTS|GTR_SPAWNINVUL|GTR_RESPAWNDELAY,
|
||||
|
||||
// CTF
|
||||
GTR_RINGSLINGER|GTR_FIRSTPERSON|GTR_SPECTATORS|GTR_TEAMS|GTR_TEAMFLAGS|GTR_POINTLIMIT|GTR_TIMELIMIT|GTR_POWERSTONES|GTR_DEATHMATCHSTARTS|GTR_SPAWNINVUL|GTR_RESPAWNDELAY|GTR_PITYSHIELD,
|
||||
GTR_RINGSLINGER|GTR_FIRSTPERSON|GTR_SPECTATORS|GTR_TEAMS|GTR_TEAMFLAGS|GTR_POINTLIMIT|GTR_TIMELIMIT|GTR_OVERTIME|GTR_POWERSTONES|GTR_DEATHMATCHSTARTS|GTR_SPAWNINVUL|GTR_RESPAWNDELAY|GTR_PITYSHIELD,
|
||||
};
|
||||
|
||||
//
|
||||
|
@ -3252,8 +3267,8 @@ void G_AddGametypeConstant(INT16 gtype, const char *newgtconst)
|
|||
{
|
||||
size_t r = 0; // read
|
||||
size_t w = 0; // write
|
||||
char *gtconst = Z_Calloc(strlen(newgtconst) + 3, PU_STATIC, NULL);
|
||||
char *tmpconst = Z_Calloc(strlen(newgtconst), PU_STATIC, NULL);
|
||||
char *gtconst = Z_Calloc(strlen(newgtconst) + 4, PU_STATIC, NULL);
|
||||
char *tmpconst = Z_Calloc(strlen(newgtconst) + 1, PU_STATIC, NULL);
|
||||
|
||||
// Copy the gametype name.
|
||||
strcpy(tmpconst, newgtconst);
|
||||
|
@ -3380,6 +3395,36 @@ UINT32 gametypetol[NUMGAMETYPES] =
|
|||
TOL_CTF, // CTF
|
||||
};
|
||||
|
||||
tolinfo_t TYPEOFLEVEL[NUMTOLNAMES] = {
|
||||
{"SOLO",TOL_SP},
|
||||
{"SP",TOL_SP},
|
||||
{"SINGLEPLAYER",TOL_SP},
|
||||
{"SINGLE",TOL_SP},
|
||||
|
||||
{"COOP",TOL_COOP},
|
||||
{"CO-OP",TOL_COOP},
|
||||
|
||||
{"COMPETITION",TOL_COMPETITION},
|
||||
{"RACE",TOL_RACE},
|
||||
|
||||
{"MATCH",TOL_MATCH},
|
||||
{"TAG",TOL_TAG},
|
||||
{"CTF",TOL_CTF},
|
||||
|
||||
{"2D",TOL_2D},
|
||||
{"MARIO",TOL_MARIO},
|
||||
{"NIGHTS",TOL_NIGHTS},
|
||||
{"OLDBRAK",TOL_ERZ3},
|
||||
|
||||
{"XMAS",TOL_XMAS},
|
||||
{"CHRISTMAS",TOL_XMAS},
|
||||
{"WINTER",TOL_XMAS},
|
||||
|
||||
{NULL, 0}
|
||||
};
|
||||
|
||||
UINT32 lastcustomtol = (TOL_XMAS<<1);
|
||||
|
||||
//
|
||||
// G_AddTOL
|
||||
//
|
||||
|
@ -3387,16 +3432,16 @@ UINT32 gametypetol[NUMGAMETYPES] =
|
|||
//
|
||||
void G_AddTOL(UINT32 newtol, const char *tolname)
|
||||
{
|
||||
TYPEOFLEVEL[numtolinfo].name = Z_StrDup(tolname);
|
||||
TYPEOFLEVEL[numtolinfo].flag = newtol;
|
||||
numtolinfo++;
|
||||
INT32 i;
|
||||
for (i = 0; TYPEOFLEVEL[i].name; i++)
|
||||
;
|
||||
|
||||
TYPEOFLEVEL[numtolinfo].name = NULL;
|
||||
TYPEOFLEVEL[numtolinfo].flag = 0;
|
||||
TYPEOFLEVEL[i].name = Z_StrDup(tolname);
|
||||
TYPEOFLEVEL[i].flag = newtol;
|
||||
}
|
||||
|
||||
//
|
||||
// G_AddTOL
|
||||
// G_AddGametypeTOL
|
||||
//
|
||||
// Assigns a type of level to a gametype.
|
||||
//
|
||||
|
@ -3735,7 +3780,10 @@ static void G_DoCompleted(void)
|
|||
}
|
||||
|
||||
if (i == 7)
|
||||
{
|
||||
gottoken = false;
|
||||
token = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (spec && !gottoken)
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1993-1996 by id Software, Inc.
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2019 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2020 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2019 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2020 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
@ -662,7 +662,13 @@ INT32 G_KeyStringtoNum(const char *keystr)
|
|||
return keystr[0];
|
||||
|
||||
if (!strncmp(keystr, "KEY", 3) && keystr[3] >= '0' && keystr[3] <= '9')
|
||||
return atoi(&keystr[3]);
|
||||
{
|
||||
/* what if we out of range bruh? */
|
||||
j = atoi(&keystr[3]);
|
||||
if (j < NUMINPUTS)
|
||||
return j;
|
||||
return 0;
|
||||
}
|
||||
|
||||
for (j = 0; j < NUMKEYNAMES; j++)
|
||||
if (!stricmp(keynames[j].name, keystr))
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2019 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2020 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2019 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2020 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -48,7 +48,6 @@ struct GLMipmap_s
|
|||
|
||||
struct GLMipmap_s *nextcolormap;
|
||||
const UINT8 *colormap;
|
||||
INT32 tcindex;
|
||||
|
||||
// opengl
|
||||
struct GLMipmap_s *nextmipmap; // opengl : liste of all texture in opengl driver
|
||||
|
|
|
@ -509,6 +509,7 @@ light_t *t_lspr[NUMSPRITES] =
|
|||
&lspr[NOLIGHT], // SPR_LCKN
|
||||
&lspr[NOLIGHT], // SPR_TTAG
|
||||
&lspr[NOLIGHT], // SPR_GFLG
|
||||
&lspr[NOLIGHT], // SPR_FNSF
|
||||
|
||||
&lspr[NOLIGHT], // SPR_CORK
|
||||
&lspr[NOLIGHT], // SPR_LHRT
|
||||
|
|
|
@ -5022,12 +5022,7 @@ void HWR_AddTransparentFloor(levelflat_t *levelflat, extrasubsector_t *xsub, boo
|
|||
|
||||
planeinfo[numplanes].isceiling = isceiling;
|
||||
planeinfo[numplanes].fixedheight = fixedheight;
|
||||
|
||||
if (planecolormap && (planecolormap->fog & 1))
|
||||
planeinfo[numplanes].lightlevel = lightlevel;
|
||||
else
|
||||
planeinfo[numplanes].lightlevel = 255;
|
||||
|
||||
planeinfo[numplanes].lightlevel = (planecolormap && (planecolormap->flags & CMF_FOG)) ? lightlevel : 255;
|
||||
planeinfo[numplanes].levelflat = levelflat;
|
||||
planeinfo[numplanes].xsub = xsub;
|
||||
planeinfo[numplanes].alpha = alpha;
|
||||
|
@ -5059,12 +5054,7 @@ void HWR_AddTransparentPolyobjectFloor(levelflat_t *levelflat, polyobj_t *polyse
|
|||
|
||||
polyplaneinfo[numpolyplanes].isceiling = isceiling;
|
||||
polyplaneinfo[numpolyplanes].fixedheight = fixedheight;
|
||||
|
||||
if (planecolormap && (planecolormap->fog & 1))
|
||||
polyplaneinfo[numpolyplanes].lightlevel = lightlevel;
|
||||
else
|
||||
polyplaneinfo[numpolyplanes].lightlevel = 255;
|
||||
|
||||
polyplaneinfo[numpolyplanes].lightlevel = (planecolormap && (planecolormap->flags & CMF_FOG)) ? lightlevel : 255;
|
||||
polyplaneinfo[numpolyplanes].levelflat = levelflat;
|
||||
polyplaneinfo[numpolyplanes].polysector = polysector;
|
||||
polyplaneinfo[numpolyplanes].alpha = alpha;
|
||||
|
@ -5325,7 +5315,7 @@ static void HWR_AddSprites(sector_t *sec)
|
|||
#ifdef HWPRECIP
|
||||
precipmobj_t *precipthing;
|
||||
#endif
|
||||
fixed_t approx_dist, limit_dist, hoop_limit_dist;
|
||||
fixed_t limit_dist, hoop_limit_dist;
|
||||
|
||||
// BSP is traversed by subsector.
|
||||
// A sector might have been split into several
|
||||
|
@ -5344,35 +5334,10 @@ static void HWR_AddSprites(sector_t *sec)
|
|||
// If a limit exists, handle things a tiny bit different.
|
||||
limit_dist = (fixed_t)(cv_drawdist.value) << FRACBITS;
|
||||
hoop_limit_dist = (fixed_t)(cv_drawdist_nights.value) << FRACBITS;
|
||||
if (limit_dist || hoop_limit_dist)
|
||||
for (thing = sec->thinglist; thing; thing = thing->snext)
|
||||
{
|
||||
for (thing = sec->thinglist; thing; thing = thing->snext)
|
||||
{
|
||||
if (thing->sprite == SPR_NULL || thing->flags2 & MF2_DONTDRAW)
|
||||
continue;
|
||||
|
||||
approx_dist = P_AproxDistance(viewx-thing->x, viewy-thing->y);
|
||||
|
||||
if (thing->sprite == SPR_HOOP)
|
||||
{
|
||||
if (hoop_limit_dist && approx_dist > hoop_limit_dist)
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (limit_dist && approx_dist > limit_dist)
|
||||
continue;
|
||||
}
|
||||
|
||||
if (R_ThingVisibleWithinDist(thing, limit_dist, hoop_limit_dist))
|
||||
HWR_ProjectSprite(thing);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Draw everything in sector, no checks
|
||||
for (thing = sec->thinglist; thing; thing = thing->snext)
|
||||
if (!(thing->sprite == SPR_NULL || thing->flags2 & MF2_DONTDRAW))
|
||||
HWR_ProjectSprite(thing);
|
||||
}
|
||||
|
||||
#ifdef HWPRECIP
|
||||
|
@ -5381,15 +5346,8 @@ static void HWR_AddSprites(sector_t *sec)
|
|||
{
|
||||
for (precipthing = sec->preciplist; precipthing; precipthing = precipthing->snext)
|
||||
{
|
||||
if (precipthing->precipflags & PCF_INVISIBLE)
|
||||
continue;
|
||||
|
||||
approx_dist = P_AproxDistance(viewx-precipthing->x, viewy-precipthing->y);
|
||||
|
||||
if (approx_dist > limit_dist)
|
||||
continue;
|
||||
|
||||
HWR_ProjectPrecipitationSprite(precipthing);
|
||||
if (R_PrecipThingVisible(precipthing, limit_dist))
|
||||
HWR_ProjectPrecipitationSprite(precipthing);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
@ -5643,7 +5601,7 @@ static void HWR_ProjectSprite(mobj_t *thing)
|
|||
if ((thing->flags2 & MF2_LINKDRAW) && thing->tracer)
|
||||
{
|
||||
// bodge support - not nearly as comprehensive as r_things.c, but better than nothing
|
||||
if (thing->tracer->sprite == SPR_NULL || thing->tracer->flags2 & MF2_DONTDRAW)
|
||||
if (! R_ThingVisible(thing->tracer))
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -5851,6 +5809,12 @@ static void HWR_DrawSkyBackground(player_t *player)
|
|||
dometransform.scalez = 1;
|
||||
dometransform.fovxangle = fpov; // Tails
|
||||
dometransform.fovyangle = fpov; // Tails
|
||||
if (player->viewrollangle != 0)
|
||||
{
|
||||
fixed_t rol = AngleFixed(player->viewrollangle);
|
||||
dometransform.rollangle = FIXED_TO_FLOAT(rol);
|
||||
dometransform.roll = true;
|
||||
}
|
||||
dometransform.splitscreen = splitscreen;
|
||||
|
||||
HWR_GetTexture(texturetranslation[skytexture]);
|
||||
|
@ -6074,6 +6038,12 @@ void HWR_RenderSkyboxView(INT32 viewnumber, player_t *player)
|
|||
atransform.scalez = 1;
|
||||
atransform.fovxangle = fpov; // Tails
|
||||
atransform.fovyangle = fpov; // Tails
|
||||
if (player->viewrollangle != 0)
|
||||
{
|
||||
fixed_t rol = AngleFixed(player->viewrollangle);
|
||||
atransform.rollangle = FIXED_TO_FLOAT(rol);
|
||||
atransform.roll = true;
|
||||
}
|
||||
atransform.splitscreen = splitscreen;
|
||||
|
||||
gr_fovlud = (float)(1.0l/tan((double)(fpov*M_PIl/360l)));
|
||||
|
@ -6294,6 +6264,12 @@ void HWR_RenderPlayerView(INT32 viewnumber, player_t *player)
|
|||
atransform.scalez = 1;
|
||||
atransform.fovxangle = fpov; // Tails
|
||||
atransform.fovyangle = fpov; // Tails
|
||||
if (player->viewrollangle != 0)
|
||||
{
|
||||
fixed_t rol = AngleFixed(player->viewrollangle);
|
||||
atransform.rollangle = FIXED_TO_FLOAT(rol);
|
||||
atransform.roll = true;
|
||||
}
|
||||
atransform.splitscreen = splitscreen;
|
||||
|
||||
gr_fovlud = (float)(1.0l/tan((double)(fpov*M_PIl/360l)));
|
||||
|
|
|
@ -476,8 +476,9 @@ void HWR_InitModels(void)
|
|||
size_t i;
|
||||
INT32 s;
|
||||
FILE *f;
|
||||
char name[18], filename[32];
|
||||
char name[24], filename[32];
|
||||
float scale, offset;
|
||||
size_t prefixlen;
|
||||
|
||||
CONS_Printf("HWR_InitModels()...\n");
|
||||
for (s = 0; s < MAXSKINS; s++)
|
||||
|
@ -509,46 +510,54 @@ void HWR_InitModels(void)
|
|||
nomd2s = true;
|
||||
return;
|
||||
}
|
||||
while (fscanf(f, "%19s %31s %f %f", name, filename, &scale, &offset) == 4)
|
||||
|
||||
// length of the player model prefix
|
||||
prefixlen = strlen(PLAYERMODELPREFIX);
|
||||
|
||||
while (fscanf(f, "%25s %31s %f %f", name, filename, &scale, &offset) == 4)
|
||||
{
|
||||
if (stricmp(name, "PLAY") == 0)
|
||||
char *skinname = name;
|
||||
size_t len = strlen(name);
|
||||
|
||||
// check for the player model prefix.
|
||||
if (!strnicmp(name, PLAYERMODELPREFIX, prefixlen) && (len > prefixlen))
|
||||
{
|
||||
CONS_Printf("Model for sprite PLAY detected in models.dat, use a player skin instead!\n");
|
||||
continue;
|
||||
skinname += prefixlen;
|
||||
goto addskinmodel;
|
||||
}
|
||||
|
||||
for (i = 0; i < NUMSPRITES; i++)
|
||||
// add sprite model
|
||||
if (len == 4) // must be 4 characters long exactly. otherwise it's not a sprite name.
|
||||
{
|
||||
if (stricmp(name, sprnames[i]) == 0)
|
||||
for (i = 0; i < NUMSPRITES; i++)
|
||||
{
|
||||
//if (stricmp(name, "PLAY") == 0)
|
||||
//continue;
|
||||
|
||||
//CONS_Debug(DBG_RENDER, " Found: %s %s %f %f\n", name, filename, scale, offset);
|
||||
md2_models[i].scale = scale;
|
||||
md2_models[i].offset = offset;
|
||||
md2_models[i].notfound = false;
|
||||
strcpy(md2_models[i].filename, filename);
|
||||
goto md2found;
|
||||
if (stricmp(name, sprnames[i]) == 0)
|
||||
{
|
||||
md2_models[i].scale = scale;
|
||||
md2_models[i].offset = offset;
|
||||
md2_models[i].notfound = false;
|
||||
strcpy(md2_models[i].filename, filename);
|
||||
goto modelfound;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
addskinmodel:
|
||||
// add player model
|
||||
for (s = 0; s < MAXSKINS; s++)
|
||||
{
|
||||
if (stricmp(name, skins[s].name) == 0)
|
||||
if (stricmp(skinname, skins[s].name) == 0)
|
||||
{
|
||||
//CONS_Printf(" Found: %s %s %f %f\n", name, filename, scale, offset);
|
||||
md2_playermodels[s].skin = s;
|
||||
md2_playermodels[s].scale = scale;
|
||||
md2_playermodels[s].offset = offset;
|
||||
md2_playermodels[s].notfound = false;
|
||||
strcpy(md2_playermodels[s].filename, filename);
|
||||
goto md2found;
|
||||
goto modelfound;
|
||||
}
|
||||
}
|
||||
// no sprite/player skin name found?!?
|
||||
//CONS_Printf("Unknown sprite/player skin %s detected in models.dat\n", name);
|
||||
md2found:
|
||||
|
||||
modelfound:
|
||||
// move on to next line...
|
||||
continue;
|
||||
}
|
||||
|
@ -558,8 +567,9 @@ md2found:
|
|||
void HWR_AddPlayerModel(int skin) // For skins that were added after startup
|
||||
{
|
||||
FILE *f;
|
||||
char name[18], filename[32];
|
||||
char name[24], filename[32];
|
||||
float scale, offset;
|
||||
size_t prefixlen;
|
||||
|
||||
if (nomd2s)
|
||||
return;
|
||||
|
@ -577,32 +587,42 @@ void HWR_AddPlayerModel(int skin) // For skins that were added after startup
|
|||
return;
|
||||
}
|
||||
|
||||
// Check for any model that match the names of player skins!
|
||||
while (fscanf(f, "%19s %31s %f %f", name, filename, &scale, &offset) == 4)
|
||||
// length of the player model prefix
|
||||
prefixlen = strlen(PLAYERMODELPREFIX);
|
||||
|
||||
// Check for any models that match the names of player skins!
|
||||
while (fscanf(f, "%25s %31s %f %f", name, filename, &scale, &offset) == 4)
|
||||
{
|
||||
if (stricmp(name, skins[skin].name) == 0)
|
||||
char *skinname = name;
|
||||
size_t len = strlen(name);
|
||||
|
||||
// ignore the player model prefix.
|
||||
if (!strnicmp(name, PLAYERMODELPREFIX, prefixlen) && (len > prefixlen))
|
||||
skinname += prefixlen;
|
||||
|
||||
if (stricmp(skinname, skins[skin].name) == 0)
|
||||
{
|
||||
md2_playermodels[skin].skin = skin;
|
||||
md2_playermodels[skin].scale = scale;
|
||||
md2_playermodels[skin].offset = offset;
|
||||
md2_playermodels[skin].notfound = false;
|
||||
strcpy(md2_playermodels[skin].filename, filename);
|
||||
goto playermd2found;
|
||||
goto playermodelfound;
|
||||
}
|
||||
}
|
||||
|
||||
//CONS_Printf("Model for player skin %s not found\n", skins[skin].name);
|
||||
md2_playermodels[skin].notfound = true;
|
||||
playermd2found:
|
||||
playermodelfound:
|
||||
fclose(f);
|
||||
}
|
||||
|
||||
void HWR_AddSpriteModel(size_t spritenum) // For sprites that were added after startup
|
||||
{
|
||||
FILE *f;
|
||||
// name[18] is used to check for names in the models.dat file that match with sprites or player skins
|
||||
// name[24] is used to check for names in the models.dat file that match with sprites or player skins
|
||||
// sprite names are always 4 characters long, and names is for player skins can be up to 19 characters long
|
||||
char name[18], filename[32];
|
||||
// PLAYERMODELPREFIX is 6 characters long
|
||||
char name[24], filename[32];
|
||||
float scale, offset;
|
||||
|
||||
if (nomd2s)
|
||||
|
@ -622,22 +642,30 @@ void HWR_AddSpriteModel(size_t spritenum) // For sprites that were added after s
|
|||
return;
|
||||
}
|
||||
|
||||
// Check for any MD2s that match the names of sprite names!
|
||||
while (fscanf(f, "%19s %31s %f %f", name, filename, &scale, &offset) == 4)
|
||||
// Check for any models that match the names of sprite names!
|
||||
while (fscanf(f, "%25s %31s %f %f", name, filename, &scale, &offset) == 4)
|
||||
{
|
||||
// length of the sprite name
|
||||
size_t len = strlen(name);
|
||||
if (len != 4) // must be 4 characters long exactly. otherwise it's not a sprite name.
|
||||
continue;
|
||||
|
||||
// check for the player model prefix.
|
||||
if (!strnicmp(name, PLAYERMODELPREFIX, strlen(PLAYERMODELPREFIX)))
|
||||
continue; // that's not a sprite...
|
||||
|
||||
if (stricmp(name, sprnames[spritenum]) == 0)
|
||||
{
|
||||
md2_models[spritenum].scale = scale;
|
||||
md2_models[spritenum].offset = offset;
|
||||
md2_models[spritenum].notfound = false;
|
||||
strcpy(md2_models[spritenum].filename, filename);
|
||||
goto spritemd2found;
|
||||
goto spritemodelfound;
|
||||
}
|
||||
}
|
||||
|
||||
//CONS_Printf("MD2 for sprite %s not found\n", sprnames[spritenum]);
|
||||
md2_models[spritenum].notfound = true;
|
||||
spritemd2found:
|
||||
spritemodelfound:
|
||||
fclose(f);
|
||||
}
|
||||
|
||||
|
@ -1020,32 +1048,13 @@ static void HWR_GetBlendedTexture(GLPatch_t *gpatch, GLPatch_t *blendgpatch, INT
|
|||
// mostly copied from HWR_GetMappedPatch, hence the similarities and comment
|
||||
GLMipmap_t *grmip, *newmip;
|
||||
|
||||
if ((colormap == colormaps || colormap == NULL) && (skinnum > TC_DEFAULT))
|
||||
if (colormap == colormaps || colormap == NULL)
|
||||
{
|
||||
// Don't do any blending
|
||||
HWD.pfnSetTexture(gpatch->mipmap);
|
||||
return;
|
||||
}
|
||||
|
||||
// search for the mipmap
|
||||
// skip the first (no colormap translated)
|
||||
for (grmip = gpatch->mipmap; grmip->nextcolormap; )
|
||||
{
|
||||
grmip = grmip->nextcolormap;
|
||||
if (grmip->colormap == colormap || (skinnum < TC_DEFAULT && grmip->tcindex == skinnum))
|
||||
{
|
||||
if (grmip->downloaded && grmip->grInfo.data)
|
||||
{
|
||||
HWD.pfnSetTexture(grmip); // found the colormap, set it to the correct texture
|
||||
Z_ChangeTag(grmip->grInfo.data, PU_HWRMODELTEXTURE);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// If here, the blended texture has not been created
|
||||
// So we create it
|
||||
|
||||
if ((blendgpatch && blendgpatch->mipmap->grInfo.format)
|
||||
&& (gpatch->width != blendgpatch->width || gpatch->height != blendgpatch->height))
|
||||
{
|
||||
|
@ -1054,21 +1063,39 @@ static void HWR_GetBlendedTexture(GLPatch_t *gpatch, GLPatch_t *blendgpatch, INT
|
|||
return;
|
||||
}
|
||||
|
||||
// search for the mipmap
|
||||
// skip the first (no colormap translated)
|
||||
for (grmip = gpatch->mipmap; grmip->nextcolormap; )
|
||||
{
|
||||
grmip = grmip->nextcolormap;
|
||||
if (grmip->colormap == colormap)
|
||||
{
|
||||
if (grmip->downloaded && grmip->grInfo.data)
|
||||
{
|
||||
HWD.pfnSetTexture(grmip); // found the colormap, set it to the correct texture
|
||||
Z_ChangeTag(grmip->grInfo.data, PU_HWRMODELTEXTURE_UNLOCKED);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// If here, the blended texture has not been created
|
||||
// So we create it
|
||||
|
||||
//BP: WARNING: don't free it manually without clearing the cache of harware renderer
|
||||
// (it have a liste of mipmap)
|
||||
// this malloc is cleared in HWR_FreeTextureCache
|
||||
// (...) unfortunately z_malloc fragment alot the memory :(so malloc is better
|
||||
newmip = calloc(1, sizeof (*newmip));
|
||||
if (newmip == NULL)
|
||||
I_Error("%s: Out of memory", "HWR_GetMappedPatch");
|
||||
I_Error("%s: Out of memory", "HWR_GetBlendedTexture");
|
||||
grmip->nextcolormap = newmip;
|
||||
newmip->colormap = colormap;
|
||||
newmip->tcindex = skinnum;
|
||||
|
||||
HWR_CreateBlendedTexture(gpatch, blendgpatch, newmip, skinnum, color);
|
||||
|
||||
HWD.pfnSetTexture(newmip);
|
||||
Z_ChangeTag(newmip->grInfo.data, PU_HWRMODELTEXTURE);
|
||||
Z_ChangeTag(newmip->grInfo.data, PU_HWRMODELTEXTURE_UNLOCKED);
|
||||
}
|
||||
|
||||
#define NORMALFOG 0x00000000
|
||||
|
@ -1298,7 +1325,7 @@ boolean HWR_DrawModel(gr_vissprite_t *spr)
|
|||
|
||||
if (gpatch && gpatch->mipmap->grInfo.format) // else if meant that if a texture couldn't be loaded, it would just end up using something else's texture
|
||||
{
|
||||
INT32 skinnum = INT32_MAX;
|
||||
INT32 skinnum = TC_DEFAULT;
|
||||
|
||||
if ((spr->mobj->flags & (MF_ENEMY|MF_BOSS)) && (spr->mobj->flags2 & MF2_FRET) && !(spr->mobj->flags & MF_GRENADEBOUNCE) && (leveltime & 1)) // Bosses "flash"
|
||||
{
|
||||
|
@ -1329,15 +1356,7 @@ boolean HWR_DrawModel(gr_vissprite_t *spr)
|
|||
}
|
||||
|
||||
// Translation or skin number found
|
||||
if (skinnum != INT32_MAX)
|
||||
{
|
||||
HWR_GetBlendedTexture(gpatch, (GLPatch_t *)md2->blendgrpatch, skinnum, spr->colormap, (skincolors_t)spr->mobj->color);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Sorry nothing
|
||||
HWD.pfnSetTexture(gpatch->mipmap);
|
||||
}
|
||||
HWR_GetBlendedTexture(gpatch, (GLPatch_t *)md2->blendgrpatch, skinnum, spr->colormap, (skincolors_t)spr->mobj->color);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -49,4 +49,6 @@ void HWR_AddPlayerModel(INT32 skin);
|
|||
void HWR_AddSpriteModel(size_t spritenum);
|
||||
boolean HWR_DrawModel(gr_vissprite_t *spr);
|
||||
|
||||
#define PLAYERMODELPREFIX "PLAYER"
|
||||
|
||||
#endif // _HW_MD2_H_
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// Emacs style mode select -*- C++ -*-
|
||||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// Copyright (C) 1998-2019 by Sonic Team Junior.
|
||||
// Copyright (C) 1998-2020 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
|
@ -2238,6 +2238,8 @@ EXPORT void HWRAPI(SetTransform) (FTransform *stransform)
|
|||
else
|
||||
pglScalef(stransform->scalex, stransform->scaley, -stransform->scalez);
|
||||
|
||||
if (stransform->roll)
|
||||
pglRotatef(stransform->rollangle, 0.0f, 0.0f, 1.0f);
|
||||
pglRotatef(stransform->anglex , 1.0f, 0.0f, 0.0f);
|
||||
pglRotatef(stransform->angley+270.0f, 0.0f, 1.0f, 0.0f);
|
||||
pglTranslatef(-stransform->x, -stransform->z, -stransform->y);
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1993-1996 by id Software, Inc.
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2019 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2020 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
@ -787,10 +787,12 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum)
|
|||
case SKINCOLOR_RED:
|
||||
case SKINCOLOR_CRIMSON:
|
||||
case SKINCOLOR_FLAME:
|
||||
case SKINCOLOR_KETCHUP:
|
||||
cstart = "\x85"; // V_REDMAP
|
||||
break;
|
||||
case SKINCOLOR_YOGURT:
|
||||
case SKINCOLOR_BROWN:
|
||||
case SKINCOLOR_BRONZE:
|
||||
case SKINCOLOR_TAN:
|
||||
case SKINCOLOR_BEIGE:
|
||||
case SKINCOLOR_QUAIL:
|
||||
|
@ -818,6 +820,7 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum)
|
|||
cstart = "\x8e"; // V_ROSYMAP
|
||||
break;
|
||||
case SKINCOLOR_SUNSET:
|
||||
case SKINCOLOR_COPPER:
|
||||
case SKINCOLOR_APRICOT:
|
||||
case SKINCOLOR_ORANGE:
|
||||
case SKINCOLOR_RUST:
|
||||
|
@ -831,6 +834,7 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum)
|
|||
break;
|
||||
case SKINCOLOR_LIME:
|
||||
case SKINCOLOR_PERIDOT:
|
||||
case SKINCOLOR_APPLE:
|
||||
cstart = "\x8b"; // V_PERIDOTMAP
|
||||
break;
|
||||
case SKINCOLOR_SEAFOAM:
|
||||
|
@ -851,12 +855,14 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum)
|
|||
case SKINCOLOR_BLUE:
|
||||
case SKINCOLOR_COBALT:
|
||||
case SKINCOLOR_DUSK:
|
||||
case SKINCOLOR_BLUEBELL:
|
||||
cstart = "\x84"; // V_BLUEMAP
|
||||
break;
|
||||
case SKINCOLOR_BUBBLEGUM:
|
||||
case SKINCOLOR_MAGENTA:
|
||||
case SKINCOLOR_NEON:
|
||||
case SKINCOLOR_VIOLET:
|
||||
case SKINCOLOR_RASPBERRY:
|
||||
cstart = "\x81"; // V_MAGENTAMAP
|
||||
break;
|
||||
}
|
||||
|
@ -1437,7 +1443,7 @@ static void HU_drawMiniChat(void)
|
|||
|
||||
for (; i>0; i--)
|
||||
{
|
||||
const char *msg = CHAT_WordWrap(x+2, boxw-(charwidth*2), V_SNAPTOBOTTOM|V_SNAPTOLEFT|V_ALLOWLOWERCASE, chat_mini[i-1]);
|
||||
char *msg = CHAT_WordWrap(x+2, boxw-(charwidth*2), V_SNAPTOBOTTOM|V_SNAPTOLEFT|V_ALLOWLOWERCASE, chat_mini[i-1]);
|
||||
size_t j = 0;
|
||||
INT32 linescount = 0;
|
||||
|
||||
|
@ -1479,6 +1485,9 @@ static void HU_drawMiniChat(void)
|
|||
dy = 0;
|
||||
dx = 0;
|
||||
msglines += linescount+1;
|
||||
|
||||
if (msg)
|
||||
Z_Free(msg);
|
||||
}
|
||||
|
||||
y = chaty - charheight*(msglines+1);
|
||||
|
@ -1501,7 +1510,7 @@ static void HU_drawMiniChat(void)
|
|||
INT32 timer = ((cv_chattime.value*TICRATE)-chat_timers[i]) - cv_chattime.value*TICRATE+9; // see below...
|
||||
INT32 transflag = (timer >= 0 && timer <= 9) ? (timer*V_10TRANS) : 0; // you can make bad jokes out of this one.
|
||||
size_t j = 0;
|
||||
const char *msg = CHAT_WordWrap(x+2, boxw-(charwidth*2), V_SNAPTOBOTTOM|V_SNAPTOLEFT|V_ALLOWLOWERCASE, chat_mini[i]); // get the current message, and word wrap it.
|
||||
char *msg = CHAT_WordWrap(x+2, boxw-(charwidth*2), V_SNAPTOBOTTOM|V_SNAPTOLEFT|V_ALLOWLOWERCASE, chat_mini[i]); // get the current message, and word wrap it.
|
||||
UINT8 *colormap = NULL;
|
||||
|
||||
while(msg[j]) // iterate through msg
|
||||
|
@ -1547,6 +1556,9 @@ static void HU_drawMiniChat(void)
|
|||
}
|
||||
dy += charheight;
|
||||
dx = 0;
|
||||
|
||||
if (msg)
|
||||
Z_Free(msg);
|
||||
}
|
||||
|
||||
// decrement addy and make that shit smooth:
|
||||
|
@ -1598,7 +1610,7 @@ static void HU_drawChatLog(INT32 offset)
|
|||
{
|
||||
INT32 clrflag = 0;
|
||||
INT32 j = 0;
|
||||
const char *msg = CHAT_WordWrap(x+2, boxw-(charwidth*2), V_SNAPTOBOTTOM|V_SNAPTOLEFT|V_ALLOWLOWERCASE, chat_log[i]); // get the current message, and word wrap it.
|
||||
char *msg = CHAT_WordWrap(x+2, boxw-(charwidth*2), V_SNAPTOBOTTOM|V_SNAPTOLEFT|V_ALLOWLOWERCASE, chat_log[i]); // get the current message, and word wrap it.
|
||||
UINT8 *colormap = NULL;
|
||||
while(msg[j]) // iterate through msg
|
||||
{
|
||||
|
@ -1638,6 +1650,9 @@ static void HU_drawChatLog(INT32 offset)
|
|||
}
|
||||
dy += charheight;
|
||||
dx = 0;
|
||||
|
||||
if (msg)
|
||||
Z_Free(msg);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1993-1996 by id Software, Inc.
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2019 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2020 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 2011-2019 by Sonic Team Junior.
|
||||
// Copyright (C) 2011-2020 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 2011-2019 by Sonic Team Junior.
|
||||
// Copyright (C) 2011-2020 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2019 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2020 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1993-1996 by id Software, Inc.
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2019 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2020 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1993-1996 by id Software, Inc.
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2019 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2020 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1993-1996 by id Software, Inc.
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2019 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2020 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2019 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2020 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2019 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2020 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1993-1996 by id Software, Inc.
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2019 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2020 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
56
src/info.c
56
src/info.c
|
@ -2,7 +2,7 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1993-1996 by id Software, Inc.
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2019 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2020 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
@ -407,6 +407,7 @@ char sprnames[NUMSPRITES + 1][5] =
|
|||
"LCKN", // Target
|
||||
"TTAG", // Tag Sign
|
||||
"GFLG", // Got Flag sign
|
||||
"FNSF", // Finish flag
|
||||
|
||||
"CORK",
|
||||
"LHRT",
|
||||
|
@ -762,7 +763,7 @@ state_t states[NUMSTATES] =
|
|||
{SPR_PLAY, SPR2_LIFE, 20, {NULL}, 0, 4, S_NULL}, // S_PLAY_ICON3
|
||||
|
||||
// Level end sign (uses player sprite)
|
||||
{SPR_PLAY, SPR2_SIGN|FF_PAPERSPRITE, -1, {NULL}, 0, 29, S_PLAY_SIGN}, // S_PLAY_SIGN
|
||||
{SPR_PLAY, SPR2_SIGN|FF_PAPERSPRITE, 2, {NULL}, 0, 29, S_PLAY_SIGN}, // S_PLAY_SIGN
|
||||
|
||||
// NiGHTS Player, transforming
|
||||
{SPR_PLAY, SPR2_TRNS|FF_ANIMATE, 7, {NULL}, 0, 4, S_PLAY_NIGHTS_TRANS2}, // S_PLAY_NIGHTS_TRANS1
|
||||
|
@ -2343,12 +2344,13 @@ state_t states[NUMSTATES] =
|
|||
|
||||
// TNT barrel
|
||||
{SPR_BARR, 0, -1, {NULL}, 0, 0, S_NULL}, // S_TNTBARREL_STND1
|
||||
{SPR_BARX, 0|FF_FULLBRIGHT, 3, {A_SetObjectFlags}, MF_NOCLIP|MF_NOGRAVITY|MF_NOBLOCKMAP, 0, S_TNTBARREL_EXPL2}, // S_TNTBARREL_EXPL1
|
||||
{SPR_BARX, 1|FF_FULLBRIGHT, 2, {A_TNTExplode}, MT_TNTDUST, 0, S_TNTBARREL_EXPL3}, // S_TNTBARREL_EXPL2
|
||||
{SPR_BARX, 1|FF_FULLBRIGHT, 1, {NULL}, 0, 0, S_TNTBARREL_EXPL4}, // S_TNTBARREL_EXPL3
|
||||
{SPR_BARX, 2|FF_FULLBRIGHT, 3, {NULL}, 0, 0, S_TNTBARREL_EXPL5}, // S_TNTBARREL_EXPL4
|
||||
{SPR_BARX, 3|FF_FULLBRIGHT, 3, {NULL}, 0, 0, S_TNTBARREL_EXPL6}, // S_TNTBARREL_EXPL5
|
||||
{SPR_NULL, 0, 35, {NULL}, 0, 0, S_NULL}, // S_TNTBARREL_EXPL6
|
||||
{SPR_BARX, 0, 0, {A_RollAngle}, 0, 1, S_TNTBARREL_EXPL2}, // S_TNTBARREL_EXPL1
|
||||
{SPR_BARX, 0|FF_FULLBRIGHT, 3, {A_SetObjectFlags}, MF_NOCLIP|MF_NOGRAVITY|MF_NOBLOCKMAP, 0, S_TNTBARREL_EXPL3}, // S_TNTBARREL_EXPL2
|
||||
{SPR_BARX, 1|FF_FULLBRIGHT, 2, {A_TNTExplode}, MT_TNTDUST, 0, S_TNTBARREL_EXPL4}, // S_TNTBARREL_EXPL3
|
||||
{SPR_BARX, 1|FF_FULLBRIGHT, 1, {NULL}, 0, 0, S_TNTBARREL_EXPL5}, // S_TNTBARREL_EXPL4
|
||||
{SPR_BARX, 2|FF_FULLBRIGHT, 3, {NULL}, 0, 0, S_TNTBARREL_EXPL6}, // S_TNTBARREL_EXPL5
|
||||
{SPR_BARX, 3|FF_FULLBRIGHT, 3, {NULL}, 0, 0, S_TNTBARREL_EXPL7}, // S_TNTBARREL_EXPL6
|
||||
{SPR_NULL, 0, 35, {NULL}, 0, 0, S_NULL}, // S_TNTBARREL_EXPL7
|
||||
#ifndef ROTSPRITE
|
||||
{SPR_BARR, 1|FF_ANIMATE, -1, {NULL}, 7, 2, S_NULL}, // S_TNTBARREL_FLYING
|
||||
#else
|
||||
|
@ -2394,7 +2396,7 @@ state_t states[NUMSTATES] =
|
|||
|
||||
// Minecart
|
||||
{SPR_NULL, 0, 1, {NULL}, 0, 0, S_MINECART_IDLE}, // S_MINECART_IDLE
|
||||
{SPR_NULL, 0, 0, {A_KillSegments}, 0, 0, S_TNTBARREL_EXPL3}, // S_MINECART_DTH1
|
||||
{SPR_NULL, 0, 0, {A_KillSegments}, 0, 0, S_TNTBARREL_EXPL4}, // S_MINECART_DTH1
|
||||
{SPR_MCRT, 8|FF_PAPERSPRITE, -1, {NULL}, 0, 0, S_NULL}, // S_MINECARTEND
|
||||
{SPR_MCRT, 0|FF_PAPERSPRITE, -1, {NULL}, 0, 0, S_NULL}, // S_MINECARTSEG_FRONT
|
||||
{SPR_MCRT, 1|FF_PAPERSPRITE, -1, {NULL}, 0, 0, S_NULL}, // S_MINECARTSEG_BACK
|
||||
|
@ -3348,7 +3350,10 @@ state_t states[NUMSTATES] =
|
|||
{SPR_TTAG, FF_FULLBRIGHT, 2, {NULL}, 0, 0, S_NULL}, // S_TTAG
|
||||
|
||||
// CTF Sign
|
||||
{SPR_GFLG, FF_FULLBRIGHT, 2, {NULL}, 0, 0, S_NULL}, // S_GOTFLAG
|
||||
{SPR_GFLG, FF_FULLBRIGHT, 2, {NULL}, 0, 0, S_NULL}, // S_GOTFLAG
|
||||
|
||||
// Finish flag
|
||||
{SPR_FNSF, FF_TRANS30, -1, {NULL}, 0, 0, S_NULL}, // S_FINISHFLAG
|
||||
|
||||
{SPR_CORK, 0, -1, {NULL}, 0, 0, S_NULL}, // S_CORK
|
||||
{SPR_LHRT, FF_FULLBRIGHT, -1, {NULL}, 0, 0, S_NULL}, // S_LHRT
|
||||
|
@ -6487,10 +6492,10 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
|||
24*FRACUNIT, // radius
|
||||
24*FRACUNIT, // height
|
||||
0, // display offset
|
||||
0, // mass
|
||||
DMG_FIRE, // mass
|
||||
1, // damage
|
||||
sfx_None, // activesound
|
||||
MF_NOBLOCKMAP|MF_MISSILE|MF_NOGRAVITY, // flags
|
||||
MF_NOBLOCKMAP|MF_MISSILE|MF_PAIN|MF_NOGRAVITY, // flags
|
||||
S_NULL // raisestate
|
||||
},
|
||||
|
||||
|
@ -17994,6 +17999,33 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
|||
MF_NOBLOCKMAP|MF_NOCLIP|MF_NOGRAVITY|MF_SCENERY, // flags
|
||||
S_NULL // raisestate
|
||||
},
|
||||
|
||||
{ // MT_FINISHFLAG
|
||||
-1, // doomednum
|
||||
S_FINISHFLAG, // spawnstate
|
||||
1000, // spawnhealth
|
||||
S_NULL, // seestate
|
||||
sfx_None, // seesound
|
||||
8, // reactiontime
|
||||
sfx_None, // attacksound
|
||||
S_NULL, // painstate
|
||||
0, // painchance
|
||||
sfx_None, // painsound
|
||||
S_NULL, // meleestate
|
||||
S_NULL, // missilestate
|
||||
S_NULL, // deathstate
|
||||
S_NULL, // xdeathstate
|
||||
sfx_None, // deathsound
|
||||
4*FRACUNIT, // speed
|
||||
8*FRACUNIT, // radius
|
||||
8*FRACUNIT, // height
|
||||
1, // display offset
|
||||
16, // mass
|
||||
0, // damage
|
||||
sfx_None, // activesound
|
||||
MF_NOBLOCKMAP|MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_SCENERY, // flags
|
||||
S_NULL // raisestate
|
||||
},
|
||||
|
||||
// ambient water 1a (large)
|
||||
{ // MT_AWATERA
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1993-1996 by id Software, Inc.
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2019 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2020 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
@ -670,6 +670,7 @@ typedef enum sprite
|
|||
SPR_LCKN, // Target
|
||||
SPR_TTAG, // Tag Sign
|
||||
SPR_GFLG, // Got Flag sign
|
||||
SPR_FNSF, // Finish flag
|
||||
|
||||
SPR_CORK,
|
||||
SPR_LHRT,
|
||||
|
@ -2503,6 +2504,7 @@ typedef enum state
|
|||
S_TNTBARREL_EXPL4,
|
||||
S_TNTBARREL_EXPL5,
|
||||
S_TNTBARREL_EXPL6,
|
||||
S_TNTBARREL_EXPL7,
|
||||
S_TNTBARREL_FLYING,
|
||||
|
||||
// TNT proximity shell
|
||||
|
@ -3484,6 +3486,9 @@ typedef enum state
|
|||
|
||||
// Got Flag Sign
|
||||
S_GOTFLAG,
|
||||
|
||||
// Finish flag
|
||||
S_FINISHFLAG,
|
||||
|
||||
S_CORK,
|
||||
S_LHRT,
|
||||
|
@ -4625,6 +4630,7 @@ typedef enum mobj_type
|
|||
MT_LOCKONINF, // In-level Target
|
||||
MT_TAG, // Tag Sign
|
||||
MT_GOTFLAG, // Got Flag sign
|
||||
MT_FINISHFLAG, // Finish flag
|
||||
|
||||
// Ambient Sounds
|
||||
MT_AWATERA, // Ambient Water Sound 1
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2019 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2020 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 2012-2016 by John "JTE" Muniz.
|
||||
// Copyright (C) 2012-2019 by Sonic Team Junior.
|
||||
// Copyright (C) 2012-2020 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
@ -20,6 +20,7 @@
|
|||
#endif
|
||||
#include "z_zone.h"
|
||||
#include "r_main.h"
|
||||
#include "r_draw.h"
|
||||
#include "r_things.h"
|
||||
#include "m_random.h"
|
||||
#include "s_sound.h"
|
||||
|
@ -2313,9 +2314,29 @@ static int lib_rTextureNumForName(lua_State *L)
|
|||
return 1;
|
||||
}
|
||||
|
||||
// R_DRAW
|
||||
////////////
|
||||
static int lib_rGetColorByName(lua_State *L)
|
||||
{
|
||||
const char* colorname = luaL_checkstring(L, 1);
|
||||
//HUDSAFE
|
||||
lua_pushinteger(L, R_GetColorByName(colorname));
|
||||
return 1;
|
||||
}
|
||||
|
||||
// Lua exclusive function, returns the name of a color from the SKINCOLOR_ constant.
|
||||
// SKINCOLOR_GREEN > "Green" for example
|
||||
static int lib_rGetNameByColor(lua_State *L)
|
||||
{
|
||||
UINT8 colornum = (UINT8)luaL_checkinteger(L, 1);
|
||||
if (!colornum || colornum >= MAXSKINCOLORS)
|
||||
return luaL_error(L, "skincolor %d out of range (1 - %d).", colornum, MAXSKINCOLORS-1);
|
||||
lua_pushstring(L, Color_Names[colornum]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
// S_SOUND
|
||||
////////////
|
||||
|
||||
static int lib_sStartSound(lua_State *L)
|
||||
{
|
||||
const void *origin = NULL;
|
||||
|
@ -3153,6 +3174,10 @@ static luaL_Reg lib[] = {
|
|||
{"R_CheckTextureNumForName",lib_rCheckTextureNumForName},
|
||||
{"R_TextureNumForName",lib_rTextureNumForName},
|
||||
|
||||
// r_draw
|
||||
{"R_GetColorByName", lib_rGetColorByName},
|
||||
{"R_GetNameByColor", lib_rGetNameByColor},
|
||||
|
||||
// s_sound
|
||||
{"S_StartSound",lib_sStartSound},
|
||||
{"S_StartSoundAtVolume",lib_sStartSoundAtVolume},
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 2016 by Iestyn "Monster Iestyn" Jealous.
|
||||
// Copyright (C) 2016-2019 by Sonic Team Junior.
|
||||
// Copyright (C) 2016-2020 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 2012-2016 by John "JTE" Muniz.
|
||||
// Copyright (C) 2012-2019 by Sonic Team Junior.
|
||||
// Copyright (C) 2012-2020 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 2012-2016 by John "JTE" Muniz.
|
||||
// Copyright (C) 2012-2019 by Sonic Team Junior.
|
||||
// Copyright (C) 2012-2020 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 2012-2016 by John "JTE" Muniz.
|
||||
// Copyright (C) 2012-2019 by Sonic Team Junior.
|
||||
// Copyright (C) 2012-2020 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
@ -1594,7 +1594,7 @@ boolean LUAh_SeenPlayer(player_t *player, player_t *seenfriend)
|
|||
hook_p hookp;
|
||||
boolean hasSeenPlayer = true;
|
||||
if (!gL || !(hooksAvailable[hook_SeenPlayer/8] & (1<<(hook_SeenPlayer%8))))
|
||||
return 0;
|
||||
return true;
|
||||
|
||||
lua_settop(gL, 0);
|
||||
hud_running = true; // local hook
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 2014-2016 by John "JTE" Muniz.
|
||||
// Copyright (C) 2014-2019 by Sonic Team Junior.
|
||||
// Copyright (C) 2014-2020 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
142
src/lua_hudlib.c
142
src/lua_hudlib.c
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 2014-2016 by John "JTE" Muniz.
|
||||
// Copyright (C) 2014-2019 by Sonic Team Junior.
|
||||
// Copyright (C) 2014-2020 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
@ -119,9 +119,25 @@ enum align {
|
|||
align_center,
|
||||
align_right,
|
||||
align_fixed,
|
||||
align_fixedcenter,
|
||||
align_fixedright,
|
||||
align_small,
|
||||
align_smallfixed,
|
||||
align_smallfixedcenter,
|
||||
align_smallfixedright,
|
||||
align_smallcenter,
|
||||
align_smallright,
|
||||
align_smallthin,
|
||||
align_smallthincenter,
|
||||
align_smallthinright,
|
||||
align_smallthinfixed,
|
||||
align_smallthinfixedcenter,
|
||||
align_smallthinfixedright,
|
||||
align_thin,
|
||||
align_thinfixed,
|
||||
align_thinfixedcenter,
|
||||
align_thinfixedright,
|
||||
align_thincenter,
|
||||
align_thinright
|
||||
};
|
||||
static const char *const align_opt[] = {
|
||||
|
@ -129,9 +145,25 @@ static const char *const align_opt[] = {
|
|||
"center",
|
||||
"right",
|
||||
"fixed",
|
||||
"fixed-center",
|
||||
"fixed-right",
|
||||
"small",
|
||||
"small-fixed",
|
||||
"small-fixed-center",
|
||||
"small-fixed-right",
|
||||
"small-center",
|
||||
"small-right",
|
||||
"small-thin",
|
||||
"small-thin-center",
|
||||
"small-thin-right",
|
||||
"small-thin-fixed",
|
||||
"small-thin-fixed-center",
|
||||
"small-thin-fixed-right",
|
||||
"thin",
|
||||
"thin-fixed",
|
||||
"thin-fixed-center",
|
||||
"thin-fixed-right",
|
||||
"thin-center",
|
||||
"thin-right",
|
||||
NULL};
|
||||
|
||||
|
@ -268,10 +300,14 @@ static int patch_get(lua_State *L)
|
|||
#endif
|
||||
enum patch field = luaL_checkoption(L, 2, NULL, patch_opt);
|
||||
|
||||
// patches are CURRENTLY always valid, expected to be cached with PU_STATIC
|
||||
// this may change in the future, so patch.valid still exists
|
||||
if (!patch)
|
||||
// patches are invalidated when switching renderers
|
||||
if (!patch) {
|
||||
if (field == patch_valid) {
|
||||
lua_pushboolean(L, 0);
|
||||
return 1;
|
||||
}
|
||||
return LUA_ErrInvalid(L, "patch_t");
|
||||
}
|
||||
|
||||
switch (field)
|
||||
{
|
||||
|
@ -424,7 +460,7 @@ static int libd_cachePatch(lua_State *L)
|
|||
return 1;
|
||||
}
|
||||
|
||||
// v.getSpritePatch(sprite, [frame, [angle]])
|
||||
// v.getSpritePatch(sprite, [frame, [angle, [rollangle]]])
|
||||
static int libd_getSpritePatch(lua_State *L)
|
||||
{
|
||||
UINT32 i; // sprite prefix
|
||||
|
@ -475,13 +511,31 @@ static int libd_getSpritePatch(lua_State *L)
|
|||
if (angle >= ((sprframe->rotate & SRF_3DGE) ? 16 : 8)) // out of range?
|
||||
return 0;
|
||||
|
||||
#ifdef ROTSPRITE
|
||||
if (lua_isnumber(L, 4))
|
||||
{
|
||||
// rotsprite?????
|
||||
angle_t rollangle = luaL_checkangle(L, 4);
|
||||
INT32 rot = R_GetRollAngle(rollangle);
|
||||
|
||||
if (rot) {
|
||||
if (!(sprframe->rotsprite.cached & (1<<angle)))
|
||||
R_CacheRotSprite(i, frame, NULL, sprframe, angle, sprframe->flip & (1<<angle));
|
||||
LUA_PushUserdata(L, sprframe->rotsprite.patch[angle][rot], META_PATCH);
|
||||
lua_pushboolean(L, false);
|
||||
lua_pushboolean(L, true);
|
||||
return 3;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// push both the patch and it's "flip" value
|
||||
LUA_PushUserdata(L, W_CachePatchNum(sprframe->lumppat[angle], PU_PATCH), META_PATCH);
|
||||
lua_pushboolean(L, (sprframe->flip & (1<<angle)) != 0);
|
||||
return 2;
|
||||
}
|
||||
|
||||
// v.getSprite2Patch(skin, sprite, [super?,] [frame, [angle]])
|
||||
// v.getSprite2Patch(skin, sprite, [super?,] [frame, [angle, [rollangle]]])
|
||||
static int libd_getSprite2Patch(lua_State *L)
|
||||
{
|
||||
INT32 i; // skin number
|
||||
|
@ -570,6 +624,24 @@ static int libd_getSprite2Patch(lua_State *L)
|
|||
if (angle >= ((sprframe->rotate & SRF_3DGE) ? 16 : 8)) // out of range?
|
||||
return 0;
|
||||
|
||||
#ifdef ROTSPRITE
|
||||
if (lua_isnumber(L, 4))
|
||||
{
|
||||
// rotsprite?????
|
||||
angle_t rollangle = luaL_checkangle(L, 4);
|
||||
INT32 rot = R_GetRollAngle(rollangle);
|
||||
|
||||
if (rot) {
|
||||
if (!(sprframe->rotsprite.cached & (1<<angle)))
|
||||
R_CacheRotSprite(SPR_PLAY, frame, &skins[i].sprinfo[j], sprframe, angle, sprframe->flip & (1<<angle));
|
||||
LUA_PushUserdata(L, sprframe->rotsprite.patch[angle][rot], META_PATCH);
|
||||
lua_pushboolean(L, false);
|
||||
lua_pushboolean(L, true);
|
||||
return 3;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// push both the patch and it's "flip" value
|
||||
LUA_PushUserdata(L, W_CachePatchNum(sprframe->lumppat[angle], PU_PATCH), META_PATCH);
|
||||
lua_pushboolean(L, (sprframe->flip & (1<<angle)) != 0);
|
||||
|
@ -735,20 +807,68 @@ static int libd_drawString(lua_State *L)
|
|||
case align_fixed:
|
||||
V_DrawStringAtFixed(x, y, flags, str);
|
||||
break;
|
||||
case align_fixedcenter:
|
||||
V_DrawCenteredStringAtFixed(x, y, flags, str);
|
||||
break;
|
||||
case align_fixedright:
|
||||
V_DrawRightAlignedStringAtFixed(x, y, flags, str);
|
||||
break;
|
||||
// hu_font, 0.5x scale
|
||||
case align_small:
|
||||
V_DrawSmallString(x, y, flags, str);
|
||||
break;
|
||||
case align_smallfixed:
|
||||
V_DrawSmallStringAtFixed(x, y, flags, str);
|
||||
break;
|
||||
case align_smallfixedcenter:
|
||||
V_DrawCenteredSmallStringAtFixed(x, y, flags, str);
|
||||
break;
|
||||
case align_smallfixedright:
|
||||
V_DrawRightAlignedSmallStringAtFixed(x, y, flags, str);
|
||||
break;
|
||||
case align_smallcenter:
|
||||
V_DrawCenteredSmallString(x, y, flags, str);
|
||||
break;
|
||||
case align_smallright:
|
||||
V_DrawRightAlignedSmallString(x, y, flags, str);
|
||||
break;
|
||||
case align_smallthin:
|
||||
V_DrawSmallThinString(x, y, flags, str);
|
||||
break;
|
||||
case align_smallthincenter:
|
||||
V_DrawCenteredSmallThinString(x, y, flags, str);
|
||||
break;
|
||||
case align_smallthinright:
|
||||
V_DrawRightAlignedSmallThinString(x, y, flags, str);
|
||||
break;
|
||||
case align_smallthinfixed:
|
||||
V_DrawSmallThinStringAtFixed(x, y, flags, str);
|
||||
break;
|
||||
case align_smallthinfixedcenter:
|
||||
V_DrawCenteredSmallThinStringAtFixed(x, y, flags, str);
|
||||
break;
|
||||
case align_smallthinfixedright:
|
||||
V_DrawRightAlignedSmallThinStringAtFixed(x, y, flags, str);
|
||||
break;
|
||||
// tny_font
|
||||
case align_thin:
|
||||
V_DrawThinString(x, y, flags, str);
|
||||
break;
|
||||
case align_thincenter:
|
||||
V_DrawCenteredThinString(x, y, flags, str);
|
||||
break;
|
||||
case align_thinright:
|
||||
V_DrawRightAlignedThinString(x, y, flags, str);
|
||||
break;
|
||||
case align_thinfixed:
|
||||
V_DrawThinStringAtFixed(x, y, flags, str);
|
||||
break;
|
||||
case align_thinfixedcenter:
|
||||
V_DrawCenteredThinStringAtFixed(x, y, flags, str);
|
||||
break;
|
||||
case align_thinfixedright:
|
||||
V_DrawRightAlignedThinStringAtFixed(x, y, flags, str);
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@ -1214,7 +1334,7 @@ void LUAh_GameHUD(player_t *stplayr)
|
|||
|
||||
lua_getfield(gL, LUA_REGISTRYINDEX, "HUD");
|
||||
I_Assert(lua_istable(gL, -1));
|
||||
lua_rawgeti(gL, -1, 2); // HUD[2] = rendering funcs
|
||||
lua_rawgeti(gL, -1, 2+hudhook_game); // HUD[2] = rendering funcs
|
||||
I_Assert(lua_istable(gL, -1));
|
||||
|
||||
lua_rawgeti(gL, -2, 1); // HUD[1] = lib_draw
|
||||
|
@ -1248,7 +1368,7 @@ void LUAh_ScoresHUD(void)
|
|||
|
||||
lua_getfield(gL, LUA_REGISTRYINDEX, "HUD");
|
||||
I_Assert(lua_istable(gL, -1));
|
||||
lua_rawgeti(gL, -1, 3); // HUD[3] = rendering funcs
|
||||
lua_rawgeti(gL, -1, 2+hudhook_scores); // HUD[3] = rendering funcs
|
||||
I_Assert(lua_istable(gL, -1));
|
||||
|
||||
lua_rawgeti(gL, -2, 1); // HUD[1] = lib_draw
|
||||
|
@ -1273,7 +1393,7 @@ void LUAh_TitleHUD(void)
|
|||
|
||||
lua_getfield(gL, LUA_REGISTRYINDEX, "HUD");
|
||||
I_Assert(lua_istable(gL, -1));
|
||||
lua_rawgeti(gL, -1, 4); // HUD[4] = rendering funcs
|
||||
lua_rawgeti(gL, -1, 2+hudhook_title); // HUD[5] = rendering funcs
|
||||
I_Assert(lua_istable(gL, -1));
|
||||
|
||||
lua_rawgeti(gL, -2, 1); // HUD[1] = lib_draw
|
||||
|
@ -1298,7 +1418,7 @@ void LUAh_TitleCardHUD(player_t *stplayr)
|
|||
|
||||
lua_getfield(gL, LUA_REGISTRYINDEX, "HUD");
|
||||
I_Assert(lua_istable(gL, -1));
|
||||
lua_rawgeti(gL, -1, 5); // HUD[5] = rendering funcs
|
||||
lua_rawgeti(gL, -1, 2+hudhook_titlecard); // HUD[6] = rendering funcs
|
||||
I_Assert(lua_istable(gL, -1));
|
||||
|
||||
lua_rawgeti(gL, -2, 1); // HUD[1] = lib_draw
|
||||
|
@ -1332,7 +1452,7 @@ void LUAh_IntermissionHUD(void)
|
|||
|
||||
lua_getfield(gL, LUA_REGISTRYINDEX, "HUD");
|
||||
I_Assert(lua_istable(gL, -1));
|
||||
lua_rawgeti(gL, -1, 4); // HUD[4] = rendering funcs
|
||||
lua_rawgeti(gL, -1, 2+hudhook_intermission); // HUD[4] = rendering funcs
|
||||
I_Assert(lua_istable(gL, -1));
|
||||
|
||||
lua_rawgeti(gL, -2, 1); // HUD[1] = lib_draw
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 2012-2016 by John "JTE" Muniz.
|
||||
// Copyright (C) 2012-2019 by Sonic Team Junior.
|
||||
// Copyright (C) 2012-2020 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 2012-2016 by John "JTE" Muniz.
|
||||
// Copyright (C) 2012-2019 by Sonic Team Junior.
|
||||
// Copyright (C) 2012-2020 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 2012-2016 by John "JTE" Muniz.
|
||||
// Copyright (C) 2012-2019 by Sonic Team Junior.
|
||||
// Copyright (C) 2012-2020 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 2012-2016 by John "JTE" Muniz.
|
||||
// Copyright (C) 2012-2019 by Sonic Team Junior.
|
||||
// Copyright (C) 2012-2020 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 2012-2016 by John "JTE" Muniz.
|
||||
// Copyright (C) 2012-2019 by Sonic Team Junior.
|
||||
// Copyright (C) 2012-2020 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 2012-2016 by John "JTE" Muniz.
|
||||
// Copyright (C) 2012-2019 by Sonic Team Junior.
|
||||
// Copyright (C) 2012-2020 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
@ -97,6 +97,10 @@ static int player_get(lua_State *L)
|
|||
lua_pushboolean(L, true);
|
||||
else if (fastcmp(field,"name"))
|
||||
lua_pushstring(L, player_names[plr-players]);
|
||||
else if (fastcmp(field,"realmo"))
|
||||
LUA_PushUserdata(L, plr->mo, META_MOBJ);
|
||||
// Kept for backward-compatibility
|
||||
// Should be fixed to work like "realmo" later
|
||||
else if (fastcmp(field,"mo"))
|
||||
{
|
||||
if (plr->spectator)
|
||||
|
@ -120,6 +124,8 @@ static int player_get(lua_State *L)
|
|||
lua_pushfixed(L, plr->deltaviewheight);
|
||||
else if (fastcmp(field,"bob"))
|
||||
lua_pushfixed(L, plr->bob);
|
||||
else if (fastcmp(field,"viewrollangle"))
|
||||
lua_pushangle(L, plr->viewrollangle);
|
||||
else if (fastcmp(field,"aiming"))
|
||||
lua_pushangle(L, plr->aiming);
|
||||
else if (fastcmp(field,"drawangle"))
|
||||
|
@ -396,7 +402,7 @@ static int player_set(lua_State *L)
|
|||
if (hud_running)
|
||||
return luaL_error(L, "Do not alter player_t in HUD rendering code!");
|
||||
|
||||
if (fastcmp(field,"mo")) {
|
||||
if (fastcmp(field,"mo") || fastcmp(field,"realmo")) {
|
||||
mobj_t *newmo = *((mobj_t **)luaL_checkudata(L, 3, META_MOBJ));
|
||||
plr->mo->player = NULL; // remove player pointer from old mobj
|
||||
(newmo->player = plr)->mo = newmo; // set player pointer for new mobj, and set new mobj as the player's mobj
|
||||
|
@ -417,6 +423,8 @@ static int player_set(lua_State *L)
|
|||
plr->deltaviewheight = luaL_checkfixed(L, 3);
|
||||
else if (fastcmp(field,"bob"))
|
||||
plr->bob = luaL_checkfixed(L, 3);
|
||||
else if (fastcmp(field,"viewrollangle"))
|
||||
plr->viewrollangle = luaL_checkangle(L, 3);
|
||||
else if (fastcmp(field,"aiming")) {
|
||||
plr->aiming = luaL_checkangle(L, 3);
|
||||
if (plr == &players[consoleplayer])
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 2012-2016 by John "JTE" Muniz.
|
||||
// Copyright (C) 2012-2019 by Sonic Team Junior.
|
||||
// Copyright (C) 2012-2020 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
@ -102,6 +102,9 @@ int LUA_PushGlobals(lua_State *L, const char *word)
|
|||
} else if (fastcmp(word,"circuitmap")) {
|
||||
lua_pushboolean(L, circuitmap);
|
||||
return 1;
|
||||
} else if (fastcmp(word,"stoppedclock")) {
|
||||
lua_pushboolean(L, stoppedclock);
|
||||
return 1;
|
||||
} else if (fastcmp(word,"netgame")) {
|
||||
lua_pushboolean(L, netgame);
|
||||
return 1;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 2012-2016 by John "JTE" Muniz.
|
||||
// Copyright (C) 2012-2019 by Sonic Team Junior.
|
||||
// Copyright (C) 2012-2020 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 2014-2016 by John "JTE" Muniz.
|
||||
// Copyright (C) 2014-2019 by Sonic Team Junior.
|
||||
// Copyright (C) 2014-2020 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 2012-2016 by John "JTE" Muniz.
|
||||
// Copyright (C) 2012-2019 by Sonic Team Junior.
|
||||
// Copyright (C) 2012-2020 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1993-1996 by id Software, Inc.
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2019 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2020 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1993-1996 by id Software, Inc.
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2019 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2020 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
109
src/m_anigif.c
109
src/m_anigif.c
|
@ -2,7 +2,7 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 2013-2016 by Matthew "Kaito Sinclaire" Walsh.
|
||||
// Copyright (C) 2013 by "Ninji".
|
||||
// Copyright (C) 2013-2019 by Sonic Team Junior.
|
||||
// Copyright (C) 2013-2020 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
@ -19,6 +19,7 @@
|
|||
#include "v_video.h"
|
||||
#include "i_video.h"
|
||||
#include "m_misc.h"
|
||||
#include "st_stuff.h" // st_palette
|
||||
|
||||
#ifdef HWRENDER
|
||||
#include "hardware/hw_main.h"
|
||||
|
@ -29,11 +30,17 @@
|
|||
|
||||
consvar_t cv_gif_optimize = {"gif_optimize", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_gif_downscale = {"gif_downscale", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_gif_localcolortable = {"gif_localcolortable", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
#ifdef HAVE_ANIGIF
|
||||
static boolean gif_optimize = false; // So nobody can do something dumb
|
||||
static boolean gif_downscale = false; // like changing cvars mid output
|
||||
static RGBA_t *gif_palette = NULL;
|
||||
|
||||
// Palette handling
|
||||
static boolean gif_localcolortable = false;
|
||||
static boolean gif_colorprofile = false;
|
||||
static RGBA_t *gif_headerpalette = NULL;
|
||||
static RGBA_t *gif_framepalette = NULL;
|
||||
|
||||
static FILE *gif_out = NULL;
|
||||
static INT32 gif_frames = 0;
|
||||
|
@ -393,16 +400,47 @@ const UINT8 gifhead_nsid[19] = {0x21,0xFF,0x0B, // extension block + size
|
|||
0x4E,0x45,0x54,0x53,0x43,0x41,0x50,0x45,0x32,0x2E,0x30, // NETSCAPE2.0
|
||||
0x03,0x01,0xFF,0xFF,0x00}; // sub-block, repetitions
|
||||
|
||||
|
||||
//
|
||||
// GIF_getpalette
|
||||
// determine the palette for the current frame.
|
||||
//
|
||||
static RGBA_t *GIF_getpalette(size_t palnum)
|
||||
{
|
||||
// In hardware mode, always returns the local palette
|
||||
#ifdef HWRENDER
|
||||
if (rendermode == render_opengl)
|
||||
return pLocalPalette;
|
||||
else
|
||||
#endif
|
||||
return (gif_colorprofile ? &pLocalPalette[palnum*256] : &pMasterPalette[palnum*256]);
|
||||
}
|
||||
|
||||
//
|
||||
// GIF_palwrite
|
||||
// writes the gif palette.
|
||||
// used both for the header and local color tables.
|
||||
//
|
||||
static UINT8 *GIF_palwrite(UINT8 *p, RGBA_t *pal)
|
||||
{
|
||||
INT32 i;
|
||||
for (i = 0; i < 256; i++)
|
||||
{
|
||||
WRITEUINT8(p, pal[i].s.red);
|
||||
WRITEUINT8(p, pal[i].s.green);
|
||||
WRITEUINT8(p, pal[i].s.blue);
|
||||
}
|
||||
return p;
|
||||
}
|
||||
|
||||
//
|
||||
// GIF_headwrite
|
||||
// writes the gif header to the currently open output file.
|
||||
// NOTE that this code does not accomodate for palette changes.
|
||||
//
|
||||
static void GIF_headwrite(void)
|
||||
{
|
||||
UINT8 *gifhead = Z_Malloc(800, PU_STATIC, NULL);
|
||||
UINT8 *p = gifhead;
|
||||
INT32 i;
|
||||
UINT16 rwidth, rheight;
|
||||
|
||||
if (!gif_out)
|
||||
|
@ -423,24 +461,17 @@ static void GIF_headwrite(void)
|
|||
rwidth = vid.width;
|
||||
rheight = vid.height;
|
||||
}
|
||||
|
||||
WRITEUINT16(p, rwidth);
|
||||
WRITEUINT16(p, rheight);
|
||||
|
||||
// colors, aspect, etc
|
||||
WRITEUINT8(p, 0xF7);
|
||||
WRITEUINT8(p, 0xF7); // (0xF7 = 1111 0111)
|
||||
WRITEUINT8(p, 0x00);
|
||||
WRITEUINT8(p, 0x00);
|
||||
|
||||
// write color table
|
||||
{
|
||||
RGBA_t *pal = gif_palette;
|
||||
for (i = 0; i < 256; i++)
|
||||
{
|
||||
WRITEUINT8(p, pal[i].s.red);
|
||||
WRITEUINT8(p, pal[i].s.green);
|
||||
WRITEUINT8(p, pal[i].s.blue);
|
||||
}
|
||||
}
|
||||
p = GIF_palwrite(p, gif_headerpalette);
|
||||
|
||||
// write extension block
|
||||
WRITEMEM(p, gifhead_nsid, sizeof(gifhead_nsid));
|
||||
|
@ -468,7 +499,7 @@ static void hwrconvert(void)
|
|||
INT32 x, y;
|
||||
size_t i = 0;
|
||||
|
||||
InitColorLUT(gif_palette);
|
||||
InitColorLUT(gif_framepalette);
|
||||
|
||||
for (y = 0; y < vid.height; y++)
|
||||
{
|
||||
|
@ -494,6 +525,7 @@ static void GIF_framewrite(void)
|
|||
UINT8 *p;
|
||||
UINT8 *movie_screen = screens[2];
|
||||
INT32 blitx, blity, blitw, blith;
|
||||
boolean palchanged;
|
||||
|
||||
if (!gifframe_data)
|
||||
gifframe_data = Z_Malloc(gifframe_size, PU_STATIC, NULL);
|
||||
|
@ -502,8 +534,18 @@ static void GIF_framewrite(void)
|
|||
if (!gif_out)
|
||||
return;
|
||||
|
||||
// Lactozilla: Compare the header's palette with the current frame's palette and see if it changed.
|
||||
if (gif_localcolortable)
|
||||
{
|
||||
gif_framepalette = GIF_getpalette(max(st_palette, 0));
|
||||
palchanged = memcmp(gif_headerpalette, gif_framepalette, sizeof(RGBA_t) * 256);
|
||||
}
|
||||
else
|
||||
palchanged = false;
|
||||
|
||||
// Compare image data (for optimizing GIF)
|
||||
if (gif_optimize && gif_frames > 0)
|
||||
// If the palette has changed, the entire frame is considered to be different.
|
||||
if (gif_optimize && gif_frames > 0 && (!palchanged))
|
||||
{
|
||||
// before blit movie_screen points to last frame, cur_screen points to this frame
|
||||
UINT8 *cur_screen = screens[0];
|
||||
|
@ -566,7 +608,20 @@ static void GIF_framewrite(void)
|
|||
WRITEUINT16(p, (UINT16)(blity / scrbuf_downscaleamt));
|
||||
WRITEUINT16(p, (UINT16)(blitw / scrbuf_downscaleamt));
|
||||
WRITEUINT16(p, (UINT16)(blith / scrbuf_downscaleamt));
|
||||
WRITEUINT8(p, 0); // no local table of colors
|
||||
|
||||
if (!gif_localcolortable)
|
||||
WRITEUINT8(p, 0); // no local table of colors
|
||||
else
|
||||
{
|
||||
if (palchanged)
|
||||
{
|
||||
// The palettes are different, so write the Local Color Table!
|
||||
WRITEUINT8(p, 0x87); // (0x87 = 1000 0111)
|
||||
p = GIF_palwrite(p, gif_framepalette);
|
||||
}
|
||||
else
|
||||
WRITEUINT8(p, 0); // They are equal, no Local Color Table needed.
|
||||
}
|
||||
|
||||
scrbuf_pos = movie_screen + blitx + (blity * vid.width);
|
||||
scrbuf_writeend = scrbuf_pos + (blitw - 1) + ((blith - 1) * vid.width);
|
||||
|
@ -624,29 +679,15 @@ static void GIF_framewrite(void)
|
|||
//
|
||||
INT32 GIF_open(const char *filename)
|
||||
{
|
||||
#if 0
|
||||
if (rendermode != render_soft)
|
||||
{
|
||||
CONS_Alert(CONS_WARNING, M_GetText("GIFs cannot be taken in non-software modes!\n"));
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
gif_out = fopen(filename, "wb");
|
||||
if (!gif_out)
|
||||
return 0;
|
||||
|
||||
gif_optimize = (!!cv_gif_optimize.value);
|
||||
gif_downscale = (!!cv_gif_downscale.value);
|
||||
|
||||
// GIF color table
|
||||
// In hardware mode, uses the master palette
|
||||
gif_palette = ((cv_screenshot_colorprofile.value
|
||||
#ifdef HWRENDER
|
||||
&& (rendermode == render_soft)
|
||||
#endif
|
||||
) ? pLocalPalette
|
||||
: pMasterPalette);
|
||||
gif_localcolortable = (!!cv_gif_localcolortable.value);
|
||||
gif_colorprofile = (!!cv_screenshot_colorprofile.value);
|
||||
gif_headerpalette = GIF_getpalette(0);
|
||||
|
||||
GIF_headwrite();
|
||||
gif_frames = 0;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 2013-2016 by Matthew "Kaito Sinclaire" Walsh.
|
||||
// Copyright (C) 2013-2019 by Sonic Team Junior.
|
||||
// Copyright (C) 2013-2020 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
@ -27,6 +27,6 @@ void GIF_frame(void);
|
|||
INT32 GIF_close(void);
|
||||
#endif
|
||||
|
||||
extern consvar_t cv_gif_optimize, cv_gif_downscale;
|
||||
extern consvar_t cv_gif_optimize, cv_gif_downscale, cv_gif_localcolortable;
|
||||
|
||||
#endif
|
||||
|
|
23
src/m_argv.c
23
src/m_argv.c
|
@ -2,7 +2,7 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1993-1996 by id Software, Inc.
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2019 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2020 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
@ -92,36 +92,21 @@ const char *M_GetNextParm(void)
|
|||
void M_PushSpecialParameters(void)
|
||||
{
|
||||
INT32 i;
|
||||
char s[256];
|
||||
boolean onetime = false;
|
||||
|
||||
for (i = 1; i < myargc; i++)
|
||||
{
|
||||
if (myargv[i][0] == '+')
|
||||
{
|
||||
strcpy(s, &myargv[i][1]);
|
||||
COM_BufAddText(&myargv[i][1]);
|
||||
i++;
|
||||
|
||||
// get the parameters of the command too
|
||||
for (; i < myargc && myargv[i][0] != '+' && myargv[i][0] != '-'; i++)
|
||||
{
|
||||
strcat(s, " ");
|
||||
if (!onetime)
|
||||
{
|
||||
strcat(s, "\"");
|
||||
onetime = true;
|
||||
}
|
||||
strcat(s, myargv[i]);
|
||||
COM_BufAddText(va(" \"%s\"", myargv[i]));
|
||||
}
|
||||
if (onetime)
|
||||
{
|
||||
strcat(s, "\"");
|
||||
onetime = false;
|
||||
}
|
||||
strcat(s, "\n");
|
||||
|
||||
// push it
|
||||
COM_BufAddText(s);
|
||||
COM_BufAddText("\n");
|
||||
i--;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1993-1996 by id Software, Inc.
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2019 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2020 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1993-1996 by id Software, Inc.
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2019 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2020 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1993-1996 by id Software, Inc.
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2019 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2020 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1993-1996 by id Software, Inc.
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2019 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2020 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1993-1996 by id Software, Inc.
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2019 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2020 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 2012-2016 by Matthew "Kaito Sinclaire" Walsh.
|
||||
// Copyright (C) 2012-2019 by Sonic Team Junior.
|
||||
// Copyright (C) 2012-2020 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 2012-2016 by Matthew "Kaito Sinclaire" Walsh.
|
||||
// Copyright (C) 2012-2019 by Sonic Team Junior.
|
||||
// Copyright (C) 2012-2020 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 2005 by James Haley
|
||||
// Copyright (C) 2005-2019 by Sonic Team Junior.
|
||||
// Copyright (C) 2005-2020 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1993-1996 by id Software, Inc.
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2019 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2020 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1993-1996 by id Software, Inc.
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2019 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2020 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
226
src/m_menu.c
226
src/m_menu.c
|
@ -3,7 +3,7 @@
|
|||
// Copyright (C) 1993-1996 by id Software, Inc.
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 2011-2016 by Matthew "Kaito Sinclaire" Walsh.
|
||||
// Copyright (C) 1999-2019 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2020 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
@ -231,6 +231,8 @@ static void M_Credits(INT32 choice);
|
|||
static void M_SoundTest(INT32 choice);
|
||||
static void M_PandorasBox(INT32 choice);
|
||||
static void M_EmblemHints(INT32 choice);
|
||||
static void M_HandleEmblemHints(INT32 choice);
|
||||
UINT32 hintpage = 1;
|
||||
static void M_HandleChecklist(INT32 choice);
|
||||
menu_t SR_MainDef, SR_UnlockChecklistDef;
|
||||
|
||||
|
@ -323,6 +325,7 @@ menu_t OP_DataOptionsDef, OP_ScreenshotOptionsDef, OP_EraseDataDef;
|
|||
menu_t OP_ServerOptionsDef;
|
||||
menu_t OP_MonitorToggleDef;
|
||||
static void M_ScreenshotOptions(INT32 choice);
|
||||
static void M_SetupScreenshotMenu(void);
|
||||
static void M_EraseData(INT32 choice);
|
||||
|
||||
static void M_Addons(INT32 choice);
|
||||
|
@ -364,7 +367,6 @@ static void M_DrawMonitorToggles(void);
|
|||
static void M_OGL_DrawFogMenu(void);
|
||||
#endif
|
||||
#ifndef NONET
|
||||
static void M_DrawScreenshotMenu(void);
|
||||
static void M_DrawConnectMenu(void);
|
||||
static void M_DrawMPMainMenu(void);
|
||||
static void M_DrawRoomMenu(void);
|
||||
|
@ -727,8 +729,9 @@ static menuitem_t SR_SoundTestMenu[] =
|
|||
|
||||
static menuitem_t SR_EmblemHintMenu[] =
|
||||
{
|
||||
{IT_STRING|IT_CVAR, NULL, "Emblem Radar", &cv_itemfinder, 10},
|
||||
{IT_WHITESTRING|IT_SUBMENU, NULL, "Back", &SPauseDef, 20}
|
||||
{IT_STRING | IT_ARROWS, NULL, "Page", M_HandleEmblemHints, 10},
|
||||
{IT_STRING|IT_CVAR, NULL, "Emblem Radar", &cv_itemfinder, 20},
|
||||
{IT_WHITESTRING|IT_SUBMENU, NULL, "Back", &SPauseDef, 30}
|
||||
};
|
||||
|
||||
// --------------------------------
|
||||
|
@ -1514,6 +1517,7 @@ static menuitem_t OP_ScreenshotOptionsMenu[] =
|
|||
|
||||
{IT_STRING|IT_CVAR, NULL, "Region Optimizing", &cv_gif_optimize, 95},
|
||||
{IT_STRING|IT_CVAR, NULL, "Downscaling", &cv_gif_downscale, 100},
|
||||
{IT_STRING|IT_CVAR, NULL, "Local Color Table", &cv_gif_localcolortable, 105},
|
||||
|
||||
{IT_STRING|IT_CVAR, NULL, "Memory Level", &cv_zlib_memorya, 95},
|
||||
{IT_STRING|IT_CVAR, NULL, "Compression Level", &cv_zlib_levela, 100},
|
||||
|
@ -1524,13 +1528,14 @@ static menuitem_t OP_ScreenshotOptionsMenu[] =
|
|||
enum
|
||||
{
|
||||
op_screenshot_colorprofile = 1,
|
||||
op_screenshot_storagelocation = 3,
|
||||
op_screenshot_folder = 4,
|
||||
op_movie_folder = 11,
|
||||
op_screenshot_capture = 12,
|
||||
op_screenshot_gif_start = 13,
|
||||
op_screenshot_gif_end = 14,
|
||||
op_screenshot_apng_start = 15,
|
||||
op_screenshot_apng_end = 18,
|
||||
op_screenshot_gif_end = 15,
|
||||
op_screenshot_apng_start = 16,
|
||||
op_screenshot_apng_end = 19,
|
||||
};
|
||||
|
||||
static menuitem_t OP_EraseDataMenu[] =
|
||||
|
@ -3028,7 +3033,8 @@ static void M_ChangeCvar(INT32 choice)
|
|||
|| !(currentMenu->menuitems[itemOn].status & IT_CV_INTEGERSTEP))
|
||||
{
|
||||
char s[20];
|
||||
sprintf(s,"%f",FIXED_TO_FLOAT(cv->value)+(choice)*(1.0f/16.0f));
|
||||
float n = FIXED_TO_FLOAT(cv->value)+(choice)*(1.0f/16.0f);
|
||||
sprintf(s,"%ld%s",(long)n,M_Ftrim(n));
|
||||
CV_Set(cv,s);
|
||||
}
|
||||
else
|
||||
|
@ -3147,6 +3153,9 @@ boolean M_Responder(event_t *ev)
|
|||
if (gamestate == GS_TITLESCREEN && finalecount < TICRATE)
|
||||
return false;
|
||||
|
||||
if (CON_Ready())
|
||||
return false;
|
||||
|
||||
if (noFurtherInput)
|
||||
{
|
||||
// Ignore input after enter/escape/other buttons
|
||||
|
@ -3506,6 +3515,7 @@ boolean M_Responder(event_t *ev)
|
|||
return false;
|
||||
|
||||
default:
|
||||
CON_Responder(ev);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -3758,6 +3768,12 @@ void M_SetupNextMenu(menu_t *menudef)
|
|||
hidetitlemap = false;
|
||||
}
|
||||
|
||||
// Guess I'll put this here, idk
|
||||
boolean M_MouseNeeded(void)
|
||||
{
|
||||
return (currentMenu == &MessageDef && currentMenu->prevMenu == &OP_ChangeControlsDef);
|
||||
}
|
||||
|
||||
//
|
||||
// M_Ticker
|
||||
//
|
||||
|
@ -3779,6 +3795,9 @@ void M_Ticker(void)
|
|||
if (--vidm_testingmode == 0)
|
||||
setmodeneeded = vidm_previousmode + 1;
|
||||
}
|
||||
|
||||
if (currentMenu == &OP_ScreenshotOptionsDef)
|
||||
M_SetupScreenshotMenu();
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -5596,7 +5615,8 @@ static void M_DrawNightsAttackMountains(void)
|
|||
static INT32 bgscrollx;
|
||||
INT32 dupz = (vid.dupx < vid.dupy ? vid.dupx : vid.dupy);
|
||||
patch_t *background = W_CachePatchName(curbgname, PU_PATCH);
|
||||
INT32 x = FixedInt(bgscrollx) % SHORT(background->width);
|
||||
INT16 w = SHORT(background->width);
|
||||
INT32 x = FixedInt(-bgscrollx) % w;
|
||||
INT32 y = BASEVIDHEIGHT - SHORT(background->height)*2;
|
||||
|
||||
if (vid.height != BASEVIDHEIGHT * dupz)
|
||||
|
@ -5604,11 +5624,13 @@ static void M_DrawNightsAttackMountains(void)
|
|||
V_DrawFill(0, y+50, vid.width, BASEVIDHEIGHT, V_SNAPTOLEFT|31);
|
||||
|
||||
V_DrawScaledPatch(x, y, V_SNAPTOLEFT, background);
|
||||
x += SHORT(background->width);
|
||||
x += w;
|
||||
if (x < BASEVIDWIDTH)
|
||||
V_DrawScaledPatch(x, y, V_SNAPTOLEFT, background);
|
||||
|
||||
bgscrollx -= (FRACUNIT/2);
|
||||
bgscrollx += (FRACUNIT/2);
|
||||
if (bgscrollx > w<<FRACBITS)
|
||||
bgscrollx &= 0xFFFF;
|
||||
}
|
||||
|
||||
// NiGHTS Attack foreground.
|
||||
|
@ -7225,18 +7247,33 @@ finishchecklist:
|
|||
}
|
||||
|
||||
#define NUMHINTS 5
|
||||
|
||||
static void M_EmblemHints(INT32 choice)
|
||||
{
|
||||
INT32 i;
|
||||
UINT32 local = 0;
|
||||
emblem_t *emblem;
|
||||
for (i = 0; i < numemblems; i++)
|
||||
{
|
||||
emblem = &emblemlocations[i];
|
||||
if (emblem->level != gamemap || emblem->type > ET_SKIN)
|
||||
continue;
|
||||
if (++local > NUMHINTS*2)
|
||||
break;
|
||||
}
|
||||
|
||||
(void)choice;
|
||||
SR_EmblemHintMenu[0].status = (M_SecretUnlocked(SECRET_ITEMFINDER)) ? (IT_CVAR|IT_STRING) : (IT_SECRET);
|
||||
SR_EmblemHintMenu[0].status = (local > NUMHINTS*2) ? (IT_STRING | IT_ARROWS) : (IT_DISABLED);
|
||||
SR_EmblemHintMenu[1].status = (M_SecretUnlocked(SECRET_ITEMFINDER)) ? (IT_CVAR|IT_STRING) : (IT_SECRET);
|
||||
hintpage = 1;
|
||||
M_SetupNextMenu(&SR_EmblemHintDef);
|
||||
itemOn = 1; // always start on back.
|
||||
itemOn = 2; // always start on back.
|
||||
}
|
||||
|
||||
static void M_DrawEmblemHints(void)
|
||||
{
|
||||
INT32 i, j = 0, x, y, left_hints = NUMHINTS;
|
||||
UINT32 collected = 0, local = 0;
|
||||
INT32 i, j = 0, x, y, left_hints = NUMHINTS, pageflag = 0;
|
||||
UINT32 collected = 0, totalemblems = 0, local = 0;
|
||||
emblem_t *emblem;
|
||||
const char *hint;
|
||||
|
||||
|
@ -7245,17 +7282,34 @@ static void M_DrawEmblemHints(void)
|
|||
emblem = &emblemlocations[i];
|
||||
if (emblem->level != gamemap || emblem->type > ET_SKIN)
|
||||
continue;
|
||||
if (++local >= NUMHINTS*2)
|
||||
break;
|
||||
|
||||
local++;
|
||||
}
|
||||
|
||||
x = (local > NUMHINTS ? 4 : 12);
|
||||
y = 8;
|
||||
|
||||
// If there are more than 1 page's but less than 2 pages' worth of emblems,
|
||||
if (local > NUMHINTS){
|
||||
if (local > ((hintpage-1)*NUMHINTS*2) && local < ((hintpage)*NUMHINTS*2)){
|
||||
if (NUMHINTS % 2 == 1)
|
||||
left_hints = (local - ((hintpage-1)*NUMHINTS*2) + 1) / 2;
|
||||
else
|
||||
left_hints = (local - ((hintpage-1)*NUMHINTS*2)) / 2;
|
||||
}else{
|
||||
left_hints = NUMHINTS;
|
||||
}
|
||||
}
|
||||
|
||||
if (local > NUMHINTS*2){
|
||||
if (itemOn == 0){
|
||||
pageflag = V_YELLOWMAP;
|
||||
}
|
||||
V_DrawString(currentMenu->x + 40, currentMenu->y + 10, pageflag, va("%d of %d",hintpage, local/(NUMHINTS*2) + 1));
|
||||
}
|
||||
|
||||
// If there are more than 1 page's but less than 2 pages' worth of emblems on the last possible page,
|
||||
// put half (rounded up) of the hints on the left, and half (rounded down) on the right
|
||||
if (local > NUMHINTS && local < (NUMHINTS*2)-1)
|
||||
left_hints = (local + 1) / 2;
|
||||
|
||||
|
||||
if (!local)
|
||||
V_DrawCenteredString(160, 48, V_YELLOWMAP, "No hidden emblems on this map.");
|
||||
|
@ -7265,42 +7319,80 @@ static void M_DrawEmblemHints(void)
|
|||
if (emblem->level != gamemap || emblem->type > ET_SKIN)
|
||||
continue;
|
||||
|
||||
if (emblem->collected)
|
||||
{
|
||||
collected = V_GREENMAP;
|
||||
V_DrawMappedPatch(x, y+4, 0, W_CachePatchName(M_GetEmblemPatch(emblem, false), PU_PATCH),
|
||||
R_GetTranslationColormap(TC_DEFAULT, M_GetEmblemColor(emblem), GTC_CACHE));
|
||||
}
|
||||
else
|
||||
{
|
||||
collected = 0;
|
||||
V_DrawScaledPatch(x, y+4, 0, W_CachePatchName("NEEDIT", PU_PATCH));
|
||||
}
|
||||
totalemblems++;
|
||||
|
||||
if (emblem->hint[0])
|
||||
hint = emblem->hint;
|
||||
else
|
||||
hint = M_GetText("No hint available for this emblem.");
|
||||
hint = V_WordWrap(40, BASEVIDWIDTH-12, 0, hint);
|
||||
if (local > NUMHINTS)
|
||||
V_DrawThinString(x+28, y, V_RETURN8|V_ALLOWLOWERCASE|collected, hint);
|
||||
else
|
||||
V_DrawString(x+28, y, V_RETURN8|V_ALLOWLOWERCASE|collected, hint);
|
||||
if (totalemblems >= ((hintpage-1)*(NUMHINTS*2) + 1) && totalemblems < (hintpage*NUMHINTS*2)+1){
|
||||
|
||||
y += 28;
|
||||
if (emblem->collected)
|
||||
{
|
||||
collected = V_GREENMAP;
|
||||
V_DrawMappedPatch(x, y+4, 0, W_CachePatchName(M_GetEmblemPatch(emblem, false), PU_PATCH),
|
||||
R_GetTranslationColormap(TC_DEFAULT, M_GetEmblemColor(emblem), GTC_CACHE));
|
||||
}
|
||||
else
|
||||
{
|
||||
collected = 0;
|
||||
V_DrawScaledPatch(x, y+4, 0, W_CachePatchName("NEEDIT", PU_PATCH));
|
||||
}
|
||||
|
||||
if (++j == left_hints)
|
||||
{
|
||||
x = 4+(BASEVIDWIDTH/2);
|
||||
y = 8;
|
||||
if (emblem->hint[0])
|
||||
hint = emblem->hint;
|
||||
else
|
||||
hint = M_GetText("No hint available for this emblem.");
|
||||
hint = V_WordWrap(40, BASEVIDWIDTH-12, 0, hint);
|
||||
//always draw tiny if we have more than NUMHINTS*2, visually more appealing
|
||||
if (local > NUMHINTS)
|
||||
V_DrawThinString(x+28, y, V_RETURN8|V_ALLOWLOWERCASE|collected, hint);
|
||||
else
|
||||
V_DrawString(x+28, y, V_RETURN8|V_ALLOWLOWERCASE|collected, hint);
|
||||
|
||||
y += 28;
|
||||
|
||||
// If there are more than 1 page's but less than 2 pages' worth of emblems on the last possible page,
|
||||
// put half (rounded up) of the hints on the left, and half (rounded down) on the right
|
||||
|
||||
if (++j == left_hints)
|
||||
{
|
||||
x = 4+(BASEVIDWIDTH/2);
|
||||
y = 8;
|
||||
}
|
||||
else if (j >= NUMHINTS*2)
|
||||
break;
|
||||
}
|
||||
else if (j >= NUMHINTS*2)
|
||||
break;
|
||||
}
|
||||
|
||||
M_DrawGenericMenu();
|
||||
}
|
||||
|
||||
|
||||
static void M_HandleEmblemHints(INT32 choice)
|
||||
{
|
||||
INT32 i;
|
||||
emblem_t *emblem;
|
||||
UINT32 stageemblems = 0;
|
||||
|
||||
for (i = 0; i < numemblems; i++)
|
||||
{
|
||||
emblem = &emblemlocations[i];
|
||||
if (emblem->level != gamemap || emblem->type > ET_SKIN)
|
||||
continue;
|
||||
|
||||
stageemblems++;
|
||||
}
|
||||
|
||||
|
||||
if (choice == 0){
|
||||
if (hintpage > 1){
|
||||
hintpage--;
|
||||
}
|
||||
}else{
|
||||
if (hintpage < ((stageemblems-1)/(NUMHINTS*2) + 1)){
|
||||
hintpage++;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*static void M_DrawSkyRoom(void)
|
||||
{
|
||||
INT32 i, y = 0;
|
||||
|
@ -8059,8 +8151,16 @@ static void M_DrawLoadGameData(void)
|
|||
col = 134;
|
||||
else
|
||||
{
|
||||
col = charskin->prefcolor - 1;
|
||||
col = Color_Index[Color_Opposite[col][0]-1][Color_Opposite[col][1]];
|
||||
if (charskin->prefoppositecolor)
|
||||
{
|
||||
col = charskin->prefoppositecolor - 1;
|
||||
col = Color_Index[col][Color_Opposite[Color_Opposite[col][0] - 1][1]];
|
||||
}
|
||||
else
|
||||
{
|
||||
col = charskin->prefcolor - 1;
|
||||
col = Color_Index[Color_Opposite[col][0]-1][Color_Opposite[col][1]];
|
||||
}
|
||||
}
|
||||
|
||||
V_DrawFill(x+6, y+64, 72, 50, col);
|
||||
|
@ -10837,7 +10937,6 @@ static void M_HandleConnectIP(INT32 choice)
|
|||
default: // otherwise do nothing.
|
||||
break;
|
||||
}
|
||||
break; // don't check for typed keys
|
||||
}
|
||||
|
||||
if (l >= 28-1)
|
||||
|
@ -11341,9 +11440,27 @@ static void M_ScreenshotOptions(INT32 choice)
|
|||
Screenshot_option_Onchange();
|
||||
Moviemode_mode_Onchange();
|
||||
|
||||
M_SetupScreenshotMenu();
|
||||
M_SetupNextMenu(&OP_ScreenshotOptionsDef);
|
||||
}
|
||||
|
||||
static void M_SetupScreenshotMenu(void)
|
||||
{
|
||||
menuitem_t *item = &OP_ScreenshotOptionsMenu[op_screenshot_colorprofile];
|
||||
|
||||
#ifdef HWRENDER
|
||||
// Hide some options based on render mode
|
||||
if (rendermode == render_opengl)
|
||||
{
|
||||
item->status = IT_GRAYEDOUT;
|
||||
if ((currentMenu == &OP_ScreenshotOptionsDef) && (itemOn == op_screenshot_colorprofile)) // Can't select that
|
||||
itemOn = op_screenshot_storagelocation;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
item->status = (IT_STRING | IT_CVAR);
|
||||
}
|
||||
|
||||
// =============
|
||||
// JOYSTICK MENU
|
||||
// =============
|
||||
|
@ -12286,6 +12403,15 @@ static void M_HandleVideoMode(INT32 ch)
|
|||
static void M_DrawScreenshotMenu(void)
|
||||
{
|
||||
M_DrawGenericScrollMenu();
|
||||
#ifdef HWRENDER
|
||||
if ((rendermode == render_opengl) && (itemOn < 7)) // where it starts to go offscreen; change this number if you change the layout of the screenshot menu
|
||||
{
|
||||
INT32 y = currentMenu->y+currentMenu->menuitems[op_screenshot_colorprofile].alphaKey*2;
|
||||
if (itemOn == 6)
|
||||
y -= 10;
|
||||
V_DrawRightAlignedString(BASEVIDWIDTH - currentMenu->x, y, V_REDMAP, "Yes");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
// ===============
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue