Merge branch SRB2:next into fix-blockmap-bugs

This commit is contained in:
MIDIMan 2025-01-20 21:07:44 +00:00
commit fe0fd35bbc
63 changed files with 2726 additions and 598 deletions

View file

@ -27,10 +27,10 @@ list(TRANSFORM SRB2_ASSETS_DOCS PREPEND "${SRB2_ASSET_DIRECTORY_ABSOLUTE}")
set(SRB2_ASSETS_GAME
"srb2.pk3"
"player.dta"
"characters.pk3"
"zones.pk3"
"patch.pk3"
"music.dta"
"music.pk3"
"models.dat"
)
list(TRANSFORM SRB2_ASSETS_GAME PREPEND "/")

View file

@ -39,7 +39,7 @@ https://facebook.com/SonicRoboBlast2
COPYRIGHT AND DISCLAIMER
Design and content in Sonic Robo Blast 2 is copyright 1998-2024 by Sonic Team Jr.
Design and content in Sonic Robo Blast 2 is copyright 1998-2025 by Sonic Team Jr.
All original material in this game is copyrighted by their respective owners, and no copyright infringement is intended. Sonic Team Jr. is in no way affiliated with SEGA or Sonic Team, and we do not claim ownership of any of SEGA's intellectual property used in SRB2.

View file

@ -12,7 +12,7 @@ Upstream Author(s):
Copyright:
Copyright (C) 1998-2024 by Sonic Team Junior
Copyright (C) 1998-2025 by Sonic Team Junior
License:
@ -21,7 +21,7 @@ License:
The Debian packaging is:
Copyright (C) 2010 Callum Dickinson <gcfreak_ag20@hotmail.com>
Copyright (C) 2010-2024 by Sonic Team Junior <stjr@srb2.org>
Copyright (C) 2010-2025 by Sonic Team Junior <stjr@srb2.org>
and is licensed under the GPL version 2,
see "/usr/share/common-licenses/GPL-2".

View file

