Skip to content

Commit

Permalink
[xbox] Initialize the video system and specify search path
Browse files Browse the repository at this point in the history
  • Loading branch information
AJenbo committed Jul 4, 2022
1 parent 10273c5 commit 55e6bb6
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Source/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ std::vector<std::string> GetMPQSearchPaths()
paths.emplace_back("/usr/local/share/diasurgical/devilutionx/");
#elif defined(__3DS__) || defined(__SWITCH__)
paths.emplace_back("romfs:/");
#elif defined(NXDK)
paths.emplace_back("D:\\");
#elif (defined(_WIN64) || defined(_WIN32)) && !defined(__UWP__) && !defined(NXDK)
char gogpath[_FSG_PATH_MAX];
fsg_get_gog_game_path(gogpath, "1412601690");
Expand Down
16 changes: 16 additions & 0 deletions Source/utils/display.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
#include "platform/ctr/display.hpp"
#endif

#ifdef NXDK
#include <hal/video.h>
#endif

#include "DiabloUI/diabloui.h"
#include "control.h"
#include "controls/controller.h"
Expand Down Expand Up @@ -235,6 +239,18 @@ bool SpawnWindow(const char *lpWindowName)
#ifdef __vita__
scePowerSetArmClockFrequency(444);
#endif
#ifdef NXDK
{
Size windowSize = *sgOptions.Graphics.resolution;
VIDEO_MODE xmode;
void *p = nullptr;
while (XVideoListModes(&xmode, 0, 0, &p)) {
if (windowSize.width >= xmode.width && windowSize.height == xmode.height)
break;
}
XVideoSetMode(xmode.width, xmode.height, xmode.bpp, xmode.refresh);
}
#endif

#if SDL_VERSION_ATLEAST(2, 0, 6) && defined(__vita__)
SDL_SetHint(SDL_HINT_TOUCH_MOUSE_EVENTS, "0");
Expand Down

0 comments on commit 55e6bb6

Please sign in to comment.