From d09b83d4a5565ce6e895393487d8a2521b4f8295 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 1 Jan 2020 12:01:26 +0100 Subject: [PATCH] - moved the last remaining function out of baselayer.cpp and removed that file. g_logFlushWindow was deleted entirely because with the current console this is not needed anymore. --- source/CMakeLists.txt | 1 - source/build/src/baselayer.cpp | 54 ---------------------------------- source/build/src/defs.cpp | 9 ------ source/build/src/engine.cpp | 2 ++ source/build/src/sdlayer.cpp | 35 ++++++++++++++++++++++ source/common/inputstate.cpp | 2 ++ source/duke3d/src/game.cpp | 3 -- source/duke3d/src/gamedef.cpp | 4 --- source/rr/src/game.cpp | 2 -- source/rr/src/gamedef.cpp | 4 --- 10 files changed, 39 insertions(+), 77 deletions(-) delete mode 100644 source/build/src/baselayer.cpp diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index 517d6b3b0..b28a84f4b 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -683,7 +683,6 @@ set (PCH_SOURCES # Todo: Split out the license-safe code from this. build/src/a-c.cpp build/src/animvpx.cpp - build/src/baselayer.cpp build/src/clip.cpp build/src/colmatch.cpp build/src/common.cpp diff --git a/source/build/src/baselayer.cpp b/source/build/src/baselayer.cpp deleted file mode 100644 index 1137ae093..000000000 --- a/source/build/src/baselayer.cpp +++ /dev/null @@ -1,54 +0,0 @@ -#include "compat.h" -#include "osd.h" -#include "build.h" -#include "baselayer.h" - -#include "baselayer.h" - -#include "a.h" -#include "polymost.h" - -#include "inputstate.h" -#include "d_event.h" -#include "../../glbackend/glbackend.h" - -int GUICapture = false; - - -// Calculate ylookup[] and call setvlinebpl() -void calc_ylookup(int32_t bpl, int32_t lastyidx) -{ - int32_t i, j=0; - static int32_t ylookupsiz; - - Bassert(lastyidx <= MAXYDIM); - - lastyidx++; - - if (lastyidx > ylookupsiz) - { - ylookup.Resize(lastyidx); - ylookupsiz = lastyidx; - } - - for (i=0; i<=lastyidx-4; i+=4) - { - ylookup[i] = j; - ylookup[i + 1] = j + bpl; - ylookup[i + 2] = j + (bpl << 1); - ylookup[i + 3] = j + (bpl * 3); - j += (bpl << 2); - } - - for (; i= 50) { - g_logFlushWindow = 1; initprintf("."); - g_logFlushWindow = 0; iter = 0; } #endif @@ -3443,15 +3439,12 @@ static int32_t defsparser(scriptfile *script) int32_t loaddefinitionsfile(const char *fn) { scriptfile *script; - int32_t f = g_logFlushWindow; script = scriptfile_fromfile(fn); if (script) { - g_logFlushWindow = 1; initprintf("Loading \"%s\"\n",fn); - g_logFlushWindow = 0; defsparser(script); } @@ -3459,8 +3452,6 @@ int32_t loaddefinitionsfile(const char *fn) if (userConfig.AddDefs) for (auto& m : *userConfig.AddDefs) defsparser_include(m, NULL, NULL); - g_logFlushWindow = f; - if (script) scriptfile_close(script); diff --git a/source/build/src/engine.cpp b/source/build/src/engine.cpp index 4148f8843..e01626f56 100644 --- a/source/build/src/engine.cpp +++ b/source/build/src/engine.cpp @@ -10557,6 +10557,8 @@ void rotatesprite_(int32_t sx, int32_t sy, int32_t z, int16_t a, int16_t picnum, } + + // // clearview // diff --git a/source/build/src/sdlayer.cpp b/source/build/src/sdlayer.cpp index 34461fc67..88662e314 100644 --- a/source/build/src/sdlayer.cpp +++ b/source/build/src/sdlayer.cpp @@ -158,6 +158,41 @@ void videoResetMode(void) videomodereset = 1; } + +// Calculate ylookup[] and call setvlinebpl() +void calc_ylookup(int32_t bpl, int32_t lastyidx) +{ + int32_t i, j = 0; + static int32_t ylookupsiz; + + Bassert(lastyidx <= MAXYDIM); + + lastyidx++; + + if (lastyidx > ylookupsiz) + { + ylookup.Resize(lastyidx); + ylookupsiz = lastyidx; + } + + for (i = 0; i <= lastyidx - 4; i += 4) + { + ylookup[i] = j; + ylookup[i + 1] = j + bpl; + ylookup[i + 2] = j + (bpl << 1); + ylookup[i + 3] = j + (bpl * 3); + j += (bpl << 2); + } + + for (; i < lastyidx; i++) + { + ylookup[i] = j; + j += bpl; + } + + setvlinebpl(bpl); +} + // // begindrawing() -- locks the framebuffer for drawing // diff --git a/source/common/inputstate.cpp b/source/common/inputstate.cpp index 29ea85c54..4b0bb90bd 100644 --- a/source/common/inputstate.cpp +++ b/source/common/inputstate.cpp @@ -36,6 +36,8 @@ #include "build.h" #include "gamecvars.h" +int GUICapture = false; + //========================================================================== // // diff --git a/source/duke3d/src/game.cpp b/source/duke3d/src/game.cpp index f31e0eaa9..55fbbf9c0 100644 --- a/source/duke3d/src/game.cpp +++ b/source/duke3d/src/game.cpp @@ -5724,9 +5724,6 @@ int GameInterface::app_main() S_InitSound(); - g_logFlushWindow = 0; - - G_SetupCheats(); if (SHAREWARE) diff --git a/source/duke3d/src/gamedef.cpp b/source/duke3d/src/gamedef.cpp index ee622f865..9c8ca72c4 100644 --- a/source/duke3d/src/gamedef.cpp +++ b/source/duke3d/src/gamedef.cpp @@ -5906,8 +5906,6 @@ void C_Compile(const char *fileName) initprintf("Compiling: %s (%d bytes)\n", fileName, kFileLen); - g_logFlushWindow = 0; - uint32_t const startcompiletime = timerGetTicks(); char * mptr = (char *)Xmalloc(kFileLen+1); @@ -5942,8 +5940,6 @@ void C_Compile(const char *fileName) C_Include(m); } - g_logFlushWindow = 1; - if (g_errorCnt > 63) initprintf("fatal error: too many errors: Aborted\n"); diff --git a/source/rr/src/game.cpp b/source/rr/src/game.cpp index ed8cfb262..863af19ed 100644 --- a/source/rr/src/game.cpp +++ b/source/rr/src/game.cpp @@ -7164,8 +7164,6 @@ int GameInterface::app_main() S_InitSound(); - g_logFlushWindow = 0; - if (RR) { g_cdTrack = -1; diff --git a/source/rr/src/gamedef.cpp b/source/rr/src/gamedef.cpp index 1fe52b3c9..5afc3da78 100644 --- a/source/rr/src/gamedef.cpp +++ b/source/rr/src/gamedef.cpp @@ -2212,8 +2212,6 @@ void C_Compile(const char *fileName) initprintf("Compiling: %s (%d bytes)\n", fileName, kFileLen); - g_logFlushWindow = 0; - uint32_t const startcompiletime = timerGetTicks(); char * mptr = (char *)Xmalloc(kFileLen+1); @@ -2250,8 +2248,6 @@ void C_Compile(const char *fileName) } userConfig.AddCons.reset(); - g_logFlushWindow = 1; - if (g_errorCnt > 63) initprintf("fatal error: too many errors: Aborted\n");