/
aquaria-1.1.3~git06072020.patchset
180 lines (163 loc) · 5.2 KB
/
aquaria-1.1.3~git06072020.patchset
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
From 8d0e4b67374a50088de986234361f3f76a45b357 Mon Sep 17 00:00:00 2001
From: Gerasim Troeglazov <3dEyes@gmail.com>
Date: Wed, 17 Feb 2021 19:01:47 +1000
Subject: Fix for Haiku
diff --git a/Aquaria/DSQ.cpp b/Aquaria/DSQ.cpp
index dc18033..4fb29c8 100644
--- a/Aquaria/DSQ.cpp
+++ b/Aquaria/DSQ.cpp
@@ -49,6 +49,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "ttvfs.h"
#endif
+#ifdef __HAIKU__
+#include <interface/Rect.h>
+#include <interface/Screen.h>
+#endif
+
#ifdef BBGE_BUILD_UNIX
#include <sys/types.h>
#include <sys/stat.h>
@@ -966,7 +971,11 @@ This build is not yet final, and as such there are a couple things lacking. They
// PHYSFS_addToSearchPath("gfx.zpk",0 );
bool mipmapsEnabled=true;
+#ifdef __HAIKU__
+ bool fullscreen = false;
+#else
bool fullscreen = true;
+#endif
int joystickMode = 0;
int dsq_filter = 0;
voiceOversEnabled = true;
@@ -1014,6 +1023,20 @@ This build is not yet final, and as such there are a couple things lacking. They
else
debugLog("VoiceOvers Disabled");
+#ifdef __HAIKU__
+ SDL_Init(SDL_INIT_VIDEO);
+
+ BScreen *scr = new BScreen(B_MAIN_SCREEN_ID);
+ if (fullscreen) {
+ user.video.resx = scr->Frame().Width() + 1;
+ user.video.resy = scr->Frame().Height() + 1;
+ } else {
+ if (user.video.resx >= scr->Frame().Width() + 1 && user.video.resy >= scr->Frame().Height() + 1) {
+ user.video.resx = 800;
+ user.video.resy = 600;
+ }
+ }
+#endif
#ifdef _DEBUG
if (!createWindow(800, 600, user.video.bits, false, "Aquaria"))
@@ -1035,7 +1058,7 @@ This build is not yet final, and as such there are a couple things lacking. They
debugLog("OK");
*/
-#ifdef BBGE_BUILD_SDL
+#if defined(BBGE_BUILD_SDL) && !defined(__HAIKU__)
SDL_Init(SDL_INIT_VIDEO);
if (fullscreen && !sdlVideoModeOK(user.video.resx, user.video.resy, user.video.bits))
{
diff --git a/Aquaria/Game.cpp b/Aquaria/Game.cpp
index b6847f4..4df3fa1 100644
--- a/Aquaria/Game.cpp
+++ b/Aquaria/Game.cpp
@@ -40,6 +40,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "ToolTip.h"
+#ifdef __HAIKU__
+#include <interface/Rect.h>
+#include <interface/Screen.h>
+#endif
+
std::vector<std::string> allowedMaps;
Vector worldLeftCenter(217,250), worldRightCenter(575, 250);
@@ -8752,6 +8757,18 @@ void Game::onOptionsSave()
|| dsq->user.video.full != dsq->user_backup.video.full
|| dsq->user.video.vsync != dsq->user_backup.video.vsync)
{
+#ifdef __HAIKU__
+ if (dsq->user.video.full != dsq->user_backup.video.full) {
+ if (dsq->user.video.full) {
+ BScreen scr(B_MAIN_SCREEN_ID);
+ dsq->user.video.resx = scr.Frame().Width() + 1;
+ dsq->user.video.resy = scr.Frame().Height() + 1;
+ } else {
+ dsq->user.video.resx = 800;
+ dsq->user.video.resy = 600;
+ }
+ }
+#endif
dsq->resetGraphics(dsq->user.video.resx, dsq->user.video.resy, dsq->user.video.full);
if (dsq->confirm("", "graphics", false, 10)) {
} else {
diff --git a/BBGE/Core.cpp b/BBGE/Core.cpp
index 2e3be81..450af28 100644
--- a/BBGE/Core.cpp
+++ b/BBGE/Core.cpp
@@ -39,6 +39,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <Carbon/Carbon.h>
#endif
+#ifdef __HAIKU__
+#include <interface/Rect.h>
+#include <interface/Screen.h>
+#endif
+
#if BBGE_BUILD_WINDOWS
#include <shlobj.h>
#include <direct.h>
@@ -912,6 +917,8 @@ Core::Core(const std::string &filesystem, const std::string& extraDataDir, int n
// "/home/icculus/.Aquaria" or something. Spaces are okay.
#ifdef BBGE_BUILD_MACOSX
const std::string prefix("Library/Application Support/");
+ #elif defined(__HAIKU__)
+ const std::string prefix("config/settings/");
#else
const std::string prefix(".");
#endif
@@ -1975,7 +1982,7 @@ bool Core::initGraphicsLibrary(int width, int height, bool fullscreen, int vsync
Uint32 flags = 0;
flags = SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN;
if (fullscreen)
- flags |= SDL_WINDOW_FULLSCREEN;
+ flags |= SDL_WINDOW_FULLSCREEN_DESKTOP;
gScreen = SDL_CreateWindow(appName.c_str(), SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, width, height, flags);
if (gScreen == NULL)
{
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 941fc25..5a7ae55 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -740,6 +740,10 @@ IF(WIN32)
SET(OPTIONAL_LIBS ${OPTIONAL_LIBS} "ws2_32")
ENDIF(WIN32)
+IF(HAIKU)
+ SET(OPTIONAL_LIBS ${OPTIONAL_LIBS} "be")
+ENDIF(HAIKU)
+
IF(MACOSX)
SET(OPTIONAL_LIBS ${OPTIONAL_LIBS} "-framework Carbon")
SET(OPTIONAL_LIBS ${OPTIONAL_LIBS} "-framework Cocoa")
--
2.30.0
From f4c8f378437f172a04be100278995e71fd5bcb32 Mon Sep 17 00:00:00 2001
From: Gerasim Troeglazov <3dEyes@gmail.com>
Date: Wed, 17 Feb 2021 22:19:35 +1000
Subject: Use SupportDefs.h
diff --git a/BBGE/Flags.h b/BBGE/Flags.h
index 5eb304b..e8ff9ad 100644
--- a/BBGE/Flags.h
+++ b/BBGE/Flags.h
@@ -24,10 +24,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#ifdef BBGE_BUILD_WINDOWS
typedef unsigned __int32 uint32;
#endif
-#ifdef BBGE_BUILD_UNIX
+#if defined(BBGE_BUILD_UNIX) && !defined(__HAIKU__)
#include <stdint.h>
typedef uint32_t uint32;
#endif
+#ifdef __HAIKU__
+ #include <SupportDefs.h>
+#endif
#ifdef BBGE_BUILD_X360
typedef unsigned int uint32;
#endif
--
2.30.0