Skip to content

Commit 2afb9f6

Browse files
committed
Remove NFDE in favor of SDL_NFD.
1 parent 633d154 commit 2afb9f6

File tree

17 files changed

+231
-165
lines changed

17 files changed

+231
-165
lines changed

.github/workflows/accuracy.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ jobs:
4646
meson \
4747
ninja-build \
4848
libglew-dev \
49-
libgtk-3-dev \
5049
libreadline-dev \
5150
libedit-dev \
5251
libcapstone-dev \

.github/workflows/build.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,6 @@ jobs:
193193
ninja-build \
194194
libfuse2 \
195195
libglew-dev \
196-
libgtk-3-dev \
197196
libarchive-dev \
198197
libudev-dev \
199198
libpipewire-0.3-dev
@@ -273,7 +272,6 @@ jobs:
273272
meson \
274273
ninja-build \
275274
libglew-dev \
276-
libgtk-3-dev \
277275
libarchive-dev \
278276
libudev-dev \
279277
libpipewire-0.3-dev
@@ -321,7 +319,7 @@ jobs:
321319
maintainer: The Hades Authors
322320
version: 1.0.0
323321
arch: 'amd64'
324-
depends: 'libarchive13, libgtk-3-0, libglew2.2'
322+
depends: 'libarchive13, libglew2.2, libdecor-0-0'
325323
desc: 'A Nintendo Game Boy Advance Emulator.'
326324
- name: Test Hades
327325
run: |

.gitmodules

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44
[submodule "external/stb"]
55
path = external/stb
66
url = https://github.com/nothings/stb.git
7-
[submodule "external/nfde"]
8-
path = external/nfde
9-
url = https://github.com/btzy/nativefiledialog-extended.git
107
[submodule "external/mjson"]
118
path = external/mjson
129
url = https://github.com/cesanta/mjson.git

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,19 +51,18 @@ To build Hades, you first need to install those dependencies:
5151
- `SDL3`
5252
- `OpenGL`
5353
- `glew`
54-
- `gtk3`
5554
- `libarchive`
5655

5756
On the latest Ubuntu, you can install all those dependencies with:
5857

5958
```bash
60-
$ apt install meson ninja-build gcc libsdl3-dev libglew-dev libgtk-3-dev libarchive-dev
59+
$ apt install meson ninja-build gcc libsdl3-dev libglew-dev libarchive-dev
6160
```
6261

6362
On Fedora, you can install all those dependencies with:
6463

6564
```bash
66-
$ dnf install meson ninja-build gcc SDL3-devel glew-devel gtk3-devel libarchive-devel
65+
$ dnf install meson ninja-build gcc SDL3-devel glew-devel libarchive-devel
6766
```
6867

6968
Finally, to build Hades, run:

