diff --git a/Stub/diabloui.cpp b/Stub/diabloui.cpp index f8e99506b..38f1664cd 100644 --- a/Stub/diabloui.cpp +++ b/Stub/diabloui.cpp @@ -112,8 +112,9 @@ void LoadUiGFX() { DWORD dwData[2]; - LoadArtImage("ui_art\\focus16.pcx", &MenuPentegram16, 8, dwData); - LoadArtImage("ui_art\\focus42.pcx", &MenuPentegram42, 8, dwData); + LoadArtImage("ui_art\\focus16.pcx", &MenuPentegram16, 8, NULL); + LoadArtImage("ui_art\\focus.pcx", &MenuPentegram, 8, NULL); + LoadArtImage("ui_art\\focus42.pcx", &MenuPentegram42, 8, NULL); LoadArtImage("ui_art\\cursor.pcx", &pPcxCursorImage, 1, dwData); gdwCursorWidth = dwData[0]; @@ -175,7 +176,6 @@ void UiInitialize() SDL_Event event; int x, y; bool quit = false; - int HeroPortrait = 3; printf("Main Menu Init\n"); if (!window) { @@ -191,40 +191,37 @@ void UiInitialize() LoadCharNamesintoMemory(); while (!quit) { - DrawMouse(); PaletteFadeIn(32); switch (menu) { case SPLASH: - SDL_RenderDiabloSplashPage(); + RenderDiabloSplashPage(); break; case MAINMENU: - SDL_RenderDiabloMainPage(); + RenderDiabloMainPage(); + DrawMouse(); break; case SINGLEPLAYER_LOAD: - SDL_RenderDiabloSinglePlayerPage(); + RenderDiabloSinglePlayerPage(); gbMaxPlayers = 1; DrawMouse(); break; case SINGLEPLAYER_CLASSES: - CreateHeroMenu(); // TODO crashes - DrawNewHeroImage(HeroPortrait, 1); + CreateHeroMenu(); DrawMouse(); break; case SINGLEPLAYER_NAME: - DrawNewHeroImage(HeroPortrait, 0); - RenderDefaultStats(HeroPortrait); - RenderUndecidedHeroName(); + RenderUndecidedHeroName(HeroChosen); DrawMouse(); break; case MULTIPLAYER_LOBBY: - DrawPreGameOptions(HeroPortrait, 1); - RenderDefaultStats(HeroPortrait); + DrawPreGameOptions(1); + RenderDefaultStats(HeroChosen); DrawMouse(); break; case MULTIPLAYER_DIFFICULTY: - DrawPreGameDifficultySelection(HeroPortrait, 1); - RenderDefaultStats(HeroPortrait); + DrawPreGameDifficultySelection(HeroChosen, 1); + RenderDefaultStats(HeroChosen); DrawMouse(); break; case CREDIT: @@ -255,7 +252,7 @@ void UiInitialize() case SDLK_UP: SelectedItem--; if (SelectedItem < 1) { - SelectedItem = SelectedItemMax; + SelectedItem = SelectedItemMax ? SelectedItemMax : 1; } effects_play_sound("sfx\\items\\titlemov.wav"); break; @@ -291,10 +288,19 @@ void UiInitialize() } break; case SINGLEPLAYER_LOAD: - if (SelectedItem == SelectedItemMax) { - SetMenu(SINGLEPLAYER_NAME); + if (1 || SelectedItem == SelectedItemMax) { // TODO skip to choose class if no valid saves + SetMenu(SINGLEPLAYER_CLASSES); } break; + case SINGLEPLAYER_CLASSES: + HeroChosen = SelectedItem - 1; + SetMenu(SINGLEPLAYER_NAME); + break; + case SINGLEPLAYER_NAME: + CreateSinglePlayerChar = 1; + const char *test_name = HeroUndecidedName; + quit = true; + break; } break; @@ -343,12 +349,6 @@ void UiInitialize() int CreateHeroCanBBoxX = 445; int CreateHeroCanBBoxY = 473; - SDL_Rect SorcerorSelectBox; - SorcerorSelectBox.y = 428; - SorcerorSelectBox.x = 280; - SorcerorSelectBox.w = 100; - SorcerorSelectBox.h = 30; - SDL_Rect CreateHeroCancelBox; CreateHeroCancelBox.y = 550; CreateHeroCancelBox.x = 675; @@ -423,8 +423,6 @@ void UiInitialize() SetMenu(MULTIPLAYER_LOBBY); // break; } else if (TotalPlayers >= 6 && IsInsideRect(x, y, CreateHeroCancelBox)) { - HeroPortrait = 3; - printf("Cancel\n\n\n"); SetMenu(MAINMENU); } else if (TotalPlayers >= 6 && IsInside(x, y, CreateHeroX + ItemWidth, CreateHeroY, ItemWidth, ItemHeight)) { @@ -433,7 +431,6 @@ void UiInitialize() } break; case SINGLEPLAYER_CLASSES: - // SinglePlayerMenuItemsLoaded = 0; printf("\n\nmenu3 X%d Y%d \n ", x, y); int WarriorSelectBoxY = 430; @@ -445,9 +442,6 @@ void UiInitialize() int SorcerorSelectBoxX = 383; int SorcerorSelectBoxY = 365; - // int x = 280; - // int y = 430; - SDL_Rect WarriorSelectBox; WarriorSelectBox.y = 350; WarriorSelectBox.x = 280; @@ -459,27 +453,26 @@ void UiInitialize() RogueSelectBox.x = 280; RogueSelectBox.w = 100; RogueSelectBox.h = 30; - // X450 Y 392 ; - // X 447 Y 428 + + SDL_Rect SorcerorSelectBox; + SorcerorSelectBox.y = 428; + SorcerorSelectBox.x = 280; + SorcerorSelectBox.w = 100; + SorcerorSelectBox.h = 30; if (IsInsideRect(x, y, WarriorSelectBox)) { printf(" warrior I was hit\n\n\n"); - HeroPortrait = 0; HeroChosen = 0; SetMenu(SINGLEPLAYER_NAME); } else if (IsInsideRect(x, y, RogueSelectBox)) { printf(" rogue I was hit\n\n\n"); - HeroPortrait = 1; HeroChosen = 1; SetMenu(SINGLEPLAYER_NAME); } else if (IsInsideRect(x, y, SorcerorSelectBox)) { - HeroPortrait = 2; printf("sorceror I was hit\n\n\n"); HeroChosen = 2; SetMenu(SINGLEPLAYER_NAME); } else if (IsInsideRect(x, y, CreateHeroCancelBox)) { - HeroPortrait = 3; - printf("Cancel\n\n\n"); SetMenu(SINGLEPLAYER_CLASSES); } @@ -499,7 +492,6 @@ void UiInitialize() NewHeroNameIndex = 0; printf("Cancel\n\n\n"); - HeroPortrait = 3; SetMenu(SINGLEPLAYER_CLASSES); } else if (IsInsideRect(x, y, ClickOkBox)) { printf("Ok\n"); @@ -546,7 +538,6 @@ void UiInitialize() printf(" Load Game I was hit\n\n\n"); break; } else if (IsInsideRect(x, y, CreateHeroCancelBox)) { - HeroPortrait = 3; timestart = 0; cpu_time_used = 0; start = 0; @@ -603,7 +594,6 @@ void UiInitialize() StartNewGame = 1; break; } else if (IsInsideRect(x, y, CreateHeroCancelBox)) { - HeroPortrait = 3; timestart = 0; cpu_time_used = 0; start = 0; diff --git a/Stub/sdlrender.cpp b/Stub/sdlrender.cpp index ee6e8e653..7adcca447 100644 --- a/Stub/sdlrender.cpp +++ b/Stub/sdlrender.cpp @@ -62,7 +62,7 @@ unsigned char *pFont16; int gdwFont24Width; int gdwFont24Height; -void *pPcxFont24sImage; +void *pPcxFont24sImage; void *pPcxFont24gImage; unsigned char *pFont24; @@ -84,6 +84,7 @@ int GameTitleWidth; void *TitleMenuText; void *MenuPentegram16; +void *MenuPentegram; void *MenuPentegram42; void *pDiabfrCel; @@ -833,16 +834,11 @@ void GetWorkingLocationOfFile(char *RelativeFile) uint32_t XgetTick() { - unsigned theTick = 0U; printf("This is supposed to replace GitTicks()"); return theTick; } -void SDLCreateDiabloCursor() -{ -} - void SdlDiabloMainWindow() { SDL_ShowCursor(SDL_DISABLE); @@ -1049,28 +1045,28 @@ void ShowCredts() } } -///////////////////////////Renders - -void AnimateDiabloLogo(int t, int w, int h, void *pBuffer) -{ - int MyPcxDelay = 60; - int MyPcxFRAME = (SDL_GetTicks() / MyPcxDelay) % 15; - MyPcxFRAME++; - if (MyPcxFRAME == 15) { - MyPcxFRAME = 0; - } - - DrawArtWithMask(GetCenterOffset(w), t, w, h, MyPcxFRAME, 250, pBuffer); -} - -void RenderDiabloLogo() -{ - AnimateDiabloLogo(182, gdwLogoWidth, gdwLogoHeight, pPcxLogoImage); -} - -void RenderDiabloLogoSm() -{ - AnimateDiabloLogo(0, gdwLogoSmWidth, gdwLogoSmHeight, pPcxLogoSmImage); +///////////////////////////Renders + +void AnimateDiabloLogo(int t, int w, int h, void *pBuffer) +{ + int MyPcxDelay = 60; + int MyPcxFRAME = (SDL_GetTicks() / MyPcxDelay) % 15; + MyPcxFRAME++; + if (MyPcxFRAME == 15) { + MyPcxFRAME = 0; + } + + DrawArtWithMask(GetCenterOffset(w), t, w, h, MyPcxFRAME, 250, pBuffer); +} + +void RenderDiabloLogo() +{ + AnimateDiabloLogo(182, gdwLogoWidth, gdwLogoHeight, pPcxLogoImage); +} + +void RenderDiabloLogoSm() +{ + AnimateDiabloLogo(0, gdwLogoSmWidth, gdwLogoSmHeight, pPcxLogoSmImage); } void DrawCursor(int mx, int my) @@ -1104,7 +1100,7 @@ void DrawMouse() // unlock_buf_priv(); } -void DrawSelector(int x, int y, int width, int padding, int spacing, int swidth, void *pBuffer) +void AnimateSelector(int x, int y, int width, int padding, int spacing, int swidth, void *pBuffer) { int Pentframe = (SDL_GetTicks() / 60) % 8; @@ -1112,6 +1108,7 @@ void DrawSelector(int x, int y, int width, int padding, int spacing, int swidth, if (Pentframe == 8) { Pentframe = 0; } + Pentframe = 0; width = width ? width : SCREEN_WIDTH; x += GetCenterOffset(swidth, width); @@ -1123,24 +1120,29 @@ void DrawSelector(int x, int y, int width, int padding, int spacing, int swidth, void DrawSelector16(int x, int y, int width, int padding, int spacing) { - DrawSelector(x, y, width, padding, spacing, 20, MenuPentegram16); + AnimateSelector(x, y, width, padding, spacing, 20, MenuPentegram16); +} + +void DrawSelector(int x, int y, int width, int padding, int spacing) +{ + AnimateSelector(x, y, width, padding, spacing, 30, MenuPentegram); } void DrawSelector42(int x, int y, int width, int padding, int spacing) { - DrawSelector(x, y, width, padding, spacing, 42, MenuPentegram42); + AnimateSelector(x, y, width, padding, spacing, 42, MenuPentegram42); } -void SDL_RenderDiabloSplashPage() +void RenderDiabloSplashPage() { LoadTitelArt("ui_art\\title.pcx"); - DrawArtImage(0, 0, gdwTitleWidth, gdwTitleHeight, 0, pPcxTitleImage); - + DrawArtImage(0, 0, gdwTitleWidth, gdwTitleHeight, 0, pPcxTitleImage); + PrintText24Silver(-1, 410, "Copyright \xA9 1996-2001 Blizzard Entertainment", JustCentre); RenderDiabloLogo(); } -void SDL_RenderDiabloMainPage() +void RenderDiabloMainPage() { char *pszFile = "ui_art\\mainmenu.pcx"; if (false) //DiabloUI_GetSpawned() @@ -1151,7 +1153,6 @@ void SDL_RenderDiabloMainPage() // scrollrt_draw_cursor_back_buffer(); // Doesn't work? - RenderDiabloLogoSm(); int menuTop = 192; @@ -1178,32 +1179,46 @@ void SDL_RenderDiabloMainPage() //ADD_PlrStringXY(0, 600 - 130, 640, " MaTT Uelman, and The Blizzard North Team ThaT Gave Us A Childhood.", COL_BLUE); } -void SDL_RenderDiabloSinglePlayerPage() +void RenderStats(char *lvl, char *str, char *mag, char *dex, char *vit) +{ + PrintText16Silver(31, 323, "Level:", JustRight, 118); + PrintText16Silver(149, 323, lvl, JustCentre, 61); + PrintText16Silver(31, 358, "Strength:", JustRight, 118); + PrintText16Silver(149, 358, str, JustCentre, 61); + PrintText16Silver(31, 380, "Magic:", JustRight, 118); + PrintText16Silver(149, 380, mag, JustCentre, 61); + PrintText16Silver(31, 401, "Dexterity:", JustRight, 118); + PrintText16Silver(149, 401, dex, JustCentre, 61); + PrintText16Silver(31, 422, "Vitality:", JustRight, 118); + PrintText16Silver(149, 422, vit, JustCentre, 61); +} + +void RenderDiabloSinglePlayerPage() { LoadTitelArt("ui_art\\selhero.pcx"); DrawArtImage(0, 0, gdwTitleWidth, gdwTitleHeight, 0, pPcxTitleImage); RenderDiabloLogoSm(); - DrawArtImage(30, 211, gdwHeroWidth, gdwHeroHeight, 0, pPcxHeroImage); + DrawArtImage(30, 211, gdwHeroWidth, gdwHeroHeight, 3, pPcxHeroImage); PrintText30Silver(-1, 161, "Single Player Characters", JustCentre); - PrintText30Silver(241 - 1, 211, "Select Hero", JustCentre, 369); + int w = 369; + int x = 241; + + PrintText30Silver(x - 1, 211, "Select Hero", JustCentre, w); - PrintText24Gold(241 - 1, 256, "New Hero", JustCentre, 369); // 26px spacing + int selectorTop = 256; + int y = selectorTop; + for (int i = 0; i < 0; i++) { + PrintText24Gold(x - 1, y, "Hero name", JustCentre, w); + y += 26; + } + PrintText24Gold(x - 1, y, "New Hero", JustCentre, w); - DrawSelector16(241, 256 + 3, 369, 32, 26); + DrawSelector16(x, selectorTop + 3, w, 32, 26); - PrintText16Silver(31, 323, "Level:", JustRight, 118); - PrintText16Silver(149, 323, "1", JustCentre, 61); - PrintText16Silver(31, 358, "Strength:", JustRight, 118); - PrintText16Silver(149, 358, "30", JustCentre, 61); - PrintText16Silver(31, 380, "Magic:", JustRight, 118); - PrintText16Silver(149, 380, "10", JustCentre, 61); - PrintText16Silver(31, 401, "Dexterity:", JustRight, 118); - PrintText16Silver(149, 401, "20", JustCentre, 61); - PrintText16Silver(31, 422, "Vitality:", JustRight, 118); - PrintText16Silver(149, 422, "25", JustCentre, 61); + RenderStats("-", "-", "-", "-", "-"); PrintText30Gold(279, 429, "OK"); PrintText30Gold(378, 429, "Delete"); @@ -1257,28 +1272,7 @@ void LoadClickBoxes(int numberofchars) int LoadedFont = 0; int TotalPlayers = 0; -void DrawNewHeroImage(int image, int ShowClasses) -{ - LoadTitelArt("ui_art\\selhero.pcx"); - DrawArtImage(0, 0, gdwTitleWidth, gdwTitleHeight, 0, pPcxTitleImage); - RenderDiabloLogoSm(); - - DrawArtImage(30, 211, gdwHeroWidth, gdwHeroHeight, 0, pPcxHeroImage); - - char *heroclasses[3] = { "Warrior", "Rogue", "Sorceror" }; - - // this should not be hard coded. - int x = 280; - int y = 430; - if (ShowClasses == 1) { - for (int i = 0; i < 3; i++) { - y += 40; - PrintText16Silver(x, y, heroclasses[i]); - } - } -} - -void DrawPreGameOptions(int image, int ShowClasses) +void DrawPreGameOptions(int ShowClasses) { LoadTitelArt("ui_art\\selhero.pcx"); DrawArtImage(0, 0, gdwTitleWidth, gdwTitleHeight, 0, pPcxTitleImage); @@ -1290,7 +1284,7 @@ void DrawPreGameOptions(int image, int ShowClasses) // this should not be hard coded. int x = 280; - int y = 430; + int y = 256; if (ShowClasses == 1) { for (int i = 0; i < 2; i++) { @@ -1300,7 +1294,7 @@ void DrawPreGameOptions(int image, int ShowClasses) } } -void DrawPreGameDifficultySelection(int image, int ShowClasses) +void DrawPreGameDifficultySelection(int HeroClass, int ShowClasses) { LoadTitelArt("ui_art\\selhero.pcx"); DrawArtImage(0, 0, gdwTitleWidth, gdwTitleHeight, 0, pPcxTitleImage); @@ -1308,12 +1302,14 @@ void DrawPreGameDifficultySelection(int image, int ShowClasses) DrawArtImage(30, 211, gdwHeroWidth, gdwHeroHeight, 0, pPcxHeroImage); + RenderStats("1", "30", "10", "20", "25"); + char *GameOptions[3] = { "Normal", "Nightmare", "Hell" }; // this should not be hard coded. int x = 280; - int y = 430; - // DrawArtImage(30, 211, gdwHeroWidth, gdwHeroHeight, image, pPcxHeroImage); + int y = 256; + DrawArtImage(30, 211, gdwHeroWidth, gdwHeroHeight, HeroClass, pPcxHeroImage); if (ShowClasses == 1) { for (int i = 0; i < 3; i++) { @@ -1323,41 +1319,19 @@ void DrawPreGameDifficultySelection(int image, int ShowClasses) } } -void RenderDefaultStats(int HeroChosen) +void RenderDefaultStats(int HeroClass) { - int x = 80; - int y = 530; - char *WarriorStats[4] = { "Strenght : 30", "Magic : 10", "Dexterity : 20", "Vitality : 25" }; - char *RogueStats[4] = { "Strenght : 20", "Magic : 15", "Dexterity : 30", "Vitality : 20" }; - char *SorcerorStats[4] = { "Strenght : 15", "Magic : 35", "Dexterity : 15", "Vitality : 20" }; - - if (HeroChosen == 0) { - PrintText16Silver(x, y - 20, "Warrior Stats:"); - for (int i = 0; i < 4; i++) { - PrintText16Silver(x, y, WarriorStats[i]); - y += 20; - } - } - if (HeroChosen == 1) { - PrintText16Silver(x, y - 20, "Rogue Stats:"); - for (int i = 0; i < 4; i++) { - PrintText16Silver(x, y, RogueStats[i]); - y += 20; - } + switch (HeroClass) { + case UI_WARRIOR: + RenderStats("1", "30", "10", "20", "25"); + break; + case UI_ROGUE: + RenderStats("1", "20", "15", "30", "20"); + break; + case UI_SORCERER: + RenderStats("1", "15", "35", "15", "20"); + break; } - if (HeroChosen == 2) { - PrintText16Silver(x, y - 20, "Sorceror Stats:"); - - for (int i = 0; i < 4; i++) { - PrintText16Silver(x, y, SorcerorStats[i]); - y += 20; - } - } -} - -void RenderUndecidedHeroName() -{ - gmenu_print_text(270, 450, (char *)HeroUndecidedName); } void SetHeroStats(_uiheroinfo *a1) @@ -1370,30 +1344,69 @@ void LoadHeroStats() pfile_ui_set_hero_infos(SetHeroStats); } -void DrawHeroStats() +// Have this load the function above and then render it in the main menu. +// Cnacel box is also needed. +void CreateHeroMenu() { + LoadTitelArt("ui_art\\selhero.pcx"); + DrawArtImage(0, 0, gdwTitleWidth, gdwTitleHeight, 0, pPcxTitleImage); + RenderDiabloLogoSm(); - int x = 80; - int y = 415; + DrawArtImage(30, 211, gdwHeroWidth, gdwHeroHeight, SelectedItem - 1, pPcxHeroImage); - /* - Render charactor stats if you want. + PrintText30Silver(-1, 161, "New Single Player Hero", JustCentre); - */ -} + int w = 369; + int x = 241; + int y = 285; -bool LoadCreateHeroDialogImages = 0; -bool SorcerorCreateSelected = 0; -bool RogueCreateSelected = 0; -bool WarriorCreateSelected = 1; + PrintText30Silver(x - 1, 211, "Choose Class", JustCentre, w); -void LoadCreateHeroDialogMenu() -{ + RenderDefaultStats(SelectedItem - 1); + + char *heroclasses[3] = { "Warrior", "Rogue", "Sorcerer" }; + + int selectorTop = y; + + for (int i = 0; i < 3; i++) { + if (i > 1) { + y += 1; // "Rouge" and "Sorcerer" has a smaller gap then other items + } + PrintText24Gold(x - 1, y, heroclasses[i], JustCentre, w); + y += 33; + } + + if (SelectedItem > 1) { + selectorTop += 1; // "Rouge" and "Sorcerer" has a smaller gap then other items + } + + DrawSelector(x, selectorTop - 2, w, 39, 26); + + PrintText30Gold(329, 429, "OK"); + PrintText30Gold(451, 429, "Cancel"); } -// Have this load the function above and then render it in the main menu. -// Cnacel box is also needed. -void CreateHeroMenu() + +void RenderUndecidedHeroName(int HeroClass) { + LoadTitelArt("ui_art\\selhero.pcx"); DrawArtImage(0, 0, gdwTitleWidth, gdwTitleHeight, 0, pPcxTitleImage); RenderDiabloLogoSm(); + + DrawArtImage(30, 211, gdwHeroWidth, gdwHeroHeight, HeroClass, pPcxHeroImage); + + PrintText30Silver(-1, 161, "New Single Player Hero", JustCentre); + + int w = 369; + int x = 241; + int y = 318; + + PrintText30Silver(x - 1, 211, "Enter Name", JustCentre, w); + + RenderDefaultStats(HeroClass); + + DrawSelector(x, y - 2, w, 39, 26); + PrintText24Gold(x + 67, y, (char *)HeroUndecidedName); // todo add blinking "|" + + PrintText30Gold(329, 429, "OK"); + PrintText30Gold(451, 429, "Cancel"); } diff --git a/Stub/sdlrender.h b/Stub/sdlrender.h index d8d36ed94..d7e683632 100644 --- a/Stub/sdlrender.h +++ b/Stub/sdlrender.h @@ -56,11 +56,6 @@ extern int gdwCreditsHeight; extern bool TitleImageLoaded; -//My SDL inclusions // -extern bool SorcerorCreateSelected; -extern bool WarriorCreateSelected; -extern bool RogueCreateSelected; - extern int totalFrames; //extern SDL_Texture* spriteSheet; extern SDL_Surface *DiabloTitle; @@ -87,6 +82,7 @@ extern int HeroChosen; extern void *TitleMenuText; extern void *MenuPentegram16; +extern void *MenuPentegram; extern void *MenuPentegram42; extern char HeroUndecidedName[17]; @@ -96,26 +92,23 @@ extern SDL_Rect CreateHeroBox; void CreateMenuDialogBox(); void CreateDiabloMainMenuz(); void SdlDiabloMainWindow(); -void SDL_RenderDiabloSplashPage(); -void SDL_RenderDiabloMainPage(); +void RenderDiabloSplashPage(); +void RenderDiabloMainPage(); char *GetWorkingDirectory(); void CreateMainDiabloMenu(); -void SDLCreateDiabloCursor(); -void SDL_RenderDiabloSinglePlayerPage(); +void RenderDiabloSinglePlayerPage(); void ShowCredts(); void RenderCharNames(); -void SDL_Diablo_UI(); void FreeMenuItems(); BOOL __cdecl LoadArtImage(char *pszFile, void **pBuffer, int frames, DWORD *data); void DrawMouse(); void DrawCursor(int mx, int my); void CreateHeroMenu(); -void DrawNewHeroImage(int image, int ShowClasses); -void RenderUndecidedHeroName(); +void RenderUndecidedHeroName(int HeroClass); void LoadHeroStats(); -void RenderDefaultStats(int HeroChosen); -void DrawPreGameOptions(int image, int ShowClasses); -void DrawPreGameDifficultySelection(int image, int ShowClasses); +void RenderDefaultStats(int HeroClass); +void DrawPreGameOptions(int ShowClasses); +void DrawPreGameDifficultySelection(int HeroClass, int ShowClasses); int GetCenterOffset(int w, int bw = 0); void DrawPCXString(int x, int y, int w, int h, char *str, BYTE *font, void *pBuff); void DrawArtWithMask(int SX, int SY, int SW, int SH, int nFrame, BYTE bMask, void *pBuffer);