mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-28 04:34:50 +00:00
TITANIC: Added CGameManager::viewChange
This commit is contained in:
parent
2665e0e08f
commit
abb5e0a5c1
@ -189,10 +189,15 @@ void CProjectItem::saveGame(int slotId) {
|
||||
Common::String::format("slot%d.gam", slotId));
|
||||
file.open(saveFile);
|
||||
|
||||
// Signal the game is being saved
|
||||
preSave();
|
||||
|
||||
// Save the contents out
|
||||
saveData(&file, this);
|
||||
|
||||
// Close the file and signal that the saving has finished
|
||||
file.close();
|
||||
postSave();
|
||||
}
|
||||
|
||||
void CProjectItem::clear() {
|
||||
@ -288,6 +293,16 @@ void CProjectItem::postLoad() {
|
||||
petControl->postLoad();
|
||||
}
|
||||
|
||||
void CProjectItem::preSave() {
|
||||
if (_gameManager)
|
||||
_gameManager->preSave(this);
|
||||
}
|
||||
|
||||
void CProjectItem::postSave() {
|
||||
if (_gameManager)
|
||||
_gameManager->postSave();
|
||||
}
|
||||
|
||||
CPetControl *CProjectItem::getPetControl() const {
|
||||
CDontSaveFileItem *fileItem = getDontSaveFileItem();
|
||||
CTreeItem *treeItem;
|
||||
|
@ -88,6 +88,16 @@ private:
|
||||
*/
|
||||
void postLoad();
|
||||
|
||||
/**
|
||||
* Called when a game is about to be saved
|
||||
*/
|
||||
void preSave();
|
||||
|
||||
/**
|
||||
* Called when a game has finished being saved
|
||||
*/
|
||||
void postSave();
|
||||
|
||||
/**
|
||||
* Finds the first child instance of a given class type
|
||||
*/
|
||||
|
@ -59,6 +59,16 @@ CString CTreeItem::dumpItem(int indent) const {
|
||||
return result;
|
||||
}
|
||||
|
||||
void CTreeItem::save(SimpleFile *file, int indent) const {
|
||||
file->writeNumberLine(0, indent);
|
||||
CMessageTarget::save(file, indent);
|
||||
}
|
||||
|
||||
void CTreeItem::load(SimpleFile *file) {
|
||||
file->readNumber();
|
||||
CMessageTarget::load(file);
|
||||
}
|
||||
|
||||
bool CTreeItem::isFileItem() const {
|
||||
return isInstanceOf(CFileItem::_type);
|
||||
}
|
||||
@ -91,16 +101,6 @@ bool CTreeItem::isGameObjectDescItem() const {
|
||||
return isInstanceOf(CGameObjectDescItem::_type);
|
||||
}
|
||||
|
||||
void CTreeItem::save(SimpleFile *file, int indent) const {
|
||||
file->writeNumberLine(0, indent);
|
||||
CMessageTarget::save(file, indent);
|
||||
}
|
||||
|
||||
void CTreeItem::load(SimpleFile *file) {
|
||||
file->readNumber();
|
||||
CMessageTarget::load(file);
|
||||
}
|
||||
|
||||
CGameManager *CTreeItem::getGameManager() const {
|
||||
return _parent ? _parent->getGameManager() : nullptr;
|
||||
}
|
||||
|
@ -119,6 +119,16 @@ public:
|
||||
*/
|
||||
virtual int compareTo(const CString &name, int maxLen) const { return false; }
|
||||
|
||||
/**
|
||||
* Gets the bounds occupied by the item
|
||||
*/
|
||||
virtual Common::Rect getBounds() { return Common::Rect(); }
|
||||
|
||||
/**
|
||||
* Called when the view changes
|
||||
*/
|
||||
virtual void viewChange() {}
|
||||
|
||||
/**
|
||||
* Get the parent for the given item
|
||||
*/
|
||||
|
@ -147,4 +147,18 @@ void CGameManager::updateDiskTicksCount() {
|
||||
_lastDiskTicksCount = g_vm->_events->getTicksCount();
|
||||
}
|
||||
|
||||
void CGameManager::viewChange() {
|
||||
delete _videoSurface1;
|
||||
delete _videoSurface2;
|
||||
|
||||
_videoSurface1 = nullptr;
|
||||
_videoSurface2 = CScreenManager::_screenManagerPtr->createSurface(600, 340);
|
||||
_trueTalkManager.viewChange();
|
||||
|
||||
for (CTreeItem *treeItem = _project; treeItem; treeItem = treeItem->scan(_project))
|
||||
treeItem->viewChange();
|
||||
|
||||
initBounds();
|
||||
}
|
||||
|
||||
} // End of namespace Titanic
|
||||
|
@ -155,6 +155,11 @@ public:
|
||||
* Updates the state of the manager
|
||||
*/
|
||||
void update();
|
||||
|
||||
/**
|
||||
* Called when the view changes
|
||||
*/
|
||||
void viewChange();
|
||||
};
|
||||
|
||||
} // End of namespace Titanic
|
||||
|
@ -179,4 +179,8 @@ void CTrueTalkManager::preLoad() {
|
||||
warning("TODO: CTrueTalkManager::preLoad");
|
||||
}
|
||||
|
||||
void CTrueTalkManager::viewChange() {
|
||||
warning("CTrueTalkManager::viewChange");
|
||||
}
|
||||
|
||||
} // End of namespace Titanic
|
||||
|
@ -97,6 +97,11 @@ public:
|
||||
*/
|
||||
void postSave() {}
|
||||
|
||||
/**
|
||||
* Called when the view changes
|
||||
*/
|
||||
void viewChange();
|
||||
|
||||
/**
|
||||
* Returns the scripts for the manager
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user