├── .clang-format ├── .github └── FUNDING.yml ├── .gitignore ├── .snapcraft.yaml ├── AppImageBuilder.yml ├── CMakeLists.txt ├── LICENSE ├── README.md ├── appveyor.yml ├── build-scripts ├── build-appimage.sh ├── build-flatpak.sh ├── build-macos.sh ├── build-switch.sh ├── build-vita.sh ├── ci │ ├── linux.deploy.sh │ ├── osx.deploy.sh │ └── win.package.ps1 └── utils │ ├── common.download-extern.sh │ └── common.install-extern.sh ├── cmake ├── Modules │ ├── FindSDL2.cmake │ ├── FindSDL2_image.cmake │ └── FindSDL2_mixer.cmake ├── switch.toolchain.cmake └── switch.tools.cmake ├── data ├── Face.pbm ├── Face_0.pbm ├── Face_1.pbm ├── Face_2.pbm ├── StageMeta │ ├── Ballo2.json │ ├── CentW.json │ ├── Chako.json │ ├── Clock.json │ ├── Comu.json │ ├── Cthu.json │ ├── Cthu2.json │ ├── Curly.json │ ├── CurlyS.json │ ├── Dark.json │ ├── Drain.json │ ├── EgEnd1.json │ ├── EgEnd2.json │ ├── EggR.json │ ├── EggR2.json │ ├── EggX.json │ ├── EggX2.json │ ├── Frog.json │ ├── Gard.json │ ├── Hell1.json │ ├── Hell4.json │ ├── Hell42.json │ ├── Itoh.json │ ├── Jail1.json │ ├── Jail2.json │ ├── Jenka1.json │ ├── Jenka2.json │ ├── Little.json │ ├── Lounge.json │ ├── Malco.json │ ├── Mapi.json │ ├── MazeA.json │ ├── MazeB.json │ ├── MazeD.json │ ├── MazeH.json │ ├── MazeI.json │ ├── MazeO.json │ ├── MazeS.json │ ├── Momo.json │ ├── Pens1.json │ ├── Pens2.json │ ├── Pixel.json │ ├── Plant.json │ ├── Pole.json │ ├── Prefa1.json │ ├── Prefa2.json │ ├── Shelt.json │ ├── Start.json │ ├── Statue.json │ ├── WeedB.json │ ├── WeedD.json │ ├── WeedS.json │ ├── e_Malc.json │ └── e_Maze.json ├── bkFog480fix.pbm ├── bkHellish.pbm ├── bkHellish480fix.pbm ├── bkLight.pbm ├── bkLight480fix.pbm ├── bkMoon480fix.pbm ├── bkSunset.pbm ├── bkSunset480fix.pbm ├── endpic │ ├── credit01m.bmp │ ├── credit02m.bmp │ └── credit03m.bmp ├── font_1.fnt ├── font_1_0.png ├── font_2.fnt ├── font_2_0.png ├── font_3.fnt ├── font_3_0.png ├── font_3_1.png ├── font_4.fnt ├── font_4_0.png ├── font_5.fnt ├── font_5_0.png ├── music.json ├── music_dirs.json ├── spot.png ├── sprites.sif ├── system.json └── tilekey.dat ├── deps ├── json.hpp ├── spdlog │ ├── async.h │ ├── async_logger.h │ ├── common.h │ ├── details │ │ ├── async_logger_impl.h │ │ ├── circular_q.h │ │ ├── console_globals.h │ │ ├── file_helper.h │ │ ├── fmt_helper.h │ │ ├── log_msg.h │ │ ├── logger_impl.h │ │ ├── mpmc_blocking_q.h │ │ ├── null_mutex.h │ │ ├── os.h │ │ ├── pattern_formatter.h │ │ ├── periodic_worker.h │ │ ├── registry.h │ │ └── thread_pool.h │ ├── fmt │ │ ├── bin_to_hex.h │ │ ├── bundled │ │ │ ├── LICENSE.rst │ │ │ ├── chrono.h │ │ │ ├── color.h │ │ │ ├── core.h │ │ │ ├── format-inl.h │ │ │ ├── format.h │ │ │ ├── locale.h │ │ │ ├── ostream.h │ │ │ ├── posix.h │ │ │ ├── printf.h │ │ │ ├── ranges.h │ │ │ └── time.h │ │ ├── fmt.h │ │ └── ostr.h │ ├── formatter.h │ ├── logger.h │ ├── sinks │ │ ├── android_sink.h │ │ ├── ansicolor_sink.h │ │ ├── base_sink.h │ │ ├── basic_file_sink.h │ │ ├── daily_file_sink.h │ │ ├── dist_sink.h │ │ ├── msvc_sink.h │ │ ├── null_sink.h │ │ ├── ostream_sink.h │ │ ├── rotating_file_sink.h │ │ ├── sink.h │ │ ├── stdout_color_sinks.h │ │ ├── stdout_sinks.h │ │ ├── syslog_sink.h │ │ └── wincolor_sink.h │ ├── spdlog.h │ ├── tweakme.h │ └── version.h ├── utf8.h └── utf8 │ ├── checked.h │ ├── core.h │ └── unchecked.h ├── nx.sln ├── org.nxengine.nxengine_evo.json ├── platform ├── osx │ ├── Info.plist │ ├── bg.png │ └── icons.icns ├── switch │ └── icon.jpg ├── vita │ └── sce_sys │ │ ├── icon0.png │ │ └── livearea │ │ └── contents │ │ ├── bg.png │ │ ├── startup.png │ │ └── template.xml ├── win32 │ ├── ext │ │ ├── include │ │ │ ├── SDL.h │ │ │ ├── SDL_assert.h │ │ │ ├── SDL_atomic.h │ │ │ ├── SDL_audio.h │ │ │ ├── SDL_bits.h │ │ │ ├── SDL_blendmode.h │ │ │ ├── SDL_clipboard.h │ │ │ ├── SDL_config.h │ │ │ ├── SDL_config_android.h │ │ │ ├── SDL_config_iphoneos.h │ │ │ ├── SDL_config_macosx.h │ │ │ ├── SDL_config_minimal.h │ │ │ ├── SDL_config_pandora.h │ │ │ ├── SDL_config_psp.h │ │ │ ├── SDL_config_windows.h │ │ │ ├── SDL_config_winrt.h │ │ │ ├── SDL_config_wiz.h │ │ │ ├── SDL_copying.h │ │ │ ├── SDL_cpuinfo.h │ │ │ ├── SDL_egl.h │ │ │ ├── SDL_endian.h │ │ │ ├── SDL_error.h │ │ │ ├── SDL_events.h │ │ │ ├── SDL_filesystem.h │ │ │ ├── SDL_gamecontroller.h │ │ │ ├── SDL_gesture.h │ │ │ ├── SDL_haptic.h │ │ │ ├── SDL_hints.h │ │ │ ├── SDL_image.h │ │ │ ├── SDL_joystick.h │ │ │ ├── SDL_keyboard.h │ │ │ ├── SDL_keycode.h │ │ │ ├── SDL_loadso.h │ │ │ ├── SDL_locale.h │ │ │ ├── SDL_log.h │ │ │ ├── SDL_main.h │ │ │ ├── SDL_messagebox.h │ │ │ ├── SDL_metal.h │ │ │ ├── SDL_misc.h │ │ │ ├── SDL_mixer.h │ │ │ ├── SDL_mouse.h │ │ │ ├── SDL_mutex.h │ │ │ ├── SDL_name.h │ │ │ ├── SDL_opengl.h │ │ │ ├── SDL_opengl_glext.h │ │ │ ├── SDL_opengles.h │ │ │ ├── SDL_opengles2.h │ │ │ ├── SDL_opengles2_gl2.h │ │ │ ├── SDL_opengles2_gl2ext.h │ │ │ ├── SDL_opengles2_gl2platform.h │ │ │ ├── SDL_opengles2_khrplatform.h │ │ │ ├── SDL_pixels.h │ │ │ ├── SDL_platform.h │ │ │ ├── SDL_power.h │ │ │ ├── SDL_quit.h │ │ │ ├── SDL_rect.h │ │ │ ├── SDL_render.h │ │ │ ├── SDL_revision.h │ │ │ ├── SDL_rwops.h │ │ │ ├── SDL_scancode.h │ │ │ ├── SDL_sensor.h │ │ │ ├── SDL_shape.h │ │ │ ├── SDL_stdinc.h │ │ │ ├── SDL_surface.h │ │ │ ├── SDL_system.h │ │ │ ├── SDL_syswm.h │ │ │ ├── SDL_test.h │ │ │ ├── SDL_test_assert.h │ │ │ ├── SDL_test_common.h │ │ │ ├── SDL_test_compare.h │ │ │ ├── SDL_test_crc32.h │ │ │ ├── SDL_test_font.h │ │ │ ├── SDL_test_fuzzer.h │ │ │ ├── SDL_test_harness.h │ │ │ ├── SDL_test_images.h │ │ │ ├── SDL_test_log.h │ │ │ ├── SDL_test_md5.h │ │ │ ├── SDL_test_memory.h │ │ │ ├── SDL_test_random.h │ │ │ ├── SDL_thread.h │ │ │ ├── SDL_timer.h │ │ │ ├── SDL_touch.h │ │ │ ├── SDL_types.h │ │ │ ├── SDL_version.h │ │ │ ├── SDL_video.h │ │ │ ├── SDL_vulkan.h │ │ │ ├── begin_code.h │ │ │ ├── close_code.h │ │ │ ├── png.h │ │ │ ├── pngconf.h │ │ │ ├── pnglibconf.h │ │ │ ├── zconf.h │ │ │ └── zlib.h │ │ ├── lib │ │ │ └── x64 │ │ │ │ ├── SDL2.lib │ │ │ │ ├── SDL2_image.lib │ │ │ │ ├── SDL2_mixer.lib │ │ │ │ ├── SDL2main.lib │ │ │ │ ├── SDL2test.lib │ │ │ │ └── libpng16.lib │ │ └── runtime │ │ │ └── x64 │ │ │ ├── SDL2.dll │ │ │ ├── SDL2_image.dll │ │ │ ├── SDL2_mixer.dll │ │ │ ├── libFLAC-8.dll │ │ │ ├── libjpeg-9.dll │ │ │ ├── libmodplug-1.dll │ │ │ ├── libmpg123-0.dll │ │ │ ├── libogg-0.dll │ │ │ ├── libopus-0.dll │ │ │ ├── libopusfile-0.dll │ │ │ ├── libpng16-16.dll │ │ │ ├── libpng16.dll │ │ │ ├── libtiff-5.dll │ │ │ ├── libvorbis-0.dll │ │ │ ├── libvorbisfile-3.dll │ │ │ ├── libwebp-7.dll │ │ │ └── zlib1.dll │ ├── extract │ │ ├── extract.vcxproj │ │ └── extract.vcxproj.filters │ ├── nx │ │ ├── nx.aps │ │ ├── nx.rc │ │ ├── nx.vcxproj │ │ ├── nx.vcxproj.filters │ │ ├── nx.vcxproj.user │ │ └── resource.h │ └── nx64x64.ico └── xdg │ ├── appdata-add-version.xslt │ ├── org.nxengine.nxengine_evo.appdata.xml │ ├── org.nxengine.nxengine_evo.desktop │ └── org.nxengine.nxengine_evo.png ├── screenshot.png └── src ├── ObjManager.cpp ├── ObjManager.h ├── ResourceManager.cpp ├── ResourceManager.h ├── Singleton.h ├── TextBox ├── ItemImage.cpp ├── ItemImage.h ├── SaveSelect.cpp ├── SaveSelect.h ├── StageSelect.cpp ├── StageSelect.h ├── TextBox.cpp ├── TextBox.h ├── YesNoPrompt.cpp └── YesNoPrompt.h ├── Utils ├── Common.h ├── Logger.cpp └── Logger.h ├── ai ├── IrregularBBox.cpp ├── IrregularBBox.h ├── ai.cpp ├── ai.h ├── almond │ ├── almond.cpp │ └── almond.h ├── balrog_common.cpp ├── balrog_common.h ├── boss │ ├── balfrog.cpp │ ├── balfrog.h │ ├── ballos.cpp │ ├── ballos.h │ ├── core.cpp │ ├── core.h │ ├── heavypress.cpp │ ├── heavypress.h │ ├── ironhead.cpp │ ├── ironhead.h │ ├── omega.cpp │ ├── omega.h │ ├── sisters.cpp │ ├── sisters.h │ ├── undead_core.cpp │ ├── undead_core.h │ ├── x.cpp │ └── x.h ├── egg │ ├── egg.cpp │ ├── egg.h │ ├── egg2.cpp │ ├── egg2.h │ ├── igor.cpp │ └── igor.h ├── final_battle │ ├── balcony.cpp │ ├── balcony.h │ ├── doctor.cpp │ ├── doctor.h │ ├── doctor_common.cpp │ ├── doctor_common.h │ ├── doctor_frenzied.cpp │ ├── doctor_frenzied.h │ ├── final_misc.cpp │ ├── final_misc.h │ ├── misery.cpp │ ├── misery.h │ ├── sidekicks.cpp │ └── sidekicks.h ├── first_cave │ ├── first_cave.cpp │ └── first_cave.h ├── hell │ ├── ballos_misc.cpp │ ├── ballos_misc.h │ ├── ballos_priest.cpp │ ├── ballos_priest.h │ ├── hell.cpp │ └── hell.h ├── last_cave │ ├── last_cave.cpp │ └── last_cave.h ├── maze │ ├── balrog_boss_missiles.cpp │ ├── balrog_boss_missiles.h │ ├── critter_purple.cpp │ ├── critter_purple.h │ ├── gaudi.cpp │ ├── gaudi.h │ ├── labyrinth_m.cpp │ ├── labyrinth_m.h │ ├── maze.cpp │ ├── maze.h │ ├── pooh_black.cpp │ └── pooh_black.h ├── npc │ ├── balrog.cpp │ ├── balrog.h │ ├── curly.cpp │ ├── curly.h │ ├── curly_ai.cpp │ ├── curly_ai.h │ ├── misery.cpp │ ├── misery.h │ ├── npcguest.cpp │ ├── npcguest.h │ ├── npcplayer.cpp │ ├── npcplayer.h │ ├── npcregu.cpp │ └── npcregu.h ├── oside │ ├── oside.cpp │ └── oside.h ├── plantation │ ├── plantation.cpp │ └── plantation.h ├── sand │ ├── curly_boss.cpp │ ├── curly_boss.h │ ├── puppy.cpp │ ├── puppy.h │ ├── sand.cpp │ ├── sand.h │ ├── toroko_frenzied.cpp │ └── toroko_frenzied.h ├── stdai.h ├── sym │ ├── smoke.cpp │ ├── smoke.h │ ├── sym.cpp │ └── sym.h ├── village │ ├── balrog_boss_running.cpp │ ├── balrog_boss_running.h │ ├── ma_pignon.cpp │ ├── ma_pignon.h │ ├── village.cpp │ └── village.h ├── weapons │ ├── blade.cpp │ ├── blade.h │ ├── bubbler.cpp │ ├── bubbler.h │ ├── fireball.cpp │ ├── fireball.h │ ├── missile.cpp │ ├── missile.h │ ├── nemesis.cpp │ ├── nemesis.h │ ├── polar_mgun.cpp │ ├── polar_mgun.h │ ├── snake.cpp │ ├── snake.h │ ├── spur.cpp │ ├── spur.h │ ├── weapons.cpp │ ├── weapons.h │ ├── whimstar.cpp │ └── whimstar.h └── weed │ ├── balrog_boss_flying.cpp │ ├── balrog_boss_flying.h │ ├── frenzied_mimiga.cpp │ ├── frenzied_mimiga.h │ ├── weed.cpp │ └── weed.h ├── autogen ├── AssignSprites.cpp ├── AssignSprites.h ├── objnames.h └── sprites.h ├── caret.cpp ├── caret.h ├── common ├── InitList.cpp ├── InitList.h ├── basics.h ├── bufio.h ├── glob.cpp ├── glob.h ├── llist.h ├── misc.cpp ├── misc.h ├── myfnmatch.cpp └── myfnmatch.h ├── config.h ├── console.cpp ├── console.h ├── debug.cpp ├── debug.h ├── endgame ├── CredReader.cpp ├── CredReader.h ├── credits.cpp ├── credits.h ├── island.cpp ├── island.h ├── misc.cpp └── misc.h ├── extract ├── crc.cpp ├── crc.h ├── extractfiles.cpp ├── extractfiles.h ├── extractpxt.cpp ├── extractpxt.h ├── extractstages.cpp ├── extractstages.h └── main.cpp ├── floattext.cpp ├── floattext.h ├── game.cpp ├── game.h ├── graphics ├── Font.cpp ├── Font.h ├── Renderer.cpp ├── Renderer.h ├── Sprites.cpp ├── Sprites.h ├── Surface.cpp ├── Surface.h ├── Tileset.cpp ├── Tileset.h ├── nx_icon.h ├── pngfuncs.cpp ├── pngfuncs.h ├── types.h ├── zoom.cpp └── zoom.h ├── i18n ├── minibidi.cpp ├── minibidi.h ├── translate.cpp └── translate.h ├── input.cpp ├── input.h ├── intro ├── intro.cpp ├── intro.h ├── title.cpp └── title.h ├── inventory.cpp ├── inventory.h ├── main.cpp ├── map.cpp ├── map.h ├── map_system.cpp ├── map_system.h ├── maprecord.h ├── niku.cpp ├── niku.h ├── nx.h ├── object.cpp ├── object.h ├── p_arms.cpp ├── p_arms.h ├── pause ├── dialog.cpp ├── dialog.h ├── message.cpp ├── message.h ├── mods.cpp ├── mods.h ├── objects.cpp ├── objects.h ├── options.cpp ├── options.h ├── pause.cpp └── pause.h ├── player.cpp ├── player.h ├── playerstats.cpp ├── playerstats.h ├── profile.cpp ├── profile.h ├── screeneffect.cpp ├── screeneffect.h ├── settings.cpp ├── settings.h ├── siflib ├── sectSprites.cpp ├── sectSprites.h ├── sectStringArray.cpp ├── sectStringArray.h ├── sif.cpp ├── sif.h ├── sifloader.cpp └── sifloader.h ├── slope.cpp ├── slope.h ├── sound ├── Ogg.cpp ├── Ogg.h ├── Organya.cpp ├── Organya.h ├── Pixtone.cpp ├── Pixtone.h ├── SoundManager.cpp └── SoundManager.h ├── stageboss.cpp ├── stageboss.h ├── stagedata.cpp ├── stagedata.h ├── statusbar.cpp ├── statusbar.h ├── trig.cpp ├── trig.h ├── tsc.cpp ├── tsc.h └── version.h /.clang-format: -------------------------------------------------------------------------------- 1 | --- 2 | BasedOnStyle: Webkit 3 | --- 4 | Language: Cpp 5 | PointerAlignment: Right 6 | BreakBeforeBraces: Allman 7 | AllowShortBlocksOnASingleLine: false 8 | AllowShortFunctionsOnASingleLine: Empty 9 | Cpp11BracedListStyle: true 10 | Standard: Cpp11 11 | ColumnLimit: 120 12 | IndentWidth: 2 13 | AccessModifierOffset: -2 14 | FixNamespaceComments: true 15 | NamespaceIndentation: None 16 | IncludeBlocks: Regroup 17 | IndentCaseLabels: true 18 | MaxEmptyLinesToKeep: 1 19 | UseTab: Never 20 | AlignAfterOpenBracket: Align 21 | AlignConsecutiveAssignments: true 22 | AlignOperands: true 23 | AlignTrailingComments: true 24 | AllowShortCaseLabelsOnASingleLine: false 25 | AllowShortIfStatementsOnASingleLine: false 26 | AllowShortLoopsOnASingleLine: false 27 | CommentPragmas: '^ NOLINT' 28 | --- 29 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | custom: https://paypal.me/sarcasticat 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /.flatpak-builder 2 | /build 3 | /bin 4 | /extern 5 | /tools 6 | 7 | *.AppImage 8 | *.flatpak 9 | *.snap 10 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # NXEngine-evo 2 | A somewhat upgraded/refactored version of [NXEngine](http://nxengine.sourceforge.net/) by Caitlin Shaw. 3 | 4 | [![Discord chat](https://img.shields.io/discord/804396136252964954?label=Discord)](https://discord.gg/jnwmA7DhQh) [![Matrix chat](https://img.shields.io/matrix/nxengine-evo:ninetailed.ninja?server_fqdn=matrix.ninetailed.ninja&label=Matrix)](https://matrix.to/#/#nxengine-evo:ninetailed.ninja) 5 | 6 | ![Screenshot](https://raw.githubusercontent.com/nxengine/nxengine-evo/master/screenshot.png) 7 | 8 | ## Running the game 9 | * Check the wiki for [Linux](https://github.com/nxengine/nxengine-evo/wiki/Building-on-Linux), [macOS](https://github.com/nxengine/nxengine-evo/wiki/Building-on-macOS), and [Windows](https://github.com/nxengine/nxengine-evo/wiki/Building-on-Windows)-specific instructions if you'd like to build from source. 10 | * Check the [Releases](https://github.com/nxengine/nxengine-evo/releases) page and download the latest version if you'd rather not build it yourself. 11 | 12 | ## Differences from the original version of NXEngine: 13 | * Port to SDL2 (thanks to [PIlin](https://github.com/PIlin/NXEngine-iOS)) 14 | * More resolutions and proper widescreen support up to Full HD (thanks to [EXL](https://github.com/EXL/NXEngine)) 15 | * Animated character portraits 16 | * Modern main menu 17 | * Credits graphics specific to the Mimiga Mask ending 18 | * Localization support 19 | * Force feedback support 20 | * Custom soundtrack support 21 | * Initial mod support 22 | * Vita/Switch versions 23 | * Cleaner and partly-refactored code 24 | * Tons of gameplay-related bugfixes 25 | * Removed built-in data extractor 26 | * Removed replays, as they were buggy/not implemented anyway 27 | 28 | ### Vita icon based on art by [ClockWorkInc](https://www.deviantart.com/clockworkinc) 29 | -------------------------------------------------------------------------------- /appveyor.yml: -------------------------------------------------------------------------------- 1 | image: 2 | - macos-mojave 3 | - Ubuntu2004 4 | - Visual Studio 2017 5 | 6 | version: 2.6.5.{build} 7 | 8 | pull_requests: 9 | do_not_increment_build_number: true 10 | 11 | configuration: Release 12 | 13 | platform: 14 | - x64 15 | 16 | build: 17 | project: nx.sln 18 | verbosity: minimal 19 | 20 | artifacts: 21 | - path: NXEngine-*.zip 22 | name: winbuild 23 | 24 | - path: NXEngine-*.dmg 25 | name: osxbuild 26 | 27 | - path: NXEngine-*.AppImage 28 | name: appimagebuild 29 | 30 | 31 | deploy: 32 | - provider: GitHub 33 | release: $(APPVEYOR_REPO_TAG_NAME) 34 | tag: $(APPVEYOR_REPO_TAG_NAME) 35 | description: '' 36 | auth_token: 37 | secure: UNAaCG+KMRMqZqVEHpSgXTXZOJlqEQ/7nySQ6U/LutHjXnuqVNpYDxoqIW1hufI+ 38 | draft: true 39 | force_update: true 40 | prerelease: false 41 | on: 42 | APPVEYOR_REPO_TAG: true 43 | 44 | 45 | for: 46 | - 47 | matrix: 48 | only: 49 | - image: Visual Studio 2017 50 | 51 | after_build: 52 | - ps: .\build-scripts\ci\win.package.ps1 53 | 54 | 55 | - 56 | matrix: 57 | only: 58 | - image: Ubuntu2004 59 | 60 | install: 61 | - sudo apt update 62 | - sudo apt install -yqq libsdl2-dev libsdl2-mixer-dev libsdl2-image-dev libjpeg-dev libpng-dev ninja-build 63 | 64 | build_script: 65 | - cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=build/AppDir/usr -Bbuild -H. 66 | - ninja -Cbuild 67 | 68 | after_build: 69 | - build-scripts/ci/linux.deploy.sh 70 | 71 | - 72 | matrix: 73 | only: 74 | - image: macos-mojave 75 | 76 | install: 77 | - brew update 78 | - brew install sdl2 sdl2_mixer sdl2_image libjpeg libpng ninja coreutils 79 | 80 | build_script: 81 | - cmake -GNinja -DCMAKE_BUILD_TYPE=Release -Bbuild -H. 82 | - ninja -Cbuild 83 | 84 | after_build: 85 | - sh: build-scripts/ci/osx.deploy.sh $0 86 | -------------------------------------------------------------------------------- /build-scripts/build-appimage.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -eu -o pipefail 3 | cd "$(dirname "$(readlink -f "$0")")/.." # GNU guard 4 | 5 | export APP_ID="org.nxengine.nxengine_evo" 6 | 7 | SKIP_BUILD=false 8 | if [[ $# -gt 0 ]]; 9 | then 10 | case "$1" in 11 | "--no-build") 12 | SKIP_BUILD=true 13 | ;; 14 | 15 | *) 16 | echo "Usage: ${0##*/} [--no-build]" 17 | exit 1 18 | ;; 19 | esac 20 | fi 21 | 22 | # Extract latest release from AppStream data 23 | APP_VERSION="v$(xmllint --xpath 'string(/component/releases/release/@version)' "platform/xdg/${APP_ID}.appdata.xml")" 24 | 25 | # override for CI 26 | if [ "${APPVEYOR_REPO_TAG:-}" == "true" ] 27 | then 28 | APP_VERSION="${APPVEYOR_REPO_TAG_NAME}" 29 | fi 30 | 31 | MACHINE="$(uname -m)" 32 | 33 | # Download required dependencies 34 | build-scripts/utils/common.download-extern.sh 35 | 36 | # Additionally download recent version of the appimage-builder AppImage utility (no checksum verification since file regularily changes when updated to newer versions) 37 | test -e "extern/appimage-builder.AppImage" || wget "https://github.com/AppImageCrafters/appimage-builder/releases/download/v1.1.0/appimage-builder-1.1.0-x86_64.AppImage" -O "extern/appimage-builder.AppImage" 38 | chmod +x extern/appimage-builder.AppImage 39 | 40 | # Build NXEngine-Evo 41 | if ! ${SKIP_BUILD}; 42 | then 43 | rm -rf build 44 | cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DPORTABLE=ON -DCMAKE_INSTALL_PREFIX=/usr -Bbuild -H. 45 | ninja -Cbuild 46 | fi 47 | 48 | # Generate AppImage filesystem image directory 49 | rm -rf AppDir 50 | DESTDIR=AppDir ninja -Cbuild install 51 | build-scripts/utils/common.install-extern.sh build/AppDir/usr/bin/ build/nxextract 52 | cp -r build/AppDir/usr/share/nxengine/data/ build/AppDir/usr/bin/ 53 | 54 | export PATH="${PWD}/build/bin${PATH+:}${PATH:-}" 55 | 56 | PLATFORM_SUFFIX="" 57 | case "${MACHINE}" in 58 | i[3456789]86|x86|x86-32|x86_32) 59 | PLATFORM_SUFFIX="i386" 60 | ;; 61 | x86-64|x86_64|amd64) 62 | PLATFORM_SUFFIX="x86_64" 63 | ;; 64 | *) 65 | PLATFORM_SUFFIX="${MACHINE}" 66 | ;; 67 | esac 68 | 69 | export APP_VERSION 70 | export PLATFORM_SUFFIX 71 | export OUTPUT="NXEngine-Evo-${APP_VERSION}-Linux-${PLATFORM_SUFFIX}.AppImage" 72 | rm -f "${OUTPUT}" 73 | 74 | extern/appimage-builder.AppImage --appdir build/AppDir/ 75 | -------------------------------------------------------------------------------- /build-scripts/build-flatpak.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -eu 3 | cd "$(dirname "$(readlink -f "$0")")/.." # GNU guard 4 | 5 | APP_ID="org.nxengine.nxengine_evo" 6 | VERSION="$(xmllint --xpath 'string(/component/releases/release/@version)' platform/xdg/org.nxengine.nxengine_evo.appdata.xml)" 7 | 8 | # Build Flatpak and export it into build/flatpak-repo 9 | flatpak-builder --ccache --force-clean --repo=build/flatpak-repo "$@" build/flatpak-build "${APP_ID}.json" 10 | 11 | # Export Flatpak bundles from repo 12 | flatpak build-bundle build/flatpak-repo "NXEngine-v${VERSION}-Linux64.flatpak" "${APP_ID}" 13 | flatpak build-bundle build/flatpak-repo --runtime "NXEngine-v${VERSION}-Linux64.Debug.flatpak" "${APP_ID}.Debug" -------------------------------------------------------------------------------- /build-scripts/build-macos.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -eu -o pipefail 3 | if FILEPATH="$(readlink -f "$0" 2>/dev/null)"; 4 | then 5 | cd "${FILEPATH%/*}/" 6 | else 7 | FILEPATH="$0" 8 | for _ in 1 2 3 4 5 6 7 8; # Maximum symlink recursion depth 9 | do 10 | cd -L "`case "${FILEPATH}" in */*) echo "${FILEPATH%/*}";; *) echo ".";; esac`/" # cd $(dirname) 11 | if ! FILEPATH="$(readlink "${FILEPATH##*/}" || ( echo "${FILEPATH##*/}" && false ) )"; 12 | then 13 | break 14 | fi 15 | done 16 | cd -P "." 17 | FILEPATH="$(pwd)/${FILEPATH}" 18 | fi 19 | cd .. 20 | 21 | 22 | export APP_ID="org.nxengine.nxengine_evo" 23 | BUILD_DEST=build/NXEngine.app 24 | 25 | SKIP_BUILD=false 26 | if [[ $# -gt 0 ]]; 27 | then 28 | case "$1" in 29 | "--no-build") 30 | SKIP_BUILD=true 31 | ;; 32 | 33 | *) 34 | echo "Usage: ${0##*/} [--no-build]" 35 | exit 1 36 | ;; 37 | esac 38 | fi 39 | 40 | # Download required dependencies 41 | build-scripts/utils/common.download-extern.sh 42 | 43 | # Build NXEngine-Evo 44 | if ! ${SKIP_BUILD}; 45 | then 46 | rm -rf build 47 | cmake -GNinja -DCMAKE_BUILD_TYPE=Release -Bbuild -H. 48 | ninja -Cbuild 49 | fi 50 | 51 | # Copy main binary 52 | install -vd "${BUILD_DEST}"/Contents/{MacOS,Resources} 53 | install -v build/nxengine-evo "${BUILD_DEST}/Contents/MacOS/NXEngine" 54 | install -v platform/osx/icons.icns "${BUILD_DEST}/Contents/Resources/icons.icns" 55 | install -v platform/osx/Info.plist "${BUILD_DEST}/Contents/Info.plist" 56 | 57 | # Copy game data 58 | cp -v -RpP data "${BUILD_DEST}/Contents/Resources/" 59 | build-scripts/utils/common.install-extern.sh "${BUILD_DEST}/Contents/Resources" build/nxextract 60 | 61 | # Bundle dynamic libraries 62 | dylibbundler -b -x "${BUILD_DEST}/Contents/MacOS/NXEngine" -d "${BUILD_DEST}/Contents/libs-intel" -od -p '@executable_path/../libs-intel' 63 | 64 | # Create disk image 65 | create-dmg \ 66 | --volname "NXEngine" \ 67 | --window-size 640 480 \ 68 | --app-drop-link 380 205 \ 69 | --background platform/osx/bg.png \ 70 | --icon-size 96 \ 71 | --icon "NXEngine.app" 110 205 \ 72 | "NXEngine-Evo-${APPVEYOR_REPO_TAG_NAME}-OSX.dmg" "${BUILD_DEST}" 73 | 74 | ls -------------------------------------------------------------------------------- /build-scripts/build-switch.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | rm -rf build 4 | rm -rf release 5 | mkdir release 6 | mkdir build 7 | cd build 8 | cmake .. 9 | make extract 10 | cd .. 11 | 12 | cd release 13 | wget https://github.com/nxengine/translations/releases/download/v1.14/all.zip 14 | unzip all.zip 15 | rm all.zip 16 | wget https://sarcasticat.com/cavestoryen.zip 17 | unzip cavestoryen.zip 18 | rm cavestoryen.zip 19 | cd CaveStory 20 | ../../build/nxextract 21 | cp -r data/* ../data/ 22 | cd .. 23 | rm -rf CaveStory 24 | cp -r ../data/* data/ 25 | cd .. 26 | rm -rf build 27 | 28 | mkdir build 29 | cd build 30 | cmake -DPLATFORM=switch -GNinja -DCMAKE_BUILD_TYPE=Release .. 31 | ninja 32 | cd .. 33 | rm -rf release/data -------------------------------------------------------------------------------- /build-scripts/build-vita.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | export APP_ID="org.nxengine.nxengine_evo" 4 | build-scripts/utils/common.download-extern.sh 5 | 6 | rm -rf build 7 | rm -rf release 8 | mkdir -p release 9 | mkdir -p build 10 | cd build 11 | cmake .. 12 | make extract 13 | cd .. 14 | 15 | build-scripts/utils/common.install-extern.sh release/ build/nxextract 16 | 17 | cp -v -RpP data "release/" 18 | 19 | rm -rf build 20 | mkdir build 21 | cd build 22 | cmake -DPLATFORM=vita -GNinja -DCMAKE_BUILD_TYPE=Release .. 23 | ninja 24 | cd .. 25 | rm -rf release/data -------------------------------------------------------------------------------- /build-scripts/ci/linux.deploy.sh: -------------------------------------------------------------------------------- 1 | if [ ${APPVEYOR_REPO_TAG} == "true" ]; then 2 | 3 | sudo apt install -yqq libxml2-utils jq appstream appstream-util 4 | build-scripts/build-appimage.sh --no-build 5 | 6 | appveyor PushArtifact "NXEngine-Evo-${APPVEYOR_REPO_TAG_NAME}-Linux-x86_64.AppImage" -DeploymentName appimagebuild 7 | fi 8 | -------------------------------------------------------------------------------- /build-scripts/ci/osx.deploy.sh: -------------------------------------------------------------------------------- 1 | if [ ${APPVEYOR_REPO_TAG} == "true" ]; then 2 | # first parameter is path to appveyor-build-agent or its shell wrapper, hopefully 3 | AGENT_PATH=$(greadlink -f $1) 4 | 5 | BUILD_AGENT="$(dirname $AGENT_PATH)/appveyor-build-agent" 6 | 7 | # because agent version (and path) changes with updates we need to calculate actual csreq 8 | 9 | codesign --detached /tmp/appveyor-build-agent.sig -s - $BUILD_AGENT 10 | 11 | codesign -d -r- --detached /tmp/appveyor-build-agent.sig $BUILD_AGENT 2>&1 | awk -F ' => ' '/designated/{print $2}' | csreq -r- -b /tmp/appveyor-build-agent.csreq 12 | 13 | AGENT_CSREQ=$(xxd -p /tmp/appveyor-build-agent.csreq | tr -d '\n') 14 | 15 | 16 | sqlite3 "/Users/appveyor/Library/Application Support/com.apple.TCC/TCC.db" "INSERT INTO access VALUES('kTCCServiceAppleEvents','$BUILD_AGENT',1,1,1,X'$AGENT_CSREQ',NULL,0,'com.apple.finder',X'fade0c000000002c00000001000000060000000200000010636f6d2e6170706c652e66696e64657200000003',NULL,1605970638);" 17 | 18 | brew install create-dmg dylibbundler jq 19 | build-scripts/build-macos.sh --no-build 20 | appveyor PushArtifact NXEngine-Evo-${APPVEYOR_REPO_TAG_NAME}-OSX.dmg -DeploymentName osxbuild 21 | fi 22 | -------------------------------------------------------------------------------- /build-scripts/ci/win.package.ps1: -------------------------------------------------------------------------------- 1 | if($env:APPVEYOR_REPO_TAG -eq "true") { 2 | Invoke-WebRequest "https://github.com/nxengine/translations/releases/download/v1.14/all.zip" -Out all.zip 3 | 7z x .\all.zip 4 | rm .\all.zip 5 | 6 | mkdir release 7 | cd release 8 | wget https://sarcasticat.com/cavestoryen.zip -outfile cavestoryen.zip 9 | 7z x .\cavestoryen.zip 10 | rm .\cavestoryen.zip 11 | mkdir NXEngine 12 | 13 | #prepare and copy data 14 | if ($env:PLATFORM -eq "x86") { 15 | cp ..\bin\Win32\Release\extract_Win32.exe .\CaveStory\extract.exe 16 | cp ..\bin\Win32\Release\nx_Win32.exe .\NXEngine\nx.exe 17 | } else { 18 | cp ..\bin\x64\Release\extract_x64.exe .\CaveStory\extract.exe 19 | cp ..\bin\x64\Release\nx_x64.exe .\NXEngine\nx.exe 20 | } 21 | 22 | cd .\CaveStory\ 23 | .\extract.exe 24 | cd .. 25 | 26 | cp -r .\CaveStory\data\ .\NXEngine\ 27 | cp -r -force ..\data\ .\NXEngine\ 28 | 29 | if ($env:PLATFORM -eq "x86") { 30 | #bundle libs 31 | cp ..\platform\win32\ext\runtime\x86\* .\NXEngine\ 32 | 33 | #create zip 34 | $name = "NXEngine-Evo-$env:APPVEYOR_REPO_TAG_NAME-Win32.zip" 35 | 7z a $name .\NXEngine\ 36 | 37 | Push-AppveyorArtifact $name -DeploymentName winbuild 38 | 39 | } else { 40 | #bundle libs 41 | cp ..\platform\\win32\ext\runtime\x64\* .\NXEngine\ 42 | 43 | #create zip 44 | $name = "NXEngine-Evo-$env:APPVEYOR_REPO_TAG_NAME-Win64.zip" 45 | 7z a $name .\NXEngine\ 46 | 47 | Push-AppveyorArtifact $name -DeploymentName winbuild 48 | } 49 | } -------------------------------------------------------------------------------- /build-scripts/utils/common.install-extern.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Install external dependencies needed to complete the install step 3 | # 4 | # Expects to be called during the Flatpak or AppImage build process. 5 | # Because of this, the following things are expected about the environment: 6 | # * Current working directory must be at the GIT checkout of the project root directory 7 | # * Directory `extern/Translations` must contain the preprocessed and extracted translations (one subdirectory for each language) 8 | # * Directory `extern/CaveStory` must contain the extracted Windows game ZIP 9 | # 10 | # Call as: build-scripts/unix.install-extern.sh [target-path:/usr/share/nxengine] [/path/to/nxextract] 11 | set -eu 12 | TARGET="${1}" 13 | NXEXTRACT="`case "$2" in /*) echo "$2";; *) echo "$(pwd)/$2";; esac`" 14 | 15 | # Extract resources from original CaveStory EXE 16 | ( cd extern/CaveStory && "${NXEXTRACT}"; ) 17 | 18 | # Install NXEngine data files 19 | install -vd "${TARGET}" 20 | cp -v -RpP extern/CaveStory/data "${TARGET}/" 21 | cp -v -RpP extern/Translations "${TARGET}/data/lang" -------------------------------------------------------------------------------- /cmake/switch.tools.cmake: -------------------------------------------------------------------------------- 1 | find_program(ELF2NRO elf2nro ${DEVKITPRO}/tools/bin) 2 | if (ELF2NRO) 3 | message(STATUS "elf2nro: ${ELF2NRO} - found") 4 | else () 5 | message(WARNING "elf2nro - not found") 6 | endif () 7 | 8 | find_program(NACPTOOL nacptool ${DEVKITPRO}/tools/bin) 9 | if (NACPTOOL) 10 | message(STATUS "nacptool: ${NACPTOOL} - found") 11 | else () 12 | message(WARNING "nacptool - not found") 13 | endif () 14 | 15 | function(__add_nacp target APP_TITLE APP_AUTHOR APP_VERSION) 16 | set(__NACP_COMMAND ${NACPTOOL} --create ${APP_TITLE} ${APP_AUTHOR} ${APP_VERSION} ${CMAKE_CURRENT_BINARY_DIR}/${target}) 17 | 18 | add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${target} 19 | COMMAND ${__NACP_COMMAND} 20 | WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} 21 | VERBATIM 22 | ) 23 | endfunction() 24 | 25 | function(add_nro_target target title author version icon romfs) 26 | get_filename_component(target_we ${target} NAME_WE) 27 | if (NOT ${target_we}.nacp) 28 | __add_nacp(${target_we}.nacp ${title} ${author} ${version}) 29 | endif () 30 | add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${target_we}.nro 31 | COMMAND ${ELF2NRO} $ ${CMAKE_CURRENT_BINARY_DIR}/${target_we}.nro --icon=${icon} --nacp=${CMAKE_CURRENT_BINARY_DIR}/${target_we}.nacp --romfsdir=${romfs} 32 | DEPENDS ${target} ${CMAKE_CURRENT_BINARY_DIR}/${target_we}.nacp 33 | VERBATIM 34 | ) 35 | add_custom_target(${target_we}_nro ALL SOURCES ${CMAKE_CURRENT_BINARY_DIR}/${target_we}.nro) 36 | endfunction() 37 | -------------------------------------------------------------------------------- /data/Face.pbm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxengine/nxengine-evo/f8fb001fa86c72af50c1fb2b4495d80c2a4159e7/data/Face.pbm -------------------------------------------------------------------------------- /data/Face_0.pbm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxengine/nxengine-evo/f8fb001fa86c72af50c1fb2b4495d80c2a4159e7/data/Face_0.pbm -------------------------------------------------------------------------------- /data/Face_1.pbm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxengine/nxengine-evo/f8fb001fa86c72af50c1fb2b4495d80c2a4159e7/data/Face_1.pbm -------------------------------------------------------------------------------- /data/Face_2.pbm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxengine/nxengine-evo/f8fb001fa86c72af50c1fb2b4495d80c2a4159e7/data/Face_2.pbm -------------------------------------------------------------------------------- /data/StageMeta/Ballo2.json: -------------------------------------------------------------------------------- 1 | { 2 | "out-of-bounds": [ 109 ] 3 | } 4 | 5 | -------------------------------------------------------------------------------- /data/StageMeta/CentW.json: -------------------------------------------------------------------------------- 1 | { 2 | "out-of-bounds": [ 48 ] 3 | } 4 | 5 | -------------------------------------------------------------------------------- /data/StageMeta/Chako.json: -------------------------------------------------------------------------------- 1 | { 2 | "out-of-bounds": [ 5 ] 3 | } 4 | 5 | -------------------------------------------------------------------------------- /data/StageMeta/Clock.json: -------------------------------------------------------------------------------- 1 | { 2 | "out-of-bounds": [ 1, 2, 17, 18 ] 3 | } 4 | 5 | -------------------------------------------------------------------------------- /data/StageMeta/Comu.json: -------------------------------------------------------------------------------- 1 | { 2 | "out-of-bounds": [ 36 ] 3 | } 4 | 5 | -------------------------------------------------------------------------------- /data/StageMeta/Cthu.json: -------------------------------------------------------------------------------- 1 | { 2 | "out-of-bounds": [ 48 ] 3 | } 4 | 5 | -------------------------------------------------------------------------------- /data/StageMeta/Cthu2.json: -------------------------------------------------------------------------------- 1 | { 2 | "out-of-bounds": [ 48 ] 3 | } 4 | 5 | -------------------------------------------------------------------------------- /data/StageMeta/Curly.json: -------------------------------------------------------------------------------- 1 | { 2 | "out-of-bounds": [ 1, 2, 17, 18 ] 3 | } 4 | 5 | -------------------------------------------------------------------------------- /data/StageMeta/CurlyS.json: -------------------------------------------------------------------------------- 1 | { 2 | "out-of-bounds": [ 36 ] 3 | } 4 | 5 | -------------------------------------------------------------------------------- /data/StageMeta/Dark.json: -------------------------------------------------------------------------------- 1 | { 2 | "out-of-bounds": [ 96 ] 3 | } 4 | 5 | -------------------------------------------------------------------------------- /data/StageMeta/Drain.json: -------------------------------------------------------------------------------- 1 | { 2 | "out-of-bounds": [ 32, 33, 48, 49 ] 3 | } 4 | 5 | -------------------------------------------------------------------------------- /data/StageMeta/EgEnd1.json: -------------------------------------------------------------------------------- 1 | { 2 | "out-of-bounds": [ 48 ] 3 | } 4 | 5 | -------------------------------------------------------------------------------- /data/StageMeta/EgEnd2.json: -------------------------------------------------------------------------------- 1 | { 2 | "out-of-bounds": [ 48 ] 3 | } 4 | 5 | -------------------------------------------------------------------------------- /data/StageMeta/EggR.json: -------------------------------------------------------------------------------- 1 | { 2 | "out-of-bounds": [ 48 ] 3 | } 4 | 5 | -------------------------------------------------------------------------------- /data/StageMeta/EggR2.json: -------------------------------------------------------------------------------- 1 | { 2 | "out-of-bounds": [ 48 ] 3 | } 4 | 5 | -------------------------------------------------------------------------------- /data/StageMeta/EggX.json: -------------------------------------------------------------------------------- 1 | { 2 | "out-of-bounds": [ 16 ] 3 | } 4 | 5 | -------------------------------------------------------------------------------- /data/StageMeta/EggX2.json: -------------------------------------------------------------------------------- 1 | { 2 | "out-of-bounds": [ 16 ] 3 | } 4 | 5 | -------------------------------------------------------------------------------- /data/StageMeta/Frog.json: -------------------------------------------------------------------------------- 1 | { 2 | "out-of-bounds": [ 35, 36, 51, 52 ] 3 | } 4 | 5 | -------------------------------------------------------------------------------- /data/StageMeta/Gard.json: -------------------------------------------------------------------------------- 1 | { 2 | "out-of-bounds": [ 1, 2, 17, 18 ] 3 | } 4 | 5 | -------------------------------------------------------------------------------- /data/StageMeta/Hell1.json: -------------------------------------------------------------------------------- 1 | { 2 | "out-of-bounds": [ 19, 20, 35, 36 ] 3 | } 4 | 5 | -------------------------------------------------------------------------------- /data/StageMeta/Hell4.json: -------------------------------------------------------------------------------- 1 | { 2 | "out-of-bounds": [ 1 ] 3 | } 4 | 5 | -------------------------------------------------------------------------------- /data/StageMeta/Hell42.json: -------------------------------------------------------------------------------- 1 | { 2 | "out-of-bounds": [ 1 ] 3 | } 4 | 5 | -------------------------------------------------------------------------------- /data/StageMeta/Itoh.json: -------------------------------------------------------------------------------- 1 | { 2 | "out-of-bounds": [ 48 ] 3 | } 4 | 5 | -------------------------------------------------------------------------------- /data/StageMeta/Jail1.json: -------------------------------------------------------------------------------- 1 | { 2 | "out-of-bounds": [ 3, 4, 19, 20 ] 3 | } 4 | 5 | -------------------------------------------------------------------------------- /data/StageMeta/Jail2.json: -------------------------------------------------------------------------------- 1 | { 2 | "out-of-bounds": [ 48 ] 3 | } 4 | 5 | -------------------------------------------------------------------------------- /data/StageMeta/Jenka1.json: -------------------------------------------------------------------------------- 1 | { 2 | "out-of-bounds": [ 5 ] 3 | } 4 | 5 | -------------------------------------------------------------------------------- /data/StageMeta/Jenka2.json: -------------------------------------------------------------------------------- 1 | { 2 | "out-of-bounds": [ 5 ] 3 | } 4 | 5 | -------------------------------------------------------------------------------- /data/StageMeta/Little.json: -------------------------------------------------------------------------------- 1 | { 2 | "out-of-bounds": [ 36 ] 3 | } 4 | 5 | -------------------------------------------------------------------------------- /data/StageMeta/Lounge.json: -------------------------------------------------------------------------------- 1 | { 2 | "out-of-bounds": [ 3, 4, 19, 20 ] 3 | } 4 | 5 | -------------------------------------------------------------------------------- /data/StageMeta/Malco.json: -------------------------------------------------------------------------------- 1 | { 2 | "out-of-bounds": [ 5 ] 3 | } 4 | 5 | -------------------------------------------------------------------------------- /data/StageMeta/Mapi.json: -------------------------------------------------------------------------------- 1 | { 2 | "out-of-bounds": [ 32, 33, 48, 49 ] 3 | } 4 | 5 | -------------------------------------------------------------------------------- /data/StageMeta/MazeA.json: -------------------------------------------------------------------------------- 1 | { 2 | "out-of-bounds": [ 48 ] 3 | } 4 | 5 | -------------------------------------------------------------------------------- /data/StageMeta/MazeB.json: -------------------------------------------------------------------------------- 1 | { 2 | "out-of-bounds": [ 1, 2, 17, 18 ] 3 | } 4 | 5 | -------------------------------------------------------------------------------- /data/StageMeta/MazeD.json: -------------------------------------------------------------------------------- 1 | { 2 | "out-of-bounds": [ 3, 4, 19, 20 ] 3 | } 4 | 5 | -------------------------------------------------------------------------------- /data/StageMeta/MazeH.json: -------------------------------------------------------------------------------- 1 | { 2 | "out-of-bounds": [ 16 ] 3 | } 4 | 5 | -------------------------------------------------------------------------------- /data/StageMeta/MazeI.json: -------------------------------------------------------------------------------- 1 | { 2 | "out-of-bounds": [ 16 ] 3 | } 4 | 5 | -------------------------------------------------------------------------------- /data/StageMeta/MazeO.json: -------------------------------------------------------------------------------- 1 | { 2 | "out-of-bounds": [ 16 ] 3 | } 4 | 5 | -------------------------------------------------------------------------------- /data/StageMeta/MazeS.json: -------------------------------------------------------------------------------- 1 | { 2 | "out-of-bounds": [ 3, 4, 19, 20 ] 3 | } 4 | 5 | -------------------------------------------------------------------------------- /data/StageMeta/Momo.json: -------------------------------------------------------------------------------- 1 | { 2 | "out-of-bounds": [ 3, 4, 19, 20 ] 3 | } 4 | 5 | -------------------------------------------------------------------------------- /data/StageMeta/Pens1.json: -------------------------------------------------------------------------------- 1 | { 2 | "out-of-bounds": [ 36 ] 3 | } 4 | 5 | -------------------------------------------------------------------------------- /data/StageMeta/Pens2.json: -------------------------------------------------------------------------------- 1 | { 2 | "out-of-bounds": [ 36 ] 3 | } 4 | 5 | -------------------------------------------------------------------------------- /data/StageMeta/Pixel.json: -------------------------------------------------------------------------------- 1 | { 2 | "out-of-bounds": [ 36 ] 3 | } 4 | 5 | -------------------------------------------------------------------------------- /data/StageMeta/Plant.json: -------------------------------------------------------------------------------- 1 | { 2 | "out-of-bounds": [ 35, 36, 51, 52 ] 3 | } 4 | 5 | -------------------------------------------------------------------------------- /data/StageMeta/Pole.json: -------------------------------------------------------------------------------- 1 | { 2 | "out-of-bounds": [ 32, 33, 48, 49 ] 3 | } 4 | 5 | -------------------------------------------------------------------------------- /data/StageMeta/Prefa1.json: -------------------------------------------------------------------------------- 1 | { 2 | "out-of-bounds": [ 36 ] 3 | } 4 | 5 | -------------------------------------------------------------------------------- /data/StageMeta/Prefa2.json: -------------------------------------------------------------------------------- 1 | { 2 | "out-of-bounds": [ 36 ] 3 | } 4 | 5 | -------------------------------------------------------------------------------- /data/StageMeta/Shelt.json: -------------------------------------------------------------------------------- 1 | { 2 | "out-of-bounds": [ 48 ] 3 | } 4 | 5 | -------------------------------------------------------------------------------- /data/StageMeta/Start.json: -------------------------------------------------------------------------------- 1 | { 2 | "out-of-bounds": [ 32, 33, 48, 49 ] 3 | } 4 | 5 | -------------------------------------------------------------------------------- /data/StageMeta/Statue.json: -------------------------------------------------------------------------------- 1 | { 2 | "out-of-bounds": [ 16, 17, 32, 33 ] 3 | } 4 | 5 | -------------------------------------------------------------------------------- /data/StageMeta/WeedB.json: -------------------------------------------------------------------------------- 1 | { 2 | "out-of-bounds": [ 36 ] 3 | } 4 | 5 | -------------------------------------------------------------------------------- /data/StageMeta/WeedD.json: -------------------------------------------------------------------------------- 1 | { 2 | "out-of-bounds": [ 48 ] 3 | } 4 | 5 | -------------------------------------------------------------------------------- /data/StageMeta/WeedS.json: -------------------------------------------------------------------------------- 1 | { 2 | "out-of-bounds": [ 5 ] 3 | } 4 | 5 | -------------------------------------------------------------------------------- /data/StageMeta/e_Malc.json: -------------------------------------------------------------------------------- 1 | { 2 | "out-of-bounds": [ 5 ] 3 | } 4 | 5 | -------------------------------------------------------------------------------- /data/StageMeta/e_Maze.json: -------------------------------------------------------------------------------- 1 | { 2 | "out-of-bounds": [ 23 ] 3 | } 4 | 5 | -------------------------------------------------------------------------------- /data/bkFog480fix.pbm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxengine/nxengine-evo/f8fb001fa86c72af50c1fb2b4495d80c2a4159e7/data/bkFog480fix.pbm -------------------------------------------------------------------------------- /data/bkHellish.pbm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxengine/nxengine-evo/f8fb001fa86c72af50c1fb2b4495d80c2a4159e7/data/bkHellish.pbm -------------------------------------------------------------------------------- /data/bkHellish480fix.pbm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxengine/nxengine-evo/f8fb001fa86c72af50c1fb2b4495d80c2a4159e7/data/bkHellish480fix.pbm -------------------------------------------------------------------------------- /data/bkLight.pbm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxengine/nxengine-evo/f8fb001fa86c72af50c1fb2b4495d80c2a4159e7/data/bkLight.pbm -------------------------------------------------------------------------------- /data/bkLight480fix.pbm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxengine/nxengine-evo/f8fb001fa86c72af50c1fb2b4495d80c2a4159e7/data/bkLight480fix.pbm -------------------------------------------------------------------------------- /data/bkMoon480fix.pbm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxengine/nxengine-evo/f8fb001fa86c72af50c1fb2b4495d80c2a4159e7/data/bkMoon480fix.pbm -------------------------------------------------------------------------------- /data/bkSunset.pbm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxengine/nxengine-evo/f8fb001fa86c72af50c1fb2b4495d80c2a4159e7/data/bkSunset.pbm -------------------------------------------------------------------------------- /data/bkSunset480fix.pbm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxengine/nxengine-evo/f8fb001fa86c72af50c1fb2b4495d80c2a4159e7/data/bkSunset480fix.pbm -------------------------------------------------------------------------------- /data/endpic/credit01m.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxengine/nxengine-evo/f8fb001fa86c72af50c1fb2b4495d80c2a4159e7/data/endpic/credit01m.bmp -------------------------------------------------------------------------------- /data/endpic/credit02m.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxengine/nxengine-evo/f8fb001fa86c72af50c1fb2b4495d80c2a4159e7/data/endpic/credit02m.bmp -------------------------------------------------------------------------------- /data/endpic/credit03m.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxengine/nxengine-evo/f8fb001fa86c72af50c1fb2b4495d80c2a4159e7/data/endpic/credit03m.bmp -------------------------------------------------------------------------------- /data/font_1_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxengine/nxengine-evo/f8fb001fa86c72af50c1fb2b4495d80c2a4159e7/data/font_1_0.png -------------------------------------------------------------------------------- /data/font_2_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxengine/nxengine-evo/f8fb001fa86c72af50c1fb2b4495d80c2a4159e7/data/font_2_0.png -------------------------------------------------------------------------------- /data/font_3_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxengine/nxengine-evo/f8fb001fa86c72af50c1fb2b4495d80c2a4159e7/data/font_3_0.png -------------------------------------------------------------------------------- /data/font_3_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxengine/nxengine-evo/f8fb001fa86c72af50c1fb2b4495d80c2a4159e7/data/font_3_1.png -------------------------------------------------------------------------------- /data/font_4_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxengine/nxengine-evo/f8fb001fa86c72af50c1fb2b4495d80c2a4159e7/data/font_4_0.png -------------------------------------------------------------------------------- /data/font_5_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxengine/nxengine-evo/f8fb001fa86c72af50c1fb2b4495d80c2a4159e7/data/font_5_0.png -------------------------------------------------------------------------------- /data/music.json: -------------------------------------------------------------------------------- 1 | [ 2 | {"name":"wanpaku"}, 3 | {"name":"anzen"}, 4 | {"name":"gameover", "loop":false}, 5 | {"name":"gravity"}, 6 | {"name":"weed"}, 7 | {"name":"mdown2"}, 8 | {"name":"fireeye"}, 9 | {"name":"vivi"}, 10 | {"name":"mura"}, 11 | {"name":"fanfale1", "loop":false}, 12 | {"name":"ginsuke"}, 13 | {"name":"cemetery"}, 14 | {"name":"plant"}, 15 | {"name":"kodou"}, 16 | {"name":"fanfale2", "loop":false}, 17 | {"name":"fanfale3", "loop":false}, 18 | {"name":"dr"}, 19 | {"name":"escape"}, 20 | {"name":"jenka"}, 21 | {"name":"maze"}, 22 | {"name":"access"}, 23 | {"name":"ironh"}, 24 | {"name":"grand"}, 25 | {"name":"curly"}, 26 | {"name":"oside"}, 27 | {"name":"requiem"}, 28 | {"name":"wanpak2"}, 29 | {"name":"quiet"}, 30 | {"name":"lastcave"}, 31 | {"name":"balcony"}, 32 | {"name":"lastbtl"}, 33 | {"name":"lastbt3"}, 34 | {"name":"ending"}, 35 | {"name":"zonbie"}, 36 | {"name":"bdown"}, 37 | {"name":"hell"}, 38 | {"name":"jenka2"}, 39 | {"name":"marine"}, 40 | {"name":"ballos"}, 41 | {"name":"toroko"}, 42 | {"name":"white"} 43 | ] 44 | 45 | -------------------------------------------------------------------------------- /data/music_dirs.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name":"New", 4 | "dir":"Ogg/" 5 | }, 6 | { 7 | "name":"Remastered", 8 | "dir":"Ogg11/" 9 | }, 10 | { 11 | "name":"Famitracks", 12 | "dir":"Ogg17/" 13 | }, 14 | { 15 | "name":"Ridiculon", 16 | "dir":"Ogg_ridic/" 17 | } 18 | ] -------------------------------------------------------------------------------- /data/spot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxengine/nxengine-evo/f8fb001fa86c72af50c1fb2b4495d80c2a4159e7/data/spot.png -------------------------------------------------------------------------------- /data/sprites.sif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxengine/nxengine-evo/f8fb001fa86c72af50c1fb2b4495d80c2a4159e7/data/sprites.sif -------------------------------------------------------------------------------- /data/system.json: -------------------------------------------------------------------------------- 1 | { 2 | "english": "English" 3 | } 4 | 5 | -------------------------------------------------------------------------------- /data/tilekey.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxengine/nxengine-evo/f8fb001fa86c72af50c1fb2b4495d80c2a4159e7/data/tilekey.dat -------------------------------------------------------------------------------- /deps/spdlog/details/circular_q.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(c) 2018 Gabi Melman. 3 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 4 | // 5 | 6 | // cirucal q view of std::vector. 7 | #pragma once 8 | 9 | #include 10 | 11 | namespace spdlog { 12 | namespace details { 13 | template 14 | class circular_q 15 | { 16 | public: 17 | using item_type = T; 18 | 19 | explicit circular_q(size_t max_items) 20 | : max_items_(max_items + 1) // one item is reserved as marker for full q 21 | , v_(max_items_) 22 | { 23 | } 24 | 25 | // push back, overrun (oldest) item if no room left 26 | void push_back(T &&item) 27 | { 28 | v_[tail_] = std::move(item); 29 | tail_ = (tail_ + 1) % max_items_; 30 | 31 | if (tail_ == head_) // overrun last item if full 32 | { 33 | head_ = (head_ + 1) % max_items_; 34 | ++overrun_counter_; 35 | } 36 | } 37 | 38 | // Pop item from front. 39 | // If there are no elements in the container, the behavior is undefined. 40 | void pop_front(T &popped_item) 41 | { 42 | popped_item = std::move(v_[head_]); 43 | head_ = (head_ + 1) % max_items_; 44 | } 45 | 46 | bool empty() 47 | { 48 | return tail_ == head_; 49 | } 50 | 51 | bool full() 52 | { 53 | // head is ahead of the tail by 1 54 | return ((tail_ + 1) % max_items_) == head_; 55 | } 56 | 57 | size_t overrun_counter() const 58 | { 59 | return overrun_counter_; 60 | } 61 | 62 | private: 63 | size_t max_items_; 64 | typename std::vector::size_type head_ = 0; 65 | typename std::vector::size_type tail_ = 0; 66 | 67 | std::vector v_; 68 | 69 | size_t overrun_counter_ = 0; 70 | }; 71 | } // namespace details 72 | } // namespace spdlog 73 | -------------------------------------------------------------------------------- /deps/spdlog/details/console_globals.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | // 3 | // Copyright(c) 2018 Gabi Melman. 4 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 5 | // 6 | 7 | #include "spdlog/details/null_mutex.h" 8 | #include 9 | #include 10 | 11 | #ifdef _WIN32 12 | 13 | #ifndef NOMINMAX 14 | #define NOMINMAX // prevent windows redefining min/max 15 | #endif 16 | 17 | #ifndef WIN32_LEAN_AND_MEAN 18 | #define WIN32_LEAN_AND_MEAN 19 | #endif 20 | 21 | #include 22 | #endif 23 | 24 | namespace spdlog { 25 | namespace details { 26 | struct console_stdout 27 | { 28 | static std::FILE *stream() 29 | { 30 | return stdout; 31 | } 32 | #ifdef _WIN32 33 | static HANDLE handle() 34 | { 35 | return ::GetStdHandle(STD_OUTPUT_HANDLE); 36 | } 37 | #endif 38 | }; 39 | 40 | struct console_stderr 41 | { 42 | static std::FILE *stream() 43 | { 44 | return stderr; 45 | } 46 | #ifdef _WIN32 47 | static HANDLE handle() 48 | { 49 | return ::GetStdHandle(STD_ERROR_HANDLE); 50 | } 51 | #endif 52 | }; 53 | 54 | struct console_mutex 55 | { 56 | using mutex_t = std::mutex; 57 | static mutex_t &mutex() 58 | { 59 | static mutex_t s_mutex; 60 | return s_mutex; 61 | } 62 | }; 63 | 64 | struct console_nullmutex 65 | { 66 | using mutex_t = null_mutex; 67 | static mutex_t &mutex() 68 | { 69 | static mutex_t s_mutex; 70 | return s_mutex; 71 | } 72 | }; 73 | } // namespace details 74 | } // namespace spdlog 75 | -------------------------------------------------------------------------------- /deps/spdlog/details/log_msg.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(c) 2015 Gabi Melman. 3 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 4 | // 5 | 6 | #pragma once 7 | 8 | #include "spdlog/common.h" 9 | #include "spdlog/details/os.h" 10 | 11 | #include 12 | #include 13 | 14 | namespace spdlog { 15 | namespace details { 16 | struct log_msg 17 | { 18 | 19 | log_msg(source_loc loc, const std::string *loggers_name, level::level_enum lvl, string_view_t view) 20 | : logger_name(loggers_name) 21 | , level(lvl) 22 | #ifndef SPDLOG_NO_DATETIME 23 | , time(os::now()) 24 | #endif 25 | 26 | #ifndef SPDLOG_NO_THREAD_ID 27 | , thread_id(os::thread_id()) 28 | #endif 29 | , source(loc) 30 | , payload(view) 31 | { 32 | } 33 | 34 | log_msg(const std::string *loggers_name, level::level_enum lvl, string_view_t view) 35 | : log_msg(source_loc{}, loggers_name, lvl, view) 36 | { 37 | } 38 | 39 | log_msg(const log_msg &other) = default; 40 | 41 | const std::string *logger_name{nullptr}; 42 | level::level_enum level{level::off}; 43 | log_clock::time_point time; 44 | size_t thread_id{0}; 45 | size_t msg_id{0}; 46 | 47 | // wrapping the formatted text with color (updated by pattern_formatter). 48 | mutable size_t color_range_start{0}; 49 | mutable size_t color_range_end{0}; 50 | 51 | source_loc source; 52 | const string_view_t payload; 53 | }; 54 | } // namespace details 55 | } // namespace spdlog 56 | -------------------------------------------------------------------------------- /deps/spdlog/details/null_mutex.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(c) 2015 Gabi Melman. 3 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 4 | // 5 | 6 | #pragma once 7 | 8 | #include 9 | // null, no cost dummy "mutex" and dummy "atomic" int 10 | 11 | namespace spdlog { 12 | namespace details { 13 | struct null_mutex 14 | { 15 | void lock() {} 16 | void unlock() {} 17 | bool try_lock() 18 | { 19 | return true; 20 | } 21 | }; 22 | 23 | struct null_atomic_int 24 | { 25 | int value; 26 | null_atomic_int() = default; 27 | 28 | explicit null_atomic_int(int val) 29 | : value(val) 30 | { 31 | } 32 | 33 | int load(std::memory_order) const 34 | { 35 | return value; 36 | } 37 | 38 | void store(int val) 39 | { 40 | value = val; 41 | } 42 | }; 43 | 44 | } // namespace details 45 | } // namespace spdlog 46 | -------------------------------------------------------------------------------- /deps/spdlog/details/periodic_worker.h: -------------------------------------------------------------------------------- 1 | 2 | // 3 | // Copyright(c) 2018 Gabi Melman. 4 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 5 | // 6 | 7 | #pragma once 8 | 9 | // periodic worker thread - periodically executes the given callback function. 10 | // 11 | // RAII over the owned thread: 12 | // creates the thread on construction. 13 | // stops and joins the thread on destruction (if the thread is executing a callback, wait for it to finish first). 14 | 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | namespace spdlog { 21 | namespace details { 22 | 23 | class periodic_worker 24 | { 25 | public: 26 | periodic_worker(const std::function &callback_fun, std::chrono::seconds interval) 27 | { 28 | active_ = (interval > std::chrono::seconds::zero()); 29 | if (!active_) 30 | { 31 | return; 32 | } 33 | 34 | worker_thread_ = std::thread([this, callback_fun, interval]() { 35 | for (;;) 36 | { 37 | std::unique_lock lock(this->mutex_); 38 | if (this->cv_.wait_for(lock, interval, [this] { return !this->active_; })) 39 | { 40 | return; // active_ == false, so exit this thread 41 | } 42 | callback_fun(); 43 | } 44 | }); 45 | } 46 | 47 | periodic_worker(const periodic_worker &) = delete; 48 | periodic_worker &operator=(const periodic_worker &) = delete; 49 | 50 | // stop the worker thread and join it 51 | ~periodic_worker() 52 | { 53 | if (worker_thread_.joinable()) 54 | { 55 | { 56 | std::lock_guard lock(mutex_); 57 | active_ = false; 58 | } 59 | cv_.notify_one(); 60 | worker_thread_.join(); 61 | } 62 | } 63 | 64 | private: 65 | bool active_; 66 | std::thread worker_thread_; 67 | std::mutex mutex_; 68 | std::condition_variable cv_; 69 | }; 70 | } // namespace details 71 | } // namespace spdlog 72 | -------------------------------------------------------------------------------- /deps/spdlog/fmt/bundled/LICENSE.rst: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012 - 2016, Victor Zverovich 2 | 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are met: 7 | 8 | 1. Redistributions of source code must retain the above copyright notice, this 9 | list of conditions and the following disclaimer. 10 | 2. Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 15 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 16 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 18 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 19 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 20 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 21 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 23 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | -------------------------------------------------------------------------------- /deps/spdlog/fmt/fmt.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(c) 2016-2018 Gabi Melman. 3 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 4 | // 5 | 6 | #pragma once 7 | 8 | // 9 | // Include a bundled header-only copy of fmtlib or an external one. 10 | // By default spdlog include its own copy. 11 | // 12 | 13 | #if !defined(SPDLOG_FMT_EXTERNAL) 14 | #ifndef FMT_HEADER_ONLY 15 | #define FMT_HEADER_ONLY 16 | #endif 17 | #ifndef FMT_USE_WINDOWS_H 18 | #define FMT_USE_WINDOWS_H 0 19 | #endif 20 | #include "bundled/core.h" 21 | #include "bundled/format.h" 22 | #else // external fmtlib 23 | #include 24 | #include 25 | #endif 26 | -------------------------------------------------------------------------------- /deps/spdlog/fmt/ostr.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(c) 2016 Gabi Melman. 3 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 4 | // 5 | 6 | #pragma once 7 | // 8 | // include bundled or external copy of fmtlib's ostream support 9 | // 10 | #if !defined(SPDLOG_FMT_EXTERNAL) 11 | #ifndef FMT_HEADER_ONLY 12 | #define FMT_HEADER_ONLY 13 | #endif 14 | #include "bundled/ostream.h" 15 | #include "fmt.h" 16 | #else 17 | #include 18 | #endif 19 | -------------------------------------------------------------------------------- /deps/spdlog/formatter.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(c) 2015 Gabi Melman. 3 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 4 | // 5 | 6 | #pragma once 7 | 8 | #include "fmt/fmt.h" 9 | #include "spdlog/details/log_msg.h" 10 | 11 | namespace spdlog { 12 | 13 | class formatter 14 | { 15 | public: 16 | virtual ~formatter() = default; 17 | virtual void format(const details::log_msg &msg, fmt::memory_buffer &dest) = 0; 18 | virtual std::unique_ptr clone() const = 0; 19 | }; 20 | } // namespace spdlog 21 | -------------------------------------------------------------------------------- /deps/spdlog/sinks/base_sink.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(c) 2015 Gabi Melman. 3 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 4 | // 5 | 6 | #pragma once 7 | // 8 | // base sink templated over a mutex (either dummy or real) 9 | // concrete implementation should override the sink_it_() and flush_() methods. 10 | // locking is taken care of in this class - no locking needed by the 11 | // implementers.. 12 | // 13 | 14 | #include "spdlog/common.h" 15 | #include "spdlog/details/log_msg.h" 16 | #include "spdlog/formatter.h" 17 | #include "spdlog/sinks/sink.h" 18 | 19 | namespace spdlog { 20 | namespace sinks { 21 | template 22 | class base_sink : public sink 23 | { 24 | public: 25 | base_sink() = default; 26 | base_sink(const base_sink &) = delete; 27 | base_sink &operator=(const base_sink &) = delete; 28 | 29 | void log(const details::log_msg &msg) final 30 | { 31 | std::lock_guard lock(mutex_); 32 | sink_it_(msg); 33 | } 34 | 35 | void flush() final 36 | { 37 | std::lock_guard lock(mutex_); 38 | flush_(); 39 | } 40 | 41 | void set_pattern(const std::string &pattern) final 42 | { 43 | std::lock_guard lock(mutex_); 44 | set_pattern_(pattern); 45 | } 46 | 47 | void set_formatter(std::unique_ptr sink_formatter) final 48 | { 49 | std::lock_guard lock(mutex_); 50 | set_formatter_(std::move(sink_formatter)); 51 | } 52 | 53 | protected: 54 | virtual void sink_it_(const details::log_msg &msg) = 0; 55 | virtual void flush_() = 0; 56 | 57 | virtual void set_pattern_(const std::string &pattern) 58 | { 59 | set_formatter_(details::make_unique(pattern)); 60 | } 61 | 62 | virtual void set_formatter_(std::unique_ptr sink_formatter) 63 | { 64 | formatter_ = std::move(sink_formatter); 65 | } 66 | Mutex mutex_; 67 | }; 68 | } // namespace sinks 69 | } // namespace spdlog 70 | -------------------------------------------------------------------------------- /deps/spdlog/sinks/basic_file_sink.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(c) 2015-2018 Gabi Melman. 3 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 4 | // 5 | 6 | #pragma once 7 | 8 | #ifndef SPDLOG_H 9 | #include "spdlog/spdlog.h" 10 | #endif 11 | 12 | #include "spdlog/details/file_helper.h" 13 | #include "spdlog/details/null_mutex.h" 14 | #include "spdlog/sinks/base_sink.h" 15 | 16 | #include 17 | #include 18 | 19 | namespace spdlog { 20 | namespace sinks { 21 | /* 22 | * Trivial file sink with single file as target 23 | */ 24 | template 25 | class basic_file_sink final : public base_sink 26 | { 27 | public: 28 | explicit basic_file_sink(const filename_t &filename, bool truncate = false) 29 | { 30 | file_helper_.open(filename, truncate); 31 | } 32 | 33 | protected: 34 | void sink_it_(const details::log_msg &msg) override 35 | { 36 | fmt::memory_buffer formatted; 37 | sink::formatter_->format(msg, formatted); 38 | file_helper_.write(formatted); 39 | } 40 | 41 | void flush_() override 42 | { 43 | file_helper_.flush(); 44 | } 45 | 46 | private: 47 | details::file_helper file_helper_; 48 | }; 49 | 50 | using basic_file_sink_mt = basic_file_sink; 51 | using basic_file_sink_st = basic_file_sink; 52 | 53 | } // namespace sinks 54 | 55 | // 56 | // factory functions 57 | // 58 | template 59 | inline std::shared_ptr basic_logger_mt(const std::string &logger_name, const filename_t &filename, bool truncate = false) 60 | { 61 | return Factory::template create(logger_name, filename, truncate); 62 | } 63 | 64 | template 65 | inline std::shared_ptr basic_logger_st(const std::string &logger_name, const filename_t &filename, bool truncate = false) 66 | { 67 | return Factory::template create(logger_name, filename, truncate); 68 | } 69 | 70 | } // namespace spdlog 71 | -------------------------------------------------------------------------------- /deps/spdlog/sinks/msvc_sink.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(c) 2016 Alexander Dalshov. 3 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 4 | // 5 | 6 | #pragma once 7 | 8 | #ifndef SPDLOG_H 9 | #include "spdlog/spdlog.h" 10 | #endif 11 | 12 | #if defined(_WIN32) 13 | 14 | #include "spdlog/details/null_mutex.h" 15 | #include "spdlog/sinks/base_sink.h" 16 | 17 | #include 18 | 19 | #include 20 | #include 21 | 22 | namespace spdlog { 23 | namespace sinks { 24 | /* 25 | * MSVC sink (logging using OutputDebugStringA) 26 | */ 27 | template 28 | class msvc_sink : public base_sink 29 | { 30 | public: 31 | explicit msvc_sink() {} 32 | 33 | protected: 34 | void sink_it_(const details::log_msg &msg) override 35 | { 36 | 37 | fmt::memory_buffer formatted; 38 | sink::formatter_->format(msg, formatted); 39 | OutputDebugStringA(fmt::to_string(formatted).c_str()); 40 | } 41 | 42 | void flush_() override {} 43 | }; 44 | 45 | using msvc_sink_mt = msvc_sink; 46 | using msvc_sink_st = msvc_sink; 47 | 48 | using windebug_sink_mt = msvc_sink_mt; 49 | using windebug_sink_st = msvc_sink_st; 50 | 51 | } // namespace sinks 52 | } // namespace spdlog 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /deps/spdlog/sinks/null_sink.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(c) 2015 Gabi Melman. 3 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 4 | // 5 | 6 | #pragma once 7 | 8 | #ifndef SPDLOG_H 9 | #include "spdlog/spdlog.h" 10 | #endif 11 | 12 | #include "spdlog/details/null_mutex.h" 13 | #include "spdlog/sinks/base_sink.h" 14 | 15 | #include 16 | 17 | namespace spdlog { 18 | namespace sinks { 19 | 20 | template 21 | class null_sink : public base_sink 22 | { 23 | protected: 24 | void sink_it_(const details::log_msg &) override {} 25 | void flush_() override {} 26 | }; 27 | 28 | using null_sink_mt = null_sink; 29 | using null_sink_st = null_sink; 30 | 31 | } // namespace sinks 32 | 33 | template 34 | inline std::shared_ptr null_logger_mt(const std::string &logger_name) 35 | { 36 | auto null_logger = Factory::template create(logger_name); 37 | null_logger->set_level(level::off); 38 | return null_logger; 39 | } 40 | 41 | template 42 | inline std::shared_ptr null_logger_st(const std::string &logger_name) 43 | { 44 | auto null_logger = Factory::template create(logger_name); 45 | null_logger->set_level(level::off); 46 | return null_logger; 47 | } 48 | 49 | } // namespace spdlog 50 | -------------------------------------------------------------------------------- /deps/spdlog/sinks/ostream_sink.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(c) 2015 Gabi Melman. 3 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 4 | // 5 | 6 | #pragma once 7 | 8 | #ifndef SPDLOG_H 9 | #include "spdlog/spdlog.h" 10 | #endif 11 | 12 | #include "spdlog/details/null_mutex.h" 13 | #include "spdlog/sinks/base_sink.h" 14 | 15 | #include 16 | #include 17 | 18 | namespace spdlog { 19 | namespace sinks { 20 | template 21 | class ostream_sink final : public base_sink 22 | { 23 | public: 24 | explicit ostream_sink(std::ostream &os, bool force_flush = false) 25 | : ostream_(os) 26 | , force_flush_(force_flush) 27 | { 28 | } 29 | ostream_sink(const ostream_sink &) = delete; 30 | ostream_sink &operator=(const ostream_sink &) = delete; 31 | 32 | protected: 33 | void sink_it_(const details::log_msg &msg) override 34 | { 35 | fmt::memory_buffer formatted; 36 | sink::formatter_->format(msg, formatted); 37 | ostream_.write(formatted.data(), static_cast(formatted.size())); 38 | if (force_flush_) 39 | { 40 | ostream_.flush(); 41 | } 42 | } 43 | 44 | void flush_() override 45 | { 46 | ostream_.flush(); 47 | } 48 | 49 | std::ostream &ostream_; 50 | bool force_flush_; 51 | }; 52 | 53 | using ostream_sink_mt = ostream_sink; 54 | using ostream_sink_st = ostream_sink; 55 | 56 | } // namespace sinks 57 | } // namespace spdlog 58 | -------------------------------------------------------------------------------- /deps/spdlog/sinks/sink.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(c) 2015 Gabi Melman. 3 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 4 | // 5 | 6 | #pragma once 7 | 8 | #include "spdlog/details/log_msg.h" 9 | #include "spdlog/details/pattern_formatter.h" 10 | #include "spdlog/formatter.h" 11 | 12 | namespace spdlog { 13 | namespace sinks { 14 | class sink 15 | { 16 | public: 17 | sink() 18 | : level_(level::trace) 19 | , formatter_(new pattern_formatter()) 20 | { 21 | } 22 | 23 | explicit sink(std::unique_ptr formatter) 24 | : level_(level::trace) 25 | , formatter_(std::move(formatter)) 26 | { 27 | } 28 | 29 | virtual ~sink() = default; 30 | virtual void log(const details::log_msg &msg) = 0; 31 | virtual void flush() = 0; 32 | virtual void set_pattern(const std::string &pattern) = 0; 33 | virtual void set_formatter(std::unique_ptr sink_formatter) = 0; 34 | 35 | bool should_log(level::level_enum msg_level) const 36 | { 37 | return msg_level >= level_.load(std::memory_order_relaxed); 38 | } 39 | 40 | void set_level(level::level_enum log_level) 41 | { 42 | level_.store(log_level); 43 | } 44 | 45 | level::level_enum level() const 46 | { 47 | return static_cast(level_.load(std::memory_order_relaxed)); 48 | } 49 | 50 | protected: 51 | // sink log level - default is all 52 | level_t level_; 53 | 54 | // sink formatter - default is full format 55 | std::unique_ptr formatter_; 56 | }; 57 | 58 | } // namespace sinks 59 | } // namespace spdlog 60 | -------------------------------------------------------------------------------- /deps/spdlog/sinks/stdout_color_sinks.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(c) 2018 spdlog 3 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 4 | // 5 | 6 | #pragma once 7 | 8 | #ifndef SPDLOG_H 9 | #include "spdlog/spdlog.h" 10 | #endif 11 | 12 | #ifdef _WIN32 13 | #include "spdlog/sinks/wincolor_sink.h" 14 | #else 15 | #include "spdlog/sinks/ansicolor_sink.h" 16 | #endif 17 | 18 | namespace spdlog { 19 | namespace sinks { 20 | #ifdef _WIN32 21 | using stdout_color_sink_mt = wincolor_stdout_sink_mt; 22 | using stdout_color_sink_st = wincolor_stdout_sink_st; 23 | using stderr_color_sink_mt = wincolor_stderr_sink_mt; 24 | using stderr_color_sink_st = wincolor_stderr_sink_st; 25 | #else 26 | using stdout_color_sink_mt = ansicolor_stdout_sink_mt; 27 | using stdout_color_sink_st = ansicolor_stdout_sink_st; 28 | using stderr_color_sink_mt = ansicolor_stderr_sink_mt; 29 | using stderr_color_sink_st = ansicolor_stderr_sink_st; 30 | #endif 31 | } // namespace sinks 32 | 33 | template 34 | inline std::shared_ptr stdout_color_mt(const std::string &logger_name) 35 | { 36 | return Factory::template create(logger_name); 37 | } 38 | 39 | template 40 | inline std::shared_ptr stdout_color_st(const std::string &logger_name) 41 | { 42 | return Factory::template create(logger_name); 43 | } 44 | 45 | template 46 | inline std::shared_ptr stderr_color_mt(const std::string &logger_name) 47 | { 48 | return Factory::template create(logger_name); 49 | } 50 | 51 | template 52 | inline std::shared_ptr stderr_color_st(const std::string &logger_name) 53 | { 54 | return Factory::template create(logger_name); 55 | } 56 | } // namespace spdlog 57 | -------------------------------------------------------------------------------- /deps/spdlog/version.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(c) 2015 Gabi Melman. 3 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 4 | // 5 | 6 | #pragma once 7 | 8 | #define SPDLOG_VER_MAJOR 1 9 | #define SPDLOG_VER_MINOR 3 10 | #define SPDLOG_VER_PATCH 1 11 | 12 | #define SPDLOG_VERSION (SPDLOG_VER_MAJOR * 10000 + SPDLOG_VER_MINOR * 100 + SPDLOG_VER_PATCH) 13 | -------------------------------------------------------------------------------- /deps/utf8.h: -------------------------------------------------------------------------------- 1 | // Copyright 2006 Nemanja Trifunovic 2 | 3 | /* 4 | Permission is hereby granted, free of charge, to any person or organization 5 | obtaining a copy of the software and accompanying documentation covered by 6 | this license (the "Software") to use, reproduce, display, distribute, 7 | execute, and transmit the Software, and to prepare derivative works of the 8 | Software, and to permit third-parties to whom the Software is furnished to 9 | do so, all subject to the following: 10 | 11 | The copyright notices in the Software and this entire statement, including 12 | the above license grant, this restriction and the following disclaimer, 13 | must be included in all copies of the Software, in whole or in part, and 14 | all derivative works of the Software, unless such copies or derivative 15 | works are solely in the form of machine-executable object code generated by 16 | a source language processor. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 21 | SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 22 | FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 23 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 24 | DEALINGS IN THE SOFTWARE. 25 | */ 26 | 27 | #ifndef UTF8_FOR_CPP_2675DCD0_9480_4c0c_B92A_CC14C027B731 28 | #define UTF8_FOR_CPP_2675DCD0_9480_4c0c_B92A_CC14C027B731 29 | 30 | #include "utf8/checked.h" 31 | #include "utf8/unchecked.h" 32 | 33 | #endif // header guard 34 | -------------------------------------------------------------------------------- /nx.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.25420.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nx", "platform\win32\nx\nx.vcxproj", "{CECC2B34-F07A-41D9-B7D8-F0FA79366710}" 7 | EndProject 8 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "extract", "platform\win32\extract\extract.vcxproj", "{42C0C7A1-1243-4FF3-AAA5-12C0485EA811}" 9 | EndProject 10 | Global 11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 12 | Debug|x64 = Debug|x64 13 | Debug|x86 = Debug|x86 14 | Release|x64 = Release|x64 15 | Release|x86 = Release|x86 16 | EndGlobalSection 17 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 18 | {CECC2B34-F07A-41D9-B7D8-F0FA79366710}.Debug|x64.ActiveCfg = Debug|x64 19 | {CECC2B34-F07A-41D9-B7D8-F0FA79366710}.Debug|x64.Build.0 = Debug|x64 20 | {CECC2B34-F07A-41D9-B7D8-F0FA79366710}.Debug|x86.ActiveCfg = Debug|Win32 21 | {CECC2B34-F07A-41D9-B7D8-F0FA79366710}.Debug|x86.Build.0 = Debug|Win32 22 | {CECC2B34-F07A-41D9-B7D8-F0FA79366710}.Release|x64.ActiveCfg = Release|x64 23 | {CECC2B34-F07A-41D9-B7D8-F0FA79366710}.Release|x64.Build.0 = Release|x64 24 | {CECC2B34-F07A-41D9-B7D8-F0FA79366710}.Release|x86.ActiveCfg = Release|Win32 25 | {CECC2B34-F07A-41D9-B7D8-F0FA79366710}.Release|x86.Build.0 = Release|Win32 26 | {42C0C7A1-1243-4FF3-AAA5-12C0485EA811}.Debug|x64.ActiveCfg = Debug|x64 27 | {42C0C7A1-1243-4FF3-AAA5-12C0485EA811}.Debug|x64.Build.0 = Debug|x64 28 | {42C0C7A1-1243-4FF3-AAA5-12C0485EA811}.Debug|x86.ActiveCfg = Debug|Win32 29 | {42C0C7A1-1243-4FF3-AAA5-12C0485EA811}.Debug|x86.Build.0 = Debug|Win32 30 | {42C0C7A1-1243-4FF3-AAA5-12C0485EA811}.Release|x64.ActiveCfg = Release|x64 31 | {42C0C7A1-1243-4FF3-AAA5-12C0485EA811}.Release|x64.Build.0 = Release|x64 32 | {42C0C7A1-1243-4FF3-AAA5-12C0485EA811}.Release|x86.ActiveCfg = Release|Win32 33 | {42C0C7A1-1243-4FF3-AAA5-12C0485EA811}.Release|x86.Build.0 = Release|Win32 34 | EndGlobalSection 35 | GlobalSection(SolutionProperties) = preSolution 36 | HideSolutionNode = FALSE 37 | EndGlobalSection 38 | EndGlobal 39 | -------------------------------------------------------------------------------- /org.nxengine.nxengine_evo.json: -------------------------------------------------------------------------------- 1 | { 2 | "app-id": "org.nxengine.nxengine_evo", 3 | "runtime": "org.freedesktop.Platform", 4 | "runtime-version": "23.08", 5 | "sdk": "org.freedesktop.Sdk", 6 | "command": "nxengine-evo", 7 | "finish-args": [ 8 | "--socket=fallback-x11", 9 | "--share=ipc", 10 | "--socket=wayland", 11 | "--device=dri", 12 | 13 | "--socket=pulseaudio" 14 | ], 15 | 16 | "modules": [ 17 | { 18 | "name": "nxengine-evo", 19 | "buildsystem": "cmake-ninja", 20 | "post-install": [ 21 | "build-scripts/utils/common.install-extern.sh \"${FLATPAK_DEST}/share/nxengine\" \"${FLATPAK_DEST}/bin/nxextract\"" 22 | ], 23 | 24 | "sources": [ 25 | { 26 | "type": "git", 27 | "path": ".", 28 | "tag": "HEAD" 29 | }, 30 | { 31 | "type": "archive", 32 | "url": "https://github.com/nxengine/translations/releases/download/v1.14/all.zip", 33 | "sha256": "1dd85a8c230c5ebf23c6fd6283fe168d9bf4044339d1e93e324bd336165a4422", 34 | "strip-components": 2, 35 | "dest": "extern/Translations" 36 | }, 37 | { 38 | "type": "archive", 39 | "url": "https://sarcasticat.com/cavestoryen.zip", 40 | "sha256": "aa87fa30bee9b4980640c7e104791354e0f1f6411ee0d45a70af70046aa0685f", 41 | "dest": "extern/CaveStory" 42 | } 43 | ], 44 | 45 | "//": "No long list of build dependencies here as all requried dependencies are included in the FreeDesktop runtime already", 46 | "modules": [] 47 | } 48 | ] 49 | } 50 | -------------------------------------------------------------------------------- /platform/osx/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleExecutable 6 | NXEngine 7 | CFBundleIconFile 8 | icons.icns 9 | CFBundleInfoDictionaryVersion 10 | 1.0 11 | CFBundlePackageType 12 | APPL 13 | CFBundleSignature 14 | ???? 15 | CFBundleVersion 16 | 2.6.5 17 | 18 | 19 | -------------------------------------------------------------------------------- /platform/osx/bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxengine/nxengine-evo/f8fb001fa86c72af50c1fb2b4495d80c2a4159e7/platform/osx/bg.png -------------------------------------------------------------------------------- /platform/osx/icons.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxengine/nxengine-evo/f8fb001fa86c72af50c1fb2b4495d80c2a4159e7/platform/osx/icons.icns -------------------------------------------------------------------------------- /platform/switch/icon.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxengine/nxengine-evo/f8fb001fa86c72af50c1fb2b4495d80c2a4159e7/platform/switch/icon.jpg -------------------------------------------------------------------------------- /platform/vita/sce_sys/icon0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxengine/nxengine-evo/f8fb001fa86c72af50c1fb2b4495d80c2a4159e7/platform/vita/sce_sys/icon0.png -------------------------------------------------------------------------------- /platform/vita/sce_sys/livearea/contents/bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxengine/nxengine-evo/f8fb001fa86c72af50c1fb2b4495d80c2a4159e7/platform/vita/sce_sys/livearea/contents/bg.png -------------------------------------------------------------------------------- /platform/vita/sce_sys/livearea/contents/startup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxengine/nxengine-evo/f8fb001fa86c72af50c1fb2b4495d80c2a4159e7/platform/vita/sce_sys/livearea/contents/startup.png -------------------------------------------------------------------------------- /platform/vita/sce_sys/livearea/contents/template.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | bg.png 6 | 7 | 8 | 9 | startup.png 10 | 11 | 12 | 13 | 14 | 15 | NXEngine-evo 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /platform/win32/ext/include/SDL_clipboard.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2020 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_clipboard.h 24 | * 25 | * Include file for SDL clipboard handling 26 | */ 27 | 28 | #ifndef SDL_clipboard_h_ 29 | #define SDL_clipboard_h_ 30 | 31 | #include "SDL_stdinc.h" 32 | 33 | #include "begin_code.h" 34 | /* Set up for C function definitions, even when using C++ */ 35 | #ifdef __cplusplus 36 | extern "C" { 37 | #endif 38 | 39 | /* Function prototypes */ 40 | 41 | /** 42 | * \brief Put UTF-8 text into the clipboard 43 | * 44 | * \sa SDL_GetClipboardText() 45 | */ 46 | extern DECLSPEC int SDLCALL SDL_SetClipboardText(const char *text); 47 | 48 | /** 49 | * \brief Get UTF-8 text from the clipboard, which must be freed with SDL_free() 50 | * 51 | * \sa SDL_SetClipboardText() 52 | */ 53 | extern DECLSPEC char * SDLCALL SDL_GetClipboardText(void); 54 | 55 | /** 56 | * \brief Returns a flag indicating whether the clipboard exists and contains a text string that is non-empty 57 | * 58 | * \sa SDL_GetClipboardText() 59 | */ 60 | extern DECLSPEC SDL_bool SDLCALL SDL_HasClipboardText(void); 61 | 62 | 63 | /* Ends C function definitions when using C++ */ 64 | #ifdef __cplusplus 65 | } 66 | #endif 67 | #include "close_code.h" 68 | 69 | #endif /* SDL_clipboard_h_ */ 70 | 71 | /* vi: set ts=4 sw=4 expandtab: */ 72 | -------------------------------------------------------------------------------- /platform/win32/ext/include/SDL_copying.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2017 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | -------------------------------------------------------------------------------- /platform/win32/ext/include/SDL_name.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2020 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | #ifndef SDLname_h_ 23 | #define SDLname_h_ 24 | 25 | #if defined(__STDC__) || defined(__cplusplus) 26 | #define NeedFunctionPrototypes 1 27 | #endif 28 | 29 | #define SDL_NAME(X) SDL_##X 30 | 31 | #endif /* SDLname_h_ */ 32 | 33 | /* vi: set ts=4 sw=4 expandtab: */ 34 | -------------------------------------------------------------------------------- /platform/win32/ext/include/SDL_opengles.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2020 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_opengles.h 24 | * 25 | * This is a simple file to encapsulate the OpenGL ES 1.X API headers. 26 | */ 27 | #include "SDL_config.h" 28 | 29 | #ifdef __IPHONEOS__ 30 | #include 31 | #include 32 | #else 33 | #include 34 | #include 35 | #endif 36 | 37 | #ifndef APIENTRY 38 | #define APIENTRY 39 | #endif 40 | -------------------------------------------------------------------------------- /platform/win32/ext/include/SDL_opengles2.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2020 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_opengles2.h 24 | * 25 | * This is a simple file to encapsulate the OpenGL ES 2.0 API headers. 26 | */ 27 | #include "SDL_config.h" 28 | 29 | #ifndef _MSC_VER 30 | 31 | #ifdef __IPHONEOS__ 32 | #include 33 | #include 34 | #else 35 | #include 36 | #include 37 | #include 38 | #endif 39 | 40 | #else /* _MSC_VER */ 41 | 42 | /* OpenGL ES2 headers for Visual Studio */ 43 | #include "SDL_opengles2_khrplatform.h" 44 | #include "SDL_opengles2_gl2platform.h" 45 | #include "SDL_opengles2_gl2.h" 46 | #include "SDL_opengles2_gl2ext.h" 47 | 48 | #endif /* _MSC_VER */ 49 | 50 | #ifndef APIENTRY 51 | #define APIENTRY GL_APIENTRY 52 | #endif 53 | -------------------------------------------------------------------------------- /platform/win32/ext/include/SDL_opengles2_gl2platform.h: -------------------------------------------------------------------------------- 1 | #ifndef __gl2platform_h_ 2 | #define __gl2platform_h_ 3 | 4 | /* $Revision: 10602 $ on $Date:: 2010-03-04 22:35:34 -0800 #$ */ 5 | 6 | /* 7 | * This document is licensed under the SGI Free Software B License Version 8 | * 2.0. For details, see http://oss.sgi.com/projects/FreeB/ . 9 | */ 10 | 11 | /* Platform-specific types and definitions for OpenGL ES 2.X gl2.h 12 | * 13 | * Adopters may modify khrplatform.h and this file to suit their platform. 14 | * You are encouraged to submit all modifications to the Khronos group so that 15 | * they can be included in future versions of this file. Please submit changes 16 | * by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla) 17 | * by filing a bug against product "OpenGL-ES" component "Registry". 18 | */ 19 | 20 | /*#include */ 21 | 22 | #ifndef GL_APICALL 23 | #define GL_APICALL KHRONOS_APICALL 24 | #endif 25 | 26 | #ifndef GL_APIENTRY 27 | #define GL_APIENTRY KHRONOS_APIENTRY 28 | #endif 29 | 30 | #endif /* __gl2platform_h_ */ 31 | -------------------------------------------------------------------------------- /platform/win32/ext/include/SDL_revision.h: -------------------------------------------------------------------------------- 1 | #define SDL_REVISION "hg-14525:e52d96ea04fc" 2 | #define SDL_REVISION_NUMBER 14525 3 | -------------------------------------------------------------------------------- /platform/win32/ext/include/SDL_test.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2020 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_test.h 24 | * 25 | * Include file for SDL test framework. 26 | * 27 | * This code is a part of the SDL2_test library, not the main SDL library. 28 | */ 29 | 30 | #ifndef SDL_test_h_ 31 | #define SDL_test_h_ 32 | 33 | #include "SDL.h" 34 | #include "SDL_test_assert.h" 35 | #include "SDL_test_common.h" 36 | #include "SDL_test_compare.h" 37 | #include "SDL_test_crc32.h" 38 | #include "SDL_test_font.h" 39 | #include "SDL_test_fuzzer.h" 40 | #include "SDL_test_harness.h" 41 | #include "SDL_test_images.h" 42 | #include "SDL_test_log.h" 43 | #include "SDL_test_md5.h" 44 | #include "SDL_test_memory.h" 45 | #include "SDL_test_random.h" 46 | 47 | #include "begin_code.h" 48 | /* Set up for C function definitions, even when using C++ */ 49 | #ifdef __cplusplus 50 | extern "C" { 51 | #endif 52 | 53 | /* Global definitions */ 54 | 55 | /* 56 | * Note: Maximum size of SDLTest log message is less than SDL's limit 57 | * to ensure we can fit additional information such as the timestamp. 58 | */ 59 | #define SDLTEST_MAX_LOGMESSAGE_LENGTH 3584 60 | 61 | /* Ends C function definitions when using C++ */ 62 | #ifdef __cplusplus 63 | } 64 | #endif 65 | #include "close_code.h" 66 | 67 | #endif /* SDL_test_h_ */ 68 | 69 | /* vi: set ts=4 sw=4 expandtab: */ 70 | -------------------------------------------------------------------------------- /platform/win32/ext/include/SDL_test_log.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2020 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_test_log.h 24 | * 25 | * Include file for SDL test framework. 26 | * 27 | * This code is a part of the SDL2_test library, not the main SDL library. 28 | */ 29 | 30 | /* 31 | * 32 | * Wrapper to log in the TEST category 33 | * 34 | */ 35 | 36 | #ifndef SDL_test_log_h_ 37 | #define SDL_test_log_h_ 38 | 39 | #include "begin_code.h" 40 | /* Set up for C function definitions, even when using C++ */ 41 | #ifdef __cplusplus 42 | extern "C" { 43 | #endif 44 | 45 | /** 46 | * \brief Prints given message with a timestamp in the TEST category and INFO priority. 47 | * 48 | * \param fmt Message to be logged 49 | */ 50 | void SDLTest_Log(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1); 51 | 52 | /** 53 | * \brief Prints given message with a timestamp in the TEST category and the ERROR priority. 54 | * 55 | * \param fmt Message to be logged 56 | */ 57 | void SDLTest_LogError(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1); 58 | 59 | /* Ends C function definitions when using C++ */ 60 | #ifdef __cplusplus 61 | } 62 | #endif 63 | #include "close_code.h" 64 | 65 | #endif /* SDL_test_log_h_ */ 66 | 67 | /* vi: set ts=4 sw=4 expandtab: */ 68 | -------------------------------------------------------------------------------- /platform/win32/ext/include/SDL_test_memory.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2020 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_test_memory.h 24 | * 25 | * Include file for SDL test framework. 26 | * 27 | * This code is a part of the SDL2_test library, not the main SDL library. 28 | */ 29 | 30 | #ifndef SDL_test_memory_h_ 31 | #define SDL_test_memory_h_ 32 | 33 | #include "begin_code.h" 34 | /* Set up for C function definitions, even when using C++ */ 35 | #ifdef __cplusplus 36 | extern "C" { 37 | #endif 38 | 39 | 40 | /** 41 | * \brief Start tracking SDL memory allocations 42 | * 43 | * \note This should be called before any other SDL functions for complete tracking coverage 44 | */ 45 | int SDLTest_TrackAllocations(void); 46 | 47 | /** 48 | * \brief Print a log of any outstanding allocations 49 | * 50 | * \note This can be called after SDL_Quit() 51 | */ 52 | void SDLTest_LogAllocations(void); 53 | 54 | 55 | /* Ends C function definitions when using C++ */ 56 | #ifdef __cplusplus 57 | } 58 | #endif 59 | #include "close_code.h" 60 | 61 | #endif /* SDL_test_memory_h_ */ 62 | 63 | /* vi: set ts=4 sw=4 expandtab: */ 64 | -------------------------------------------------------------------------------- /platform/win32/ext/include/SDL_types.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2020 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_types.h 24 | * 25 | * \deprecated 26 | */ 27 | 28 | /* DEPRECATED */ 29 | #include "SDL_stdinc.h" 30 | -------------------------------------------------------------------------------- /platform/win32/ext/include/close_code.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2020 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file close_code.h 24 | * 25 | * This file reverses the effects of begin_code.h and should be included 26 | * after you finish any function and structure declarations in your headers 27 | */ 28 | 29 | #ifndef _begin_code_h 30 | #error close_code.h included without matching begin_code.h 31 | #endif 32 | #undef _begin_code_h 33 | 34 | /* Reset structure packing at previous byte alignment */ 35 | #if defined(_MSC_VER) || defined(__MWERKS__) || defined(__BORLANDC__) 36 | #ifdef __BORLANDC__ 37 | #pragma nopackwarning 38 | #endif 39 | #pragma pack(pop) 40 | #endif /* Compiler needs structure packing set */ 41 | -------------------------------------------------------------------------------- /platform/win32/ext/lib/x64/SDL2.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxengine/nxengine-evo/f8fb001fa86c72af50c1fb2b4495d80c2a4159e7/platform/win32/ext/lib/x64/SDL2.lib -------------------------------------------------------------------------------- /platform/win32/ext/lib/x64/SDL2_image.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxengine/nxengine-evo/f8fb001fa86c72af50c1fb2b4495d80c2a4159e7/platform/win32/ext/lib/x64/SDL2_image.lib -------------------------------------------------------------------------------- /platform/win32/ext/lib/x64/SDL2_mixer.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxengine/nxengine-evo/f8fb001fa86c72af50c1fb2b4495d80c2a4159e7/platform/win32/ext/lib/x64/SDL2_mixer.lib -------------------------------------------------------------------------------- /platform/win32/ext/lib/x64/SDL2main.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxengine/nxengine-evo/f8fb001fa86c72af50c1fb2b4495d80c2a4159e7/platform/win32/ext/lib/x64/SDL2main.lib -------------------------------------------------------------------------------- /platform/win32/ext/lib/x64/SDL2test.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxengine/nxengine-evo/f8fb001fa86c72af50c1fb2b4495d80c2a4159e7/platform/win32/ext/lib/x64/SDL2test.lib -------------------------------------------------------------------------------- /platform/win32/ext/lib/x64/libpng16.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxengine/nxengine-evo/f8fb001fa86c72af50c1fb2b4495d80c2a4159e7/platform/win32/ext/lib/x64/libpng16.lib -------------------------------------------------------------------------------- /platform/win32/ext/runtime/x64/SDL2.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxengine/nxengine-evo/f8fb001fa86c72af50c1fb2b4495d80c2a4159e7/platform/win32/ext/runtime/x64/SDL2.dll -------------------------------------------------------------------------------- /platform/win32/ext/runtime/x64/SDL2_image.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxengine/nxengine-evo/f8fb001fa86c72af50c1fb2b4495d80c2a4159e7/platform/win32/ext/runtime/x64/SDL2_image.dll -------------------------------------------------------------------------------- /platform/win32/ext/runtime/x64/SDL2_mixer.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxengine/nxengine-evo/f8fb001fa86c72af50c1fb2b4495d80c2a4159e7/platform/win32/ext/runtime/x64/SDL2_mixer.dll -------------------------------------------------------------------------------- /platform/win32/ext/runtime/x64/libFLAC-8.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxengine/nxengine-evo/f8fb001fa86c72af50c1fb2b4495d80c2a4159e7/platform/win32/ext/runtime/x64/libFLAC-8.dll -------------------------------------------------------------------------------- /platform/win32/ext/runtime/x64/libjpeg-9.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxengine/nxengine-evo/f8fb001fa86c72af50c1fb2b4495d80c2a4159e7/platform/win32/ext/runtime/x64/libjpeg-9.dll -------------------------------------------------------------------------------- /platform/win32/ext/runtime/x64/libmodplug-1.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxengine/nxengine-evo/f8fb001fa86c72af50c1fb2b4495d80c2a4159e7/platform/win32/ext/runtime/x64/libmodplug-1.dll -------------------------------------------------------------------------------- /platform/win32/ext/runtime/x64/libmpg123-0.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxengine/nxengine-evo/f8fb001fa86c72af50c1fb2b4495d80c2a4159e7/platform/win32/ext/runtime/x64/libmpg123-0.dll -------------------------------------------------------------------------------- /platform/win32/ext/runtime/x64/libogg-0.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxengine/nxengine-evo/f8fb001fa86c72af50c1fb2b4495d80c2a4159e7/platform/win32/ext/runtime/x64/libogg-0.dll -------------------------------------------------------------------------------- /platform/win32/ext/runtime/x64/libopus-0.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxengine/nxengine-evo/f8fb001fa86c72af50c1fb2b4495d80c2a4159e7/platform/win32/ext/runtime/x64/libopus-0.dll -------------------------------------------------------------------------------- /platform/win32/ext/runtime/x64/libopusfile-0.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxengine/nxengine-evo/f8fb001fa86c72af50c1fb2b4495d80c2a4159e7/platform/win32/ext/runtime/x64/libopusfile-0.dll -------------------------------------------------------------------------------- /platform/win32/ext/runtime/x64/libpng16-16.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxengine/nxengine-evo/f8fb001fa86c72af50c1fb2b4495d80c2a4159e7/platform/win32/ext/runtime/x64/libpng16-16.dll -------------------------------------------------------------------------------- /platform/win32/ext/runtime/x64/libpng16.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxengine/nxengine-evo/f8fb001fa86c72af50c1fb2b4495d80c2a4159e7/platform/win32/ext/runtime/x64/libpng16.dll -------------------------------------------------------------------------------- /platform/win32/ext/runtime/x64/libtiff-5.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxengine/nxengine-evo/f8fb001fa86c72af50c1fb2b4495d80c2a4159e7/platform/win32/ext/runtime/x64/libtiff-5.dll -------------------------------------------------------------------------------- /platform/win32/ext/runtime/x64/libvorbis-0.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxengine/nxengine-evo/f8fb001fa86c72af50c1fb2b4495d80c2a4159e7/platform/win32/ext/runtime/x64/libvorbis-0.dll -------------------------------------------------------------------------------- /platform/win32/ext/runtime/x64/libvorbisfile-3.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxengine/nxengine-evo/f8fb001fa86c72af50c1fb2b4495d80c2a4159e7/platform/win32/ext/runtime/x64/libvorbisfile-3.dll -------------------------------------------------------------------------------- /platform/win32/ext/runtime/x64/libwebp-7.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxengine/nxengine-evo/f8fb001fa86c72af50c1fb2b4495d80c2a4159e7/platform/win32/ext/runtime/x64/libwebp-7.dll -------------------------------------------------------------------------------- /platform/win32/ext/runtime/x64/zlib1.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxengine/nxengine-evo/f8fb001fa86c72af50c1fb2b4495d80c2a4159e7/platform/win32/ext/runtime/x64/zlib1.dll -------------------------------------------------------------------------------- /platform/win32/nx/nx.aps: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxengine/nxengine-evo/f8fb001fa86c72af50c1fb2b4495d80c2a4159e7/platform/win32/nx/nx.aps -------------------------------------------------------------------------------- /platform/win32/nx/nx.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxengine/nxengine-evo/f8fb001fa86c72af50c1fb2b4495d80c2a4159e7/platform/win32/nx/nx.rc -------------------------------------------------------------------------------- /platform/win32/nx/nx.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /platform/win32/nx/resource.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxengine/nxengine-evo/f8fb001fa86c72af50c1fb2b4495d80c2a4159e7/platform/win32/nx/resource.h -------------------------------------------------------------------------------- /platform/win32/nx64x64.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxengine/nxengine-evo/f8fb001fa86c72af50c1fb2b4495d80c2a4159e7/platform/win32/nx64x64.ico -------------------------------------------------------------------------------- /platform/xdg/appdata-add-version.xslt: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /platform/xdg/org.nxengine.nxengine_evo.appdata.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.nxengine.nxengine_evo 4 | CC0-1.0 5 | GPL-3.0-or-later AND LicenseRef-proprietary=https://studiopixel.jp/doukutsumonogatari/ 6 | Cave Story (NXEngine Evo) 7 | Classic jump-and-run platformer game 8 | 9 | Game 10 | ActionGame 11 | 12 | 13 | moderate 14 | moderate 15 | moderate 16 | 17 | 18 |

