Prefix mkxp-z preprocessor definitions with MKXPZ_

This commit is contained in:
Struma 2020-12-31 14:50:07 -05:00 committed by Roza
parent f7449ab7e6
commit 7db1c1219e
17 changed files with 67 additions and 65 deletions

View file

@ -67,7 +67,7 @@ extern const char module_rpg3[];
// Scripts to run at some point during Ruby execution
#ifdef EASY_POKE
#ifdef MKXPZ_ESSENTIALS_DEBUG
#ifndef MKXPZ_BUILD_XCODE
#include "EssentialsCompatibility.rb.xxd"
#endif
@ -100,11 +100,11 @@ void graphicsBindingInit();
void fileIntBindingInit();
#ifdef USE_MINIFFI
#ifdef MKXPZ_MINIFFI
void MiniFFIBindingInit();
#endif
#ifdef HAVE_STEAMSHIM
#ifdef MKXPZ_STEAM
void CUSLBindingInit();
#endif
@ -153,11 +153,11 @@ static void mriBindingInit() {
fileIntBindingInit();
#ifdef USE_MINIFFI
#ifdef MKXPZ_MINIFFI
MiniFFIBindingInit();
#endif
#ifdef HAVE_STEAMSHIM
#ifdef MKXPZ_STEAM
CUSLBindingInit();
#endif
@ -595,7 +595,7 @@ static void runRMXPScripts(BacktraceData &btData) {
}
// Can be force-disabled similarly to framerate options
#ifndef NO_PRELOAD_SCRIPTS
#ifndef MKXPZ_NO_PRELOADSCRIPTS
/* Execute preloaded scripts */
for (std::vector<std::string>::const_iterator i = conf.preloadScripts.begin();
i != conf.preloadScripts.end(); ++i)
@ -605,13 +605,13 @@ static void runRMXPScripts(BacktraceData &btData) {
if (exc != Qnil)
return;
#ifdef EASY_POKE
#ifdef MKXPZ_ESSENTIALS_DEBUG
// Used to try and fix Essentials garbage later if it's detected
int minimonsters = 0;
#endif
while (true) {
#if RAPI_FULL < 200 && defined(NO_CONSOLE)
#if RAPI_FULL < 200 && defined(MKXPZ_DISABLE_CONSOLE)
VALUE iostr = rb_str_new2(NULL_IO);
// Sysinit isn't a thing yet, so send io to /dev/null instead
rb_funcall(rb_gv_get("$stderr"), rb_intern("reopen"), 1, iostr);
@ -636,7 +636,7 @@ static void runRMXPScripts(BacktraceData &btData) {
fname = newStringUTF8(buf, len);
btData.scriptNames.insert(buf, scriptName);
#ifdef EASY_POKE
#ifdef MKXPZ_ESSENTIALS_DEBUG
// There is 0 reason for anything other than Essentials to have this class
if (minimonsters == 0 && rb_const_defined(rb_cObject, rb_intern("PokemonMapMetadata")))
minimonsters = 1;
@ -656,7 +656,7 @@ static void runRMXPScripts(BacktraceData &btData) {
}
#endif
if (i + 2 == scriptCount){
#ifdef EASY_POKE
#ifdef MKXPZ_ESSENTIALS_DEBUG
if (minimonsters > 0 && !RTEST(rb_gv_get("Z_NOPOKEFIX"))){
EVALFILE(EssentialsCompatibility);
minimonsters = -1;
@ -796,7 +796,7 @@ static void mriBindingExecute() {
#endif
#if defined(EASY_POKE) && !defined(__WIN32__)
#if defined(MKXPZ_ESSENTIALS_DEBUG) && !defined(__WIN32__)
char *tmpdir = getenv("TMPDIR");
if (tmpdir)
setenv("TEMP", tmpdir, false);

View file

@ -23,7 +23,7 @@
#define BINDING_UTIL_H
#include <ruby.h>
#ifndef LEGACY_RUBY
#ifndef MKXPZ_LEGACY_RUBY
#include <ruby/version.h>
#else
#include <version.h>

View file

@ -1,4 +1,4 @@
#ifdef HAVE_STEAMSHIM
#ifdef MKXPZ_STEAM
#include "binding-util.h"
#include "steamshim_child.h"

View file

@ -273,7 +273,7 @@ void graphicsBindingInit()
_rb_define_module_function(module, "fadein", graphicsFadein);
_rb_define_module_function(module, "snap_to_bitmap", graphicsSnapToBitmap);
_rb_define_module_function(module, "resize_screen", graphicsResizeScreen);
#ifdef EASY_POKE
#ifdef MKXPZ_ESSENTIALS_DEBUG
// The other two are overridden by default, which is super
_rb_define_module_function(module, "mkxp_snap_to_bitmap", graphicsSnapToBitmap);
_rb_define_module_function(module, "mkxp_resize_screen", graphicsResizeScreen);

View file

@ -2,7 +2,7 @@
if get_option('mri_includes') == ''
ver = get_option('mri_version')
if ver.version_compare('<=1.8')
global_args += '-DLEGACY_RUBY'
global_args += '-DMKXPZ_LEGACY_RUBY'
elif ver.version_compare('>=3.0')
global_args += '-fdeclspec'
endif
@ -13,7 +13,7 @@ else
endif
if get_option('no_preload_scripts') == true
add_project_arguments('-DNO_PRELOAD_SCRIPTS', language: ['cpp','objc','objcpp'])
add_project_arguments('-DMKXPZ_NO_PRELOADSCRIPTS', language: ['cpp','objc','objcpp'])
endif
global_include_dirs += include_directories('.')

View file

@ -55,7 +55,7 @@ DEF_ALLOCFUNC_CUSTOMFREE(MiniFFI, SDL_UnloadObject);
#endif
static void *MiniFFI_GetFunctionHandle(void *libhandle, const char *func) {
#ifdef EASY_POKE
#ifdef MKXPZ_ESSENTIALS_DEBUG
#define CAPTURE(n) \
if (!strcmp(#n, func)) \
return (void *)&MKXP_##n

View file

@ -6,7 +6,7 @@
//
// Uncomment this for the Essentials crap
// GCC_PREPROCESSOR_DEFINITIONS = $(inherited) EASY_POKE
// GCC_PREPROCESSOR_DEFINITIONS = $(inherited) MKXPZ_ESSENTIALS_DEBUG
SDK_ROOT = macosx
BUILD_ARCH = x86_64

View file

@ -2920,8 +2920,8 @@
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"$(inherited)",
LEGACY_RUBY,
EASY_POKE,
MKXPZ_LEGACY_RUBY,
MKXPZ_ESSENTIALS_DEBUG,
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
@ -3007,8 +3007,8 @@
GCC_NO_COMMON_BLOCKS = YES;
GCC_PREPROCESSOR_DEFINITIONS = (
"$(inherited)",
LEGACY_RUBY,
EASY_POKE,
MKXPZ_LEGACY_RUBY,
MKXPZ_ESSENTIALS_DEBUG,
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
@ -3671,8 +3671,8 @@
CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
GCC_PREPROCESSOR_DEFINITIONS = (
MKXPZ_BUILD_XCODE,
"ALCDEVICE_STRUCT=ALCdevice",
USE_MINIFFI,
"MKXPZ_ALCDEVICE=ALCdevice",
MKXPZ_MINIFFI,
AL_LIBTYPE_STATIC,
);
HEADER_SEARCH_PATHS = (
@ -3710,8 +3710,8 @@
CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
GCC_PREPROCESSOR_DEFINITIONS = (
MKXPZ_BUILD_XCODE,
"ALCDEVICE_STRUCT=ALCdevice",
USE_MINIFFI,
"MKXPZ_ALCDEVICE=ALCdevice",
MKXPZ_MINIFFI,
AL_LIBTYPE_STATIC,
);
HEADER_SEARCH_PATHS = (
@ -3793,8 +3793,8 @@
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"$(inherited)",
LEGACY_RUBY,
EASY_POKE,
MKXPZ_LEGACY_RUBY,
MKXPZ_ESSENTIALS_DEBUG,
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
@ -3879,8 +3879,8 @@
GCC_NO_COMMON_BLOCKS = YES;
GCC_PREPROCESSOR_DEFINITIONS = (
"$(inherited)",
LEGACY_RUBY,
EASY_POKE,
MKXPZ_LEGACY_RUBY,
MKXPZ_ESSENTIALS_DEBUG,
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
@ -3966,8 +3966,8 @@
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"$(inherited)",
LEGACY_RUBY,
EASY_POKE,
MKXPZ_LEGACY_RUBY,
MKXPZ_ESSENTIALS_DEBUG,
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
@ -4052,8 +4052,8 @@
GCC_NO_COMMON_BLOCKS = YES;
GCC_PREPROCESSOR_DEFINITIONS = (
"$(inherited)",
LEGACY_RUBY,
EASY_POKE,
MKXPZ_LEGACY_RUBY,
MKXPZ_ESSENTIALS_DEBUG,
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;

View file

@ -52,7 +52,7 @@ if steamworks_path != ''
if steamlib.found() == true
global_include_dirs += include_directories('steamshim')
global_args += '-DHAVE_STEAMSHIM'
global_args += '-DMKXPZ_STEAM'
global_sources += 'steamshim/steamshim_child.c'
steamworks = true
endif
@ -82,10 +82,12 @@ endif
global_args += ['-Wno-non-virtual-dtor', '-Wno-reorder', '-Wno-uninitialized', '-Wno-unknown-pragmas', '-Wno-unknown-warning-option', '-Wno-deprecated-register']
if compilers['cpp'].get_id() == 'clang'
global_args += ['-Wno-undefined-var-template', '-Wno-delete-non-abstract-non-virtual-dtor']
global_args += '-masm=intel'
endif
if host_system == 'windows'
global_args += '-Wno-unknown-attributes'
if compilers['cpp'].get_id() != 'clang'
global_args += '-masm=intel'
endif
endif
# Decide whether or not to use MiniFFI
@ -93,7 +95,7 @@ miniffi = get_option('use_miniffi')
if miniffi == true
if win64 != true
miniffi = true
global_args += '-DUSE_MINIFFI'
global_args += '-DMKXPZ_MINIFFI'
else
warning('64-bit MiniFFI is only supported on Linux and macOS.')
warning('To use MiniFFI/Win32API on Windows, target 32-bit.')
@ -107,15 +109,15 @@ if get_option('workdir_current')
endif
if get_option('easypoke') == true and miniffi == true
global_args += '-DEASY_POKE'
global_args += '-DMKXPZ_ESSENTIALS_DEBUG'
endif
if get_option('cxx11_experimental') == true
global_args += '-DUSE_EXPERIMENTAL_FILESYSTEM'
global_args += '-DMKXPZ_EXP_FS'
endif
if not get_option('console')
global_args += '-DNO_CONSOLE'
global_args += '-DMKXPZ_DISABLE_CONSOLE'
endif
if get_option('force32') == true
@ -127,7 +129,7 @@ if get_option('static_executable') == true and host_system == 'windows'
build_static = true
endif
global_args += '-DTHREADED_GLINIT'
global_args += '-DMKXPZ_INIT_GL_LATER'
subdir('src')
subdir('binding')

View file

@ -38,14 +38,14 @@
#include <SDL_ttf.h>
#ifndef MKXPZ_BUILD_XCODE
#ifndef CJK_FALLBACK
#ifndef MKXPZ_CJK_FONT
#include "liberation.ttf.xxd"
#else
#include "wqymicrohei.ttf.xxd"
#endif
#ifndef CJK_FALLBACK
#ifndef MKXPZ_CJK_FONT
#define BUNDLED_FONT liberation
#else
#define BUNDLED_FONT wqymicrohei

View file

@ -44,7 +44,7 @@
#include <SDL_timer.h>
#include <SDL_video.h>
#ifdef HAVE_STEAMSHIM
#ifdef MKXPZ_STEAM
#include "steamshim_child.h"
#endif
@ -569,7 +569,7 @@ Graphics::Graphics(RGSSThreadData *data) {
// emulator-like speedups
// Nothing stops anybody from building with this
// enabled though and I'm not removing this stuff
#ifndef DEFAULT_FRAMERATE
#ifndef MKXPZ_STATIC_FRAMERATE
if (data->config.syncToRefreshrate) {
p->frameRate = data->refreshRate;
p->fpsLimiter.disabled = true;
@ -587,7 +587,7 @@ void Graphics::update() {
p->checkShutDownReset();
p->checkSyncLock();
#ifdef HAVE_STEAMSHIM
#ifdef MKXPZ_STEAM
if (STEAMSHIM_alive())
STEAMSHIM_pump();
#endif

View file

@ -38,7 +38,7 @@
#include <stdint.h>
struct RGSSThreadData;
typedef struct ALCDEVICE_STRUCT ALCdevice;
typedef struct MKXPZ_ALCDEVICE ALCdevice;
struct SDL_Window;
union SDL_Event;

View file

@ -9,7 +9,7 @@
#include "util/exception.h"
#include "util/debugwriter.h"
#ifdef USE_EXPERIMENTAL_FILESYSTEM
#ifdef MKXPZ_EXP_FS
#include <experimental/filesystem>
namespace fs = std::experimental::filesystem;
#else

View file

@ -50,18 +50,18 @@
#include <Winsock2.h>
#endif
#ifdef HAVE_STEAMSHIM
#ifdef MKXPZ_STEAM
#include "steamshim_child.h"
#endif
#ifdef MKXPZ_BUILD_XCODE
#include <Availability.h>
#if __MAC_OS_X_VERSION_MAX_ALLOWED < __MAC_10_15
#define THREADED_GLINIT
#define MKXPZ_INIT_GL_LATER
#endif
#endif
#ifndef THREADED_GLINIT
#ifndef MKXPZ_INIT_GL_LATER
#define GLINIT_SHOWERROR(s) showInitError(s)
#else
#define GLINIT_SHOWERROR(s) rgssThreadError(threadData, s)
@ -87,7 +87,7 @@ static SDL_GLContext initGL(SDL_Window *win, Config &conf,
int rgssThreadFun(void *userdata) {
RGSSThreadData *threadData = static_cast<RGSSThreadData *>(userdata);
#ifdef THREADED_GLINIT
#ifdef MKXPZ_INIT_GL_LATER
threadData->glContext =
initGL(threadData->window, threadData->config, threadData);
if (!threadData->glContext)
@ -223,7 +223,7 @@ int main(int argc, char *argv[]) {
conf.readGameINI();
#ifdef HAVE_STEAMSHIM
#ifdef MKXPZ_STEAM
if (!STEAMSHIM_init()) {
showInitError("Failed to initialize Steamworks. The application cannot "
"continue launching.");
@ -244,7 +244,7 @@ int main(int argc, char *argv[]) {
SDL_GetError());
SDL_Quit();
#ifdef HAVE_STEAMSHIM
#ifdef MKXPZ_STEAM
STEAMSHIM_deinit();
#endif
@ -257,7 +257,7 @@ int main(int argc, char *argv[]) {
IMG_Quit();
SDL_Quit();
#ifdef HAVE_STEAMSHIM
#ifdef MKXPZ_STEAM
STEAMSHIM_deinit();
#endif
@ -271,7 +271,7 @@ int main(int argc, char *argv[]) {
IMG_Quit();
SDL_Quit();
#ifdef HAVE_STEAMSHIM
#ifdef MKXPZ_STEAM
STEAMSHIM_deinit();
#endif
@ -306,7 +306,7 @@ int main(int argc, char *argv[]) {
if (!win) {
showInitError(std::string("Error creating window: ") + SDL_GetError());
#ifdef HAVE_STEAMSHIM
#ifdef MKXPZ_STEAM
STEAMSHIM_deinit();
#endif
return 0;
@ -329,7 +329,7 @@ int main(int argc, char *argv[]) {
IMG_Quit();
SDL_Quit();
#ifdef HAVE_STEAMSHIM
#ifdef MKXPZ_STEAM
STEAMSHIM_deinit();
#endif
return 0;
@ -344,7 +344,7 @@ int main(int argc, char *argv[]) {
EventThread eventThread;
#ifndef THREADED_GLINIT
#ifndef MKXPZ_INIT_GL_LATER
SDL_GLContext glCtx = initGL(win, conf, 0);
#else
SDL_GLContext glCtx = NULL;
@ -413,7 +413,7 @@ int main(int argc, char *argv[]) {
WSACleanup();
#endif
#ifdef HAVE_STEAMSHIM
#ifdef MKXPZ_STEAM
STEAMSHIM_deinit();
#endif
Sound_Quit();

View file

@ -64,7 +64,7 @@ if openal.type_name() == 'pkgconfig'
endif
endif
global_args += '-DALCDEVICE_STRUCT=' + alcdev_struct
global_args += '-DMKXPZ_ALCDEVICE=' + alcdev_struct
global_include_dirs += include_directories('.',
@ -91,11 +91,11 @@ if get_option('shared_fluid') == true
endif
if get_option('default_framerate') == true
add_project_arguments('-DDEFAULT_FRAMERATE', language: 'cpp')
add_project_arguments('-DMKXPZ_STATIC_FRAMERATE', language: 'cpp')
endif
if get_option('cjk_fallback_font') == true
add_project_arguments('-DCJK_FALLBACK', language: 'cpp')
add_project_arguments('-DMKXPZ_CJK_FONT', language: 'cpp')
endif
main_source = files(

View file

@ -1,4 +1,4 @@
#ifdef EASY_POKE
#ifdef MKXPZ_ESSENTIALS_DEBUG
#include <SDL.h>
#ifdef __WIN32__

View file

@ -16,7 +16,7 @@
#define PREFABI
#endif
#ifdef EASY_POKE
#ifdef MKXPZ_ESSENTIALS_DEBUG
#include <stddef.h>
#ifdef __WIN32__