external/meson.build

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -90,39 +90,3 @@ mjson = static_library(
9090
stb_inc = include_directories(
9191
'stb/'
9292
)
93-
94-
###############################
95-
## NFDe ##
96-
###############################
97-
98-
nfde_inc = include_directories(
99-
'nfde/src/include/'
100-
)
101-
102-
nfde_src = []
103-
nfde_dep = []
104-
105-
if host_machine.system() == 'windows'
106-
nfde_src += ['nfde/src/nfd_win.cpp']
107-
elif host_machine.system() == 'darwin'
108-
add_languages('objc')
109-
nfde_src += ['nfde/src/nfd_cocoa.m']
110-
nfde_dep += [
111-
dependency('appleframeworks', required: true, modules: ['AppKit', 'UniformTypeIdentifiers']),
112-
]
113-
else
114-
nfde_src += ['nfde/src/nfd_gtk.cpp']
115-
nfde_dep += [
116-
dependency('gtk+-3.0', required: true, static: static_dependencies),
117-
]
118-
endif
119-
120-
nfde = static_library(
121-
'nfde',
122-
nfde_src,
123-
include_directories: nfde_inc,
124-
dependencies: nfde_dep,
125-
c_args: cflags,
126-
cpp_args: cflags,
127-
link_args: ldflags,
128-
)

external/nfde

Lines changed: 0 additions & 1 deletion
This file was deleted.

include/app/app.h

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,11 @@
1313
#include <capstone/capstone.h>
1414
#endif
1515

16-
#include <stdatomic.h>
17-
#include <GL/glew.h>
1816
#include <SDL3/SDL.h>
17+
#include <SDL3/SDL_dialog.h>
18+
#include <GL/glew.h>
1919
#include <cimgui.h>
20+
#include <stdatomic.h>
2021
#include "gba/gba.h"
2122

2223
#define GLSL(src) "#version 330 core\n" #src
@@ -142,13 +143,26 @@ enum bind_actions {
142143

143144
extern char const * const binds_pretty_name[];
144145
extern char const * const binds_slug[];
146+
extern SDL_DialogFileFilter const sdl_nfd_bios_filters[];
147+
extern SDL_DialogFileFilter const sdl_nfd_rom_filters[];
148+
extern SDL_DialogFileFilter const sdl_nfd_save_filters[];
145149

146150
enum app_notification_kind {
147151
UI_NOTIFICATION_INFO,
148152
UI_NOTIFICATION_SUCCESS,
149153
UI_NOTIFICATION_ERROR,
150154
};
151155

156+
enum nfd_event_kind {
157+
NFD_BIOS_PATH,
158+
NFD_ROM_PATH,
159+
NFD_EXPORT_SAVE,
160+
NFD_IMPORT_SAVE,
161+
NFD_SAVE_DIR,
162+
NFD_QUICKSAVE_DIR,
163+
NFD_SCREENSHOT_DIR,
164+
};
165+
152166
enum menu_kind {
153167
MENU_GENERAL,
154168
MENU_EMULATION,
@@ -167,6 +181,14 @@ struct app_notification {
167181
struct app_notification *next;
168182
};
169183

184+
struct nfd_event {
185+
enum nfd_event_kind kind;
186+
struct app *app;
187+
char *path;
188+
189+
struct nfd_event *next;
190+
};
191+
170192
struct keyboard_binding {
171193
SDL_Keycode key;
172194

@@ -400,6 +422,12 @@ struct app {
400422
bool left;
401423
} joystick;
402424
} gamepad;
425+
426+
struct {
427+
pthread_mutex_t lock;
428+
429+
struct nfd_event *head;
430+
} nfd;
403431
} sdl;
404432

405433
struct {
@@ -652,6 +680,9 @@ void app_emulator_set_watchpoints_list(struct app *app, struct watchpoint *watch
652680
/* event.c */
653681
void app_sdl_handle_events(struct app *app, SDL_Event *event);
654682
void app_sdl_set_rumble(struct app const *app, bool enable);
683+
void app_nfd_process_events(struct app *app);
684+
void app_nfd_update_path(void *raw_event, const char * const *filelist, int filter);
685+
struct nfd_event *app_nfd_create_event(struct app *app, enum nfd_event_kind kind);
655686

656687
/* path.c */
657688
void app_paths_update(struct app *app);

resource/linux/AppImageBuilder.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ AppDir:
3232
- sourceline: deb http://security.ubuntu.com/ubuntu/ jammy-security multiverse
3333
include:
3434
- libarchive13
35-
- libgtk-3-0
36-
- libgtk-3-common
3735
- libglew2.2
3836
- librsvg2-common # See https://github.com/hades-emu/Hades/issues/102
3937
exclude:

source/app/audio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ app_sdl_audio_callback(
2828
len = additional_amount / sizeof(int16_t);
2929

3030
if (len <= 0) {
31-
return ;
31+
return;
3232
}
3333

3434
if (len > array_length(app->audio.buffer)) {

source/app/event.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ app_sdl_set_rumble(
260260
bool enable
261261
) {
262262
if (!app->sdl.gamepad.ptr || !app->sdl.gamepad.can_rumble) {
263-
return ;
263+
return;
264264
}
265265

266266
// Rumble for 0.25s

0 commit comments

Comments
 (0)