diff --git a/source/build/include/build.h b/source/build/include/build.h index ddae46faa..8fe641a6c 100644 --- a/source/build/include/build.h +++ b/source/build/include/build.h @@ -229,7 +229,7 @@ EXTERN int16_t thewall[MAXWALLSB]; EXTERN tspriteptr_t tspriteptr[MAXSPRITESONSCREEN + 1]; EXTERN int32_t wx1, wy1, wx2, wy2; -EXTERN int32_t xdim, ydim, numpages, upscalefactor; +EXTERN int32_t xdim, ydim; EXTERN int32_t yxaspect, viewingrange; #ifndef GEKKO @@ -448,7 +448,6 @@ int32_t qloadkvx(int32_t voxindex, const char *filename); void vox_undefine(int32_t const); void vox_deinit(); -int32_t videoSetGameMode(char davidoption, int32_t daupscaledxdim, int32_t daupscaledydim, int32_t dabpp, int32_t daupscalefactor); void videoSetCorrectedAspect(); void videoSetViewableArea(int32_t x1, int32_t y1, int32_t x2, int32_t y2); void renderSetAspect(int32_t daxrange, int32_t daaspect); @@ -463,6 +462,7 @@ void renderCompleteMirror(void); int32_t renderDrawRoomsQ16(int32_t daposx, int32_t daposy, int32_t daposz, fixed_t daang, fixed_t dahoriz, int16_t dacursectnum); void renderDrawMasks(void); +void setVideoMode(); void videoInit(); void videoClearViewableArea(int32_t dacol); void videoClearScreen(int32_t dacol); diff --git a/source/build/include/polymost.h b/source/build/include/polymost.h index e039e9dcd..41bbc7fbf 100644 --- a/source/build/include/polymost.h +++ b/source/build/include/polymost.h @@ -99,7 +99,7 @@ enum { static_assert(DAMETH_NARROW_MASKPROPS(DAMETH_MASKPROPS) == DAMETH_MASK); extern float fcosglobalang, fsinglobalang; -extern float fxdim, fydim, fydimen, fviewingrange; +extern float fydimen, fviewingrange; extern int32_t viewingrangerecip; #endif diff --git a/source/build/src/engine.cpp b/source/build/src/engine.cpp index e16a9f6c8..c3ce067a4 100644 --- a/source/build/src/engine.cpp +++ b/source/build/src/engine.cpp @@ -45,7 +45,7 @@ int32_t r_rorphase = 0; int32_t mdtims, omdtims; float fcosglobalang, fsinglobalang; -float fxdim, fydim, fydimen, fviewingrange; +float fydimen, fviewingrange; uint8_t globalr = 255, globalg = 255, globalb = 255; @@ -82,7 +82,6 @@ static int32_t qradarang[10240]; uint16_t ATTRIBUTE((used)) sqrtable[4096], ATTRIBUTE((used)) shlookup[4096+256], ATTRIBUTE((used)) sqrtable_old[2048]; -static char kensmessage[128]; const char *engineerrstr = "No error"; int32_t showfirstwall=0; @@ -194,7 +193,6 @@ int16_t numscans, numbunches; static int16_t numhits; int16_t searchit; -int32_t searchx = -1, searchy; //search input int16_t searchsector, searchwall, searchstat; //search output // SEARCHBOTTOMWALL: @@ -831,8 +829,6 @@ const int16_t* getpsky(int32_t picnum, int32_t* dapyscale, int32_t* dapskybits, // // preinitengine // -static int32_t preinitcalled = 0; - static spriteext_t spriteext_s[MAXSPRITES+MAXUNIQHUDID]; static spritesmooth_t spritesmooth_s[MAXSPRITES+MAXUNIQHUDID]; static sectortype sector_s[MAXSECTORS]; @@ -842,17 +838,12 @@ static tspritetype tsprite_s[MAXSPRITESONSCREEN]; int32_t enginePreInit(void) { - polymost_initosdfuncs(); - sector = sector_s; wall = wall_s; sprite = sprite_s; tsprite = tsprite_s; spriteext = spriteext_s; spritesmooth = spritesmooth_s; - - - preinitcalled = 1; return 0; } @@ -862,14 +853,6 @@ int32_t enginePreInit(void) // int32_t engineInit(void) { - int32_t i; - - if (!preinitcalled) - { - i = enginePreInit(); - if (i) return i; - } - if (engineLoadTables()) return 1; @@ -877,7 +860,7 @@ int32_t engineInit(void) voxelmemory.Reset(); - for (i=0; i>1); } - - return 0; -} - // // qloadkvx // diff --git a/source/build/src/engine_priv.h b/source/build/src/engine_priv.h index 77f8eebb1..046845c03 100644 --- a/source/build/src/engine_priv.h +++ b/source/build/src/engine_priv.h @@ -102,7 +102,6 @@ extern int32_t globalorientation; extern int16_t editstatus; extern int16_t searchit; -extern int32_t searchx, searchy; extern int16_t searchsector, searchwall, searchstat; extern int16_t searchbottomwall, searchisbottom; diff --git a/source/build/src/polymost.cpp b/source/build/src/polymost.cpp index f0066088e..b512a535b 100644 --- a/source/build/src/polymost.cpp +++ b/source/build/src/polymost.cpp @@ -3538,10 +3538,6 @@ _drawsprite_return: static_assert((int)RS_YFLIP == (int)HUDFLAG_FLIPPED); -void polymost_initosdfuncs(void) -{ -} - void polymost_precache(int32_t dapicnum, int32_t dapalnum, int32_t datype) { // dapicnum and dapalnum are like you'd expect diff --git a/source/core/gamecontrol.cpp b/source/core/gamecontrol.cpp index 128803e3a..0b6da9865 100644 --- a/source/core/gamecontrol.cpp +++ b/source/core/gamecontrol.cpp @@ -912,11 +912,7 @@ int RunGame() if (Args->CheckParm("-sounddebug")) C_DoCommand("stat sounddebug"); - if (enginePreInit()) - { - I_FatalError("There was a problem initializing the Build engine: %s\n", engineerrstr); - } - + enginePreInit(); SetupGameButtons(); gameinfo.mBackButton = "engine/graphics/m_back.png"; gi->app_init(); @@ -1000,11 +996,20 @@ void updatePauseStatus() void PolymostProcessVoxels(void); +void setVideoMode() +{ + xdim = screen->GetWidth(); + ydim = screen->GetHeight(); + V_UpdateModeSize(xdim, ydim); + videoSetViewableArea(0, 0, xdim - 1, ydim - 1); + videoClearScreen(0); +} + void videoInit() { lookups.postLoadLookups(); V_Init2(); - videoSetGameMode(vid_fullscreen, screen->GetWidth(), screen->GetHeight(), 32, 1); + setVideoMode(); PolymostProcessVoxels(); GLInterface.Init(screen->GetWidth()); diff --git a/source/core/inputstate.cpp b/source/core/inputstate.cpp index 5fcbd5099..98500826a 100644 --- a/source/core/inputstate.cpp +++ b/source/core/inputstate.cpp @@ -157,7 +157,7 @@ int32_t handleevents(void) // change the view size if needed if (setsizeneeded) { - videoSetGameMode(vid_fullscreen, SCREENWIDTH, SCREENHEIGHT, 32, 1); + setVideoMode(); setViewport(hud_size); setsizeneeded = false; } diff --git a/source/games/sw/src/panel.h b/source/games/sw/src/panel.h index ad6ad516d..3a64f3f6f 100644 --- a/source/games/sw/src/panel.h +++ b/source/games/sw/src/panel.h @@ -122,7 +122,6 @@ struct PANEL_SPRITEstruct short picndx; // for pip stuff in conpic.h short picnum; // bypass pip stuff in conpic.h short vel, vel_adj; - short numpages; int xorig, yorig, flags, priority; int scale; int jump_speed, jump_grav; // jumping vars