├── NullSoundSystem ├── AudioSink.h ├── SoundListener.cpp ├── SoundClip.cpp ├── SoundUtils.h ├── SoundUtils.cpp ├── SoundListener.h ├── SoundClip.h ├── SoundEmitter.cpp └── SoundEmitter.h ├── DungeonsOfNoudarNDK ├── app │ ├── .gitignore │ ├── src │ │ └── main │ │ │ ├── res │ │ │ ├── values │ │ │ │ ├── strings.xml │ │ │ │ ├── colors.xml │ │ │ │ └── styles.xml │ │ │ ├── drawable │ │ │ │ ├── aim.png │ │ │ │ ├── back.png │ │ │ │ ├── down.png │ │ │ │ ├── fill.png │ │ │ │ ├── fire.png │ │ │ │ ├── icon.png │ │ │ │ ├── left.png │ │ │ │ ├── pick.png │ │ │ │ ├── up.png │ │ │ │ ├── right.png │ │ │ │ ├── screen.png │ │ │ │ ├── bgrepeat.jpg │ │ │ │ ├── action_hit.png │ │ │ │ ├── action_pick.png │ │ │ │ ├── border_left.png │ │ │ │ ├── border_top.png │ │ │ │ ├── strafe_left.png │ │ │ │ ├── action_button.png │ │ │ │ ├── action_enter.png │ │ │ │ ├── border_bottom.png │ │ │ │ ├── border_right.png │ │ │ │ ├── strafe_right.png │ │ │ │ ├── action_next_item.png │ │ │ │ ├── base_key_dark_grey.png │ │ │ │ ├── base_key_light_grey.png │ │ │ │ ├── border_left_repeat.xml │ │ │ │ ├── border_top_repeat.xml │ │ │ │ ├── border_bottom_repeat.xml │ │ │ │ └── border_right_repeat.xml │ │ │ ├── raw │ │ │ │ ├── i114t1o8f.wav │ │ │ │ ├── t200i98a.wav │ │ │ │ ├── t200i9o1fa.wav │ │ │ │ ├── t200i52o4defg.wav │ │ │ │ ├── t200i53o3fo1f.wav │ │ │ │ ├── t200i101o3afo1a.wav │ │ │ │ └── t200i101o8ao4ao2ao1a.wav │ │ │ └── xml │ │ │ │ └── backup_descriptor.xml │ │ │ ├── assets │ │ │ └── data.pfs │ │ │ ├── java │ │ │ └── pt │ │ │ │ └── b13h │ │ │ │ └── noudar │ │ │ │ ├── NoudarJNI.kt │ │ │ │ ├── GamePresentation.kt │ │ │ │ └── NoudarApplication.kt │ │ │ ├── AndroidManifest.xml │ │ │ └── cpp │ │ │ └── CMakeLists.txt │ ├── proguard-rules.pro │ └── build.gradle.kts ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── .gitignore ├── build.gradle.kts ├── settings.gradle.kts ├── gradle.properties └── gradlew.bat ├── screenshot1.png ├── screenshot2.png ├── DungeonsOfNoudar486 ├── res │ ├── arch.png │ ├── bars.png │ ├── bricks.png │ ├── clouds.png │ ├── fence.png │ ├── font.png │ ├── grass.png │ ├── grass2.png │ ├── intro.png │ ├── lava0.png │ ├── lava1.png │ ├── logo.png │ ├── rope.png │ ├── seal.png │ ├── shield.png │ ├── slot.png │ ├── splat0.png │ ├── splat1.png │ ├── splat2.png │ ├── tile.png │ ├── token.png │ ├── bricks2.png │ ├── ceiling.png │ ├── crossbow.png │ ├── falcata.png │ ├── MonkAttack0.png │ ├── ceilingbars.png │ ├── ceilingdoor.png │ ├── ceilingend.png │ ├── cobblestone.png │ ├── stonefloor.png │ ├── FallenAttack0.png │ ├── bricks_blood.png │ ├── ceilingbegin.png │ ├── in_ictu_oculi.png │ ├── stoneceiling.png │ ├── CocoonStanding0.png │ ├── WarthogAttack0.png │ ├── WeakDemonAttack0.png │ ├── bricks_candles.png │ ├── EvilSpiritAttack0.png │ ├── StrongDemonAttack0.png │ ├── finis_gloriae_mundi.png │ ├── title.txt │ ├── chapter0.txt │ ├── chapter4.txt │ ├── chapter6.txt │ ├── chapter1.txt │ ├── chapter2.txt │ ├── chapter3.txt │ ├── chapter5.txt │ ├── gameover.txt │ ├── tiles1.lst │ ├── tiles5.lst │ ├── tiles6.lst │ ├── tiles0.lst │ ├── tiles2.lst │ ├── tiles3.lst │ ├── tiles4.lst │ ├── chapter7.txt │ ├── map0.txt │ ├── map1.txt │ ├── map2.txt │ ├── map3.txt │ ├── map4.txt │ ├── map5.txt │ ├── map6.txt │ ├── map7.txt │ ├── tiles4.prp │ ├── tiles2.prp │ ├── tiles0.prp │ ├── tiles3.prp │ ├── tiles6.prp │ ├── tiles5.prp │ └── tiles1.prp ├── OPL2LPT │ ├── timer.h │ ├── controller.h │ ├── MusicSDL.cpp │ ├── timer.cpp │ └── OPL2.h ├── include │ ├── RaycastCommon.h │ ├── RasterizerCommon.h │ ├── CPackedFileReader.h │ ├── CTile3DProperties.h │ ├── VisibilityStrategy.h │ └── MapWithCharKey.h ├── src │ ├── RasterizerCommon.cpp │ ├── NativeBitmap.cpp │ ├── CPackedFileReader.cpp │ ├── CTile3DProperties.cpp │ └── VisibilityStrategy.cpp ├── .gitignore ├── Makefile ├── packer.cpp ├── Makefile.SDL ├── cmake_find │ ├── FindSDL2_ttf.cmake │ ├── FindSDL2_mixer.cmake │ └── FindSDL2_image.cmake ├── CMakeLists.txt └── main.cpp ├── noudar-rendering ├── LoadPNG.h ├── VBORegister.h ├── Logger.h ├── CLerp.h ├── NoudarGLES2Bridge.h ├── SplatAnimation.h ├── NativeBitmap.h ├── LightningStrategy.h ├── ETextures.h ├── CLerp.cpp ├── CTile3DProperties.h ├── SplatAnimation.cpp ├── Logger.cpp ├── VBORenderingJob.h ├── Camera.h ├── VisibilityStrategy.h ├── NativeBitmap.cpp ├── VBORenderingJob.cpp ├── NoudarDungeonSnapshot.cpp ├── LoadPNG.cpp ├── GameNativeAPI.h ├── RenderingJobSnapshotAdapter.h ├── NoudarDungeonSnapshot.h ├── CTile3DProperties.cpp ├── LightningStrategy.cpp ├── DungeonGLES2Renderer.h └── Camera.cpp ├── .gitmodules ├── License.md ├── .gitignore └── README.md /NullSoundSystem/AudioSink.h: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /DungeonsOfNoudarNDK/app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /screenshot1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheFakeMontyOnTheRun/dungeons-of-noudar/HEAD/screenshot1.png -------------------------------------------------------------------------------- /screenshot2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheFakeMontyOnTheRun/dungeons-of-noudar/HEAD/screenshot2.png -------------------------------------------------------------------------------- /DungeonsOfNoudar486/res/arch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheFakeMontyOnTheRun/dungeons-of-noudar/HEAD/DungeonsOfNoudar486/res/arch.png -------------------------------------------------------------------------------- /DungeonsOfNoudar486/res/bars.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheFakeMontyOnTheRun/dungeons-of-noudar/HEAD/DungeonsOfNoudar486/res/bars.png -------------------------------------------------------------------------------- /DungeonsOfNoudar486/res/bricks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheFakeMontyOnTheRun/dungeons-of-noudar/HEAD/DungeonsOfNoudar486/res/bricks.png -------------------------------------------------------------------------------- /DungeonsOfNoudar486/res/clouds.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheFakeMontyOnTheRun/dungeons-of-noudar/HEAD/DungeonsOfNoudar486/res/clouds.png -------------------------------------------------------------------------------- /DungeonsOfNoudar486/res/fence.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheFakeMontyOnTheRun/dungeons-of-noudar/HEAD/DungeonsOfNoudar486/res/fence.png -------------------------------------------------------------------------------- /DungeonsOfNoudar486/res/font.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheFakeMontyOnTheRun/dungeons-of-noudar/HEAD/DungeonsOfNoudar486/res/font.png -------------------------------------------------------------------------------- /DungeonsOfNoudar486/res/grass.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheFakeMontyOnTheRun/dungeons-of-noudar/HEAD/DungeonsOfNoudar486/res/grass.png -------------------------------------------------------------------------------- /DungeonsOfNoudar486/res/grass2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheFakeMontyOnTheRun/dungeons-of-noudar/HEAD/DungeonsOfNoudar486/res/grass2.png -------------------------------------------------------------------------------- /DungeonsOfNoudar486/res/intro.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheFakeMontyOnTheRun/dungeons-of-noudar/HEAD/DungeonsOfNoudar486/res/intro.png -------------------------------------------------------------------------------- /DungeonsOfNoudar486/res/lava0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheFakeMontyOnTheRun/dungeons-of-noudar/HEAD/DungeonsOfNoudar486/res/lava0.png -------------------------------------------------------------------------------- /DungeonsOfNoudar486/res/lava1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheFakeMontyOnTheRun/dungeons-of-noudar/HEAD/DungeonsOfNoudar486/res/lava1.png -------------------------------------------------------------------------------- /DungeonsOfNoudar486/res/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheFakeMontyOnTheRun/dungeons-of-noudar/HEAD/DungeonsOfNoudar486/res/logo.png -------------------------------------------------------------------------------- /DungeonsOfNoudar486/res/rope.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheFakeMontyOnTheRun/dungeons-of-noudar/HEAD/DungeonsOfNoudar486/res/rope.png -------------------------------------------------------------------------------- /DungeonsOfNoudar486/res/seal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheFakeMontyOnTheRun/dungeons-of-noudar/HEAD/DungeonsOfNoudar486/res/seal.png -------------------------------------------------------------------------------- /DungeonsOfNoudar486/res/shield.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheFakeMontyOnTheRun/dungeons-of-noudar/HEAD/DungeonsOfNoudar486/res/shield.png -------------------------------------------------------------------------------- /DungeonsOfNoudar486/res/slot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheFakeMontyOnTheRun/dungeons-of-noudar/HEAD/DungeonsOfNoudar486/res/slot.png -------------------------------------------------------------------------------- /DungeonsOfNoudar486/res/splat0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheFakeMontyOnTheRun/dungeons-of-noudar/HEAD/DungeonsOfNoudar486/res/splat0.png -------------------------------------------------------------------------------- /DungeonsOfNoudar486/res/splat1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheFakeMontyOnTheRun/dungeons-of-noudar/HEAD/DungeonsOfNoudar486/res/splat1.png -------------------------------------------------------------------------------- /DungeonsOfNoudar486/res/splat2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheFakeMontyOnTheRun/dungeons-of-noudar/HEAD/DungeonsOfNoudar486/res/splat2.png -------------------------------------------------------------------------------- /DungeonsOfNoudar486/res/tile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheFakeMontyOnTheRun/dungeons-of-noudar/HEAD/DungeonsOfNoudar486/res/tile.png -------------------------------------------------------------------------------- /DungeonsOfNoudar486/res/token.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheFakeMontyOnTheRun/dungeons-of-noudar/HEAD/DungeonsOfNoudar486/res/token.png -------------------------------------------------------------------------------- /DungeonsOfNoudar486/res/bricks2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheFakeMontyOnTheRun/dungeons-of-noudar/HEAD/DungeonsOfNoudar486/res/bricks2.png -------------------------------------------------------------------------------- /DungeonsOfNoudar486/res/ceiling.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheFakeMontyOnTheRun/dungeons-of-noudar/HEAD/DungeonsOfNoudar486/res/ceiling.png -------------------------------------------------------------------------------- /DungeonsOfNoudar486/res/crossbow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheFakeMontyOnTheRun/dungeons-of-noudar/HEAD/DungeonsOfNoudar486/res/crossbow.png -------------------------------------------------------------------------------- /DungeonsOfNoudar486/res/falcata.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheFakeMontyOnTheRun/dungeons-of-noudar/HEAD/DungeonsOfNoudar486/res/falcata.png -------------------------------------------------------------------------------- /DungeonsOfNoudarNDK/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | Dungeons of Noudar 3 | 4 | -------------------------------------------------------------------------------- /DungeonsOfNoudar486/res/MonkAttack0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheFakeMontyOnTheRun/dungeons-of-noudar/HEAD/DungeonsOfNoudar486/res/MonkAttack0.png -------------------------------------------------------------------------------- /DungeonsOfNoudar486/res/ceilingbars.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheFakeMontyOnTheRun/dungeons-of-noudar/HEAD/DungeonsOfNoudar486/res/ceilingbars.png -------------------------------------------------------------------------------- /DungeonsOfNoudar486/res/ceilingdoor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheFakeMontyOnTheRun/dungeons-of-noudar/HEAD/DungeonsOfNoudar486/res/ceilingdoor.png -------------------------------------------------------------------------------- /DungeonsOfNoudar486/res/ceilingend.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheFakeMontyOnTheRun/dungeons-of-noudar/HEAD/DungeonsOfNoudar486/res/ceilingend.png -------------------------------------------------------------------------------- /DungeonsOfNoudar486/res/cobblestone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheFakeMontyOnTheRun/dungeons-of-noudar/HEAD/DungeonsOfNoudar486/res/cobblestone.png -------------------------------------------------------------------------------- /DungeonsOfNoudar486/res/stonefloor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheFakeMontyOnTheRun/dungeons-of-noudar/HEAD/DungeonsOfNoudar486/res/stonefloor.png -------------------------------------------------------------------------------- /DungeonsOfNoudar486/res/FallenAttack0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheFakeMontyOnTheRun/dungeons-of-noudar/HEAD/DungeonsOfNoudar486/res/FallenAttack0.png -------------------------------------------------------------------------------- /DungeonsOfNoudar486/res/bricks_blood.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheFakeMontyOnTheRun/dungeons-of-noudar/HEAD/DungeonsOfNoudar486/res/bricks_blood.png -------------------------------------------------------------------------------- /DungeonsOfNoudar486/res/ceilingbegin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheFakeMontyOnTheRun/dungeons-of-noudar/HEAD/DungeonsOfNoudar486/res/ceilingbegin.png -------------------------------------------------------------------------------- /DungeonsOfNoudar486/res/in_ictu_oculi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheFakeMontyOnTheRun/dungeons-of-noudar/HEAD/DungeonsOfNoudar486/res/in_ictu_oculi.png -------------------------------------------------------------------------------- /DungeonsOfNoudar486/res/stoneceiling.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheFakeMontyOnTheRun/dungeons-of-noudar/HEAD/DungeonsOfNoudar486/res/stoneceiling.png -------------------------------------------------------------------------------- /DungeonsOfNoudar486/res/CocoonStanding0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheFakeMontyOnTheRun/dungeons-of-noudar/HEAD/DungeonsOfNoudar486/res/CocoonStanding0.png -------------------------------------------------------------------------------- /DungeonsOfNoudar486/res/WarthogAttack0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheFakeMontyOnTheRun/dungeons-of-noudar/HEAD/DungeonsOfNoudar486/res/WarthogAttack0.png -------------------------------------------------------------------------------- /DungeonsOfNoudar486/res/WeakDemonAttack0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheFakeMontyOnTheRun/dungeons-of-noudar/HEAD/DungeonsOfNoudar486/res/WeakDemonAttack0.png -------------------------------------------------------------------------------- /DungeonsOfNoudar486/res/bricks_candles.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheFakeMontyOnTheRun/dungeons-of-noudar/HEAD/DungeonsOfNoudar486/res/bricks_candles.png -------------------------------------------------------------------------------- /DungeonsOfNoudar486/res/EvilSpiritAttack0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheFakeMontyOnTheRun/dungeons-of-noudar/HEAD/DungeonsOfNoudar486/res/EvilSpiritAttack0.png -------------------------------------------------------------------------------- /DungeonsOfNoudar486/res/StrongDemonAttack0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheFakeMontyOnTheRun/dungeons-of-noudar/HEAD/DungeonsOfNoudar486/res/StrongDemonAttack0.png -------------------------------------------------------------------------------- /DungeonsOfNoudar486/res/finis_gloriae_mundi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheFakeMontyOnTheRun/dungeons-of-noudar/HEAD/DungeonsOfNoudar486/res/finis_gloriae_mundi.png -------------------------------------------------------------------------------- /DungeonsOfNoudarNDK/app/src/main/assets/data.pfs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheFakeMontyOnTheRun/dungeons-of-noudar/HEAD/DungeonsOfNoudarNDK/app/src/main/assets/data.pfs -------------------------------------------------------------------------------- /DungeonsOfNoudarNDK/app/src/main/res/drawable/aim.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheFakeMontyOnTheRun/dungeons-of-noudar/HEAD/DungeonsOfNoudarNDK/app/src/main/res/drawable/aim.png -------------------------------------------------------------------------------- /DungeonsOfNoudarNDK/app/src/main/res/drawable/back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheFakeMontyOnTheRun/dungeons-of-noudar/HEAD/DungeonsOfNoudarNDK/app/src/main/res/drawable/back.png -------------------------------------------------------------------------------- /DungeonsOfNoudarNDK/app/src/main/res/drawable/down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheFakeMontyOnTheRun/dungeons-of-noudar/HEAD/DungeonsOfNoudarNDK/app/src/main/res/drawable/down.png -------------------------------------------------------------------------------- /DungeonsOfNoudarNDK/app/src/main/res/drawable/fill.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheFakeMontyOnTheRun/dungeons-of-noudar/HEAD/DungeonsOfNoudarNDK/app/src/main/res/drawable/fill.png -------------------------------------------------------------------------------- /DungeonsOfNoudarNDK/app/src/main/res/drawable/fire.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheFakeMontyOnTheRun/dungeons-of-noudar/HEAD/DungeonsOfNoudarNDK/app/src/main/res/drawable/fire.png -------------------------------------------------------------------------------- /DungeonsOfNoudarNDK/app/src/main/res/drawable/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheFakeMontyOnTheRun/dungeons-of-noudar/HEAD/DungeonsOfNoudarNDK/app/src/main/res/drawable/icon.png -------------------------------------------------------------------------------- /DungeonsOfNoudarNDK/app/src/main/res/drawable/left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheFakeMontyOnTheRun/dungeons-of-noudar/HEAD/DungeonsOfNoudarNDK/app/src/main/res/drawable/left.png -------------------------------------------------------------------------------- /DungeonsOfNoudarNDK/app/src/main/res/drawable/pick.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheFakeMontyOnTheRun/dungeons-of-noudar/HEAD/DungeonsOfNoudarNDK/app/src/main/res/drawable/pick.png -------------------------------------------------------------------------------- /DungeonsOfNoudarNDK/app/src/main/res/drawable/up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheFakeMontyOnTheRun/dungeons-of-noudar/HEAD/DungeonsOfNoudarNDK/app/src/main/res/drawable/up.png -------------------------------------------------------------------------------- /DungeonsOfNoudarNDK/app/src/main/res/raw/i114t1o8f.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheFakeMontyOnTheRun/dungeons-of-noudar/HEAD/DungeonsOfNoudarNDK/app/src/main/res/raw/i114t1o8f.wav -------------------------------------------------------------------------------- /DungeonsOfNoudarNDK/app/src/main/res/raw/t200i98a.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheFakeMontyOnTheRun/dungeons-of-noudar/HEAD/DungeonsOfNoudarNDK/app/src/main/res/raw/t200i98a.wav -------------------------------------------------------------------------------- /DungeonsOfNoudarNDK/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheFakeMontyOnTheRun/dungeons-of-noudar/HEAD/DungeonsOfNoudarNDK/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /DungeonsOfNoudarNDK/app/src/main/res/drawable/right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheFakeMontyOnTheRun/dungeons-of-noudar/HEAD/DungeonsOfNoudarNDK/app/src/main/res/drawable/right.png -------------------------------------------------------------------------------- /DungeonsOfNoudarNDK/app/src/main/res/drawable/screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheFakeMontyOnTheRun/dungeons-of-noudar/HEAD/DungeonsOfNoudarNDK/app/src/main/res/drawable/screen.png -------------------------------------------------------------------------------- /DungeonsOfNoudarNDK/app/src/main/res/raw/t200i9o1fa.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheFakeMontyOnTheRun/dungeons-of-noudar/HEAD/DungeonsOfNoudarNDK/app/src/main/res/raw/t200i9o1fa.wav -------------------------------------------------------------------------------- /DungeonsOfNoudarNDK/app/src/main/res/drawable/bgrepeat.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheFakeMontyOnTheRun/dungeons-of-noudar/HEAD/DungeonsOfNoudarNDK/app/src/main/res/drawable/bgrepeat.jpg -------------------------------------------------------------------------------- /DungeonsOfNoudarNDK/app/src/main/res/raw/t200i52o4defg.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheFakeMontyOnTheRun/dungeons-of-noudar/HEAD/DungeonsOfNoudarNDK/app/src/main/res/raw/t200i52o4defg.wav -------------------------------------------------------------------------------- /DungeonsOfNoudarNDK/app/src/main/res/raw/t200i53o3fo1f.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheFakeMontyOnTheRun/dungeons-of-noudar/HEAD/DungeonsOfNoudarNDK/app/src/main/res/raw/t200i53o3fo1f.wav -------------------------------------------------------------------------------- /DungeonsOfNoudarNDK/app/src/main/res/drawable/action_hit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheFakeMontyOnTheRun/dungeons-of-noudar/HEAD/DungeonsOfNoudarNDK/app/src/main/res/drawable/action_hit.png -------------------------------------------------------------------------------- /DungeonsOfNoudarNDK/app/src/main/res/drawable/action_pick.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheFakeMontyOnTheRun/dungeons-of-noudar/HEAD/DungeonsOfNoudarNDK/app/src/main/res/drawable/action_pick.png -------------------------------------------------------------------------------- /DungeonsOfNoudarNDK/app/src/main/res/drawable/border_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheFakeMontyOnTheRun/dungeons-of-noudar/HEAD/DungeonsOfNoudarNDK/app/src/main/res/drawable/border_left.png -------------------------------------------------------------------------------- /DungeonsOfNoudarNDK/app/src/main/res/drawable/border_top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheFakeMontyOnTheRun/dungeons-of-noudar/HEAD/DungeonsOfNoudarNDK/app/src/main/res/drawable/border_top.png -------------------------------------------------------------------------------- /DungeonsOfNoudarNDK/app/src/main/res/drawable/strafe_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheFakeMontyOnTheRun/dungeons-of-noudar/HEAD/DungeonsOfNoudarNDK/app/src/main/res/drawable/strafe_left.png -------------------------------------------------------------------------------- /DungeonsOfNoudarNDK/app/src/main/res/raw/t200i101o3afo1a.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheFakeMontyOnTheRun/dungeons-of-noudar/HEAD/DungeonsOfNoudarNDK/app/src/main/res/raw/t200i101o3afo1a.wav -------------------------------------------------------------------------------- /DungeonsOfNoudarNDK/app/src/main/res/drawable/action_button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheFakeMontyOnTheRun/dungeons-of-noudar/HEAD/DungeonsOfNoudarNDK/app/src/main/res/drawable/action_button.png -------------------------------------------------------------------------------- /DungeonsOfNoudarNDK/app/src/main/res/drawable/action_enter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheFakeMontyOnTheRun/dungeons-of-noudar/HEAD/DungeonsOfNoudarNDK/app/src/main/res/drawable/action_enter.png -------------------------------------------------------------------------------- /DungeonsOfNoudarNDK/app/src/main/res/drawable/border_bottom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheFakeMontyOnTheRun/dungeons-of-noudar/HEAD/DungeonsOfNoudarNDK/app/src/main/res/drawable/border_bottom.png -------------------------------------------------------------------------------- /DungeonsOfNoudarNDK/app/src/main/res/drawable/border_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheFakeMontyOnTheRun/dungeons-of-noudar/HEAD/DungeonsOfNoudarNDK/app/src/main/res/drawable/border_right.png -------------------------------------------------------------------------------- /DungeonsOfNoudarNDK/app/src/main/res/drawable/strafe_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheFakeMontyOnTheRun/dungeons-of-noudar/HEAD/DungeonsOfNoudarNDK/app/src/main/res/drawable/strafe_right.png -------------------------------------------------------------------------------- /DungeonsOfNoudarNDK/app/src/main/res/drawable/action_next_item.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheFakeMontyOnTheRun/dungeons-of-noudar/HEAD/DungeonsOfNoudarNDK/app/src/main/res/drawable/action_next_item.png -------------------------------------------------------------------------------- /DungeonsOfNoudarNDK/app/src/main/res/raw/t200i101o8ao4ao2ao1a.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheFakeMontyOnTheRun/dungeons-of-noudar/HEAD/DungeonsOfNoudarNDK/app/src/main/res/raw/t200i101o8ao4ao2ao1a.wav -------------------------------------------------------------------------------- /NullSoundSystem/SoundListener.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "glm/glm.hpp" 3 | 4 | #include "SoundListener.h" 5 | 6 | namespace odb { 7 | SoundListener::SoundListener() { 8 | 9 | 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /DungeonsOfNoudarNDK/app/src/main/res/drawable/base_key_dark_grey.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheFakeMontyOnTheRun/dungeons-of-noudar/HEAD/DungeonsOfNoudarNDK/app/src/main/res/drawable/base_key_dark_grey.png -------------------------------------------------------------------------------- /DungeonsOfNoudarNDK/app/src/main/res/drawable/base_key_light_grey.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheFakeMontyOnTheRun/dungeons-of-noudar/HEAD/DungeonsOfNoudarNDK/app/src/main/res/drawable/base_key_light_grey.png -------------------------------------------------------------------------------- /DungeonsOfNoudarNDK/app/src/main/res/xml/backup_descriptor.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /DungeonsOfNoudarNDK/app/src/main/res/drawable/border_left_repeat.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /DungeonsOfNoudarNDK/app/src/main/res/drawable/border_top_repeat.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /DungeonsOfNoudarNDK/app/src/main/res/drawable/border_bottom_repeat.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /DungeonsOfNoudarNDK/app/src/main/res/drawable/border_right_repeat.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /NullSoundSystem/SoundClip.cpp: -------------------------------------------------------------------------------- 1 | 2 | 3 | #include "SoundClip.h" 4 | 5 | namespace odb { 6 | SoundClip::SoundClip(unsigned char *buffer, int size, int offset, int bits, int channels, 7 | int frequency) { 8 | 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /DungeonsOfNoudar486/OPL2LPT/timer.h: -------------------------------------------------------------------------------- 1 | #ifndef TIMER_H_ 2 | #define TIMER_H_ 3 | 4 | void timer_setup(unsigned short frequency); 5 | void timer_shutdown(); 6 | unsigned long timer_get(); 7 | void timer_reset(unsigned short frequency); 8 | 9 | void hlt(void); 10 | #endif 11 | -------------------------------------------------------------------------------- /DungeonsOfNoudar486/OPL2LPT/controller.h: -------------------------------------------------------------------------------- 1 | #ifndef DEMOTUNE_H_ 2 | #define DEMOTUNE_H_ 3 | extern void music_set(const char* melody1, const char* melody2, const char* melody3); 4 | extern void music_setup(); 5 | extern void music_loop(); 6 | extern void music_shutdown(); 7 | #endif 8 | -------------------------------------------------------------------------------- /DungeonsOfNoudarNDK/app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #008577 4 | #00574B 5 | #D81B60 6 | 7 | -------------------------------------------------------------------------------- /DungeonsOfNoudarNDK/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/caches 5 | /.idea/libraries 6 | /.idea/modules.xml 7 | /.idea/workspace.xml 8 | /.idea/navEditor.xml 9 | /.idea/assetWizardSettings.xml 10 | .DS_Store 11 | /build 12 | /captures 13 | .externalNativeBuild 14 | .cxx 15 | -------------------------------------------------------------------------------- /DungeonsOfNoudarNDK/build.gradle.kts: -------------------------------------------------------------------------------- 1 | buildscript { 2 | } 3 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 4 | plugins { 5 | id("com.android.application") version "8.10.1" apply false 6 | id("org.jetbrains.kotlin.android") version "1.9.0" apply false 7 | } -------------------------------------------------------------------------------- /DungeonsOfNoudarNDK/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Sun Jun 01 15:45:03 WEST 2025 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip 5 | zipStoreBase=GRADLE_USER_HOME 6 | zipStorePath=wrapper/dists 7 | -------------------------------------------------------------------------------- /NullSoundSystem/SoundUtils.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by monty on 10/10/16. 3 | // 4 | 5 | #ifndef TIC_TAC_TOE_GLES_SOUNDUTILS_H 6 | #define TIC_TAC_TOE_GLES_SOUNDUTILS_H 7 | namespace odb { 8 | std::shared_ptr makeSoundClipFrom(FILE *fileHandle); 9 | } 10 | #endif //TIC_TAC_TOE_GLES_SOUNDUTILS_H 11 | -------------------------------------------------------------------------------- /noudar-rendering/LoadPNG.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by monty on 06/10/16. 3 | // 4 | 5 | #ifndef NOUDAR_CORE_LOADPNG_H 6 | #define NOUDAR_CORE_LOADPNG_H 7 | 8 | std::shared_ptr 9 | loadPNG(const std::string filename, std::shared_ptr fileLoader); 10 | 11 | #endif //NOUDAR_CORE_LOADPNG_H 12 | -------------------------------------------------------------------------------- /noudar-rendering/VBORegister.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by monty on 14/01/17. 3 | // 4 | 5 | #ifndef DUNGEONSOFNOUDAR_NDK_VBOREGISTER_H 6 | #define DUNGEONSOFNOUDAR_NDK_VBOREGISTER_H 7 | 8 | using VBORegister = std::tuple; 9 | 10 | using VBORegisterId = std::string; 11 | 12 | #endif //DUNGEONSOFNOUDAR_NDK_VBOREGISTER_H 13 | -------------------------------------------------------------------------------- /NullSoundSystem/SoundUtils.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by monty on 10/10/16. 3 | // 4 | #include 5 | 6 | #include "SoundClip.h" 7 | #include "SoundUtils.h" 8 | 9 | namespace odb { 10 | std::shared_ptr makeSoundClipFrom(FILE *source) { 11 | return std::make_shared(nullptr, 0, 0, 0, 0, 0); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /NullSoundSystem/SoundListener.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by monty on 10/10/16. 3 | // 4 | 5 | #ifndef TIC_TAC_TOE_GLES_SOUNDLISTENER_H 6 | #define TIC_TAC_TOE_GLES_SOUNDLISTENER_H 7 | 8 | namespace odb { 9 | class SoundListener { 10 | public: 11 | glm::vec3 mPosition{0, 0, 0}; 12 | 13 | SoundListener(); 14 | }; 15 | } 16 | 17 | #endif //TIC_TAC_TOE_GLES_SOUNDLISTENER_H 18 | -------------------------------------------------------------------------------- /noudar-rendering/Logger.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by monty on 26/09/16. 3 | // 4 | 5 | #ifndef DUNGEONSOFNOUDAR_NDK_LOGGER_H 6 | #define DUNGEONSOFNOUDAR_NDK_LOGGER_H 7 | 8 | namespace odb { 9 | class Logger { 10 | public: 11 | static void log(const char *format, ...); 12 | 13 | static void log(std::string format, ...); 14 | }; 15 | } 16 | 17 | #endif //DUNGEONSOFNOUDAR_NDK_LOGGER_H 18 | -------------------------------------------------------------------------------- /DungeonsOfNoudar486/res/title.txt: -------------------------------------------------------------------------------- 1 | 2 | (c) 2014-2018 3 | 4 | A game by Daniel Monteiro. 5 | Art by Stone Soup project. 6 | 7 | Controls: 8 | - arrows to move and turn. 9 | - z and x to strafe left and right. 10 | - s (or 1 - 3) to cycle the inventory. 11 | - a to pick items. 12 | - space to use the current item. 13 | - esc to quit (but why?!). 14 | 15 | Many thanks to the folks at 16 | Serdaco, Retromania.pt and DOSHaven.eu! 17 | -------------------------------------------------------------------------------- /DungeonsOfNoudarNDK/settings.gradle.kts: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | google() 4 | mavenCentral() 5 | gradlePluginPortal() 6 | } 7 | } 8 | dependencyResolutionManagement { 9 | repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) 10 | repositories { 11 | google() 12 | mavenCentral() 13 | } 14 | } 15 | 16 | rootProject.name = "Dungeons of Noudar" 17 | include(":app") 18 | -------------------------------------------------------------------------------- /DungeonsOfNoudarNDK/app/src/main/java/pt/b13h/noudar/NoudarJNI.kt: -------------------------------------------------------------------------------- 1 | package pt.b13h.noudar 2 | 3 | import android.content.res.AssetManager 4 | 5 | object NoudarJNI { 6 | init { 7 | System.loadLibrary("native-lib") 8 | } 9 | 10 | external fun initAssets(assetManager: AssetManager?) 11 | external fun getPixelsFromNative(javaSide: ByteArray?) 12 | external fun sendCommand(cmd: Char) 13 | external fun getSoundToPlay(): Int 14 | } 15 | -------------------------------------------------------------------------------- /DungeonsOfNoudar486/res/chapter0.txt: -------------------------------------------------------------------------------- 1 | - The Citadel - 2 | You, a former priest and crusader, were 3 | summoned to investigate and ultimately 4 | perform the ancient pagan rituals 5 | required to purge the sacred citadel 6 | from once again falling into demoniac 7 | hands. 8 | 9 | Like the ones that came before you, 10 | generation after generation, you will 11 | have to assess the situation and 12 | preserve your own faith. 13 | 14 | This holy land is at your hands now. -------------------------------------------------------------------------------- /DungeonsOfNoudar486/res/chapter4.txt: -------------------------------------------------------------------------------- 1 | - Dungeon of despair - 2 | The poisonous seeds can only grow if 3 | fed with the most slovenly of the 4 | living souls. 5 | 6 | Even the most resilient flame require 7 | fanning to thrust new life into these 8 | cold walls. The cry from the damned 9 | drips from between the moldy bricks. 10 | 11 | Whispers and howls defy your bravery, 12 | but also pull you further into it's 13 | nurturing womb. 14 | May fire consume this scourge. -------------------------------------------------------------------------------- /DungeonsOfNoudar486/res/chapter6.txt: -------------------------------------------------------------------------------- 1 | - Under the sheltering mercy - 2 | May the coat of pride clouding your 3 | horizons have faded with your scars. 4 | 5 | Only by standing in the shoes of any 6 | giving soul you can experience the joy 7 | of this uplifting gesture. 8 | 9 | In this fiery will lies the utmost 10 | chance to grant the eternal penitent 11 | another chance for redemption. At least 12 | until it's next trial. 13 | 14 | Even your existance must have a reason. -------------------------------------------------------------------------------- /NullSoundSystem/SoundClip.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by monty on 10/10/16. 3 | // 4 | #ifndef TIC_TAC_TOE_GLES_SOUNDCLIP_H 5 | #define TIC_TAC_TOE_GLES_SOUNDCLIP_H 6 | 7 | namespace odb { 8 | class SoundClip { 9 | public: 10 | unsigned int mBufferHandle; 11 | 12 | SoundClip(unsigned char *bufferData, int size, int offset, int bits, int channels, 13 | int frequency); 14 | }; 15 | } 16 | 17 | #endif //TIC_TAC_TOE_GLES_SOUNDCLIP_H 18 | -------------------------------------------------------------------------------- /DungeonsOfNoudar486/res/chapter1.txt: -------------------------------------------------------------------------------- 1 | - Monastery - 2 | The sudden realization that you might 3 | be late brings tears into your eyes and 4 | fear into your heart. 5 | 6 | In other times, your faith would be on 7 | trial. What's left of it, after so many 8 | years doesn't feel threatened, but 9 | rather vindicated. 10 | 11 | You expected the priests, but not a 12 | soldier to be present. Something more 13 | lies beath this. You have to seek the 14 | fate of this congregation's leadership. -------------------------------------------------------------------------------- /NullSoundSystem/SoundEmitter.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "glm/glm.hpp" 3 | #include 4 | 5 | 6 | #include "SoundClip.h" 7 | #include "SoundListener.h" 8 | #include "SoundEmitter.h" 9 | 10 | namespace odb { 11 | void playSource(void *arg) { 12 | 13 | } 14 | 15 | 16 | SoundEmitter::SoundEmitter(std::shared_ptr aSample) : mSample(aSample) { 17 | 18 | } 19 | 20 | void SoundEmitter::play(std::shared_ptr listener) { 21 | 22 | 23 | } 24 | } 25 | 26 | -------------------------------------------------------------------------------- /DungeonsOfNoudar486/res/chapter2.txt: -------------------------------------------------------------------------------- 1 | - Prison - 2 | The situation is much worse then your 3 | biggest fears and the more you look, 4 | the less you expect to find a solution. 5 | 6 | There is, it seems, a source to all 7 | this tainted web of befallen counter 8 | measures. It must be somewhere in here. 9 | 10 | In previous times, a guardian would 11 | personally hand over the token of it's 12 | faith and finish it's pupil training, 13 | but your journey here and your pagan 14 | roots are your only tool now. -------------------------------------------------------------------------------- /DungeonsOfNoudar486/res/chapter3.txt: -------------------------------------------------------------------------------- 1 | - Graveyard - 2 | As you gazed into the eternal lava, new 3 | perspectives hit fathoms deep into the 4 | core of your presumedly failed creed. 5 | 6 | If that crossbow, such icon of hope, 7 | stood by the well unscathed, so will 8 | the pure shimmering strength you have 9 | in store for such dark forces. 10 | 11 | From afar, you could see the temple of 12 | such perversions - so close you could 13 | almost hear it's whisper. There must be 14 | a new route for your new crusade. -------------------------------------------------------------------------------- /DungeonsOfNoudar486/res/chapter5.txt: -------------------------------------------------------------------------------- 1 | - Sanctuary vaults - 2 | The woeful visage may tear the enamel 3 | of your essence, but you survived this 4 | clash. May it be the nadir on this. 5 | 6 | As strong as the crossbow is, time is 7 | an important ally now. The thickest of 8 | the skins will eventually stretch if 9 | to become more sensitive to the sun. 10 | 11 | The letter that summoned you gave 12 | hints of a protective implement. 13 | Something that sounded like a metaphor 14 | The path of the righteous takes a turn -------------------------------------------------------------------------------- /DungeonsOfNoudarNDK/app/src/main/java/pt/b13h/noudar/GamePresentation.kt: -------------------------------------------------------------------------------- 1 | package pt.b13h.noudar 2 | 3 | import android.app.Presentation 4 | import android.content.Context 5 | import android.os.Bundle 6 | import android.view.Display 7 | import android.widget.ImageView 8 | 9 | class GamePresentation(context: Context?, display: Display?, private val canvas: ImageView) : 10 | Presentation(context, display) { 11 | override fun onCreate(savedInstanceState: Bundle) { 12 | super.onCreate(savedInstanceState) 13 | setContentView(canvas) 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /DungeonsOfNoudar486/res/gameover.txt: -------------------------------------------------------------------------------- 1 | - Epilogue - 2 | A meandering soul 3 | found way into the 4 | gates of 5 | absolution way too 6 | early into it's 7 | mission. 8 | 9 | Do not feel 10 | discouraged by 11 | whatever setback 12 | in your journey. 13 | 14 | Into the dark 15 | reigns of DOS for 16 | now. 17 | -------------------------------------------------------------------------------- /DungeonsOfNoudar486/res/tiles1.lst: -------------------------------------------------------------------------------- 1 | grass.png 2 | grass2.png 3 | stonefloor.png 4 | bricks.png 5 | arch.png 6 | bars.png 7 | bricks2.png 8 | bricks_candles.png 9 | StrongDemonAttack0.png 10 | WeakDemonAttack0.png 11 | WarthogAttack0.png 12 | EvilSpiritAttack0.png 13 | FallenAttack0.png 14 | MonkAttack0.png 15 | CocoonStanding0.png 16 | ceiling.png 17 | ceilingdoor.png 18 | ceilingbegin.png 19 | ceilingend.png 20 | splat0.png 21 | splat1.png 22 | splat2.png 23 | ceilingbars.png 24 | clouds.png 25 | crossbow.png 26 | falcata.png 27 | shield.png 28 | rope.png 29 | slot.png 30 | seal.png 31 | cobblestone.png 32 | fence.png 33 | -------------------------------------------------------------------------------- /DungeonsOfNoudar486/res/tiles5.lst: -------------------------------------------------------------------------------- 1 | grass.png 2 | lava0.png 3 | stonefloor.png 4 | bricks.png 5 | arch.png 6 | bars.png 7 | bricks_blood.png 8 | bricks_candles.png 9 | StrongDemonAttack0.png 10 | WeakDemonAttack0.png 11 | WarthogAttack0.png 12 | EvilSpiritAttack0.png 13 | FallenAttack0.png 14 | MonkAttack0.png 15 | CocoonStanding0.png 16 | ceiling.png 17 | ceilingdoor.png 18 | ceilingbegin.png 19 | ceilingend.png 20 | splat0.png 21 | splat1.png 22 | splat2.png 23 | ceilingbars.png 24 | clouds.png 25 | crossbow.png 26 | falcata.png 27 | shield.png 28 | rope.png 29 | slot.png 30 | seal.png 31 | cobblestone.png 32 | fence.png 33 | -------------------------------------------------------------------------------- /DungeonsOfNoudar486/res/tiles6.lst: -------------------------------------------------------------------------------- 1 | grass.png 2 | lava0.png 3 | stonefloor.png 4 | bricks.png 5 | arch.png 6 | bars.png 7 | bricks_blood.png 8 | bricks_candles.png 9 | StrongDemonAttack0.png 10 | WeakDemonAttack0.png 11 | WarthogAttack0.png 12 | EvilSpiritAttack0.png 13 | FallenAttack0.png 14 | MonkAttack0.png 15 | CocoonStanding0.png 16 | ceiling.png 17 | ceilingdoor.png 18 | ceilingbegin.png 19 | ceilingend.png 20 | splat0.png 21 | splat1.png 22 | splat2.png 23 | ceilingbars.png 24 | clouds.png 25 | crossbow.png 26 | falcata.png 27 | shield.png 28 | rope.png 29 | slot.png 30 | seal.png 31 | cobblestone.png 32 | fence.png 33 | -------------------------------------------------------------------------------- /DungeonsOfNoudar486/res/tiles0.lst: -------------------------------------------------------------------------------- 1 | grass.png 2 | grass2.png 3 | stonefloor.png 4 | bricks.png 5 | arch.png 6 | bars.png 7 | bricks_blood.png 8 | bricks_candles.png 9 | StrongDemonAttack0.png 10 | WeakDemonAttack0.png 11 | WarthogAttack0.png 12 | EvilSpiritAttack0.png 13 | FallenAttack0.png 14 | MonkAttack0.png 15 | CocoonStanding0.png 16 | ceiling.png 17 | ceilingdoor.png 18 | ceilingbegin.png 19 | ceilingend.png 20 | splat0.png 21 | splat1.png 22 | splat2.png 23 | ceilingbars.png 24 | clouds.png 25 | crossbow.png 26 | falcata.png 27 | shield.png 28 | rope.png 29 | slot.png 30 | seal.png 31 | cobblestone.png 32 | fence.png 33 | -------------------------------------------------------------------------------- /DungeonsOfNoudar486/res/tiles2.lst: -------------------------------------------------------------------------------- 1 | grass.png 2 | lava0.png 3 | ceiling.png 4 | bricks2.png 5 | arch.png 6 | bars.png 7 | bricks_blood.png 8 | bricks_candles.png 9 | StrongDemonAttack0.png 10 | WeakDemonAttack0.png 11 | WarthogAttack0.png 12 | EvilSpiritAttack0.png 13 | FallenAttack0.png 14 | MonkAttack0.png 15 | CocoonStanding0.png 16 | stoneceiling.png 17 | ceilingdoor.png 18 | ceilingbegin.png 19 | ceilingend.png 20 | splat0.png 21 | splat1.png 22 | splat2.png 23 | ceilingbars.png 24 | clouds.png 25 | crossbow.png 26 | falcata.png 27 | shield.png 28 | rope.png 29 | slot.png 30 | seal.png 31 | cobblestone.png 32 | bricks.png 33 | -------------------------------------------------------------------------------- /DungeonsOfNoudar486/res/tiles3.lst: -------------------------------------------------------------------------------- 1 | grass.png 2 | grass2.png 3 | stonefloor.png 4 | bricks.png 5 | arch.png 6 | bars.png 7 | bricks_blood.png 8 | bricks_candles.png 9 | StrongDemonAttack0.png 10 | WeakDemonAttack0.png 11 | WarthogAttack0.png 12 | EvilSpiritAttack0.png 13 | FallenAttack0.png 14 | MonkAttack0.png 15 | CocoonStanding0.png 16 | ceiling.png 17 | ceilingdoor.png 18 | ceilingbegin.png 19 | ceilingend.png 20 | splat0.png 21 | splat1.png 22 | splat2.png 23 | ceilingbars.png 24 | clouds.png 25 | crossbow.png 26 | falcata.png 27 | shield.png 28 | rope.png 29 | slot.png 30 | bricks2.png 31 | cobblestone.png 32 | fence.png 33 | -------------------------------------------------------------------------------- /DungeonsOfNoudar486/res/tiles4.lst: -------------------------------------------------------------------------------- 1 | grass.png 2 | lava0.png 3 | ceiling.png 4 | bricks2.png 5 | arch.png 6 | bars.png 7 | bricks_blood.png 8 | bricks_candles.png 9 | StrongDemonAttack0.png 10 | WeakDemonAttack0.png 11 | WarthogAttack0.png 12 | EvilSpiritAttack0.png 13 | FallenAttack0.png 14 | MonkAttack0.png 15 | CocoonStanding0.png 16 | stoneceiling.png 17 | ceilingdoor.png 18 | ceilingbegin.png 19 | ceilingend.png 20 | splat0.png 21 | splat1.png 22 | splat2.png 23 | ceilingbars.png 24 | clouds.png 25 | crossbow.png 26 | falcata.png 27 | shield.png 28 | rope.png 29 | slot.png 30 | bricks.png 31 | cobblestone.png 32 | fence.png 33 | -------------------------------------------------------------------------------- /NullSoundSystem/SoundEmitter.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by monty on 10/10/16. 3 | // 4 | 5 | #ifndef TIC_TAC_TOE_GLES_SOUNDEMITTER_H 6 | #define TIC_TAC_TOE_GLES_SOUNDEMITTER_H 7 | 8 | namespace odb { 9 | class SoundEmitter { 10 | std::shared_ptr mSample = nullptr; 11 | unsigned int mEmitterHandle; 12 | public: 13 | glm::vec3 mPosition{0, 0, 0}; 14 | float mVolume = 1.0f; 15 | 16 | SoundEmitter(std::shared_ptr aSample); 17 | 18 | void play(std::shared_ptr listener); 19 | }; 20 | } 21 | 22 | #endif //TIC_TAC_TOE_GLES_SOUNDEMITTER_H 23 | -------------------------------------------------------------------------------- /noudar-rendering/CLerp.h: -------------------------------------------------------------------------------- 1 | #ifndef CLERP_H 2 | #define CLERP_H 3 | 4 | namespace odb { 5 | class CLerp { 6 | public: 7 | float mDelta; 8 | float mDuration; 9 | float mInitialValue; 10 | long mEllapsed; 11 | 12 | explicit CLerp(long initialValue, long finalValue, long duration); 13 | 14 | float getValue(long ellapsed); 15 | 16 | float getFinalValue(); 17 | 18 | bool isFinished(); 19 | 20 | float getCurrentValue(); 21 | 22 | long getEllapsed(); 23 | 24 | long getDuration(); 25 | 26 | void update(long ms); 27 | }; 28 | } 29 | #endif -------------------------------------------------------------------------------- /DungeonsOfNoudar486/OPL2LPT/MusicSDL.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | using std::vector; 12 | 13 | #include "IFileLoaderDelegate.h" 14 | #include "CPackedFileReader.h" 15 | 16 | #include 17 | #include 18 | 19 | void playMusic(const std::string &music) { 20 | } 21 | 22 | void setupOPL2(int port) { 23 | } 24 | 25 | void stopSounds() { 26 | } 27 | 28 | void playTune(const std::string &music) { 29 | 30 | } 31 | 32 | void soundTick() { 33 | 34 | } 35 | 36 | void muteSound() { 37 | 38 | } -------------------------------------------------------------------------------- /noudar-rendering/NoudarGLES2Bridge.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by monty on 06/10/16. 3 | // 4 | 5 | #ifndef NOUDAR_CORE_NOUDARGLES2BRIDGE_H 6 | #define NOUDAR_CORE_NOUDARGLES2BRIDGE_H 7 | 8 | namespace odb { 9 | class NoudarGLES2Bridge : public Knights::IRenderer { 10 | char mNextCmd = '.'; 11 | bool mPerformVisibilityCheck = true; 12 | public: 13 | NoudarGLES2Bridge(); 14 | 15 | void drawMap(Knights::CMap &map, std::shared_ptr current) override; 16 | 17 | char getInput() override; 18 | 19 | char peekInput() override; 20 | 21 | void setNextCommand(char cmd); 22 | 23 | void reset(); 24 | 25 | void setVisibilityChecks(bool visibilityCheck); 26 | }; 27 | } 28 | 29 | 30 | #endif //NOUDAR_CORE_NOUDARGLES2BRIDGE_H 31 | -------------------------------------------------------------------------------- /noudar-rendering/SplatAnimation.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by monty on 22/10/16. 3 | // 4 | 5 | #ifndef DUNGEONSOFNOUDAR_NDK_SPLATANIMATION_H 6 | #define DUNGEONSOFNOUDAR_NDK_SPLATANIMATION_H 7 | 8 | 9 | namespace odb { 10 | class SplatAnimation { 11 | 12 | public: 13 | SplatAnimation(Knights::Vec2i position); 14 | 15 | void update(long ms); 16 | 17 | void startSplatAnimation(); 18 | 19 | int getSplatFrame(); 20 | 21 | bool isFinished(); 22 | 23 | Knights::Vec2i getPosition(); 24 | 25 | private: 26 | const int TOTAL_ANIMATION_TIME = 500; 27 | const int NUMBER_OF_FRAMES = 3; 28 | Knights::Vec2i mPosition{0, 0}; 29 | 30 | long showSplatTime = 0; 31 | }; 32 | } 33 | 34 | #endif //DUNGEONSOFNOUDAR_NDK_SPLATANIMATION_H 35 | -------------------------------------------------------------------------------- /noudar-rendering/NativeBitmap.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by monty on 28/02/16. 3 | // 4 | 5 | #ifndef LESSON10_NATIVEBITMAP_H 6 | #define LESSON10_NATIVEBITMAP_H 7 | namespace odb { 8 | class NativeBitmap { 9 | std::string mId; 10 | int mWidth; 11 | int mHeight; 12 | int *mRawData; 13 | 14 | public: 15 | NativeBitmap(std::string aId, int aWidth, int aHeight, int *aRawData); 16 | 17 | std::shared_ptr makeBitmapWithHalfDimensions() const; 18 | 19 | int getWidth() const; 20 | 21 | int getHeight() const; 22 | 23 | int *getPixelData() const; 24 | 25 | std::string getId() const; 26 | 27 | void releaseTextureData(); 28 | 29 | ~NativeBitmap(); 30 | }; 31 | } 32 | 33 | #endif //LESSON10_NATIVEBITMAP_H 34 | -------------------------------------------------------------------------------- /DungeonsOfNoudar486/res/chapter7.txt: -------------------------------------------------------------------------------- 1 | - Epilogue - 2 | After such gruesome 3 | and soul-searching 4 | battle, you did it. 5 | The demon is gone. 6 | 7 | You barely had time 8 | to breathe as the 9 | ground began to 10 | rumble. A split 11 | second later, 12 | anything beneath 13 | you simply 14 | collapsed into a 15 | big amorphous plot 16 | of land. 17 | 18 | Finally peace and 19 | redemption savory. 20 | Embrace eternity. 21 | 22 | Thanks for playing! 23 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "DungeonsOfNoudar-NDK/app/src/main/jni/gles2-renderer"] 2 | path = DungeonsOfNoudar-NDK/app/src/main/jni/gles2-renderer 3 | url = https://github.com/TheFakeMontyOnTheRun/gles2-renderer.git 4 | [submodule "DungeonsOfNoudar-NDK/common_includes/glm-head"] 5 | path = DungeonsOfNoudar-NDK/common_includes/glm-head 6 | url = https://github.com/g-truc/glm.git 7 | [submodule "stb"] 8 | path = stb 9 | url = https://github.com/TheFakeMontyOnTheRun/stb.git 10 | [submodule "noudar-core"] 11 | path = noudar-core 12 | url = https://github.com/TheFakeMontyOnTheRun/noudar-core 13 | [submodule "DungeonsOfNoudar486/uGLy"] 14 | path = DungeonsOfNoudar486/uGLy 15 | url = https://github.com/TheFakeMontyOnTheRun/uGLy.git 16 | [submodule "fixed_point"] 17 | path = fixed_point 18 | url = https://github.com/johnmcfarlane/fixed_point.git 19 | -------------------------------------------------------------------------------- /DungeonsOfNoudarNDK/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /DungeonsOfNoudarNDK/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /DungeonsOfNoudar486/include/RaycastCommon.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by monty on 27/08/16. 3 | // 4 | 5 | #ifndef BLANKSLATE_COMMON_H 6 | #define BLANKSLATE_COMMON_H 7 | 8 | #include 9 | 10 | namespace odb { 11 | enum class ECommand { 12 | kUp, 13 | kRight, 14 | kDown, 15 | kLeft, 16 | kFire1, 17 | kFire2 18 | }; 19 | 20 | using FixP = fixed_point; 21 | 22 | class RayCollision { 23 | public: 24 | FixP mSquaredDistance = 0; 25 | Knights::Vec2i mCollisionPoint = {0,0}; 26 | int mHeight = 0; 27 | int mElement = 0; 28 | }; 29 | 30 | using CControlCallback = std::function< void(ECommand) >; 31 | 32 | int wrap360(int i); 33 | 34 | const int xRes = 255; 35 | const int yRes = 128; 36 | const FixP fixedYRes = FixP{128}; 37 | 38 | } 39 | #endif //BLANKSLATE_COMMON_H 40 | -------------------------------------------------------------------------------- /noudar-rendering/LightningStrategy.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by monty on 30/07/16. 3 | // 4 | 5 | 6 | #ifndef KNIGHTSOFALENTEJOANDROID_AS_LIGHTNINGSTRATEGY_H 7 | #define KNIGHTSOFALENTEJOANDROID_AS_LIGHTNINGSTRATEGY_H 8 | 9 | namespace odb { 10 | 11 | class LightningStrategy { 12 | 13 | 14 | enum Direction : uint8_t { 15 | N, 16 | E, 17 | S, 18 | W, 19 | TOP, 20 | BOTTOM 21 | }; 22 | 23 | static bool isValid(Knights::Vec2i pos); 24 | 25 | static void castLight(Direction from, LightMap &lightMap, int emission, 26 | IntMap occluders, Knights::Vec2i pos); 27 | 28 | public: 29 | static void castPointLight(LightMap &lightMap, int emission, IntMap occluders, 30 | int x, int y); 31 | }; 32 | } 33 | 34 | #endif //KNIGHTSOFALENTEJOANDROID_AS_LIGHTNINGSTRATEGY_H 35 | -------------------------------------------------------------------------------- /DungeonsOfNoudar486/include/RasterizerCommon.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by monty on 27/08/16. 3 | // 4 | 5 | #ifndef BLANKSLATE_COMMON_H 6 | #define BLANKSLATE_COMMON_H 7 | 8 | namespace odb { 9 | 10 | using FixP16 = fixed_point; 11 | using FixP32 = fixed_point; 12 | using TextureFixP = fixed_point; 13 | 14 | #ifdef LOWRES 15 | using FixP = FixP16; 16 | #else 17 | using FixP = FixP32; 18 | #endif 19 | 20 | 21 | class Vec3 { 22 | public: 23 | FixP mX; 24 | FixP mY; 25 | FixP mZ; 26 | }; 27 | 28 | Vec3 operator+(const Vec3 &v1, const Vec3 &v2); 29 | 30 | Vec3 operator-(const Vec3 &v1, const Vec3 &v2); 31 | 32 | Vec3 &operator+=(Vec3 &v1, const Vec3 &v2); 33 | 34 | Vec3 &operator-=(Vec3 &v1, const Vec3 &v2); 35 | 36 | class Vec2 { 37 | public: 38 | FixP mX; 39 | FixP mY; 40 | }; 41 | } 42 | #endif //BLANKSLATE_COMMON_H 43 | -------------------------------------------------------------------------------- /DungeonsOfNoudar486/include/CPackedFileReader.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by monty on 06-12-2017. 3 | // 4 | 5 | #ifndef DUNGEONSOFNOUDAR486_CPACKEDFILEREADER_H 6 | #define DUNGEONSOFNOUDAR486_CPACKEDFILEREADER_H 7 | 8 | namespace odb { 9 | class CPackedFileReader : public Knights::IFileLoaderDelegate { 10 | FILE *mDataPack = nullptr; 11 | std::string mPackPath; 12 | std::unordered_map mOffsets; 13 | public: 14 | CPackedFileReader() = delete; 15 | size_t sizeOfFile(const std::string& path) override; 16 | explicit CPackedFileReader( std::string dataFilePath ); 17 | uint8_t* loadBinaryFileFromPath( const std::string& path ) override; 18 | std::string loadFileFromPath( const std::string& path ) override ; 19 | std::string getFilePathPrefix() override; 20 | virtual ~CPackedFileReader(); 21 | 22 | }; 23 | } 24 | 25 | #endif //DUNGEONSOFNOUDAR486_CPACKEDFILEREADER_H 26 | -------------------------------------------------------------------------------- /noudar-rendering/ETextures.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by monty on 14/01/17. 3 | // 4 | 5 | #ifndef DUNGEONSOFNOUDAR_NDK_ETEXTURES_H 6 | #define DUNGEONSOFNOUDAR_NDK_ETEXTURES_H 7 | namespace odb { 8 | enum ETextures : uint8_t { 9 | Grass, 10 | Lava, 11 | Floor, 12 | Bricks, 13 | Arch, 14 | Bars, 15 | BricksBlood, 16 | BricksCandles, 17 | StrongDemonAttack0, 18 | WeakDemonAttack0, 19 | WarthogAttack0, 20 | EvilSpiritAttack0, 21 | FallenAttack0, 22 | MonkAttack0, 23 | CocoonStanding0, 24 | Ceiling, 25 | CeilingDoor, 26 | CeilingBegin, 27 | CeilingEnd, 28 | Splat0, 29 | Splat1, 30 | Splat2, 31 | CeilingBars, 32 | Skybox, 33 | Crossbow, 34 | Falcata, 35 | Shield, 36 | Rope, 37 | Slot, 38 | MagicSeal, 39 | Cobblestone, 40 | Fence, 41 | Cross 42 | }; 43 | } 44 | #endif //DUNGEONSOFNOUDAR_NDK_ETEXTURES_H 45 | -------------------------------------------------------------------------------- /noudar-rendering/CLerp.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include "CLerp.h" 5 | 6 | namespace odb { 7 | CLerp::CLerp(long initialValue, long finalValue, long duration) : 8 | mDelta(std::abs(finalValue - initialValue)), mDuration(duration), 9 | mInitialValue(initialValue), mEllapsed(0) { 10 | } 11 | 12 | float CLerp::getValue(long ellapsed) { 13 | return mInitialValue + std::min(((mDelta * ellapsed) / mDuration), mDelta); 14 | } 15 | 16 | float CLerp::getFinalValue() { 17 | return mInitialValue + mDelta; 18 | } 19 | 20 | long CLerp::getEllapsed() { 21 | return mEllapsed; 22 | } 23 | 24 | float CLerp::getCurrentValue() { 25 | return getValue(mEllapsed); 26 | } 27 | 28 | void CLerp::update(long ms) { 29 | mEllapsed += ms; 30 | } 31 | 32 | long CLerp::getDuration() { 33 | return mDuration; 34 | } 35 | 36 | bool CLerp::isFinished() { 37 | return mEllapsed >= mDuration; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /noudar-rendering/CTile3DProperties.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by monty on 14/01/17. 3 | // 4 | 5 | #ifndef DUNGEONSOFNOUDAR_NDK_TILEPROPERTIES_H 6 | #define DUNGEONSOFNOUDAR_NDK_TILEPROPERTIES_H 7 | namespace odb { 8 | 9 | class CTile3DProperties; 10 | 11 | using CTileId = uint8_t; 12 | 13 | using CTilePropertyMap = std::map; 14 | 15 | using TextureName = std::string; 16 | 17 | class CTile3DProperties { 18 | public: 19 | bool mNeedsAlphaTest = true; 20 | TextureName mCeilingTexture; 21 | TextureName mFloorTexture; 22 | TextureName mMainWallTexture; 23 | VBORegisterId mVBOToRender; 24 | TextureName mCeilingRepeatedWallTexture; 25 | TextureName mFloorRepeatedWallTexture; 26 | uint8_t mCeilingRepetitions; 27 | uint8_t mFloorRepetitions; 28 | float mCeilingHeight; 29 | float mFloorHeight; 30 | 31 | static CTilePropertyMap parsePropertyList(std::string propertyFile); 32 | }; 33 | } 34 | 35 | 36 | #endif //DUNGEONSOFNOUDAR_NDK_TILEPROPERTIES_H 37 | -------------------------------------------------------------------------------- /DungeonsOfNoudar486/src/RasterizerCommon.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by monty on 04-07-2017. 3 | // 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | using std::vector; 14 | using std::array; 15 | using sg14::fixed_point; 16 | 17 | #include "RasterizerCommon.h" 18 | 19 | namespace odb { 20 | 21 | Vec3 operator+(const Vec3& v1, const Vec3& v2 ) { 22 | return { v1.mX + v2.mX, v1.mY + v2.mY, v1.mZ + v2.mZ }; 23 | } 24 | 25 | Vec3 operator-(const Vec3& v1, const Vec3& v2 ) { 26 | return { v1.mX - v2.mX, v1.mY - v2.mY, v1.mZ - v2.mZ }; 27 | } 28 | 29 | Vec3& operator+=(Vec3& v1, const Vec3& v2 ) { 30 | 31 | v1.mX += v2.mX; 32 | v1.mY += v2.mY; 33 | v1.mZ += v2.mZ; 34 | 35 | return v1; 36 | } 37 | 38 | Vec3& operator-=(Vec3& v1, const Vec3& v2 ) { 39 | 40 | v1.mX -= v2.mX; 41 | v1.mY -= v2.mY; 42 | v1.mZ -= v2.mZ; 43 | 44 | return v1; 45 | } 46 | } 47 | 48 | -------------------------------------------------------------------------------- /noudar-rendering/SplatAnimation.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by monty on 22/10/16. 3 | // 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #include 10 | #include "Vec2i.h" 11 | #include "SplatAnimation.h" 12 | 13 | void odb::SplatAnimation::update(long ms) { 14 | showSplatTime -= ms; 15 | } 16 | 17 | void odb::SplatAnimation::startSplatAnimation() { 18 | showSplatTime = TOTAL_ANIMATION_TIME; 19 | } 20 | 21 | int odb::SplatAnimation::getSplatFrame() { 22 | if (showSplatTime > 0) { 23 | return (int) ((TOTAL_ANIMATION_TIME - showSplatTime) * NUMBER_OF_FRAMES) / 24 | TOTAL_ANIMATION_TIME; 25 | } else { 26 | return -1; 27 | } 28 | } 29 | 30 | bool odb::SplatAnimation::isFinished() { 31 | return showSplatTime <= 0; 32 | } 33 | 34 | odb::SplatAnimation::SplatAnimation(Knights::Vec2i aPosition) : mPosition(aPosition) { 35 | startSplatAnimation(); 36 | } 37 | 38 | Knights::Vec2i odb::SplatAnimation::getPosition() { 39 | return mPosition; 40 | } 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /noudar-rendering/Logger.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by monty on 26/09/16. 3 | // 4 | #include 5 | #include 6 | #include 7 | 8 | #ifdef __ANDROID__ 9 | 10 | #include 11 | 12 | #else 13 | #include 14 | #endif 15 | 16 | #include "Logger.h" 17 | 18 | namespace odb { 19 | 20 | void doLog(const char *format, va_list args) { 21 | char buffer[255]; 22 | return; 23 | memset(&buffer[0], 0, 255); 24 | std::vsnprintf(buffer, 255, format, args); 25 | 26 | #ifdef __ANDROID__ 27 | __android_log_print(ANDROID_LOG_INFO, "Logger::log", "%s", buffer); 28 | #else 29 | std::printf( "%s\n", buffer ); 30 | #endif 31 | 32 | 33 | } 34 | 35 | void Logger::log(const char *format, ...) { 36 | 37 | va_list args; 38 | va_start(args, format); 39 | 40 | doLog(format, args); 41 | va_end(args); 42 | } 43 | 44 | void Logger::log(std::string format, ...) { 45 | va_list args; 46 | va_start(args, format); 47 | auto fmt = format.c_str(); 48 | doLog(fmt, args); 49 | va_end(args); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /DungeonsOfNoudarNDK/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 11 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /noudar-rendering/VBORenderingJob.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Daniel Monteiro on 12/11/16. 3 | // 4 | 5 | #ifndef DUNGEONSOFNOUDAR_NDK_VBORENDERINGJOB_H 6 | #define DUNGEONSOFNOUDAR_NDK_VBORENDERINGJOB_H 7 | 8 | namespace odb { 9 | class VBORenderingJob { 10 | public: 11 | explicit VBORenderingJob(int vboId, int vboIndicesId, int amount, glm::mat4 transform, 12 | float shade, bool needsAlphaTest, bool needsZBuffer); 13 | 14 | explicit VBORenderingJob(int vboId, int vboIndicesId, int amount, glm::mat4 transform, 15 | float shade, bool needsAlphaTest); 16 | 17 | glm::mat4 getTransform() const; 18 | 19 | int getVBOId() const; 20 | 21 | int getVBOIndicesId() const; 22 | 23 | float getShade() const; 24 | 25 | int getAmount() const; 26 | 27 | private: 28 | glm::mat4 mVBOInstanceTransform = glm::mat4(1.0f); 29 | float mShade = 1.0f; 30 | int mVBOId = -1; 31 | int mVBOIndicesId = -1; 32 | int mAmount = 0; 33 | public: 34 | bool mNeedsZBuffer = true; 35 | bool mNeedsAlphaTest = false; 36 | }; 37 | } 38 | 39 | #endif //DUNGEONSOFNOUDAR_NDK_VBORENDERINGJOB_H 40 | -------------------------------------------------------------------------------- /noudar-rendering/Camera.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by monty on 09/02/17. 3 | // 4 | 5 | #ifndef DUNGEONSOFNOUDAR_NDK_CAMERA_H 6 | #define DUNGEONSOFNOUDAR_NDK_CAMERA_H 7 | 8 | namespace odb { 9 | class Camera { 10 | 11 | glm::mat4 mTransform = glm::mat4(1.0f); 12 | 13 | glm::vec2 mCameraTarget; 14 | glm::vec2 cameraPosition; 15 | 16 | float *mEyeView = nullptr; 17 | 18 | float mAngleXZ = 0; 19 | float mAngleYZ = 0; 20 | 21 | int mCameraRotation = 0; 22 | int mRotationTarget = 0; 23 | 24 | public: 25 | void rotateBy(glm::vec3 axis, int degrees); 26 | 27 | void moveBy(glm::vec3 delta); 28 | 29 | void rotateTo(glm::vec3 axis, int degrees); 30 | 31 | void moveTo(glm::vec3 position); 32 | 33 | glm::mat4 getTransform(); 34 | 35 | glm::vec3 getPosition(); 36 | 37 | glm::mat4 getViewMatrix(glm::vec3 position); 38 | 39 | void update(long ms); 40 | 41 | void incrementRotateTarget(int delta); 42 | 43 | bool isAnimating(); 44 | 45 | void setEyeView(float *eyeView); 46 | 47 | void reset(); 48 | 49 | void setRotationXZ(float xz); 50 | 51 | void setRotationYZ(float yz); 52 | 53 | int getCameraRotationXZ() const; 54 | }; 55 | } 56 | 57 | #endif //DUNGEONSOFNOUDAR_NDK_CAMERA_H 58 | -------------------------------------------------------------------------------- /License.md: -------------------------------------------------------------------------------- 1 | BSD 2-Clause License 2 | 3 | Copyright (c) 2016, Daniel Monteiro 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | * Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 20 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | -------------------------------------------------------------------------------- /noudar-rendering/VisibilityStrategy.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by monty on 30/07/16. 3 | // 4 | 5 | 6 | #ifndef KNIGHTSOFALENTEJOANDROID_AS_VISIBILITYSTRATEGY_H 7 | #define KNIGHTSOFALENTEJOANDROID_AS_VISIBILITYSTRATEGY_H 8 | 9 | namespace odb { 10 | 11 | class VisibilityStrategy { 12 | 13 | static bool isValid(Knights::Vec2i pos); 14 | 15 | static void 16 | castVisibility(Knights::EDirection from, VisMap &visMap, const IntMap &occluders, 17 | Knights::Vec2i pos, Knights::Vec2i offset); 18 | 19 | static bool 20 | isBlock(const IntMap &occluders, Knights::EDirection from, Knights::Vec2i currentPos); 21 | 22 | static bool 23 | isVisibleAt(const VisMap &visMap, Knights::EDirection from, Knights::Vec2i currentPos); 24 | 25 | static void 26 | setIsVisible(VisMap &visMap, Knights::EDirection from, Knights::Vec2i currentPos); 27 | 28 | public: 29 | static Knights::Vec2i transform(Knights::EDirection from, Knights::Vec2i currentPos); 30 | 31 | static void castVisibility(VisMap &visMap, const IntMap &occluders, Knights::Vec2i pos, 32 | Knights::EDirection direction, bool cleanPrevious); 33 | 34 | static void mergeInto(const VisMap &map1, const VisMap &map2, VisMap &result); 35 | 36 | static void makeAllVisible(VisMap &array); 37 | }; 38 | } 39 | 40 | #endif //KNIGHTSOFALENTEJOANDROID_AS_VISIBILITYSTRATEGY_H 41 | -------------------------------------------------------------------------------- /DungeonsOfNoudar486/include/CTile3DProperties.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by monty on 14/01/17. 3 | // 4 | 5 | #ifndef DUNGEONSOFNOUDAR_NDK_TILEPROPERTIES_H 6 | #define DUNGEONSOFNOUDAR_NDK_TILEPROPERTIES_H 7 | namespace odb { 8 | 9 | class CTile3DProperties; 10 | 11 | using CTileId = uint8_t; 12 | using TextureIndex = int16_t; 13 | 14 | using CTilePropertyMap = std::unordered_map< CTileId, CTile3DProperties >; 15 | 16 | using TextureName = std::string; 17 | 18 | enum GeometryType{ kNone, kCube, kLeftNearWall, kRightNearWall}; 19 | 20 | class CTile3DProperties { 21 | public: 22 | bool mNeedsAlphaTest = true; 23 | TextureName mCeilingTexture; 24 | TextureName mFloorTexture; 25 | TextureName mMainWallTexture; 26 | 27 | TextureIndex mCeilingTextureIndex; 28 | TextureIndex mFloorTextureIndex; 29 | TextureIndex mMainWallTextureIndex; 30 | 31 | GeometryType mGeometryType; 32 | 33 | TextureName mCeilingRepeatedWallTexture; 34 | TextureName mFloorRepeatedWallTexture; 35 | 36 | TextureIndex mCeilingRepeatedTextureIndex; 37 | TextureIndex mFloorRepeatedTextureIndex; 38 | 39 | uint8_t mCeilingRepetitions; 40 | uint8_t mFloorRepetitions; 41 | FixP mCeilingHeight; 42 | FixP mFloorHeight; 43 | 44 | static CTilePropertyMap parsePropertyList( std::string propertyFile ); 45 | }; 46 | } 47 | 48 | 49 | #endif //DUNGEONSOFNOUDAR_NDK_TILEPROPERTIES_H 50 | -------------------------------------------------------------------------------- /DungeonsOfNoudarNDK/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | # IDE (e.g. Android Studio) users: 3 | # Gradle settings configured through the IDE *will override* 4 | # any settings specified in this file. 5 | # For more details on how to configure your build environment visit 6 | # http://www.gradle.org/docs/current/userguide/build_environment.html 7 | # Specifies the JVM arguments used for the daemon process. 8 | # The setting is particularly useful for tweaking memory settings. 9 | org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 10 | # When configured, Gradle will run in incubating parallel mode. 11 | # This option should only be used with decoupled projects. More details, visit 12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 13 | # org.gradle.parallel=true 14 | # AndroidX package structure to make it clearer which packages are bundled with the 15 | # Android operating system, and which are packaged with your app's APK 16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn 17 | android.useAndroidX=true 18 | # Kotlin code style for this project: "official" or "obsolete": 19 | kotlin.code.style=official 20 | # Enables namespacing of each library's R class so that its R class includes only the 21 | # resources declared in the library itself and none from the library's dependencies, 22 | # thereby reducing the size of the R class for that library 23 | android.nonTransitiveRClass=true 24 | org.gradle.configuration-cache=true -------------------------------------------------------------------------------- /noudar-rendering/NativeBitmap.cpp: -------------------------------------------------------------------------------- 1 | //// 2 | //// Created by monty on 28/02/16. 3 | //// 4 | #include 5 | #include 6 | #include "NativeBitmap.h" 7 | 8 | namespace odb { 9 | int NativeBitmap::getWidth() const { 10 | return this->mWidth; 11 | } 12 | 13 | int NativeBitmap::getHeight() const { 14 | return this->mHeight; 15 | } 16 | 17 | int *NativeBitmap::getPixelData() const { 18 | return this->mRawData; 19 | } 20 | 21 | std::string NativeBitmap::getId() const { 22 | return mId; 23 | } 24 | 25 | NativeBitmap::NativeBitmap(std::string aId, int aWidth, int aHeight, int *aRawData) : 26 | mId(aId), mWidth(aWidth), mHeight(aHeight), mRawData(aRawData) { 27 | } 28 | 29 | void NativeBitmap::releaseTextureData() { 30 | this->mWidth = 0; 31 | this->mHeight = 0; 32 | this->mRawData = nullptr; 33 | } 34 | 35 | NativeBitmap::~NativeBitmap() { 36 | delete[] mRawData; 37 | } 38 | 39 | std::shared_ptr NativeBitmap::makeBitmapWithHalfDimensions() const { 40 | int *rawData; 41 | int newWidth = mWidth / 2; 42 | int newHeight = mHeight / 2; 43 | rawData = new int[newHeight * newWidth]; 44 | 45 | for (int y = 0; y < mHeight; ++y) { 46 | for (int x = 0; x < mWidth; ++x) { 47 | rawData[(newWidth * (y / 2)) + (x / 2)] = this->mRawData[(mWidth * y) + x]; 48 | } 49 | } 50 | 51 | return std::make_shared(mId, newWidth, newHeight, rawData); 52 | } 53 | } -------------------------------------------------------------------------------- /DungeonsOfNoudar486/src/NativeBitmap.cpp: -------------------------------------------------------------------------------- 1 | //// 2 | //// Created by monty on 28/02/16. 3 | //// 4 | #include 5 | #include 6 | #include "NativeBitmap.h" 7 | 8 | namespace odb { 9 | int NativeBitmap::getWidth() const { 10 | return this->mWidth; 11 | } 12 | 13 | int NativeBitmap::getHeight() const { 14 | return this->mHeight; 15 | } 16 | 17 | int *NativeBitmap::getPixelData() const { 18 | return this->mRawData; 19 | } 20 | 21 | std::string NativeBitmap::getId() const { 22 | return mId; 23 | } 24 | 25 | NativeBitmap::NativeBitmap(std::string aId, int aWidth, int aHeight, int *aRawData) : 26 | mId(aId), mWidth(aWidth), mHeight(aHeight), mRawData(aRawData) { 27 | } 28 | 29 | void NativeBitmap::releaseTextureData() { 30 | this->mWidth = 0; 31 | this->mHeight = 0; 32 | this->mRawData = nullptr; 33 | } 34 | 35 | NativeBitmap::~NativeBitmap() { 36 | delete[] mRawData; 37 | } 38 | 39 | std::shared_ptr NativeBitmap::makeBitmapWithHalfDimensions() const { 40 | int *rawData; 41 | int newWidth = mWidth / 2; 42 | int newHeight = mHeight / 2; 43 | rawData = new int[newHeight * newWidth]; 44 | 45 | for (int y = 0; y < mHeight; ++y) { 46 | for (int x = 0; x < mWidth; ++x) { 47 | rawData[(newWidth * (y / 2)) + (x / 2)] = this->mRawData[(mWidth * y) + x]; 48 | } 49 | } 50 | 51 | return std::make_shared( mId, newWidth, newHeight, rawData); 52 | } 53 | } -------------------------------------------------------------------------------- /DungeonsOfNoudar486/include/VisibilityStrategy.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by monty on 30/07/16. 3 | // 4 | 5 | 6 | #ifndef KNIGHTSOFALENTEJOANDROID_AS_VISIBILITYSTRATEGY_H 7 | #define KNIGHTSOFALENTEJOANDROID_AS_VISIBILITYSTRATEGY_H 8 | 9 | namespace odb { 10 | enum class EVisibility : uint8_t {kVisible, kInvisible}; 11 | using IntMap = array, Knights::kMapSize >; 12 | using VisMap = array, Knights::kMapSize >; 13 | 14 | using DistanceDistribution = array, Knights::kMapSize + Knights::kMapSize >; 15 | class VisibilityStrategy { 16 | 17 | static bool isValid(const Knights::Vec2i& pos); 18 | static void castVisibility(Knights::EDirection from, VisMap &visMap, const IntMap& occluders, const Knights::Vec2i& pos, DistanceDistribution& distances); 19 | static bool isBlock(const IntMap& occluders, const Knights::Vec2i& transformed); 20 | static bool isVisibleAt(const VisMap& visMap, const Knights::Vec2i& transformed ); 21 | static void setIsVisible(VisMap& visMap, const Knights::Vec2i& transformed ); 22 | public: 23 | static void mergeInto(const VisMap &map1, const VisMap &map2, VisMap &result); 24 | 25 | static void makeAllVisible(VisMap& array); 26 | static Knights::Vec2i transform( Knights::EDirection from, const Knights::Vec2i& currentPos ); 27 | static void castVisibility(VisMap &visMap, const IntMap& occluders, const Knights::Vec2i& pos, Knights::EDirection direction, bool cleanPrevious, DistanceDistribution& distances); 28 | }; 29 | } 30 | 31 | #endif //KNIGHTSOFALENTEJOANDROID_AS_VISIBILITYSTRATEGY_H 32 | -------------------------------------------------------------------------------- /DungeonsOfNoudarNDK/app/src/main/java/pt/b13h/noudar/NoudarApplication.kt: -------------------------------------------------------------------------------- 1 | package pt.b13h.noudar 2 | 3 | import android.app.Application 4 | import android.content.Context 5 | import android.content.pm.PackageManager 6 | import android.content.res.Configuration 7 | import android.media.AudioManager 8 | import android.view.InputDevice 9 | 10 | class NoudarApplication : Application() { 11 | 12 | fun mayEnableSound(): Boolean { 13 | val am = getSystemService(Context.AUDIO_SERVICE) as AudioManager 14 | return when (am.ringerMode) { 15 | AudioManager.RINGER_MODE_NORMAL -> true 16 | AudioManager.RINGER_MODE_SILENT, AudioManager.RINGER_MODE_VIBRATE -> false 17 | else -> false 18 | } 19 | } 20 | 21 | private fun hasTouchscreen(): Boolean { 22 | return packageManager.hasSystemFeature(PackageManager.FEATURE_TOUCHSCREEN) 23 | } 24 | 25 | private fun hasPhysicalKeyboard(): Boolean { 26 | return resources.configuration.keyboard != Configuration.KEYBOARD_NOKEYS 27 | } 28 | 29 | 30 | private fun hasGamepad(): Boolean { 31 | for (deviceId in InputDevice.getDeviceIds()) { 32 | val dev = InputDevice.getDevice(deviceId) 33 | val sources = dev!!.sources 34 | if ((sources and InputDevice.SOURCE_GAMEPAD) == InputDevice.SOURCE_GAMEPAD || 35 | ((sources and InputDevice.SOURCE_JOYSTICK) == InputDevice.SOURCE_JOYSTICK) 36 | ) { 37 | return true 38 | } 39 | } 40 | return false 41 | } 42 | 43 | fun hasPhysicalController(): Boolean { 44 | return hasPhysicalKeyboard() || hasGamepad() || !hasTouchscreen() 45 | } 46 | } -------------------------------------------------------------------------------- /noudar-rendering/VBORenderingJob.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Daniel Monteiro on 12/11/16. 3 | // 4 | #include "glm/glm.hpp" 5 | #include "glm/gtc/matrix_transform.hpp" 6 | 7 | #include "VBORenderingJob.h" 8 | 9 | glm::mat4 odb::VBORenderingJob::getTransform() const { 10 | return mVBOInstanceTransform; 11 | } 12 | 13 | int odb::VBORenderingJob::getVBOId() const { 14 | return mVBOId; 15 | } 16 | 17 | odb::VBORenderingJob::VBORenderingJob(int aVBOId, int aVBOIndicesId, int aAmount, 18 | glm::mat4 aTransform, float aShade, 19 | bool needsAlphaTest, bool needsZBuffer) : 20 | mVBOInstanceTransform(aTransform), 21 | mShade(aShade), 22 | mVBOId(aVBOId), 23 | mVBOIndicesId(aVBOIndicesId), 24 | mAmount(aAmount), 25 | mNeedsZBuffer(needsZBuffer), 26 | mNeedsAlphaTest(needsAlphaTest) { 27 | } 28 | 29 | odb::VBORenderingJob::VBORenderingJob(int aVBOId, int aVBOIndicesId, int aAmount, 30 | glm::mat4 aTransform, float aShade, 31 | bool needsAlphaTest = false) : 32 | mVBOInstanceTransform(aTransform), 33 | mShade(aShade), 34 | mVBOId(aVBOId), 35 | mVBOIndicesId(aVBOIndicesId), 36 | mAmount(aAmount), 37 | mNeedsAlphaTest(needsAlphaTest) { 38 | } 39 | 40 | float odb::VBORenderingJob::getShade() const { 41 | return mShade; 42 | } 43 | 44 | int odb::VBORenderingJob::getAmount() const { 45 | return mAmount; 46 | } 47 | 48 | int odb::VBORenderingJob::getVBOIndicesId() const { 49 | return mVBOIndicesId; 50 | } 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /noudar-rendering/NoudarDungeonSnapshot.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by monty on 06/12/16. 3 | // 4 | #include "glm/glm.hpp" 5 | #include "glm/gtc/matrix_transform.hpp" 6 | 7 | #include 8 | #include 9 | 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | 25 | using std::vector; 26 | using std::array; 27 | 28 | #include "Vec2i.h" 29 | #include "IMapElement.h" 30 | #include "CTeam.h" 31 | #include "CItem.h" 32 | #include "CActor.h" 33 | #include "CGameDelegate.h" 34 | #include "CMap.h" 35 | 36 | #include "NoudarDungeonSnapshot.h" 37 | 38 | namespace odb { 39 | std::ostream &operator<<(std::ostream &os, const NoudarDungeonSnapshot &aSnapshot) { 40 | 41 | for (int y = 0; y < Knights::kMapSize; ++y) { 42 | for (int x = 0; x < Knights::kMapSize; ++x) { 43 | 44 | char element = '.'; 45 | 46 | if (aSnapshot.mVisibilityMap[y][x] == EVisibility::kVisible) { 47 | if (aSnapshot.snapshot[y][x] != EActorsSnapshotElement::kNothing) { 48 | element = '^'; 49 | } else { 50 | element = aSnapshot.map[y][x]; 51 | } 52 | } 53 | 54 | os << element; 55 | } 56 | os << std::endl; 57 | } 58 | 59 | return os; 60 | } 61 | 62 | std::string to_string(const NoudarDungeonSnapshot &aSnapshot) { 63 | std::stringstream ss; 64 | ss << aSnapshot; 65 | return ss.str(); 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /DungeonsOfNoudar486/res/map0.txt: -------------------------------------------------------------------------------- 1 | 1111111111111111111111111111111111111111 2 | 1======================================= 3 | 1=11111111111111111111111111111111111111 4 | 1=1-----------------------------------91 5 | 1=1-111111111111111111111111111111111111 6 | 1=1-1=AAAAAAAAAAAAAAARRRRRRRRDD1DDDDDDDD 7 | 1=1-1=11111YY1111RRRRR1111-1RDD1DDDDDDDD 8 | 1=1-1=1**********ROOOOO1@1-1RDD1DDDDDDDD 9 | 1=1-1=#O*********HOOOOOAT@-1RDD1DDDDDDDD 10 | 1=1-1=#O*********HOOOOO1RRRRRDD1DDDDDDDD 11 | 1=1-1=1OOO6OOOOOO1OOOOOYT@-1RDD1DDDDDDDD 12 | 1=1-1=1OKKKOOKKKO1OOOOOOO1=1RDD1DDDDDDDD 13 | 1=1-1=1OOOOOOOOOO1OOOOOOO1=1RDD1DDDDDDDD 14 | 1=1-1=1OKKKOOKKKO1OOOOOOO111RDD1OOO1DDDD 15 | 1=1-1=1OOOOOOOOOO1OOO6OOO1DDRD_~OOO1DDDD 16 | 1=1-1=1OKKKOOKKKO1OOOOOOORRRRD_1OOO1DDDD 17 | 1=1-1-1OOOOOOOOOO1OOOOOOO#E#DD_1DDDDDDDD 18 | 1=1-Y-1OKKKOOKKKO111111111111D_1DDDDDDDD 19 | 1=3***IOOOOOO6OOOIDDDDDDDDDDDD_1DDDDDDDD 20 | 1=I***AOKKKOOKKKOIDDDDDDDDDDDD_1DDDDDDDD 21 | 1=I-\=IOOOOOOOOOOIDDDDDDDDDDDD_1DDDDDDDD 22 | 1#IIIII1111~~1111IIII1111111DDD1DDDDDDDD 23 | 1__\/____(1~~1)___\/_1------DDD1DDDDDDDD 24 | 1_____DD_____________1------DDD1DDDDDDDD 25 | 1_DDDDDDD______5DDDD_1------DDD1DDDDDDDD 26 | 1_D0000000000000DDDD_I1111111111DDDDDDDD 27 | 1_000000000000000DDD_IDDD191DD1DDDDDDDDD 28 | 1_DD0000000000000DDD_ID1D1D1DD1DDDDDDDDD 29 | 1_D000000000000000DD_ID1D1D1TDADDDDDDDDD 30 | 1_0DDDDDDD____00000D_ID1D1D1TD1DDDDDDDDD 31 | 1_DDD0DDDD_ZS_000000_ID1D1D1TD1DDDDDDDDD 32 | 1_00DDDDDD_SZ_000000_ID1D1#1TD1DDDDDDDDD 33 | #_DDDDDDDD____D0000D_I9111TTTD1DDDDDDDDD 34 | #_D00DD00000DDD000DD_I1111#1111DDDDDDDDD 35 | 1_4D0000000DD0000DDD_1---------DDDDDDDDD 36 | 1____________________1---------DDDDDDDDD 37 | 1111111111111111111111111111111111111111 38 | DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD 39 | DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD 40 | DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD 41 | -------------------------------------------------------------------------------- /DungeonsOfNoudar486/res/map1.txt: -------------------------------------------------------------------------------- 1 | 0000000000000000011PPPP10000000000000000 2 | 1111111111111111111P9=-11111111111111111 3 | RRRRRRRRRRRRRRRRRRRR#1111111111111111111 4 | R0000000000000000001O1AOOOOOOOOOOOOOOO\1 5 | R1RRRRRRRRRRRRRRRRRR#1AOOOOOOOOOOOOOOOO1 6 | R1R11111111111111111~11111\OOOOO6OOOOOO1 7 | R1T@/OOOOOOOOOOO1OOOOOOOOO1OOOOOOOOOOOO1 8 | R1O1OO5OOOO6OOOO1OOOOOOOOO~OOLLLLLLLLLL1 9 | R1OOOOOOOOOOOOOO~OOODDDOOO11111A11111111 10 | R1OOOOOOLKOOKLOO1OOODDDOOO1_000000001#11 11 | RRR11111111111111OOODDDOOO\1000000000001 12 | RT@/OOOOOOOOOOOO1OOODDDOOOO#000000000001 13 | RO1OOO6OOOO6OOOO1OOODDDOOO/1000000000001 14 | ROOOOOOOOOOOOOOO1OOODDDOOO1_000000000001 15 | ROOOOOOOOOOOOOOO~OOOOOOOOO11111A10000001 16 | ROOOOOOOLKOOKLOO1OOOOOOOOO~OOOOO10000001 17 | R1111111111111111OOOOOOOOO1OOOOO10000001 18 | R0000000000011111111111111/OOOOO10000001 19 | R000000000001OOOOOOOOOOO1OOOOOOO10000001 20 | R000000000001OOOOOOOOOOO~OOODDOO10000001 21 | R0000000000011111111111A1\OODDOO10000001 22 | R0000000000000000000000001OODDOO10000001 23 | R000000000000000000000000AOODDOO10000001 24 | R0000000000000000000000001OODDOO10000001 25 | R1111111111111111111111A1/OODDOO10000001 26 | ROOOLKOLKOOOOOOOOOOOOOOO~OOOOOOO10000001 27 | ROOOOKOOKOOOOOOOOOOOOOO/1\OOOOO/11111111 28 | R\OOOOOOOOOOOOO6OOOOOOO111OOOOO1OOOOOOO1 29 | RR#11111111111111111111111OOOOO~OODDDOO1 30 | 1/OOOOOOO1OOOOOOOOOOOOO\1/OOOOO1OODDDOO1 31 | 1O+O+OO+O1OODDDDDDDDDOOO~OOOOOO1OOO6OKK1 32 | 1OOOOOOOO1OOOOOOOOOOOOO/1\OOOOO1OOOOLKK1 33 | 1111111111111111~11111111111111111111111 34 | 1000888888888000____________|00000000000 35 | 100888888888880088888880000_|00000000000 36 | 111111111111110884___080000_|00000000000 37 | 000000000000010081_1________|00000000000 38 | 000000000000011111#111111111100000000000 39 | II000000000000000___00000000000000000000 40 | II0000000000000OOOOOO0000000000000000000 41 | -------------------------------------------------------------------------------- /DungeonsOfNoudar486/res/map2.txt: -------------------------------------------------------------------------------- 1 | 1111111=1111111999999999999RRRRRRRRRRRRR 2 | 1/===\1#1/==\11111111111P##R11111111111R 3 | 1============111111111111==111111111111R 4 | 1==/\====/\==1111111RRRRR##RRRRRRRRRRR=R 5 | 1==\/====\/==1=1=5==#===========#5===R=R 6 | 1=====KK=====1==5===#=/\=4==/\==#=5==R=R 7 | 1==/\====/\==1=1=5==#=\/====\/==#=5==R=R 8 | 1==\/====\/==1=11111#===========#1111R=R 9 | 1===========/1=1=5==#====6======#==5=R=R 10 | 1==11111111111=1====#===========#===5R=R 11 | 1==\/=======\1=16===#=/\====/\==#====R=R 12 | 1============1=1====#=\/====\/==#=5==R=R 13 | 1\=====/1\===1=11111#===========#1111R=R 14 | 1111==/111\=/1=1==5=#==/11Y11\==#====R=R 15 | 1111==\/==\111=1=5==#=/11/=\11\=#=55=R=R 16 | 11/\\======\11=1====#=1=======1=#====R=R 17 | 1/==\1=======1=111111=~=/1~1\=~=RRR11R=R 18 | 1====~=======1=\111111111/=\11111@RRRR1R 19 | 1====1======/1===#==========11===TR1111R 20 | 1====1\====/11=1111111111===/\==1@11111R 21 | 1====11====111==========1===\/==1111111R 22 | 1====11====\11====11111=1=5=====1111111R 23 | 1====11\=====#==5=11111=111111111111111R 24 | 1======Y\==/11====111/==1/========\1===R 25 | 1====1111==111####111==/1===/\=====1===R 26 | 1====1=====\1IOOOO111==1/===\/=====1===R 27 | 1\==/1=======OLLLLI11==~===========1===R 28 | 11##11==11\==OLLLLI11=/1===========AX==R 29 | 119911==111\=OLLLLO===1/===========1===R 30 | 11111/==\1111OLLLLI11=1============Y===R 31 | 1111/====\11OOLLLLI11=1======y=====1===R 32 | 111/======1/OLLLLLO=1=1=/\======/\=1===R 33 | 111=======1=OLLLLLO/1=1=\/======\/=1===R 34 | 111=======#=OLLLLLO\1=1============1===R 35 | 111======RR=OLLLLLO=1=1============AX==R 36 | 111======R1YOLLLLLO===1=====/\=====1===R 37 | 111======RRTOLLLLLO=161=====\/=====1===R 38 | 111\=====/R@ILLLLLI1111\==========/1111R 39 | 1111\===/1R11IIIII111111111111111111111R 40 | 1111111111RRRRRRRRRRRRRRRRRRRRRRRRRRRRRR 41 | -------------------------------------------------------------------------------- /DungeonsOfNoudar486/res/map3.txt: -------------------------------------------------------------------------------- 1 | IIII#IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII 2 | I_____IDDD000DDDDDD0000000000000DD00000I 3 | 1_000_10---0-0---DD___00---0---0DDD0000I 4 | I_00D_1000D000DDDDD___00000000DDDDDDD00I 5 | I_DDD_1___________________________0---0I 6 | #40DD_~___________________________00000I 7 | I_00D_1___________________________0---0I 8 | I_000_100IIIIIIAAI0__000000000____00000I 9 | 1_____100I9I1UOOOO-__0-0-0-0-0____0---0I 10 | 111111100I9=LUOOOO-__0-0-0-0-0____00000I 11 | 100DDD005IIIIIIAAI0__0-0-0-0-0____0---0I 12 | 100DDDD000000000000__111111111____00000I 13 | 10-0______________________________0---0I 14 | 10-0______________________________00000I 15 | 10-0______________________________0---0I 16 | 1000____100000000000000000000000000DDD0I 17 | 10-0____1---00-0-00-0-0-001I1I1I1I06DDDI 18 | 10-0____10D000-0-00-0-0-00I=X99991000DDI 19 | 10-0____1---00-0-00-0-0-001#1I1I1I00DDDI 20 | 1000____1000000000000000000_000000DDD00I 21 | 10-0______________________________00000I 22 | 10-0______________________________0---0I 23 | 10-00000__________________________00000I 24 | 11111110________A_________________0---0I 25 | %VVVVV100DDD00IIAIIIIIIII__0000000000DDI 26 | %VVVVV100DDDD0I====PPPPPI__000000000DDDI 27 | %VVVVV1000DDD0I====P9HHHI__0050000DDDDDI 28 | VVVVVV100500D0I====P9PPPY__000000000DDDI 29 | VVVVVV10DD0000I====1=1==#__00000000600DI 30 | VVVVVV100D0000I=T1J=====R__000000000000I 31 | %VVVVV1KKKKKKKIXRRRRRRRRRKKKKKKKKKKKKKKI 32 | %\VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV% 33 | %/VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV% 34 | %VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV% 35 | %VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV% 36 | %VVVVVVVVVVVVVVVVVSZVVVVVVVVVVVVVVVVVVV% 37 | %VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV% 38 | %\VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV% 39 | %/VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV% 40 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 41 | -------------------------------------------------------------------------------- /DungeonsOfNoudar486/res/map4.txt: -------------------------------------------------------------------------------- 1 | 1111111Y1111111111111111111RRRRRRRRRRRRR 2 | 1/==========\11P=P1111111##R11111111111R 3 | 1=====KK======c9=P1111111==111111111111R 4 | 1==/\====/\==/111111RRRRR##RRRRRRRRRRR=R 5 | 1==\/====\/==1=1====#===========#====R=R 6 | 1=====KK=====1======#=/\====/\==#====R=R 7 | 1==/\====/\==1=1====#=\/====\/==#====R=R 8 | 1==\/====\/==1=11111#===========#1111R=R 9 | 1===========/1=1====#===========#====R=R 10 | R##11111111111=1====#===========#====R=R 11 | R==\/=======\1=1====#=/\====/\==#====R=R 12 | R==========6K1=1====#=\/====\/==#====R=R 13 | R\==w==/1\==K1=11111#===========#1111R=R 14 | R111==/1Y1\=/1=1====#==/11#11\==#====R=R 15 | R111==\/==\111=1====#=/11/=\11\=#====R=R 16 | R1/\\======\11=1====#=1=======1=#====R=R 17 | R/==\1=======1=111111=~=/1~1\=~=R1111R=R 18 | R====~=====w=1=\111111111/=\111RRRRRRR1R 19 | R====1======/1===#==========11=T1111111R 20 | R====1\====/11=1111111111===/\==1111111R 21 | R====11====111==========1===\/==1111111R 22 | R====11====\11====11111=1=======1111111R 23 | R====11\=====#====11111=111111111111111R 24 | R=====K1\==/11====111/==1/========\1===R 25 | R====1111w=111####111==/1===/\=====1===R 26 | R====1=====\1IOOOO#====1/===\/=====1===R 27 | R\4=/1=======OLLLLI11==~===========1===R 28 | R1#1RRHH11\==OLLLLI11=/1===========1===R 29 | R===R1==111\=OLLLLO===1/===========1===R 30 | RRRRR/==\1111OLLLLI11=1============1===R 31 | R111/====\11OOLLLLI11=1======y=====1===R 32 | R11/======1/OLLLLLO=1=1=/\======/\=1===R 33 | R11=======1=OLLLLLO/1=1=\/======\/=1===R 34 | R11===w===~=OLLLLLO\1=1============1===R 35 | R@/=======1=OLLLLLO=1=1============1===R 36 | RT========1YOLLLLLO===1=====/\=====1===R 37 | R@\=======R=OLLLLLO=1=1=====\/=====1===R 38 | 111Y===w=/R@ILLLLLI1111\==========/1111R 39 | 11=#====/1R11IIIII111111111111111111111R 40 | 11=1111111RRRRRRRRRRRRRRRRRRRRRRRRRRRRRR 41 | -------------------------------------------------------------------------------- /DungeonsOfNoudar486/res/map5.txt: -------------------------------------------------------------------------------- 1 | LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL 2 | LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL 3 | LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL 4 | LLLLLLLLLLLLLLLLLLLLLLVVVVVVVVVVVVVVVVVV 5 | LLLLLLLLLLLLLLLLLLLLVVVVVVVVVVVVVVVVVVVV 6 | LLLLLLLLLLLLLLLLLLLVVVVVVVVVVVVVVVVVVVVV 7 | LLLLLLLLLLLLLLLLLLVVVIIIIAIIIIVVVVVVVVVV 8 | LLLLLLLLLLLLLLLLLLVVVI/=====\IVVVVVVVVKK 9 | LLLLLLLLLLLLLLLLLVVVVIK=*****IIIIIIIIIIK 10 | LLLLLLLLLLLVVVVVVVVVVYKv*****!*******!=K 11 | LLLLLLLLLVVVVVVVVVVVVIK=*****IIIIII#II!K 12 | LLLLLLLVVVVVVVVVVVVRRR\=====/IVVI****#=L 13 | LLLLVVVVVVVVVVVVVVVR@TIIIAIIIIVVIK***#=L 14 | VVVVVVVVVVVVVVVVVVVRRVVVVVVVVVVVIK***#=L 15 | RRRRRRRRRRRRRRRRRRRRRAIIIIVVVVVVIK***#=L 16 | R==================\Y====IVVVVVVIK***#=L 17 | R-----=============-~-===IVVVVVVI****#=L 18 | R#1~1111111111111111111111111A11111#11=K 19 | R-1-1===================------*******1!K 20 | R=1=1===================------*******!=K 21 | R=1=1=1RRRRRRRRRRRRRRRRRRRR#RRRRRRRRRRRR 22 | R=1=1=1TAAAAAAAAAAAAAAAAAA---Y1111111DDD 23 | R=1=1=1111111YY1111111111114-#===1DDDDDD 24 | R=1=1=1-1-*********1OOOO1@R11111=1DDRDDD 25 | R=1=1=1-#--*******-~OOOOAT@111D1=1DDRDDD 26 | R=1=1=1-#O-*******-~OOOO1RRR11DRRRRRRDDD 27 | R=1=1=1=1OOOO88OOOO1OOOOORRR11DRDDDDDDDD 28 | R=1=1=1=1OKKK88KKKO1OOOOOOOR11DRDDDDDDDD 29 | R=1=1=1=1OOOO88OOOO1OOOOOOOR11DRDDDDDDDD 30 | R=1=1=1=1OKKK88KKKO1OOOOOOOR11RRD1OODDDD 31 | R=1=1=1=1OOOO88OOOO1OOOOOOORDDDD_~OODDDD 32 | R=1=1=1=1OKKK88KKKO1OOOOOOOR=DDD_1OODDDD 33 | R=1=1=1=1OOOO88OOOO1OOOOOOOR=DDD_1DDDDDD 34 | R=1=1=Y=1OKKK88KKKO11111111R=DDD_1DDDDDD 35 | 1=I=3***IOOOO88OOOOIDDDDDDDRDDDD_1DDDDDD 36 | R#IA1***AOKKK88KKKOIDDDDDDDRDDDD_1DDDDDD 37 | R==91/\=IOOOO88OOOOIDDDDDDDRDDDD_1DDDDDD 38 | RRR#RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRDDDDDD 39 | IVV9VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV 40 | IVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV 41 | -------------------------------------------------------------------------------- /DungeonsOfNoudar486/res/map6.txt: -------------------------------------------------------------------------------- 1 | 1111111111111111111111111111111111111111 2 | 1======================================= 3 | 1=11111111111111111111111111111111111111 4 | 1=1-----------------------------------D1 5 | 1=1-111111111111111111111111111111111111 6 | 1=1-1=AAAAAAAAAAAAAAAAAA-1-1DDDDDDDDDDDD 7 | 1=1-1=11111YY1111111111111-1DDDDDDDDDDDD 8 | 1=1-1=1**********1OOOOO1@1-1DDDDDDDDDDDD 9 | 1=1-1=#O*********#OOOOOAO@-1DDDDDDDDDDDD 10 | 1=1-1=#O*********#OOOOO111-1DDDDDDDDDDDD 11 | 1=1-1=1OOOO88OOOO1OOOOOY11-1DDDDDDDDDDDD 12 | 1=1-1=1OKKK88KKKO1OOOOOOO1=1DDDDDDDDDDDD 13 | 1=1-1=1OOOO88OOOO1OOOOOOO#=1DDDDDDDDDDDD 14 | 1=1-1=1OKKK88KKKO1OOOOOOO111DDD1OOO1DDDD 15 | 1=1-1=1OOOO88OOOO1OOOOOOO1DDDD_~OOO1DDDD 16 | 1=1-1=1OKKK88KKKO1OOOOOOO1=DDD_1OOO1DDDD 17 | 1=1-1-1OOOO88OOOO1OOOOOOO~1DDD_1DDDDDDDD 18 | 1=1-Y-1OKKK88KKKO111111111=DDD_1DDDDDDDD 19 | 1=_***IOOOO88OOOOIDDDDDDDDDDDD_1DDDDDDDD 20 | 1=I***AOKKK88KKKOIDDDDDDDDDDDD_1DDDDDDDD 21 | 1=I-\=IOOOO88OOOOIDDDDDDDDDDDD_1DDDDDDDD 22 | 1#IDDII1111~~1111IDDI1111111DDDDDDDDDDDD 23 | 1__\/____(1~~1)___\/_1------DDDDDDDDDDDD 24 | 1_____DD_____________1------DDDDDDDDDDDD 25 | 1_4DDDDDD______DDDDD_1------DDDDDDDDDDDD 26 | 1_DDDDDDDDDDDDDDDDDD_I111111111DDDDDDDDD 27 | 1_DDDDDDDDDDDDDDDDDD_IDDD1D1DD1DDDDDDDDD 28 | 1_DDDDDDDDDDDDDDDDDD_ID1D1D1DD1DDDDDDDDD 29 | 1_DDDDDDDDDDDDDDDDDD_ID1D1D1=DADDDDDDDDD 30 | 1_DDDDDDDD____DDDDDD_ID1D1D1=D1DDDDDDDDD 31 | 1_DDDDDDDD_ZS_DDDDDD_ID1D1D1=D1DDDDDDDDD 32 | 1_DDDDDDDD_SZ_DDDDDD_ID1D1#1=D1DDDDDDDDD 33 | #_DDDDDDDD____DDDDDD_ID111===D1DDDDDDDDD 34 | #_DDDDDDDDDDDDDDDDDD_I1111#1111DDDDDDDDD 35 | 1_DDDDDDDDeDDDDDDDDD_1---------DDDDDDDDD 36 | 1____________________1---------DDDDDDDDD 37 | 1111111111111111111111111111111111111111 38 | DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD 39 | DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD 40 | DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD 41 | -------------------------------------------------------------------------------- /DungeonsOfNoudar486/res/map7.txt: -------------------------------------------------------------------------------- 1 | 1111111111111111111111111111111111111111 2 | 1======================================= 3 | 1=11111111111111111111111111111111111111 4 | 1=1-----------------------------------D1 5 | 1=1-111111111111111111111111111111111111 6 | 1=1-1=AAAAAAAAAAAAAAAAAA-1-1DDDDDDDDDDDD 7 | 1=1-1=11111YY11111111111-1-1DDDDDDDDDDDD 8 | 1=1-1=1**********1OOOOO1---1DDDDDDDDDDDD 9 | 1=1-1=#O*********#OOOOO1---1DDDDDDDDDDDD 10 | 1=1-1=#O*********#OOOOO111-1DDDDDDDDDDDD 11 | 1=1-1=1OOOO88OOOO1OOOOOOO1-1DDDDDDDDDDDD 12 | 1=1-1=1OKKK88KKKO1OOOOOOO1=1DDDDDDDDDDDD 13 | 1=1-1=1OOOO88OOOO1OOOOOOO#=1DDDDDDDDDDDD 14 | 1=1-1=1OKKK88KKKO1OOOOOOO111DDD1OOO1DDDD 15 | 1=1-1=1OOOO88OOOO1OOOOOOO1DDDD_~OOO1DDDD 16 | 1=1-1=1OKKK88KKKO1OOOOOOO1=DDD_1OOO1DDDD 17 | 1=1-1-1OOOO88OOOO1OOOOOOO~1DDD_1DDDDDDDD 18 | 1=1-Y-1OKKK88KKKO111111111=DDD_1DDDDDDDD 19 | 1=_***IOOOO88OOOOIDDDDDDDDDDDD_1DDDDDDDD 20 | 1=I***AOKKK88KKKOIDDDDDDDDDDDD_1DDDDDDDD 21 | 1=I-\=IOOOO88OOOOIDDDDDDDDDDDD_1DDDDDDDD 22 | 1#IDDII1111~~1111IDDI1111111DDDDDDDDDDDD 23 | 1__\/____(1~~1)___\/_1------DDDDDDDDDDDD 24 | 1_____DD__________K__1------DDDDDDDDDDDD 25 | 1_4vy*************Ke_1------DDDDDDDDDDDD 26 | 1_****************KKKI111111111DDDDDDDDD 27 | 1_DDDDDDDDDDDDDDDDDD_IDDD1D1DD1DDDDDDDDD 28 | 1_DDDDDDDDDDDDDDDDDD_ID1D1D1DD1DDDDDDDDD 29 | 1_DDDDDDDDDDDDDDDDDD_ID1D1D1=DADDDDDDDDD 30 | 1_DDDDDDDD____DDDDDD_ID1D1D1=D1DDDDDDDDD 31 | 1_DDDDDDDD_ZS_DDDDDD_ID1D1D1=D1DDDDDDDDD 32 | 1_DDDDDDDD_SZ_DDDDDD_ID1D1#1=D1DDDDDDDDD 33 | #_DDDDDDDD____DDDDDD_ID111===D1DDDDDDDDD 34 | #_DDDDDDDDDDDDDDDDDD_I1111#1111DDDDDDDDD 35 | 1_DDDDDDDDDDDDDDDDDD_1---------DDDDDDDDD 36 | 1____________________1---------DDDDDDDDD 37 | 1111111111111111111111111111111111111111 38 | DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD 39 | DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD 40 | DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD 41 | -------------------------------------------------------------------------------- /DungeonsOfNoudarNDK/app/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("com.android.application") 3 | id("org.jetbrains.kotlin.android") 4 | } 5 | 6 | android { 7 | namespace = "pt.b13h.noudar" 8 | compileSdk = 36 9 | 10 | defaultConfig { 11 | applicationId = "pt.b13h.noudar" 12 | minSdk = 22 13 | targetSdk = 36 14 | versionCode = 8 15 | versionName = "1.1" 16 | 17 | testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" 18 | 19 | externalNativeBuild { 20 | cmake { 21 | arguments += listOf("-DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=ON") 22 | } 23 | } 24 | } 25 | 26 | buildTypes { 27 | release { 28 | isMinifyEnabled = false 29 | proguardFiles( 30 | getDefaultProguardFile("proguard-android-optimize.txt"), 31 | "proguard-rules.pro" 32 | ) 33 | } 34 | } 35 | compileOptions { 36 | sourceCompatibility = JavaVersion.VERSION_1_8 37 | targetCompatibility = JavaVersion.VERSION_1_8 38 | } 39 | kotlinOptions { 40 | jvmTarget = "1.8" 41 | } 42 | externalNativeBuild { 43 | cmake { 44 | path = file("src/main/cpp/CMakeLists.txt") 45 | version = "3.22.1" 46 | } 47 | } 48 | } 49 | 50 | dependencies { 51 | 52 | implementation("androidx.core:core-ktx:1.16.0") 53 | implementation("androidx.appcompat:appcompat:1.7.0") 54 | implementation("com.google.android.material:material:1.12.0") 55 | implementation("androidx.constraintlayout:constraintlayout:2.2.1") 56 | testImplementation("junit:junit:4.13.2") 57 | androidTestImplementation("androidx.test.ext:junit:1.2.1") 58 | androidTestImplementation("androidx.test.espresso:espresso-core:3.6.1") 59 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /Xcode8Project/DerivedData 2 | /DungeonsOfNoudarX11/.idea/.name 3 | /DungeonsOfNoudarX11/cmake-build-debug 4 | /DungeonsOfNoudar-NDK/.idea 5 | /DungeonsOfNoudarSDL/noudar 6 | /DungeonsOfNoudarX11/noudar 7 | /DungeonsOfNoudarX11/noudar.html 8 | /DungeonsOfNoudar-NDK/.idea 9 | /DungeonsOfNoudar-NDK/DungeonsOfNoudar-NDK.iml 10 | /DungeonsOfNoudar-NDK/app/app.iml 11 | /DungeonsOfNoudar-NDK/audio/audio.iml 12 | /DungeonsOfNoudar-NDK/base/base.iml 13 | /DungeonsOfNoudar-NDK/common/common.iml 14 | /DungeonsOfNoudarX11/.idea 15 | /DungeonsOfNoudarX11/noudar.data 16 | /DungeonsOfNoudarX11/noudar.html.mem 17 | /DungeonsOfNoudarX11/noudar.js 18 | # Compiled Object files 19 | *.slo 20 | *.lo 21 | *.o 22 | *.obj 23 | 24 | # Precompiled Headers 25 | *.gch 26 | *.pch 27 | 28 | # Compiled Dynamic libraries 29 | *.so 30 | *.dylib 31 | *.dll 32 | 33 | # Fortran module files 34 | *.mod 35 | *.smod 36 | 37 | # Compiled Static libraries 38 | *.lai 39 | *.la 40 | *.a 41 | *.lib 42 | 43 | # Executables 44 | *.exe 45 | *.out 46 | *.app 47 | 48 | # Built application files 49 | *.apk 50 | *.ap_ 51 | 52 | # Files for the Dalvik VM 53 | *.dex 54 | 55 | # Java class files 56 | *.class 57 | 58 | # Generated files 59 | bin/ 60 | gen/ 61 | 62 | # Gradle files 63 | .gradle/ 64 | build/ 65 | /*/build/ 66 | 67 | # Local configuration file (sdk path, etc) 68 | local.properties 69 | 70 | # Proguard folder generated by Eclipse 71 | proguard/ 72 | 73 | # Log Files 74 | *.log 75 | DungeonsOfNoudar-NDK/.idea 76 | DungeonsOfNoudar-NDK/app/.externalNativeBuild 77 | DungeonsOfNoudar486/data.pfs 78 | DungeonsOfNoudar486/packer 79 | DungeonsOfNoudar486/.idea/DungeonsOfNoudar486.iml 80 | DungeonsOfNoudar486/cmake-build-debug 81 | DungeonsOfNoudar-NDK/app/.cxx 82 | DungeonsOfNoudar486/.idea 83 | DungeonsOfNoudarNDK-GLES/.idea 84 | DungeonsOfNoudarNDK-GLES/app/.cxx 85 | UserInterfaceState.xcuserstate 86 | DungeonsOfNoudarNDK/app/.cxx 87 | DungeonsOfNoudarNDK/.idea 88 | DungeonsOfNoudarNDK/app/release 89 | -------------------------------------------------------------------------------- /noudar-rendering/LoadPNG.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by monty on 06/10/16. 3 | // 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | using std::vector; 12 | using std::array; 13 | 14 | #include "IFileLoaderDelegate.h" 15 | #include "NativeBitmap.h" 16 | #include "LoadPNG.h" 17 | 18 | #define STB_IMAGE_IMPLEMENTATION 19 | 20 | #include "stb_image.h" 21 | 22 | std::shared_ptr 23 | loadPNG(const std::string filename, std::shared_ptr fileLoader) { 24 | 25 | 26 | auto buffer = fileLoader->loadBinaryFileFromPath(filename); 27 | auto bufferSize = fileLoader->sizeOfFile(filename); 28 | int xSize; 29 | int ySize; 30 | int components; 31 | #if defined(TARGET_IOS) 32 | stbi_convert_iphone_png_to_rgb(1); 33 | #endif 34 | 35 | auto image = stbi_load_from_memory((const stbi_uc *) buffer, bufferSize, &xSize, &ySize, 36 | &components, 0); 37 | auto rawData = new int[xSize * ySize]; 38 | std::memcpy(rawData, image, xSize * ySize * 4); 39 | stbi_image_free(image); 40 | 41 | #if defined(OSMESA) || defined(VGA) 42 | for ( int c = 0; c < xSize * ySize; ++c ) { 43 | int origin = rawData[ c ]; 44 | 45 | int r = (origin & 0xFF000000) >> 24; 46 | int g = (origin & 0x00FF0000) >> 16; 47 | int b = (origin & 0x0000FF00) >> 8; 48 | int a = (origin & 0x000000FF); 49 | 50 | int r20 = (( r / 21 ) * 21 ); 51 | int g20 = (( g / 21 ) * 21 ); 52 | int b20 = (( b / 21) * 21 ); 53 | 54 | int pixel = a; 55 | pixel += ( r20 << 24 ); 56 | pixel += ( g20 << 16 ); 57 | pixel += ( b20 << 8 ); 58 | 59 | rawData[ c ] = pixel; 60 | } 61 | #endif 62 | 63 | delete[] buffer; 64 | buffer = nullptr; 65 | 66 | return std::make_shared(filename, xSize, ySize, rawData); 67 | } 68 | -------------------------------------------------------------------------------- /noudar-rendering/GameNativeAPI.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by monty on 27/09/16. 3 | // 4 | 5 | #ifndef DUNGEONSOFNOUDAR_NDK_GAMENATIVEAPI_H 6 | #define DUNGEONSOFNOUDAR_NDK_GAMENATIVEAPI_H 7 | 8 | bool setupGraphics(int w, int h, std::string vertexShader, std::string fragmentShader, 9 | std::shared_ptr fileLoader); 10 | 11 | void renderFrame(long delta); 12 | 13 | void shutdown(); 14 | 15 | void updateAnimations(long delta); 16 | 17 | void addCharacterMovement(int id, glm::vec2 previousPosition, glm::vec2 newPosition); 18 | 19 | void setSnapshot(const odb::NoudarDungeonSnapshot &snapshot); 20 | 21 | void startFadingIn(); 22 | 23 | void startFadingOut(); 24 | 25 | bool isAnimating(); 26 | 27 | void rotateCameraLeft(); 28 | 29 | void rotateCameraRight(); 30 | 31 | void setEyeViewMatrix(float *eyeView); 32 | 33 | void setPerspectiveMatrix(float *perspectiveMatrix); 34 | 35 | void setAngleXZ(float XZAngle); 36 | 37 | void setAngleYZ(float YZAngle); 38 | 39 | void loadMapData(std::string geoFile, std::string petFile); 40 | 41 | void readMap(std::shared_ptr fileLoaderDelegate); 42 | 43 | void moveUp(); 44 | 45 | void moveDown(); 46 | 47 | void moveLeft(); 48 | 49 | void moveRight(); 50 | 51 | void pickupItem(); 52 | 53 | void cycleNextItem(); 54 | 55 | void cyclePrevItem(); 56 | 57 | void gameLoopTick(long ms); 58 | 59 | void setSoundEmitters(vector> emitters, 60 | std::shared_ptr listener); 61 | 62 | void forceDirection(int direction); 63 | 64 | void interact(); 65 | 66 | bool isThereAnyObjectInFrontOfYou(); 67 | 68 | std::string getCurrentObjectName(); 69 | 70 | int getHP(); 71 | 72 | void shouldDrawHUD(bool drawHUD); 73 | 74 | void performVisibilityChecks(bool visibilityCheck); 75 | 76 | Knights::EDirection getCurrentDirection(); 77 | 78 | bool isPlaying(); 79 | 80 | int getLevel(); 81 | 82 | #endif //DUNGEONSOFNOUDAR_NDK_GAMENATIVEAPI_H 83 | -------------------------------------------------------------------------------- /DungeonsOfNoudar486/OPL2LPT/timer.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #define LOCK_VARIABLE(x) _go32_dpmi_lock_data((void *)&x,(long)sizeof(x)); 10 | #define LOCK_FUNCTION(x) _go32_dpmi_lock_code(x,(long)sizeof(x)); 11 | 12 | #define TIMER 0x8 13 | 14 | _go32_dpmi_seginfo OldISR, NewISR; 15 | 16 | 17 | #include 18 | #include 19 | 20 | 21 | static volatile unsigned int timer_ticks; 22 | static unsigned int timer_counter; 23 | static unsigned int timer_sum; 24 | 25 | void timer_handler() { 26 | auto old_sum = timer_sum; 27 | 28 | ++timer_ticks; 29 | 30 | timer_sum += timer_counter; 31 | 32 | 33 | if (timer_sum < old_sum) { 34 | _go32_dpmi_chain_protected_mode_interrupt_vector(TIMER,&OldISR); 35 | } else { 36 | outp(0x20, 0x20); 37 | } 38 | } 39 | 40 | void timer_reset(unsigned short frequency) { 41 | timer_ticks = 0; 42 | timer_counter = 0x1234DD / frequency; 43 | timer_sum = 0; 44 | } 45 | 46 | void timer_setup(unsigned short frequency) { 47 | timer_reset(frequency); 48 | 49 | LOCK_FUNCTION(timer_handler); 50 | LOCK_VARIABLE(timer_ticks); 51 | 52 | _go32_dpmi_get_protected_mode_interrupt_vector(TIMER, &OldISR); 53 | NewISR.pm_offset = (int) timer_handler; 54 | NewISR.pm_selector = _go32_my_cs(); 55 | _go32_dpmi_chain_protected_mode_interrupt_vector(TIMER, &NewISR); 56 | 57 | disable(); 58 | outp(0x43, 0x34); 59 | outp(0x40, timer_counter & 256); 60 | outp(0x40, timer_counter >> 8); 61 | enable(); 62 | } 63 | 64 | void timer_shutdown() { 65 | disable(); 66 | outp(0x43, 0x34); 67 | outp(0x40, 0); 68 | outp(0x40, 0); 69 | enable(); 70 | 71 | _go32_dpmi_set_protected_mode_interrupt_vector(TIMER, &OldISR); 72 | } 73 | 74 | auto timer_get() { 75 | disable(); 76 | auto result = timer_ticks; 77 | enable(); 78 | return result; 79 | } 80 | -------------------------------------------------------------------------------- /DungeonsOfNoudar486/include/MapWithCharKey.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by monty on 07-03-2018. 3 | // 4 | #pragma once 5 | 6 | // std 7 | #include // int types (uint8_t...) 8 | 9 | namespace odb { 10 | 11 | template 12 | class MapWithCharKey 13 | { 14 | //------------------------------------------------------------------------// 15 | // iVars // 16 | //------------------------------------------------------------------------// 17 | private: 18 | T mMap [256]; // @todo(stdmatt): Remove magic values... 19 | bool mPresent[256]; // @todo(stdmatt): Remove magic values... 20 | 21 | //------------------------------------------------------------------------// 22 | // CTOR / DTOR // 23 | //------------------------------------------------------------------------// 24 | public: 25 | MapWithCharKey() { 26 | // @improve(stdmatt): We can do a memset here! 27 | for (uint8_t c = 0; c < 255; ++c) { 28 | mPresent[c] = false; 29 | } 30 | } 31 | 32 | //------------------------------------------------------------------------// 33 | // Public Methods // 34 | //------------------------------------------------------------------------// 35 | public: 36 | bool present(const uint8_t key) const { 37 | return mPresent[key]; 38 | } 39 | 40 | const T& get(const uint8_t key) const { 41 | return mMap[key]; 42 | } 43 | 44 | void set(const uint8_t key, const T &value) { 45 | mMap [key] = value; 46 | mPresent[key] = true; 47 | } 48 | 49 | void remove(const uint8_t key) { 50 | mPresent[key] = false; 51 | } 52 | 53 | void clear() { 54 | // @improve(stdmatt): We can do a memset here! 55 | for (uint8_t c = 0; c < 255; ++c) { 56 | mPresent[c] = false; 57 | } 58 | } 59 | 60 | }; // class MapWithCharKey 61 | } // namespace odb 62 | -------------------------------------------------------------------------------- /noudar-rendering/RenderingJobSnapshotAdapter.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by monty on 07/02/17. 3 | // 4 | 5 | #ifndef DUNGEONSOFNOUDAR_NDK_RENDERINGJOBSNAPSHOTADAPTER_H 6 | #define DUNGEONSOFNOUDAR_NDK_RENDERINGJOBSNAPSHOTADAPTER_H 7 | 8 | namespace odb { 9 | const static bool kFogEnabled = false; 10 | const static VBORegisterId mNullVBO = "null"; 11 | const static TextureName mNullTexture = "null"; 12 | 13 | static const long kAnimationLength = 500; 14 | 15 | const static TextureName mSkyBoxTextureName = "sky"; 16 | const static int kSkyTextureLength = 400; 17 | using Shade = float; 18 | 19 | using TextureId = uint8_t; 20 | 21 | class RenderingJobSnapshotAdapter { 22 | 23 | static glm::mat4 getSkyTransform(long offset); 24 | 25 | static glm::mat4 getFloorTransform(glm::vec3 translation); 26 | 27 | static glm::mat4 getCornerLeftFarTransform(glm::vec3 translation); 28 | 29 | static glm::mat4 getCornerLeftNearTransform(glm::vec3 translation); 30 | 31 | static glm::mat4 getCubeTransform(glm::vec3 translation, float scale); 32 | 33 | static glm::mat4 getBillboardTransform(const Camera &camera, glm::vec3 translation); 34 | 35 | public: 36 | static void 37 | readSnapshot(const NoudarDungeonSnapshot &snapshot, 38 | std::unordered_map> &batches, 39 | const CTilePropertyMap &tileProperties, 40 | const std::unordered_map &VBORegisters, 41 | const std::unordered_map &textureRegistry, 42 | const Camera &camera, 43 | const std::unordered_map &elementMap 44 | ); 45 | 46 | static glm::vec2 47 | easingAnimationCurveStep(glm::vec2 prevPosition, glm::vec2 destPosition, long animationTime, 48 | long timestamp 49 | ); 50 | 51 | static int visibility; 52 | 53 | }; 54 | } 55 | 56 | #endif //DUNGEONSOFNOUDAR_NDK_RENDERINGJOBSNAPSHOTADAPTER_H 57 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Dungeons of Noudar 2 | A first person 2.5D dungeon-crawler for (MS/Free)DOS for *Protected-Mode*, written in C++14(ish), fixed point math and test coverage (for its core). As the 1990s tradition dictates! 3 | 4 | Sound options include: 5 | 6 | * Adlib 7 | * PC-Speaker 8 | * OPL2LPT 9 | 10 | ![ ](screenshot1.png?raw=true) 11 | ![ ](screenshot2.png?raw=true) 12 | 13 | ## Cloning 14 | 15 | Make sure to clone recursively, with all submodules: 16 | 17 | ``` 18 | git clone --recursive https://github.com/TheFakeMontyOnTheRun/dungeons-of-noudar 19 | ``` 20 | 21 | Check your favorite Git book for more info. 22 | 23 | ## Building 24 | 25 | Building the game requires a modern version of DJGPP. It was originally written using https://github.com/andrewwutw/build-djgpp, but later changed to use https://github.com/jwt27/build-gcc. It is known to build from either Linux and Mac just fine. ARM Linux also works well, but I could not test on Apple Silicon yet. 26 | 27 | From inside `DungeonsOfNoudar486`, run: 28 | 29 | ``` 30 | make 31 | ``` 32 | 33 | This will build both the DOS executable and the data package. If you want just the data package, run: 34 | 35 | ``` 36 | make data 37 | ``` 38 | 39 | There is also an internal SDL2 version, meant for testing and development, available thru *CMake* or `Makefile.SDL`. This version will *NOT* assemble the data package. Build the DOS version first! 40 | 41 | ## System Requirements 42 | 43 | The game has been successfully tested on a 486 SX-33Mhz, with 8MB RAM. There are reports of it running on a 386, but I can't guarantee it's smooth enough. 44 | 45 | ## Core (Curses version) 46 | 47 | The core stil is a valid text-mode dungeon crawler with almost the same geometry and rules as this version. In fact, when I was developing that one, I was already preparing the levels to be 3D (hence the somewhat gratuitous tiles variety). Go to `noudar-core` for building it. 48 | 49 | The core also contains more detailed game design docs. 50 | 51 | ## Other versions 52 | 53 | This game began its life as an Android VR game (Cardboard) and for a while it run just file like that. Eventually, the allure of building something for REAL DOS got me and those versions fell on the wayside. You can still build those from the ***V2*** branch. 54 | 55 | That branch also contains ports for other platforms, like iOS, OSX, LibRetro (as a core) and a botched Win32 version. Historically, there was also a OpenGL (software rendered) version for DOS, but it required too much CPU power and didn't look that pretty. 56 | 57 | 58 | -------------------------------------------------------------------------------- /DungeonsOfNoudarNDK/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | 53 | :win9xME_args 54 | @rem Slurp the command line arguments. 55 | set CMD_LINE_ARGS= 56 | set _SKIP=2 57 | 58 | :win9xME_args_slurp 59 | if "x%~1" == "x" goto execute 60 | 61 | set CMD_LINE_ARGS=%* 62 | 63 | :execute 64 | @rem Setup the command line 65 | 66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 67 | 68 | @rem Execute Gradle 69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 70 | 71 | :end 72 | @rem End local scope for the variables with windows NT shell 73 | if "%ERRORLEVEL%"=="0" goto mainEnd 74 | 75 | :fail 76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 77 | rem the _cmd.exe /c_ return code! 78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 79 | exit /b 1 80 | 81 | :mainEnd 82 | if "%OS%"=="Windows_NT" endlocal 83 | 84 | :omega 85 | -------------------------------------------------------------------------------- /DungeonsOfNoudar486/.gitignore: -------------------------------------------------------------------------------- 1 | # Prerequisites 2 | *.d 3 | 4 | # Compiled Object files 5 | *.slo 6 | *.lo 7 | *.o 8 | *.obj 9 | 10 | # Precompiled Headers 11 | *.gch 12 | *.pch 13 | 14 | # Compiled Dynamic libraries 15 | *.so 16 | *.dylib 17 | *.dll 18 | 19 | # Fortran module files 20 | *.mod 21 | *.smod 22 | 23 | # Compiled Static libraries 24 | *.lai 25 | *.la 26 | *.a 27 | *.lib 28 | 29 | # Executables 30 | *.exe 31 | *.out 32 | *.app 33 | /.idea/.name 34 | /.idea/castle-of-viana-3D.iml 35 | /.idea/misc.xml 36 | /.idea/modules.xml 37 | /.idea/vcs.xml 38 | /.idea/workspace.xml 39 | /CWSDPMI.SWP 40 | /cmake-build-debug/CMakeCache.txt 41 | /cmake-build-debug/CMakeFiles/3.8.2/CMakeCCompiler.cmake 42 | /cmake-build-debug/CMakeFiles/3.8.2/CMakeCXXCompiler.cmake 43 | /cmake-build-debug/CMakeFiles/3.8.2/CMakeDetermineCompilerABI_C.bin 44 | /cmake-build-debug/CMakeFiles/3.8.2/CMakeDetermineCompilerABI_CXX.bin 45 | /cmake-build-debug/CMakeFiles/3.8.2/CMakeSystem.cmake 46 | /cmake-build-debug/CMakeFiles/3.8.2/CompilerIdC/CMakeCCompilerId.c 47 | /cmake-build-debug/CMakeFiles/3.8.2/CompilerIdCXX/CMakeCXXCompilerId.cpp 48 | /cmake-build-debug/CMakeFiles/CMakeDirectoryInformation.cmake 49 | /cmake-build-debug/CMakeFiles/CMakeError.log 50 | /cmake-build-debug/CMakeFiles/CMakeOutput.log 51 | /cmake-build-debug/CMakeFiles/Makefile.cmake 52 | /cmake-build-debug/CMakeFiles/Makefile2 53 | /cmake-build-debug/CMakeFiles/TargetDirectories.txt 54 | /cmake-build-debug/CMakeFiles/castle_of_viana_3D.dir/CXX.includecache 55 | /cmake-build-debug/CMakeFiles/castle_of_viana_3D.dir/DependInfo.cmake 56 | /cmake-build-debug/CMakeFiles/castle_of_viana_3D.dir/build.make 57 | /cmake-build-debug/CMakeFiles/castle_of_viana_3D.dir/cmake_clean.cmake 58 | /cmake-build-debug/CMakeFiles/castle_of_viana_3D.dir/depend.internal 59 | /cmake-build-debug/CMakeFiles/castle_of_viana_3D.dir/depend.make 60 | /cmake-build-debug/CMakeFiles/castle_of_viana_3D.dir/flags.make 61 | /cmake-build-debug/CMakeFiles/castle_of_viana_3D.dir/link.txt 62 | /cmake-build-debug/CMakeFiles/castle_of_viana_3D.dir/progress.make 63 | /cmake-build-debug/CMakeFiles/clion-environment.txt 64 | /cmake-build-debug/CMakeFiles/clion-log.txt 65 | /cmake-build-debug/CMakeFiles/cmake.check_cache 66 | /cmake-build-debug/CMakeFiles/feature_tests.bin 67 | /cmake-build-debug/CMakeFiles/feature_tests.c 68 | /cmake-build-debug/CMakeFiles/feature_tests.cxx 69 | /cmake-build-debug/CMakeFiles/progress.marks 70 | /cmake-build-debug/Makefile 71 | /cmake-build-debug/castle_of_viana_3D 72 | /cmake-build-debug/castle_of_viana_3D.cbp 73 | /cmake-build-debug/cmake_install.cmake 74 | /game.data 75 | /game.html 76 | /game.js 77 | /game 78 | -------------------------------------------------------------------------------- /noudar-rendering/NoudarDungeonSnapshot.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by monty on 06/12/16. 3 | // 4 | 5 | #ifndef DUNGEONSOFNOUDAR_NDK_NOUDARDUNGEONSNAPSHOT_H 6 | #define DUNGEONSOFNOUDAR_NDK_NOUDARDUNGEONSNAPSHOT_H 7 | 8 | namespace odb { 9 | 10 | enum class EActorsSnapshotElement : uint8_t { 11 | kNothing, 12 | kHeroStanding0, 13 | kHeroStanding1, 14 | kHeroAttacking0, 15 | kHeroAttacking1, 16 | kWeakenedDemonAttacking0, 17 | kWeakenedDemonAttacking1, 18 | kWeakenedDemonStanding0, 19 | kWeakenedDemonStanding1, 20 | kStrongDemonAttacking0, 21 | kStrongDemonAttacking1, 22 | kStrongDemonStanding0, 23 | kStrongDemonStanding1, 24 | kCocoonStanding0, 25 | kCocoonStanding1, 26 | kEvilSpiritAttacking0, 27 | kEvilSpiritAttacking1, 28 | kEvilSpiritStanding0, 29 | kEvilSpiritStanding1, 30 | kWarthogAttacking0, 31 | kWarthogAttacking1, 32 | kWarthogStanding0, 33 | kWarthogStanding1, 34 | kMonkAttacking0, 35 | kMonkAttacking1, 36 | kMonkStanding0, 37 | kMonkStanding1, 38 | kFallenAttacking0, 39 | kFallenAttacking1, 40 | kFallenStanding0, 41 | kFallenStanding1, 42 | kRope, 43 | kMagicSeal 44 | }; 45 | 46 | enum class EVisibility : uint8_t { 47 | kInvisible, 48 | kVisible, 49 | }; 50 | 51 | using CCharacterId = int8_t; 52 | 53 | using IntMap = array, Knights::kMapSize>; 54 | using CharMap = array, Knights::kMapSize>; 55 | using VisMap = array, Knights::kMapSize>; 56 | using LightMap = array, Knights::kMapSize>; 57 | using AnimationList = std::map >; 58 | 59 | class NoudarDungeonSnapshot { 60 | 61 | public: 62 | odb::IntMap map; 63 | odb::VisMap mVisibilityMap; 64 | odb::CharMap snapshot; 65 | odb::IntMap splat; 66 | odb::IntMap ids; 67 | odb::LightMap mLightMap; 68 | odb::IntMap mItemMap; 69 | Knights::Vec2i mCursorPosition; 70 | int mCameraId; 71 | int mTurn; 72 | long mTimestamp; 73 | AnimationList movingCharacters; 74 | std::string mCurrentItem = ""; 75 | int mHP; 76 | Knights::Vec2i mCameraPosition; 77 | }; 78 | 79 | std::ostream &operator<<(std::ostream &os, const NoudarDungeonSnapshot &aSnapshot); 80 | 81 | std::string to_string(const NoudarDungeonSnapshot &aSnapshot); 82 | 83 | } 84 | #endif //DUNGEONSOFNOUDAR_NDK_NOUDARDUNGEONSNAPSHOT_H 85 | -------------------------------------------------------------------------------- /DungeonsOfNoudar486/res/tiles4.prp: -------------------------------------------------------------------------------- 1 | 1 0 null null null cube bricks null 2 0 0 0 2 | P 0 null null null cube magicseal null 2 0 0 0 3 | R 0 null null null cube bricks null 2 0 0 0 4 | _ 0 ceiling floor null cube floor null 0 0 2 0 5 | @ 0 bricks bricks slot cube bricks null 1 0 1 0 6 | I 0 null null null cube null bricks 0 4 0 2 7 | 0 0 ceiling floor null floor null null 0 0 2 0 8 | O 0 ceiling floor null cube bricks bricks 1 6 2 0 9 | A 1 ceiling ceiling null cube bricks bricks 2 0 2 -2 10 | L 0 ceiling lava null floor null null 0 0 2 -2 11 | * 0 null floor null cube null null 0 0 0 0 12 | 4 0 ceiling floor null cube null null 0 0 2 0 13 | % 1 null floor bricks leftnear bricks null 3 0 1 0 14 | # 1 ceilingbars floor bars cube bricks null 1 0 1 0 15 | F 1 ceilingbars floor bars cube bricks null 1 0 1 0 16 | | 0 null floor bricks leftfar bricks null 3 0 1 0 17 | \ 0 ceiling floor bricks leftfar null null 0 0 2 0 18 | / 0 ceiling floor bricks leftnear null null 0 0 2 0 19 | . 0 ceiling floor null null null null 0 0 2 0 20 | - 0 ceiling floor null cube bricks null 1 0 2 0 21 | ( 1 null floorstonefar null null null null 0 0 0 0 22 | { 1 null floorstonenear null null null null 0 0 0 0 23 | ) 1 null stonefloornear null null null null 0 0 0 0 24 | } 1 null stonefloorfar null null null null 0 0 0 0 25 | ' 0 null null bricks cube bricks null 3 0 1 0 26 | ! 0 ceilingbars floor null cube bricks null 2 0 1 0 27 | ~ 1 ceilingbars floor arch cube bricks null 1 0 1 0 28 | Y 0 null null bricks cube brickscandles null 1 0 1 0 29 | X 0 null null bricks cube bricks null 2 0 1 0 30 | B 0 ceilingbegin floor begin cube null null 2 0 1 0 31 | E 0 ceiling floor null cube bricks bricks 0 0 2 0 32 | > 0 null floor bricks leftnear bricks null 2 0 1 0 33 | < 0 null floor bricks leftfar bricks null 2 0 1 0 34 | Z 0 null floor bricks leftnear bricks null 2 0 1 0 35 | S 0 null floor bricks leftfar bricks null 2 0 1 0 36 | t 0 null floor null floor null null 0 0 0 0 37 | y 0 ceiling floor null floor null null 0 0 2 0 38 | u 0 null floor null floor null null 0 0 0 0 39 | U 0 null floor null floor null null 0 0 0 0 40 | 2 0 null floor null floor null null 0 0 0 0 41 | 7 0 null floor null floor null null 0 0 0 0 42 | v 0 null floor null floor null null 0 0 0 0 43 | + 0 ceiling floor null floor null null 0 0 0 0 44 | 9 0 ceiling floor null cube bricks bricks 0 0 2 0 45 | T 0 ceiling floor null floor bricks bricks 0 0 2 0 46 | w 0 ceiling floor null floor null null 0 0 2 0 47 | 6 0 ceiling floor null cube bricks bricks 0 0 2 0 48 | 5 0 ceiling floor null cube bricks bricks 0 0 2 0 49 | c 0 ceiling floor null floor null null 0 0 2 0 50 | d 0 ceiling floor null floor null null 0 0 2 0 51 | e 0 ceiling floor null floor null null 0 0 2 0 52 | G 0 ceiling floor null floor null null 0 0 2 0 53 | = 0 ceiling floor null cube bricks bricks 0 0 2 0 54 | K 0 ceiling ceilingend null cube null ceilingdoor 0 1 2 0.3 55 | H 1 ceilingbars floor arch cube bricks null 1 0 1 0 -------------------------------------------------------------------------------- /DungeonsOfNoudar486/res/tiles2.prp: -------------------------------------------------------------------------------- 1 | 1 0 null null null cube bricks null 2 0 0 0 2 | P 0 null null null cube fence null 2 0 0 0 3 | R 0 null null null cube bricks null 2 0 0 0 4 | @ 0 bricks bricks slot cube bricks null 1 0 1 0 5 | I 0 null null null cube null bricks 0 4 0 2 6 | 0 0 ceiling floor null floor null null 0 0 2 0 7 | O 0 ceiling floor null cube bricks bricks 1 6 2 0 8 | _ 0 ceiling floor null cube floor null 0 0 2 0 9 | A 0 ceiling ceiling null cube bricks bricks 1 1 1.2 0.2 10 | X 0 null null bricksblood cube null null 0 0 1.2 0.2 11 | L 0 ceiling lava null floor null null 0 0 2 -2 12 | * 0 null floor null cube null null 0 0 0 0 13 | 4 0 ceiling floor null cube null null 0 0 2 0 14 | % 1 null floor bricks leftnear bricks null 3 0 1 0 15 | # 1 ceilingbars floor bars cube bricks null 1 0 1 0 16 | | 0 null floor bricks leftfar bricks null 3 0 1 0 17 | \ 0 ceiling floor bricks leftfar null null 0 0 2 0 18 | / 0 ceiling floor bricks leftnear null null 0 0 2 0 19 | . 0 ceiling floor null null null null 0 0 2 0 20 | H 0 ceiling floor null cube brickscandles null 1 0 3 0 21 | - 0 ceiling floor null cube bricks null 1 0 2 0 22 | ( 1 null floorstonefar null null null null 0 0 0 0 23 | { 1 null floorstonenear null null null null 0 0 0 0 24 | ) 1 null stonefloornear null null null null 0 0 0 0 25 | } 1 null stonefloorfar null null null null 0 0 0 0 26 | ' 0 null null bricks cube bricks null 3 0 1 0 27 | ! 0 ceilingbars floor null cube bricks null 2 0 1 0 28 | ~ 1 ceilingbars floor arch cube bricks null 1 0 1 0 29 | Y 0 null null bricks cube brickscandles null 1 0 1 0 30 | B 0 ceilingbegin floor begin cube null null 2 0 1 0 31 | E 1 ceilingend floor exit cube null null 1 0 1 0 32 | > 0 null floor bricks leftnear bricks null 2 0 1 0 33 | < 0 null floor bricks leftfar bricks null 2 0 1 0 34 | Z 0 null floor bricks leftnear bricks null 2 0 1 0 35 | S 0 null floor bricks leftfar bricks null 2 0 1 0 36 | + 0 null floor null floor null null 0 0 0 0 37 | t 0 null floor null floor null null 0 0 0 0 38 | y 0 ceiling floor null floor null null 0 0 2 0 39 | u 0 null floor null floor null null 0 0 0 0 40 | U 0 null floor null floor null null 0 0 0 0 41 | 2 0 null floor null floor null null 0 0 0 0 42 | 7 0 null floor null floor null null 0 0 0 0 43 | v 0 null floor null floor null null 0 0 0 0 44 | + 0 null floor null floor null null 0 0 0 0 45 | 9 0 null floor null floor null null 0 0 0 0 46 | T 0 ceiling floor null floor null null 0 0 2 0 47 | w 0 null floor null floor null null 0 0 0 0 48 | J 0 null floor null floor null null 0 0 0 0 49 | 6 0 ceiling floor null cube bricks bricks 0 0 2 0 50 | 5 0 ceiling floor null cube bricks bricks 0 0 2 0 51 | c 0 null floor null floor null null 0 0 0 0 52 | d 0 null floor null floor null null 0 0 0 0 53 | e 0 null floor null floor null null 0 0 0 0 54 | G 0 null floor null floor null null 0 0 0 0 55 | = 0 ceiling floor null cube bricks bricks 0 0 2 0 56 | E 0 ceiling floor null cube fence fence 0 1 2.2 0.2 -------------------------------------------------------------------------------- /DungeonsOfNoudar486/res/tiles0.prp: -------------------------------------------------------------------------------- 1 | I 0 null null null cube bricks null 6 0 0 0 2 | O 0 ceiling floor null cube null bricks 0 0 3 0.05 3 | 8 0 ceiling floor null cube null bricks 0 0 3 0.05 4 | K 0 ceiling ceilingend null cube null ceilingdoor 0 1 3 0.3 5 | R 0 null null null cube bricks null 4 0 0 0 6 | 1 0 null null null cube bricks null 4 0 0 0 7 | = 0 ceiling floor null cube bricks bricks 1 1 2 0.1 8 | * 0 ceiling ceilingbars null cube bricks bricks 1 1 2 0.1 9 | E 0 ceiling floor null cube bricks bricks 1 1 2 0.1 10 | _ 0 null cobblestone null cube null cobblestone 0 1 0 0.05 11 | A 1 ceiling floor null cube bricks bricks 4 1 0.7 0.15 12 | L 0 ceiling lava null cube null null 2 0 2 -2 13 | % 1 null floor bricks leftnear bricks null 3 0 1 0 14 | # 1 ceilingbars floor bars cube bricks null 2 0 1 0 15 | F 1 ceilingbars floor bars cube bricks null 2 0 1 0 16 | 3 1 ceilingbars floor magicseal cube bricks null 2 0 1 0 17 | @ 1 ceilingbars floor slot cube bricks null 2 0 1 0 18 | | 0 null floor bricks leftfar bricks null 3 0 1 0 19 | . 0 null grass null null null null 0 0 0 0 20 | H 1 ceilingbars floor arch cube bricks null 2 0 1 0.05 21 | - 0 ceiling grass null cube bricks null 1 0 2 0 22 | ' 0 null null bricks cube bricks null 3 0 1 0 23 | ! 0 ceilingbars floor null cube bricks null 2 0 1 0 24 | ~ 1 ceilingbars floor arch cube bricks null 2 0 1 0.05 25 | Y 0 null null brickscandles cube bricks bricks 4 1 2 1 26 | X 0 null null bricks cube bricks null 2 0 1 0 27 | B 0 ceilingbegin floor begin cube null null 2 0 1 0 28 | > 0 null floor bricks leftnear bricks null 2 0 1 0 29 | < 0 null floor bricks leftfar bricks null 2 0 1 0 30 | + 0 null grass null floor null null 0 0 0 0 31 | t 0 null grass null floor null null 0 0 0 0 32 | y 0 null grass null floor null null 0 0 0 0 33 | u 0 null grass null floor null null 0 0 0 0 34 | U 0 null floor null floor null null 0 0 0 0 35 | 2 0 null grass null floor null null 0 0 0 0 36 | 7 0 null grass null floor null null 0 0 0 0 37 | v 0 null grass null floor null null 0 0 0 0 38 | + 0 null grass null floor null null 0 0 0 0 39 | 9 0 null grass null floor null null 0 0 0 0 40 | w 0 null grass null floor null null 0 0 0 0 41 | J 0 null grass null floor null null 0 0 0 0 42 | 6 0 ceiling floor null cube null bricks 0 0 3 0.05 43 | 5 0 null grass null floor null null 0 0 0 0 44 | c 0 null grass null floor null null 0 0 0 0 45 | d 0 null grass null floor null null 0 0 0 0 46 | e 0 null grass null floor null null 0 0 0 0 47 | G 0 null grass null floor null null 0 0 0 0 48 | 4 0 null grass null null null null 0 0 0 0 49 | T 0 ceiling cobblestone null cube null bricks 0 0 3 0.05 50 | ( 0 null ceiling bricks leftfar null null 0 0 2 0 51 | ) 0 null ceiling bricks leftnear null null 0 0 2 0 52 | \ 0 null floor bricks leftfar null null 0 0 6 0 53 | / 0 null floor bricks leftnear null null 0 0 6 0 54 | S 0 null floor brickscandles leftfar null null 0 0 3 0 55 | Z 0 null floor brickscandles leftnear null null 0 0 3 0 56 | 0 0 null lava null floor null null 0 0 0 0 57 | D 0 null grass null floor null null 0 0 0 0 -------------------------------------------------------------------------------- /DungeonsOfNoudar486/res/tiles3.prp: -------------------------------------------------------------------------------- 1 | 1 0 null null bricks cube bricks null 2 0 1 0 2 | R 0 null null bricks cube bricks null 2 0 1 0 3 | 0 0 null grass null floor null null 0 0 0 0 4 | _ 0 null cobblestone null cube null null 0 0 0 0 5 | A 1 ceiling ceiling null cube bricks brickscandles 1 2 2 1 6 | ' 0 ceiling ceiling null cube bricks bricks 1 4 3.75 3.15 7 | I 0 null null bricks cube bricks bricks 3 1 1 0 8 | Y 0 null null brickscandles cube bricks bricks 3 1 1 0 9 | * 0 null floor null cube null null 0 0 0 0 10 | 4 0 null floor null cube null null 0 0 0 0 11 | % 1 null floor magicseal leftnear magicseal null 3 0 1 0 12 | # 1 ceilingbars floor bars cube bricks null 3 0 1 0 13 | K 1 null floor fence cube null bricks 0 1 2 0.25 14 | | 0 null floor bricks leftfar bricks null 3 0 1 0 15 | . 0 null grass null null null null 0 0 0 0 16 | - 0 null floor null cube null bricks 0 1 2 0.3 17 | O 0 ceiling floor null cube null bricks 0 1 3 0.6 18 | L 1 ceiling floor bars cube brickscandles bricks 1 1 2 1 19 | = 0 ceiling floor null cube bricks bricks 1 6 2 0 20 | ( 1 null grassstonefar null null null null 0 0 0 0 21 | { 1 null grassstonenear null null null null 0 0 0 0 22 | ) 1 null stonegrassnear null null null null 0 0 0 0 23 | } 1 null stonegrassfar null null null null 0 0 0 0 24 | ~ 1 ceilingbars cobblestone arch cube bricks null 2 0 1 0 25 | X 0 null null bricksblood cube bricks null 2 0 1 0 26 | B 0 ceilingbegin floor begin cube null null 2 0 1 0 27 | E 0 ceilingend floor exit cube null null 1 0 1 0 28 | > 0 null floor bricks leftnear bricks null 2 0 1 0 29 | < 0 null floor bricks leftfar bricks null 2 0 1 0 30 | Z 0 null floor bricks leftnear bricks null 2 0 1 0 31 | S 0 null floor bricks leftfar bricks null 2 0 1 0 32 | + 0 null grass null floor null null 0 0 0 0 33 | t 0 null grass null floor null null 0 0 0 0 34 | y 0 null grass null floor null null 0 0 0 0 35 | u 0 null grass null floor null null 0 0 0 0 36 | U 0 ceiling floor null cube null bricks 0 1 3 0.8 37 | 2 0 null grass null floor null null 0 0 0 0 38 | 7 0 null grass null floor null null 0 0 0 0 39 | v 0 null grass null floor null null 0 0 0 0 40 | + 0 null grass null floor null null 0 0 0 0 41 | 9 0 null grass null floor null null 0 0 0 0 42 | T 0 null floor null floor null null 0 0 3 0.8 43 | w 0 null grass null floor null null 0 0 0 0 44 | J 0 null floor null floor null null 0 0 0 0 45 | 6 0 null grass null floor null null 0 0 0 0 46 | 5 0 null grass null floor null null 0 0 0 0 47 | c 0 null grass null floor null null 0 0 0 0 48 | d 0 null grass null floor null null 0 0 0 0 49 | e 0 null grass null floor null null 0 0 0 0 50 | G 0 null grass null floor null null 0 0 0 0 51 | E 0 ceiling floor null cube null bricks 0 1 2 -0.2 52 | H 0 ceiling floor null cube null bricks 0 1 2 -0.4 53 | % 0 null null null cube null bricks 0 4 5 3 54 | P 0 null null null cube null magicseal 0 4 5 3 55 | V 0 null grass null floor null null 0 0 0 -1 56 | \ 0 null ceiling null leftfar bricks bricks 6 0 -1 -1 57 | / 0 null ceiling null leftnear bricks bricks 6 0 -1 -1 58 | D 0 null lava null floor null null 0 0 0 0 -------------------------------------------------------------------------------- /DungeonsOfNoudar486/res/tiles6.prp: -------------------------------------------------------------------------------- 1 | 1 0 null null null cube bricks null 4 0 0 0 2 | R 0 null null null cube bricks null 4 0 0 0 3 | I 0 null null null cube bricks null 6 0 0 0 4 | O 0 ceiling floor null cube null bricks 0 0 3 0.05 5 | 8 0 ceiling floor null cube null bricks 0 0 3 0.05 6 | K 0 ceiling ceilingend null cube null ceilingdoor 0 1 3 0.3 7 | \ 0 null ceiling null leftfar bricks bricks 6 0 0 0 8 | / 0 null ceiling null leftnear bricks bricks 6 0 0 0 9 | ( 0 null ceiling null leftfar bricks bricks 2 0 0 0 10 | ) 0 null ceiling null leftnear bricks bricks 2 0 0 0 11 | 0 0 ceiling floor null cube null bricks 0 0 3 0.05 12 | = 0 ceiling floor null cube bricks bricks 1 1 2 0.1 13 | E 0 ceiling floor null cube bricks bricks 1 1 2 0.1 14 | _ 0 null cobblestone null cube null cobblestone 0 1 0 0.05 15 | A 1 ceiling floor null cube bricks bricks 4 1 0.7 0.15 16 | L 0 ceiling lava null cube null null 2 0 2 -2 17 | * 0 ceiling ceilingbars null cube bricks bricks 1 1 2 0.1 18 | % 1 null floor bricks leftnear bricks null 3 0 1 0 19 | # 1 ceilingbars floor bars cube bricks null 2 0 1 0 20 | 3 1 ceilingbars floor magicseal cube bricks null 2 0 1 0 21 | @ 1 ceilingbars floor slot cube bricks null 2 0 1 0 22 | | 0 null floor bricks leftfar bricks null 3 0 1 0 23 | . 0 null grass null null null null 0 0 0 0 24 | H 0 ceiling grass null cube brickscandles null 1 0 3 0 25 | - 0 ceiling grass null cube bricks null 1 0 2 0 26 | { 0 null floor ceilingend leftfar null null 0 0 1 0.0 27 | } 0 null floor ceilingend leftnear null null 0 0 1 0.0 28 | ' 0 null null bricks cube bricks null 3 0 1 0 29 | ! 0 ceilingbars floor null cube bricks null 2 0 1 0 30 | ~ 1 ceilingbars floor arch cube bricks null 2 0 1 0.05 31 | Y 0 null null brickscandles cube bricks bricks 4 1 2 1 32 | X 0 null null bricks cube bricks null 2 0 1 0 33 | B 0 ceilingbegin floor begin cube null null 2 0 1 0 34 | > 0 null floor bricks leftnear bricks null 2 0 1 0 35 | < 0 null floor bricks leftfar bricks null 2 0 1 0 36 | S 0 null floor brickscandles leftfar null null 0 0 3 0 37 | Z 0 null floor brickscandles leftnear null null 0 0 3 0 38 | + 0 null grass null floor null null 0 0 0 0 39 | t 0 null grass null floor null null 0 0 0 0 40 | y 0 null grass null floor null null 0 0 0 0 41 | u 0 null grass null floor null null 0 0 0 0 42 | U 0 null floor null floor null null 0 0 0 0 43 | 2 0 null grass null floor null null 0 0 0 0 44 | 7 0 null grass null floor null null 0 0 0 0 45 | v 0 null grass null floor null null 0 0 0 0 46 | + 0 null grass null floor null null 0 0 0 0 47 | 9 0 null grass null floor null null 0 0 0 0 48 | T 0 null grass null floor null null 0 0 0 0 49 | w 0 null grass null floor null null 0 0 0 0 50 | J 0 null grass null floor null null 0 0 0 0 51 | 6 0 null grass null floor null null 0 0 0 0 52 | 5 0 null grass null floor null null 0 0 0 0 53 | c 0 null grass null floor null null 0 0 0 0 54 | d 0 null grass null floor null null 0 0 0 0 55 | e 0 null grass null floor null null 0 0 0 0 56 | G 0 null grass null floor null null 0 0 0 0 57 | 4 0 null grass null null null null 0 0 0 0 58 | D 0 null grass null floor null null 0 0 0 0 59 | 5 0 null grass null floor null null 0 0 0 0 60 | 6 0 ceiling floor null cube null bricks 0 0 3 0.05 61 | T 0 ceiling floor null cube null bricks 0 0 3 0.05 -------------------------------------------------------------------------------- /DungeonsOfNoudar486/Makefile: -------------------------------------------------------------------------------- 1 | CXX = i386-pc-msdosdjgpp-g++ 2 | LD = i386-pc-msdosdjgpp-ld 3 | 4 | CXXFLAGS = -g -DVGA -DDONT_LOAD_LEVEL_UPON_START -Iinclude -c -Istb -fpermissive -c -O6 -Ofast -funroll-loops -funroll-all-loops -fomit-frame-pointer -fno-exceptions -ffast-math -mtune=i486 -march=i486 -I../fixed_point/include -IDOS-version -Iinclude -I../stb -I../noudar-core/noudar-core/include -I../noudar-rendering -I../noudar-rendering -fpermissive -Wno-narrowing -DUSE_ITEMS_INSTANTLY 5 | 6 | LDFLAGS = -lemu 7 | 8 | OBJS = src/CRenderer.o \ 9 | src/CRenderer_Rasterization.o \ 10 | src/CRenderer_Tesselation.o \ 11 | src/RasterizerCommon.o \ 12 | src/NativeBitmap.o \ 13 | src/CTile3DProperties.o \ 14 | src/CPackedFileReader.o \ 15 | src/VisibilityStrategy.o \ 16 | OPL2LPT/OPL2.o \ 17 | OPL2LPT/timer.o \ 18 | OPL2LPT/controller.o \ 19 | OPL2LPT/MusicDOS.o \ 20 | ../noudar-rendering/Logger.o \ 21 | ../noudar-rendering/LoadPNG.o \ 22 | ../noudar-core/noudar-core/src/Vec2i.o \ 23 | ../noudar-core/noudar-core/src/CActor.o \ 24 | ../noudar-core/noudar-core/src/CMonster.o \ 25 | ../noudar-core/noudar-core/src/CMonsterGenerator.o \ 26 | ../noudar-core/noudar-core/src/CTeam.o \ 27 | ../noudar-core/noudar-core/src/CMap.o \ 28 | ../noudar-core/noudar-core/src/Common.o \ 29 | ../noudar-core/noudar-core/src/CCharacter.o \ 30 | ../noudar-core/noudar-core/src/CCharacterArchetype.o \ 31 | ../noudar-core/noudar-core/src/CDoorway.o \ 32 | ../noudar-core/noudar-core/src/IFileLoaderDelegate.o \ 33 | ../noudar-core/noudar-core/src/IMapElement.o \ 34 | ../noudar-core/noudar-core/src/CGame.o \ 35 | ../noudar-core/noudar-core/src/CItem.o \ 36 | ../noudar-core/noudar-core/src/CStorageItem.o \ 37 | ../noudar-core/noudar-core/src/CGameDelegate.o \ 38 | ../noudar-core/noudar-core/src/commands/IGameCommand.o \ 39 | ../noudar-core/noudar-core/src/commands/CMoveActorCommand.o \ 40 | ../noudar-core/noudar-core/src/commands/CLoadNewLevelCommand.o \ 41 | ../noudar-core/noudar-core/src/commands/CTurnActorCommand.o \ 42 | ../noudar-core/noudar-core/src/commands/CQuitCommand.o \ 43 | ../noudar-core/noudar-core/src/commands/CNullCommand.o \ 44 | ../noudar-core/noudar-core/src/commands/CEndTurnCommand.o \ 45 | ../noudar-core/noudar-core/src/commands/CPickItemCommand.o \ 46 | ../noudar-core/noudar-core/src/commands/CDropItemCommand.o \ 47 | ../noudar-core/noudar-core/src/commands/CSuggestItemCommand.o \ 48 | ../noudar-core/noudar-core/src/commands/CUseCurrentItemCommand.o \ 49 | ../noudar-core/noudar-core/src/commands/CCycleNextItemCommand.o \ 50 | ../noudar-core/noudar-core/src/commands/CCyclePreviousItemCommand.o \ 51 | main.o \ 52 | events.o \ 53 | DOSVersion/CDOSRenderer.o \ 54 | 55 | TARGET = noudar.exe 56 | DATA = data.pfs 57 | 58 | $(TARGET): $(OBJS) $(DATA) 59 | $(CXX) -o $(TARGET) $(OBJS) $(LIBS) $(LDFLAGS) 60 | i386-pc-msdosdjgpp-strip $(TARGET) 61 | 62 | all: $(TARGET) 63 | 64 | packager: 65 | rm -f ./packer 66 | g++ -std=c++14 -opacker packer.cpp 67 | 68 | 69 | $(DATA): packager 70 | rm -f ./data.pfs 71 | ls res/*.* | xargs ./packer 72 | 73 | clean: 74 | rm -f $(OBJS) $(TARGET) 75 | -------------------------------------------------------------------------------- /noudar-rendering/CTile3DProperties.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by monty on 14/01/17. 3 | // 4 | #include "glm/glm.hpp" 5 | #include "glm/gtc/type_ptr.hpp" 6 | 7 | #ifdef __APPLE__ 8 | #if TARGET_IOS 9 | #import 10 | #import 11 | #else 12 | #import 13 | #import 14 | #endif 15 | #else 16 | 17 | #endif 18 | 19 | #include 20 | #include 21 | 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | 31 | using std::vector; 32 | using std::array; 33 | 34 | #include "Vec2i.h" 35 | #include "IMapElement.h" 36 | #include "CTeam.h" 37 | #include "CItem.h" 38 | #include "CActor.h" 39 | #include "CGameDelegate.h" 40 | #include "CMap.h" 41 | 42 | #include "NativeBitmap.h" 43 | #include "Logger.h" 44 | #include "VBORenderingJob.h" 45 | #include "NoudarDungeonSnapshot.h" 46 | #include "ETextures.h" 47 | #include "VBORegister.h" 48 | #include "CTile3DProperties.h" 49 | 50 | namespace odb { 51 | 52 | CTile3DProperties readPropertiesLine(vector::iterator &pos) { 53 | 54 | CTile3DProperties properties; 55 | 56 | pos = std::next(pos); 57 | properties.mNeedsAlphaTest = ((*pos)[0] == '1'); 58 | pos = std::next(pos); 59 | properties.mCeilingTexture = *pos; 60 | pos = std::next(pos); 61 | properties.mFloorTexture = *pos; 62 | pos = std::next(pos); 63 | properties.mMainWallTexture = *pos; 64 | pos = std::next(pos); 65 | properties.mVBOToRender = *pos; 66 | pos = std::next(pos); 67 | properties.mCeilingRepeatedWallTexture = *pos; 68 | pos = std::next(pos); 69 | properties.mFloorRepeatedWallTexture = *pos; 70 | pos = std::next(pos); 71 | properties.mCeilingRepetitions = std::atoi(pos->c_str()); 72 | pos = std::next(pos); 73 | properties.mFloorRepetitions = std::atoi(pos->c_str()); 74 | pos = std::next(pos); 75 | properties.mCeilingHeight = atof(pos->c_str()); 76 | pos = std::next(pos); 77 | properties.mFloorHeight = atof(pos->c_str()); 78 | 79 | return properties; 80 | } 81 | 82 | 83 | CTilePropertyMap CTile3DProperties::parsePropertyList(std::string propertyFile) { 84 | 85 | odb::CTilePropertyMap map; 86 | 87 | std::stringstream ss; 88 | ss << propertyFile; 89 | 90 | vector tokens; 91 | std::string tmp; 92 | while (ss.good()) { 93 | ss >> tmp; 94 | tokens.push_back(tmp); 95 | } 96 | 97 | auto fileBegin = std::begin(tokens); 98 | auto fileEnd = std::end(tokens); 99 | auto pos = fileBegin; 100 | 101 | int line = 0; 102 | 103 | while (pos != fileEnd) { 104 | line++; 105 | CTileId id = pos->c_str()[0]; 106 | auto props = readPropertiesLine(pos); 107 | map[id] = props; 108 | pos = std::next(pos); 109 | } 110 | 111 | return map; 112 | } 113 | } 114 | 115 | -------------------------------------------------------------------------------- /DungeonsOfNoudar486/packer.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | using std::vector; 10 | 11 | vector readToBuffer(FILE *fileDescriptor) { 12 | const unsigned N = 1024; 13 | 14 | fseek(fileDescriptor, 0, SEEK_END); 15 | auto endPos = ftell( fileDescriptor ); 16 | rewind(fileDescriptor); 17 | vector total(endPos); 18 | auto writeHead = std::begin( total ); 19 | 20 | for ( int c = 0; c < endPos; ++c ) { 21 | char buffer[N]; 22 | size_t read = fread((void *) &buffer[0], 1, N, fileDescriptor); 23 | if (read) { 24 | for (unsigned int c = 0; c < read; ++c) { 25 | *writeHead = (buffer[c]); 26 | writeHead = std::next(writeHead); 27 | } 28 | } 29 | if (read < N) { 30 | break; 31 | } 32 | } 33 | 34 | return total; 35 | } 36 | 37 | struct Entry { 38 | public: 39 | Entry( std::string path, std::string key ); 40 | vector mContent; 41 | std::string id; 42 | uint32_t offset = 0; 43 | }; 44 | 45 | Entry::Entry(std::string path, std::string key) : id(key) { 46 | FILE* in = fopen(path.c_str(), "rb"); 47 | mContent = readToBuffer(in); 48 | fclose( in ); 49 | } 50 | 51 | void writeHeader( FILE*file, uint16_t entries ) { 52 | fwrite( &entries, 2, 1, file ); 53 | } 54 | 55 | int main( int argc, char **argv ) { 56 | int c = argc; 57 | 58 | vector files; 59 | while (--c) { 60 | std::string filename = argv[c]; 61 | std::cout << "adding " << filename << std::endl; 62 | files.emplace_back( filename, filename.substr(filename.find('/') + 1) ); 63 | } 64 | 65 | FILE* file = fopen( "data.pfs", "wb" ); 66 | uint32_t accOffset = 0; 67 | uint16_t entries = files.size(); 68 | writeHeader(file, entries ); 69 | 70 | accOffset += 2; 71 | 72 | for ( uint16_t e = 0; e < entries; ++e ) { 73 | accOffset += 4 + 1 + files[ e ].id.length() + 1; 74 | } 75 | 76 | std::cout << "base offset " << accOffset << std::endl; 77 | 78 | for ( uint16_t e = 0; e < entries; ++e ) { 79 | files[ e ].offset = accOffset; 80 | std::cout << "Offset for " << files[ e ].id << " = " << accOffset << std::endl; 81 | accOffset += 4 + files[ e ].mContent.size(); 82 | } 83 | 84 | for ( uint16_t e = 0; e < entries; ++e ) { 85 | std::cout << "entry " << files[ e ].id << " starting at " << ftell(file) << std::endl; 86 | uint32_t offset = files[ e ].offset; 87 | const char *name = files[ e ].id.c_str(); 88 | uint8_t strLen = std::strlen(name); 89 | fwrite( &offset, 4, 1, file ); 90 | fwrite( &strLen, 1, 1, file ); 91 | fwrite( name, strLen + 1, 1, file ); 92 | } 93 | 94 | for ( uint16_t e = 0; e < entries; ++e ) { 95 | uint32_t size = files[ e ].mContent.size(); 96 | std::cout << "writing a file " << files[ e ].id << " with " << size << " bytes at " << ftell(file) << std::endl; 97 | fwrite( &size, 4, 1, file ); 98 | 99 | for ( const auto& c : files[ e ].mContent ) { 100 | fwrite( &c, 1, 1, file ); 101 | } 102 | } 103 | 104 | fclose( file ); 105 | 106 | return 0; 107 | } 108 | -------------------------------------------------------------------------------- /DungeonsOfNoudar486/res/tiles5.prp: -------------------------------------------------------------------------------- 1 | 1 0 null null null cube bricks null 4 0 0 0 2 | R 0 null null null cube bricks null 4 0 0 0 3 | I 0 null null null cube bricks bricks 6 1 0 0 4 | O 0 ceiling floor null cube null bricks 0 0 3 0.05 5 | 8 0 ceiling floor null cube null bricks 0 0 3 0.05 6 | K 0 ceiling ceilingend null cube null ceilingdoor 0 1 3 0.3 7 | \ 0 ceiling floor bricks leftfar null null 0 0 2 0.1 8 | / 0 ceiling floor bricks leftnear null null 0 0 2 0.1 9 | ( 0 null ceiling null leftfar bricks bricks 2 0 0 0 10 | ) 0 null ceiling null leftnear bricks bricks 2 0 0 0 11 | 0 0 ceiling floor null cube null bricks 0 0 3 0.05 12 | = 0 ceiling floor null floor null null 0 0 2 0.1 13 | - 0 ceiling floor null cube bricks bricks 1 1 2 0.1 14 | E 0 ceiling floor null cube bricks bricks 1 1 2 0.1 15 | _ 0 brickscandles cobblestone null cube bricks bricks 1 1 1 0.1 16 | V 0 null grass null floor null null 0 0 0 -0.2 17 | A 1 ceiling floor null cube bricks bricks 4 1 0.7 0.15 18 | L 0 ceiling lava null cube null null 2 0 2 -2 19 | * 0 ceiling ceilingbars null floor null null 0 0 2 0.1 20 | % 1 null floor bricks leftnear bricks null 3 0 1 0 21 | # 1 ceilingbars floor bars cube bricks null 2 0 1 0 22 | 3 1 ceiling floor magicseal cube bricks null 2 0 1 0 23 | @ 1 ceilingbars floor slot cube bricks null 2 0 1 0 24 | | 0 null floor bricks leftfar bricks null 3 0 1 0 25 | . 0 null floor null null null null 0 0 0 0 26 | H 0 ceiling floor null cube brickscandles null 1 0 3 0 27 | { 0 null floor ceilingend leftfar null null 0 0 1 0.0 28 | } 0 null floor ceilingend leftnear null null 0 0 1 0.0 29 | ' 0 null null bricks cube bricks null 3 0 1 0 30 | ! 0 ceilingbars brickscandles null cube bricks bricks 5 1 1 0.15 31 | ~ 1 ceilingbars floor arch cube bricks null 2 0 1 0.05 32 | Y 0 null null brickscandles cube bricks bricks 4 1 2 1 33 | X 0 null null bricks cube bricks null 2 0 1 0 34 | B 0 ceilingbegin floor begin cube null null 2 0 1 0 35 | > 0 null floor bricks leftnear bricks null 2 0 1 0 36 | < 0 null floor bricks leftfar bricks null 2 0 1 0 37 | Z 0 null floor bricks leftnear bricks null 2 0 1 0 38 | S 0 null floor bricks leftfar bricks null 2 0 1 0 39 | + 0 null floor null floor null null 0 0 0 0 40 | t 0 null floor null floor null null 0 0 0 0 41 | y 0 ceiling floor null floor null null 0 0 2 0.1 42 | u 0 null floor null floor null null 0 0 0 0 43 | U 0 null floor null floor null null 0 0 0 0 44 | 2 0 null floor null floor null null 0 0 0 0 45 | 7 0 null floor null floor null null 0 0 0 0 46 | v 0 ceiling floor null floor null null 0 0 2 0.1 47 | + 0 null floor null floor null null 0 0 0 0 48 | 9 0 null floor null floor null null 0 0 0 0 49 | T 0 null floor null floor null null 0 0 0 0 50 | w 0 null floor null floor null null 0 0 0 0 51 | J 0 null floor null floor null null 0 0 0 0 52 | 6 0 null floor null floor null null 0 0 0 0 53 | 5 0 null floor null floor null null 0 0 0 0 54 | c 0 null floor null floor null null 0 0 0 0 55 | d 0 null floor null floor null null 0 0 0 0 56 | e 0 null floor null floor null null 0 0 0 0 57 | G 0 null floor null floor null null 0 0 0 0 58 | D 0 null floor null null null null 0 0 0 0 59 | 4 0 ceiling floor null null null null 0 0 2 0.1 60 | 5 0 null floor null floor null null 0 0 0 0 61 | 6 0 ceiling floor null cube null bricks 0 0 3 0.05 62 | T 0 brickscandles cobblestone null cube null bricks 0 1 3 0.1 -------------------------------------------------------------------------------- /DungeonsOfNoudar486/Makefile.SDL: -------------------------------------------------------------------------------- 1 | CXX = clang++ 2 | 3 | SDL_LIB = `sdl-config --libs` 4 | SDL_INCLUDE = `sdl-config --cflags ` 5 | 6 | CXXFLAGS = -std=c++14 -O2 -g $(SDL_INCLUDE) -g -DDONT_LOAD_LEVEL_UPON_START -DSDLSW -DVGA -DEA_PLATFORM_SAMSUNG_TV -Iinclude -c -Istb -fpermissive -Ofast -fomit-frame-pointer -fno-exceptions -ffast-math -I../fixed_point/include -IDOS-version -Iinclude -I../stb -I../noudar-core/noudar-core/include -I../noudar-rendering -I../gles2-renderer -Wno-narrowing -DUSE_ITEMS_INSTANTLY 7 | 8 | OBJS = main.o \ 9 | events.o \ 10 | src/CRenderer_Rasterization.o \ 11 | src/CRenderer_Tesselation.o \ 12 | SDLVersion/CSDLRenderer.o \ 13 | OPL2LPT/MusicSDL.o \ 14 | src/CRenderer.o \ 15 | src/RasterizerCommon.o \ 16 | src/NativeBitmap.o \ 17 | src/CTile3DProperties.o \ 18 | src/CPackedFileReader.o \ 19 | src/VisibilityStrategy.o \ 20 | ../noudar-rendering/LoadPNG.o \ 21 | ../noudar-core/noudar-core/src/Vec2i.o \ 22 | ../noudar-core/noudar-core/src/CActor.o \ 23 | ../noudar-core/noudar-core/src/CMonster.o \ 24 | ../noudar-core/noudar-core/src/CMonsterGenerator.o \ 25 | ../noudar-core/noudar-core/src/CTeam.o \ 26 | ../noudar-core/noudar-core/src/CMap.o \ 27 | ../noudar-core/noudar-core/src/Common.o \ 28 | ../noudar-core/noudar-core/src/CCharacter.o \ 29 | ../noudar-core/noudar-core/src/CCharacterArchetype.o \ 30 | ../noudar-core/noudar-core/src/CDoorway.o \ 31 | ../noudar-core/noudar-core/src/IFileLoaderDelegate.o \ 32 | ../noudar-core/noudar-core/src/IMapElement.o \ 33 | ../noudar-core/noudar-core/src/CGame.o \ 34 | ../noudar-core/noudar-core/src/CItem.o \ 35 | ../noudar-core/noudar-core/src/CStorageItem.o \ 36 | ../noudar-core/noudar-core/src/CGameDelegate.o \ 37 | ../noudar-core/noudar-core/src/commands/IGameCommand.o \ 38 | ../noudar-core/noudar-core/src/commands/CMoveActorCommand.o \ 39 | ../noudar-core/noudar-core/src/commands/CLoadNewLevelCommand.o \ 40 | ../noudar-core/noudar-core/src/commands/CTurnActorCommand.o \ 41 | ../noudar-core/noudar-core/src/commands/CQuitCommand.o \ 42 | ../noudar-core/noudar-core/src/commands/CNullCommand.o \ 43 | ../noudar-core/noudar-core/src/commands/CEndTurnCommand.o \ 44 | ../noudar-core/noudar-core/src/commands/CPickItemCommand.o \ 45 | ../noudar-core/noudar-core/src/commands/CDropItemCommand.o \ 46 | ../noudar-core/noudar-core/src/commands/CSuggestItemCommand.o \ 47 | ../noudar-core/noudar-core/src/commands/CUseCurrentItemCommand.o \ 48 | ../noudar-core/noudar-core/src/commands/CCycleNextItemCommand.o \ 49 | ../noudar-core/noudar-core/src/commands/CCyclePreviousItemCommand.o 50 | 51 | LIBS = $(SDL_LIB) 52 | TARGET = x11noudar 53 | 54 | $(TARGET): $(OBJS) 55 | $(CXX) -o $(TARGET) $(OBJS) $(LIBS) 56 | 57 | all: $(TARGET) 58 | 59 | clean: 60 | rm -f $(OBJS) $(TARGET) 61 | 62 | packager: 63 | rm -f ./packer 64 | $(CXX) -std=c++14 -opacker packer.cpp 65 | 66 | data: packager 67 | rm -f ./data.pfs 68 | ls res/*.* | xargs ./packer 69 | 70 | audio: packager 71 | rm -f ./audio.pfs 72 | rm -f ./data.pfs 73 | ls audio/* | xargs ./packer 74 | mv ./data.pfs ./audio.pfs 75 | 76 | 77 | 78 | demodata: packager 79 | rm -f ./data.pfs 80 | ls resDemo/*.* | xargs ./packer 81 | -------------------------------------------------------------------------------- /DungeonsOfNoudar486/res/tiles1.prp: -------------------------------------------------------------------------------- 1 | 1 0 null null null cube bricks null 3 0 0 0 2 | R 0 null null null cube bricks null 3 0 0 0 3 | \ 0 ceiling floor bricks leftfar bricks null 2 0 2 0.05 4 | / 0 ceiling floor bricks leftnear bricks null 2 0 2 0.05 5 | T 0 ceiling cobblestone null floor null null 0 0 2 0.05 6 | . 0 ceiling floor null floor null null 0 0 2 0.05 7 | _ 0 null cobblestone null floor null cobblestone 0 1 2 0.05 8 | I 0 null null null cube ceilingend null 6 0 -0.5 0 9 | 0 0 null grass null floor null null 0 0 0 0 10 | 4 0 null grass null floor null null 0 0 0 0 11 | * 0 null floor null cube null null 0 0 0 0 12 | - 0 ceiling floor null floor null null 0 2 2 -0.6 13 | = 0 ceiling floor null cube null bricks 0 1 2 -0.4 14 | E 0 ceiling floor null cube null bricks 0 1 2 -0.2 15 | % 1 null floor bricks leftnear bricks null 3 0 1 0 16 | # 1 ceilingbars floor bars cube bricks null 2 0 1 0.05 17 | | 1 null floor fence cube null bricks 0 1 1 0.05 18 | P 0 null null null cube bricksblood null 3 0 -1 -1 19 | ( 1 null grassstonefar null null null null 0 0 0 0 20 | { 1 null grassstonenear null null null null 0 0 0 0 21 | ) 1 null stonegrassnear null null null null 0 0 0 0 22 | } 1 null stonegrassfar null null null null 0 0 0 0 23 | ' 0 null null bricks cube bricks null 3 0 1 0 24 | ! 0 ceilingbars floor null cube bricks null 2 0 1 0 25 | ~ 1 ceilingbars floor arch cube bricks null 2 0 1 0.05 26 | Y 0 null null bricks cube bricks null 2 0 1 0 27 | X 0 null null bricks cube bricks null 2 0 1 0 28 | B 0 ceilingbegin floor begin cube null null 2 0 1 0 29 | > 0 null floor bricks leftnear bricks null 2 0 1 0 30 | < 0 null floor bricks leftfar bricks null 2 0 1 0 31 | Z 0 null floor bricks leftnear bricks null 2 0 1 0 32 | S 0 null floor bricks leftfar bricks null 2 0 1 0 33 | t 0 null grass null floor null null 0 0 0 0 34 | y 0 null grass null floor null null 0 0 0 0 35 | u 0 null grass null floor null null 0 0 0 0 36 | U 0 null floor null floor null null 0 0 0 0 37 | 2 0 null grass null floor null null 0 0 0 0 38 | 7 0 null grass null floor null null 0 0 0 0 39 | v 0 null grass null floor null null 0 0 0 0 40 | A 1 ceiling ceiling null cube bricks bricks 2 1 0.8 0.4 41 | 9 0 null grass null floor null null 0 0 0 0 42 | w 0 null grass null floor null null 0 0 0 0 43 | J 0 null grass null floor null null 0 0 0 0 44 | 6 0 null grass null floor null null 0 0 0 0 45 | 5 0 null grass null floor null null 0 0 0 0 46 | c 0 null grass null floor null null 0 0 0 0 47 | d 0 null grass null floor null null 0 0 0 0 48 | e 0 null grass null floor null null 0 0 0 0 49 | G 0 null grass null floor null null 0 0 0 0 50 | D 0 null grass null floor null null 0 0 0 0 51 | 5 0 ceiling floor null floor null null 0 0 2 0.05 52 | 6 0 ceiling floor null floor null null 0 0 2 0.05 53 | 3 1 ceilingbars floor magicseal cube bricks null 2 0 1 0 54 | @ 1 ceilingbars floor slot cube bricks null 2 0 1 0 55 | v 0 null grass null floor null null 0 0 0 0 56 | + 0 ceiling floor null floor null null 0 0 2 0.05 57 | w 0 null grass null floor null null 0 0 0 0 58 | J 0 null grass null floor null null 0 0 0 0 59 | c 0 null grass null floor null null 0 0 0 0 60 | d 0 null grass null floor null null 0 0 0 0 61 | e 0 null grass null floor null null 0 0 0 0 62 | G 0 null grass null floor null null 0 0 0 0 63 | D 0 null grass null floor null null 0 0 0 0 64 | K 0 ceiling ceilingbars null cube null ceilingdoor 0 1 2 0.3 65 | L 0 ceiling ceilingend null cube null ceilingdoor 0 1 2 0.4 66 | O 0 ceiling floor null floor null null 0 0 2 0.05 67 | D 0 ceiling ceilingbars null floor null null 0 0 2 0.05 68 | 8 0 null lava null floor null null 0 0 0 0 -------------------------------------------------------------------------------- /DungeonsOfNoudar486/OPL2LPT/OPL2.h: -------------------------------------------------------------------------------- 1 | #ifndef OPL2_LIB_H_ 2 | #define OPL2_LIB_H_ 3 | 4 | #ifndef TRUE 5 | #define TRUE 1 6 | #endif 7 | 8 | #ifndef FALSE 9 | #define FALSE 0 10 | #endif 11 | 12 | // Operator definitions. 13 | #define OPERATOR1 false 14 | #define OPERATOR2 true 15 | #define MODULATOR false 16 | #define CARRIER true 17 | 18 | // Synthesis type definitions. 19 | #define FREQ_MODULATION false 20 | #define ADDITIVE_SYNTH true 21 | 22 | // Drum sounds. 23 | #define DRUM_BASS 0x10 24 | #define DRUM_SNARE 0x08 25 | #define DRUM_TOM 0x04 26 | #define DRUM_CYMBAL 0x02 27 | #define DRUM_HI_HAT 0x01 28 | 29 | // Note to frequency mapping. 30 | #define NOTE_C 0 31 | #define NOTE_CS 1 32 | #define NOTE_D 2 33 | #define NOTE_DS 3 34 | #define NOTE_E 4 35 | #define NOTE_F 5 36 | #define NOTE_FS 6 37 | #define NOTE_G 7 38 | #define NOTE_GS 8 39 | #define NOTE_A 9 40 | #define NOTE_AS 10 41 | #define NOTE_B 11 42 | 43 | 44 | #include 45 | typedef uint8_t byte; 46 | #define min(a, b) ((a) < (b) ? (a) : (b)) 47 | #define max(a, b) ((a) > (b) ? (a) : (b)) 48 | #define PROGMEM 49 | 50 | 51 | class OPL2 { 52 | public: 53 | OPL2(); 54 | void init(short lpt_base, bool isRealAdlib); 55 | void reset(); 56 | void write(byte, byte); 57 | 58 | short getNoteFrequency(byte, byte, byte); 59 | byte getRegister(byte); 60 | bool getWaveFormSelect(); 61 | bool getTremolo(byte, bool); 62 | bool getVibrato(byte, bool); 63 | bool getMaintainSustain(byte, bool); 64 | bool getEnvelopeScaling(byte, bool); 65 | byte getMultiplier(byte, bool); 66 | byte getScalingLevel(byte, bool); 67 | byte getVolume(byte, bool); 68 | byte getAttack(byte, bool); 69 | byte getDecay(byte, bool); 70 | byte getSustain(byte, bool); 71 | byte getRelease(byte, bool); 72 | short getFrequency(byte); 73 | byte getBlock(byte); 74 | bool getKeyOn(byte); 75 | byte getFeedback(byte); 76 | bool getSynthMode(byte); 77 | bool getDeepTremolo(); 78 | bool getDeepVibrato(); 79 | bool getPercussion(); 80 | byte getDrums(); 81 | byte getWaveForm(byte, bool); 82 | 83 | void setInstrument(byte, const unsigned char*); 84 | byte setRegister(byte, byte); 85 | byte setWaveFormSelect(bool); 86 | byte setTremolo(byte, bool, bool); 87 | byte setVibrato(byte, bool, bool); 88 | byte setMaintainSustain(byte, bool, bool); 89 | byte setEnvelopeScaling(byte, bool, bool); 90 | byte setMultiplier(byte, bool, byte); 91 | byte setScalingLevel(byte, bool, byte); 92 | byte setVolume(byte, bool, byte); 93 | byte setAttack(byte, bool, byte); 94 | byte setDecay(byte, bool, byte); 95 | byte setSustain(byte, bool, byte); 96 | byte setRelease(byte, bool, byte); 97 | byte setFrequency(byte, short); 98 | byte setBlock(byte, byte); 99 | byte setKeyOn(byte, bool); 100 | byte setFeedback(byte, byte); 101 | byte setSynthMode(byte, bool); 102 | byte setDeepTremolo(bool); 103 | byte setDeepVibrato(bool); 104 | byte setPercussion(bool); 105 | byte setDrums(bool, bool, bool, bool, bool); 106 | byte setWaveForm(byte, bool, byte); 107 | 108 | private: 109 | const static unsigned fIntervals[8]; 110 | const static unsigned notes[12]; 111 | const static byte offset[2][9]; 112 | const static byte drumOffset[6]; 113 | const static byte instrumentBaseRegs[11]; 114 | short lpt_base; 115 | byte oplRegisters[256]; 116 | byte getRegisterOffset(byte, bool); 117 | 118 | bool mIsRealAdlib = false; 119 | }; 120 | #endif 121 | -------------------------------------------------------------------------------- /noudar-rendering/LightningStrategy.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by monty on 30/07/16. 3 | // 4 | 5 | #include "glm/glm.hpp" 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | using std::vector; 14 | using std::array; 15 | 16 | #include "glm/glm.hpp" 17 | #include "glm/gtc/matrix_transform.hpp" 18 | 19 | #include 20 | 21 | #include "NativeBitmap.h" 22 | #include "VBORenderingJob.h" 23 | 24 | #include "Vec2i.h" 25 | #include "IMapElement.h" 26 | #include "CTeam.h" 27 | #include "CItem.h" 28 | #include "CActor.h" 29 | #include "CGameDelegate.h" 30 | #include "CMap.h" 31 | 32 | #include "NoudarDungeonSnapshot.h" 33 | 34 | #include "LightningStrategy.h" 35 | 36 | namespace odb { 37 | 38 | bool LightningStrategy::isValid(Knights::Vec2i pos) { 39 | return 0 <= pos.x && pos.x < Knights::kMapSize && 0 <= pos.y && pos.y < Knights::kMapSize; 40 | } 41 | 42 | void LightningStrategy::castPointLight(LightMap &lightMap, int emission, IntMap occluders, 43 | int x, int y) { 44 | castLight(Direction::TOP, lightMap, emission, occluders, Knights::Vec2i{x, y}); 45 | } 46 | 47 | bool isBlock(IntMap occluders, int x, int y) { 48 | 49 | auto tile = occluders[y][x]; 50 | 51 | for (auto candidate : {'1', 'Y', 'X', '9', '*'}) { 52 | if (candidate == tile) { 53 | return true; 54 | } 55 | } 56 | 57 | return false; 58 | } 59 | 60 | 61 | void LightningStrategy::castLight(Direction from, LightMap &lightMap, int emission, 62 | IntMap occluders, Knights::Vec2i originalPos) { 63 | 64 | array positions; 65 | array intensity; 66 | size_t stackPos = 0; 67 | Knights::Vec2i currentPos; 68 | 69 | positions[stackPos] = originalPos; 70 | intensity[stackPos] = emission; 71 | ++stackPos; 72 | 73 | while (stackPos > 0) { 74 | --stackPos; 75 | 76 | currentPos = positions[stackPos]; 77 | emission = intensity[stackPos]; 78 | 79 | if (emission <= 2) { 80 | continue; 81 | } 82 | 83 | int x = currentPos.x; 84 | int y = currentPos.y; 85 | 86 | if (!isValid(currentPos)) { 87 | continue; 88 | } 89 | 90 | if (isBlock(occluders, x, y)) { 91 | continue; 92 | } 93 | 94 | if ((lightMap[y][x] + emission) <= 255 && (lightMap[y][x] + emission) >= 0) { 95 | lightMap[y][x] += emission; 96 | } else { 97 | lightMap[y][x] = 255; 98 | } 99 | 100 | //The -1 is due to the fact I will add a new element. 101 | 102 | if (stackPos < positions.size() - 1) { 103 | positions[stackPos] = Knights::Vec2i{currentPos.x + 1, currentPos.y}; 104 | intensity[stackPos] = emission / 2; 105 | ++stackPos; 106 | } 107 | 108 | if (stackPos < positions.size() - 1) { 109 | positions[stackPos] = Knights::Vec2i{currentPos.x, currentPos.y + 1}; 110 | intensity[stackPos] = emission / 2; 111 | ++stackPos; 112 | } 113 | 114 | if (stackPos < positions.size() - 1) { 115 | positions[stackPos] = Knights::Vec2i{currentPos.x - 1, currentPos.y}; 116 | intensity[stackPos] = emission / 2; 117 | ++stackPos; 118 | } 119 | 120 | if (stackPos < positions.size() - 1) { 121 | positions[stackPos] = Knights::Vec2i{currentPos.x, currentPos.y - 1}; 122 | intensity[stackPos] = emission / 2; 123 | ++stackPos; 124 | } 125 | } 126 | } 127 | } 128 | -------------------------------------------------------------------------------- /DungeonsOfNoudar486/cmake_find/FindSDL2_ttf.cmake: -------------------------------------------------------------------------------- 1 | # Locate SDL_ttf library 2 | # 3 | # This module defines: 4 | # 5 | # :: 6 | # 7 | # SDL2_TTF_LIBRARIES, the name of the library to link against 8 | # SDL2_TTF_INCLUDE_DIRS, where to find the headers 9 | # SDL2_TTF_FOUND, if false, do not try to link against 10 | # SDL2_TTF_VERSION_STRING - human-readable string containing the version of SDL_ttf 11 | # 12 | # 13 | # 14 | # For backward compatibility the following variables are also set: 15 | # 16 | # :: 17 | # 18 | # SDLTTF_LIBRARY (same value as SDL2_TTF_LIBRARIES) 19 | # SDLTTF_INCLUDE_DIR (same value as SDL2_TTF_INCLUDE_DIRS) 20 | # SDLTTF_FOUND (same value as SDL2_TTF_FOUND) 21 | # 22 | # 23 | # 24 | # $SDLDIR is an environment variable that would correspond to the 25 | # ./configure --prefix=$SDLDIR used in building SDL. 26 | # 27 | # Created by Eric Wing. This was influenced by the FindSDL.cmake 28 | # module, but with modifications to recognize OS X frameworks and 29 | # additional Unix paths (FreeBSD, etc). 30 | 31 | #============================================================================= 32 | # Copyright 2005-2009 Kitware, Inc. 33 | # Copyright 2012 Benjamin Eikel 34 | # 35 | # Distributed under the OSI-approved BSD License (the "License"); 36 | # see accompanying file Copyright.txt for details. 37 | # 38 | # This software is distributed WITHOUT ANY WARRANTY; without even the 39 | # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 40 | # See the License for more information. 41 | #============================================================================= 42 | # (To distribute this file outside of CMake, substitute the full 43 | # License text for the above reference.) 44 | 45 | find_path(SDL2_TTF_INCLUDE_DIR SDL_ttf.h 46 | HINTS 47 | ENV SDL2TTFDIR 48 | ENV SDL2DIR 49 | PATH_SUFFIXES SDL2 50 | # path suffixes to search inside ENV{SDLDIR} 51 | include/SDL2 include 52 | PATHS ${SDL2_TTF_PATH} 53 | ) 54 | 55 | if (CMAKE_SIZEOF_VOID_P EQUAL 8) 56 | set(VC_LIB_PATH_SUFFIX lib/x64) 57 | else () 58 | set(VC_LIB_PATH_SUFFIX lib/x86) 59 | endif () 60 | 61 | find_library(SDL2_TTF_LIBRARY 62 | NAMES SDL2_ttf 63 | HINTS 64 | ENV SDL2TTFDIR 65 | ENV SDL2DIR 66 | PATH_SUFFIXES lib ${VC_LIB_PATH_SUFFIX} 67 | PATHS ${SDL2_TTF_PATH} 68 | ) 69 | 70 | if (SDL2_TTF_INCLUDE_DIR AND EXISTS "${SDL2_TTF_INCLUDE_DIR}/SDL_ttf.h") 71 | file(STRINGS "${SDL2_TTF_INCLUDE_DIR}/SDL_ttf.h" SDL2_TTF_VERSION_MAJOR_LINE REGEX "^#define[ \t]+SDL_TTF_MAJOR_VERSION[ \t]+[0-9]+$") 72 | file(STRINGS "${SDL2_TTF_INCLUDE_DIR}/SDL_ttf.h" SDL2_TTF_VERSION_MINOR_LINE REGEX "^#define[ \t]+SDL_TTF_MINOR_VERSION[ \t]+[0-9]+$") 73 | file(STRINGS "${SDL2_TTF_INCLUDE_DIR}/SDL_ttf.h" SDL2_TTF_VERSION_PATCH_LINE REGEX "^#define[ \t]+SDL_TTF_PATCHLEVEL[ \t]+[0-9]+$") 74 | string(REGEX REPLACE "^#define[ \t]+SDL_TTF_MAJOR_VERSION[ \t]+([0-9]+)$" "\\1" SDL2_TTF_VERSION_MAJOR "${SDL2_TTF_VERSION_MAJOR_LINE}") 75 | string(REGEX REPLACE "^#define[ \t]+SDL_TTF_MINOR_VERSION[ \t]+([0-9]+)$" "\\1" SDL2_TTF_VERSION_MINOR "${SDL2_TTF_VERSION_MINOR_LINE}") 76 | string(REGEX REPLACE "^#define[ \t]+SDL_TTF_PATCHLEVEL[ \t]+([0-9]+)$" "\\1" SDL2_TTF_VERSION_PATCH "${SDL2_TTF_VERSION_PATCH_LINE}") 77 | set(SDL2_TTF_VERSION_STRING ${SDL2_TTF_VERSION_MAJOR}.${SDL2_TTF_VERSION_MINOR}.${SDL2_TTF_VERSION_PATCH}) 78 | unset(SDL2_TTF_VERSION_MAJOR_LINE) 79 | unset(SDL2_TTF_VERSION_MINOR_LINE) 80 | unset(SDL2_TTF_VERSION_PATCH_LINE) 81 | unset(SDL2_TTF_VERSION_MAJOR) 82 | unset(SDL2_TTF_VERSION_MINOR) 83 | unset(SDL2_TTF_VERSION_PATCH) 84 | endif () 85 | 86 | set(SDL2_TTF_LIBRARIES ${SDL2_TTF_LIBRARY}) 87 | set(SDL2_TTF_INCLUDE_DIRS ${SDL2_TTF_INCLUDE_DIR}) 88 | 89 | include(FindPackageHandleStandardArgs) 90 | 91 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL2_ttf 92 | REQUIRED_VARS SDL2_TTF_LIBRARIES SDL2_TTF_INCLUDE_DIRS 93 | VERSION_VAR SDL2_TTF_VERSION_STRING) 94 | 95 | # for backward compatibility 96 | set(SDLTTF_LIBRARY ${SDL2_TTF_LIBRARIES}) 97 | set(SDLTTF_INCLUDE_DIR ${SDL2_TTF_INCLUDE_DIRS}) 98 | set(SDLTTF_FOUND ${SDL2_TTF_FOUND}) 99 | -------------------------------------------------------------------------------- /DungeonsOfNoudar486/cmake_find/FindSDL2_mixer.cmake: -------------------------------------------------------------------------------- 1 | # Locate SDL_mixer library 2 | # 3 | # This module defines: 4 | # 5 | # :: 6 | # 7 | # SDL2_MIXER_LIBRARIES, the name of the library to link against 8 | # SDL2_MIXER_INCLUDE_DIRS, where to find the headers 9 | # SDL2_MIXER_FOUND, if false, do not try to link against 10 | # SDL2_MIXER_VERSION_STRING - human-readable string containing the version of SDL_mixer 11 | # 12 | # 13 | # 14 | # For backward compatibility the following variables are also set: 15 | # 16 | # :: 17 | # 18 | # SDLMIXER_LIBRARY (same value as SDL2_MIXER_LIBRARIES) 19 | # SDLMIXER_INCLUDE_DIR (same value as SDL2_MIXER_INCLUDE_DIRS) 20 | # SDLMIXER_FOUND (same value as SDL2_MIXER_FOUND) 21 | # 22 | # 23 | # 24 | # $SDLDIR is an environment variable that would correspond to the 25 | # ./configure --prefix=$SDLDIR used in building SDL. 26 | # 27 | # Created by Eric Wing. This was influenced by the FindSDL.cmake 28 | # module, but with modifications to recognize OS X frameworks and 29 | # additional Unix paths (FreeBSD, etc). 30 | 31 | #============================================================================= 32 | # Copyright 2005-2009 Kitware, Inc. 33 | # Copyright 2012 Benjamin Eikel 34 | # 35 | # Distributed under the OSI-approved BSD License (the "License"); 36 | # see accompanying file Copyright.txt for details. 37 | # 38 | # This software is distributed WITHOUT ANY WARRANTY; without even the 39 | # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 40 | # See the License for more information. 41 | #============================================================================= 42 | # (To distribute this file outside of CMake, substitute the full 43 | # License text for the above reference.) 44 | 45 | find_path(SDL2_MIXER_INCLUDE_DIR SDL_mixer.h 46 | HINTS 47 | ENV SDL2MIXERDIR 48 | ENV SDL2DIR 49 | PATH_SUFFIXES SDL2 50 | # path suffixes to search inside ENV{SDLDIR} 51 | include/SDL2 include 52 | PATHS ${SDL2_MIXER_PATH} 53 | ) 54 | 55 | if (CMAKE_SIZEOF_VOID_P EQUAL 8) 56 | set(VC_LIB_PATH_SUFFIX lib/x64) 57 | else () 58 | set(VC_LIB_PATH_SUFFIX lib/x86) 59 | endif () 60 | 61 | find_library(SDL2_MIXER_LIBRARY 62 | NAMES SDL2_mixer 63 | HINTS 64 | ENV SDL2MIXERDIR 65 | ENV SDL2DIR 66 | PATH_SUFFIXES lib ${VC_LIB_PATH_SUFFIX} 67 | PATHS ${SDL2_MIXER_PATH} 68 | ) 69 | 70 | if (SDL2_MIXER_INCLUDE_DIR AND EXISTS "${SDL2_MIXER_INCLUDE_DIR}/SDL_mixer.h") 71 | file(STRINGS "${SDL2_MIXER_INCLUDE_DIR}/SDL_mixer.h" SDL2_MIXER_VERSION_MAJOR_LINE REGEX "^#define[ \t]+SDL_MIXER_MAJOR_VERSION[ \t]+[0-9]+$") 72 | file(STRINGS "${SDL2_MIXER_INCLUDE_DIR}/SDL_mixer.h" SDL2_MIXER_VERSION_MINOR_LINE REGEX "^#define[ \t]+SDL_MIXER_MINOR_VERSION[ \t]+[0-9]+$") 73 | file(STRINGS "${SDL2_MIXER_INCLUDE_DIR}/SDL_mixer.h" SDL2_MIXER_VERSION_PATCH_LINE REGEX "^#define[ \t]+SDL_MIXER_PATCHLEVEL[ \t]+[0-9]+$") 74 | string(REGEX REPLACE "^#define[ \t]+SDL_MIXER_MAJOR_VERSION[ \t]+([0-9]+)$" "\\1" SDL2_MIXER_VERSION_MAJOR "${SDL2_MIXER_VERSION_MAJOR_LINE}") 75 | string(REGEX REPLACE "^#define[ \t]+SDL_MIXER_MINOR_VERSION[ \t]+([0-9]+)$" "\\1" SDL2_MIXER_VERSION_MINOR "${SDL2_MIXER_VERSION_MINOR_LINE}") 76 | string(REGEX REPLACE "^#define[ \t]+SDL_MIXER_PATCHLEVEL[ \t]+([0-9]+)$" "\\1" SDL2_MIXER_VERSION_PATCH "${SDL2_MIXER_VERSION_PATCH_LINE}") 77 | set(SDL2_MIXER_VERSION_STRING ${SDL2_MIXER_VERSION_MAJOR}.${SDL2_MIXER_VERSION_MINOR}.${SDL2_MIXER_VERSION_PATCH}) 78 | unset(SDL2_MIXER_VERSION_MAJOR_LINE) 79 | unset(SDL2_MIXER_VERSION_MINOR_LINE) 80 | unset(SDL2_MIXER_VERSION_PATCH_LINE) 81 | unset(SDL2_MIXER_VERSION_MAJOR) 82 | unset(SDL2_MIXER_VERSION_MINOR) 83 | unset(SDL2_MIXER_VERSION_PATCH) 84 | endif () 85 | 86 | set(SDL2_MIXER_LIBRARIES ${SDL2_MIXER_LIBRARY}) 87 | set(SDL2_MIXER_INCLUDE_DIRS ${SDL2_MIXER_INCLUDE_DIR}) 88 | 89 | include(FindPackageHandleStandardArgs) 90 | 91 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL2_mixer 92 | REQUIRED_VARS SDL2_MIXER_LIBRARIES SDL2_MIXER_INCLUDE_DIRS 93 | VERSION_VAR SDL2_MIXER_VERSION_STRING) 94 | 95 | # for backward compatibility 96 | set(SDLMIXER_LIBRARY ${SDL2_MIXER_LIBRARIES}) 97 | set(SDLMIXER_INCLUDE_DIR ${SDL2_MIXER_INCLUDE_DIRS}) 98 | set(SDLMIXER_FOUND ${SDL2_MIXER_FOUND}) 99 | -------------------------------------------------------------------------------- /DungeonsOfNoudar486/cmake_find/FindSDL2_image.cmake: -------------------------------------------------------------------------------- 1 | # Locate SDL_image library 2 | # 3 | # This module defines: 4 | # 5 | # :: 6 | # 7 | # SDL2_IMAGE_LIBRARIES, the name of the library to link against 8 | # SDL2_IMAGE_INCLUDE_DIRS, where to find the headers 9 | # SDL2_IMAGE_FOUND, if false, do not try to link against 10 | # SDL2_IMAGE_VERSION_STRING - human-readable string containing the version of SDL_image 11 | # 12 | # 13 | # 14 | # For backward compatibility the following variables are also set: 15 | # 16 | # :: 17 | # 18 | # SDLIMAGE_LIBRARY (same value as SDL2_IMAGE_LIBRARIES) 19 | # SDLIMAGE_INCLUDE_DIR (same value as SDL2_IMAGE_INCLUDE_DIRS) 20 | # SDLIMAGE_FOUND (same value as SDL2_IMAGE_FOUND) 21 | # 22 | # 23 | # 24 | # $SDLDIR is an environment variable that would correspond to the 25 | # ./configure --prefix=$SDLDIR used in building SDL. 26 | # 27 | # Created by Eric Wing. This was influenced by the FindSDL.cmake 28 | # module, but with modifications to recognize OS X frameworks and 29 | # additional Unix paths (FreeBSD, etc). 30 | 31 | #============================================================================= 32 | # Copyright 2005-2009 Kitware, Inc. 33 | # Copyright 2012 Benjamin Eikel 34 | # 35 | # Distributed under the OSI-approved BSD License (the "License"); 36 | # see accompanying file Copyright.txt for details. 37 | # 38 | # This software is distributed WITHOUT ANY WARRANTY; without even the 39 | # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 40 | # See the License for more information. 41 | #============================================================================= 42 | # (To distribute this file outside of CMake, substitute the full 43 | # License text for the above reference.) 44 | 45 | find_path(SDL2_IMAGE_INCLUDE_DIR SDL_image.h 46 | HINTS 47 | ENV SDL2IMAGEDIR 48 | ENV SDL2DIR 49 | PATH_SUFFIXES SDL2 50 | # path suffixes to search inside ENV{SDLDIR} 51 | include/SDL2 include 52 | PATHS ${SDL2_IMAGE_PATH} 53 | ) 54 | 55 | if(CMAKE_SIZEOF_VOID_P EQUAL 8) 56 | set(VC_LIB_PATH_SUFFIX lib/x64) 57 | else() 58 | set(VC_LIB_PATH_SUFFIX lib/x86) 59 | endif() 60 | 61 | find_library(SDL2_IMAGE_LIBRARY 62 | NAMES SDL2_image 63 | HINTS 64 | ENV SDL2IMAGEDIR 65 | ENV SDL2DIR 66 | PATH_SUFFIXES lib ${VC_LIB_PATH_SUFFIX} 67 | PATHS ${SDL2_IMAGE_PATH} 68 | ) 69 | 70 | if(SDL2_IMAGE_INCLUDE_DIR AND EXISTS "${SDL2_IMAGE_INCLUDE_DIR}/SDL_image.h") 71 | file(STRINGS "${SDL2_IMAGE_INCLUDE_DIR}/SDL_image.h" SDL2_IMAGE_VERSION_MAJOR_LINE REGEX "^#define[ \t]+SDL_IMAGE_MAJOR_VERSION[ \t]+[0-9]+$") 72 | file(STRINGS "${SDL2_IMAGE_INCLUDE_DIR}/SDL_image.h" SDL2_IMAGE_VERSION_MINOR_LINE REGEX "^#define[ \t]+SDL_IMAGE_MINOR_VERSION[ \t]+[0-9]+$") 73 | file(STRINGS "${SDL2_IMAGE_INCLUDE_DIR}/SDL_image.h" SDL2_IMAGE_VERSION_PATCH_LINE REGEX "^#define[ \t]+SDL_IMAGE_PATCHLEVEL[ \t]+[0-9]+$") 74 | string(REGEX REPLACE "^#define[ \t]+SDL_IMAGE_MAJOR_VERSION[ \t]+([0-9]+)$" "\\1" SDL2_IMAGE_VERSION_MAJOR "${SDL2_IMAGE_VERSION_MAJOR_LINE}") 75 | string(REGEX REPLACE "^#define[ \t]+SDL_IMAGE_MINOR_VERSION[ \t]+([0-9]+)$" "\\1" SDL2_IMAGE_VERSION_MINOR "${SDL2_IMAGE_VERSION_MINOR_LINE}") 76 | string(REGEX REPLACE "^#define[ \t]+SDL_IMAGE_PATCHLEVEL[ \t]+([0-9]+)$" "\\1" SDL2_IMAGE_VERSION_PATCH "${SDL2_IMAGE_VERSION_PATCH_LINE}") 77 | set(SDL2_IMAGE_VERSION_STRING ${SDL2_IMAGE_VERSION_MAJOR}.${SDL2_IMAGE_VERSION_MINOR}.${SDL2_IMAGE_VERSION_PATCH}) 78 | unset(SDL2_IMAGE_VERSION_MAJOR_LINE) 79 | unset(SDL2_IMAGE_VERSION_MINOR_LINE) 80 | unset(SDL2_IMAGE_VERSION_PATCH_LINE) 81 | unset(SDL2_IMAGE_VERSION_MAJOR) 82 | unset(SDL2_IMAGE_VERSION_MINOR) 83 | unset(SDL2_IMAGE_VERSION_PATCH) 84 | endif() 85 | 86 | set(SDL2_IMAGE_LIBRARIES ${SDL2_IMAGE_LIBRARY}) 87 | set(SDL2_IMAGE_INCLUDE_DIRS ${SDL2_IMAGE_INCLUDE_DIR}) 88 | 89 | include(FindPackageHandleStandardArgs) 90 | 91 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL2_image 92 | REQUIRED_VARS SDL2_IMAGE_LIBRARIES SDL2_IMAGE_INCLUDE_DIRS 93 | VERSION_VAR SDL2_IMAGE_VERSION_STRING) 94 | 95 | # for backward compatibility 96 | set(SDLIMAGE_LIBRARY ${SDL2_IMAGE_LIBRARIES}) 97 | set(SDLIMAGE_INCLUDE_DIR ${SDL2_IMAGE_INCLUDE_DIRS}) 98 | set(SDLIMAGE_FOUND ${SDL2_IMAGE_FOUND}) 99 | 100 | mark_as_advanced(SDL2_IMAGE_LIBRARY SDL2_IMAGE_INCLUDE_DIR) 101 | -------------------------------------------------------------------------------- /noudar-rendering/DungeonGLES2Renderer.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by monty on 23/11/15. 3 | // 4 | 5 | #ifndef NOUDARRENDERING_DUNGEONRENDERER_H 6 | #define NOUDARRENDERING_DUNGEONRENDERER_H 7 | 8 | 9 | namespace odb { 10 | 11 | enum EShaderType { 12 | kVertexShader, 13 | kFragmentShader, 14 | }; 15 | 16 | const CLerp kNoFade = CLerp(1000, 1000, 0);; 17 | 18 | class DungeonGLES2Renderer { 19 | 20 | private: 21 | void fetchShaderLocations(); 22 | 23 | void setPerspective(); 24 | 25 | void prepareShaderProgram(); 26 | 27 | void clearBuffers(); 28 | 29 | void resetTransformMatrices(); 30 | 31 | void printVerboseDriverInformation(); 32 | 33 | void createVBOs(); 34 | 35 | void deleteVBOs(); 36 | 37 | void drawGeometry(const int vertexVbo, const int indexVbo, 38 | int vertexCount, 39 | const glm::mat4 &transform, float shade); 40 | 41 | int createProgram(const char *pVertexSource, const char *pFragmentSource); 42 | 43 | int loadShader(EShaderType shaderType, const char *pSource); 44 | 45 | void consumeRenderingBatches(long animationTime); 46 | 47 | void produceRenderingBatches(const NoudarDungeonSnapshot &snapshot); 48 | 49 | void initTileProperties(); 50 | 51 | private: 52 | int frame = 0; 53 | int vertexAttributePosition; 54 | int samplerUniformPosition; 55 | int textureCoordinatesAttributePosition; 56 | int projectionViewMatrixAttributePosition; 57 | int gProgram; 58 | int uMod; 59 | int uScale; 60 | int fadeUniform; 61 | int mSkyboxVBOVertexId = -1; 62 | int mBillboardVBOVertexId = -1; 63 | glm::mat4 projectionMatrix; 64 | glm::mat4 mViewMatrix = glm::mat4(1.0f); 65 | std::unordered_map> batches; 66 | std::unordered_map mElementMap; 67 | vector> mBitmaps; 68 | vector mTextures; 69 | std::unordered_map mVBORegisters; 70 | std::unordered_map mTextureRegistry; 71 | CTilePropertyMap mTileProperties; 72 | 73 | //interaction 74 | glm::vec3 mCurrentCharacterPosition; 75 | 76 | //VBOs 77 | const static float cubeVertices[16 * 5]; 78 | const static unsigned short cubeIndices[6 * 4]; 79 | 80 | static const float billboardVertices[20]; 81 | static const unsigned short billboardIndices[6]; 82 | 83 | static const float cornerLeftFarVertices[20]; 84 | static const unsigned short cornerLeftFarIndices[6]; 85 | 86 | static const float cornerLeftNearVertices[20]; 87 | static const unsigned short cornerLeftNearIndices[6]; 88 | 89 | static const float floorVertices[20]; 90 | static const unsigned short floorIndices[6]; 91 | 92 | static const float skyVertices[20]; 93 | static const unsigned short skyIndices[6]; 94 | 95 | RenderingJobSnapshotAdapter mSnapshotAdapter; 96 | Camera mCamera; 97 | CLerp mFadeLerp = kNoFade; 98 | public: 99 | //basic bookeeping 100 | DungeonGLES2Renderer(); 101 | 102 | void reloadTextures(); 103 | 104 | void unloadTextures(); 105 | 106 | ~DungeonGLES2Renderer(); 107 | 108 | bool init(float w, float h, const std::string &vertexShader, 109 | const std::string &fragmentShader); 110 | 111 | void setTexture(vector> textures); 112 | 113 | void render(const NoudarDungeonSnapshot &snapshot); 114 | 115 | void shutdown(); 116 | 117 | void invalidateCachedBatches(); 118 | 119 | void setTileProperties(CTilePropertyMap propertyMap); 120 | 121 | void setPerspectiveMatrix(float *perspectiveMatrix); 122 | 123 | VBORegister 124 | submitVBO(float *data, int vertices, unsigned short *indexData, unsigned int indices); 125 | 126 | //camera controls 127 | 128 | void updateCamera(long ms); 129 | 130 | void rotateLeft(); 131 | 132 | void rotateRight(); 133 | 134 | bool isAnimating(); 135 | 136 | void setEyeView(float *eyeView); 137 | 138 | void setAngleXZ(float xz); 139 | 140 | void setAngleYZ(float yz); 141 | 142 | //fade 143 | void startFadingIn(); 144 | 145 | void startFadingOut(); 146 | 147 | void updateFadeState(long ms); 148 | 149 | //interactions 150 | void resetCamera(); 151 | }; 152 | } 153 | #endif //NOUDARRENDERING_DUNGEONRENDERER_H 154 | -------------------------------------------------------------------------------- /DungeonsOfNoudar486/src/CPackedFileReader.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by monty on 06-12-2017. 3 | // 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | using std::vector; 11 | 12 | #include "Common.h" 13 | #include "IFileLoaderDelegate.h" 14 | #include "CPackedFileReader.h" 15 | 16 | 17 | #ifdef ANDROID 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | 24 | extern AAssetManager *defaultAssetManager; 25 | 26 | int android_read(void *cookie, char *buf, int size) { 27 | return AAsset_read((AAsset *) cookie, buf, size); 28 | } 29 | 30 | int android_write(void *cookie, const char *buf, int size) { 31 | return EACCES; 32 | } 33 | 34 | fpos_t android_seek(void *cookie, fpos_t offset, int whence) { 35 | return AAsset_seek((AAsset *) cookie, offset, whence); 36 | } 37 | 38 | int android_close(void *cookie) { 39 | AAsset_close((AAsset *) cookie); 40 | return 0; 41 | } 42 | 43 | 44 | FILE *android_fopen(const char* filename) { 45 | 46 | AAsset *asset = AAssetManager_open(defaultAssetManager, "data.pfs", 0); 47 | if (!asset) { 48 | return NULL; 49 | } 50 | 51 | return funopen(asset, android_read, android_write, android_seek, android_close); 52 | 53 | } 54 | #endif 55 | 56 | odb::CPackedFileReader::CPackedFileReader(std::string dataFilePath) : mPackPath(dataFilePath) { 57 | #ifndef ANDROID 58 | FILE *mDataPack = fopen(mPackPath.c_str(), "rb"); 59 | #else 60 | FILE *mDataPack = android_fopen(&mPackPath[0]); 61 | #endif 62 | 63 | uint16_t entries = 0; 64 | fread(&entries, 2, 1, mDataPack); 65 | 66 | char buffer[85]; 67 | 68 | for ( int c = 0; c < entries; ++c ) { 69 | 70 | uint32_t offset = 0; 71 | fread(&offset, 4, 1, mDataPack ); 72 | 73 | uint8_t stringSize = 0; 74 | fread(&stringSize, 1, 1, mDataPack ); 75 | 76 | fread(&buffer, stringSize + 1, 1, mDataPack ); 77 | std::string name = buffer; 78 | 79 | #ifdef SDLSW 80 | // std::cout << "name " << name << " offset " << offset << std::endl; 81 | #endif 82 | mOffsets[name] = offset; 83 | } 84 | 85 | fclose(mDataPack); 86 | } 87 | 88 | size_t odb::CPackedFileReader::sizeOfFile(const std::string& path) { 89 | #ifndef ANDROID 90 | FILE *mDataPack = fopen(mPackPath.c_str(), "rb"); 91 | #else 92 | FILE *mDataPack = android_fopen(&mPackPath[0]); 93 | #endif 94 | 95 | uint32_t offset = mOffsets[ path ]; 96 | if ( offset == 0 ) { 97 | printf("failed to load %s", path.c_str()); 98 | exit(-1); 99 | } 100 | 101 | auto result = fseek( mDataPack, offset, SEEK_SET ); 102 | 103 | uint32_t size = 0; 104 | fread(&size, 4, 1, mDataPack ); 105 | fclose(mDataPack); 106 | 107 | return size; 108 | } 109 | 110 | uint8_t* odb::CPackedFileReader::loadBinaryFileFromPath(const std::string &path) { 111 | uint8_t* toReturn; 112 | #ifndef ANDROID 113 | FILE *mDataPack = fopen(mPackPath.c_str(), "rb"); 114 | #else 115 | FILE *mDataPack = android_fopen(&mPackPath[0]); 116 | #endif 117 | 118 | uint32_t offset = mOffsets[ path ]; 119 | if ( offset == 0 ) { 120 | printf("failed to load %s", path.c_str()); 121 | exit(-1); 122 | } 123 | 124 | auto result = fseek( mDataPack, offset, SEEK_SET ); 125 | 126 | uint32_t size = 0; 127 | char data; 128 | fread(&size, 4, 1, mDataPack ); 129 | toReturn = new uint8_t[size]; 130 | 131 | auto ptr = toReturn; 132 | for ( int c = 0; c < size; ++c ) { 133 | fread(&data, 1, 1, mDataPack ); 134 | (*ptr++)=(data); 135 | } 136 | fclose(mDataPack); 137 | 138 | return toReturn; 139 | } 140 | 141 | std::string odb::CPackedFileReader::loadFileFromPath(const std::string &path) { 142 | std::string toReturn; 143 | #ifndef ANDROID 144 | FILE *mDataPack = fopen(mPackPath.c_str(), "rb"); 145 | #else 146 | FILE *mDataPack = android_fopen(&mPackPath[0]); 147 | #endif 148 | 149 | uint32_t offset = mOffsets[ path ]; 150 | if ( offset == 0 ) { 151 | printf("failed to load %s", path.c_str()); 152 | exit(-1); 153 | } 154 | auto result = fseek( mDataPack, offset, SEEK_SET ); 155 | 156 | uint32_t size = 0; 157 | char data; 158 | fread(&size, 4, 1, mDataPack ); 159 | 160 | for ( int c = 0; c < size; ++c ) { 161 | fread(&data, 1, 1, mDataPack ); 162 | toReturn.push_back(data); 163 | } 164 | fclose(mDataPack); 165 | 166 | return toReturn; 167 | } 168 | 169 | std::string odb::CPackedFileReader::getFilePathPrefix() { 170 | return ""; 171 | } 172 | 173 | odb::CPackedFileReader::~CPackedFileReader() { 174 | 175 | } -------------------------------------------------------------------------------- /DungeonsOfNoudar486/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.8) 2 | project(DungeonsOfNoudar486) 3 | 4 | 5 | set(CMAKE_CXX_STANDARD 14) 6 | set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake_find") 7 | 8 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DDONT_LOAD_LEVEL_UPON_START -DUSE_ITEMS_INSTANTLY -DVGA -DSDLSW") 9 | 10 | 11 | find_package(SDL2 REQUIRED) 12 | 13 | include_directories(${SDL2_INCLUDE_DIR}) 14 | 15 | include_directories(include) 16 | include_directories(../fixed_point/include) 17 | include_directories(../noudar-core/noudar-core/include) 18 | include_directories(../stb) 19 | include_directories(../noudar-rendering) 20 | 21 | set(SOURCE_FILES 22 | SDLVersion/CSDLRenderer.cpp 23 | src/CRenderer.cpp 24 | src/CRenderer_Rasterization.cpp 25 | src/CRenderer_Tesselation.cpp 26 | src/NativeBitmap.cpp 27 | src/RasterizerCommon.cpp 28 | src/CTile3DProperties.cpp 29 | src/VisibilityStrategy.cpp 30 | include/RasterizerCommon.h 31 | include/CRenderer.h 32 | include/RaycastCommon.h 33 | main.cpp 34 | events.cpp 35 | ../noudar-core/noudar-core/include/commands/CMoveActorCommand.h 36 | ../noudar-core/noudar-core/include/commands/CEndTurnCommand.h 37 | ../noudar-core/noudar-core/include/commands/CLoadNewLevelCommand.h 38 | ../noudar-core/noudar-core/include/commands/CNullCommand.h 39 | ../noudar-core/noudar-core/include/commands/CUseCurrentItemCommand.h 40 | ../noudar-core/noudar-core/include/commands/CQuitCommand.h 41 | ../noudar-core/noudar-core/include/commands/CTurnActorCommand.h 42 | ../noudar-core/noudar-core/include/commands/CDropItemCommand.h 43 | ../noudar-core/noudar-core/include/commands/CPickItemCommand.h 44 | ../noudar-core/noudar-core/include/commands/CSuggestItemCommand.h 45 | ../noudar-core/noudar-core/include/commands/IGameCommand.h 46 | ../noudar-core/noudar-core/include/CActor.h 47 | ../noudar-core/noudar-core/include/CMonsterGenerator.h 48 | ../noudar-core/noudar-core/include/CMonster.h 49 | ../noudar-core/noudar-core/include/CDoorway.h 50 | ../noudar-core/noudar-core/include/CGame.h 51 | ../noudar-core/noudar-core/include/CMap.h 52 | ../noudar-core/noudar-core/include/IRenderer.h 53 | ../noudar-core/noudar-core/include/Vec2i.h 54 | ../noudar-core/noudar-core/include/CTeam.h 55 | ../noudar-core/noudar-core/include/CCharacterArchetype.h 56 | ../noudar-core/noudar-core/include/CCharacter.h 57 | ../noudar-core/noudar-core/src/commands/CMoveActorCommand.cpp 58 | ../noudar-core/noudar-core/src/commands/CEndTurnCommand.cpp 59 | ../noudar-core/noudar-core/src/commands/CLoadNewLevelCommand.cpp 60 | ../noudar-core/noudar-core/src/commands/CNullCommand.cpp 61 | ../noudar-core/noudar-core/src/commands/CQuitCommand.cpp 62 | ../noudar-core/noudar-core/src/commands/CTurnActorCommand.cpp 63 | ../noudar-core/noudar-core/src/commands/CCycleNextItemCommand.cpp 64 | ../noudar-core/noudar-core/src/commands/CPickItemCommand.cpp 65 | ../noudar-core/noudar-core/src/commands/CDropItemCommand.cpp 66 | ../noudar-core/noudar-core/src/commands/CSuggestItemCommand.cpp 67 | ../noudar-core/noudar-core/src/commands/CCyclePreviousItemCommand.cpp 68 | ../noudar-core/noudar-core/src/commands/CUseCurrentItemCommand.cpp 69 | ../noudar-core/noudar-core/src/commands/IGameCommand.cpp 70 | ../noudar-core/noudar-core/src/Vec2i.cpp 71 | ../noudar-core/noudar-core/src/Common.cpp 72 | ../noudar-core/noudar-core/src/CActor.cpp 73 | ../noudar-core/noudar-core/src/CItem.cpp 74 | ../noudar-core/noudar-core/include/CItem.h 75 | ../noudar-core/noudar-core/src/CCharacter.cpp 76 | ../noudar-core/noudar-core/src/CMonsterGenerator.cpp 77 | ../noudar-core/noudar-core/include/CMonsterGenerator.h 78 | ../noudar-core/noudar-core/src/CCharacterArchetype.cpp 79 | ../noudar-core/noudar-core/src/CGameDelegate.cpp 80 | ../noudar-core/noudar-core/src/CMonster.cpp 81 | ../noudar-core/noudar-core/src/IFileLoaderDelegate.cpp 82 | ../noudar-core/noudar-core/src/CTeam.cpp 83 | ../noudar-core/noudar-core/src/CDoorway.cpp 84 | ../noudar-core/noudar-core/src/CGame.cpp 85 | ../noudar-core/noudar-core/src/CMap.cpp 86 | ../noudar-core/noudar-core/src/IMapElement.cpp 87 | ../noudar-core/noudar-core/src/CStorageItem.cpp 88 | ../noudar-core/noudar-core/include/CStorageItem.h 89 | OPL2LPT/MusicSDL.cpp 90 | ../noudar-rendering/Logger.cpp 91 | ../noudar-rendering/LoadPNG.cpp 92 | src/CPackedFileReader.cpp 93 | include/CPackedFileReader.h 94 | src/CPackedFileReader.cpp 95 | include/CPackedFileReader.h) 96 | 97 | include (FindPkgConfig) 98 | 99 | add_executable(DungeonsOfNoudar486 ${SOURCE_FILES} ) 100 | 101 | target_include_directories(DungeonsOfNoudar486 PUBLIC ${SDL2_INCLUDE_DIR}) 102 | target_link_libraries(DungeonsOfNoudar486 ${SDL2_LIBRARY} m ) -------------------------------------------------------------------------------- /DungeonsOfNoudar486/src/CTile3DProperties.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by monty on 14/01/17. 3 | // 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | 17 | using sg14::fixed_point; 18 | using std::vector; 19 | using std::array; 20 | 21 | #include "Vec2i.h" 22 | #include "IMapElement.h" 23 | #include "CTeam.h" 24 | #include "CItem.h" 25 | #include "CActor.h" 26 | #include "CGameDelegate.h" 27 | #include "MapWithCharKey.h" 28 | #include "CMap.h" 29 | #include "NativeBitmap.h" 30 | #include "Logger.h" 31 | #include "RasterizerCommon.h" 32 | #include "CTile3DProperties.h" 33 | 34 | namespace odb { 35 | 36 | GeometryType parseGeometryType(std::string token); 37 | 38 | CTile3DProperties readPropertiesLine( std::string::iterator pos0, std::string::iterator pos1 ) { 39 | 40 | CTile3DProperties properties; 41 | std::string::iterator pos2; 42 | //the ID; 43 | ++pos0; 44 | 45 | while( std::isspace( *pos0 ) && pos0 != pos1 ) { ++pos0; }; 46 | properties.mNeedsAlphaTest = ( *pos0 == '1'); 47 | ++pos0; 48 | 49 | while( std::isspace( *pos0 ) && pos0 != pos1 ) { ++pos0; } 50 | pos2 = pos0; 51 | while( !std::isspace( *pos2 ) && pos2 != pos1 ) { ++pos2; } 52 | properties.mCeilingTexture = std::string{ pos0, pos2 }; 53 | pos0 = pos2 + 1; 54 | 55 | while( std::isspace( *pos0 ) && pos0 != pos1 ) { ++pos0; } 56 | pos2 = pos0; 57 | while( !std::isspace( *pos2 ) && pos2 != pos1 ) { ++pos2; } 58 | properties.mFloorTexture = std::string{ pos0, pos2 }; 59 | pos0 = pos2 + 1; 60 | 61 | while( std::isspace( *pos0 ) && pos0 != pos1 ) { ++pos0; } 62 | pos2 = pos0; 63 | while( !std::isspace( *pos2 ) && pos2 != pos1 ) { ++pos2; } 64 | properties.mMainWallTexture = std::string{ pos0, pos2 }; 65 | pos0 = pos2 + 1; 66 | 67 | while( std::isspace( *pos0 ) && pos0 != pos1 ) { ++pos0; } 68 | pos2 = pos0; 69 | while( !std::isspace( *pos2 ) && pos2 != pos1 ) { ++pos2; } 70 | properties.mGeometryType = parseGeometryType( std::string( pos0, pos2 ) ); 71 | pos0 = pos2 + 1; 72 | 73 | while( std::isspace( *pos0 ) && pos0 != pos1 ) { ++pos0; } 74 | pos2 = pos0; 75 | while( !std::isspace( *pos2 ) && pos2 != pos1 ) { ++pos2; } 76 | properties.mCeilingRepeatedWallTexture = std::string{ pos0, pos2 }; 77 | pos0 = pos2 + 1; 78 | 79 | while( std::isspace( *pos0 ) && pos0 != pos1 ) { ++pos0; } 80 | pos2 = pos0; 81 | while( !std::isspace( *pos2 ) && pos2 != pos1 ) { ++pos2; } 82 | properties.mFloorRepeatedWallTexture = std::string{ pos0, pos2 }; 83 | pos0 = pos2 + 1; 84 | 85 | while( std::isspace( *pos0 ) && pos0 != pos1 ) { ++pos0; } 86 | properties.mCeilingRepetitions = *pos0 - '0'; 87 | pos0++; 88 | 89 | while( std::isspace( *pos0 ) && pos0 != pos1 ) { ++pos0; } 90 | pos2 = pos0; 91 | while( !std::isspace( *pos2 ) && pos2 != pos1 ) { ++pos2; } 92 | properties.mFloorRepetitions = *pos0 - '0'; 93 | pos0++; 94 | 95 | 96 | while( std::isspace( *pos0 ) && pos0 != pos1 ) { ++pos0; } 97 | pos2 = pos0; 98 | while( !std::isspace( *pos2 ) && pos2 != pos1 ) { ++pos2; } 99 | properties.mCeilingHeight = FixP{atof( std::string{ pos0, pos2}.c_str() )}; 100 | pos0 = pos2 + 1; 101 | 102 | while( std::isspace( *pos0 ) && pos0 != pos1 ) { ++pos0; } 103 | pos2 = pos0; 104 | while( !std::isspace( *pos2 ) && pos2 != pos1 ) { ++pos2; } 105 | properties.mFloorHeight = FixP{atof( std::string{ pos0, pos2}.c_str() )}; 106 | 107 | return properties; 108 | } 109 | 110 | GeometryType parseGeometryType(std::string token) { 111 | 112 | if ( token == "cube") { 113 | return kCube; 114 | } 115 | 116 | if ( token == "leftfar") { 117 | return kRightNearWall; 118 | } 119 | 120 | if ( token == "leftnear") { 121 | return kLeftNearWall; 122 | } 123 | 124 | return kNone; 125 | } 126 | 127 | 128 | CTilePropertyMap CTile3DProperties::parsePropertyList(std::string propertyFile) { 129 | 130 | odb::CTilePropertyMap map; 131 | vector tokens; 132 | int line = 0; 133 | 134 | auto ptr = std::begin(propertyFile); 135 | auto end = std::end(propertyFile); 136 | auto lineBegin = ptr; 137 | 138 | while ( ptr <= end ) { 139 | 140 | if ( ptr == end || *ptr == '\n' ) { 141 | CTileId id = *lineBegin; 142 | auto props = readPropertiesLine(lineBegin, ptr); 143 | tokens.clear(); 144 | map[id] = props; 145 | lineBegin = ptr + 1; 146 | } 147 | 148 | ++ptr; 149 | } 150 | 151 | return map; 152 | } 153 | } 154 | 155 | -------------------------------------------------------------------------------- /DungeonsOfNoudar486/main.cpp: -------------------------------------------------------------------------------- 1 | #if defined(WINVER) 2 | #include 3 | #endif 4 | 5 | #ifdef __DJGPP__ 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #else 12 | const long UCLOCKS_PER_SEC = 1000; 13 | 14 | long uclock(); 15 | 16 | #endif 17 | 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | 31 | #ifdef __EMSCRIPTEN__ 32 | #include 33 | #include 34 | #endif 35 | 36 | enum class ESoundDriver { 37 | kNone, kPcSpeaker, kOpl2Lpt, kAdlib, kTandy, kCovox 38 | }; 39 | 40 | ESoundDriver soundDriver = ESoundDriver::kNone; 41 | void initOPL2(int port); 42 | void playTune(const std::string &); 43 | 44 | ///game interface 45 | void init(); 46 | void loopTick(long ms); 47 | void shutdown(); 48 | bool isPlaying(); 49 | /// 50 | #ifdef __EMSCRIPTEN__ 51 | void emscriptenLoopTick() { 52 | loopTick(50); 53 | } 54 | #endif 55 | 56 | #ifdef __APPLE__ 57 | int main(int argc, char **argv) { 58 | #else 59 | 60 | #if defined(WINVER) 61 | 62 | namespace odb { 63 | LRESULT CALLBACK WindProcedure(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam); 64 | } 65 | 66 | 67 | 68 | int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, 69 | LPSTR lpCmdLine, int nCmdShow) 70 | { 71 | 72 | HINSTANCE hInst; 73 | 74 | WNDCLASSEX WndCls; 75 | static char szAppName[] = "DungeonsOfNoudar95"; 76 | MSG Msg; 77 | 78 | hInst = hInstance; 79 | WndCls.cbSize = sizeof(WndCls); 80 | WndCls.style = CS_OWNDC | CS_VREDRAW | CS_HREDRAW; 81 | WndCls.lpfnWndProc = odb::WindProcedure; 82 | WndCls.cbClsExtra = 0; 83 | WndCls.cbWndExtra = 0; 84 | WndCls.hInstance = hInst; 85 | WndCls.hIcon = LoadIcon(NULL, IDI_APPLICATION); 86 | WndCls.hCursor = LoadCursor(NULL, IDC_ARROW); 87 | WndCls.hbrBackground = (HBRUSH) GetStockObject(WHITE_BRUSH); 88 | WndCls.lpszMenuName = NULL; 89 | WndCls.lpszClassName = szAppName; 90 | WndCls.hIconSm = LoadIcon(hInstance, IDI_APPLICATION); 91 | RegisterClassEx(&WndCls); 92 | 93 | CreateWindowEx(WS_EX_OVERLAPPEDWINDOW, 94 | szAppName, 95 | "Dungeons of Noudar 95", 96 | WS_OVERLAPPEDWINDOW | WS_VISIBLE, 97 | CW_USEDEFAULT, 98 | CW_USEDEFAULT, 99 | 320, 100 | 240, 101 | NULL, 102 | NULL, 103 | hInstance, 104 | NULL); 105 | 106 | #else 107 | 108 | int main(int argc, char **argv) { 109 | puts("\n\nDungeons of Noudar 3D 1.2 startup.\nCopyright 2016-2022 Brotherhood of 13h."); 110 | 111 | if (argc >= 2) { 112 | if (!std::strcmp(argv[1], "opl2lpt")) { 113 | soundDriver = ESoundDriver::kOpl2Lpt; 114 | initOPL2(-1); 115 | playTune("t200i101o1a"); 116 | } else if (!std::strcmp(argv[1], "adlib")) { 117 | soundDriver = ESoundDriver::kAdlib; 118 | initOPL2(0x0388); 119 | playTune("t200i101o1a"); 120 | } else if (!std::strcmp(argv[1], "pcspeaker")) { 121 | soundDriver = ESoundDriver::kPcSpeaker; 122 | } 123 | } 124 | #ifdef __DJGPP__ 125 | else { 126 | puts("\n\nPlease select a sound driver:"); 127 | puts("1 - PC Speaker"); 128 | puts("2 - Adlib"); 129 | puts("3 - OPL2LPT on LPT1"); 130 | puts("4 - No sound"); 131 | puts("5 - Quit"); 132 | 133 | uint8_t selection = getch(); 134 | 135 | switch( selection ) { 136 | case '1': 137 | soundDriver = ESoundDriver::kPcSpeaker; 138 | break; 139 | 140 | case '2': 141 | soundDriver = ESoundDriver::kAdlib; 142 | initOPL2(0x0388); 143 | playTune("t200i101o1a"); 144 | break; 145 | 146 | case '3': 147 | soundDriver = ESoundDriver::kOpl2Lpt; 148 | initOPL2(-1); 149 | playTune("t200i101o1a"); 150 | break; 151 | 152 | case '4': 153 | break; 154 | case '5': 155 | exit(0); 156 | return 0; 157 | } 158 | } 159 | #endif 160 | 161 | #endif 162 | 163 | #endif 164 | 165 | init(); 166 | 167 | #ifdef __EMSCRIPTEN__ 168 | emscripten_set_main_loop(emscriptenLoopTick, 20, 1); 169 | #else 170 | clock_t diff = 0; 171 | 172 | while (isPlaying()) { 173 | clock_t t0 = 0; 174 | clock_t t1 = 0; 175 | 176 | t0 = uclock(); 177 | 178 | loopTick(diff); 179 | 180 | t1 = uclock(); 181 | 182 | diff = (1000 * (t1 - t0)) / UCLOCKS_PER_SEC; 183 | 184 | if (diff == 0) { 185 | diff = 1; 186 | } 187 | } 188 | #endif 189 | 190 | shutdown(); 191 | 192 | return 0; 193 | } 194 | -------------------------------------------------------------------------------- /noudar-rendering/Camera.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by monty on 09/02/17. 3 | // 4 | #include "glm/glm.hpp" 5 | #include "glm/gtc/matrix_transform.hpp" 6 | 7 | #include 8 | #include 9 | 10 | #include 11 | 12 | #include "glm/gtc/type_ptr.hpp" 13 | 14 | #include "Camera.h" 15 | 16 | const static bool kUseQuarterAngles = true; 17 | 18 | const static bool kCompleteMovementInstantly = false; 19 | 20 | 21 | static const auto transformIdentity = glm::mat4(1.0f); 22 | 23 | glm::mat4 odb::Camera::getTransform() { 24 | return mTransform; 25 | } 26 | 27 | void odb::Camera::rotateBy(glm::vec3 axis, int degrees) { 28 | mTransform = glm::rotate(mTransform, (float) degrees, axis); 29 | } 30 | 31 | void odb::Camera::rotateTo(glm::vec3 axis, int degrees) { 32 | mTransform = glm::rotate(transformIdentity, (float) degrees, axis); 33 | } 34 | 35 | void odb::Camera::moveBy(glm::vec3 delta) { 36 | mTransform = glm::translate(mTransform, delta); 37 | } 38 | 39 | void odb::Camera::moveTo(glm::vec3 position) { 40 | mTransform = glm::translate(transformIdentity, position); 41 | } 42 | 43 | glm::vec3 odb::Camera::getPosition() { 44 | return {mTransform[3][0], 45 | mTransform[3][1], 46 | mTransform[3][2] 47 | }; 48 | } 49 | 50 | void odb::Camera::update(long ms) { 51 | cameraPosition.x += (ms * (mCameraTarget.x - cameraPosition.x)) / 1000; 52 | cameraPosition.y += (ms * (mCameraTarget.y - cameraPosition.y)) / 1000; 53 | 54 | if (mRotationTarget > mCameraRotation) { 55 | 56 | 57 | if (kUseQuarterAngles) { 58 | mCameraRotation = std::min(mCameraRotation + 45, mRotationTarget); 59 | } else { 60 | mCameraRotation = std::min(mCameraRotation + 5, mRotationTarget); 61 | } 62 | } else if (mRotationTarget < mCameraRotation) { 63 | if (kUseQuarterAngles) { 64 | mCameraRotation = std::max(mCameraRotation - 45, mRotationTarget); 65 | } else { 66 | mCameraRotation = std::max(mCameraRotation - 5, mRotationTarget); 67 | } 68 | } 69 | } 70 | 71 | void odb::Camera::incrementRotateTarget(int delta) { 72 | this->mRotationTarget += delta; 73 | 74 | if (kCompleteMovementInstantly) { 75 | mCameraRotation += delta; 76 | } else { 77 | if (kUseQuarterAngles) { 78 | mCameraRotation += delta / 2; 79 | } 80 | } 81 | } 82 | 83 | bool odb::Camera::isAnimating() { 84 | return mRotationTarget != mCameraRotation; 85 | } 86 | 87 | void odb::Camera::setEyeView(float *eyeView) { 88 | mEyeView = eyeView; 89 | } 90 | 91 | void odb::Camera::reset() { 92 | mAngleXZ = 0; 93 | mAngleYZ = 0; 94 | mCameraRotation = 0; 95 | mRotationTarget = 0; 96 | } 97 | 98 | void odb::Camera::setRotationXZ(float xz) { 99 | mAngleXZ = xz; 100 | } 101 | 102 | void odb::Camera::setRotationYZ(float yz) { 103 | mAngleYZ = yz; 104 | } 105 | 106 | int odb::Camera::getCameraRotationXZ() const { 107 | return (mCameraRotation) + mAngleXZ; 108 | } 109 | 110 | glm::mat4 odb::Camera::getViewMatrix(glm::vec3 position) { 111 | 112 | if (!kUseQuarterAngles) { 113 | glm::vec3 pos = position; 114 | glm::vec4 pos_front4 = glm::vec4(0.0f, 0.0f, -1.0f, 0.0f); 115 | glm::vec3 pos_front; 116 | glm::mat4 eyeMatrixOriginal = 117 | mEyeView != nullptr ? glm::make_mat4(mEyeView) : glm::mat4(1.0f); 118 | glm::mat4 eyeMatrix = glm::mat4(1.0f); 119 | 120 | eyeMatrix[3][0] = eyeMatrixOriginal[3][0]; 121 | eyeMatrix[3][1] = eyeMatrixOriginal[3][1]; 122 | eyeMatrix[3][2] = eyeMatrixOriginal[3][2]; 123 | 124 | float angleInRadiansYZ = mAngleYZ * (3.14159f / 180.0f); 125 | float angleInRadiansXZ = (mAngleXZ - mCameraRotation) * (3.14159f / 180.0f); 126 | 127 | glm::vec3 mCameraDirection{0, 0, 0}; 128 | 129 | auto direction4 = glm::rotate( 130 | glm::rotate(glm::mat4(1.0f), angleInRadiansXZ, glm::vec3(0.0f, 1.0f, 0.0f)), 131 | angleInRadiansYZ, glm::vec3(1.0f, 0.0f, 0.0f)) * pos_front4; 132 | 133 | mCameraDirection = glm::vec3(direction4.x, direction4.y, direction4.z); 134 | 135 | pos_front = mCameraDirection; 136 | 137 | const glm::vec3 forward{ 138 | pos_front.x + pos.x, 139 | pos_front.y + pos.y, 140 | pos_front.z + pos.z 141 | }; 142 | 143 | 144 | return glm::lookAt( 145 | pos, 146 | forward, 147 | glm::vec3(0.0f, 1.0, 0.0f)) * eyeMatrix; 148 | } else { 149 | 150 | int direction = (mCameraRotation / 45); 151 | 152 | direction = direction % 8; 153 | 154 | while (direction < 0) { 155 | direction += 8; 156 | } 157 | 158 | static const glm::vec3 forward[8]{ 159 | glm::vec3(0.0f, 0.0f, -1.0f), 160 | glm::vec3(1.0f, 0.0f, -1.0f), 161 | glm::vec3(1.0f, 0.0f, 0.0f), 162 | glm::vec3(1.0f, 0.0f, 1.0f), 163 | glm::vec3(0.0f, 0.0f, 1.0f), 164 | glm::vec3(-1.0f, 0.0f, 1.0f), 165 | glm::vec3(-1.0f, 0.0f, 0.0f), 166 | glm::vec3(-1.0f, 0.0f, -1.0f), 167 | }; 168 | 169 | return glm::lookAt( 170 | position, 171 | position + forward[direction], 172 | glm::vec3(0.0f, 1.0, 0.0f)); 173 | 174 | } 175 | } 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | -------------------------------------------------------------------------------- /DungeonsOfNoudar486/src/VisibilityStrategy.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by monty on 30/07/16. 3 | // 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | using std::vector; 12 | using std::array; 13 | 14 | #include 15 | 16 | using sg14::fixed_point; 17 | 18 | #include "NativeBitmap.h" 19 | #include "ETextures.h" 20 | #include "IFileLoaderDelegate.h" 21 | #include "NativeBitmap.h" 22 | #include "Vec2i.h" 23 | #include "IMapElement.h" 24 | #include "CTeam.h" 25 | #include "CItem.h" 26 | #include "CActor.h" 27 | #include "CGameDelegate.h" 28 | #include "MapWithCharKey.h" 29 | #include "CMap.h" 30 | #include "VisibilityStrategy.h" 31 | 32 | namespace odb { 33 | 34 | const bool kNarrowByDistance = true; 35 | const bool kConservativeOccluders = true; 36 | const int kUseLimitedDrawingDistance = false; 37 | const int kDrawingDistance = 20; 38 | 39 | bool VisibilityStrategy::isValid(const Knights::Vec2i& pos) { 40 | return 0 <= pos.x && pos.x < Knights::kMapSize && 0 <= pos.y && pos.y < Knights::kMapSize; 41 | } 42 | 43 | bool VisibilityStrategy::isBlock(const IntMap& occluders, const Knights::Vec2i& transformed) { 44 | 45 | auto tile = occluders[ transformed.y][transformed.x]; 46 | 47 | std::string occluderString = ""; 48 | 49 | if (kConservativeOccluders ) { 50 | occluderString = "1IYXPR"; 51 | } else { 52 | occluderString = "1IYXPR\\/SZ|%<>"; 53 | } 54 | 55 | for (const auto& candidate : occluderString ) { 56 | if (candidate == tile) { 57 | return true; 58 | } 59 | } 60 | 61 | return false; 62 | } 63 | 64 | void VisibilityStrategy::castVisibility(VisMap &visMap, const IntMap &occluders, const Knights::Vec2i& pos, Knights::EDirection direction, bool cleanPrevious, DistanceDistribution& distances) { 65 | if ( cleanPrevious ) { 66 | for (auto &line : visMap) { 67 | std::fill(std::begin(line), std::end(line), EVisibility::kInvisible); 68 | } 69 | } 70 | 71 | for ( auto& distanceLine : distances ) { 72 | distanceLine.clear(); 73 | } 74 | 75 | castVisibility(direction, visMap, occluders, transform( direction, pos ), distances); 76 | } 77 | 78 | bool VisibilityStrategy::isVisibleAt(const VisMap& visMap, const Knights::Vec2i& transformed ) { 79 | return visMap[ transformed.y ][ transformed.x ] == EVisibility::kVisible; 80 | } 81 | 82 | void VisibilityStrategy::setIsVisible(VisMap& visMap, const Knights::Vec2i& transformed ) { 83 | visMap[ transformed.y ][ transformed.x ] = EVisibility::kVisible; 84 | } 85 | 86 | Knights::Vec2i VisibilityStrategy::transform( Knights::EDirection from, const Knights::Vec2i& currentPos ) { 87 | 88 | switch( from ) { 89 | case Knights::EDirection::kNorth: 90 | return currentPos; 91 | case Knights::EDirection::kSouth: 92 | return { Knights::kMapSize - currentPos.x - 1, Knights::kMapSize - currentPos.y - 1}; 93 | case Knights::EDirection::kEast: 94 | return { Knights::kMapSize - currentPos.y - 1, Knights::kMapSize - currentPos.x - 1}; 95 | case Knights::EDirection::kWest: 96 | return { currentPos.y, currentPos.x}; 97 | } 98 | } 99 | 100 | void VisibilityStrategy::castVisibility(Knights::EDirection from, VisMap &visMap, const IntMap &occluders, 101 | const Knights::Vec2i& originalPos, DistanceDistribution& distances) { 102 | 103 | array positions; 104 | Knights::Vec2i currentPos; 105 | 106 | //The -1 is due to the fact I will add a new element. 107 | auto stackEnd = std::end( positions ) - 1; 108 | auto stackHead = std::begin(positions); 109 | auto stackRoot = stackHead; 110 | 111 | auto rightOffset = Knights::mapOffsetForDirection(Knights::EDirection::kEast); 112 | auto leftOffset = Knights::mapOffsetForDirection(Knights::EDirection::kWest); 113 | auto northOffset = Knights::mapOffsetForDirection(Knights::EDirection::kNorth); 114 | 115 | *stackHead = originalPos; 116 | ++stackHead; 117 | 118 | while (stackHead != stackRoot ) { 119 | --stackHead; 120 | 121 | currentPos = *stackHead; 122 | 123 | auto transformed = transform( from, currentPos); 124 | 125 | if (!isValid(transformed)) { 126 | continue; 127 | } 128 | 129 | if ( isVisibleAt( visMap, transformed ) ) { 130 | continue; 131 | } 132 | 133 | setIsVisible( visMap, transformed ); 134 | 135 | int verticalDistance = ( currentPos.y - originalPos.y ); 136 | 137 | if (kUseLimitedDrawingDistance ) { 138 | if (std::abs(verticalDistance) > kDrawingDistance) { 139 | continue; 140 | } 141 | } 142 | 143 | int manhattanDistance = std::abs( verticalDistance ) + std::abs( currentPos.x - originalPos.x ); 144 | distances[ manhattanDistance ].push_back( transformed ); 145 | 146 | if (isBlock(occluders, transformed )) { 147 | continue; 148 | } 149 | 150 | int narrowing = kNarrowByDistance ? std::abs(verticalDistance) : 1; 151 | 152 | if ( ( !kNarrowByDistance || ( currentPos.x - originalPos.x ) >= -narrowing )&& ( currentPos.x - originalPos.x ) <= 0 && (stackHead != stackEnd ) ) { 153 | *stackHead++ = Knights::Vec2i{currentPos.x + leftOffset.x, currentPos.y + leftOffset.y}; 154 | } 155 | 156 | if ( ( !kNarrowByDistance || ( currentPos.x - originalPos.x ) <= narrowing ) && ( currentPos.x - originalPos.x ) >= 0 && (stackHead != stackEnd ) ) { 157 | *stackHead++ = Knights::Vec2i{currentPos.x + rightOffset.x, currentPos.y + rightOffset.y}; 158 | } 159 | 160 | if ( verticalDistance <= 0 && (stackHead != stackEnd) ) { 161 | *stackHead++ = Knights::Vec2i{currentPos.x + northOffset.x, currentPos.y + northOffset.y}; 162 | } 163 | 164 | } 165 | } 166 | } 167 | -------------------------------------------------------------------------------- /DungeonsOfNoudarNDK/app/src/main/cpp/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # For more information about using CMake with Android Studio, read the 2 | # documentation: https://d.android.com/studio/projects/add-native-code.html 3 | 4 | # Sets the minimum version of CMake required to build the native library. 5 | 6 | cmake_minimum_required(VERSION 3.4.1) 7 | project(native-lib) 8 | 9 | include_directories(../../../../../DungeonsOfNoudar486/include) 10 | include_directories(../../../../../fixed_point/include) 11 | include_directories(../../../../../stb) 12 | include_directories(../../../../../noudar-core/noudar-core/include) 13 | include_directories(../../../../../noudar-rendering) 14 | 15 | 16 | 17 | set(CMAKE_CXX_STANDARD 14) 18 | 19 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DSDLSW -std=c90 -DANDROID -DDONT_LOAD_LEVEL_UPON_START -DUSE_ITEMS_INSTANTLY -DVGA -D_BSD_SOURCE") 20 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DSDLSW -std=c++14 -DANDROID -DDONT_LOAD_LEVEL_UPON_START -DUSE_ITEMS_INSTANTLY -DVGA -D_BSD_SOURCE") 21 | 22 | 23 | # Creates and names a library, sets it as either STATIC 24 | # or SHARED, and provides the relative paths to its source code. 25 | # You can define multiple libraries, and CMake builds them for you. 26 | # Gradle automatically packages shared libraries with your APK. 27 | 28 | add_library( # Sets the name of the library. 29 | native-lib 30 | 31 | # Sets the library as a shared library. 32 | SHARED 33 | 34 | # Provides a relative path to your source file(s). 35 | 36 | ../../../../../DungeonsOfNoudar486/src/CRenderer_Rasterization.cpp 37 | ../../../../../DungeonsOfNoudar486/src/CRenderer_Tesselation.cpp 38 | ../../../../../DungeonsOfNoudar486/src/CRenderer.cpp 39 | ../../../../../DungeonsOfNoudar486/src/NativeBitmap.cpp 40 | ../../../../../DungeonsOfNoudar486/src/RasterizerCommon.cpp 41 | ../../../../../DungeonsOfNoudar486/src/CTile3DProperties.cpp 42 | ../../../../../DungeonsOfNoudar486/src/CPackedFileReader.cpp 43 | ../../../../../DungeonsOfNoudar486/src/VisibilityStrategy.cpp 44 | ../../../../../DungeonsOfNoudar486/events.cpp 45 | ../../../../../noudar-rendering/LoadPNG.cpp 46 | ../../../../../noudar-rendering/Logger.cpp 47 | ../../../../../noudar-core/noudar-core/src/commands/CMoveActorCommand.cpp 48 | ../../../../../noudar-core/noudar-core/src/commands/CEndTurnCommand.cpp 49 | ../../../../../noudar-core/noudar-core/src/commands/CLoadNewLevelCommand.cpp 50 | ../../../../../noudar-core/noudar-core/src/commands/CNullCommand.cpp 51 | ../../../../../noudar-core/noudar-core/src/commands/CQuitCommand.cpp 52 | ../../../../../noudar-core/noudar-core/src/commands/CTurnActorCommand.cpp 53 | ../../../../../noudar-core/noudar-core/src/commands/CCycleNextItemCommand.cpp 54 | ../../../../../noudar-core/noudar-core/src/commands/CPickItemCommand.cpp 55 | ../../../../../noudar-core/noudar-core/src/commands/CDropItemCommand.cpp 56 | ../../../../../noudar-core/noudar-core/src/commands/CSuggestItemCommand.cpp 57 | ../../../../../noudar-core/noudar-core/src/commands/CCyclePreviousItemCommand.cpp 58 | ../../../../../noudar-core/noudar-core/src/commands/CUseCurrentItemCommand.cpp 59 | ../../../../../noudar-core/noudar-core/src/commands/IGameCommand.cpp 60 | ../../../../../noudar-core/noudar-core/src/Vec2i.cpp 61 | ../../../../../noudar-core/noudar-core/src/Common.cpp 62 | ../../../../../noudar-core/noudar-core/src/CActor.cpp 63 | ../../../../../noudar-core/noudar-core/src/CItem.cpp 64 | ../../../../../noudar-core/noudar-core/src/CCharacter.cpp 65 | ../../../../../noudar-core/noudar-core/src/CMonsterGenerator.cpp 66 | ../../../../../noudar-core/noudar-core/src/CCharacterArchetype.cpp 67 | ../../../../../noudar-core/noudar-core/src/CGameDelegate.cpp 68 | ../../../../../noudar-core/noudar-core/src/CMonster.cpp 69 | ../../../../../noudar-core/noudar-core/src/IFileLoaderDelegate.cpp 70 | ../../../../../noudar-core/noudar-core/src/CTeam.cpp 71 | ../../../../../noudar-core/noudar-core/src/CDoorway.cpp 72 | ../../../../../noudar-core/noudar-core/src/CGame.cpp 73 | ../../../../../noudar-core/noudar-core/src/CMap.cpp 74 | ../../../../../noudar-core/noudar-core/src/IMapElement.cpp 75 | ../../../../../noudar-core/noudar-core/src/CStorageItem.cpp 76 | native-lib.cpp) 77 | 78 | # Searches for a specified prebuilt library and stores the path as a 79 | # variable. Because CMake includes system libraries in the search path by 80 | # default, you only need to specify the name of the public NDK library 81 | # you want to add. CMake verifies that the library exists before 82 | # completing its build. 83 | 84 | find_library( # Sets the name of the path variable. 85 | log-lib 86 | 87 | # Specifies the name of the NDK library that 88 | # you want CMake to locate. 89 | log) 90 | 91 | find_library( # Sets the name of the path variable. 92 | android-lib 93 | 94 | # Specifies the name of the NDK library that 95 | # you want CMake to locate. 96 | android ) 97 | 98 | 99 | # Specifies libraries CMake should link to your target library. You 100 | # can link multiple libraries, such as libraries you define in this 101 | # build script, prebuilt third-party libraries, or system libraries. 102 | 103 | target_link_libraries( # Specifies the target library. 104 | native-lib 105 | ${android-lib} 106 | 107 | android 108 | jnigraphics 109 | EGL 110 | OpenSLES 111 | GLESv2 112 | 113 | # Links the target library to the log library 114 | # included in the NDK. 115 | ${log-lib}) 116 | --------------------------------------------------------------------------------