mirror of
https://github.com/libretro/scummvm.git
synced 2025-03-05 09:49:14 +00:00
DM: Get rid of some globals in inventory
This commit is contained in:
parent
236a27e4cc
commit
f9323fe9fa
@ -2354,7 +2354,7 @@ void ChampionMan::f281_renameChampion(Champion* champ) {
|
||||
displayBox._x2 = displayBox._x1 + 167;
|
||||
|
||||
_vm->_displayMan->f135_fillBoxBitmap(_vm->_displayMan->_g296_bitmapViewport, displayBox, k12_ColorDarkestGray, k112_byteWidthViewport, k136_heightViewport);
|
||||
_vm->_displayMan->f20_blitToViewport(_vm->_displayMan->f489_getNativeBitmapOrGraphic(k27_PanelRenameChampionIndice), g32_BoxPanel, k72_byteWidth, k4_ColorCyan, 73);
|
||||
_vm->_displayMan->f20_blitToViewport(_vm->_displayMan->f489_getNativeBitmapOrGraphic(k27_PanelRenameChampionIndice), _vm->_inventoryMan->g32_BoxPanel, k72_byteWidth, k4_ColorCyan, 73);
|
||||
_vm->_textMan->f52_printToViewport(177, 58, k13_ColorLightestGray, "_______");
|
||||
_vm->_textMan->f52_printToViewport(105, 76, k13_ColorLightestGray, "___________________");
|
||||
_vm->_eventMan->f78_showMouse();
|
||||
|
@ -681,7 +681,7 @@ void DMEngine::f444_endGame(bool doNotDrawCreditsOnly) {
|
||||
continue;
|
||||
|
||||
char displStr[20];
|
||||
strcpy(displStr, G0428_apc_SkillLevelNames[skillLevel - 2]);
|
||||
strcpy(displStr, _inventoryMan->G0428_apc_SkillLevelNames[skillLevel - 2]);
|
||||
strcat(displStr, " ");
|
||||
strcat(displStr, _championMan->_baseSkillName[idx]);
|
||||
_textMan->f443_endgamePrintString(105, textPosY = textPosY + 8, k13_ColorLightestGray, displStr);
|
||||
|
@ -42,32 +42,30 @@
|
||||
|
||||
namespace DM {
|
||||
|
||||
Box g41_BoxFloppyZzzCross = Box(174, 218, 2, 12); // @ G0041_s_Graphic562_Box_ViewportFloppyZzzCross
|
||||
Box g32_BoxPanel = Box(80, 223, 52, 124); // @ G0032_s_Graphic562_Box_Panel
|
||||
Box g35_BoxFood = Box(112, 159, 60, 68); // @ G0035_s_Graphic562_Box_Food
|
||||
Box g36_BoxWater = Box(112, 159, 83, 91); // @ G0036_s_Graphic562_Box_Water
|
||||
Box g37_BoxPoisoned = Box(112, 207, 105, 119); // @ G0037_s_Graphic562_Box_Poisoned
|
||||
|
||||
const char* G0428_apc_SkillLevelNames[15];
|
||||
|
||||
void InventoryMan::initConstants() {
|
||||
{
|
||||
static const char* G0428_apc_SkillLevelNames_EN_ANY[15] = {"NEOPHYTE", "NOVICE", "APPRENTICE", "JOURNEYMAN", "CRAFTSMAN",
|
||||
"ARTISAN", "ADEPT", "EXPERT", "` MASTER", "a MASTER","b MASTER", "c MASTER", "d MASTER", "e MASTER", "ARCHMASTER"};
|
||||
static const char* G0428_apc_SkillLevelNames_DE_DEU[15] = {"ANFAENGER", "NEULING", "LEHRLING", "ARBEITER", "GESELLE", "HANDWERKR", "FACHMANN",
|
||||
"EXPERTE", "` MEISTER", "a MEISTER", "b MEISTER", "c MEISTER", "d MEISTER", "e MEISTER", "ERZMEISTR"};
|
||||
static const char* G0428_apc_SkillLevelNames_FR_FRA[15] = {"NEOPHYTE", "NOVICE", "APPRENTI", "COMPAGNON", "ARTISAN", "PATRON",
|
||||
"ADEPTE", "EXPERT", "MAITRE '", "MAITRE a", "MAITRE b", "MAITRE c", "MAITRE d", "MAITRE e", "SUR-MAITRE"};
|
||||
const char **g428_byLanguage;
|
||||
switch (_vm->getGameLanguage()) { // localized
|
||||
default:
|
||||
case Common::EN_ANY: g428_byLanguage = G0428_apc_SkillLevelNames_EN_ANY; break;
|
||||
case Common::DE_DEU: g428_byLanguage = G0428_apc_SkillLevelNames_DE_DEU; break;
|
||||
case Common::FR_FRA: g428_byLanguage = G0428_apc_SkillLevelNames_FR_FRA; break;
|
||||
}
|
||||
for (int i = 0; i < 15; ++i)
|
||||
G0428_apc_SkillLevelNames[i] = g428_byLanguage[i];
|
||||
static const char* G0428_apc_SkillLevelNames_EN_ANY[15] = {"NEOPHYTE", "NOVICE", "APPRENTICE", "JOURNEYMAN", "CRAFTSMAN",
|
||||
"ARTISAN", "ADEPT", "EXPERT", "` MASTER", "a MASTER","b MASTER", "c MASTER", "d MASTER", "e MASTER", "ARCHMASTER"};
|
||||
static const char* G0428_apc_SkillLevelNames_DE_DEU[15] = {"ANFAENGER", "NEULING", "LEHRLING", "ARBEITER", "GESELLE", "HANDWERKR", "FACHMANN",
|
||||
"EXPERTE", "` MEISTER", "a MEISTER", "b MEISTER", "c MEISTER", "d MEISTER", "e MEISTER", "ERZMEISTR"};
|
||||
static const char* G0428_apc_SkillLevelNames_FR_FRA[15] = {"NEOPHYTE", "NOVICE", "APPRENTI", "COMPAGNON", "ARTISAN", "PATRON",
|
||||
"ADEPTE", "EXPERT", "MAITRE '", "MAITRE a", "MAITRE b", "MAITRE c", "MAITRE d", "MAITRE e", "SUR-MAITRE"};
|
||||
const char **g428_byLanguage;
|
||||
switch (_vm->getGameLanguage()) { // localized
|
||||
default:
|
||||
case Common::EN_ANY:
|
||||
g428_byLanguage = G0428_apc_SkillLevelNames_EN_ANY;
|
||||
break;
|
||||
case Common::DE_DEU:
|
||||
g428_byLanguage = G0428_apc_SkillLevelNames_DE_DEU;
|
||||
break;
|
||||
case Common::FR_FRA:
|
||||
g428_byLanguage = G0428_apc_SkillLevelNames_FR_FRA;
|
||||
break;
|
||||
}
|
||||
for (int i = 0; i < 15; ++i)
|
||||
G0428_apc_SkillLevelNames[i] = g428_byLanguage[i];
|
||||
|
||||
g32_BoxPanel = Box(80, 223, 52, 124); // @ G0032_s_Graphic562_Box_Panel
|
||||
}
|
||||
|
||||
InventoryMan::InventoryMan(DMEngine *vm) : _vm(vm) {
|
||||
@ -79,10 +77,15 @@ InventoryMan::InventoryMan(DMEngine *vm) : _vm(vm) {
|
||||
_g421_objDescTextXpos = 0;
|
||||
_g422_objDescTextYpos = 0;
|
||||
|
||||
for (int i = 0; i < 15; i++)
|
||||
G0428_apc_SkillLevelNames[i] = nullptr;
|
||||
|
||||
initConstants();
|
||||
}
|
||||
|
||||
void InventoryMan::f355_toggleInventory(ChampionIndex championIndex) {
|
||||
static Box g41_BoxFloppyZzzCross(174, 218, 2, 12); // @ G0041_s_Graphic562_Box_ViewportFloppyZzzCross
|
||||
|
||||
if (championIndex == kM1_ChampionNone) {
|
||||
delete _vm->_saveThumbnail;
|
||||
_vm->_saveThumbnail = nullptr;
|
||||
@ -210,6 +213,10 @@ void InventoryMan::f344_drawPanelFoodOrWaterBar(int16 amount, int16 y, Color col
|
||||
}
|
||||
|
||||
void InventoryMan::f345_drawPanelFoodWaterPoisoned() {
|
||||
static Box g35_BoxFood(112, 159, 60, 68); // @ G0035_s_Graphic562_Box_Food
|
||||
static Box g36_BoxWater(112, 159, 83, 91); // @ G0036_s_Graphic562_Box_Water
|
||||
static Box g37_BoxPoisoned(112, 207, 105, 119); // @ G0037_s_Graphic562_Box_Poisoned
|
||||
|
||||
Champion &champ = _vm->_championMan->_gK71_champions[_g432_inventoryChampionOrdinal];
|
||||
f334_closeChest();
|
||||
DisplayMan &dispMan = *_vm->_displayMan;
|
||||
|
@ -37,9 +37,6 @@ namespace DM {
|
||||
#define k69_ChampionStatusBoxSpacing 69 // @ C69_CHAMPION_STATUS_BOX_SPACING
|
||||
#define k38_SlotBoxChestFirstSlot 38 // @ C38_SLOT_BOX_CHEST_FIRST_SLOT
|
||||
|
||||
|
||||
extern Box g32_BoxPanel; // @ G0032_s_Graphic562_Box_Panel
|
||||
|
||||
enum PanelContent {
|
||||
k0_PanelContentFoodWaterPoisoned = 0, // @ C00_PANEL_FOOD_WATER_POISONED
|
||||
k2_PanelContentScroll = 2, // @ C02_PANEL_SCROLL
|
||||
@ -47,8 +44,6 @@ enum PanelContent {
|
||||
k5_PanelContentResurrectReincarnate = 5 // @ C05_PANEL_RESURRECT_REINCARNATE
|
||||
};
|
||||
|
||||
extern const char* G0428_apc_SkillLevelNames[15]; // @ G0428_apc_SkillLevelNames
|
||||
|
||||
class InventoryMan {
|
||||
DMEngine *_vm;
|
||||
|
||||
@ -63,6 +58,8 @@ public:
|
||||
Thing _g426_openChest; // @ G0426_T_OpenChest
|
||||
int16 _g421_objDescTextXpos; // @ G0421_i_ObjectDescriptionTextX
|
||||
int16 _g422_objDescTextYpos; // @ G0422_i_ObjectDescriptionTextY
|
||||
Box g32_BoxPanel;
|
||||
const char* G0428_apc_SkillLevelNames[15];
|
||||
|
||||
void f355_toggleInventory(ChampionIndex championIndex); // @ F0355_INVENTORY_Toggle_CPSE
|
||||
void f354_drawStatusBoxPortrait(ChampionIndex championIndex); // @ F0354_INVENTORY_DrawStatusBoxPortrait
|
||||
|
Loading…
x
Reference in New Issue
Block a user