Browse Source

Match the credit menu look

This also adds transitions to menus
pull/25/head
Anders Jenbo 7 years ago
parent
commit
5fed0b1316
  1. 3
      CMakeLists.txt
  2. 4
      README.md
  3. 21
      Stub/diabloui.cpp
  4. 3
      Stub/miniwin_sdl.h
  5. 1011
      Stub/sdlrender.cpp
  6. 8
      Stub/sdlrender.h

3
CMakeLists.txt

@ -43,6 +43,7 @@ string(APPEND CMAKE_CXX_FLAGS_DEBUG " -Og -fno-omit-frame-pointer")
string(APPEND CMAKE_CXX_FLAGS_DEBUG " -fsanitize=address -fsanitize-recover=address")
find_package(SDL2 REQUIRED)
find_package(SDL2_ttf REQUIRED)
find_package(SDL2_mixer REQUIRED)
set(SOURCES
@ -157,6 +158,7 @@ set(STUB_SOURCES
)
include_directories(${SDL2_INCLUDE_DIR}
${SDL2_TTF_INCLUDE_DIR}
${SDL2_MIXER_INCLUDE_DIR})
include_directories(. Stub)
@ -192,6 +194,7 @@ add_executable(devilution
target_link_libraries(devilution PUBLIC
m
${SDL2_LIBRARY}
${SDL2_TTF_LIBRARIES}
${SDL2_MIXER_LIBRARIES}
)

4
README.md

@ -57,7 +57,7 @@ Note: The 64bit builds are currently not in a playable state, as such you might
Install the dependencies on your machine:
```
sudo apt-get install cmake libsdl2-dev libsdl2-mixer-dev
sudo apt-get install cmake libsdl2-dev libsdl2-mixer-dev libsdl2-ttf-dev
```
Now run the following commands:
@ -78,7 +78,7 @@ Please keep in mind that this is still being worked on and is missing parts of U
### Building deviltuionX 32bit on 64bit platforms
```
sudo apt-get install cmake g++-multilib libsdl2-dev:i386 libsdl2-mixer-dev:i386
sudo apt-get install cmake g++-multilib libsdl2-dev:i386 libsdl2-mixer-dev:i386 libsdl2-ttf-dev:i386
```
Now run the following commands:

21
Stub/diabloui.cpp

@ -16,6 +16,7 @@ void __cdecl UiDestroy()
BOOL __stdcall UiTitleDialog(int a1)
{
fadeValue = 0;
TitleImageLoaded = false;
SDL_Event event;
while (1) {
@ -170,6 +171,7 @@ void UiInitialize()
BOOL __stdcall UiMainMenuDialog(char *name, int *pdwResult, void(__stdcall *fnSound)(char *file), int a4)
{
fadeValue = 0;
TitleImageLoaded = false;
SelectedItem = 1;
SelectedItemMax = 5;
@ -291,6 +293,7 @@ BOOL __stdcall UiSelHeroSingDialog(
char *name,
int *difficulty)
{
fadeValue = 0;
TitleImageLoaded = false;
submenu = SINGLEPLAYER_LOAD;
@ -618,6 +621,7 @@ BOOL __stdcall UiSelHeroMultDialog(
char *name)
{
DUMMY();
fadeValue = 0;
TitleImageLoaded = false;
submenu = MULTIPLAYER_LOBBY;
@ -836,11 +840,19 @@ BOOL __stdcall UiSelHeroMultDialog(
BOOL __stdcall UiCreditsDialog(int a1)
{
if (!TTF_WasInit() && TTF_Init() == -1) {
printf("TTF_Init: %s\n", TTF_GetError());
exit(1);
}
nottheend = TRUE;
lineCount = 13;
creditline = -lineCount;
lastYbase = 0;
fadeValue = 0;
TitleImageLoaded = false;
SDL_Event event;
while (1) {
ShowCredts();
while (ShowCredts()) {
if (SDL_PollEvent(&event)) {
switch (event.type) {
case SDL_KEYDOWN:
@ -853,7 +865,7 @@ BOOL __stdcall UiCreditsDialog(int a1)
}
}
return FALSE;
return TRUE;
}
void __cdecl UiProfileCallback()
@ -921,6 +933,7 @@ int __stdcall UiSelectProvider(int a1, _SNETPROGRAMDATA *client_info, _SNETPLAYE
{
int gameType = 0;
fadeValue = 0;
TitleImageLoaded = false;
SelectedItem = 1;
SelectedItemMax = 3;

3
Stub/miniwin_sdl.h

@ -11,10 +11,9 @@
#include <utility>
#include <SDL2/SDL.h>
//#include <SDL_image.h>
#include <SDL_ttf.h>
#include <SDL_mixer.h>
#include <SDL_thread.h>
//#include "SDL_FontCache.h"
typedef SDL_mutex *CRITICAL_SECTION, **LPCRITICAL_SECTION;
VOID WINAPI InitializeCriticalSection(LPCRITICAL_SECTION lpCriticalSection);

1011
Stub/sdlrender.cpp

File diff suppressed because it is too large Load Diff

8
Stub/sdlrender.h

@ -54,6 +54,12 @@ extern void *pPcxCreditsImage;
extern int gdwCreditsWidth;
extern int gdwCreditsHeight;
extern int fadeValue;
extern int lineCount;
extern int creditline;
extern BOOL nottheend;
extern int lastYbase;
extern bool TitleImageLoaded;
extern int SelectedItem;
@ -98,7 +104,7 @@ void RenderDiabloMainPage(char *name);
char *GetWorkingDirectory();
void CreateMainDiabloMenu();
void RenderDiabloSinglePlayerPage();
void ShowCredts();
BOOL ShowCredts();
void RenderCharNames();
void FreeMenuItems();
BOOL __cdecl LoadArtImage(char *pszFile, void **pBuffer, int frames, DWORD *data);

Loading…
Cancel
Save