Compare commits
37
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
467ecf8224 | ||
|
|
2077315f24 | ||
|
|
67e74b5874 | ||
|
|
9bea6eddbd | ||
|
|
f4e5f7249c | ||
|
|
9639ace28a | ||
|
|
a2616778cc | ||
|
|
495c34dd40 | ||
|
|
b0bf588c27 | ||
|
|
35e4f35f6e | ||
|
|
7866b769cc | ||
|
|
1af1e42dab | ||
|
|
40bd3e5e19 | ||
|
|
a05413d925 | ||
|
|
8a8cbffd12 | ||
|
|
1fb6c63097 | ||
|
|
c312380944 | ||
|
|
b5bb2b42bf | ||
|
|
d074f375ca | ||
|
|
6fd14f0a80 | ||
|
|
d6bbb2c1b3 | ||
|
|
fa66b87965 | ||
|
|
c59d5db03e | ||
|
|
b6edc90553 | ||
|
|
23735121ff | ||
|
|
20950b698f | ||
|
|
44df85d6a4 | ||
|
|
42d53f1f6f | ||
|
|
48f2d0ff83 | ||
|
|
517723f9c1 | ||
|
|
6915077e0f | ||
|
|
406dbf333d | ||
|
|
a730dfd212 | ||
|
|
3058d365f3 | ||
|
|
ccc453e0b0 | ||
|
|
c3d02090e4 | ||
|
|
20cd7621c3 |
No files matched your search
@@ -64,7 +64,7 @@ endif
|
|||||||
|
|
||||||
# This must have high to low order.
|
# This must have high to low order.
|
||||||
gcc_versions:=\
|
gcc_versions:=\
|
||||||
151 150 15\
|
152 151 150 15\
|
||||||
142 141 140 14\
|
142 141 140 14\
|
||||||
132 131 130 13\
|
132 131 130 13\
|
||||||
123 122 121 120 12\
|
123 122 121 120 12\
|
||||||
@@ -77,7 +77,7 @@ gcc_versions:=\
|
|||||||
55 54 53 52 51 50\
|
55 54 53 52 51 50\
|
||||||
49 48 47 46 45 44 43 42 41 40
|
49 48 47 46 45 44 43 42 41 40
|
||||||
|
|
||||||
latest_gcc_version:=15.1.1
|
latest_gcc_version:=15.2
|
||||||
|
|
||||||
# Automatically set version flag, but not if one was
|
# Automatically set version flag, but not if one was
|
||||||
# manually set. And don't bother if this is a clean only
|
# manually set. And don't bother if this is a clean only
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ $(foreach v,$(join $(wordlist 2,$(_n),- $(gcc_versions)),\
|
|||||||
CXXFLAGS+= -Wno-aggregate-return
|
CXXFLAGS+= -Wno-aggregate-return
|
||||||
|
|
||||||
# -W -Wno-unused
|
# -W -Wno-unused
|
||||||
WFLAGS:=-Wall -Wno-trigraphs
|
WFLAGS:=-Wall -Wno-trigraphs -Wnull-dereference
|
||||||
ifndef GCC295
|
ifndef GCC295
|
||||||
#WFLAGS+=-Wno-packed
|
#WFLAGS+=-Wno-packed
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -226,10 +226,6 @@ const char *I_LocateWad(void)
|
|||||||
return "/sdcard/srb2";
|
return "/sdcard/srb2";
|
||||||
}
|
}
|
||||||
|
|
||||||
void I_GetJoystickEvents(void){}
|
|
||||||
|
|
||||||
void I_GetJoystick2Events(void){}
|
|
||||||
|
|
||||||
char *I_GetEnv(const char *name)
|
char *I_GetEnv(const char *name)
|
||||||
{
|
{
|
||||||
LOGW("I_GetEnv() called?!");
|
LOGW("I_GetEnv() called?!");
|
||||||
|
|||||||
@@ -167,6 +167,8 @@ static char returnWadPath[256];
|
|||||||
#include "../i_video.h"
|
#include "../i_video.h"
|
||||||
#include "../i_sound.h"
|
#include "../i_sound.h"
|
||||||
#include "../i_system.h"
|
#include "../i_system.h"
|
||||||
|
#include "../i_time.h"
|
||||||
|
#include "../i_net.h"
|
||||||
#include "../screen.h" //vid.WndParent
|
#include "../screen.h" //vid.WndParent
|
||||||
#include "../d_net.h"
|
#include "../d_net.h"
|
||||||
#include "../g_game.h"
|
#include "../g_game.h"
|
||||||
@@ -196,8 +198,6 @@ UINT8 keyboard_started = false;
|
|||||||
|
|
||||||
#ifdef HAVE_TERMIOS
|
#ifdef HAVE_TERMIOS
|
||||||
// TERMIOS console code from Quake3: thank you!
|
// TERMIOS console code from Quake3: thank you!
|
||||||
boolean stdin_active = true;
|
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
size_t cursor;
|
size_t cursor;
|
||||||
@@ -699,11 +699,7 @@ void I_JoyScale4(void)
|
|||||||
|
|
||||||
|
|
||||||
*/
|
*/
|
||||||
void I_ShutdownJoystick(void)
|
void I_ShutdownJoystick(UINT8 index)
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void I_GetJoystickEvents(UINT8 index)
|
|
||||||
{
|
{
|
||||||
(void)index;
|
(void)index;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -115,6 +115,10 @@ INT32 VID_GetModeForSize(INT32 w, INT32 h)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void VID_RefreshModeList(void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
void VID_PrepareModeList(void)
|
void VID_PrepareModeList(void)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -125,6 +129,13 @@ INT32 VID_SetMode(INT32 modeNum)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
boolean I_CheckAboveDesktopRes(INT32 width, INT32 height)
|
||||||
|
{
|
||||||
|
(void)width;
|
||||||
|
(void)height;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
void I_StartupGraphics(void)
|
void I_StartupGraphics(void)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -619,7 +619,6 @@ static void HWR_PrecacheLevelFlats(void)
|
|||||||
// lookup for flats that may´ve been already loaded
|
// lookup for flats that may´ve been already loaded
|
||||||
// too lazy to make a hashtable or smth so unordered set will do :carbuncle:
|
// too lazy to make a hashtable or smth so unordered set will do :carbuncle:
|
||||||
std::unordered_set<UINT32> flatpresent;
|
std::unordered_set<UINT32> flatpresent;
|
||||||
lumpnum_t lump;
|
|
||||||
size_t i, j;
|
size_t i, j;
|
||||||
INT32 k;
|
INT32 k;
|
||||||
|
|
||||||
@@ -649,9 +648,8 @@ static void HWR_PrecacheLevelFlats(void)
|
|||||||
const INT32 pic = ceiling ? sec->ceilingpic : sec->floorpic;
|
const INT32 pic = ceiling ? sec->ceilingpic : sec->floorpic;
|
||||||
|
|
||||||
const levelflat_t *levelflat = &levelflats[pic];
|
const levelflat_t *levelflat = &levelflats[pic];
|
||||||
lump = levelflat->lumpnum;
|
|
||||||
|
|
||||||
load_flat(lump, R_NoEncore(sec, ceiling));
|
load_flat(levelflat->lumpnum, R_NoEncore(sec, ceiling));
|
||||||
|
|
||||||
if (levelflat->speed) // is it an animated flat ?
|
if (levelflat->speed) // is it an animated flat ?
|
||||||
{
|
{
|
||||||
@@ -672,9 +670,8 @@ static void HWR_PrecacheLevelFlats(void)
|
|||||||
for (i = 0; i < numlevelflats; i++)
|
for (i = 0; i < numlevelflats; i++)
|
||||||
{
|
{
|
||||||
const levelflat_t *levelflat = &levelflats[i];
|
const levelflat_t *levelflat = &levelflats[i];
|
||||||
lump = levelflat->lumpnum;
|
|
||||||
|
|
||||||
load_flat(lump, false);
|
load_flat(levelflat->lumpnum, false);
|
||||||
|
|
||||||
if (levelflat->speed) // is it an animated flat ?
|
if (levelflat->speed) // is it an animated flat ?
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -5538,7 +5538,7 @@ static void HWR_RenderViewpoint(gl_portal_t *rootportal, int stencil_level, bool
|
|||||||
player_t *viewplayer = &players[displayplayers[viewssnum]];
|
player_t *viewplayer = &players[displayplayers[viewssnum]];
|
||||||
const float fpov = FixedToFloat(R_GetPlayerFov(viewplayer));
|
const float fpov = FixedToFloat(R_GetPlayerFov(viewplayer));
|
||||||
|
|
||||||
auto reset_viewstate = [&](const float fpov)
|
auto reset_viewstate = [&]()
|
||||||
{
|
{
|
||||||
HWR_SetTransform(fpov);
|
HWR_SetTransform(fpov);
|
||||||
HWR_ClearSprites();
|
HWR_ClearSprites();
|
||||||
@@ -5558,7 +5558,7 @@ static void HWR_RenderViewpoint(gl_portal_t *rootportal, int stencil_level, bool
|
|||||||
currentportallist = &portallist;
|
currentportallist = &portallist;
|
||||||
HWR_SetPortalState(GLPORTAL_SEARCH);
|
HWR_SetPortalState(GLPORTAL_SEARCH);
|
||||||
|
|
||||||
reset_viewstate(fpov);
|
reset_viewstate();
|
||||||
|
|
||||||
if (rootportal)
|
if (rootportal)
|
||||||
{
|
{
|
||||||
@@ -5584,7 +5584,7 @@ static void HWR_RenderViewpoint(gl_portal_t *rootportal, int stencil_level, bool
|
|||||||
// draw normal things in current frame in current incremented stencil buffer area
|
// draw normal things in current frame in current incremented stencil buffer area
|
||||||
HWR_SetStencilState(HWR_STENCIL_NORMAL, stencil_level);
|
HWR_SetStencilState(HWR_STENCIL_NORMAL, stencil_level);
|
||||||
|
|
||||||
reset_viewstate(fpov);
|
reset_viewstate();
|
||||||
|
|
||||||
if constexpr (Type == RenderViewpointType::kPortal)
|
if constexpr (Type == RenderViewpointType::kPortal)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -29,6 +29,10 @@ extern "C" {
|
|||||||
*/
|
*/
|
||||||
#define MAX_QUIT_FUNCS 16
|
#define MAX_QUIT_FUNCS 16
|
||||||
|
|
||||||
|
void I_GetConsoleEvents(void);
|
||||||
|
|
||||||
|
extern boolean consolevent;
|
||||||
|
extern boolean framebuffer;
|
||||||
|
|
||||||
/** \brief Graphic system had started up
|
/** \brief Graphic system had started up
|
||||||
*/
|
*/
|
||||||
|
|||||||
+11
-2
@@ -95,6 +95,7 @@ INT32 VID_SetMode(INT32 modenum);
|
|||||||
*/
|
*/
|
||||||
const char *VID_GetModeName(INT32 modenum);
|
const char *VID_GetModeName(INT32 modenum);
|
||||||
|
|
||||||
|
void VID_RefreshModeList(void);
|
||||||
void VID_PrepareModeList(void);
|
void VID_PrepareModeList(void);
|
||||||
|
|
||||||
/** \brief can video system do fullscreen
|
/** \brief can video system do fullscreen
|
||||||
@@ -121,12 +122,11 @@ void I_ReadScreen(UINT8 * restrict scr, INT32 scale);
|
|||||||
|
|
||||||
UINT32 I_GetRefreshRate(void);
|
UINT32 I_GetRefreshRate(void);
|
||||||
|
|
||||||
|
boolean I_CheckAboveDesktopRes(INT32 width, INT32 height);
|
||||||
boolean I_CheckNativeRes(void);
|
boolean I_CheckNativeRes(void);
|
||||||
|
|
||||||
void I_SetBorderlessWindow(void);
|
void I_SetBorderlessWindow(void);
|
||||||
|
|
||||||
void I_HandleControllerHatRepeat(void);
|
|
||||||
|
|
||||||
#ifdef USE_FBO_OGL
|
#ifdef USE_FBO_OGL
|
||||||
|
|
||||||
void RefreshOGLSDLSurface(void);
|
void RefreshOGLSDLSurface(void);
|
||||||
@@ -135,6 +135,15 @@ boolean UseScreenFBO(void);
|
|||||||
extern boolean downsample;
|
extern boolean downsample;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// So we can call this from i_video event loop
|
||||||
|
void I_ShutdownJoystick(UINT8 index);
|
||||||
|
|
||||||
|
// Quick thing to make SDL_JOYDEVICEADDED events less of an abomination
|
||||||
|
void I_UpdateJoystickDeviceIndex(UINT8 player);
|
||||||
|
void I_UpdateJoystickDeviceIndices(UINT8 excludePlayer);
|
||||||
|
|
||||||
|
void I_HandleControllerHatRepeat(void);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
} // extern "C"
|
} // extern "C"
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+20
-17
@@ -1064,9 +1064,13 @@ static void ArchiveTables(UINT8 **p)
|
|||||||
{
|
{
|
||||||
// Write key
|
// Write key
|
||||||
e = ArchiveValue(p, TABLESINDEX, -2); // key should be either a number or a string, ArchiveValue can handle this.
|
e = ArchiveValue(p, TABLESINDEX, -2); // key should be either a number or a string, ArchiveValue can handle this.
|
||||||
if (e == 2) // invalid key type (function, thread, lightuserdata, or anything we don't recognise)
|
if (e == 1)
|
||||||
|
n++; // the table contained a new table we'll have to archive. :(
|
||||||
|
else if (e == 2) // invalid key type (function, thread, lightuserdata, or anything we don't recognise)
|
||||||
{
|
{
|
||||||
CONS_Alert(CONS_ERROR, "Index '%s' (%s) of table %d could not be archived!\n", lua_tostring(gL, -2), luaL_typename(gL, -2), i);
|
CONS_Alert(CONS_ERROR, "Index '%s' (%s) of table %d could not be archived!\n", lua_tostring(gL, -2), luaL_typename(gL, -2), i);
|
||||||
|
lua_pop(gL, 1);
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
else if (e == 3) // nil key due to invalid userdata. NOT an error.
|
else if (e == 3) // nil key due to invalid userdata. NOT an error.
|
||||||
{
|
{
|
||||||
@@ -1077,15 +1081,12 @@ static void ArchiveTables(UINT8 **p)
|
|||||||
// Write value
|
// Write value
|
||||||
e = ArchiveValue(p, TABLESINDEX, -1);
|
e = ArchiveValue(p, TABLESINDEX, -1);
|
||||||
if (e == 1)
|
if (e == 1)
|
||||||
{
|
|
||||||
n++; // the table contained a new table we'll have to archive. :(
|
n++; // the table contained a new table we'll have to archive. :(
|
||||||
}
|
|
||||||
else if (e == 2) // invalid value type
|
else if (e == 2) // invalid value type
|
||||||
{
|
|
||||||
CONS_Alert(CONS_ERROR, "Type of value for table %d entry '%s' (%s) could not be archived!\n", i, lua_tostring(gL, -2), luaL_typename(gL, -1));
|
CONS_Alert(CONS_ERROR, "Type of value for table %d entry '%s' (%s) could not be archived!\n", i, lua_tostring(gL, -2), luaL_typename(gL, -1));
|
||||||
}
|
|
||||||
|
|
||||||
lua_pop(gL, 1);
|
lua_pop(gL, 1);
|
||||||
|
|
||||||
}
|
}
|
||||||
lua_pop(gL, 1);
|
lua_pop(gL, 1);
|
||||||
WRITEUINT8(*p, ARCH_TEND);
|
WRITEUINT8(*p, ARCH_TEND);
|
||||||
@@ -1276,13 +1277,21 @@ static void UnArchiveTables(UINT8 **p, boolean network)
|
|||||||
UINT8 ret;
|
UINT8 ret;
|
||||||
|
|
||||||
ret = UnArchiveValue(p, TABLESINDEX, network);
|
ret = UnArchiveValue(p, TABLESINDEX, network);
|
||||||
if (ret == 3)
|
if (ret == 1) // End of table
|
||||||
|
break;
|
||||||
|
else if (ret == 2) // Key contains a new table
|
||||||
|
n++;
|
||||||
|
else if (ret == 3)
|
||||||
{
|
{
|
||||||
//CONS_Alert(CONS_WARNING,"Couldn't read mobj_t\n");
|
//CONS_Alert(CONS_WARNING,"Couldn't read mobj_t\n");
|
||||||
lua_pushnil(gL);
|
lua_pushnil(gL);
|
||||||
}
|
}
|
||||||
else if (ret == 1) // read key
|
|
||||||
break;
|
if (lua_isnil(gL, -1)) // If key is nil, skip this entry
|
||||||
|
{
|
||||||
|
lua_pop(gL, 1);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
ret = UnArchiveValue(p, TABLESINDEX, network);
|
ret = UnArchiveValue(p, TABLESINDEX, network);
|
||||||
if (ret == 1)
|
if (ret == 1)
|
||||||
@@ -1291,21 +1300,15 @@ static void UnArchiveTables(UINT8 **p, boolean network)
|
|||||||
lua_pop(gL, 1); // Pop key
|
lua_pop(gL, 1); // Pop key
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
else if (ret == 2) // read value
|
||||||
|
n++;
|
||||||
else if (ret == 3)
|
else if (ret == 3)
|
||||||
{
|
{
|
||||||
//CONS_Alert(CONS_WARNING,"Couldn't read mobj_t\n");
|
//CONS_Alert(CONS_WARNING,"Couldn't read mobj_t\n");
|
||||||
lua_pushnil(gL);
|
lua_pushnil(gL);
|
||||||
}
|
}
|
||||||
else if (ret == 2) // read value
|
|
||||||
n++;
|
|
||||||
|
|
||||||
if (lua_isnil(gL, -2)) // if key is nil (if a function etc was accidentally saved)
|
lua_rawset(gL, -3);
|
||||||
{
|
|
||||||
CONS_Alert(CONS_ERROR, "A nil key in table %d was found! (Invalid key type or corrupted save?)\n", i);
|
|
||||||
lua_pop(gL, 2); // pop key and value instead of setting them in the table, to prevent Lua panic errors
|
|
||||||
}
|
|
||||||
else
|
|
||||||
lua_rawset(gL, -3);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
lua_pop(gL, 1);
|
lua_pop(gL, 1);
|
||||||
|
|||||||
+43
-51
@@ -306,7 +306,6 @@ static void M_SetupMultiHandler(INT32 choice);
|
|||||||
|
|
||||||
// Options
|
// Options
|
||||||
// Split into multiple parts due to size
|
// Split into multiple parts due to size
|
||||||
static void M_VideoModeMenu(INT32 choice);
|
|
||||||
static void M_Setup1PControlsMenu(void);
|
static void M_Setup1PControlsMenu(void);
|
||||||
static void M_Setup2PControlsMenu(void);
|
static void M_Setup2PControlsMenu(void);
|
||||||
static void M_Setup3PControlsMenu(void);
|
static void M_Setup3PControlsMenu(void);
|
||||||
@@ -9713,14 +9712,11 @@ static void M_ResetControls(INT32 choice)
|
|||||||
// ===============
|
// ===============
|
||||||
|
|
||||||
//added : 30-01-98:
|
//added : 30-01-98:
|
||||||
#define MAXCOLUMNMODES 12 //max modes displayed in one column
|
|
||||||
#define MAXMODEDESCS (MAXCOLUMNMODES*3)
|
|
||||||
|
|
||||||
static modedesc_t modedescs[MAXMODEDESCS];
|
static modedesc_t modedescs[MAXMODEDESCS];
|
||||||
|
|
||||||
static void M_VideoModeMenu(INT32 choice)
|
void M_VideoModeMenu(INT32 choice)
|
||||||
{
|
{
|
||||||
INT32 i, j, vdup, nummodes, width, height;
|
INT32 i, nummodes, width, height;
|
||||||
const char *desc;
|
const char *desc;
|
||||||
|
|
||||||
(void)choice;
|
(void)choice;
|
||||||
@@ -9734,54 +9730,30 @@ static void M_VideoModeMenu(INT32 choice)
|
|||||||
nummodes = VID_NumModes();
|
nummodes = VID_NumModes();
|
||||||
|
|
||||||
// DOS does not skip mode 0, because mode 0 is ALWAYS present
|
// DOS does not skip mode 0, because mode 0 is ALWAYS present
|
||||||
i = 0;
|
for (i = 0; i < nummodes && vidm_nummodes < MAXMODEDESCS; i++)
|
||||||
for (; i < nummodes && vidm_nummodes < MAXMODEDESCS; i++)
|
|
||||||
{
|
{
|
||||||
desc = VID_GetModeName(i);
|
desc = VID_GetModeName(i);
|
||||||
if (desc)
|
|
||||||
{
|
|
||||||
vdup = 0;
|
|
||||||
|
|
||||||
// when a resolution exists both under VGA and VESA, keep the
|
if (!desc)
|
||||||
// VESA mode, which is always a higher modenum
|
continue;
|
||||||
for (j = 0; j < vidm_nummodes; j++)
|
|
||||||
{
|
|
||||||
if (fastcmp(modedescs[j].desc, desc))
|
|
||||||
{
|
|
||||||
// mode(0): 320x200 is always standard VGA, not vesa
|
|
||||||
if (modedescs[j].modenum)
|
|
||||||
{
|
|
||||||
modedescs[j].modenum = i;
|
|
||||||
vdup = 1;
|
|
||||||
|
|
||||||
if (i == vid.modenum)
|
modedescs[vidm_nummodes].modenum = i;
|
||||||
vidm_selected = j;
|
modedescs[vidm_nummodes].desc = desc;
|
||||||
}
|
|
||||||
else
|
|
||||||
vdup = 1;
|
|
||||||
|
|
||||||
break;
|
if (i == vid.modenum)
|
||||||
}
|
vidm_selected = vidm_nummodes;
|
||||||
}
|
|
||||||
|
|
||||||
if (!vdup)
|
// Pull out the width and height
|
||||||
{
|
sscanf(desc, "%u%*c%u", &width, &height);
|
||||||
modedescs[vidm_nummodes].modenum = i;
|
|
||||||
modedescs[vidm_nummodes].desc = desc;
|
|
||||||
|
|
||||||
if (i == vid.modenum)
|
// Show resolutions above desktop res as red.
|
||||||
vidm_selected = vidm_nummodes;
|
if (I_CheckAboveDesktopRes(width, height))
|
||||||
|
modedescs[vidm_nummodes].goodratio = 2;
|
||||||
|
// Show multiples of 320x200 as green.
|
||||||
|
else if (SCR_IsAspectCorrect(width, height))
|
||||||
|
modedescs[vidm_nummodes].goodratio = 1;
|
||||||
|
|
||||||
// Pull out the width and height
|
vidm_nummodes++;
|
||||||
sscanf(desc, "%u%*c%u", &width, &height);
|
|
||||||
|
|
||||||
// Show multiples of 320x200 as green.
|
|
||||||
if (SCR_IsAspectCorrect(width, height))
|
|
||||||
modedescs[vidm_nummodes].goodratio = 1;
|
|
||||||
|
|
||||||
vidm_nummodes++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
vidm_column_size = (vidm_nummodes+2) / 3;
|
vidm_column_size = (vidm_nummodes+2) / 3;
|
||||||
@@ -9977,7 +9949,11 @@ static void M_DrawVideoMode(void)
|
|||||||
V_DrawString(row, col, highlightflags|MENUCAPS, modedescs[i].desc);
|
V_DrawString(row, col, highlightflags|MENUCAPS, modedescs[i].desc);
|
||||||
// Show multiples of 320x200 as green.
|
// Show multiples of 320x200 as green.
|
||||||
else
|
else
|
||||||
V_DrawString(row, col, ((modedescs[i].goodratio) ? recommendedflags : 0)|MENUCAPS, modedescs[i].desc);
|
{
|
||||||
|
const UINT8 goodratio = modedescs[i].goodratio;
|
||||||
|
const INT32 goodflag = ((goodratio == 2) ? warningflags : (goodratio == 1) ? recommendedflags : 0);
|
||||||
|
V_DrawString(row, col, goodflag|MENUCAPS, modedescs[i].desc);
|
||||||
|
}
|
||||||
|
|
||||||
col += 8;
|
col += 8;
|
||||||
if ((i % vidm_column_size) == (vidm_column_size-1))
|
if ((i % vidm_column_size) == (vidm_column_size-1))
|
||||||
@@ -10001,7 +9977,6 @@ static void M_DrawVideoMode(void)
|
|||||||
va("Wait %d second%s", testtime, (testtime > 1) ? "s" : ""));
|
va("Wait %d second%s", testtime, (testtime > 1) ? "s" : ""));
|
||||||
M_CentreText(OP_VideoModeDef.y + 158,
|
M_CentreText(OP_VideoModeDef.y + 158,
|
||||||
"or press ESC to return");
|
"or press ESC to return");
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -10017,9 +9992,26 @@ static void M_DrawVideoMode(void)
|
|||||||
V_DrawCenteredString(BASEVIDWIDTH/2, OP_VideoModeDef.y + 138,
|
V_DrawCenteredString(BASEVIDWIDTH/2, OP_VideoModeDef.y + 138,
|
||||||
recommendedflags|MENUCAPS, "Marked modes are recommended.");
|
recommendedflags|MENUCAPS, "Marked modes are recommended.");
|
||||||
V_DrawCenteredString(BASEVIDWIDTH/2, OP_VideoModeDef.y + 146,
|
V_DrawCenteredString(BASEVIDWIDTH/2, OP_VideoModeDef.y + 146,
|
||||||
highlightflags|MENUCAPS, "Other modes may have visual errors.");
|
warningflags|MENUCAPS, "Marked modes are above Desktop resolution");
|
||||||
V_DrawCenteredString(BASEVIDWIDTH/2, OP_VideoModeDef.y + 158,
|
|
||||||
highlightflags|MENUCAPS, "Larger modes may have performance issues.");
|
if (rendermode == render_opengl)
|
||||||
|
{
|
||||||
|
#ifdef USE_FBO_OGL
|
||||||
|
if (!cv_glframebuffer.value)
|
||||||
|
#endif
|
||||||
|
V_DrawCenteredString(BASEVIDWIDTH/2, OP_VideoModeDef.y + 154,
|
||||||
|
warningflags|MENUCAPS, "and will have visual errors in OpenGL mode.");
|
||||||
|
|
||||||
|
V_DrawCenteredString(BASEVIDWIDTH/2, OP_VideoModeDef.y + 166,
|
||||||
|
highlightflags|MENUCAPS, "Other modes may have visual errors.");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
V_DrawCenteredString(BASEVIDWIDTH/2, OP_VideoModeDef.y + 154,
|
||||||
|
highlightflags|MENUCAPS, "Other modes may have visual errors.");
|
||||||
|
V_DrawCenteredString(BASEVIDWIDTH/2, OP_VideoModeDef.y + 166,
|
||||||
|
highlightflags|MENUCAPS, "Larger modes may have performance issues.");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Draw the cursor for the VidMode menu
|
// Draw the cursor for the VidMode menu
|
||||||
|
|||||||
@@ -223,6 +223,11 @@ extern menu_t *currentMenu;
|
|||||||
extern menu_t MainDef;
|
extern menu_t MainDef;
|
||||||
extern menu_t SP_LoadDef;
|
extern menu_t SP_LoadDef;
|
||||||
|
|
||||||
|
#define MAXCOLUMNMODES 12 //max modes displayed in one column
|
||||||
|
#define MAXMODEDESCS (MAXCOLUMNMODES*3)
|
||||||
|
extern menu_t OP_VideoModeDef;
|
||||||
|
void M_VideoModeMenu(INT32 choice);
|
||||||
|
|
||||||
// Call upon joystick hotplug
|
// Call upon joystick hotplug
|
||||||
void M_SetupJoystickMenu(INT32 choice);
|
void M_SetupJoystickMenu(INT32 choice);
|
||||||
extern menu_t OP_JoystickSetDef;
|
extern menu_t OP_JoystickSetDef;
|
||||||
|
|||||||
+5
-4
@@ -1346,14 +1346,15 @@ void M_MinimapGenerate(void)
|
|||||||
minigen = AM_MinimapGenerate(mul);
|
minigen = AM_MinimapGenerate(mul);
|
||||||
|
|
||||||
if (minigen == NULL || minigen->buf == NULL)
|
if (minigen == NULL || minigen->buf == NULL)
|
||||||
goto failure;
|
{
|
||||||
|
CONS_Alert(CONS_ERROR, M_GetText("Couldn't create %s\n"), filepath);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
M_CreateScreenShotPalette();
|
M_CreateScreenShotPalette();
|
||||||
ret = M_SavePNG(filepath, minigen->buf, minigen->w, minigen->h, screenshot_palette);
|
ret = M_SavePNG(filepath, minigen->buf, minigen->w, minigen->h, screenshot_palette);
|
||||||
|
|
||||||
failure:
|
free(minigen->buf);
|
||||||
if (minigen->buf != NULL)
|
|
||||||
free(minigen->buf);
|
|
||||||
|
|
||||||
if (ret)
|
if (ret)
|
||||||
{
|
{
|
||||||
|
|||||||
+1
-2
@@ -1385,8 +1385,7 @@ static void Polyobj_rotateThings(polyobj_t *po, vector2_t origin, angle_t delta,
|
|||||||
|
|
||||||
if (mo->player)
|
if (mo->player)
|
||||||
{
|
{
|
||||||
angle_t localangle = P_GetLocalAngle(mo->player);
|
P_ForceLocalAngle(mo->player, P_GetLocalAngle(mo->player) + delta);
|
||||||
P_ForceLocalAngle(mo->player, localangle + delta);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+5
-5
@@ -2229,12 +2229,12 @@ void R_StoreWallRange(INT32 start, INT32 stop)
|
|||||||
lowcutslope = std::max(worldbottomslope, worldlowslope) + viewz;
|
lowcutslope = std::max(worldbottomslope, worldlowslope) + viewz;
|
||||||
highcutslope = std::min(worldtopslope, worldhighslope) + viewz;
|
highcutslope = std::min(worldtopslope, worldhighslope) + viewz;
|
||||||
|
|
||||||
auto check_fof_offscreen = [&](ffloor_t* rover, INT32 bottom, INT32 bottomslope, INT32 top, INT32 topslope)
|
auto check_fof_offscreen = [&](ffloor_t* rrover, INT32 bottom, INT32 bottomslope, INT32 top, INT32 topslope)
|
||||||
{
|
{
|
||||||
return ((P_GetFFloorTopZAt (rover, segleft .x, segleft .y) <= bottom + viewz
|
return ((P_GetFFloorTopZAt (rrover, segleft .x, segleft .y) <= bottom + viewz
|
||||||
&& P_GetFFloorTopZAt (rover, segright.x, segright.y) <= bottomslope + viewz)
|
&& P_GetFFloorTopZAt (rrover, segright.x, segright.y) <= bottomslope + viewz)
|
||||||
|| ( P_GetFFloorBottomZAt (rover, segleft .x, segleft .y) >= top + viewz
|
|| ( P_GetFFloorBottomZAt (rrover, segleft .x, segleft .y) >= top + viewz
|
||||||
&& P_GetFFloorBottomZAt (rover, segright.x, segright.y) >= topslope + viewz));
|
&& P_GetFFloorBottomZAt (rrover, segright.x, segright.y) >= topslope + viewz));
|
||||||
};
|
};
|
||||||
|
|
||||||
if (frontsector->ffloors && backsector->ffloors)
|
if (frontsector->ffloors && backsector->ffloors)
|
||||||
|
|||||||
+1
-1
@@ -1577,7 +1577,7 @@ static void R_ProjectSprite(mobj_t *thing)
|
|||||||
else
|
else
|
||||||
blendmode = thing->blendmode;
|
blendmode = thing->blendmode;
|
||||||
|
|
||||||
if (thing->flags2 & MF2_SHADOW || thing->flags2 & MF2_SHADOW) // actually only the player should use this (temporary invisibility)
|
if (thing->flags2 & MF2_SHADOW) // actually only the player should use this (temporary invisibility)
|
||||||
trans = tr_trans80; // because now the translucency is set through FF_TRANSMASK
|
trans = tr_trans80; // because now the translucency is set through FF_TRANSMASK
|
||||||
else if (thing->frame & FF_TRANSMASK)
|
else if (thing->frame & FF_TRANSMASK)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1491,6 +1491,9 @@ musicdef_t *S_FindMusicCredit(const char *musname)
|
|||||||
{
|
{
|
||||||
def = S_GetMusicCredit(i);
|
def = S_GetMusicCredit(i);
|
||||||
|
|
||||||
|
if (!def)
|
||||||
|
continue;
|
||||||
|
|
||||||
if (hash != def->hash)
|
if (hash != def->hash)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
|||||||
+5
-4
@@ -42,8 +42,8 @@ INT32 setmodeneeded = 0; // video mode change needed if > 0 (the mode number to
|
|||||||
static CV_PossibleValue_t shittyscreen_cons_t[] = {{0, "Okay"}, {1, "Shitty"}, {2, "Extra Shitty"}, {0, NULL}};
|
static CV_PossibleValue_t shittyscreen_cons_t[] = {{0, "Okay"}, {1, "Shitty"}, {2, "Extra Shitty"}, {0, NULL}};
|
||||||
|
|
||||||
//added : 03-02-98: default screen mode, as loaded/saved in config
|
//added : 03-02-98: default screen mode, as loaded/saved in config
|
||||||
consvar_t cv_scr_width = {"scr_width", "1280", CV_SAVE, CV_Unsigned, NULL, 0, NULL, NULL, 0, 0, NULL};
|
consvar_t cv_scr_width = {"scr_width", "1280", CV_SAVE|CV_CALL, CV_Unsigned, VID_RefreshModeList, 0, NULL, NULL, 0, 0, NULL};
|
||||||
consvar_t cv_scr_height = {"scr_height", "800", CV_SAVE, CV_Unsigned, NULL, 0, NULL, NULL, 0, 0, NULL};
|
consvar_t cv_scr_height = {"scr_height", "800", CV_SAVE|CV_CALL, CV_Unsigned, VID_RefreshModeList, 0, NULL, NULL, 0, 0, NULL};
|
||||||
consvar_t cv_renderview = {"renderview", "On", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
consvar_t cv_renderview = {"renderview", "On", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||||
|
|
||||||
consvar_t cv_frameskip = {"frameskip", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
consvar_t cv_frameskip = {"frameskip", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||||
@@ -315,8 +315,9 @@ void SCR_CheckDefaultMode(void)
|
|||||||
void SCR_SetDefaultMode(void)
|
void SCR_SetDefaultMode(void)
|
||||||
{
|
{
|
||||||
// remember the default screen size
|
// remember the default screen size
|
||||||
CV_SetValue(&cv_scr_width, vid.width);
|
CV_StealthSetValue(&cv_scr_width, vid.width);
|
||||||
CV_SetValue(&cv_scr_height, vid.height);
|
CV_StealthSetValue(&cv_scr_height, vid.height);
|
||||||
|
VID_RefreshModeList(); // probably not needed but justin käs
|
||||||
}
|
}
|
||||||
|
|
||||||
// Change fullscreen on/off according to cv_fullscreen
|
// Change fullscreen on/off according to cv_fullscreen
|
||||||
|
|||||||
+8
-10
@@ -213,14 +213,12 @@ static char returnWadPath[256];
|
|||||||
#include "../byteptr.h"
|
#include "../byteptr.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
SDL_bool consolevent = SDL_FALSE;
|
boolean consolevent = false;
|
||||||
SDL_bool framebuffer = SDL_FALSE;
|
boolean framebuffer = false;
|
||||||
UINT8 keyboard_started = false;
|
UINT8 keyboard_started = false;
|
||||||
|
|
||||||
#ifdef HAVE_TERMIOS
|
#ifdef HAVE_TERMIOS
|
||||||
// TERMIOS console code from Quake3: thank you!
|
// TERMIOS console code from Quake3: thank you!
|
||||||
SDL_bool stdin_active = SDL_TRUE;
|
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
size_t cursor;
|
size_t cursor;
|
||||||
@@ -282,7 +280,7 @@ static void I_ShutdownConsole(void)
|
|||||||
if (consolevent)
|
if (consolevent)
|
||||||
{
|
{
|
||||||
I_OutputMsg("Shutdown tty console\n");
|
I_OutputMsg("Shutdown tty console\n");
|
||||||
consolevent = SDL_FALSE;
|
consolevent = false;
|
||||||
tcsetattr(STDIN_FILENO, TCSADRAIN, &tty_tc);
|
tcsetattr(STDIN_FILENO, TCSADRAIN, &tty_tc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -301,7 +299,7 @@ static void I_StartupConsole(void)
|
|||||||
framebuffer = static_cast<SDL_bool>( M_CheckParm("-framebuffer"));
|
framebuffer = static_cast<SDL_bool>( M_CheckParm("-framebuffer"));
|
||||||
|
|
||||||
if (framebuffer)
|
if (framebuffer)
|
||||||
consolevent = SDL_FALSE;
|
consolevent = false;
|
||||||
|
|
||||||
if (!consolevent)
|
if (!consolevent)
|
||||||
return;
|
return;
|
||||||
@@ -309,7 +307,7 @@ static void I_StartupConsole(void)
|
|||||||
if (isatty(STDIN_FILENO)!=1)
|
if (isatty(STDIN_FILENO)!=1)
|
||||||
{
|
{
|
||||||
I_OutputMsg("stdin is not a tty, tty console mode failed\n");
|
I_OutputMsg("stdin is not a tty, tty console mode failed\n");
|
||||||
consolevent = SDL_FALSE;
|
consolevent = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -511,7 +509,7 @@ static void I_StartupConsole(void)
|
|||||||
if (gotConsole)
|
if (gotConsole)
|
||||||
{
|
{
|
||||||
SetConsoleTitleA("SRB2Kart Console");
|
SetConsoleTitleA("SRB2Kart Console");
|
||||||
consolevent = SDL_TRUE;
|
consolevent = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Let get the real console HANDLE, because Mingw's Bash is bad!
|
//Let get the real console HANDLE, because Mingw's Bash is bad!
|
||||||
@@ -544,7 +542,7 @@ static inline void I_StartupConsole(void)
|
|||||||
framebuffer = M_CheckParm("-framebuffer");
|
framebuffer = M_CheckParm("-framebuffer");
|
||||||
|
|
||||||
if (framebuffer)
|
if (framebuffer)
|
||||||
consolevent = SDL_FALSE;
|
consolevent = false;
|
||||||
}
|
}
|
||||||
static inline void I_ShutdownConsole(void){}
|
static inline void I_ShutdownConsole(void){}
|
||||||
#endif
|
#endif
|
||||||
@@ -765,7 +763,7 @@ void I_JoyScale4(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Cheat to get the device index for a joystick handle
|
// Cheat to get the device index for a joystick handle
|
||||||
INT32 I_GetJoystickDeviceIndex(SDL_GameController *dev)
|
static INT32 I_GetJoystickDeviceIndex(SDL_GameController *dev)
|
||||||
{
|
{
|
||||||
SDL_Joystick *joystick = NULL;
|
SDL_Joystick *joystick = NULL;
|
||||||
|
|
||||||
|
|||||||
+266
-93
@@ -84,15 +84,20 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// maximum number of windowed modes (see windowedModes[][])
|
// maximum number of windowed modes (see windowedModes[][])
|
||||||
#define MAXWINMODES (22)
|
#define MAXWINMODES (128)
|
||||||
|
|
||||||
/** \brief
|
static void I_FillScreenResolutionsList(boolean force);
|
||||||
*/
|
|
||||||
static INT32 numVidModes = -1;
|
|
||||||
|
|
||||||
/** \brief
|
typedef struct
|
||||||
*/
|
{
|
||||||
static char vidModeName[33][32]; // allow 33 different modes
|
char name[10];
|
||||||
|
INT32 w;
|
||||||
|
INT32 h;
|
||||||
|
} video_mode_t;
|
||||||
|
|
||||||
|
static video_mode_t windowedModes[MAXWINMODES] = {{"320x200", 320, 200}}; // make sure the default mode exists
|
||||||
|
static const char *fallback_resolution_name = "Fallback";
|
||||||
|
static int vid_nummodes = 1;
|
||||||
|
|
||||||
rendermode_t rendermode = render_none;
|
rendermode_t rendermode = render_none;
|
||||||
|
|
||||||
@@ -139,9 +144,6 @@ static SDL_bool disable_mouse = SDL_FALSE;
|
|||||||
#define MOUSE_MENU false //(!disable_mouse && cv_usemouse.value && menuactive && !USE_FULLSCREEN)
|
#define MOUSE_MENU false //(!disable_mouse && cv_usemouse.value && menuactive && !USE_FULLSCREEN)
|
||||||
#define MOUSEBUTTONS_MAX MOUSEBUTTONS
|
#define MOUSEBUTTONS_MAX MOUSEBUTTONS
|
||||||
|
|
||||||
// first entry in the modelist which is not bigger than MAXVIDWIDTHxMAXVIDHEIGHT
|
|
||||||
static INT32 firstEntry = 0;
|
|
||||||
|
|
||||||
// Total mouse motion X/Y offsets
|
// Total mouse motion X/Y offsets
|
||||||
static INT32 mousemovex = 0, mousemovey = 0;
|
static INT32 mousemovex = 0, mousemovey = 0;
|
||||||
|
|
||||||
@@ -155,42 +157,13 @@ static SDL_bool usesdl2soft = SDL_FALSE;
|
|||||||
static SDL_bool borderlesswindow = SDL_FALSE;
|
static SDL_bool borderlesswindow = SDL_FALSE;
|
||||||
|
|
||||||
// SDL2 vars
|
// SDL2 vars
|
||||||
SDL_Window *window = NULL;
|
static SDL_Window *window = NULL;
|
||||||
SDL_Renderer *renderer = NULL;
|
static SDL_Renderer *renderer = NULL;
|
||||||
static SDL_Texture *texture = NULL;
|
static SDL_Texture *texture = NULL;
|
||||||
|
#ifdef HWRENDER
|
||||||
|
static SDL_GLContext sdlglcontext = NULL;
|
||||||
|
#endif
|
||||||
static SDL_bool havefocus = SDL_TRUE;
|
static SDL_bool havefocus = SDL_TRUE;
|
||||||
static const char *fallback_resolution_name = "Fallback";
|
|
||||||
|
|
||||||
// windowed video modes from which to choose from.
|
|
||||||
static INT32 windowedModes[MAXWINMODES][2] =
|
|
||||||
{
|
|
||||||
{2560,1440}, // 1.66
|
|
||||||
{1920,1200}, // 1.60,6.00
|
|
||||||
{1920,1080}, // 1.66
|
|
||||||
{1680,1050}, // 1.60,5.25
|
|
||||||
{1600,1200}, // 1.33
|
|
||||||
{1600, 900}, // 1.66
|
|
||||||
{1366, 768}, // 1.66
|
|
||||||
{1440, 900}, // 1.60,4.50
|
|
||||||
{1280,1024}, // 1.33?
|
|
||||||
{1280, 960}, // 1.33,4.00
|
|
||||||
{1280, 800}, // 1.60,4.00
|
|
||||||
{1280, 720}, // 1.66
|
|
||||||
{1152, 864}, // 1.33,3.60
|
|
||||||
{1024, 768}, // 1.33,3.20
|
|
||||||
{ 960, 600}, // 1.33,3.20
|
|
||||||
{ 800, 600}, // 1.33,2.50
|
|
||||||
{ 735, 415}, // 1.33,2.50
|
|
||||||
{ 640, 480}, // 1.33,2.00
|
|
||||||
{ 640, 400}, // 1.60,2.00
|
|
||||||
{ 500, 300}, // 1.33
|
|
||||||
{ 320, 240}, // 1.33,1.00
|
|
||||||
{ 320, 200}, // 1.60,1.00
|
|
||||||
};
|
|
||||||
|
|
||||||
#define CUSTOMMODENUM 9999
|
|
||||||
static INT32 custom_width = 0;
|
|
||||||
static INT32 custom_height = 0;
|
|
||||||
|
|
||||||
static SDL_bool Impl_CreateWindow(SDL_bool fullscreen);
|
static SDL_bool Impl_CreateWindow(SDL_bool fullscreen);
|
||||||
static void Impl_SetWindowIcon(void);
|
static void Impl_SetWindowIcon(void);
|
||||||
@@ -516,11 +489,20 @@ static void Impl_HandleWindowEvent(SDL_WindowEvent evt)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (windowmoved && rendermode == render_opengl)
|
if (windowmoved)
|
||||||
{
|
{
|
||||||
I_CheckDesktopRes();
|
I_CheckDesktopRes();
|
||||||
|
|
||||||
|
// if we say moved our game window to a different screen
|
||||||
|
// refetch our resolutions
|
||||||
|
I_FillScreenResolutionsList(false);
|
||||||
|
#ifdef HWRENDER
|
||||||
#ifdef USE_FBO_OGL
|
#ifdef USE_FBO_OGL
|
||||||
I_DownSample();
|
if (rendermode == render_opengl)
|
||||||
|
{
|
||||||
|
I_DownSample();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
windowmoved = SDL_FALSE;
|
windowmoved = SDL_FALSE;
|
||||||
}
|
}
|
||||||
@@ -537,7 +519,8 @@ static void Impl_HandleWindowEvent(SDL_WindowEvent evt)
|
|||||||
|
|
||||||
if (!firsttimeonmouse)
|
if (!firsttimeonmouse)
|
||||||
{
|
{
|
||||||
if (cv_usemouse.value) I_StartupMouse();
|
if (cv_usemouse.value)
|
||||||
|
I_StartupMouse();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (!mousefocus && !kbfocus)
|
else if (!mousefocus && !kbfocus)
|
||||||
@@ -1219,9 +1202,9 @@ static void VID_Command_ModeList_f(void)
|
|||||||
"Under opengl, fullscreen only supports native desktop resolution.\n"
|
"Under opengl, fullscreen only supports native desktop resolution.\n"
|
||||||
"Under software, the mode is stretched up to desktop resolution.\n");
|
"Under software, the mode is stretched up to desktop resolution.\n");
|
||||||
|
|
||||||
for (i = 0; i < MAXWINMODES; i++)
|
for (i = 0; i < vid_nummodes; i++)
|
||||||
{
|
{
|
||||||
CONS_Printf("%2d: %dx%d\n", i, windowedModes[i][0], windowedModes[i][1]);
|
CONS_Printf("%2d: %dx%d\n", i, windowedModes[i].w, windowedModes[i].h);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1260,7 +1243,7 @@ static void I_CheckDesktopRes(void)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (SDL_GetDesktopDisplayMode(currentDisplayIndex, &curmode) != 0)
|
if (SDL_GetCurrentDisplayMode(currentDisplayIndex, &curmode) != 0)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1275,6 +1258,11 @@ boolean I_CheckNativeRes(void)
|
|||||||
return (vid.width == desktopwidth && vid.height == desktopheight);
|
return (vid.width == desktopwidth && vid.height == desktopheight);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
boolean I_CheckAboveDesktopRes(INT32 width, INT32 height)
|
||||||
|
{
|
||||||
|
return (width > desktopwidth || height > desktopheight);
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef USE_FBO_OGL
|
#ifdef USE_FBO_OGL
|
||||||
|
|
||||||
void RefreshOGLSDLSurface(void)
|
void RefreshOGLSDLSurface(void)
|
||||||
@@ -1426,7 +1414,7 @@ void I_FinishUpdate(void)
|
|||||||
#ifdef HWRENDER
|
#ifdef HWRENDER
|
||||||
if (rendermode == render_opengl)
|
if (rendermode == render_opengl)
|
||||||
{
|
{
|
||||||
OglSdlFinishUpdate(cv_vidwait.value);
|
OglSdlFinishUpdate(window);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -1505,13 +1493,207 @@ void I_SetPalette(RGBA_t *palette)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// make sure the canonical resolutions are always available
|
||||||
|
static const struct {
|
||||||
|
const int w, h;
|
||||||
|
} canonicals[] = {
|
||||||
|
{1920, 1200}, // 16:10
|
||||||
|
{1280, 800}, // 16:10
|
||||||
|
{ 960, 600}, // 16:10
|
||||||
|
{ 640, 400}, // 16:10
|
||||||
|
{ 320, 200}, // Vanilla Doom
|
||||||
|
};
|
||||||
|
static const int num_canonicals = sizeof(canonicals)/sizeof(*canonicals);
|
||||||
|
|
||||||
|
// [FG] sort resolutions by width first and height second
|
||||||
|
static int cmp_resolutions(const void *a, const void *b)
|
||||||
|
{
|
||||||
|
const video_mode_t *ma = (const video_mode_t *) a;
|
||||||
|
const video_mode_t *mb = (const video_mode_t *) b;
|
||||||
|
|
||||||
|
return (ma->w == mb->w) ? mb->h - ma->h : mb->w - ma->w;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void I_AppendResolution(SDL_DisplayMode *mode, int *list_size)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
for (i = 0; i < *list_size; i++)
|
||||||
|
if (windowedModes[i].w == mode->w
|
||||||
|
&& windowedModes[i].h == mode->h)
|
||||||
|
return;
|
||||||
|
|
||||||
|
snprintf(windowedModes[*list_size].name,
|
||||||
|
sizeof(windowedModes[*list_size].name),
|
||||||
|
"%dx%d", mode->w, mode->h);
|
||||||
|
windowedModes[*list_size].w = mode->w;
|
||||||
|
windowedModes[*list_size].h = mode->h;
|
||||||
|
|
||||||
|
(*list_size)++;
|
||||||
|
}
|
||||||
|
|
||||||
|
// small helper to check if a video mode is canonical
|
||||||
|
static boolean IsModeCanonical(int w, int h)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < num_canonicals; i++)
|
||||||
|
{
|
||||||
|
if (canonicals[i].w == w && canonicals[i].h == h)
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// check if our desired resolution already is in the videomode list
|
||||||
|
static int IsCustomResolutionInList(int list_size)
|
||||||
|
{
|
||||||
|
INT32 custom_w = cv_scr_width.value;
|
||||||
|
INT32 custom_h = cv_scr_height.value;
|
||||||
|
|
||||||
|
// startup
|
||||||
|
if (!custom_w || !custom_h)
|
||||||
|
return -2;
|
||||||
|
|
||||||
|
// invalid resolution
|
||||||
|
// dont even attempt to add it
|
||||||
|
if (custom_w < BASEVIDWIDTH || custom_w > MAXVIDWIDTH
|
||||||
|
|| custom_h < BASEVIDHEIGHT || custom_h > MAXVIDHEIGHT)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
for (int i = 0; i < list_size; i++)
|
||||||
|
{
|
||||||
|
if (windowedModes[i].w == custom_w && windowedModes[i].h == custom_h)
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// I_FillScreenResolutionsList
|
||||||
|
// Get all the supported screen resolutions
|
||||||
|
// and fill the list with them
|
||||||
|
//
|
||||||
|
static void I_FillScreenResolutionsList(boolean force)
|
||||||
|
{
|
||||||
|
int currentDisplayIndex = -1;
|
||||||
|
static int oldDisplayIndex = -1;
|
||||||
|
SDL_DisplayMode mode;
|
||||||
|
int i = 0, list_size = 0;
|
||||||
|
int count = 0;
|
||||||
|
char custom_resolution[10];
|
||||||
|
|
||||||
|
currentDisplayIndex = SDL_GetWindowDisplayIndex(window);
|
||||||
|
|
||||||
|
// No valid index
|
||||||
|
if (currentDisplayIndex < 0)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// didnt change screen, no need to redo the list
|
||||||
|
if (!force && currentDisplayIndex == oldDisplayIndex)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
oldDisplayIndex = currentDisplayIndex;
|
||||||
|
|
||||||
|
// Don't call SDL_ListModes if SDL has not been initialized
|
||||||
|
count = SDL_GetNumDisplayModes(currentDisplayIndex);
|
||||||
|
|
||||||
|
list_size = 0;
|
||||||
|
|
||||||
|
// on success, SDL_GetNumDisplayModes() always returns at least 1
|
||||||
|
if (count > 0)
|
||||||
|
{
|
||||||
|
// -2 for the desired resolution and for NULL
|
||||||
|
count = min(count, MAXWINMODES - 2 - num_canonicals);
|
||||||
|
|
||||||
|
for (i = count - 1 + num_canonicals; i >= 0; i--)
|
||||||
|
{
|
||||||
|
// make sure the canonical resolutions are always available
|
||||||
|
if (i > count - 1)
|
||||||
|
{
|
||||||
|
mode.w = canonicals[i - count].w;
|
||||||
|
mode.h = canonicals[i - count].h;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SDL_GetDisplayMode(currentDisplayIndex, i, &mode);
|
||||||
|
}
|
||||||
|
|
||||||
|
I_AppendResolution(&mode, &list_size);
|
||||||
|
}
|
||||||
|
|
||||||
|
windowedModes[list_size].name[0] = '\0';
|
||||||
|
}
|
||||||
|
|
||||||
|
const int customresinlist = IsCustomResolutionInList(list_size);
|
||||||
|
|
||||||
|
if (customresinlist == 0)
|
||||||
|
{
|
||||||
|
// did not find mode from list, make custom resolution if the values somewhat make sense
|
||||||
|
if (list_size < MAXWINMODES)
|
||||||
|
{
|
||||||
|
snprintf(custom_resolution, sizeof(custom_resolution), "%dx%d", cv_scr_width.value, cv_scr_height.value);
|
||||||
|
|
||||||
|
// [FG] if the desired resolution not in the list, append it
|
||||||
|
snprintf(windowedModes[list_size].name,
|
||||||
|
sizeof(windowedModes[list_size].name),
|
||||||
|
"%dx%d", cv_scr_width.value, cv_scr_height.value);
|
||||||
|
windowedModes[list_size].w = cv_scr_width.value;
|
||||||
|
windowedModes[list_size].h = cv_scr_height.value;
|
||||||
|
list_size++;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
CONS_Alert(CONS_ERROR, "Could not set custom resolution!\n");
|
||||||
|
}
|
||||||
|
else if (customresinlist == -1)
|
||||||
|
CONS_Alert(CONS_ERROR, "Could not set custom resolution!\n");
|
||||||
|
|
||||||
|
// [FG] sort the list
|
||||||
|
SDL_qsort(windowedModes, list_size, sizeof(*windowedModes), cmp_resolutions);
|
||||||
|
|
||||||
|
// if we have more video modes than we can list
|
||||||
|
// try to shrink the list, lowest resolutions first
|
||||||
|
// whilst keeping the canonicals
|
||||||
|
if (list_size > MAXMODEDESCS)
|
||||||
|
{
|
||||||
|
// list is sorted from largest to smallest, so start at the end
|
||||||
|
for (i = list_size - 1; i >= 0 && list_size > MAXMODEDESCS; i--)
|
||||||
|
{
|
||||||
|
if (IsModeCanonical(windowedModes[i].w, windowedModes[i].h))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
// Should we like, instead prioritize checking for non aspect correct resolutions to remove?
|
||||||
|
|
||||||
|
// we gotta shift everything
|
||||||
|
// due to canonicals we cant just shrink the list
|
||||||
|
for (int k = i; k < list_size - 1; k++)
|
||||||
|
{
|
||||||
|
windowedModes[k] = windowedModes[k + 1];
|
||||||
|
}
|
||||||
|
|
||||||
|
list_size--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
windowedModes[list_size].name[0] = '\0';
|
||||||
|
vid_nummodes = list_size;
|
||||||
|
|
||||||
|
// be sure to update the video menu
|
||||||
|
if (menuactive &&
|
||||||
|
currentMenu == &OP_VideoModeDef)
|
||||||
|
M_VideoModeMenu(0);
|
||||||
|
}
|
||||||
|
|
||||||
// return number of fullscreen + X11 modes
|
// return number of fullscreen + X11 modes
|
||||||
INT32 VID_NumModes(void)
|
INT32 VID_NumModes(void)
|
||||||
{
|
{
|
||||||
if (USE_FULLSCREEN && numVidModes != -1)
|
return vid_nummodes;
|
||||||
return numVidModes - firstEntry;
|
|
||||||
else
|
|
||||||
return MAXWINMODES;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *VID_GetModeName(INT32 modeNum)
|
const char *VID_GetModeName(INT32 modeNum)
|
||||||
@@ -1521,42 +1703,34 @@ const char *VID_GetModeName(INT32 modeNum)
|
|||||||
return fallback_resolution_name;
|
return fallback_resolution_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (modeNum > MAXWINMODES)
|
if (modeNum > vid_nummodes)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
sprintf(&vidModeName[modeNum][0], "%dx%d",
|
return windowedModes[modeNum].name;
|
||||||
windowedModes[modeNum][0],
|
|
||||||
windowedModes[modeNum][1]);
|
|
||||||
|
|
||||||
return &vidModeName[modeNum][0];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
INT32 VID_GetModeForSize(INT32 w, INT32 h)
|
INT32 VID_GetModeForSize(INT32 w, INT32 h)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < MAXWINMODES; i++)
|
for (i = 0; i < vid_nummodes; i++)
|
||||||
{
|
{
|
||||||
if (windowedModes[i][0] == w && windowedModes[i][1] == h)
|
if (windowedModes[i].w == w && windowedModes[i].h == h)
|
||||||
{
|
{
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// did not find mode from list, make custom resolution if the values somewhat make sense
|
|
||||||
// opengl mode does not mind about max resolution defined in screen.h
|
|
||||||
// if not using opengl, check against the maximum as well
|
|
||||||
if ((w >= BASEVIDWIDTH && h >= BASEVIDHEIGHT) &&
|
|
||||||
(rendermode == render_opengl || (w <= MAXVIDWIDTH && h <= MAXVIDHEIGHT)))
|
|
||||||
{
|
|
||||||
custom_width = w;
|
|
||||||
custom_height = h;
|
|
||||||
return CUSTOMMODENUM;
|
|
||||||
}
|
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void VID_RefreshModeList(void)
|
||||||
|
{
|
||||||
|
// check if we even need to rebuild the list
|
||||||
|
if (IsCustomResolutionInList(vid_nummodes) == 0)
|
||||||
|
I_FillScreenResolutionsList(true);
|
||||||
|
}
|
||||||
|
|
||||||
void VID_PrepareModeList(void)
|
void VID_PrepareModeList(void)
|
||||||
{
|
{
|
||||||
// Under SDL2, we just use the windowed modes list, and scale in windowed fullscreen.
|
// Under SDL2, we just use the windowed modes list, and scale in windowed fullscreen.
|
||||||
@@ -1588,17 +1762,10 @@ INT32 VID_SetMode(INT32 modeNum)
|
|||||||
{
|
{
|
||||||
vid.recalc = true;
|
vid.recalc = true;
|
||||||
|
|
||||||
if (modeNum >= 0 && modeNum < MAXWINMODES)
|
if (modeNum >= 0 && modeNum < vid_nummodes)
|
||||||
{
|
{
|
||||||
vid.width = windowedModes[modeNum][0];
|
vid.width = windowedModes[modeNum].w;
|
||||||
vid.height = windowedModes[modeNum][1];
|
vid.height = windowedModes[modeNum].h;
|
||||||
vid.modenum = modeNum;
|
|
||||||
}
|
|
||||||
else if (modeNum == CUSTOMMODENUM && custom_width && custom_height)
|
|
||||||
{
|
|
||||||
// at this point these values are assumed to be okay
|
|
||||||
vid.width = custom_width;
|
|
||||||
vid.height = custom_height;
|
|
||||||
vid.modenum = modeNum;
|
vid.modenum = modeNum;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -1631,7 +1798,6 @@ INT32 VID_SetMode(INT32 modeNum)
|
|||||||
return SDL_TRUE;
|
return SDL_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static SDL_bool Impl_CreateContext(void)
|
static SDL_bool Impl_CreateContext(void)
|
||||||
{
|
{
|
||||||
// Renderer-specific stuff
|
// Renderer-specific stuff
|
||||||
@@ -1654,6 +1820,9 @@ static SDL_bool Impl_CreateContext(void)
|
|||||||
I_Error("Failed to set up GL context: %s\n", SDL_GetError());
|
I_Error("Failed to set up GL context: %s\n", SDL_GetError());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// be sure to fill the resolution list the moment we have a window
|
||||||
|
I_FillScreenResolutionsList(false);
|
||||||
|
|
||||||
return SDL_TRUE;
|
return SDL_TRUE;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -1695,6 +1864,9 @@ static SDL_bool Impl_CreateContext(void)
|
|||||||
|
|
||||||
SDL_RenderSetLogicalSize(renderer, BASEVIDWIDTH, BASEVIDHEIGHT);
|
SDL_RenderSetLogicalSize(renderer, BASEVIDWIDTH, BASEVIDHEIGHT);
|
||||||
|
|
||||||
|
// be sure to fill the resolution list the moment we have a window
|
||||||
|
I_FillScreenResolutionsList(false);
|
||||||
|
|
||||||
return SDL_TRUE;
|
return SDL_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1932,8 +2104,6 @@ void I_StartupGraphics(void)
|
|||||||
usesdl2soft = M_CheckParm("-softblit");
|
usesdl2soft = M_CheckParm("-softblit");
|
||||||
borderlesswindow = M_CheckParm("-borderless");
|
borderlesswindow = M_CheckParm("-borderless");
|
||||||
|
|
||||||
VID_Command_ModeList_f();
|
|
||||||
|
|
||||||
#ifdef HWRENDER
|
#ifdef HWRENDER
|
||||||
if (rendermode == render_opengl)
|
if (rendermode == render_opengl)
|
||||||
{
|
{
|
||||||
@@ -1957,6 +2127,9 @@ void I_StartupGraphics(void)
|
|||||||
vid.height = BASEVIDHEIGHT; // BitsPerPixel is the SDL interface's
|
vid.height = BASEVIDHEIGHT; // BitsPerPixel is the SDL interface's
|
||||||
vid.recalc = true; // Set up the console stufff
|
vid.recalc = true; // Set up the console stufff
|
||||||
|
|
||||||
|
// be sure to print AFTER window creation
|
||||||
|
VID_Command_ModeList_f();
|
||||||
|
|
||||||
#ifdef HAVE_TTF
|
#ifdef HAVE_TTF
|
||||||
I_ShutdownTTF();
|
I_ShutdownTTF();
|
||||||
#endif
|
#endif
|
||||||
@@ -2028,17 +2201,17 @@ UINT32 I_GetRefreshRate(void)
|
|||||||
|
|
||||||
static void Impl_SetVsync(void)
|
static void Impl_SetVsync(void)
|
||||||
{
|
{
|
||||||
#if SDL_VERSION_ATLEAST(2,0,18)
|
|
||||||
if (renderer)
|
|
||||||
SDL_RenderSetVSync(renderer, cv_vidwait.value);
|
|
||||||
#endif
|
|
||||||
#ifdef HWRENDER
|
#ifdef HWRENDER
|
||||||
if (!renderer && rendermode == render_opengl &&
|
if (rendermode == render_opengl &&
|
||||||
sdlglcontext != NULL && SDL_GL_GetCurrentContext() == sdlglcontext)
|
sdlglcontext != NULL && SDL_GL_GetCurrentContext() == sdlglcontext)
|
||||||
{
|
{
|
||||||
SDL_GL_SetSwapInterval(cv_vidwait.value ? 1 : 0);
|
SDL_GL_SetSwapInterval(cv_vidwait.value ? 1 : 0);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
#if SDL_VERSION_ATLEAST(2,0,18)
|
||||||
|
if (renderer)
|
||||||
|
SDL_RenderSetVSync(renderer, cv_vidwait.value);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void I_SetBorderlessWindow(void)
|
void I_SetBorderlessWindow(void)
|
||||||
|
|||||||
@@ -461,7 +461,7 @@ void *I_GetSfx(sfxinfo_t *sfx)
|
|||||||
gme_track_info(emu, &info, 0);
|
gme_track_info(emu, &info, 0);
|
||||||
|
|
||||||
len = (info->play_length * 441 / 10) << 2;
|
len = (info->play_length * 441 / 10) << 2;
|
||||||
mem = Z_Malloc(len, PU_SOUND, 0);
|
mem = Z_Malloc(len, PU_SOUND, NULL);
|
||||||
|
|
||||||
gme_play(emu, len >> 1, mem);
|
gme_play(emu, len >> 1, mem);
|
||||||
gme_free_info(info);
|
gme_free_info(info);
|
||||||
@@ -499,7 +499,7 @@ void *I_GetSfx(sfxinfo_t *sfx)
|
|||||||
gme_track_info(emu, &info, 0);
|
gme_track_info(emu, &info, 0);
|
||||||
|
|
||||||
len = (info->play_length * 441 / 10) << 2;
|
len = (info->play_length * 441 / 10) << 2;
|
||||||
mem = Z_Malloc(len, PU_SOUND, 0);
|
mem = Z_Malloc(len, PU_SOUND, NULL);
|
||||||
|
|
||||||
gme_play(emu, len >> 1, mem);
|
gme_play(emu, len >> 1, mem);
|
||||||
gme_free_info(info);
|
gme_free_info(info);
|
||||||
|
|||||||
+2
-38
@@ -63,25 +63,15 @@ PFNglGetString pglGetString;
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef USE_FBO_OGL
|
#ifdef USE_FBO_OGL
|
||||||
|
|
||||||
#if defined (__unix__)
|
|
||||||
static boolean xwaylandcrap = false;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
boolean UseScreenFBO(void)
|
boolean UseScreenFBO(void)
|
||||||
{
|
{
|
||||||
return ((supportFBO && cv_glframebuffer.value && downsample)
|
return (supportFBO && cv_glframebuffer.value && downsample);
|
||||||
#if defined (__unix__)
|
|
||||||
|| (supportFBO && xwaylandcrap)
|
|
||||||
#endif
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/** \brief SDL video display surface
|
/** \brief SDL video display surface
|
||||||
*/
|
*/
|
||||||
INT32 oglflags = 0;
|
INT32 oglflags = 0;
|
||||||
SDL_GLContext sdlglcontext = NULL;
|
|
||||||
|
|
||||||
void *GetGLFunc(const char *proc)
|
void *GetGLFunc(const char *proc)
|
||||||
{
|
{
|
||||||
@@ -201,17 +191,6 @@ boolean OglSdlSurface(INT32 w, INT32 h)
|
|||||||
supportNPO2tex = true;
|
supportNPO2tex = true;
|
||||||
|
|
||||||
glanisotropicmode_cons_t[1].value = maximumAnisotropy;
|
glanisotropicmode_cons_t[1].value = maximumAnisotropy;
|
||||||
|
|
||||||
#if defined (__unix__)
|
|
||||||
#ifdef USE_FBO_OGL
|
|
||||||
// TODO: delet this since nvidia fixed their shit on 575
|
|
||||||
char videodriver[4] = {'S','D','L',0};
|
|
||||||
if (supportFBO && strstr((const char*)gl_renderer, "NVIDIA")
|
|
||||||
&& (*strncpy(videodriver, SDL_GetCurrentVideoDriver(), sizeof(videodriver)-1) != '\0')
|
|
||||||
&& (strncasecmp("x11", videodriver, 4) == 0))
|
|
||||||
xwaylandcrap = true;
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SDL_GL_SetSwapInterval(cv_vidwait.value ? 1 : 0);
|
SDL_GL_SetSwapInterval(cv_vidwait.value ? 1 : 0);
|
||||||
@@ -241,22 +220,14 @@ boolean OglSdlSurface(INT32 w, INT32 h)
|
|||||||
|
|
||||||
\return void
|
\return void
|
||||||
*/
|
*/
|
||||||
void OglSdlFinishUpdate(boolean waitvbl)
|
void OglSdlFinishUpdate(SDL_Window *window)
|
||||||
{
|
{
|
||||||
static boolean oldwaitvbl = false;
|
|
||||||
int sdlw, sdlh;
|
int sdlw, sdlh;
|
||||||
|
|
||||||
#ifdef USE_FBO_OGL
|
#ifdef USE_FBO_OGL
|
||||||
const boolean usefbo = UseScreenFBO();
|
const boolean usefbo = UseScreenFBO();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (oldwaitvbl != waitvbl)
|
|
||||||
{
|
|
||||||
SDL_GL_SetSwapInterval(waitvbl ? 1 : 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
oldwaitvbl = waitvbl;
|
|
||||||
|
|
||||||
SDL_GetWindowSize(window, &sdlw, &sdlh);
|
SDL_GetWindowSize(window, &sdlw, &sdlh);
|
||||||
HWR_MakeScreenFinalTexture();
|
HWR_MakeScreenFinalTexture();
|
||||||
|
|
||||||
@@ -289,13 +260,6 @@ void OglSdlFinishUpdate(boolean waitvbl)
|
|||||||
if (!I_CheckNativeRes() || WipeInAction)
|
if (!I_CheckNativeRes() || WipeInAction)
|
||||||
#endif
|
#endif
|
||||||
HWR_DrawScreenFinalTexture(realwidth, realheight, false);
|
HWR_DrawScreenFinalTexture(realwidth, realheight, false);
|
||||||
|
|
||||||
#if defined (__unix__)
|
|
||||||
#ifdef USE_FBO_OGL
|
|
||||||
if (loaded_config)
|
|
||||||
xwaylandcrap = false;
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif //HWRENDER
|
#endif //HWRENDER
|
||||||
|
|||||||
+1
-3
@@ -20,11 +20,9 @@
|
|||||||
|
|
||||||
boolean OglSdlSurface(INT32 w, INT32 h);
|
boolean OglSdlSurface(INT32 w, INT32 h);
|
||||||
|
|
||||||
void OglSdlFinishUpdate(boolean vidwait);
|
void OglSdlFinishUpdate(SDL_Window *window);
|
||||||
boolean VID_LoadOGLAPI(void);
|
boolean VID_LoadOGLAPI(void);
|
||||||
|
|
||||||
extern SDL_Renderer *renderer;
|
|
||||||
extern SDL_GLContext sdlglcontext;
|
|
||||||
extern Uint16 realwidth;
|
extern Uint16 realwidth;
|
||||||
extern Uint16 realheight;
|
extern Uint16 realheight;
|
||||||
|
|
||||||
@@ -23,9 +23,6 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern SDL_bool consolevent;
|
|
||||||
extern SDL_bool framebuffer;
|
|
||||||
|
|
||||||
#include "../m_fixed.h"
|
#include "../m_fixed.h"
|
||||||
|
|
||||||
// SDL2 stub macro
|
// SDL2 stub macro
|
||||||
@@ -67,21 +64,6 @@ extern SDLJoyInfo_t JoyInfo[4]; //MAXSPLITSCREENPLAYERS
|
|||||||
#define SDL_JDEADZONE 153
|
#define SDL_JDEADZONE 153
|
||||||
#undef SDL_JDEADZONE
|
#undef SDL_JDEADZONE
|
||||||
|
|
||||||
// So we can call this from i_video event loop
|
|
||||||
void I_ShutdownJoystick(UINT8 index);
|
|
||||||
|
|
||||||
// Cheat to get the device index for a game controller handle
|
|
||||||
INT32 I_GetJoystickDeviceIndex(SDL_GameController *dev);
|
|
||||||
|
|
||||||
// Quick thing to make SDL_JOYDEVICEADDED events less of an abomination
|
|
||||||
void I_UpdateJoystickDeviceIndex(UINT8 player);
|
|
||||||
void I_UpdateJoystickDeviceIndices(UINT8 excludePlayer);
|
|
||||||
|
|
||||||
void I_GetConsoleEvents(void);
|
|
||||||
|
|
||||||
// Needed for some WIN32 functions
|
|
||||||
extern SDL_Window *window;
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
} // extern "C"
|
} // extern "C"
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+20
-1
@@ -1997,11 +1997,16 @@ void *W_CachePatchNameRotated(const char *name, INT32 rotationangle, INT32 tag)
|
|||||||
|
|
||||||
rspr = (rotsprite_t *)W_GetCachedRotPatchPwad(WADFILENUM(num),LUMPNUM(num));
|
rspr = (rotsprite_t *)W_GetCachedRotPatchPwad(WADFILENUM(num),LUMPNUM(num));
|
||||||
|
|
||||||
|
if (rspr == NULL)
|
||||||
|
return W_CachePatchNum(W_GetNumForName("MISSING"), tag);
|
||||||
|
|
||||||
if (rspr->patches[idx] == NULL)
|
if (rspr->patches[idx] == NULL)
|
||||||
{
|
{
|
||||||
INT32 xpivot = 0, ypivot = 0;
|
INT32 xpivot = 0, ypivot = 0;
|
||||||
|
|
||||||
ptr = (patch_t *)W_CachePatchNum(num, PU_PATCH);
|
ptr = (patch_t *)W_CachePatchNum(num, PU_PATCH);
|
||||||
|
if (ptr == NULL)
|
||||||
|
return W_CachePatchNum(W_GetNumForName("MISSING"), tag);
|
||||||
|
|
||||||
// >y pivot centered
|
// >y pivot centered
|
||||||
// >x pivot not centered
|
// >x pivot not centered
|
||||||
@@ -2612,6 +2617,9 @@ virtres_t* vres_GetMap(lumpnum_t lumpnum)
|
|||||||
|
|
||||||
// Remember that we're assuming that the WAD will have a specific set of lumps in a specific order.
|
// Remember that we're assuming that the WAD will have a specific set of lumps in a specific order.
|
||||||
UINT8 *wadData = (UINT8*)(W_CacheLumpNum(lumpnum, PU_LEVEL));
|
UINT8 *wadData = (UINT8*)(W_CacheLumpNum(lumpnum, PU_LEVEL));
|
||||||
|
if (wadData == NULL)
|
||||||
|
I_Error("vres_GetMap: Invalid WadData!\n");
|
||||||
|
|
||||||
filelump_t *fileinfo = (filelump_t *)(wadData + LONG(((wadinfo_t *)wadData)->infotableofs));
|
filelump_t *fileinfo = (filelump_t *)(wadData + LONG(((wadinfo_t *)wadData)->infotableofs));
|
||||||
|
|
||||||
i = LONG(((wadinfo_t *)wadData)->numlumps);
|
i = LONG(((wadinfo_t *)wadData)->numlumps);
|
||||||
@@ -2628,6 +2636,8 @@ virtres_t* vres_GetMap(lumpnum_t lumpnum)
|
|||||||
}
|
}
|
||||||
|
|
||||||
vlumps = (virtlump_t*)(Z_Malloc(sizeof(virtlump_t)*numlumps, PU_LEVEL, NULL));
|
vlumps = (virtlump_t*)(Z_Malloc(sizeof(virtlump_t)*numlumps, PU_LEVEL, NULL));
|
||||||
|
if (vlumps == NULL)
|
||||||
|
I_Error("vres_GetMap: Out of memory!\n");
|
||||||
|
|
||||||
// Build the lumps, skipping over empty entries.
|
// Build the lumps, skipping over empty entries.
|
||||||
for (i = 0, realentry = 0; i < numlumps; realentry++)
|
for (i = 0, realentry = 0; i < numlumps; realentry++)
|
||||||
@@ -2663,7 +2673,11 @@ virtres_t* vres_GetMap(lumpnum_t lumpnum)
|
|||||||
lumpnum_t lumppos = lumpnum + 1;
|
lumpnum_t lumppos = lumpnum + 1;
|
||||||
for (i = LUMPNUM(lumppos); i < wadfiles[WADFILENUM(lumpnum)]->numlumps; i++, lumppos++, numlumps++)
|
for (i = LUMPNUM(lumppos); i < wadfiles[WADFILENUM(lumpnum)]->numlumps; i++, lumppos++, numlumps++)
|
||||||
{
|
{
|
||||||
if (memcmp(W_CheckNameForNum(lumppos), "MAP", 3) == 0 || W_LumpLength(lumppos) == 0)
|
const char *name = W_CheckNameForNum(lumppos);
|
||||||
|
if (name == NULL)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (memcmp(name, "MAP", 3) == 0 || W_LumpLength(lumppos) == 0)
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -2671,10 +2685,15 @@ virtres_t* vres_GetMap(lumpnum_t lumpnum)
|
|||||||
numlumps++;
|
numlumps++;
|
||||||
|
|
||||||
vlumps = (virtlump_t*)(Z_Malloc(sizeof(virtlump_t)*numlumps, PU_LEVEL, NULL));
|
vlumps = (virtlump_t*)(Z_Malloc(sizeof(virtlump_t)*numlumps, PU_LEVEL, NULL));
|
||||||
|
if (vlumps == NULL)
|
||||||
|
I_Error("vres_GetMap: Out of memory!\n");
|
||||||
|
|
||||||
for (i = 0; i < numlumps; i++, lumpnum++)
|
for (i = 0; i < numlumps; i++, lumpnum++)
|
||||||
{
|
{
|
||||||
// Check if it is map marker. It is not always first lump sadly, so we need to expect it anywhere
|
// Check if it is map marker. It is not always first lump sadly, so we need to expect it anywhere
|
||||||
const char *name = W_CheckNameForNum(lumpnum);
|
const char *name = W_CheckNameForNum(lumpnum);
|
||||||
|
if (name == NULL)
|
||||||
|
continue;
|
||||||
|
|
||||||
if (strlen(name) == 5 && memcmp(name, "MAP", 3) == 0)
|
if (strlen(name) == 5 && memcmp(name, "MAP", 3) == 0)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in new issue
Block a user