diff --git a/CMakeLists.txt b/CMakeLists.txt index 855393de1..abec11087 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.0) # DO NOT CHANGE THIS SRB2 STRING! Some variable names depend on this string. # Version change is fine. project(SRB2 - VERSION 2.2.1 + VERSION 2.2.2 LANGUAGES C) if(${PROJECT_SOURCE_DIR} MATCHES ${PROJECT_BINARY_DIR}) diff --git a/appveyor.yml b/appveyor.yml index 20b18d7d5..a28935f63 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,4 +1,4 @@ -version: 2.2.1.{branch}-{build} +version: 2.2.2.{branch}-{build} os: MinGW environment: diff --git a/assets/CMakeLists.txt b/assets/CMakeLists.txt index 0636c1e59..095349418 100644 --- a/assets/CMakeLists.txt +++ b/assets/CMakeLists.txt @@ -19,7 +19,8 @@ set(SRB2_ASSET_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/installer" set(SRB2_ASSET_HASHED "srb2.pk3;\ player.dta;\ -zones.pk3" +zones.pk3;\ +patch.pk3" CACHE STRING "Asset filenames to apply MD5 checks. No spaces between entries!" ) diff --git a/src/Makefile b/src/Makefile index eb92364bd..343b8d143 100644 --- a/src/Makefile +++ b/src/Makefile @@ -2,7 +2,7 @@ # GNU Make makefile for SRB2 ############################################################################# # Copyright (C) 1998-2000 by DooM Legacy Team. -# Copyright (C) 2003-2019 by Sonic Team Junior. +# Copyright (C) 2003-2020 by Sonic Team Junior. # # This program is free software distributed under the # terms of the GNU General Public License, version 2. diff --git a/src/am_map.c b/src/am_map.c index b2c7de442..234df1abd 100644 --- a/src/am_map.c +++ b/src/am_map.c @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/am_map.h b/src/am_map.h index 0560207bb..1c8fa70e4 100644 --- a/src/am_map.h +++ b/src/am_map.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/apng.c b/src/apng.c index 694b3d1e8..0abbe541d 100644 --- a/src/apng.c +++ b/src/apng.c @@ -1,5 +1,5 @@ /* -Copyright 2019, James R. +Copyright 2019-2020, James R. All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/src/apng.h b/src/apng.h index 0f22dca6d..a8b5c8f24 100644 --- a/src/apng.h +++ b/src/apng.h @@ -1,5 +1,5 @@ /* -Copyright 2019, James R. +Copyright 2019-2020, James R. All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/src/asm_defs.inc b/src/asm_defs.inc index 82149f70e..ec286b0bd 100644 --- a/src/asm_defs.inc +++ b/src/asm_defs.inc @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/b_bot.c b/src/b_bot.c index f83aaa34c..4f904b672 100644 --- a/src/b_bot.c +++ b/src/b_bot.c @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 2007-2016 by John "JTE" Muniz. -// Copyright (C) 2011-2019 by Sonic Team Junior. +// Copyright (C) 2011-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/b_bot.h b/src/b_bot.h index 54ef300a3..2806bd68f 100644 --- a/src/b_bot.h +++ b/src/b_bot.h @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 2007-2016 by John "JTE" Muniz. -// Copyright (C) 2012-2019 by Sonic Team Junior. +// Copyright (C) 2012-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/byteptr.h b/src/byteptr.h index 57fe9cb75..933c2af34 100644 --- a/src/byteptr.h +++ b/src/byteptr.h @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/command.c b/src/command.c index cb6803b57..d1eea6052 100644 --- a/src/command.c +++ b/src/command.c @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/command.h b/src/command.h index e7371b2fa..404052ce4 100644 --- a/src/command.h +++ b/src/command.h @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/config.h.in b/src/config.h.in index 498f3086d..4926f9a06 100644 --- a/src/config.h.in +++ b/src/config.h.in @@ -27,13 +27,13 @@ /* Manually defined asset hashes for non-CMake builds * Last updated 2020 / 02 / 15 - v2.2.1 - main assets - * Last updated 20?? / ?? / ?? - v2.2.? - patch.pk3 + * Last updated 2020 / 02 / 22 - v2.2.2 - patch.pk3 */ #define ASSET_HASH_SRB2_PK3 "0277c9416756627004e83cbb5b2e3e28" #define ASSET_HASH_ZONES_PK3 "f7e88afb6af7996a834c7d663144bead" #define ASSET_HASH_PLAYER_DTA "ad49e07b17cc662f1ad70c454910b4ae" #ifdef USE_PATCH_DTA -#define ASSET_HASH_PATCH_PK3 "there is no patch.pk3, only zuul" +#define ASSET_HASH_PATCH_PK3 "ee54330ecb743314c5f962af4db731ff" #endif #endif diff --git a/src/console.c b/src/console.c index 83df15a28..f92868e4c 100644 --- a/src/console.c +++ b/src/console.c @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. @@ -613,15 +613,6 @@ void CON_Ticker(void) con_tick++; con_tick &= 7; - // if the menu is open then close the console. - if (menuactive && con_destlines) - { - consoletoggle = false; - con_destlines = 0; - CON_ClearHUD(); - I_UpdateMouseGrab(); - } - // console key was pushed if (consoletoggle) { @@ -793,7 +784,7 @@ boolean CON_Responder(event_t *ev) // check other keys only if console prompt is active if (!consoleready && key < NUMINPUTS) // metzgermeister: boundary check!! { - if (bindtable[key]) + if (! menuactive && bindtable[key]) { COM_BufAddText(bindtable[key]); COM_BufAddText("\n"); diff --git a/src/console.h b/src/console.h index 7a55c4b92..2be92d62b 100644 --- a/src/console.h +++ b/src/console.h @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 77118110e..71e32977a 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. @@ -3945,7 +3945,9 @@ static void HandlePacketFromPlayer(SINT8 node) INT32 netconsole; tic_t realend, realstart; UINT8 *pak, *txtpak, numtxtpak; +#ifndef NOMD5 UINT8 finalmd5[16];/* Well, it's the cool thing to do? */ +#endif txtpak = NULL; @@ -3964,7 +3966,7 @@ static void HandlePacketFromPlayer(SINT8 node) case PT_RESYNCHGET: if (client) break; - SV_AcknowledgeResynchAck(netconsole, netbuffer->u.resynchgot); + SV_AcknowledgeResynchAck(node, netbuffer->u.resynchgot); break; case PT_CLIENTCMD: case PT_CLIENT2CMD: diff --git a/src/d_clisrv.h b/src/d_clisrv.h index df93fe31d..10a1d714d 100644 --- a/src/d_clisrv.h +++ b/src/d_clisrv.h @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/d_event.h b/src/d_event.h index c61b9460a..3cce8fad1 100644 --- a/src/d_event.h +++ b/src/d_event.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/d_main.c b/src/d_main.c index 418da4ecc..ef2ed6322 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. @@ -266,6 +266,9 @@ static void D_Display(void) #endif } + if (rendermode == render_soft && !splitscreen) + R_CheckViewMorph(); + // change the view size if needed if (setsizeneeded || setrenderstillneeded) { @@ -446,6 +449,9 @@ static void D_Display(void) // Image postprocessing effect if (rendermode == render_soft) { + if (!splitscreen) + R_ApplyViewMorph(); + if (postimgtype) V_DoPostProcessor(0, postimgtype, postimgparam); if (postimgtype2) @@ -502,13 +508,11 @@ static void D_Display(void) // vid size change is now finished if it was on... vid.recalc = 0; - // FIXME: draw either console or menu, not the two - if (gamestate != GS_TIMEATTACK) - CON_Drawer(); - M_Drawer(); // menu is drawn even on top of everything // focus lost moved to M_Drawer + CON_Drawer(); + // // wipe update // @@ -1036,7 +1040,7 @@ void D_SRB2Main(void) // Print GPL notice for our console users (Linux) CONS_Printf( "\n\nSonic Robo Blast 2\n" - "Copyright (C) 1998-2019 by Sonic Team Junior\n\n" + "Copyright (C) 1998-2020 by Sonic Team Junior\n\n" "This program comes with ABSOLUTELY NO WARRANTY.\n\n" "This is free software, and you are welcome to redistribute it\n" "and/or modify it under the terms of the GNU General Public License\n" @@ -1210,14 +1214,14 @@ void D_SRB2Main(void) W_InitMultipleFiles(startupwadfiles, mainwads); D_CleanFile(); -#ifndef DEVELOP // md5s last updated 16/02/20 (ddmmyy) +#ifndef DEVELOP // md5s last updated 22/02/20 (ddmmyy) // Check MD5s of autoloaded files W_VerifyFileMD5(0, ASSET_HASH_SRB2_PK3); // srb2.pk3 W_VerifyFileMD5(1, ASSET_HASH_ZONES_PK3); // zones.pk3 W_VerifyFileMD5(2, ASSET_HASH_PLAYER_DTA); // player.dta #ifdef USE_PATCH_DTA - W_VerifyFileMD5(3, ASSET_HASH_PATCH_DTA); // patch.pk3 + W_VerifyFileMD5(3, ASSET_HASH_PATCH_PK3); // patch.pk3 #endif // don't check music.dta because people like to modify it, and it doesn't matter if they do // ...except it does if they slip maps in there, and that's what W_VerifyNMUSlumps is for. @@ -1225,20 +1229,6 @@ void D_SRB2Main(void) mainwadstally = packetsizetally; // technically not accurate atm, remember to port the two-stage -file process from kart in 2.2.x - if (M_CheckParm("-warp") && M_IsNextParm()) - { - const char *word = M_GetNextParm(); - pstartmap = G_FindMapByNameOrCode(word, 0); - if (! pstartmap) - I_Error("Cannot find a map remotely named '%s'\n", word); - else - { - if (!M_CheckParm("-server")) - G_SetGameModified(true); - autostart = true; - } - } - cht_Init(); //---------------------------------------------------- READY SCREEN @@ -1287,11 +1277,18 @@ void D_SRB2Main(void) // Lactozilla: Does the render mode need to change? if ((setrenderneeded != 0) && (setrenderneeded != rendermode)) { - CONS_Printf("Switching the renderer...\n"); + CONS_Printf(M_GetText("Switching the renderer...\n")); + Z_PreparePatchFlush(); + + // set needpatchflush / needpatchrecache true for D_CheckRendererState needpatchflush = true; needpatchrecache = true; + + // Set cv_renderer to the new render mode VID_CheckRenderer(); SCR_ChangeRendererCVars(setrenderneeded); + + // check the renderer's state, and then clear setrenderneeded D_CheckRendererState(); setrenderneeded = 0; } @@ -1302,6 +1299,23 @@ void D_SRB2Main(void) //------------------------------------------------ COMMAND LINE PARAMS + // this must be done after loading gamedata, + // to avoid setting off the corrupted gamedata code in G_LoadGameData if a SOC with custom gamedata is added + // -- Monster Iestyn 20/02/20 + if (M_CheckParm("-warp") && M_IsNextParm()) + { + const char *word = M_GetNextParm(); + pstartmap = G_FindMapByNameOrCode(word, 0); + if (! pstartmap) + I_Error("Cannot find a map remotely named '%s'\n", word); + else + { + if (!M_CheckParm("-server")) + G_SetGameModified(true); + autostart = true; + } + } + // Initialize CD-Audio if (M_CheckParm("-usecd") && !dedicated) I_InitCD(); diff --git a/src/d_main.h b/src/d_main.h index b0cd3cb88..81de0634d 100644 --- a/src/d_main.h +++ b/src/d_main.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/d_net.c b/src/d_net.c index 573c9cfe9..f7848f16e 100644 --- a/src/d_net.c +++ b/src/d_net.c @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/d_net.h b/src/d_net.h index c6fe4a27f..ed4f66284 100644 --- a/src/d_net.h +++ b/src/d_net.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/d_netcmd.c b/src/d_netcmd.c index bac297f8e..c25929929 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. @@ -370,7 +370,7 @@ consvar_t cv_advancemap = {"advancemap", "Next", CV_NETVAR, advancemap_cons_t, N static CV_PossibleValue_t playersforexit_cons_t[] = {{0, "One"}, {1, "1/4"}, {2, "Half"}, {3, "3/4"}, {4, "All"}, {0, NULL}}; consvar_t cv_playersforexit = {"playersforexit", "All", CV_NETVAR, playersforexit_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_exitmove = {"exitmove", "Off", CV_NETVAR|CV_CALL, CV_OnOff, ExitMove_OnChange, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_exitmove = {"exitmove", "On", CV_NETVAR|CV_CALL, CV_OnOff, ExitMove_OnChange, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_runscripts = {"runscripts", "Yes", 0, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL}; @@ -3749,9 +3749,15 @@ static void ExitMove_OnChange(void) if (cv_exitmove.value) { for (i = 0; i < MAXPLAYERS; ++i) - if (playeringame[i] && players[i].mo - && players[i].mo->target && players[i].mo->target->type == MT_SIGN) - P_SetTarget(&players[i].mo->target, NULL); + if (playeringame[i] && players[i].mo) + { + if (players[i].mo->target && players[i].mo->target->type == MT_SIGN) + P_SetTarget(&players[i].mo->target, NULL); + + if (players[i].pflags & PF_FINISHED) + P_GiveFinishFlags(&players[i]); + } + CONS_Printf(M_GetText("Players can now move after completing the level.\n")); } else diff --git a/src/d_netcmd.h b/src/d_netcmd.h index f258cde62..2b0ddd185 100644 --- a/src/d_netcmd.h +++ b/src/d_netcmd.h @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/d_netfil.c b/src/d_netfil.c index 93b4b1990..3926ff14d 100644 --- a/src/d_netfil.c +++ b/src/d_netfil.c @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/d_netfil.h b/src/d_netfil.h index 17aeb8b7e..8214ccd4c 100644 --- a/src/d_netfil.h +++ b/src/d_netfil.h @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/d_player.h b/src/d_player.h index db55a9913..209ff766d 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. @@ -278,6 +278,7 @@ typedef enum pw_nights_linkfreeze, pw_nocontrol, //for linedef exec 427 + pw_justlaunched, // Launched off a slope this tic (0=none, 1=standard launch, 2=half-pipe launch) NUMPOWERS } powertype_t; @@ -324,6 +325,8 @@ typedef struct player_s // bounded/scaled total momentum. fixed_t bob; + angle_t viewrollangle; + // Mouse aiming, where the guy is looking at! // It is updated with cmd->aiming. angle_t aiming; diff --git a/src/d_think.h b/src/d_think.h index c56551c21..4bdac4627 100644 --- a/src/d_think.h +++ b/src/d_think.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/d_ticcmd.h b/src/d_ticcmd.h index 337be1ff0..0a8012bb1 100644 --- a/src/d_ticcmd.h +++ b/src/d_ticcmd.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/dehacked.c b/src/dehacked.c index e9ee6f58f..5a151ce3e 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. @@ -1806,6 +1806,24 @@ static void readlevelheader(MYFILE *f, INT32 num) else mapheaderinfo[num-1]->levelflags &= ~LF_NOTITLECARD; } + else if (fastcmp(word, "SHOWTITLECARDFOR")) + { + mapheaderinfo[num-1]->levelflags |= LF_NOTITLECARD; + tmp = strtok(word2,","); + do { + if (fastcmp(tmp, "FIRST")) + mapheaderinfo[num-1]->levelflags &= ~LF_NOTITLECARDFIRST; + else if (fastcmp(tmp, "RESPAWN")) + mapheaderinfo[num-1]->levelflags &= ~LF_NOTITLECARDRESPAWN; + else if (fastcmp(tmp, "RECORDATTACK")) + mapheaderinfo[num-1]->levelflags &= ~LF_NOTITLECARDRECORDATTACK; + else if (fastcmp(tmp, "ALL")) + mapheaderinfo[num-1]->levelflags &= ~LF_NOTITLECARD; + else if (!fastcmp(tmp, "NONE")) + deh_warning("Level header %d: unknown titlecard show option %s\n", num, tmp); + + } while((tmp = strtok(NULL,",")) != NULL); + } // Individual triggers for menu flags else if (fastcmp(word, "HIDDEN")) @@ -7459,6 +7477,9 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit // Got Flag Sign "S_GOTFLAG", + + // Finish flag + "S_FINISHFLAG", "S_CORK", "S_LHRT", @@ -8580,6 +8601,7 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s "MT_LOCKONINF", // In-level Target "MT_TAG", // Tag Sign "MT_GOTFLAG", // Got Flag sign + "MT_FINISHFLAG", // Finish flag // Ambient Sounds "MT_AWATERA", // Ambient Water Sound 1 @@ -8970,9 +8992,11 @@ static const char *COLOR_ENUMS[] = { // Desaturated "AETHER", // SKINCOLOR_AETHER, "SLATE", // SKINCOLOR_SLATE, + "BLUEBELL", // SKINCOLOR_BLUEBELL, "PINK", // SKINCOLOR_PINK, "YOGURT", // SKINCOLOR_YOGURT, "BROWN", // SKINCOLOR_BROWN, + "BRONZE", // SKINCOLOR_BRONZE, "TAN", // SKINCOLOR_TAN, "BEIGE", // SKINCOLOR_BEIGE, "MOSS", // SKINCOLOR_MOSS, @@ -8985,9 +9009,11 @@ static const char *COLOR_ENUMS[] = { "RED", // SKINCOLOR_RED, "CRIMSON", // SKINCOLOR_CRIMSON, "FLAME", // SKINCOLOR_FLAME, + "KETCHUP", // SKINCOLOR_KETCHUP, "PEACHY", // SKINCOLOR_PEACHY, "QUAIL", // SKINCOLOR_QUAIL, "SUNSET", // SKINCOLOR_SUNSET, + "COPPER", // SKINCOLOR_COPPER, "APRICOT", // SKINCOLOR_APRICOT, "ORANGE", // SKINCOLOR_ORANGE, "RUST", // SKINCOLOR_RUST, @@ -8997,6 +9023,7 @@ static const char *COLOR_ENUMS[] = { "OLIVE", // SKINCOLOR_OLIVE, "LIME", // SKINCOLOR_LIME, "PERIDOT", // SKINCOLOR_PERIDOT, + "APPLE", // SKINCOLOR_APPLE, "GREEN", // SKINCOLOR_GREEN, "FOREST", // SKINCOLOR_FOREST, "EMERALD", // SKINCOLOR_EMERALD, @@ -9023,6 +9050,7 @@ static const char *COLOR_ENUMS[] = { "VIOLET", // SKINCOLOR_VIOLET, "LILAC", // SKINCOLOR_LILAC, "PLUM", // SKINCOLOR_PLUM, + "RASPBERRY", // SKINCOLOR_RASPBERRY, "ROSY", // SKINCOLOR_ROSY, // Super special awesome Super flashing colors! @@ -9116,7 +9144,8 @@ static const char *const POWERS_LIST[] = { "NIGHTS_LINKFREEZE", //for linedef exec 427 - "NOCONTROL" + "NOCONTROL", + "JUSTLAUNCHED", }; static const char *const HUDITEMS_LIST[] = { @@ -9351,6 +9380,9 @@ struct { {"LF_NOZONE",LF_NOZONE}, {"LF_SAVEGAME",LF_SAVEGAME}, {"LF_MIXNIGHTSCOUNTDOWN",LF_MIXNIGHTSCOUNTDOWN}, + {"LF_NOTITLECARDFIRST",LF_NOTITLECARDFIRST}, + {"LF_NOTITLECARDRESPAWN",LF_NOTITLECARDRESPAWN}, + {"LF_NOTITLECARDRECORDATTACK",LF_NOTITLECARDRECORDATTACK}, {"LF_NOTITLECARD",LF_NOTITLECARD}, {"LF_WARNINGTITLE",LF_WARNINGTITLE}, // And map flags diff --git a/src/dehacked.h b/src/dehacked.h index 2b34377fd..80c31f3de 100644 --- a/src/dehacked.h +++ b/src/dehacked.h @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/djgppdos/rdb-s.h b/src/djgppdos/rdb-s.h index b7a994fc9..2d460c935 100644 --- a/src/djgppdos/rdb-s.h +++ b/src/djgppdos/rdb-s.h @@ -1,7 +1,7 @@ // Emacs style mode select -*- C++ -*- //----------------------------------------------------------------------------- // -// Copyright (C) 2005-2019 by Sonic Team Junior. +// Copyright (C) 2005-2020 by Sonic Team Junior. // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License diff --git a/src/doomdata.h b/src/doomdata.h index f6e7cb584..c2ee50c2e 100644 --- a/src/doomdata.h +++ b/src/doomdata.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/doomdef.h b/src/doomdef.h index 4d3204d67..3d4a116be 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. @@ -143,16 +143,16 @@ extern char logfilename[1024]; // we use comprevision and compbranch instead. #else #define VERSION 202 // Game version -#define SUBVERSION 1 // more precise version number -#define VERSIONSTRING "v2.2.1" -#define VERSIONSTRINGW L"v2.2.1" +#define SUBVERSION 2 // more precise version number +#define VERSIONSTRING "v2.2.2" +#define VERSIONSTRINGW L"v2.2.2" // Hey! If you change this, add 1 to the MODVERSION below! // Otherwise we can't force updates! #endif // Does this version require an added patch file? // Comment or uncomment this as necessary. -//#define USE_PATCH_DTA +#define USE_PATCH_DTA // Use .kart extension addons //#define USE_KART @@ -210,7 +210,7 @@ extern char logfilename[1024]; // it's only for detection of the version the player is using so the MS can alert them of an update. // Only set it higher, not lower, obviously. // Note that we use this to help keep internal testing in check; this is why v2.2.0 is not version "1". -#define MODVERSION 41 +#define MODVERSION 42 // To version config.cfg, MAJOREXECVERSION is set equal to MODVERSION automatically. // Increment MINOREXECVERSION whenever a config change is needed that does not correspond @@ -253,9 +253,11 @@ typedef enum // Desaturated SKINCOLOR_AETHER, SKINCOLOR_SLATE, + SKINCOLOR_BLUEBELL, SKINCOLOR_PINK, SKINCOLOR_YOGURT, SKINCOLOR_BROWN, + SKINCOLOR_BRONZE, SKINCOLOR_TAN, SKINCOLOR_BEIGE, SKINCOLOR_MOSS, @@ -268,9 +270,11 @@ typedef enum SKINCOLOR_RED, SKINCOLOR_CRIMSON, SKINCOLOR_FLAME, + SKINCOLOR_KETCHUP, SKINCOLOR_PEACHY, SKINCOLOR_QUAIL, SKINCOLOR_SUNSET, + SKINCOLOR_COPPER, SKINCOLOR_APRICOT, SKINCOLOR_ORANGE, SKINCOLOR_RUST, @@ -280,6 +284,7 @@ typedef enum SKINCOLOR_OLIVE, SKINCOLOR_LIME, SKINCOLOR_PERIDOT, + SKINCOLOR_APPLE, SKINCOLOR_GREEN, SKINCOLOR_FOREST, SKINCOLOR_EMERALD, @@ -306,6 +311,7 @@ typedef enum SKINCOLOR_VIOLET, SKINCOLOR_LILAC, SKINCOLOR_PLUM, + SKINCOLOR_RASPBERRY, SKINCOLOR_ROSY, // SKINCOLOR_? - one left before we bump up against 0x39, which isn't a HARD limit anymore but would be excessive @@ -490,6 +496,7 @@ extern INT32 cv_debug; #define DBG_SETUP 0x0400 #define DBG_LUA 0x0800 #define DBG_RANDOMIZER 0x1000 +#define DBG_VIEWMORPH 0x2000 // ======================= // Misc stuff for later... diff --git a/src/doomstat.h b/src/doomstat.h index cf02e4389..b7388fd96 100644 --- a/src/doomstat.h +++ b/src/doomstat.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. @@ -351,15 +351,19 @@ typedef struct } mapheader_t; // level flags -#define LF_SCRIPTISFILE 1 ///< True if the script is a file, not a lump. -#define LF_SPEEDMUSIC 2 ///< Speed up act music for super sneakers -#define LF_NOSSMUSIC 4 ///< Disable Super Sonic music -#define LF_NORELOAD 8 ///< Don't reload level on death -#define LF_NOZONE 16 ///< Don't include "ZONE" on level title -#define LF_SAVEGAME 32 ///< Save the game upon loading this level -#define LF_MIXNIGHTSCOUNTDOWN 64 ///< Play sfx_timeup instead of music change for NiGHTS countdown -#define LF_WARNINGTITLE 128 ///< WARNING! WARNING! WARNING! WARNING! -#define LF_NOTITLECARD 256 ///< Don't start the title card +#define LF_SCRIPTISFILE (1<<0) ///< True if the script is a file, not a lump. +#define LF_SPEEDMUSIC (1<<1) ///< Speed up act music for super sneakers +#define LF_NOSSMUSIC (1<<2) ///< Disable Super Sonic music +#define LF_NORELOAD (1<<3) ///< Don't reload level on death +#define LF_NOZONE (1<<4) ///< Don't include "ZONE" on level title +#define LF_SAVEGAME (1<<5) ///< Save the game upon loading this level +#define LF_MIXNIGHTSCOUNTDOWN (1<<6) ///< Play sfx_timeup instead of music change for NiGHTS countdown +#define LF_WARNINGTITLE (1<<7) ///< WARNING! WARNING! WARNING! WARNING! + +#define LF_NOTITLECARDFIRST (1<<8) +#define LF_NOTITLECARDRESPAWN (1<<9) +#define LF_NOTITLECARDRECORDATTACK (1<<10) +#define LF_NOTITLECARD (LF_NOTITLECARDFIRST|LF_NOTITLECARDRESPAWN|LF_NOTITLECARDRECORDATTACK) ///< Don't start the title card at all #define LF2_HIDEINMENU 1 ///< Hide in the multiplayer menu #define LF2_HIDEINSTATS 2 ///< Hide in the statistics screen diff --git a/src/doomtype.h b/src/doomtype.h index 6365f851e..571e930e0 100644 --- a/src/doomtype.h +++ b/src/doomtype.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/endian.h b/src/endian.h index 76f3ef6e8..24d8e35cd 100644 --- a/src/endian.h +++ b/src/endian.h @@ -1,6 +1,6 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- -// Copyright (C) 2014-2019 by Sonic Team Junior. +// Copyright (C) 2014-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/f_finale.c b/src/f_finale.c index 66f963bbb..c98d49842 100644 --- a/src/f_finale.c +++ b/src/f_finale.c @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/f_finale.h b/src/f_finale.h index efc2de2e6..63319d7d6 100644 --- a/src/f_finale.h +++ b/src/f_finale.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/f_wipe.c b/src/f_wipe.c index a350e0f36..8d12262ef 100644 --- a/src/f_wipe.c +++ b/src/f_wipe.c @@ -3,7 +3,7 @@ // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 2013-2016 by Matthew "Kaito Sinclaire" Walsh. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. @@ -192,8 +192,7 @@ void F_WipeStageTitle(void) // draw level title if ((WipeStageTitle && st_overlay) && (wipestyle == WIPESTYLE_COLORMAP) - && !(mapheaderinfo[gamemap-1]->levelflags & LF_NOTITLECARD) - && *mapheaderinfo[gamemap-1]->lvlttl != '\0') + && G_IsTitleCardAvailable()) { ST_runTitleCard(); ST_drawWipeTitleCard(); diff --git a/src/g_game.c b/src/g_game.c index 989722010..08192bfb8 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. @@ -1928,13 +1928,22 @@ void G_PreLevelTitleCard(void) wipestyleflags = WSF_CROSSFADE; } +static boolean titlecardforreload = false; + // // Returns true if the current level has a title card. // boolean G_IsTitleCardAvailable(void) { // The current level header explicitly disabled the title card. - if (mapheaderinfo[gamemap-1]->levelflags & LF_NOTITLECARD) + UINT16 titleflag = LF_NOTITLECARDFIRST; + + if (modeattacking != ATTACKING_NONE) + titleflag = LF_NOTITLECARDRECORDATTACK; + else if (titlecardforreload) + titleflag = LF_NOTITLECARDRESPAWN; + + if (mapheaderinfo[gamemap-1]->levelflags & titleflag) return false; // The current gametype doesn't have a title card. @@ -3024,7 +3033,9 @@ void G_DoReborn(INT32 playernum) #ifdef HAVE_BLUA LUAh_MapChange(gamemap); #endif + titlecardforreload = true; G_DoLoadLevel(true); + titlecardforreload = false; if (metalrecording) G_BeginMetal(); return; @@ -3203,17 +3214,17 @@ UINT32 gametypedefaultrules[NUMGAMETYPES] = GTR_RACE|GTR_SPAWNENEMIES|GTR_SPAWNINVUL|GTR_ALLOWEXIT, // Match - GTR_RINGSLINGER|GTR_FIRSTPERSON|GTR_SPECTATORS|GTR_POINTLIMIT|GTR_TIMELIMIT|GTR_POWERSTONES|GTR_DEATHMATCHSTARTS|GTR_SPAWNINVUL|GTR_RESPAWNDELAY|GTR_PITYSHIELD|GTR_DEATHPENALTY, + GTR_RINGSLINGER|GTR_FIRSTPERSON|GTR_SPECTATORS|GTR_POINTLIMIT|GTR_TIMELIMIT|GTR_OVERTIME|GTR_POWERSTONES|GTR_DEATHMATCHSTARTS|GTR_SPAWNINVUL|GTR_RESPAWNDELAY|GTR_PITYSHIELD|GTR_DEATHPENALTY, // Team Match - GTR_RINGSLINGER|GTR_FIRSTPERSON|GTR_SPECTATORS|GTR_TEAMS|GTR_POINTLIMIT|GTR_TIMELIMIT|GTR_DEATHMATCHSTARTS|GTR_SPAWNINVUL|GTR_RESPAWNDELAY|GTR_PITYSHIELD, + GTR_RINGSLINGER|GTR_FIRSTPERSON|GTR_SPECTATORS|GTR_TEAMS|GTR_POINTLIMIT|GTR_TIMELIMIT|GTR_OVERTIME|GTR_DEATHMATCHSTARTS|GTR_SPAWNINVUL|GTR_RESPAWNDELAY|GTR_PITYSHIELD, // Tag - GTR_RINGSLINGER|GTR_FIRSTPERSON|GTR_TAG|GTR_SPECTATORS|GTR_POINTLIMIT|GTR_TIMELIMIT|GTR_STARTCOUNTDOWN|GTR_BLINDFOLDED|GTR_DEATHMATCHSTARTS|GTR_SPAWNINVUL|GTR_RESPAWNDELAY, + GTR_RINGSLINGER|GTR_FIRSTPERSON|GTR_TAG|GTR_SPECTATORS|GTR_POINTLIMIT|GTR_TIMELIMIT|GTR_OVERTIME|GTR_STARTCOUNTDOWN|GTR_BLINDFOLDED|GTR_DEATHMATCHSTARTS|GTR_SPAWNINVUL|GTR_RESPAWNDELAY, // Hide and Seek - GTR_RINGSLINGER|GTR_FIRSTPERSON|GTR_TAG|GTR_SPECTATORS|GTR_POINTLIMIT|GTR_TIMELIMIT|GTR_STARTCOUNTDOWN|GTR_BLINDFOLDED|GTR_DEATHMATCHSTARTS|GTR_SPAWNINVUL|GTR_RESPAWNDELAY, + GTR_RINGSLINGER|GTR_FIRSTPERSON|GTR_TAG|GTR_SPECTATORS|GTR_POINTLIMIT|GTR_TIMELIMIT|GTR_OVERTIME|GTR_STARTCOUNTDOWN|GTR_BLINDFOLDED|GTR_DEATHMATCHSTARTS|GTR_SPAWNINVUL|GTR_RESPAWNDELAY, // CTF - GTR_RINGSLINGER|GTR_FIRSTPERSON|GTR_SPECTATORS|GTR_TEAMS|GTR_TEAMFLAGS|GTR_POINTLIMIT|GTR_TIMELIMIT|GTR_POWERSTONES|GTR_DEATHMATCHSTARTS|GTR_SPAWNINVUL|GTR_RESPAWNDELAY|GTR_PITYSHIELD, + GTR_RINGSLINGER|GTR_FIRSTPERSON|GTR_SPECTATORS|GTR_TEAMS|GTR_TEAMFLAGS|GTR_POINTLIMIT|GTR_TIMELIMIT|GTR_OVERTIME|GTR_POWERSTONES|GTR_DEATHMATCHSTARTS|GTR_SPAWNINVUL|GTR_RESPAWNDELAY|GTR_PITYSHIELD, }; // diff --git a/src/g_game.h b/src/g_game.h index a4afac163..c4c40d84b 100644 --- a/src/g_game.h +++ b/src/g_game.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/g_input.c b/src/g_input.c index ed7bc5cb6..ecce4d83c 100644 --- a/src/g_input.c +++ b/src/g_input.c @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/g_input.h b/src/g_input.h index f7f952d72..a7484c7ad 100644 --- a/src/g_input.h +++ b/src/g_input.h @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/g_state.h b/src/g_state.h index e82a34935..3320ebc47 100644 --- a/src/g_state.h +++ b/src/g_state.h @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/hardware/hw_cache.c b/src/hardware/hw_cache.c index 66f4e3c28..5dc02e00b 100644 --- a/src/hardware/hw_cache.c +++ b/src/hardware/hw_cache.c @@ -298,13 +298,13 @@ static void HWR_DrawPatchInCache(GLMipmap_t *mipmap, if (pwidth <= 0 || pheight <= 0) return; - ncols = (pwidth * pblockwidth) / pwidth; + ncols = pwidth; // source advance xfrac = 0; - xfracstep = (pwidth << FRACBITS) / pblockwidth; - yfracstep = (pheight << FRACBITS) / pblockheight; - scale_y = (pblockheight << FRACBITS) / pheight; + xfracstep = FRACUNIT; + yfracstep = FRACUNIT; + scale_y = FRACUNIT; bpp = format2bpp[mipmap->grInfo.format]; @@ -573,13 +573,18 @@ void HWR_MakePatch (const patch_t *patch, GLPatch_t *grPatch, GLMipmap_t *grMipm grPatch->leftoffset = SHORT(patch->leftoffset); grPatch->topoffset = SHORT(patch->topoffset); - grMipmap->width = (UINT16)SHORT(patch->width); - grMipmap->height = (UINT16)SHORT(patch->height); + grMipmap->width = grMipmap->height = 1; + while (grMipmap->width < grPatch->width) grMipmap->width <<= 1; + while (grMipmap->height < grPatch->height) grMipmap->height <<= 1; // no wrap around, no chroma key grMipmap->flags = 0; // setup the texture info grMipmap->grInfo.format = patchformat; + + //grPatch->max_s = grPatch->max_t = 1.0f; + grPatch->max_s = (float)grPatch->width / (float)grMipmap->width; + grPatch->max_t = (float)grPatch->height / (float)grMipmap->height; } Z_Free(grMipmap->grInfo.data); @@ -590,12 +595,10 @@ void HWR_MakePatch (const patch_t *patch, GLPatch_t *grPatch, GLMipmap_t *grMipm MakeBlock(grMipmap); HWR_DrawPatchInCache(grMipmap, - grPatch->width, grPatch->height, + grMipmap->width, grMipmap->height, grPatch->width, grPatch->height, patch); } - - grPatch->max_s = grPatch->max_t = 1.0f; } diff --git a/src/hardware/hw_light.c b/src/hardware/hw_light.c index a47f12749..c50969c4a 100644 --- a/src/hardware/hw_light.c +++ b/src/hardware/hw_light.c @@ -503,6 +503,7 @@ light_t *t_lspr[NUMSPRITES] = &lspr[NOLIGHT], // SPR_LCKN &lspr[NOLIGHT], // SPR_TTAG &lspr[NOLIGHT], // SPR_GFLG + &lspr[NOLIGHT], // SPR_FNSF &lspr[NOLIGHT], // SPR_CORK &lspr[NOLIGHT], // SPR_LHRT diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index 37a27a2aa..ede76ed97 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -4640,12 +4640,7 @@ void HWR_AddTransparentFloor(levelflat_t *levelflat, extrasubsector_t *xsub, boo planeinfo[numplanes].isceiling = isceiling; planeinfo[numplanes].fixedheight = fixedheight; - - if (planecolormap && (planecolormap->fog & 1)) - planeinfo[numplanes].lightlevel = lightlevel; - else - planeinfo[numplanes].lightlevel = 255; - + planeinfo[numplanes].lightlevel = (planecolormap && (planecolormap->flags & CMF_FOG)) ? lightlevel : 255; planeinfo[numplanes].levelflat = levelflat; planeinfo[numplanes].xsub = xsub; planeinfo[numplanes].alpha = alpha; @@ -4676,12 +4671,7 @@ void HWR_AddTransparentPolyobjectFloor(levelflat_t *levelflat, polyobj_t *polyse polyplaneinfo[numpolyplanes].isceiling = isceiling; polyplaneinfo[numpolyplanes].fixedheight = fixedheight; - - if (planecolormap && (planecolormap->fog & 1)) - polyplaneinfo[numpolyplanes].lightlevel = lightlevel; - else - polyplaneinfo[numpolyplanes].lightlevel = 255; - + polyplaneinfo[numpolyplanes].lightlevel = (planecolormap && (planecolormap->flags & CMF_FOG)) ? lightlevel : 255; polyplaneinfo[numpolyplanes].levelflat = levelflat; polyplaneinfo[numpolyplanes].polysector = polysector; polyplaneinfo[numpolyplanes].alpha = alpha; @@ -5438,6 +5428,12 @@ static void HWR_DrawSkyBackground(player_t *player) dometransform.scalez = 1; dometransform.fovxangle = fpov; // Tails dometransform.fovyangle = fpov; // Tails + if (player->viewrollangle != 0) + { + fixed_t rol = AngleFixed(player->viewrollangle); + dometransform.rollangle = FIXED_TO_FLOAT(rol); + dometransform.roll = true; + } dometransform.splitscreen = splitscreen; HWR_GetTexture(texturetranslation[skytexture]); @@ -5686,6 +5682,12 @@ void HWR_RenderSkyboxView(INT32 viewnumber, player_t *player) atransform.fovxangle = fpov; // Tails atransform.fovyangle = fpov; // Tails + if (player->viewrollangle != 0) + { + fixed_t rol = AngleFixed(player->viewrollangle); + atransform.rollangle = FIXED_TO_FLOAT(rol); + atransform.roll = true; + } atransform.splitscreen = splitscreen; gr_fovlud = (float)(1.0l/tan((double)(fpov*M_PIl/360l))); @@ -5887,6 +5889,12 @@ void HWR_RenderPlayerView(INT32 viewnumber, player_t *player) atransform.fovxangle = fpov; // Tails atransform.fovyangle = fpov; // Tails + if (player->viewrollangle != 0) + { + fixed_t rol = AngleFixed(player->viewrollangle); + atransform.rollangle = FIXED_TO_FLOAT(rol); + atransform.roll = true; + } atransform.splitscreen = splitscreen; gr_fovlud = (float)(1.0l/tan((double)(fpov*M_PIl/360l))); diff --git a/src/hardware/r_opengl/r_opengl.c b/src/hardware/r_opengl/r_opengl.c index 9892439aa..63e86c7fb 100644 --- a/src/hardware/r_opengl/r_opengl.c +++ b/src/hardware/r_opengl/r_opengl.c @@ -2889,6 +2889,8 @@ EXPORT void HWRAPI(SetTransform) (FTransform *stransform) else pglScalef(stransform->scalex, stransform->scaley, -stransform->scalez); + if (stransform->roll) + pglRotatef(stransform->rollangle, 0.0f, 0.0f, 1.0f); pglRotatef(stransform->anglex , 1.0f, 0.0f, 0.0f); pglRotatef(stransform->angley+270.0f, 0.0f, 1.0f, 0.0f); pglTranslatef(-stransform->x, -stransform->z, -stransform->y); diff --git a/src/hu_stuff.c b/src/hu_stuff.c index bf2432f5d..98f3ca5a9 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. @@ -787,10 +787,12 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum) case SKINCOLOR_RED: case SKINCOLOR_CRIMSON: case SKINCOLOR_FLAME: + case SKINCOLOR_KETCHUP: cstart = "\x85"; // V_REDMAP break; case SKINCOLOR_YOGURT: case SKINCOLOR_BROWN: + case SKINCOLOR_BRONZE: case SKINCOLOR_TAN: case SKINCOLOR_BEIGE: case SKINCOLOR_QUAIL: @@ -818,6 +820,7 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum) cstart = "\x8e"; // V_ROSYMAP break; case SKINCOLOR_SUNSET: + case SKINCOLOR_COPPER: case SKINCOLOR_APRICOT: case SKINCOLOR_ORANGE: case SKINCOLOR_RUST: @@ -831,6 +834,7 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum) break; case SKINCOLOR_LIME: case SKINCOLOR_PERIDOT: + case SKINCOLOR_APPLE: cstart = "\x8b"; // V_PERIDOTMAP break; case SKINCOLOR_SEAFOAM: @@ -851,12 +855,14 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum) case SKINCOLOR_BLUE: case SKINCOLOR_COBALT: case SKINCOLOR_DUSK: + case SKINCOLOR_BLUEBELL: cstart = "\x84"; // V_BLUEMAP break; case SKINCOLOR_BUBBLEGUM: case SKINCOLOR_MAGENTA: case SKINCOLOR_NEON: case SKINCOLOR_VIOLET: + case SKINCOLOR_RASPBERRY: cstart = "\x81"; // V_MAGENTAMAP break; } diff --git a/src/hu_stuff.h b/src/hu_stuff.h index 3502a1b2d..9e3c66747 100644 --- a/src/hu_stuff.h +++ b/src/hu_stuff.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/i_addrinfo.c b/src/i_addrinfo.c index dd3b5ab0f..e77774549 100644 --- a/src/i_addrinfo.c +++ b/src/i_addrinfo.c @@ -1,6 +1,6 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- -// Copyright (C) 2011-2019 by Sonic Team Junior. +// Copyright (C) 2011-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/i_addrinfo.h b/src/i_addrinfo.h index 3108c422e..7ae006719 100644 --- a/src/i_addrinfo.h +++ b/src/i_addrinfo.h @@ -1,6 +1,6 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- -// Copyright (C) 2011-2019 by Sonic Team Junior. +// Copyright (C) 2011-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/i_joy.h b/src/i_joy.h index 5f9b63712..2a2797fc4 100644 --- a/src/i_joy.h +++ b/src/i_joy.h @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/i_net.h b/src/i_net.h index e96891d9d..5d93f191e 100644 --- a/src/i_net.h +++ b/src/i_net.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/i_sound.h b/src/i_sound.h index fbaa93053..4bd05d234 100644 --- a/src/i_sound.h +++ b/src/i_sound.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/i_system.h b/src/i_system.h index a60b56310..b38748244 100644 --- a/src/i_system.h +++ b/src/i_system.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/i_tcp.c b/src/i_tcp.c index 502eb6732..34cad1765 100644 --- a/src/i_tcp.c +++ b/src/i_tcp.c @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/i_tcp.h b/src/i_tcp.h index ea8b0a94f..738b8b4d1 100644 --- a/src/i_tcp.h +++ b/src/i_tcp.h @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/i_video.h b/src/i_video.h index 8f87a360e..bdc10c9c5 100644 --- a/src/i_video.h +++ b/src/i_video.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. @@ -37,8 +37,9 @@ typedef enum extern rendermode_t rendermode; /** \brief hardware renderer loaded + 0 = never loaded, 1 = loaded successfully, -1 = failed loading */ -extern boolean hwrenderloaded; +extern INT32 hwrenderloaded; /** \brief use highcolor modes if true */ diff --git a/src/info.c b/src/info.c index 20bd73498..bd6ccb527 100644 --- a/src/info.c +++ b/src/info.c @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. @@ -407,6 +407,7 @@ char sprnames[NUMSPRITES + 1][5] = "LCKN", // Target "TTAG", // Tag Sign "GFLG", // Got Flag sign + "FNSF", // Finish flag "CORK", "LHRT", @@ -3349,7 +3350,10 @@ state_t states[NUMSTATES] = {SPR_TTAG, FF_FULLBRIGHT, 2, {NULL}, 0, 0, S_NULL}, // S_TTAG // CTF Sign - {SPR_GFLG, FF_FULLBRIGHT, 2, {NULL}, 0, 0, S_NULL}, // S_GOTFLAG + {SPR_GFLG, FF_FULLBRIGHT, 2, {NULL}, 0, 0, S_NULL}, // S_GOTFLAG + + // Finish flag + {SPR_FNSF, FF_TRANS30, -1, {NULL}, 0, 0, S_NULL}, // S_FINISHFLAG {SPR_CORK, 0, -1, {NULL}, 0, 0, S_NULL}, // S_CORK {SPR_LHRT, FF_FULLBRIGHT, -1, {NULL}, 0, 0, S_NULL}, // S_LHRT @@ -17995,6 +17999,33 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = MF_NOBLOCKMAP|MF_NOCLIP|MF_NOGRAVITY|MF_SCENERY, // flags S_NULL // raisestate }, + + { // MT_FINISHFLAG + -1, // doomednum + S_FINISHFLAG, // spawnstate + 1000, // spawnhealth + S_NULL, // seestate + sfx_None, // seesound + 8, // reactiontime + sfx_None, // attacksound + S_NULL, // painstate + 0, // painchance + sfx_None, // painsound + S_NULL, // meleestate + S_NULL, // missilestate + S_NULL, // deathstate + S_NULL, // xdeathstate + sfx_None, // deathsound + 4*FRACUNIT, // speed + 8*FRACUNIT, // radius + 8*FRACUNIT, // height + 1, // display offset + 16, // mass + 0, // damage + sfx_None, // activesound + MF_NOBLOCKMAP|MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_SCENERY, // flags + S_NULL // raisestate + }, // ambient water 1a (large) { // MT_AWATERA diff --git a/src/info.h b/src/info.h index 59b8eb68d..f8a713674 100644 --- a/src/info.h +++ b/src/info.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. @@ -670,6 +670,7 @@ typedef enum sprite SPR_LCKN, // Target SPR_TTAG, // Tag Sign SPR_GFLG, // Got Flag sign + SPR_FNSF, // Finish flag SPR_CORK, SPR_LHRT, @@ -3485,6 +3486,9 @@ typedef enum state // Got Flag Sign S_GOTFLAG, + + // Finish flag + S_FINISHFLAG, S_CORK, S_LHRT, @@ -4626,6 +4630,7 @@ typedef enum mobj_type MT_LOCKONINF, // In-level Target MT_TAG, // Tag Sign MT_GOTFLAG, // Got Flag sign + MT_FINISHFLAG, // Finish flag // Ambient Sounds MT_AWATERA, // Ambient Water Sound 1 diff --git a/src/keys.h b/src/keys.h index 8819aaa86..6cdd7956c 100644 --- a/src/keys.h +++ b/src/keys.h @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/lua_baselib.c b/src/lua_baselib.c index 66bd30e32..03f142446 100644 --- a/src/lua_baselib.c +++ b/src/lua_baselib.c @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 2012-2016 by John "JTE" Muniz. -// Copyright (C) 2012-2019 by Sonic Team Junior. +// Copyright (C) 2012-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. @@ -20,6 +20,7 @@ #endif #include "z_zone.h" #include "r_main.h" +#include "r_draw.h" #include "r_things.h" #include "m_random.h" #include "s_sound.h" @@ -2313,9 +2314,29 @@ static int lib_rTextureNumForName(lua_State *L) return 1; } +// R_DRAW +//////////// +static int lib_rGetColorByName(lua_State *L) +{ + const char* colorname = luaL_checkstring(L, 1); + //HUDSAFE + lua_pushinteger(L, R_GetColorByName(colorname)); + return 1; +} + +// Lua exclusive function, returns the name of a color from the SKINCOLOR_ constant. +// SKINCOLOR_GREEN > "Green" for example +static int lib_rGetNameByColor(lua_State *L) +{ + UINT8 colornum = (UINT8)luaL_checkinteger(L, 1); + if (!colornum || colornum >= MAXSKINCOLORS) + return luaL_error(L, "skincolor %d out of range (1 - %d).", colornum, MAXSKINCOLORS-1); + lua_pushstring(L, Color_Names[colornum]); + return 1; +} + // S_SOUND //////////// - static int lib_sStartSound(lua_State *L) { const void *origin = NULL; @@ -3153,6 +3174,10 @@ static luaL_Reg lib[] = { {"R_CheckTextureNumForName",lib_rCheckTextureNumForName}, {"R_TextureNumForName",lib_rTextureNumForName}, + // r_draw + {"R_GetColorByName", lib_rGetColorByName}, + {"R_GetNameByColor", lib_rGetNameByColor}, + // s_sound {"S_StartSound",lib_sStartSound}, {"S_StartSoundAtVolume",lib_sStartSoundAtVolume}, diff --git a/src/lua_blockmaplib.c b/src/lua_blockmaplib.c index 7f7dc9560..78a9e75a1 100644 --- a/src/lua_blockmaplib.c +++ b/src/lua_blockmaplib.c @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 2016 by Iestyn "Monster Iestyn" Jealous. -// Copyright (C) 2016-2019 by Sonic Team Junior. +// Copyright (C) 2016-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/lua_consolelib.c b/src/lua_consolelib.c index 48f2e20a8..923722eb8 100644 --- a/src/lua_consolelib.c +++ b/src/lua_consolelib.c @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 2012-2016 by John "JTE" Muniz. -// Copyright (C) 2012-2019 by Sonic Team Junior. +// Copyright (C) 2012-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/lua_hook.h b/src/lua_hook.h index 94d2239f7..265700e4f 100644 --- a/src/lua_hook.h +++ b/src/lua_hook.h @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 2012-2016 by John "JTE" Muniz. -// Copyright (C) 2012-2019 by Sonic Team Junior. +// Copyright (C) 2012-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/lua_hooklib.c b/src/lua_hooklib.c index f9dad6cb7..efed9adb7 100644 --- a/src/lua_hooklib.c +++ b/src/lua_hooklib.c @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 2012-2016 by John "JTE" Muniz. -// Copyright (C) 2012-2019 by Sonic Team Junior. +// Copyright (C) 2012-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/lua_hud.h b/src/lua_hud.h index a00a5cb02..4a7c596c8 100644 --- a/src/lua_hud.h +++ b/src/lua_hud.h @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 2014-2016 by John "JTE" Muniz. -// Copyright (C) 2014-2019 by Sonic Team Junior. +// Copyright (C) 2014-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/lua_hudlib.c b/src/lua_hudlib.c index dbab801df..7d5f9325e 100644 --- a/src/lua_hudlib.c +++ b/src/lua_hudlib.c @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 2014-2016 by John "JTE" Muniz. -// Copyright (C) 2014-2019 by Sonic Team Junior. +// Copyright (C) 2014-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. @@ -119,9 +119,25 @@ enum align { align_center, align_right, align_fixed, + align_fixedcenter, + align_fixedright, align_small, + align_smallfixed, + align_smallfixedcenter, + align_smallfixedright, + align_smallcenter, align_smallright, + align_smallthin, + align_smallthincenter, + align_smallthinright, + align_smallthinfixed, + align_smallthinfixedcenter, + align_smallthinfixedright, align_thin, + align_thinfixed, + align_thinfixedcenter, + align_thinfixedright, + align_thincenter, align_thinright }; static const char *const align_opt[] = { @@ -129,9 +145,25 @@ static const char *const align_opt[] = { "center", "right", "fixed", + "fixed-center", + "fixed-right", "small", + "small-fixed", + "small-fixed-center", + "small-fixed-right", + "small-center", "small-right", + "small-thin", + "small-thin-center", + "small-thin-right", + "small-thin-fixed", + "small-thin-fixed-center", + "small-thin-fixed-right", "thin", + "thin-fixed", + "thin-fixed-center", + "thin-fixed-right", + "thin-center", "thin-right", NULL}; @@ -428,7 +460,7 @@ static int libd_cachePatch(lua_State *L) return 1; } -// v.getSpritePatch(sprite, [frame, [angle]]) +// v.getSpritePatch(sprite, [frame, [angle, [rollangle]]]) static int libd_getSpritePatch(lua_State *L) { UINT32 i; // sprite prefix @@ -479,13 +511,31 @@ static int libd_getSpritePatch(lua_State *L) if (angle >= ((sprframe->rotate & SRF_3DGE) ? 16 : 8)) // out of range? return 0; +#ifdef ROTSPRITE + if (lua_isnumber(L, 4)) + { + // rotsprite????? + angle_t rollangle = luaL_checkangle(L, 4); + INT32 rot = R_GetRollAngle(rollangle); + + if (rot) { + if (!(sprframe->rotsprite.cached & (1<flip & (1<rotsprite.patch[angle][rot], META_PATCH); + lua_pushboolean(L, false); + lua_pushboolean(L, true); + return 3; + } + } +#endif + // push both the patch and it's "flip" value LUA_PushUserdata(L, W_CachePatchNum(sprframe->lumppat[angle], PU_PATCH), META_PATCH); lua_pushboolean(L, (sprframe->flip & (1<= ((sprframe->rotate & SRF_3DGE) ? 16 : 8)) // out of range? return 0; +#ifdef ROTSPRITE + if (lua_isnumber(L, 4)) + { + // rotsprite????? + angle_t rollangle = luaL_checkangle(L, 4); + INT32 rot = R_GetRollAngle(rollangle); + + if (rot) { + if (!(sprframe->rotsprite.cached & (1<flip & (1<rotsprite.patch[angle][rot], META_PATCH); + lua_pushboolean(L, false); + lua_pushboolean(L, true); + return 3; + } + } +#endif + // push both the patch and it's "flip" value LUA_PushUserdata(L, W_CachePatchNum(sprframe->lumppat[angle], PU_PATCH), META_PATCH); lua_pushboolean(L, (sprframe->flip & (1<deltaviewheight); else if (fastcmp(field,"bob")) lua_pushfixed(L, plr->bob); + else if (fastcmp(field,"viewrollangle")) + lua_pushangle(L, plr->viewrollangle); else if (fastcmp(field,"aiming")) lua_pushangle(L, plr->aiming); else if (fastcmp(field,"drawangle")) @@ -417,6 +419,8 @@ static int player_set(lua_State *L) plr->deltaviewheight = luaL_checkfixed(L, 3); else if (fastcmp(field,"bob")) plr->bob = luaL_checkfixed(L, 3); + else if (fastcmp(field,"viewrollangle")) + plr->viewrollangle = luaL_checkangle(L, 3); else if (fastcmp(field,"aiming")) { plr->aiming = luaL_checkangle(L, 3); if (plr == &players[consoleplayer]) diff --git a/src/lua_script.c b/src/lua_script.c index 2538fb711..e7ce35ff1 100644 --- a/src/lua_script.c +++ b/src/lua_script.c @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 2012-2016 by John "JTE" Muniz. -// Copyright (C) 2012-2019 by Sonic Team Junior. +// Copyright (C) 2012-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. @@ -102,6 +102,9 @@ int LUA_PushGlobals(lua_State *L, const char *word) } else if (fastcmp(word,"circuitmap")) { lua_pushboolean(L, circuitmap); return 1; + } else if (fastcmp(word,"stoppedclock")) { + lua_pushboolean(L, stoppedclock); + return 1; } else if (fastcmp(word,"netgame")) { lua_pushboolean(L, netgame); return 1; diff --git a/src/lua_script.h b/src/lua_script.h index 8f27dcb4c..6caccd69b 100644 --- a/src/lua_script.h +++ b/src/lua_script.h @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 2012-2016 by John "JTE" Muniz. -// Copyright (C) 2012-2019 by Sonic Team Junior. +// Copyright (C) 2012-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/lua_skinlib.c b/src/lua_skinlib.c index a4ab075b4..3ade06042 100644 --- a/src/lua_skinlib.c +++ b/src/lua_skinlib.c @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 2014-2016 by John "JTE" Muniz. -// Copyright (C) 2014-2019 by Sonic Team Junior. +// Copyright (C) 2014-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/lua_thinkerlib.c b/src/lua_thinkerlib.c index 1462b26ef..ddb5abf72 100644 --- a/src/lua_thinkerlib.c +++ b/src/lua_thinkerlib.c @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 2012-2016 by John "JTE" Muniz. -// Copyright (C) 2012-2019 by Sonic Team Junior. +// Copyright (C) 2012-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/m_aatree.c b/src/m_aatree.c index efa92cbe0..c0bb739f8 100644 --- a/src/m_aatree.c +++ b/src/m_aatree.c @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/m_aatree.h b/src/m_aatree.h index af95f91b8..b784eb17a 100644 --- a/src/m_aatree.h +++ b/src/m_aatree.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/m_anigif.c b/src/m_anigif.c index faa8f29e1..ce2ca20b9 100644 --- a/src/m_anigif.c +++ b/src/m_anigif.c @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 2013-2016 by Matthew "Kaito Sinclaire" Walsh. // Copyright (C) 2013 by "Ninji". -// Copyright (C) 2013-2019 by Sonic Team Junior. +// Copyright (C) 2013-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/m_anigif.h b/src/m_anigif.h index 9eb6faa75..4bb45b67d 100644 --- a/src/m_anigif.h +++ b/src/m_anigif.h @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 2013-2016 by Matthew "Kaito Sinclaire" Walsh. -// Copyright (C) 2013-2019 by Sonic Team Junior. +// Copyright (C) 2013-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/m_argv.c b/src/m_argv.c index 129706127..acb74cff4 100644 --- a/src/m_argv.c +++ b/src/m_argv.c @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/m_argv.h b/src/m_argv.h index 57c3f9d50..ca97d9b12 100644 --- a/src/m_argv.h +++ b/src/m_argv.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/m_bbox.c b/src/m_bbox.c index 5af1b4ef8..02d534164 100644 --- a/src/m_bbox.c +++ b/src/m_bbox.c @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/m_bbox.h b/src/m_bbox.h index dce3cf15a..9b63c61b6 100644 --- a/src/m_bbox.h +++ b/src/m_bbox.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/m_cheat.c b/src/m_cheat.c index 980d9fc21..1431e8873 100644 --- a/src/m_cheat.c +++ b/src/m_cheat.c @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/m_cheat.h b/src/m_cheat.h index 3c4403e7f..092e51756 100644 --- a/src/m_cheat.h +++ b/src/m_cheat.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/m_cond.c b/src/m_cond.c index 08f3fe038..89058a488 100644 --- a/src/m_cond.c +++ b/src/m_cond.c @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 2012-2016 by Matthew "Kaito Sinclaire" Walsh. -// Copyright (C) 2012-2019 by Sonic Team Junior. +// Copyright (C) 2012-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/m_cond.h b/src/m_cond.h index 7fe3105fb..d7b9704dd 100644 --- a/src/m_cond.h +++ b/src/m_cond.h @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 2012-2016 by Matthew "Kaito Sinclaire" Walsh. -// Copyright (C) 2012-2019 by Sonic Team Junior. +// Copyright (C) 2012-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/m_dllist.h b/src/m_dllist.h index 8f8d4c1fb..680c2cd80 100644 --- a/src/m_dllist.h +++ b/src/m_dllist.h @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 2005 by James Haley -// Copyright (C) 2005-2019 by Sonic Team Junior. +// Copyright (C) 2005-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/m_fixed.c b/src/m_fixed.c index 6be54c486..eb10fd5f8 100644 --- a/src/m_fixed.c +++ b/src/m_fixed.c @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/m_fixed.h b/src/m_fixed.h index 02d4c73ff..7fdb9ad0a 100644 --- a/src/m_fixed.h +++ b/src/m_fixed.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/m_menu.c b/src/m_menu.c index 0a5238bfd..858c19f64 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -3,7 +3,7 @@ // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 2011-2016 by Matthew "Kaito Sinclaire" Walsh. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. @@ -231,6 +231,8 @@ static void M_Credits(INT32 choice); static void M_SoundTest(INT32 choice); static void M_PandorasBox(INT32 choice); static void M_EmblemHints(INT32 choice); +static void M_HandleEmblemHints(INT32 choice); +UINT32 hintpage = 1; static void M_HandleChecklist(INT32 choice); menu_t SR_MainDef, SR_UnlockChecklistDef; @@ -310,6 +312,7 @@ static void M_AssignJoystick(INT32 choice); static void M_ChangeControl(INT32 choice); // Video & Sound +static void M_VideoOptions(INT32 choice); menu_t OP_VideoOptionsDef, OP_VideoModeDef, OP_ColorOptionsDef; #ifdef HWRENDER static void M_OpenGLOptionsMenu(void); @@ -724,8 +727,9 @@ static menuitem_t SR_SoundTestMenu[] = static menuitem_t SR_EmblemHintMenu[] = { - {IT_STRING|IT_CVAR, NULL, "Emblem Radar", &cv_itemfinder, 10}, - {IT_WHITESTRING|IT_SUBMENU, NULL, "Back", &SPauseDef, 20} + {IT_STRING | IT_ARROWS, NULL, "Page", M_HandleEmblemHints, 10}, + {IT_STRING|IT_CVAR, NULL, "Emblem Radar", &cv_itemfinder, 20}, + {IT_WHITESTRING|IT_SUBMENU, NULL, "Back", &SPauseDef, 30} }; // -------------------------------- @@ -1028,7 +1032,7 @@ static menuitem_t OP_MainMenu[] = {IT_SUBMENU | IT_STRING, NULL, "Player 2 Controls...", &OP_P2ControlsDef, 20}, {IT_CVAR | IT_STRING, NULL, "Controls per key", &cv_controlperkey, 30}, - {IT_SUBMENU | IT_STRING, NULL, "Video Options...", &OP_VideoOptionsDef, 50}, + {IT_CALL | IT_STRING, NULL, "Video Options...", M_VideoOptions, 50}, {IT_SUBMENU | IT_STRING, NULL, "Sound Options...", &OP_SoundOptionsDef, 60}, {IT_CALL | IT_STRING, NULL, "Server Options...", M_ServerOptions, 80}, @@ -1279,6 +1283,16 @@ static menuitem_t OP_Camera2ExtendedOptionsMenu[] = {IT_STRING | IT_CVAR, NULL, "Crosshair", &cv_crosshair2, 126}, }; +enum +{ + op_video_resolution = 1, +#if (defined (__unix__) && !defined (MSDOS)) || defined (UNIXCOMMON) || defined (HAVE_SDL) + op_video_fullscreen, +#endif + op_video_vsync, + op_video_renderer, +}; + static menuitem_t OP_VideoOptionsMenu[] = { {IT_HEADER, NULL, "Screen", NULL, 0}, @@ -2071,6 +2085,20 @@ menu_t OP_PlaystyleDef = { 0, 0, 0, NULL }; +static void M_VideoOptions(INT32 choice) +{ + (void)choice; +#ifdef HWRENDER + if (hwrenderloaded == -1) + { + OP_VideoOptionsMenu[op_video_renderer].status = (IT_TRANSTEXT | IT_PAIR); + OP_VideoOptionsMenu[op_video_renderer].patch = "Renderer"; + OP_VideoOptionsMenu[op_video_renderer].text = "Software"; + } + +#endif + M_SetupNextMenu(&OP_VideoOptionsDef); +} menu_t OP_VideoOptionsDef = { @@ -3130,6 +3158,9 @@ boolean M_Responder(event_t *ev) if (gamestate == GS_TITLESCREEN && finalecount < TICRATE) return false; + if (CON_Ready()) + return false; + if (noFurtherInput) { // Ignore input after enter/escape/other buttons @@ -3489,6 +3520,7 @@ boolean M_Responder(event_t *ev) return false; default: + CON_Responder(ev); break; } @@ -7220,18 +7252,33 @@ finishchecklist: } #define NUMHINTS 5 + static void M_EmblemHints(INT32 choice) { + INT32 i; + UINT32 local = 0; + emblem_t *emblem; + for (i = 0; i < numemblems; i++) + { + emblem = &emblemlocations[i]; + if (emblem->level != gamemap || emblem->type > ET_SKIN) + continue; + if (++local > NUMHINTS*2) + break; + } + (void)choice; - SR_EmblemHintMenu[0].status = (M_SecretUnlocked(SECRET_ITEMFINDER)) ? (IT_CVAR|IT_STRING) : (IT_SECRET); + SR_EmblemHintMenu[0].status = (local > NUMHINTS*2) ? (IT_STRING | IT_ARROWS) : (IT_DISABLED); + SR_EmblemHintMenu[1].status = (M_SecretUnlocked(SECRET_ITEMFINDER)) ? (IT_CVAR|IT_STRING) : (IT_SECRET); + hintpage = 1; M_SetupNextMenu(&SR_EmblemHintDef); - itemOn = 1; // always start on back. + itemOn = 2; // always start on back. } static void M_DrawEmblemHints(void) { - INT32 i, j = 0, x, y, left_hints = NUMHINTS; - UINT32 collected = 0, local = 0; + INT32 i, j = 0, x, y, left_hints = NUMHINTS, pageflag = 0; + UINT32 collected = 0, totalemblems = 0, local = 0; emblem_t *emblem; const char *hint; @@ -7240,17 +7287,34 @@ static void M_DrawEmblemHints(void) emblem = &emblemlocations[i]; if (emblem->level != gamemap || emblem->type > ET_SKIN) continue; - if (++local >= NUMHINTS*2) - break; + + local++; } x = (local > NUMHINTS ? 4 : 12); y = 8; - // If there are more than 1 page's but less than 2 pages' worth of emblems, + if (local > NUMHINTS){ + if (local > ((hintpage-1)*NUMHINTS*2) && local < ((hintpage)*NUMHINTS*2)){ + if (NUMHINTS % 2 == 1) + left_hints = (local - ((hintpage-1)*NUMHINTS*2) + 1) / 2; + else + left_hints = (local - ((hintpage-1)*NUMHINTS*2)) / 2; + }else{ + left_hints = NUMHINTS; + } + } + + if (local > NUMHINTS*2){ + if (itemOn == 0){ + pageflag = V_YELLOWMAP; + } + V_DrawString(currentMenu->x + 40, currentMenu->y + 10, pageflag, va("%d of %d",hintpage, local/(NUMHINTS*2) + 1)); + } + + // If there are more than 1 page's but less than 2 pages' worth of emblems on the last possible page, // put half (rounded up) of the hints on the left, and half (rounded down) on the right - if (local > NUMHINTS && local < (NUMHINTS*2)-1) - left_hints = (local + 1) / 2; + if (!local) V_DrawCenteredString(160, 48, V_YELLOWMAP, "No hidden emblems on this map."); @@ -7260,42 +7324,80 @@ static void M_DrawEmblemHints(void) if (emblem->level != gamemap || emblem->type > ET_SKIN) continue; - if (emblem->collected) - { - collected = V_GREENMAP; - V_DrawMappedPatch(x, y+4, 0, W_CachePatchName(M_GetEmblemPatch(emblem, false), PU_PATCH), - R_GetTranslationColormap(TC_DEFAULT, M_GetEmblemColor(emblem), GTC_CACHE)); - } - else - { - collected = 0; - V_DrawScaledPatch(x, y+4, 0, W_CachePatchName("NEEDIT", PU_PATCH)); - } + totalemblems++; - if (emblem->hint[0]) - hint = emblem->hint; - else - hint = M_GetText("No hint available for this emblem."); - hint = V_WordWrap(40, BASEVIDWIDTH-12, 0, hint); - if (local > NUMHINTS) - V_DrawThinString(x+28, y, V_RETURN8|V_ALLOWLOWERCASE|collected, hint); - else - V_DrawString(x+28, y, V_RETURN8|V_ALLOWLOWERCASE|collected, hint); + if (totalemblems >= ((hintpage-1)*(NUMHINTS*2) + 1) && totalemblems < (hintpage*NUMHINTS*2)+1){ - y += 28; + if (emblem->collected) + { + collected = V_GREENMAP; + V_DrawMappedPatch(x, y+4, 0, W_CachePatchName(M_GetEmblemPatch(emblem, false), PU_PATCH), + R_GetTranslationColormap(TC_DEFAULT, M_GetEmblemColor(emblem), GTC_CACHE)); + } + else + { + collected = 0; + V_DrawScaledPatch(x, y+4, 0, W_CachePatchName("NEEDIT", PU_PATCH)); + } - if (++j == left_hints) - { - x = 4+(BASEVIDWIDTH/2); - y = 8; + if (emblem->hint[0]) + hint = emblem->hint; + else + hint = M_GetText("No hint available for this emblem."); + hint = V_WordWrap(40, BASEVIDWIDTH-12, 0, hint); + //always draw tiny if we have more than NUMHINTS*2, visually more appealing + if (local > NUMHINTS) + V_DrawThinString(x+28, y, V_RETURN8|V_ALLOWLOWERCASE|collected, hint); + else + V_DrawString(x+28, y, V_RETURN8|V_ALLOWLOWERCASE|collected, hint); + + y += 28; + + // If there are more than 1 page's but less than 2 pages' worth of emblems on the last possible page, + // put half (rounded up) of the hints on the left, and half (rounded down) on the right + + if (++j == left_hints) + { + x = 4+(BASEVIDWIDTH/2); + y = 8; + } + else if (j >= NUMHINTS*2) + break; } - else if (j >= NUMHINTS*2) - break; } M_DrawGenericMenu(); } + +static void M_HandleEmblemHints(INT32 choice) +{ + INT32 i; + emblem_t *emblem; + UINT32 stageemblems = 0; + + for (i = 0; i < numemblems; i++) + { + emblem = &emblemlocations[i]; + if (emblem->level != gamemap || emblem->type > ET_SKIN) + continue; + + stageemblems++; + } + + + if (choice == 0){ + if (hintpage > 1){ + hintpage--; + } + }else{ + if (hintpage < ((stageemblems-1)/(NUMHINTS*2) + 1)){ + hintpage++; + } + } + +} + /*static void M_DrawSkyRoom(void) { INT32 i, y = 0; @@ -8054,8 +8156,16 @@ static void M_DrawLoadGameData(void) col = 134; else { - col = charskin->prefcolor - 1; - col = Color_Index[Color_Opposite[col][0]-1][Color_Opposite[col][1]]; + if (charskin->prefoppositecolor) + { + col = charskin->prefoppositecolor - 1; + col = Color_Index[col][Color_Opposite[Color_Opposite[col][0] - 1][1]]; + } + else + { + col = charskin->prefcolor - 1; + col = Color_Index[Color_Opposite[col][0]-1][Color_Opposite[col][1]]; + } } V_DrawFill(x+6, y+64, 72, 50, col); @@ -12009,7 +12119,6 @@ static void M_VideoModeMenu(INT32 choice) static void M_DrawMainVideoMenu(void) { - M_DrawGenericScrollMenu(); if (itemOn < 8) // where it starts to go offscreen; change this number if you change the layout of the video menu { diff --git a/src/m_menu.h b/src/m_menu.h index 1985bbac2..698790a0b 100644 --- a/src/m_menu.h +++ b/src/m_menu.h @@ -3,7 +3,7 @@ // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 2011-2016 by Matthew "Kaito Sinclaire" Walsh. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/m_misc.c b/src/m_misc.c index d762712b6..920a13198 100644 --- a/src/m_misc.c +++ b/src/m_misc.c @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/m_misc.h b/src/m_misc.h index ad12517c1..d64faea59 100644 --- a/src/m_misc.h +++ b/src/m_misc.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/m_queue.c b/src/m_queue.c index d8cb97d07..8603ab202 100644 --- a/src/m_queue.c +++ b/src/m_queue.c @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 2003 by James Haley -// Copyright (C) 2003-2019 by Sonic Team Junior. +// Copyright (C) 2003-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/m_queue.h b/src/m_queue.h index 096b0e1bb..3e9579e11 100644 --- a/src/m_queue.h +++ b/src/m_queue.h @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 2003 by James Haley -// Copyright (C) 2003-2019 by Sonic Team Junior. +// Copyright (C) 2003-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/m_random.c b/src/m_random.c index 8fd0e1e4e..481fdb72b 100644 --- a/src/m_random.c +++ b/src/m_random.c @@ -3,7 +3,7 @@ // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 2012-2016 by Matthew "Kaito Sinclaire" Walsh. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/m_random.h b/src/m_random.h index 5efd3e02c..01190e046 100644 --- a/src/m_random.h +++ b/src/m_random.h @@ -3,7 +3,7 @@ // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 2012-2016 by Matthew "Kaito Sinclaire" Walsh. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/m_swap.h b/src/m_swap.h index d7233cba5..b44d6de8c 100644 --- a/src/m_swap.h +++ b/src/m_swap.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/mserv.c b/src/mserv.c index 4ddab05b9..05a5344ba 100644 --- a/src/mserv.c +++ b/src/mserv.c @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. @@ -18,7 +18,7 @@ #include -#if (defined (NOMD5) || defined (NOMSERV)) && !defined (NONET) +#if (defined (NOMSERV)) && !defined (NONET) #define NONET #endif diff --git a/src/mserv.h b/src/mserv.h index b851aed30..6d91da643 100644 --- a/src/mserv.h +++ b/src/mserv.h @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/p_ceilng.c b/src/p_ceilng.c index 7031c287d..c65156b6f 100644 --- a/src/p_ceilng.c +++ b/src/p_ceilng.c @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/p_enemy.c b/src/p_enemy.c index 2ddbd8d29..5d067ebc3 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/p_floor.c b/src/p_floor.c index c23d469bc..9c5ab9057 100644 --- a/src/p_floor.c +++ b/src/p_floor.c @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/p_inter.c b/src/p_inter.c index 667245f03..a24f9bf03 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. @@ -2542,7 +2542,8 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damaget else if (!target->player->bot && !target->player->spectator && (target->player->lives != INFLIVES) && G_GametypeUsesLives()) { - target->player->lives -= 1; // Lose a life Tails 03-11-2000 + if (!(target->player->pflags & PF_FINISHED)) + target->player->lives -= 1; // Lose a life Tails 03-11-2000 if (target->player->lives <= 0) // Tails 03-14-2000 { diff --git a/src/p_lights.c b/src/p_lights.c index 7de6a4dc5..371077a30 100644 --- a/src/p_lights.c +++ b/src/p_lights.c @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/p_local.h b/src/p_local.h index 8056d137c..5e27379a7 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. @@ -159,6 +159,7 @@ void P_GivePlayerLives(player_t *player, INT32 numlives); void P_GiveCoopLives(player_t *player, INT32 numlives, boolean sound); UINT8 P_GetNextEmerald(void); void P_GiveEmerald(boolean spawnObj); +void P_GiveFinishFlags(player_t *player); #if 0 void P_ResetScore(player_t *player); #else diff --git a/src/p_map.c b/src/p_map.c index 40fee7b46..966684818 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. @@ -592,9 +592,6 @@ static void P_DoTailsCarry(player_t *sonic, player_t *tails) if (!(tails->pflags & PF_CANCARRY)) return; - if (sonic->pflags & PF_FINISHED) - return; - if ((sonic->mo->eflags & MFE_VERTICALFLIP) != (tails->mo->eflags & MFE_VERTICALFLIP)) return; // Both should be in same gravity diff --git a/src/p_maputl.c b/src/p_maputl.c index b4043d643..69be5a70f 100644 --- a/src/p_maputl.c +++ b/src/p_maputl.c @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/p_maputl.h b/src/p_maputl.h index 16cfc834e..bb09c3ed1 100644 --- a/src/p_maputl.h +++ b/src/p_maputl.h @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/p_mobj.c b/src/p_mobj.c index 10898f70e..faee245d3 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. @@ -1997,8 +1997,12 @@ void P_XYMovement(mobj_t *mo) { mo->momz = transfermomz; mo->standingslope = NULL; - if (player && (player->pflags & PF_SPINNING)) - player->pflags |= PF_THOKKED; + if (player) + { + player->powers[pw_justlaunched] = 2; + if (player->pflags & PF_SPINNING) + player->pflags |= PF_THOKKED; + } } } #endif @@ -3922,6 +3926,7 @@ static void P_PlayerMobjThinker(mobj_t *mobj) // Needed for gravity boots P_CheckGravity(mobj, false); + mobj->player->powers[pw_justlaunched] = 0; if (mobj->momx || mobj->momy) { P_XYMovement(mobj); @@ -7996,8 +8001,40 @@ static void P_MobjSceneryThink(mobj_t *mobj) } if (mobj->fuse < 0) return; - if ((--mobj->fuse) < 6) + if (mobj->fuse < 6) mobj->frame = (mobj->frame & ~FF_TRANSMASK) | ((10 - (mobj->fuse*2)) << (FF_TRANSSHIFT)); + mobj->fuse--; + } + break; + case MT_FINISHFLAG: + { + if (!mobj->target || mobj->target->player->playerstate == PST_DEAD || !cv_exitmove.value) + { + P_RemoveMobj(mobj); + return; + } + + if (!camera.chase) + mobj->flags2 |= MF2_DONTDRAW; + else + mobj->flags2 &= ~MF2_DONTDRAW; + + P_UnsetThingPosition(mobj); + { + fixed_t radius = FixedMul(10*mobj->info->speed, mobj->target->scale); + angle_t fa; + + mobj->angle += FixedAngle(mobj->info->speed); + + fa = mobj->angle >> ANGLETOFINESHIFT; + + mobj->x = mobj->target->x + FixedMul(FINECOSINE(fa),radius); + mobj->y = mobj->target->y + FixedMul(FINESINE(fa),radius); + mobj->z = mobj->target->z + mobj->target->height/2; + } + P_SetThingPosition(mobj); + + P_SetScale(mobj, mobj->target->scale); } break; case MT_VWREF: @@ -11558,6 +11595,9 @@ void P_AfterPlayerSpawn(INT32 playernum) if (CheckForReverseGravity) P_CheckGravity(mobj, false); + + if (p->pflags & PF_FINISHED) + P_GiveFinishFlags(p); } // spawn it at a playerspawn mapthing diff --git a/src/p_mobj.h b/src/p_mobj.h index fd0c95a56..63c91571b 100644 --- a/src/p_mobj.h +++ b/src/p_mobj.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/p_polyobj.c b/src/p_polyobj.c index a206d0171..7e1ff1f49 100644 --- a/src/p_polyobj.c +++ b/src/p_polyobj.c @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 2006 by James Haley -// Copyright (C) 2006-2019 by Sonic Team Junior. +// Copyright (C) 2006-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/p_polyobj.h b/src/p_polyobj.h index 339390c0a..d56701d2d 100644 --- a/src/p_polyobj.h +++ b/src/p_polyobj.h @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 2006 by James Haley -// Copyright (C) 2006-2019 by Sonic Team Junior. +// Copyright (C) 2006-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/p_pspr.h b/src/p_pspr.h index a7545bc3e..3c10e9be4 100644 --- a/src/p_pspr.h +++ b/src/p_pspr.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/p_saveg.c b/src/p_saveg.c index 7d755edc6..fc8d9d4ee 100644 --- a/src/p_saveg.c +++ b/src/p_saveg.c @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. @@ -116,6 +116,7 @@ static void P_NetArchivePlayers(void) WRITEANGLE(save_p, players[i].aiming); WRITEANGLE(save_p, players[i].drawangle); + WRITEANGLE(save_p, players[i].viewrollangle); WRITEANGLE(save_p, players[i].awayviewaiming); WRITEINT32(save_p, players[i].awayviewtics); WRITEINT16(save_p, players[i].rings); @@ -326,6 +327,7 @@ static void P_NetUnArchivePlayers(void) players[i].aiming = READANGLE(save_p); players[i].drawangle = READANGLE(save_p); + players[i].viewrollangle = READANGLE(save_p); players[i].awayviewaiming = READANGLE(save_p); players[i].awayviewtics = READINT32(save_p); players[i].rings = READINT16(save_p); @@ -609,7 +611,7 @@ static void P_NetArchiveColormaps(void) WRITEUINT8(save_p, exc->fadestart); WRITEUINT8(save_p, exc->fadeend); - WRITEUINT8(save_p, exc->fog); + WRITEUINT8(save_p, exc->flags); WRITEINT32(save_p, exc->rgba); WRITEINT32(save_p, exc->fadergba); @@ -639,7 +641,7 @@ static void P_NetUnArchiveColormaps(void) for (exc = net_colormaps; i < num_net_colormaps; i++, exc = exc_next) { - UINT8 fadestart, fadeend, fog; + UINT8 fadestart, fadeend, flags; INT32 rgba, fadergba; #ifdef EXTRACOLORMAPLUMPS char lumpname[9]; @@ -647,7 +649,7 @@ static void P_NetUnArchiveColormaps(void) fadestart = READUINT8(save_p); fadeend = READUINT8(save_p); - fog = READUINT8(save_p); + flags = READUINT8(save_p); rgba = READINT32(save_p); fadergba = READINT32(save_p); @@ -679,7 +681,7 @@ static void P_NetUnArchiveColormaps(void) exc->fadestart = fadestart; exc->fadeend = fadeend; - exc->fog = fog; + exc->flags = flags; exc->rgba = rgba; exc->fadergba = fadergba; @@ -689,7 +691,7 @@ static void P_NetUnArchiveColormaps(void) exc->lumpname[0] = 0; #endif - existing_exc = R_GetColormapFromListByValues(rgba, fadergba, fadestart, fadeend, fog); + existing_exc = R_GetColormapFromListByValues(rgba, fadergba, fadestart, fadeend, flags); if (existing_exc) exc->colormap = existing_exc->colormap; @@ -1404,7 +1406,7 @@ static void SaveMobjThinker(const thinker_t *th, const UINT8 type) diff |= MD_TICS; if (mobj->sprite != mobj->state->sprite) diff |= MD_SPRITE; - if (mobj->sprite == SPR_PLAY && mobj->sprite2 != 0) + if (mobj->sprite == SPR_PLAY && mobj->sprite2 != (mobj->state->frame&FF_FRAMEMASK)) diff |= MD_SPRITE; if (mobj->frame != mobj->state->frame) diff |= MD_FRAME; diff --git a/src/p_saveg.h b/src/p_saveg.h index 16d47bea8..012e7023b 100644 --- a/src/p_saveg.h +++ b/src/p_saveg.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/p_setup.c b/src/p_setup.c index dcc28bae1..7b4c6773b 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/p_setup.h b/src/p_setup.h index d7e2d8861..e7150c0ae 100644 --- a/src/p_setup.h +++ b/src/p_setup.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/p_sight.c b/src/p_sight.c index 07dfabbc1..4ea14cca0 100644 --- a/src/p_sight.c +++ b/src/p_sight.c @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/p_slopes.c b/src/p_slopes.c index d584bb92d..e275964e3 100644 --- a/src/p_slopes.c +++ b/src/p_slopes.c @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 2004 by Stephen McGranahan -// Copyright (C) 2015-2019 by Sonic Team Junior. +// Copyright (C) 2015-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. @@ -726,6 +726,9 @@ void P_SlopeLaunch(mobj_t *mo) //CONS_Printf("Launched off of slope.\n"); mo->standingslope = NULL; + + if (mo->player) + mo->player->powers[pw_justlaunched] = 1; } // diff --git a/src/p_slopes.h b/src/p_slopes.h index 0bf03f26d..f8159b884 100644 --- a/src/p_slopes.h +++ b/src/p_slopes.h @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 2004 by Stephen McGranahan -// Copyright (C) 2015-2019 by Sonic Team Junior. +// Copyright (C) 2015-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/p_spec.c b/src/p_spec.c index 76a80d754..d9bbab246 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. @@ -3516,7 +3516,7 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec) false, // subtract FadeA (no flag for this, just pass negative alpha) false, // subtract FadeStart (we ran out of flags) false, // subtract FadeEnd (we ran out of flags) - false, // ignore Fog (we ran out of flags) + false, // ignore Flags (we ran out of flags) line->flags & ML_DONTPEGBOTTOM, (line->flags & ML_DONTPEGBOTTOM) ? (sides[line->sidenum[0]].textureoffset >> FRACBITS) : 0, (line->flags & ML_DONTPEGBOTTOM) ? (sides[line->sidenum[0]].rowoffset >> FRACBITS) : 0, @@ -3883,7 +3883,7 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec) false, // subtract FadeA (no flag for this, just pass negative alpha) false, // subtract FadeStart (we ran out of flags) false, // subtract FadeEnd (we ran out of flags) - false, // ignore Fog (we ran out of flags) + false, // ignore Flags (we ran out of flags) line->flags & ML_DONTPEGBOTTOM, (line->flags & ML_DONTPEGBOTTOM) ? (sides[line->sidenum[0]].textureoffset >> FRACBITS) : 0, (line->flags & ML_DONTPEGBOTTOM) ? (sides[line->sidenum[0]].rowoffset >> FRACBITS) : 0, @@ -7081,10 +7081,9 @@ void P_SpawnSpecials(boolean fromnetsave) case 202: // Fog ffloorflags = FF_EXISTS|FF_RENDERALL|FF_FOG|FF_BOTHPLANES|FF_INVERTPLANES|FF_ALLSIDES|FF_INVERTSIDES|FF_CUTEXTRA|FF_EXTRA|FF_DOUBLESHADOW|FF_CUTSPRITES; sec = sides[*lines[i].sidenum].sector - sectors; - // SoM: Because it's fog, check for an extra colormap and set - // the fog flag... + // SoM: Because it's fog, check for an extra colormap and set the fog flag... if (sectors[sec].extra_colormap) - sectors[sec].extra_colormap->fog = 1; + sectors[sec].extra_colormap->flags = CMF_FOG; P_AddFakeFloorsByLine(i, ffloorflags, secthinkers); break; @@ -8472,7 +8471,7 @@ void T_FadeColormap(fadecolormap_t *d) extracolormap_t *exc; INT32 duration = d->ticbased ? d->duration : 256; fixed_t factor = min(FixedDiv(duration - d->timer, duration), 1*FRACUNIT); - INT16 cr, cg, cb, ca, fadestart, fadeend, fog; + INT16 cr, cg, cb, ca, fadestart, fadeend, flags; INT32 rgba, fadergba; // NULL failsafes (or intentionally set to signify default) @@ -8521,7 +8520,7 @@ void T_FadeColormap(fadecolormap_t *d) fadestart = APPLYFADE(d->dest_exc->fadestart, d->source_exc->fadestart, d->sector->extra_colormap->fadestart); fadeend = APPLYFADE(d->dest_exc->fadeend, d->source_exc->fadeend, d->sector->extra_colormap->fadeend); - fog = abs(factor) > FRACUNIT/2 ? d->dest_exc->fog : d->source_exc->fog; // set new fog flag halfway through fade + flags = abs(factor) > FRACUNIT/2 ? d->dest_exc->flags : d->source_exc->flags; // set new flags halfway through fade #undef APPLYFADE @@ -8529,12 +8528,12 @@ void T_FadeColormap(fadecolormap_t *d) // setup new colormap ////////////////// - if (!(d->sector->extra_colormap = R_GetColormapFromListByValues(rgba, fadergba, fadestart, fadeend, fog))) + if (!(d->sector->extra_colormap = R_GetColormapFromListByValues(rgba, fadergba, fadestart, fadeend, flags))) { exc = R_CreateDefaultColormap(false); exc->fadestart = fadestart; exc->fadeend = fadeend; - exc->fog = (boolean)fog; + exc->flags = flags; exc->rgba = rgba; exc->fadergba = fadergba; exc->colormap = R_CreateLightTable(exc); diff --git a/src/p_spec.h b/src/p_spec.h index 4b64fe05d..6377059b6 100644 --- a/src/p_spec.h +++ b/src/p_spec.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/p_telept.c b/src/p_telept.c index 69729d208..600d40c88 100644 --- a/src/p_telept.c +++ b/src/p_telept.c @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/p_tick.c b/src/p_tick.c index 74472b71f..1d421ad37 100644 --- a/src/p_tick.c +++ b/src/p_tick.c @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/p_tick.h b/src/p_tick.h index a9501f62f..1fb88f3f2 100644 --- a/src/p_tick.h +++ b/src/p_tick.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/p_user.c b/src/p_user.c index 5abf01b57..5dd6fe057 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. @@ -370,6 +370,36 @@ void P_GiveEmerald(boolean spawnObj) } } +// +// P_GiveFinishFlags +// +// Give the player visual indicators +// that they've finished the map. +// +void P_GiveFinishFlags(player_t *player) +{ + angle_t angle = FixedAngle(player->mo->angle << FRACBITS); + UINT8 i; + + if (!player->mo) + return; + + if (!(netgame||multiplayer)) + return; + + for (i = 0; i < 3; i++) + { + angle_t fa = (angle >> ANGLETOFINESHIFT) & FINEMASK; + fixed_t xoffs = FINECOSINE(fa); + fixed_t yoffs = FINESINE(fa); + mobj_t* flag = P_SpawnMobjFromMobj(player->mo, xoffs, yoffs, 0, MT_FINISHFLAG); + flag->angle = angle; + angle += FixedAngle(120*FRACUNIT); + + P_SetTarget(&flag->target, player->mo); + } +} + #if 0 // // P_ResetScore @@ -2171,6 +2201,7 @@ void P_DoPlayerFinish(player_t *player) return; player->pflags |= PF_FINISHED; + P_GiveFinishFlags(player); if (netgame) CONS_Printf(M_GetText("%s has completed the level.\n"), player_names[player-players]); @@ -7436,6 +7467,8 @@ static void P_NiGHTSMovement(player_t *player) else // AngleFixed(R_PointToAngle2()) results in slight inaccuracy! Don't use it unless movement is on both axises. newangle = (INT16)FixedInt(AngleFixed(R_PointToAngle2(0,0, cmd->sidemove*FRACUNIT, cmd->forwardmove*FRACUNIT))); + newangle -= player->viewrollangle / ANG1; + if (newangle < 0 && moved) newangle = (INT16)(360+newangle); } diff --git a/src/r_bsp.c b/src/r_bsp.c index 6b4667aee..c0011f4b9 100644 --- a/src/r_bsp.c +++ b/src/r_bsp.c @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/r_bsp.h b/src/r_bsp.h index 95aea9eff..1562b79f6 100644 --- a/src/r_bsp.h +++ b/src/r_bsp.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/r_data.c b/src/r_data.c index ef62ba0c1..553e83bbc 100644 --- a/src/r_data.c +++ b/src/r_data.c @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. @@ -1805,7 +1805,7 @@ extracolormap_t *R_CreateDefaultColormap(boolean lighttable) extracolormap_t *exc = Z_Calloc(sizeof (*exc), PU_LEVEL, NULL); exc->fadestart = 0; exc->fadeend = 31; - exc->fog = 0; + exc->flags = 0; exc->rgba = 0; exc->fadergba = 0x19000000; exc->colormap = lighttable ? R_CreateLightTable(exc) : NULL; @@ -1909,17 +1909,17 @@ void R_AddColormapToList(extracolormap_t *extra_colormap) // #ifdef EXTRACOLORMAPLUMPS boolean R_CheckDefaultColormapByValues(boolean checkrgba, boolean checkfadergba, boolean checkparams, - INT32 rgba, INT32 fadergba, UINT8 fadestart, UINT8 fadeend, UINT8 fog, lumpnum_t lump) + INT32 rgba, INT32 fadergba, UINT8 fadestart, UINT8 fadeend, UINT8 flags, lumpnum_t lump) #else boolean R_CheckDefaultColormapByValues(boolean checkrgba, boolean checkfadergba, boolean checkparams, - INT32 rgba, INT32 fadergba, UINT8 fadestart, UINT8 fadeend, UINT8 fog) + INT32 rgba, INT32 fadergba, UINT8 fadestart, UINT8 fadeend, UINT8 flags) #endif { return ( (!checkparams ? true : (fadestart == 0 && fadeend == 31 - && !fog) + && !flags) ) && (!checkrgba ? true : rgba == 0) && (!checkfadergba ? true : fadergba == 0x19000000) @@ -1936,9 +1936,9 @@ boolean R_CheckDefaultColormap(extracolormap_t *extra_colormap, boolean checkrgb return true; #ifdef EXTRACOLORMAPLUMPS - return R_CheckDefaultColormapByValues(checkrgba, checkfadergba, checkparams, extra_colormap->rgba, extra_colormap->fadergba, extra_colormap->fadestart, extra_colormap->fadeend, extra_colormap->fog, extra_colormap->lump); + return R_CheckDefaultColormapByValues(checkrgba, checkfadergba, checkparams, extra_colormap->rgba, extra_colormap->fadergba, extra_colormap->fadestart, extra_colormap->fadeend, extra_colormap->flags, extra_colormap->lump); #else - return R_CheckDefaultColormapByValues(checkrgba, checkfadergba, checkparams, extra_colormap->rgba, extra_colormap->fadergba, extra_colormap->fadestart, extra_colormap->fadeend, extra_colormap->fog); + return R_CheckDefaultColormapByValues(checkrgba, checkfadergba, checkparams, extra_colormap->rgba, extra_colormap->fadergba, extra_colormap->fadestart, extra_colormap->fadeend, extra_colormap->flags); #endif } @@ -1958,7 +1958,7 @@ boolean R_CheckEqualColormaps(extracolormap_t *exc_a, extracolormap_t *exc_b, bo (!checkparams ? true : (exc_a->fadestart == exc_b->fadestart && exc_a->fadeend == exc_b->fadeend - && exc_a->fog == exc_b->fog) + && exc_a->flags == exc_b->flags) ) && (!checkrgba ? true : exc_a->rgba == exc_b->rgba) && (!checkfadergba ? true : exc_a->fadergba == exc_b->fadergba) @@ -1974,9 +1974,9 @@ boolean R_CheckEqualColormaps(extracolormap_t *exc_a, extracolormap_t *exc_b, bo // NOTE: Returns NULL if no match is found // #ifdef EXTRACOLORMAPLUMPS -extracolormap_t *R_GetColormapFromListByValues(INT32 rgba, INT32 fadergba, UINT8 fadestart, UINT8 fadeend, UINT8 fog, lumpnum_t lump) +extracolormap_t *R_GetColormapFromListByValues(INT32 rgba, INT32 fadergba, UINT8 fadestart, UINT8 fadeend, UINT8 flags, lumpnum_t lump) #else -extracolormap_t *R_GetColormapFromListByValues(INT32 rgba, INT32 fadergba, UINT8 fadestart, UINT8 fadeend, UINT8 fog) +extracolormap_t *R_GetColormapFromListByValues(INT32 rgba, INT32 fadergba, UINT8 fadestart, UINT8 fadeend, UINT8 flags) #endif { extracolormap_t *exc; @@ -1988,7 +1988,7 @@ extracolormap_t *R_GetColormapFromListByValues(INT32 rgba, INT32 fadergba, UINT8 && fadergba == exc->fadergba && fadestart == exc->fadestart && fadeend == exc->fadeend - && fog == exc->fog + && flags == exc->flags #ifdef EXTRACOLORMAPLUMPS && (lump != LUMPERROR && lump == exc->lump) #endif @@ -2007,9 +2007,9 @@ extracolormap_t *R_GetColormapFromListByValues(INT32 rgba, INT32 fadergba, UINT8 extracolormap_t *R_GetColormapFromList(extracolormap_t *extra_colormap) { #ifdef EXTRACOLORMAPLUMPS - return R_GetColormapFromListByValues(extra_colormap->rgba, extra_colormap->fadergba, extra_colormap->fadestart, extra_colormap->fadeend, extra_colormap->fog, extra_colormap->lump); + return R_GetColormapFromListByValues(extra_colormap->rgba, extra_colormap->fadergba, extra_colormap->fadestart, extra_colormap->fadeend, extra_colormap->flags, extra_colormap->lump); #else - return R_GetColormapFromListByValues(extra_colormap->rgba, extra_colormap->fadergba, extra_colormap->fadestart, extra_colormap->fadeend, extra_colormap->fog); + return R_GetColormapFromListByValues(extra_colormap->rgba, extra_colormap->fadergba, extra_colormap->fadestart, extra_colormap->fadeend, extra_colormap->flags); #endif } @@ -2041,7 +2041,7 @@ extracolormap_t *R_ColormapForName(char *name) // is no real way to tell how GL should handle a colormap lump anyway.. exc->fadestart = 0; exc->fadeend = 31; - exc->fog = 0; + exc->flags = 0; exc->rgba = 0; exc->fadergba = 0x19000000; @@ -2198,7 +2198,7 @@ extracolormap_t *R_CreateColormap(char *p1, char *p2, char *p3) // default values UINT8 cr = 0, cg = 0, cb = 0, ca = 0, cfr = 0, cfg = 0, cfb = 0, cfa = 25; UINT32 fadestart = 0, fadeend = 31; - UINT8 fog = 0; + UINT8 flags = 0; INT32 rgba = 0, fadergba = 0x19000000; #define HEX2INT(x) (UINT32)(x >= '0' && x <= '9' ? x - '0' : x >= 'a' && x <= 'f' ? x - 'a' + 10 : x >= 'A' && x <= 'F' ? x - 'A' + 10 : 0) @@ -2247,12 +2247,12 @@ extracolormap_t *R_CreateColormap(char *p1, char *p2, char *p3) #define NUMFROMCHAR(c) (c >= '0' && c <= '9' ? c - '0' : 0) - // Get parameters like fadestart, fadeend, and the fogflag + // Get parameters like fadestart, fadeend, and flags if (p2[0] == '#') { if (p2[1]) { - fog = NUMFROMCHAR(p2[1]); + flags = NUMFROMCHAR(p2[1]); if (p2[2] && p2[3]) { fadestart = NUMFROMCHAR(p2[3]) + (NUMFROMCHAR(p2[2]) * 10); @@ -2319,18 +2319,18 @@ extracolormap_t *R_CreateColormap(char *p1, char *p2, char *p3) // Did we just make a default colormap? #ifdef EXTRACOLORMAPLUMPS - if (R_CheckDefaultColormapByValues(true, true, true, rgba, fadergba, fadestart, fadeend, fog, LUMPERROR)) + if (R_CheckDefaultColormapByValues(true, true, true, rgba, fadergba, fadestart, fadeend, flags, LUMPERROR)) return NULL; #else - if (R_CheckDefaultColormapByValues(true, true, true, rgba, fadergba, fadestart, fadeend, fog)) + if (R_CheckDefaultColormapByValues(true, true, true, rgba, fadergba, fadestart, fadeend, flags)) return NULL; #endif // Look for existing colormaps #ifdef EXTRACOLORMAPLUMPS - exc = R_GetColormapFromListByValues(rgba, fadergba, fadestart, fadeend, fog, LUMPERROR); + exc = R_GetColormapFromListByValues(rgba, fadergba, fadestart, fadeend, flags, LUMPERROR); #else - exc = R_GetColormapFromListByValues(rgba, fadergba, fadestart, fadeend, fog); + exc = R_GetColormapFromListByValues(rgba, fadergba, fadestart, fadeend, flags); #endif if (exc) return exc; @@ -2342,7 +2342,7 @@ extracolormap_t *R_CreateColormap(char *p1, char *p2, char *p3) extra_colormap->fadestart = (UINT16)fadestart; extra_colormap->fadeend = (UINT16)fadeend; - extra_colormap->fog = fog; + extra_colormap->flags = flags; extra_colormap->rgba = rgba; extra_colormap->fadergba = fadergba; @@ -2369,7 +2369,7 @@ extracolormap_t *R_CreateColormap(char *p1, char *p2, char *p3) extracolormap_t *R_AddColormaps(extracolormap_t *exc_augend, extracolormap_t *exc_addend, boolean subR, boolean subG, boolean subB, boolean subA, boolean subFadeR, boolean subFadeG, boolean subFadeB, boolean subFadeA, - boolean subFadeStart, boolean subFadeEnd, boolean ignoreFog, + boolean subFadeStart, boolean subFadeEnd, boolean ignoreFlags, boolean useAltAlpha, INT16 altAlpha, INT16 altFadeAlpha, boolean lighttable) { @@ -2457,8 +2457,8 @@ extracolormap_t *R_AddColormaps(extracolormap_t *exc_augend, extracolormap_t *ex // HACK: fadeend defaults to 31, so don't add anything in this case , 31), 0); - if (!ignoreFog) // overwrite fog with new value - exc_augend->fog = exc_addend->fog; + if (!ignoreFlags) // overwrite flags with new value + exc_augend->flags = exc_addend->flags; /////////////////// // put it together diff --git a/src/r_data.h b/src/r_data.h index 145f0182b..78ce35a41 100644 --- a/src/r_data.h +++ b/src/r_data.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. @@ -135,12 +135,12 @@ void R_AddColormapToList(extracolormap_t *extra_colormap); #ifdef EXTRACOLORMAPLUMPS boolean R_CheckDefaultColormapByValues(boolean checkrgba, boolean checkfadergba, boolean checkparams, - INT32 rgba, INT32 fadergba, UINT8 fadestart, UINT8 fadeend, UINT8 fog, lumpnum_t lump); -extracolormap_t *R_GetColormapFromListByValues(INT32 rgba, INT32 fadergba, UINT8 fadestart, UINT8 fadeend, UINT8 fog, lumpnum_t lump); + INT32 rgba, INT32 fadergba, UINT8 fadestart, UINT8 fadeend, UINT8 flags, lumpnum_t lump); +extracolormap_t *R_GetColormapFromListByValues(INT32 rgba, INT32 fadergba, UINT8 fadestart, UINT8 fadeend, UINT8 flags, lumpnum_t lump); #else boolean R_CheckDefaultColormapByValues(boolean checkrgba, boolean checkfadergba, boolean checkparams, - INT32 rgba, INT32 fadergba, UINT8 fadestart, UINT8 fadeend, UINT8 fog); -extracolormap_t *R_GetColormapFromListByValues(INT32 rgba, INT32 fadergba, UINT8 fadestart, UINT8 fadeend, UINT8 fog); + INT32 rgba, INT32 fadergba, UINT8 fadestart, UINT8 fadeend, UINT8 flags); +extracolormap_t *R_GetColormapFromListByValues(INT32 rgba, INT32 fadergba, UINT8 fadestart, UINT8 fadeend, UINT8 flags); #endif boolean R_CheckDefaultColormap(extracolormap_t *extra_colormap, boolean checkrgba, boolean checkfadergba, boolean checkparams); boolean R_CheckEqualColormaps(extracolormap_t *exc_a, extracolormap_t *exc_b, boolean checkrgba, boolean checkfadergba, boolean checkparams); @@ -151,7 +151,7 @@ extracolormap_t *R_CreateColormap(char *p1, char *p2, char *p3); extracolormap_t *R_AddColormaps(extracolormap_t *exc_augend, extracolormap_t *exc_addend, boolean subR, boolean subG, boolean subB, boolean subA, boolean subFadeR, boolean subFadeG, boolean subFadeB, boolean subFadeA, - boolean subFadeStart, boolean subFadeEnd, boolean ignoreFog, + boolean subFadeStart, boolean subFadeEnd, boolean ignoreFlags, boolean useAltAlpha, INT16 altAlpha, INT16 altFadeAlpha, boolean lighttable); #ifdef EXTRACOLORMAPLUMPS diff --git a/src/r_defs.h b/src/r_defs.h index 88d418fc9..e6f1e4e7c 100644 --- a/src/r_defs.h +++ b/src/r_defs.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. @@ -53,11 +53,14 @@ typedef struct // Could even use more than 32 levels. typedef UINT8 lighttable_t; +#define CMF_FADEFULLBRIGHTSPRITES 1 +#define CMF_FOG 4 + // ExtraColormap type. Use for extra_colormaps from now on. typedef struct extracolormap_s { UINT8 fadestart, fadeend; - UINT8 fog; // categorical value, not boolean + UINT8 flags; // store rgba values in combined bitwise // also used in OpenGL instead lighttables diff --git a/src/r_draw.c b/src/r_draw.c index 743965cfb..f46f4fb13 100644 --- a/src/r_draw.c +++ b/src/r_draw.c @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. @@ -153,9 +153,11 @@ const UINT8 Color_Index[MAXTRANSLATIONS-1][16] = { // Desaturated {0x00, 0x00, 0x01, 0x02, 0x02, 0x03, 0x91, 0x91, 0x91, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xaf}, // SKINCOLOR_AETHER {0x00, 0x02, 0x04, 0x06, 0x08, 0x0a, 0xaa, 0xaa, 0xaa, 0xab, 0xac, 0xac, 0xad, 0xad, 0xae, 0xaf}, // SKINCOLOR_SLATE + {0x90, 0x91, 0x92, 0x93, 0x94, 0x94, 0x95, 0xac, 0xac, 0xad, 0xad, 0xa8, 0xa8, 0xa9, 0xfd, 0xfe}, // SKINCOLOR_BLUEBELL {0xd0, 0xd0, 0xd1, 0xd1, 0xd2, 0xd2, 0xd3, 0xd3, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0x2b, 0x2c, 0x2e}, // SKINCOLOR_PINK {0xd0, 0x30, 0xd8, 0xd9, 0xda, 0xdb, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, 0xe0, 0xe3, 0xe6, 0xe8, 0xe9}, // SKINCOLOR_YOGURT {0xdf, 0xe0, 0xe1, 0xe2, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef}, // SKINCOLOR_BROWN + {0xde, 0xe0, 0xe1, 0xe4, 0xe7, 0xe9, 0xeb, 0xec, 0xed, 0xed, 0xed, 0x19, 0x19, 0x1b, 0x1d, 0x1e}, // SKINCOLOR_BRONZE {0x51, 0x51, 0x54, 0x54, 0x55, 0x55, 0x56, 0x56, 0x56, 0x57, 0xf5, 0xf5, 0xf9, 0xf9, 0xed, 0xed}, // SKINCOLOR_TAN {0x54, 0x55, 0x56, 0x56, 0xf2, 0xf3, 0xf3, 0xf4, 0xf5, 0xf6, 0xf8, 0xf9, 0xfa, 0xfb, 0xed, 0xed}, // SKINCOLOR_BEIGE {0x58, 0x58, 0x59, 0x59, 0x5a, 0x5a, 0x5b, 0x5b, 0x5b, 0x5c, 0x5d, 0x5d, 0x5e, 0x5e, 0x5f, 0x5f}, // SKINCOLOR_MOSS @@ -168,9 +170,11 @@ const UINT8 Color_Index[MAXTRANSLATIONS-1][16] = { {0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x47, 0x2e, 0x2f}, // SKINCOLOR_RED {0x27, 0x27, 0x28, 0x28, 0x29, 0x2a, 0x2b, 0x2b, 0x2c, 0x2d, 0x2e, 0x2e, 0x2e, 0x2f, 0x2f, 0x1f}, // SKINCOLOR_CRIMSON {0x31, 0x32, 0x33, 0x36, 0x22, 0x22, 0x25, 0x25, 0x25, 0xcd, 0xcf, 0xcf, 0xc5, 0xc5, 0xc7, 0xc7}, // SKINCOLOR_FLAME + {0x48, 0x49, 0x40, 0x33, 0x34, 0x36, 0x22, 0x24, 0x26, 0x28, 0x2a, 0x2b, 0x2c, 0x47, 0x2e, 0x2f}, // SKINCOLOR_KETCHUP {0xd0, 0x30, 0x31, 0x31, 0x32, 0x32, 0xdc, 0xdc, 0xdc, 0xd3, 0xd4, 0xd4, 0xcc, 0xcd, 0xce, 0xcf}, // SKINCOLOR_PEACHY {0xd8, 0xd9, 0xdb, 0xdc, 0xde, 0xdf, 0xd5, 0xd5, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0x1d, 0x1f}, // SKINCOLOR_QUAIL {0x51, 0x52, 0x40, 0x40, 0x34, 0x36, 0xd5, 0xd5, 0xd6, 0xd7, 0xcf, 0xcf, 0xc6, 0xc6, 0xc7, 0xfe}, // SKINCOLOR_SUNSET + {0x58, 0x54, 0x40, 0x34, 0x35, 0x38, 0x3a, 0x3c, 0x3d, 0x2a, 0x2b, 0x2c, 0x2c, 0xba, 0xba, 0xbb}, // SKINCOLOR_COPPER {0x00, 0xd8, 0xd9, 0xda, 0xdb, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e}, // SKINCOLOR_APRICOT {0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, 0x2c}, // SKINCOLOR_ORANGE {0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3c, 0x3d, 0x3d, 0x3d, 0x3f, 0x2c, 0x2d, 0x47, 0x2e, 0x2f, 0x2f}, // SKINCOLOR_RUST @@ -180,6 +184,7 @@ const UINT8 Color_Index[MAXTRANSLATIONS-1][16] = { {0x4b, 0x4b, 0x4c, 0x4c, 0x4d, 0x4e, 0xe7, 0xe7, 0xe9, 0xc5, 0xc5, 0xc6, 0xc6, 0xc7, 0xc7, 0xfd}, // SKINCOLOR_OLIVE {0x50, 0x51, 0x52, 0x53, 0x48, 0xbc, 0xbd, 0xbe, 0xbe, 0xbf, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f}, // SKINCOLOR_LIME {0x58, 0x58, 0xbc, 0xbc, 0xbd, 0xbd, 0xbe, 0xbe, 0xbe, 0xbf, 0x5e, 0x5e, 0x5f, 0x5f, 0x77, 0x77}, // SKINCOLOR_PERIDOT + {0x49, 0x49, 0xbc, 0xbd, 0xbe, 0xbe, 0xbe, 0x67, 0x69, 0x6a, 0x6b, 0x6b, 0x6c, 0x6d, 0x6d, 0x6d}, // SKINCOLOR_APPLE {0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f}, // SKINCOLOR_GREEN {0x65, 0x66, 0x67, 0x68, 0x69, 0x69, 0x6a, 0x6b, 0x6b, 0x6c, 0x6d, 0x6d, 0x6e, 0x6e, 0x6e, 0x6f}, // SKINCOLOR_FOREST {0x70, 0x70, 0x71, 0x71, 0x72, 0x72, 0x73, 0x73, 0x73, 0x74, 0x75, 0x75, 0x76, 0x76, 0x77, 0x77}, // SKINCOLOR_EMERALD @@ -206,6 +211,7 @@ const UINT8 Color_Index[MAXTRANSLATIONS-1][16] = { {0xd0, 0xd1, 0xd2, 0xca, 0xcc, 0xb8, 0xb9, 0xb9, 0xba, 0xa8, 0xa8, 0xa9, 0xa9, 0xfd, 0xfe, 0xfe}, // SKINCOLOR_VIOLET {0x00, 0xd0, 0xd1, 0xd2, 0xd3, 0xc1, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc5, 0xc6, 0xc6, 0xfe, 0x1f}, // SKINCOLOR_LILAC {0xc8, 0xd3, 0xd5, 0xd6, 0xd7, 0xce, 0xcf, 0xb9, 0xb9, 0xba, 0xba, 0xa9, 0xa9, 0xa9, 0xfd, 0xfe}, // SKINCOLOR_PLUM + {0xc8, 0xc9, 0xca, 0xcb, 0xcb, 0xcc, 0xcd, 0xcd, 0xce, 0xb9, 0xb9, 0xba, 0xba, 0xbb, 0xfe, 0xfe}, // SKINCOLOR_RASPBERRY {0xfc, 0xc8, 0xc8, 0xc9, 0xc9, 0xca, 0xca, 0xcb, 0xcb, 0xcc, 0xcc, 0xcd, 0xcd, 0xce, 0xce, 0xcf}, // SKINCOLOR_ROSY // {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}, // SKINCOLOR_? @@ -285,9 +291,11 @@ const char *Color_Names[MAXSKINCOLORS + NUMSUPERCOLORS] = // Desaturated "Aether", // SKINCOLOR_AETHER, "Slate", // SKINCOLOR_SLATE, + "Bluebell", // SKINCOLOR_BLUEBELL, "Pink", // SKINCOLOR_PINK, "Yogurt", // SKINCOLOR_YOGURT, - "Brown", // SKINCOLOR_BROWN, + "Brown", // SKINCOLOR_BROWN, + "Bronze", // SKINCOLOR_BRONZE, "Tan", // SKINCOLOR_TAN, "Beige", // SKINCOLOR_BEIGE, "Moss", // SKINCOLOR_MOSS, @@ -300,9 +308,11 @@ const char *Color_Names[MAXSKINCOLORS + NUMSUPERCOLORS] = "Red", // SKINCOLOR_RED, "Crimson", // SKINCOLOR_CRIMSON, "Flame", // SKINCOLOR_FLAME, + "Ketchup", // SKINCOLOR_KETCHUP, "Peachy", // SKINCOLOR_PEACHY, "Quail", // SKINCOLOR_QUAIL, "Sunset", // SKINCOLOR_SUNSET, + "Copper", // SKINCOLOR_COPPER, "Apricot", // SKINCOLOR_APRICOT, "Orange", // SKINCOLOR_ORANGE, "Rust", // SKINCOLOR_RUST, @@ -312,6 +322,7 @@ const char *Color_Names[MAXSKINCOLORS + NUMSUPERCOLORS] = "Olive", // SKINCOLOR_OLIVE, "Lime", // SKINCOLOR_LIME, "Peridot", // SKINCOLOR_PERIDOT, + "Apple", // SKINCOLOR_APPLE, "Green", // SKINCOLOR_GREEN, "Forest", // SKINCOLOR_FOREST, "Emerald", // SKINCOLOR_EMERALD, @@ -338,6 +349,7 @@ const char *Color_Names[MAXSKINCOLORS + NUMSUPERCOLORS] = "Violet", // SKINCOLOR_VIOLET, "Lilac", // SKINCOLOR_LILAC, "Plum", // SKINCOLOR_PLUM, + "Raspberry", // SKINCOLOR_RASPBERRY, "Rosy", // SKINCOLOR_ROSY, // Super behaves by different rules (one name per 5 colours), and will be accessed exclusively via R_GetSuperColorByName instead of R_GetColorByName. @@ -375,9 +387,11 @@ const UINT8 Color_Opposite[MAXSKINCOLORS - 1][2] = // Desaturated {SKINCOLOR_GREY, 15}, // SKINCOLOR_AETHER, {SKINCOLOR_SILVER, 12}, // SKINCOLOR_SLATE, + {SKINCOLOR_COPPER, 4}, // SKINCOLOR_BLUEBELL, {SKINCOLOR_AZURE, 9}, // SKINCOLOR_PINK, {SKINCOLOR_RUST, 7}, // SKINCOLOR_YOGURT, {SKINCOLOR_TAN, 2}, // SKINCOLOR_BROWN, + {SKINCOLOR_KETCHUP, 0}, // SKINCOLOR_BRONZE, {SKINCOLOR_BROWN, 12}, // SKINCOLOR_TAN, {SKINCOLOR_MOSS, 5}, // SKINCOLOR_BEIGE, {SKINCOLOR_BEIGE, 13}, // SKINCOLOR_MOSS, @@ -390,9 +404,11 @@ const UINT8 Color_Opposite[MAXSKINCOLORS - 1][2] = {SKINCOLOR_GREEN, 10}, // SKINCOLOR_RED, {SKINCOLOR_ICY, 10}, // SKINCOLOR_CRIMSON, {SKINCOLOR_PURPLE, 8}, // SKINCOLOR_FLAME, + {SKINCOLOR_BRONZE, 8}, // SKINCOLOR_KETCHUP, {SKINCOLOR_TEAL, 7}, // SKINCOLOR_PEACHY, {SKINCOLOR_WAVE, 5}, // SKINCOLOR_QUAIL, {SKINCOLOR_SAPPHIRE, 5}, // SKINCOLOR_SUNSET, + {SKINCOLOR_BLUEBELL, 5}, // SKINCOLOR_COPPER {SKINCOLOR_CYAN, 4}, // SKINCOLOR_APRICOT, {SKINCOLOR_BLUE, 4}, // SKINCOLOR_ORANGE, {SKINCOLOR_YOGURT, 8}, // SKINCOLOR_RUST, @@ -402,6 +418,7 @@ const UINT8 Color_Opposite[MAXSKINCOLORS - 1][2] = {SKINCOLOR_DUSK, 3}, // SKINCOLOR_OLIVE, {SKINCOLOR_MAGENTA, 9}, // SKINCOLOR_LIME, {SKINCOLOR_COBALT, 2}, // SKINCOLOR_PERIDOT, + {SKINCOLOR_RASPBERRY, 13}, // SKINCOLOR_APPLE, {SKINCOLOR_RED, 6}, // SKINCOLOR_GREEN, {SKINCOLOR_SALMON, 9}, // SKINCOLOR_FOREST, {SKINCOLOR_RUBY, 4}, // SKINCOLOR_EMERALD, @@ -428,6 +445,7 @@ const UINT8 Color_Opposite[MAXSKINCOLORS - 1][2] = {SKINCOLOR_MINT, 6}, // SKINCOLOR_VIOLET, {SKINCOLOR_VAPOR, 4}, // SKINCOLOR_LILAC, {SKINCOLOR_MINT, 7}, // SKINCOLOR_PLUM, + {SKINCOLOR_APPLE, 13}, // SKINCOLOR_RASPBERRY {SKINCOLOR_AQUA, 1} // SKINCOLOR_ROSY, }; diff --git a/src/r_draw.h b/src/r_draw.h index da38c40e0..870d294c3 100644 --- a/src/r_draw.h +++ b/src/r_draw.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/r_draw16.c b/src/r_draw16.c index 48017f45e..8b1d29e8d 100644 --- a/src/r_draw16.c +++ b/src/r_draw16.c @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/r_draw8.c b/src/r_draw8.c index 015dac2a7..fe0a23770 100644 --- a/src/r_draw8.c +++ b/src/r_draw8.c @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. @@ -644,6 +644,7 @@ void R_CalcTiltedLighting(fixed_t start, fixed_t end) } } +#define PLANELIGHTFLOAT (BASEVIDWIDTH * BASEVIDWIDTH / vid.width / (zeroheight - FIXED_TO_FLOAT(viewz)) / 21.0f * FIXED_TO_FLOAT(fovtan)) /** \brief The R_DrawTiltedSpan_8 function Draw slopes! Holy sheit! @@ -669,7 +670,7 @@ void R_DrawTiltedSpan_8(void) // Lighting is simple. It's just linear interpolation from start to end { - float planelightfloat = BASEVIDWIDTH*BASEVIDWIDTH/vid.width / (zeroheight - FIXED_TO_FLOAT(viewz)) / 21.0f; + float planelightfloat = PLANELIGHTFLOAT; float lightstart, lightend; lightend = (iz + ds_szp->x*width) * planelightfloat; @@ -805,7 +806,7 @@ void R_DrawTiltedTranslucentSpan_8(void) // Lighting is simple. It's just linear interpolation from start to end { - float planelightfloat = BASEVIDWIDTH*BASEVIDWIDTH/vid.width / (zeroheight - FIXED_TO_FLOAT(viewz)) / 21.0f; + float planelightfloat = PLANELIGHTFLOAT; float lightstart, lightend; lightend = (iz + ds_szp->x*width) * planelightfloat; @@ -942,7 +943,7 @@ void R_DrawTiltedTranslucentWaterSpan_8(void) // Lighting is simple. It's just linear interpolation from start to end { - float planelightfloat = BASEVIDWIDTH*BASEVIDWIDTH/vid.width / (zeroheight - FIXED_TO_FLOAT(viewz)) / 21.0f; + float planelightfloat = PLANELIGHTFLOAT; float lightstart, lightend; lightend = (iz + ds_szp->x*width) * planelightfloat; @@ -1078,7 +1079,7 @@ void R_DrawTiltedSplat_8(void) // Lighting is simple. It's just linear interpolation from start to end { - float planelightfloat = BASEVIDWIDTH*BASEVIDWIDTH/vid.width / (zeroheight - FIXED_TO_FLOAT(viewz)) / 21.0f; + float planelightfloat = PLANELIGHTFLOAT; float lightstart, lightend; lightend = (iz + ds_szp->x*width) * planelightfloat; diff --git a/src/r_draw8_npo2.c b/src/r_draw8_npo2.c index 748ca195c..b91f492f2 100644 --- a/src/r_draw8_npo2.c +++ b/src/r_draw8_npo2.c @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. @@ -62,6 +62,9 @@ void R_DrawSpan_NPO2_8 (void) } #ifdef ESLOPE + +#define PLANELIGHTFLOAT (BASEVIDWIDTH * BASEVIDWIDTH / vid.width / (zeroheight - FIXED_TO_FLOAT(viewz)) / 21.0f * FIXED_TO_FLOAT(fovtan)) + /** \brief The R_DrawTiltedSpan_NPO2_8 function Draw slopes! Holy sheit! */ @@ -86,7 +89,7 @@ void R_DrawTiltedSpan_NPO2_8(void) // Lighting is simple. It's just linear interpolation from start to end { - float planelightfloat = BASEVIDWIDTH*BASEVIDWIDTH/vid.width / (zeroheight - FIXED_TO_FLOAT(viewz)) / 21.0f; + float planelightfloat = PLANELIGHTFLOAT; float lightstart, lightend; lightend = (iz + ds_szp->x*width) * planelightfloat; @@ -282,7 +285,7 @@ void R_DrawTiltedTranslucentSpan_NPO2_8(void) // Lighting is simple. It's just linear interpolation from start to end { - float planelightfloat = BASEVIDWIDTH*BASEVIDWIDTH/vid.width / (zeroheight - FIXED_TO_FLOAT(viewz)) / 21.0f; + float planelightfloat = PLANELIGHTFLOAT; float lightstart, lightend; lightend = (iz + ds_szp->x*width) * planelightfloat; @@ -476,7 +479,7 @@ void R_DrawTiltedSplat_NPO2_8(void) // Lighting is simple. It's just linear interpolation from start to end { - float planelightfloat = BASEVIDWIDTH*BASEVIDWIDTH/vid.width / (zeroheight - FIXED_TO_FLOAT(viewz)) / 21.0f; + float planelightfloat = PLANELIGHTFLOAT; float lightstart, lightend; lightend = (iz + ds_szp->x*width) * planelightfloat; @@ -869,7 +872,7 @@ void R_DrawTiltedTranslucentWaterSpan_NPO2_8(void) // Lighting is simple. It's just linear interpolation from start to end { - float planelightfloat = BASEVIDWIDTH*BASEVIDWIDTH/vid.width / (zeroheight - FIXED_TO_FLOAT(viewz)) / 21.0f; + float planelightfloat = PLANELIGHTFLOAT; float lightstart, lightend; lightend = (iz + ds_szp->x*width) * planelightfloat; diff --git a/src/r_local.h b/src/r_local.h index 379d55205..48044118d 100644 --- a/src/r_local.h +++ b/src/r_local.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/r_main.c b/src/r_main.c index 40025c5b0..a881e046d 100644 --- a/src/r_main.c +++ b/src/r_main.c @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. @@ -548,6 +548,303 @@ static inline void R_InitLightTables(void) } } +//#define WOUGHMP_WOUGHMP // I got a fish-eye lens - I'll make a rap video with a couple of friends +// it's kinda laggy sometimes + +static struct { + angle_t rollangle; // pre-shifted by fineshift +#ifdef WOUGHMP_WOUGHMP + fixed_t fisheye; +#endif + + fixed_t zoomneeded; + INT32 *scrmap; + INT32 scrmapsize; + + INT32 x1; // clip rendering horizontally for efficiency + INT16 ceilingclip[MAXVIDWIDTH], floorclip[MAXVIDWIDTH]; + + boolean use; +} viewmorph = { + 0, +#ifdef WOUGHMP_WOUGHMP + 0, +#endif + + FRACUNIT, + NULL, + 0, + + 0, + {}, {}, + + false +}; + +void R_CheckViewMorph(void) +{ + float zoomfactor, rollcos, rollsin; + float x1, y1, x2, y2; + fixed_t temp; + INT32 end, vx, vy, pos, usedpos; + INT32 usedx, usedy, halfwidth = vid.width/2, halfheight = vid.height/2; +#ifdef WOUGHMP_WOUGHMP + float fisheyemap[MAXVIDWIDTH/2 + 1]; +#endif + + angle_t rollangle = players[displayplayer].viewrollangle; +#ifdef WOUGHMP_WOUGHMP + fixed_t fisheye = cv_cam2_turnmultiplier.value; // temporary test value +#endif + + rollangle >>= ANGLETOFINESHIFT; + rollangle = ((rollangle+2) & ~3) & FINEMASK; // Limit the distinct number of angles to reduce recalcs from angles changing a lot. + +#ifdef WOUGHMP_WOUGHMP + fisheye &= ~0x7FF; // Same +#endif + + if (rollangle == viewmorph.rollangle && +#ifdef WOUGHMP_WOUGHMP + fisheye == viewmorph.fisheye && +#endif + viewmorph.scrmapsize == vid.width*vid.height) + return; // No change + + viewmorph.rollangle = rollangle; +#ifdef WOUGHMP_WOUGHMP + viewmorph.fisheye = fisheye; +#endif + + if (viewmorph.rollangle == 0 +#ifdef WOUGHMP_WOUGHMP + && viewmorph.fisheye == 0 +#endif + ) + { + viewmorph.use = false; + viewmorph.x1 = 0; + if (viewmorph.zoomneeded != FRACUNIT) + R_SetViewSize(); + viewmorph.zoomneeded = FRACUNIT; + + return; + } + + if (viewmorph.scrmapsize != vid.width*vid.height) + { + if (viewmorph.scrmap) + free(viewmorph.scrmap); + viewmorph.scrmap = malloc(vid.width*vid.height * sizeof(INT32)); + viewmorph.scrmapsize = vid.width*vid.height; + } + + temp = FINECOSINE(rollangle); + rollcos = FIXED_TO_FLOAT(temp); + temp = FINESINE(rollangle); + rollsin = FIXED_TO_FLOAT(temp); + + // Calculate maximum zoom needed + x1 = (vid.width*fabsf(rollcos) + vid.height*fabsf(rollsin)) / vid.width; + y1 = (vid.height*fabsf(rollcos) + vid.width*fabsf(rollsin)) / vid.height; + +#ifdef WOUGHMP_WOUGHMP + if (fisheye) + { + float f = FIXED_TO_FLOAT(fisheye); + for (vx = 0; vx <= halfwidth; vx++) + fisheyemap[vx] = 1.0f / cos(atan(vx * f / halfwidth)); + + f = cos(atan(f)); + if (f < 1.0f) + { + x1 /= f; + y1 /= f; + } + } +#endif + + temp = max(x1, y1)*FRACUNIT; + if (temp < FRACUNIT) + temp = FRACUNIT; + else + temp |= 0x3FFF; // Limit how many times the viewport needs to be recalculated + + //CONS_Printf("Setting zoom to %f\n", FIXED_TO_FLOAT(temp)); + + if (temp != viewmorph.zoomneeded) + { + viewmorph.zoomneeded = temp; + R_SetViewSize(); + } + + zoomfactor = FIXED_TO_FLOAT(viewmorph.zoomneeded); + + end = vid.width * vid.height - 1; + + pos = 0; + + // Pre-multiply rollcos and rollsin to use for positional stuff + rollcos /= zoomfactor; + rollsin /= zoomfactor; + + x1 = -(halfwidth * rollcos - halfheight * rollsin); + y1 = -(halfheight * rollcos + halfwidth * rollsin); + +#ifdef WOUGHMP_WOUGHMP + if (fisheye) + viewmorph.x1 = (INT32)(halfwidth - (halfwidth * fabsf(rollcos) + halfheight * fabsf(rollsin)) * fisheyemap[halfwidth]); + else +#endif + viewmorph.x1 = (INT32)(halfwidth - (halfwidth * fabsf(rollcos) + halfheight * fabsf(rollsin))); + //CONS_Printf("saving %d cols\n", viewmorph.x1); + + // Set ceilingclip and floorclip + for (vx = 0; vx < vid.width; vx++) + { + viewmorph.ceilingclip[vx] = vid.height; + viewmorph.floorclip[vx] = -1; + } + x2 = x1; + y2 = y1; + for (vx = 0; vx < vid.width; vx++) + { + INT16 xa, ya, xb, yb; + xa = x2+halfwidth; + ya = y2+halfheight-1; + xb = vid.width-1-xa; + yb = vid.height-1-ya; + + viewmorph.ceilingclip[xa] = min(viewmorph.ceilingclip[xa], ya); + viewmorph.floorclip[xa] = max(viewmorph.floorclip[xa], ya); + viewmorph.ceilingclip[xb] = min(viewmorph.ceilingclip[xb], yb); + viewmorph.floorclip[xb] = max(viewmorph.floorclip[xb], yb); + x2 += rollcos; + y2 += rollsin; + } + x2 = x1; + y2 = y1; + for (vy = 0; vy < vid.height; vy++) + { + INT16 xa, ya, xb, yb; + xa = x2+halfwidth; + ya = y2+halfheight; + xb = vid.width-1-xa; + yb = vid.height-1-ya; + + viewmorph.ceilingclip[xa] = min(viewmorph.ceilingclip[xa], ya); + viewmorph.floorclip[xa] = max(viewmorph.floorclip[xa], ya); + viewmorph.ceilingclip[xb] = min(viewmorph.ceilingclip[xb], yb); + viewmorph.floorclip[xb] = max(viewmorph.floorclip[xb], yb); + x2 -= rollsin; + y2 += rollcos; + } + + //CONS_Printf("Top left corner is %f %f\n", x1, y1); + +#ifdef WOUGHMP_WOUGHMP + if (fisheye) + { + for (vy = 0; vy < halfheight; vy++) + { + x2 = x1; + y2 = y1; + x1 -= rollsin; + y1 += rollcos; + + for (vx = 0; vx < vid.width; vx++) + { + usedx = halfwidth + x2*fisheyemap[(int) floorf(fabsf(y2*zoomfactor))]; + usedy = halfheight + y2*fisheyemap[(int) floorf(fabsf(x2*zoomfactor))]; + + usedpos = usedx + usedy*vid.width; + + viewmorph.scrmap[pos] = usedpos; + viewmorph.scrmap[end-pos] = end-usedpos; + + x2 += rollcos; + y2 += rollsin; + pos++; + } + } + } + else + { +#endif + x1 += halfwidth; + y1 += halfheight; + + for (vy = 0; vy < halfheight; vy++) + { + x2 = x1; + y2 = y1; + x1 -= rollsin; + y1 += rollcos; + + for (vx = 0; vx < vid.width; vx++) + { + usedx = x2; + usedy = y2; + + usedpos = usedx + usedy*vid.width; + + viewmorph.scrmap[pos] = usedpos; + viewmorph.scrmap[end-pos] = end-usedpos; + + x2 += rollcos; + y2 += rollsin; + pos++; + } + } +#ifdef WOUGHMP_WOUGHMP + } +#endif + + viewmorph.use = true; +} + +void R_ApplyViewMorph(void) +{ + UINT8 *tmpscr = screens[4]; + UINT8 *srcscr = screens[0]; + INT32 p, end = vid.width * vid.height; + + if (!viewmorph.use) + return; + + if (cv_debug & DBG_VIEWMORPH) + { + UINT8 border = 32; + UINT8 grid = 160; + INT32 ws = vid.width / 4; + INT32 hs = vid.width * (vid.height / 4); + + memcpy(tmpscr, srcscr, vid.width*vid.height); + for (p = 0; p < vid.width; p++) + { + tmpscr[viewmorph.scrmap[p]] = border; + tmpscr[viewmorph.scrmap[p + hs]] = grid; + tmpscr[viewmorph.scrmap[p + hs*2]] = grid; + tmpscr[viewmorph.scrmap[p + hs*3]] = grid; + tmpscr[viewmorph.scrmap[end - 1 - p]] = border; + } + for (p = vid.width; p < end; p += vid.width) + { + tmpscr[viewmorph.scrmap[p]] = border; + tmpscr[viewmorph.scrmap[p + ws]] = grid; + tmpscr[viewmorph.scrmap[p + ws*2]] = grid; + tmpscr[viewmorph.scrmap[p + ws*3]] = grid; + tmpscr[viewmorph.scrmap[end - 1 - p]] = border; + } + } + else + for (p = 0; p < end; p++) + tmpscr[p] = srcscr[viewmorph.scrmap[p]]; + + VID_BlitLinearScreen(tmpscr, screens[0], + vid.width*vid.bpp, vid.height, vid.width*vid.bpp, vid.width); +} + // // R_SetViewSize @@ -596,7 +893,7 @@ void R_ExecuteSetViewSize(void) centeryfrac = centery<> ANGLETOFINESHIFT); + fovtan = FixedMul(FINETANGENT(fov >> ANGLETOFINESHIFT), viewmorph.zoomneeded); if (splitscreen == 1) // Splitscreen FOV should be adjusted to maintain expected vertical view fovtan = 17*fovtan/10; @@ -1114,9 +1411,22 @@ void R_RenderPlayerView(player_t *player) validcount++; // Clear buffers. - R_ClearClipSegs(); - R_ClearDrawSegs(); R_ClearPlanes(); + if (viewmorph.use) + { + portalclipstart = viewmorph.x1; + portalclipend = viewwidth-viewmorph.x1-1; + R_PortalClearClipSegs(portalclipstart, portalclipend); + memcpy(ceilingclip, viewmorph.ceilingclip, sizeof(INT16)*vid.width); + memcpy(floorclip, viewmorph.floorclip, sizeof(INT16)*vid.width); + } + else + { + portalclipstart = 0; + portalclipend = viewwidth-1; + R_ClearClipSegs(); + } + R_ClearDrawSegs(); R_ClearSprites(); #ifdef FLOORSPLATS R_ClearVisibleFloorSplats(); diff --git a/src/r_main.h b/src/r_main.h index 52bff4140..578eb3d54 100644 --- a/src/r_main.h +++ b/src/r_main.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. @@ -49,6 +49,8 @@ extern size_t validcount, linecount, loopcount, framecount; #define MAXLIGHTZ 128 #define LIGHTZSHIFT 20 +#define LIGHTRESOLUTIONFIX (640*fovtan/vid.width) + extern lighttable_t *scalelight[LIGHTLEVELS][MAXLIGHTSCALE]; extern lighttable_t *scalelightfixed[MAXLIGHTSCALE]; extern lighttable_t *zlight[LIGHTLEVELS][MAXLIGHTZ]; @@ -95,6 +97,9 @@ void R_InitHardwareMode(void); #endif void R_ReloadHUDGraphics(void); +void R_CheckViewMorph(void); +void R_ApplyViewMorph(void); + // just sets setsizeneeded true extern boolean setsizeneeded; void R_SetViewSize(void); diff --git a/src/r_patch.c b/src/r_patch.c index 4304f3eab..9e31d4d19 100644 --- a/src/r_patch.c +++ b/src/r_patch.c @@ -1212,15 +1212,17 @@ void R_CacheRotSprite(spritenum_t sprnum, UINT8 frame, spriteinfo_t *sprinfo, sp INT32 width, height, leftoffset; fixed_t ca, sa; lumpnum_t lump = sprframe->lumppat[rot]; +#ifndef NO_PNG_LUMPS size_t lumplength; +#endif if (lump == LUMPERROR) return; patch = (patch_t *)W_CacheLumpNum(lump, PU_STATIC); +#ifndef NO_PNG_LUMPS lumplength = W_LumpLength(lump); -#ifndef NO_PNG_LUMPS if (R_IsLumpPNG((UINT8 *)patch, lumplength)) patch = R_PNGToPatch((UINT8 *)patch, lumplength, NULL); else diff --git a/src/r_patch.h b/src/r_patch.h index e743a7d09..a2db6320c 100644 --- a/src/r_patch.h +++ b/src/r_patch.h @@ -1,8 +1,8 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. -// Copyright (C) 2018-2019 by Jaime "Lactozilla" Passos. -// Copyright (C) 2019 by Sonic Team Junior. +// Copyright (C) 2018-2020 by Jaime "Lactozilla" Passos. +// Copyright (C) 2019-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/r_plane.c b/src/r_plane.c index 5d5e1f20d..e1e45517a 100644 --- a/src/r_plane.c +++ b/src/r_plane.c @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. @@ -44,9 +44,6 @@ // Quincunx antialiasing of flats! //#define QUINCUNX -// good night sweet prince -#define SHITPLANESPARENCY - //SoM: 3/23/2000: Use Boom visplane hashing. visplane_t *visplanes[MAXVISPLANES]; @@ -995,11 +992,7 @@ void R_DrawSinglePlane(visplane_t *pl) else // Opaque, but allow transparent flat pixels spanfunctype = SPANDRAWFUNC_SPLAT; -#ifdef SHITPLANESPARENCY - if ((spanfunctype == SPANDRAWFUNC_SPLAT) != (pl->extra_colormap && (pl->extra_colormap->fog & 4))) -#else - if (!pl->extra_colormap || !(pl->extra_colormap->fog & 2)) -#endif + if ((spanfunctype == SPANDRAWFUNC_SPLAT) || (pl->extra_colormap && (pl->extra_colormap->flags & CMF_FOG))) light = (pl->lightlevel >> LIGHTSEGSHIFT); else light = LIGHTLEVELS-1; @@ -1053,11 +1046,7 @@ void R_DrawSinglePlane(visplane_t *pl) else // Opaque, but allow transparent flat pixels spanfunctype = SPANDRAWFUNC_SPLAT; -#ifdef SHITPLANESPARENCY - if ((spanfunctype == SPANDRAWFUNC_SPLAT) != (pl->extra_colormap && (pl->extra_colormap->fog & 4))) -#else - if (!pl->extra_colormap || !(pl->extra_colormap->fog & 2)) -#endif + if ((spanfunctype == SPANDRAWFUNC_SPLAT) || (pl->extra_colormap && (pl->extra_colormap->flags & CMF_FOG))) light = (pl->lightlevel >> LIGHTSEGSHIFT); else light = LIGHTLEVELS-1; diff --git a/src/r_plane.h b/src/r_plane.h index d9ba5c56b..405dd9726 100644 --- a/src/r_plane.h +++ b/src/r_plane.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/r_portal.c b/src/r_portal.c index 576b606ec..1aca145ec 100644 --- a/src/r_portal.c +++ b/src/r_portal.c @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/r_portal.h b/src/r_portal.h index c46ddfdab..406b98d10 100644 --- a/src/r_portal.h +++ b/src/r_portal.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/r_segs.c b/src/r_segs.c index dcb5fc160..0233b1161 100644 --- a/src/r_segs.c +++ b/src/r_segs.c @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. @@ -199,7 +199,7 @@ static void R_DrawWallSplats(void) // draw the columns for (dc_x = x1; dc_x <= x2; dc_x++, spryscale += rw_scalestep) { - pindex = FixedMul(spryscale, FixedDiv(640, vid.width))>>LIGHTSCALESHIFT; + pindex = FixedMul(spryscale, LIGHTRESOLUTIONFIX)>>LIGHTSCALESHIFT; if (pindex >= MAXLIGHTSCALE) pindex = MAXLIGHTSCALE - 1; dc_colormap = walllights[pindex]; @@ -418,14 +418,14 @@ void R_RenderMaskedSegRange(drawseg_t *ds, INT32 x1, INT32 x2) rlight->extra_colormap = *light->extra_colormap; rlight->flags = light->flags; - if (rlight->flags & FF_FOG || (rlight->extra_colormap && rlight->extra_colormap->fog)) + if ((colfunc != colfuncs[COLDRAWFUNC_FUZZY]) + || (rlight->flags & FF_FOG) + || (rlight->extra_colormap && (rlight->extra_colormap->flags & CMF_FOG))) lightnum = (rlight->lightlevel >> LIGHTSEGSHIFT); - else if (colfunc == colfuncs[COLDRAWFUNC_FUZZY]) - lightnum = LIGHTLEVELS - 1; else - lightnum = (rlight->lightlevel >> LIGHTSEGSHIFT); + lightnum = LIGHTLEVELS - 1; - if (rlight->extra_colormap && rlight->extra_colormap->fog) + if (rlight->extra_colormap && (rlight->extra_colormap->flags & CMF_FOG)) ; else if (curline->v1->y == curline->v2->y) lightnum--; @@ -437,18 +437,14 @@ void R_RenderMaskedSegRange(drawseg_t *ds, INT32 x1, INT32 x2) } else { - if (colfunc == colfuncs[COLDRAWFUNC_FUZZY]) - { - if (frontsector->extra_colormap && frontsector->extra_colormap->fog) - lightnum = (frontsector->lightlevel >> LIGHTSEGSHIFT); - else - lightnum = LIGHTLEVELS - 1; - } - else + if ((colfunc != colfuncs[COLDRAWFUNC_FUZZY]) + || (frontsector->extra_colormap && (frontsector->extra_colormap->flags & CMF_FOG))) lightnum = (frontsector->lightlevel >> LIGHTSEGSHIFT); + else + lightnum = LIGHTLEVELS - 1; if (colfunc == colfuncs[COLDRAWFUNC_FOG] - || (frontsector->extra_colormap && frontsector->extra_colormap->fog)) + || (frontsector->extra_colormap && (frontsector->extra_colormap->flags & CMF_FOG))) ; else if (curline->v1->y == curline->v2->y) lightnum--; @@ -599,7 +595,7 @@ void R_RenderMaskedSegRange(drawseg_t *ds, INT32 x1, INT32 x2) else xwalllights = scalelight[rlight->lightnum]; - pindex = FixedMul(spryscale, FixedDiv(640, vid.width))>>LIGHTSCALESHIFT; + pindex = FixedMul(spryscale, LIGHTRESOLUTIONFIX)>>LIGHTSCALESHIFT; if (pindex >= MAXLIGHTSCALE) pindex = MAXLIGHTSCALE - 1; @@ -644,7 +640,7 @@ void R_RenderMaskedSegRange(drawseg_t *ds, INT32 x1, INT32 x2) } // calculate lighting - pindex = FixedMul(spryscale, FixedDiv(640, vid.width))>>LIGHTSCALESHIFT; + pindex = FixedMul(spryscale, LIGHTRESOLUTIONFIX)>>LIGHTSCALESHIFT; if (pindex >= MAXLIGHTSCALE) pindex = MAXLIGHTSCALE - 1; @@ -947,7 +943,7 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor) else rlight->lightnum = (rlight->lightlevel >> LIGHTSEGSHIFT); - if (pfloor->flags & FF_FOG || rlight->flags & FF_FOG || (rlight->extra_colormap && rlight->extra_colormap->fog)) + if (pfloor->flags & FF_FOG || rlight->flags & FF_FOG || (rlight->extra_colormap && (rlight->extra_colormap->flags & CMF_FOG))) ; else if (curline->v1->y == curline->v2->y) rlight->lightnum--; @@ -962,7 +958,7 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor) else { // Get correct light level! - if ((frontsector->extra_colormap && frontsector->extra_colormap->fog)) + if ((frontsector->extra_colormap && (frontsector->extra_colormap->flags & CMF_FOG))) lightnum = (frontsector->lightlevel >> LIGHTSEGSHIFT); else if (pfloor->flags & FF_FOG) lightnum = (pfloor->master->frontsector->lightlevel >> LIGHTSEGSHIFT); @@ -972,7 +968,7 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor) lightnum = R_FakeFlat(frontsector, &tempsec, &templight, &templight, false) ->lightlevel >> LIGHTSEGSHIFT; - if (pfloor->flags & FF_FOG || (frontsector->extra_colormap && frontsector->extra_colormap->fog)); + if (pfloor->flags & FF_FOG || (frontsector->extra_colormap && (frontsector->extra_colormap->flags & CMF_FOG))); else if (curline->v1->y == curline->v2->y) lightnum--; else if (curline->v1->x == curline->v2->x) @@ -1188,7 +1184,7 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor) else xwalllights = scalelight[lightnum]; - pindex = FixedMul(spryscale, FixedDiv(640, vid.width))>>LIGHTSCALESHIFT; + pindex = FixedMul(spryscale, LIGHTRESOLUTIONFIX)>>LIGHTSCALESHIFT; if (pindex >= MAXLIGHTSCALE) pindex = MAXLIGHTSCALE-1; @@ -1281,7 +1277,7 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor) } // calculate lighting - pindex = FixedMul(spryscale, FixedDiv(640, vid.width))>>LIGHTSCALESHIFT; + pindex = FixedMul(spryscale, LIGHTRESOLUTIONFIX)>>LIGHTSCALESHIFT; if (pindex >= MAXLIGHTSCALE) pindex = MAXLIGHTSCALE - 1; @@ -1486,7 +1482,7 @@ static void R_RenderSegLoop (void) if (segtextured) { // calculate lighting - pindex = FixedMul(rw_scale, FixedDiv(640, vid.width))>>LIGHTSCALESHIFT; + pindex = FixedMul(rw_scale, LIGHTRESOLUTIONFIX)>>LIGHTSCALESHIFT; if (pindex >= MAXLIGHTSCALE) pindex = MAXLIGHTSCALE-1; @@ -1521,7 +1517,7 @@ static void R_RenderSegLoop (void) else xwalllights = scalelight[lightnum]; - pindex = FixedMul(rw_scale, FixedDiv(640, vid.width))>>LIGHTSCALESHIFT; + pindex = FixedMul(rw_scale, LIGHTRESOLUTIONFIX)>>LIGHTSCALESHIFT; if (pindex >= MAXLIGHTSCALE) pindex = MAXLIGHTSCALE-1; diff --git a/src/r_segs.h b/src/r_segs.h index 1c852ddc7..a61f1f921 100644 --- a/src/r_segs.h +++ b/src/r_segs.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/r_sky.c b/src/r_sky.c index c9d28cebc..7cdcfa44d 100644 --- a/src/r_sky.c +++ b/src/r_sky.c @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. @@ -76,5 +76,5 @@ void R_SetupSkyDraw(void) void R_SetSkyScale(void) { fixed_t difference = vid.fdupx-(vid.dupx<extra_colormap = *sector->lightlist[i].extra_colormap; - if (!((newsprite->cut & SC_FULLBRIGHT) - && (!newsprite->extra_colormap || !(newsprite->extra_colormap->fog & 1)))) + if (!(newsprite->cut & SC_FULLBRIGHT) + || (newsprite->extra_colormap && (newsprite->extra_colormap->flags & CMF_FADEFULLBRIGHTSPRITES))) { - lindex = FixedMul(sprite->xscale, FixedDiv(640, vid.width))>>(LIGHTSCALESHIFT); + lindex = FixedMul(sprite->xscale, LIGHTRESOLUTIONFIX)>>(LIGHTSCALESHIFT); if (lindex >= MAXLIGHTSCALE) lindex = MAXLIGHTSCALE-1; @@ -1307,17 +1307,8 @@ static void R_ProjectDropShadow(mobj_t *thing, vissprite_t *vis, fixed_t scale, shadow->mobj = thing; // Easy access! Tails 06-07-2002 - shadow->x1 = x1 < 0 ? 0 : x1; - shadow->x2 = x2 >= viewwidth ? viewwidth-1 : x2; - - // PORTAL SEMI-CLIPPING - if (portalrender) - { - if (shadow->x1 < portalclipstart) - shadow->x1 = portalclipstart; - if (shadow->x2 >= portalclipend) - shadow->x2 = portalclipend-1; - } + shadow->x1 = x1 < portalclipstart ? portalclipstart : x1; + shadow->x2 = x2 >= portalclipend ? portalclipend-1 : x2; shadow->xscale = FixedMul(xscale, shadowxscale); //SoM: 4/17/2000 shadow->scale = FixedMul(yscale, shadowyscale); @@ -1815,17 +1806,8 @@ static void R_ProjectSprite(mobj_t *thing) vis->mobj = thing; // Easy access! Tails 06-07-2002 - vis->x1 = x1 < 0 ? 0 : x1; - vis->x2 = x2 >= viewwidth ? viewwidth-1 : x2; - - // PORTAL SEMI-CLIPPING - if (portalrender) - { - if (vis->x1 < portalclipstart) - vis->x1 = portalclipstart; - if (vis->x2 >= portalclipend) - vis->x2 = portalclipend-1; - } + vis->x1 = x1 < portalclipstart ? portalclipstart : x1; + vis->x2 = x2 >= portalclipend ? portalclipend-1 : x2; vis->xscale = xscale; //SoM: 4/17/2000 vis->sector = thing->subsector->sector; @@ -1882,7 +1864,7 @@ static void R_ProjectSprite(mobj_t *thing) vis->cut |= SC_FULLBRIGHT; if (vis->cut & SC_FULLBRIGHT - && (!vis->extra_colormap || !(vis->extra_colormap->fog & 1))) + && (!vis->extra_colormap || !(vis->extra_colormap->flags & CMF_FADEFULLBRIGHTSPRITES))) { // full bright: goggles vis->colormap = colormaps; @@ -1890,7 +1872,7 @@ static void R_ProjectSprite(mobj_t *thing) else { // diminished light - lindex = FixedMul(xscale, FixedDiv(640, vid.width))>>(LIGHTSCALESHIFT); + lindex = FixedMul(xscale, LIGHTRESOLUTIONFIX)>>(LIGHTSCALESHIFT); if (lindex >= MAXLIGHTSCALE) lindex = MAXLIGHTSCALE-1; @@ -2034,17 +2016,8 @@ static void R_ProjectPrecipitationSprite(precipmobj_t *thing) vis->shear.tan = 0; vis->shear.offset = 0; - vis->x1 = x1 < 0 ? 0 : x1; - vis->x2 = x2 >= viewwidth ? viewwidth-1 : x2; - - // PORTAL SEMI-CLIPPING - if (portalrender) - { - if (vis->x1 < portalclipstart) - vis->x1 = portalclipstart; - if (vis->x2 >= portalclipend) - vis->x2 = portalclipend-1; - } + vis->x1 = x1 < portalclipstart ? portalclipstart : x1; + vis->x2 = x2 >= portalclipend ? portalclipend-1 : x2; vis->xscale = xscale; //SoM: 4/17/2000 vis->sector = thing->subsector->sector; diff --git a/src/r_things.h b/src/r_things.h index 217179148..bd6271b60 100644 --- a/src/r_things.h +++ b/src/r_things.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/s_sound.c b/src/s_sound.c index d84e20ab4..8193fdb9b 100644 --- a/src/s_sound.c +++ b/src/s_sound.c @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/s_sound.h b/src/s_sound.h index 9a4cbe48b..d7e0c46ab 100644 --- a/src/s_sound.h +++ b/src/s_sound.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/screen.c b/src/screen.c index b5faaef7e..7ebe34635 100644 --- a/src/screen.c +++ b/src/screen.c @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. @@ -450,6 +450,20 @@ static int target_renderer = 0; void SCR_ActuallyChangeRenderer(void) { setrenderneeded = target_renderer; + +#ifdef HWRENDER + // Well, it didn't even load anyway. + if ((hwrenderloaded == -1) && (setrenderneeded == render_opengl)) + { + if (M_CheckParm("-nogl")) + CONS_Alert(CONS_ERROR, "OpenGL rendering was disabled!\n"); + else + CONS_Alert(CONS_ERROR, "OpenGL never loaded\n"); + setrenderneeded = 0; + return; + } +#endif + // setting the same renderer twice WILL crash your game, so let's not, please if (rendermode == setrenderneeded) setrenderneeded = 0; @@ -464,7 +478,7 @@ void SCR_ChangeRenderer(void) { target_renderer = cv_renderer.value; #ifdef HWRENDER - if (M_CheckParm("-opengl") && hwrenderloaded) + if (M_CheckParm("-opengl") && (hwrenderloaded == 1)) target_renderer = rendermode = render_opengl; else #endif diff --git a/src/screen.h b/src/screen.h index 02b336f75..717ce9adc 100644 --- a/src/screen.h +++ b/src/screen.h @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/sdl/i_system.c b/src/sdl/i_system.c index 81420e757..a86af316e 100644 --- a/src/sdl/i_system.c +++ b/src/sdl/i_system.c @@ -5,7 +5,7 @@ // // Copyright (C) 1993-1996 by id Software, Inc. // Portions Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 2014-2019 by Sonic Team Junior. +// Copyright (C) 2014-2020 by Sonic Team Junior. // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License diff --git a/src/sdl/i_video.c b/src/sdl/i_video.c index 9615a109a..1af4cbf73 100644 --- a/src/sdl/i_video.c +++ b/src/sdl/i_video.c @@ -4,7 +4,7 @@ // // Copyright (C) 1993-1996 by id Software, Inc. // Portions Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 2014-2019 by Sonic Team Junior. +// Copyright (C) 2014-2020 by Sonic Team Junior. // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License @@ -104,7 +104,7 @@ static consvar_t cv_stretch = {"stretch", "Off", CV_SAVE|CV_NOSHOWHELP, CV_OnOff static consvar_t cv_alwaysgrabmouse = {"alwaysgrabmouse", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; UINT8 graphics_started = 0; // Is used in console.c and screen.c -boolean hwrenderloaded = false; +INT32 hwrenderloaded = 0; // To disable fullscreen at startup; is set in VID_PrepareModeList boolean allow_fullscreen = false; @@ -176,7 +176,7 @@ static SDL_bool Impl_CreateWindow(SDL_bool fullscreen); //static void Impl_SetWindowName(const char *title); static void Impl_SetWindowIcon(void); -static void SDLSetMode(INT32 width, INT32 height, SDL_bool fullscreen) +static void SDLSetMode(INT32 width, INT32 height, SDL_bool fullscreen, SDL_bool reposition) { static SDL_bool wasfullscreen = SDL_FALSE; Uint32 rmask; @@ -205,10 +205,13 @@ static void SDLSetMode(INT32 width, INT32 height, SDL_bool fullscreen) } // Reposition window only in windowed mode SDL_SetWindowSize(window, width, height); - SDL_SetWindowPosition(window, - SDL_WINDOWPOS_CENTERED_DISPLAY(SDL_GetWindowDisplayIndex(window)), - SDL_WINDOWPOS_CENTERED_DISPLAY(SDL_GetWindowDisplayIndex(window)) - ); + if (reposition) + { + SDL_SetWindowPosition(window, + SDL_WINDOWPOS_CENTERED_DISPLAY(SDL_GetWindowDisplayIndex(window)), + SDL_WINDOWPOS_CENTERED_DISPLAY(SDL_GetWindowDisplayIndex(window)) + ); + } } } else @@ -1433,7 +1436,7 @@ static SDL_bool Impl_CreateContext(void) { // Renderer-specific stuff #ifdef HWRENDER - if (rendermode == render_opengl) + if ((rendermode == render_opengl) && (hwrenderloaded != -1)) { if (!sdlglcontext) sdlglcontext = SDL_GL_CreateContext(window); @@ -1469,7 +1472,7 @@ static SDL_bool Impl_CreateContext(void) #ifdef HWRENDER static void VID_CheckGLLoaded(rendermode_t oldrender) { - if (!hwrenderloaded) // Well, it didn't work the first time anyway. + if (hwrenderloaded == -1) // Well, it didn't work the first time anyway. { CONS_Alert(CONS_ERROR, "OpenGL never loaded\n"); rendermode = oldrender; @@ -1487,6 +1490,7 @@ static void VID_CheckGLLoaded(rendermode_t oldrender) void VID_CheckRenderer(void) { + SDL_bool rendererchanged = SDL_FALSE; rendermode_t oldrenderer = rendermode; if (dedicated) @@ -1500,14 +1504,24 @@ void VID_CheckRenderer(void) if (setrenderneeded) { rendermode = setrenderneeded; + rendererchanged = SDL_TRUE; + #ifdef HWRENDER - if (setrenderneeded == render_opengl) + if (rendermode == render_opengl) + { VID_CheckGLLoaded(oldrenderer); + // Initialise OpenGL before calling SDLSetMode!!! + if (hwrenderloaded != 1) + I_StartupHardwareGraphics(); + else if (hwrenderloaded == -1) + rendererchanged = SDL_FALSE; + } #endif + Impl_CreateContext(); } - SDLSetMode(vid.width, vid.height, USE_FULLSCREEN); + SDLSetMode(vid.width, vid.height, USE_FULLSCREEN, (rendererchanged ? SDL_FALSE : SDL_TRUE)); Impl_VideoSetupBuffer(); if (rendermode == render_soft) @@ -1518,16 +1532,14 @@ void VID_CheckRenderer(void) bufSurface = NULL; } #ifdef HWRENDER - HWR_FreeTextureCache(); + if (hwrenderloaded == 1) // Only if OpenGL ever loaded! + HWR_FreeTextureCache(); #endif SCR_SetDrawFuncs(); } #ifdef HWRENDER else if (rendermode == render_opengl) - { - I_StartupHardwareGraphics(); R_InitHardwareMode(); - } #else (void)oldrenderer; #endif @@ -1571,7 +1583,8 @@ static SDL_bool Impl_CreateWindow(SDL_bool fullscreen) flags |= SDL_WINDOW_BORDERLESS; #ifdef HWRENDER - flags |= SDL_WINDOW_OPENGL; + if (hwrenderloaded != -1) + flags |= SDL_WINDOW_OPENGL; #endif // Create a window @@ -1705,7 +1718,10 @@ void I_StartupGraphics(void) //SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY>>1,SDL_DEFAULT_REPEAT_INTERVAL<<2); VID_Command_ModeList_f(); #ifdef HWRENDER - I_StartupHardwareGraphics(); + if (M_CheckParm("-nogl")) + hwrenderloaded = -1; // Don't call SDL_GL_LoadLibrary + else + I_StartupHardwareGraphics(); #endif // Fury: we do window initialization after GL setup to allow @@ -1808,8 +1824,6 @@ void I_StartupHardwareGraphics(void) rendermode = render_soft; setrenderneeded = 0; } - else - hwrenderloaded = true; glstartup = true; } #endif diff --git a/src/sdl/macosx/Srb2mac.xcodeproj/project.pbxproj b/src/sdl/macosx/Srb2mac.xcodeproj/project.pbxproj index 2b03cb8d4..b615bc1df 100644 --- a/src/sdl/macosx/Srb2mac.xcodeproj/project.pbxproj +++ b/src/sdl/macosx/Srb2mac.xcodeproj/project.pbxproj @@ -1219,7 +1219,7 @@ C01FCF4B08A954540054247B /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - CURRENT_PROJECT_VERSION = 2.2.1; + CURRENT_PROJECT_VERSION = 2.2.2; GCC_PREPROCESSOR_DEFINITIONS = ( "$(inherited)", NORMALSRB2, @@ -1231,7 +1231,7 @@ C01FCF4C08A954540054247B /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - CURRENT_PROJECT_VERSION = 2.2.1; + CURRENT_PROJECT_VERSION = 2.2.2; GCC_ENABLE_FIX_AND_CONTINUE = NO; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_PREPROCESSOR_DEFINITIONS = ( diff --git a/src/sdl/mixer_sound.c b/src/sdl/mixer_sound.c index b60dab14c..9a713608c 100644 --- a/src/sdl/mixer_sound.c +++ b/src/sdl/mixer_sound.c @@ -1,6 +1,6 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- -// Copyright (C) 2014-2019 by Sonic Team Junior. +// Copyright (C) 2014-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/sdl/ogl_sdl.c b/src/sdl/ogl_sdl.c index bbaaeea80..edc69b21d 100644 --- a/src/sdl/ogl_sdl.c +++ b/src/sdl/ogl_sdl.c @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 2014-2019 by Sonic Team Junior. +// Copyright (C) 2014-2020 by Sonic Team Junior. // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License diff --git a/src/sdl/ogl_sdl.h b/src/sdl/ogl_sdl.h index 88d7d0b6c..748e30bae 100644 --- a/src/sdl/ogl_sdl.h +++ b/src/sdl/ogl_sdl.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 2014-2019 by Sonic Team Junior. +// Copyright (C) 2014-2020 by Sonic Team Junior. // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License diff --git a/src/sdl/sdl_sound.c b/src/sdl/sdl_sound.c index b8991293c..86e294fb5 100644 --- a/src/sdl/sdl_sound.c +++ b/src/sdl/sdl_sound.c @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // // Copyright (C) 1993-1996 by id Software, Inc. -// Copyright (C) 2014-2019 by Sonic Team Junior. +// Copyright (C) 2014-2020 by Sonic Team Junior. // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License diff --git a/src/sdl/sdlmain.h b/src/sdl/sdlmain.h index bdafebfe9..e35506114 100644 --- a/src/sdl/sdlmain.h +++ b/src/sdl/sdlmain.h @@ -1,7 +1,7 @@ // Emacs style mode select -*- C++ -*- //----------------------------------------------------------------------------- // -// Copyright (C) 2006-2019 by Sonic Team Junior. +// Copyright (C) 2006-2020 by Sonic Team Junior. // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License diff --git a/src/sounds.c b/src/sounds.c index 720ba851e..a9d720d5c 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/sounds.h b/src/sounds.h index 039349d4f..e49dd2f3e 100644 --- a/src/sounds.h +++ b/src/sounds.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/st_stuff.c b/src/st_stuff.c index d99d564c8..4864f2af6 100644 --- a/src/st_stuff.c +++ b/src/st_stuff.c @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. @@ -128,6 +128,7 @@ static patch_t *minus5sec; static patch_t *minicaps; static patch_t *gotrflag; static patch_t *gotbflag; +static patch_t *fnshico; static boolean facefreed[MAXPLAYERS]; @@ -310,6 +311,7 @@ void ST_LoadGraphics(void) bmatcico = W_CachePatchName("BMATCICO", PU_HUDGFX); gotrflag = W_CachePatchName("GOTRFLAG", PU_HUDGFX); gotbflag = W_CachePatchName("GOTBFLAG", PU_HUDGFX); + fnshico = W_CachePatchName("FNSHICO", PU_HUDGFX); nonicon = W_CachePatchName("NONICON", PU_HUDGFX); nonicon2 = W_CachePatchName("NONICON2", PU_HUDGFX); @@ -944,7 +946,7 @@ static void ST_drawLivesArea(void) '\x16' | 0x80 | hudinfo[HUD_LIVES].f|V_PERPLAYER|V_HUDTRANS, false); else { - if (stplyr->playerstate == PST_DEAD && !(stplyr->spectator) && (livescount || stplyr->deadtimer < (TICRATE<<1))) + if (stplyr->playerstate == PST_DEAD && !(stplyr->spectator) && (livescount || stplyr->deadtimer < (TICRATE<<1)) && !(stplyr->pflags & PF_FINISHED)) livescount++; if (livescount > 99) livescount = 99; @@ -1434,7 +1436,7 @@ static void ST_drawPowerupHUD(void) UINT16 invulntime = 0; INT32 offs = hudinfo[HUD_POWERUPS].x; const UINT8 q = ((splitscreen && stplyr == &players[secondarydisplayplayer]) ? 1 : 0); - static INT32 flagoffs[2] = {0, 0}, shieldoffs[2] = {0, 0}; + static INT32 flagoffs[2] = {0, 0}, shieldoffs[2] = {0, 0}, finishoffs[2] = {0, 0}; #define ICONSEP (16+4) // matches weapon rings HUD if (F_GetPromptHideHud(hudinfo[HUD_POWERUPS].y)) @@ -1442,6 +1444,26 @@ static void ST_drawPowerupHUD(void) if (stplyr->spectator || stplyr->playerstate != PST_LIVE) return; + +// --------- +// Finish icon +// --------- + + // Let's have a power-like icon to represent finishing the level! + if (stplyr->pflags & PF_FINISHED && cv_exitmove.value) + { + finishoffs[q] = ICONSEP; + V_DrawSmallScaledPatch(offs, hudinfo[HUD_POWERUPS].y, V_PERPLAYER|hudinfo[HUD_POWERUPS].f|V_HUDTRANS, fnshico); + } + else if (finishoffs[q]) + { + if (finishoffs[q] > 1) + finishoffs[q] = 2*finishoffs[q]/3; + else + finishoffs[q] = 0; + } + + offs -= finishoffs[q]; // ------- // Shields @@ -2625,7 +2647,7 @@ static void ST_overlayDrawer(void) // Check for a valid level title // If the HUD is enabled // And, if Lua is running, if the HUD library has the stage title enabled - if (!(mapheaderinfo[gamemap-1]->levelflags & LF_NOTITLECARD) && *mapheaderinfo[gamemap-1]->lvlttl != '\0' && !(hu_showscores && (netgame || multiplayer))) + if (G_IsTitleCardAvailable() && *mapheaderinfo[gamemap-1]->lvlttl != '\0' && !(hu_showscores && (netgame || multiplayer))) { stagetitle = true; ST_preDrawTitleCard(); diff --git a/src/st_stuff.h b/src/st_stuff.h index e4b21b2b0..4ea307d2b 100644 --- a/src/st_stuff.h +++ b/src/st_stuff.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/strcasestr.c b/src/strcasestr.c index 4ff778bf1..b266278ed 100644 --- a/src/strcasestr.c +++ b/src/strcasestr.c @@ -2,7 +2,7 @@ strcasestr -- case insensitive substring searching function. */ /* -Copyright 2019 James R. +Copyright 2019-2020 James R. All rights reserved. Redistribution and use in source forms, with or without modification, is diff --git a/src/string.c b/src/string.c index dc30529cc..e430c5cc3 100644 --- a/src/string.c +++ b/src/string.c @@ -1,8 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 2006 by Graue. -// Copyright (C) 2006-2019 by Sonic Team Junior. -// Copyright (C) 2019 by James R. +// Copyright (C) 2006-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/tables.c b/src/tables.c index 72dfaf0c3..00424db22 100644 --- a/src/tables.c +++ b/src/tables.c @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/tables.h b/src/tables.h index 07e3cdf09..953d891ce 100644 --- a/src/tables.h +++ b/src/tables.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/tmap.nas b/src/tmap.nas index 79452ab8c..106f38e96 100644 --- a/src/tmap.nas +++ b/src/tmap.nas @@ -1,7 +1,7 @@ ;; SONIC ROBO BLAST 2 ;;----------------------------------------------------------------------------- ;; Copyright (C) 1998-2000 by DooM Legacy Team. -;; Copyright (C) 1999-2019 by Sonic Team Junior. +;; Copyright (C) 1999-2020 by Sonic Team Junior. ;; ;; This program is free software distributed under the ;; terms of the GNU General Public License, version 2. diff --git a/src/tmap.s b/src/tmap.s index cdd65eee3..3a4cf2e1a 100644 --- a/src/tmap.s +++ b/src/tmap.s @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/tmap_asm.s b/src/tmap_asm.s index 067318f30..3cd0f87cc 100644 --- a/src/tmap_asm.s +++ b/src/tmap_asm.s @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/tmap_mmx.nas b/src/tmap_mmx.nas index 843419c65..15b97499d 100644 --- a/src/tmap_mmx.nas +++ b/src/tmap_mmx.nas @@ -1,7 +1,7 @@ ;; SONIC ROBO BLAST 2 ;;----------------------------------------------------------------------------- ;; Copyright (C) 1998-2000 by DOSDOOM. -;; Copyright (C) 2010-2019 by Sonic Team Junior. +;; Copyright (C) 2010-2020 by Sonic Team Junior. ;; ;; This program is free software distributed under the ;; terms of the GNU General Public License, version 2. diff --git a/src/tmap_vc.nas b/src/tmap_vc.nas index 72ed9a530..49eb21a6d 100644 --- a/src/tmap_vc.nas +++ b/src/tmap_vc.nas @@ -1,7 +1,7 @@ ;; SONIC ROBO BLAST 2 ;;----------------------------------------------------------------------------- ;; Copyright (C) 1998-2000 by DooM Legacy Team. -;; Copyright (C) 1999-2019 by Sonic Team Junior. +;; Copyright (C) 1999-2020 by Sonic Team Junior. ;; ;; This program is free software distributed under the ;; terms of the GNU General Public License, version 2. diff --git a/src/v_video.c b/src/v_video.c index bda059661..aa7937237 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. @@ -2299,6 +2299,13 @@ void V_DrawSmallString(INT32 x, INT32 y, INT32 option, const char *string) } } +void V_DrawCenteredSmallString(INT32 x, INT32 y, INT32 option, const char *string) +{ + x -= V_SmallStringWidth(string, option)/2; + V_DrawSmallString(x, y, option, string); +} + + void V_DrawRightAlignedSmallString(INT32 x, INT32 y, INT32 option, const char *string) { x -= V_SmallStringWidth(string, option); @@ -2404,12 +2411,44 @@ void V_DrawThinString(INT32 x, INT32 y, INT32 option, const char *string) } } +void V_DrawCenteredThinString(INT32 x, INT32 y, INT32 option, const char *string) +{ + x -= V_ThinStringWidth(string, option)/2; + V_DrawThinString(x, y, option, string); +} + void V_DrawRightAlignedThinString(INT32 x, INT32 y, INT32 option, const char *string) { x -= V_ThinStringWidth(string, option); V_DrawThinString(x, y, option, string); } +// +// Write a string using the tny_font, 0.5x scale +// NOTE: the text is centered for screens larger than the base width +// +// Literally a wrapper. ~Golden +void V_DrawSmallThinString(INT32 x, INT32 y, INT32 option, const char *string) +{ + x <<= FRACBITS; + y <<= FRACBITS; + V_DrawSmallThinStringAtFixed((fixed_t)x, (fixed_t)y, option, string); +} + +void V_DrawCenteredSmallThinString(INT32 x, INT32 y, INT32 option, const char *string) +{ + x <<= FRACBITS; + y <<= FRACBITS; + V_DrawCenteredSmallThinStringAtFixed((fixed_t)x, (fixed_t)y, option, string); +} + +void V_DrawRightAlignedSmallThinString(INT32 x, INT32 y, INT32 option, const char *string) +{ + x <<= FRACBITS; + y <<= FRACBITS; + V_DrawRightAlignedSmallThinStringAtFixed((fixed_t)x, (fixed_t)y, option, string); +} + // Draws a string at a fixed_t location. void V_DrawStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char *string) { @@ -2511,6 +2550,360 @@ void V_DrawStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char *string) } } +void V_DrawCenteredStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char *string) +{ + x -= (V_StringWidth(string, option) / 2)<= HU_FONTSIZE || !hu_font[c]) + { + cx += (spacewidth * dupx)<width)*(dupx/4); + } + else + w = SHORT(hu_font[c]->width) * dupx / 2; + + if ((cx>>FRACBITS) > scrwidth) + break; + if ((cx>>FRACBITS)+left + w < 0) //left boundary check + { + cx += w<= HU_FONTSIZE || !tny_font[c]) + { + cx += (spacewidth * dupx)<width)*(dupx/2); + } + else + w = SHORT(tny_font[c]->width) * dupx; + + if ((cx>>FRACBITS) > scrwidth) + break; + if ((cx>>FRACBITS)+left + w < 0) //left boundary check + { + cx += w<= HU_FONTSIZE || !tny_font[c]) + { + cx += FixedMul(spacewidth, dupx); + continue; + } + + if (charwidth) + { + w = FixedMul(charwidth, dupx); + center = w/2 - SHORT(tny_font[c]->width)*(dupx/4); + } + else + w = SHORT(tny_font[c]->width) * dupx / 2; + + if (cx > scrwidth) + break; + if (cx+left + w < 0) //left boundary check + { + cx += w; + continue; + } + + colormap = V_GetStringColormap(charflags); + + V_DrawFixedPatch(cx + center, cy, FRACUNIT/2, option, tny_font[c], colormap); + + cx += w; + } +} + +void V_DrawCenteredSmallThinStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char *string) +{ + x -= V_SmallThinStringWidth(string, option)/4; + V_DrawSmallThinStringAtFixed(x, y, option, string); +} + +void V_DrawRightAlignedSmallThinStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char *string) +{ + x -= V_SmallThinStringWidth(string, option)/2; + V_DrawSmallThinStringAtFixed(x, y, option, string); +} + // Draws a tallnum. Replaces two functions in y_inter and st_stuff void V_DrawTallNum(INT32 x, INT32 y, INT32 flags, INT32 num) { @@ -3068,6 +3461,15 @@ INT32 V_ThinStringWidth(const char *string, INT32 option) return w; } +// +// Find string width from tny_font chars, 0.5x scale +// +INT32 V_SmallThinStringWidth(const char *string, INT32 option) +{ + INT32 w = V_ThinStringWidth(string, option)<