Browse Source

Implement splash screen

pull/17/head
Anders Jenbo 7 years ago
parent
commit
937afed84b
  1. 203
      Stub/diabloui.cpp
  2. 13
      Stub/dx.cpp
  3. 84
      Stub/sdlrender.cpp
  4. 9
      Stub/sdlrender.h
  5. 15
      enums.h

203
Stub/diabloui.cpp

@ -4,10 +4,11 @@
#include "sdlrender.h"
#include "stubs.h"
int menu = 0;
int SelectedItem = 1;
int SelectedItemMax = 1;
int MenuItem[10] = { 5, 0, 1, 0, 0, 0, 0, 0, 0, 0 };
int menu = SPLASH;
int SelectedItem = 0;
int SelectedItemMax = 0;
int MenuItem[11] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
int PreviousItem[11] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
void __cdecl UiDestroy()
{
@ -44,7 +45,7 @@ void LoadCharNamesintoMemory()
}
for (int i = 0; i < MAX_CHARACTERS; i++) {
strcpy(p_hero_names, "32as1d");
strcpy(p_hero_names, "32as1d");
p_hero_names += 32;
}
@ -84,7 +85,28 @@ BOOL IsInsideRect(int x, int y, SDL_Rect rect)
return IsInside(x, y, rect.x, rect.y, rect.w, rect.h);
}
void LoadUiGFX() // I anticipate to move this later.
void InitHiracy()
{
MenuItem[MAINMENU] = 5;
MenuItem[SINGLEPLAYER_CLASSES] = 3;
MenuItem[MULTIPLAYER_CONNECTIONS] = 4;
MenuItem[MULTIPLAYER_LOBBY] = 2;
MenuItem[MULTIPLAYER_DIFFICULTY] = 3;
MenuItem[MULTIPLAYER_BNET_GATEWAYS] = 3;
PreviousItem[SPLASH] = MAINMENU;
PreviousItem[SINGLEPLAYER_LOAD] = MAINMENU;
PreviousItem[SINGLEPLAYER_CLASSES] = SINGLEPLAYER_LOAD;
PreviousItem[SINGLEPLAYER_NAME] = SINGLEPLAYER_CLASSES;
PreviousItem[MULTIPLAYER_CONNECTIONS] = MAINMENU;
PreviousItem[MULTIPLAYER_LOBBY] = MULTIPLAYER_CONNECTIONS;
PreviousItem[MULTIPLAYER_DIFFICULTY] = MULTIPLAYER_LOBBY;
PreviousItem[MULTIPLAYER_BNET_GATEWAYS] = MULTIPLAYER_CONNECTIONS;
PreviousItem[MULTIPLAYER_ERROR] = MAINMENU;
PreviousItem[CREDIT] = MAINMENU;
}
void LoadUiGFX()
{
DWORD dwData[2];
@ -95,10 +117,15 @@ void LoadUiGFX() // I anticipate to move this later.
gdwCursorWidth = dwData[0];
gdwCursorHeight = dwData[1];
LoadArtImage("ui_art\\smlogo.pcx", &pPcxLogoImage, 15, dwData);
printf("logo\n");
LoadArtImage("ui_art\\logo.pcx", &pPcxLogoImage, 15, dwData);
gdwLogoWidth = dwData[0];
gdwLogoHeight = dwData[1];
LoadArtImage("ui_art\\smlogo.pcx", &pPcxLogoSmImage, 15, dwData);
gdwLogoSmWidth = dwData[0];
gdwLogoSmHeight = dwData[1];
LoadArtImage("ui_art\\heros.pcx", &pPcxHeroImage, 4, dwData);
gdwHeroWidth = dwData[0];
gdwHeroHeight = dwData[1];
@ -110,6 +137,7 @@ void LoadUiGFX() // I anticipate to move this later.
gdwFont16Height = dwData[1];
pFont24 = LoadFileInMem("ui_art\\font24.bin", 0);
LoadArtImage("ui_art\\font24s.pcx", &pPcxFont24sImage, 256, NULL);
LoadArtImage("ui_art\\font24g.pcx", &pPcxFont24gImage, 256, dwData);
gdwFont24Width = dwData[0];
gdwFont24Height = dwData[1];
@ -126,11 +154,13 @@ void LoadUiGFX() // I anticipate to move this later.
gdwFont42Height = dwData[1];
}
void UiInitialize() // I anticipate to move this later.
void UiInitialize()
{
printf("UiInitialize");
//SDL_SetRelativeMouseMode(SDL_TRUE);
// WNDPROC saveProc;
InitHiracy();
LoadUiGFX();
snd_init(0);
music_start(5);
@ -139,7 +169,7 @@ void UiInitialize() // I anticipate to move this later.
signed int NewHeroNameIndex = 0;
SetMenu(0);
SelectedItemMax = MenuItem[menu];
SDL_Event event;
int x, y;
bool quit = false;
@ -163,36 +193,39 @@ void UiInitialize() // I anticipate to move this later.
PaletteFadeIn(32);
switch (menu) {
case 0:
case SPLASH:
SDL_RenderDiabloSplashPage();
break;
case MAINMENU:
SDL_RenderDiabloMainPage();
break;
case 2:
case SINGLEPLAYER_LOAD:
SDL_RenderDiabloSinglePlayerPage();
gbMaxPlayers = 1;
DrawMouse();
break;
case 3:
CreateHeroMenu();
case SINGLEPLAYER_CLASSES:
CreateHeroMenu(); // TODO crashes
DrawNewHeroImage(HeroPortrait, 1);
DrawMouse();
break;
case 4:
case SINGLEPLAYER_NAME:
DrawNewHeroImage(HeroPortrait, 0);
RenderDefaultStats(HeroPortrait);
RenderUndecidedHeroName();
DrawMouse();
break;
case 5:
case MULTIPLAYER_LOBBY:
DrawPreGameOptions(HeroPortrait, 1);
RenderDefaultStats(HeroPortrait);
DrawMouse();
break;
case 6:
case MULTIPLAYER_DIFFICULTY:
DrawPreGameDifficultySelection(HeroPortrait, 1);
RenderDefaultStats(HeroPortrait);
DrawMouse();
break;
case 10:
case CREDIT:
ShowCredts();
break;
}
@ -202,8 +235,8 @@ void UiInitialize() // I anticipate to move this later.
case SDL_KEYDOWN:
switch (event.key.keysym.sym) {
case SDLK_ESCAPE:
if (menu != 0) {
SetMenu(0);
if (PreviousItem[menu]) {
SetMenu(PreviousItem[menu]);
break;
}
quit = true;
@ -234,22 +267,31 @@ void UiInitialize() // I anticipate to move this later.
break;
case SDLK_RETURN:
switch (SelectedItem) {
case MAINMENU_SINGLE_PLAYER:
SetMenu(2); // TODO skip to choose class if no valid saves
break;
case MAINMENU_MULTIPLAYER:
printf("Multi Player\n");
break;
case MAINMENU_REPLAY_INTRO:
printf("Replay Intro\n");
break;
case MAINMENU_SHOW_CREDITS:
SetMenu(10);
switch (menu) {
case MAINMENU:
switch (SelectedItem) {
case MAINMENU_SINGLE_PLAYER:
SetMenu(SINGLEPLAYER_LOAD); // TODO skip to choose class if no valid saves
break;
case MAINMENU_MULTIPLAYER:
printf("Multi Player\n");
break;
case MAINMENU_REPLAY_INTRO:
printf("Replay Intro\n");
break;
case MAINMENU_SHOW_CREDITS:
SetMenu(CREDIT);
break;
case MAINMENU_EXIT_DIABLO:
quit = true;
ExitDiablo();
break;
}
break;
case MAINMENU_EXIT_DIABLO:
quit = true;
ExitDiablo();
case SINGLEPLAYER_LOAD:
if (SelectedItem == SelectedItemMax) {
SetMenu(SINGLEPLAYER_NAME);
}
break;
}
break;
@ -302,38 +344,38 @@ void UiInitialize() // I anticipate to move this later.
SDL_Rect SorcerorSelectBox;
SorcerorSelectBox.y = 428;
SorcerorSelectBox.x = 280;
SorcerorSelectBox.w = SorcerorSelectBox.x + 100;
SorcerorSelectBox.h = SorcerorSelectBox.y + 30;
SorcerorSelectBox.w = 100;
SorcerorSelectBox.h = 30;
SDL_Rect CreateHeroCancelBox;
CreateHeroCancelBox.y = 550;
CreateHeroCancelBox.x = 675;
CreateHeroCancelBox.w = CreateHeroCancelBox.x + 100;
CreateHeroCancelBox.h = CreateHeroCancelBox.y + 30;
CreateHeroCancelBox.w = 100;
CreateHeroCancelBox.h = 30;
clock_t start, end;
double cpu_time_used;
switch (menu) {
case 0:
case MAINMENU:
ItemTop = 191;
ItemHeight = 42;
ItemWidth = 515;
ItemLeft = GetCenterOffset(ItemWidth);
if (IsInside(x, y, ItemLeft, ItemTop, ItemWidth, ItemHeight)) {
SetMenu(2); // TODO skip to choose class if no valid saves
SetMenu(SINGLEPLAYER_LOAD); // TODO skip to choose class if no valid saves
} else if (IsInside(x, y, ItemLeft, ItemTop + ItemHeight + 1, ItemWidth, ItemHeight)) {
printf("Multi Player\n");
} else if (IsInside(x, y, ItemLeft, ItemTop + ItemHeight * 2 + 1, ItemWidth, ItemHeight)) {
printf("Replay Intro\n");
} else if (IsInside(x, y, ItemLeft, ItemTop + ItemHeight * 3 + 2, ItemWidth, ItemHeight)) {
SetMenu(10);
SetMenu(CREDIT);
} else if (IsInside(x, y, ItemLeft, ItemTop + ItemHeight * 4 + 3, ItemWidth, ItemHeight)) {
quit = true;
ExitDiablo();
}
break;
case 2:
case SINGLEPLAYER_LOAD:
ItemLeft = 440;
ItemTop = 315;
ItemHeight = 30;
@ -346,49 +388,49 @@ void UiInitialize() // I anticipate to move this later.
if (TotalPlayers >= 1 && IsInside(x, y, ItemLeft, ItemTop, ItemWidth, ItemHeight)) {
strcpy(chr_name_str, hero_names[0]);
printf("Player %s\n", chr_name_str);
SetMenu(5);
SetMenu(MULTIPLAYER_LOBBY);
// break;
} else if (TotalPlayers >= 2 && IsInside(x, y, ItemLeft, ItemTop + ItemHeight, ItemWidth, ItemHeight)) {
printf("Player 2 Diablo\n");
strcpy(chr_name_str, hero_names[1]);
printf("Player %s\n", chr_name_str);
SetMenu(5);
SetMenu(MULTIPLAYER_LOBBY);
// break;
} else if (TotalPlayers >= 3 && IsInside(x, y, ItemLeft, ItemTop + ItemHeight * 2, ItemWidth, ItemHeight)) {
printf("Player 3 Diablo\n");
strcpy(chr_name_str, hero_names[2]);
printf("Player %s\n", chr_name_str);
SetMenu(5);
SetMenu(MULTIPLAYER_LOBBY);
// break;
} else if (TotalPlayers >= 4 && IsInside(x, y, ItemLeft, ItemTop + ItemHeight * 3, ItemWidth, ItemHeight)) {
printf("Player 4 Diablo\n");
strcpy(chr_name_str, hero_names[3]);
printf("Player %s\n", chr_name_str);
SetMenu(5);
SetMenu(MULTIPLAYER_LOBBY);
// break;
} else if (TotalPlayers >= 5 && IsInside(x, y, ItemLeft, ItemTop + ItemHeight * 4, ItemWidth, ItemHeight)) {
printf("Player 5 Diablo\n");
strcpy(chr_name_str, hero_names[4]);
printf("Player %s\n", chr_name_str);
SetMenu(5);
SetMenu(MULTIPLAYER_LOBBY);
// break;
} else if (TotalPlayers >= 6 && IsInside(x, y, ItemLeft, ItemTop + ItemHeight * 5, ItemWidth, ItemHeight)) {
printf("Player 6 Diablo\n");
strcpy(chr_name_str, hero_names[5]);
printf("Player %s\n", chr_name_str);
SetMenu(5);
SetMenu(MULTIPLAYER_LOBBY);
// break;
} else if (TotalPlayers >= 6 && IsInsideRect(x, y, CreateHeroCancelBox)) {
HeroPortrait = 3;
printf("Cancel\n\n\n");
SetMenu(0);
SetMenu(MAINMENU);
} else if (TotalPlayers >= 6 && IsInside(x, y, CreateHeroX + ItemWidth, CreateHeroY, ItemWidth, ItemHeight)) {
printf("Clicked Create Hero Box\n");
SetMenu(3);
SetMenu(SINGLEPLAYER_CLASSES);
}
break;
case 3:
case SINGLEPLAYER_CLASSES:
// SinglePlayerMenuItemsLoaded = 0;
printf("\n\nmenu3 X%d Y%d \n ", x, y);
@ -407,14 +449,14 @@ void UiInitialize() // I anticipate to move this later.
SDL_Rect WarriorSelectBox;
WarriorSelectBox.y = 350;
WarriorSelectBox.x = 280;
WarriorSelectBox.w = WarriorSelectBox.x + 100;
WarriorSelectBox.h = WarriorSelectBox.y + 30;
WarriorSelectBox.w = 100;
WarriorSelectBox.h = 30;
SDL_Rect RogueSelectBox;
RogueSelectBox.y = 392;
RogueSelectBox.x = 280;
RogueSelectBox.w = RogueSelectBox.x + 100;
RogueSelectBox.h = RogueSelectBox.y + 30;
RogueSelectBox.w = 100;
RogueSelectBox.h = 30;
// X450 Y 392 ;
// X 447 Y 428
@ -422,33 +464,32 @@ void UiInitialize() // I anticipate to move this later.
printf(" warrior I was hit\n\n\n");
HeroPortrait = 0;
HeroChosen = 0;
SetMenu(4);
SetMenu(SINGLEPLAYER_NAME);
} else if (IsInsideRect(x, y, RogueSelectBox)) {
printf(" rogue I was hit\n\n\n");
HeroPortrait = 1;
HeroChosen = 1;
SetMenu(4);
SetMenu(SINGLEPLAYER_NAME);
} else if (IsInsideRect(x, y, SorcerorSelectBox)) {
HeroPortrait = 2;
printf("sorceror I was hit\n\n\n");
HeroChosen = 2;
SetMenu(4);
SetMenu(SINGLEPLAYER_NAME);
} else if (IsInsideRect(x, y, CreateHeroCancelBox)) {
HeroPortrait = 3;
printf("Cancel\n\n\n");
SetMenu(3);
SetMenu(SINGLEPLAYER_CLASSES);
}
break;
case 4:
case SINGLEPLAYER_NAME:
printf("Create hero");
// X 549 , Y 551
SDL_Rect ClickOkBox;
ClickOkBox.y = 550;
ClickOkBox.x = 550;
ClickOkBox.w = ClickOkBox.x + 30;
ClickOkBox.h = ClickOkBox.y + 30;
ClickOkBox.x = 324;
ClickOkBox.y = 430;
ClickOkBox.w = 48;
ClickOkBox.h = 30;
if (IsInsideRect(x, y, CreateHeroCancelBox)) {
memset(HeroUndecidedName, 0, 17);
@ -457,7 +498,7 @@ void UiInitialize() // I anticipate to move this later.
printf("Cancel\n\n\n");
HeroPortrait = 3;
SetMenu(3);
SetMenu(SINGLEPLAYER_CLASSES);
} else if (IsInsideRect(x, y, ClickOkBox)) {
printf("Ok\n");
CreateSinglePlayerChar = 1;
@ -481,20 +522,20 @@ void UiInitialize() // I anticipate to move this later.
SDL_Rect NewGameBox;
NewGameBox.y = 350;
NewGameBox.x = 280;
NewGameBox.w = NewGameBox.x + 300;
NewGameBox.h = NewGameBox.y + 30;
NewGameBox.w = 300;
NewGameBox.h = 30;
SDL_Rect LoadGameBox;
LoadGameBox.y = 392;
LoadGameBox.x = 280;
LoadGameBox.w = LoadGameBox.x + 300;
LoadGameBox.h = LoadGameBox.y + 30;
LoadGameBox.w = 300;
LoadGameBox.h = 30;
// X450 Y 392 ;
// X 447 Y 428
if (cpu_time_used > 0.5 && IsInsideRect(x, y, NewGameBox)) {
printf(" New Game I was hit\n\n\n");
SetMenu(6);
SetMenu(MULTIPLAYER_DIFFICULTY);
cpu_time_used = 0;
timestart = 0;
start = 0;
@ -512,12 +553,10 @@ void UiInitialize() // I anticipate to move this later.
printf("Cancel\n\n\n");
SetMenu(2); // TODO skip to main menu if no valid saves
SetMenu(SINGLEPLAYER_CLASSES); // TODO skip to main menu if no valid saves
}
break;
case 6:
// Choose difficulty
case MULTIPLAYER_DIFFICULTY:
if (timestart == 0) {
start = clock();
timestart = 1;
@ -532,21 +571,21 @@ void UiInitialize() // I anticipate to move this later.
SDL_Rect NormalSelectBox;
NormalSelectBox.y = 350;
NormalSelectBox.x = 280;
NormalSelectBox.w = NormalSelectBox.x + 300;
NormalSelectBox.h = NormalSelectBox.y + 30;
NormalSelectBox.w = 300;
NormalSelectBox.h = 30;
SDL_Rect NightmareSelectBox;
NightmareSelectBox.y = 392;
NightmareSelectBox.x = 280;
NightmareSelectBox.w = NightmareSelectBox.x + 300;
NightmareSelectBox.h = NightmareSelectBox.y + 30;
NightmareSelectBox.w = 300;
NightmareSelectBox.h = 30;
// X450 Y 392 ;
SDL_Rect HellSelectBox;
HellSelectBox.y = 428;
HellSelectBox.x = 280;
HellSelectBox.w = HellSelectBox.x + 300;
HellSelectBox.h = HellSelectBox.y + 30;
HellSelectBox.w = 300;
HellSelectBox.h = 30;
// X 447 Y 428
if (cpu_time_used > 0.5 && IsInsideRect(x, y, NormalSelectBox)) {
@ -570,7 +609,7 @@ void UiInitialize() // I anticipate to move this later.
cpu_time_used = 0;
printf("Cancel\n\n\n");
SetMenu(5);
SetMenu(MULTIPLAYER_LOBBY);
}
break;
}

13
Stub/dx.cpp

@ -293,12 +293,11 @@ void sdl_present_surface()
void __cdecl lock_buf_priv()
{
if (!gpBuffer) {
printf(" GpBuffer Created\n ");
printf("GpBuffer Created\n");
const int pitch = 640 + 64 + 64;
gpBuffer = (Screen *)malloc(sizeof(Screen));
printf("SIZE OF SCREEN %d", sizeof(Screen));
printf("SIZE OF SCREEN %d\n", sizeof(Screen));
gpBufEnd += (unsigned int)gpBuffer;
@ -310,15 +309,13 @@ void __cdecl lock_buf_priv()
}
unlock_buf_priv();
}
void __cdecl unlock_buf_priv()
{
gpBufEnd -= (unsigned int)gpBufEnd;
if (!surface_dirty) {
@ -399,4 +396,4 @@ WINBOOL WINAPI TextOutA(HDC hdc, int x, int y, LPCSTR lpString, int c)
SDL_SetWindowTitle(window, lpString);
return TRUE;
}
}

84
Stub/sdlrender.cpp

@ -2,12 +2,9 @@
#include "miniwin_sdl.h"
#include "stubs.h"
int SCREEN_WIDTH = 640; // 1024×768
int SCREEN_WIDTH = 640;
int SCREEN_HEIGHT = 480;
int Window_Width = 640;
int Window_Height = 480;
int LogoWidth;
int LogoHeight;
@ -35,9 +32,12 @@ bool DiabloImageLoaded = 0;
bool DiabloMainMenuListLoaded = 0;
bool TitleImageLoaded = false;
void *pPcxLogoImage;
int gdwLogoWidth;
int gdwLogoHeight;
void *pPcxLogoImage;
void *pPcxLogoSmImage;
int gdwLogoSmWidth;
int gdwLogoSmHeight;
int gdwTitleWidth;
int gdwTitleHeight;
@ -62,6 +62,7 @@ unsigned char *pFont16;
int gdwFont24Width;
int gdwFont24Height;
void *pPcxFont24sImage;
void *pPcxFont24gImage;
unsigned char *pFont24;
@ -85,8 +86,8 @@ void *TitleMenuText;
void *MenuPentegram16;
void *MenuPentegram42;
void *pDiabfrCel;
void *pDiabfrCel;
char HeroUndecidedName[17];
_uiheroinfo heroarray[10];
@ -848,8 +849,7 @@ void SdlDiabloMainWindow()
SDL_Init(SDL_INIT_EVERYTHING);
SDL_Init(SDL_INIT_VIDEO);
window = SDL_CreateWindow("Diablo", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, Window_Width, Window_Height,
0);
window = SDL_CreateWindow("Diablo", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, SCREEN_WIDTH, SCREEN_HEIGHT, 0);
renderer = SDL_CreateRenderer(window, -1, 0);
printf("Window And Renderer Created!\n");
@ -913,7 +913,7 @@ int GetCenterOffset(int w, int bw = 0)
return bw / 2 - w / 2;
}
void DrawPCXString(int x, int y, int w, int h, char *str, BYTE *font, void *pBuff)
void DrawPCXString(int x, int y, int w, int h, BYTE *str, BYTE *font, void *pBuff)
{
int i;
int len = 0;
@ -979,6 +979,13 @@ void PrintText24Gold(int x, int y, char *text, TXT_JUST align = JustLeft, int bw
DrawPCXString(x, y, gdwFont24Width, gdwFont24Height, text, pFont24, pPcxFont24gImage);
}
void PrintText24Silver(int x, int y, char *text, TXT_JUST align = JustLeft, int bw = 0)
{
x += TextAlignment(text, align, bw, pFont24);
DrawPCXString(x, y, gdwFont24Width, gdwFont24Height, text, pFont24, pPcxFont24sImage);
}
void PrintText30Gold(int x, int y, char *text, TXT_JUST align = JustLeft, int bw = 0)
{
x += TextAlignment(text, align, bw, pFont30);
@ -1042,18 +1049,28 @@ void ShowCredts()
}
}
///////////////////////////Renders
void RenderDiabloLogo()
{
int MyPcxDelay = 60;
int MyPcxFRAME = (SDL_GetTicks() / MyPcxDelay) % 15; // This is not how this should be done...
MyPcxFRAME++;
if (MyPcxFRAME == 15) {
MyPcxFRAME = 0;
}
DrawArtWithMask(GetCenterOffset(gdwLogoWidth), 0, gdwLogoWidth, gdwLogoHeight, MyPcxFRAME, 250, pPcxLogoImage);
///////////////////////////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)
@ -1114,6 +1131,15 @@ void DrawSelector42(int x, int y, int width, int padding, int spacing)
DrawSelector(x, y, width, padding, spacing, 42, MenuPentegram42);
}
void SDL_RenderDiabloSplashPage()
{
LoadTitelArt("ui_art\\title.pcx");
DrawArtImage(0, 0, gdwTitleWidth, gdwTitleHeight, 0, pPcxTitleImage);
PrintText24Silver(-1, 410, "Copyright \xA9 1996-2001 Blizzard Entertainment", JustCentre);
RenderDiabloLogo();
}
void SDL_RenderDiabloMainPage()
{
char *pszFile = "ui_art\\mainmenu.pcx";
@ -1125,11 +1151,11 @@ void SDL_RenderDiabloMainPage()
// scrollrt_draw_cursor_back_buffer(); // Doesn't work?
char *MENIITEMS[5] = { "Single Player", "Multi Player", "Replay Intro", "Show Credits", "Exit Diablo" };
RenderDiabloLogo();
RenderDiabloLogoSm();
int menuTop = 192;
char *MENIITEMS[5] = { "Single Player", "Multi Player", "Replay Intro", "Show Credits", "Exit Diablo" };
for (int i = 0; i < 5; i++) {
int y = menuTop + i * 43;
@ -1156,7 +1182,7 @@ void SDL_RenderDiabloSinglePlayerPage()
{
LoadTitelArt("ui_art\\selhero.pcx");
DrawArtImage(0, 0, gdwTitleWidth, gdwTitleHeight, 0, pPcxTitleImage);
RenderDiabloLogo();
RenderDiabloLogoSm();
DrawArtImage(30, 211, gdwHeroWidth, gdwHeroHeight, 0, pPcxHeroImage);
@ -1235,7 +1261,7 @@ void DrawNewHeroImage(int image, int ShowClasses)
{
LoadTitelArt("ui_art\\selhero.pcx");
DrawArtImage(0, 0, gdwTitleWidth, gdwTitleHeight, 0, pPcxTitleImage);
RenderDiabloLogo();
RenderDiabloLogoSm();
DrawArtImage(30, 211, gdwHeroWidth, gdwHeroHeight, 0, pPcxHeroImage);
@ -1256,7 +1282,7 @@ void DrawPreGameOptions(int image, int ShowClasses)
{
LoadTitelArt("ui_art\\selhero.pcx");
DrawArtImage(0, 0, gdwTitleWidth, gdwTitleHeight, 0, pPcxTitleImage);
RenderDiabloLogo();
RenderDiabloLogoSm();
DrawArtImage(30, 211, gdwHeroWidth, gdwHeroHeight, 0, pPcxHeroImage);
@ -1278,7 +1304,7 @@ void DrawPreGameDifficultySelection(int image, int ShowClasses)
{
LoadTitelArt("ui_art\\selhero.pcx");
DrawArtImage(0, 0, gdwTitleWidth, gdwTitleHeight, 0, pPcxTitleImage);
RenderDiabloLogo();
RenderDiabloLogoSm();
DrawArtImage(30, 211, gdwHeroWidth, gdwHeroHeight, 0, pPcxHeroImage);
@ -1369,5 +1395,5 @@ void LoadCreateHeroDialogMenu()
void CreateHeroMenu()
{
DrawArtImage(0, 0, gdwTitleWidth, gdwTitleHeight, 0, pPcxTitleImage);
RenderDiabloLogo();
RenderDiabloLogoSm();
}

9
Stub/sdlrender.h

@ -10,6 +10,7 @@ extern void *pPcxFont16gImage;
extern int gdwFont24Width;
extern int gdwFont24Height;
extern void *pPcxFont24sImage;
extern void *pPcxFont24gImage;
extern unsigned char *pFont24;
@ -26,9 +27,14 @@ extern void *pPcxFont42gImage;
extern void *pTitlqtxtCel;
extern void *pDiabfrCel;
extern void *pPcxLogoImage;
extern int gdwLogoWidth;
extern int gdwLogoHeight;
extern void *pPcxLogoImage;
extern void *pPcxLogoSmImage;
extern int gdwLogoSmWidth;
extern int gdwLogoSmHeight;
extern int gdwTitleWidth;
extern int gdwTitleHeight;
extern void *pPcxTitleImage;
@ -90,6 +96,7 @@ extern SDL_Rect CreateHeroBox;
void CreateMenuDialogBox();
void CreateDiabloMainMenuz();
void SdlDiabloMainWindow();
void SDL_RenderDiabloSplashPage();
void SDL_RenderDiabloMainPage();
char *GetWorkingDirectory();
void CreateMainDiabloMenu();

15
enums.h

@ -2158,6 +2158,21 @@ enum _mainmenu_selections
MAINMENU_ATTRACT_MODE = 6,
};
enum menus
{
SPLASH,
MAINMENU,
SINGLEPLAYER_LOAD,
SINGLEPLAYER_CLASSES,
SINGLEPLAYER_NAME,
MULTIPLAYER_CONNECTIONS,
MULTIPLAYER_LOBBY,
MULTIPLAYER_DIFFICULTY,
MULTIPLAYER_BNET_GATEWAYS,
MULTIPLAYER_ERROR,
CREDIT,
};
enum TXT_JUST {
JustLeft = 0,
JustCentre = 1,

Loading…
Cancel
Save