#include "core/alloc_func.hpp"
Go to the source code of this file.
Data Structures | |
struct | BaseStorageArray |
Base class for all NewGRF storage arrays. More... | |
struct | PersistentStorageArray< TYPE, SIZE > |
Class for persistent storage of data. More... | |
struct | TemporaryStorageArray< TYPE, SIZE > |
Class for temporary storage of data. More... | |
Functions | |
void | AddChangedStorage (BaseStorageArray *storage) |
Add the changed storage array to the list of changed arrays. | |
void | ClearStorageChanges (bool keep_changes) |
Clear the changes made since the last ClearStorageChanges. |
Definition in file newgrf_storage.h.
void AddChangedStorage | ( | BaseStorageArray * | storage | ) |
Add the changed storage array to the list of changed arrays.
This is done so we only have to revert/save the changed arrays, which saves quite a few clears, etc. after callbacks.
storage | the array that has changed |
Definition at line 19 of file newgrf_storage.cpp.
References _changed_storage_arrays.
Referenced by TemporaryStorageArray< TYPE, SIZE >::Store(), and PersistentStorageArray< unsigned int, 16 >::Store().
void ClearStorageChanges | ( | bool | keep_changes | ) |
Clear the changes made since the last ClearStorageChanges.
This is done for *all* storages that have been registered to with AddChangedStorage since the previous ClearStorageChanges.
This can be done in two ways:
keep_changes | do we save or revert the changes since the last ClearChanges? |
Definition at line 24 of file newgrf_storage.cpp.
References _changed_storage_arrays.
Referenced by _GenerateWorld(), and StateGameLoop().