[Scummvm-cvs-logs] SF.net SVN: scummvm: [27505] scummvm/trunk/engines/saga

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Sun Jun 17 04:59:57 CEST 2007


Revision: 27505
          http://scummvm.svn.sourceforge.net/scummvm/?rev=27505&view=rev
Author:   thebluegr
Date:     2007-06-16 19:59:56 -0700 (Sat, 16 Jun 2007)

Log Message:
-----------
Some updates on the save/load system in IHNM. It still needs work, though

Modified Paths:
--------------
    scummvm/trunk/engines/saga/displayinfo.h
    scummvm/trunk/engines/saga/interface.cpp

Modified: scummvm/trunk/engines/saga/displayinfo.h
===================================================================
--- scummvm/trunk/engines/saga/displayinfo.h	2007-06-17 01:50:49 UTC (rev 27504)
+++ scummvm/trunk/engines/saga/displayinfo.h	2007-06-17 02:59:56 UTC (rev 27505)
@@ -323,6 +323,7 @@
 };
 
 static PanelButton IHNM_OptionPanelButtons[] = {
+	{kPanelButtonOptionSlider,	421,16, 16,138,	0,'-',0,	0,0,0},				//slider-scroller
 	{kPanelButtonOptionText,28,36,	0,0,	kTextReadingSpeed,'-',0, 0,0,0},	// text: read speed
 	{kPanelButtonOptionText,60,61,	0,0,	kTextMusic,'-',0, 0,0,0},			// text: music
 	{kPanelButtonOptionText,60,86,	0,0,	kTextSound,'-',0, 0,0,0},			// text: noise
@@ -333,7 +334,7 @@
 	{kPanelButtonOption,	153,104,79,23,	kTextVoices,'v',0,	0,0,0},			//voices
 	{kPanelButtonOption,	19,149,	200,25,	kTextQuitGame,'q',0,	0,0,0},		//quit
 	{kPanelButtonOption,	19,177,	200,25,	kTextContinuePlaying,'c',0,	0,0,0}, //continue
-	// TODO: Implement load/save
+	{kPanelButtonOptionSaveFiles,	244,18, 170,138,	0,'-',0,	0,0,0},		//savefiles
 	{kPanelButtonOption,	242,162, 79,23,	kTextLoad,'l',0,	0,0,0},			//load
 	{kPanelButtonOption,	333,162, 79,23,	kTextSave,'s',0,	0,0,0},			//save
 };
@@ -345,15 +346,21 @@
 };
 
 static PanelButton IHNM_LoadPanelButtons[] = {
-	{kPanelButtonArrow, 0,0, 0,0, 0,'-',0, 0,0,0}, //TODO
+	// TODO
+	{kPanelButtonLoad, 101,19, 60,16, kTextOK,'o',0, 0,0,0},
+	{kPanelButtonLoadText, -1,5, 0,0, kTextLoadSuccessful,'-',0, 0,0,0},
 };
 
 static PanelButton IHNM_SavePanelButtons[] = {
-	{kPanelButtonArrow, 0,0, 0,0, 0,'-',0, 0,0,0}, //TODO
+	// TODO
+	{kPanelButtonSave, 25,79, 80,25, kTextSave,'s',0, 0,0,0},
+	{kPanelButtonSave, 155,79, 80,25, kTextCancel,'c',0, 0,0,0},
+	{kPanelButtonSaveEdit, 26,57, 209,17, 0,'-',0, 0,0,0},
+	{kPanelButtonSaveText, 75,30, 0,0, kTextEnterSaveGameName,'-',0, 0,0,0},
 };
 
 
