Merge branch 'master' into menu_for_real

This commit is contained in:
Christoph Oelckers 2019-11-29 00:49:33 +01:00
commit 5590abd471
4 changed files with 30 additions and 28 deletions

View file

@ -4807,23 +4807,20 @@ void G_Polymer_UnInit(void) { }
#include "saveable.h" #include "saveable.h"
saveable_module saveable_build{};
void Saveable_Init_Dynamic()
{
static saveable_data saveable_build_data[] = static saveable_data saveable_build_data[] =
{ {
SAVE_DATA(sector), {sector, MAXSECTORS*sizeof(sectortype)},
SAVE_DATA(sprite), {sprite, MAXSPRITES*sizeof(spritetype)},
SAVE_DATA(wall) {wall, MAXWALLS*sizeof(walltype)},
}; };
saveable_module saveable_build = saveable_build.data = saveable_build_data;
{ saveable_build.numdata = NUM_SAVEABLE_ITEMS(saveable_build_data);
// code }
NULL,
0,
// data
saveable_build_data,
NUM_SAVEABLE_ITEMS(saveable_build_data)
};
/*extern*/ bool GameInterface::validate_hud(int requested_size) { return requested_size; } /*extern*/ bool GameInterface::validate_hud(int requested_size) { return requested_size; }
/*extern*/ void GameInterface::set_hud_layout(int requested_size) { /* the relevant setting is gs.BorderNum */} /*extern*/ void GameInterface::set_hud_layout(int requested_size) { /* the relevant setting is gs.BorderNum */}

View file

@ -522,7 +522,7 @@ MenuGroup LoadGameGroup = {100, 5, "^Load Game", load_i, pic_loadgame, 0, m_defs
#define MAIN_XSTART 55 #define MAIN_XSTART 55
#define MAIN_LINE(line) (MAIN_YSTART + (MAIN_YOFF * line)) #define MAIN_LINE(line) (MAIN_YSTART + (MAIN_YOFF * line))
#define MAIN_MENU_COOL_STUFF "^Cool Stuff" #define MAIN_MENU_COOL_STUFF "^Credits"
#define MAIN_MENU_HOW_TO_ORDER "^How to Order" #define MAIN_MENU_HOW_TO_ORDER "^How to Order"
MenuItem main_i[] = MenuItem main_i[] =
@ -1259,29 +1259,24 @@ MNU_OrderCustom(UserCall call, MenuItem *item)
static short RegOrderScreen[] = static short RegOrderScreen[] =
{ {
5262, // 5262,
5261, // 5261,
4979,
5111, 5111,
5118, 5118,
4979,
5113, 5113,
//5111,
//5118,
//4979,
//5261,
//5262
5120 // 5114 // JBF: for my credits 5120 // 5114 // JBF: for my credits
}; };
static short SWOrderScreen[] = static short SWOrderScreen[] =
{ {
5262,
5110, 5110,
5112, 5112,
5113, // 5262,
5111, 5111,
5118, 5118,
4979, 4979,
5113,
5120 // 5114 // JBF: for my credits 5120 // 5114 // JBF: for my credits
}; };

View file

@ -38,6 +38,8 @@ void Saveable_Init(void)
{ {
if (nummodules > 0) return; if (nummodules > 0) return;
Saveable_Init_Dynamic();
#define MODULE(x) { \ #define MODULE(x) { \
extern saveable_module saveable_ ## x; \ extern saveable_module saveable_ ## x; \
saveablemodules[nummodules++] = &saveable_ ## x; \ saveablemodules[nummodules++] = &saveable_ ## x; \

View file

@ -24,6 +24,7 @@
#ifndef SAVEABLE_H #ifndef SAVEABLE_H
#define SAVEABLE_H #define SAVEABLE_H
#include "compat.h"
typedef void *saveable_code; typedef void *saveable_code;
@ -42,10 +43,16 @@ typedef struct
unsigned int numdata; unsigned int numdata;
} saveable_module; } saveable_module;
#define SAVE_CODE(s) (void*)s template <typename T>
#define SAVE_DATA(s) { (void*)&s, sizeof(s) } static FORCE_INLINE constexpr enable_if_t<!std::is_pointer<T>::value, size_t> SAVE_SIZEOF(T const & obj) noexcept
{
return sizeof(obj);
}
#define NUM_SAVEABLE_ITEMS(x) (sizeof(x)/sizeof(x[0])) #define SAVE_CODE(s) (void*)(s)
#define SAVE_DATA(s) { (void*)&(s), SAVE_SIZEOF(s) }
#define NUM_SAVEABLE_ITEMS(x) ARRAY_SIZE(x)
typedef struct typedef struct
{ {
@ -61,6 +68,7 @@ typedef struct
} saveddatasym; } saveddatasym;
void Saveable_Init(void); void Saveable_Init(void);
void Saveable_Init_Dynamic(void);
int Saveable_FindCodeSym(void *ptr, savedcodesym *sym); int Saveable_FindCodeSym(void *ptr, savedcodesym *sym);
int Saveable_FindDataSym(void *ptr, saveddatasym *sym); int Saveable_FindDataSym(void *ptr, saveddatasym *sym);