27 bool BasePersistentStorageArray::gameloop;
28 bool BasePersistentStorageArray::command;
29 bool BasePersistentStorageArray::testmode;
34 BasePersistentStorageArray::~BasePersistentStorageArray()
61 assert(ignore_prev_mode || !gameloop);
62 assert(!command && !testmode);
67 assert(ignore_prev_mode || gameloop);
68 assert(!command && !testmode);
73 assert((ignore_prev_mode || !command) && !testmode);
78 assert(ignore_prev_mode || command);
83 assert(!command && (ignore_prev_mode || !testmode));
88 assert(ignore_prev_mode || testmode);
92 default: NOT_REACHED();
97 DEBUG(desync, 1,
"Discarding persistent storage changes: Feature %d, GrfID %08X, Tile %d", (*it)->feature,
BSWAP32((*it)->grfid), (*it)->tile);
98 (*it)->ClearChanges();
Leave command test mode, revert to previous mode.
Enter command test mode, changes will be tempoary.
Functionality related to the temporary and persistent storage arrays for NewGRFs. ...
void AddChangedPersistentStorage(BasePersistentStorageArray *storage)
Add the changed storage array to the list of changed arrays.
Functions related to debugging.
Function to handling different endian machines.
Some methods of Pool are placed here in order to reduce compilation time and binary size...
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...
PersistentStorageMode
Mode switches to the behaviour of persistent storage array.
Definition of base types and functions in a cross-platform compatible way.
Enter the gameloop, changes will be permanent.
A number of safeguards to prevent using unsafe methods.
Class for pooled persistent storage of data.
static std::set< BasePersistentStorageArray * > * _changed_storage_arrays
The changed storage arrays.
Base class for all persistent NewGRF storage arrays.
Enter command scope, changes will be permanent.
Leave command scope, revert to previous mode.
Base class for all pools.
#define DEBUG(name, level,...)
Output a line of debugging information.
#define INSTANTIATE_POOL_METHODS(name)
Force instantiation of pool methods so we don't get linker errors.
Leave the gameloop, changes will be temporary.
static uint32 BSWAP32(uint32 x)
Perform a 32 bits endianness bitswap on x.