@ -1,14 +1,16 @@
include(LibFindMacros)
libfind_pkg_check_modules(libopenmpt_PKGCONF openmpt)
libfind_pkg_check_modules(libopenmpt_PKGCONF openmpt libopenmpt)
find_path(libopenmpt_INCLUDE_DIR
NAMES libopenmpt.h
PATHS
${libopenmpt_PKGCONF_INCLUDE_DIRS}
"${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include/libopenmpt"
"/usr/include/libopenmpt"
"/usr/local/include/libopenmpt"
"${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include"
"/usr/include"
"/usr/local/include"
PATH_SUFFIXES
+ libopenmpt
)
find_library(libopenmpt_LIBRARY

View file

@ -12,7 +12,7 @@ Upstream Author(s):
Copyright:
Copyright (C) 1998-2024 by Sonic Team Junior
Copyright (C) 1998-2025 by Sonic Team Junior
License:
@ -21,7 +21,7 @@ License:
The Debian packaging is:
Copyright (C) 2010 Callum Dickinson <gcfreak_ag20@hotmail.com>
Copyright (C) 2010-2024 by Sonic Team Junior <stjr@srb2.org>
Copyright (C) 2010-2025 by Sonic Team Junior <stjr@srb2.org>
and is licensed under the GPL version 2,
see "/usr/share/common-licenses/GPL-2".

View file

@ -0,0 +1,7 @@
set(VCPKG_TARGET_ARCHITECTURE arm64)
set(VCPKG_OSX_DEPLOYMENT_TARGET 10.15)
set(VCPKG_CRT_LINKAGE dynamic)
set(VCPKG_LIBRARY_LINKAGE static)
set(VCPKG_CMAKE_SYSTEM_NAME Darwin)
set(VCPKG_OSX_ARCHITECTURES arm64)

25
scripts/make-macos-universal.sh Executable file
View file

@ -0,0 +1,25 @@
#!/usr/bin/env bash
# Makes a fused macOS Universal app bundle in the arm64 release preset dir
# Only works if in master branch or in source tarball
set -e
rm -rf "build/ninja-x64_osx_vcpkg-release"
rm -rf "build/ninja-arm64_osx_vcpkg-release"
cmake --preset ninja-x64_osx_vcpkg-release -DVCPKG_OVERLAY_TRIPLETS=scripts/ -DVCPKG_TARGET_TRIPLET=x64-osx-1015 -DCMAKE_OSX_ARCHITECTURES=x86_64 -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 "-DSRB2_SDL2_EXE_NAME=srb2"
cmake --build --preset ninja-x64_osx_vcpkg-release
cmake --preset ninja-arm64_osx_vcpkg-release -DVCPKG_OVERLAY_TRIPLETS=scripts/ -DVCPKG_TARGET_TRIPLET=arm64-osx-1015 -DCMAKE_OSX_ARCHITECTURES=arm64 -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 "-DSRB2_SDL2_EXE_NAME=srb2"
cmake --build --preset ninja-arm64_osx_vcpkg-release
mkdir -p build/dist
rm -rf "build/dist/Sonic Robo Blast 2.app" "build/dist/srb2.app"
cp -r build/ninja-arm64_osx_vcpkg-release/bin/srb2.app build/dist/
lipo -create \
-output "build/dist/srb2.app/Contents/MacOS/srb2" \
build/ninja-x64_osx_vcpkg-release/bin/srb2.app/Contents/MacOS/srb2 \
build/ninja-arm64_osx_vcpkg-release/bin/srb2.app/Contents/MacOS/srb2
mv build/dist/srb2.app "build/dist/Sonic Robo Blast 2.app"

View file

@ -0,0 +1,7 @@
set(VCPKG_TARGET_ARCHITECTURE x64)
set(VCPKG_OSX_DEPLOYMENT_TARGET 10.15)
set(VCPKG_CRT_LINKAGE dynamic)
set(VCPKG_LIBRARY_LINKAGE static)
set(VCPKG_CMAKE_SYSTEM_NAME Darwin)
set(VCPKG_OSX_ARCHITECTURES x86_64)

View file

@ -1076,6 +1076,9 @@ static inline void AM_drawPlayers(void)
if (!playeringame[i] || players[i].spectator)
continue;
if (!players[i].mo)
continue;
p = &players[i];
if (p->skincolor > 0)
color = R_GetTranslationColormap(TC_DEFAULT, p->skincolor, GTC_CACHE)[GREENS + 8];

View file

@ -648,7 +648,7 @@ static void COM_ExecuteString(char *ptext)
{
if ((com_flags & COM_LUA) && !(cmd->flags & COM_LUA))
{
CONS_Alert(CONS_WARNING, "Command '%s' cannot be run from Lua.\n", cmd->name);
CONS_Alert(CONS_WARNING, "Command '%s' cannot be run from a script.\n", cmd->name);
return;
}
@ -809,49 +809,60 @@ static void COM_CEchoDuration_f(void)
/** Executes a script file.
*/
static void COM_Exec_f(void)
boolean COM_ExecFile(const char *scriptname, com_flags_t flags, boolean silent)
{
UINT8 *buf = NULL;
char filename[256];
if (!D_CheckPathAllowed(scriptname, "tried to exec"))
return false;
// load file
// Try with Argv passed verbatim first, for back compat
FIL_ReadFile(scriptname, &buf);
if (!buf)
{
// Now try by searching the file path
// filename is modified with the full found path
strlcpy(filename, scriptname, sizeof(filename));
if (findfile(filename, NULL, true) != FS_NOTFOUND)
FIL_ReadFile(filename, &buf);
if (!buf)
return false;
}
if (!silent)
CONS_Printf(M_GetText("Executing %s\n"), scriptname);
// insert text file into the command buffer
COM_BufAddTextEx((char *)buf, flags);
COM_BufAddTextEx("\n", flags);
// free buffer
Z_Free(buf);
return true;
}
static void COM_Exec_f(void)
{
boolean silent;
if (COM_Argc() < 2 || COM_Argc() > 3)
{
CONS_Printf(M_GetText("exec <filename>: run a script file\n"));
return;
}
if (!D_CheckPathAllowed(COM_Argv(1), "tried to exec"))
silent = COM_CheckParm("-silent");
if (COM_ExecFile(COM_Argv(1), com_flags, silent))
return;
// load file
// Try with Argv passed verbatim first, for back compat
FIL_ReadFile(COM_Argv(1), &buf);
if (!buf)
{
// Now try by searching the file path
// filename is modified with the full found path
strcpy(filename, COM_Argv(1));
if (findfile(filename, NULL, true) != FS_NOTFOUND)
FIL_ReadFile(filename, &buf);
if (!buf)
{
if (!COM_CheckParm("-noerror"))
CONS_Printf(M_GetText("couldn't execute file %s\n"), COM_Argv(1));
return;
}
}
if (!COM_CheckParm("-silent"))
CONS_Printf(M_GetText("executing %s\n"), COM_Argv(1));
// insert text file into the command buffer
COM_BufAddTextEx((char *)buf, com_flags);
COM_BufAddTextEx("\n", com_flags);
// free buffer
Z_Free(buf);
if (!COM_CheckParm("-noerror"))
CONS_Printf(M_GetText("Couldn't execute file %s\n"), COM_Argv(1));
}
/** Delays execution of the rest of the commands until the next frame.
@ -2493,7 +2504,7 @@ static boolean CV_Command(void)
if (CV_Immutable(v))
{
CONS_Alert(CONS_WARNING, "Variable '%s' cannot be changed from Lua.\n", v->name);
CONS_Alert(CONS_WARNING, "Variable '%s' cannot be changed from a script.\n", v->name);
return true;
}

View file

@ -66,6 +66,9 @@ void COM_ImmedExecute(const char *ptext);
// Execute commands in buffer, flush them
void COM_BufExecute(void);
// Executes a script from a file
boolean COM_ExecFile(const char *scriptname, com_flags_t flags, boolean silent);
// As above; and progress the wait timer.
void COM_BufTicker(void);

View file

@ -40,10 +40,11 @@
* Last updated 2023 / 05 / 02 - v2.2.11 - patch.pk3 & zones.pk3
* Last updated 2023 / 09 / 06 - v2.2.12 - patch.pk3
* Last updated 2023 / 09 / 09 - v2.2.13 - none
* Last updated 2025 / 01 / 16 - v2.2.14 - main assets
*/
#define ASSET_HASH_SRB2_PK3 "ad911f29a28a18968ee5b2d11c2acb39"
#define ASSET_HASH_ZONES_PK3 "1c8adf8d079ecb87d00081f158acf3c7"
#define ASSET_HASH_PLAYER_DTA "2e7aaae8a6b1b77d90ffe7606ceadb6c"
#define ASSET_HASH_SRB2_PK3 "c1d9a4b3452b350d4662f41eb301dc6c"
#define ASSET_HASH_ZONES_PK3 "2ab758817fff96bc60ee9dec85e0b534"
#define ASSET_HASH_CHARACTERS_PK3 "97ce7008d16152731fe037141309aa24"
#ifdef USE_PATCH_DTA
#define ASSET_HASH_PATCH_PK3 "3c7b73f34af7e9a7bceb2d5260f76172"
#endif

View file

@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2024 by Sonic Team Junior.
// Copyright (C) 1999-2025 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
@ -1180,7 +1180,7 @@ static void IdentifyVersion(void)
D_AddFile(&startupwadfiles, va(pandf,srb2waddir, "zones.pk3"));
// Add the players
D_AddFile(&startupwadfiles, va(pandf,srb2waddir, "player.dta"));
D_AddFile(&startupwadfiles, va(pandf,srb2waddir, "characters.pk3"));
#ifdef USE_PATCH_DTA
// Add our crappy patches to fix our bugs
@ -1199,7 +1199,7 @@ static void IdentifyVersion(void)
I_Error("File "str" has been modified with non-music/sound lumps"); \
}
MUSICTEST("music.dta")
MUSICTEST("music.pk3")
//MUSICTEST("patch_music.pk3")
}
#endif
@ -1250,7 +1250,7 @@ void D_SRB2Main(void)
// Print GPL notice for our console users (Linux)
CONS_Printf(
"\n\nSonic Robo Blast 2\n"
"Copyright (C) 1998-2024 by Sonic Team Junior\n\n"
"Copyright (C) 1998-2025 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"
@ -1431,7 +1431,7 @@ void D_SRB2Main(void)
// Make backups of some SOCcable tables.
P_BackupTables();
mainwads = 3; // doesn't include music.dta
mainwads = 3; // doesn't include music.pk3
#ifdef USE_PATCH_DTA
mainwads++;
#endif
@ -1446,11 +1446,11 @@ void D_SRB2Main(void)
// 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
W_VerifyFileMD5(2, ASSET_HASH_CHARACTERS_PK3); // characters.pk3
#ifdef USE_PATCH_DTA
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
// don't check music.pk3 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.
#endif //ifndef DEVELOP
@ -1600,7 +1600,7 @@ void D_SRB2Main(void)
{
if (!M_IsNextParm())
I_Error("usage: -room <room_id>\nCheck the Master Server's webpage for room ID numbers.\n");
ms_RoomId = atoi(M_GetNextParm());
CV_SetValue(&cv_masterserver_room_id, atoi(M_GetNextParm()));
#ifdef UPDATE_ALERT
GetMODVersion_Console();

View file

@ -3,7 +3,7 @@
//
// Copyright (C) 1993-1996 by id Software, Inc.
// Portions Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 2014-2024 by Sonic Team Junior.
// Copyright (C) 2014-2025 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
@ -65,10 +65,11 @@ typedef LPVOID (WINAPI *p_MapViewOfFile) (HANDLE, DWORD, DWORD, DWORD, SIZE_T);
#pragma warning(default : 4214 4244)
#endif
#if defined (__unix__) || defined(__APPLE__) || (defined (UNIXCOMMON) && !defined (__HAIKU__))
#if defined (__linux__)
#include <sys/vfs.h>
#if defined (__unix__) || defined(__APPLE__) || defined (UNIXCOMMON)
#if defined (__linux__) || defined (__HAIKU__)
#include <sys/statvfs.h>
#else
#include <sys/statvfs.h>
#include <sys/param.h>
#include <sys/mount.h>
/*For meminfo*/
@ -81,7 +82,7 @@ typedef LPVOID (WINAPI *p_MapViewOfFile) (HANDLE, DWORD, DWORD, DWORD, SIZE_T);
#endif
#endif
#if defined (__linux__) || (defined (UNIXCOMMON) && !defined (__HAIKU__))
#if defined (__linux__) || defined (UNIXCOMMON)
#ifndef NOTERMIOS
#include <termios.h>
#include <sys/ioctl.h> // ioctl
@ -96,8 +97,10 @@ typedef LPVOID (WINAPI *p_MapViewOfFile) (HANDLE, DWORD, DWORD, DWORD, SIZE_T);
#if defined (__unix__) || (defined (UNIXCOMMON) && !defined (__APPLE__))
#include <errno.h>
#include <sys/wait.h>
#ifndef __HAIKU__ // haiku's crash dialog is just objectively better
#define NEWSIGNALHANDLER
#endif
#endif
#ifndef NOMUMBLE
#ifdef __linux__ // need -lrt
@ -374,15 +377,24 @@ void I_Sleep(UINT32 ms)
void I_SleepDuration(precise_t duration)
{
#if defined(__linux__) || defined(__FreeBSD__)
#if defined(__linux__) || defined(__FreeBSD__) || defined(__HAIKU__)
UINT64 precision = I_GetPrecisePrecision();
struct timespec ts = {
.tv_sec = duration / precision,
.tv_nsec = duration * 1000000000 / precision % 1000000000,
};
int status;
do status = clock_nanosleep(CLOCK_MONOTONIC, 0, &ts, &ts);
while (status == EINTR);
precise_t dest = I_GetPreciseTime() + duration;
precise_t slack = (precision / 5000); // 0.2 ms slack
if (duration > slack)
{
duration -= slack;
struct timespec ts = {
.tv_sec = duration / precision,
.tv_nsec = duration * 1000000000 / precision % 1000000000,
};
int status;
do status = clock_nanosleep(CLOCK_MONOTONIC, 0, &ts, &ts);
while (status == EINTR);
}
// busy-wait the rest
while (((INT64)dest - (INT64)I_GetPreciseTime()) > 0);
#else
UINT64 precision = I_GetPrecisePrecision();
INT32 sleepvalue = cv_sleep.value;
@ -705,10 +717,9 @@ typedef struct
static feild_t tty_con;
// when printing general stuff to stdout stderr (Sys_Printf)
// we need to disable the tty console stuff
// this increments so we can recursively disable
static INT32 ttycon_hide = 0;
// lock to prevent clearing partial lines, since not everything
// printed ends on a newline.
static boolean ttycon_ateol = true;
// some key codes that the terminal may be using
// TTimo NOTE: I'm not sure how relevant this is
static INT32 tty_erase;
@ -736,63 +747,31 @@ static inline void tty_FlushIn(void)
// TTimo NOTE: it seems on some terminals just sending '\b' is not enough
// so for now, in any case we send "\b \b" .. yeah well ..
// (there may be a way to find out if '\b' alone would work though)
// Hanicef NOTE: using \b this way is unreliable because of terminal state,
// it's better to use \r to reset the cursor to the beginning of the
// line and clear from there.
static void tty_Back(void)
{
char key;
ssize_t d;
key = '\b';
d = write(STDOUT_FILENO, &key, 1);
key = ' ';
d = write(STDOUT_FILENO, &key, 1);
key = '\b';
d = write(STDOUT_FILENO, &key, 1);
(void)d;
write(STDOUT_FILENO, "\r", 1);
if (tty_con.cursor>0)
{
write(STDOUT_FILENO, tty_con.buffer, tty_con.cursor);
}
write(STDOUT_FILENO, " \b", 2);
}
static void tty_Clear(void)
{
size_t i;
write(STDOUT_FILENO, "\r", 1);
if (tty_con.cursor>0)
{
for (i=0; i<tty_con.cursor; i++)
{
tty_Back();
write(STDOUT_FILENO, " ", 1);
}
write(STDOUT_FILENO, "\r", 1);
}
}
// clear the display of the line currently edited
// bring cursor back to beginning of line
static inline void tty_Hide(void)
{
//I_Assert(consolevent);
if (ttycon_hide)
{
ttycon_hide++;
return;
}
tty_Clear();
ttycon_hide++;
}
// show the current line
// FIXME TTimo need to position the cursor if needed??
static inline void tty_Show(void)
{
size_t i;
ssize_t d;
//I_Assert(consolevent);
I_Assert(ttycon_hide>0);
ttycon_hide--;
if (ttycon_hide == 0 && tty_con.cursor)
{
for (i=0; i<tty_con.cursor; i++)
{
d = write(STDOUT_FILENO, tty_con.buffer+i, 1);
}
}
(void)d;
}
// never exit without calling this, or your terminal will be left in a pretty bad state
@ -900,6 +879,11 @@ static void I_GetConsoleEvents(void)
tty_con.cursor = 0;
ev.key = KEY_ENTER;
}
else if (key == 0x4) // ^D, aka EOF
{
// shut down, most unix programs behave this way
I_Quit();
}
else continue;
}
else if (tty_con.cursor < sizeof(tty_con.buffer))
@ -1046,6 +1030,9 @@ void I_OutputMsg(const char *fmt, ...)
va_start(argptr,fmt);
len = vsnprintf(NULL, 0, fmt, argptr);
va_end(argptr);
if (len == 0)
return;
txt = malloc(len+1);
va_start(argptr,fmt);
vsprintf(txt, fmt, argptr);
@ -1135,18 +1122,20 @@ void I_OutputMsg(const char *fmt, ...)
}
#else
#ifdef HAVE_TERMIOS
if (consolevent)
if (consolevent && ttycon_ateol)
{
tty_Hide();
tty_Clear();
ttycon_ateol = false;
}
#endif
if (!framebuffer)
fprintf(stderr, "%s", txt);
#ifdef HAVE_TERMIOS
if (consolevent)
if (consolevent && txt[len-1] == '\n')
{
tty_Show();
write(STDOUT_FILENO, tty_con.buffer, tty_con.cursor);
ttycon_ateol = true;
}
#endif
@ -1226,18 +1215,13 @@ void I_ShutdownSystem(void)
void I_GetDiskFreeSpace(INT64* freespace)
{
#if defined (__unix__) || defined(__APPLE__) || defined (UNIXCOMMON)
#if defined (SOLARIS) || defined (__HAIKU__)
*freespace = INT32_MAX;
return;
#else // Both Linux and BSD have this, apparently.
struct statfs stfs;
if (statfs(srb2home, &stfs) == -1)
struct statvfs stfs;
if (statvfs(srb2home, &stfs) == -1)
{
*freespace = INT32_MAX;
return;
}
*freespace = stfs.f_bavail * stfs.f_bsize;
#endif
#elif defined (_WIN32)
static p_GetDiskFreeSpaceExA pfnGetDiskFreeSpaceEx = NULL;
static boolean testwin95 = false;
@ -1453,8 +1437,10 @@ const char *I_LocateWad(void)
{
// change to the directory where we found srb2.pk3
#if defined (_WIN32)
waddir = _fullpath(NULL, waddir, MAX_PATH);
SetCurrentDirectoryA(waddir);
#else
waddir = realpath(waddir, NULL);
if (chdir(waddir) == -1)
I_OutputMsg("Couldn't change working directory\n");
#endif

View file

@ -3584,7 +3584,7 @@ void readmaincfg(MYFILE *f)
if (fastcmp(word, "EXECCFG"))
{
if (strchr(word2, '.'))
COM_BufAddText(va("exec %s\n", word2));
COM_ExecFile(word2, COM_LUA, false);
else
{
lumpnum_t lumpnum;
@ -3599,7 +3599,7 @@ void readmaincfg(MYFILE *f)
if (lumpnum == LUMPERROR || W_LumpLength(lumpnum) == 0)
CONS_Debug(DBG_SETUP, "SOC Error: script lump %s not found/not valid.\n", newname);
else
COM_BufInsertText(W_CacheLumpNum(lumpnum, PU_CACHE));
COM_BufInsertTextEx(W_CacheLumpNum(lumpnum, PU_CACHE), COM_LUA);
}
}
@ -3925,6 +3925,7 @@ void readmaincfg(MYFILE *f)
value = get_number(word2);
bootmap = (INT16)value;
bootmapchanged = true;
//titlechanged = true;
}
else if (fastcmp(word, "STARTCHAR"))

View file

@ -2245,6 +2245,10 @@ const char *const STATE_LIST[] = { // array length left dynamic for sanity testi
"S_LAMPPOST2", // with snow
"S_HANGSTAR",
"S_MISTLETOE",
"S_SSZTREE",
"S_SSZTREE_BRANCH",
"S_SSZTREE2",
"S_SSZTREE2_BRANCH",
// Xmas GFZ bushes
"S_XMASBLUEBERRYBUSH",
"S_XMASBERRYBUSH",
@ -2365,6 +2369,9 @@ const char *const STATE_LIST[] = { // array length left dynamic for sanity testi
"S_DBALL5",
"S_DBALL6",
"S_EGGSTATUE2",
"S_GINE",
"S_PPAL",
"S_PPEL",
// Shield Orb
"S_ARMA1",
@ -2913,6 +2920,69 @@ const char *const STATE_LIST[] = { // array length left dynamic for sanity testi
"S_BHORIZ7",
"S_BHORIZ8",
// Yellow Trampoline
"S_YELLOWTRAMPOLINE",
"S_YELLOWTRAMPOLINE2",
"S_YELLOWTRAMPOLINE3",
"S_YELLOWTRAMPOLINE4",
"S_YELLOWTRAMPOLINE5",
// Red Trampoline
"S_REDTRAMPOLINE",
"S_REDTRAMPOLINE2",
"S_REDTRAMPOLINE3",
"S_REDTRAMPOLINE4",
"S_REDTRAMPOLINE5",
// Blue Trampoline
"S_BLUETRAMPOLINE",
"S_BLUETRAMPOLINE2",
"S_BLUETRAMPOLINE3",
"S_BLUETRAMPOLINE4",
"S_BLUETRAMPOLINE5",
// Horizontal Yellow Trampoline
"S_HORIZYELLOWTRAMPOLINE",
"S_HORIZYELLOWTRAMPOLINE2",
"S_HORIZYELLOWTRAMPOLINE3",
"S_HORIZYELLOWTRAMPOLINE4",
"S_HORIZYELLOWTRAMPOLINE5",
// Horizontal Red Trampoline
"S_HORIZREDTRAMPOLINE",
"S_HORIZREDTRAMPOLINE2",
"S_HORIZREDTRAMPOLINE3",
"S_HORIZREDTRAMPOLINE4",
"S_HORIZREDTRAMPOLINE5",
// Horizontal Blue Trampoline
"S_HORIZBLUETRAMPOLINE",
"S_HORIZBLUETRAMPOLINE2",
"S_HORIZBLUETRAMPOLINE3",
"S_HORIZBLUETRAMPOLINE4",
"S_HORIZBLUETRAMPOLINE5",
// Diagonal Yellow Trampoline
"S_DIAGYELLOWTRAMPOLINE",
"S_DIAGYELLOWTRAMPOLINE2",
"S_DIAGYELLOWTRAMPOLINE3",
"S_DIAGYELLOWTRAMPOLINE4",
"S_DIAGYELLOWTRAMPOLINE5",
// Diagonal Red Trampoline
"S_DIAGREDTRAMPOLINE",
"S_DIAGREDTRAMPOLINE2",
"S_DIAGREDTRAMPOLINE3",
"S_DIAGREDTRAMPOLINE4",
"S_DIAGREDTRAMPOLINE5",
// Diagonal Blue Trampoline
"S_DIAGBLUETRAMPOLINE",
"S_DIAGBLUETRAMPOLINE2",
"S_DIAGBLUETRAMPOLINE3",
"S_DIAGBLUETRAMPOLINE4",
"S_DIAGBLUETRAMPOLINE5",
// Booster
"S_BOOSTERSOUND",
"S_YELLOWBOOSTERROLLER",
@ -3185,37 +3255,28 @@ const char *const STATE_LIST[] = { // array length left dynamic for sanity testi
"S_RINGEXPLODE",
"S_COIN1",
"S_COIN2",
"S_COIN3",
// Mario-specific stuff
"S_COIN",
"S_COINSPARKLE1",
"S_COINSPARKLE2",
"S_COINSPARKLE3",
"S_COINSPARKLE4",
"S_GOOMBA1",
"S_GOOMBA1B",
"S_GOOMBA2",
"S_GOOMBA3",
"S_GOOMBA4",
"S_GOOMBA5",
"S_GOOMBA6",
"S_GOOMBA7",
"S_GOOMBA8",
"S_GOOMBA9",
"S_GOOMBA_DEAD",
"S_GOOMBA_DEAD2",
"S_GOOMBA_DEAD3",
"S_BLUEGOOMBA1",
"S_BLUEGOOMBA1B",
"S_BLUEGOOMBA2",
"S_BLUEGOOMBA3",
"S_BLUEGOOMBA4",
"S_BLUEGOOMBA5",
"S_BLUEGOOMBA6",
"S_BLUEGOOMBA7",
"S_BLUEGOOMBA8",
"S_BLUEGOOMBA9",
"S_BLUEGOOMBA_DEAD",
// Mario-specific stuff
"S_BLUEGOOMBA_DEAD2",
"S_BLUEGOOMBA_DEAD3",
"S_FIREFLOWER1",
"S_FIREFLOWER2",
"S_FIREFLOWER3",
@ -3223,6 +3284,13 @@ const char *const STATE_LIST[] = { // array length left dynamic for sanity testi
"S_FIREBALL",
"S_FIREBALLTRAIL1",
"S_FIREBALLTRAIL2",
"S_GREENKOOPASPAWN",
"S_GREENKOOPA1",
"S_GREENKOOPA2",
"S_GREENKOOPA3",
"S_GREENKOOPA4",
"S_GREENKOOPADEATH1",
"S_GREENKOOPADEATH2",
"S_SHELL",
"S_PUMA_START1",
"S_PUMA_START2",
@ -3248,6 +3316,68 @@ const char *const STATE_LIST[] = { // array length left dynamic for sanity testi
"S_MARIOBUSH1",
"S_MARIOBUSH2",
"S_TOAD",
"S_PTZSHROOM",
"S_PTZFLAG1",
"S_PTZFLAG2",
"S_PTZFLAG3",
"S_PTZFLAG4",
"S_PTZFLAG5",
"S_MARIOBUSH",
"S_BSBSHROOM",
"S_BLBSHROOM",
"S_BNWSHROOM",
"S_REDMFLOWER",
"S_BLUEMFLOWER",
"S_YELLOWMFLOWER",
"S_WHITEDANDELION",
"S_MAR64TREE",
// Power up mushrooms
"S_LIFESHROOM",
"S_LIFESHROOM2",
"S_LIFESHROOMD",
"S_LIFESHROOM_INVISIBLE",
"S_LIFESHROOM_INVISIBLE_TOUCH",
"S_POISONSHROOM",
"S_POISONSHROOM2",
"S_POISONSHROOMD",
"S_NUKESHROOM",
"S_NUKESHROOM2",
"S_NUKESHROOMD",
"S_FORCESHROOM",
"S_FORCESHROOM2",
"S_FORCESHROOMD",
"S_ATTRACTSHROOM",
"S_ATTRACTSHROOM2",
"S_ATTRACTSHROOMD",
"S_ELEMENTALSHROOM",
"S_ELEMENTALSHROOM2",
"S_ELEMENTALSHROOMD",
"S_CLOUDSHROOM",
"S_CLOUDSHROOM2",
"S_CLOUDSHROOMD",
"S_STARMAN",
"S_STARMAN1",
"S_STARMAN2",
"S_STARMAN3",
"S_STARMAND",
"S_SPEEDWINGS",
"S_SPEEDWINGSD",
"S_PARTICLEPICKUP1",
"S_PARTICLEPICKUP2",
"S_1000SCOREAWARD",
"S_POWERUPAWARD",
"S_POWERUPAWARD1",
"S_POWERUPAWARD2",
// Nights-specific stuff
"S_NIGHTSDRONE_MAN1",
@ -3550,8 +3680,19 @@ const char *const STATE_LIST[] = { // array length left dynamic for sanity testi
"S_REDBRICKDEBRIS",
"S_BLUEBRICKDEBRIS",
"S_YELLOWBRICKDEBRIS",
"S_MARIOBRICKDEBRIS",
"S_MARIOBRICKDEBRISS",
"S_MARIOBRICKDEBRISB",
"S_MARIOBRICKDEBRISC",
"S_MARIOBRICKDEBRISM",
"S_NAMECHECK",
// LJ Knuckles
"S_OLDK_STND",
"S_OLDK_DIE0",
"S_OLDK_DIE1",
"S_OLDK_DIE2",
};
// RegEx to generate this from info.h: ^\tMT_([^,]+), --> \t"MT_\1",
@ -3726,6 +3867,16 @@ const char *const MOBJTYPE_LIST[] = { // array length left dynamic for sanity t
"MT_REDHORIZ",
"MT_BLUEHORIZ",
"MT_YELLOWTRAMPOLINE",
"MT_REDTRAMPOLINE",
"MT_BLUETRAMPOLINE",
"MT_HORIZYELLOWTRAMPOLINE",
"MT_HORIZREDTRAMPOLINE",
"MT_HORIZBLUETRAMPOLINE",
"MT_DIAGYELLOWTRAMPOLINE",
"MT_DIAGREDTRAMPOLINE",
"MT_DIAGBLUETRAMPOLINE",
"MT_BOOSTERSEG",
"MT_BOOSTERROLLER",
"MT_YELLOWBOOSTER",
@ -4023,6 +4174,10 @@ const char *const MOBJTYPE_LIST[] = { // array length left dynamic for sanity t
"MT_LAMPPOST2", // with snow
"MT_HANGSTAR",
"MT_MISTLETOE",
"MT_SSZTREE",
"MT_SSZTREE_BRANCH",
"MT_SSZTREE2",
"MT_SSZTREE2_BRANCH",
// Xmas GFZ bushes
"MT_XMASBLUEBERRYBUSH",
"MT_XMASBERRYBUSH",
@ -4102,6 +4257,9 @@ const char *const MOBJTYPE_LIST[] = { // array length left dynamic for sanity t
// Misc scenery
"MT_DBALL",
"MT_EGGSTATUE2",
"MT_GINE",
"MT_PPAL",
"MT_PPEL",
// Powerup Indicators
"MT_ELEMENTAL_ORB", // Elemental shield mobj
@ -4219,6 +4377,7 @@ const char *const MOBJTYPE_LIST[] = { // array length left dynamic for sanity t
"MT_FIREFLOWER",
"MT_FIREBALL",
"MT_FIREBALLTRAIL",
"MT_GREENKOOPA",
"MT_SHELL",
"MT_PUMA",
"MT_PUMATRAIL",
@ -4229,6 +4388,30 @@ const char *const MOBJTYPE_LIST[] = { // array length left dynamic for sanity t
"MT_MARIOBUSH1",
"MT_MARIOBUSH2",
"MT_TOAD",
"MT_PTZSHROOM",
"MT_PTZFLAG",
"MT_BSBSHROOM",
"MT_BLBSHROOM",
"MT_BNWSHROOM",
"MT_MARIOBUSH",
"MT_REDMFLOWER",
"MT_BLUEMFLOWER",
"MT_YELLOWMFLOWER",
"MT_WHITEDANDELION",
"MT_MAR64TREE",
// Power up mushrooms
"MT_LIFESHROOM",
"MT_LIFESHROOM_INVISIBLE",
"MT_POISONSHROOM",
"MT_NUKESHROOM",
"MT_FORCESHROOM",
"MT_ATTRACTSHROOM",
"MT_ELEMENTALSHROOM",
"MT_CLOUDSHROOM",
"MT_STARMAN",
"MT_SPEEDWINGS",
"MT_POWERUPAWARD",
// NiGHTS Stuff
"MT_AXIS",
@ -4326,9 +4509,16 @@ const char *const MOBJTYPE_LIST[] = { // array length left dynamic for sanity t
"MT_REDBRICKDEBRIS",
"MT_BLUEBRICKDEBRIS",
"MT_YELLOWBRICKDEBRIS",
"MT_MARIOBRICKDEBRIS",
"MT_MARIOBRICKDEBRISS",
"MT_MARIOBRICKDEBRISB",
"MT_MARIOBRICKDEBRISC",
"MT_MARIOBRICKDEBRISM",
"MT_NAMECHECK",
"MT_RAY",
"MT_OLDK",
};
const char *const MOBJFLAG_LIST[] = {

View file

@ -20,6 +20,7 @@ boolean deh_loaded = false;
boolean gamedataadded = false;
boolean titlechanged = false;
boolean introchanged = false;
boolean bootmapchanged = false;
static int dbg_line;
static INT32 deh_num_warning = 0;
@ -199,7 +200,7 @@ static void DEH_LoadDehackedFile(MYFILE *f, boolean mainfile)
deh_num_warning = 0;
gamedataadded = titlechanged = introchanged = false;
gamedataadded = titlechanged = introchanged = bootmapchanged = false;
// it doesn't test the version of SRB2 and version of dehacked file
dbg_line = -1; // start at -1 so the first line is 0.
@ -590,7 +591,12 @@ static void DEH_LoadDehackedFile(MYFILE *f, boolean mainfile)
if (gamestate == GS_TITLESCREEN)
{
if (introchanged)
if (bootmapchanged && bootmap)
{
menuactive = false;
D_MapChange(bootmap, gametype, ultimatemode, true, 0, false, false);
}
else if (introchanged)
{
menuactive = false;
I_UpdateMouseGrab();

View file

@ -39,6 +39,7 @@ extern boolean deh_loaded;
extern boolean gamedataadded;
extern boolean titlechanged;
extern boolean introchanged;
extern boolean bootmapchanged;
#define MAX_ACTION_RECURSION 30
extern const char *luaactions[MAX_ACTION_RECURSION];

View file

@ -168,7 +168,7 @@ extern char logfilename[1024];
// Does this version require an added patch file?
// Comment or uncomment this as necessary.
#define USE_PATCH_DTA
//#define USE_PATCH_DTA
// Enforce a limit of loaded WAD files.
//#define ENFORCE_WAD_LIMIT

View file

@ -1080,6 +1080,7 @@ static const char *credits[] = {
"Louis-Antoine \"LJ Sonic\" de Moulins", // de Rochefort doesn't quite fit on the screen sorry lol
"John \"JTE\" Muniz",
"Colin \"Sonict\" Pfaff",
"\"Radicalicious\"",
"James \"james\" Robert Roman",
"Sean \"Sryder13\" Ryder",
"Ehab \"Wolfy\" Saeed",
@ -1103,7 +1104,8 @@ static const char *credits[] = {
"\"ChrispyPixels\"",
"Paul \"Boinciel\" Clempson",
"Sally \"TehRealSalt\" Cochenour",
"\"Dave Lite\"",
"\"DaJumpJump\"", // New Ringslinger graphics (2.2.14)
"\"DeltaSanic\"",
"Desmond \"Blade\" DesJardins",
"Sherman \"CoatRack\" DesJardins",
"\"DirkTheHusky\"",
@ -1123,10 +1125,12 @@ static const char *credits[] = {
"\"MotorRoach\"",
"Phillip \"TelosTurntable\" Robinson",
"\"Scizor300\"",
"\"Skydusk\"",
"Wessel \"sphere\" Smit",
"David \"Instant Sonic\" Spencer Jr.",
"\"SSNTails\"",
"Daniel \"Inazuma\" Trinh",
"Samuel \"Spectorious\" Tuttle",
"\"VelocitOni\"",
"Jarrett \"JEV3\" Voight",
"",
@ -1135,6 +1139,7 @@ static const char *credits[] = {
"Victor \"VAdaPEGA\" Ara\x1Fjo", // Araújo
"Malcolm \"RedXVI\" Brown",
"Dave \"DemonTomatoDave\" Bulmer",
"Dan Cidoni", // aka Krabs
"Paul \"Boinciel\" Clempson",
"\"Cyan Helkaraxe\"",
"Claire \"clairebun\" Ellis",
@ -1153,24 +1158,32 @@ static const char *credits[] = {
"Colette \"fickleheart\" Bordelon",
"Hank \"FuriousFox\" Brannock",
"Matthew \"Fawfulfan\" Chapman",
"Dan Cidoni", // aka Krabs
"Paul \"Boinciel\" Clempson",
"Sally \"TehRealSalt\" Cochenour",
"Desmond \"Blade\" DesJardins",
"Sherman \"CoatRack\" DesJardins",
"Ben \"Mystic\" Geyer",
"Nathan \"Jazz\" Giroux",
"\"GomaTheMascar\"",
"Vivian \"toaster\" Grannell",
"James \"SeventhSentinel\" Hall",
"Kepa \"Nev3r\" Iceta",
"Thomas \"Shadow Hog\" Igoe",
"Mujamel \"MK\" Khan",
"\"Kaito Sinclaire\"",
"Alexander \"DrTapeworm\" Moench-Ford",
"\"orbitalviolet\"", // summit showdown hehehehe (aka Evertone)
"\"Radicalicious\"",
"\"Revan\"",
"Anna \"QueenDelta\" Sandlin",
"\"Skydusk\"",
"Wessel \"sphere\" Smit",
"\"SSNTails\"",
"Aaron \"Othius\" Stojkov",
"Rob Tisdell",
"\"Torgo\"",
"Samuel \"Spectorious\" Tuttle",
"Jarrett \"JEV3\" Voight",
"Johnny \"Sonikku\" Wallbank",
"Marco \"mazmazz\" Zafra",
@ -3645,7 +3658,7 @@ static void F_DrawContinueCharacter(INT32 dx, INT32 dy, UINT8 n)
(
HUD_HOOK(continue), luahuddrawlist_continue[n], contPlayers[n],
dx, dy, contskins[n]->highresscale,
(INT32)(&contskins[n] - skins), cont_spr2[n][0], cont_spr2[n][1], cont_spr2[n][2] + 1, contColors[n], // add 1 to rotation to convert internal angle numbers (0-7) to WAD editor angle numbers (1-8)
(INT32)(contskins[n]->skinnum), cont_spr2[n][0], cont_spr2[n][1], cont_spr2[n][2] + 1, contColors[n], // add 1 to rotation to convert internal angle numbers (0-7) to WAD editor angle numbers (1-8)
imcontinuing ? continuetime : timetonext, imcontinuing
);
}
@ -3711,7 +3724,7 @@ void F_ContinueDrawer(void)
else if (ncontinues > 10)
{
if (!(continuetime & 1) || continuetime > 17)
V_DrawContinueIcon(x, 68, 0, (INT32)(&contskins[0] - skins), contColors[0]);
V_DrawContinueIcon(x, 68, 0, contskins[0]->skinnum, contColors[0]);
V_DrawScaledPatch(x+12, 66, 0, stlivex);
V_DrawRightAlignedString(x+38, 64, 0,
va("%d",(imcontinuing ? ncontinues-1 : ncontinues)));
@ -3725,7 +3738,7 @@ void F_ContinueDrawer(void)
{
if (i == (ncontinues/2) && ((continuetime & 1) || continuetime > 17))
continue;
V_DrawContinueIcon(x - (i*30), 68, 0, (INT32)(&contskins[0] - skins), contColors[0]);
V_DrawContinueIcon(x - (i*30), 68, 0, contskins[0]->skinnum, contColors[0]);
}
x = BASEVIDWIDTH>>1;
}

View file

@ -1384,7 +1384,7 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer)
if (PLAYERINPUTDOWN(ssplayer, GC_SPIN) || (usejoystick && axis > 0))
cmd->buttons |= BT_SPIN;
if (gamestate != GS_LEVEL) // not in a level, don't build anything else
if (gamestate == GS_INTRO) // prevent crash in intro
{
cmd->angleturn = ticcmd_oldangleturn[forplayer];
cmd->aiming = G_ClipAimingPitch(myaiming);
@ -1722,7 +1722,7 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer)
// At this point, cmd doesn't contain the final angle yet,
// So we need to temporarily transform it so Lua scripters
// don't need to handle it differently than in other hooks.
if (addedtogame)
if (addedtogame && gamestate == GS_LEVEL)
{
INT16 extra = ticcmd_oldangleturn[forplayer] - player->oldrelangleturn;
INT16 origangle = cmd->angleturn;

View file

@ -395,6 +395,8 @@ light_t *t_lspr[NUMSPRITES] =
&lspr[NOLIGHT], // SPR_XMS4
&lspr[NOLIGHT], // SPR_XMS5
&lspr[NOLIGHT], // SPR_XMS6
&lspr[NOLIGHT], // SPR_SNTT
&lspr[NOLIGHT], // SPR_SSTT
&lspr[NOLIGHT], // SPR_FHZI
&lspr[NOLIGHT], // SPR_ROSY
@ -428,6 +430,8 @@ light_t *t_lspr[NUMSPRITES] =
// Misc Scenery
&lspr[NOLIGHT], // SPR_STLG
&lspr[NOLIGHT], // SPR_DBAL
&lspr[NOLIGHT], // SPR_GINE
&lspr[NOLIGHT], // SPR_PPAL
// Powerup Indicators
&lspr[NOLIGHT], // SPR_ARMA
@ -481,6 +485,15 @@ light_t *t_lspr[NUMSPRITES] =
&lspr[NOLIGHT], // SPR_SSWY
&lspr[NOLIGHT], // SPR_SSWR
&lspr[NOLIGHT], // SPR_SSWB
&lspr[NOLIGHT], // SPR_MPRY
&lspr[NOLIGHT], // SPR_MPRR
&lspr[NOLIGHT], // SPR_MPRB
&lspr[NOLIGHT], // SPR_MSWY
&lspr[NOLIGHT], // SPR_MSWR
&lspr[NOLIGHT], // SPR_MSWB
&lspr[NOLIGHT], // SPR_MDIY
&lspr[NOLIGHT], // SPR_MDIR
&lspr[NOLIGHT], // SPR_MDIB
&lspr[NOLIGHT], // SPR_BSTY
&lspr[NOLIGHT], // SPR_BSTR
@ -539,6 +552,7 @@ light_t *t_lspr[NUMSPRITES] =
&lspr[NOLIGHT], // SPR_BGOM
&lspr[REDBALL_L], // SPR_FFWR
&lspr[SMALLREDBALL_L], // SPR_FBLL
&lspr[NOLIGHT], // SPR_MKOP
&lspr[NOLIGHT], // SPR_SHLL
&lspr[REDBALL_L], // SPR_PUMA
&lspr[NOLIGHT], // SPR_HAMM
@ -609,11 +623,30 @@ light_t *t_lspr[NUMSPRITES] =
&lspr[NOLIGHT], // SPR_BRIR
&lspr[NOLIGHT], // SPR_BRIB
&lspr[NOLIGHT], // SPR_BRIY
&lspr[NOLIGHT], // SPR_MBRI
&lspr[NOLIGHT], // SPR_MBRS
&lspr[NOLIGHT], // SPR_MBRB
&lspr[NOLIGHT], // SPR_MBRC
&lspr[NOLIGHT], // SPR_MTRI
&lspr[NOLIGHT], // SPR_MARS
&lspr[NOLIGHT], // SPR_MRFL
&lspr[NOLIGHT], // SPR_MAUH
&lspr[NOLIGHT], // SPR_MBSA
&lspr[NOLIGHT], // SPR_MBSB
&lspr[NOLIGHT], // SPR_MBSC
&lspr[NOLIGHT], // SPR_MFRE
&lspr[NOLIGHT], // SPR_MFYE
&lspr[NOLIGHT], // SPR_MFBE
&lspr[NOLIGHT], // SPR_MFWD
&lspr[NOLIGHT], // SPR_MUS3
// Gravity Well Objects
&lspr[NOLIGHT], // SPR_GWLG
&lspr[NOLIGHT], // SPR_GWLR
// LJ Knuckles
&lspr[NOLIGHT], // SPR_OLDK,
// Free slots
&lspr[NOLIGHT],
&lspr[NOLIGHT],

View file

@ -5794,6 +5794,7 @@ void HWR_AddCommands(void)
CV_RegisterVar(&cv_glskydome);
CV_RegisterVar(&cv_glspritebillboarding);
CV_RegisterVar(&cv_glfakecontrast);
CV_RegisterVar(&cv_glslopecontrast);
CV_RegisterVar(&cv_glshearing);
CV_RegisterVar(&cv_glshaders);

View file

@ -1193,6 +1193,90 @@ static void adjustTextureCoords(model_t *model, patch_t *patch)
model->max_t = gpatch->max_t;
}
static INT32 GetAnimDuration(mobj_t *mobj) //part of p_mobj's setplayermobjstate logic, used to make sure that anim durations are actually correct when the speed gets adjusted on players
{
player_t *player = mobj->player;
INT32 tics = mobj->state->tics;
if (!(mobj->frame & FF_ANIMATE) && mobj->anim_duration) //set manually by something through lua
return mobj->anim_duration;
if (!player && mobj->type == MT_TAILSOVERLAY && mobj->tracer) //so tails overlays interpolate properly
player = mobj->tracer->player;
if (player)
{
if (player->panim == PA_EDGE && (player->charflags & SF_FASTEDGE))
tics = 2;
else if (player->powers[pw_tailsfly] && (!(player->mo->eflags & MFE_UNDERWATER) || (mobj->type == MT_PLAYER))) //tailsoverlay does not get adjusted from these rules when underwater
{
if (player->fly1 > 0)
tics = 1;
else if (!(player->mo->eflags & MFE_UNDERWATER))
tics = 2;
else
tics = 4;
}
else if (!(disableSpeedAdjust || player->charflags & SF_NOSPEEDADJUST))
{
fixed_t speed;// = FixedDiv(player->speed, FixedMul(mobj->scale, player->mo->movefactor));
if (player->panim == PA_FALL)
{
speed = FixedDiv(abs(mobj->momz), mobj->scale);
if (speed < 10<<FRACBITS)
tics = 4;
else if (speed < 20<<FRACBITS)
tics = 3;
else if (speed < 30<<FRACBITS)
tics = 2;
else
tics = 1;
}
else if (player->panim == PA_ABILITY2 && player->charability2 == CA2_SPINDASH)
{
fixed_t step = (player->maxdash - player->mindash)/4;
speed = (player->dashspeed - player->mindash);
if (speed > 3*step)
tics = 1;
else if (speed > step)
tics = 2;
else
tics = 3;
}
else
{
speed = FixedDiv(player->speed, FixedMul(mobj->scale, player->mo->movefactor));
if (player->panim == PA_ROLL || player->panim == PA_JUMP)
{
if (speed > 16<<FRACBITS)
tics = 1;
else
tics = 2;
}
else if (P_IsObjectOnGround(mobj) || ((player->charability == CA_FLOAT || player->charability == CA_SLOWFALL) && player->secondjump == 1) || player->powers[pw_super]) // Only if on the ground or superflying.
{
if (player->panim == PA_WALK)
{
if (speed > 12<<FRACBITS)
tics = 2;
else if (speed > 6<<FRACBITS)
tics = 3;
else
tics = 4;
}
else if ((player->panim == PA_RUN) || (player->panim == PA_DASH))
{
if (speed > 52<<FRACBITS)
tics = 1;
else
tics = 2;
}
}
}
}
}
return tics;
}
//
// HWR_DrawModel
//
@ -1266,7 +1350,7 @@ boolean HWR_DrawModel(gl_vissprite_t *spr)
{
patch_t *gpatch, *blendgpatch;
GLPatch_t *hwrPatch = NULL, *hwrBlendPatch = NULL;
float durs = (float)spr->mobj->state->tics;
float durs = GetAnimDuration(spr->mobj);
float tics = (float)spr->mobj->tics;
const boolean papersprite = (R_ThingIsPaperSprite(spr->mobj) && !R_ThingIsFloorSprite(spr->mobj));
const UINT8 flip = (UINT8)(!(spr->mobj->eflags & MFE_VERTICALFLIP) != !R_ThingVerticallyFlipped(spr->mobj));
@ -1287,8 +1371,8 @@ boolean HWR_DrawModel(gl_vissprite_t *spr)
}
// Apparently people don't like jump frames like that, so back it goes
//if (tics > durs)
//durs = tics;
if (tics > durs)
durs = tics;
// Make linkdraw objects use their tracer's alpha value
fixed_t newalpha = spr->mobj->alpha;
@ -1607,7 +1691,6 @@ boolean HWR_DrawModel(gl_vissprite_t *spr)
HWD.pfnDrawModel(md2->model, frame, durs, tics, nextFrame, &p, md2->scale * xs, md2->scale * ys, flip, hflip, &Surf);
}
}
return true;
}

View file

@ -117,7 +117,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, // handle to DLL module
#define pwglDeleteContext wglDeleteContext;
#define pwglMakeCurrent wglMakeCurrent;
#else
static HMODULE OGL32, GLU32;
static HMODULE OGL32;
typedef void *(WINAPI *PFNwglGetProcAddress) (const char *);
static PFNwglGetProcAddress pwglGetProcAddress;
typedef HGLRC (WINAPI *PFNwglCreateContext) (HDC hdc);
@ -132,13 +132,6 @@ static PFNwglMakeCurrent pwglMakeCurrent;
void *GetGLFunc(const char *proc)
{
void *func = NULL;
if (strncmp(proc, "glu", 3) == 0)
{
if (GLU32)
func = GetProcAddress(GLU32, proc);
else
return NULL;
}
if (pwglGetProcAddress)
func = pwglGetProcAddress(proc);
if (!func)
@ -155,8 +148,6 @@ boolean LoadGL(void)
if (!OGL32)
return 0;
GLU32 = LoadLibrary("GLU32.DLL");
pwglGetProcAddress = GetGLFunc("wglGetProcAddress");
pwglCreateContext = GetGLFunc("wglCreateContext");
pwglDeleteContext = GetGLFunc("wglDeleteContext");
@ -528,7 +519,6 @@ EXPORT void HWRAPI(Shutdown) (void)
ReleaseDC(hWnd, hDC);
hDC = NULL;
}
FreeLibrary(GLU32);
FreeLibrary(OGL32);
GL_DBG_Printf ("HWRAPI Shutdown(DONE)\n");
}

View file

@ -96,6 +96,7 @@ static GLint min_filter = GL_LINEAR;
static GLint mag_filter = GL_LINEAR;
static GLint anisotropic_filter = 0;
static boolean model_lighting = false;
boolean supportMipMap = false;
const GLubyte *gl_version = NULL;
const GLubyte *gl_renderer = NULL;
@ -417,9 +418,6 @@ static PFNglCopyTexImage2D pglCopyTexImage2D;
typedef void (APIENTRY * PFNglCopyTexSubImage2D) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
static PFNglCopyTexSubImage2D pglCopyTexSubImage2D;
#endif
/* GLU functions */
typedef GLint (APIENTRY * PFNgluBuild2DMipmaps) (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *data);
static PFNgluBuild2DMipmaps pgluBuild2DMipmaps;
/* 1.2 functions for 3D textures */
typedef void (APIENTRY * PFNglTexImage3D) (GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
@ -708,9 +706,6 @@ void SetupGLFunc4(void)
pglUniform3fv = GetGLFunc("glUniform3fv");
pglGetUniformLocation = GetGLFunc("glGetUniformLocation");
#endif
// GLU
pgluBuild2DMipmaps = GetGLFunc("gluBuild2DMipmaps");
}
EXPORT boolean HWRAPI(InitShaders) (void)
@ -1617,7 +1612,8 @@ EXPORT void HWRAPI(UpdateTexture) (GLMipmap_t *pTexInfo)
//pglTexImage2D(GL_TEXTURE_2D, 0, GL_ALPHA, w, h, 0, GL_RGBA, GL_UNSIGNED_BYTE, ptex);
if (MipMap)
{
pgluBuild2DMipmaps(GL_TEXTURE_2D, GL_LUMINANCE_ALPHA, w, h, GL_RGBA, GL_UNSIGNED_BYTE, ptex);
pglTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_TRUE);
pglTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE_ALPHA, w, h, 0, GL_RGBA, GL_UNSIGNED_BYTE, ptex);
pglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_LOD, 0);
if (pTexInfo->flags & TF_TRANSPARENT)
pglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LOD, 0); // No mippmaps on transparent stuff
@ -1638,7 +1634,8 @@ EXPORT void HWRAPI(UpdateTexture) (GLMipmap_t *pTexInfo)
//pglTexImage2D(GL_TEXTURE_2D, 0, GL_ALPHA, w, h, 0, GL_RGBA, GL_UNSIGNED_BYTE, ptex);
if (MipMap)
{
pgluBuild2DMipmaps(GL_TEXTURE_2D, GL_ALPHA, w, h, GL_RGBA, GL_UNSIGNED_BYTE, ptex);
pglTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_TRUE);
pglTexImage2D(GL_TEXTURE_2D, 0, GL_ALPHA, w, h, 0, GL_RGBA, GL_UNSIGNED_BYTE, ptex);
pglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_LOD, 0);
if (pTexInfo->flags & TF_TRANSPARENT)
pglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LOD, 0); // No mippmaps on transparent stuff
@ -1658,7 +1655,8 @@ EXPORT void HWRAPI(UpdateTexture) (GLMipmap_t *pTexInfo)
{
if (MipMap)
{
pgluBuild2DMipmaps(GL_TEXTURE_2D, textureformatGL, w, h, GL_RGBA, GL_UNSIGNED_BYTE, ptex);
pglTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_TRUE);
pglTexImage2D(GL_TEXTURE_2D, 0, textureformatGL, w, h, 0, GL_RGBA, GL_UNSIGNED_BYTE, ptex);
// Control the mipmap level of detail
pglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_LOD, 0); // the lower the number, the higer the detail
if (pTexInfo->flags & TF_TRANSPARENT)
@ -2241,7 +2239,7 @@ EXPORT void HWRAPI(SetSpecialState) (hwdspecialstate_t IdState, INT32 Value)
mag_filter = GL_LINEAR;
min_filter = GL_NEAREST;
}
if (!pgluBuild2DMipmaps)
if (!supportMipMap)
{
MipMap = GL_FALSE;
min_filter = GL_LINEAR;

View file

@ -35,7 +35,6 @@
#else
#include <GL/gl.h>
#include <GL/glu.h>
#ifdef STATIC_OPENGL // Because of the 1.3 functions, you'll need GLext to compile it if static
#define GL_GLEXT_PROTOTYPES
@ -127,6 +126,7 @@ extern GLint screen_width;
extern GLint screen_height;
extern GLbyte screen_depth;
extern GLint maximumAnisotropy;
extern boolean supportMipMap;
/** \brief OpenGL flags for video driver
*/

View file

@ -590,6 +590,45 @@ static void Command_CSay_f(void)
UINT8 spam_tokens[MAXPLAYERS] = { 1 }; // fill the buffer with 1 so the motd can be sent.
tic_t spam_tics[MAXPLAYERS];
static const char *GetChatColorFromSkinColor(INT32 skincolor)
{
const char *textcolor = NULL;
UINT16 chatcolor = skincolors[skincolor].chatcolor;
if (!chatcolor || chatcolor%0x1000 || chatcolor>V_INVERTMAP)
textcolor = "\x80";
else if (chatcolor == V_MAGENTAMAP)
textcolor = "\x81";
else if (chatcolor == V_YELLOWMAP)
textcolor = "\x82";
else if (chatcolor == V_GREENMAP)
textcolor = "\x83";
else if (chatcolor == V_BLUEMAP)
textcolor = "\x84";
else if (chatcolor == V_REDMAP)
textcolor = "\x85";
else if (chatcolor == V_GRAYMAP)
textcolor = "\x86";
else if (chatcolor == V_ORANGEMAP)
textcolor = "\x87";
else if (chatcolor == V_SKYMAP)
textcolor = "\x88";
else if (chatcolor == V_PURPLEMAP)
textcolor = "\x89";
else if (chatcolor == V_AQUAMAP)
textcolor = "\x8a";
else if (chatcolor == V_PERIDOTMAP)
textcolor = "\x8b";
else if (chatcolor == V_AZUREMAP)
textcolor = "\x8c";
else if (chatcolor == V_BROWNMAP)
textcolor = "\x8d";
else if (chatcolor == V_ROSYMAP)
textcolor = "\x8e";
else if (chatcolor == V_INVERTMAP)
textcolor = "\x8f";
return textcolor;
}
/** Receives a message, processing an ::XD_SAY command.
* \sa DoSayCommand
* \author Graue <graue@oceanbase.org>
@ -599,6 +638,7 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum)
SINT8 target;
UINT8 flags;
const char *dispname;
char buf[HU_MAXMSGLEN + 1];
char *msg;
boolean action = false;
char *ptr;
@ -608,8 +648,8 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum)
target = READSINT8(*p);
flags = READUINT8(*p);
msg = (char *)*p;
SKIPSTRINGL(*p, HU_MAXMSGLEN + 1);
msg = buf;
READSTRINGL(*p, msg, HU_MAXMSGLEN + 1);
if ((cv_mute.value || players[playernum].muted || flags & (HU_CSAY|HU_SERVER_SAY)) && playernum != serverplayer && !(IsPlayerAdmin(playernum)))
{
@ -709,51 +749,27 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum)
{
if (players[playernum].ctfteam == 1) // red
{
cstart = "\x85";
textcolor = "\x85";
cstart = textcolor = GetChatColorFromSkinColor(skincolor_redteam);
}
else // blue
{
cstart = "\x84";
textcolor = "\x84";
cstart = textcolor = GetChatColorFromSkinColor(skincolor_blueteam);
}
}
else
{
UINT16 chatcolor = skincolors[players[playernum].skincolor].chatcolor;
if (!chatcolor || chatcolor%0x1000 || chatcolor>V_INVERTMAP)
cstart = "\x80";
else if (chatcolor == V_MAGENTAMAP)
cstart = "\x81";
else if (chatcolor == V_YELLOWMAP)
cstart = "\x82";
else if (chatcolor == V_GREENMAP)
cstart = "\x83";
else if (chatcolor == V_BLUEMAP)
cstart = "\x84";
else if (chatcolor == V_REDMAP)
cstart = "\x85";
else if (chatcolor == V_GRAYMAP)
cstart = "\x86";
else if (chatcolor == V_ORANGEMAP)
cstart = "\x87";
else if (chatcolor == V_SKYMAP)
cstart = "\x88";
else if (chatcolor == V_PURPLEMAP)
cstart = "\x89";
else if (chatcolor == V_AQUAMAP)
cstart = "\x8a";
else if (chatcolor == V_PERIDOTMAP)
cstart = "\x8b";
else if (chatcolor == V_AZUREMAP)
cstart = "\x8c";
else if (chatcolor == V_BROWNMAP)
cstart = "\x8d";
else if (chatcolor == V_ROSYMAP)
cstart = "\x8e";
else if (chatcolor == V_INVERTMAP)
cstart = "\x8f";
cstart = GetChatColorFromSkinColor(players[playernum].skincolor);
if (G_GametypeHasTeams())
{
if (players[playernum].ctfteam == 1) // red
{
cstart = GetChatColorFromSkinColor(skincolor_redteam);
}
else // blue
{
cstart = GetChatColorFromSkinColor(skincolor_blueteam);
}
}
}
prefix = cstart;

1462
src/info.c

File diff suppressed because it is too large Load diff

View file

@ -857,6 +857,8 @@ typedef enum sprite
SPR_XMS4, // Lamppost
SPR_XMS5, // Hanging Star
SPR_XMS6, // Mistletoe
SPR_SNTT, // Silver Shiver tree
SPR_SSTT, // Silver Shiver tree with snow
SPR_FHZI, // FHZ Ice
SPR_ROSY,
@ -890,6 +892,8 @@ typedef enum sprite
// Misc Scenery
SPR_STLG, // Stalagmites
SPR_DBAL, // Disco
SPR_GINE, // Crystalline Heights tree
SPR_PPAL, // Pristine Shores palm trees
// Powerup Indicators
SPR_ARMA, // Armageddon Shield Orb
@ -943,6 +947,15 @@ typedef enum sprite
SPR_SSWY, // Yellow Side Spring
SPR_SSWR, // Red Side Spring
SPR_SSWB, // Blue Side Spring
SPR_MPRY, // Yellow trampoline
SPR_MPRR, // Red trampoline
SPR_MPRB, // Blue trampoline
SPR_MSWY, // Yellow horizontal trampoline
SPR_MSWR, // Red horizontal trampoline
SPR_MSWB, // Blue horizontal trampoline
SPR_MDIY, // Yellow diagonal trampoline
SPR_MDIR, // Red diagonal trampoline
SPR_MDIB, // Blue diagonal trampoline
SPR_BSTY, // Yellow Booster
SPR_BSTR, // Red Booster
@ -1001,6 +1014,7 @@ typedef enum sprite
SPR_BGOM,
SPR_FFWR,
SPR_FBLL,
SPR_MKOP,
SPR_SHLL,
SPR_PUMA,
SPR_HAMM,
@ -1010,6 +1024,29 @@ typedef enum sprite
SPR_MUS1,
SPR_MUS2,
SPR_TOAD,
SPR_MARS,
SPR_MRFL,
SPR_MAUH,
SPR_MBSA,
SPR_MBSB,
SPR_MBSC,
SPR_MFRE,
SPR_MFYE,
SPR_MFBE,
SPR_MFWD,
SPR_MUS3,
// Mario powerups
SPR_MSIV, // invincibility
SPR_MS1P, // 1-up
SPR_MSAT, // attract
SPR_MSFO, // force
SPR_MSAR, // nuke
SPR_MSWW, // whirlwind
SPR_MSEL, // elemental
SPR_MSSP, // speed shoes
SPR_MEGH, // poison
SPR_UPPB, // particle pickup
// NiGHTS Stuff
SPR_NDRN, // NiGHTS drone
@ -1071,11 +1108,19 @@ typedef enum sprite
SPR_BRIR, // CEZ3 colored bricks
SPR_BRIB,
SPR_BRIY,
SPR_MBRI,
SPR_MBRS,
SPR_MBRB,
SPR_MBRC,
SPR_MTRI,
// Gravity Well Objects
SPR_GWLG,
SPR_GWLR,
// LJ Knuckles
SPR_OLDK,
SPR_FIRSTFREESLOT,
SPR_LASTFREESLOT = SPR_FIRSTFREESLOT + NUMSPRITEFREESLOTS - 1,
NUMSPRITES
@ -3060,6 +3105,10 @@ typedef enum state
S_LAMPPOST2, // with snow
S_HANGSTAR,
S_MISTLETOE,
S_SSZTREE,
S_SSZTREE_BRANCH,
S_SSZTREE2,
S_SSZTREE2_BRANCH,
// Xmas GFZ bushes
S_XMASBLUEBERRYBUSH,
S_XMASBERRYBUSH,
@ -3180,6 +3229,9 @@ typedef enum state
S_DBALL5,
S_DBALL6,
S_EGGSTATUE2,
S_GINE,
S_PPAL,
S_PPEL,
// Shield Orb
S_ARMA1,
@ -3728,6 +3780,69 @@ typedef enum state
S_BHORIZ7,
S_BHORIZ8,
// Yellow Trampoline
S_YELLOWTRAMPOLINE,
S_YELLOWTRAMPOLINE2,
S_YELLOWTRAMPOLINE3,
S_YELLOWTRAMPOLINE4,
S_YELLOWTRAMPOLINE5,
// Red Trampoline
S_REDTRAMPOLINE,
S_REDTRAMPOLINE2,
S_REDTRAMPOLINE3,
S_REDTRAMPOLINE4,
S_REDTRAMPOLINE5,
// Blue Trampoline
S_BLUETRAMPOLINE,
S_BLUETRAMPOLINE2,
S_BLUETRAMPOLINE3,
S_BLUETRAMPOLINE4,
S_BLUETRAMPOLINE5,
// Horizontal Yellow Trampoline
S_HORIZYELLOWTRAMPOLINE,
S_HORIZYELLOWTRAMPOLINE2,
S_HORIZYELLOWTRAMPOLINE3,
S_HORIZYELLOWTRAMPOLINE4,
S_HORIZYELLOWTRAMPOLINE5,
// Horizontal Red Trampoline
S_HORIZREDTRAMPOLINE,
S_HORIZREDTRAMPOLINE2,
S_HORIZREDTRAMPOLINE3,
S_HORIZREDTRAMPOLINE4,
S_HORIZREDTRAMPOLINE5,
// Horizontal Blue Trampoline
S_HORIZBLUETRAMPOLINE,
S_HORIZBLUETRAMPOLINE2,
S_HORIZBLUETRAMPOLINE3,
S_HORIZBLUETRAMPOLINE4,
S_HORIZBLUETRAMPOLINE5,
// Diagonal Yellow Trampoline
S_DIAGYELLOWTRAMPOLINE,
S_DIAGYELLOWTRAMPOLINE2,
S_DIAGYELLOWTRAMPOLINE3,
S_DIAGYELLOWTRAMPOLINE4,
S_DIAGYELLOWTRAMPOLINE5,
// Diagonal Red Trampoline
S_DIAGREDTRAMPOLINE,
S_DIAGREDTRAMPOLINE2,
S_DIAGREDTRAMPOLINE3,
S_DIAGREDTRAMPOLINE4,
S_DIAGREDTRAMPOLINE5,
// Diagonal Blue Trampoline
S_DIAGBLUETRAMPOLINE,
S_DIAGBLUETRAMPOLINE2,
S_DIAGBLUETRAMPOLINE3,
S_DIAGBLUETRAMPOLINE4,
S_DIAGBLUETRAMPOLINE5,
// Booster
S_BOOSTERSOUND,
S_YELLOWBOOSTERROLLER,
@ -4000,37 +4115,28 @@ typedef enum state
S_RINGEXPLODE,
S_COIN1,
S_COIN2,
S_COIN3,
// Mario-specific stuff
S_COIN,
S_COINSPARKLE1,
S_COINSPARKLE2,
S_COINSPARKLE3,
S_COINSPARKLE4,
S_GOOMBA1,
S_GOOMBA1B,
S_GOOMBA2,
S_GOOMBA3,
S_GOOMBA4,
S_GOOMBA5,
S_GOOMBA6,
S_GOOMBA7,
S_GOOMBA8,
S_GOOMBA9,
S_GOOMBA_DEAD,
S_GOOMBA_DEAD2,
S_GOOMBA_DEAD3,
S_BLUEGOOMBA1,
S_BLUEGOOMBA1B,
S_BLUEGOOMBA2,
S_BLUEGOOMBA3,
S_BLUEGOOMBA4,
S_BLUEGOOMBA5,
S_BLUEGOOMBA6,
S_BLUEGOOMBA7,
S_BLUEGOOMBA8,
S_BLUEGOOMBA9,
S_BLUEGOOMBA_DEAD,
// Mario-specific stuff
S_BLUEGOOMBA_DEAD2,
S_BLUEGOOMBA_DEAD3,
S_FIREFLOWER1,
S_FIREFLOWER2,
S_FIREFLOWER3,
@ -4038,6 +4144,13 @@ typedef enum state
S_FIREBALL,
S_FIREBALLTRAIL1,
S_FIREBALLTRAIL2,
S_GREENKOOPASPAWN,
S_GREENKOOPA1,
S_GREENKOOPA2,
S_GREENKOOPA3,
S_GREENKOOPA4,
S_GREENKOOPADEATH1,
S_GREENKOOPADEATH2,
S_SHELL,
S_PUMA_START1,
S_PUMA_START2,
@ -4063,6 +4176,68 @@ typedef enum state
S_MARIOBUSH1,
S_MARIOBUSH2,
S_TOAD,
S_PTZSHROOM,
S_PTZFLAG1,
S_PTZFLAG2,
S_PTZFLAG3,
S_PTZFLAG4,
S_PTZFLAG5,
S_MARIOBUSH,
S_BSBSHROOM,
S_BLBSHROOM,
S_BNWSHROOM,
S_REDMFLOWER,
S_BLUEMFLOWER,
S_YELLOWMFLOWER,
S_WHITEDANDELION,
S_MAR64TREE,
// Power up mushrooms
S_LIFESHROOM,
S_LIFESHROOM2,
S_LIFESHROOMD,
S_LIFESHROOM_INVISIBLE,
S_LIFESHROOM_INVISIBLE_TOUCH,
S_POISONSHROOM,
S_POISONSHROOM2,
S_POISONSHROOMD,
S_NUKESHROOM,
S_NUKESHROOM2,
S_NUKESHROOMD,
S_FORCESHROOM,
S_FORCESHROOM2,
S_FORCESHROOMD,
S_ATTRACTSHROOM,
S_ATTRACTSHROOM2,
S_ATTRACTSHROOMD,
S_ELEMENTALSHROOM,
S_ELEMENTALSHROOM2,
S_ELEMENTALSHROOMD,
S_CLOUDSHROOM,
S_CLOUDSHROOM2,
S_CLOUDSHROOMD,
S_STARMAN,
S_STARMAN1,
S_STARMAN2,
S_STARMAN3,
S_STARMAND,
S_SPEEDWINGS,
S_SPEEDWINGSD,
S_PARTICLEPICKUP1,
S_PARTICLEPICKUP2,
S_1000SCOREAWARD,
S_POWERUPAWARD,
S_POWERUPAWARD1,
S_POWERUPAWARD2,
// Nights-specific stuff
S_NIGHTSDRONE_MAN1,
@ -4365,9 +4540,20 @@ typedef enum state
S_REDBRICKDEBRIS, // for CEZ3
S_BLUEBRICKDEBRIS, // for CEZ3
S_YELLOWBRICKDEBRIS, // for CEZ3
S_MARIOBRICKDEBRIS,
S_MARIOBRICKDEBRISS,
S_MARIOBRICKDEBRISB,
S_MARIOBRICKDEBRISC,
S_MARIOBRICKDEBRISM,
S_NAMECHECK,
// LJ Knuckles
S_OLDK_STND,
S_OLDK_DIE0,
S_OLDK_DIE1,
S_OLDK_DIE2,
S_FIRSTFREESLOT,
S_LASTFREESLOT = S_FIRSTFREESLOT + NUMSTATEFREESLOTS - 1,
NUMSTATES
@ -4562,6 +4748,16 @@ typedef enum mobj_type
MT_REDHORIZ,
MT_BLUEHORIZ,
MT_YELLOWTRAMPOLINE,
MT_REDTRAMPOLINE,
MT_BLUETRAMPOLINE,
MT_HORIZYELLOWTRAMPOLINE,
MT_HORIZREDTRAMPOLINE,
MT_HORIZBLUETRAMPOLINE,
MT_DIAGYELLOWTRAMPOLINE,
MT_DIAGREDTRAMPOLINE,
MT_DIAGBLUETRAMPOLINE,
MT_BOOSTERSEG,
MT_BOOSTERROLLER,
MT_YELLOWBOOSTER,
@ -4859,6 +5055,10 @@ typedef enum mobj_type
MT_LAMPPOST2, // with snow
MT_HANGSTAR,
MT_MISTLETOE,
MT_SSZTREE,
MT_SSZTREE_BRANCH,
MT_SSZTREE2,
MT_SSZTREE2_BRANCH,
// Xmas GFZ bushes
MT_XMASBLUEBERRYBUSH,
MT_XMASBERRYBUSH,
@ -4938,6 +5138,9 @@ typedef enum mobj_type
// Misc scenery
MT_DBALL,
MT_EGGSTATUE2,
MT_GINE,
MT_PPAL,
MT_PPEL,
// Powerup Indicators
MT_ELEMENTAL_ORB, // Elemental shield mobj
@ -5055,6 +5258,7 @@ typedef enum mobj_type
MT_FIREFLOWER,
MT_FIREBALL,
MT_FIREBALLTRAIL,
MT_GREENKOOPA,
MT_SHELL,
MT_PUMA,
MT_PUMATRAIL,
@ -5065,6 +5269,30 @@ typedef enum mobj_type
MT_MARIOBUSH1,
MT_MARIOBUSH2,
MT_TOAD,
MT_PTZSHROOM,
MT_PTZFLAG,
MT_BSBSHROOM,
MT_BLBSHROOM,
MT_BNWSHROOM,
MT_MARIOBUSH,
MT_REDMFLOWER,
MT_BLUEMFLOWER,
MT_YELLOWMFLOWER,
MT_WHITEDANDELION,
MT_MAR64TREE,
// Power up mushrooms
MT_LIFESHROOM,
MT_LIFESHROOM_INVISIBLE,
MT_POISONSHROOM,
MT_NUKESHROOM,
MT_FORCESHROOM,
MT_ATTRACTSHROOM,
MT_ELEMENTALSHROOM,
MT_CLOUDSHROOM,
MT_STARMAN,
MT_SPEEDWINGS,
MT_POWERUPAWARD,
// NiGHTS Stuff
MT_AXIS,
@ -5162,10 +5390,17 @@ typedef enum mobj_type
MT_REDBRICKDEBRIS, // for CEZ3
MT_BLUEBRICKDEBRIS, // for CEZ3
MT_YELLOWBRICKDEBRIS, // for CEZ3
MT_MARIOBRICKDEBRIS,
MT_MARIOBRICKDEBRISS,
MT_MARIOBRICKDEBRISB,
MT_MARIOBRICKDEBRISC,
MT_MARIOBRICKDEBRISM,
MT_NAMECHECK,
MT_RAY, // General purpose mobj
MT_OLDK,
MT_FIRSTFREESLOT,
MT_LASTFREESLOT = MT_FIRSTFREESLOT + NUMMOBJFREESLOTS - 1,
NUMMOBJTYPES

View file

@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
// Copyright (C) 2012-2016 by John "JTE" Muniz.
// Copyright (C) 2012-2024 by Sonic Team Junior.
// Copyright (C) 2012-2025 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
@ -1730,12 +1730,11 @@ static int lib_pResetCamera(lua_State *L)
static int lib_pSuperReady(lua_State *L)
{
player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
boolean transform = (boolean)lua_opttrueboolean(L, 2);
//HUDSAFE
INLEVEL
if (!player)
return LUA_ErrInvalid(L, "player_t");
lua_pushboolean(L, P_SuperReady(player, transform));
lua_pushboolean(L, P_SuperReady(player));
return 1;
}
@ -3181,17 +3180,25 @@ static int lib_rTextureNumForName(lua_State *L)
static int lib_rCheckTextureNameForNum(lua_State *L)
{
char s[9];
INT32 num = (INT32)luaL_checkinteger(L, 1);
//HUDSAFE
lua_pushstring(L, R_CheckTextureNameForNum(num));
M_Memcpy(s, R_CheckTextureNameForNum(num), 8);
s[8] = '\0';
lua_pushstring(L, s);
return 1;
}
static int lib_rTextureNameForNum(lua_State *L)
{
char s[9];
INT32 num = (INT32)luaL_checkinteger(L, 1);
//HUDSAFE
lua_pushstring(L, R_TextureNameForNum(num));
M_Memcpy(s, R_TextureNameForNum(num), 8);
s[8] = '\0';
lua_pushstring(L, s);
return 1;
}

View file

@ -31,11 +31,27 @@ return luaL_error(L, "HUD rendering code should not call this function!");
static consvar_t *this_cvar;
static void clear_lua_stack(void)
{
if (gL) // check if Lua is actually turned on first, you dummmy -- Monster Iestyn 04/07/18
lua_settop(gL, 0); // clear stack
}
void Got_Luacmd(UINT8 **cp, INT32 playernum)
{
UINT8 i, argc, flags;
const char *argv[256];
char buf[256];
argc = READUINT8(*cp);
argv[0] = (const char*)*cp;
SKIPSTRINGN(*cp, 255);
for (i = 1; i < argc; i++)
{
argv[i] = (const char*)*cp;
SKIPSTRINGN(*cp, 255);
}
// don't use I_Assert here, goto the deny code below
// to clean up and kick people who try nefarious exploits
// like sending random junk lua commands to crash the server
@ -48,8 +64,7 @@ void Got_Luacmd(UINT8 **cp, INT32 playernum)
lua_getfield(gL, LUA_REGISTRYINDEX, "COM_Command"); // push COM_Command
if (!lua_istable(gL, -1)) goto deny;
argc = READUINT8(*cp);
READSTRINGN(*cp, buf, 255);
strlcpy(buf, argv[0], 255);
strlwr(buf); // must lowercase buffer
lua_getfield(gL, -1, buf); // push command info table
if (!lua_istable(gL, -1)) goto deny;
@ -75,10 +90,17 @@ void Got_Luacmd(UINT8 **cp, INT32 playernum)
lua_remove(gL, -2); // pop command info table
if (!lua_checkstack(gL, argc)) // player + command arguments
{
clear_lua_stack();
CONS_Alert(CONS_WARNING, "lua command stack overflow from %s (%d, need %d more)\n", player_names[playernum], lua_gettop(gL), argc);
return;
}
LUA_PushUserdata(gL, &players[playernum], META_PLAYER);
for (i = 1; i < argc; i++)
{
READSTRINGN(*cp, buf, 255);
strlcpy(buf, argv[i], 255);
lua_pushstring(gL, buf);
}
LUA_Call(gL, (int)argc, 0, 1); // argc is 1-based, so this will cover the player we passed too.
@ -86,8 +108,7 @@ void Got_Luacmd(UINT8 **cp, INT32 playernum)
deny:
//must be hacked/buggy client
if (gL) // check if Lua is actually turned on first, you dummmy -- Monster Iestyn 04/07/18
lua_settop(gL, 0); // clear stack
clear_lua_stack();
CONS_Alert(CONS_WARNING, M_GetText("Illegal lua command received from %s\n"), player_names[playernum]);
if (server)
@ -173,6 +194,11 @@ void COM_Lua_f(void)
I_Assert(lua_isfunction(gL, -1));
lua_remove(gL, -2); // pop command info table
if (!lua_checkstack(gL, COM_Argc() + 1))
{
CONS_Alert(CONS_WARNING, "lua command stack overflow (%d, need %s more)\n", lua_gettop(gL), sizeu1(COM_Argc() + 1));
return;
}
LUA_PushUserdata(gL, &players[playernum], META_PLAYER);
for (i = 1; i < COM_Argc(); i++)
lua_pushstring(gL, COM_Argv(i));

View file

@ -613,6 +613,10 @@ static int libd_getSprite2Patch(lua_State *L)
if (super)
j |= SPR2F_SUPER;
// If there is no "super" variation of this sprite, try with the normal one.
if (!P_IsValidSprite2(skins[i], j))
j &= ~SPR2F_SUPER;
sprdef = P_GetSkinSpritedef(skins[i], j);
// set frame number

View file

@ -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-2024 by Sonic Team Junior.
// Copyright (C) 1999-2025 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
@ -3318,7 +3318,7 @@ boolean M_Responder(event_t *ev)
if (ch == -1)
return false;
else if (ch == gamecontrol[GC_SYSTEMMENU][0] || ch == gamecontrol[GC_SYSTEMMENU][1]) // allow remappable ESC key
else if (ev->type != ev_text && (ch == gamecontrol[GC_SYSTEMMENU][0] || ch == gamecontrol[GC_SYSTEMMENU][1])) // allow remappable ESC key
ch = KEY_ESCAPE;
// F-Keys
@ -3399,6 +3399,13 @@ boolean M_Responder(event_t *ev)
// Handle menuitems which need a specific key handling
if (routine && (currentMenu->menuitems[itemOn].status & IT_TYPE) == IT_KEYHANDLER)
{
// block text input if ctrl is held, to allow using ctrl+c ctrl+v and ctrl+x
if (ctrldown)
{
routine(ch);
return true;
}
// ignore ev_keydown events if the key maps to a character, since
// the ev_text event will follow immediately after in that case.
if (ev->type == ev_keydown && ((ch >= 32 && ch <= 127) || (ch >= KEY_KEYPAD7 && ch <= KEY_KPADDEL)))
@ -3429,7 +3436,7 @@ boolean M_Responder(event_t *ev)
{
// dirty hack: for customising controls, I want only buttons/keys, not moves
if (ev->type == ev_mouse || ev->type == ev_mouse2 || ev->type == ev_joystick
|| ev->type == ev_joystick2)
|| ev->type == ev_joystick2 || ev->type == ev_text)
return true;
if (routine)
{
@ -8511,6 +8518,7 @@ static void M_StartTutorial(INT32 choice)
gamecomplete = 0;
cursaveslot = 0;
maplistoption = 0;
CV_StealthSet(&cv_skin, DEFAULTSKIN); // tutorial accounts for sonic only
G_DeferedInitNew(false, G_BuildMapName(tutorialmap), 0, false, false);
}
@ -11775,10 +11783,10 @@ static void M_ChooseRoom(INT32 choice)
#endif
if (choice == 0)
ms_RoomId = -1;
CV_SetValue(&cv_masterserver_room_id, 0);
else
{
ms_RoomId = roomIds[choice-1];
CV_SetValue(&cv_masterserver_room_id, roomIds[choice-1]);
menuRoomIndex = choice - 1;
}
@ -12115,8 +12123,7 @@ static void M_HandleConnectIP(INT32 choice)
if ( ctrldown ) {
switch (choice) {
case 'v':
case 'V': // ctrl+v, pasting
case 'v': // ctrl+v, pasting
{
const char *paste = I_ClipboardPaste();
@ -12129,8 +12136,7 @@ static void M_HandleConnectIP(INT32 choice)
break;
}
case KEY_INS:
case 'c':
case 'C': // ctrl+c, ctrl+insert, copying
case 'c': // ctrl+c, ctrl+insert, copying
if (l != 0) // Don't replace the clipboard without any text
{
I_ClipboardCopy(setupm_ip, l);
@ -12138,8 +12144,7 @@ static void M_HandleConnectIP(INT32 choice)
}
break;
case 'x':
case 'X': // ctrl+x, cutting
case 'x': // ctrl+x, cutting
if (l != 0) // Don't replace the clipboard without any text
{
I_ClipboardCopy(setupm_ip, l);
@ -14412,6 +14417,33 @@ static INT32 quitsounds[] =
sfx_chchng // Tails 11-09-99
};
const char *QuitScreenMessages[3] = {
(
"Design and content in\n"
"SRB2 is copyright\n"
"1998-2025 by STJr. All\n"
"original material in\n"
"this game is copyrighted\n"
"by their respective\n"
"owners, and no copyright\n"
"infringement is\n"
"intended. STJr's staff\n"
"make no profit\n"
"whatsoever (in\n"
"fact, we lose\n"
"money)."
),
(
"THIS GAME SHOULD NOT BE SOLD!"
),
(
"STJr is in no way affiliated\n"
"with SEGA or Sonic Team."
)
};
void M_QuitResponse(INT32 ch)
{
tic_t ptime;
@ -14433,6 +14465,9 @@ void M_QuitResponse(INT32 ch)
while (ptime > I_GetTime())
{
V_DrawScaledPatch(0, 0, 0, W_CachePatchName("GAMEQUIT", PU_PATCH)); // Demo 3 Quit Screen Tails 06-16-2001
V_DrawCenteredString(2+(V_StringWidth(QuitScreenMessages[0], V_ALLOWLOWERCASE)/2), 4, V_ALLOWLOWERCASE, QuitScreenMessages[0]);
V_DrawCenteredString(160, 166, V_ALLOWLOWERCASE|V_REDMAP, QuitScreenMessages[1]);
V_DrawCenteredString(160, 176, V_ALLOWLOWERCASE, QuitScreenMessages[2]);
I_FinishUpdate(); // Update the screen with the image Tails 06-19-2001
I_Sleep(cv_sleep.value);
I_UpdateTime(cv_timescale.value);

View file

@ -453,7 +453,7 @@ static int PS_DrawPerfRows(int x, int y, int color, perfstatrow_t *rows)
return draw_y;
}
static void PS_UpdateMetricHistory(ps_metric_t *metric, boolean time_metric, boolean frame_metric, boolean set_user)
static void PS_UpdateMetricHistory(ps_metric_t *metric, boolean time_metric, boolean frame_metric)
{
int index = frame_metric ? ps_frame_index : ps_tick_index;
@ -461,7 +461,7 @@ static void PS_UpdateMetricHistory(ps_metric_t *metric, boolean time_metric, boo
{
// allocate history table
int value_size = time_metric ? sizeof(precise_t) : sizeof(INT32);
void** memory_user = set_user ? &metric->history : NULL;
void** memory_user = &metric->history;
metric->history = Z_Calloc(value_size * cv_ps_samplesize.value, PU_PERFSTATS,
memory_user);
@ -491,7 +491,7 @@ static void PS_UpdateRowHistories(perfstatrow_t *rows, boolean frame_metric)
for (row = rows; row->lores_label; row++)
{
if (PS_IsRowValid(row))
PS_UpdateMetricHistory(row->metric, !!(row->flags & PS_TIME), frame_metric, true);
PS_UpdateMetricHistory(row->metric, !!(row->flags & PS_TIME), frame_metric);
}
}
@ -649,17 +649,17 @@ void PS_UpdateTickStats(void)
if (cv_perfstats.value == 3)
{
for (i = 0; i < thinkframe_hooks_length; i++)
PS_UpdateMetricHistory(&thinkframe_hooks[i].time_taken, true, false, false);
PS_UpdateMetricHistory(&thinkframe_hooks[i].time_taken, true, false);
}
else if (cv_perfstats.value == 4)
{
for (i = 0; i < prethinkframe_hooks_length; i++)
PS_UpdateMetricHistory(&prethinkframe_hooks[i].time_taken, true, false, false);
PS_UpdateMetricHistory(&prethinkframe_hooks[i].time_taken, true, false);
}
else if (cv_perfstats.value == 5)
{
for (i = 0; i < postthinkframe_hooks_length; i++)
PS_UpdateMetricHistory(&postthinkframe_hooks[i].time_taken, true, false, false);
PS_UpdateMetricHistory(&postthinkframe_hooks[i].time_taken, true, false);
}
}
if (cv_perfstats.value)

View file

@ -546,6 +546,7 @@ static void AbortConnection(void)
{
Snake_Free(&snake);
CURLAbortFile();
D_QuitNetGame();
CL_Reset();
D_StartTitle();
@ -1062,10 +1063,6 @@ static boolean CL_ServerConnectionTicker(const char *tmpsave, tic_t *oldtic, tic
}
}
// Rusty TODO: multithread
if (filedownload.http_running)
CURLGetFile();
if (waitmore)
break; // exit the case

View file

@ -113,9 +113,11 @@ consvar_t cv_blamecfail = CVAR_INIT ("blamecfail", "Off", CV_SAVE|CV_NETVAR, CV_
static CV_PossibleValue_t playbackspeed_cons_t[] = {{1, "MIN"}, {10, "MAX"}, {0, NULL}};
consvar_t cv_playbackspeed = CVAR_INIT ("playbackspeed", "1", 0, playbackspeed_cons_t, NULL);
consvar_t cv_idletime = CVAR_INIT ("idletime", "0", CV_SAVE, CV_Unsigned, NULL);
consvar_t cv_idlespectate = CVAR_INIT ("idlespectate", "On", CV_SAVE, CV_OnOff, NULL);
consvar_t cv_dedicatedidletime = CVAR_INIT ("dedicatedidletime", "10", CV_SAVE, CV_Unsigned, NULL);
consvar_t cv_dedicatedidletime = CVAR_INIT ("dedicatedidletime", "10", CV_SAVE|CV_NETVAR, CV_Unsigned, NULL);
static CV_PossibleValue_t idleaction_cons_t[] = {{1, "Kick"}, {2, "Spectate"}, {0, NULL}};
consvar_t cv_idleaction = CVAR_INIT ("idleaction", "Spectate", CV_SAVE|CV_NETVAR, idleaction_cons_t, NULL);
consvar_t cv_idletime = CVAR_INIT ("idletime", "3", CV_SAVE|CV_NETVAR, CV_Unsigned, NULL);
consvar_t cv_httpsource = CVAR_INIT ("http_source", "", CV_SAVE, NULL, NULL);
@ -1373,7 +1375,7 @@ static void IdleUpdate(void)
if (cv_idletime.value && !IsPlayerAdmin(i) && i != serverplayer && !(players[i].pflags & PF_FINISHED) && players[i].lastinputtime > (tic_t)cv_idletime.value * TICRATE * 60)
{
players[i].lastinputtime = 0;
if (cv_idlespectate.value && G_GametypeHasSpectators())
if (cv_idleaction.value == 2 && G_GametypeHasSpectators())
{
changeteam_union NetPacket;
UINT16 usvalue;
@ -1384,7 +1386,7 @@ static void IdleUpdate(void)
usvalue = SHORT(NetPacket.value.l|NetPacket.value.b);
SendNetXCmd(XD_TEAMCHANGE, &usvalue, sizeof(usvalue));
}
else
else if (cv_idleaction.value == 1)
{
SendKick(i, KICK_MSG_IDLE | KICK_MSG_KEEP_BODY);
}

View file

@ -73,7 +73,7 @@ extern UINT32 realpingtable[MAXPLAYERS];
extern UINT32 playerpingtable[MAXPLAYERS];
extern tic_t servermaxping;
extern consvar_t cv_netticbuffer, cv_resynchattempts, cv_blamecfail, cv_playbackspeed, cv_idletime, cv_idlespectate, cv_dedicatedidletime;
extern consvar_t cv_netticbuffer, cv_resynchattempts, cv_blamecfail, cv_playbackspeed, cv_idletime, cv_idleaction, cv_dedicatedidletime;
extern consvar_t cv_httpsource;
// Used in d_net, the only dependence

View file

@ -391,7 +391,7 @@ static CV_PossibleValue_t perfstats_cons_t[] = {
consvar_t cv_perfstats = CVAR_INIT ("perfstats", "Off", CV_CALL, perfstats_cons_t, PS_PerfStats_OnChange);
static CV_PossibleValue_t ps_samplesize_cons_t[] = {
{1, "MIN"}, {1000, "MAX"}, {0, NULL}};
consvar_t cv_ps_samplesize = CVAR_INIT ("ps_samplesize", "1", CV_CALL, ps_samplesize_cons_t, PS_SampleSize_OnChange);
consvar_t cv_ps_samplesize = CVAR_INIT ("ps_samplesize", "175", CV_CALL, ps_samplesize_cons_t, PS_SampleSize_OnChange);
static CV_PossibleValue_t ps_descriptor_cons_t[] = {
{1, "Average"}, {2, "SD"}, {3, "Minimum"}, {4, "Maximum"}, {0, NULL}};
consvar_t cv_ps_descriptor = CVAR_INIT ("ps_descriptor", "Average", 0, ps_descriptor_cons_t, NULL);
@ -620,7 +620,7 @@ void D_RegisterServerCommands(void)
CV_RegisterVar(&cv_blamecfail);
CV_RegisterVar(&cv_dedicatedidletime);
CV_RegisterVar(&cv_idletime);
CV_RegisterVar(&cv_idlespectate);
CV_RegisterVar(&cv_idleaction);
CV_RegisterVar(&cv_httpsource);
COM_AddCommand("ping", Command_Ping_f, COM_LUA);

View file

@ -95,6 +95,7 @@ static filetran_t transfer[MAXNETNODES];
INT32 fileneedednum; // Number of files needed to join the server
fileneeded_t *fileneeded; // List of needed files
static tic_t lasttimeackpacketsent = 0;
static I_mutex downloadmutex;
char downloaddir[512] = "DOWNLOAD";
// For resuming failed downloads
@ -606,7 +607,7 @@ void AddLuaFileTransfer(const char *filename, const char *mode)
prevnext = &((*prevnext)->next);
// Allocate file transfer information and append it to the transfer list
filetransfer = malloc(sizeof(luafiletransfer_t));
filetransfer = calloc(1, sizeof(luafiletransfer_t));
if (!filetransfer)
I_Error("AddLuaFileTransfer: Out of memory\n");
*prevnext = filetransfer;
@ -1344,9 +1345,9 @@ void PT_FileFragment(SINT8 node, INT32 netconsole)
if (!(strcmp(filename, "srb2.pk3")
&& strcmp(filename, "zones.pk3")
&& strcmp(filename, "player.dta")
&& strcmp(filename, "characters.pk3")
&& strcmp(filename, "patch.pk3")
&& strcmp(filename, "music.dta")
&& strcmp(filename, "music.pk3")
))
I_Error("Tried to download \"%s\"", filename);
@ -1609,11 +1610,13 @@ boolean CURLPrepareFile(const char* url, int dfilenum)
I_Error("Attempted to download files in -nodownload mode");
#endif
curl_global_init(CURL_GLOBAL_ALL);
if (!multi_handle)
{
curl_global_init(CURL_GLOBAL_ALL);
multi_handle = curl_multi_init();
}
http_handle = curl_easy_init();
multi_handle = curl_multi_init();
if (http_handle && multi_handle)
{
I_mkdir(downloaddir, 0755);
@ -1672,6 +1675,8 @@ boolean CURLPrepareFile(const char* url, int dfilenum)
filedownload.current = dfilenum;
filedownload.http_running = true;
I_spawn_thread("http-download", (I_thread_fn)CURLGetFile, NULL);
return true;
}
@ -1680,103 +1685,119 @@ boolean CURLPrepareFile(const char* url, int dfilenum)
return false;
}
void CURLAbortFile(void)
{
filedownload.http_running = false;
// lock and unlock to wait for the download thread to exit
I_lock_mutex(&downloadmutex);
I_unlock_mutex(downloadmutex);
}
void CURLGetFile(void)
{
I_lock_mutex(&downloadmutex);
CURLMcode mc; /* return code used by curl_multi_wait() */
CURLcode easyres; /* Return from easy interface */
int numfds;
CURLMsg *m; /* for picking up messages with the transfer status */
CURL *e;
int msgs_left; /* how many messages are left */
const char *easy_handle_error;
boolean running = true;
if (curl_runninghandles)
while (running && filedownload.http_running)
{
curl_multi_perform(multi_handle, &curl_runninghandles);
/* wait for activity, timeout or "nothing" */
mc = curl_multi_wait(multi_handle, NULL, 0, 1000, &numfds);
if (mc != CURLM_OK)
if (curl_runninghandles)
{
CONS_Alert(CONS_WARNING, "curl_multi_wait() failed, code %d.\n", mc);
return;
}
curl_curfile->currentsize = curl_dlnow;
curl_curfile->totalsize = curl_dltotal;
}
curl_multi_perform(multi_handle, &curl_runninghandles);
/* See how the transfers went */
while ((m = curl_multi_info_read(multi_handle, &msgs_left)))
{
if (m && (m->msg == CURLMSG_DONE))
{
e = m->easy_handle;
easyres = m->data.result;
/* wait for activity, timeout or "nothing" */
mc = curl_multi_wait(multi_handle, NULL, 0, 1000, NULL);
char *filename = Z_StrDup(curl_realname);
nameonly(filename);
if (easyres != CURLE_OK)
if (mc != CURLM_OK)
{
long response_code = 0;
if (easyres == CURLE_HTTP_RETURNED_ERROR)
curl_easy_getinfo(e, CURLINFO_RESPONSE_CODE, &response_code);
if (response_code == 404)
curl_curfile->failed = FDOWNLOAD_FAIL_NOTFOUND;
else
curl_curfile->failed = FDOWNLOAD_FAIL_OTHER;
easy_handle_error = (response_code) ? va("HTTP response code %ld", response_code) : curl_easy_strerror(easyres);
curl_curfile->status = FS_FALLBACK;
curl_curfile->currentsize = curl_origfilesize;
curl_curfile->totalsize = curl_origtotalfilesize;
filedownload.http_failed = true;
fclose(curl_curfile->file);
remove(curl_curfile->filename);
CONS_Alert(CONS_ERROR, M_GetText("Failed to download addon \"%s\" (%s)\n"), filename, easy_handle_error);
CONS_Alert(CONS_WARNING, "curl_multi_wait() failed, code %d.\n", mc);
continue;
}
else
curl_curfile->currentsize = curl_dlnow;
curl_curfile->totalsize = curl_dltotal;
}
/* See how the transfers went */
while ((m = curl_multi_info_read(multi_handle, &msgs_left)))
{
if (m && (m->msg == CURLMSG_DONE))
{
fclose(curl_curfile->file);
running = false;
e = m->easy_handle;
easyres = m->data.result;
CONS_Printf(M_GetText("Finished download of \"%s\"\n"), filename);
char *filename = Z_StrDup(curl_realname);
nameonly(filename);
if (checkfilemd5(curl_curfile->filename, curl_curfile->md5sum) == FS_MD5SUMBAD)
if (easyres != CURLE_OK)
{
CONS_Alert(CONS_WARNING, M_GetText("File \"%s\" does not match the version used by the server\n"), filename);
long response_code = 0;
if (easyres == CURLE_HTTP_RETURNED_ERROR)
curl_easy_getinfo(e, CURLINFO_RESPONSE_CODE, &response_code);
if (response_code == 404)
curl_curfile->failed = FDOWNLOAD_FAIL_NOTFOUND;
else
curl_curfile->failed = FDOWNLOAD_FAIL_OTHER;
easy_handle_error = (response_code) ? va("HTTP response code %ld", response_code) : curl_easy_strerror(easyres);
curl_curfile->status = FS_FALLBACK;
curl_curfile->failed = FDOWNLOAD_FAIL_MD5SUMBAD;
curl_curfile->currentsize = curl_origfilesize;
curl_curfile->totalsize = curl_origtotalfilesize;
filedownload.http_failed = true;
fclose(curl_curfile->file);
remove(curl_curfile->filename);
CONS_Alert(CONS_ERROR, M_GetText("Failed to download addon \"%s\" (%s)\n"), filename, easy_handle_error);
}
else
{
filedownload.completednum++;
filedownload.completedsize += curl_curfile->totalsize;
curl_curfile->status = FS_FOUND;
fclose(curl_curfile->file);
CONS_Printf(M_GetText("Finished download of \"%s\"\n"), filename);
if (checkfilemd5(curl_curfile->filename, curl_curfile->md5sum) == FS_MD5SUMBAD)
{
CONS_Alert(CONS_WARNING, M_GetText("File \"%s\" does not match the version used by the server\n"), filename);
curl_curfile->status = FS_FALLBACK;
curl_curfile->failed = FDOWNLOAD_FAIL_MD5SUMBAD;
filedownload.http_failed = true;
}
else
{
filedownload.completednum++;
filedownload.completedsize += curl_curfile->totalsize;
curl_curfile->status = FS_FOUND;
}
}
Z_Free(filename);
curl_curfile->file = NULL;
filedownload.remaining--;
curl_multi_remove_handle(multi_handle, e);
curl_easy_cleanup(e);
if (!filedownload.remaining)
break;
}
Z_Free(filename);
curl_curfile->file = NULL;
filedownload.http_running = false;
filedownload.remaining--;
curl_multi_remove_handle(multi_handle, e);
curl_easy_cleanup(e);
if (!filedownload.remaining)
break;
}
}
if (!filedownload.remaining)
if (!filedownload.remaining || !filedownload.http_running)
{
curl_multi_cleanup(multi_handle);
curl_global_cleanup();
multi_handle = NULL;
}
filedownload.http_running = false;
I_unlock_mutex(downloadmutex);
}
HTTP_login *

View file

@ -140,6 +140,7 @@ boolean CL_SendFileRequest(void);
void PT_RequestFile(SINT8 node);
boolean CURLPrepareFile(const char* url, int dfilenum);
void CURLAbortFile(void);
void CURLGetFile(void);
HTTP_login * CURLGetLogin (const char *url, HTTP_login ***return_prev_next);

View file

@ -55,6 +55,7 @@ static boolean ServerName_CanChange (const char*);
static void Update_parameters (void);
static void MasterServer_OnChange(void);
static void RoomId_OnChange(void);
static CV_PossibleValue_t masterserver_update_rate_cons_t[] = {
{2, "MIN"},
@ -66,8 +67,9 @@ consvar_t cv_masterserver = CVAR_INIT ("masterserver", "https://ds.ms.srb2.org/M
consvar_t cv_servername = CVAR_INIT_WITH_CALLBACKS ("servername", "SRB2 server", CV_SAVE|CV_NETVAR|CV_CALL|CV_NOINIT|CV_ALLOWLUA, NULL, Update_parameters, ServerName_CanChange);
consvar_t cv_masterserver_update_rate = CVAR_INIT ("masterserver_update_rate", "15", CV_SAVE|CV_CALL|CV_NOINIT, masterserver_update_rate_cons_t, Update_parameters);
consvar_t cv_masterserver_room_id = CVAR_INIT ("masterserver_room_id", "0", CV_CALL, CV_Unsigned, RoomId_OnChange);
INT16 ms_RoomId = -1;
INT16 ms_RoomId = 0;
#if defined (MASTERSERVER) && defined (HAVE_THREADS)
int ms_QueryId;
@ -92,6 +94,7 @@ void AddMServCommands(void)
{
CV_RegisterVar(&cv_masterserver);
CV_RegisterVar(&cv_masterserver_update_rate);
CV_RegisterVar(&cv_masterserver_room_id);
CV_RegisterVar(&cv_masterserver_timeout);
CV_RegisterVar(&cv_masterserver_debug);
CV_RegisterVar(&cv_masterserver_token);
@ -534,6 +537,17 @@ Update_parameters (void)
#endif/*MASTERSERVER*/
}
static void RoomId_OnChange(void)
{
if (ms_RoomId != cv_masterserver_room_id.value)
{
UnregisterServer();
ms_RoomId = cv_masterserver_room_id.value;
if (Online())
RegisterServer();
}
}
static void MasterServer_OnChange(void)
{
#ifdef MASTERSERVER

View file

@ -66,6 +66,7 @@ typedef struct
extern consvar_t cv_masterserver, cv_servername;
extern consvar_t cv_masterserver_update_rate;
extern consvar_t cv_masterserver_room_id;
extern consvar_t cv_masterserver_timeout;
extern consvar_t cv_masterserver_debug;
extern consvar_t cv_masterserver_token;

View file

@ -7837,13 +7837,14 @@ void A_BuzzFly(mobj_t *actor)
// Function: A_GuardChase
//
// Description: Modified A_Chase for Egg Guard
// Description: Modified A_Chase for Egg Guard and Koopa Troopas
//
// var1 = unused
// var1 = shield (0) or no shield (1)
// var2 = unused
//
void A_GuardChase(mobj_t *actor)
{
INT32 locvar1 = var1;
INT32 delta;
if (LUA_CallAction(A_GUARDCHASE, actor))
@ -7852,11 +7853,11 @@ void A_GuardChase(mobj_t *actor)
if (actor->reactiontime)
actor->reactiontime--;
if (actor->threshold != 42) // In formation...
if (actor->threshold != 42 || locvar1 == 1) // In formation...
{
fixed_t speed;
if (!actor->tracer || !actor->tracer->health)
if ((!actor->tracer || !actor->tracer->health) && locvar1 == 0)
{
P_SetTarget(&actor->tracer, NULL);
actor->threshold = 42;
@ -7945,7 +7946,7 @@ void A_GuardChase(mobj_t *actor)
// Now that we've moved, its time for our shield to move!
// Otherwise it'll never act as a proper overlay.
if (actor->tracer && actor->tracer->state
&& actor->tracer->state->action.acp1)
&& actor->tracer->state->action.acp1 && locvar1 == 0)
{
var1 = actor->tracer->state->var1, var2 = actor->tracer->state->var2;
actor->tracer->state->action.acp1(actor->tracer);

View file

@ -198,7 +198,7 @@ mobj_t *P_LookForEnemies(player_t *player, boolean nonenemies, boolean bullet);
void P_NukeEnemies(mobj_t *inflictor, mobj_t *source, fixed_t radius);
void P_Earthquake(mobj_t *inflictor, mobj_t *source, fixed_t radius);
boolean P_HomingAttack(mobj_t *source, mobj_t *enemy); /// \todo doesn't belong in p_user
boolean P_SuperReady(player_t *player, boolean transform);
boolean P_SuperReady(player_t *player);
void P_DoJump(player_t *player, boolean soundandstate, boolean allowflip);
void P_DoSpinDashDust(player_t *player);
#define P_AnalogMove(player) (P_ControlStyle(player) == CS_LMAOGALOG)

View file

@ -96,11 +96,15 @@ static void P_SetupStateAnimation(mobj_t *mobj, state_t *st)
animlength = st->var1;
if (!(st->frame & FF_ANIMATE))
{
mobj->anim_duration = 0;
return;
}
if (animlength <= 0 || st->var2 == 0)
{
mobj->frame &= ~FF_ANIMATE;
mobj->anim_duration = 0;
return; // Crash/stupidity prevention
}
@ -174,27 +178,6 @@ static void P_CycleMobjState(mobj_t *mobj)
}
}
//
// P_CycleMobjState for players.
//
static void P_CyclePlayerMobjState(mobj_t *mobj)
{
// state animations
P_CycleStateAnimation(mobj);
// cycle through states,
// calling action functions at transitions
if (mobj->tics != -1)
{
mobj->tics--;
// you can cycle through multiple states in a tic
if (!mobj->tics && mobj->state)
if (!P_SetMobjState(mobj, mobj->state->nextstate))
return; // freed itself
}
}
//
// P_SetPlayerMobjState
// Returns true if the mobj is still present.
@ -3799,7 +3782,7 @@ static void P_PlayerMobjThinker(mobj_t *mobj)
}
animonly:
P_CyclePlayerMobjState(mobj);
P_CycleMobjState(mobj);
}
static void CalculatePrecipFloor(precipmobj_t *mobj)
@ -8061,6 +8044,10 @@ static boolean P_MobjBossThink(mobj_t *mobj)
case MT_METALSONIC_BATTLE:
P_Boss9Thinker(mobj);
break;
case MT_OLDK:
if (mobj->health <= 0)
mobj->momz -= (2*FRACUNIT)/3;
break;
default: // Generic SOC-made boss
if (mobj->flags2 & MF2_SKULLFLY)
P_SpawnGhostMobj(mobj);
@ -10326,10 +10313,7 @@ void P_MobjThinker(mobj_t *mobj)
}
// Can end up here if a player dies.
if (mobj->player)
P_CyclePlayerMobjState(mobj);
else
P_CycleMobjState(mobj);
P_CycleMobjState(mobj);
if (P_MobjWasRemoved(mobj))
return;
@ -13149,6 +13133,32 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj, boolean
banner->angle = mobjangle + ANGLE_90;
}
break;
case MT_SSZTREE:
{ // Spawn the branches
INT32 i;
mobj_t *branch;
for (i = 0; i < 5; i++)
{
branch = P_SpawnMobjFromMobj(mobj, 0, 0, 0, MT_SSZTREE_BRANCH);
if (P_MobjWasRemoved(branch))
continue;
branch->angle = mobj->angle + FixedAngle(i*72*FRACUNIT);
}
}
break;
case MT_SSZTREE2:
{ // Spawn the branches
INT32 i;
mobj_t *branch;
for (i = 0; i < 5; i++)
{
branch = P_SpawnMobjFromMobj(mobj, 0, 0, 0, MT_SSZTREE2_BRANCH);
if (P_MobjWasRemoved(branch))
continue;
branch->angle = mobj->angle + FixedAngle(i*72*FRACUNIT);
}
}
break;
case MT_HHZTREE_TOP:
{ // Spawn the branches
angle_t mobjangle = FixedAngle(mthing->angle << FRACBITS) & (ANGLE_90 - 1);

View file

@ -5866,6 +5866,10 @@ static void P_ConvertBinaryLinedefTypes(void)
lines[i].args[0] = tag;
lines[i].args[1] = !!(lines[i].flags & ML_NOCLIMB);
break;
case 465: // Bounce Player (purely for backwards compatibility with new Pipe Towers)
lines[i].args[0] = (FixedHypot(lines[i].dx, lines[i].dy) / 8) >> FRACBITS;
lines[i].special = 430;
break;
case 466: //Set level failure state
lines[i].args[0] = !!(lines[i].flags & ML_NOCLIMB);
break;
@ -7369,11 +7373,11 @@ static void P_RunLevelScript(const char *scriptname)
return;
}
COM_BufInsertText(W_CacheLumpNum(lumpnum, PU_CACHE));
COM_BufInsertTextEx(W_CacheLumpNum(lumpnum, PU_CACHE), COM_LUA);
}
else
{
COM_BufAddText(va("exec %s\n", scriptname));
COM_ExecFile(scriptname, COM_LUA, false);
}
COM_BufExecute(); // Run it!
}
@ -7853,6 +7857,10 @@ boolean P_LoadLevel(boolean fromnetsave, boolean reloadinggamestate)
maptol = mapheaderinfo[gamemap-1]->typeoflevel;
gametyperules = gametypedefaultrules[gametype];
// clear the target on map change, since the object will be invalidated
P_SetTarget(&ticcmd_ztargetfocus[0], NULL);
P_SetTarget(&ticcmd_ztargetfocus[1], NULL);
CON_Drawer(); // let the user know what we are going to do
I_FinishUpdate(); // page flip or blit buffer

View file

@ -2546,7 +2546,7 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec)
char *text = Z_Malloc(len + 1, PU_CACHE, NULL);
memcpy(text, lump, len);
text[len] = '\0';
COM_BufInsertText(text);
COM_BufInsertTextEx(text, COM_LUA);
Z_Free(text);
}
}
@ -2702,6 +2702,18 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec)
EV_DoCrush(line->args[0], line, crushBothOnce);
break;
case 430: // Bounce Player
if (mo && mo->player)
{
P_SetObjectMomZ(mo, line->args[0]*FRACUNIT, false);
S_StartSound(NULL, sfx_s3k8a);
mo->player->pflags |= PF_JUMPED;
if (skins[mo->player->skin]->flags & SF_NOJUMPSPIN)
P_SetMobjState(mo, S_PLAY_SPRING);
else
P_SetMobjState(mo, S_PLAY_JUMP);
}
break;
case 432: // Enable/Disable 2D Mode
if (mo && mo->player)
{

View file

@ -4438,27 +4438,21 @@ static void P_DoSuperStuff(player_t *player)
//
// Returns true if player is ready to transform or detransform
//
boolean P_SuperReady(player_t *player, boolean transform)
boolean P_SuperReady(player_t *player)
{
if (!transform &&
(player->powers[pw_super] < TICRATE*3/2
|| !G_CoopGametype())) // No turning back in competitive!
return false;
else if (transform
&& (player->powers[pw_super]
|| !ALL7EMERALDS(emeralds)
|| !(player->rings >= 50)))
return false;
if (player->mo
&& (player->rings >= 50)
&& ALL7EMERALDS(emeralds)
&& (player->charflags & SF_SUPER)
&& (player->pflags & PF_JUMPED)
&& !player->powers[pw_super]
&& !player->powers[pw_invulnerability]
&& !(player->powers[pw_shield] & SH_NOSTACK)
&& !player->powers[pw_tailsfly]
&& !player->powers[pw_carry]
&& (player->charflags & SF_SUPER)
&& !P_PlayerInPain(player)
&& !player->climbing
&& !(player->pflags & (PF_JUMPSTASIS|PF_THOKKED|PF_STARTDASH|PF_GLIDING|PF_SLIDING|PF_SHIELDABILITY))
&& ((player->pflags & PF_JUMPED) || (P_IsObjectOnGround(player->mo) && (player->panim == PA_IDLE || player->panim == PA_EDGE
|| player->panim == PA_WALK || player->panim == PA_RUN || (player->charflags & SF_DASHMODE && player->panim == PA_DASH))))
&& !(maptol & TOL_NIGHTS))
return true;
@ -5318,8 +5312,7 @@ static void P_DoJumpStuff(player_t *player, ticcmd_t *cmd, boolean spinshieldhac
;
else if (cmd->buttons & BT_SPIN)
{
if (spinshieldhack && !(player->pflags & PF_SPINDOWN) && P_SuperReady(player, true)
&& !player->powers[pw_invulnerability] && !(player->powers[pw_shield] & SH_NOSTACK)) // These two checks are no longer in P_SuperReady
if (spinshieldhack && !(player->pflags & PF_SPINDOWN) && P_SuperReady(player))
{
// If you're using two-button play, can turn Super and aren't already,
// and you don't have a shield, then turn Super!
@ -8803,12 +8796,8 @@ void P_MovePlayer(player_t *player)
if ((cmd->buttons & BT_SHIELD) && !(player->pflags & PF_SHIELDDOWN) && !spinshieldhack)
{
// Transform into super if we can!
if (P_SuperReady(player, true))
if (P_SuperReady(player))
P_DoSuperTransformation(player, false);
// Detransform from super if we can!
else if (P_SuperReady(player, false))
P_DoSuperDetransformation(player);
}
}

View file

@ -83,7 +83,7 @@ static fixed_t planeheight;
fixed_t yslopetab[MAXVIDHEIGHT*16];
fixed_t *yslope;
static fixed_t xoffs, yoffs;
static INT64 xoffs, yoffs;
static dvector3_t slope_origin, slope_u, slope_v;
static dvector3_t slope_lightu, slope_lightv;
@ -376,19 +376,25 @@ visplane_t *R_FindPlane(sector_t *sector, fixed_t height, INT32 picnum, INT32 li
visplane_t *check;
unsigned hash;
float offset_xd = FixedToFloat(xoff) / FixedToFloat(xscale ? xscale : 1);
float offset_yd = FixedToFloat(yoff) / FixedToFloat(yscale ? yscale : 1);
INT64 offset_x = offset_xd * FRACUNIT;
INT64 offset_y = offset_yd * FRACUNIT;
if (!slope) // Don't mess with this right now if a slope is involved
{
xoff += FixedMul(viewx, xscale);
yoff -= FixedMul(viewy, yscale);
offset_x += viewx;
offset_y -= viewy;
if (plangle != 0)
{
// Add the view offset, rotated by the plane angle.
float ang = ANG2RAD(plangle);
float x = FixedToFloat(xoff);
float y = FixedToFloat(yoff);
xoff = FloatToFixed(x * cos(ang) + y * sin(ang));
yoff = FloatToFixed(-x * sin(ang) + y * cos(ang));
float x = offset_x / (float)FRACUNIT;
float y = offset_y / (float)FRACUNIT;
offset_x = (x * cos(ang) + y * sin(ang)) * FRACUNIT;
offset_y = (-x * sin(ang) + y * cos(ang)) * FRACUNIT;
}
}
@ -399,16 +405,19 @@ visplane_t *R_FindPlane(sector_t *sector, fixed_t height, INT32 picnum, INT32 li
float ang = ANG2RAD(polyobj->angle);
float x = FixedToFloat(polyobj->centerPt.x);
float y = FixedToFloat(polyobj->centerPt.y);
xoff -= FloatToFixed(x * cos(ang) + y * sin(ang));
yoff -= FloatToFixed(x * sin(ang) - y * cos(ang));
offset_x -= (x * cos(ang) + y * sin(ang)) * FRACUNIT;
offset_y -= (x * sin(ang) - y * cos(ang)) * FRACUNIT;
}
else
{
xoff -= polyobj->centerPt.x;
yoff += polyobj->centerPt.y;
offset_x -= polyobj->centerPt.x;
offset_y += polyobj->centerPt.y;
}
}
offset_x = ((INT64)offset_x * xscale) / FRACUNIT;
offset_y = ((INT64)offset_y * yscale) / FRACUNIT;
// This appears to fix the Nimbus Ruins sky bug.
if (picnum == skyflatnum && pfloor)
{
@ -423,7 +432,7 @@ visplane_t *R_FindPlane(sector_t *sector, fixed_t height, INT32 picnum, INT32 li
{
if (height == check->height && picnum == check->picnum
&& lightlevel == check->lightlevel
&& xoff == check->xoffs && yoff == check->yoffs
&& offset_x == check->xoffs && offset_y == check->yoffs
&& xscale == check->xscale && yscale == check->yscale
&& planecolormap == check->extra_colormap
&& check->viewx == viewx && check->viewy == viewy && check->viewz == viewz
@ -449,8 +458,8 @@ visplane_t *R_FindPlane(sector_t *sector, fixed_t height, INT32 picnum, INT32 li
check->lightlevel = lightlevel;
check->minx = vid.width;
check->maxx = -1;
check->xoffs = xoff;
check->yoffs = yoff;
check->xoffs = offset_x;
check->yoffs = offset_y;
check->xscale = xscale;
check->yscale = yscale;
check->extra_colormap = planecolormap;
@ -658,13 +667,13 @@ static void R_DrawSkyPlane(visplane_t *pl)
}
// Returns the height of the sloped plane at (x, y) as a double
static double R_GetSlopeZAt(const pslope_t *slope, fixed_t x, fixed_t y)
static double R_GetSlopeZAt(const pslope_t *slope, INT64 x, INT64 y)
{
// If you want to reimplement this using just the equation constants, use this instead:
// (d + a*x + b*y) * -(1.0 / c)
double px = FixedToDouble(x) - slope->dorigin.x;
double py = FixedToDouble(y) - slope->dorigin.y;
double px = (x / (double)FRACUNIT) - slope->dorigin.x;
double py = (y / (double)FRACUNIT) - slope->dorigin.y;
double dist = (px * slope->dnormdir.x) + (py * slope->dnormdir.y);
@ -672,10 +681,10 @@ static double R_GetSlopeZAt(const pslope_t *slope, fixed_t x, fixed_t y)
}
// Sets the texture origin vector of the sloped plane.
static void R_SetSlopePlaneOrigin(pslope_t *slope, fixed_t xpos, fixed_t ypos, fixed_t zpos, fixed_t xoff, fixed_t yoff, fixed_t angle)
static void R_SetSlopePlaneOrigin(pslope_t *slope, fixed_t xpos, fixed_t ypos, fixed_t zpos, INT64 xoff, INT64 yoff, fixed_t angle)
{
INT64 vx = (INT64)xpos + (INT64)xoff;
INT64 vy = (INT64)ypos - (INT64)yoff;
INT64 vx = (INT64)xpos + xoff;
INT64 vy = (INT64)ypos - yoff;
float vxf = vx / (float)FRACUNIT;
float vyf = vy / (float)FRACUNIT;
@ -702,7 +711,7 @@ void R_SetSlopePlane(pslope_t *slope, fixed_t xpos, fixed_t ypos, fixed_t zpos,
slope->moved = false;
}
R_SetSlopePlaneOrigin(slope, xpos, ypos, zpos, xoff, yoff, angle);
R_SetSlopePlaneOrigin(slope, xpos, ypos, zpos, (INT64)xoff, (INT64)yoff, angle);
height = R_GetSlopeZAt(slope, xpos, ypos);
zeroheight = height - FixedToDouble(zpos);
@ -735,7 +744,7 @@ void R_SetSlopePlane(pslope_t *slope, fixed_t xpos, fixed_t ypos, fixed_t zpos,
}
// This function calculates all of the vectors necessary for drawing a sloped and scaled plane.
void R_SetScaledSlopePlane(pslope_t *slope, fixed_t xpos, fixed_t ypos, fixed_t zpos, fixed_t xs, fixed_t ys, fixed_t xoff, fixed_t yoff, angle_t angle, angle_t plangle)
void R_SetScaledSlopePlane(pslope_t *slope, fixed_t xpos, fixed_t ypos, fixed_t zpos, fixed_t xs, fixed_t ys, INT64 xoff, INT64 yoff, angle_t angle, angle_t plangle)
{
double height, z_at_xy;
float ang;
@ -836,9 +845,11 @@ static void CalcSlopePlaneVectors(visplane_t *pl, fixed_t xoff, fixed_t yoff)
{
if (!ds_fog && (pl->xscale != FRACUNIT || pl->yscale != FRACUNIT))
{
float offset_x = FixedToFloat(xoff) / FixedToFloat(pl->xscale ? pl->xscale : 1);
float offset_y = FixedToFloat(yoff) / FixedToFloat(pl->yscale ? pl->yscale : 1);
R_SetScaledSlopePlane(pl->slope, pl->viewx, pl->viewy, pl->viewz,
FixedDiv(FRACUNIT, pl->xscale), FixedDiv(FRACUNIT, pl->yscale),
FixedDiv(xoff, pl->xscale), FixedDiv(yoff, pl->yscale), pl->viewangle, pl->plangle);
(INT64)(offset_x * FRACUNIT), (INT64)(offset_y * FRACUNIT), pl->viewangle, pl->plangle);
}
else
R_SetSlopePlane(pl->slope, pl->viewx, pl->viewy, pl->viewz, xoff, yoff, pl->viewangle, pl->plangle);

View file

@ -48,7 +48,7 @@ typedef struct visplane_s
UINT16 padbottomstart, bottom[MAXVIDWIDTH], padbottomend;
INT32 high, low; // R_PlaneBounds should set these.
fixed_t xoffs, yoffs; // Scrolling flats.
INT64 xoffs, yoffs; // Scrolling flats.
fixed_t xscale, yscale;
sector_t *sector;
@ -85,7 +85,7 @@ void R_DrawSinglePlane(visplane_t *pl);
// Calculates the slope vectors needed for tilted span drawing.
void R_SetSlopePlane(pslope_t *slope, fixed_t xpos, fixed_t ypos, fixed_t zpos, fixed_t xoff, fixed_t yoff, angle_t angle, angle_t plangle);
void R_SetScaledSlopePlane(pslope_t *slope, fixed_t xpos, fixed_t ypos, fixed_t zpos, fixed_t xs, fixed_t ys, fixed_t xoff, fixed_t yoff, angle_t angle, angle_t plangle);
void R_SetScaledSlopePlane(pslope_t *slope, fixed_t xpos, fixed_t ypos, fixed_t zpos, fixed_t xs, fixed_t ys, INT64 xoff, INT64 yoff, angle_t angle, angle_t plangle);
typedef struct planemgr_s
{

View file

@ -381,7 +381,7 @@ static void R_RasterizeFloorSplat(floorsplat_t *pSplat, vector2_t *verts, visspr
if (pSplat->slope)
{
R_SetScaledSlopePlane(pSplat->slope, vis->viewpoint.x, vis->viewpoint.y, vis->viewpoint.z, pSplat->xscale, pSplat->yscale, -pSplat->verts[0].x, pSplat->verts[0].y, vis->viewpoint.angle, pSplat->angle);
R_SetScaledSlopePlane(pSplat->slope, vis->viewpoint.x, vis->viewpoint.y, vis->viewpoint.z, (INT64)pSplat->xscale, (INT64)pSplat->yscale, -pSplat->verts[0].x, pSplat->verts[0].y, vis->viewpoint.angle, pSplat->angle);
}
else if (!ds_solidcolor)
{

View file

@ -495,11 +495,9 @@ void SCR_ClosedCaptions(void)
basey -= 42;
else if (splitscreen)
basey -= 8;
else if ((modeattacking == ATTACKING_NIGHTS)
|| (!(maptol & TOL_NIGHTS)
&& LUA_HudEnabled(hud_powerups)
else if (LUA_HudEnabled(hud_powerups)
&& ((cv_powerupdisplay.value == 2) // "Always"
|| (cv_powerupdisplay.value == 1 && !camera.chase)))) // "First-person only"
|| (cv_powerupdisplay.value == 1 && !camera.chase))) // "First-person only"
basey -= 16;
}

View file

@ -5,7 +5,7 @@
//
// Copyright (C) 1993-1996 by id Software, Inc.
// Portions Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 2014-2023 by Sonic Team Junior.
// Copyright (C) 2014-2025 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
@ -78,10 +78,11 @@ typedef LPVOID (WINAPI *p_MapViewOfFile) (HANDLE, DWORD, DWORD, DWORD, SIZE_T);
#include "SDL_cpuinfo.h"
#define HAVE_SDLCPUINFO
#if defined (__unix__) || defined(__APPLE__) || (defined (UNIXCOMMON) && !defined (__HAIKU__))
#if defined (__linux__)
#include <sys/vfs.h>
#if defined (__unix__) || defined(__APPLE__) || defined (UNIXCOMMON)
#if defined (__linux__) || defined (__HAIKU__)
#include <sys/statvfs.h>
#else
#include <sys/statvfs.h>
#include <sys/param.h>
#include <sys/mount.h>
/*For meminfo*/
@ -94,7 +95,7 @@ typedef LPVOID (WINAPI *p_MapViewOfFile) (HANDLE, DWORD, DWORD, DWORD, SIZE_T);
#endif
#endif
#if defined (__linux__) || (defined (UNIXCOMMON) && !defined (__HAIKU__))
#if defined (__linux__) || defined (UNIXCOMMON)
#ifndef NOTERMIOS
#include <termios.h>
#include <sys/ioctl.h> // ioctl
@ -109,8 +110,10 @@ typedef LPVOID (WINAPI *p_MapViewOfFile) (HANDLE, DWORD, DWORD, DWORD, SIZE_T);
#if defined (__unix__) || (defined (UNIXCOMMON) && !defined (__APPLE__))
#include <errno.h>
#include <sys/wait.h>
#ifndef __HAIKU__ // haiku's crash dialog is just objectively better
#define NEWSIGNALHANDLER
#endif
#endif
#ifndef NOMUMBLE
#ifdef __linux__ // need -lrt
@ -477,10 +480,9 @@ typedef struct
feild_t tty_con;
// when printing general stuff to stdout stderr (Sys_Printf)
// we need to disable the tty console stuff
// this increments so we can recursively disable
static INT32 ttycon_hide = 0;
// lock to prevent clearing partial lines, since not everything
// printed ends on a newline.
static boolean ttycon_ateol = true;
// some key codes that the terminal may be using
// TTimo NOTE: I'm not sure how relevant this is
static INT32 tty_erase;
@ -508,63 +510,31 @@ static inline void tty_FlushIn(void)
// TTimo NOTE: it seems on some terminals just sending '\b' is not enough
// so for now, in any case we send "\b \b" .. yeah well ..
// (there may be a way to find out if '\b' alone would work though)
// Hanicef NOTE: using \b this way is unreliable because of terminal state,
// it's better to use \r to reset the cursor to the beginning of the
// line and clear from there.
static void tty_Back(void)
{
char key;
ssize_t d;
key = '\b';
d = write(STDOUT_FILENO, &key, 1);
key = ' ';
d = write(STDOUT_FILENO, &key, 1);
key = '\b';
d = write(STDOUT_FILENO, &key, 1);
(void)d;
write(STDOUT_FILENO, "\r", 1);
if (tty_con.cursor>0)
{
write(STDOUT_FILENO, tty_con.buffer, tty_con.cursor);
}
write(STDOUT_FILENO, " \b", 2);
}
static void tty_Clear(void)
{
size_t i;
write(STDOUT_FILENO, "\r", 1);
if (tty_con.cursor>0)
{
for (i=0; i<tty_con.cursor; i++)
{
tty_Back();
write(STDOUT_FILENO, " ", 1);
}
write(STDOUT_FILENO, "\r", 1);
}
}
// clear the display of the line currently edited
// bring cursor back to beginning of line
static inline void tty_Hide(void)
{
//I_Assert(consolevent);
if (ttycon_hide)
{
ttycon_hide++;
return;
}
tty_Clear();
ttycon_hide++;
}
// show the current line
// FIXME TTimo need to position the cursor if needed??
static inline void tty_Show(void)
{
size_t i;
ssize_t d;
//I_Assert(consolevent);
I_Assert(ttycon_hide>0);
ttycon_hide--;
if (ttycon_hide == 0 && tty_con.cursor)
{
for (i=0; i<tty_con.cursor; i++)
{
d = write(STDOUT_FILENO, tty_con.buffer+i, 1);
}
}
(void)d;
}
// never exit without calling this, or your terminal will be left in a pretty bad state
@ -672,6 +642,11 @@ void I_GetConsoleEvents(void)
tty_con.cursor = 0;
ev.key = KEY_ENTER;
}
else if (key == 0x4) // ^D, aka EOF
{
// shut down, most unix programs behave this way
I_Quit();
}
else continue;
}
else if (tty_con.cursor < sizeof (tty_con.buffer))
@ -879,9 +854,16 @@ static void I_RegisterChildSignals(void)
void I_OutputMsg(const char *fmt, ...)
{
size_t len;
char txt[8192];
char *txt;
va_list argptr;
va_start(argptr,fmt);
len = vsnprintf(NULL, 0, fmt, argptr);
va_end(argptr);
if (len == 0)
return;
txt = malloc(len+1);
va_start(argptr,fmt);
vsprintf(txt, fmt, argptr);
va_end(argptr);
@ -915,7 +897,10 @@ void I_OutputMsg(const char *fmt, ...)
DWORD bytesWritten;
if (co == INVALID_HANDLE_VALUE)
{
free(txt);
return;
}
if (GetFileType(co) == FILE_TYPE_CHAR && GetConsoleMode(co, &bytesWritten))
{
@ -931,11 +916,16 @@ void I_OutputMsg(const char *fmt, ...)
if (oldLength > 0)
{
LPVOID blank = malloc(oldLength);
if (!blank) return;
if (!blank)
{
free(txt);
return;
}
memset(blank, ' ', oldLength); // Blank out.
oldLines = malloc(oldLength*sizeof(TCHAR));
if (!oldLines)
{
free(txt);
free(blank);
return;
}
@ -970,18 +960,20 @@ void I_OutputMsg(const char *fmt, ...)
}
#else
#ifdef HAVE_TERMIOS
if (consolevent)
if (consolevent && ttycon_ateol)
{
tty_Hide();
tty_Clear();
ttycon_ateol = false;
}
#endif
if (!framebuffer)
fprintf(stderr, "%s", txt);
#ifdef HAVE_TERMIOS
if (consolevent)
if (consolevent && txt[len-1] == '\n')
{
tty_Show();
write(STDOUT_FILENO, tty_con.buffer, tty_con.cursor);
ttycon_ateol = true;
}
#endif
@ -990,6 +982,7 @@ void I_OutputMsg(const char *fmt, ...)
fflush(stderr);
#endif
free(txt);
}
//
@ -2309,13 +2302,22 @@ void I_SleepDuration(precise_t duration)
{
#if defined(__linux__) || defined(__FreeBSD__) || defined(__HAIKU__)
UINT64 precision = I_GetPrecisePrecision();
struct timespec ts = {
.tv_sec = duration / precision,
.tv_nsec = duration * 1000000000 / precision % 1000000000,
};
int status;
do status = clock_nanosleep(CLOCK_MONOTONIC, 0, &ts, &ts);
while (status == EINTR);
precise_t dest = I_GetPreciseTime() + duration;
precise_t slack = (precision / 5000); // 0.2 ms slack
if (duration > slack)
{
duration -= slack;
struct timespec ts = {
.tv_sec = duration / precision,
.tv_nsec = duration * 1000000000 / precision % 1000000000,
};
int status;
do status = clock_nanosleep(CLOCK_MONOTONIC, 0, &ts, &ts);
while (status == EINTR);
}
// busy-wait the rest
while (((INT64)dest - (INT64)I_GetPreciseTime()) > 0);
#elif defined (MIN_SLEEP_DURATION_MS)
UINT64 precision = I_GetPrecisePrecision();
INT32 sleepvalue = cv_sleep.value;
@ -2754,18 +2756,13 @@ void I_ShutdownSystem(void)
void I_GetDiskFreeSpace(INT64 *freespace)
{
#if defined (__unix__) || defined(__APPLE__) || defined (UNIXCOMMON)
#if defined (SOLARIS) || defined (__HAIKU__)
*freespace = INT32_MAX;
return;
#else // Both Linux and BSD have this, apparently.
struct statfs stfs;
if (statfs(srb2home, &stfs) == -1)
struct statvfs stfs;
if (statvfs(srb2home, &stfs) == -1)
{
*freespace = INT32_MAX;
return;
}
*freespace = stfs.f_bavail * stfs.f_bsize;
#endif
#elif defined (_WIN32)
static p_GetDiskFreeSpaceExA pfnGetDiskFreeSpaceEx = NULL;
static boolean testwin95 = false;
@ -3087,8 +3084,10 @@ const char *I_LocateWad(void)
{
// change to the directory where we found srb2.pk3
#if defined (_WIN32)
waddir = _fullpath(NULL, waddir, MAX_PATH);
SetCurrentDirectoryA(waddir);
#else
waddir = realpath(waddir, NULL);
if (chdir(waddir) == -1)
I_OutputMsg("Couldn't change working directory\n");
#endif

View file

@ -87,7 +87,7 @@
#endif
// maximum number of windowed modes (see windowedModes[][])
#define MAXWINMODES (18)
#define MAXWINMODES (21)
/** \brief
*/
@ -157,7 +157,9 @@ static INT32 windowedModes[MAXWINMODES][2] =
{1920,1080}, // 1.66
{1680,1050}, // 1.60,5.25
{1600,1200}, // 1.33
{1600,1000}, // 1.60,5.00
{1600, 900}, // 1.66
{1536, 864}, // 1.66,4.80
{1366, 768}, // 1.66
{1440, 900}, // 1.60,4.50
{1280,1024}, // 1.33?
@ -166,6 +168,7 @@ static INT32 windowedModes[MAXWINMODES][2] =
{1280, 720}, // 1.66
{1152, 864}, // 1.33,3.60
{1024, 768}, // 1.33,3.20
{ 960, 600}, // 1.60,3.00
{ 800, 600}, // 1.33,2.50
{ 640, 480}, // 1.33,2.00
{ 640, 400}, // 1.60,2.00
@ -1946,8 +1949,6 @@ void I_ShutdownGraphics(void)
I_OutputMsg("shut down\n");
#ifdef HWRENDER
if (GLUhandle)
hwClose(GLUhandle);
if (sdlglcontext)
{
SDL_GL_DeleteContext(sdlglcontext);

View file

@ -70,18 +70,10 @@ PFNglGetString pglGetString;
/** \brief SDL video display surface
*/
INT32 oglflags = 0;
void *GLUhandle = NULL;
SDL_GLContext sdlglcontext = 0;
void *GetGLFunc(const char *proc)
{
if (strncmp(proc, "glu", 3) == 0)
{
if (GLUhandle)
return hwSym(proc, GLUhandle);
else
return NULL;
}
return SDL_GL_GetProcAddress(proc);
}
@ -89,7 +81,6 @@ boolean LoadGL(void)
{
#ifndef STATIC_OPENGL
const char *OGLLibname = NULL;
const char *GLULibname = NULL;
if (M_CheckParm("-OGLlib") && M_IsNextParm())
OGLLibname = M_GetNextParm();
@ -102,43 +93,6 @@ boolean LoadGL(void)
CONS_Printf("If you know what is the OpenGL library's name, use -OGLlib\n");
return 0;
}
#if 0
GLULibname = "/proc/self/exe";
#elif defined (_WIN32)
GLULibname = "GLU32.DLL";
#elif defined (__MACH__)
GLULibname = "/System/Library/Frameworks/OpenGL.framework/Libraries/libGLU.dylib";
#elif defined (macintos)
GLULibname = "OpenGLLibrary";
#elif defined (__unix__)
GLULibname = "libGLU.so.1";
#elif defined (__HAIKU__)
GLULibname = "libGLU.so";
#else
GLULibname = NULL;
#endif
if (M_CheckParm("-GLUlib") && M_IsNextParm())
GLULibname = M_GetNextParm();
if (GLULibname)
{
GLUhandle = hwOpen(GLULibname);
if (GLUhandle)
return SetupGLfunc();
else
{
CONS_Alert(CONS_ERROR, "Could not load GLU Library: %s\n", GLULibname);
if (!M_CheckParm ("-GLUlib"))
CONS_Alert(CONS_ERROR, "If you know what is the GLU library's name, use -GLUlib\n");
}
}
else
{
CONS_Alert(CONS_ERROR, "Could not load GLU Library\n");
CONS_Alert(CONS_ERROR, "If you know what is the GLU library's name, use -GLUlib\n");
}
#endif
return SetupGLfunc();
}
@ -155,6 +109,7 @@ boolean OglSdlSurface(INT32 w, INT32 h)
{
INT32 cbpp = cv_scr_depth.value < 16 ? 16 : cv_scr_depth.value;
static boolean first_init = false;
static int majorGL = 0, minorGL = 0;
oglflags = 0;
@ -189,6 +144,12 @@ boolean OglSdlSurface(INT32 w, INT32 h)
else
maximumAnisotropy = 1;
if (sscanf((const char*)gl_version, "%d.%d", &majorGL, &minorGL)
&& (!(majorGL == 1 && minorGL <= 3)))
supportMipMap = true;
else
supportMipMap = false;
SetupGLFunc4();
glanisotropicmode_cons_t[1].value = maximumAnisotropy;

View file

@ -19,8 +19,6 @@
#include "../v_video.h"
extern void *GLUhandle;
boolean OglSdlSurface(INT32 w, INT32 h);
void OglSdlFinishUpdate(boolean vidwait);

View file

@ -284,6 +284,8 @@ sfxinfo_t S_sfx[NUMSFX] =
{"mario8", false, 48, SF_X4AWAYSOUND, -1, NULL, 0, -1, -1, LUMPERROR, "Hurt"},
{"mario9", true, 120, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Emerging power-up"},
{"marioa", true, 192, 0, -1, NULL, 0, -1, -1, LUMPERROR, "One-up"},
{"mariob", true, 127, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Spring"},
{"marioc", true, 127, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Crumbling"},
{"thwomp", true, 127, SF_X4AWAYSOUND, -1, NULL, 0, -1, -1, LUMPERROR, "Thwomp"},
// Black Eggman

View file

@ -332,6 +332,8 @@ typedef enum
sfx_mario8,
sfx_mario9,
sfx_marioa,
sfx_mariob,
sfx_marioc,
sfx_thwomp,
// Black Eggman

View file

@ -2068,24 +2068,25 @@ static void ST_drawNiGHTSHUD(void)
if (!stplyr->exiting && !oldspecialstage && LUA_HudEnabled(hud_nightsscore))
ST_DrawNightsOverlayNum(304<<FRACBITS, 14<<FRACBITS, FRACUNIT, V_PERPLAYER|V_SNAPTOTOP|V_SNAPTORIGHT, stplyr->marescore, nightsnum, SKINCOLOR_AZURE);
// TODO give this its own section for Lua
// TODO: give this its own section for Lua
// TODO: on multi-mare maps, show time & grade for each completed mare
if (!stplyr->exiting && LUA_HudEnabled(hud_nightsscore))
{
if (modeattacking == ATTACKING_NIGHTS)
{
INT32 maretime = max(stplyr->realtime - stplyr->marebegunat, 0);
#define VFLAGS V_SNAPTOBOTTOM|V_SNAPTORIGHT|V_PERPLAYER|V_HUDTRANS
V_DrawScaledPatch(BASEVIDWIDTH-22, BASEVIDHEIGHT-20, VFLAGS, W_CachePatchName("NGRTIMER", PU_HUDGFX));
V_DrawPaddedTallNum(BASEVIDWIDTH-22, BASEVIDHEIGHT-20, VFLAGS, G_TicsToCentiseconds(maretime), 2);
V_DrawScaledPatch(BASEVIDWIDTH-46, BASEVIDHEIGHT-20, VFLAGS, sboperiod);
#define VFLAGS V_SNAPTOTOP|V_SNAPTORIGHT|V_PERPLAYER|V_HUDTRANS
V_DrawScaledPatch(BASEVIDWIDTH-16, 40, VFLAGS, W_CachePatchName("NGRTIMER", PU_HUDGFX));
V_DrawPaddedTallNum(BASEVIDWIDTH-16, 40, VFLAGS, G_TicsToCentiseconds(maretime), 2);
V_DrawScaledPatch(BASEVIDWIDTH-40, 40, VFLAGS, sboperiod);
if (maretime < 60*TICRATE)
V_DrawTallNum(BASEVIDWIDTH-46, BASEVIDHEIGHT-20, VFLAGS, G_TicsToSeconds(maretime));
V_DrawTallNum(BASEVIDWIDTH-40, 40, VFLAGS, G_TicsToSeconds(maretime));
else
{
V_DrawPaddedTallNum(BASEVIDWIDTH-46, BASEVIDHEIGHT-20, VFLAGS, G_TicsToSeconds(maretime), 2);
V_DrawScaledPatch(BASEVIDWIDTH-70, BASEVIDHEIGHT-20, VFLAGS, sbocolon);
V_DrawTallNum(BASEVIDWIDTH-70, BASEVIDHEIGHT-20, VFLAGS, G_TicsToMinutes(maretime, true));
V_DrawPaddedTallNum(BASEVIDWIDTH-40, 40, VFLAGS, G_TicsToSeconds(maretime), 2);
V_DrawScaledPatch(BASEVIDWIDTH-64, 40, VFLAGS, sbocolon);
V_DrawTallNum(BASEVIDWIDTH-64, 40, VFLAGS, G_TicsToMinutes(maretime, true));
}
#undef VFLAGS
}

View file

@ -12,4 +12,4 @@
#define MODVERSION 55
// Define this as a prerelease version suffix (pre#, RC#)
#define BETAVERSION "nightly"
//#define BETAVERSION "pre4"

View file

@ -98,7 +98,7 @@ BEGIN
VALUE "FileDescription", "Sonic Robo Blast 2\0"
VALUE "FileVersion", VERSIONSTRING_RC
VALUE "InternalName", "srb2\0"
VALUE "LegalCopyright", "Copyright 1998-2024 by Sonic Team Junior\0"
VALUE "LegalCopyright", "Copyright 1998-2025 by Sonic Team Junior\0"
VALUE "LegalTrademarks", "Sonic the Hedgehog and related characters are trademarks of Sega.\0"
VALUE "OriginalFilename", "srb2win.exe\0"
VALUE "PrivateBuild", "\0"

View file

@ -109,6 +109,7 @@ typedef union
UINT16 *color[MAXPLAYERS]; // Winner's color #
boolean spectator[MAXPLAYERS]; // Spectator list
UINT8 *character[MAXPLAYERS]; // Winner's character #
INT32 ctfteam[MAXPLAYERS]; // Winner's ctfteam #
INT32 num[MAXPLAYERS]; // Winner's player #
char *name[MAXPLAYERS]; // Winner's name
patch_t *result; // RESULT
@ -579,9 +580,9 @@ void Y_IntermissionDrawer(void)
{
if (LUA_HudEnabled(hud_intermissiontitletext))
{
const char *ringtext = "\x82" "get 50 rings, then";
const char *ringtext = "\x82" "50 rings, no shield";
const char *tut1text = "\x82" "press " "\x80" "shield";
const char *tut2text = "\x82" "to transform";
const char *tut2text = "\x82" "mid-" "\x80" "jump";
ttheight = 8;
V_DrawLevelTitle(data.spec.passedx1 + xoffset1, ttheight, 0, data.spec.passed1);
ttheight += V_LevelNameHeight(data.spec.passed3) + 2;
@ -849,7 +850,7 @@ void Y_IntermissionDrawer(void)
{
UINT8 *colormap = R_GetTranslationColormap(*data.match.character[i], *data.match.color[i], GTC_CACHE);
if (*data.match.color[i] == SKINCOLOR_RED) //red
if (data.match.ctfteam[i] == 1) //red
{
if (redplayers++ > 9)
continue;
@ -857,7 +858,7 @@ void Y_IntermissionDrawer(void)
y = (redplayers * 16) + 32;
V_DrawCenteredString(x+6, y, 0, va("%d", redplayers));
}
else if (*data.match.color[i] == SKINCOLOR_BLUE) //blue
else if (data.match.ctfteam[i] == 2) //blue
{
if (blueplayers++ > 9)
continue;
@ -1129,7 +1130,7 @@ void Y_Ticker(void)
else if (mapheaderinfo[gamemap-1]->musintername[0] && S_MusicExists(mapheaderinfo[gamemap-1]->musintername, !midi_disabled, !digital_disabled))
S_ChangeMusicInternal(mapheaderinfo[gamemap-1]->musintername, false); // don't loop it
else
S_ChangeMusicInternal("_clear", false); // don't loop it
S_ChangeMusicInternal(stagefailed ? "CHFAIL" : "CHPASS", false); // don't loop it
tallydonetic = -1;
}
@ -1622,6 +1623,7 @@ static void Y_CalculateMatchWinners(void)
boolean completed[MAXPLAYERS];
// Initialize variables
memset(data.match.ctfteam, 0, sizeof (data.match.ctfteam));
memset(data.match.scores, 0, sizeof (data.match.scores));
memset(data.match.color, 0, sizeof (data.match.color));
memset(data.match.character, 0, sizeof (data.match.character));
@ -1642,8 +1644,15 @@ static void Y_CalculateMatchWinners(void)
if (players[i].score >= data.match.scores[data.match.numplayers] && completed[i] == false)
{
data.match.ctfteam[data.match.numplayers] = players[i].ctfteam;
data.match.scores[data.match.numplayers] = players[i].score;
data.match.color[data.match.numplayers] = &players[i].skincolor;
if (data.match.ctfteam[data.match.numplayers] == 1) // red team
data.match.color[data.match.numplayers] = &skincolor_redteam;
if (data.match.ctfteam[data.match.numplayers] == 2) // blue team
data.match.color[data.match.numplayers] = &skincolor_blueteam;
data.match.character[data.match.numplayers] = &players[i].skin;
data.match.name[data.match.numplayers] = player_names[i];
data.match.spectator[data.match.numplayers] = players[i].spectator;