diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index 9c8f371..0000000 --- a/.editorconfig +++ /dev/null @@ -1,5 +0,0 @@ -root=true -[*] -end_of_line = lf -indent_style = tab -indent_size = 4 diff --git a/CMakeLists.txt b/CMakeLists.txt index bcb4096..932d3a6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,7 @@ Project(mkxp) ## Setup options ## -option(SHARED_FLUID "Dynamically link fluidsynth at build time" OFF) +option(MIDI "Enable midi support" ON) option(WORKDIR_CURRENT "Keep current directory on startup" OFF) option(FORCE32 "Force 32bit compile on 64bit OS" OFF) set(BINDING "MRI" CACHE STRING "The Binding Type (MRI, MRUBY, NULL)") @@ -110,7 +110,6 @@ set(MAIN_HEADERS src/flashable.h src/font.h src/input.h - src/iniconfig.h src/plane.h src/scene.h src/sprite.h @@ -125,9 +124,8 @@ set(MAIN_HEADERS src/glstate.h src/quad.h src/tilemap.h - src/tilemap-common.h src/graphics.h - src/gl-debug.h + src/debuglogger.h src/global-ibo.h src/exception.h src/filesystem.h @@ -137,8 +135,6 @@ set(MAIN_HEADERS src/gl-util.h src/util.h src/config.h - src/settingsmenu.h - src/keybindings.h src/tileatlas.h src/sharedstate.h src/al-util.h @@ -155,9 +151,6 @@ set(MAIN_HEADERS src/windowvx.h src/tilemapvx.h src/tileatlasvx.h - src/sharedmidistate.h - src/fluid-fun.h - src/sdl-util.h ) set(MAIN_SOURCE @@ -168,7 +161,6 @@ set(MAIN_SOURCE src/filesystem.cpp src/font.cpp src/input.cpp - src/iniconfig.cpp src/plane.cpp src/scene.cpp src/sprite.cpp @@ -182,11 +174,9 @@ set(MAIN_SOURCE src/tilemap.cpp src/autotiles.cpp src/graphics.cpp - src/gl-debug.cpp + src/debuglogger.cpp src/etc.cpp src/config.cpp - src/settingsmenu.cpp - src/keybindings.cpp src/tileatlas.cpp src/sharedstate.cpp src/gl-fun.cpp @@ -203,46 +193,32 @@ set(MAIN_SOURCE src/tilemapvx.cpp src/tileatlasvx.cpp src/autotilesvx.cpp - src/midisource.cpp - src/fluid-fun.cpp ) -if(WIN32) - list(APPEND MAIN_HEADERS windows/resource.h) - list(APPEND MAIN_SOURCE windows/resource.rc) -endif() - source_group("MKXP Source" FILES ${MAIN_SOURCE} ${MAIN_HEADERS}) ## Setup embedded source ## set(EMBEDDED_INPUT - shader/common.h shader/transSimple.frag shader/trans.frag shader/hue.frag shader/sprite.frag shader/plane.frag - shader/gray.frag shader/bitmapBlit.frag - shader/flatColor.frag shader/simple.frag shader/simpleColor.frag shader/simpleAlpha.frag - shader/simpleAlphaUni.frag shader/flashMap.frag - shader/minimal.vert shader/simple.vert shader/simpleColor.vert shader/sprite.vert shader/tilemap.vert - shader/tilemapvx.vert shader/blur.frag shader/blurH.vert shader/blurV.vert shader/simpleMatrix.vert assets/liberation.ttf - assets/icon.png ) if (RGSS2) @@ -251,10 +227,16 @@ if (RGSS2) ) endif() -if (SHARED_FLUID) - pkg_check_modules(FLUID REQUIRED fluidsynth) +if (MIDI) + pkg_check_modules(MIDI REQUIRED fluidsynth) list(APPEND DEFINES - SHARED_FLUID + MIDI + ) + list(APPEND MAIN_HEADERS + src/sharedmidistate.h + ) + list(APPEND MAIN_SOURCE + src/midisource.cpp ) endif() @@ -294,7 +276,7 @@ source_group("Embedded Source" FILES ${EMBEDDED_INPUT} ${EMBEDDED_SOURCE}) ## Setup binding source ## if (BINDING STREQUAL "MRI") - set(MRIVERSION "2.1" CACHE STRING "Version of MRI to link with") + set(MRIVERSION "2.0" CACHE STRING "Version of MRI to link with") pkg_check_modules(MRI REQUIRED ruby-${MRIVERSION}) list(APPEND DEFINES BINDING_MRI @@ -386,7 +368,6 @@ if(APPLE) list(APPEND PLATFORM_LIBRARIES ${CARBON_LIBRARY} ${IOKIT_LIBRARY} - "-liconv" ) endif() @@ -412,16 +393,14 @@ target_compile_definitions(${PROJECT_NAME} PRIVATE ) target_include_directories(${PROJECT_NAME} PRIVATE src - windows ${SIGCXX_INCLUDE_DIRS} ${PIXMAN_INCLUDE_DIRS} ${PHYSFS_INCLUDE_DIRS} ${SDL2_INCLUDE_DIRS} # Blindly assume other SDL bits are in same directory - ${SDL_SOUND_INCLUDE_DIRS} ${Boost_INCLUDE_DIR} ${MRI_INCLUDE_DIRS} ${VORBISFILE_INCLUDE_DIRS} - ${FLUID_INCLUDE_DIRS} + ${MIDI_INCLUDE_DIRS} ${OPENAL_INCLUDE_DIR} ) @@ -436,7 +415,7 @@ target_link_libraries(${PROJECT_NAME} ${Boost_LIBRARIES} ${MRI_LIBRARIES} ${VORBISFILE_LIBRARIES} - ${FLUID_LIBRARIES} + ${MIDI_LIBRARIES} ${OPENAL_LIBRARY} ${ZLIB_LIBRARY} diff --git a/README.md b/README.md index 5762988..e21e854 100644 --- a/README.md +++ b/README.md @@ -1,19 +1,26 @@ # mkxp -Discord community: https://discord.gg/A8xHE8P -Matrix space: https://matrix.to/#/#rpgmaker:mapleshrine.eu -Further links: https://mapleshrine.eu - -mkxp is a project that seeks to provide a fully open source implementation of the Ruby Game Scripting System (RGSS) interface used in the popular game creation software "RPG Maker XP", "RPG Maker VX" and "RPG Maker VX Ace" (trademark by Enterbrain, Inc.), with focus on Linux. The goal is to be able to run games created with the above software natively without changing a single file. +mkxp is a project that seeks to provide a fully open source implementation of the Ruby Game Scripting System (RGSS) interface used in the popular game creation software "RPG Maker XP" (trademark by Enterbrain, Inc.), with focus on Linux. The goal is to be able to run games created with the above software natively without changing a single file. Experimental support for RPG Maker VX / VX Ace games is present. It is licensed under the GNU General Public License v2+. -## Prebuilt binaries -[**Linux / Windows**](https://www.mapleshrine.eu/releases/) -[**OSX**](https://app.box.com/mkxpmacbuilds) by Ali +## RGSS2 / RGSS3 +Support for these RGSS versions is experimental. A lot is implemented (to the point that you can play the VX Ace sample game, with caveats), but not everything is in place yet. Note that there is no cmake support for building these at the moment. -## Should I use mkxp -mkxp primarily targets technically versed users that are comfortable with Ruby / RGSS, and ideally know how to compile the project themselves. The reason for this is that for most games, due to Win32-API usage, mkxp is simply not a plug-and-play solution, but a building block with which a fully cross-platform version can be created in time. +Missing RGSS2 functionality: + +* Text shadow + +Missing RGSS3 functionality: + +* Text outline +* Movie playback +* F12 reset +* Audio fade-in + +Some other things might be implemented, but simply not bound yet. + +RGSS2 might work a little bit less than 3 because I don't have a VX license and as such am unable to experiment thoroughly on it. ## Bindings Bindings provide the glue code for an interpreted language environment to run game scripts in. Currently there are three bindings: @@ -26,8 +33,6 @@ Matz's Ruby Interpreter, also called CRuby, is the most widely deployed version For a list of differences, see: http://stackoverflow.com/questions/21574/what-is-the-difference-between-ruby-1-8-and-ruby-1-9 -This binding supports RGSS1, RGSS2 and RGSS3. - ### mruby (Lightweight Ruby) Website: https://github.com/mruby/mruby @@ -37,8 +42,6 @@ Due to heavy differences between mruby and MRI as well as lacking modules, runni Some extensions to the standard classes/modules are provided, taking the RPG Maker XP helpfile as a quasi "reference". These include Marshal, File, FileTest and Time. -This binding only supports RGSS1. - **Important:** If you decide to use [mattn's oniguruma regexp gem](https://github.com/mattn/mruby-onig-regexp), don't forget to add `-lonig` to the linker flags to avoid ugly symbol overlaps with libc. ### null @@ -51,32 +54,31 @@ This binding only exists for testing purposes and does nothing (the engine quits * libsigc++ 2.0 * PhysFS (latest hg) * OpenAL -* SDL2* +* SDL2 * SDL2_image * SDL2_ttf -* [my SDL_sound fork](https://github.com/Ancurio/SDL_sound) +* SDL_sound (latest hg, apply provided patches!) * vorbisfile * pixman +* fluidsynth (if midi enabled) * zlib (only ruby bindings) * OpenGL header (alternatively GLES2 with `DEFINES+=GLES2_HEADER`) * libiconv (on Windows, optional with INI_ENCODING) * libguess (optional with INI_ENCODING) -(* For the F1 menu to work correctly under Linux/X11, you need latest hg + [this patch](https://bugzilla.libsdl.org/show_bug.cgi?id=2745)) - mkxp employs Qt's qmake build system, so you'll need to install that beforehand. Alternatively, you can build with cmake (FIXME: add cmake instructions). qmake will use pkg-config to locate the respective include/library paths. If you installed any dependencies into non-standard prefixes, make sure to adjust your `PKG_CONFIG_PATH` variable accordingly. The exception is boost, which is weird in that it still hasn't managed to pull off pkg-config support (seriously?). *If you installed boost in a non-standard prefix*, you will need to pass its include path via `BOOST_I` and library path via `BOOST_L`, either as direct arguments to qmake (`qmake BOOST_I="/usr/include" ...`) or via environment variables. You can specify a library suffix (eg. "-mt") via `BOOST_LIB_SUFFIX` if needed. -Midi support is enabled by default and requires fluidsynth to be present at runtime (not needed for building); if mkxp can't find it at runtime, midi playback is disabled. It looks for `libfluidsynth.so.1` on Linux, `libfluidsynth.dylib.1` on OSX and `fluidsynth.dll` on Windows, so make sure to have one of these in your link path. If you still need fluidsynth to be hard linked at buildtime, use `CONFIG+=SHARED_FLUID`. When building fluidsynth yourself, you can disable almost all options (audio drivers etc.) as they are not used. Note that upstream fluidsynth has support for sharing soundfont data between synthesizers (mkxp uses multiple synths), so if your memory usage is very high, you might want to try compiling fluidsynth from git master. +Midi support is enabled by default; you can disable it via `qmake CONFIG+=DISABLE_MIDI`, in which case the fluidsynth dependency is dropped. When building fluidsynth yourself, you can disable almost all options (audio drivers etc.) as they are not used. Note that upstream fluidsynth has support for sharing soundfont data between synthesizers (mkxp uses multiple synths), so if your memory usage is very high, you might want to try compiling fluidsynth from git master. By default, mkxp switches into the directory where its binary is contained and then starts reading the configuration and resolving relative paths. In case this is undesired (eg. when the binary is to be installed to a system global, read-only location), it can be turned off by adding `DEFINES+=WORKDIR_CURRENT` to qmake's arguments. To auto detect the encoding of the game title in `Game.ini` and auto convert it to UTF-8, build with `CONFIG+=INI_ENCODING`. Requires iconv implementation and libguess. If the encoding is wrongly detected, you can set the "titleLanguage" hint in mkxp.conf. -**MRI-Binding**: pkg-config will look for `ruby-2.1.pc`, but you can override the version with `MRIVERSION=2.2` ('2.2' being an example). This is the default binding, so no arguments to qmake needed (`BINDING=MRI` to be explicit). +**MRI-Binding**: pkg-config will look for `ruby-2.1.pc`, but you can modify mkxp.pro to use 2.0 instead. This is the default binding, so no arguments to qmake needed (`BINDING=MRI` to be explicit). **MRuby-Binding**: place the "mruby" folder into the project folder and build it first. Add `BINDING=MRUBY` to qmake's arguments. @@ -87,10 +89,6 @@ These depend on the SDL auxiliary libraries. For maximum RGSS compliance, build To run mkxp, you should have a graphics card capable of at least **OpenGL (ES) 2.0** with an up-to-date driver installed. -## Dependency kit - -To facilitate hacking, I have assembled a package containing all dependencies to compile mkxp on a bare-bones Ubuntu 12.04 64bit installation. Compatibility with other distributions has not been tested. You can download it [here](https://mapleshrine.eu/depkits/linux64.tar.xz). Read the "README" for instructions. - ## Configuration mkxp reads configuration data from the file "mkxp.conf". The format is ini-style. Do *not* use quotes around file paths (spaces won't break). Lines starting with '#' are comments. See 'mkxp.conf.sample' for a list of accepted entries. @@ -101,11 +99,13 @@ The syntax is: `--