diff options
author | Nikolay Korolev <nickvnuk@gmail.com> | 2021-01-24 11:42:45 +0100 |
---|---|---|
committer | Nikolay Korolev <nickvnuk@gmail.com> | 2021-01-24 11:42:45 +0100 |
commit | ee89c485fcce7f3b9a189f7a80b3a1b2933f79bd (patch) | |
tree | ba8ccf97a2fd5aff3180f7ad600a53a4d29cf9ff /src/extras | |
parent | fix (diff) | |
download | re3-ee89c485fcce7f3b9a189f7a80b3a1b2933f79bd.tar re3-ee89c485fcce7f3b9a189f7a80b3a1b2933f79bd.tar.gz re3-ee89c485fcce7f3b9a189f7a80b3a1b2933f79bd.tar.bz2 re3-ee89c485fcce7f3b9a189f7a80b3a1b2933f79bd.tar.lz re3-ee89c485fcce7f3b9a189f7a80b3a1b2933f79bd.tar.xz re3-ee89c485fcce7f3b9a189f7a80b3a1b2933f79bd.tar.zst re3-ee89c485fcce7f3b9a189f7a80b3a1b2933f79bd.zip |
Diffstat (limited to 'src/extras')
-rw-r--r-- | src/extras/custompipes.cpp | 2 | ||||
-rw-r--r-- | src/extras/custompipes_d3d9.cpp | 2 | ||||
-rw-r--r-- | src/extras/frontendoption.cpp | 6 | ||||
-rw-r--r-- | src/extras/frontendoption.h | 6 | ||||
-rw-r--r-- | src/extras/ini_parser.hpp | 19 | ||||
-rw-r--r-- | src/extras/postfx.cpp | 3 | ||||
-rw-r--r-- | src/extras/screendroplets.cpp | 2 |
7 files changed, 30 insertions, 10 deletions
diff --git a/src/extras/custompipes.cpp b/src/extras/custompipes.cpp index 247aa4b1..390ec475 100644 --- a/src/extras/custompipes.cpp +++ b/src/extras/custompipes.cpp @@ -1,4 +1,4 @@ -#define WITH_D3D +#define WITHD3D #include "common.h" #ifdef EXTENDED_PIPELINES diff --git a/src/extras/custompipes_d3d9.cpp b/src/extras/custompipes_d3d9.cpp index 551d1a74..68337fb6 100644 --- a/src/extras/custompipes_d3d9.cpp +++ b/src/extras/custompipes_d3d9.cpp @@ -1,4 +1,4 @@ -#define WITH_D3D +#define WITHD3D #include "common.h" #ifdef RW_D3D9 diff --git a/src/extras/frontendoption.cpp b/src/extras/frontendoption.cpp index 8a95a49a..2660e75e 100644 --- a/src/extras/frontendoption.cpp +++ b/src/extras/frontendoption.cpp @@ -111,7 +111,7 @@ void FrontendOptionAddBuiltinAction(const char* gxtKey, uint16 x, uint16 y, uint option.m_TargetMenu = targetMenu; } -void FrontendOptionAddSelect(const char* gxtKey, uint16 x, uint16 y, uint8 align, const char** rightTexts, int8 numRightTexts, int8 *var, bool onlyApplyOnEnter, ChangeFunc changeFunc, const char* saveName, bool disableIfGameLoaded) +void FrontendOptionAddSelect(const char* gxtKey, uint16 x, uint16 y, uint8 align, const char** rightTexts, int8 numRightTexts, int8 *var, bool onlyApplyOnEnter, ChangeFunc changeFunc, const char* saveCat, const char* saveName, bool disableIfGameLoaded) { int8 screenOptionOrder = RegisterNewOption(); @@ -130,13 +130,14 @@ void FrontendOptionAddSelect(const char* gxtKey, uint16 x, uint16 y, uint8 align option.m_CFOSelect->displayedValue = *var; option.m_CFOSelect->lastSavedValue = *var; } + option.m_CFOSelect->saveCat = saveCat; option.m_CFOSelect->save = saveName; option.m_CFOSelect->onlyApplyOnEnter = onlyApplyOnEnter; option.m_CFOSelect->changeFunc = changeFunc; option.m_CFOSelect->disableIfGameLoaded = disableIfGameLoaded; } -void FrontendOptionAddDynamic(const char* gxtKey, uint16 x, uint16 y, uint8 align, DrawFunc drawFunc, int8 *var, ButtonPressFunc buttonPressFunc, const char* saveName) +void FrontendOptionAddDynamic(const char* gxtKey, uint16 x, uint16 y, uint8 align, DrawFunc drawFunc, int8 *var, ButtonPressFunc buttonPressFunc, const char* saveCat, const char* saveName) { int8 screenOptionOrder = RegisterNewOption(); @@ -150,6 +151,7 @@ void FrontendOptionAddDynamic(const char* gxtKey, uint16 x, uint16 y, uint8 alig option.m_CFODynamic->drawFunc = drawFunc; option.m_CFODynamic->buttonPressFunc = buttonPressFunc; option.m_CFODynamic->value = var; + option.m_CFODynamic->saveCat = saveCat; option.m_CFODynamic->save = saveName; } diff --git a/src/extras/frontendoption.h b/src/extras/frontendoption.h index 2719f076..05cd5fa0 100644 --- a/src/extras/frontendoption.h +++ b/src/extras/frontendoption.h @@ -76,10 +76,10 @@ uint8 GetNumberOfMenuOptions(int screen); void FrontendOptionSetCursor(int screen, int8 option, bool overwrite = false); -// var is optional in AddDynamic, enables you to save them in an INI file(also needs passing char array to saveName param. obv), otherwise pass nil/0 +// var is optional in AddDynamic, enables you to save them in an INI file(also needs passing char array to saveCat and saveKey param. obv), otherwise pass nil/0 void FrontendOptionAddBuiltinAction(const char* gxtKey, uint16 x, uint16 y, uint8 align, int action, int targetMenu = MENUPAGE_NONE, int saveSlot = SAVESLOT_NONE); -void FrontendOptionAddSelect(const char* gxtKey, uint16 x, uint16 y, uint8 align, const char** rightTexts, int8 numRightTexts, int8 *var, bool onlyApplyOnEnter, ChangeFunc changeFunc, const char* saveName = nil, bool disableIfGameLoaded = false); -void FrontendOptionAddDynamic(const char* gxtKey, uint16 x, uint16 y, uint8 align, DrawFunc rightTextDrawFunc, int8 *var, ButtonPressFunc buttonPressFunc, const char* saveName = nil); +void FrontendOptionAddSelect(const char* gxtKey, uint16 x, uint16 y, uint8 align, const char** rightTexts, int8 numRightTexts, int8 *var, bool onlyApplyOnEnter, ChangeFunc changeFunc, const char* saveCat = nil, const char* saveKey = nil, bool disableIfGameLoaded = false); +void FrontendOptionAddDynamic(const char* gxtKey, uint16 x, uint16 y, uint8 align, DrawFunc rightTextDrawFunc, int8 *var, ButtonPressFunc buttonPressFunc, const char* saveCat = nil, const char* saveKey = nil); // lineHeight = 0 means game will use MENU_DEFAULT_LINE_HEIGHT uint8 FrontendScreenAdd(const char* gxtKey, int prevPage, int lineHeight, bool showLeftRightHelper, ReturnPrevPageFunc returnPrevPageFunc = nil); diff --git a/src/extras/ini_parser.hpp b/src/extras/ini_parser.hpp index 8e88bc29..7bea024c 100644 --- a/src/extras/ini_parser.hpp +++ b/src/extras/ini_parser.hpp @@ -158,6 +158,25 @@ namespace linb /* Too lazy to continue this container... If you need more methods, just add it */ + // re3 + void remove(const string_type& sect, const key_type& key) + { + auto it = this->find(sect); + if(it != this->end()) + { + it->second.erase(key); + } + } + + int category_size(const string_type& sect) + { + auto it = this->find(sect); + if(it != this->end()) + { + return it->second.size(); + } + return 0; + } #if 1 bool read_file(const char_type* filename) diff --git a/src/extras/postfx.cpp b/src/extras/postfx.cpp index a9e0604b..1ccd8ac5 100644 --- a/src/extras/postfx.cpp +++ b/src/extras/postfx.cpp @@ -1,5 +1,4 @@ -#define WITHWINDOWS -#define WITH_D3D +#define WITHD3D #include "common.h" #ifdef EXTENDED_COLOURFILTER diff --git a/src/extras/screendroplets.cpp b/src/extras/screendroplets.cpp index 963b7624..1412141e 100644 --- a/src/extras/screendroplets.cpp +++ b/src/extras/screendroplets.cpp @@ -1,4 +1,4 @@ -#define WITH_D3D +#define WITHD3D #include "common.h" #ifdef SCREEN_DROPLETS |