TheMaverickProgrammer / OpenNetBattle

An open source card-based battle engine written in modern C++
GNU General Public License v3.0
197 stars 41 forks source link

Fix build on macOS. #175

Closed bigfarts closed 2 years ago

bigfarts commented 2 years ago

There are some remaining issues on macOS: the game crashes past the title screen. I'll investigate them soon, but the game will build.

There are some additional changes required in SFML and Swoosh.

Swoosh: https://github.com/TheMaverickProgrammer/Swoosh/pull/16

SFML: https://github.com/TheMaverickProgrammer/SFML_ANDROID_ES_2/pull/3

It looks like there is an outstanding thread safety issue that needs to be resolved.

BUG IN CLIENT OF LIBDISPATCH: Assertion failed: Block was expected to execute on queue [com.apple.main-thread]

Thread 7 Crashed:
0   libdispatch.dylib                          0x1849c101c _dispatch_assert_queue_fail + 116
1   libdispatch.dylib                          0x1849c1014 _dispatch_assert_queue_fail + 108
2   libdispatch.dylib                          0x1849c0fa8 dispatch_assert_queue + 200
3   HIToolbox                                  0x18d7bf0d8 islGetInputSourceListWithAdditions + 160
4   HIToolbox                                  0x18d7c16bc isValidateInputSourceRef + 92
5   HIToolbox                                  0x18d7c157c TSMGetInputSourceProperty + 40
6   libsfml-window.2.5.1.dylib                 0x10d4e7bec sf::priv::HIDInputManager::HIDInputManager() + 152
7   libsfml-window.2.5.1.dylib                 0x10d4e7830 sf::priv::HIDInputManager::HIDInputManager() + 28
8   libsfml-window.2.5.1.dylib                 0x10d4e77b8 sf::priv::HIDInputManager::getInstance() + 64
9   libsfml-window.2.5.1.dylib                 0x10d4e6be0 sf::priv::InputImpl::isKeyPressed(sf::Keyboard::Key) + 20
10  libsfml-window.2.5.1.dylib                 0x10d4db174 sf::Keyboard::isKeyPressed(sf::Keyboard::Key) + 24
11  BattleNetwork                              0x103281aac Overworld::Homepage::onUpdate(double) + 312
12  BattleNetwork                              0x10077c1d4 swoosh::Segue::onUpdate(double) + 116
13  BattleNetwork                              0x102a31a1c swoosh::ActivityController::update(double) + 480
14  BattleNetwork                              0x102a31424 Game::ProcessFrame() + 224
15  BattleNetwork                              0x102a69c88 decltype(*(std::__1::forward<Game*>(fp0)).*fp()) std::__1::__invoke<void (Game::*)(), Game*, void>(void (Game::*&&)(), Game*&&) + 108
16  BattleNetwork                              0x102a69bd0 void std::__1::__thread_execute<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void (Game::*)(), Game*, 2ul>(std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void (Game::*)(), Game*>&, std::__1::__tuple_indices<2ul>) + 56
17  BattleNetwork                              0x102a69330 void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void (Game::*)(), Game*> >(void*) + 80
18  libsystem_pthread.dylib                    0x184b7d4ec _pthread_start + 148
19  libsystem_pthread.dylib                    0x184b782d0 thread_start + 8