aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBendegúz Nagy2016-08-26 22:51:13 +0200
committerBendegúz Nagy2016-08-26 23:02:22 +0200
commitead63373ca38626ff977c8b09ff2fe3c34b85da2 (patch)
treeef4d5ff26387217e6ac9ac71a73b3a6b9a537ad7
parent0f9995851bccea18084cf05b7ef156d78ebdb8d1 (diff)
downloadscummvm-rg350-ead63373ca38626ff977c8b09ff2fe3c34b85da2.tar.gz
scummvm-rg350-ead63373ca38626ff977c8b09ff2fe3c34b85da2.tar.bz2
scummvm-rg350-ead63373ca38626ff977c8b09ff2fe3c34b85da2.zip
DM: Add stub methods, clean up warnings and some comments
-rw-r--r--engines/dm/TODOs/todo.txt23
-rw-r--r--engines/dm/gfx.cpp10
-rw-r--r--engines/dm/gfx.h4
-rw-r--r--engines/dm/inventory.cpp4
-rw-r--r--engines/dm/loadsave.cpp5
-rw-r--r--engines/dm/menus.cpp8
-rw-r--r--engines/dm/text.cpp14
-rw-r--r--engines/dm/text.h15
8 files changed, 40 insertions, 43 deletions
diff --git a/engines/dm/TODOs/todo.txt b/engines/dm/TODOs/todo.txt
index b44ec12269..5017e48671 100644
--- a/engines/dm/TODOs/todo.txt
+++ b/engines/dm/TODOs/todo.txt
@@ -3,9 +3,10 @@ Bugs:
Broken colour palette for dungeon and cursor
Gui is messed up by drawn spell area line on startup
Spellcasting tabs are displayed inproperly, switching between them is possible tho
+ When reordering a champions, the icons in the top right corner ar drawn twice under the cursor
Logic:
- End game method is broken
+ F0444_STARTEND_Endgame is broken
Items thrown on the right side end up on the left side
@@ -23,21 +24,9 @@ Todo:
Double check strcat, strstr usages
I forgot to add a bunch of warning for show/hide mouse pointer and other mouse functions
-Finish stuff:
- F0444_STARTEND_Endgame
- Make missing code warnings to STUB methods
- Add quit resuest from scummvm
- f380_processCommandQueue
- Missing main loop methods
+Code stuff todo:
+ Complete stub methods
+ Add localization
Save file f433_processCommand140_saveGame fails silently
- F0438_STARTEND_OpenEntranceDoors
- F0442_STARTEND_ProcessCommand202_EntranceDrawCredits
- G0335_ui_SelectedDialogChoice
- Add dialogs
- Add failcheck to saveing and loading
-
-
-
-Refactoring
- Places implementing mini mainloop and where input doesn't really matter should call discardInput instead of processInput
+ \ No newline at end of file
diff --git a/engines/dm/gfx.cpp b/engines/dm/gfx.cpp
index 90f89a387e..8d23784ed5 100644
--- a/engines/dm/gfx.cpp
+++ b/engines/dm/gfx.cpp
@@ -1056,7 +1056,7 @@ void DisplayMan::f110_drawDoorButton(int16 doorButtonOrdinal, int16 viewDoorButt
void DisplayMan::f565_viewportSetPalette(uint16* middleScreenPalette, uint16* topAndBottomScreen) {
if (middleScreenPalette && topAndBottomScreen)
- debugC(kDMDebugOftenCalledWarning, "MISSING CODE: F0508_AMIGA_BuildPaletteChangeCopperList");
+ f508_buildPaletteChangeCopperList(middleScreenPalette, topAndBottomScreen);
f566_viewportBlitToScreen();
}
@@ -2045,7 +2045,7 @@ void DisplayMan::f124_drawSquareD1C(Direction dir, int16 posX, int16 posY) {
_g296_bitmapViewport, g106_BoxThievesEye_ViewPortVisibleArea, 0, 0,
48, k112_byteWidthViewport, k9_ColorGold, 95, k136_heightViewport); /* BUG0_74 */
f493_addDerivedBitmap(k1_DerivedBitmapThievesEyeVisibleArea);
- warning(false, "MISSING CODE: F0480_CACHE_ReleaseBlock");
+ f480_releaseBlock(k1_DerivedBitmapThievesEyeVisibleArea | 0x8000);
}
return;
case k17_DoorFrontElemType:
@@ -2692,6 +2692,7 @@ uint32 DisplayMan::getCompressedDataSize(uint16 index) {
#define kMaskFieldAspectNoMask 255 // @ C255_NO_MASK
void DisplayMan::f113_drawField(FieldAspect* fieldAspect, Box& box) {
+ warning(false, "STUB METHOD: f113_drawField");
DisplayMan &dispMan = *_vm->_displayMan;
byte *bitmapMask;
@@ -2705,11 +2706,6 @@ void DisplayMan::f113_drawField(FieldAspect* fieldAspect, Box& box) {
dispMan.f130_flipBitmapHorizontal(bitmapMask, fieldAspect->_byteWidth, fieldAspect->_height);
}
}
-
- // byte *bitmap = dispMan.f489_getNativeBitmapOrGraphic(k73_FieldTeleporterGraphicIndice + fieldAspect->_nativeBitmapRelativeIndex);
- warning(false, "MISSING CODE: F0133_VIDEO_BlitBoxFilledWithMaskedBitmap");
-
- warning(false, "IGNORED CODE: F0491_CACHE_IsDerivedBitmapInCache, F0493_CACHE_AddDerivedBitmap, F0480_CACHE_ReleaseBlock");
}
int16 DisplayMan::f459_getScaledBitmapByteCount(int16 byteWidth, int16 height, int16 scale) {
diff --git a/engines/dm/gfx.h b/engines/dm/gfx.h
index 7de68ac4aa..563e1294ac 100644
--- a/engines/dm/gfx.h
+++ b/engines/dm/gfx.h
@@ -750,7 +750,9 @@ public:
void f493_addDerivedBitmap(int16 derivedBitmapIndex); // @ F0493_CACHE_AddDerivedBitmap
void f480_releaseBlock(uint16 index); // @ F0480_CACHE_ReleaseBlock
uint16 f431_getDarkenedColor(uint16 RGBcolor);
- void f436_STARTEND_FadeToPalette(uint16 *P0849_pui_Palette) { warning(false, "STUB: f436_STARTEND_FadeToPalette"); }
+ void f436_STARTEND_FadeToPalette(uint16 *P0849_pui_Palette) { warning(false, "STUB METHOD: f436_STARTEND_FadeToPalette"); }
+ void f508_buildPaletteChangeCopperList(uint16* middleScreen, uint16* topAndBottom) { warning(false, "STUB METHOD: f508_buildPaletteChangeCopperList"); }// @ F0508_AMIGA_BuildPaletteChangeCopperList
+ void f136_shadeScreenBox(Box* box, Color color) { warning(false, "STUB METHOD: f136_shadeScreenBox"); } // @ F0136_VIDEO_ShadeScreenBox
};
}
diff --git a/engines/dm/inventory.cpp b/engines/dm/inventory.cpp
index 019ef5ec85..48f9716043 100644
--- a/engines/dm/inventory.cpp
+++ b/engines/dm/inventory.cpp
@@ -117,14 +117,14 @@ void InventoryMan::f355_toggleInventory(ChampionIndex championIndex) {
_vm->_displayMan->_g578_useByteBoxCoordinates = false;
_g432_inventoryChampionOrdinal = _vm->M0_indexToOrdinal(championIndex);
if (!AL1102_ui_InventoryChampionOrdinal) {
- warning(false, "MISSING CODE: F0136_VIDEO_ShadeScreenBox");
+ _vm->_displayMan->f136_shadeScreenBox(&g2_BoxMovementArrows, k0_ColorBlack);
}
L1103_ps_Champion = &_vm->_championMan->_gK71_champions[championIndex];
_vm->_displayMan->f466_loadIntoBitmap(k17_InventoryGraphicIndice, _vm->_displayMan->_g296_bitmapViewport);
if (_vm->_championMan->_g299_candidateChampionOrdinal) {
_vm->_displayMan->f135_fillBoxBitmap(_vm->_displayMan->_g296_bitmapViewport, g41_BoxFloppyZzzCross, k12_ColorDarkestGray, k112_byteWidthViewport, k136_heightViewport);
}
- _vm->_textMan->f52_printToViewport(5, 116, k13_ColorLightestGray, "HEALTH");
+ _vm->_textMan->f52_printToViewport(5, 116, k13_ColorLightestGray, "HEALTH"); // TODO: localization
_vm->_textMan->f52_printToViewport(5, 124, k13_ColorLightestGray, "STAMINA");
_vm->_textMan->f52_printToViewport(5, 132, k13_ColorLightestGray, "MANA");
for (AL1102_ui_SlotIndex = k0_ChampionSlotReadyHand; AL1102_ui_SlotIndex < k30_ChampionSlotChest_1; AL1102_ui_SlotIndex++) {
diff --git a/engines/dm/loadsave.cpp b/engines/dm/loadsave.cpp
index 24e1a1518c..3563fb58ae 100644
--- a/engines/dm/loadsave.cpp
+++ b/engines/dm/loadsave.cpp
@@ -36,6 +36,7 @@
#include "menus.h"
#include "eventman.h"
#include "projexpl.h"
+#include "dialog.h"
namespace DM {
@@ -141,8 +142,8 @@ LoadgameResponse DMEngine::f435_loadgame(int16 slot) {
_timeline->f233_initTimeline();
_groupMan->f196_initActiveGroups();
+ warning(false, "Disabled code in f435_loadgame");
#if 0
- // always false?
if (L1366_B_FadePalette) {
_displayMan->f436_STARTEND_FadeToPalette(_displayMan->_g345_aui_BlankBuffer);
D26_WaitForVerticalBlank();
@@ -156,7 +157,7 @@ LoadgameResponse DMEngine::f435_loadgame(int16 slot) {
_g526_dungeonId = dmSaveHeader._dungeonId;
_g524_restartGameAllowed = true;
- warning(false, "MISSING CDOE: F0427_DIALOG_Draw in f435_loadgame");
+ _dialog->f427_dialogDraw(nullptr, "LOADING GAME . . .", nullptr, nullptr, nullptr, nullptr, true, true, true); // TODO: localization
}
_championMan->_g303_partyDead = false;
diff --git a/engines/dm/menus.cpp b/engines/dm/menus.cpp
index 509623d6d9..b69780d2dd 100644
--- a/engines/dm/menus.cpp
+++ b/engines/dm/menus.cpp
@@ -170,7 +170,7 @@ T0386006:
box2._y2 = 110;
dm.f132_blitToBitmap(bitmapIcon, dm._g348_bitmapScreen, box2, 0, 0, 8, k160_byteWidthScreen, kM1_ColorNoTransparency);
if (champion.getAttributes(k0x0008_ChampionAttributeDisableAction) || _vm->_championMan->_g299_candidateChampionOrdinal || _vm->_championMan->_g300_partyIsSleeping) {
- warning(false, "MISSING CODE: F0136_VIDEO_ShadeScreenBox");
+ _vm->_displayMan->f136_shadeScreenBox(&box, k0_ColorBlack);
}
}
@@ -183,10 +183,10 @@ void MenuMan::f456_drawDisabledMenu() {
_vm->_inventoryMan->f334_closeChest();
}
} else {
- warning(false, "MISSING CODE: F0136_VIDEO_ShadeScreenBox");
+ _vm->_displayMan->f136_shadeScreenBox(&g2_BoxMovementArrows, k0_ColorBlack);
}
- warning(false, "MISSING CODE: F0136_VIDEO_ShadeScreenBox");
- warning(false, "MISSING CODE: F0136_VIDEO_ShadeScreenBox");
+ _vm->_displayMan->f136_shadeScreenBox(&g0_BoxSpellArea, k0_ColorBlack);
+ _vm->_displayMan->f136_shadeScreenBox(&g1_BoxActionArea, k0_ColorBlack);
_vm->_eventMan->f67_setMousePointerToNormal(k0_pointerArrow);
}
}
diff --git a/engines/dm/text.cpp b/engines/dm/text.cpp
index 51d203dac8..68ea14f9cb 100644
--- a/engines/dm/text.cpp
+++ b/engines/dm/text.cpp
@@ -139,9 +139,10 @@ void TextMan::f45_messageAreaCreateNewRow() {
uint16 L0029_ui_RowIndex;
if (_g358_messageAreaCursorRow == 3) {
- warning(false, "MISSING CODE: F0561_SCROLLER_IsTextScrolling");
+ f561_isTextScrolling(&_gK60_s_TextScroller, true);
memset(_g356_bitmapMessageAreaNewRow, k0_ColorBlack, 320 * 7);
- warning(false, "MISSING CODE: F0560_SCROLLER_SetCommand");
+ f560_SCROLLER_setCommand(&_gK60_s_TextScroller, 1);
+
for (L0029_ui_RowIndex = 0; L0029_ui_RowIndex < 3; L0029_ui_RowIndex++) {
_g360_messageAreaRowExpirationTime[L0029_ui_RowIndex] = _g360_messageAreaRowExpirationTime[L0029_ui_RowIndex + 1];
}
@@ -155,13 +156,12 @@ void TextMan::f46_messageAreaPrintString(Color color, const char* string) {
int16 L0030_i_StringLength;
L0030_i_StringLength = strlen(string);
- warning(false, "MISSING CODE: F0561_SCROLLER_IsTextScrolling");
- if (true) { // there is a test here with F0561_SCROLLER_IsTextScrolling
+ if (f561_isTextScrolling(&_gK60_s_TextScroller, false)) {
f53_printToLogicalScreen(_g359_messageAreaCursorColumn * 6, (_g358_messageAreaCursorRow * 7 - 6) + 177, color, k0_ColorBlack, string);
} else {
f40_printTextToBitmap(_g356_bitmapMessageAreaNewRow, k160_byteWidthScreen, _g359_messageAreaCursorColumn * 6, 5, color, k0_ColorBlack, string, 7);
- warning(false, "MISSING CODE: F0561_SCROLLER_IsTextScrolling");
- warning(false, "MISSING CODE: F0560_SCROLLER_SetCommand");
+ if(f561_isTextScrolling(&_gK60_s_TextScroller, false))
+ f560_SCROLLER_setCommand(&_gK60_s_TextScroller, 1);
}
_g359_messageAreaCursorColumn += L0030_i_StringLength;
_g360_messageAreaRowExpirationTime[_g358_messageAreaCursorRow] = _vm->_g313_gameTime + 200;
@@ -206,7 +206,7 @@ void TextMan::f44_messageAreaClearExpiredRows() {
if ((L0027_l_ExpirationTime == -1) || (L0027_l_ExpirationTime > _vm->_g313_gameTime))
continue;
L0028_s_Box._y2 = (L0028_s_Box._y1 = 172 + (L0026_ui_RowIndex * 7)) + 6;
- warning(false, "MISSING CODE:F0561_SCROLLER_IsTextScrolling(&K0060_s_TextScroller, true);");
+ f561_isTextScrolling(&_gK60_s_TextScroller, true);
_vm->_displayMan->f135_fillBoxBitmap(_vm->_displayMan->_g348_bitmapScreen, L0028_s_Box, k0_ColorBlack, k160_byteWidthScreen, k200_heightScreen);
_g360_messageAreaRowExpirationTime[L0026_ui_RowIndex] = -1;
}
diff --git a/engines/dm/text.h b/engines/dm/text.h
index 3a41274c42..b4eca1a06a 100644
--- a/engines/dm/text.h
+++ b/engines/dm/text.h
@@ -33,6 +33,10 @@
namespace DM {
+struct TextScroller {
+ // Placeholder, empty for now
+}; // @ Text_Scroller
+
class TextMan {
DMEngine *_vm;
int16 _g359_messageAreaCursorColumn; // @ G0359_i_MessageAreaCursorColumn
@@ -40,14 +44,16 @@ class TextMan {
int32 _g360_messageAreaRowExpirationTime[4]; // @ G0360_al_MessageAreaRowExpirationTime
byte *_g356_bitmapMessageAreaNewRow; // @ G0356_puc_Bitmap_MessageAreaNewRow
public:
+ TextScroller _gK60_s_TextScroller;
+
explicit TextMan(DMEngine *vm);
~TextMan();
void f40_printTextToBitmap(byte *destBitmap, uint16 destByteWidth, int16 destX, int16 destY,
- Color textColor, Color bgColor, const char *text, uint16 destHeight); // @ F0040_TEXT_Print
+ Color textColor, Color bgColor, const char *text, uint16 destHeight); // @ F0040_TEXT_Print
void f53_printToLogicalScreen(uint16 destX, uint16 destY, Color textColor, Color bgColor, const char *text); // @ F0053_TEXT_PrintToLogicalScreen
void f52_printToViewport(int16 posX, int16 posY, Color textColor, const char *text, Color bgColor = k12_ColorDarkestGray); // @ F0052_TEXT_PrintToViewport
void f41_printWithTrailingSpaces(byte *destBitmap, int16 destByteWidth, int16 destX, int16 destY, Color textColor, Color bgColor,
- const char *text, int16 strLenght, int16 destHeight); // @ F0041_TEXT_PrintWithTrailingSpaces
+ const char *text, int16 strLenght, int16 destHeight); // @ F0041_TEXT_PrintWithTrailingSpaces
void f51_messageAreaPrintLineFeed(); // @ F0051_TEXT_MESSAGEAREA_PrintLineFeed
void f47_messageAreaPrintMessage(Color color, const char *string); // @ F0047_TEXT_MESSAGEAREA_PrintMessage
void f45_messageAreaCreateNewRow(); // @ F0045_TEXT_MESSAGEAREA_CreateNewRow
@@ -56,7 +62,10 @@ public:
void f42_messageAreaMoveCursor(int16 column, int16 row); // @ F0042_TEXT_MESSAGEAREA_MoveCursor
void f44_messageAreaClearExpiredRows(); // @ F0044_TEXT_MESSAGEAREA_ClearExpiredRows
void f443_endgamePrintString(int16 x, int16 y, Color textColor, char *text); // @ F0443_STARTEND_EndgamePrintString
-
+ bool f561_isTextScrolling(TextScroller *scroller, bool waitEndOfScrolling) {
+ warning(false, "STUB METHOD: f561_isTextScrolling"); return true;
+ } // @ F0561_SCROLLER_IsTextScrolling
+ void f560_SCROLLER_setCommand(TextScroller *scroller, int16 command) { warning(false, "STUB METHOD: f560_SCROLLER_setCommand"); } // @ F0560_SCROLLER_SetCommand
};
}