Browse Source

🚚 Move header we implement into the project

pull/1549/head
Anders Jenbo 5 years ago
parent
commit
6e1a106a38
  1. 2
      CMakeLists.txt
  2. 72
      DiabloUI/diabloui.h
  3. 2
      Source/appfat.cpp
  4. 2
      Source/appfat.h
  5. 2
      Source/capture.cpp
  6. 4
      Source/diablo.cpp
  7. 2
      Source/dthread.cpp
  8. 2
      Source/dx.cpp
  9. 2
      Source/engine.cpp
  10. 4
      Source/init.cpp
  11. 2
      Source/itemdat.h
  12. 4
      Source/mainmenu.cpp
  13. 2
      Source/monster.cpp
  14. 2
      Source/movie.cpp
  15. 4
      Source/msg.cpp
  16. 1
      Source/msg.h
  17. 4
      Source/multi.cpp
  18. 2
      Source/nthread.cpp
  19. 1
      Source/objects.h
  20. 2
      Source/options.h
  21. 2
      Source/palette.cpp
  22. 2
      Source/pfile.cpp
  23. 2
      Source/pfile.h
  24. 2
      Source/player.cpp
  25. 3
      Source/scrollrt.h
  26. 2
      Source/sound.cpp
  27. 2
      Source/textdat.h
  28. 3
      SourceX/DiabloUI/art.cpp
  29. 3
      SourceX/DiabloUI/art.h
  30. 2
      SourceX/DiabloUI/diabloui.cpp
  31. 64
      SourceX/DiabloUI/diabloui.h
  32. 2
      SourceX/DiabloUI/selconn.cpp
  33. 2
      SourceX/DiabloUI/selgame.cpp
  34. 1
      SourceX/DiabloUI/selhero.cpp
  35. 1
      SourceX/DiabloUI/ui_item.h
  36. 2
      SourceX/controls/game_controls.h
  37. 1
      SourceX/controls/touch.cpp
  38. 7
      SourceX/display.h
  39. 2
      SourceX/dvlnet/abstract_net.cpp
  40. 2
      SourceX/dvlnet/abstract_net.h
  41. 2
      SourceX/storm/storm.cpp
  42. 4
      SourceX/storm/storm.h
  43. 2
      SourceX/storm_sdl_rw.cpp

2
CMakeLists.txt

