OpenTTD Source
12.0-beta2
|
Go to the documentation of this file.
59 assert(ignore_prev_mode || !gameloop);
60 assert(!command && !testmode);
65 assert(ignore_prev_mode || gameloop);
66 assert(!command && !testmode);
71 assert((ignore_prev_mode || !command) && !testmode);
76 assert(ignore_prev_mode || command);
81 assert(!command && (ignore_prev_mode || !testmode));
86 assert(ignore_prev_mode || testmode);
90 default: NOT_REACHED();
95 Debug(desync, 1,
"Discarding persistent storage changes: Feature {}, GrfID {:08X}, Tile {}", (*it)->feature,
BSWAP32((*it)->grfid), (*it)->tile);
96 (*it)->ClearChanges();
@ PSM_LEAVE_TESTMODE
Leave command test mode, revert to previous mode.
void AddChangedPersistentStorage(BasePersistentStorageArray *storage)
Add the changed storage array to the list of changed arrays.
Class for pooled persistent storage of data.
@ PSM_LEAVE_COMMAND
Leave command scope, revert to previous mode.
@ PSM_ENTER_GAMELOOP
Enter the gameloop, changes will be permanent.
static std::set< BasePersistentStorageArray * > * _changed_storage_arrays
The changed storage arrays.
static uint32 BSWAP32(uint32 x)
Perform a 32 bits endianness bitswap on x.
Base class for all persistent NewGRF storage arrays.
Base class for all pools.
#define INSTANTIATE_POOL_METHODS(name)
Force instantiation of pool methods so we don't get linker errors.
#define Debug(name, level, format_string,...)
Ouptut a line of debugging information.
@ PSM_LEAVE_GAMELOOP
Leave the gameloop, changes will be temporary.
static void SwitchMode(PersistentStorageMode mode, bool ignore_prev_mode=false)
Clear temporary changes made since the last call to SwitchMode, and set whether subsequent changes sh...
@ PSM_ENTER_COMMAND
Enter command scope, changes will be permanent.
@ PSM_ENTER_TESTMODE
Enter command test mode, changes will be temporary.
PersistentStorageMode
Mode switches to the behaviour of persistent storage array.