-static const GameDisplayInfo IHNM_DisplayInfo = { //TODO: fill it all
+static const GameDisplayInfo IHNM_DisplayInfo = {
 	640, 480,	// logical width&height
 
 	0,			// scene path y offset
@@ -388,8 +395,8 @@
 	ARRAYSIZE(IHNM_ConversePanelButtons),
 	IHNM_ConversePanelButtons,
 
-	-1, -1,		// save file index
-	0,			// optionSaveFileVisible
+	11, 0,		// save file index
+	15,			// optionSaveFileVisible
 	92, 46,		// option panel offsets
 	ARRAYSIZE(IHNM_OptionPanelButtons),
 	IHNM_OptionPanelButtons,
@@ -399,14 +406,14 @@
 	ARRAYSIZE(IHNM_QuitPanelButtons),
 	IHNM_QuitPanelButtons,
 
-	0, 0,			// load panel offsets
-	0, 0,			// load panel width & height
+	190, 94,		// load panel offsets
+	260, 115,		// load panel width & height
 	ARRAYSIZE(IHNM_LoadPanelButtons),
 	IHNM_LoadPanelButtons,
 
-	-1,				// save edit index
-	0, 0,			// save panel offsets
-	0, 0,			// save panel width & height
+	2,				// save edit index
+	190, 94,		// save panel offsets
+	260, 115,		// save panel width & height
 	ARRAYSIZE(IHNM_SavePanelButtons),
 	IHNM_SavePanelButtons,
 

Modified: scummvm/trunk/engines/saga/interface.cpp
===================================================================
--- scummvm/trunk/engines/saga/interface.cpp	2007-06-17 01:50:49 UTC (rev 27504)
+++ scummvm/trunk/engines/saga/interface.cpp	2007-06-17 02:59:56 UTC (rev 27505)
@@ -203,6 +203,28 @@
 		free(resource);
 	}
 
+	// Save panel
+	if (_vm->getGameType() == GType_IHNM) {
+		_savePanel.buttons = _vm->getDisplayInfo().savePanelButtons;
+		_savePanel.buttonsCount = _vm->getDisplayInfo().savePanelButtonsCount;
+
+		_vm->_resource->loadResource(_interfaceContext, _vm->getResourceDescription()->warningPanelResourceId, resource, resourceLength);
+		_vm->decodeBGImage(resource, resourceLength, &_savePanel.image,
+			&_savePanel.imageLength, &_savePanel.imageWidth, &_savePanel.imageHeight);
+		free(resource);
+	}
+
+	// Load panel
+	if (_vm->getGameType() == GType_IHNM) {
+		_loadPanel.buttons = _vm->getDisplayInfo().loadPanelButtons;
+		_loadPanel.buttonsCount = _vm->getDisplayInfo().loadPanelButtonsCount;
+
+		_vm->_resource->loadResource(_interfaceContext, _vm->getResourceDescription()->warningPanelResourceId, resource, resourceLength);
+		_vm->decodeBGImage(resource, resourceLength, &_loadPanel.image,
+			&_loadPanel.imageLength, &_loadPanel.imageWidth, &_loadPanel.imageHeight);
+		free(resource);
+	}
+
 	// Main panel sprites
 	_vm->_sprite->loadList(_vm->getResourceDescription()->mainPanelSpritesResourceId, _mainPanel.sprites);
 	// Option panel sprites
@@ -750,7 +772,6 @@
 void Interface::calcOptionSaveSlider() {
 	int totalFiles = _vm->getSaveFilesCount();
 	int visibleFiles = _vm->getDisplayInfo().optionSaveFileVisible;
-	if (_optionSaveFileSlider == NULL) return; //TODO:REMOVE
 	int height = _optionSaveFileSlider->height;
 	int sliderHeight;
 	int pos;
@@ -870,10 +891,6 @@
 			backBuffer->drawRect(_optionSaveRectTop, kITEColorDarkGrey);
 	}
 
-	// FIXME: The _optionSaveFileSlider checks exist for IHNM, where 
-	// _optionSaveFileSlider is not initialized correctly yet
-	if (_optionSaveFileSlider == NULL) return; //TODO:REMOVE
-
 	drawButtonBox(backBuffer, _optionSaveRectSlider, kSlider, _optionSaveFileSlider->state > 0);
 
 	if (_optionSaveRectBottom.height() > 0) {
@@ -899,7 +916,10 @@
 			text = _vm->getSaveFile(idx)->name;
 			textPoint.x = rect.left + 1;
 			textPoint.y = rect2.top;
-			_vm->_font->textDraw(kKnownFontSmall, backBuffer, text, textPoint, fgColor, 0, kFontNormal);
+			if (_vm->getGameType() == GType_ITE)
+				_vm->_font->textDraw(kKnownFontSmall, backBuffer, text, textPoint, fgColor, 0, kFontNormal);
+			else
+				_vm->_font->textDraw(kKnownFontVerb, backBuffer, text, textPoint, fgColor, 0, kFontNormal);
 		}
 	}
 
@@ -978,7 +998,11 @@
 	backBuffer = _vm->_gfx->getBackBuffer();
 
 	_loadPanel.getRect(rect);
-	drawButtonBox(backBuffer, rect, kButton, false);
+	if (_vm->getGameType() == GType_ITE)
+		drawButtonBox(backBuffer, rect, kButton, false);
+	else
+		backBuffer->blit(rect, _loadPanel.image);
+
 	for (i = 0; i < _loadPanel.buttonsCount; i++) {
 		panelButton = &_loadPanel.buttons[i];
 		if (panelButton->type == kPanelButtonLoad) {
@@ -1178,7 +1202,11 @@
 	backBuffer = _vm->_gfx->getBackBuffer();
 
 	_savePanel.getRect(rect);
-	drawButtonBox(backBuffer, rect, kButton, false);
+	if (_vm->getGameType() == GType_ITE)
+		drawButtonBox(backBuffer, rect, kButton, false);
+	else
+		backBuffer->blit(rect, _savePanel.image);
+
 	for (i = 0; i < _savePanel.buttonsCount; i++) {
 		panelButton = &_savePanel.buttons[i];
 		if (panelButton->type == kPanelButtonSave) {
@@ -1291,7 +1319,6 @@
 	bool releasedButton;
 
 	if (_vm->mouseButtonPressed()) {
-		if (_optionSaveFileSlider != NULL) //TODO:REMOVE
 		if (_optionSaveFileSlider->state > 0) {
 			_optionPanel.calcPanelButtonRect(_optionSaveFileSlider, rect);
 
@@ -2117,6 +2144,14 @@
 			texturePoint.x = _quitPanel.x + panelButton->xOffset;
 			texturePoint.y = _quitPanel.y + panelButton->yOffset;
 			_vm->_sprite->draw(ds, _vm->getDisplayClip(), _optionPanel.sprites, 14 + litButton, texturePoint, 256);
+		} else if (panel == &_savePanel) {
+			texturePoint.x = _savePanel.x + panelButton->xOffset;
+			texturePoint.y = _savePanel.y + panelButton->yOffset;
+			_vm->_sprite->draw(ds, _vm->getDisplayClip(), _optionPanel.sprites, 14 + litButton, texturePoint, 256);
+		} else if (panel == &_loadPanel) {
+			texturePoint.x = _loadPanel.x + panelButton->xOffset;
+			texturePoint.y = _loadPanel.y + panelButton->yOffset;
+			_vm->_sprite->draw(ds, _vm->getDisplayClip(), _optionPanel.sprites, 14 + litButton, texturePoint, 256);
 		} else {
 			// revert to default behavior
 			drawButtonBox(ds, rect, kButton, panelButton->state > 0);


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list