mirror of
https://github.com/mkxp-z/mkxp-z.git
synced 2025-09-10 12:02:53 +02:00
Drop ObjFW as a dependency
This commit is contained in:
parent
00f085f8a5
commit
0a533bb3c2
29 changed files with 1172 additions and 756 deletions
|
@ -19,20 +19,24 @@
|
|||
** along with mkxp. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "audio.h"
|
||||
#include "audio/audio.h"
|
||||
#include "filesystem/filesystem.h"
|
||||
#include "display/graphics.h"
|
||||
#include "system/system.h"
|
||||
|
||||
#include "util/util.h"
|
||||
#include "util/sdl-util.h"
|
||||
#include "util/debugwriter.h"
|
||||
#include "util/boost-hash.h"
|
||||
|
||||
|
||||
#include "binding-util.h"
|
||||
#include "binding.h"
|
||||
#include "debugwriter.h"
|
||||
#include "eventthread.h"
|
||||
#include "filesystem.h"
|
||||
#include "graphics.h"
|
||||
#include "lang-fun.h"
|
||||
#include "sdl-util.h"
|
||||
#include "sharedstate.h"
|
||||
#include "src/config.h"
|
||||
#include "src/util/util.h"
|
||||
|
||||
#include "boost-hash.h"
|
||||
#include "sharedstate.h"
|
||||
#include "config.h"
|
||||
#include "eventthread.h"
|
||||
|
||||
#include <vector>
|
||||
|
||||
extern "C" {
|
||||
|
@ -250,9 +254,8 @@ RB_METHOD(mkxpDataDirectory) {
|
|||
const std::string &path = shState->config().customDataPath;
|
||||
const char *s = path.empty() ? "." : path.c_str();
|
||||
|
||||
char *s_nml = shState->fileSystem().normalize(s, 1, 1);
|
||||
VALUE ret = rb_str_new_cstr(s_nml);
|
||||
delete s_nml;
|
||||
std::string s_nml = shState->fileSystem().normalize(s, 1, 1);
|
||||
VALUE ret = rb_str_new_cstr(s_nml.c_str());
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -304,7 +307,7 @@ RB_METHOD(mkxpPlatform) {
|
|||
RB_METHOD(mkxpUserLanguage) {
|
||||
RB_UNUSED_PARAM;
|
||||
|
||||
return rb_str_new_cstr(getUserLanguage());
|
||||
return rb_str_new_cstr(mkxp_sys::getSystemLanguage().c_str());
|
||||
}
|
||||
|
||||
RB_METHOD(mkxpGameTitle) {
|
||||
|
@ -491,7 +494,7 @@ bool evalScript(VALUE string, const char *filename)
|
|||
return true;
|
||||
}
|
||||
|
||||
#ifndef MARIN
|
||||
|
||||
#define SCRIPT_SECTION_FMT (rgssVer >= 3 ? "{%04ld}" : "Section%03ld")
|
||||
|
||||
static void runRMXPScripts(BacktraceData &btData) {
|
||||
|
@ -586,7 +589,6 @@ static void runRMXPScripts(BacktraceData &btData) {
|
|||
VALUE exc = rb_gv_get("$!");
|
||||
if (exc != Qnil)
|
||||
return;
|
||||
#endif
|
||||
|
||||
#ifdef EASY_POKE
|
||||
// Used to try and fix Essentials garbage later if it's detected
|
||||
|
@ -800,7 +802,7 @@ static void mriBindingExecute() {
|
|||
}
|
||||
#ifndef WORKDIR_CURRENT
|
||||
else {
|
||||
rb_ary_push(lpaths, rb_str_new_cstr(getcwd(0,0)));
|
||||
rb_ary_push(lpaths, rb_str_new_cstr(mkxp_fs::getCurrentDirectory().c_str()));
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -814,11 +816,7 @@ static void mriBindingExecute() {
|
|||
if (!customScript.empty())
|
||||
runCustomScript(customScript);
|
||||
else
|
||||
#ifdef MARIN
|
||||
runCustomScript("ruby/scripts/requires.rb");
|
||||
#else
|
||||
runRMXPScripts(btData);
|
||||
#endif
|
||||
|
||||
#if RAPI_FULL > 187
|
||||
VALUE exc = rb_errinfo();
|
||||
|
|
|
@ -292,26 +292,17 @@ struct {
|
|||
{"LEFT", Input::Left},
|
||||
{"RIGHT", Input::Right},
|
||||
{"UP", Input::Up},
|
||||
|
||||
#ifdef MARIN
|
||||
{"ZL", Input::ZL},
|
||||
{"ZR", Input::ZR},
|
||||
#else
|
||||
{"C", Input::ZL},
|
||||
{"Z", Input::ZR},
|
||||
#endif
|
||||
|
||||
{"A", Input::A},
|
||||
{"B", Input::B},
|
||||
{"X", Input::X},
|
||||
{"Y", Input::Y},
|
||||
{"L", Input::L},
|
||||
{"R", Input::R},
|
||||
|
||||
{"SHIFT", Input::Shift},
|
||||
{"CTRL", Input::Ctrl},
|
||||
{"ALT", Input::Alt},
|
||||
|
||||
{"F5", Input::F5},
|
||||
{"F6", Input::F6},
|
||||
{"F7", Input::F7},
|
||||
|
|
|
@ -244,26 +244,6 @@ $(DOWNLOADS)/openal/cmakebuild/Makefile: $(DOWNLOADS)/openal/CMakeLists.txt
|
|||
$(DOWNLOADS)/openal/CMakeLists.txt:
|
||||
$(CLONE) $(GITHUB)/kcat/openal-soft $(DOWNLOADS)/openal
|
||||
|
||||
# ObjFW
|
||||
objfw: init_dirs $(LIBDIR)/libobjfw.a
|
||||
|
||||
$(LIBDIR)/libobjfw.a: $(DOWNLOADS)/ObjFW/Makefile
|
||||
cd $(DOWNLOADS)/ObjFW; \
|
||||
make -j$(NPROC); make install
|
||||
|
||||
$(DOWNLOADS)/ObjFW/Makefile: $(DOWNLOADS)/ObjFW/configure
|
||||
cd $(DOWNLOADS)/ObjFW; \
|
||||
$(CONFIGURE) --enable-static --disable-shared
|
||||
|
||||
$(DOWNLOADS)/ObjFW/configure: $(DOWNLOADS)/ObjFW/autogen.sh
|
||||
cd $(DOWNLOADS)/ObjFW; \
|
||||
./autogen.sh
|
||||
|
||||
$(DOWNLOADS)/ObjFW/autogen.sh:
|
||||
$(CLONE) $(GITHUB)/ObjFW/ObjFW $(DOWNLOADS)/ObjFW; \
|
||||
cd $(DOWNLOADS)/ObjFW; \
|
||||
git checkout 7ff624a09675925f08222499249ef25f325bee41
|
||||
|
||||
# Standard ruby
|
||||
ruby: init_dirs $(LIBDIR)/libruby*.a
|
||||
|
||||
|
@ -308,6 +288,6 @@ clean-downloads:
|
|||
clean-compiled:
|
||||
-rm -rf build-$(SDK)-$(ARCH)
|
||||
|
||||
deps-core: libvorbis sigcxx pixman libpng libjpeg objfw physfs sdl2 sdl2image sdl2ttf openal
|
||||
deps-core: libvorbis sigcxx pixman libpng libjpeg physfs sdl2 sdl2image sdl2ttf openal
|
||||
deps-binding: ruby
|
||||
everything: deps-core deps-binding
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<key>CFBundleIconFile</key>
|
||||
<string>icon.icns</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com.zoro.mkxpz</string>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
|
|
|
@ -2,7 +2,17 @@
|
|||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>com.apple.security.app-sandbox</key>
|
||||
<true/>
|
||||
<key>com.apple.security.assets.pictures.read-write</key>
|
||||
<true/>
|
||||
<key>com.apple.security.cs.disable-library-validation</key>
|
||||
<true/>
|
||||
<key>com.apple.security.files.downloads.read-write</key>
|
||||
<true/>
|
||||
<key>com.apple.security.files.user-selected.read-write</key>
|
||||
<true/>
|
||||
<key>com.apple.security.network.client</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
|
|
|
@ -63,10 +63,9 @@
|
|||
3B10EDAA2568E95E00372D13 /* table.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3B10ED4C2568E95D00372D13 /* table.cpp */; };
|
||||
3B10EDAB2568E95E00372D13 /* etc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3B10ED4D2568E95D00372D13 /* etc.cpp */; };
|
||||
3B10EDAC2568E95E00372D13 /* sharedstate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3B10ED512568E95D00372D13 /* sharedstate.cpp */; };
|
||||
3B10EDAD2568E95E00372D13 /* filesystem.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3B10ED542568E95D00372D13 /* filesystem.mm */; };
|
||||
3B10EDAF2568E95E00372D13 /* main.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3B10ED562568E95D00372D13 /* main.mm */; };
|
||||
3B10EDB12568E95E00372D13 /* fake-api.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3B10ED5A2568E95D00372D13 /* fake-api.mm */; };
|
||||
3B10EDB22568E95E00372D13 /* lang-fun.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3B10ED5B2568E95D00372D13 /* lang-fun.mm */; };
|
||||
3B10EDAD2568E95E00372D13 /* filesystem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3B10ED542568E95D00372D13 /* filesystem.cpp */; };
|
||||
3B10EDAF2568E95E00372D13 /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3B10ED562568E95D00372D13 /* main.cpp */; };
|
||||
3B10EDB12568E95E00372D13 /* fake-api.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3B10ED5A2568E95D00372D13 /* fake-api.cpp */; };
|
||||
3B10EDB32568E95E00372D13 /* midisource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3B10ED5E2568E95D00372D13 /* midisource.cpp */; };
|
||||
3B10EDB42568E95E00372D13 /* alstream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3B10ED5F2568E95D00372D13 /* alstream.cpp */; };
|
||||
3B10EDB52568E95E00372D13 /* fluid-fun.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3B10ED602568E95D00372D13 /* fluid-fun.cpp */; };
|
||||
|
@ -124,6 +123,121 @@
|
|||
3B5A840D2569BE7C00BAF2E5 /* filesystemImplApple.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3B5A840C2569BE7C00BAF2E5 /* filesystemImplApple.mm */; };
|
||||
3B5A84342569F82C00BAF2E5 /* mkxp.json in CopyFiles */ = {isa = PBXBuildFile; fileRef = 3BD2B7282565B35D003DAD8A /* mkxp.json */; };
|
||||
3B5A8445256A0F6300BAF2E5 /* libopenal.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B5A8444256A0F6300BAF2E5 /* libopenal.a */; };
|
||||
3B5A8464256A46B200BAF2E5 /* systemImplApple.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3B5A8463256A46B200BAF2E5 /* systemImplApple.mm */; };
|
||||
3B83DC26256A51B9001991CB /* CocoaHelpers.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3B10EE122568EA0900372D13 /* CocoaHelpers.mm */; };
|
||||
3B83DC27256A51B9001991CB /* tilemapvx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3B10ED7D2568E95D00372D13 /* tilemapvx.cpp */; };
|
||||
3B83DC28256A51B9001991CB /* SDL_sound.c in Sources */ = {isa = PBXBuildFile; fileRef = 3B10ED112568E8F100372D13 /* SDL_sound.c */; };
|
||||
3B83DC29256A51B9001991CB /* rgssad.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3B10ED382568E95D00372D13 /* rgssad.cpp */; };
|
||||
3B83DC2A256A51B9001991CB /* input.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3B10ED462568E95D00372D13 /* input.cpp */; };
|
||||
3B83DC2B256A51B9001991CB /* tilemap-binding.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3B10EDE72568E96A00372D13 /* tilemap-binding.cpp */; };
|
||||
3B83DC2C256A51B9001991CB /* audio.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3B10ED642568E95D00372D13 /* audio.cpp */; };
|
||||
3B83DC2D256A51B9001991CB /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3B10ED562568E95D00372D13 /* main.cpp */; };
|
||||
3B83DC2E256A51B9001991CB /* alstream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3B10ED5F2568E95D00372D13 /* alstream.cpp */; };
|
||||
3B83DC2F256A51B9001991CB /* table.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3B10ED4C2568E95D00372D13 /* table.cpp */; };
|
||||
3B83DC30256A51B9001991CB /* table-binding.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3B10EDE52568E96A00372D13 /* table-binding.cpp */; };
|
||||
3B83DC31256A51B9001991CB /* config.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3B5A84052569B56F00BAF2E5 /* config.cpp */; };
|
||||
3B83DC32256A51B9001991CB /* bitmap-binding.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3B10EDE42568E96A00372D13 /* bitmap-binding.cpp */; };
|
||||
3B83DC33256A51B9001991CB /* vorbissource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3B10ED6A2568E95D00372D13 /* vorbissource.cpp */; };
|
||||
3B83DC34256A51B9001991CB /* SDL_sound_raw.c in Sources */ = {isa = PBXBuildFile; fileRef = 3B10ED0C2568E8F100372D13 /* SDL_sound_raw.c */; };
|
||||
3B83DC35256A51B9001991CB /* filesystem-binding.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3B10EDD72568E96A00372D13 /* filesystem-binding.cpp */; };
|
||||
3B83DC36256A51B9001991CB /* SDL_sound_shn.c in Sources */ = {isa = PBXBuildFile; fileRef = 3B10ED072568E8F100372D13 /* SDL_sound_shn.c */; };
|
||||
3B83DC37256A51B9001991CB /* glstate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3B10ED8A2568E95E00372D13 /* glstate.cpp */; };
|
||||
3B83DC38256A51B9001991CB /* gl-fun.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3B10ED922568E95E00372D13 /* gl-fun.cpp */; };
|
||||
3B83DC39256A51B9001991CB /* sprite-binding.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3B10EDDF2568E96A00372D13 /* sprite-binding.cpp */; };
|
||||
3B83DC3A256A51B9001991CB /* sprite.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3B10ED762568E95D00372D13 /* sprite.cpp */; };
|
||||
3B83DC3B256A51B9001991CB /* cusl-binding.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3B10EDD92568E96A00372D13 /* cusl-binding.cpp */; };
|
||||
3B83DC3C256A51B9001991CB /* sdlsoundsource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3B10ED632568E95D00372D13 /* sdlsoundsource.cpp */; };
|
||||
3B83DC3D256A51B9001991CB /* viewport-binding.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3B10EDF42568E96A00372D13 /* viewport-binding.cpp */; };
|
||||
3B83DC3E256A51B9001991CB /* windowvx-binding.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3B10EDDD2568E96A00372D13 /* windowvx-binding.cpp */; };
|
||||
3B83DC3F256A51B9001991CB /* windowvx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3B10ED722568E95D00372D13 /* windowvx.cpp */; };
|
||||
3B83DC40256A51B9001991CB /* module_rpg.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3B10EDF32568E96A00372D13 /* module_rpg.cpp */; };
|
||||
3B83DC41256A51B9001991CB /* autotiles.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3B10EDA22568E95E00372D13 /* autotiles.cpp */; };
|
||||
3B83DC42256A51B9001991CB /* audiostream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3B10ED662568E95D00372D13 /* audiostream.cpp */; };
|
||||
3B83DC43256A51B9001991CB /* binding-util.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3B10EDEF2568E96A00372D13 /* binding-util.cpp */; };
|
||||
3B83DC44256A51B9001991CB /* plane-binding.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3B10EDEA2568E96A00372D13 /* plane-binding.cpp */; };
|
||||
3B83DC45256A51B9001991CB /* gl-meta.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3B10ED882568E95E00372D13 /* gl-meta.cpp */; };
|
||||
3B83DC46256A51B9001991CB /* etc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3B10ED4D2568E95D00372D13 /* etc.cpp */; };
|
||||
3B83DC47256A51B9001991CB /* shader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3B10ED8C2568E95E00372D13 /* shader.cpp */; };
|
||||
3B83DC48256A51B9001991CB /* tilemap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3B10ED9C2568E95E00372D13 /* tilemap.cpp */; };
|
||||
3B83DC49256A51B9001991CB /* SDL_sound_au.c in Sources */ = {isa = PBXBuildFile; fileRef = 3B10ED152568E8F100372D13 /* SDL_sound_au.c */; };
|
||||
3B83DC4A256A51B9001991CB /* window.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3B10ED742568E95D00372D13 /* window.cpp */; };
|
||||
3B83DC4B256A51B9001991CB /* SDL_sound_wav.c in Sources */ = {isa = PBXBuildFile; fileRef = 3B10ED142568E8F100372D13 /* SDL_sound_wav.c */; };
|
||||
3B83DC4C256A51B9001991CB /* input-binding.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3B10EDDC2568E96A00372D13 /* input-binding.cpp */; };
|
||||
3B83DC4D256A51B9001991CB /* keybindings.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3B10ED472568E95D00372D13 /* keybindings.cpp */; };
|
||||
3B83DC4E256A51B9001991CB /* filesystem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3B10ED542568E95D00372D13 /* filesystem.cpp */; };
|
||||
3B83DC4F256A51B9001991CB /* binding-mri.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3B10EDF02568E96A00372D13 /* binding-mri.cpp */; };
|
||||
3B83DC50256A51B9001991CB /* settingsmenu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3B10ED6E2568E95D00372D13 /* settingsmenu.cpp */; };
|
||||
3B83DC51256A51B9001991CB /* eventthread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3B10ED352568E95D00372D13 /* eventthread.cpp */; };
|
||||
3B83DC52256A51B9001991CB /* viewport.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3B10ED9E2568E95E00372D13 /* viewport.cpp */; };
|
||||
3B83DC53256A51B9001991CB /* gl-debug.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3B10ED832568E95E00372D13 /* gl-debug.cpp */; };
|
||||
3B83DC54256A51B9001991CB /* SDL_sound_vorbis.c in Sources */ = {isa = PBXBuildFile; fileRef = 3B10ED102568E8F100372D13 /* SDL_sound_vorbis.c */; };
|
||||
3B83DC55256A51B9001991CB /* tileatlasvx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3B10ED892568E95E00372D13 /* tileatlasvx.cpp */; };
|
||||
3B83DC56256A51B9001991CB /* bitmap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3B10ED732568E95D00372D13 /* bitmap.cpp */; };
|
||||
3B83DC57256A51B9001991CB /* tilemapvx-binding.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3B10EDE12568E96A00372D13 /* tilemapvx-binding.cpp */; };
|
||||
3B83DC58256A51B9001991CB /* window-binding.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3B10EDD62568E96A00372D13 /* window-binding.cpp */; };
|
||||
3B83DC59256A51B9001991CB /* midisource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3B10ED5E2568E95D00372D13 /* midisource.cpp */; };
|
||||
3B83DC5A256A51B9001991CB /* graphics-binding.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3B10EDE92568E96A00372D13 /* graphics-binding.cpp */; };
|
||||
3B83DC5B256A51B9001991CB /* plane.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3B10EDA12568E95E00372D13 /* plane.cpp */; };
|
||||
3B83DC5C256A51B9001991CB /* tilequad.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3B10ED802568E95D00372D13 /* tilequad.cpp */; };
|
||||
3B83DC5D256A51B9001991CB /* SDL_sound_mp3.c in Sources */ = {isa = PBXBuildFile; fileRef = 3B10ED162568E8F100372D13 /* SDL_sound_mp3.c */; };
|
||||
3B83DC5E256A51B9001991CB /* SDL_sound_aiff.c in Sources */ = {isa = PBXBuildFile; fileRef = 3B10ED172568E8F100372D13 /* SDL_sound_aiff.c */; };
|
||||
3B83DC5F256A51B9001991CB /* tileatlas.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3B10ED912568E95E00372D13 /* tileatlas.cpp */; };
|
||||
3B83DC60256A51B9001991CB /* fluid-fun.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3B10ED602568E95D00372D13 /* fluid-fun.cpp */; };
|
||||
3B83DC61256A51B9001991CB /* scene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3B10ED842568E95E00372D13 /* scene.cpp */; };
|
||||
3B83DC62256A51B9001991CB /* texpool.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3B10ED812568E95D00372D13 /* texpool.cpp */; };
|
||||
3B83DC63256A51B9001991CB /* font-binding.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3B10EDEC2568E96A00372D13 /* font-binding.cpp */; };
|
||||
3B83DC64256A51B9001991CB /* SDL_sound_coreaudio.c in Sources */ = {isa = PBXBuildFile; fileRef = 3B10ED092568E8F100372D13 /* SDL_sound_coreaudio.c */; };
|
||||
3B83DC65256A51B9001991CB /* audio-binding.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3B10EDDA2568E96A00372D13 /* audio-binding.cpp */; };
|
||||
3B83DC66256A51B9001991CB /* autotilesvx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3B10ED9D2568E95E00372D13 /* autotilesvx.cpp */; };
|
||||
3B83DC67256A51B9001991CB /* SDL_sound_voc.c in Sources */ = {isa = PBXBuildFile; fileRef = 3B10ED122568E8F100372D13 /* SDL_sound_voc.c */; };
|
||||
3B83DC68256A51B9001991CB /* vertex.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3B10ED982568E95E00372D13 /* vertex.cpp */; };
|
||||
3B83DC69256A51B9001991CB /* miniffi-binding.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3B10EDE82568E96A00372D13 /* miniffi-binding.cpp */; };
|
||||
3B83DC6A256A51B9001991CB /* soundemitter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3B10ED652568E95D00372D13 /* soundemitter.cpp */; };
|
||||
3B83DC6B256A51B9001991CB /* etc-binding.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3B10EDE62568E96A00372D13 /* etc-binding.cpp */; };
|
||||
3B83DC6C256A51B9001991CB /* systemImplApple.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3B5A8463256A46B200BAF2E5 /* systemImplApple.mm */; };
|
||||
3B83DC6D256A51B9001991CB /* graphics.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3B10ED7B2568E95D00372D13 /* graphics.cpp */; };
|
||||
3B83DC6E256A51B9001991CB /* font.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3B10ED772568E95D00372D13 /* font.cpp */; };
|
||||
3B83DC6F256A51B9001991CB /* SDL_sound_flac.c in Sources */ = {isa = PBXBuildFile; fileRef = 3B10ED182568E8F100372D13 /* SDL_sound_flac.c */; };
|
||||
3B83DC70256A51B9001991CB /* SDL_sound_modplug.c in Sources */ = {isa = PBXBuildFile; fileRef = 3B10ED0D2568E8F100372D13 /* SDL_sound_modplug.c */; };
|
||||
3B83DC71256A51B9001991CB /* filesystemImplApple.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3B5A840C2569BE7C00BAF2E5 /* filesystemImplApple.mm */; };
|
||||
3B83DC72256A51B9001991CB /* fake-api.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3B10ED5A2568E95D00372D13 /* fake-api.cpp */; };
|
||||
3B83DC73256A51B9001991CB /* sharedstate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3B10ED512568E95D00372D13 /* sharedstate.cpp */; };
|
||||
3B83DC75256A51B9001991CB /* libruby.2.6-static.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3BE080F4256879FD0006849F /* libruby.2.6-static.a */; };
|
||||
3B83DC76256A51B9001991CB /* libSDL2_ttf.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3BE080EF256879FD0006849F /* libSDL2_ttf.a */; };
|
||||
3B83DC77256A51B9001991CB /* libvorbisenc.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3BE080FB256879FE0006849F /* libvorbisenc.a */; };
|
||||
3B83DC78256A51B9001991CB /* libSDL2main.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3BE080E4256879FC0006849F /* libSDL2main.a */; };
|
||||
3B83DC79256A51B9001991CB /* libopenal.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B5A8444256A0F6300BAF2E5 /* libopenal.a */; };
|
||||
3B83DC7A256A51B9001991CB /* libpixman-1.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3BE080E9256879FC0006849F /* libpixman-1.a */; };
|
||||
3B83DC7B256A51B9001991CB /* libogg.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3BE080FD256879FE0006849F /* libogg.a */; };
|
||||
3B83DC7C256A51B9001991CB /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3BE080EB256879FC0006849F /* libSDL2.a */; };
|
||||
3B83DC7D256A51B9001991CB /* libturbojpeg.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3BE081492568A5F60006849F /* libturbojpeg.a */; };
|
||||
3B83DC7E256A51B9001991CB /* libpng.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3BE081452568A5C60006849F /* libpng.a */; };
|
||||
3B83DC7F256A51B9001991CB /* libvorbis.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3BE080E6256879FC0006849F /* libvorbis.a */; };
|
||||
3B83DC80256A51B9001991CB /* libsigc-2.0.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3BE08100256879FE0006849F /* libsigc-2.0.a */; };
|
||||
3B83DC81256A51B9001991CB /* libSDL2_test.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3BE080FA256879FE0006849F /* libSDL2_test.a */; };
|
||||
3B83DC82256A51B9001991CB /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3BA08FA425674C9400449CFF /* OpenGL.framework */; };
|
||||
3B83DC83256A51B9001991CB /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3BD2B47A256534BA003DAD8A /* IOKit.framework */; };
|
||||
3B83DC84256A51B9001991CB /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3BE081552568D3A60006849F /* Carbon.framework */; };
|
||||
3B83DC85256A51B9001991CB /* AppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3BE081582568D3A60006849F /* AppKit.framework */; };
|
||||
3B83DC86256A51B9001991CB /* Metal.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3BE081542568D3A60006849F /* Metal.framework */; };
|
||||
3B83DC87256A51B9001991CB /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3BE081572568D3A60006849F /* ForceFeedback.framework */; };
|
||||
3B83DC88256A51B9001991CB /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3BE081532568D3A60006849F /* CoreVideo.framework */; };
|
||||
3B83DC89256A51B9001991CB /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3BE081522568D3A60006849F /* Carbon.framework */; };
|
||||
3B83DC8A256A51B9001991CB /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3BE081562568D3A60006849F /* CoreGraphics.framework */; };
|
||||
3B83DC8B256A51B9001991CB /* libbz2.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 3BE081502568D3A50006849F /* libbz2.tbd */; };
|
||||
3B83DC8C256A51B9001991CB /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3BE081512568D3A60006849F /* CoreAudio.framework */; };
|
||||
3B83DC8D256A51B9001991CB /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3BD2B46925651C1B003DAD8A /* AudioToolbox.framework */; };
|
||||
3B83DC8E256A51B9001991CB /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3BD2B46725651C00003DAD8A /* Foundation.framework */; };
|
||||
3B83DC8F256A51B9001991CB /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3BD2B46625651BFC003DAD8A /* CoreFoundation.framework */; };
|
||||
3B83DC90256A51B9001991CB /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 3BD2B46525651BF3003DAD8A /* libz.tbd */; };
|
||||
3B83DC91256A51B9001991CB /* libiconv.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 3BD2B46825651C12003DAD8A /* libiconv.tbd */; };
|
||||
3B83DC92256A51B9001991CB /* libvorbisfile.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3BE080E7256879FC0006849F /* libvorbisfile.a */; };
|
||||
3B83DC93256A51B9001991CB /* libSDL2_image.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3BE080F0256879FD0006849F /* libSDL2_image.a */; };
|
||||
3B83DC94256A51B9001991CB /* libfreetype.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3BE080FC256879FE0006849F /* libfreetype.a */; };
|
||||
3B83DC95256A51B9001991CB /* libphysfs.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3BE080FF256879FE0006849F /* libphysfs.a */; };
|
||||
3B83DC97256A51B9001991CB /* icon.icns in Resources */ = {isa = PBXBuildFile; fileRef = 3BDB23E22564546E00C4A63D /* icon.icns */; };
|
||||
3B83DC99256A51B9001991CB /* mkxp.json in CopyFiles */ = {isa = PBXBuildFile; fileRef = 3BD2B7282565B35D003DAD8A /* mkxp.json */; };
|
||||
3B83DC9A256A51B9001991CB /* Assets.bundle in CopyFiles */ = {isa = PBXBuildFile; fileRef = 3BA08EA4256641ED00449CFF /* Assets.bundle */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
3BA08E9B256638C900449CFF /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3BD2B46925651C1B003DAD8A /* AudioToolbox.framework */; };
|
||||
3BA08ED4256643C200449CFF /* Assets.bundle in CopyFiles */ = {isa = PBXBuildFile; fileRef = 3BA08EA4256641ED00449CFF /* Assets.bundle */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
3BA08FA525674C9900449CFF /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3BA08FA425674C9400449CFF /* OpenGL.framework */; };
|
||||
|
@ -138,10 +252,8 @@
|
|||
3BE08105256879FE0006849F /* libvorbisfile.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3BE080E7256879FC0006849F /* libvorbisfile.a */; };
|
||||
3BE08107256879FE0006849F /* libpixman-1.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3BE080E9256879FC0006849F /* libpixman-1.a */; };
|
||||
3BE08109256879FE0006849F /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3BE080EB256879FC0006849F /* libSDL2.a */; };
|
||||
3BE0810B256879FE0006849F /* libobjfwbridge.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3BE080ED256879FD0006849F /* libobjfwbridge.a */; };
|
||||
3BE0810D256879FE0006849F /* libSDL2_ttf.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3BE080EF256879FD0006849F /* libSDL2_ttf.a */; };
|
||||
3BE0810E256879FE0006849F /* libSDL2_image.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3BE080F0256879FD0006849F /* libSDL2_image.a */; };
|
||||
3BE08110256879FE0006849F /* libobjfw.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3BE080F2256879FD0006849F /* libobjfw.a */; };
|
||||
3BE08112256879FE0006849F /* libruby.2.6-static.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3BE080F4256879FD0006849F /* libruby.2.6-static.a */; };
|
||||
3BE08118256879FE0006849F /* libSDL2_test.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3BE080FA256879FE0006849F /* libSDL2_test.a */; };
|
||||
3BE08119256879FE0006849F /* libvorbisenc.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3BE080FB256879FE0006849F /* libvorbisenc.a */; };
|
||||
|
@ -155,6 +267,13 @@
|
|||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXContainerItemProxy section */
|
||||
3B83DC24256A51B9001991CB /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 3BDB22EC25644FBF00C4A63D /* Project object */;
|
||||
proxyType = 1;
|
||||
remoteGlobalIDString = 3BA08EA3256641ED00449CFF;
|
||||
remoteInfo = "mkxpz-resources";
|
||||
};
|
||||
3BA08ED2256643AD00449CFF /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 3BDB22EC25644FBF00C4A63D /* Project object */;
|
||||
|
@ -176,6 +295,17 @@
|
|||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
3B83DC98256A51B9001991CB /* CopyFiles */ = {
|
||||
isa = PBXCopyFilesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
dstPath = "";
|
||||
dstSubfolderSpec = 7;
|
||||
files = (
|
||||
3B83DC99256A51B9001991CB /* mkxp.json in CopyFiles */,
|
||||
3B83DC9A256A51B9001991CB /* Assets.bundle in CopyFiles */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
3BA08EAC2566426200449CFF /* CopyFiles */ = {
|
||||
isa = PBXCopyFilesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
|
@ -308,13 +438,10 @@
|
|||
3B10ED502568E95D00372D13 /* settingsmenu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = settingsmenu.h; sourceTree = "<group>"; };
|
||||
3B10ED512568E95D00372D13 /* sharedstate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sharedstate.cpp; sourceTree = "<group>"; };
|
||||
3B10ED532568E95D00372D13 /* filesystem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = filesystem.h; sourceTree = "<group>"; };
|
||||
3B10ED542568E95D00372D13 /* filesystem.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = filesystem.mm; sourceTree = "<group>"; };
|
||||
3B10ED542568E95D00372D13 /* filesystem.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = filesystem.cpp; sourceTree = "<group>"; };
|
||||
3B10ED552568E95D00372D13 /* meson.build */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = meson.build; sourceTree = "<group>"; };
|
||||
3B10ED562568E95D00372D13 /* main.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = main.mm; sourceTree = "<group>"; };
|
||||
3B10ED572568E95D00372D13 /* config.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = config.mm; sourceTree = "<group>"; };
|
||||
3B10ED592568E95D00372D13 /* lang-fun.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "lang-fun.h"; sourceTree = "<group>"; };
|
||||
3B10ED5A2568E95D00372D13 /* fake-api.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "fake-api.mm"; sourceTree = "<group>"; };
|
||||
3B10ED5B2568E95D00372D13 /* lang-fun.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "lang-fun.mm"; sourceTree = "<group>"; };
|
||||
3B10ED562568E95D00372D13 /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = "<group>"; };
|
||||
3B10ED5A2568E95D00372D13 /* fake-api.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "fake-api.cpp"; sourceTree = "<group>"; };
|
||||
3B10ED5C2568E95D00372D13 /* fake-api.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "fake-api.h"; sourceTree = "<group>"; };
|
||||
3B10ED5E2568E95D00372D13 /* midisource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = midisource.cpp; sourceTree = "<group>"; };
|
||||
3B10ED5F2568E95D00372D13 /* alstream.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = alstream.cpp; sourceTree = "<group>"; };
|
||||
|
@ -426,6 +553,10 @@
|
|||
3B5A84142569C28B00BAF2E5 /* filesystemImpl.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = filesystemImpl.h; sourceTree = "<group>"; };
|
||||
3B5A842B2569E8BA00BAF2E5 /* mINI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = mINI.h; sourceTree = "<group>"; };
|
||||
3B5A8444256A0F6300BAF2E5 /* libopenal.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libopenal.a; path = "Dependencies/build-macosx-x86_64/lib/libopenal.a"; sourceTree = "<group>"; };
|
||||
3B5A845C256A465700BAF2E5 /* system.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = system.h; sourceTree = "<group>"; };
|
||||
3B5A845D256A465700BAF2E5 /* systemImpl.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = systemImpl.cpp; sourceTree = "<group>"; };
|
||||
3B5A8463256A46B200BAF2E5 /* systemImplApple.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = systemImplApple.mm; sourceTree = "<group>"; };
|
||||
3B83DC9E256A51B9001991CB /* mkxp-z.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "mkxp-z.app"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
3BA08EA4256641ED00449CFF /* Assets.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = Assets.bundle; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
3BA08EA6256641EE00449CFF /* Assets.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Assets.plist; sourceTree = "<group>"; };
|
||||
3BA08FA425674C9400449CFF /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = System/Library/Frameworks/OpenGL.framework; sourceTree = SDKROOT; };
|
||||
|
@ -447,10 +578,8 @@
|
|||
3BE080E7256879FC0006849F /* libvorbisfile.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libvorbisfile.a; path = "Dependencies/build-macosx-x86_64/lib/libvorbisfile.a"; sourceTree = "<group>"; };
|
||||
3BE080E9256879FC0006849F /* libpixman-1.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libpixman-1.a"; path = "Dependencies/build-macosx-x86_64/lib/libpixman-1.a"; sourceTree = "<group>"; };
|
||||
3BE080EB256879FC0006849F /* libSDL2.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libSDL2.a; path = "Dependencies/build-macosx-x86_64/lib/libSDL2.a"; sourceTree = "<group>"; };
|
||||
3BE080ED256879FD0006849F /* libobjfwbridge.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libobjfwbridge.a; path = "Dependencies/build-macosx-x86_64/lib/libobjfwbridge.a"; sourceTree = "<group>"; };
|
||||
3BE080EF256879FD0006849F /* libSDL2_ttf.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libSDL2_ttf.a; path = "Dependencies/build-macosx-x86_64/lib/libSDL2_ttf.a"; sourceTree = "<group>"; };
|
||||
3BE080F0256879FD0006849F /* libSDL2_image.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libSDL2_image.a; path = "Dependencies/build-macosx-x86_64/lib/libSDL2_image.a"; sourceTree = "<group>"; };
|
||||
3BE080F2256879FD0006849F /* libobjfw.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libobjfw.a; path = "Dependencies/build-macosx-x86_64/lib/libobjfw.a"; sourceTree = "<group>"; };
|
||||
3BE080F4256879FD0006849F /* libruby.2.6-static.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libruby.2.6-static.a"; path = "Dependencies/build-macosx-x86_64/lib/libruby.2.6-static.a"; sourceTree = "<group>"; };
|
||||
3BE080FA256879FE0006849F /* libSDL2_test.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libSDL2_test.a; path = "Dependencies/build-macosx-x86_64/lib/libSDL2_test.a"; sourceTree = "<group>"; };
|
||||
3BE080FB256879FE0006849F /* libvorbisenc.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libvorbisenc.a; path = "Dependencies/build-macosx-x86_64/lib/libvorbisenc.a"; sourceTree = "<group>"; };
|
||||
|
@ -472,6 +601,46 @@
|
|||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
3B83DC74256A51B9001991CB /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
3B83DC75256A51B9001991CB /* libruby.2.6-static.a in Frameworks */,
|
||||
3B83DC76256A51B9001991CB /* libSDL2_ttf.a in Frameworks */,
|
||||
3B83DC77256A51B9001991CB /* libvorbisenc.a in Frameworks */,
|
||||
3B83DC78256A51B9001991CB /* libSDL2main.a in Frameworks */,
|
||||
3B83DC79256A51B9001991CB /* libopenal.a in Frameworks */,
|
||||
3B83DC7A256A51B9001991CB /* libpixman-1.a in Frameworks */,
|
||||
3B83DC7B256A51B9001991CB /* libogg.a in Frameworks */,
|
||||
3B83DC7C256A51B9001991CB /* libSDL2.a in Frameworks */,
|
||||
3B83DC7D256A51B9001991CB /* libturbojpeg.a in Frameworks */,
|
||||
3B83DC7E256A51B9001991CB /* libpng.a in Frameworks */,
|
||||
3B83DC7F256A51B9001991CB /* libvorbis.a in Frameworks */,
|
||||
3B83DC80256A51B9001991CB /* libsigc-2.0.a in Frameworks */,
|
||||
3B83DC81256A51B9001991CB /* libSDL2_test.a in Frameworks */,
|
||||
3B83DC82256A51B9001991CB /* OpenGL.framework in Frameworks */,
|
||||
3B83DC83256A51B9001991CB /* IOKit.framework in Frameworks */,
|
||||
3B83DC84256A51B9001991CB /* Carbon.framework in Frameworks */,
|
||||
3B83DC85256A51B9001991CB /* AppKit.framework in Frameworks */,
|
||||
3B83DC86256A51B9001991CB /* Metal.framework in Frameworks */,
|
||||
3B83DC87256A51B9001991CB /* ForceFeedback.framework in Frameworks */,
|
||||
3B83DC88256A51B9001991CB /* CoreVideo.framework in Frameworks */,
|
||||
3B83DC89256A51B9001991CB /* Carbon.framework in Frameworks */,
|
||||
3B83DC8A256A51B9001991CB /* CoreGraphics.framework in Frameworks */,
|
||||
3B83DC8B256A51B9001991CB /* libbz2.tbd in Frameworks */,
|
||||
3B83DC8C256A51B9001991CB /* CoreAudio.framework in Frameworks */,
|
||||
3B83DC8D256A51B9001991CB /* AudioToolbox.framework in Frameworks */,
|
||||
3B83DC8E256A51B9001991CB /* Foundation.framework in Frameworks */,
|
||||
3B83DC8F256A51B9001991CB /* CoreFoundation.framework in Frameworks */,
|
||||
3B83DC90256A51B9001991CB /* libz.tbd in Frameworks */,
|
||||
3B83DC91256A51B9001991CB /* libiconv.tbd in Frameworks */,
|
||||
3B83DC92256A51B9001991CB /* libvorbisfile.a in Frameworks */,
|
||||
3B83DC93256A51B9001991CB /* libSDL2_image.a in Frameworks */,
|
||||
3B83DC94256A51B9001991CB /* libfreetype.a in Frameworks */,
|
||||
3B83DC95256A51B9001991CB /* libphysfs.a in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
3BA08EA1256641ED00449CFF /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
|
@ -515,9 +684,7 @@
|
|||
3BE08105256879FE0006849F /* libvorbisfile.a in Frameworks */,
|
||||
3BE0810E256879FE0006849F /* libSDL2_image.a in Frameworks */,
|
||||
3BE0811A256879FE0006849F /* libfreetype.a in Frameworks */,
|
||||
3BE0810B256879FE0006849F /* libobjfwbridge.a in Frameworks */,
|
||||
3BE0811D256879FE0006849F /* libphysfs.a in Frameworks */,
|
||||
3BE08110256879FE0006849F /* libobjfw.a in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
@ -616,12 +783,11 @@
|
|||
3B10ED352568E95D00372D13 /* eventthread.cpp */,
|
||||
3B10ED492568E95D00372D13 /* eventthread.h */,
|
||||
3B10ED432568E95D00372D13 /* config.h */,
|
||||
3B10ED572568E95D00372D13 /* config.mm */,
|
||||
3B5A84052569B56F00BAF2E5 /* config.cpp */,
|
||||
3B10ED502568E95D00372D13 /* settingsmenu.h */,
|
||||
3B10ED512568E95D00372D13 /* sharedstate.cpp */,
|
||||
3B10ED552568E95D00372D13 /* meson.build */,
|
||||
3B10ED562568E95D00372D13 /* main.mm */,
|
||||
3B10ED562568E95D00372D13 /* main.cpp */,
|
||||
3B10ED6E2568E95D00372D13 /* settingsmenu.cpp */,
|
||||
3B10EDA42568E95E00372D13 /* sharedstate.h */,
|
||||
3B10EDA52568E95E00372D13 /* binding.h */,
|
||||
|
@ -684,7 +850,7 @@
|
|||
isa = PBXGroup;
|
||||
children = (
|
||||
3B10ED532568E95D00372D13 /* filesystem.h */,
|
||||
3B10ED542568E95D00372D13 /* filesystem.mm */,
|
||||
3B10ED542568E95D00372D13 /* filesystem.cpp */,
|
||||
3B5A840C2569BE7C00BAF2E5 /* filesystemImplApple.mm */,
|
||||
3B5A84132569C28B00BAF2E5 /* filesystemImpl.cpp */,
|
||||
3B5A84142569C28B00BAF2E5 /* filesystemImpl.h */,
|
||||
|
@ -695,10 +861,11 @@
|
|||
3B10ED582568E95D00372D13 /* system */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
3B10ED592568E95D00372D13 /* lang-fun.h */,
|
||||
3B10ED5B2568E95D00372D13 /* lang-fun.mm */,
|
||||
3B10ED5A2568E95D00372D13 /* fake-api.mm */,
|
||||
3B10ED5A2568E95D00372D13 /* fake-api.cpp */,
|
||||
3B10ED5C2568E95D00372D13 /* fake-api.h */,
|
||||
3B5A845C256A465700BAF2E5 /* system.h */,
|
||||
3B5A8463256A46B200BAF2E5 /* systemImplApple.mm */,
|
||||
3B5A845D256A465700BAF2E5 /* systemImpl.cpp */,
|
||||
);
|
||||
path = system;
|
||||
sourceTree = "<group>";
|
||||
|
@ -900,6 +1067,7 @@
|
|||
children = (
|
||||
3BD2B7252565AEC0003DAD8A /* mkxp-z.app */,
|
||||
3BA08EA4256641ED00449CFF /* Assets.bundle */,
|
||||
3B83DC9E256A51B9001991CB /* mkxp-z.app */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
|
@ -919,7 +1087,7 @@
|
|||
3BDB23E5256455A400C4A63D /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
3BE080CA256829FE0006849F /* Temp-IntelOnly */,
|
||||
3BE080CA256829FE0006849F /* Intel */,
|
||||
3BD2B46425651BEB003DAD8A /* System */,
|
||||
);
|
||||
name = Frameworks;
|
||||
|
@ -934,13 +1102,11 @@
|
|||
name = Player;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
3BE080CA256829FE0006849F /* Temp-IntelOnly */ = {
|
||||
3BE080CA256829FE0006849F /* Intel */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
3BE080FC256879FE0006849F /* libfreetype.a */,
|
||||
3B5A8444256A0F6300BAF2E5 /* libopenal.a */,
|
||||
3BE080F2256879FD0006849F /* libobjfw.a */,
|
||||
3BE080ED256879FD0006849F /* libobjfwbridge.a */,
|
||||
3BE080FD256879FE0006849F /* libogg.a */,
|
||||
3BE081452568A5C60006849F /* libpng.a */,
|
||||
3BE081492568A5F60006849F /* libturbojpeg.a */,
|
||||
|
@ -957,12 +1123,31 @@
|
|||
3BE080FB256879FE0006849F /* libvorbisenc.a */,
|
||||
3BE080E7256879FC0006849F /* libvorbisfile.a */,
|
||||
);
|
||||
name = "Temp-IntelOnly";
|
||||
name = Intel;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
3B83DC22256A51B9001991CB /* LegacyPlayer */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 3B83DC9B256A51B9001991CB /* Build configuration list for PBXNativeTarget "LegacyPlayer" */;
|
||||
buildPhases = (
|
||||
3B83DC25256A51B9001991CB /* Sources */,
|
||||
3B83DC74256A51B9001991CB /* Frameworks */,
|
||||
3B83DC96256A51B9001991CB /* Resources */,
|
||||
3B83DC98256A51B9001991CB /* CopyFiles */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
3B83DC23256A51B9001991CB /* PBXTargetDependency */,
|
||||
);
|
||||
name = LegacyPlayer;
|
||||
productName = PlayerLegacy;
|
||||
productReference = 3B83DC9E256A51B9001991CB /* mkxp-z.app */;
|
||||
productType = "com.apple.product-type.application";
|
||||
};
|
||||
3BA08EA3256641ED00449CFF /* Assets */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 3BA08EA9256641EE00449CFF /* Build configuration list for PBXNativeTarget "Assets" */;
|
||||
|
@ -1030,11 +1215,20 @@
|
|||
targets = (
|
||||
3BA08EA3256641ED00449CFF /* Assets */,
|
||||
3BD2B64B2565AEC0003DAD8A /* Player */,
|
||||
3B83DC22256A51B9001991CB /* LegacyPlayer */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXResourcesBuildPhase section */
|
||||
3B83DC96256A51B9001991CB /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
3B83DC97256A51B9001991CB /* icon.icns in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
3BA08EA2256641ED00449CFF /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
|
@ -1054,6 +1248,91 @@
|
|||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
3B83DC25256A51B9001991CB /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
3B83DC26256A51B9001991CB /* CocoaHelpers.mm in Sources */,
|
||||
3B83DC27256A51B9001991CB /* tilemapvx.cpp in Sources */,
|
||||
3B83DC28256A51B9001991CB /* SDL_sound.c in Sources */,
|
||||
3B83DC29256A51B9001991CB /* rgssad.cpp in Sources */,
|
||||
3B83DC2A256A51B9001991CB /* input.cpp in Sources */,
|
||||
3B83DC2B256A51B9001991CB /* tilemap-binding.cpp in Sources */,
|
||||
3B83DC2C256A51B9001991CB /* audio.cpp in Sources */,
|
||||
3B83DC2D256A51B9001991CB /* main.cpp in Sources */,
|
||||
3B83DC2E256A51B9001991CB /* alstream.cpp in Sources */,
|
||||
3B83DC2F256A51B9001991CB /* table.cpp in Sources */,
|
||||
3B83DC30256A51B9001991CB /* table-binding.cpp in Sources */,
|
||||
3B83DC31256A51B9001991CB /* config.cpp in Sources */,
|
||||
3B83DC32256A51B9001991CB /* bitmap-binding.cpp in Sources */,
|
||||
3B83DC33256A51B9001991CB /* vorbissource.cpp in Sources */,
|
||||
3B83DC34256A51B9001991CB /* SDL_sound_raw.c in Sources */,
|
||||
3B83DC35256A51B9001991CB /* filesystem-binding.cpp in Sources */,
|
||||
3B83DC36256A51B9001991CB /* SDL_sound_shn.c in Sources */,
|
||||
3B83DC37256A51B9001991CB /* glstate.cpp in Sources */,
|
||||
3B83DC38256A51B9001991CB /* gl-fun.cpp in Sources */,
|
||||
3B83DC39256A51B9001991CB /* sprite-binding.cpp in Sources */,
|
||||
3B83DC3A256A51B9001991CB /* sprite.cpp in Sources */,
|
||||
3B83DC3B256A51B9001991CB /* cusl-binding.cpp in Sources */,
|
||||
3B83DC3C256A51B9001991CB /* sdlsoundsource.cpp in Sources */,
|
||||
3B83DC3D256A51B9001991CB /* viewport-binding.cpp in Sources */,
|
||||
3B83DC3E256A51B9001991CB /* windowvx-binding.cpp in Sources */,
|
||||
3B83DC3F256A51B9001991CB /* windowvx.cpp in Sources */,
|
||||
3B83DC40256A51B9001991CB /* module_rpg.cpp in Sources */,
|
||||
3B83DC41256A51B9001991CB /* autotiles.cpp in Sources */,
|
||||
3B83DC42256A51B9001991CB /* audiostream.cpp in Sources */,
|
||||
3B83DC43256A51B9001991CB /* binding-util.cpp in Sources */,
|
||||
3B83DC44256A51B9001991CB /* plane-binding.cpp in Sources */,
|
||||
3B83DC45256A51B9001991CB /* gl-meta.cpp in Sources */,
|
||||
3B83DC46256A51B9001991CB /* etc.cpp in Sources */,
|
||||
3B83DC47256A51B9001991CB /* shader.cpp in Sources */,
|
||||
3B83DC48256A51B9001991CB /* tilemap.cpp in Sources */,
|
||||
3B83DC49256A51B9001991CB /* SDL_sound_au.c in Sources */,
|
||||
3B83DC4A256A51B9001991CB /* window.cpp in Sources */,
|
||||
3B83DC4B256A51B9001991CB /* SDL_sound_wav.c in Sources */,
|
||||
3B83DC4C256A51B9001991CB /* input-binding.cpp in Sources */,
|
||||
3B83DC4D256A51B9001991CB /* keybindings.cpp in Sources */,
|
||||
3B83DC4E256A51B9001991CB /* filesystem.cpp in Sources */,
|
||||
3B83DC4F256A51B9001991CB /* binding-mri.cpp in Sources */,
|
||||
3B83DC50256A51B9001991CB /* settingsmenu.cpp in Sources */,
|
||||
3B83DC51256A51B9001991CB /* eventthread.cpp in Sources */,
|
||||
3B83DC52256A51B9001991CB /* viewport.cpp in Sources */,
|
||||
3B83DC53256A51B9001991CB /* gl-debug.cpp in Sources */,
|
||||
3B83DC54256A51B9001991CB /* SDL_sound_vorbis.c in Sources */,
|
||||
3B83DC55256A51B9001991CB /* tileatlasvx.cpp in Sources */,
|
||||
3B83DC56256A51B9001991CB /* bitmap.cpp in Sources */,
|
||||
3B83DC57256A51B9001991CB /* tilemapvx-binding.cpp in Sources */,
|
||||
3B83DC58256A51B9001991CB /* window-binding.cpp in Sources */,
|
||||
3B83DC59256A51B9001991CB /* midisource.cpp in Sources */,
|
||||
3B83DC5A256A51B9001991CB /* graphics-binding.cpp in Sources */,
|
||||
3B83DC5B256A51B9001991CB /* plane.cpp in Sources */,
|
||||
3B83DC5C256A51B9001991CB /* tilequad.cpp in Sources */,
|
||||
3B83DC5D256A51B9001991CB /* SDL_sound_mp3.c in Sources */,
|
||||
3B83DC5E256A51B9001991CB /* SDL_sound_aiff.c in Sources */,
|
||||
3B83DC5F256A51B9001991CB /* tileatlas.cpp in Sources */,
|
||||
3B83DC60256A51B9001991CB /* fluid-fun.cpp in Sources */,
|
||||
3B83DC61256A51B9001991CB /* scene.cpp in Sources */,
|
||||
3B83DC62256A51B9001991CB /* texpool.cpp in Sources */,
|
||||
3B83DC63256A51B9001991CB /* font-binding.cpp in Sources */,
|
||||
3B83DC64256A51B9001991CB /* SDL_sound_coreaudio.c in Sources */,
|
||||
3B83DC65256A51B9001991CB /* audio-binding.cpp in Sources */,
|
||||
3B83DC66256A51B9001991CB /* autotilesvx.cpp in Sources */,
|
||||
3B83DC67256A51B9001991CB /* SDL_sound_voc.c in Sources */,
|
||||
3B83DC68256A51B9001991CB /* vertex.cpp in Sources */,
|
||||
3B83DC69256A51B9001991CB /* miniffi-binding.cpp in Sources */,
|
||||
3B83DC6A256A51B9001991CB /* soundemitter.cpp in Sources */,
|
||||
3B83DC6B256A51B9001991CB /* etc-binding.cpp in Sources */,
|
||||
3B83DC6C256A51B9001991CB /* systemImplApple.mm in Sources */,
|
||||
3B83DC6D256A51B9001991CB /* graphics.cpp in Sources */,
|
||||
3B83DC6E256A51B9001991CB /* font.cpp in Sources */,
|
||||
3B83DC6F256A51B9001991CB /* SDL_sound_flac.c in Sources */,
|
||||
3B83DC70256A51B9001991CB /* SDL_sound_modplug.c in Sources */,
|
||||
3B83DC71256A51B9001991CB /* filesystemImplApple.mm in Sources */,
|
||||
3B83DC72256A51B9001991CB /* fake-api.cpp in Sources */,
|
||||
3B83DC73256A51B9001991CB /* sharedstate.cpp in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
3BA08EA0256641ED00449CFF /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
|
@ -1072,7 +1351,7 @@
|
|||
3B10EDA82568E95E00372D13 /* input.cpp in Sources */,
|
||||
3B10EE022568E96A00372D13 /* tilemap-binding.cpp in Sources */,
|
||||
3B10EDB72568E95E00372D13 /* audio.cpp in Sources */,
|
||||
3B10EDAF2568E95E00372D13 /* main.mm in Sources */,
|
||||
3B10EDAF2568E95E00372D13 /* main.cpp in Sources */,
|
||||
3B10EDB42568E95E00372D13 /* alstream.cpp in Sources */,
|
||||
3B10EDAA2568E95E00372D13 /* table.cpp in Sources */,
|
||||
3B10EE002568E96A00372D13 /* table-binding.cpp in Sources */,
|
||||
|
@ -1105,8 +1384,7 @@
|
|||
3B10ED232568E8F100372D13 /* SDL_sound_wav.c in Sources */,
|
||||
3B10EDF92568E96A00372D13 /* input-binding.cpp in Sources */,
|
||||
3B10EDA92568E95E00372D13 /* keybindings.cpp in Sources */,
|
||||
3B10EDB22568E95E00372D13 /* lang-fun.mm in Sources */,
|
||||
3B10EDAD2568E95E00372D13 /* filesystem.mm in Sources */,
|
||||
3B10EDAD2568E95E00372D13 /* filesystem.cpp in Sources */,
|
||||
3B10EE092568E96A00372D13 /* binding-mri.cpp in Sources */,
|
||||
3B10EDBB2568E95E00372D13 /* settingsmenu.cpp in Sources */,
|
||||
3B10EDA62568E95E00372D13 /* eventthread.cpp in Sources */,
|
||||
|
@ -1136,12 +1414,13 @@
|
|||
3B10EE032568E96A00372D13 /* miniffi-binding.cpp in Sources */,
|
||||
3B10EDB82568E95E00372D13 /* soundemitter.cpp in Sources */,
|
||||
3B10EE012568E96A00372D13 /* etc-binding.cpp in Sources */,
|
||||
3B5A8464256A46B200BAF2E5 /* systemImplApple.mm in Sources */,
|
||||
3B10EDC12568E95E00372D13 /* graphics.cpp in Sources */,
|
||||
3B10EDC02568E95E00372D13 /* font.cpp in Sources */,
|
||||
3B10ED272568E8F100372D13 /* SDL_sound_flac.c in Sources */,
|
||||
3B10ED1E2568E8F100372D13 /* SDL_sound_modplug.c in Sources */,
|
||||
3B5A840D2569BE7C00BAF2E5 /* filesystemImplApple.mm in Sources */,
|
||||
3B10EDB12568E95E00372D13 /* fake-api.mm in Sources */,
|
||||
3B10EDB12568E95E00372D13 /* fake-api.cpp in Sources */,
|
||||
3B10EDAC2568E95E00372D13 /* sharedstate.cpp in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
|
@ -1149,6 +1428,11 @@
|
|||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXTargetDependency section */
|
||||
3B83DC23256A51B9001991CB /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
target = 3BA08EA3256641ED00449CFF /* Assets */;
|
||||
targetProxy = 3B83DC24256A51B9001991CB /* PBXContainerItemProxy */;
|
||||
};
|
||||
3BA08ED3256643AD00449CFF /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
target = 3BA08EA3256641ED00449CFF /* Assets */;
|
||||
|
@ -1157,6 +1441,185 @@
|
|||
/* End PBXTargetDependency section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
3B83DC9C256A51B9001991CB /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 3BDB240A2564715C00C4A63D /* Config.xcconfig */;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
ARCHS = x86_64;
|
||||
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = NO;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_ENABLE_OBJC_WEAK = YES;
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
CODE_SIGN_ENTITLEMENTS = "";
|
||||
CODE_SIGN_IDENTITY = "-";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
CURRENT_PROJECT_VERSION = 2.0;
|
||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||
DEVELOPMENT_ASSET_PATHS = "";
|
||||
DEVELOPMENT_TEAM = "";
|
||||
ENABLE_HARDENED_RUNTIME = NO;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
ENABLE_TESTABILITY = YES;
|
||||
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
|
||||
GCC_C_LANGUAGE_STANDARD = "compiler-default";
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_INPUT_FILETYPE = automatic;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"$(inherited)",
|
||||
EASY_POKE,
|
||||
LEGACY_RUBY,
|
||||
);
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
HEADER_SEARCH_PATHS = "$(inherited)";
|
||||
INFOPLIST_FILE = Info.plist;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/../Frameworks",
|
||||
);
|
||||
LIBRARY_SEARCH_PATHS = "$(inherited)";
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.13;
|
||||
MARKETING_VERSION = 2.0;
|
||||
MRI_VERSION = 1.8.7;
|
||||
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
|
||||
MTL_FAST_MATH = YES;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
OTHER_CFLAGS = (
|
||||
"$(inherited)",
|
||||
"-w",
|
||||
);
|
||||
OTHER_CODE_SIGN_FLAGS = "$(inherited)";
|
||||
OTHER_LDFLAGS = "";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.zoro.mkxpz;
|
||||
PRODUCT_NAME = "mkxp-z";
|
||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||
SDKROOT = macosx;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
3B83DC9D256A51B9001991CB /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 3BDB240A2564715C00C4A63D /* Config.xcconfig */;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
ARCHS = x86_64;
|
||||
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = NO;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_ENABLE_OBJC_WEAK = YES;
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
CODE_SIGN_ENTITLEMENTS = "";
|
||||
CODE_SIGN_IDENTITY = "-";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
CURRENT_PROJECT_VERSION = 2.0;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
DEVELOPMENT_ASSET_PATHS = "";
|
||||
DEVELOPMENT_TEAM = "";
|
||||
ENABLE_HARDENED_RUNTIME = NO;
|
||||
ENABLE_NS_ASSERTIONS = NO;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
|
||||
GCC_C_LANGUAGE_STANDARD = "compiler-default";
|
||||
GCC_INPUT_FILETYPE = automatic;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"$(inherited)",
|
||||
EASY_POKE,
|
||||
LEGACY_RUBY,
|
||||
);
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
HEADER_SEARCH_PATHS = "$(inherited)";
|
||||
INFOPLIST_FILE = Info.plist;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/../Frameworks",
|
||||
);
|
||||
LIBRARY_SEARCH_PATHS = "$(inherited)";
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.13;
|
||||
MARKETING_VERSION = 2.0;
|
||||
MRI_VERSION = 1.8.7;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
MTL_FAST_MATH = YES;
|
||||
OTHER_CFLAGS = (
|
||||
"$(inherited)",
|
||||
"-w",
|
||||
);
|
||||
OTHER_CODE_SIGN_FLAGS = "$(inherited)";
|
||||
OTHER_LDFLAGS = "";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.zoro.mkxpz;
|
||||
PRODUCT_NAME = "mkxp-z";
|
||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||
SDKROOT = macosx;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
3BA08EA7256641EE00449CFF /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
|
@ -1298,6 +1761,7 @@
|
|||
baseConfigurationReference = 3BDB240A2564715C00C4A63D /* Config.xcconfig */;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
ARCHS = x86_64;
|
||||
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
|
@ -1375,13 +1839,11 @@
|
|||
ONLY_ACTIVE_ARCH = YES;
|
||||
OTHER_CFLAGS = (
|
||||
"$(inherited)",
|
||||
"-fconstant-string-class=OFConstantString",
|
||||
"-fno-constant-cfstrings",
|
||||
"-w",
|
||||
);
|
||||
OTHER_CODE_SIGN_FLAGS = "$(inherited)";
|
||||
OTHER_LDFLAGS = "";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.zoro.mkxpz;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "$(inherited)";
|
||||
PRODUCT_NAME = "mkxp-z";
|
||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||
SDKROOT = macosx;
|
||||
|
@ -1393,6 +1855,7 @@
|
|||
baseConfigurationReference = 3BDB240A2564715C00C4A63D /* Config.xcconfig */;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
ARCHS = x86_64;
|
||||
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
|
@ -1467,13 +1930,11 @@
|
|||
MTL_FAST_MATH = YES;
|
||||
OTHER_CFLAGS = (
|
||||
"$(inherited)",
|
||||
"-fconstant-string-class=OFConstantString",
|
||||
"-fno-constant-cfstrings",
|
||||
"-w",
|
||||
);
|
||||
OTHER_CODE_SIGN_FLAGS = "$(inherited)";
|
||||
OTHER_LDFLAGS = "";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.zoro.mkxpz;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "$(inherited)";
|
||||
PRODUCT_NAME = "mkxp-z";
|
||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||
SDKROOT = macosx;
|
||||
|
@ -1508,6 +1969,7 @@
|
|||
);
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.13;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.zoro.mkxpz;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
|
@ -1539,12 +2001,22 @@
|
|||
);
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.13;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.zoro.mkxpz;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
3B83DC9B256A51B9001991CB /* Build configuration list for PBXNativeTarget "LegacyPlayer" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
3B83DC9C256A51B9001991CB /* Debug */,
|
||||
3B83DC9D256A51B9001991CB /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
3BA08EA9256641EE00449CFF /* Build configuration list for PBXNativeTarget "Assets" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
|
|
Binary file not shown.
|
@ -9,6 +9,11 @@
|
|||
<key>orderHint</key>
|
||||
<integer>1</integer>
|
||||
</dict>
|
||||
<key>Player copy.xcscheme_^#shared#^_</key>
|
||||
<dict>
|
||||
<key>orderHint</key>
|
||||
<integer>2</integer>
|
||||
</dict>
|
||||
<key>Player.xcscheme_^#shared#^_</key>
|
||||
<dict>
|
||||
<key>orderHint</key>
|
||||
|
|
38
meson.build
38
meson.build
|
@ -1,14 +1,9 @@
|
|||
project('mkxp-z', 'c', 'cpp', 'objc', 'objcpp', version: '1.3.0', meson_version: '>=0.47.0', default_options: ['cpp_std=c++11', 'buildtype=release'])
|
||||
project('mkxp-z', 'c', 'cpp', version: '1.3.0', meson_version: '>=0.47.0', default_options: ['cpp_std=c++17', 'buildtype=release'])
|
||||
|
||||
xxd = find_program('xxd', native: true)
|
||||
objfw = find_program('objfw-config', native: true)
|
||||
host_system = host_machine.system()
|
||||
|
||||
compilers = {'cpp': meson.get_compiler('cpp'), 'objc': meson.get_compiler('objc'), 'objcpp': meson.get_compiler('objcpp')}
|
||||
|
||||
if compilers['objc'].get_id() != 'clang' or compilers['objcpp'].get_id() != 'clang' or compilers['cpp'].get_id() != 'clang'
|
||||
error('This program must be built with Clang! ( export CC=clang OBJC=clang CXX=clang++ OBJCXX=clang++ )')
|
||||
endif
|
||||
compilers = {'cpp': meson.get_compiler('cpp')}
|
||||
|
||||
global_sources = []
|
||||
global_dependencies = []
|
||||
|
@ -95,7 +90,7 @@ endif
|
|||
|
||||
# Suppress warnings
|
||||
global_args += ['-Wno-non-virtual-dtor', '-Wno-reorder', '-Wno-uninitialized', '-Wno-unknown-pragmas', '-Wno-unknown-warning-option', '-Wno-deprecated-register']
|
||||
if compilers['objc'].get_id() == 'clang'
|
||||
if compilers['cpp'].get_id() == 'clang'
|
||||
global_args += ['-Wno-undefined-var-template', '-Wno-delete-non-abstract-non-virtual-dtor']
|
||||
endif
|
||||
if host_system == 'windows'
|
||||
|
@ -143,22 +138,6 @@ if host_system != 'darwin' or current_macos_version.version_compare('<10.15')
|
|||
global_args += '-DTHREADED_GLINIT'
|
||||
endif
|
||||
|
||||
# Objectify our C
|
||||
global_args += run_command(objfw,'--cppflags').stdout().split()
|
||||
add_project_arguments(run_command(objfw,'--objcflags').stdout().split(), language:['objc','objcpp'])
|
||||
add_project_link_arguments(run_command(objfw,'--libs','--ldflags').stdout().split(), language:['objc','objcpp'])
|
||||
|
||||
# Make sure to use ARC
|
||||
add_project_arguments(run_command(objfw,'--arc').stdout().split(), language:['objc','objcpp'])
|
||||
if host_system != 'darwin'
|
||||
add_project_arguments('-fobjc-runtime=objfw', language:['objc','objcpp'])
|
||||
endif
|
||||
|
||||
# (Fix cquery thinking ObjC headers are C++ headers in VSCode)
|
||||
add_project_arguments('-ObjC', language:'objc')
|
||||
add_project_arguments('-ObjC++', language:'objcpp')
|
||||
|
||||
|
||||
subdir('src')
|
||||
subdir('binding')
|
||||
subdir('shader')
|
||||
|
@ -176,15 +155,12 @@ if host_system == 'windows'
|
|||
elif host_system == 'darwin'
|
||||
subdir('macos')
|
||||
rpath = '@executable_path/../libs'
|
||||
add_project_arguments('-stdlib=libc++', language: ['cpp','objcpp'])
|
||||
add_project_arguments('-std=c++11', language: 'objcpp') # Meson's cpp_std doesn't work on ObjC for some reason
|
||||
add_project_arguments('-stdlib=libc++', language: ['cpp'])
|
||||
if minimum_macos_version != ''
|
||||
add_project_arguments('-mmacosx-version-min='+minimum_macos_version, language: ['cpp', 'objc', 'objcpp'])
|
||||
add_project_link_arguments('-mmacosx-version-min='+minimum_macos_version, language: ['cpp', 'objc', 'objcpp'])
|
||||
endif
|
||||
if minimum_macos_version.version_compare('>=10.13') == true
|
||||
warning('Please consider using the Xcode project located in the `macos` directory instead.')
|
||||
add_project_arguments('-mmacosx-version-min='+minimum_macos_version, language: ['c', 'cpp'])
|
||||
add_project_link_arguments('-mmacosx-version-min='+minimum_macos_version, language: ['c', 'cpp'])
|
||||
endif
|
||||
warning('Please consider using the Xcode project located in the `macos` directory instead.')
|
||||
else
|
||||
subdir('linux')
|
||||
add_project_arguments('-std=c++11', language: 'objcpp')
|
||||
|
|
|
@ -157,7 +157,7 @@
|
|||
// Set the base path of the game to '/path/to/game'
|
||||
// (default: executable directory)
|
||||
//
|
||||
// "gameFolder": "/path/to/game",
|
||||
"gameFolder": "/Users/zoroark/Downloads/Village of Nightmare [English 2.1]",
|
||||
|
||||
|
||||
// Use either right or left Alt + Enter to toggle
|
||||
|
|
|
@ -71,7 +71,7 @@ void Config::read(int argc, char *argv[]) {
|
|||
{"subImageFix", false},
|
||||
{"enableBlitting", true},
|
||||
{"maxTextureSize", 0},
|
||||
{"gameFolder", "."},
|
||||
{"gameFolder", ""},
|
||||
{"anyAltToggleFS", false},
|
||||
{"enableReset", true},
|
||||
{"allowSymlinks", false},
|
||||
|
@ -106,9 +106,14 @@ try { exp } catch (...) {}
|
|||
editor.battleTest = true;
|
||||
}
|
||||
|
||||
if (filesystemImpl::fileExists(CONF_FILE)) {
|
||||
if (mkxp_fs::fileExists(CONF_FILE)) {
|
||||
|
||||
json::value confData = json::parse5(filesystemImpl::contentsOfFileAsString(CONF_FILE));
|
||||
json::value confData = json::value(0);
|
||||
try {
|
||||
confData = json::parse5(mkxp_fs::contentsOfFileAsString(CONF_FILE));
|
||||
} catch (...) {
|
||||
Debug() << "Failed to parse JSON configuration";
|
||||
}
|
||||
|
||||
if (!confData.is_object())
|
||||
confData = json::object({});
|
||||
|
@ -200,11 +205,10 @@ void Config::readGameINI() {
|
|||
|
||||
std::string iniFileName(execName + ".ini");
|
||||
|
||||
if (filesystemImpl::fileExists(iniFileName.c_str())) {
|
||||
ini::INIFile iniFile(iniFileName);
|
||||
if (mkxp_fs::fileExists(iniFileName.c_str())) {
|
||||
ini::INIStructure iniStruct;
|
||||
|
||||
if (!iniFile.read(iniStruct)) {
|
||||
if (!ini::INIFile(iniFileName).read(iniStruct)) {
|
||||
Debug() << "Failed to read INI file" << iniFileName;
|
||||
}
|
||||
else if (!iniStruct.has("Game")){
|
||||
|
|
|
@ -931,11 +931,10 @@ void Bitmap::saveToFile(const char *filename)
|
|||
|
||||
getRaw(surf->pixels, surf->w * surf->h * 4);
|
||||
|
||||
char *fn_normalized = shState->fileSystem().normalize(filename, 1, 1);
|
||||
int rc = SDL_SaveBMP(surf, fn_normalized);
|
||||
std::string fn_normalized = shState->fileSystem().normalize(filename, 1, 1);
|
||||
int rc = SDL_SaveBMP(surf, fn_normalized.c_str());
|
||||
|
||||
SDL_FreeSurface(surf);
|
||||
delete fn_normalized;
|
||||
if (rc) throw new Exception(Exception::SDLError, "%s", SDL_GetError());
|
||||
}
|
||||
|
||||
|
|
|
@ -53,13 +53,9 @@
|
|||
#include <sys/time.h>
|
||||
#include <time.h>
|
||||
|
||||
#ifdef MARIN
|
||||
#define DEF_SCREEN_W 480
|
||||
#define DEF_SCREEN_H 320
|
||||
#else
|
||||
#define DEF_SCREEN_W (rgssVer == 1 ? 640 : 544)
|
||||
#define DEF_SCREEN_H (rgssVer == 1 ? 480 : 416)
|
||||
#endif
|
||||
|
||||
#define DEF_FRAMERATE (rgssVer == 1 ? 40 : 60)
|
||||
|
||||
struct PingPong {
|
||||
|
|
|
@ -19,36 +19,35 @@
|
|||
** along with mkxp. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#import <ObjFW/ObjFW.h>
|
||||
#include "filesystem.h"
|
||||
|
||||
#import "filesystem.h"
|
||||
#include "util/boost-hash.h"
|
||||
#include "util/debugwriter.h"
|
||||
#include "util/exception.h"
|
||||
#include "util/util.h"
|
||||
#include "display/font.h"
|
||||
#include "crypto/rgssad.h"
|
||||
|
||||
#import "boost-hash.h"
|
||||
#import "debugwriter.h"
|
||||
#import "eventthread.h"
|
||||
#import "exception.h"
|
||||
#import "font.h"
|
||||
#import "rgssad.h"
|
||||
#import "sharedstate.h"
|
||||
#import "util.h"
|
||||
#include "eventthread.h"
|
||||
#include "sharedstate.h"
|
||||
|
||||
#import <physfs.h>
|
||||
#include <physfs.h>
|
||||
|
||||
#import <SDL_sound.h>
|
||||
#include <SDL_sound.h>
|
||||
|
||||
#import <algorithm>
|
||||
#import <stack>
|
||||
#import <stdio.h>
|
||||
#import <string.h>
|
||||
#import <unistd.h>
|
||||
#import <vector>
|
||||
#include <algorithm>
|
||||
#include <stack>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <vector>
|
||||
|
||||
#ifdef __APPLE__
|
||||
#import <iconv.h>
|
||||
#include <iconv.h>
|
||||
#endif
|
||||
|
||||
#ifdef __WINDOWS__
|
||||
#import <direct.h>
|
||||
#include <direct.h>
|
||||
#endif
|
||||
|
||||
struct SDLRWIoContext {
|
||||
|
@ -576,10 +575,9 @@ openReadEnumCB(void *d, const char *dirpath, const char *filename) {
|
|||
}
|
||||
|
||||
void FileSystem::openRead(OpenHandler &handler, const char *filename) {
|
||||
char *filename_nm = normalize(filename, false, false);
|
||||
std::string filename_nm = normalize(filename, false, false);
|
||||
char buffer[512];
|
||||
size_t len = strcpySafe(buffer, filename_nm, sizeof(buffer), -1);
|
||||
delete filename_nm;
|
||||
size_t len = strcpySafe(buffer, filename_nm.c_str(), sizeof(buffer), -1);
|
||||
char *delim;
|
||||
|
||||
if (p->havePathCache)
|
||||
|
@ -642,31 +640,9 @@ void FileSystem::openReadRaw(SDL_RWops &ops, const char *filename,
|
|||
// (`Audio/BGM/../../Audio/ME/[file]`)
|
||||
|
||||
// SDL_SaveBMP wants absolute paths
|
||||
char *FileSystem::normalize(const char *pathname, bool preferred,
|
||||
std::string FileSystem::normalize(const char *pathname, bool preferred,
|
||||
bool absolute) {
|
||||
@autoreleasepool {
|
||||
OFMutableString *str = @(pathname).mutableCopy;
|
||||
|
||||
if (absolute && !str.absolutePath) {
|
||||
[str prependString:@"/"];
|
||||
[str prependString:OFFileManager.defaultManager.currentDirectoryPath];
|
||||
}
|
||||
str = str.stringByStandardizingPath.mutableCopy;
|
||||
#ifdef __WINDOWS__
|
||||
if (preferred) {
|
||||
[str replaceOccurrencesOfString:@"/" withString:@"\\"];
|
||||
} else {
|
||||
[str replaceOccurrencesOfString:@"\\" withString:@"/"];
|
||||
}
|
||||
#else
|
||||
[str replaceOccurrencesOfString:@"\\" withString:@"/"];
|
||||
#endif
|
||||
|
||||
[str makeImmutable];
|
||||
char *ret = new char[300];
|
||||
strncpy(ret, str.UTF8String, 300);
|
||||
return ret;
|
||||
};
|
||||
return filesystemImpl::normalizePath(pathname, preferred, absolute);
|
||||
}
|
||||
|
||||
bool FileSystem::exists(const char *filename) {
|
||||
|
@ -674,8 +650,12 @@ bool FileSystem::exists(const char *filename) {
|
|||
}
|
||||
|
||||
const char *FileSystem::desensitize(const char *filename) {
|
||||
OFString *fn_lower = @(filename).lowercaseString;
|
||||
if (p->havePathCache && p->pathCache.contains(fn_lower.UTF8String))
|
||||
return p->pathCache[fn_lower.UTF8String].c_str();
|
||||
std::string fn_lower(filename);
|
||||
|
||||
std::transform(fn_lower.begin(), fn_lower.end(), fn_lower.begin(), [](unsigned char c){
|
||||
return std::tolower(c);
|
||||
});
|
||||
if (p->havePathCache && p->pathCache.contains(fn_lower))
|
||||
return p->pathCache[fn_lower].c_str();
|
||||
return filename;
|
||||
}
|
|
@ -27,6 +27,8 @@
|
|||
|
||||
#include "filesystemImpl.h"
|
||||
|
||||
namespace mkxp_fs = filesystemImpl;
|
||||
|
||||
struct FileSystemPrivate;
|
||||
class SharedFontState;
|
||||
|
||||
|
@ -67,7 +69,7 @@ public:
|
|||
const char *filename,
|
||||
bool freeOnClose = false);
|
||||
|
||||
char *normalize(const char *pathname, bool preferred, bool absolute);
|
||||
std::string normalize(const char *pathname, bool preferred, bool absolute);
|
||||
|
||||
/* Does not perform extension supplementing */
|
||||
bool exists(const char *filename);
|
||||
|
|
|
@ -7,3 +7,33 @@
|
|||
|
||||
#include "filesystemImpl.h"
|
||||
#include <filesystem>
|
||||
#include <unistd.h>
|
||||
|
||||
// TODO
|
||||
bool filesystemImpl::fileExists(const char *path) {
|
||||
assert(!"Not implemented");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// TODO
|
||||
std::string filesystemImpl::contentsOfFileAsString(const char *path) {
|
||||
assert(!"Not implemented");
|
||||
return std::string("");
|
||||
|
||||
}
|
||||
|
||||
// TODO
|
||||
bool filesystemImpl::setCurrentDirectory(const char *path) {
|
||||
return chdir(path);
|
||||
}
|
||||
|
||||
// TODO
|
||||
std::string filesystemImpl::getCurrentDirectory() {
|
||||
return std::string(getcwd(0,0));
|
||||
}
|
||||
|
||||
std::string filesystemImpl::normalizePath(const char *path, bool preferred, bool absolute) {
|
||||
assert(!"Not implemented");
|
||||
return std::string("");
|
||||
}
|
||||
|
|
|
@ -10,11 +10,16 @@
|
|||
|
||||
#include <string>
|
||||
|
||||
class filesystemImpl {
|
||||
public:
|
||||
static bool fileExists(const char *path);
|
||||
namespace filesystemImpl {
|
||||
bool fileExists(const char *path);
|
||||
|
||||
static std::string contentsOfFileAsString(const char *path);
|
||||
std::string contentsOfFileAsString(const char *path);
|
||||
|
||||
bool setCurrentDirectory(const char *path);
|
||||
|
||||
std::string getCurrentDirectory();
|
||||
|
||||
std::string normalizePath(const char *path, bool preferred, bool absolute);
|
||||
|
||||
};
|
||||
#endif /* filesystemImpl_h */
|
||||
|
|
|
@ -9,17 +9,43 @@
|
|||
#import "filesystemImpl.h"
|
||||
#import "exception.h"
|
||||
|
||||
#define PATHTONS(str) [NSFileManager.defaultManager stringWithFileSystemRepresentation:str length:strlen(str)]
|
||||
|
||||
#define NSTOPATH(str) [NSFileManager.defaultManager fileSystemRepresentationWithPath:str]
|
||||
|
||||
bool filesystemImpl::fileExists(const char *path) {
|
||||
return [NSFileManager.defaultManager fileExistsAtPath:@(path) isDirectory: FALSE] == TRUE;
|
||||
NSString *nspath = PATHTONS(path);
|
||||
BOOL isDir;
|
||||
return [NSFileManager.defaultManager fileExistsAtPath:PATHTONS(path) isDirectory: &isDir] && !isDir;
|
||||
}
|
||||
|
||||
|
||||
|
||||
std::string filesystemImpl::contentsOfFileAsString(const char *path) {
|
||||
NSString *fileContents = [NSString stringWithContentsOfFile: @(path)];
|
||||
NSString *fileContents = [NSString stringWithContentsOfFile: PATHTONS(path)];
|
||||
if (fileContents == nil)
|
||||
throw new Exception(Exception::MKXPError, "Failed to locate file at %s", path);
|
||||
throw new Exception(Exception::NoFileError, "Failed to locate file at %s", path);
|
||||
|
||||
return std::string(fileContents.UTF8String);
|
||||
|
||||
}
|
||||
|
||||
|
||||
bool filesystemImpl::setCurrentDirectory(const char *path) {
|
||||
return [NSFileManager.defaultManager changeCurrentDirectoryPath: PATHTONS(path)];
|
||||
}
|
||||
|
||||
std::string filesystemImpl::getCurrentDirectory() {
|
||||
return std::string(NSTOPATH(NSFileManager.defaultManager.currentDirectoryPath));
|
||||
}
|
||||
|
||||
std::string filesystemImpl::normalizePath(const char *path, bool preferred, bool absolute) {
|
||||
NSString *nspath = PATHTONS(path);
|
||||
if (!nspath.isAbsolutePath && absolute) {
|
||||
nspath = [NSURL fileURLWithPath: nspath].URLByStandardizingPath.path;
|
||||
}
|
||||
else {
|
||||
nspath = nspath.stringByStandardizingPath;
|
||||
}
|
||||
return std::string(NSTOPATH(nspath));
|
||||
}
|
||||
|
|
|
@ -72,7 +72,6 @@ static const KbBindingData defaultKbBindings[] =
|
|||
{ SDL_SCANCODE_UP, Input::Up },
|
||||
{ SDL_SCANCODE_DOWN, Input::Down },
|
||||
|
||||
#ifndef MARIN
|
||||
{ SDL_SCANCODE_SPACE, Input::ZL },
|
||||
{ SDL_SCANCODE_RETURN, Input::ZL },
|
||||
{ SDL_SCANCODE_ESCAPE, Input::B },
|
||||
|
@ -84,19 +83,8 @@ static const KbBindingData defaultKbBindings[] =
|
|||
{ SDL_SCANCODE_W, Input::R },
|
||||
{ SDL_SCANCODE_A, Input::X },
|
||||
{ SDL_SCANCODE_S, Input::Y }
|
||||
#else
|
||||
{ SDL_SCANCODE_D, Input::ZL },
|
||||
{ SDL_SCANCODE_F, Input::ZR },
|
||||
{ SDL_SCANCODE_A, Input::L },
|
||||
{ SDL_SCANCODE_S, Input::R },
|
||||
{ SDL_SCANCODE_C, Input::A },
|
||||
{ SDL_SCANCODE_X, Input::B },
|
||||
{ SDL_SCANCODE_Z, Input::X },
|
||||
{ SDL_SCANCODE_V, Input::Y }
|
||||
#endif
|
||||
};
|
||||
|
||||
#ifndef MARIN
|
||||
/* RGSS1 */
|
||||
static const KbBindingData defaultKbBindings1[] =
|
||||
{
|
||||
|
@ -109,14 +97,10 @@ static const KbBindingData defaultKbBindings2[] =
|
|||
{
|
||||
{ SDL_SCANCODE_Z, Input::ZL }
|
||||
};
|
||||
#endif
|
||||
|
||||
static elementsN(defaultKbBindings);
|
||||
|
||||
#ifndef MARIN
|
||||
static elementsN(defaultKbBindings1);
|
||||
static elementsN(defaultKbBindings2);
|
||||
#endif
|
||||
|
||||
static const JsBindingData defaultJsBindings[] =
|
||||
{
|
||||
|
@ -166,14 +150,14 @@ BDescVec genDefaultBindings(const Config &conf)
|
|||
|
||||
for (size_t i = 0; i < defaultKbBindingsN; ++i)
|
||||
defaultKbBindings[i].add(d);
|
||||
#ifndef MARIN
|
||||
|
||||
if (conf.rgssVersion == 1)
|
||||
for (size_t i = 0; i < defaultKbBindings1N; ++i)
|
||||
defaultKbBindings1[i].add(d);
|
||||
else
|
||||
for (size_t i = 0; i < defaultKbBindings2N; ++i)
|
||||
defaultKbBindings2[i].add(d);
|
||||
#endif
|
||||
|
||||
for (size_t i = 0; i < defaultJsBindingsN; ++i)
|
||||
defaultJsBindings[i].add(d);
|
||||
|
||||
|
|
|
@ -22,38 +22,38 @@
|
|||
#ifdef MKXPZ_BUILD_XCODE
|
||||
#include "CocoaHelpers.hpp"
|
||||
#else
|
||||
#import "icon.png.xxd"
|
||||
#include "icon.png.xxd"
|
||||
#endif
|
||||
|
||||
#include <alc.h>
|
||||
|
||||
#import <SDL.h>
|
||||
#import <SDL_image.h>
|
||||
#import <SDL_sound.h>
|
||||
#import <SDL_ttf.h>
|
||||
#include <SDL.h>
|
||||
#include <SDL_image.h>
|
||||
#include <SDL_sound.h>
|
||||
#include <SDL_ttf.h>
|
||||
|
||||
#import <assert.h>
|
||||
#import <string.h>
|
||||
#import <string>
|
||||
#import <unistd.h>
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
#include <string>
|
||||
#include <unistd.h>
|
||||
|
||||
#import "debugwriter.h"
|
||||
#import "eventthread.h"
|
||||
#import "exception.h"
|
||||
#import "gl-debug.h"
|
||||
#import "gl-fun.h"
|
||||
#import "sharedstate.h"
|
||||
#include "binding.h"
|
||||
#include "sharedstate.h"
|
||||
#include "eventthread.h"
|
||||
#include "util/debugwriter.h"
|
||||
#include "util/exception.h"
|
||||
#include "display/gl/gl-debug.h"
|
||||
#include "display/gl/gl-fun.h"
|
||||
|
||||
#import "binding.h"
|
||||
#include "filesystem/filesystem.h"
|
||||
|
||||
#if defined(__WINDOWS__)
|
||||
#import "resource.h"
|
||||
#import <Winsock2.h>
|
||||
#include "resource.h"
|
||||
#include <Winsock2.h>
|
||||
#endif
|
||||
|
||||
#import <ObjFW/ObjFW.h>
|
||||
#ifdef HAVE_STEAMSHIM
|
||||
#import "steamshim_child.h"
|
||||
#include "steamshim_child.h"
|
||||
#endif
|
||||
|
||||
#ifndef THREADED_GLINIT
|
||||
|
@ -110,11 +110,8 @@ int rgssThreadFun(void *userdata) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
@
|
||||
autoreleasepool {
|
||||
/* Start script execution */
|
||||
scriptBinding->execute();
|
||||
}
|
||||
/* Start script execution */
|
||||
scriptBinding->execute();
|
||||
|
||||
threadData->rqTermAck.set();
|
||||
threadData->ethread->requestTerminate();
|
||||
|
@ -168,7 +165,6 @@ static void setupWindowIcon(const Config &conf, SDL_Window *win) {
|
|||
}
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
@autoreleasepool {
|
||||
SDL_SetHint(SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS, "0");
|
||||
SDL_SetHint(SDL_HINT_ACCELEROMETER_AS_JOYSTICK, "0");
|
||||
|
||||
|
@ -186,26 +182,6 @@ int main(int argc, char *argv[]) {
|
|||
showInitError("Error allocating SDL user events");
|
||||
return 0;
|
||||
}
|
||||
/*
|
||||
#ifndef WORKDIR_CURRENT
|
||||
// set working directory
|
||||
char *dataDir{};
|
||||
dataDir = SDL_GetBasePath();
|
||||
if (dataDir)
|
||||
{
|
||||
int result = chdir(dataDir);
|
||||
(void)result;
|
||||
SDL_free(dataDir);
|
||||
}
|
||||
#else
|
||||
#ifdef __linux__
|
||||
dataDir = getenv("OWD");
|
||||
if (!dataDir)
|
||||
#endif
|
||||
#endif
|
||||
*/
|
||||
|
||||
OFFileManager *fm = [OFFileManager defaultManager];
|
||||
|
||||
#ifndef WORKDIR_CURRENT
|
||||
char dataDir[512]{};
|
||||
|
@ -223,10 +199,7 @@ int main(int argc, char *argv[]) {
|
|||
SDL_free(tmp);
|
||||
}
|
||||
}
|
||||
@try {
|
||||
[fm changeCurrentDirectoryPath: [OFString stringWithUTF8String:dataDir ]];
|
||||
} @catch (...) {
|
||||
}
|
||||
mkxp_fs::setCurrentDirectory(dataDir);
|
||||
#endif
|
||||
|
||||
/* now we load the config */
|
||||
|
@ -234,9 +207,9 @@ int main(int argc, char *argv[]) {
|
|||
conf.read(argc, argv);
|
||||
|
||||
if (!conf.gameFolder.empty()) {
|
||||
@try {
|
||||
[fm changeCurrentDirectoryPath: [OFString stringWithUTF8String: conf.gameFolder.c_str()]];
|
||||
} @catch (...) {
|
||||
|
||||
if (!mkxp_fs::setCurrentDirectory(conf.gameFolder.c_str()))
|
||||
{
|
||||
showInitError(std::string("Unable to switch into gameFolder ") +
|
||||
conf.gameFolder);
|
||||
return 0;
|
||||
|
@ -410,11 +383,7 @@ int main(int argc, char *argv[]) {
|
|||
else
|
||||
SDL_ShowSimpleMessageBox(
|
||||
SDL_MESSAGEBOX_ERROR, conf.game.title.c_str(),
|
||||
[OFString
|
||||
stringWithFormat:
|
||||
@"The RGSS script seems to be stuck. %s will now force quit.",
|
||||
conf.game.title.c_str()]
|
||||
.UTF8String,
|
||||
std::string("The RGSS script seems to be stuck. "+conf.game.title+" will now force quit.").c_str(),
|
||||
win);
|
||||
|
||||
if (!rtData.rgssErrorMsg.empty()) {
|
||||
|
@ -448,7 +417,6 @@ int main(int argc, char *argv[]) {
|
|||
SDL_Quit();
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
static SDL_GLContext initGL(SDL_Window *win, Config &conf,
|
|
@ -75,8 +75,8 @@ if get_option('cjk_fallback_font') == true
|
|||
endif
|
||||
|
||||
main_source = files(
|
||||
'main.mm',
|
||||
'config.mm',
|
||||
'main.cpp',
|
||||
'config.cpp',
|
||||
'eventthread.cpp',
|
||||
'settingsmenu.cpp',
|
||||
'sharedstate.cpp',
|
||||
|
@ -120,13 +120,14 @@ main_source = files(
|
|||
'etc/etc.cpp',
|
||||
'etc/table.cpp',
|
||||
|
||||
'filesystem/filesystem.mm',
|
||||
'filesystem/filesystem.cpp',
|
||||
'filesystem/filesystemImpl.cpp',
|
||||
|
||||
'input/input.cpp',
|
||||
'input/keybindings.cpp',
|
||||
|
||||
'system/fake-api.mm',
|
||||
'system/lang-fun.mm'
|
||||
'system/fake-api.cpp',
|
||||
'system/systemImpl.cpp'
|
||||
)
|
||||
|
||||
global_sources += main_source
|
||||
|
|
|
@ -70,18 +70,10 @@ struct VButton
|
|||
BTN_STRING(R),
|
||||
BTN_STRING(A),
|
||||
BTN_STRING(B),
|
||||
#ifdef MARIN
|
||||
BTN_STRING(ZL),
|
||||
#else
|
||||
BTN_STRING_CUSTOM(ZL, "C"),
|
||||
#endif
|
||||
BTN_STRING(X),
|
||||
BTN_STRING(Y),
|
||||
#ifdef MARIN
|
||||
BTN_STRING(ZR),
|
||||
#else
|
||||
BTN_STRING_CUSTOM(ZR, "Z"),
|
||||
#endif
|
||||
};
|
||||
|
||||
static elementsN(vButtons);
|
||||
|
|
374
src/system/fake-api.cpp
Normal file
374
src/system/fake-api.cpp
Normal file
|
@ -0,0 +1,374 @@
|
|||
#ifdef EASY_POKE
|
||||
#include <SDL.h>
|
||||
|
||||
#ifdef __WIN32__
|
||||
#include <SDL_syswm.h>
|
||||
#include <windows.h>
|
||||
#else
|
||||
#include <cstring>
|
||||
#endif
|
||||
|
||||
|
||||
#include "util/mINI.h"
|
||||
#include "eventthread.h"
|
||||
#include "system/fake-api.h"
|
||||
#include "filesystem/filesystem.h"
|
||||
#include "input/input.h"
|
||||
#include "system/system.h"
|
||||
#include "sharedstate.h"
|
||||
|
||||
namespace ini = mINI;
|
||||
|
||||
// Essentials, without edits, needs Win32API. Two problems with that:
|
||||
|
||||
// 1. Not all Win32API functions work here, and
|
||||
// 2. It uses Windows libraries.
|
||||
|
||||
// So, even on Windows, we need to switch out some of those functions
|
||||
// with our own in order to trick the game into doing what we want.
|
||||
|
||||
// On Windows, we just have to worry about functions that involve
|
||||
// thread IDs and window handles mostly. On anything else, every
|
||||
// function that an Essentials game uses has to be impersonated.
|
||||
|
||||
// If you're lucky enough to be using a crossplatform library, you
|
||||
// could just load that since MiniFFI should work anywhere, but
|
||||
// every single system or windows-specific function you use has
|
||||
// to be intercepted.
|
||||
|
||||
// This would also apply if you were trying to load a macOS .dylib
|
||||
// from Windows or a linux .so from macOS. It's just not gonna work,
|
||||
// chief.
|
||||
|
||||
// There's probably not much reason to change this outside of
|
||||
// improving compatibility with games in general, since if you just
|
||||
// want to fix one specific game and you're smart enough to add to
|
||||
// this then you're also smart enough to either use MiniFFI on a
|
||||
// library made for your platform or, better yet, just write the
|
||||
// functionality into MKXP and don't use MiniFFI/Win32API at all.
|
||||
|
||||
// A lot of functions here will probably be bound directly to Ruby
|
||||
// eventually (so that you can just call Graphics.screenshot or
|
||||
// something instead of having to make a messy Win32API call
|
||||
// that *now* has to run entirely different function to even work)
|
||||
|
||||
PREFABI DWORD MKXP_GetCurrentThreadId(void) NOP_VAL(DUMMY_VAL)
|
||||
|
||||
PREFABI DWORD
|
||||
MKXP_GetWindowThreadProcessId(HWND hWnd, LPDWORD lpdwProcessId)
|
||||
NOP_VAL(DUMMY_VAL)
|
||||
|
||||
PREFABI HWND MKXP_FindWindowEx(HWND hWnd, HWND hWndChildAfter,
|
||||
LPCSTR lpszClass, LPCSTR lpszWindow)
|
||||
#ifdef __WIN32__
|
||||
{
|
||||
SDL_SysWMinfo wm;
|
||||
SDL_GetWindowWMInfo(shState->sdlWindow(), &wm);
|
||||
return wm.info.win.window;
|
||||
}
|
||||
#else
|
||||
NOP_VAL((HWND)DUMMY_VAL)
|
||||
#endif
|
||||
|
||||
PREFABI DWORD MKXP_GetForegroundWindow(void) {
|
||||
if (SDL_GetWindowFlags(shState->sdlWindow()) & SDL_WINDOW_INPUT_FOCUS) {
|
||||
return DUMMY_VAL;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
PREFABI BOOL MKXP_GetClientRect(HWND hWnd, LPRECT lpRect) {
|
||||
SDL_GetWindowSize(shState->sdlWindow(), (int *)&lpRect->right,
|
||||
(int *)&lpRect->bottom);
|
||||
return true;
|
||||
}
|
||||
|
||||
// You would think that you could just call GetCursorPos
|
||||
// and ScreenToClient with the window handle and lppoint
|
||||
// and be fine, but nope
|
||||
PREFABI BOOL MKXP_GetCursorPos(LPPOINT lpPoint) {
|
||||
SDL_GetGlobalMouseState((int *)&lpPoint->x, (int *)&lpPoint->y);
|
||||
return true;
|
||||
}
|
||||
|
||||
PREFABI BOOL MKXP_ScreenToClient(HWND hWnd, LPPOINT lpPoint) {
|
||||
lpPoint->x = shState->input().mouseX();
|
||||
lpPoint->y = shState->input().mouseY();
|
||||
return true;
|
||||
}
|
||||
|
||||
PREFABI BOOL MKXP_SetWindowPos(HWND hWnd, HWND hWndInsertAfter, int X, int Y,
|
||||
int cx, int cy, UINT uFlags) {
|
||||
// The game calls resize_screen which will automatically
|
||||
// ... well, resize the screen
|
||||
// shState->eThread().requestWindowResize(cx, cy);
|
||||
|
||||
shState->eThread().requestWindowReposition(X, Y);
|
||||
return true;
|
||||
}
|
||||
|
||||
PREFABI BOOL MKXP_SetWindowTextA(HWND hWnd, LPCSTR lpString) {
|
||||
shState->eThread().requestWindowRename((const char *)lpString);
|
||||
return true;
|
||||
}
|
||||
|
||||
PREFABI BOOL MKXP_GetWindowRect(HWND hWnd, LPRECT lpRect) {
|
||||
int cur_x, cur_y, cur_w, cur_h;
|
||||
SDL_GetWindowPosition(shState->sdlWindow(), &cur_x, &cur_y);
|
||||
SDL_GetWindowSize(shState->sdlWindow(), &cur_w, &cur_h);
|
||||
lpRect->left = cur_x;
|
||||
lpRect->right = cur_x + cur_w + 1;
|
||||
lpRect->top = cur_y;
|
||||
lpRect->bottom = cur_y + cur_h + 1;
|
||||
return true;
|
||||
}
|
||||
|
||||
// Shift key with GetKeyboardState doesn't work for whatever reason,
|
||||
// so Windows needs this too
|
||||
#define ks(sc) shState->eThread().keyStates[SDL_SCANCODE_##sc]
|
||||
PREFABI BOOL MKXP_GetKeyboardState(PBYTE lpKeyState) {
|
||||
#ifdef __WIN32__
|
||||
bool rc = GetKeyboardState(lpKeyState);
|
||||
if (rc) {
|
||||
lpKeyState[VK_LSHIFT] = ks(LSHIFT) << 7;
|
||||
lpKeyState[VK_RSHIFT] = ks(RSHIFT) << 7;
|
||||
lpKeyState[VK_SHIFT] =
|
||||
(lpKeyState[VK_LSHIFT] || lpKeyState[VK_RSHIFT]) ? 0x80 : 0;
|
||||
}
|
||||
return rc;
|
||||
#else
|
||||
for (int i = 254; i > 0; i--) {
|
||||
lpKeyState[i] = (MKXP_GetAsyncKeyState(i)) ? 0x80 : 0;
|
||||
}
|
||||
return true;
|
||||
#endif
|
||||
}
|
||||
|
||||
// =========================================
|
||||
// macOS / Linux only stuff starts here
|
||||
// =========================================
|
||||
|
||||
#ifndef __WIN32__
|
||||
|
||||
PREFABI VOID MKXP_RtlMoveMemory(VOID *Destination, VOID *Source,
|
||||
SIZE_T Length) {
|
||||
// I have no idea if this is a good idea or not
|
||||
// or why it's even necessary in the first place,
|
||||
// getting rid of this is priority #1
|
||||
memcpy(Destination, Source, Length);
|
||||
}
|
||||
|
||||
// I don't know who's more crazy, them for writing this stuff
|
||||
// or me for being willing to put it here.
|
||||
|
||||
// Probably me.
|
||||
|
||||
PREFABI HMODULE MKXP_LoadLibrary(LPCSTR lpLibFileName) {
|
||||
return SDL_LoadObject(lpLibFileName);
|
||||
}
|
||||
|
||||
PREFABI BOOL MKXP_FreeLibrary(HMODULE hLibModule) {
|
||||
SDL_UnloadObject(hLibModule);
|
||||
return true;
|
||||
}
|
||||
|
||||
// Luckily, Essentials only cares about the high-order bit,
|
||||
// so SDL's keystates will work perfectly fine
|
||||
PREFABI SHORT MKXP_GetAsyncKeyState(int vKey) {
|
||||
SHORT result;
|
||||
switch (vKey) {
|
||||
case 0x10: // Any Shift
|
||||
result = (ks(LSHIFT) || ks(RSHIFT)) ? 0x8000 : 0;
|
||||
break;
|
||||
|
||||
case 0x11: // Any Ctrl
|
||||
result = (ks(LCTRL) || ks(RCTRL)) ? 0x8000 : 0;
|
||||
break;
|
||||
|
||||
case 0x12: // Any Alt
|
||||
result = (ks(LALT) || ks(RALT)) ? 0x8000 : 0;
|
||||
break;
|
||||
|
||||
case 0x1: // Mouse button 1
|
||||
result = (SDL_GetMouseState(0, 0) & SDL_BUTTON(1)) ? 0x8000 : 0;
|
||||
break;
|
||||
|
||||
case 0x2: // Mouse button 2
|
||||
result = (SDL_GetMouseState(0, 0) & SDL_BUTTON(3)) ? 0x8000 : 0;
|
||||
break;
|
||||
|
||||
case 0x4: // Middle mouse
|
||||
result = (SDL_GetMouseState(0, 0) & SDL_BUTTON(2)) ? 0x8000 : 0;
|
||||
break;
|
||||
|
||||
default:
|
||||
try {
|
||||
// Use EventThread instead of Input because
|
||||
// Input.update typically gets overridden
|
||||
result = shState->eThread().keyStates[vKeyToScancode[vKey]] << 15;
|
||||
} catch (...) {
|
||||
result = 0;
|
||||
}
|
||||
break;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
#undef ks
|
||||
|
||||
PREFABI BOOL
|
||||
MKXP_GetSystemPowerStatus(LPSYSTEM_POWER_STATUS lpSystemPowerStatus) {
|
||||
int seconds, percent;
|
||||
SDL_PowerState ps;
|
||||
ps = SDL_GetPowerInfo(&seconds, &percent);
|
||||
|
||||
// Setting ACLineStatus
|
||||
if (ps == SDL_POWERSTATE_UNKNOWN) {
|
||||
lpSystemPowerStatus->ACLineStatus = 0xFF;
|
||||
} else {
|
||||
lpSystemPowerStatus->ACLineStatus =
|
||||
(ps == SDL_POWERSTATE_ON_BATTERY) ? 1 : 0;
|
||||
}
|
||||
|
||||
// Setting BatteryFlag
|
||||
if (ps == SDL_POWERSTATE_ON_BATTERY) {
|
||||
if (percent == -1) {
|
||||
lpSystemPowerStatus->BatteryFlag = 0xFF;
|
||||
} else if (percent >= 33) {
|
||||
lpSystemPowerStatus->BatteryFlag = 1;
|
||||
} else if (4 < percent && percent < 33) {
|
||||
lpSystemPowerStatus->BatteryFlag = 2;
|
||||
} else {
|
||||
lpSystemPowerStatus->BatteryFlag = 4;
|
||||
}
|
||||
} else if (ps == SDL_POWERSTATE_CHARGING) {
|
||||
lpSystemPowerStatus->BatteryFlag = 8;
|
||||
} else if (ps == SDL_POWERSTATE_NO_BATTERY) {
|
||||
lpSystemPowerStatus->BatteryFlag = (BYTE)128;
|
||||
} else {
|
||||
lpSystemPowerStatus->BatteryFlag = 0xFF;
|
||||
}
|
||||
|
||||
// Setting BatteryLifePercent
|
||||
lpSystemPowerStatus->BatteryLifePercent =
|
||||
(percent != -1) ? (BYTE)percent : 0xFF;
|
||||
|
||||
// Setting SystemStatusFlag
|
||||
lpSystemPowerStatus->SystemStatusFlag = 0;
|
||||
|
||||
// Setting BatteryLifeTime
|
||||
lpSystemPowerStatus->BatteryLifeTime = seconds;
|
||||
|
||||
// Setting BatteryFullLifeTime
|
||||
lpSystemPowerStatus->BatteryFullLifeTime = -1;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
PREFABI BOOL MKXP_ShowWindow(HWND hWnd, int nCmdShow) NOP_VAL(true);
|
||||
|
||||
// This only currently supports getting screen width/height
|
||||
// Not really motivated to do the other ones when I'll be
|
||||
// extending Ruby at a later time anyway
|
||||
PREFABI int MKXP_GetSystemMetrics(int nIndex) {
|
||||
SDL_DisplayMode dm = {0};
|
||||
int rc = SDL_GetDesktopDisplayMode(
|
||||
SDL_GetWindowDisplayIndex(shState->sdlWindow()), &dm);
|
||||
if (!rc) {
|
||||
switch (nIndex) {
|
||||
case 0:
|
||||
return dm.w;
|
||||
break;
|
||||
|
||||
case 1:
|
||||
return dm.h;
|
||||
break;
|
||||
|
||||
default:
|
||||
return -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
PREFABI HWND MKXP_SetCapture(HWND hWnd) NOP_VAL((HWND)DUMMY_VAL);
|
||||
|
||||
PREFABI BOOL MKXP_ReleaseCapture(void) NOP_VAL(true);
|
||||
|
||||
PREFABI int MKXP_ShowCursor(BOOL bShow) NOP_VAL(DUMMY_VAL);
|
||||
|
||||
PREFABI DWORD MKXP_GetPrivateProfileString(LPCTSTR lpAppName, LPCTSTR lpKeyName,
|
||||
LPCTSTR lpDefault,
|
||||
LPTSTR lpReturnedString, DWORD nSize,
|
||||
LPCTSTR lpFileName) {
|
||||
if (mkxp_fs::fileExists(lpFileName)) {
|
||||
ini::INIStructure data;
|
||||
|
||||
if (ini::INIFile(lpFileName).read(data)) {
|
||||
if (data.has(lpAppName) && data[lpAppName].has(lpKeyName))
|
||||
strncpy(lpReturnedString, data[lpAppName][lpKeyName].c_str(), nSize);
|
||||
} else {
|
||||
strncpy(lpReturnedString, lpDefault, nSize);
|
||||
}
|
||||
}
|
||||
|
||||
return strlen(lpReturnedString);
|
||||
}
|
||||
|
||||
// Does not handle sublanguages, only returns a few
|
||||
// common languages
|
||||
|
||||
// Use MKXP.user_language instead
|
||||
|
||||
PREFABI short // I know it's a LANGID but I don't care
|
||||
MKXP_GetUserDefaultLangID(void) {
|
||||
char buf[50];
|
||||
strncpy(buf, mkxp_sys::getSystemLanguage().c_str(), sizeof(buf));
|
||||
|
||||
for (int i = 0; i < strlen(buf); i++) {
|
||||
if (buf[i] == '_') {
|
||||
buf[i] = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
#define MATCH(l, c) \
|
||||
if (!strcmp(l, buf)) \
|
||||
return (c & 0x3ff);
|
||||
MATCH("ja", 0x11);
|
||||
MATCH("en", 0x09);
|
||||
MATCH("fr", 0x0c);
|
||||
MATCH("it", 0x10);
|
||||
MATCH("de", 0x07);
|
||||
MATCH("es", 0x0a);
|
||||
MATCH("ko", 0x12);
|
||||
MATCH("pt", 0x16);
|
||||
MATCH("zh", 0x04);
|
||||
#undef MATCH
|
||||
return 0x09;
|
||||
}
|
||||
|
||||
PREFABI BOOL MKXP_GetUserName(LPSTR lpBuffer, LPDWORD pcbBuffer) {
|
||||
if (*pcbBuffer < 1)
|
||||
return false;
|
||||
strncpy(lpBuffer, mkxp_sys::getUserName().c_str(), *pcbBuffer);
|
||||
return true;
|
||||
}
|
||||
|
||||
PREFABI BOOL MKXP_RegisterHotKey(HWND hWnd, int id, UINT fsModifiers, UINT vk)
|
||||
NOP_VAL(true);
|
||||
|
||||
PREFABI LONG MKXP_SetWindowLong(HWND hWnd, int nIndex, LONG dwNewLong) {
|
||||
if (nIndex == -16) {
|
||||
if (dwNewLong == 0) {
|
||||
shState->eThread().requestFullscreenMode(true);
|
||||
} else if (dwNewLong == 0x14ca0000) {
|
||||
shState->eThread().requestFullscreenMode(false);
|
||||
}
|
||||
}
|
||||
return DUMMY_VAL;
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
|
@ -1,385 +0,0 @@
|
|||
#ifdef EASY_POKE
|
||||
#import <SDL.h>
|
||||
#ifdef __APPLE__
|
||||
#import <Foundation/Foundation.h>
|
||||
#endif
|
||||
#import <ObjFW/ObjFW.h>
|
||||
|
||||
#ifdef __WIN32__
|
||||
#import <SDL_syswm.h>
|
||||
#import <windows.h>
|
||||
#else
|
||||
#import <cstring>
|
||||
#endif
|
||||
|
||||
#import "eventthread.h"
|
||||
#import "fake-api.h"
|
||||
#import "filesystem.h"
|
||||
#import "input.h"
|
||||
#import "lang-fun.h"
|
||||
#import "sharedstate.h"
|
||||
|
||||
// Essentials, without edits, needs Win32API. Two problems with that:
|
||||
|
||||
// 1. Not all Win32API functions work here, and
|
||||
// 2. It uses Windows libraries.
|
||||
|
||||
// So, even on Windows, we need to switch out some of those functions
|
||||
// with our own in order to trick the game into doing what we want.
|
||||
|
||||
// On Windows, we just have to worry about functions that involve
|
||||
// thread IDs and window handles mostly. On anything else, every
|
||||
// function that an Essentials game uses has to be impersonated.
|
||||
|
||||
// If you're lucky enough to be using a crossplatform library, you
|
||||
// could just load that since MiniFFI should work anywhere, but
|
||||
// every single system or windows-specific function you use has
|
||||
// to be intercepted.
|
||||
|
||||
// This would also apply if you were trying to load a macOS .dylib
|
||||
// from Windows or a linux .so from macOS. It's just not gonna work,
|
||||
// chief.
|
||||
|
||||
// There's probably not much reason to change this outside of
|
||||
// improving compatibility with games in general, since if you just
|
||||
// want to fix one specific game and you're smart enough to add to
|
||||
// this then you're also smart enough to either use MiniFFI on a
|
||||
// library made for your platform or, better yet, just write the
|
||||
// functionality into MKXP and don't use MiniFFI/Win32API at all.
|
||||
|
||||
// A lot of functions here will probably be bound directly to Ruby
|
||||
// eventually (so that you can just call Graphics.screenshot or
|
||||
// something instead of having to make a messy Win32API call
|
||||
// that *now* has to run entirely different function to even work)
|
||||
|
||||
PREFABI DWORD MKXP_GetCurrentThreadId(void) NOP_VAL(DUMMY_VAL)
|
||||
|
||||
PREFABI DWORD
|
||||
MKXP_GetWindowThreadProcessId(HWND hWnd, LPDWORD lpdwProcessId)
|
||||
NOP_VAL(DUMMY_VAL)
|
||||
|
||||
PREFABI HWND MKXP_FindWindowEx(HWND hWnd, HWND hWndChildAfter,
|
||||
LPCSTR lpszClass, LPCSTR lpszWindow)
|
||||
#ifdef __WIN32__
|
||||
{
|
||||
SDL_SysWMinfo wm;
|
||||
SDL_GetWindowWMInfo(shState->sdlWindow(), &wm);
|
||||
return wm.info.win.window;
|
||||
}
|
||||
#else
|
||||
NOP_VAL((HWND)DUMMY_VAL)
|
||||
#endif
|
||||
|
||||
PREFABI DWORD MKXP_GetForegroundWindow(void) {
|
||||
if (SDL_GetWindowFlags(shState->sdlWindow()) & SDL_WINDOW_INPUT_FOCUS) {
|
||||
return DUMMY_VAL;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
PREFABI BOOL MKXP_GetClientRect(HWND hWnd, LPRECT lpRect) {
|
||||
SDL_GetWindowSize(shState->sdlWindow(), (int *)&lpRect->right,
|
||||
(int *)&lpRect->bottom);
|
||||
return true;
|
||||
}
|
||||
|
||||
// You would think that you could just call GetCursorPos
|
||||
// and ScreenToClient with the window handle and lppoint
|
||||
// and be fine, but nope
|
||||
PREFABI BOOL MKXP_GetCursorPos(LPPOINT lpPoint) {
|
||||
SDL_GetGlobalMouseState((int *)&lpPoint->x, (int *)&lpPoint->y);
|
||||
return true;
|
||||
}
|
||||
|
||||
PREFABI BOOL MKXP_ScreenToClient(HWND hWnd, LPPOINT lpPoint) {
|
||||
lpPoint->x = shState->input().mouseX();
|
||||
lpPoint->y = shState->input().mouseY();
|
||||
return true;
|
||||
}
|
||||
|
||||
PREFABI BOOL MKXP_SetWindowPos(HWND hWnd, HWND hWndInsertAfter, int X, int Y,
|
||||
int cx, int cy, UINT uFlags) {
|
||||
// The game calls resize_screen which will automatically
|
||||
// ... well, resize the screen
|
||||
// shState->eThread().requestWindowResize(cx, cy);
|
||||
|
||||
shState->eThread().requestWindowReposition(X, Y);
|
||||
return true;
|
||||
}
|
||||
|
||||
PREFABI BOOL MKXP_SetWindowTextA(HWND hWnd, LPCSTR lpString) {
|
||||
shState->eThread().requestWindowRename((const char *)lpString);
|
||||
return true;
|
||||
}
|
||||
|
||||
PREFABI BOOL MKXP_GetWindowRect(HWND hWnd, LPRECT lpRect) {
|
||||
int cur_x, cur_y, cur_w, cur_h;
|
||||
SDL_GetWindowPosition(shState->sdlWindow(), &cur_x, &cur_y);
|
||||
SDL_GetWindowSize(shState->sdlWindow(), &cur_w, &cur_h);
|
||||
lpRect->left = cur_x;
|
||||
lpRect->right = cur_x + cur_w + 1;
|
||||
lpRect->top = cur_y;
|
||||
lpRect->bottom = cur_y + cur_h + 1;
|
||||
return true;
|
||||
}
|
||||
|
||||
// Shift key with GetKeyboardState doesn't work for whatever reason,
|
||||
// so Windows needs this too
|
||||
#define ks(sc) shState->eThread().keyStates[SDL_SCANCODE_##sc]
|
||||
PREFABI BOOL MKXP_GetKeyboardState(PBYTE lpKeyState) {
|
||||
#ifdef __WIN32__
|
||||
bool rc = GetKeyboardState(lpKeyState);
|
||||
if (rc) {
|
||||
lpKeyState[VK_LSHIFT] = ks(LSHIFT) << 7;
|
||||
lpKeyState[VK_RSHIFT] = ks(RSHIFT) << 7;
|
||||
lpKeyState[VK_SHIFT] =
|
||||
(lpKeyState[VK_LSHIFT] || lpKeyState[VK_RSHIFT]) ? 0x80 : 0;
|
||||
}
|
||||
return rc;
|
||||
#else
|
||||
for (int i = 254; i > 0; i--) {
|
||||
lpKeyState[i] = (MKXP_GetAsyncKeyState(i)) ? 0x80 : 0;
|
||||
}
|
||||
return true;
|
||||
#endif
|
||||
}
|
||||
|
||||
// =========================================
|
||||
// macOS / Linux only stuff starts here
|
||||
// =========================================
|
||||
|
||||
#ifndef __WIN32__
|
||||
|
||||
PREFABI VOID MKXP_RtlMoveMemory(VOID *Destination, VOID *Source,
|
||||
SIZE_T Length) {
|
||||
// I have no idea if this is a good idea or not
|
||||
// or why it's even necessary in the first place,
|
||||
// getting rid of this is priority #1
|
||||
memcpy(Destination, Source, Length);
|
||||
}
|
||||
|
||||
// I don't know who's more crazy, them for writing this stuff
|
||||
// or me for being willing to put it here.
|
||||
|
||||
// Probably me.
|
||||
|
||||
PREFABI HMODULE MKXP_LoadLibrary(LPCSTR lpLibFileName) {
|
||||
return SDL_LoadObject(lpLibFileName);
|
||||
}
|
||||
|
||||
PREFABI BOOL MKXP_FreeLibrary(HMODULE hLibModule) {
|
||||
SDL_UnloadObject(hLibModule);
|
||||
return true;
|
||||
}
|
||||
|
||||
// Luckily, Essentials only cares about the high-order bit,
|
||||
// so SDL's keystates will work perfectly fine
|
||||
PREFABI SHORT MKXP_GetAsyncKeyState(int vKey) {
|
||||
SHORT result;
|
||||
switch (vKey) {
|
||||
case 0x10: // Any Shift
|
||||
result = (ks(LSHIFT) || ks(RSHIFT)) ? 0x8000 : 0;
|
||||
break;
|
||||
|
||||
case 0x11: // Any Ctrl
|
||||
result = (ks(LCTRL) || ks(RCTRL)) ? 0x8000 : 0;
|
||||
break;
|
||||
|
||||
case 0x12: // Any Alt
|
||||
result = (ks(LALT) || ks(RALT)) ? 0x8000 : 0;
|
||||
break;
|
||||
|
||||
case 0x1: // Mouse button 1
|
||||
result = (SDL_GetMouseState(0, 0) & SDL_BUTTON(1)) ? 0x8000 : 0;
|
||||
break;
|
||||
|
||||
case 0x2: // Mouse button 2
|
||||
result = (SDL_GetMouseState(0, 0) & SDL_BUTTON(3)) ? 0x8000 : 0;
|
||||
break;
|
||||
|
||||
case 0x4: // Middle mouse
|
||||
result = (SDL_GetMouseState(0, 0) & SDL_BUTTON(2)) ? 0x8000 : 0;
|
||||
break;
|
||||
|
||||
default:
|
||||
try {
|
||||
// Use EventThread instead of Input because
|
||||
// Input.update typically gets overridden
|
||||
result = shState->eThread().keyStates[vKeyToScancode[vKey]] << 15;
|
||||
} catch (...) {
|
||||
result = 0;
|
||||
}
|
||||
break;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
#undef ks
|
||||
|
||||
PREFABI BOOL
|
||||
MKXP_GetSystemPowerStatus(LPSYSTEM_POWER_STATUS lpSystemPowerStatus) {
|
||||
int seconds, percent;
|
||||
SDL_PowerState ps;
|
||||
ps = SDL_GetPowerInfo(&seconds, &percent);
|
||||
|
||||
// Setting ACLineStatus
|
||||
if (ps == SDL_POWERSTATE_UNKNOWN) {
|
||||
lpSystemPowerStatus->ACLineStatus = 0xFF;
|
||||
} else {
|
||||
lpSystemPowerStatus->ACLineStatus =
|
||||
(ps == SDL_POWERSTATE_ON_BATTERY) ? 1 : 0;
|
||||
}
|
||||
|
||||
// Setting BatteryFlag
|
||||
if (ps == SDL_POWERSTATE_ON_BATTERY) {
|
||||
if (percent == -1) {
|
||||
lpSystemPowerStatus->BatteryFlag = 0xFF;
|
||||
} else if (percent >= 33) {
|
||||
lpSystemPowerStatus->BatteryFlag = 1;
|
||||
} else if (4 < percent && percent < 33) {
|
||||
lpSystemPowerStatus->BatteryFlag = 2;
|
||||
} else {
|
||||
lpSystemPowerStatus->BatteryFlag = 4;
|
||||
}
|
||||
} else if (ps == SDL_POWERSTATE_CHARGING) {
|
||||
lpSystemPowerStatus->BatteryFlag = 8;
|
||||
} else if (ps == SDL_POWERSTATE_NO_BATTERY) {
|
||||
lpSystemPowerStatus->BatteryFlag = (BYTE)128;
|
||||
} else {
|
||||
lpSystemPowerStatus->BatteryFlag = 0xFF;
|
||||
}
|
||||
|
||||
// Setting BatteryLifePercent
|
||||
lpSystemPowerStatus->BatteryLifePercent =
|
||||
(percent != -1) ? (BYTE)percent : 0xFF;
|
||||
|
||||
// Setting SystemStatusFlag
|
||||
lpSystemPowerStatus->SystemStatusFlag = 0;
|
||||
|
||||
// Setting BatteryLifeTime
|
||||
lpSystemPowerStatus->BatteryLifeTime = seconds;
|
||||
|
||||
// Setting BatteryFullLifeTime
|
||||
lpSystemPowerStatus->BatteryFullLifeTime = -1;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
PREFABI BOOL MKXP_ShowWindow(HWND hWnd, int nCmdShow) NOP_VAL(true);
|
||||
|
||||
// This only currently supports getting screen width/height
|
||||
// Not really motivated to do the other ones when I'll be
|
||||
// extending Ruby at a later time anyway
|
||||
PREFABI int MKXP_GetSystemMetrics(int nIndex) {
|
||||
SDL_DisplayMode dm = {0};
|
||||
int rc = SDL_GetDesktopDisplayMode(
|
||||
SDL_GetWindowDisplayIndex(shState->sdlWindow()), &dm);
|
||||
if (!rc) {
|
||||
switch (nIndex) {
|
||||
case 0:
|
||||
return dm.w;
|
||||
break;
|
||||
|
||||
case 1:
|
||||
return dm.h;
|
||||
break;
|
||||
|
||||
default:
|
||||
return -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
PREFABI HWND MKXP_SetCapture(HWND hWnd) NOP_VAL((HWND)DUMMY_VAL);
|
||||
|
||||
PREFABI BOOL MKXP_ReleaseCapture(void) NOP_VAL(true);
|
||||
|
||||
PREFABI int MKXP_ShowCursor(BOOL bShow) NOP_VAL(DUMMY_VAL);
|
||||
|
||||
PREFABI DWORD MKXP_GetPrivateProfileString(LPCTSTR lpAppName, LPCTSTR lpKeyName,
|
||||
LPCTSTR lpDefault,
|
||||
LPTSTR lpReturnedString, DWORD nSize,
|
||||
LPCTSTR lpFileName) {
|
||||
OFString *filePath = [OFString stringWithUTF8String:lpFileName];
|
||||
OFString *ret = 0;
|
||||
if ([OFFileManager.defaultManager fileExistsAtPath:filePath]) {
|
||||
@try {
|
||||
OFINIFile *iniFile = [OFINIFile fileWithPath:filePath];
|
||||
OFINICategory *iniCat =
|
||||
[iniFile categoryForName:[OFString stringWithUTF8String:lpAppName]];
|
||||
ret = [iniCat stringForKey:[OFString stringWithUTF8String:lpKeyName]];
|
||||
} @catch (...) {
|
||||
}
|
||||
}
|
||||
if (ret) {
|
||||
strncpy(lpReturnedString, ret.UTF8String, nSize);
|
||||
} else {
|
||||
strncpy(lpReturnedString, lpDefault, nSize);
|
||||
}
|
||||
return strlen(lpDefault);
|
||||
}
|
||||
|
||||
// Does not handle sublanguages, only returns a few
|
||||
// common languages
|
||||
|
||||
// Use MKXP.user_language instead
|
||||
|
||||
PREFABI short // I know it's a LANGID but I don't care
|
||||
MKXP_GetUserDefaultLangID(void) {
|
||||
char buf[50];
|
||||
strncpy(buf, getUserLanguage(), sizeof(buf));
|
||||
|
||||
for (int i = 0; i < strlen(buf); i++) {
|
||||
if (buf[i] == '_') {
|
||||
buf[i] = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
#define MATCH(l, c) \
|
||||
if (!strcmp(l, buf)) \
|
||||
return (c & 0x3ff);
|
||||
MATCH("ja", 0x11);
|
||||
MATCH("en", 0x09);
|
||||
MATCH("fr", 0x0c);
|
||||
MATCH("it", 0x10);
|
||||
MATCH("de", 0x07);
|
||||
MATCH("es", 0x0a);
|
||||
MATCH("ko", 0x12);
|
||||
MATCH("pt", 0x16);
|
||||
MATCH("zh", 0x04);
|
||||
#undef MATCH
|
||||
return 0x09;
|
||||
}
|
||||
|
||||
PREFABI BOOL MKXP_GetUserName(LPSTR lpBuffer, LPDWORD pcbBuffer) {
|
||||
if (*pcbBuffer < 1)
|
||||
return false;
|
||||
#ifdef __APPLE__
|
||||
strncpy(lpBuffer, NSUserName().UTF8String, *pcbBuffer);
|
||||
#else
|
||||
char *username = getenv("USER");
|
||||
strncpy(lpBuffer, (username) ? username : "ditto", *pcbBuffer);
|
||||
lpBuffer[0] = toupper(lpBuffer[0]);
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
PREFABI BOOL MKXP_RegisterHotKey(HWND hWnd, int id, UINT fsModifiers, UINT vk)
|
||||
NOP_VAL(true);
|
||||
|
||||
PREFABI LONG MKXP_SetWindowLong(HWND hWnd, int nIndex, LONG dwNewLong) {
|
||||
if (nIndex == -16) {
|
||||
if (dwNewLong == 0) {
|
||||
shState->eThread().requestFullscreenMode(true);
|
||||
} else if (dwNewLong == 0x14ca0000) {
|
||||
shState->eThread().requestFullscreenMode(false);
|
||||
}
|
||||
}
|
||||
return DUMMY_VAL;
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
|
@ -1,3 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
const char *getUserLanguage();
|
|
@ -1,84 +0,0 @@
|
|||
#if defined(__WIN32__)
|
||||
|
||||
#import <stdlib.h>
|
||||
#import <windows.h>
|
||||
|
||||
#else
|
||||
#import <locale>
|
||||
|
||||
#ifdef __APPLE__
|
||||
#import <Foundation/Foundation.h>
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#import "lang-fun.h"
|
||||
#import <cstring>
|
||||
#import <string>
|
||||
|
||||
// ======================================================================
|
||||
// https://github.com/wine-mirror/wine/blob/master/dlls/kernel32/locale.c
|
||||
// ======================================================================
|
||||
|
||||
#ifdef __APPLE__
|
||||
/***********************************************************************
|
||||
* get_mac_locale
|
||||
*
|
||||
* Return a locale identifier string reflecting the Mac locale, in a form
|
||||
* that parse_locale_name() will understand. So, strip out unusual
|
||||
* things like script, variant, etc. Or, rather, just construct it as
|
||||
* <lang>[_<country>].UTF-8.
|
||||
*/
|
||||
NSString *get_mac_locale(void) {
|
||||
NSMutableString *mac_locale = [NSMutableString string];
|
||||
|
||||
if (mac_locale != nil) {
|
||||
NSLocale *locale = NSLocale.currentLocale;
|
||||
NSString *lang = locale.languageCode;
|
||||
NSString *country = locale.countryCode;
|
||||
NSString *locale_string;
|
||||
|
||||
if (country != nil)
|
||||
locale_string =
|
||||
[NSString stringWithFormat:[NSString stringWithUTF8String:"%@_%@"],
|
||||
lang, country];
|
||||
else
|
||||
locale_string = [NSString stringWithString:lang];
|
||||
|
||||
[mac_locale appendFormat:[NSString stringWithUTF8String:"%@%@"],
|
||||
locale_string,
|
||||
[NSString stringWithUTF8String:".UTF-8"]];
|
||||
}
|
||||
return mac_locale;
|
||||
}
|
||||
#endif
|
||||
|
||||
const char *getUserLanguage() {
|
||||
static char buf[50] = {0};
|
||||
#if defined(__WIN32__)
|
||||
wchar_t wbuf[50] = {0};
|
||||
LANGID lid = GetUserDefaultLangID();
|
||||
LCIDToLocaleName(lid, wbuf, sizeof(wbuf), 0);
|
||||
wcstombs(buf, wbuf, sizeof(buf));
|
||||
#else
|
||||
strncpy(buf, std::locale("").name().c_str(), sizeof(buf));
|
||||
#ifdef __APPLE__
|
||||
if (!buf[0])
|
||||
strncpy(buf, get_mac_locale().UTF8String, sizeof(buf));
|
||||
#endif
|
||||
#endif
|
||||
|
||||
for (int i = 0; (size_t)i < strlen(buf); i++) {
|
||||
#ifdef __WIN32__
|
||||
if (buf[i] == '-') {
|
||||
buf[i] = '_';
|
||||
#else
|
||||
if (buf[i] == '.') {
|
||||
buf[i] = 0;
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return buf;
|
||||
}
|
20
src/system/system.h
Normal file
20
src/system/system.h
Normal file
|
@ -0,0 +1,20 @@
|
|||
//
|
||||
// system.h
|
||||
// Player
|
||||
//
|
||||
// Created by ゾロアーク on 11/22/20.
|
||||
//
|
||||
|
||||
#ifndef system_h
|
||||
#define system_h
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace systemImpl {
|
||||
std::string getSystemLanguage();
|
||||
std::string getUserName();
|
||||
}
|
||||
|
||||
namespace mkxp_sys = systemImpl;
|
||||
|
||||
#endif /* system_h */
|
56
src/system/systemImpl.cpp
Normal file
56
src/system/systemImpl.cpp
Normal file
|
@ -0,0 +1,56 @@
|
|||
//
|
||||
// systemImpl.cpp
|
||||
// Player
|
||||
//
|
||||
// Created by ゾロアーク on 11/22/20.
|
||||
//
|
||||
|
||||
#include "system.h"
|
||||
|
||||
#if defined(__WIN32__)
|
||||
#include <stdlib.h>
|
||||
#include <windows.h>
|
||||
#else
|
||||
#include <locale>
|
||||
#endif
|
||||
|
||||
#include <cstring>
|
||||
#include <string>
|
||||
|
||||
std::string systemImpl::getSystemLanguage() {
|
||||
static char buf[50] = {0};
|
||||
#if defined(__WIN32__)
|
||||
wchar_t wbuf[50] = {0};
|
||||
LANGID lid = GetUserDefaultLangID();
|
||||
LCIDToLocaleName(lid, wbuf, sizeof(wbuf), 0);
|
||||
wcstombs(buf, wbuf, sizeof(buf));
|
||||
#else
|
||||
strncpy(buf, std::locale("").name().c_str(), sizeof(buf));
|
||||
#endif
|
||||
|
||||
for (int i = 0; (size_t)i < strlen(buf); i++) {
|
||||
#ifdef __WIN32__
|
||||
if (buf[i] == '-') {
|
||||
buf[i] = '_';
|
||||
#else
|
||||
if (buf[i] == '.') {
|
||||
buf[i] = 0;
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
}
|
||||
return std::string(buf);
|
||||
}
|
||||
|
||||
std::string systemImpl::getUserName() {
|
||||
char ret[30];
|
||||
#ifdef __WINDOWS__
|
||||
GetUserName(ret, sizeof(ret));
|
||||
#else
|
||||
char *username = getenv("USER");
|
||||
if (username)
|
||||
strncpy(ret, username, sizeof(ret));
|
||||
#endif
|
||||
return std::string(ret);
|
||||
|
||||
}
|
19
src/system/systemImplApple.mm
Normal file
19
src/system/systemImplApple.mm
Normal file
|
@ -0,0 +1,19 @@
|
|||
//
|
||||
// systemImplApple.m
|
||||
// Player
|
||||
//
|
||||
// Created by ゾロアーク on 11/22/20.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "system.h"
|
||||
|
||||
std::string systemImpl::getSystemLanguage() {
|
||||
NSString *languageCode = NSLocale.currentLocale.languageCode;
|
||||
NSString *countryCode = NSLocale.currentLocale.countryCode;
|
||||
return std::string([NSString stringWithFormat:@"%@_%@", languageCode, countryCode].UTF8String);
|
||||
}
|
||||
|
||||
std::string systemImpl::getUserName() {
|
||||
return std::string(NSUserName().UTF8String);
|
||||
}
|
Loading…
Add table
Reference in a new issue