diff --git a/CMakeLists.txt b/CMakeLists.txt index 15dacc7d..dbe6ceb5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,7 +35,6 @@ pkg_check_modules(SDL2_TTF REQUIRED SDL2_ttf) pkg_check_modules(SDL2_IMAGE REQUIRED SDL2_image) pkg_check_modules(SDL_SOUND REQUIRED SDL_sound) pkg_check_modules(MRI REQUIRED ruby-3.1) -pkg_check_modules(ZMQPP REQUIRED libzmqpp) pkg_check_modules(OGG REQUIRED ogg) pkg_check_modules(SPEEX REQUIRED speex) pkg_check_modules(MODPLUG REQUIRED libmodplug) @@ -127,8 +126,6 @@ set(MAIN_HEADERS src/oneshot.h src/pipe.h src/i18n.h - src/otherview-message.h - src/crash-handler.h ) set(MAIN_SOURCE @@ -183,8 +180,6 @@ set(MAIN_SOURCE src/sharedstate.cpp src/oneshot.cpp src/i18n.cpp - src/otherview-message.cpp - src/crash-handler.cpp ) if(WIN32) @@ -339,7 +334,6 @@ set(BINDING_SOURCE binding-mri/niko-binding.cpp binding-mri/modshot-window-binding.cpp binding-mri/aleffect-binding.cpp - binding-mri/otherview-binding.cpp binding-mri/screen-binding.cpp binding-mri/display-binding.cpp ) @@ -385,7 +379,6 @@ target_include_directories(${PROJECT_NAME} PRIVATE ${VORBISFILE_INCLUDE_DIRS} ${FLUID_INCLUDE_DIRS} ${OPENAL_INCLUDE_DIR} - ${ZMQPP_INCLUDE_DIRS} ) target_link_libraries(${PROJECT_NAME} @@ -402,7 +395,6 @@ target_link_libraries(${PROJECT_NAME} ${FLUID_LIBRARIES} ${OPENAL_LIBRARY} ${ZLIB_LIBRARY} - ${ZMQPP_LIBRARIES} ${OGG_LIBRARIES} ${SPEEX_LIBRARIES} diff --git a/README.md b/README.md index ede31b2a..d20db260 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,7 @@ -# OSFM-Core-Public -[![Build ModShot Ubuntu](https://github.com/Speak2Erase/OSFM-Core-Public/actions/workflows/build-ubuntu.yml/badge.svg)](https://github.com/Speak2Erase/OSFM-Core-Public/actions/workflows/build-ubuntu.yml)[![Build ModShot Windows](https://github.com/Speak2Erase/OSFM-Core-Public/actions/workflows/build-windows.yml/badge.svg)](https://github.com/Speak2Erase/OSFM-Core-Public/actions/workflows/build-windows.yml) ---- +# ModShot-Core +[![Build ModShot Ubuntu ](https://github.com/Astrabit-ST/ModShot-Core/actions/workflows/build-ubuntu.yml/badge.svg)](https://github.com/Astrabit-ST/ModShot-Core/actions/workflows/build-ubuntu.yml)[![Build ModShot Windows](https://github.com/Astrabit-ST/ModShot-Core/actions/workflows/build-windows.yml/badge.svg)](https://github.com/Astrabit-ST/ModShot-Core/actions/workflows/build-windows.yml) -This is a even more MORE specialized fork of a specialized fork of [OSFM-Public-Core by Speak2Erase](https://github.com/Speak2Erase/OSFM-Core-Public) ([mkxp by Ancurio](https://github.com/Ancurio/mkxp) designed for [*OneShot*](http://oneshot-game.com/)) for OneShot mods. +This is a even more MORE specialized fork of a specialized fork of ([mkxp by Ancurio](https://github.com/Ancurio/mkxp) designed for [*OneShot*](http://oneshot-game.com/)) for OneShot mods. Thanks to [hunternet93](https://github.com/hunternet93) for starting the reimplementation of the journal program! diff --git a/binding-mri/binding-mri.cpp b/binding-mri/binding-mri.cpp index 9b5cd89a..188c7fdc 100644 --- a/binding-mri/binding-mri.cpp +++ b/binding-mri/binding-mri.cpp @@ -32,8 +32,6 @@ #include "boost-hash.h" #include "version.h" -#include "otherview-message.h" - #include #include #undef inline @@ -87,7 +85,6 @@ void oneshotBindingInit(); void steamBindingInit(); void modshotwindowBindingInit(); void aleffectBindingInit(); -void otherviewBindingInit(); void screenBindingInit(); RB_METHOD(mriPrint); RB_METHOD(mriP); @@ -126,7 +123,6 @@ static void mriBindingInit() steamBindingInit(); modshotwindowBindingInit(); aleffectBindingInit(); - otherviewBindingInit(); screenBindingInit(); rb_define_global_const("MODSHOT_VERSION", rb_str_new_cstr(MODSHOT_VERSION)); if (rgssVer >= 3) @@ -445,7 +441,6 @@ static void runRMXPScripts(BacktraceData &btData) /* Set the debug flag */ rb_gv_set("$debug", conf.debugMode ? Qtrue : Qfalse); - rb_gv_set("$otherview", conf.isOtherView ? Qtrue : Qfalse); rb_gv_set("$RGSS_SCRIPTS", scriptArray); diff --git a/binding-mri/meson.build b/binding-mri/meson.build index cd4aa5e7..66adb478 100644 --- a/binding-mri/meson.build +++ b/binding-mri/meson.build @@ -36,7 +36,6 @@ binding_source = [files( 'viewport-binding.cpp', 'wallpaper-binding.cpp', 'window-binding.cpp', - 'otherview-binding.cpp', )] global_sources += binding_source diff --git a/binding-mri/otherview-binding.cpp b/binding-mri/otherview-binding.cpp deleted file mode 100644 index bf2c1b41..00000000 --- a/binding-mri/otherview-binding.cpp +++ /dev/null @@ -1,33 +0,0 @@ -#include "binding-util.h" -#include "binding-types.h" -#include "sharedstate.h" -#include "eventthread.h" -#include "otherview-message.h" -#include "debugwriter.h" - -RB_METHOD(sendMessage) -{ - OtherViewMessager &messager = shState->otherView(); - - const char* message; - rb_get_args(argc, argv, "z", &message RB_ARG_END); - Debug() << "Sending message: " << message; - - bool ret = messager.sendMsg(message); - - return rb_bool_new(ret); -} -RB_METHOD(readMessage) -{ - OtherViewMessager &messager = shState->otherView(); - VALUE rtn = rb_str_new_cstr(messager.getMsg().c_str()); - return rtn; -} - - -void otherviewBindingInit() -{ - VALUE module = rb_define_module("OtherView"); - _rb_define_module_function(module, "send", sendMessage); - _rb_define_module_function(module, "read", readMessage); -} \ No newline at end of file diff --git a/linux/Makefile b/linux/Makefile index 619b8251..bb203768 100644 --- a/linux/Makefile +++ b/linux/Makefile @@ -87,35 +87,6 @@ $(DOWNLOADS)/ruby/configure: $(DOWNLOADS)/ruby/*.c $(DOWNLOADS)/ruby/*.c: $(CLONE) $(GITHUB)/ruby/ruby $(DOWNLOADS)/ruby -b ruby_$(RUBY_BRANCH); -libzmq: init_dirs $(LIBDIR)/libzmq.so - -$(LIBDIR)/libzmq.so: $(DOWNLOADS)/libzmq/Makefile - cd $(DOWNLOADS)/libzmq; \ - make -j$(NPROC); make install - -$(DOWNLOADS)/libzmq/Makefile: $(DOWNLOADS)/libzmq/configure - cd $(DOWNLOADS)/libzmq; \ - $(CONFIGURE) - -$(DOWNLOADS)/libzmq/configure: $(DOWNLOADS)/libzmq/autogen.sh - cd $(DOWNLOADS)/libzmq; ./autogen.sh - -$(DOWNLOADS)/libzmq/autogen.sh: - $(CLONE) $(GITHUB)/zeromq/libzmq $(DOWNLOADS)/libzmq - -zmqpp: init_dirs libzmq $(LIBDIR)/libzmqpp.so - -$(LIBDIR)/libzmqpp.so: ${DOWNLOADS}/zmqpp/cmakebuild/Makefile - cd ${DOWNLOADS}/zmqpp/cmakebuild; \ - make -j${NPROC}; make install - -$(DOWNLOADS)/zmqpp/cmakebuild/Makefile: $(DOWNLOADS)/zmqpp/CMakeLists.txt - cd $(DOWNLOADS)/zmqpp; mkdir -p cmakebuild; cd cmakebuild; \ - $(CMAKE) - -$(DOWNLOADS)/zmqpp/CMakeLists.txt: - $(CLONE) $(GITHUB)/somedevfox/zmqpp $(DOWNLOADS)/zmqpp - libnsgif: init_dirs ${LIBDIR}/libnsgif.so $(LIBDIR)/libnsgif.so: $(DOWNLOADS)/libnsgif/Makefile @@ -141,5 +112,5 @@ powerwash: clean-downloads clean-downloads: -rm -rf downloads -deps-core: sdlsound iconv libzmq zmqpp libnsgif +deps-core: sdlsound iconv libnsgif everything: deps-core ruby diff --git a/linux/install.sh b/linux/install.sh index 738027af..1569d28c 100644 --- a/linux/install.sh +++ b/linux/install.sh @@ -47,7 +47,7 @@ copy_dependencies $BINARY $BINARY echo "Copying standard library..." cp -ar "$RUBY_LIB_DIR/$RUBY_VER.0" "$DESTDIR/ruby" echo "Downloading cacert.pem..." -curl -o "$DESTDIR/cacert.pem" https://curl.haxx.se/ca/cacert.pem +curl -o "$DESTDIR/cacert.pem" https://curl.se/ca/cacert.pem echo "Sym-linking modshot..." ln -sf "$DESTDIR/lmodshot" $BINARY echo "Done!" \ No newline at end of file diff --git a/src/config.cpp b/src/config.cpp index 5c154bac..c7e01971 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -97,7 +97,6 @@ void Config::read(int argc, char *argv[]) PO_DESC(SE.sourceCount, int, 6) \ PO_DESC(audioChannels, int, 30) \ PO_DESC(pathCache, bool, true) \ - PO_DESC(isOtherView, bool, false) \ // Not gonna take your shit boost #define GUARD_ALL( exp ) try { exp } catch(...) {} @@ -179,7 +178,7 @@ void Config::read(int argc, char *argv[]) SE.sourceCount = clamp(SE.sourceCount, 1, 64); - commonDataPath = prefPath(".", "OSFM"); + commonDataPath = prefPath(".", "OneShot"); //Hardcode some ini/version settings rgssVersion = 1; diff --git a/src/config.h b/src/config.h index 315dcbee..67ab04d5 100644 --- a/src/config.h +++ b/src/config.h @@ -52,7 +52,6 @@ struct Config bool subImageFix; bool enableBlitting; int maxTextureSize; - bool isOtherView; std::string gameFolder; bool allowSymlinks; diff --git a/src/eventthread.cpp b/src/eventthread.cpp index 36fd359e..7daaaad6 100644 --- a/src/eventthread.cpp +++ b/src/eventthread.cpp @@ -46,7 +46,6 @@ #include -#include "otherview-message.h" #define KEYCODE_TO_SCUFFEDCODE(keycode) (((keycode & 0xff) | ((keycode & 0x180) == 0x100 ? 0x180 : 0)) + SDL_NUM_SCANCODES) @@ -200,7 +199,7 @@ void EventThread::process(RGSSThreadData &rtData) break; } #endif - + if (sMenu && sMenu->onEvent(event, joysticks)) { if (sMenu->destroyReq()) @@ -677,7 +676,6 @@ void EventThread::cleanup() if ((event.type - usrIdStart) == REQUEST_MESSAGEBOX) free(event.user.data1); - shState->otherView().close(); // Bad place to do this but I don't care } void EventThread::resetInputStates() diff --git a/src/meson.build b/src/meson.build index 9f705217..1d30907f 100644 --- a/src/meson.build +++ b/src/meson.build @@ -16,8 +16,6 @@ jpeg = dependency('libjpeg', static: build_static) tiff = dependency('libtiff-4', static: build_static) webp = dependency('libwebp', static: build_static) zlib = dependency('zlib', static: build_static) -libzmq = dependency('libzmq') -zmqpp = dependency('libzmqpp', static: build_static) nsgif = dependency('libnsgif', static: build_static) if host_system == 'windows' @@ -53,7 +51,8 @@ global_include_dirs += include_directories('.', 'opengl/headers' ) -global_dependencies += [boost, bz2, openal, zlib, sdl2, sdl_sound, pixman, physfs, vorbisfile, vorbis, iconv, ogg, sdl2_ttf, sigcxx, sdl2_image, png, jpeg, libzmq, zmqpp, nsgif, freetype, tiff, webp] +global_dependencies += [boost, bz2, openal, zlib, sdl2, sdl_sound, pixman, physfs, vorbisfile, vorbis, iconv, ogg, sdl2_ttf, sigcxx, sdl2_image, png, jpeg, nsgif, freetype, tiff, webp] + if host_system == 'windows' global_dependencies += compilers['cpp'].find_library('wsock32') global_dependencies += compilers['cpp'].find_library('winmm') @@ -102,7 +101,6 @@ main_source = files( 'sharedstate.cpp', 'oneshot.cpp', 'i18n.cpp', - 'otherview-message.cpp', 'crash-handler.cpp' ) diff --git a/src/oneshot.cpp b/src/oneshot.cpp index ea1933aa..6fd206ee 100644 --- a/src/oneshot.cpp +++ b/src/oneshot.cpp @@ -619,4 +619,4 @@ void Oneshot::resetObscured() std::fill(p->obscuredMap.begin(), p->obscuredMap.end(), 255); obscuredDirty = true; p->obscuredCleared = false; -} +} \ No newline at end of file diff --git a/src/otherview-message.cpp b/src/otherview-message.cpp deleted file mode 100644 index d2af0328..00000000 --- a/src/otherview-message.cpp +++ /dev/null @@ -1,83 +0,0 @@ -#include "otherview-message.h" -#include -#include "config.h" -#include "debugwriter.h" - -OtherViewMessager::OtherViewMessager(const Config &c): - conf(c) -{ - Debug() << "Setting up otheview"; - isOtherView = c.isOtherView; - otherViewEndpoint = "tcp://127.0.0.1:9697"; - normalEndpoint = "tcp://127.0.0.1:7536"; - - Debug() << "Setting up contexts"; - if (isOtherView) { - otherview_socket_type = zmqpp::socket_type::push; - normal_socket_type = zmqpp::socket_type::pull; - } else { - otherview_socket_type = zmqpp::socket_type::pull; - normal_socket_type = zmqpp::socket_type::push; - } - - otherview_socket = new zmqpp::socket (otherview_context, otherview_socket_type); - normal_socket = new zmqpp::socket (normal_context, normal_socket_type); - - Debug() << "Attempting to connect to otherview at " << otherViewEndpoint; - Debug() << "Attempting to connect to normal at " << normalEndpoint; - if (isOtherView) { - otherview_socket->connect(otherViewEndpoint); - normal_socket->connect(normalEndpoint); - } else { - otherview_socket->bind(otherViewEndpoint); - normal_socket->bind(normalEndpoint); - } -} - -bool OtherViewMessager::sendMsg(const char* string) -{ - zmqpp::message message; - message << string; - bool ret; - if (isOtherView) { - ret = otherview_socket->send(message, true); - } else { - ret = normal_socket->send(message, true); - } - //Debug() << "Sent message: "; - //Debug() << string; - //Debug() << ret; - - return ret; -} - -std::string OtherViewMessager::getMsg() -{ - zmqpp::message message; - std::string response; - bool ret; - if (isOtherView) { - ret = normal_socket->receive(message, true); - } else { - ret = otherview_socket->receive(message, true); - } - if (ret) { - message >> response; - } else { - response = ""; - } - //Debug() << "Received message: "; - //Debug() << response; - //Debug() << ret; - return response; -} - -void OtherViewMessager::close() -{ - Debug() << "Closing sockets"; - otherview_socket->close(); - normal_socket->close(); - Debug() << "Deleting sockets"; - delete(otherview_socket); - delete(normal_socket); -} \ No newline at end of file diff --git a/src/otherview-message.h b/src/otherview-message.h deleted file mode 100644 index 2d6720cd..00000000 --- a/src/otherview-message.h +++ /dev/null @@ -1,25 +0,0 @@ -#include "etc.h" -#include -#include - -struct Config; - -class OtherViewMessager { - const Config &conf; - bool isOtherView; - std::string otherViewEndpoint; - std::string normalEndpoint; - - zmqpp::context otherview_context; - zmqpp::context normal_context; - zmqpp::socket_type otherview_socket_type; - zmqpp::socket_type normal_socket_type; - - zmqpp::socket *otherview_socket; - zmqpp::socket *normal_socket; -public: - OtherViewMessager(const Config &c); - bool sendMsg(const char* message); - std::string getMsg(); - void close(); -}; \ No newline at end of file diff --git a/src/sharedstate.cpp b/src/sharedstate.cpp index 499829e5..70f15133 100644 --- a/src/sharedstate.cpp +++ b/src/sharedstate.cpp @@ -40,7 +40,6 @@ #include "quad.h" #include "binding.h" #include "exception.h" -#include "otherview-message.h" #ifndef _MSC_VER #include @@ -94,8 +93,6 @@ struct SharedStatePrivate unsigned int stampCounter; - OtherViewMessager otherView; - SharedStatePrivate(RGSSThreadData *threadData) : bindingData(0), sdlWindow(threadData->window), @@ -109,8 +106,7 @@ struct SharedStatePrivate oneshot(*threadData), _glState(threadData->config), fontState(threadData->config), - stampCounter(0), - otherView(threadData->config) + stampCounter(0) { /* Shaders have been compiled in ShaderSet's constructor */ if (gl.ReleaseShaderCompiler) @@ -218,7 +214,6 @@ GSATT(ShaderSet&, shaders) GSATT(TexPool&, texPool) GSATT(Quad&, gpQuad) GSATT(SharedFontState&, fontState) -GSATT(OtherViewMessager&, otherView) void SharedState::setBindingData(void *data) { diff --git a/src/sharedstate.h b/src/sharedstate.h index 6c615257..28641e70 100644 --- a/src/sharedstate.h +++ b/src/sharedstate.h @@ -54,7 +54,6 @@ struct GlobalIBO; struct Config; struct Vec2i; struct SharedMidiState; -class OtherViewMessager; struct SharedState { @@ -78,7 +77,6 @@ struct SharedState Oneshot &oneshot() const; - OtherViewMessager &otherView() const; #ifdef STEAM Steam &steam() const; diff --git a/windows/Makefile b/windows/Makefile index f1100eb5..c4bd42bf 100644 --- a/windows/Makefile +++ b/windows/Makefile @@ -83,35 +83,6 @@ $(DOWNLOADS)/ruby/configure: $(DOWNLOADS)/ruby/*.c $(DOWNLOADS)/ruby/*.c: $(CLONE) $(GITHUB)/ruby/ruby $(DOWNLOADS)/ruby -b ruby_$(RUBY_BRANCH); -libzmq: init_dirs $(LIBDIR)/libzmq.dll - -$(LIBDIR)/libzmq.dll: $(DOWNLOADS)/libzmq/Makefile - cd $(DOWNLOADS)/libzmq; \ - make -j$(NPROC); make install - -$(DOWNLOADS)/libzmq/Makefile: $(DOWNLOADS)/libzmq/configure - cd $(DOWNLOADS)/libzmq; \ - $(CONFIGURE) - -$(DOWNLOADS)/libzmq/configure: $(DOWNLOADS)/libzmq/autogen.sh - cd $(DOWNLOADS)/libzmq; ./autogen.sh - -$(DOWNLOADS)/libzmq/autogen.sh: - $(CLONE) $(GITHUB)/zeromq/libzmq $(DOWNLOADS)/libzmq - -zmqpp: init_dirs libzmq $(LIBDIR)/libzmqpp.dll - -$(LIBDIR)/libzmqpp.dll: ${DOWNLOADS}/zmqpp/cmakebuild/Makefile - cd ${DOWNLOADS}/zmqpp/cmakebuild; \ - make -j${NPROC}; make install - -$(DOWNLOADS)/zmqpp/cmakebuild/Makefile: $(DOWNLOADS)/zmqpp/CMakeLists.txt - cd $(DOWNLOADS)/zmqpp; mkdir -p cmakebuild; cd cmakebuild; \ - $(CMAKE) - -$(DOWNLOADS)/zmqpp/CMakeLists.txt: - $(CLONE) $(GITHUB)/somedevfox/zmqpp $(DOWNLOADS)/zmqpp - libnsgif: init_dirs ${LIBDIR}/libnsgif.dll $(LIBDIR)/libnsgif.dll: $(DOWNLOADS)/libnsgif/Makefile @@ -137,5 +108,5 @@ powerwash: clean-downloads clean-downloads: -rm -rf downloads -deps-core: sdlsound libzmq zmqpp libnsgif +deps-core: sdlsound libnsgif everything: deps-core ruby diff --git a/windows/install.sh b/windows/install.sh index ea7e01d1..fc126c89 100644 --- a/windows/install.sh +++ b/windows/install.sh @@ -43,7 +43,7 @@ copy_dependencies $BINARY $BINARY echo "Copying standard library..." cp -ar "$RUBY_LIB_DIR/$RUBY_VER.0" "$DESTDIR/ruby" echo "Downloading cacert.pem..." -curl -o "$DESTDIR/cacert.pem" https://curl.haxx.se/ca/cacert.pem +curl -o "$DESTDIR/cacert.pem" https://curl.se/ca/cacert.pem echo "Moving shim..." cp $SHIM_BINARY "$DESTDIR/../$BINARY" echo "Done!" \ No newline at end of file diff --git a/windows/shim.c b/windows/shim.c index 0c267305..d8b6b849 100644 --- a/windows/shim.c +++ b/windows/shim.c @@ -38,7 +38,7 @@ int WINAPI WinMain(HINSTANCE hInstance, argv[0] = ARGV0; } - _wexecv(L"lib\\oneshot.exe", argv); + _wexecv(L"lib\\modshot.exe", argv); MessageBoxW(NULL, L"Cannot start ModShot for some reason.\nPlease check your ModShot installation.", L"ModShot Shim",