From ed9b418db786b26d09199c24849ab36654d13ab0 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 20 May 2020 19:29:25 +0200 Subject: [PATCH] - deleted a bit more unused code. # Conflicts: # source/games/duke/src/zz_config.cpp --- source/build/include/build.h | 3 ++ source/games/duke/src/actors.h | 7 ---- source/games/duke/src/config.h | 37 ------------------ source/games/duke/src/duke3d_ed.h | 1 - source/games/duke/src/zz_actors.cpp | 52 -------------------------- source/games/duke/src/zz_config.cpp | 58 ----------------------------- source/games/duke/src/zz_game.cpp | 26 ++++++++++++- 7 files changed, 28 insertions(+), 156 deletions(-) delete mode 100644 source/games/duke/src/config.h delete mode 100644 source/games/duke/src/zz_config.cpp diff --git a/source/build/include/build.h b/source/build/include/build.h index fd28d686f..c437d0b5b 100644 --- a/source/build/include/build.h +++ b/source/build/include/build.h @@ -1319,6 +1319,9 @@ extern int32_t rintersect(int32_t x1, int32_t y1, int32_t z1, int32_t x3, int32_t y3, int32_t x4, int32_t y4, int32_t *intx, int32_t *inty, int32_t *intz); +void markTileForPrecache(int tilenum, int palnum); +void precacheMarkedTiles(); + extern int32_t(*animateoffs_replace)(int const tilenum, int fakevar); extern void(*paletteLoadFromDisk_replace)(void); extern int32_t(*getpalookup_replace)(int32_t davis, int32_t dashade); diff --git a/source/games/duke/src/actors.h b/source/games/duke/src/actors.h index 68af275d7..1d6e99cfd 100644 --- a/source/games/duke/src/actors.h +++ b/source/games/duke/src/actors.h @@ -233,7 +233,6 @@ enum sflags_t extern ActorInfo actorinfo[MAXTILES]; extern actor_t actor[MAXSPRITES]; extern actor_t* hittype; -extern int32_t block_deletesprite; extern int32_t g_noEnemies; #define actor_tog g_noEnemies extern int32_t otherp; @@ -247,15 +246,10 @@ inline int LocateTheLocator(int const tag, int const sectNum) } int A_IncurDamage(int spriteNum); -void A_AddToDeleteQueue(int spriteNum); void A_DeleteSprite(int spriteNum); -void A_DoGuts(int spriteNum, int tileNum, int spawnCnt); -void A_DoGutsDir(int spriteNum, int tileNum, int spawnCnt); void movecyclers(void); void movedummyplayers(void); -void A_MoveSector(int spriteNum); -void A_SpawnMultiple(int spriteNum, int tileNum, int spawnCnt); void resetlanepics(void); int G_SetInterpolation(int32_t *posptr); @@ -282,7 +276,6 @@ static FORCE_INLINE void setsectinterpolate(int sectnum) { Sect_ToggleInterpol # define ACTOR_INLINE_HEADER EXTERN_INLINE_HEADER #endif -extern int32_t A_MoveSprite(int32_t spritenum, vec3_t const * change, uint32_t cliptype); ACTOR_INLINE_HEADER int A_CheckEnemyTile(int tileNum); ACTOR_INLINE_HEADER int A_SetSprite(int spriteNum, uint32_t cliptype); diff --git a/source/games/duke/src/config.h b/source/games/duke/src/config.h deleted file mode 100644 index c7f20de6c..000000000 --- a/source/games/duke/src/config.h +++ /dev/null @@ -1,37 +0,0 @@ -//------------------------------------------------------------------------- -/* -Copyright (C) 2010 EDuke32 developers and contributors - -This file is part of EDuke32. - -EDuke32 is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License version 2 -as published by the Free Software Foundation. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -See the GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ -//------------------------------------------------------------------------- - -#ifndef config_public_h_ -#define config_public_h_ - -#include "gamecontrol.h" - -BEGIN_DUKE_NS - -#define SETUPNAMEPARM "SETUPFILE" - -int32_t CONFIG_ReadSetup( void ); -void CONFIG_GetSetupFilename( void ); - -END_DUKE_NS - -#endif diff --git a/source/games/duke/src/duke3d_ed.h b/source/games/duke/src/duke3d_ed.h index 299e37a5d..ad6d32339 100644 --- a/source/games/duke/src/duke3d_ed.h +++ b/source/games/duke/src/duke3d_ed.h @@ -108,7 +108,6 @@ END_DUKE_NS #include "actors.h" #include "common_game.h" -#include "config.h" #include "gamecontrol.h" #include "game.h" #include "gamedef.h" diff --git a/source/games/duke/src/zz_actors.cpp b/source/games/duke/src/zz_actors.cpp index d5d988203..174626c30 100644 --- a/source/games/duke/src/zz_actors.cpp +++ b/source/games/duke/src/zz_actors.cpp @@ -50,24 +50,9 @@ void G_ClearCameraView(DukePlayer_t *ps) sprite[k].yvel = 0; } -int32_t A_MoveSprite(int32_t spriteNum, vec3_t const * const change, uint32_t clipType) -{ - - return fi.movesprite(spriteNum, change->x, change->y, change->z, clipType); -} - -int32_t block_deletesprite = 0; - - // deletesprite() game wrapper void A_DeleteSprite(int spriteNum) { - if (EDUKE32_PREDICT_FALSE(block_deletesprite)) - { - Printf(TEXTCOLOR_RED "A_DeleteSprite(): tried to remove sprite %d in EVENT_EGS\n", spriteNum); - return; - } - #ifdef POLYMER if (actor[spriteNum].lightptr != NULL && videoGetRenderMode() == REND_POLYMER) A_DeleteLight(spriteNum); @@ -82,35 +67,6 @@ void A_DeleteSprite(int spriteNum) void insertspriteq(int i); -void A_AddToDeleteQueue(int spriteNum) -{ - insertspriteq(spriteNum); -} - -void A_SpawnMultiple(int spriteNum, int tileNum, int spawnCnt) -{ - spritetype *pSprite = &sprite[spriteNum]; - - for (; spawnCnt>0; spawnCnt--) - { - int32_t const r1 = krand2(), r2 = krand2(); - int const j = A_InsertSprite(pSprite->sectnum, pSprite->x, pSprite->y, pSprite->z - (r2 % (47 << 8)), tileNum, -32, 8, - 8, r1 & 2047, 0, 0, spriteNum, 5); - //fi.spawn(-1, j); - sprite[j].cstat = krand2()&12; - } -} - -void A_DoGuts(int spriteNum, int tileNum, int spawnCnt) -{ - fi.guts(&sprite[spriteNum], tileNum, spawnCnt, 0); -} - -void A_DoGutsDir(int spriteNum, int tileNum, int spawnCnt) -{ - fi.gutsdir(&sprite[spriteNum], tileNum, spawnCnt, 0); -} - static int32_t G_ToggleWallInterpolation(int32_t wallNum, int32_t setInterpolation) { if (setInterpolation) @@ -141,14 +97,6 @@ void Sect_ToggleInterpolation(int sectNum, int setInterpolation) } } -void ms(short i); - -void A_MoveSector(int spriteNum) -{ - ms(spriteNum); -} - - int g_canSeePlayer = 0; int G_WakeUp(spritetype *const pSprite, int const playerNum) diff --git a/source/games/duke/src/zz_config.cpp b/source/games/duke/src/zz_config.cpp deleted file mode 100644 index ca2622fc3..000000000 --- a/source/games/duke/src/zz_config.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//------------------------------------------------------------------------- -/* -Copyright (C) 2016 EDuke32 developers and contributors - -This file is part of EDuke32. - -EDuke32 is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License version 2 -as published by the Free Software Foundation. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -See the GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ -//------------------------------------------------------------------------- - -#include "ns.h" // Must come before everything else! - -#include "duke3d.h" -#include "osdcmds.h" -#include "baselayer.h" -#include "cmdline.h" - -// we load this in to get default button and key assignments -// as well as setting up function mappings - -BEGIN_DUKE_NS - -int32_t CONFIG_ReadSetup(void) -{ - g_player[0].ps->aim_mode = 1; - ud.config.ShowOpponentWeapons = 0; - ud.automsg = 0; - ud.camerasprite = -1; - - ud.camera_time = 0;//4; - - ud.screen_tilting = 1; - ud.statusbarflags = 0;// STATUSBAR_NOSHRINK; - playerteam = 0; - ud.angleinterpolation = 0; - - ud.display_bonus_screen = 1; - ud.show_level_text = 1; - ud.screenfade = 1; - ud.menubackground = 1; - ud.slidebar_paldisabled = 1; - ud.shadow_pal = 4; - return 0; -} - -END_DUKE_NS diff --git a/source/games/duke/src/zz_game.cpp b/source/games/duke/src/zz_game.cpp index fd55b34de..c0b3239c2 100644 --- a/source/games/duke/src/zz_game.cpp +++ b/source/games/duke/src/zz_game.cpp @@ -3833,6 +3833,30 @@ static const char* actions[] = { void InitFonts(); +int32_t SetDefaults(void) +{ + g_player[0].ps->aim_mode = 1; + ud.config.ShowOpponentWeapons = 0; + ud.automsg = 0; + ud.camerasprite = -1; + + ud.camera_time = 0;//4; + + ud.screen_tilting = 1; + ud.statusbarflags = 0;// STATUSBAR_NOSHRINK; + playerteam = 0; + ud.angleinterpolation = 0; + + ud.display_bonus_screen = 1; + ud.show_level_text = 1; + ud.screenfade = 1; + ud.menubackground = 1; + ud.slidebar_paldisabled = 1; + ud.shadow_pal = 4; + return 0; +} + + int GameInterface::app_main() { for (int i = 0; i < MAXPLAYERS; i++) @@ -3861,7 +3885,7 @@ int GameInterface::app_main() G_CheckCommandLine(); - CONFIG_ReadSetup(); + SetDefaults(); hud_size.Callback();