diff options
Diffstat (limited to 'common')
| -rw-r--r-- | common/array.h | 12 | ||||
| -rw-r--r-- | common/util.cpp | 13 | ||||
| -rw-r--r-- | common/util.h | 7 |
3 files changed, 16 insertions, 16 deletions
diff --git a/common/array.h b/common/array.h index ac8a4b20d7..0b5a65e9bd 100644 --- a/common/array.h +++ b/common/array.h @@ -222,13 +222,7 @@ public: T *old_storage = _storage; _capacity = newCapacity; - // PS2 gcc 3.2.2 can't do "new T[newCapacity]()" but only - // "new T[newCapacity]" -> quick fix until we update tools. - #ifndef __PLAYSTATION2__ - _storage = new T[newCapacity](); - #else _storage = new T[newCapacity]; - #endif assert(_storage); if (old_storage) { @@ -279,13 +273,7 @@ protected: // If there is not enough space, allocate more and // copy old elements over. uint newCapacity = roundUpCapacity(_size + n); - // PS2 gcc 3.2.2 can't do "new T[newCapacity]()" but only - // "new T[newCapacity]" -> quick fix until we update tools. - #ifndef __PLAYSTATION2__ - newStorage = new T[newCapacity](); - #else newStorage = new T[newCapacity]; - #endif assert(newStorage); copy(_storage, _storage + idx, newStorage); pos = newStorage + idx; diff --git a/common/util.cpp b/common/util.cpp index 5f5e31aa93..869cec4c48 100644 --- a/common/util.cpp +++ b/common/util.cpp @@ -24,6 +24,7 @@ #include "common/util.h" #include "common/system.h" +#include "common/config-manager.h" #include "gui/debugger.h" #include "engines/engine.h" @@ -420,6 +421,14 @@ String getGameGUIOptionsDescription(uint32 options) { return res; } +void updateGameGUIOptions(const uint32 options) { + if ((options && !ConfMan.hasKey("guioptions")) || + (ConfMan.hasKey("guioptions") && options != parseGameGUIOptions(ConfMan.get("guioptions")))) { + ConfMan.set("guioptions", getGameGUIOptionsDescription(options)); + ConfMan.flushToDisk(); + } +} + } // End of namespace Common @@ -477,11 +486,7 @@ void NORETURN error(const char *s, ...) { // Print the error message to stderr -#ifndef __PLAYSTATION2__ fputs(buf_output, stderr); -#else - fprintf(stderr, "%s", buf_output); -#endif // Unless this error -originated- within the debugger itself, we // now invoke the debugger, if available / supported. diff --git a/common/util.h b/common/util.h index e50dcebff0..aeadcd1483 100644 --- a/common/util.h +++ b/common/util.h @@ -284,6 +284,13 @@ bool checkGameGUIOption(GameGUIOption option, const String &str); uint32 parseGameGUIOptions(const String &str); String getGameGUIOptionsDescription(uint32 options); +/** + * Updates the GUI options of the current config manager + * domain, when they differ to the ones passed as + * parameter. + */ +void updateGameGUIOptions(const uint32 options); + } // End of namespace Common |