@ -447,7 +447,7 @@ if(GPERF)
find_package(Gperftools REQUIRED)
endif()
target_include_directories(devilution PUBLIC Source SourceS ${CMAKE_CURRENT_BINARY_DIR})
target_include_directories(devilution PUBLIC Source SourceS SourceX ${CMAKE_CURRENT_BINARY_DIR})
target_include_directories(${BIN_TARGET} PRIVATE
SourceS
SourceX

72
DiabloUI/diabloui.h

@ -1,72 +0,0 @@
//HEADER_GOES_HERE
#pragma once
#include <stdint.h>
namespace devilution {
enum _mainmenu_selections : uint8_t {
MAINMENU_NONE,
MAINMENU_SINGLE_PLAYER,
MAINMENU_MULTIPLAYER,
MAINMENU_REPLAY_INTRO,
MAINMENU_SHOW_SUPPORT,
MAINMENU_SHOW_CREDITS,
MAINMENU_EXIT_DIABLO,
MAINMENU_ATTRACT_MODE,
};
enum _selhero_selections : uint8_t {
SELHERO_NEW_DUNGEON,
SELHERO_CONTINUE,
SELHERO_CONNECT,
SELHERO_PREVIOUS,
};
struct _uidefaultstats {
Uint16 strength;
Uint16 magic;
Uint16 dexterity;
Uint16 vitality;
};
struct _uiheroinfo {
struct _uiheroinfo *next;
char name[16];
Uint16 level;
HeroClass heroclass;
Uint8 herorank;
Uint16 strength;
Uint16 magic;
Uint16 dexterity;
Uint16 vitality;
Sint32 gold;
Sint32 hassaved;
bool spawned;
};
void UiDestroy();
void UiTitleDialog();
void UiSetSpawned(bool bSpawned);
void UiInitialize();
bool UiValidPlayerName(const char *name); /* check */
void UiSelHeroMultDialog(bool (*fninfo)(bool (*fninfofunc)(_uiheroinfo *)), bool (*fncreate)(_uiheroinfo *), bool (*fnremove)(_uiheroinfo *), void (*fnstats)(unsigned int, _uidefaultstats *), _selhero_selections *dlgresult, char (*name)[16]);
void UiSelHeroSingDialog(bool (*fninfo)(bool (*fninfofunc)(_uiheroinfo *)), bool (*fncreate)(_uiheroinfo *), bool (*fnremove)(_uiheroinfo *), void (*fnstats)(unsigned int, _uidefaultstats *), _selhero_selections *dlgresult, char (*name)[16], _difficulty *difficulty);
bool UiCreditsDialog();
bool UiSupportDialog();
bool UiMainMenuDialog(const char *name, _mainmenu_selections *pdwResult, void (*fnSound)(const char *file), int attractTimeOut);
bool UiProgressDialog(const char *msg, int (*fnfunc)(), int rate);
void UiProfileCallback();
void UiProfileDraw();
bool UiCategoryCallback(int a1, int a2, int a3, int a4, int a5, DWORD *a6, DWORD *a7);
bool UiGetDataCallback(int game_type, int data_code, void *a3, int a4, int a5);
bool UiAuthCallback(int a1, char *a2, char *a3, char a4, char *a5, char *lpBuffer, int cchBufferMax);
bool UiSoundCallback(int a1, int type, int a3);
bool UiDrawDescCallback(int game_type, DWORD color, const char *lpString, char *a4, int a5, UINT align, time_t a7, HDC *a8);
bool UiCreateGameCallback(int a1, int a2, int a3, int a4, int a5, int a6);
bool UiArtCallback(int game_type, unsigned int art_code, SDL_Color *pPalette, BYTE *pBuffer, DWORD dwBuffersize, DWORD *pdwWidth, DWORD *pdwHeight, DWORD *pdwBpp);
int UiSelectGame(GameData *gameData, int *playerId);
int UiSelectProvider(GameData *gameData);
void UiSetupPlayerInfo(char *infostr, _uiheroinfo *pInfo, Uint32 type);
} // namespace devilution

2
Source/appfat.cpp

@ -4,7 +4,7 @@
* Implementation of error dialogs.
*/
#include "all.h"
#include "../3rdParty/Storm/Source/storm.h"
#include "storm/storm.h"
#include <config.h>
namespace devilution {

2
Source/appfat.h

@ -7,6 +7,8 @@
#include <SDL.h>
#include "miniwin.h"
namespace devilution {
#define ErrSdl() ErrDlg("SDL Error", SDL_GetError(), __FILE__, __LINE__)

2
Source/capture.cpp

@ -6,7 +6,7 @@
#include <fstream>
#include "all.h"
#include "../3rdParty/Storm/Source/storm.h"
#include "storm/storm.h"
#include "paths.h"
#include "file_util.h"

4
Source/diablo.cpp

@ -9,8 +9,8 @@
#include "options.h"
#include "multi.h"
#include "sound.h"
#include "../3rdParty/Storm/Source/storm.h"
#include "../DiabloUI/diabloui.h"
#include "storm/storm.h"
#include "DiabloUI/diabloui.h"
#include <config.h>
namespace devilution {

2
Source/dthread.cpp

@ -4,7 +4,7 @@
* Implementation of functions for updating game state from network commands.
*/
#include "all.h"
#include "../3rdParty/Storm/Source/storm.h"
#include "storm/storm.h"
namespace devilution {

2
Source/dx.cpp

@ -4,7 +4,7 @@
* Implementation of functions setting up the graphics pipeline.
*/
#include "all.h"
#include "../3rdParty/Storm/Source/storm.h"
#include "storm/storm.h"
#include "../SourceX/display.h"
#include "options.h"
#include <SDL.h>

2
Source/engine.cpp

@ -12,7 +12,7 @@
*/
#include "all.h"
#include "options.h"
#include "../3rdParty/Storm/Source/storm.h"
#include "storm/storm.h"
namespace devilution {

4
Source/init.cpp

@ -8,8 +8,8 @@
#include "all.h"
#include "paths.h"
#include "../3rdParty/Storm/Source/storm.h"
#include "../DiabloUI/diabloui.h"
#include "storm/storm.h"
#include "DiabloUI/diabloui.h"
#include <SDL.h>
#include <config.h>

2
Source/itemdat.h

@ -8,6 +8,8 @@
#include <stdint.h>
#include <stdbool.h>
#include "spelldat.h"
namespace devilution {
/** @todo add missing values and apply */

4
Source/mainmenu.cpp

@ -5,8 +5,8 @@
*/
#include "all.h"
#include "options.h"
#include "../3rdParty/Storm/Source/storm.h"
#include "../DiabloUI/diabloui.h"
#include "storm/storm.h"
#include "DiabloUI/diabloui.h"
namespace devilution {

2
Source/monster.cpp

@ -7,7 +7,7 @@
#include "all.h"
#include "options.h"
#include "../3rdParty/Storm/Source/storm.h"
#include "storm/storm.h"
namespace devilution {

2
Source/movie.cpp

@ -4,7 +4,7 @@
* Implementation of video playback.
*/
#include "all.h"
#include "../3rdParty/Storm/Source/storm.h"
#include "storm/storm.h"
#include "../SourceX/display.h"
namespace devilution {

4
Source/msg.cpp

@ -4,8 +4,8 @@
* Implementation of function for sending and reciving network messages.
*/
#include "all.h"
#include "../3rdParty/Storm/Source/storm.h"
#include "../DiabloUI/diabloui.h"
#include "storm/storm.h"
#include "DiabloUI/diabloui.h"
#include "objects.h"
#include "options.h"

1
Source/msg.h

@ -11,6 +11,7 @@
#include "objects.h"
#include "monster.h"
#include "portal.h"
#include "items.h"
namespace devilution {

4
Source/multi.cpp

@ -6,8 +6,8 @@
#include "all.h"
#include "diablo.h"
#include "options.h"
#include "../3rdParty/Storm/Source/storm.h"
#include "../DiabloUI/diabloui.h"
#include "storm/storm.h"
#include "DiabloUI/diabloui.h"
#include <config.h>
namespace devilution {

2
Source/nthread.cpp

@ -4,7 +4,7 @@
* Implementation of functions for managing game ticks.
*/
#include "all.h"
#include "../3rdParty/Storm/Source/storm.h"
#include "storm/storm.h"
namespace devilution {

1
Source/objects.h

@ -7,6 +7,7 @@
#include "objdat.h"
#include "textdat.h"
#include "itemdat.h"
namespace devilution {

2
Source/options.h

@ -1,5 +1,7 @@
#pragma once
#include "pack.h"
namespace devilution {
struct DiabloOptions {

2
Source/palette.cpp

@ -6,7 +6,7 @@
#include "all.h"
#include "options.h"
#include "../SourceX/display.h"
#include "../3rdParty/Storm/Source/storm.h"
#include "storm/storm.h"
namespace devilution {

2
Source/pfile.cpp

@ -7,7 +7,7 @@
#include "all.h"
#include "paths.h"
#include "../3rdParty/Storm/Source/storm.h"
#include "storm/storm.h"
#include "file_util.h"
namespace devilution {

2
Source/pfile.h

@ -6,7 +6,7 @@
#pragma once
#include "player.h"
#include "../DiabloUI/diabloui.h"
#include "DiabloUI/diabloui.h"
namespace devilution {

2
Source/player.cpp

@ -7,7 +7,7 @@
#include "all.h"
#include "options.h"
#include "../3rdParty/Storm/Source/storm.h"
#include "storm/storm.h"
namespace devilution {

3
Source/scrollrt.h

@ -7,6 +7,9 @@
#include <stdint.h>
#include "engine.h"
#include "miniwin.h"
namespace devilution {
#define PANELS_COVER (gnScreenWidth <= PANEL_WIDTH && gnScreenHeight <= SPANEL_HEIGHT + PANEL_HEIGHT)

2
Source/sound.cpp

@ -5,7 +5,7 @@
*/
#include "all.h"
#include "options.h"
#include "../3rdParty/Storm/Source/storm.h"
#include "storm/storm.h"
#include "../SourceX/stubs.h"
#include "../SourceX/storm_sdl_rw.h"
#include <SDL.h>

2
Source/textdat.h

@ -5,6 +5,8 @@
*/
#pragma once
#include "effects.h"
namespace devilution {
enum _speech_id : int16_t {

3
SourceX/DiabloUI/art.cpp

@ -1,6 +1,7 @@
#include "DiabloUI/art.h"
#include "display.h"
#include "../3rdParty/Storm/Source/storm.h"
#include "storm/storm.h"
#include "sdl_compat.h"
namespace devilution {

3
SourceX/DiabloUI/art.h

@ -1,8 +1,7 @@
#pragma once
#include "all.h"
#include "../sdl_ptrs.h"
#include "../3rdParty/Storm/Source/storm.h"
#include "storm/storm.h"
namespace devilution {

2
SourceX/DiabloUI/diabloui.cpp

@ -3,7 +3,7 @@
#include <algorithm>
#include <string>
#include "../3rdParty/Storm/Source/storm.h"
#include "storm/storm.h"
#include "controls/controller.h"
#include "controls/menu_controls.h"

64
SourceX/DiabloUI/diabloui.h

@ -8,6 +8,7 @@
#include "DiabloUI/art.h"
#include "DiabloUI/ui_item.h"
#include "display.h"
#include "player.h"
namespace devilution {
@ -26,6 +27,46 @@ enum _artLogo : uint8_t {
LOGO_BIG,
};
enum _mainmenu_selections : uint8_t {
MAINMENU_NONE,
MAINMENU_SINGLE_PLAYER,
MAINMENU_MULTIPLAYER,
MAINMENU_REPLAY_INTRO,
MAINMENU_SHOW_SUPPORT,
MAINMENU_SHOW_CREDITS,
MAINMENU_EXIT_DIABLO,
MAINMENU_ATTRACT_MODE,
};
enum _selhero_selections : uint8_t {
SELHERO_NEW_DUNGEON,
SELHERO_CONTINUE,
SELHERO_CONNECT,
SELHERO_PREVIOUS,
};
struct _uidefaultstats {
Uint16 strength;
Uint16 magic;
Uint16 dexterity;
Uint16 vitality;
};
struct _uiheroinfo {
struct _uiheroinfo *next;
char name[16];
Uint16 level;
HeroClass heroclass;
Uint8 herorank;
Uint16 strength;
Uint16 magic;
Uint16 dexterity;
Uint16 vitality;
Sint32 gold;
Sint32 hassaved;
bool spawned;
};
extern std::array<Art, 3> ArtLogos;
extern std::array<Art, 3> ArtFocus;
extern Art ArtBackground;
@ -42,6 +83,29 @@ inline SDL_Surface *DiabloUiSurface()
return GetOutputSurface();
}
void UiDestroy();
void UiTitleDialog();
void UiSetSpawned(bool bSpawned);
void UiInitialize();
bool UiValidPlayerName(const char *name); /* check */
void UiSelHeroMultDialog(bool (*fninfo)(bool (*fninfofunc)(_uiheroinfo *)), bool (*fncreate)(_uiheroinfo *), bool (*fnremove)(_uiheroinfo *), void (*fnstats)(unsigned int, _uidefaultstats *), _selhero_selections *dlgresult, char (*name)[16]);
void UiSelHeroSingDialog(bool (*fninfo)(bool (*fninfofunc)(_uiheroinfo *)), bool (*fncreate)(_uiheroinfo *), bool (*fnremove)(_uiheroinfo *), void (*fnstats)(unsigned int, _uidefaultstats *), _selhero_selections *dlgresult, char (*name)[16], _difficulty *difficulty);
bool UiCreditsDialog();
bool UiSupportDialog();
bool UiMainMenuDialog(const char *name, _mainmenu_selections *pdwResult, void (*fnSound)(const char *file), int attractTimeOut);
bool UiProgressDialog(const char *msg, int (*fnfunc)(), int rate);
void UiProfileCallback();
void UiProfileDraw();
bool UiCategoryCallback(int a1, int a2, int a3, int a4, int a5, DWORD *a6, DWORD *a7);
bool UiGetDataCallback(int game_type, int data_code, void *a3, int a4, int a5);
bool UiAuthCallback(int a1, char *a2, char *a3, char a4, char *a5, char *lpBuffer, int cchBufferMax);
bool UiSoundCallback(int a1, int type, int a3);
bool UiDrawDescCallback(int game_type, DWORD color, const char *lpString, char *a4, int a5, UINT align, time_t a7, HDC *a8);
bool UiCreateGameCallback(int a1, int a2, int a3, int a4, int a5, int a6);
bool UiArtCallback(int game_type, unsigned int art_code, SDL_Color *pPalette, BYTE *pBuffer, DWORD dwBuffersize, DWORD *pdwWidth, DWORD *pdwHeight, DWORD *pdwBpp);
int UiSelectGame(GameData *gameData, int *playerId);
int UiSelectProvider(GameData *gameData);
void UiSetupPlayerInfo(char *infostr, _uiheroinfo *pInfo, Uint32 type);
void UiFadeIn();
void UiHandleEvents(SDL_Event *event);
bool UiItemMouseEvents(SDL_Event *event, std::vector<UiItemBase *> items);

2
SourceX/DiabloUI/selconn.cpp

@ -3,7 +3,7 @@
#include "all.h"
#include "DiabloUI/diabloui.h"
#include "DiabloUI/text.h"
#include "../3rdParty/Storm/Source/storm.h"
#include "storm/storm.h"
namespace devilution {

2
SourceX/DiabloUI/selgame.cpp

@ -1,7 +1,7 @@
#include "selgame.h"
#include "all.h"
#include "../3rdParty/Storm/Source/storm.h"
#include "storm/storm.h"
#include "config.h"
#include "DiabloUI/diabloui.h"
#include "DiabloUI/text.h"

1
SourceX/DiabloUI/selhero.cpp

@ -5,7 +5,6 @@
#include <random>
#include "DiabloUI/diabloui.h"
#include "../../DiabloUI/diabloui.h"
#include "all.h"
#include "DiabloUI/dialogs.h"
#include "DiabloUI/scrollbar.h"

1
SourceX/DiabloUI/ui_item.h

@ -5,7 +5,6 @@
#include <string>
#include <vector>
#include "all.h"
#include "stubs.h"
#include "DiabloUI/art.h"

2
SourceX/controls/game_controls.h

@ -4,8 +4,8 @@
#include <cstdint>
#include <SDL.h>
#include "controls/controller.h"
#include "./axis_direction.h"
#include "./controller.h"
namespace devilution {

1
SourceX/controls/touch.cpp

@ -2,6 +2,7 @@
#include "display.h"
#include "options.h"
#include "touch.h"
#include "ui_fwd.h"
#include <math.h>
static int visible_width;

7
SourceX/display.h

@ -2,10 +2,15 @@
#include <cstdint>
#include "all.h"
#include "sdl_ptrs.h"
#include <SDL.h>
#ifdef USE_SDL1
#include "sdl2_to_1_2_backports.h"
#else
#include "sdl2_backports.h"
#endif
#include <type_traits>
namespace devilution {

2
SourceX/dvlnet/abstract_net.cpp

@ -8,7 +8,7 @@
#include "dvlnet/protocol_zt.h"
#endif
#include "dvlnet/loopback.h"
#include "../3rdParty/Storm/Source/storm.h"
#include "storm/storm.h"
namespace devilution {
namespace net {

2
SourceX/dvlnet/abstract_net.h

@ -6,7 +6,7 @@
#include <exception>
#include "all.h"
#include "../3rdParty/Storm/Source/storm.h"
#include "storm/storm.h"
namespace devilution {
namespace net {

2
SourceX/storm/storm.cpp

@ -5,7 +5,7 @@
#include "all.h"
#include "options.h"
#include "paths.h"
#include "../3rdParty/Storm/Source/storm.h"
#include "storm/storm.h"
#if !SDL_VERSION_ATLEAST(2, 0, 4)
#include <queue>

4
3rdParty/Storm/Source/storm.h → SourceX/storm/storm.h

@ -3,6 +3,10 @@
#include <cstdint>
#include <limits>
#include <string>
#include "appfat.h"
#include "multi.h"
namespace devilution {
enum game_info : uint8_t {

2
SourceX/storm_sdl_rw.cpp

@ -4,7 +4,7 @@
#include <cstring>
#include "all.h"
#include "../3rdParty/Storm/Source/storm.h"
#include "storm/storm.h"
#include "../Source/engine.h"
namespace devilution {

Loading…
Cancel
Save