Rewrite of the jump-and-run platformer masterpiece Doukutsu Monogatari (also commonly known as Cave Story).

19 |
20 | 21 | 22 | https://raw.githubusercontent.com/nxengine/nxengine-evo/master/screenshot.png 23 | 24 | 25 | https://github.com/nxengine/nxengine-evo/ 26 | https://github.com/nxengine/nxengine-evo/issues/ 27 | 28 | org.nxengine.nxengine_evo.desktop 29 | 30 | org.nxengine.nxengine_evo.desktop 31 | 32 | 33 | 34 | 35 | 36 |
37 | -------------------------------------------------------------------------------- /platform/xdg/org.nxengine.nxengine_evo.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Version=1.0 3 | Type=Application 4 | Terminal=false 5 | Name=Cave Story (NXEngine Evo) 6 | GenericName=Jump-and-run Platformer Game 7 | Comment=Rewrite of the jump-and-run platformer masterpiece Doukutsu Monogatari 8 | Exec=nxengine-evo 9 | Categories=Game;ActionGame; 10 | Icon=org.nxengine.nxengine_evo 11 | -------------------------------------------------------------------------------- /platform/xdg/org.nxengine.nxengine_evo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxengine/nxengine-evo/f8fb001fa86c72af50c1fb2b4495d80c2a4159e7/platform/xdg/org.nxengine.nxengine_evo.png -------------------------------------------------------------------------------- /screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxengine/nxengine-evo/f8fb001fa86c72af50c1fb2b4495d80c2a4159e7/screenshot.png -------------------------------------------------------------------------------- /src/ResourceManager.h: -------------------------------------------------------------------------------- 1 | #ifndef _RESOURCEMANAGER_H 2 | #define _RESOURCEMANAGER_H 3 | 4 | #include "Singleton.h" 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | typedef struct { 13 | std::string dir; 14 | std::string name; 15 | bool skip_intro; 16 | } Mod; 17 | 18 | class ResourceManager 19 | { 20 | 21 | public: 22 | static ResourceManager *getInstance(); 23 | static bool fileExists(const std::string &filename); 24 | 25 | /** 26 | * Returns the base path to binary 27 | */ 28 | std::string getBasePath(); 29 | 30 | /** 31 | * Returns the path to the directory where user-data resides 32 | */ 33 | std::string getUserPrefPath(); 34 | 35 | void shutdown(); 36 | std::string getPath(const std::string &filename, bool localized = true); 37 | 38 | std::string getPrefPath(const std::string &filename); 39 | 40 | std::string getPathForDir(const std::string &dir); 41 | 42 | std::vector &languages(); 43 | Mod& mod(std::string& name); 44 | void setMod(std::string name); 45 | Mod& mod(); 46 | bool isMod(); 47 | std::map &mods(); 48 | protected: 49 | friend class Singleton; 50 | 51 | ResourceManager(); 52 | ~ResourceManager(); 53 | ResourceManager(const ResourceManager &) = delete; 54 | ResourceManager &operator=(const ResourceManager &) = delete; 55 | std::string _language; 56 | void findLanguages(); 57 | std::vector _languages; 58 | std::string _mod = ""; 59 | void findMods(); 60 | std::map _mods; 61 | }; 62 | 63 | #endif 64 | -------------------------------------------------------------------------------- /src/Singleton.h: -------------------------------------------------------------------------------- 1 | #ifndef _BASE_SINGLETON_H 2 | #define _BASE_SINGLETON_H 3 | 4 | #include 5 | 6 | template class Singleton 7 | { 8 | private: 9 | // Classes using the Singleton pattern should declare a getInstance() 10 | // method and call Singleton::get() from within that. 11 | friend Type *Type::getInstance(); 12 | 13 | static Type *get() 14 | { 15 | if (!_instance) 16 | { 17 | _instance = new Type(); 18 | } 19 | 20 | return _instance; 21 | } 22 | 23 | static Type *_instance; 24 | }; 25 | 26 | template Type *Singleton::_instance = nullptr; 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /src/TextBox/ItemImage.cpp: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | The powerup display for textboxes. 4 | E.g. when you get a life capsule or new weapon and 5 | it shows you a picture of it. 6 | */ 7 | 8 | #include "ItemImage.h" 9 | 10 | #include "../graphics/Renderer.h" 11 | using namespace NXE::Graphics; 12 | #include "TextBox.h" 13 | 14 | #define ITEMBOX_W 76 15 | #define ITEMBOX_H 32 16 | 17 | #define ITEMBOX_X (Renderer::getInstance()->screenWidth / 2) - 32 18 | #define ITEMBOX_Y (Renderer::getInstance()->screenHeight / 2) 19 | 20 | /* 21 | void c------------------------------() {} 22 | */ 23 | 24 | void TB_ItemImage::ResetState() 25 | { 26 | fVisible = false; 27 | } 28 | 29 | void TB_ItemImage::SetVisible(bool enable) 30 | { 31 | fVisible = enable; 32 | } 33 | 34 | void TB_ItemImage::SetSprite(int sprite, int frame) 35 | { 36 | fSprite = sprite; 37 | fFrame = frame; 38 | fYOffset = 1; 39 | } 40 | 41 | /* 42 | void c------------------------------() {} 43 | */ 44 | 45 | void TB_ItemImage::Tick(void) 46 | { 47 | } 48 | 49 | void TB_ItemImage::Draw(void) 50 | { 51 | if (!fVisible) 52 | return; 53 | 54 | // animate moving item downwards into box 55 | int desty = (ITEMBOX_H / 2) - (Renderer::getInstance()->sprites.sprites[fSprite].h / 2); 56 | if (++fYOffset > desty) 57 | fYOffset = desty; 58 | 59 | // draw the box frame 60 | TextBox::DrawFrame(ITEMBOX_X, ITEMBOX_Y, ITEMBOX_W, ITEMBOX_H); 61 | 62 | // draw the item 63 | int x = ITEMBOX_X + ((ITEMBOX_W / 2) - (Renderer::getInstance()->sprites.sprites[fSprite].w / 2)); 64 | if (Renderer::getInstance()->sprites.sprites[fSprite].w == 14) 65 | x--; // hack for ArmsIcons 66 | 67 | Renderer::getInstance()->sprites.drawSprite(x, ITEMBOX_Y + fYOffset, fSprite, fFrame); 68 | } 69 | -------------------------------------------------------------------------------- /src/TextBox/ItemImage.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _ITEMIMAGE_H 3 | #define _ITEMIMAGE_H 4 | 5 | class TB_ItemImage 6 | { 7 | public: 8 | void ResetState(); 9 | void Draw(); 10 | void Tick(); 11 | 12 | void SetVisible(bool enable); 13 | void SetSprite(int sprite, int frame); 14 | 15 | private: 16 | bool fVisible; 17 | int fSprite, fFrame; 18 | int fYOffset; 19 | }; 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /src/TextBox/SaveSelect.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _SAVESELECT_H 3 | #define _SAVESELECT_H 4 | 5 | #define SS_LOADING 0 6 | #define SS_SAVING 1 7 | #define MAX_SAVE_SLOTS 5 8 | 9 | class TB_SaveSelect 10 | { 11 | public: 12 | TB_SaveSelect(); 13 | 14 | void ResetState(); 15 | void SetVisible(bool enable, bool saving = SS_LOADING); 16 | 17 | bool IsVisible(); 18 | bool Aborted(); 19 | void Draw(); 20 | void Tick(); 21 | 22 | private: 23 | void Run_Input(); 24 | void DrawProfile(int x, int y, int index); 25 | void DrawExtendedInfo(); 26 | 27 | bool fVisible; 28 | bool fSaving; 29 | bool fAborted; 30 | int fCurSel; 31 | int fNumFiles; 32 | 33 | struct 34 | { 35 | int x, y, w, h; 36 | } fCoords; 37 | }; 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /src/TextBox/StageSelect.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _STAGESELECT_H 3 | #define _STAGESELECT_H 4 | 5 | #include 6 | 7 | #define NUM_TELEPORTER_SLOTS 8 8 | 9 | struct Teleporter_Slot 10 | { 11 | int slotno; // which slot # this is (first param to PS+) 12 | int scriptno; // which script is run when selected (2nd param to PS+) 13 | }; 14 | 15 | class TB_StageSelect 16 | { 17 | public: 18 | TB_StageSelect(); 19 | 20 | void ResetState(); 21 | void SetVisible(bool enable); 22 | 23 | void SetSlot(int slotno, int scriptno); 24 | void ClearSlots(); 25 | bool GetSlotByIndex(int index, int *slotno_out = NULL, int *scriptno_out = NULL); 26 | int CountActiveSlots(); 27 | 28 | bool IsVisible(); 29 | void Draw(); 30 | void Tick(); 31 | 32 | private: 33 | void HandleInput(); 34 | void MoveSelection(int dir); 35 | void UpdateText(); 36 | 37 | bool fVisible; 38 | int fSlots[NUM_TELEPORTER_SLOTS]; // scripts used for slots 39 | 40 | int fWarpY; 41 | 42 | int fSelectionIndex; 43 | int fSelectionFrame; 44 | 45 | bool fMadeSelection; 46 | }; 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /src/TextBox/YesNoPrompt.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _YESNOPROMPT_H 3 | #define _YESNOPROMPT_H 4 | 5 | enum YNJResult 6 | { 7 | NO, 8 | YES 9 | }; 10 | 11 | class TB_YNJPrompt 12 | { 13 | public: 14 | void SetVisible(bool enable); 15 | void ResetState(); 16 | 17 | void Draw(); 18 | void Tick(); 19 | 20 | bool IsVisible() 21 | { 22 | return fVisible; 23 | } 24 | bool ResultReady(); // returns true if the user has selected a result 25 | int GetResult(); // returns YES or NO 26 | 27 | private: 28 | bool fVisible; 29 | struct 30 | { 31 | int y; 32 | } fCoords; 33 | 34 | int fState; 35 | int fTimer; 36 | 37 | int fAnswer; 38 | }; 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /src/Utils/Common.h: -------------------------------------------------------------------------------- 1 | #ifndef _COMMON_H 2 | #define _COMMON_H 3 | 4 | template 5 | constexpr const T& clamp(const T& val, const T& min, const T& max) 6 | { 7 | return (val <= min) ? min : (max <= val) ? max : val; 8 | } 9 | 10 | #endif -------------------------------------------------------------------------------- /src/Utils/Logger.cpp: -------------------------------------------------------------------------------- 1 | #include "Logger.h" 2 | #include 3 | #include 4 | #include "../common/misc.h" 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | namespace NXE 11 | { 12 | namespace Utils 13 | { 14 | namespace Logger 15 | { 16 | static const char *LOG_PATTERN = "%^[%H:%M:%S.%e] [%l] [%@ %!]: %v%$"; 17 | std::vector sinks; 18 | 19 | void init(std::string filename) 20 | { 21 | sinks.push_back(std::make_shared()); 22 | sinks.push_back(std::make_shared(widen(filename), true)); 23 | 24 | spdlog::set_default_logger(std::make_shared("nxe logger", begin(sinks), end(sinks))); 25 | 26 | spdlog::set_pattern(LOG_PATTERN); 27 | 28 | spdlog::set_error_handler([](const std::string &msg) { 29 | std::cerr << "spdlog error: " << msg << std::endl; 30 | }); 31 | 32 | spdlog::flush_on(spdlog::level::debug); 33 | #if defined(DEBUG) 34 | spdlog::set_level(spdlog::level::trace); 35 | #else 36 | spdlog::set_level(spdlog::level::info); 37 | #endif 38 | } 39 | 40 | 41 | } // namespace Logger 42 | } // namespace Utils 43 | } // namespace NXE 44 | -------------------------------------------------------------------------------- /src/Utils/Logger.h: -------------------------------------------------------------------------------- 1 | #ifndef _LOGGER_H 2 | 3 | #include 4 | 5 | #include 6 | 7 | namespace NXE 8 | { 9 | namespace Utils 10 | { 11 | 12 | namespace Logger 13 | { 14 | 15 | void init(std::string filename); 16 | 17 | #define LOG_TRACE SPDLOG_TRACE 18 | #define LOG_DEBUG SPDLOG_DEBUG 19 | #define LOG_INFO SPDLOG_INFO 20 | #define LOG_WARN SPDLOG_WARN 21 | #define LOG_ERROR SPDLOG_ERROR 22 | #define LOG_CRITICAL SPDLOG_CRITICAL 23 | 24 | } // namespace Logger 25 | } // namespace Utils 26 | } // namespace NXE 27 | 28 | #endif //_LOGGER_H -------------------------------------------------------------------------------- /src/ai/IrregularBBox.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _IRREGULARBBOX_H 3 | #define _IRREGULARBBOX_H 4 | #include "../object.h" 5 | 6 | #define IB_MAX_BBOXES 4 7 | 8 | class IrregularBBox 9 | { 10 | public: 11 | bool init(Object *associatedObject, int max_rectangles); 12 | void destroy(); 13 | 14 | void set_damage(int dmg); 15 | void transmit_hits(); 16 | 17 | void place(void (*placefunc)(void *userparm), void *userparm); 18 | void set_bbox(int index, int x, int y, int w, int h, uint32_t flags); 19 | 20 | private: 21 | Object *bbox[IB_MAX_BBOXES]; 22 | int num_bboxes; 23 | Object *assoc_object; 24 | }; 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /src/ai/almond/almond.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _ALMOND_H 3 | #define _ALMOND_H 4 | #include "../../object.h" 5 | 6 | // states to control the water-level object 7 | #define WL_CALM 10 // calm and slow at set point 8 | 9 | #define WL_CYCLE 20 // cycles between set point and top of screen 10 | #define WL_DOWN 21 // in cycle--currently down 11 | #define WL_UP 22 // in cycle--currently up 12 | 13 | #define WL_STAY_UP 30 // goes to top of screen and doesn't come back down 14 | 15 | void ai_waterlevel(Object *o); 16 | void ai_shutter(Object *o); 17 | void ai_shutter_big(Object *o); 18 | void ai_almond_lift(Object *o); 19 | void ai_shutter_stuck(Object *o); 20 | void ai_almond_robot(Object *o); 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /src/ai/balrog_common.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _BALROG_COMMON_H 3 | #define _BALROG_COMMON_H 4 | #include "../object.h" 5 | 6 | void balrog_grab_player(Object *o); 7 | bool balrog_toss_player_away(Object *o); 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /src/ai/boss/balfrog.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _BALFROG_H 3 | #define _BALFROG_H 4 | #include "../../object.h" 5 | #include "../../stageboss.h" 6 | #include "../IrregularBBox.h" 7 | 8 | class BalfrogBoss : public StageBoss 9 | { 10 | public: 11 | void OnMapEntry(); 12 | void Run(); 13 | 14 | void place_bboxes(); 15 | 16 | private: 17 | void RunDeathAnim(); 18 | void RunEntryAnim(); 19 | 20 | void RunFighting(); 21 | void RunJumping(); 22 | void RunShooting(); 23 | 24 | void SetJumpingSprite(bool enable); 25 | void SpawnFrogs(int objtype, int count); 26 | 27 | void set_bbox(int index, int x, int y, int w, int h, uint32_t flags); 28 | void transmit_bbox_hits(Object *box); 29 | 30 | Object *o; 31 | 32 | struct 33 | { 34 | int shakeflash; 35 | 36 | int orighp; 37 | int shots_fired; 38 | int attackcounter; 39 | 40 | Object *balrog; // balrog puppet for death scene 41 | 42 | // our group of multiple bboxes to simulate our irregular bounding box. 43 | IrregularBBox bboxes; 44 | int bbox_mode; 45 | 46 | } frog; 47 | }; 48 | 49 | void ondeath_balfrog(Object *o); 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /src/ai/boss/ballos.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _BALLOS_H 3 | #define _BALLOS_H 4 | #include "../../object.h" 5 | #include "../../stageboss.h" 6 | 7 | #define NUM_EYES 2 8 | enum TRIGDIR 9 | { 10 | LESS_THAN = 0, 11 | GREATER_THAN = 1 12 | }; 13 | 14 | class BallosBoss : public StageBoss 15 | { 16 | public: 17 | void OnMapEntry(); 18 | void Run(); 19 | void RunAftermove(); 20 | 21 | private: 22 | void RunForm1(Object *o); 23 | void RunForm2(Object *o); 24 | void RunForm3(Object *o); 25 | void RunComeDown(Object *o); 26 | void RunDefeated(Object *o); 27 | 28 | void run_eye(int index); 29 | void place_eye(int index); 30 | void SetEyeStates(int newstate); 31 | 32 | bool passed_xcoord(bool ltgt, int xcoord, bool reset = false); 33 | bool passed_ycoord(bool ltgt, int ycoord, bool reset = false); 34 | 35 | Object *main; 36 | Object *body; 37 | Object *eye[NUM_EYES]; 38 | Object *shield; // top shield to cover eyes from above 39 | }; 40 | 41 | void ondeath_ballos(Object *o); 42 | void ai_ballos_rotator(Object *o); 43 | void aftermove_ballos_rotator(Object *o); 44 | void ai_ballos_platform(Object *o); 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /src/ai/boss/core.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _COREBOSS_H 3 | #define _COREBOSS_H 4 | #include "../../object.h" 5 | #include "../../stageboss.h" 6 | 7 | class CoreBoss : public StageBoss 8 | { 9 | public: 10 | void OnMapEntry(); 11 | void OnMapExit(); 12 | void Run(); 13 | 14 | private: 15 | void RunOpenMouth(); 16 | 17 | void StartWaterStream(void); 18 | void StopWaterStream(void); 19 | 20 | Object *o; 21 | Object *pieces[8]; 22 | int hittimer; 23 | }; 24 | 25 | void ai_core_front(Object *o); 26 | void ai_core_back(Object *o); 27 | void ai_minicore(Object *o); 28 | void ai_minicore_shot(Object *o); 29 | void ai_core_ghostie(Object *o); 30 | void ai_core_blast(Object *o); 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /src/ai/boss/heavypress.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _HEAVYPRESS_H 3 | #define _HEAVYPRESS_H 4 | #include "../../object.h" 5 | #include "../../stageboss.h" 6 | 7 | class HeavyPress : public StageBoss 8 | { 9 | public: 10 | void OnMapEntry(); 11 | void Run(); 12 | 13 | private: 14 | void run_defeated(); 15 | void run_passageway(); 16 | 17 | Object *o; 18 | Object *shield_left, *shield_right; 19 | 20 | int uncover_left, uncover_right; 21 | int uncover_y; 22 | 23 | SIFRect fullwidth_bbox; 24 | SIFRect center_bbox; 25 | }; 26 | 27 | void ai_hp_lightning(Object *o); 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /src/ai/boss/ironhead.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _IRONHEAD_H 3 | #define _IRONHEAD_H 4 | #include "../../object.h" 5 | #include "../../stageboss.h" 6 | 7 | class IronheadBoss : public StageBoss 8 | { 9 | public: 10 | void OnMapEntry(); 11 | void OnMapExit(); 12 | void Run(); 13 | 14 | private: 15 | Object *o; 16 | int hittimer; 17 | }; 18 | 19 | void ondeath_ironhead(Object *o); 20 | void ai_ironh_fishy(Object *o); 21 | void ai_ironh_shot(Object *o); 22 | void ai_brick_spawner(Object *o); 23 | void ai_ironh_brick(Object *o); 24 | void ai_ikachan_spawner(Object *o); 25 | void ai_ikachan(Object *o); 26 | void ai_motion_wall(Object *o); 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /src/ai/boss/omega.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _OMEGA_H 3 | #define _OMEGA_H 4 | #include "../../object.h" 5 | #include "../../stageboss.h" 6 | 7 | class OmegaBoss : public StageBoss 8 | { 9 | public: 10 | void OnMapEntry(); 11 | void OnMapExit(); 12 | 13 | void Run(); 14 | 15 | private: 16 | Object *pieces[4]; 17 | 18 | struct 19 | { 20 | int timer; 21 | int animtimer; 22 | 23 | int movedir, movetime; 24 | int nextstate; 25 | 26 | int form; 27 | 28 | int firefreq, startfiring, stopfiring, endfirestate, shotxspd; 29 | int firecounter; 30 | 31 | int leg_descend; 32 | 33 | int orgx, orgy; 34 | 35 | int shaketimer; 36 | int lasthp; 37 | 38 | bool defeated; 39 | } omg; 40 | }; 41 | 42 | void ondeath_omega_body(Object *o); 43 | void ai_omega_shot(Object *o); 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /src/ai/boss/sisters.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _SISTERS_H 3 | #define _SISTERS_H 4 | #include "../../object.h" 5 | #include "../../stageboss.h" 6 | 7 | // although you will need to add additional copies of the head sprites 8 | // for it to work properly, just try setting this number to something 9 | // like 10 and running the fight! 10 | #define NUM_SISTERS 2 11 | 12 | class SistersBoss : public StageBoss 13 | { 14 | public: 15 | void OnMapEntry(); 16 | void OnMapExit(); 17 | void Run(); 18 | 19 | private: 20 | void run_head(int index); 21 | void head_set_bbox(int index); 22 | void run_body(int index); 23 | 24 | void SetHeadStates(int newstate); 25 | void SetBodyStates(int newstate); 26 | 27 | void SpawnScreenSmoke(int count); 28 | 29 | int mainangle; 30 | 31 | Object *main; 32 | Object *head[NUM_SISTERS]; 33 | Object *body[NUM_SISTERS]; 34 | }; 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /src/ai/boss/undead_core.h: -------------------------------------------------------------------------------- 1 | #ifndef _UNDEADCORE_BOSS_H 2 | #define _UNDEADCORE_BOSS_H 3 | 4 | #include "../../object.h" 5 | #include "../../stageboss.h" 6 | 7 | #define NUM_ROTATORS 4 8 | enum BBoxes 9 | { 10 | BB_UPPER, 11 | BB_BACK, 12 | BB_LOWER, 13 | BB_TARGET, 14 | NUM_BBOXES 15 | }; 16 | 17 | enum UD_Faces 18 | { 19 | FACE_SKULL, 20 | FACE_TEETH, 21 | FACE_MOUTH, 22 | FACE_MOUTH_LIT, 23 | FACE_NONE 24 | }; 25 | 26 | class UDCoreBoss : public StageBoss 27 | { 28 | public: 29 | void OnMapEntry(); 30 | void OnMapExit(); 31 | void Run(); 32 | void RunAftermove(); 33 | 34 | private: 35 | bool RunDefeated(); 36 | void SpawnFaceSmoke(); 37 | void SpawnPellet(int dir); 38 | void RunHurtFlash(int timer); 39 | 40 | void run_front(Object *o); 41 | void run_face(Object *o); 42 | void run_back(Object *o); 43 | 44 | void move_bboxes(); 45 | void set_bbox_shootable(bool enable); 46 | 47 | Object *create_rotator(int angle, int front); 48 | void run_rotator(Object *o); 49 | void SetRotatorStates(int newstate); 50 | 51 | Object *main; 52 | Object *front, *back; 53 | Object *face; 54 | 55 | Object *rotator[NUM_ROTATORS]; 56 | Object *bbox[NUM_BBOXES]; 57 | }; 58 | 59 | void onspawn_ud_minicore_idle(Object *o); 60 | void ai_udmini_platform(Object *o); 61 | void ai_ud_pellet(Object *o); 62 | void ai_ud_smoke(Object *o); 63 | void ai_ud_spinner(Object *o); 64 | void ai_ud_spinner_trail(Object *o); 65 | void ai_ud_blast(Object *o); 66 | 67 | #endif 68 | -------------------------------------------------------------------------------- /src/ai/boss/x.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _XBOSS_H 3 | #define _XBOSS_H 4 | #include "../../object.h" 5 | #include "../../stageboss.h" 6 | 7 | enum XBDir 8 | { 9 | UL, 10 | UR, 11 | LL, 12 | LR 13 | }; 14 | 15 | class XBoss : public StageBoss 16 | { 17 | public: 18 | void OnMapEntry(); 19 | void OnMapExit(); 20 | void Run(); 21 | void RunAftermove(); 22 | 23 | private: 24 | void run_tread(int index); 25 | void run_body(int index); 26 | void run_door(int index); 27 | void run_target(int index); 28 | void run_fishy_spawner(int index); 29 | void run_internals(); 30 | 31 | bool AllTargetsDestroyed(); 32 | void Init(); 33 | Object *CreateTread(int x, int y, int sprite); 34 | Object *CreatePiece(int x, int y, int type); 35 | 36 | void SetStates(Object *objects[], int nobjects, int state); 37 | void SetDirs(Object *objects[], int nobjects, int dir); 38 | 39 | void DeleteMonster(); 40 | 41 | Object *mainobject; 42 | Object *body[4]; 43 | Object *treads[4]; 44 | Object *internals; 45 | Object *doors[2]; 46 | Object *targets[4]; 47 | Object *fishspawners[4]; 48 | 49 | Object *piecelist[24]; 50 | int npieces; 51 | 52 | struct 53 | { 54 | bool initilized; 55 | } X; 56 | }; 57 | 58 | void ondeath_x_mainobject(Object *internals); 59 | void ondeath_x_target(Object *o); 60 | void ai_x_fishy_missile(Object *o); 61 | void ai_x_defeated(Object *o); 62 | 63 | #endif 64 | -------------------------------------------------------------------------------- /src/ai/egg/egg.h: -------------------------------------------------------------------------------- 1 | #ifndef __AIEGG_H_ 2 | #define __AIEGG_H_ 3 | #include "../../object.h" 4 | 5 | void ai_basil(Object *o); 6 | void ai_behemoth(Object *o); 7 | void ai_beetle_horiz(Object *o); 8 | void ai_beetle_freefly(Object *o); 9 | void ai_giant_beetle(Object *o); 10 | void ai_egg_elevator(Object *o); 11 | void ai_forcefield(Object *o); 12 | 13 | #endif -------------------------------------------------------------------------------- /src/ai/egg/egg2.h: -------------------------------------------------------------------------------- 1 | #ifndef __AIEGG2_H_ 2 | #define __AIEGG2_H_ 3 | #include "../../object.h" 4 | 5 | void ai_dragon_zombie(Object *o); 6 | void ai_falling_spike_small(Object *o); 7 | void ai_falling_spike_large(Object *o); 8 | void ai_counter_bomb(Object *o); 9 | void ai_counter_bomb_number(Object *o); 10 | 11 | #endif -------------------------------------------------------------------------------- /src/ai/egg/igor.h: -------------------------------------------------------------------------------- 1 | #ifndef __AIIGOR_H_ 2 | #define __AIIGOR_H_ 3 | #include "../../object.h" 4 | 5 | void ai_npc_igor(Object *o); 6 | void ai_boss_igor(Object *o); 7 | void ai_boss_igor_defeated(Object *o); 8 | static void smoke_puff(Object *o, bool initial); 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /src/ai/final_battle/balcony.h: -------------------------------------------------------------------------------- 1 | #ifndef __AIBALCONY_H_ 2 | #define __AIBALCONY_H_ 3 | #include "../../object.h" 4 | 5 | void ai_helicopter(Object *o); 6 | void ai_helicopter_blade(Object *o); 7 | void ai_igor_balcony(Object *o); 8 | void ai_falling_block_spawner(Object *o); 9 | void ai_falling_block(Object *o); 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /src/ai/final_battle/doctor.h: -------------------------------------------------------------------------------- 1 | #ifndef _DOCTOR_H 2 | #define _DOCTOR_H 3 | #include "../../object.h" 4 | 5 | extern int crystal_xmark, crystal_ymark; 6 | extern bool crystal_tofront; 7 | 8 | void ai_boss_doctor(Object *o); 9 | void ai_doctor_shot(Object *o); 10 | void ai_doctor_shot_trail(Object *o); 11 | void ai_doctor_blast(Object *o); 12 | void aftermove_red_crystal(Object *o); 13 | void ai_doctor_crowned(Object *o); 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /src/ai/final_battle/doctor_common.cpp: -------------------------------------------------------------------------------- 1 | #include "doctor_common.h" 2 | 3 | #include "../../ObjManager.h" 4 | #include "../../game.h" 5 | #include "../../graphics/Renderer.h" 6 | #include "../../sound/SoundManager.h" 7 | #include "../stdai.h" 8 | 9 | using namespace NXE::Graphics; 10 | 11 | int crystal_xmark, crystal_ymark; 12 | bool crystal_tofront; 13 | 14 | Object *dr_create_red_crystal(int x, int y) 15 | { 16 | Object *upper_xtal; 17 | 18 | // we have to create these with the one which will bring itself to front 19 | // already having higher zorder (create it 2nd), because the code to 20 | // run aftermoves currently doesn't create a list first and so running 21 | // BringToFront from an aftermove can cause it's AI to be executed twice. 22 | CreateObject(x, y, OBJ_RED_CRYSTAL)->dir = RIGHT; 23 | (upper_xtal = CreateObject(x, y, OBJ_RED_CRYSTAL))->dir = LEFT; 24 | 25 | return upper_xtal; 26 | } 27 | 28 | /* 29 | void c------------------------------() {} 30 | */ 31 | 32 | void dr_tp_out_init(Object *o) 33 | { 34 | o->ResetClip(); 35 | o->clip_enable = true; 36 | 37 | NXE::Sound::SoundManager::getInstance()->playSfx(NXE::Sound::SFX::SND_TELEPORT); 38 | o->shaketime = 0; // show any waiting damage numbers NOW 39 | } 40 | 41 | bool dr_tp_out(Object *o) 42 | { 43 | o->clipy1 += 2; 44 | o->clipy2 -= 2; 45 | 46 | if (o->clipy1 >= o->clipy2) 47 | { 48 | o->clip_enable = false; 49 | o->invisible = true; 50 | 51 | return true; 52 | } 53 | 54 | return false; 55 | } 56 | 57 | /* 58 | void c------------------------------() {} 59 | */ 60 | 61 | void dr_tp_in_init(Object *o) 62 | { 63 | o->clipy1 = o->clipy2 = (Renderer::getInstance()->sprites.sprites[o->sprite].h / 2); 64 | o->clip_enable = true; 65 | o->invisible = false; 66 | } 67 | 68 | bool dr_tp_in(Object *o) 69 | { 70 | o->clipy1 -= 2; 71 | o->clipy2 += 2; 72 | 73 | if (o->clipy1 <= 0 || o->clipy2 >= Renderer::getInstance()->sprites.sprites[o->sprite].h) 74 | { 75 | o->clip_enable = false; 76 | o->ResetClip(); 77 | return true; 78 | } 79 | 80 | return false; 81 | } 82 | -------------------------------------------------------------------------------- /src/ai/final_battle/doctor_common.h: -------------------------------------------------------------------------------- 1 | #ifndef __AIDOCTORCOM_H_ 2 | #define __AIDOCTORCOM_H_ 3 | #include "../../object.h" 4 | 5 | Object *dr_create_red_crystal(int x, int y); 6 | void dr_tp_out_init(Object *o); 7 | bool dr_tp_out(Object *o); 8 | void dr_tp_in_init(Object *o); 9 | bool dr_tp_in(Object *o); 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /src/ai/final_battle/doctor_frenzied.h: -------------------------------------------------------------------------------- 1 | #ifndef __AIDOCTORFRE_H_ 2 | #define __AIDOCTORFRE_H_ 3 | #include "../../object.h" 4 | 5 | void ai_boss_doctor_frenzied(Object *o); 6 | void ai_doctor_bat(Object *o); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /src/ai/final_battle/final_misc.h: -------------------------------------------------------------------------------- 1 | #ifndef __AIFINMISC_H_ 2 | #define __AIFINMISC_H_ 3 | #include "../../object.h" 4 | 5 | void ai_doctor_ghost(Object *o); 6 | void ai_red_energy(Object *o); 7 | void ai_mimiga_caged(Object *o); 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /src/ai/final_battle/misery.h: -------------------------------------------------------------------------------- 1 | #ifndef __AIFINMISERY_H_ 2 | #define __AIFINMISERY_H_ 3 | #include "../../object.h" 4 | 5 | void ai_boss_misery(Object *o); 6 | static void run_spells(Object *o); 7 | static void run_teleport(Object *o); 8 | static void run_intro(Object *o); 9 | static void run_defeated(Object *o); 10 | static Object *CreateRing(Object *o, uint8_t angle); 11 | void ai_misery_ring(Object *o); 12 | void aftermove_misery_ring(Object *o); 13 | void ai_misery_phase(Object *o); 14 | void ai_misery_ball(Object *o); 15 | void ai_black_lightning(Object *o); 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /src/ai/final_battle/sidekicks.h: -------------------------------------------------------------------------------- 1 | #ifndef __AISIDEKICKS_H_ 2 | #define __AISIDEKICKS_H_ 3 | #include "../../object.h" 4 | 5 | void ai_misery_frenzied(Object *o); 6 | static Object *fm_spawn_missile(Object *o, int angindex); 7 | void ai_misery_critter(Object *o); 8 | void ai_misery_bat(Object *o); 9 | void ai_misery_missile(Object *o); 10 | void ai_sue_frenzied(Object *o); 11 | static void sue_somersault(Object *o); 12 | static void sue_dash(Object *o); 13 | static void set_ignore_solid(Object *o); 14 | static void sidekick_run_defeated(Object *o, int health); 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /src/ai/first_cave/first_cave.h: -------------------------------------------------------------------------------- 1 | #ifndef __AIFC_H_ 2 | #define __AIFC_H_ 3 | #include "../../object.h" 4 | 5 | void ai_bat_up_down(Object *o); 6 | void ai_hermit_gunsmith(Object *o); 7 | void ai_door_enemy(Object *o); 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /src/ai/hell/ballos_misc.h: -------------------------------------------------------------------------------- 1 | #ifndef __AIBALLOSMISC_H_ 2 | #define __AIBALLOSMISC_H_ 3 | #include "../../object.h" 4 | 5 | void ai_ballos_skull(Object *o); 6 | void ai_ballos_spikes(Object *o); 7 | void ai_green_devil_spawner(Object *o); 8 | void ai_green_devil(Object *o); 9 | void ai_bute_sword_red(Object *o); 10 | void ai_bute_archer_red(Object *o); 11 | void ai_wall_collapser(Object *o); 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /src/ai/hell/ballos_priest.h: -------------------------------------------------------------------------------- 1 | #ifndef __AIBALLOSPRIEST_H_ 2 | #define __AIBALLOSPRIEST_H_ 3 | #include "../../object.h" 4 | 5 | void ai_ballos_priest(Object *o); 6 | // static void run_flight(Object *o); 7 | // static void spawn_bones(Object *o, int dir); 8 | // static void run_lightning(Object *o); 9 | // static void run_intro(Object *o); 10 | // static void run_defeated(Object *o); 11 | void ai_ballos_target(Object *o); 12 | void ai_ballos_bone_spawner(Object *o); 13 | void ai_ballos_bone(Object *o); 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /src/ai/hell/hell.h: -------------------------------------------------------------------------------- 1 | #ifndef __AIHELL_H_ 2 | #define __AIHELL_H_ 3 | #include "../../object.h" 4 | 5 | void ai_bute_flying(Object *o); 6 | void ai_bute_spawner(Object *o); 7 | void ai_bute_falling(Object *o); 8 | void ai_bute_sword(Object *o); 9 | void ai_bute_archer(Object *o); 10 | void ai_bute_arrow(Object *o); 11 | void ai_bute_dying(Object *o); 12 | static bool run_bute_defeated(Object *o, int hp); 13 | void ai_mesa(Object *o); 14 | void ai_mesa_block(Object *o); 15 | void ai_deleet(Object *o); 16 | void ai_rolling(Object *o); 17 | void ai_statue_base(Object *o); 18 | void ai_statue(Object *o); 19 | void ai_puppy_ghost(Object *o); 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /src/ai/last_cave/last_cave.h: -------------------------------------------------------------------------------- 1 | #ifndef __AILC_H_ 2 | #define __AILC_H_ 3 | #include "../../object.h" 4 | 5 | void ai_proximity_press_vert(Object *o); 6 | void ai_critter_hopping_red(Object *o); 7 | void ai_lava_drip_spawner(Object *o); 8 | void ai_lava_drip(Object *o); 9 | void ai_red_bat_spawner(Object *o); 10 | void ai_red_bat(Object *o); 11 | void ai_red_demon(Object *o); 12 | void ai_press_vert(Object *o); 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /src/ai/maze/balrog_boss_missiles.h: -------------------------------------------------------------------------------- 1 | #ifndef __AIBALROGMISS_H_ 2 | #define __AIBALROGMISS_H_ 3 | #include "../../object.h" 4 | 5 | void ai_balrog_boss_missiles(Object *o); 6 | void ondeath_balrog_boss_missiles(Object *o); 7 | static void walking_animation(Object *o); 8 | void ai_balrog_missile(Object *o); 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /src/ai/maze/critter_purple.h: -------------------------------------------------------------------------------- 1 | #ifndef __AICRITTERPURPLE_H_ 2 | #define __AICRITTERPURPLE_H_ 3 | #include "../../object.h" 4 | 5 | void ai_critter_shooting_purple(Object *o); 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /src/ai/maze/gaudi.h: -------------------------------------------------------------------------------- 1 | #ifndef __AIGAUDI_H_ 2 | #define __AIGAUDI_H_ 3 | #include "../../object.h" 4 | 5 | void ai_gaudi(Object *o); 6 | void ai_gaudi_dying(Object *o); 7 | void ai_gaudi_flying(Object *o); 8 | void ai_gaudi_armored(Object *o); 9 | void ai_gaudi_armored_shot(Object *o); 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /src/ai/maze/labyrinth_m.h: -------------------------------------------------------------------------------- 1 | #ifndef __AILABY_H_ 2 | #define __AILABY_H_ 3 | #include "../../object.h" 4 | 5 | void ai_firewhirr(Object *o); 6 | void ai_firewhirr_shot(Object *o); 7 | void ai_gaudi_egg(Object *o); 8 | void ai_fuzz_core(Object *o); 9 | void ai_fuzz(Object *o); 10 | void aftermove_fuzz(Object *o); 11 | void ai_buyobuyo_base(Object *o); 12 | void ai_buyobuyo(Object *o); 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /src/ai/maze/maze.h: -------------------------------------------------------------------------------- 1 | #ifndef __AIMAZE_H_ 2 | #define __AIMAZE_H_ 3 | #include "../../object.h" 4 | 5 | void ai_block_moveh(Object *o); 6 | void ai_block_movev(Object *o); 7 | void ai_boulder(Object *o); 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /src/ai/maze/pooh_black.h: -------------------------------------------------------------------------------- 1 | #ifndef __AIPOOH_H_ 2 | #define __AIPOOH_H_ 3 | #include "../../object.h" 4 | 5 | void ai_pooh_black(Object *o); 6 | void ai_pooh_black_bubble(Object *o); 7 | void ai_pooh_black_dying(Object *o); 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /src/ai/npc/balrog.h: -------------------------------------------------------------------------------- 1 | #ifndef __AINPCBALROG_H_ 2 | #define __AINPCBALROG_H_ 3 | #include "../../object.h" 4 | 5 | void onspawn_balrog(Object *o); 6 | void ai_balrog(Object *o); 7 | void ai_balrog_drop_in(Object *o); 8 | void ai_balrog_bust_in(Object *o); 9 | void balrog_walk_init(Object *o); 10 | void balrog_walk_animation(Object *o); 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /src/ai/npc/curly.h: -------------------------------------------------------------------------------- 1 | #ifndef __AICURLY_H_ 2 | #define __AICURLY_H_ 3 | #include "../../object.h" 4 | 5 | void ai_curly(Object *o); 6 | void ai_curly_collapsed(Object *o); 7 | void aftermove_curly_carried(Object *o); 8 | void ai_curly_carried_shooting(Object *o); 9 | void ai_ccs_gun(Object *o); 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /src/ai/npc/curly_ai.h: -------------------------------------------------------------------------------- 1 | #ifndef __AICURLYAI_H_ 2 | #define __AICURLYAI_H_ 3 | #include "../../object.h" 4 | 5 | void ai_curly_ai(Object *o); 6 | static void CaiJUMP(Object *o); 7 | void ai_cai_gun(Object *o); 8 | void aftermove_cai_gun(Object *o); 9 | void aftermove_cai_watershield(Object *o); 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /src/ai/npc/misery.h: -------------------------------------------------------------------------------- 1 | #ifndef __AIMISERY_H_ 2 | #define __AIMISERY_H_ 3 | #include "../../object.h" 4 | 5 | void ai_misery_float(Object *o); 6 | void ai_miserys_bubble(Object *o); 7 | static Object *mbubble_find_target(void); 8 | void ai_misery_stand(Object *o); 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /src/ai/npc/npcguest.cpp: -------------------------------------------------------------------------------- 1 | #include "npcguest.h" 2 | 3 | #include "../../game.h" 4 | #include "../../graphics/Tileset.h" 5 | #include "../../player.h" 6 | #include "../ai.h" 7 | #include "../stdai.h" 8 | //#include "../../map.h" 9 | 10 | INITFUNC(AIRoutines) 11 | { 12 | ONTICK(OBJ_MAHIN, ai_npc_mahin); 13 | 14 | ONSPAWN(OBJ_YAMASHITA_FLOWERS, onspawn_set_frame_from_id2); 15 | ONTICK(OBJ_YAMASHITA_PAVILION, ai_yamashita_pavilion); 16 | 17 | ONTICK(OBJ_CHTHULU, ai_chthulu); 18 | 19 | GENERIC_NPC_NOFACEPLAYER(OBJ_DR_GERO); 20 | GENERIC_NPC_NOFACEPLAYER(OBJ_NURSE_HASUMI); 21 | } 22 | 23 | /* 24 | void c------------------------------() {} 25 | */ 26 | 27 | void ai_chthulu(Object *o) 28 | { 29 | if (!o->state) 30 | { 31 | o->SnapToGround(); 32 | o->state = 1; 33 | } 34 | 35 | // open eyes when player comes near 36 | o->frame = (pdistlx((48 * CSFI)) && pdistly2((48 * CSFI), (16 * CSFI))) ? 1 : 0; 37 | } 38 | 39 | // fat mimiga from village 40 | void ai_npc_mahin(Object *o) 41 | { 42 | switch (o->state) 43 | { 44 | case 0: 45 | o->SnapToGround(); 46 | o->state = 1; 47 | o->frame = 2; 48 | 49 | case 1: // facing away 50 | break; 51 | 52 | case 2: // talking to player 53 | o->frame = 0; 54 | randblink(o); 55 | break; 56 | } 57 | } 58 | 59 | /* 60 | void c------------------------------() {} 61 | */ 62 | 63 | // Sandaime's Pavilion from Yamashita Farm 64 | void ai_yamashita_pavilion(Object *o) 65 | { 66 | if (!o->state) 67 | { 68 | if (o->dir == LEFT) 69 | { // Sandaime present 70 | o->state = 1; 71 | } 72 | else 73 | { // Sandaime gone 74 | o->x -= (TILE_W * CSFI); 75 | o->state = 2; 76 | o->frame = 2; 77 | } 78 | } 79 | 80 | if (o->state == 1) 81 | { 82 | o->frame = 0; 83 | randblink(o); 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /src/ai/npc/npcguest.h: -------------------------------------------------------------------------------- 1 | #ifndef __AINPCGUEST_H_ 2 | #define __AINPCGUEST_H_ 3 | #include "../../object.h" 4 | 5 | void ai_chthulu(Object *o); 6 | void ai_npc_mahin(Object *o); 7 | void ai_yamashita_pavilion(Object *o); 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /src/ai/npc/npcplayer.h: -------------------------------------------------------------------------------- 1 | #ifndef __AINPCPLAYER_H_ 2 | #define __AINPCPLAYER_H_ 3 | #include "../../object.h" 4 | 5 | void ai_npc_player(Object *o); 6 | void ai_ptelin(Object *o); 7 | void ai_ptelout(Object *o); 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /src/ai/npc/npcregu.h: -------------------------------------------------------------------------------- 1 | #ifndef __AIREGU_H_ 2 | #define __AIREGU_H_ 3 | #include "../../object.h" 4 | 5 | void ai_jenka(Object *o); 6 | void ai_doctor(Object *o); 7 | void ai_toroko(Object *o); 8 | void ai_toroko_teleport_in(Object *o); 9 | void ai_npc_sue(Object *o); 10 | void aftermove_npc_sue(Object *o); 11 | void onspawn_npc_sue(Object *o); 12 | void ai_sue_teleport_in(Object *o); 13 | void ai_king(Object *o); 14 | void ai_blue_robot(Object *o); 15 | void ai_kanpachi_fishing(Object *o); 16 | void ai_professor_booster(Object *o); 17 | void ai_booster_falling(Object *o); 18 | void ai_npc_at_computer(Object *o); 19 | void ai_santa(Object *o); 20 | void ai_chaco(Object *o); 21 | void ai_jack(Object *o); 22 | 23 | void onspawn_generic_npc(Object *o); 24 | void ai_generic_npc(Object *o); 25 | void ai_generic_npc_nofaceplayer(Object *o); 26 | void npc_generic_walk(Object *o, int basestate); 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /src/ai/oside/oside.h: -------------------------------------------------------------------------------- 1 | #ifndef __AIOSIDE_H_ 2 | #define __AIOSIDE_H_ 3 | #include "../../object.h" 4 | 5 | void ai_night_spirit(Object *o); 6 | void ai_night_spirit_shot(Object *o); 7 | void ai_hoppy(Object *o); 8 | void ai_sky_dragon(Object *o); 9 | void ai_pixel_cat(Object *o); 10 | void ai_little_family(Object *o); 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /src/ai/plantation/plantation.h: -------------------------------------------------------------------------------- 1 | #ifndef __AIPLANT_H_ 2 | #define __AIPLANT_H_ 3 | #include "../../caret.h" 4 | #include "../../object.h" 5 | 6 | void ai_stumpy(Object *o); 7 | void ai_midorin(Object *o); 8 | void ai_orangebell(Object *o); 9 | void ai_orangebell_baby(Object *o); 10 | void ai_gunfish(Object *o); 11 | void ai_gunfish_shot(Object *o); 12 | void ai_droll(Object *o); 13 | void ai_droll_shot(Object *o); 14 | void ai_droll_guard(Object *o); 15 | void ai_mimiga_farmer(Object *o); 16 | void onspawn_mimiga_cage(Object *o); 17 | void ai_npc_itoh(Object *o); 18 | void ai_kanpachi_standing(Object *o); 19 | void ai_npc_momorin(Object *o); 20 | void ai_proximity_press_hoz(Object *o); 21 | void ai_rocket(Object *o); 22 | void ai_numahachi(Object *o); 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /src/ai/sand/curly_boss.h: -------------------------------------------------------------------------------- 1 | #ifndef __AICURLYBOSS_H_ 2 | #define __AICURLYBOSS_H_ 3 | #include "../../object.h" 4 | 5 | void ai_curly_boss(Object *o); 6 | static void curlyboss_fire(Object *o, int dir); 7 | void ai_curlyboss_shot(Object *o); 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /src/ai/sand/puppy.h: -------------------------------------------------------------------------------- 1 | #ifndef __AIPUPPY_H_ 2 | #define __AIPUPPY_H_ 3 | #include "../../object.h" 4 | 5 | void ai_puppy_wag(Object *o); 6 | void ai_puppy_bark(Object *o); 7 | void ai_zzzz_spawner(Object *o); 8 | void ai_puppy_run(Object *o); 9 | void aftermove_puppy_carry(Object *o); 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /src/ai/sand/sand.h: -------------------------------------------------------------------------------- 1 | #ifndef __AISAND_H_ 2 | #define __AISAND_H_ 3 | #include "../../object.h" 4 | 5 | void ai_polish(Object *o); 6 | void ondeath_polish(Object *o); 7 | void ai_polishbaby(Object *o); 8 | void ai_sandcroc(Object *o); 9 | void ai_sunstone(Object *o); 10 | void ai_crow(Object *o); 11 | void ai_crowwithskull(Object *o); 12 | void ai_skullhead(Object *o); 13 | void ai_skullhead_carried(Object *o); 14 | void aftermove_skullhead_carried(Object *o); 15 | void ai_skeleton_shot(Object *o); 16 | void ai_armadillo(Object *o); 17 | void ai_skullstep(Object *o); 18 | void ai_skullstep_foot(Object *o); 19 | void skullstep_do_step(Object *o, Object *skull, int angle); 20 | void ai_skeleton(Object *o); 21 | void ai_curlys_mimigas(Object *o); 22 | void ai_beetle_horizwait(Object *o); 23 | 24 | #endif -------------------------------------------------------------------------------- /src/ai/sand/toroko_frenzied.h: -------------------------------------------------------------------------------- 1 | #ifndef __AITOROKO_H_ 2 | #define __AITOROKO_H_ 3 | #include "../../object.h" 4 | 5 | void ai_toroko_frenzied(Object *o); 6 | void ai_toroko_block(Object *o); 7 | void aftermove_toroko_block(Object *o); 8 | void ai_toroko_flower(Object *o); 9 | 10 | #endif -------------------------------------------------------------------------------- /src/ai/stdai.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _STDAI_H 3 | #define _STDAI_H 4 | 5 | #include "../common/InitList.h" 6 | #include "../nx.h" 7 | #include "../object.h" 8 | 9 | extern InitList AIRoutines; 10 | 11 | #define ONTICK(OBJTYPE, FUNCTION) objprop[OBJTYPE].ai_routines.ontick = FUNCTION; 12 | #define ONDEATH(OBJTYPE, FUNCTION) objprop[OBJTYPE].ai_routines.ondeath = FUNCTION; 13 | #define AFTERMOVE(OBJTYPE, FUNCTION) objprop[OBJTYPE].ai_routines.aftermove = FUNCTION; 14 | #define ONSPAWN(OBJTYPE, FUNCTION) objprop[OBJTYPE].ai_routines.onspawn = FUNCTION; 15 | 16 | #define GENERIC_NPC(O) \ 17 | { \ 18 | ONSPAWN(O, onspawn_generic_npc); \ 19 | ONTICK(O, ai_generic_npc); \ 20 | } 21 | 22 | #define GENERIC_NPC_NOFACEPLAYER(O) \ 23 | { \ 24 | ONSPAWN(O, onspawn_generic_npc); \ 25 | ONTICK(O, ai_generic_npc_nofaceplayer); \ 26 | } 27 | 28 | void aftermove_StickToLinkedActionPoint(Object *o); 29 | void onspawn_set_frame_from_id2(Object *o); 30 | void onspawn_snap_to_ground(Object *o); 31 | void ai_generic_angled_shot(Object *o); 32 | 33 | void ai_generic_npc(Object *o); 34 | void ai_generic_npc_nofaceplayer(Object *o); 35 | void onspawn_generic_npc(Object *o); 36 | 37 | void ai_animate1(Object *o); 38 | void ai_animate2(Object *o); 39 | void ai_animate3(Object *o); 40 | void ai_animate4(Object *o); 41 | void ai_animate5(Object *o); 42 | 43 | void KillObjectsOfType(int type); 44 | void DeleteObjectsOfType(int type); 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /src/ai/sym/smoke.h: -------------------------------------------------------------------------------- 1 | #ifndef __SMOKE_H_ 2 | #define __SMOKE_H_ 3 | #include "../../object.h" 4 | Object *SmokePuff(int x, int y); 5 | void SmokeClouds(Object *o, int nclouds, int rangex = 0, int rangey = 0, Object *pushbehind = NULL); 6 | void SmokeXY(int x, int y, int nclouds, int rangex = 0, int rangey = 0, Object *pushbehind = NULL); 7 | void SmokeSide(Object *o, int nclouds, int dir); 8 | void SmokeCloudsSlow(int x, int y, int nclouds); 9 | void SmokeBoomUp(Object *o, int count = 8); 10 | void ai_smokecloud(Object *o); 11 | 12 | #endif -------------------------------------------------------------------------------- /src/ai/sym/sym.h: -------------------------------------------------------------------------------- 1 | #ifndef __AISYM_H_ 2 | #define __AISYM_H_ 3 | #include "../../object.h" 4 | 5 | void ai_null(Object *o); 6 | void ai_hvtrigger(Object *o); 7 | void ai_xp(Object *o); 8 | void ai_powerup(Object *o); 9 | bool Handle_Falling_Left(Object *o); 10 | void ai_hidden_powerup(Object *o); 11 | void ai_xp_capsule(Object *o); 12 | void ai_save_point(Object *o); 13 | void ai_recharge(Object *o); 14 | void ai_chest_closed(Object *o); 15 | void ai_chest_open(Object *o); 16 | void ai_lightning(Object *o); 17 | void ai_teleporter(Object *o); 18 | void ai_door(Object *o); 19 | void ai_largedoor(Object *o); 20 | void ai_press(Object *o); 21 | void ai_terminal(Object *o); 22 | void ai_fan_vert(Object *o); 23 | void ai_fan_hoz(Object *o); 24 | void ai_fan_droplet(Object *o); 25 | void ai_sprinkler(Object *o); 26 | void ai_droplet_spawner(Object *o); 27 | void ai_water_droplet(Object *o); 28 | void ai_bubble_spawner(Object *o); 29 | void ai_chinfish(Object *o); 30 | void ai_fireplace(Object *o); 31 | void ai_straining(Object *o); 32 | void ai_smoke_dropper(Object *o); 33 | void ai_scroll_controller(Object *o); 34 | void ai_quake(Object *o); 35 | void ai_generic_angled_shot(Object *o); 36 | void onspawn_spike_small(Object *o); 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /src/ai/village/balrog_boss_running.h: -------------------------------------------------------------------------------- 1 | #ifndef __AIBALROGRUN_H_ 2 | #define __AIBALROGRUN_H_ 3 | #include "../../object.h" 4 | 5 | void ai_balrog_boss_running(Object *o); 6 | static void walking_animation(Object *o); 7 | void ondeath_balrog_boss_running(Object *o); 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /src/ai/village/ma_pignon.h: -------------------------------------------------------------------------------- 1 | #ifndef __AIMAPIGNON_H_ 2 | #define __AIMAPIGNON_H_ 3 | #include "../../object.h" 4 | 5 | void ai_ma_pignon(Object *o); 6 | void ai_ma_pignon_rock(Object *o); 7 | void ai_ma_pignon_clone(Object *o); 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /src/ai/village/village.h: -------------------------------------------------------------------------------- 1 | #ifndef __AIVILLAGE_H_ 2 | #define __AIVILLAGE_H_ 3 | #include "../../object.h" 4 | 5 | void ai_toroko_shack(Object *o); 6 | void ai_mushroom_enemy(Object *o); 7 | void ai_gravekeeper(Object *o); 8 | void ai_cage(Object *o); 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /src/ai/weapons/blade.h: -------------------------------------------------------------------------------- 1 | #ifndef __AIBLADE_H_ 2 | #define __AIBLADE_H_ 3 | #include "../../object.h" 4 | 5 | void ai_blade_l3_shot(Object *o); 6 | void aftermove_blade_slash(Object *o); 7 | void ai_blade_slash(Object *o); 8 | void aftermove_blade_l12_shot(Object *o); 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /src/ai/weapons/bubbler.h: -------------------------------------------------------------------------------- 1 | #ifndef __AIBUBBLER_H_ 2 | #define __AIBUBBLER_H_ 3 | #include "../../object.h" 4 | 5 | void ai_bubbler_l12(Object *o); 6 | void ai_bubbler_l3(Object *o); 7 | void ai_bubbler_sharp(Object *o); 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /src/ai/weapons/fireball.h: -------------------------------------------------------------------------------- 1 | #ifndef __AIFIREBALL_H_ 2 | #define __AIFIREBALL_H_ 3 | #include "../../object.h" 4 | 5 | void ai_fireball(Object *o); 6 | void ai_fireball_level_23(Object *o); 7 | Object *create_fire_trail(Object *o, int objtype, int level); 8 | void ai_fireball_trail(Object *o); 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /src/ai/weapons/missile.h: -------------------------------------------------------------------------------- 1 | #ifndef __AIMISSILE_H_ 2 | #define __AIMISSILE_H_ 3 | #include "../../object.h" 4 | 5 | void ai_missile_shot(Object *o); 6 | void ai_missile_boom_spawner(Object *o); 7 | void ai_missile_boom_spawner_tick(Object *o); 8 | static void missilehitsmoke(int x, int y, int range); 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /src/ai/weapons/nemesis.h: -------------------------------------------------------------------------------- 1 | #ifndef __AINEMESIS_H_ 2 | #define __AINEMESIS_H_ 3 | #include "../../object.h" 4 | 5 | void ai_nemesis_shot(Object *o); 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /src/ai/weapons/polar_mgun.h: -------------------------------------------------------------------------------- 1 | #ifndef __AIPOLARM_H_ 2 | #define __AIPOLARM_H_ 3 | #include "../../object.h" 4 | 5 | void ai_polar_shot(Object *o); 6 | void ai_mgun_trail(Object *o); 7 | void ai_mgun_spawner(Object *o); 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /src/ai/weapons/snake.h: -------------------------------------------------------------------------------- 1 | #ifndef __AISNAKE_H_ 2 | #define __AISNAKE_H_ 3 | #include "../../object.h" 4 | 5 | void ai_snake(Object *o); 6 | void ai_snake_23(Object *o); 7 | void ai_snake_trail(Object *o); 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /src/ai/weapons/spur.h: -------------------------------------------------------------------------------- 1 | #ifndef __AISPUR_H_ 2 | #define __AISPUR_H_ 3 | #include "../../object.h" 4 | 5 | void ai_spur_shot(Object *o); 6 | static void spur_spawn_trail(Object *o); 7 | void ai_spur_trail(Object *o); 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /src/ai/weapons/weapons.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _WEAPONS_H 3 | #define _WEAPONS_H 4 | #include "../../caret.h" 5 | #include "../../object.h" 6 | #include "../stdai.h" 7 | 8 | uint8_t run_shot(Object *o, bool destroys_blocks); 9 | enum run_shot_result 10 | { 11 | RS_NONE = 0, 12 | RS_HIT_ENEMY, 13 | RS_HIT_WALL, 14 | RS_TTL_EXPIRED 15 | }; 16 | 17 | Object *check_hit_enemy(Object *o, uint32_t flags_to_exclude = 0); 18 | Object *damage_enemies(Object *o, uint32_t flags_to_exclude = 0); 19 | int damage_multiple_enemies(Object *o, uint32_t flags_to_exclude = 0); 20 | int damage_all_enemies_in_bb(Object *o, uint32_t flags_to_exclude, int x, int y, int range); 21 | 22 | void shot_spawn_effect(Object *o, int effectno); 23 | void shot_dissipate(Object *o, int effectno = EFFECT_STARPOOF); 24 | bool shot_destroy_blocks(Object *o); 25 | 26 | bool IsBlockedInShotDir(Object *o); 27 | 28 | // --------------------------------------- 29 | 30 | // from Fireball code, shared with Snake 31 | Object *create_fire_trail(Object *o, int objtype, int level); 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /src/ai/weapons/whimstar.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _WHIMSTAR_H 3 | #define _WHIMSTAR_H 4 | 5 | #include "../../object.h" 6 | 7 | #define MAX_WHIMSTARS 3 8 | 9 | struct Whimstar 10 | { 11 | int x, y; 12 | int xinertia, yinertia; 13 | }; 14 | 15 | struct WhimsicalStar 16 | { 17 | Whimstar stars[MAX_WHIMSTARS]; 18 | int nstars; 19 | int stariter; 20 | }; 21 | 22 | void init_whimstar(WhimsicalStar *wh); 23 | void add_whimstar(WhimsicalStar *wh); 24 | void remove_whimstar(WhimsicalStar *wh); 25 | void run_whimstar(WhimsicalStar *wh); 26 | void draw_whimstars(WhimsicalStar *wh); 27 | void ai_whimsical_star(Object *o); 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /src/ai/weed/balrog_boss_flying.h: -------------------------------------------------------------------------------- 1 | #ifndef __AIBALLROGFLY_H_ 2 | #define __AIBALLROGFLY_H_ 3 | #include "../../object.h" 4 | 5 | void ai_balrog_boss_flying(Object *o); 6 | void ondeath_balrog_boss_flying(Object *o); 7 | void ai_balrog_shot_bounce(Object *o); 8 | 9 | #endif -------------------------------------------------------------------------------- /src/ai/weed/frenzied_mimiga.h: -------------------------------------------------------------------------------- 1 | #ifndef __AIFRENZIEDMIMI_H_ 2 | #define __AIFRENZIEDMIMI_H_ 3 | #include "../../object.h" 4 | 5 | void ai_frenzied_mimiga(Object *o); 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /src/ai/weed/weed.h: -------------------------------------------------------------------------------- 1 | #ifndef __AIWEED_H_ 2 | #define __AIWEED_H_ 3 | #include "../../object.h" 4 | 5 | void ai_critter(Object *o); 6 | void ai_bat_hang(Object *o); 7 | void ai_bat_circle(Object *o); 8 | void ai_jelly(Object *o); 9 | void ai_giant_jelly(Object *o); 10 | void ai_mannan(Object *o); 11 | void ai_mannan_shot(Object *o); 12 | void ai_frog(Object *o); 13 | void ai_hey_spawner(Object *o); 14 | void ai_motorbike(Object *o); 15 | void ai_malco(Object *o); 16 | void ai_malco_broken(Object *o); 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /src/autogen/AssignSprites.h: -------------------------------------------------------------------------------- 1 | #ifndef __ASSIGN_SPRITES_H 2 | #define __ASSIGN_SPRITES_H 3 | 4 | void AssignSprites(void); 5 | #endif -------------------------------------------------------------------------------- /src/common/InitList.cpp: -------------------------------------------------------------------------------- 1 | 2 | // this is a combination of some C++ and preprocessor magic which allows a 3 | // group of initilization functions to be declared across many different 4 | // source files and then at the appropriate time all can be called at once. 5 | // The "trick" is that it automatically works for all modules linked to the 6 | // program so you don't have to keep a handmade list anywhere of the names 7 | // of the initilization functions. This is used by the AI functions to initilize 8 | // all the function pointers etc for the various creatures. 9 | #include "InitList.h" 10 | 11 | #include "../Utils/Logger.h" 12 | 13 | void InitList::AddFunction(void (*func)(void)) 14 | { 15 | AddFunction((void *)func); 16 | } 17 | 18 | void InitList::AddFunction(bool (*func)(void)) 19 | { 20 | AddFunction((void *)func); 21 | } 22 | 23 | void InitList::AddFunction(void *func) 24 | { 25 | // stat("AddFunction (void)%08x [%d]", func, fCount); 26 | if (fCount >= MAX_INIT_RECORDS) 27 | return; 28 | 29 | fFunctions[fCount++] = (void *)func; 30 | } 31 | 32 | /* 33 | void c------------------------------() {} 34 | */ 35 | 36 | bool InitList::CallFunctions() 37 | { 38 | int i; 39 | 40 | if (fCount >= MAX_INIT_RECORDS) 41 | { 42 | LOG_DEBUG("InitList::CallFunctions({:#08x}): too many initializers", (intptr_t)this); 43 | return 1; 44 | } 45 | 46 | LOG_DEBUG("InitList::CallFunctions({:#08x}): executing {} functions...", (intptr_t)this, fCount); 47 | 48 | for (i = 0; i < fCount; i++) 49 | { 50 | void (*func)(void) = (void (*)())fFunctions[i]; 51 | (*func)(); 52 | } 53 | 54 | return 0; 55 | } 56 | -------------------------------------------------------------------------------- /src/common/InitList.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _INITLIST_H 3 | #define _INITLIST_H 4 | 5 | #define MAX_INIT_RECORDS 100 6 | 7 | class InitList 8 | { 9 | public: 10 | void AddFunction(void (*func)(void)); 11 | void AddFunction(bool (*func)(void)); 12 | void AddFunction(void *func); 13 | bool CallFunctions(); 14 | 15 | private: 16 | void *fFunctions[MAX_INIT_RECORDS]; 17 | int fCount; // counting on behavior of auto-initilization to 0 18 | }; 19 | 20 | class InitAdder 21 | { 22 | public: 23 | InitAdder(InitList *initlist, void (*func)(void)) 24 | { 25 | initlist->AddFunction(func); 26 | } 27 | InitAdder(InitList *initlist, bool (*func)(void)) 28 | { 29 | initlist->AddFunction(func); 30 | } 31 | InitAdder(InitList &initlist, void (*func)(void)) 32 | { 33 | initlist.AddFunction(func); 34 | } 35 | InitAdder(InitList &initlist, bool (*func)(void)) 36 | { 37 | initlist.AddFunction(func); 38 | } 39 | }; 40 | 41 | #define INITFUNC(TARGET) \ 42 | static void __InitFunc(void); \ 43 | static InitAdder _ia(TARGET, __InitFunc); \ 44 | static void __InitFunc(void) 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /src/common/basics.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _BASICS_H 3 | #define _BASICS_H 4 | 5 | #include 6 | 7 | #if defined(__APPLE__) || defined(_WIN32) 8 | #define MAXPATHLEN 256 9 | #else 10 | #include // MAXPATHLEN 11 | #endif 12 | 13 | #ifndef PATH_MAX 14 | #define PATH_MAX 259 15 | #endif 16 | 17 | #include "../Utils/Logger.h" 18 | 19 | #define ASSERT(X) \ 20 | { \ 21 | if (!(X)) \ 22 | { \ 23 | LOG_CRITICAL("** ASSERT FAILED: '%s' at %s(%d)", #X, __FILE__, __LINE__); \ 24 | exit(1); \ 25 | } \ 26 | } 27 | 28 | #define SWAP(A, B) \ 29 | { \ 30 | A ^= B; \ 31 | B ^= A; \ 32 | A ^= B; \ 33 | } 34 | 35 | #ifndef MIN 36 | #define MIN(A, B) (((A) < (B)) ? (A) : (B)) 37 | #endif 38 | 39 | #ifndef MAX 40 | #define MAX(A, B) (((A) > (B)) ? (A) : (B)) 41 | #endif 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /src/common/bufio.h: -------------------------------------------------------------------------------- 1 | #ifndef _BUFIO_H 2 | #define _BUFIO_H 3 | #include "../Utils/Logger.h" 4 | 5 | #include 6 | 7 | static uint8_t read_U8(const uint8_t **data, const uint8_t *data_end) 8 | { 9 | if (*data > data_end) 10 | { 11 | LOG_ERROR("read_U8: read past end of buffer: *data > data_end"); 12 | return 0xfe; 13 | } 14 | 15 | return *(*data)++; 16 | } 17 | 18 | static uint16_t read_U16(const uint8_t **data, const uint8_t *data_end) 19 | { 20 | const uint8_t *ptr = *data; 21 | 22 | if ((ptr + 1) > data_end) 23 | { 24 | LOG_ERROR("read_U16: read past end of buffer: *data + 1 > data_end"); 25 | return 0xfefe; 26 | } 27 | 28 | *data = (ptr + 2); 29 | // we should not just cast to a uint16_t, as some processors 30 | // e.g. ARM would have alignment issues then, plus endian issues on others. 31 | return (ptr[1] << 8) | ptr[0]; 32 | } 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /src/common/glob.h: -------------------------------------------------------------------------------- 1 | #ifndef _GLOB_H_ 2 | #define _GLOB_H_ 3 | 4 | #include 5 | #include 6 | 7 | #ifdef _WIN32 8 | #include "misc.h" 9 | 10 | #include 11 | #else 12 | #include 13 | #endif 14 | 15 | class Glob 16 | { 17 | public: 18 | Glob(const std::string &pattern); 19 | ~Glob(); 20 | 21 | bool Next(); 22 | 23 | private: 24 | Glob(const Glob &); 25 | void operator=(const Glob &); 26 | std::string _base; 27 | 28 | public: 29 | #ifdef _WIN32 30 | std::string GetFileName() const 31 | { 32 | assert(ok_); 33 | return _base + "/" + narrow(find_data_.cFileName); 34 | } 35 | 36 | operator bool() const 37 | { 38 | return ok_; 39 | } 40 | 41 | private: 42 | bool ok_; 43 | HANDLE find_handle_; 44 | WIN32_FIND_DATA find_data_; 45 | #else 46 | std::string GetFileName() const 47 | { 48 | assert(dir_entry_ != 0); 49 | return _base + "/" + std::string(dir_entry_->d_name); 50 | } 51 | 52 | operator bool() const 53 | { 54 | return dir_entry_ != 0; 55 | } 56 | 57 | private: 58 | std::string pattern_; 59 | DIR *dir_; 60 | struct dirent *dir_entry_; 61 | #endif 62 | }; 63 | 64 | #endif -------------------------------------------------------------------------------- /src/common/myfnmatch.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_MY_FNMATCH_H 2 | #define HEADER_MY_FNMATCH_H 3 | 4 | #define MY_FNMATCH_MATCH 0 5 | #define MY_FNMATCH_NOMATCH 1 6 | #define MY_FNMATCH_FAIL 2 7 | 8 | int myfnmatch(const char *pattern, const char *string); 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /src/config.h: -------------------------------------------------------------------------------- 1 | #ifndef _CONFIG_H 2 | #define _CONFIG_H 3 | 4 | #endif 5 | -------------------------------------------------------------------------------- /src/console.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _CONSOLE_H 3 | #define _CONSOLE_H 4 | 5 | #define CONSOLE_MAXCMDLEN 48 6 | #define CONSOLE_MAXRESPONSELEN 48 7 | 8 | // how many commands to remember in the backbuffer 9 | #define CONSOLE_MAX_BACK 8 10 | #include 11 | #include 12 | #include 13 | 14 | struct CommandEntry 15 | { 16 | std::string name; 17 | void (*handler)(std::vector *args, int num); 18 | unsigned int minArgs, maxArgs; 19 | std::string help; 20 | }; 21 | 22 | class DebugConsole 23 | { 24 | public: 25 | DebugConsole(); 26 | 27 | void SetVisible(bool newstate); 28 | bool IsVisible(); 29 | 30 | bool HandleKey(int key); 31 | void HandleKeyRelease(int key); 32 | void Draw(); 33 | 34 | bool Execute(std::string& line); 35 | 36 | template void Print(const std::string& format, Args... args) 37 | { 38 | fResponse.push_back(fmt::format(format, args...)); 39 | fResponseTimer = 60; 40 | } 41 | 42 | std::vector& getCommands() 43 | { 44 | return commands; 45 | } 46 | 47 | private: 48 | void DrawDebugText(const std::string& text, int y = 16); 49 | void MatchCommand(const std::string& cmd, std::vector& matches); 50 | std::string SplitCommand(const std::string& line_in, std::vector& args); 51 | void ExpandCommand(); 52 | 53 | std::string fLine = ""; 54 | int fKeyDown = 0; 55 | int fRepeatTimer = 0; 56 | 57 | std::string fLineToExpand = ""; 58 | bool fBrowsingExpansion; 59 | unsigned int fExpandIndex; 60 | 61 | std::vector fResponse; 62 | int fResponseTimer = 0; 63 | 64 | int fCursorTimer = 0; 65 | bool fVisible = false; 66 | 67 | // up-down last-command buffer 68 | int fBackIndex; 69 | std::vector fBackBuffer; 70 | std::vector commands; 71 | }; 72 | 73 | extern DebugConsole console; 74 | 75 | #endif 76 | -------------------------------------------------------------------------------- /src/debug.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _DEBUG_H 3 | #define _DEBUG_H 4 | 5 | #define DM_PIXEL 0 6 | #define DM_CROSSHAIR 1 7 | #define DM_XLINE 2 8 | #define DM_YLINE 3 9 | #define DM_BOX 4 10 | 11 | #include 12 | 13 | void DrawDebug(void); 14 | void DrawBoundingBoxes(); 15 | void DrawAttrPoints(); 16 | void debug(const char *fmt, ...); 17 | void debug_draw(void); 18 | void debug_clear(); 19 | const char *DescribeObjectType(int type); 20 | int ObjectNameToType(const char *name_in); 21 | const char *DescribeDir(int dir); 22 | const char *strhex(int value); 23 | void DrawDebugMarks(void); 24 | void AddDebugMark(int x, int y, int x2, int y2, char type, uint8_t r, uint8_t g, uint8_t b); 25 | void DebugPixel(int x, int y, uint8_t r, uint8_t g, uint8_t b); 26 | void DebugCrosshair(int x, int y, uint8_t r, uint8_t g, uint8_t b); 27 | void crosshair(int x, int y); 28 | void DebugPixelNonCSF(int x, int y, uint8_t r, uint8_t g, uint8_t b); 29 | void DebugCrosshairNonCSF(int x, int y, uint8_t r, uint8_t g, uint8_t b); 30 | void debugVline(int x, uint8_t r, uint8_t g, uint8_t b); 31 | void debugHline(int y, uint8_t r, uint8_t g, uint8_t b); 32 | void debugbox(int x1, int y1, int x2, int y2, uint8_t r, uint8_t g, uint8_t b); 33 | void debugtile(int x, int y, uint8_t r, uint8_t g, uint8_t b); 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /src/endgame/CredReader.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _CREDITS_READER_H 3 | #define _CREDITS_READER_H 4 | 5 | #include 6 | 7 | enum CC 8 | { 9 | CC_TEXT = '[', 10 | CC_SET_XOFF = '+', 11 | CC_BLANK_SPACE = '-', 12 | 13 | CC_JUMP = 'j', 14 | CC_FLAGJUMP = 'f', 15 | CC_LABEL = 'l', 16 | 17 | CC_MUSIC = '!', 18 | CC_FADE_MUSIC = '~', 19 | CC_END = '/' 20 | }; 21 | 22 | // represents a command from the .tsc 23 | struct CredCommand 24 | { 25 | char type = 0; 26 | int parm, parm2 = 0; 27 | std::string text = ""; 28 | 29 | void DumpContents(); 30 | }; 31 | 32 | class CredReader 33 | { 34 | public: 35 | CredReader(); 36 | bool OpenFile(); 37 | void CloseFile(); 38 | bool ReadCommand(CredCommand *cmd); 39 | void Rewind(); 40 | 41 | private: 42 | int ReadNumber(); 43 | char get(); 44 | void unget(); 45 | char peek(); 46 | 47 | std::string data; 48 | int dataindex, datalen; 49 | }; 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /src/endgame/credits.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _CREDITS_H 3 | #define _CREDITS_H 4 | 5 | #define MAX_BIGIMAGES 20 6 | #define CRED_MAX_TEXT 80 7 | #include "../graphics/Surface.h" 8 | #include "CredReader.h" 9 | 10 | #include 11 | 12 | // a currently displayed line of text 13 | struct CredLine 14 | { 15 | std::string text = ""; 16 | int image = 0; 17 | int x, y = 0; 18 | bool remove = false; 19 | }; 20 | 21 | class BigImage 22 | { 23 | public: 24 | bool Init(); 25 | ~BigImage(); 26 | 27 | void Set(int num); 28 | void Clear(); 29 | void Draw(); 30 | 31 | private: 32 | int imagex, state; 33 | int imgno; 34 | NXE::Graphics::Surface *images[MAX_BIGIMAGES]; 35 | }; 36 | 37 | class Credits 38 | { 39 | public: 40 | bool Init(); 41 | void Tick(); 42 | void Draw(); 43 | ~Credits(); 44 | 45 | BigImage bigimage; // current "SIL" big left-hand image 46 | 47 | private: 48 | void RunNextCommand(); 49 | bool Jump(int label); 50 | 51 | void DrawLine(CredLine& line); 52 | 53 | int spawn_y; // position of next line relative to top of roll 54 | int scroll_y; // CSFd roll position 55 | 56 | int xoffset; // x position of next line 57 | 58 | // turns off scrolling and further script execution when "/" command hit at end 59 | bool roll_running; 60 | 61 | CredReader script; 62 | std::vector lines; 63 | }; 64 | 65 | bool credit_init(int parameter); 66 | void credit_tick(); 67 | void credit_set_image(int imgno); 68 | void credit_clear_image(); 69 | void credit_close(); 70 | void credit_draw(); 71 | 72 | #endif 73 | -------------------------------------------------------------------------------- /src/endgame/island.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _ISLAND_H 3 | #define _ISLAND_H 4 | 5 | bool island_init(int survives); 6 | void island_tick(); 7 | void island_draw(); 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /src/endgame/misc.h: -------------------------------------------------------------------------------- 1 | #ifndef __EMISC_H_ 2 | #define __EMISC_H_ 3 | #include "../object.h" 4 | 5 | void ai_cloud_spawner(Object *o); 6 | void ai_cloud(Object *o); 7 | void ai_balrog_flying(Object *o); 8 | void aftermove_balrog_passenger(Object *o); 9 | void ai_balrog_medic(Object *o); 10 | void ai_gaudi_patient(Object *o); 11 | void ai_baby_puppy(Object *o); 12 | void ai_turning_human(Object *o); 13 | void ai_ahchoo(Object *o); 14 | void ai_misery_wind(Object *o); 15 | void ai_the_cast(Object *o); 16 | 17 | #endif -------------------------------------------------------------------------------- /src/extract/crc.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "crc.h" 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | static uint32_t CRC_Table[256]; 9 | static const uint32_t poly = 0x04c11db7; 10 | 11 | uint32_t reflect(uint32_t value, int size) 12 | { 13 | uint32_t newbits = 0; 14 | int i; 15 | 16 | for (i = 1; i <= size; i++) 17 | { 18 | if (value & 1) 19 | newbits |= (1 << (size - i)); 20 | 21 | value >>= 1; 22 | } 23 | 24 | return newbits; 25 | } 26 | 27 | void crc_init(void) 28 | { 29 | int i, j; 30 | 31 | for (i = 0; i < 256; i++) 32 | { 33 | CRC_Table[i] = reflect(i, 8) << 24; 34 | 35 | for (j = 0; j < 8; j++) 36 | CRC_Table[i] = (CRC_Table[i] << 1) ^ ((CRC_Table[i] & (1 << 31)) ? poly : 0); 37 | 38 | CRC_Table[i] = reflect(CRC_Table[i], 32); 39 | } 40 | } 41 | 42 | uint32_t crc_calc(uint8_t *buf, uint32_t size) 43 | { 44 | uint32_t crc = 0xFFFFFFFF; 45 | 46 | while (size) 47 | { 48 | crc = (crc >> 8) ^ CRC_Table[(crc & 0xFF) ^ *buf++]; 49 | size--; 50 | } 51 | 52 | return (crc ^ 0xFFFFFFFF); 53 | } 54 | -------------------------------------------------------------------------------- /src/extract/crc.h: -------------------------------------------------------------------------------- 1 | #ifndef __CRC_H_ 2 | #define __CRC_H_ 3 | 4 | #include 5 | 6 | void crc_init(void); 7 | uint32_t crc_calc(uint8_t *buf, uint32_t size); 8 | 9 | #endif -------------------------------------------------------------------------------- /src/extract/extractfiles.h: -------------------------------------------------------------------------------- 1 | #ifndef __EXTRACTFILES_H_ 2 | #define __EXTRACTFILES_H_ 3 | 4 | #include 5 | 6 | bool extract_files(FILE *exefp); 7 | 8 | #endif -------------------------------------------------------------------------------- /src/extract/extractpxt.h: -------------------------------------------------------------------------------- 1 | #ifndef __EXTRACTPXT_H_ 2 | #define __EXTRACTPXT_H_ 3 | 4 | #include 5 | 6 | bool extract_pxt(FILE *fp); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /src/extract/extractstages.h: -------------------------------------------------------------------------------- 1 | #ifndef __EXTRACTSTAGES_H_ 2 | #define __EXTRACTSTAGES_H_ 3 | 4 | #include 5 | 6 | bool extract_stages(FILE *exefp); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /src/extract/main.cpp: -------------------------------------------------------------------------------- 1 | #include "extractfiles.h" 2 | #include "extractpxt.h" 3 | #include "extractstages.h" 4 | 5 | #include 6 | #include 7 | 8 | static const char *filename = "Doukutsu.exe"; 9 | 10 | int main(int argc, char *argv[]) 11 | { 12 | FILE *fp; 13 | 14 | fp = fopen(filename, "rb"); 15 | if (!fp) 16 | { 17 | printf("Can't open Doukutsu.exe!\n"); 18 | return 1; 19 | } 20 | 21 | if (extract_pxt(fp)) 22 | return 1; 23 | if (extract_files(fp)) 24 | return 1; 25 | if (extract_stages(fp)) 26 | return 1; 27 | fclose(fp); 28 | printf("Sucessfully extracted.\n"); 29 | return 0; 30 | } 31 | -------------------------------------------------------------------------------- /src/floattext.h: -------------------------------------------------------------------------------- 1 | #ifndef _FLOATTEXT_H 2 | #define _FLOATTEXT_H 3 | class Object; 4 | #include 5 | #define FT_Y_START -4 // this starts it exactly centered, since the font is 8px tall 6 | #define FT_Y_HOLD -19 7 | #define FT_Y_RISEAWAY (FT_Y_HOLD - 8) 8 | 9 | enum FloatTextStates 10 | { 11 | FT_IDLE, 12 | FT_RISE, 13 | FT_HOLD, 14 | FT_SCROLL_AWAY, 15 | }; 16 | 17 | class FloatText 18 | { 19 | public: 20 | FloatText(int sprite); 21 | ~FloatText(); 22 | void Reset(); 23 | 24 | void AddQty(int amt); 25 | bool IsScrollingAway(); 26 | 27 | void UpdatePos(Object *assoc_object); 28 | 29 | static void DrawAll(); 30 | static void UpdateAll(); 31 | static void DeleteAll(); 32 | static void ResetAll(void); 33 | 34 | bool ObjectDestroyed; 35 | 36 | private: 37 | void Draw(); 38 | void Update(); 39 | 40 | uint8_t state; 41 | 42 | int yoff; // how much we've risen 43 | int shownAmount; 44 | int sprite; // allows selecting font 45 | int timer; 46 | 47 | int objX, objY; // the center pixel of the associated object (de-CSFd) 48 | 49 | FloatText *next, *prev; 50 | static FloatText *first, *last; 51 | }; 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /src/graphics/Font.h: -------------------------------------------------------------------------------- 1 | #ifndef _BMFONT_H 2 | #define _BMFONT_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | namespace NXE 10 | { 11 | namespace Graphics 12 | { 13 | 14 | class Font 15 | { 16 | public: 17 | struct Glyph 18 | { 19 | uint32_t glyph_id; 20 | uint32_t atlasid; 21 | uint32_t x; 22 | uint32_t y; 23 | uint32_t w; 24 | uint32_t h; 25 | uint32_t xadvance; 26 | uint32_t xoffset; 27 | uint32_t yoffset; 28 | }; 29 | 30 | Font(); 31 | ~Font(); 32 | bool load(); 33 | void cleanup(); 34 | const Font::Glyph &glyph(uint32_t codepoint); 35 | SDL_Texture *atlas(uint32_t idx); 36 | uint32_t draw(int x, int y, const std::string &text, uint32_t color = 0xFFFFFF, bool isShaded = false); 37 | uint32_t drawLTR(int x, int y, const std::string &text, uint32_t color = 0xFFFFFF, bool isShaded = false); 38 | uint32_t getWidth(const std::string &text); 39 | uint32_t getHeight() const; 40 | uint32_t getBase() const; 41 | 42 | 43 | private: 44 | std::vector _atlases; 45 | std::map _glyphs; 46 | uint32_t _height; 47 | uint32_t _base; 48 | uint32_t _upscale; 49 | bool _rendering = true; 50 | const uint8_t _shadowOffset = 1; 51 | }; 52 | 53 | }; // namespace NXE 54 | }; // namespace Graphics 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /src/graphics/Sprites.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _SPRITES_H 3 | #define _SPRITES_H 4 | 5 | #define MAX_SPRITESHEETS 128 6 | #define MAX_SPRITES 512 7 | 8 | #include "../siflib/sif.h" 9 | #include "Surface.h" 10 | 11 | #include 12 | #include 13 | #include 14 | 15 | namespace NXE 16 | { 17 | namespace Graphics 18 | { 19 | 20 | class Sprites 21 | { 22 | public: 23 | Sprites(); 24 | ~Sprites(); 25 | 26 | bool init(); 27 | void close(); 28 | void flushSheets(); 29 | 30 | void blitSprite(int x, int y, int s, int frame, uint8_t dir, int xoff, int yoff, int wd, int ht, int alpha = 255); 31 | void blitSpriteMirrored(int x, int y, int s, int frame, uint8_t dir, int xoff, int yoff, int wd, int ht, int alpha = 255); 32 | 33 | void drawSprite(int x, int y, int s, int frame = 0, uint8_t dir = 0); 34 | void drawSpriteMirrored(int x, int y, int s, int frame = 0, uint8_t dir = 0); 35 | void drawSpriteAtDp(int x, int y, int s, int frame = 0, uint8_t dir = 0); 36 | void drawSpriteClipped(int x, int y, int s, int frame, uint8_t dir, int clipx1, int clipx2, int clipy1, int clipy2); 37 | void drawSpriteClipWidth(int x, int y, int s, int frame, int wd); 38 | void drawSpriteChopped(int x, int y, int s, int frame, int wd, int repeat_at, int alpha = 255); 39 | void drawSpriteRepeatingX(int x, int y, int s, int frame, int wd); 40 | 41 | SIFSprite sprites[MAX_SPRITES]; 42 | 43 | private: 44 | Surface *_spritesheets[MAX_SPRITESHEETS]; 45 | int _num_spritesheets = 0; 46 | int _num_sprites = 0; 47 | std::vector _sheetfiles; 48 | 49 | void _offset_by_draw_points(); 50 | void _expand_single_dir_sprites(); 51 | void _create_slope_boxes(); 52 | bool _load_sif(const std::string &fname); 53 | void _loadSheetIfNeeded(int sheetno); 54 | }; 55 | }; // namespace Graphics 56 | }; // namespace NXE 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /src/graphics/Surface.cpp: -------------------------------------------------------------------------------- 1 | #include "Surface.h" 2 | #include "Renderer.h" 3 | #include "../Utils/Logger.h" 4 | #include "zoom.h" 5 | 6 | namespace NXE 7 | { 8 | namespace Graphics 9 | { 10 | 11 | Surface::Surface() 12 | : _texture(nullptr) 13 | , _width(0) 14 | , _height(0) 15 | { 16 | } 17 | 18 | Surface::~Surface() 19 | { 20 | cleanup(); 21 | } 22 | 23 | // load the surface from a .pbm or bitmap file 24 | bool Surface::loadImage(const std::string &pbm_name, bool use_colorkey) 25 | { 26 | cleanup(); 27 | 28 | SDL_Surface *image = SDL_LoadBMP(pbm_name.c_str()); 29 | if (!image) 30 | { 31 | LOG_ERROR("Surface::LoadImage: load failed of '{}'! {}", pbm_name, SDL_GetError()); 32 | return false; 33 | } 34 | 35 | _width = image->w * Renderer::getInstance()->scale; 36 | _height = image->h * Renderer::getInstance()->scale; 37 | 38 | SDL_Surface *image_scaled = SDL_ZoomSurface(image, Renderer::getInstance()->scale); 39 | SDL_FreeSurface(image); 40 | 41 | if (use_colorkey) 42 | { 43 | SDL_SetColorKey(image_scaled, SDL_TRUE, SDL_MapRGB(image_scaled->format, 0, 0, 0)); 44 | } 45 | 46 | _texture = SDL_CreateTextureFromSurface(Renderer::getInstance()->renderer(), image_scaled); 47 | 48 | SDL_FreeSurface(image_scaled); 49 | 50 | if (!_texture) 51 | { 52 | LOG_ERROR("Surface::LoadImage: SDL_CreateTextureFromSurface failed: {}", SDL_GetError()); 53 | return false; 54 | } 55 | 56 | return true; 57 | } 58 | 59 | Surface *Surface::fromFile(const std::string &pbm_name, bool use_colorkey) 60 | { 61 | Surface *sfc = new Surface; 62 | if (!sfc->loadImage(pbm_name, use_colorkey)) 63 | { 64 | delete sfc; 65 | return nullptr; 66 | } 67 | 68 | return sfc; 69 | } 70 | 71 | int Surface::width() 72 | { 73 | return _width / Renderer::getInstance()->scale; 74 | } 75 | 76 | int Surface::height() 77 | { 78 | return _height / Renderer::getInstance()->scale; 79 | } 80 | 81 | SDL_Texture* Surface::texture() 82 | { 83 | return _texture; 84 | } 85 | 86 | void Surface::cleanup() 87 | { 88 | if (_texture) 89 | { 90 | SDL_DestroyTexture(_texture); 91 | _texture = nullptr; 92 | } 93 | } 94 | 95 | }; // namespace Graphics 96 | }; // namespace NXE 97 | -------------------------------------------------------------------------------- /src/graphics/Surface.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _SURFACE_H 3 | #define _SURFACE_H 4 | 5 | #include "../common/basics.h" 6 | 7 | #include 8 | #include 9 | #include "types.h" 10 | 11 | namespace NXE 12 | { 13 | namespace Graphics 14 | { 15 | 16 | class Surface 17 | { 18 | public: 19 | Surface(); 20 | ~Surface(); 21 | 22 | bool loadImage(const std::string &pbm_name, bool use_colorkey = false); 23 | static Surface *fromFile(const std::string &pbm_name, bool use_colorkey = false); 24 | 25 | int width(); 26 | int height(); 27 | SDL_Texture* texture(); 28 | 29 | private: 30 | void cleanup(); 31 | 32 | SDL_Texture *_texture; 33 | int _width; 34 | int _height; 35 | 36 | public: 37 | int alpha = 255; 38 | }; 39 | 40 | }; // namespace Graphics 41 | }; // namespace NXE 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /src/graphics/Tileset.cpp: -------------------------------------------------------------------------------- 1 | // manages the tileset 2 | #include "Tileset.h" 3 | 4 | #include "../ResourceManager.h" 5 | #include "../config.h" 6 | #include "../nx.h" 7 | #include "Surface.h" 8 | #include "Renderer.h" 9 | 10 | #include 11 | #include 12 | 13 | extern const char *tileset_names[]; // from stagedata.cpp 14 | 15 | namespace NXE 16 | { 17 | namespace Graphics 18 | { 19 | 20 | Tileset::Tileset() {} 21 | 22 | Tileset::~Tileset() 23 | { 24 | delete _tileset; 25 | } 26 | 27 | // load the given tileset into memory, replacing any other tileset. 28 | bool Tileset::load(int new_tileset) 29 | { 30 | char fname[MAXPATHLEN]; 31 | 32 | if (new_tileset != _current_tileset) 33 | { 34 | if (_tileset) 35 | { 36 | delete _tileset; 37 | _current_tileset = -1; 38 | } 39 | 40 | sprintf(fname, "Stage/Prt%s.pbm", tileset_names[new_tileset]); 41 | 42 | _tileset = Surface::fromFile(ResourceManager::getInstance()->getPath(fname), true); 43 | if (!_tileset) 44 | { 45 | return false; 46 | } 47 | 48 | _current_tileset = new_tileset; 49 | } 50 | 51 | return true; 52 | } 53 | 54 | // draw the given tile from the current tileset to the screen 55 | void Tileset::drawTile(int x, int y, int t) 56 | { 57 | // 16 tiles per row on all tilesheet 58 | int srcx = (t % 16) * TILE_W; 59 | int srcy = (t / 16) * TILE_H; 60 | 61 | Renderer::getInstance()->drawSurface(_tileset, x, y, srcx, srcy, TILE_W, TILE_H); 62 | } 63 | 64 | void Tileset::reload() 65 | { 66 | if (_current_tileset != -1) 67 | { 68 | int tileset = _current_tileset; 69 | _current_tileset = -1; 70 | load(tileset); 71 | } 72 | } 73 | 74 | }; //namespace Graphics 75 | }; //namespace NXE -------------------------------------------------------------------------------- /src/graphics/Tileset.h: -------------------------------------------------------------------------------- 1 | #ifndef _TILESET_H 2 | #define _TILESET_H 3 | 4 | #include "Surface.h" 5 | 6 | #define TILE_W 16 7 | #define TILE_H 16 8 | 9 | namespace NXE 10 | { 11 | namespace Graphics 12 | { 13 | 14 | class Tileset 15 | { 16 | public: 17 | Tileset(); 18 | ~Tileset(); 19 | bool init(); 20 | void close(); 21 | 22 | bool load(int new_tileset); 23 | void reload(); 24 | 25 | void drawTile(int x, int y, int t); 26 | private: 27 | Surface *_tileset = nullptr; 28 | int _current_tileset = -1; 29 | }; 30 | 31 | }; // namespace Graphics 32 | }; // namespace Tileset 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /src/graphics/pngfuncs.h: -------------------------------------------------------------------------------- 1 | /* SaveSurf: an example on how to save a SDLSurface in PNG 2 | Copyright (C) 2006 Angelo "Encelo" Theodorou 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation; either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | 18 | NOTE: 19 | 20 | This program is part of "Mars, Land of No Mercy" SDL examples, 21 | you can find other examples on http://marsnomercy.org 22 | */ 23 | 24 | #include 25 | #include 26 | 27 | int png_save_surface(const std::string& filename, SDL_Surface *surf); 28 | SDL_Surface *png_load_surface(const std::string& filename); 29 | -------------------------------------------------------------------------------- /src/graphics/types.h: -------------------------------------------------------------------------------- 1 | #ifndef _G_TYPES_H 2 | #define _G_TYPES_H 3 | 4 | #include 5 | #include 6 | 7 | struct NXColor 8 | { 9 | uint8_t r, g, b; 10 | 11 | NXColor() 12 | : r(0) 13 | , g(0) 14 | , b(0) 15 | { 16 | } 17 | 18 | NXColor(uint8_t rr, uint8_t gg, uint8_t bb) 19 | : r(rr) 20 | , g(gg) 21 | , b(bb) 22 | { 23 | } 24 | 25 | NXColor(uint32_t hexcolor) 26 | { 27 | r = hexcolor >> 16; 28 | g = hexcolor >> 8; 29 | b = hexcolor; 30 | } 31 | 32 | inline bool operator==(const NXColor& rhs) const 33 | { 34 | return (this->r == rhs.r && this->g == rhs.g && this->b == rhs.b); 35 | } 36 | 37 | inline bool operator!=(const NXColor& rhs) const 38 | { 39 | return (this->r != rhs.r || this->g != rhs.g || this->b != rhs.b); 40 | } 41 | }; 42 | 43 | typedef SDL_Rect NXRect; 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /src/graphics/zoom.h: -------------------------------------------------------------------------------- 1 | #ifndef _ZOOM_H 2 | #define _ZOOM_H 3 | 4 | #include "SDL.h" 5 | 6 | #include 7 | 8 | SDL_Surface *SDL_ZoomSurface(SDL_Surface *src, double zoom); 9 | 10 | #endif /* _SDL2_rotozoom_h */ -------------------------------------------------------------------------------- /src/i18n/minibidi.h: -------------------------------------------------------------------------------- 1 | /************************************************************************ 2 | * $Id$ 3 | * 4 | * ------------ 5 | * Description: 6 | * ------------ 7 | * This is an implemention of Unicode's Bidirectional Algorithm 8 | * (known as UAX #9). 9 | * 10 | * http://www.unicode.org/reports/tr9/ 11 | * 12 | * Author: Ahmad Khalifa 13 | * 14 | * ----------------- 15 | * Revision Details: (Updated by Revision Control System) 16 | * ----------------- 17 | * $Date$ 18 | * $Author$ 19 | * $Revision$ 20 | * $Source$ 21 | * 22 | * (www.arabeyes.org - under MIT license) 23 | * 24 | ************************************************************************/ 25 | #include 26 | 27 | #define BLOCKTYPE uint32_t* 28 | #define CHARTYPE uint32_t 29 | #define bidi_char uint32_t 30 | 31 | //int doBidi(BLOCKTYPE line, int count, bool applyShape, bool reorderCombining); 32 | int doBidi(bidi_char* line, int count, bool applyShape, bool reorderCombining); 33 | -------------------------------------------------------------------------------- /src/i18n/translate.cpp: -------------------------------------------------------------------------------- 1 | #include "translate.h" 2 | 3 | #include "../ResourceManager.h" 4 | #include "../common/misc.h" 5 | #include "../Utils/Logger.h" 6 | #include "minibidi.h" 7 | 8 | #include 9 | #include 10 | #include 11 | 12 | I18N::I18N() 13 | : _strings() 14 | { 15 | } 16 | 17 | I18N::~I18N() {} 18 | 19 | bool I18N::load() 20 | { 21 | std::string path = ResourceManager::getInstance()->getPath("system.json"); 22 | std::ifstream fl; 23 | _strings.clear(); 24 | fl.open(widen(path), std::ifstream::in | std::ifstream::binary); 25 | if (fl.is_open()) 26 | { 27 | nlohmann::json langfile = nlohmann::json::parse(fl); 28 | 29 | _rtl = langfile.value("rtl", false); 30 | 31 | for (auto it = langfile.begin(); it != langfile.end(); ++it) 32 | { 33 | if (it.key() != "rtl") 34 | { 35 | std::string result = it.value(); 36 | std::vector utf32result; 37 | utf8::utf8to32(result.begin(), result.end(), std::back_inserter(utf32result)); 38 | doBidi(&utf32result[0], utf32result.size(), true, false); 39 | result.clear(); 40 | utf8::utf32to8(utf32result.begin(), utf32result.end(), std::back_inserter(result)); 41 | LOG_DEBUG("{}: {}", it.key(), result); 42 | 43 | _strings[ it.key() ] = std::move(result); 44 | } 45 | } 46 | return true; 47 | } 48 | return false; 49 | } 50 | 51 | const std::string &I18N::translate(const std::string &key) 52 | { 53 | if (_strings.find(key) != _strings.end()) 54 | { 55 | return _strings.at(key); 56 | } 57 | else 58 | { 59 | return key; 60 | } 61 | } 62 | 63 | const bool I18N::isRTL() 64 | { 65 | return _rtl; 66 | } -------------------------------------------------------------------------------- /src/i18n/translate.h: -------------------------------------------------------------------------------- 1 | #ifndef _TRANSLATE_H_ 2 | #define _TRANSLATE_H_ 3 | 4 | #include 5 | #include 6 | 7 | class I18N 8 | { 9 | public: 10 | I18N(); 11 | ~I18N(); 12 | bool load(); 13 | const std::string &translate(const std::string &key); 14 | const bool isRTL(); 15 | 16 | private: 17 | std::map _strings; 18 | bool _rtl = false; 19 | }; 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /src/input.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _INPUT_H 3 | #define _INPUT_H 4 | #include 5 | #include 6 | 7 | typedef struct 8 | { 9 | int32_t key; 10 | int32_t jbut; 11 | int32_t jhat; 12 | int32_t jhat_value; 13 | int32_t jaxis; 14 | int32_t jaxis_value; 15 | } in_action; 16 | 17 | enum INPUTS 18 | { 19 | LEFTKEY, 20 | RIGHTKEY, 21 | UPKEY, 22 | DOWNKEY, 23 | JUMPKEY, 24 | FIREKEY, 25 | STRAFEKEY, 26 | PREVWPNKEY, 27 | NEXTWPNKEY, 28 | INVENTORYKEY, 29 | MAPSYSTEMKEY, 30 | 31 | ESCKEY, 32 | F1KEY, 33 | F2KEY, 34 | F3KEY, 35 | F4KEY, 36 | F5KEY, 37 | F6KEY, 38 | F7KEY, 39 | F8KEY, 40 | F9KEY, 41 | F10KEY, 42 | F11KEY, 43 | F12KEY, 44 | 45 | FREEZE_FRAME_KEY, 46 | FRAME_ADVANCE_KEY, 47 | DEBUG_FLY_KEY, 48 | ENTERKEY, 49 | 50 | INPUT_COUNT 51 | }; 52 | 53 | #define LASTCONTROLKEY MAPSYSTEMKEY 54 | 55 | #define DEBUG_GOD_KEY F1KEY 56 | #define DEBUG_MOVE_KEY F2KEY 57 | #define DEBUG_SAVE_KEY F4KEY 58 | #define FFWDKEY F5KEY 59 | 60 | extern bool inputs[INPUT_COUNT]; 61 | extern bool lastinputs[INPUT_COUNT]; 62 | extern in_action last_sdl_action; 63 | extern SDL_Joystick *joy; 64 | extern int ACCEPT_BUTTON; 65 | extern int DECLINE_BUTTON; 66 | 67 | bool input_init(void); 68 | void input_remap(int keyindex, in_action sdl_key); 69 | in_action input_get_mapping(int keyindex); 70 | const std::string input_get_name(int index); 71 | void input_set_mappings(in_action *array); 72 | void input_poll(void); 73 | void input_close(void); 74 | bool buttondown(void); 75 | bool buttonjustpushed(void); 76 | bool justpushed(int k); 77 | void rumble(float str, uint32_t len); 78 | 79 | #endif 80 | -------------------------------------------------------------------------------- /src/intro/intro.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _INTRO_H 3 | #define _INTRO_H 4 | 5 | bool intro_init(int param); 6 | void intro_tick(); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /src/intro/title.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _TITLE_H 3 | #define _TITLE_H 4 | 5 | bool title_init(int param); 6 | void title_tick(); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /src/inventory.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _INVENTORY_H 3 | #define _INVENTORY_H 4 | 5 | #include "sound/SoundManager.h" 6 | 7 | #define MAXLISTLEN 100 8 | 9 | struct stSelector 10 | { 11 | uint8_t flashstate, animtimer; 12 | 13 | int spacing_x, spacing_y; 14 | int cursel, lastsel; 15 | int sprite; 16 | int nitems; 17 | NXE::Sound::SFX sound; 18 | int rowlen; 19 | 20 | int scriptbase; 21 | int items[MAXLISTLEN]; 22 | }; 23 | 24 | struct stInventory 25 | { 26 | int x, y, w, h; 27 | 28 | stSelector armssel; 29 | stSelector itemsel; 30 | stSelector *curselector; 31 | 32 | char lockinput; 33 | }; 34 | 35 | bool inventory_init(int param); 36 | void inventory_tick(void); 37 | int RefreshInventoryScreen(void); 38 | void UnlockInventoryInput(void); 39 | void DrawInventory(void); 40 | 41 | enum INVENTORY 42 | { 43 | ITEM_ARTHURS_KEY = 1, 44 | ITEM_MAP_SYSTEM, 45 | ITEM_STANTAS_KEY, 46 | ITEM_SILVER_LOCKET, 47 | ITEM_BEAST_FANG, 48 | ITEM_LIFE_CAPSULE, 49 | ITEM_ID_CARD, 50 | ITEM_JELLYFISH_JUICE, 51 | ITEM_RUSTY_KEY, 52 | ITEM_GUM_KEY, 53 | ITEM_GUM_BASE, 54 | ITEM_CHARCOAL, 55 | ITEM_EXPLOSIVE, 56 | ITEM_PUPPY, 57 | ITEM_LIFE_POT, 58 | ITEM_CUREALL, 59 | ITEM_CLINIC_KEY, 60 | ITEM_BOOSTER08, 61 | ITEM_ARMS_BARRIER, 62 | ITEM_TURBOCHARGE, 63 | ITEM_AIRTANK, 64 | ITEM_COUNTER, 65 | ITEM_BOOSTER20, 66 | ITEM_MIMIGA_MASK, 67 | ITEM_TELEPORTER_KEY, 68 | ITEM_SUES_LETTER, 69 | ITEM_CONTROLLER, 70 | ITEM_BROKEN_SPRINKLER, 71 | ITEM_SPRINKLER, 72 | ITEM_TOW_ROPE, 73 | ITEM_CLAY_FIGURE_MEDAL, 74 | ITEM_LITTLE_MAN, 75 | ITEM_MUSHROOM_BADGE, 76 | ITEM_MA_PIGNON, 77 | ITEM_CURLYS_UNDERWEAR, 78 | ITEM_ALIEN_MEDAL, 79 | ITEM_CHACOS_LIPSTICK, 80 | ITEM_WHIMSICAL_STAR, 81 | ITEM_IRON_BOND 82 | }; 83 | 84 | #endif 85 | -------------------------------------------------------------------------------- /src/map_system.h: -------------------------------------------------------------------------------- 1 | #ifndef _MAPSYSTEM_H 2 | #define _MAPSYSTEM_H 3 | 4 | bool ms_init(int param); 5 | void ms_tick(void); 6 | void ms_close(void); 7 | void ms_draw(void); 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /src/maprecord.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _MAPRECORD_H 3 | #define _MAPRECORD_H 4 | 5 | #include 6 | 7 | #define MAX_STAGES 120 8 | struct MapRecord 9 | { 10 | char filename[32]; 11 | char stagename[35]; 12 | 13 | uint8_t tileset; 14 | uint8_t bg_no; 15 | uint8_t scroll_type; 16 | uint8_t bossNo; 17 | uint8_t NPCset1; 18 | uint8_t NPCset2; 19 | }; 20 | extern MapRecord stages[MAX_STAGES]; 21 | extern int num_stages; 22 | 23 | #define STAGE_SAND 10 24 | #define STAGE_START_POINT 13 25 | #define STAGE_IRONH 31 26 | #define STAGE_BOULDER_CHAMBER 44 27 | #define STAGE_MAZE_M 45 28 | #define STAGE_ALMOND 47 29 | #define STAGE_WATERWAY 48 30 | #define STAGE_KINGS_TABLE 65 31 | #define STAGE_HELL1 80 32 | #define STAGE_HELL2 81 33 | #define STAGE_HELL3 82 34 | #define STAGE_HELL4 84 35 | #define STAGE_HELL42 85 36 | #define STAGE_STATUE_CHAMBER 86 37 | #define STAGE_SEAL_CHAMBER 87 38 | #define STAGE_SEAL_CHAMBER_2 92 39 | #define STAGE_CORRIDOR 88 40 | #define STAGE_KINGS 72 // intro 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /src/niku.h: -------------------------------------------------------------------------------- 1 | #ifndef __NIKU_H_ 2 | #define __NIKU_H_ 3 | #include 4 | 5 | uint32_t niku_load(); 6 | bool niku_save(uint32_t value); 7 | 8 | #endif -------------------------------------------------------------------------------- /src/nx.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _NX_H 3 | #define _NX_H 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | //#include 10 | #include "common/basics.h" 11 | #include "config.h" 12 | #include "version.h" 13 | 14 | #include 15 | 16 | //#define CSF 9 17 | // eh, okay. this is scale for sub-pixel movement. original nxengine used this and bitshifts 18 | // guess it's short for common scale factor 19 | // but, there were many places, where negative values were shifted. And guess what: modern compilers can optimize 20 | // mul/sub so, we are using mul/div directly. for readability and no UB 21 | #define CSFI 512 22 | 23 | const char *strhex(int value); 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /src/pause/dialog.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _DIALOG_H 3 | #define _DIALOG_H 4 | 5 | #include "options.h" 6 | 7 | #include 8 | namespace Options 9 | { 10 | 11 | struct ODItem; 12 | 13 | enum OD_TYPES 14 | { 15 | OD_ACTIVATED, 16 | OD_SEPARATOR, 17 | OD_DISMISS, 18 | OD_CHOICE, 19 | OD_DISABLED, 20 | }; 21 | 22 | class Dialog : public FocusHolder 23 | { 24 | public: 25 | Dialog(); 26 | ~Dialog(); 27 | 28 | int DLG_X; 29 | int DLG_Y; 30 | int DLG_W; 31 | int DLG_H; 32 | 33 | ODItem *AddItem(const char *text, void (*activate)(ODItem *, int) = NULL, void (*update)(ODItem *) = NULL, 34 | int id = -1, int type = OD_ACTIVATED); 35 | ODItem *AddSeparator(); 36 | ODItem *AddDisabledItem(const char *text); 37 | ODItem *AddDismissalItem(const char *text = NULL); 38 | 39 | void Draw(); 40 | void RunInput(); 41 | void Dismiss(); 42 | void Clear(); 43 | void Refresh(); 44 | 45 | void UpdateSizePos(); 46 | void SetSize(int w, int h); 47 | void offset(int xd, int yd); 48 | 49 | void SetSelection(int sel); 50 | unsigned int GetSelection() 51 | { 52 | return fCurSel; 53 | } 54 | void ShowFull() 55 | { 56 | fNumShown = 99; 57 | } 58 | 59 | void (*onclear)(); 60 | void (*ondismiss)(); 61 | std::vector &Items(); 62 | 63 | private: 64 | void DrawItem(int x, int y, ODItem *item); 65 | 66 | int fCurSel; 67 | unsigned int fNumShown; // for text-draw animation on entry 68 | int fRepeatTimer; 69 | std::vector fItems; 70 | 71 | struct 72 | { 73 | int x, y, w, h; 74 | } fCoords; 75 | int fTextX; 76 | }; 77 | 78 | struct ODItem 79 | { 80 | char text[100]; 81 | char suffix[32]; 82 | char righttext[64]; 83 | char raligntext[32]; 84 | int type, id; 85 | 86 | void (*update)(ODItem *item); 87 | void (*activate)(ODItem *item, int dir); 88 | }; 89 | 90 | } // namespace Options 91 | 92 | #endif 93 | -------------------------------------------------------------------------------- /src/pause/message.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _MESSAGE_H 3 | #define _MESSAGE_H 4 | 5 | #include "../input.h" 6 | #include "options.h" 7 | 8 | #include 9 | namespace Options 10 | { 11 | 12 | class Message : public FocusHolder 13 | { 14 | public: 15 | Message(const std::string &msg, const std::string &msg2 = ""); 16 | ~Message(); 17 | 18 | void Draw(); 19 | void RunInput(); 20 | 21 | in_action *rawKeyReturn; 22 | void (*on_dismiss)(Message *msg); 23 | 24 | private: 25 | std::string fMsg, fMsg2; 26 | int fMsgX, fMsgY; 27 | int fMsg2X, fMsg2Y; 28 | 29 | int fShowDelay; 30 | int MESSAGE_X, MESSAGE_Y; 31 | }; 32 | 33 | } // namespace Options 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /src/pause/mods.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "pause.h" 3 | 4 | #include "../autogen/sprites.h" 5 | #include "../game.h" 6 | #include "../map.h" 7 | #include "../graphics/Renderer.h" 8 | #include "../input.h" 9 | #include "../nx.h" 10 | #include "../ResourceManager.h" 11 | 12 | using namespace NXE::Graphics; 13 | 14 | #include "dialog.h" 15 | using namespace Options; 16 | 17 | Dialog *moddlg; 18 | std::vector _mods; 19 | extern std::vector optionstack; 20 | 21 | void _mod_run(ODItem *item, int dir) 22 | { 23 | ResourceManager::getInstance()->setMod(_mods.at(item->id)); 24 | game.tsc->Close(); 25 | load_stages(); 26 | game.tsc->Init(); 27 | game.reset(); 28 | } 29 | 30 | void _mod_reset(ODItem *item, int dir) 31 | { 32 | ResourceManager::getInstance()->setMod(""); 33 | game.tsc->Close(); 34 | load_stages(); 35 | game.tsc->Init(); 36 | game.reset(); 37 | } 38 | 39 | void _mod_return(ODItem *item, int dir) 40 | { 41 | game.pause(false); 42 | } 43 | 44 | bool mods_init(int param) 45 | { 46 | memset(lastinputs, 1, sizeof(lastinputs)); 47 | moddlg = new Dialog(); 48 | moddlg->AddItem("Original game", _mod_reset); 49 | int i = 0; 50 | for (auto &kv: ResourceManager::getInstance()->mods()) 51 | { 52 | moddlg->AddItem(kv.second.name.c_str(), _mod_run, NULL, i); 53 | _mods.push_back(kv.second.dir); 54 | i++; 55 | } 56 | 57 | moddlg->AddSeparator(); 58 | moddlg->AddItem("Return", _mod_return); 59 | moddlg->SetSelection(0); 60 | moddlg->ShowFull(); 61 | int maxsize = 0; 62 | for (auto &item : moddlg->Items()) 63 | { 64 | int x = Renderer::getInstance()->font.getWidth(_(item->text)); 65 | if (x > maxsize) 66 | maxsize = x; 67 | } 68 | // moddlg->SetSize(maxsize + 60, 70); 69 | return 0; 70 | } 71 | 72 | void mods_tick() 73 | { 74 | if (moddlg != NULL) { 75 | Renderer::getInstance()->clearScreen(BLACK); 76 | moddlg->Draw(); 77 | moddlg->RunInput(); 78 | } 79 | } 80 | 81 | void mods_close() 82 | { 83 | optionstack.clear(); 84 | delete moddlg; 85 | moddlg = NULL; 86 | } -------------------------------------------------------------------------------- /src/pause/mods.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _MODS_H 3 | #define _MODS_H 4 | 5 | bool mods_init(int retmode); 6 | void mods_tick(void); 7 | void mods_close(void); 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /src/pause/objects.h: -------------------------------------------------------------------------------- 1 | #ifndef __OBJECTS_H_ 2 | #define __OBJECTS_H_ 3 | 4 | #include "../object.h" 5 | 6 | static void ai_oc_controller(Object *o); 7 | static void ai_oc_quote(Object *o); 8 | static void ai_oc_ikachan(Object *o); 9 | 10 | #endif -------------------------------------------------------------------------------- /src/pause/options.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _OPTIONS_H 3 | #define _OPTIONS_H 4 | #include "../object.h" 5 | 6 | namespace Options 7 | { 8 | // class for something like a dialog box that can hold the focus. 9 | // there is a stack of them. everyone in the stack is drawn, 10 | // and the topmost one receives HandleKey events. 11 | class FocusHolder 12 | { 13 | public: 14 | virtual ~FocusHolder() {} 15 | 16 | virtual void Draw() = 0; 17 | virtual void RunInput() = 0; 18 | }; 19 | 20 | void init_objects(); 21 | void close_objects(); 22 | void run_and_draw_objects(void); 23 | Object *create_object(int x, int y, int type); 24 | 25 | }; // namespace Options 26 | 27 | bool options_init(int param); 28 | void options_tick(void); 29 | void options_close(void); 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /src/pause/pause.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PAUSE_H 3 | #define _PAUSE_H 4 | 5 | bool pause_init(int retmode); 6 | void pause_tick(void); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /src/playerstats.h: -------------------------------------------------------------------------------- 1 | #ifndef __PLAYERSTATS_H_ 2 | #define __PLAYERSTATS_H_ 3 | 4 | void AddHealth(int hp); 5 | void AddXP(int xp, bool quiet = false); 6 | void SubXP(int xp, bool quiet = false); 7 | void AddInventory(int item); 8 | void DelInventory(int item); 9 | int FindInventory(int item); 10 | int CheckInventoryList(int item, int *list, int nitems); 11 | void GetWeapon(int wpn, int ammo); 12 | void LoseWeapon(int wpn); 13 | void TradeWeapon(int oldwpn, int newwpn, int ammo); 14 | void AddAmmo(int wpn, int ammo); 15 | void RefillAllAmmo(void); 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /src/profile.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PROFILE_H 3 | #define _PROFILE_H 4 | #include "game.h" 5 | #include "p_arms.h" 6 | #include "player.h" 7 | #include 8 | 9 | // how many bytes of data long a profile.dat is. 10 | #define PROFILE_LENGTH 0x604 11 | 12 | struct Profile 13 | { 14 | int stage = 0; 15 | int songno = 0; 16 | int px, py, pdir = 0; 17 | int hp, maxhp, num_whimstars = 0; 18 | uint32_t equipmask = 0; 19 | 20 | int curWeapon = 0; 21 | struct 22 | { 23 | bool hasWeapon = false; 24 | int level = 0; 25 | int xp = 0; 26 | int ammo, maxammo = 0; 27 | } weapons[WPN_COUNT]; 28 | 29 | std::vector wpnOrder = {}; 30 | 31 | int inventory[MAX_INVENTORY] = { 0 }; 32 | int ninventory = 0; 33 | 34 | bool flags[NUM_GAMEFLAGS] = { false }; 35 | 36 | struct 37 | { 38 | int slotno = 0; 39 | int scriptno = 0; 40 | } teleslots[NUM_TELEPORTER_SLOTS]; 41 | int num_teleslots = 0; 42 | }; 43 | 44 | bool profile_load(const char *pfname, Profile *file); 45 | bool profile_save(const char *pfname, Profile *file); 46 | char *GetProfileName(int num); 47 | bool ProfileExists(int num); 48 | bool AnyProfileExists(); 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /src/screeneffect.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _SCREENEFFECT_H 3 | #define _SCREENEFFECT_H 4 | #include "autogen/sprites.h" 5 | 6 | // screeneffects are a simple draw overlay used w/ things such as flashes and such. 7 | class ScreenEffect 8 | { 9 | public: 10 | ScreenEffect() 11 | { 12 | enabled = false; 13 | } 14 | virtual ~ScreenEffect() {} 15 | virtual void Draw() = 0; 16 | 17 | bool enabled; 18 | 19 | protected: 20 | int state; 21 | int timer; 22 | }; 23 | 24 | // FlashScreen simply flashes the screen white several times, 25 | // and is used in various places such as when Misery casts spells. 26 | struct SE_FlashScreen : public ScreenEffect 27 | { 28 | void Start(); 29 | void Draw(); 30 | 31 | int flashes_left; 32 | bool flashstate; 33 | }; 34 | 35 | // Starflash is a full-screen white explosion in the shape of a '+', 36 | // used when some bosses are defeated. 37 | struct SE_Starflash : public ScreenEffect 38 | { 39 | void Start(int x, int y); 40 | void Draw(); 41 | 42 | int centerx, centery; 43 | int size, speed; 44 | }; 45 | 46 | // Fade is the fade-in/out used on every stage transistion/TRA. 47 | struct SE_Fade : public ScreenEffect 48 | { 49 | SE_Fade(); 50 | 51 | void Start(int fadedir, int dir, int spr = SPR_FADE_DIAMOND); 52 | void Draw(void); 53 | void set_full(int dir); 54 | int getstate(void); 55 | 56 | struct 57 | { 58 | int fadedir; 59 | int sweepdir; 60 | int curframe; 61 | int sprite; 62 | } fade; 63 | }; 64 | 65 | #define FADE_IN 0 66 | #define FADE_OUT 1 67 | 68 | // these directions correspond to the FAI/FAO parameters. 69 | #define FADE_LEFT 0 70 | #define FADE_UP 1 71 | #define FADE_RIGHT 2 72 | #define FADE_DOWN 3 73 | #define FADE_CENTER 4 74 | 75 | #define FS_NO_FADE 0 // no fade is active 76 | #define FS_FADING 1 // currently fading in or out 77 | #define FS_FADED_OUT 2 // completely faded out 78 | 79 | namespace ScreenEffects 80 | { 81 | void Draw(void); 82 | void Stop(); 83 | }; // namespace ScreenEffects 84 | 85 | extern SE_FlashScreen flashscreen; 86 | extern SE_Starflash starflash; 87 | extern SE_Fade fade; 88 | 89 | #endif 90 | -------------------------------------------------------------------------------- /src/settings.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _SETTINGS_H 3 | #define _SETTINGS_H 4 | 5 | #include "input.h" 6 | 7 | struct Settings 8 | { 9 | uint32_t version; 10 | int resolution; 11 | int last_save_slot; 12 | bool show_fps; 13 | bool fullscreen; 14 | 15 | bool sound_enabled; 16 | int music_enabled; 17 | uint8_t new_music; 18 | 19 | bool skip_intro; 20 | bool rumble; 21 | bool strafing; 22 | bool animated_facepics; 23 | bool lights; 24 | bool control_scheme; 25 | int16_t sfx_volume; 26 | int16_t music_volume; 27 | int8_t music_interpolation; 28 | 29 | in_action input_mappings[INPUT_COUNT]; 30 | char language[256]; 31 | }; 32 | 33 | bool settings_load(Settings *settings = NULL); 34 | bool settings_save(Settings *settings = NULL); 35 | 36 | extern Settings *settings; 37 | extern Settings normal_settings; 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /src/siflib/sectSprites.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _SECT_SPRITES_H 3 | #define _SECT_SPRITES_H 4 | 5 | // this decodes and encodes the main sprites[] array of SIFSprite structures. 6 | 7 | #include "sif.h" 8 | 9 | class SIFSpritesSect 10 | { 11 | public: 12 | // get how many sprites are in the file. You can call this first if you need 13 | // to know how big to make the array. 14 | static int GetSpriteCount(const uint8_t *data, int datalen); 15 | 16 | // decode from a SIF_SECTION_SPRITES and use the resultant data to fill in 17 | // an array of SIFSprite structures pointed to by sprites. 18 | static bool Decode(const uint8_t *data, int datalen, SIFSprite *sprites, int *nsprites_out, int maxsprites); 19 | 20 | private: 21 | static void LoadRect(SIFRect *rect, const uint8_t **data, const uint8_t *data_end); 22 | static void LoadPoint(SIFPoint *pt, const uint8_t **data, const uint8_t *data_end); 23 | static void LoadPointList(SIFPointList *lst, const uint8_t **data, const uint8_t *data_end); 24 | static bool LoadFrame(SIFFrame *frame, int ndirs, const uint8_t **data, const uint8_t *data_end); 25 | }; 26 | 27 | // field types within SIFDir which are optional 28 | enum 29 | { 30 | S_DIR_END, // ends section list 31 | 32 | S_DIR_DRAW_POINT, // default is [0,0] 33 | S_DIR_ACTION_POINT, // default is [0,0] 34 | S_DIR_ACTION_POINT_2, // default is [0,0] 35 | S_DIR_PF_BBOX // default is no per-frame bbox, or rather [0,0]-[0,0] 36 | }; 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /src/siflib/sectStringArray.cpp: -------------------------------------------------------------------------------- 1 | #include "sectStringArray.h" 2 | 3 | #include "../common/bufio.h" 4 | #include "../Utils/Logger.h" 5 | 6 | // decode the raw section data into the given tringList object 7 | bool SIFStringArraySect::Decode(const uint8_t *data, int datalen, std::vector *out) 8 | { 9 | const uint8_t *data_end = data + (datalen - 1); 10 | int i, nstrings; 11 | 12 | nstrings = read_U16(&data, data_end); 13 | for (i = 0; i < nstrings; i++) 14 | { 15 | if (data > data_end) 16 | { 17 | LOG_ERROR("SIFStringArraySect::Decode: section corrupt: overran end of data"); 18 | return 1; 19 | } 20 | 21 | std::string string; 22 | ReadPascalString(&data, data_end, &string); 23 | 24 | out->push_back(std::string(string.c_str())); 25 | } 26 | 27 | return 0; 28 | } 29 | 30 | void SIFStringArraySect::ReadPascalString(const uint8_t **data, const uint8_t *data_end, std::string *out) 31 | { 32 | int len = read_U8(data, data_end); 33 | if (len == 255) 34 | len = read_U16(data, data_end); 35 | 36 | out->clear(); 37 | for (int i = 0; i < len; i++) 38 | { 39 | *out += read_U8(data, data_end); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/siflib/sectStringArray.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _SECT_STRINGARRAY_H 3 | #define _SECT_STRINGARRAY_H 4 | #include 5 | #include 6 | #include 7 | 8 | // the SectStringArray handler decodes sif sections which consist of an array 9 | // of pascal strings. This includes SIF_SECTION_SHEETS and SIF_SECTION_DIRECTORY. 10 | 11 | class SIFStringArraySect 12 | { 13 | public: 14 | static bool Decode(const uint8_t *data, int datalen, std::vector *out); 15 | static void ReadPascalString(const uint8_t **data, const uint8_t *data_end, std::string *out); 16 | }; 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /src/slope.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _SLOPE_H 3 | #define _SLOPE_H 4 | #include "graphics/Tileset.h" 5 | #include "object.h" 6 | #include "siflib/sif.h" 7 | 8 | // slope types 9 | #define SLOPE_CEIL_FWD1 1 10 | #define SLOPE_CEIL_FWD2 2 11 | #define SLOPE_CEIL_BACK1 3 12 | #define SLOPE_CEIL_BACK2 4 13 | 14 | #define SLOPE_BACK1 5 15 | #define SLOPE_BACK2 6 16 | #define SLOPE_FWD1 7 17 | #define SLOPE_FWD2 8 18 | 19 | #define SLOPE_LAST 8 20 | 21 | struct SlopeTable 22 | { 23 | uint8_t table[TILE_W][TILE_H]; 24 | }; 25 | bool initslopetable(void); 26 | uint8_t ReadSlopeTable(int x, int y); 27 | bool IsSlopeAtPointList(Object *o, SIFPointList *points); 28 | int CheckStandOnSlope(Object *o); 29 | int CheckBoppedHeadOnSlope(Object *o); 30 | bool movehandleslope(Object *o, int xinertia); 31 | void DrawSlopeTablesOnTiles(); 32 | void DrawSlopeTableOnTile(int table, int tile); 33 | void dumpslopetable(int t); 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /src/sound/Ogg.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _OGG11_H 3 | #define _OGG11_H 4 | 5 | #include "../Singleton.h" 6 | 7 | #include 8 | #include 9 | 10 | typedef void (*music_finished_cb)(void); 11 | 12 | namespace NXE 13 | { 14 | namespace Sound 15 | { 16 | 17 | struct oggSong 18 | { 19 | Mix_Music *intro = nullptr; 20 | Mix_Music *loop = nullptr; 21 | bool playing = false; 22 | int volume = 75; 23 | 24 | bool fading = false; 25 | uint32_t last_fade_time = 0; 26 | uint32_t last_pos = 0; 27 | bool doloop = false; 28 | }; 29 | 30 | class Ogg 31 | { 32 | public: 33 | static Ogg *getInstance(); 34 | 35 | protected: 36 | friend class Singleton; 37 | 38 | Ogg(); 39 | ~Ogg(); 40 | Ogg(const Ogg &) = delete; 41 | Ogg &operator=(const Ogg &) = delete; 42 | 43 | public: 44 | bool load(const std::string &fname, const std::string &dir, bool doloop); 45 | bool start(const std::string &fname, const std::string &dir, int startbeat, bool loop, bool doloop); 46 | uint32_t stop(void); 47 | bool isPlaying(void); 48 | void fade(void); 49 | void setVolume(int newvolume); 50 | void runFade(void); 51 | void pause(); 52 | void resume(); 53 | void musicFinished(); 54 | bool looped(); 55 | void updateVolume(); 56 | 57 | private: 58 | oggSong _song; 59 | bool _do_loop = false; 60 | bool _looped = false; 61 | }; 62 | 63 | }; // namespace Sound 64 | }; // namespace NXE 65 | 66 | #endif 67 | -------------------------------------------------------------------------------- /src/stageboss.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _STAGEBOSS_H 3 | #define _STAGEBOSS_H 4 | 5 | #include "object.h" 6 | 7 | // Stage Bosses are "big" boss enemies used in some stages. 8 | // 9 | // The stage boss class runs at a conceptual level "above" 10 | // normal AI routines, more like at the level of the game loop. 11 | // 12 | // This gives these complex bosses a good way to control more 13 | // things than just a single object (some bosses for example have 14 | // multiple parts which need to be coordinated, such as Omega). 15 | // 16 | // A pointer to the "main" object of a stage boss is stored by 17 | // the derived class at game.stageboss.object. 18 | // 19 | // The script command 5 | 6 | const char *backdrop_names[] = {"bk0", "bkBlue", "bkGreen", "bkBlack", "bkGard", "bkMaze", "bkGray", "bkRed", 7 | "bkWater", "bkMoon", "bkFog", "bkFall", "bkLight", "bkSunset", "bkHellish", NULL}; 8 | 9 | const char *tileset_names[] 10 | = {"0", "Pens", "Eggs", "EggX", "EggIn", "Store", "Weed", "Barr", "Maze", "Sand", "Mimi", "Cave", 11 | "River", "Gard", "Almond", "Oside", "Cent", "Jail", "White", "Fall", "Hell", "Labo", NULL}; 12 | -------------------------------------------------------------------------------- /src/stagedata.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _STAGEDATA_H 3 | #define _STAGEDATA_H 4 | 5 | //#define NMAPS 120 6 | // extern MapRecord stages[NMAPS]; 7 | 8 | #define NUM_BACKDROPS 12 9 | #define NUM_TILESETS 22 10 | 11 | extern const char *backdrop_names[]; 12 | extern const char *tileset_names[]; 13 | 14 | #define NPCSET_GUEST 0 15 | #define NPCSET_0 1 16 | #define NPCSET_EGGS1 2 17 | #define NPCSET_RAVIL 3 18 | #define NPCSET_WEED 4 19 | #define NPCSET_MAZE 5 20 | #define NPCSET_SAND 6 21 | #define NPCSET_OMG 7 22 | #define NPCSET_CEMET 8 23 | #define NPCSET_BLLG 9 24 | #define NPCSET_PLANT 10 25 | #define NPCSET_FROG 11 26 | #define NPCSET_CURLY 12 27 | #define NPCSET_STREAM 13 28 | #define NPCSET_IRONH 14 29 | #define NPCSET_TORO 15 30 | #define NPCSET_X 16 31 | #define NPCSET_DARK 17 32 | #define NPCSET_ALMO1 18 33 | #define NPCSET_EGGS2 19 34 | #define NPCSET_TWIND 20 35 | #define NPCSET_MOON 21 36 | #define NPCSET_CENT 22 37 | #define NPCSET_HERI 23 38 | #define NPCSET_RED 24 39 | #define NPCSET_MIZA 25 40 | #define NPCSET_DR 26 41 | #define NPCSET_ALMO2 27 42 | #define NPCSET_KINGS 28 43 | #define NPCSET_HELL 29 44 | #define NPCSET_PRESS 30 45 | #define NPCSET_PRIEST 31 46 | #define NPCSET_BALLOS 32 47 | #define NPCSET_ISLAND 33 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /src/statusbar.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _STATUSBAR_H 3 | #define _STATUSBAR_H 4 | 5 | struct PercentBar 6 | { 7 | int displayed_value; 8 | int dectimer; 9 | }; 10 | 11 | struct StatusBar 12 | { 13 | int xpflashcount; 14 | int xpflashstate; 15 | }; 16 | 17 | extern StatusBar statusbar; 18 | void niku_draw(int value, bool force_white = false); 19 | 20 | void stat_PrevWeapon(bool quiet = false); 21 | void stat_NextWeapon(bool quiet = false); 22 | 23 | bool statusbar_init(void); 24 | void DrawStatusBar(void); 25 | void DrawAirLeft(int x, int y); 26 | void DrawWeaponAmmo(int x, int y, int wpn); 27 | void DrawWeaponLevel(int x, int y, int wpn); 28 | void weapon_slide(int dir, int newwpn); 29 | void weapon_introslide(); 30 | void InitPercentBar(PercentBar *bar, int starting_value); 31 | void RunPercentBar(PercentBar *bar, int current_value); 32 | void DrawPercentBar(PercentBar *bar, int x, int y, int curvalue, int maxvalue, int width); 33 | void DrawNumber(int x, int y, int num); 34 | void DrawPercentage(int x, int y, int fill_sprite, int fsframe, int curvalue, int maxvalue, int width_at_max); 35 | void DrawNumberRAlign(int x, int y, int s, int num); 36 | void DrawTwoDigitNumber(int x, int y, int num); 37 | void DrawDigit(int x, int y, int digit); 38 | void niku_run(); 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /src/trig.h: -------------------------------------------------------------------------------- 1 | #ifndef __TRIG_H_ 2 | #define __TRIG_H_ 3 | 4 | #include "object.h" 5 | 6 | #include 7 | extern signed int sin_table[256]; 8 | char trig_init(void); 9 | void vector_from_angle(uint8_t angle, int speed, int *xs, int *ys); 10 | int xinertia_from_angle(uint8_t angle, int speed); 11 | int yinertia_from_angle(uint8_t angle, int speed); 12 | uint8_t GetAngle(int curx, int cury, int tgtx, int tgty); 13 | void EmFireAngledShot(Object *o, int objtype, int rand_variance, int speed); 14 | void ThrowObjectAtPlayer(Object *o, int rand_variance, int speed); 15 | void ThrowObject(Object *o, int destx, int desty, int rand_variance, int speed); 16 | void ThrowObjectAtAngle(Object *o, uint8_t angle, int speed); 17 | 18 | #endif -------------------------------------------------------------------------------- /src/version.h: -------------------------------------------------------------------------------- 1 | #ifndef __VERSION_H_ 2 | #define __VERSION_H_ 3 | 4 | #define NXVERSION "NXEngine-evo 2.6.5" 5 | 6 | #endif 7 | --------------------------------------------------------------------------------