diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 0549fe5b..db6e029d 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -13,8 +13,6 @@ things for you to read through first: - New platforms are acceptable if they use SDL + PhysicsFS and don't mess with the game source too much. - (No homebrew console targets, sorry! Maybe do the work in SDL instead?) -- Translations and localizations of the game are not a community effort. If you - want to translate the game, you should contact Terry. - Pull requests that do not fill out the Legal Stuff will be closed automatically. @@ -34,4 +32,4 @@ By submitting this pull request, I confirm that... - [ ] My changes may be used in a future commercial release of VVVVVV - [ ] I will be credited in a `CONTRIBUTORS` file and the "GitHub Friends" section of the credits for all of said releases, but will NOT be compensated - for these changes unless there is a prior written agreement + for these changes diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml deleted file mode 100644 index 3108e743..00000000 --- a/.github/workflows/android.yml +++ /dev/null @@ -1,81 +0,0 @@ -name: CI (Android) - -# Only trigger workflow when Android-specific code could have changed. -# This includes C/C++ files that have __ANDROID__ ifdefs. -# If adding new ifdefs, make sure to update these lists. -on: - push: - paths: - - "desktop_version/CMakeLists.txt" - - "desktop_version/src/ButtonGlyphs.cpp" - - "desktop_version/src/FileSystemUtils.cpp" - - "desktop_version/src/Screen.cpp" - - "desktop_version/src/Vlogging.c" - - "desktop_version/VVVVVV-android/gradlew" - - "desktop_version/VVVVVV-android/gradlew.bat" - - "desktop_version/VVVVVV-android/**/CMakeLists.txt" - - "desktop_version/VVVVVV-android/**.java" - - "desktop_version/VVVVVV-android/**.xml" - - "desktop_version/VVVVVV-android/**.pro" - - "desktop_version/VVVVVV-android/**.mk" - - "desktop_version/VVVVVV-android/**.gradle" - - "desktop_version/VVVVVV-android/**.jar" - - "desktop_version/VVVVVV-android/**.properties" - - ".github/workflows/android.yml" - pull_request: - paths: - - "desktop_version/CMakeLists.txt" - - "desktop_version/src/ButtonGlyphs.cpp" - - "desktop_version/src/FileSystemUtils.cpp" - - "desktop_version/src/Screen.cpp" - - "desktop_version/src/Vlogging.c" - - "desktop_version/VVVVVV-android/gradlew" - - "desktop_version/VVVVVV-android/gradlew.bat" - - "desktop_version/VVVVVV-android/**/CMakeLists.txt" - - "desktop_version/VVVVVV-android/**.java" - - "desktop_version/VVVVVV-android/**.xml" - - "desktop_version/VVVVVV-android/**.pro" - - "desktop_version/VVVVVV-android/**.mk" - - "desktop_version/VVVVVV-android/**.gradle" - - "desktop_version/VVVVVV-android/**.jar" - - "desktop_version/VVVVVV-android/**.properties" - - ".github/workflows/android.yml" - -env: - SRC_DIR_PATH: VVVVVV/desktop_version/VVVVVV-android - -jobs: - build: - name: Build (Android) - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - with: - submodules: true - path: 'VVVVVV' - - - uses: actions/setup-java@v3 - with: - distribution: 'temurin' - java-version: '17' - cache: 'gradle' - - - uses: actions/checkout@v4 - with: - repository: libsdl-org/SDL - ref: release-2.30.8 - path: 'SDL' - - - name: Build SDL - run: | - sudo apt-get -y install ninja-build - cd SDL - ./build-scripts/android-prefab.sh - mvn install:install-file -Dfile=build-android-prefab/prefab-2.30.8/SDL2-2.30.8.aar -DpomFile=build-android-prefab/prefab-2.30.8/SDL2-2.30.8.pom - - - name: Build - run: | - cd ${SRC_DIR_PATH} - ./gradlew build diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 446b49df..30b3934b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,32 +1,7 @@ name: CI -# Only trigger workflow when code changes, or this file is changed. -# Android has a different workflow and different rules. -on: - push: - paths: - - "desktop_version/CMakeLists.txt" - - "desktop_version/src/**.cpp" - - "desktop_version/src/**.c" - - "desktop_version/src/**.h" - - "third_party/**" - - ".github/workflows/ci.yml" - pull_request: - paths: - - "desktop_version/CMakeLists.txt" - - "desktop_version/src/**.cpp" - - "desktop_version/src/**.c" - - "desktop_version/src/**.h" - - "third_party/**" - - ".github/workflows/ci.yml" - -permissions: - contents: read - statuses: write - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true +# Trigger this workflow on push or pull request +on: [push, pull_request] env: SRC_DIR_PATH: desktop_version @@ -40,31 +15,17 @@ jobs: env: CXXFLAGS: -I/usr/local/include/SDL2 LDFLAGS: -L/usr/local/lib - HOMEBREW_NO_ENV_HINTS: 1 # Suppress brew update hints steps: - - uses: actions/checkout@v4 - with: - submodules: true - - - name: Cache Homebrew packages - id: cache-brew - uses: actions/cache@v3 - with: - path: | - /usr/local/Cellar/ninja - /usr/local/Cellar/sdl2 - /usr/local/opt/sdl2 # Symlink often used - key: ${{ runner.os }}-brew-${{ hashFiles('/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/ninja.rb', '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/sdl2.rb') }} # Using hash of formula files if available, or a fixed key for simplicity if not easily determined + - uses: actions/checkout@v1 - name: Install dependencies - if: steps.cache-brew.outputs.cache-hit != 'true' - run: brew install ninja sdl2 + run: brew install ninja sdl2 sdl2_mixer - name: CMake configure (default version) run: | - mkdir -p ${SRC_DIR_PATH}/build && cd ${SRC_DIR_PATH}/build - cmake -G Ninja .. + mkdir ${SRC_DIR_PATH}/build && cd ${SRC_DIR_PATH}/build + cmake -GNinja .. - name: Build (default version) run: ninja -C ${SRC_DIR_PATH}/build @@ -83,98 +44,126 @@ jobs: - name: Build (M&P) run: ninja -C ${SRC_DIR_PATH}/build + - name: CMake configure (no custom levels) + run: | + cd ${SRC_DIR_PATH}/build + cmake -DMAKEANDPLAY=OFF -DCUSTOM_LEVEL_SUPPORT=DISABLED .. + - name: Build (no custom levels) + run: ninja -C ${SRC_DIR_PATH}/build + + - name: CMake configure (no editor) + run: | + cd ${SRC_DIR_PATH}/build + cmake -DCUSTOM_LEVEL_SUPPORT=NO_EDITOR .. + - name: Build (no editor) + run: ninja -C ${SRC_DIR_PATH}/build + build-lin: - name: Build (Steam Linux Runtime Sniper) + name: Build (CentOS 7) runs-on: ubuntu-latest - container: registry.gitlab.steamos.cloud/steamrt/sniper/sdk:latest + container: ghcr.io/leo60228/vvvvvv-build@sha256:485448ad437653d47ceb068a0f2b910f4eb336107d340a1f0d828ca95c987985 + + env: + CXXFLAGS: -I/usr/local/include/SDL2 + LDFLAGS: -L/usr/local/lib steps: - - uses: actions/checkout@v4 - with: - submodules: true + - uses: actions/checkout@v1 - name: CMake configure (default version) run: | - mkdir -p ${SRC_DIR_PATH}/build && cd ${SRC_DIR_PATH}/build - cmake -G Ninja .. + mkdir ${SRC_DIR_PATH}/build && cd ${SRC_DIR_PATH}/build + cmake .. - name: Build (default version) - run: ninja -C ${SRC_DIR_PATH}/build + run: make -j $(nproc) -C ${SRC_DIR_PATH}/build - name: CMake configure (official) run: | cd ${SRC_DIR_PATH}/build - cmake -G Ninja -DOFFICIAL_BUILD=ON .. + cmake -DOFFICIAL_BUILD=ON .. - name: Build (official) - run: ninja -C ${SRC_DIR_PATH}/build + run: | + make -j $(nproc) -C ${SRC_DIR_PATH}/build - name: CMake configure (M&P) run: | cd ${SRC_DIR_PATH}/build - cmake -G Ninja -DOFFICIAL_BUILD=OFF -DMAKEANDPLAY=ON .. + cmake -DOFFICIAL_BUILD=OFF -DMAKEANDPLAY=ON .. - name: Build (M&P) - run: ninja -C ${SRC_DIR_PATH}/build + run: make -j $(nproc) -C ${SRC_DIR_PATH}/build + + - name: CMake configure (no custom levels) + run: | + cd ${SRC_DIR_PATH}/build + cmake -DMAKEANDPLAY=OFF -DCUSTOM_LEVEL_SUPPORT=DISABLED .. + - name: Build (no custom levels) + run: make -j $(nproc) -C ${SRC_DIR_PATH}/build + + - name: CMake configure (no editor) + run: | + cd ${SRC_DIR_PATH}/build + cmake -DCUSTOM_LEVEL_SUPPORT=NO_EDITOR .. + - name: Build (no editor) + run: make -j $(nproc) -C ${SRC_DIR_PATH}/build build-win: name: Build (windows-latest) runs-on: windows-latest - env: - SDL_VERSION: 2.26.0 - steps: - - uses: actions/checkout@v4 - with: - submodules: true + - uses: actions/checkout@v1 - - name: Cache SDL - id: cache-windows-sdl - uses: actions/cache@v3 - env: - cache-name: cache-sdl - with: - path: C:\SDL2-* - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.SDL_VERSION }} - - - if: ${{ steps.cache-windows-sdl.outputs.cache-hit != 'true' }} - name: Download SDL if not cached + - name: Install dependencies (Windows) run: | - Invoke-WebRequest "https://github.com/libsdl-org/SDL/releases/download/release-$env:SDL_VERSION/SDL2-devel-$env:SDL_VERSION-VC.zip" -OutFile C:\SDL.zip - Expand-Archive C:\SDL.zip -DestinationPath C:\ - - - name: CMake initial configure/generate - run: | - mkdir $env:SRC_DIR_PATH/build - cd $env:SRC_DIR_PATH/build - $env:LDFLAGS = "/LIBPATH:C:\SDL2-$env:SDL_VERSION\lib\x86 " - cmake -G "Visual Studio 17 2022" -A Win32 ` - -DSDL2_INCLUDE_DIRS="C:\SDL2-$env:SDL_VERSION\include" ` - -DSDL2_LIBRARIES="SDL2;SDL2main" .. + vcpkg install sdl2 sdl2-mixer - name: CMake configure (default version) run: | - cd $env:SRC_DIR_PATH/build - cmake .. + cd $env:SRC_DIR_PATH + $env:LDFLAGS = "/LIBPATH:$env:VCPKG_INSTALLATION_ROOT\installed\x86-windows\lib " + $env:LDFLAGS += "/LIBPATH:$env:VCPKG_INSTALLATION_ROOT\installed\x86-windows\lib\manual-link" + cmake -G "Visual Studio 16 2019" -A Win32 ` + -DSDL2_INCLUDE_DIRS="$env:VCPKG_INSTALLATION_ROOT\installed\x86-windows\include\SDL2" ` + -DSDL2_LIBRARIES="SDL2;SDL2main;SDL2_mixer" . - name: Build (default version) run: | - cd $env:SRC_DIR_PATH/build + cd $env:SRC_DIR_PATH cmake --build . - name: CMake configure (official) run: | - cd $env:SRC_DIR_PATH/build - cmake -DOFFICIAL_BUILD=ON .. + cd $env:SRC_DIR_PATH + cmake -DOFFICIAL_BUILD=ON . - name: Build (official) run: | - cd $env:SRC_DIR_PATH/build + cd $env:SRC_DIR_PATH cmake --build . - name: CMake configure (M&P) run: | - cd $env:SRC_DIR_PATH/build - cmake -DOFFICIAL_BUILD=OFF -DMAKEANDPLAY=ON .. + cd $env:SRC_DIR_PATH + cmake -DOFFICIAL_BUILD=OFF -DMAKEANDPLAY=ON . - name: Build (M&P) run: | - cd $env:SRC_DIR_PATH/build + cd $env:SRC_DIR_PATH + cmake --build . + + - name: CMake configure (no custom levels) + run: | + cd $env:SRC_DIR_PATH + cmake -DMAKEANDPLAY=OFF -DCUSTOM_LEVEL_SUPPORT=DISABLED . + - name: Build (no custom levels) + run: | + cd $env:SRC_DIR_PATH + cmake --build . + + - name: CMake configure (no editor) + run: | + cd $env:SRC_DIR_PATH + cmake -DCUSTOM_LEVEL_SUPPORT=NO_EDITOR . + - name: Build (no editor) + run: | + cd $env:SRC_DIR_PATH cmake --build . diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index e4e0b61a..00000000 --- a/.gitmodules +++ /dev/null @@ -1,18 +0,0 @@ -[submodule "third_party/lodepng"] - path = third_party/lodepng - url = https://github.com/lvandeve/lodepng -[submodule "third_party/physfs"] - path = third_party/physfs - url = https://github.com/icculus/physfs/ -[submodule "third_party/tinyxml2"] - path = third_party/tinyxml2 - url = https://github.com/leethomason/tinyxml2/ -[submodule "third_party/FAudio"] - path = third_party/FAudio - url = https://github.com/FNA-XNA/FAudio -[submodule "third_party/c-hashmap"] - path = third_party/c-hashmap - url = https://github.com/Mashpoe/c-hashmap -[submodule "third_party/SheenBidi"] - path = third_party/SheenBidi - url = https://github.com/Tehreer/SheenBidi diff --git a/LICENSE.md b/LICENSE.md index 70e62c2f..2b1be863 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,5 +1,3 @@ -VVVVVV's source code is made available under a custom license. Basically, you can compile yourself a copy, for free, for personal use. But if you want to distribute a compiled version of the game, you might need permission first. See the [License exceptions](License%20exceptions.md) page for more information. - VVVVVV Source Code License v1.0 ------- Last updated on January 7th, 2020. diff --git a/License exceptions.md b/License exceptions.md index fbc132f8..857232a8 100644 --- a/License exceptions.md +++ b/License exceptions.md @@ -1,26 +1,24 @@ -VVVVVV's source code is made available under a [custom license](LICENSE.md), which states that you must not distribute any materials from the game (i.e. the game's assets) which are not included in this repo unless approved by us in writing. In general, if you're interested in creating something that falls outside the license terms, get in touch with [Terry](http://distractionware.com/email/)! - -There is an important general exception: if you're compiling a [Make -and Play](https://thelettervsixtim.es/makeandplay/) version of the game, then you can you freely distribute the game's assets. - -The following is a list of projects which have been given permission by Terry to distribute the assets with distributions of the game, and under what conditions. - Exceptions granted to the VVVVVV source code license ------- -Last updated on January 23rd, 2024. +Last updated on November 22nd, 2020. + +VVVVVV's source code is made available under a [custom license](LICENSE.md), which states that you must not distribute any materials from the game (i.e. the game's assets) which are not included in this repo unless approved by us in writing. The following is a list of projects which have been given permission by Terry to distribute the assets with distributions of the game, and under what conditions. | Project | Creator | Description | Conditions | Link | |---|---|---|---|---| -| Any distribution of the VVVVVV: Make and Play edition | | All distributions and packages of the Make and Play edition can freely distribute the data assets, so long as they compile with the makeandplay define and do not distribute the original levels.| Must compile with the makeandplay define set, cannot distribute the original levels. | | | VVVVVV: Make and Play Edition |[Terry Cavanagh](http://distractionware.com/)|The free and official version of VVVVVV that includes player levels, and the tools to create your own levels, but does not include the original levels from the game.| Must compile with the makeandplay define set, cannot distribute the original levels. | [download](https://thelettervsixtim.es/makeandplay/) | -| Ved | [Dav999 and InfoTeddy](https://github.com/Daaaav/Ved/graphs/contributors) | An external editor for VVVVVV levels. | No conditions. | [download](https://tolp.nl/ved/), [github repo](https://github.com/Daaaav/Ved) | +| Ved | [Dav999 and InfoTeddy](https://gitgud.io/Dav999/ved/-/graphs/master) | An external editor for VVVVVV levels. | No conditions. | [download](https://tolp.nl/ved/), [gitlab](https://gitgud.io/Dav999/ved) | | VVVVVV: Community Edition | https://github.com/v6cord/VVVVVV-CE/graphs/contributors | Community fork of VVVVVV focused on expanding the capabilities of player levels. | Must compile with the makeandplay define set, cannot distribute the original levels. | [github repo](https://github.com/v6cord/VVVVVV-CE) | | VVVVVVwasm|kotborealis|Web Assembly port of VVVVVV| Must compile with the makeandplay define set, cannot distribute the original levels. | [github repo](https://github.com/kotborealis/VVVVVVwasm) | | cursed_vvvvvv.exe | [MustardBucket](https://twitter.com/mustard_bucket/) | Modified version of VVVVVV where instead of flipping gravity you jump normally, can jump multiple times, and wall jump. | Make it impossible to revert to ordinary flipping behaviour. | [download](https://mustardbucket.itch.io/cursed-vvvvvv?secret=O0KvS02wD473pXBF9avreZsww), [twitter gif](https://twitter.com/mustard_bucket/status/1216272971779670016) | | Haiku Port | [Julius C. Enriquez](https://github.com/win8linux) | Port for the Haiku operating system. | Display the following text in the Haiku package to make it clear that this is an exception: "VVVVVV is a commercial game! The author has given special permission to make this Haiku version available for free. If you enjoy the game, please consider purchasing a copy at [thelettervsixtim.es](http://thelettervsixtim.es)." | [haiku recipe](https://github.com/haikuports/haikuports/tree/master/games-arcade/vvvvvv), [haiku data.zip recipe](https://github.com/haikuports/haikuports/tree/master/games-arcade/vvvvvv_data) | | Dreamcast Port | [Gustavo Aranda](https://github.com/gusarba/) | Port for the Sega Dreamcast. | Permission is given to distribute a ready-to-use CD image file for the Sega Dreamcast containing the data.zip assets for non commercial use only. | [github repo](https://github.com/gusarba/VVVVVVDC)| | XBox One/UWP Port | [tunip3](https://github.com/tunip3) | Port for XBOX ONE (DURANGO) via UWP. | Permission is given to distribute a pre-compiled package (containing the data.zip assets) for people to run on development mode xboxes, for non commercial use only. | [github repo](https://github.com/tunip3/DURANGO-V6)| -| armhf Port | [johnnyonFlame](https://github.com/johnnyonFlame/) | Armhf port for Raspberry PI and other SBC devices| Permission is for non commercial use only. Display the following text in the readme to make it clear that this is an exception: "VVVVVV is a commercial game! The author has given special permission to make this port available for free. If you enjoy the game, please consider purchasing a copy at [thelettervsixtim.es](http://thelettervsixtim.es)."| [github release](https://github.com/JohnnyonFlame/VVVVVV/releases/tag/v2.4-r1) | -| PortMaster distributions of the game for Linux Handheld devices | [portmaster](https://portmaster.games/) | A port manager GUI for Linux handheld devices | Permission is for non commercial use only. Display the following text in the readme to make it clear that this is an exception: "VVVVVV is a commercial game! The author has given special permission to make this port available for free. If you enjoy the game, please consider purchasing a copy at [thelettervsixtim.es](http://thelettervsixtim.es)."| [website](https://portmaster.games/detail.html?name=vvvvvv) | -| Wii Port | [Alberto Mardegan](https://github.com/mardy/) | Port for the Nintendo Wii. | Permission is given to distribute a ready-to-use build for the Nintendo Wii containing the data.zip assets for non commercial use only. | [github repo](https://github.com/mardy/VVVVVV/tree/wii) | -| Recalbox Port | [digitalLumberjack](https://gitlab.com/recalbox/recalbox) | Port for Recalbox project. | Display the following text in the readme to make it clear that this is an exception: "VVVVVV is a commercial game! The author has given special permission to make this port available for free. If you enjoy the game, please consider purchasing a copy at [thelettervsixtim.es](http://thelettervsixtim.es)." | [website](https://recalbox.com/) | + +In addition, the following exceptions apply for any projects that match these descriptions: + +| Project | Description | Conditions | +|---|---|---| +| Any distribution of the VVVVVV: Make and Play edition | All distributions and packages of the Make and Play edition can freely distribute the data assets, so long as they compile with the makeandplay define and do not distribute the original levels.| Must compile with the makeandplay define set, cannot distribute the original levels. | + +In general, if you're interested in creating something that falls outside the license terms, [get in touch with Terry!](http://distractionware.com/email/) diff --git a/README.md b/README.md index cdcbf441..21b8f410 100644 --- a/README.md +++ b/README.md @@ -1,23 +1,22 @@ -![logo](logo.gif "VVVVVV") +This is the source code to VVVVVV, version 2.0+. For more context about this release, see the [announcement](http://distractionware.com/blog/2020/01/vvvvvv-is-now-open-source/) on Terry's blog! -This is the source code to VVVVVV, the 2010 indie game by [Terry Cavanagh](http://distractionware.com/), with music by [Magnus Pålsson](http://souleye.madtracker.net/). You can read the [announcement](http://distractionware.com/blog/2020/01/vvvvvv-is-now-open-source/) of the source code release on Terry's blog! +License +------- +VVVVVV's source code is made available under a custom license. See [LICENSE.md](LICENSE.md) for more details. -The source code for the desktop version is in [this folder](desktop_version). +In general, if you're interested in creating something that falls outside the license terms, get in touch with Terry and we'll talk about it! -VVVVVV is still commercially available at [thelettervsixtim.es](https://thelettervsixtim.es/) if you'd like to support it, but you are completely free to compile the game for your own personal use. If you're interested in distributing a compiled version of the game, see [LICENSE.md](LICENSE.md) for more information. - -Discussion about VVVVVV updates mainly happens on the "unofficial" [VVVVVV discord](https://discord.gg/Zf7Nzea), in the `vvvvvv-code` channel. - -Credits +Authors ------- - Created by [Terry Cavanagh](http://distractionware.com/) - Room Names by [Bennett Foddy](http://www.foddy.net) -- Music by [Magnus Pålsson](https://magnuspalsson.com/) -- Metal Soundtrack by [FamilyJules](https://link.space/@familyjules) +- Music by [Magnus Pålsson](http://souleye.madtracker.net/) +- Metal Soundtrack by [FamilyJules](http://familyjules7x.com/) - 2.0 Update (C++ Port) by [Simon Roth](http://www.machinestudios.co.uk) - 2.2 Update (SDL2/PhysicsFS/Steamworks port) by [Ethan Lee](http://www.flibitijibibo.com/) -- Additional coding by [Misa Kai](https://infoteddy.info/) - Beta Testing by Sam Kaplan and Pauli Kohberger - Ending Picture by Pauli Kohberger -- Localisations by [our localisation teams](desktop_version/TRANSLATORS.txt) -- With additional contributions by [many others here on github](desktop_version/CONTRIBUTORS.txt) <3 + +Versions +------------ +There are two versions of the VVVVVV source code available - the [desktop version](https://github.com/TerryCavanagh/VVVVVV/tree/master/desktop_version) (based on the C++ port, and currently live on Steam), and the [mobile version](https://github.com/TerryCavanagh/VVVVVV/tree/master/mobile_version) (based on a fork of the original flash source code, and currently live on iOS and Android). diff --git a/desktop_version/.gitignore b/desktop_version/.gitignore index 04039b60..241f712d 100644 --- a/desktop_version/.gitignore +++ b/desktop_version/.gitignore @@ -10,7 +10,6 @@ VVVVVV *.a *.gch src/Version.h.out -src/InterimVersion.out.c # Game data data.zip diff --git a/desktop_version/AppIcon.xcassets/AppIcon.appiconset/AppIcon.png b/desktop_version/AppIcon.xcassets/AppIcon.appiconset/AppIcon.png deleted file mode 100644 index 6b3a72b7..00000000 Binary files a/desktop_version/AppIcon.xcassets/AppIcon.appiconset/AppIcon.png and /dev/null differ diff --git a/desktop_version/AppIcon.xcassets/AppIcon.appiconset/Contents.json b/desktop_version/AppIcon.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index cefcc878..00000000 --- a/desktop_version/AppIcon.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "images" : [ - { - "filename" : "AppIcon.png", - "idiom" : "universal", - "platform" : "ios", - "size" : "1024x1024" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/desktop_version/AppIcon.xcassets/Contents.json b/desktop_version/AppIcon.xcassets/Contents.json deleted file mode 100644 index 73c00596..00000000 --- a/desktop_version/AppIcon.xcassets/Contents.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/desktop_version/CMakeLists.txt b/desktop_version/CMakeLists.txt index 26d191d4..7405c122 100644 --- a/desktop_version/CMakeLists.txt +++ b/desktop_version/CMakeLists.txt @@ -1,13 +1,16 @@ # CMake File for VVVVVV # Written by Ethan "flibitijibibo" Lee -cmake_minimum_required(VERSION 2.8.12...3.5) +cmake_minimum_required(VERSION 2.8.12) # CMake Options option(ENABLE_WARNINGS "Enable compilation warnings" ON) option(ENABLE_WERROR "Treat compilation warnings as errors" OFF) -option(BUNDLE_DEPENDENCIES "Use bundled TinyXML-2, PhysicsFS, and FAudio (if disabled, TinyXML-2, PhysicsFS, and FAudio will be dynamically linked; LodePNG, C-HashMap and SheenBidi will still be statically linked)" ON) +option(BUNDLE_DEPENDENCIES "Use bundled TinyXML-2, PhysicsFS, and UTF8-CPP (if disabled, TinyXML-2 and PhysicsFS will be dynamically linked, LodePNG and UTF8-CPP will still be statically linked)" ON) + +set(CUSTOM_LEVEL_SUPPORT ENABLED CACHE STRING "Optionally disable playing and/or editing of custom levels") +set_property(CACHE CUSTOM_LEVEL_SUPPORT PROPERTY STRINGS ENABLED NO_EDITOR DISABLED) option(STEAM "Use the Steam API" OFF) option(GOG "Use the GOG API" OFF) @@ -17,489 +20,316 @@ option(OFFICIAL_BUILD "Compile an official build of the game" OFF) option(MAKEANDPLAY "Compile a version of the game without the main campaign (provided for convenience; consider modifying MakeAndPlay.h instead" OFF) if(OFFICIAL_BUILD AND NOT MAKEANDPLAY) - set(STEAM ON) - set(GOG ON) + set(STEAM ON) + set(GOG ON) endif() -option(REMOVE_ABSOLUTE_PATHS "If supported by the compiler, replace all absolute paths to source directories compiled into the binary (if any) with relative paths" ON) +if(${CMAKE_VERSION} VERSION_LESS "3.1.3") + message(WARNING "Your CMake version is too old; set -std=c90 -std=c++98 yourself!") +else() + set(CMAKE_C_STANDARD 90) + set(CMAKE_C_EXTENSIONS OFF) + set(CMAKE_CXX_STANDARD 98) + set(CMAKE_CXX_EXTENSIONS OFF) +endif() # Architecture Flags -if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") - # Wow, Apple is a huge jerk these days huh? - set(OSX_10_9_SDK_PATH /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk) - if(NOT CMAKE_OSX_SYSROOT) - if(IS_DIRECTORY ${OSX_10_9_SDK_PATH}) - set(CMAKE_OSX_SYSROOT ${OSX_10_9_SDK_PATH}) - else() - message(WARNING "CMAKE_OSX_SYSROOT not set and macOS 10.9 SDK not found! Using default one.") - endif() - endif() - set(CMAKE_OSX_DEPLOYMENT_TARGET 10.9) - link_directories(/usr/local/lib) - add_compile_options(-Werror=partial-availability) -elseif(CMAKE_SYSTEM_NAME STREQUAL "iOS") - set(CMAKE_OSX_DEPLOYMENT_TARGET 12.0) # SDL goes back to iOS 8.0, but modern Xcode doesn't +if(APPLE) + # Wow, Apple is a huge jerk these days huh? + set(OSX_10_9_SDK_PATH /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk) + if(NOT CMAKE_OSX_SYSROOT) + if(IS_DIRECTORY ${OSX_10_9_SDK_PATH}) + set(CMAKE_OSX_SYSROOT ${OSX_10_9_SDK_PATH}) + else() + message(WARNING "CMAKE_OSX_SYSROOT not set and macOS 10.9 SDK not found! Using default one.") + endif() + endif() + set(CMAKE_OSX_DEPLOYMENT_TARGET 10.9) + link_directories(/usr/local/lib) + add_compile_options(-Werror=partial-availability) endif() project(VVVVVV) if(APPLE) - message(STATUS "Using macOS SDK at ${CMAKE_OSX_SYSROOT}") + message(STATUS "Using macOS SDK at ${CMAKE_OSX_SYSROOT}") endif() # RPATH if(NOT WIN32) - if(CMAKE_SYSTEM_NAME STREQUAL "iOS") - set(BIN_LIBROOT "Frameworks") - set(BIN_RPATH "@executable_path/Frameworks") - elseif(APPLE) - set(BIN_LIBROOT "osx") - set(BIN_RPATH "@executable_path/osx") - elseif(CMAKE_SIZEOF_VOID_P MATCHES "8") - set(BIN_LIBROOT "lib64") - set(BIN_RPATH "\$ORIGIN/lib64") - set(CMAKE_EXE_LINKER_FLAGS "-Wl,--disable-new-dtags") - else() - set(BIN_LIBROOT "lib") - set(BIN_RPATH "\$ORIGIN/lib") - endif() - set(CMAKE_SKIP_BUILD_RPATH TRUE) - set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) - set(CMAKE_INSTALL_RPATH ${BIN_RPATH}) - set(CMAKE_INSTALL_RPATH_USE_LINK_PATH FALSE) + if(APPLE) + set(BIN_LIBROOT "osx") + set(BIN_RPATH "@executable_path/osx") + elseif(CMAKE_SIZEOF_VOID_P MATCHES "8") + set(BIN_LIBROOT "lib64") + set(BIN_RPATH "\$ORIGIN/lib64") + else() + set(BIN_LIBROOT "lib") + set(BIN_RPATH "\$ORIGIN/lib") + endif() + set(CMAKE_SKIP_BUILD_RPATH TRUE) + set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) + set(CMAKE_INSTALL_RPATH ${BIN_RPATH}) + set(CMAKE_INSTALL_RPATH_USE_LINK_PATH FALSE) endif() # Source Lists -set(VVV_CXX_SRC - src/BinaryBlob.cpp - src/BlockV.cpp - src/ButtonGlyphs.cpp - src/CustomLevels.cpp - src/CWrappers.cpp - src/Editor.cpp - src/Ent.cpp - src/Entity.cpp - src/FileSystemUtils.cpp - src/Finalclass.cpp - src/Font.cpp - src/FontBidi.cpp - src/Game.cpp - src/Graphics.cpp - src/GraphicsResources.cpp - src/GraphicsUtil.cpp - src/IMERender.cpp - src/Input.cpp - src/KeyPoll.cpp - src/Labclass.cpp - src/LevelDebugger.cpp - src/Localization.cpp - src/LocalizationMaint.cpp - src/LocalizationStorage.cpp - src/Logic.cpp - src/Map.cpp - src/Music.cpp - src/Otherlevel.cpp - src/preloader.cpp - src/Render.cpp - src/RenderFixed.cpp - src/RoomnameTranslator.cpp - src/Screen.cpp - src/Script.cpp - src/Scripts.cpp - src/Spacestation2.cpp - src/TerminalScripts.cpp - src/Textbox.cpp - src/Tower.cpp - src/UtilityClass.cpp - src/WarpClass.cpp - src/XMLUtils.cpp - src/main.cpp -) -set(VVV_C_SRC - src/DeferCallbacks.c - src/GlitchrunnerMode.c - src/Network.c - src/Textbook.c - src/ThirdPartyDeps.c - src/UTF8.c - src/VFormat.c - src/Vlogging.c - src/Xoshiro.c - ../third_party/physfs/extras/physfsrwops.c +set(VVV_SRC + src/BinaryBlob.cpp + src/BlockV.cpp + src/Ent.cpp + src/Entity.cpp + src/FileSystemUtils.cpp + src/Finalclass.cpp + src/Game.cpp + src/Graphics.cpp + src/GraphicsResources.cpp + src/GraphicsUtil.cpp + src/Input.cpp + src/KeyPoll.cpp + src/Labclass.cpp + src/Logic.cpp + src/Map.cpp + src/Music.cpp + src/Otherlevel.cpp + src/preloader.cpp + src/Render.cpp + src/RenderFixed.cpp + src/Screen.cpp + src/Script.cpp + src/Scripts.cpp + src/SoundSystem.cpp + src/Spacestation2.cpp + src/TerminalScripts.cpp + src/Textbox.cpp + src/Tower.cpp + src/UtilityClass.cpp + src/WarpClass.cpp + src/XMLUtils.cpp + src/main.cpp + src/DeferCallbacks.c + src/GlitchrunnerMode.c + src/Network.c + src/ThirdPartyDeps.c + src/Xoshiro.c ) +if(NOT CUSTOM_LEVEL_SUPPORT STREQUAL "DISABLED") + list(APPEND VVV_SRC src/editor.cpp) +endif() if(STEAM) - list(APPEND VVV_C_SRC src/SteamNetwork.c) + list(APPEND VVV_SRC src/SteamNetwork.c) endif() if(GOG) - list(APPEND VVV_C_SRC src/GOGNetwork.c) + list(APPEND VVV_SRC src/GOGNetwork.c) endif() -if(CMAKE_SYSTEM_NAME STREQUAL "iOS") - list(APPEND VVV_C_SRC src/SDL_uikit_main.c) -endif() - -set(VVV_SRC ${VVV_CXX_SRC} ${VVV_C_SRC}) # Executable information if(WIN32) - add_executable(VVVVVV WIN32 ${VVV_SRC} icon.rc) -elseif(ANDROID) - add_library(VVVVVV SHARED ${VVV_SRC}) -elseif(CMAKE_SYSTEM_NAME STREQUAL "iOS") - file(GLOB_RECURSE REPO_RESOURCES "fonts/*" "lang/*") - - add_executable(VVVVVV MACOSX_BUNDLE ${VVV_SRC} ${DATA_ZIP} AppIcon.xcassets ${REPO_RESOURCES}) - set_target_properties(VVVVVV PROPERTIES - XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER "com.distractionware.vvvvvvmobile" - XCODE_ATTRIBUTE_PRODUCT_NAME "VVVVVV" - XCODE_ATTRIBUTE_TARGETED_DEVICE_FAMILY "1,2" # iPhone, iPad - XCODE_ATTRIBUTE_CURRENT_PROJECT_VERSION "2.5" - XCODE_ATTRIBUTE_MARKETING_VERSION "2.5" - XCODE_ATTRIBUTE_ASSETCATALOG_COMPILER_APPICON_NAME AppIcon - XCODE_ATTRIBUTE_GENERATE_INFOPLIST_FILE YES - MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/Info.plist" - XCODE_ATTRIBUTE_INFOPLIST_KEY_LSSupportsOpeningDocumentsInPlace YES - XCODE_ATTRIBUTE_INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents YES - RESOURCE "${DATA_ZIP};AppIcon.xcassets" - ) - - foreach(REPO_FILE ${REPO_RESOURCES}) - file(RELATIVE_PATH REPO_FILE_REL "${CMAKE_CURRENT_SOURCE_DIR}" ${REPO_FILE}) - get_filename_component(REPO_FILE_DIR ${REPO_FILE_REL} DIRECTORY) - set_property(SOURCE ${REPO_FILE} PROPERTY MACOSX_PACKAGE_LOCATION "Resources/${REPO_FILE_DIR}") - source_group("Resources/${REPO_FILE_DIR}" FILES "${REPO_FILE}") - endforeach() + add_executable(VVVVVV WIN32 ${VVV_SRC} icon.rc) else() - add_executable(VVVVVV ${VVV_SRC}) + add_executable(VVVVVV ${VVV_SRC}) endif() # Include Directories if(BUNDLE_DEPENDENCIES) - target_include_directories( - VVVVVV PRIVATE - src - ../third_party - ../third_party/tinyxml2 - ../third_party/physfs/src - ../third_party/physfs/extras - ../third_party/lodepng - ../third_party/c-hashmap - ../third_party/FAudio/include - ../third_party/FAudio/src - ../third_party/SheenBidi/Headers - ) + target_include_directories( + VVVVVV PRIVATE + src + ../third_party/tinyxml2 + ../third_party/physfs + ../third_party/lodepng + ../third_party/utfcpp/source + ) else() - target_include_directories( - VVVVVV PRIVATE - src - ../third_party - ../third_party/lodepng - ../third_party/physfs/extras - ../third_party/c-hashmap - ../third_party/FAudio/src - ../third_party/SheenBidi/Headers - ) + target_include_directories( + VVVVVV PRIVATE + src + ../third_party/lodepng + ) endif() if(MAKEANDPLAY) - target_compile_definitions(VVVVVV PRIVATE -DMAKEANDPLAY) + target_compile_definitions(VVVVVV PRIVATE -DMAKEANDPLAY) endif() if(STEAM) - target_compile_definitions(VVVVVV PRIVATE -DSTEAM_NETWORK) + target_compile_definitions(VVVVVV PRIVATE -DSTEAM_NETWORK) endif() if(GOG) - target_compile_definitions(VVVVVV PRIVATE -DGOG_NETWORK) + target_compile_definitions(VVVVVV PRIVATE -DGOG_NETWORK) endif() set(XML2_SRC - ../third_party/tinyxml2/tinyxml2.cpp -) -set(FAUDIO_SRC - ../third_party/FAudio/src/FAudio.c - ../third_party/FAudio/src/FAudio_internal.c - ../third_party/FAudio/src/FAudio_internal_simd.c - ../third_party/FAudio/src/FAudio_operationset.c - ../third_party/FAudio/src/FAudio_platform_sdl2.c + ../third_party/tinyxml2/tinyxml2.cpp ) set(PFS_SRC - ../third_party/physfs/src/physfs.c - ../third_party/physfs/src/physfs_archiver_dir.c - ../third_party/physfs/src/physfs_archiver_unpacked.c - ../third_party/physfs/src/physfs_archiver_zip.c - ../third_party/physfs/src/physfs_byteorder.c - ../third_party/physfs/src/physfs_unicode.c - ../third_party/physfs/src/physfs_platform_posix.c - ../third_party/physfs/src/physfs_platform_unix.c - ../third_party/physfs/src/physfs_platform_windows.c - ../third_party/physfs/src/physfs_platform_haiku.cpp - ../third_party/physfs/src/physfs_platform_android.c + ../third_party/physfs/physfs.c + ../third_party/physfs/physfs_archiver_dir.c + ../third_party/physfs/physfs_archiver_unpacked.c + ../third_party/physfs/physfs_archiver_zip.c + ../third_party/physfs/physfs_byteorder.c + ../third_party/physfs/physfs_unicode.c + ../third_party/physfs/physfs_platform_posix.c + ../third_party/physfs/physfs_platform_unix.c + ../third_party/physfs/physfs_platform_windows.c + ../third_party/physfs/physfs_platform_haiku.cpp ) if(APPLE) - # Are you noticing a pattern with this Apple crap yet? - set(PFS_SRC ${PFS_SRC} ../third_party/physfs/src/physfs_platform_apple.m) + # Are you noticing a pattern with this Apple crap yet? + set(PFS_SRC ${PFS_SRC} ../third_party/physfs/physfs_platform_apple.m) endif() -set(PNG_SRC src/lodepng_wrapper.c) -set(CHM_SRC ../third_party/c-hashmap/map.c) -set(SBIDI_SRC ../third_party/SheenBidi/Source/SheenBidi.c) +set(PNG_SRC ../third_party/lodepng/lodepng.c) if(NOT OFFICIAL_BUILD) - # Add interim commit hash and its date to the build + # Add interim commit hash and its date to the build - # These filenames have to be qualified, because when we run - # the CMake script, its work dir gets set to the build folder - set(VERSION_INPUT_FILE ${CMAKE_CURRENT_SOURCE_DIR}/src/InterimVersion.in.c) - set(VERSION_OUTPUT_FILE ${CMAKE_CURRENT_SOURCE_DIR}/src/InterimVersion.out.c) + # find_package sets GIT_FOUND and GIT_EXECUTABLE + find_package(Git) - add_custom_command( - # This OUTPUT line is required for this to be ran every time - OUTPUT ${VERSION_OUTPUT_FILE} ${CMAKE_CURRENT_SOURCE_DIR}/src/_dummy.c - COMMAND ${CMAKE_COMMAND} - # These args have to be passed through, otherwise the script can't see them - # Also, these args have to come BEFORE `-P`! (Otherwise it fails with an unclear error) - -DINPUT_FILE=${VERSION_INPUT_FILE} - -DOUTPUT_FILE=${VERSION_OUTPUT_FILE} - -P ${CMAKE_CURRENT_SOURCE_DIR}/version.cmake - ) + if(GIT_FOUND) + # These filenames have to be qualified, because when we run + # the CMake script, its work dir gets set to the build folder + set(VERSION_INPUT_FILE ${CMAKE_CURRENT_SOURCE_DIR}/src/Version.h.in) + set(VERSION_OUTPUT_FILE ${CMAKE_CURRENT_SOURCE_DIR}/src/Version.h.out) - target_compile_definitions(VVVVVV PRIVATE -DINTERIM_VERSION_EXISTS) + add_custom_target( + GenerateVersion ALL + # This BYPRODUCTS line is required for this to be ran every time + BYPRODUCTS ${VERSION_OUTPUT_FILE} + COMMAND ${CMAKE_COMMAND} + # These args have to be passed through, otherwise the script can't see them + # Also, these args have to come BEFORE `-P`! (Otherwise it fails with an unclear error) + -DGIT_EXECUTABLE=${GIT_EXECUTABLE} + -DINPUT_FILE=${VERSION_INPUT_FILE} + -DOUTPUT_FILE=${VERSION_OUTPUT_FILE} + -P ${CMAKE_CURRENT_SOURCE_DIR}/version.cmake + ) - add_library(InterimVersion STATIC src/InterimVersion.out.c) - list(APPEND STATIC_LIBRARIES InterimVersion) + add_dependencies(VVVVVV GenerateVersion) + + # This lets Version.h know that Version.h.out exists + add_definitions(-DVERSION_H_OUT_EXISTS) + endif() endif() # Build options if(ENABLE_WARNINGS) - # The weird syntax is due to CMake generator expressions. - # Saves quite a few lines and boilerplate at the price of readability. - target_compile_options(VVVVVV PRIVATE - $<$,$,$>: - -Wall -Wpedantic $<$:-Werror>> - $<$: - /W4 $<$:/WX>>) + # The weird syntax is due to CMake generator expressions. + # Saves quite a few lines and boilerplate at the price of readability. + target_compile_options(VVVVVV PRIVATE + $<$,$,$>: + -Wall -Wpedantic $<$:-Werror>> + $<$: + /W4 $<$:/WX>>) +endif() + +if(CUSTOM_LEVEL_SUPPORT STREQUAL "NO_EDITOR") + add_definitions(-DNO_EDITOR) +elseif(CUSTOM_LEVEL_SUPPORT STREQUAL "DISABLED") + add_definitions(-DNO_CUSTOM_LEVELS -DNO_EDITOR) endif() if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") - set(SUPPORTS_IMPLICIT_FALLTHROUGH TRUE) + set(SUPPORTS_IMPLICIT_FALLTHROUGH TRUE) elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7.0) - set(SUPPORTS_IMPLICIT_FALLTHROUGH TRUE) - else() - set(SUPPORTS_IMPLICIT_FALLTHROUGH FALSE) - endif() + if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7.0) + set(SUPPORTS_IMPLICIT_FALLTHROUGH TRUE) + else() + set(SUPPORTS_IMPLICIT_FALLTHROUGH FALSE) + endif() else() - set(SUPPORTS_IMPLICIT_FALLTHROUGH FALSE) + set(SUPPORTS_IMPLICIT_FALLTHROUGH FALSE) endif() if(SUPPORTS_IMPLICIT_FALLTHROUGH) - target_compile_options(VVVVVV PRIVATE -Werror=implicit-fallthrough) + target_compile_options(VVVVVV PRIVATE -Werror=implicit-fallthrough) endif() if(MSVC) - # Disable MSVC warnings about implicit conversion - target_compile_options(VVVVVV PRIVATE /wd4244) + # Disable MSVC warnings about implicit conversion + target_compile_options(VVVVVV PRIVATE /wd4244) endif() -# Disable warnings about `long long` in C++03 (from including PhysFS) -if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - target_compile_options(VVVVVV PRIVATE -Wno-long-long) -elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") - target_compile_options(VVVVVV PRIVATE -Wno-c++11-long-long) -endif() - -# Disable warnings about flexible array members in C++ (from including FAudio) -if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") - target_compile_options(VVVVVV PRIVATE -Wno-c99-extensions) -endif() - -# Set standards version, disable exceptions and RTTI if(MSVC) - # MSVC doesn't have /std:c99 or /std:c++98 switches! + # Disable exceptions + string(REGEX REPLACE "/EH[a-z]+" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc") - # MSVC does not officially support disabling exceptions, - # so this is as far as we are willing to go to disable them. - string(REGEX REPLACE "/EH[a-z]+" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - string(REPLACE "/GR" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - set_source_files_properties(${VVV_CXX_SRC} PROPERTIES COMPILE_FLAGS "/EHsc /GR-") - - if(MSVC_VERSION GREATER 1900) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /utf-8") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /utf-8") - endif() + # Disable RTTI + string(REGEX REPLACE "/GR" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /GR-") else() - string(REGEX REPLACE "-std=[a-z0-9]+" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") - set_source_files_properties(${VVV_C_SRC} PROPERTIES COMPILE_FLAGS -std=c99) + # Disable exceptions + string(REGEX REPLACE "-fexceptions" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions") - string(REGEX REPLACE "-std=[a-z0-9+]+" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - string(REPLACE "-fexceptions" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - string(REPLACE "-frtti" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - set_source_files_properties(${VVV_CXX_SRC} PROPERTIES COMPILE_FLAGS "-std=c++98 -fno-exceptions -fno-rtti") - - # Dependencies (as needed) - set_source_files_properties(${FAUDIO_SRC} PROPERTIES COMPILE_FLAGS -std=c99) - set_source_files_properties(${CHM_SRC} PROPERTIES COMPILE_FLAGS -std=c99) + # Disable RTTI + string(REGEX REPLACE "-frtti" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti") endif() # Unfortunately, it doesn't seem like distros package LodePNG add_library(lodepng-static STATIC ${PNG_SRC}) target_compile_definitions(lodepng-static PRIVATE - -DLODEPNG_NO_COMPILE_ALLOCATORS - -DLODEPNG_NO_COMPILE_DISK -) - -add_library(c-hashmap-static STATIC ${CHM_SRC}) - -add_library(sheenbidi-static STATIC ${SBIDI_SRC}) - -target_compile_definitions(sheenbidi-static PRIVATE - -DSB_CONFIG_UNITY -) -target_include_directories(sheenbidi-static PRIVATE - ../third_party/SheenBidi/Headers + -DLODEPNG_NO_COMPILE_ALLOCATORS + -DLODEPNG_NO_COMPILE_DISK + -DLODEPNG_NO_COMPILE_ENCODER ) if(BUNDLE_DEPENDENCIES) - list(APPEND STATIC_LIBRARIES physfs-static tinyxml2-static lodepng-static c-hashmap-static faudio-static sheenbidi-static) + add_library(tinyxml2-static STATIC ${XML2_SRC}) + add_library(physfs-static STATIC ${PFS_SRC}) + target_compile_definitions(physfs-static PRIVATE + -DPHYSFS_SUPPORTS_DEFAULT=0 -DPHYSFS_SUPPORTS_ZIP=1 + ) + + # PhysFS needs some extensions... + if(${CMAKE_VERSION} VERSION_GREATER "3.1.3" + OR ${CMAKE_VERSION} VERSION_EQUAL "3.1.3") + set_property(TARGET physfs-static PROPERTY C_EXTENSIONS ON) + endif() + + target_link_libraries(VVVVVV physfs-static tinyxml2-static lodepng-static) else() - list(APPEND STATIC_LIBRARIES lodepng-static c-hashmap-static sheenbidi-static) + find_package(utf8cpp CONFIG) + + target_link_libraries(VVVVVV physfs tinyxml2 utf8cpp lodepng-static) endif() -if(BUNDLE_DEPENDENCIES) - add_library(tinyxml2-static STATIC ${XML2_SRC}) - add_library(physfs-static STATIC ${PFS_SRC}) - target_compile_definitions(physfs-static PRIVATE - -DPHYSFS_SUPPORTS_DEFAULT=0 -DPHYSFS_SUPPORTS_ZIP=1 - ) - add_library(faudio-static STATIC ${FAUDIO_SRC}) - target_include_directories( - faudio-static PRIVATE - ../third_party/FAudio/include - ) - # Disable FAudio debug stuff in release mode. This needs a generator expression for CMake reasons(TM) - target_compile_definitions(faudio-static PRIVATE $<$:FAUDIO_DISABLE_DEBUGCONFIGURATION>) - - target_link_libraries(VVVVVV ${STATIC_LIBRARIES}) -else() - target_link_libraries(VVVVVV ${STATIC_LIBRARIES} physfs tinyxml2 FAudio) -endif() - - -if(MSVC) - # Statically link Microsoft's runtime library so end users don't have to install it (/MT) - # Also, build with multiple processors (/MP) - list(APPEND GLOBAL_COMPILE_FLAGS /MT /MP) -endif() - - -if(REMOVE_ABSOLUTE_PATHS) - if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") - if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 3.8) - set(SUPPORTS_DEBUG_PREFIX_MAP TRUE) - else() - set(SUPPORTS_DEBUG_PREFIX_MAP FALSE) - endif() - if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 10.0) - set(SUPPORTS_FILE_PREFIX_MAP TRUE) - else() - set(SUPPORTS_FILE_PREFIX_MAP FALSE) - endif() - elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - set(SUPPORTS_DEBUG_PREFIX_MAP TRUE) - if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 8.0) - set(SUPPORTS_FILE_PREFIX_MAP TRUE) - else() - set(SUPPORTS_FILE_PREFIX_MAP FALSE) - endif() - else() - set(SUPPORTS_DEBUG_PREFIX_MAP FALSE) - set(SUPPORTS_FILE_PREFIX_MAP FALSE) - endif() - - get_filename_component(REPO_DIR ../ ABSOLUTE) - - # Remove absolute source paths from compiled binary - if(SUPPORTS_FILE_PREFIX_MAP) - list(APPEND GLOBAL_COMPILE_FLAGS -ffile-prefix-map=${REPO_DIR}=.) - elseif(SUPPORTS_DEBUG_PREFIX_MAP) - list(APPEND GLOBAL_COMPILE_FLAGS -fdebug-prefix-map=${REPO_DIR}=.) - endif() -endif() - - -target_compile_options(VVVVVV PRIVATE ${GLOBAL_COMPILE_FLAGS}) - -foreach(static_library IN LISTS STATIC_LIBRARIES) - target_compile_options(${static_library} PRIVATE ${GLOBAL_COMPILE_FLAGS}) -endforeach(static_library) - - # SDL2 Dependency (Detection pulled from FAudio) if(DEFINED SDL2_INCLUDE_DIRS AND DEFINED SDL2_LIBRARIES) - message(STATUS "Using pre-defined SDL2 variables SDL2_INCLUDE_DIRS and SDL2_LIBRARIES") - target_include_directories(VVVVVV SYSTEM PRIVATE "$") - target_link_libraries(VVVVVV ${SDL2_LIBRARIES}) - if(BUNDLE_DEPENDENCIES) - target_include_directories(faudio-static SYSTEM PRIVATE "$") - target_link_libraries(faudio-static ${SDL2_LIBRARIES}) - endif() -elseif (EMSCRIPTEN) - message(STATUS "Using Emscripten SDL2") - target_compile_options(VVVVVV PUBLIC -sUSE_SDL=2) - target_link_libraries(VVVVVV -sUSE_SDL=2) - if(BUNDLE_DEPENDENCIES) - target_compile_options(faudio-static PUBLIC -sUSE_SDL=2) - target_link_libraries(faudio-static -sUSE_SDL=2) - endif() -elseif(DEFINED SDL2_FRAMEWORK) - message(STATUS "Using pre-defined SDL2 variable SDL2_FRAMEWORK") - target_include_directories(VVVVVV SYSTEM PRIVATE "$") - target_link_libraries(VVVVVV ${SDL2_FRAMEWORK}) - if(BUNDLE_DEPENDENCIES) - target_include_directories(faudio-static SYSTEM PRIVATE "$") - target_link_libraries(faudio-static ${SDL2_FRAMEWORK}) - endif() - set_target_properties(VVVVVV PROPERTIES XCODE_EMBED_FRAMEWORKS ${SDL2_FRAMEWORK}) + message(STATUS "Using pre-defined SDL2 variables SDL2_INCLUDE_DIRS and SDL2_LIBRARIES") + target_include_directories(VVVVVV SYSTEM PRIVATE "$") + target_link_libraries(VVVVVV ${SDL2_LIBRARIES}) else() - # Only try to autodetect if both SDL2 variables aren't explicitly set - find_package(SDL2 CONFIG) - if(TARGET SDL2::SDL2) - message(STATUS "Using TARGET SDL2::SDL2") - target_link_libraries(VVVVVV SDL2::SDL2) - if(BUNDLE_DEPENDENCIES) - target_link_libraries(faudio-static SDL2::SDL2) - endif() - elseif(TARGET SDL2) - message(STATUS "Using TARGET SDL2") - target_link_libraries(VVVVVV SDL2) - if(BUNDLE_DEPENDENCIES) - target_link_libraries(faudio-static SDL2) - endif() - else() - message(STATUS "No TARGET SDL2::SDL2, or SDL2, using variables") - target_include_directories(VVVVVV SYSTEM PRIVATE "$") - target_link_libraries(VVVVVV ${SDL2_LIBRARIES}) - if(BUNDLE_DEPENDENCIES) - target_include_directories(faudio-static SYSTEM PRIVATE "$") - target_link_libraries(faudio-static ${SDL2_LIBRARIES}) - endif() - endif() + # Only try to autodetect if both SDL2 variables aren't explicitly set + find_package(SDL2 CONFIG) + if(TARGET SDL2::SDL2) + message(STATUS "Using TARGET SDL2::SDL2") + target_link_libraries(VVVVVV SDL2::SDL2 SDL2_mixer) + elseif(TARGET SDL2) + message(STATUS "Using TARGET SDL2") + target_link_libraries(VVVVVV SDL2 SDL2_mixer) + else() + message(STATUS "No TARGET SDL2::SDL2, or SDL2, using variables") + find_path(SDL2_MIXER_INCLUDE_DIRS NAMES SDL_mixer.h PATH_SUFFIXES SDL2) + target_include_directories(VVVVVV SYSTEM PRIVATE "$" ${SDL2_MIXER_INCLUDE_DIRS}) + target_link_libraries(VVVVVV ${SDL2_LIBRARIES} SDL2_mixer) + endif() endif() # Yes, more Apple Crap if(APPLE) - find_library(FOUNDATION NAMES Foundation) - find_library(IOKIT NAMES IOKit) - target_link_libraries(VVVVVV objc ${IOKIT} ${FOUNDATION}) + find_library(FOUNDATION NAMES Foundation) + find_library(IOKIT NAMES IOKit) + target_link_libraries(VVVVVV objc ${IOKIT} ${FOUNDATION}) endif() # But hey, also some Haiku crap if(HAIKU) - find_library(BE_LIBRARY be) - find_library(ROOT_LIBRARY root) - target_link_libraries(VVVVVV ${BE_LIBRARY} ${ROOT_LIBRARY}) -endif() -if(EMSCRIPTEN) - # 256MB is enough for everybody - target_link_libraries(VVVVVV -sFORCE_FILESYSTEM=1 -sTOTAL_MEMORY=256MB) + find_library(BE_LIBRARY be) + find_library(ROOT_LIBRARY root) + target_link_libraries(VVVVVV ${BE_LIBRARY} ${ROOT_LIBRARY}) endif() diff --git a/desktop_version/CONTRIBUTORS.txt b/desktop_version/CONTRIBUTORS.txt index 06930690..5fc08e73 100644 --- a/desktop_version/CONTRIBUTORS.txt +++ b/desktop_version/CONTRIBUTORS.txt @@ -3,24 +3,22 @@ Contributors (Ordered alphabetically by first name.) -* Alexandra Fox * AlexApps99 (@AlexApps99) * Allison Fleischer (AllisonFleischer) +* AllyTally (@AllyTally) * Brian Callahan (@ibara) * Charlie Bruce (@charliebruce) * Christoph Böhmwalder (@chrboe) * Daniel Lee (@ddm999) -* Dav999 (@Daaaav) +* Dav999 (@Dav999-v) * Elijah Stone (@moon-chilled) * Elliott Saltar (@eboyblue3) * Emmanuel Vadot (@evadot) -* fraZ0R (@f-raZ0R) * Fredrik Ljungdahl (@FredrIQ) -* iliana etaoin (@iliana) * Jules de Sartiges (@strikersh) * Keith Stellyes (@keithstellyes) * KyoZM (@lsaa) -* leo vriska (@leo60228) +* leo60228 (@leo60228) * MAO3J1m0Op (@MAO3J1m0Op) * Malte Grimm (@trelbutate) * Marvin Scholz (@ePirat) @@ -31,11 +29,8 @@ Contributors * Pierre-Alain TORET (@daftaupe) * Reese Rivers (@ReeseTheRivers) * Rémi Verschelde (@akien-mga) -* SnDream (@SnDream) -* Space-G (@Space-G) * Thomas Sänger (@HorayNarea) * Tynan Richards (@tzann) * Wouter (@Xesxen) * viri (viri.moe) * Vittorio Romeo (@SuperV1234) -* Yussur Mustafa Oraji (@N00byKing) diff --git a/desktop_version/Dockerfile b/desktop_version/Dockerfile index 1c408f78..7f033991 100644 --- a/desktop_version/Dockerfile +++ b/desktop_version/Dockerfile @@ -2,9 +2,12 @@ FROM centos:7 # run first to improve caching (other things update more often than SDL2) WORKDIR /tmp -RUN curl -LJO https://github.com/libsdl-org/SDL/releases/download/release-2.24.0/SDL2-2.24.0.tar.gz -RUN tar -xf SDL2-2.24.0.tar.gz -RUN mkdir SDL2-2.24.0/build +RUN curl -O https://www.libsdl.org/release/SDL2-2.0.14.tar.gz +RUN tar -xf SDL2-2.0.14.tar.gz +RUN mkdir SDL2-2.0.14/build +RUN curl -O https://www.libsdl.org/projects/SDL_mixer/release/SDL2_mixer-2.0.4.tar.gz +RUN tar -xf SDL2_mixer-2.0.4.tar.gz +RUN mkdir SDL2_mixer-2.0.4/build # add EPEL (for SDL2) RUN yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm @@ -13,6 +16,8 @@ RUN yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.n RUN yum -y install \ # used below yum-utils \ + # SDL2_mixer dependencies + libogg-devel libvorbis-devel \ # VVVVVV dependencies gcc-c++ cmake make @@ -20,12 +25,17 @@ RUN yum-builddep -y SDL2 RUN yum clean all -WORKDIR /tmp/SDL2-2.24.0/build +WORKDIR /tmp/SDL2-2.0.14/build +RUN ../configure +RUN make -j $(nproc) +RUN make install + +WORKDIR /tmp/SDL2_mixer-2.0.4/build RUN ../configure RUN make -j $(nproc) RUN make install WORKDIR /tmp -RUN rm -rf SDL2-2.24.0.tar.gz SDL2-2.24.0/ +RUN rm -rf SDL2-2.0.14.tar.gz SDL2-2.0.14/ SDL2_mixer-2.0.4.tar.gz SDL2_mixer-2.0.4/ WORKDIR / diff --git a/desktop_version/Info.plist b/desktop_version/Info.plist deleted file mode 100644 index ff579a6c..00000000 --- a/desktop_version/Info.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - UIFileSharingEnabled - - - diff --git a/desktop_version/README.md b/desktop_version/README.md index 012d1aee..3a3e9dab 100644 --- a/desktop_version/README.md +++ b/desktop_version/README.md @@ -6,56 +6,83 @@ VVVVVV's official desktop versions are built with the following environments: - macOS: Xcode CLT, currently targeting 10.9 SDK - GNU/Linux: CentOS 7 -The engine depends solely on [SDL2](https://libsdl.org/) 2.24.0+. All other dependencies +The engine depends solely on [SDL2](https://libsdl.org/) 2.0.14+ and +[SDL2_mixer](https://www.libsdl.org/projects/SDL_mixer/). All other dependencies are statically linked into the engine. The development libraries for Windows can -be downloaded from SDL's website, Linux developers can find the dev libraries from their -respective repositories, and macOS developers should compile and install from source. -(If you're on Ubuntu and your Ubuntu is too old to have this SDL version, then -[see here](https://github.com/TerryCavanagh/VVVVVV/issues/618#issuecomment-968338212) -for workarounds.) - -Since VVVVVV 2.4, git submodules are used for the -[third party libraries](https://github.com/TerryCavanagh/VVVVVV/tree/master/third_party). -After cloning, run `git submodule update --init` to set all of these up. -You can also use this command whenever the submodules need to be updated. +be downloaded from their respective websites, Linux developers can find the dev +libraries from their respective repositories, and macOS developers should +compile and install from source (including libogg/libvorbis/libvorbisfile). Steamworks support is included and the DLL is loaded dynamically, you do not need the SDK headers and there is no special Steam or non-Steam version. The current implementation has been tested with Steamworks SDK v1.46. -To build the Make and Play edition of the game, uncomment `#define MAKEANDPLAY` -in `MakeAndPlay.h`. - To generate the projects on Windows: ``` -# Put your SDL2 folders somewhere nice! -mkdir build -cd build -cmake -A Win32 -G "Visual Studio 10 2010" .. -DSDL2_INCLUDE_DIRS="C:\SDL2-2.24.0\include" -DSDL2_LIBRARIES="C:\SDL2-2.24.0\lib\x86\SDL2;C:\SDL2-2.24.0\lib\x86\SDL2main" +# Put your SDL2/SDL2_mixer folders somewhere nice! +mkdir flibitBuild +cd flibitBuild +cmake -A Win32 -G "Visual Studio 10 2010" .. -DSDL2_INCLUDE_DIRS="C:\SDL2-2.0.14\include;C:\SDL2_mixer-2.0.4\include" -DSDL2_LIBRARIES="C:\SDL2-2.0.14\lib\x86\SDL2;C:\SDL2-2.0.14\lib\x86\SDL2main;C:\SDL2_mixer-2.0.4\lib\x86\SDL2_mixer" ``` -Then to compile the game, open the solution and click Build. +Note that on some systems, the `SDL2_LIBRARIES` list on Windows may need +SDL2/SDL2main/SDL2_mixer to have `.lib` at the end of them. The reason for this +inconsistency is unknown. -For more detailed information and troubleshooting, see the [Compiling VVVVVV -Guide](https://vsix.dev/wiki/Guide:Compiling_VVVVVV_on_Windows_with_Visual_Studio) -on the Viki. +Also note that if you're using a Visual Studio later than 2010, you will need to +change the `-G` string accordingly; otherwise you will get a weird cryptic +error. Refer to the list below: + +- VS 2012: `"Visual Studio 11 2012"` +- VS 2013: `"Visual Studio 12 2013"` +- VS 2015: `"Visual Studio 14 2015"` +- VS 2017: `"Visual Studio 15 2017"` +- VS 2019: `"Visual Studio 16 2019"` +- VS 2022: `"Visual Studio 17 2022"` To generate everywhere else: ``` -mkdir build -cd build +mkdir flibitBuild +cd flibitBuild cmake .. ``` -Then to compile the game, type `make`. +macOS may be fussy about the SDK version. How to fix this is up to the whims of +however Apple wants to make CMAKE_OSX_SYSROOT annoying to configure and retain +each time Xcode updates. Including data.zip ------------ -You'll need the data.zip file from VVVVVV to actually run the game! You can grab -it from your copy of the game, or you can just download it for free from the [Make -and Play](https://thelettervsixtim.es/makeandplay/) page. Put this file next to -your executable and the game should run. +You'll need the data.zip file from VVVVVV to actually run the game! It's +available to download separately for free in the +[Make and Play](https://thelettervsixtim.es/makeandplay/) +edition of the game. Put this file next to your executable and the game should +run. This is intended for personal use only - our license doesn't allow you to actually distribute this data.zip file with your own forks without getting -permission from us first. See [LICENSE.md](../LICENSE.md) for more details. +permission from us first. See [LICENSE.md](../LICENSE.md) for more details. (If +you've got a project in mind that requires distributing this +file, [get in touch](http://distractionware.com/email/)!) + +A Word About Compiler Quirks +---------------------------- + +_(Note: This section only applies to version 2.2 of the source code, which is +the initial commit of this repository. Since then, much hard work has been put +in to fix many undefined behaviors. If you're compiling the latest version of +the source code, ignore this section.)_ + +This engine is _super_ fussy about optimization levels and runtime checks. In +particular, the Windows version _absolutely positively must_ be compiled in +Debug mode, with /RTC enabled. If you build in Release mode, or have /RTC +disabled, the game behaves dramatically different in ways that were never fully +documented (bizarre softlocks, out-of-bounds issues that don't show up in tools +like Valgrind, stuff like that). There are lots of things about this old code +that could be cleaned up, polished, rewritten, and so on, but this is the one +that will probably bite you the hardest when setting up your own build, +regardless of platform. + +We hope you'll enjoy messing with the source anyway! + +Love, flibit diff --git a/desktop_version/TRANSLATORS.txt b/desktop_version/TRANSLATORS.txt deleted file mode 100644 index 72649b37..00000000 --- a/desktop_version/TRANSLATORS.txt +++ /dev/null @@ -1,87 +0,0 @@ -Translators ------------- - -Arabic (Eternal Dream Arabization): - - Montassar Ghanmi - - Mohammed Seif Eddine Chaib - -Catalan: - - Eduard Ereza Martínez - -Welsh: - - Morgan Roberts - -German: - - Thomas Faust - -Esperanto: - - Reese Rivers - -Spanish (ES): - - Felipe Mercader - - Sara Marín - -Spanish (LATAM): - - LocQuest - - Guido Di Carlo - -Spanish (ARG.): - - LocQuest - - Guido Di Carlo - -French: - - Words of Magic - -Irish: - - Úna-Minh Kavanagh - - Seaghán Ó Modhráin - - Davis Sandefur - -Italian (gloc.team): - - Alain Dellepiane - - Matteo Scarabelli - - Lorenzo Bertolucci - - Fabio Bortolotti - -Japanese: - - Nicalis, Inc. - - KabanFriends - -Korean: - - Bada Im - - Hyungseok Cho - -Dutch: - - Dav999 - -Polish: - - Kuba Kallus - -Brazilian Portuguese: - Translators: - - Lucas Araujo - - Thiago Araujo - Editing and LQA: - - Ivan Lopes - - Lucas Nunes - -European Portuguese: - - Locsmiths - -Russian: - - TheMysticSword - -Silesian: - - Kuba Kallus - -Turkish: - - Engin İlkiz - -Ukrainian: - - Olya Sushytska - -Chinese (Simplified): - - Sound of Mystery - -Chinese (Traditional): - - Sound of Mystery / craft \ No newline at end of file diff --git a/desktop_version/VVVVVV-android/.gitignore b/desktop_version/VVVVVV-android/.gitignore deleted file mode 100644 index 2dc11ba8..00000000 --- a/desktop_version/VVVVVV-android/.gitignore +++ /dev/null @@ -1,34 +0,0 @@ -# Gradle files -.gradle/ -build/ - -# Local configuration file (sdk path, etc) -local.properties - -# Log/OS Files -*.log - -# Android Studio generated files and folders -captures/ -.externalNativeBuild/ -.cxx/ -*.apk -output.json -output-metadata.json - -# IntelliJ -*.iml -.idea/ -misc.xml -deploymentTargetDropDown.xml -render.experimental.xml - -# Keystore files -*.jks -*.keystore - -# Google Services (e.g. APIs or Firebase) -google-services.json - -# Android Profiling -*.hprof diff --git a/desktop_version/VVVVVV-android/README.md b/desktop_version/VVVVVV-android/README.md deleted file mode 100644 index b7305828..00000000 --- a/desktop_version/VVVVVV-android/README.md +++ /dev/null @@ -1,37 +0,0 @@ -Android port for C++ version -============================ - -This is _not_ the other existing mobile version (which is a fork of the original Flash -version). This is a port of the C++ desktop version, because the C++ version has gotten -many improvements since the source release (along with Flash being deprecated in -general). - -How to Build ------------- - -The recommended way is to install Android Studio and Maven. These instructions are for -SDL 2.30.8; adapt your SDL version accordingly. - -1. Place a copy of `data.zip` in `desktop_version/VVVVVV-android/app/src/main/assets/`. - (If the `assets/` folder doesn't exist, then create it.) -2. Obtain the SDL 2.30.8 Maven package. As of writing, SDL currently does not publish - Maven packages, so here is one way to obtain them (other methods are possible): - - 1. Download the SDL 2.30.8 source code. - 2. Run the `build-scripts/android-prefab.sh` script in the SDL repository. - 3. After building, run `mvn install:install-file - -Dfile=build-android-prefab/prefab-2.30.8/SDL2-2.30.8.aar - -DpomFile=build-android-prefab/prefab-2.30.8/SDL2-2.30.8.pom` to install it to - Maven Local. - -3. Open the `desktop_version/VVVVVV-android/` folder in Android Studio. -4. Click 'Build'. - -How to Install and Play ------------------------ - -After building, go to `desktop_version/VVVVVV-android/app/build/outputs/apk/`, copy the -APK of the appropriate architecture to your device, and install it. - -Touchscreen support is currently not implemented, so you will need to connect a keyboard -or controller to your device in order to play the game. diff --git a/desktop_version/VVVVVV-android/app/build.gradle b/desktop_version/VVVVVV-android/app/build.gradle deleted file mode 100644 index 58692135..00000000 --- a/desktop_version/VVVVVV-android/app/build.gradle +++ /dev/null @@ -1,114 +0,0 @@ -def buildAsLibrary = project.hasProperty('BUILD_AS_LIBRARY'); -def buildAsApplication = !buildAsLibrary -if (buildAsApplication) { - apply plugin: 'com.android.application' -} else { - apply plugin: 'com.android.library' -} - -android { - if (buildAsApplication) { - namespace "com.distractionware.vvvvvv" - } - compileSdkVersion 34 - defaultConfig { - minSdkVersion 29 - targetSdkVersion 34 - versionCode 20005000 - versionName "2.5" - applicationId "air.com.distractionware.vvvvvvmobile" - externalNativeBuild { - cmake { - arguments "-DANDROID_STL=c++_shared" - } - } - } - buildFeatures { - prefab true - } - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - } - } - applicationVariants.all { variant -> - tasks["merge${variant.name.capitalize()}Assets"] - .dependsOn("externalNativeBuild${variant.name.capitalize()}") - } - if (!project.hasProperty('EXCLUDE_NATIVE_LIBS')) { - sourceSets.main { - jniLibs.srcDir 'libs' - } - externalNativeBuild { - cmake { - path 'jni/CMakeLists.txt' - } - } - - } - lint { - abortOnError false - } - aaptOptions { - noCompress 'zip' - } - - if (buildAsLibrary) { - libraryVariants.all { variant -> - variant.outputs.each { output -> - def outputFile = output.outputFile - if (outputFile != null && outputFile.name.endsWith(".aar")) { - def fileName = "org.libsdl.app.aar"; - output.outputFile = new File(outputFile.parent, fileName); - } - } - } - } - - splits { - abi { - enable true - } - } - - sourceSets { - main { - assets { - srcDir layout.buildDirectory.dir("generated/main/assets") - } - } - } -} - -def zipRepoAssetsTask = tasks.register("zipRepoAssets", Zip) { - from('../../fonts') { spec -> - spec.into('graphics') - } - from('../../lang') { spec -> - spec.into('lang') - } - archiveFileName.set('repo.zip') - destinationDirectory.value(layout.buildDirectory.dir("generated/main/assets")) -} - -project.android.applicationVariants.configureEach { variant -> - def compressAssetsTask = project.tasks.named("merge${variant.name.capitalize()}Assets") - compressAssetsTask.configure { task -> - task.dependsOn zipRepoAssetsTask - } -} - -afterEvaluate { - [lintReportDebug, lintAnalyzeDebug, lintReportRelease, lintAnalyzeRelease, lintVitalReportRelease, lintVitalAnalyzeRelease].each { task -> - task.dependsOn zipRepoAssetsTask - } -} - -dependencies { - implementation fileTree(include: ['*.jar'], dir: 'libs') - implementation 'org.jetbrains:annotations:15.0' - implementation 'androidx.core:core:1.10.1' - implementation 'androidx.exifinterface:exifinterface:1.3.6' - implementation 'org.libsdl.android:SDL2:2.30.8' -} diff --git a/desktop_version/VVVVVV-android/app/jni/Android.mk b/desktop_version/VVVVVV-android/app/jni/Android.mk deleted file mode 100644 index 5053e7d6..00000000 --- a/desktop_version/VVVVVV-android/app/jni/Android.mk +++ /dev/null @@ -1 +0,0 @@ -include $(call all-subdir-makefiles) diff --git a/desktop_version/VVVVVV-android/app/jni/Application.mk b/desktop_version/VVVVVV-android/app/jni/Application.mk deleted file mode 100644 index 023bc20d..00000000 --- a/desktop_version/VVVVVV-android/app/jni/Application.mk +++ /dev/null @@ -1,10 +0,0 @@ - -# Uncomment this if you're using STL in your project -# You can find more information here: -# https://developer.android.com/ndk/guides/cpp-support -# APP_STL := c++_shared - -APP_ABI := armeabi-v7a arm64-v8a x86 x86_64 - -# Min runtime API level -APP_PLATFORM=android-16 diff --git a/desktop_version/VVVVVV-android/app/jni/CMakeLists.txt b/desktop_version/VVVVVV-android/app/jni/CMakeLists.txt deleted file mode 100644 index ce54997f..00000000 --- a/desktop_version/VVVVVV-android/app/jni/CMakeLists.txt +++ /dev/null @@ -1,15 +0,0 @@ -cmake_minimum_required(VERSION 3.6) - -project(VVVVVV_android) - -# armeabi-v7a requires cpufeatures library -# include(AndroidNdkModules) -# android_ndk_import_module_cpufeatures() - -# Compilation of companion libraries -#add_subdirectory(SDL_image) -#add_subdirectory(SDL_mixer) -#add_subdirectory(SDL_ttf) - -add_subdirectory(../../.. desktop_version) - diff --git a/desktop_version/VVVVVV-android/app/proguard-rules.pro b/desktop_version/VVVVVV-android/app/proguard-rules.pro deleted file mode 100644 index eaf0e916..00000000 --- a/desktop_version/VVVVVV-android/app/proguard-rules.pro +++ /dev/null @@ -1,17 +0,0 @@ -# Add project specific ProGuard rules here. -# By default, the flags in this file are appended to flags specified -# in [sdk]/tools/proguard/proguard-android.txt -# You can edit the include path and order by changing the proguardFiles -# directive in build.gradle. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# Add any project specific keep options here: - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} diff --git a/desktop_version/VVVVVV-android/app/src/main/AndroidManifest.xml b/desktop_version/VVVVVV-android/app/src/main/AndroidManifest.xml deleted file mode 100644 index aaca64df..00000000 --- a/desktop_version/VVVVVV-android/app/src/main/AndroidManifest.xml +++ /dev/null @@ -1,112 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/VVVVVV-android/app/src/main/ic_launcher-playstore.png b/desktop_version/VVVVVV-android/app/src/main/ic_launcher-playstore.png deleted file mode 100644 index 8e221ed7..00000000 Binary files a/desktop_version/VVVVVV-android/app/src/main/ic_launcher-playstore.png and /dev/null differ diff --git a/desktop_version/VVVVVV-android/app/src/main/java/com/distractionware/vvvvvv/BaseDirProvider.java b/desktop_version/VVVVVV-android/app/src/main/java/com/distractionware/vvvvvv/BaseDirProvider.java deleted file mode 100644 index 3d22f698..00000000 --- a/desktop_version/VVVVVV-android/app/src/main/java/com/distractionware/vvvvvv/BaseDirProvider.java +++ /dev/null @@ -1,85 +0,0 @@ -package com.distractionware.vvvvvv; - -import android.database.Cursor; -import android.database.MatrixCursor; -import android.database.MatrixCursor.RowBuilder; -import android.net.Uri; -import android.provider.DocumentsContract; -import android.provider.DocumentsContract.Document; -import android.provider.DocumentsContract.Root; - -import java.io.File; -import java.io.FileNotFoundException; - -public class BaseDirProvider extends FileSystemProvider { - private static final String AUTHORITY = "com.distractionware.vvvvvv.basedir"; - private static final String DOC_ID_ROOT = "vvvvvv"; - - private static final String[] DEFAULT_ROOT_PROJECTION = new String[]{ - Root.COLUMN_ROOT_ID, Root.COLUMN_FLAGS, Root.COLUMN_ICON, Root.COLUMN_TITLE, - Root.COLUMN_DOCUMENT_ID, - }; - - private static final String[] DEFAULT_DOCUMENT_PROJECTION = new String[]{ - Document.COLUMN_DOCUMENT_ID, Document.COLUMN_MIME_TYPE, Document.COLUMN_DISPLAY_NAME, - Document.COLUMN_LAST_MODIFIED, Document.COLUMN_FLAGS, Document.COLUMN_SIZE, - }; - - private File mRoot; - - @Override - public boolean onCreate() { - super.onCreate(DEFAULT_DOCUMENT_PROJECTION); - mRoot = getContext().getExternalFilesDir(null); - return true; - } - - @Override - public Cursor queryRoots(String[] projection) throws FileNotFoundException { - final MatrixCursor result = new MatrixCursor(resolveRootProjection(projection)); - final RowBuilder row = result.newRow(); - row.add(Root.COLUMN_ROOT_ID, DOC_ID_ROOT); - row.add(Root.COLUMN_FLAGS, - Root.FLAG_LOCAL_ONLY | Root.FLAG_SUPPORTS_CREATE | Root.FLAG_SUPPORTS_SEARCH | - Root.FLAG_SUPPORTS_IS_CHILD); - row.add(Root.COLUMN_ICON, R.mipmap.ic_launcher); - row.add(Root.COLUMN_TITLE, "VVVVVV"); - row.add(Root.COLUMN_DOCUMENT_ID, DOC_ID_ROOT); - return result; - } - - @Override - protected Uri buildNotificationUri(String docId) { - return DocumentsContract.buildChildDocumentsUri(AUTHORITY, docId); - } - - private static String[] resolveRootProjection(String[] projection) { - return projection != null ? projection : DEFAULT_ROOT_PROJECTION; - } - - private static String[] resolveDocumentProjection(String[] projection) { - return projection != null ? projection : DEFAULT_DOCUMENT_PROJECTION; - } - - @Override - protected String getDocIdForFile(File file) { - return "raw:" + file.getAbsolutePath(); - } - - @Override - protected File getFileForDocId(String documentId, boolean visible) - throws FileNotFoundException { - if (DOC_ID_ROOT.equals(documentId)) { - return mRoot; - } else if (documentId.startsWith("raw:")) { - final String name = documentId.substring(4); - final File file = new File(name); - if (!file.exists()) { - throw new FileNotFoundException("File not found: " + name); - } - return file; - } else { - throw new FileNotFoundException("Invalid document ID: " + documentId); - } - } -} diff --git a/desktop_version/VVVVVV-android/app/src/main/java/com/distractionware/vvvvvv/FileSystemProvider.java b/desktop_version/VVVVVV-android/app/src/main/java/com/distractionware/vvvvvv/FileSystemProvider.java deleted file mode 100644 index ce28da6c..00000000 --- a/desktop_version/VVVVVV-android/app/src/main/java/com/distractionware/vvvvvv/FileSystemProvider.java +++ /dev/null @@ -1,936 +0,0 @@ -/* - * Copyright (C) 2017 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.distractionware.vvvvvv; - -import static android.provider.DocumentsContract.EXTRA_ORIENTATION; -import static android.provider.DocumentsContract.QUERY_ARG_DISPLAY_NAME; -import static android.provider.DocumentsContract.QUERY_ARG_EXCLUDE_MEDIA; -import static android.provider.DocumentsContract.QUERY_ARG_FILE_SIZE_OVER; -import static android.provider.DocumentsContract.QUERY_ARG_LAST_MODIFIED_AFTER; -import static android.provider.DocumentsContract.QUERY_ARG_MIME_TYPES; - -import android.content.ContentResolver; -import android.content.Context; -import android.content.Intent; -import android.content.res.AssetFileDescriptor; -import android.database.Cursor; -import android.database.MatrixCursor; -import android.database.MatrixCursor.RowBuilder; -import android.graphics.Point; -import android.media.MediaScannerConnection; -import android.net.Uri; -import android.os.Bundle; -import android.os.CancellationSignal; -import android.os.FileObserver; -import android.os.Handler; -import android.os.ParcelFileDescriptor; -import android.provider.DocumentsContract; -import android.provider.DocumentsContract.Document; -import android.provider.DocumentsProvider; -import android.text.TextUtils; -import android.util.ArrayMap; -import android.util.Log; -import android.webkit.MimeTypeMap; - -import androidx.core.content.MimeTypeFilter; -import androidx.exifinterface.media.ExifInterface; - -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -import java.io.File; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.nio.charset.StandardCharsets; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.LinkedList; -import java.util.List; -import java.util.Locale; -import java.util.Objects; -import java.util.Set; -import java.util.concurrent.CopyOnWriteArrayList; -import java.util.function.Predicate; - -/** - * A helper class for {@link android.provider.DocumentsProvider} to perform file operations on local - * files. - */ -public abstract class FileSystemProvider extends DocumentsProvider { - - private static final String TAG = "FileSystemProvider"; - - private static final boolean LOG_INOTIFY = false; - - protected static final String SUPPORTED_QUERY_ARGS = joinNewline( - QUERY_ARG_DISPLAY_NAME, - QUERY_ARG_FILE_SIZE_OVER, - QUERY_ARG_LAST_MODIFIED_AFTER, - QUERY_ARG_MIME_TYPES); - - private static String joinNewline(String... args) { - return TextUtils.join("\n", args); - } - - private String[] mDefaultProjection; - - private final ArrayMap mObservers = new ArrayMap<>(); - - private Handler mHandler; - - protected abstract File getFileForDocId(String docId, boolean visible) - throws FileNotFoundException; - - protected abstract String getDocIdForFile(File file) throws FileNotFoundException; - - protected abstract Uri buildNotificationUri(String docId); - - /** - * Callback indicating that the given document has been modified. This gives the provider a hook - * to invalidate cached data, such as {@code sdcardfs}. - */ - protected void onDocIdChanged(String docId) { - // Default is no-op - } - - /** - * Callback indicating that the given document has been deleted or moved. This gives the - * provider a hook to revoke the uri permissions. - */ - protected void onDocIdDeleted(String docId) { - // Default is no-op - } - - @Override - public boolean onCreate() { - throw new UnsupportedOperationException( - "Subclass should override this and call onCreate(defaultDocumentProjection)"); - } - - protected void onCreate(String[] defaultProjection) { - mHandler = new Handler(); - mDefaultProjection = defaultProjection; - } - - private static boolean contains(String dirPath, String filePath) { - if (dirPath.equals(filePath)) { - return true; - } - if (!dirPath.endsWith("/")) { - dirPath += "/"; - } - return filePath.startsWith(dirPath); - } - - private static boolean contains(File dir, File file) { - if (dir == null || file == null) return false; - return contains(dir.getAbsolutePath(), file.getAbsolutePath()); - } - - @Override - public boolean isChildDocument(String parentDocId, String docId) { - try { - final File parent = getFileForDocId(parentDocId).getCanonicalFile(); - final File doc = getFileForDocId(docId).getCanonicalFile(); - return contains(parent, doc); - } catch (IOException e) { - throw new IllegalArgumentException( - "Failed to determine if " + docId + " is child of " + parentDocId + ": " + e); - } - } - - protected final List findDocumentPath(File parent, File doc) - throws FileNotFoundException { - - if (!doc.exists()) { - throw new FileNotFoundException(doc + " is not found."); - } - - if (!contains(parent, doc)) { - throw new FileNotFoundException(doc + " is not found under " + parent); - } - - LinkedList path = new LinkedList<>(); - while (doc != null && contains(parent, doc)) { - path.addFirst(getDocIdForFile(doc)); - - doc = doc.getParentFile(); - } - - return path; - } - - private static boolean isValidFatFilenameChar(char c) { - if ((0x00 <= c && c <= 0x1f)) { - return false; - } - switch (c) { - case '"': - case '*': - case '/': - case ':': - case '<': - case '>': - case '?': - case '\\': - case '|': - case 0x7F: - return false; - default: - return true; - } - } - - private static String buildValidFatFilename(String name) { - if (TextUtils.isEmpty(name) || ".".equals(name) || "..".equals(name)) { - return "(invalid)"; - } - final StringBuilder res = new StringBuilder(name.length()); - for (int i = 0; i < name.length(); i++) { - final char c = name.charAt(i); - if (isValidFatFilenameChar(c)) { - res.append(c); - } else { - res.append('_'); - } - } - // Even though vfat allows 255 UCS-2 chars, we might eventually write to - // ext4 through a FUSE layer, so use that limit. - trimFilename(res, 255); - return res.toString(); - } - - private static String trimFilename(String str, int maxBytes) { - final StringBuilder res = new StringBuilder(str); - trimFilename(res, maxBytes); - return res.toString(); - } - - private static void trimFilename(StringBuilder res, int maxBytes) { - byte[] raw = res.toString().getBytes(StandardCharsets.UTF_8); - if (raw.length > maxBytes) { - maxBytes -= 3; - while (raw.length > maxBytes) { - res.deleteCharAt(res.length() / 2); - raw = res.toString().getBytes(StandardCharsets.UTF_8); - } - res.insert(res.length() / 2, "..."); - } - } - - private static File buildFile(File parent, String name, String ext) { - if (TextUtils.isEmpty(ext)) { - return new File(parent, name); - } else { - return new File(parent, name + "." + ext); - } - } - - private static File buildUniqueFileWithExtension(File parent, String name, String ext) - throws FileNotFoundException { - File file = buildFile(parent, name, ext); - // If conflicting file, try adding counter suffix - int n = 0; - while (file.exists()) { - if (n++ >= 32) { - throw new FileNotFoundException("Failed to create unique file"); - } - file = buildFile(parent, name + " (" + n + ")", ext); - } - return file; - } - - private static String[] splitFileName(String mimeType, String displayName) { - String name; - String ext; - if (Document.MIME_TYPE_DIR.equals(mimeType)) { - name = displayName; - ext = null; - } else { - String mimeTypeFromExt; - // Extract requested extension from display name - final int lastDot = displayName.lastIndexOf('.'); - if (lastDot >= 0) { - name = displayName.substring(0, lastDot); - ext = displayName.substring(lastDot + 1); - mimeTypeFromExt = MimeTypeMap.getSingleton().getMimeTypeFromExtension( - ext.toLowerCase()); - } else { - name = displayName; - ext = null; - mimeTypeFromExt = null; - } - if (mimeTypeFromExt == null) { - mimeTypeFromExt = "application/octet-stream"; - } - final String extFromMimeType; - if ("application/octet-stream".equals(mimeType)) { - extFromMimeType = null; - } else { - extFromMimeType = MimeTypeMap.getSingleton().getExtensionFromMimeType(mimeType); - } - if (Objects.equals(mimeType, mimeTypeFromExt) || Objects.equals(ext, extFromMimeType)) { - // Extension maps back to requested MIME type; allow it - } else { - // No match; insist that create file matches requested MIME - name = displayName; - ext = extFromMimeType; - } - } - if (ext == null) { - ext = ""; - } - return new String[]{name, ext}; - } - - private static File buildUniqueFile(File parent, String mimeType, String displayName) - throws FileNotFoundException { - final String[] parts = splitFileName(mimeType, displayName); - return buildUniqueFileWithExtension(parent, parts[0], parts[1]); - } - - @Override - public String createDocument(String docId, String mimeType, String displayName) - throws FileNotFoundException { - displayName = buildValidFatFilename(displayName); - - final File parent = getFileForDocId(docId); - if (!parent.isDirectory()) { - throw new IllegalArgumentException("Parent document isn't a directory"); - } - - final File file = buildUniqueFile(parent, mimeType, displayName); - final String childId; - if (Document.MIME_TYPE_DIR.equals(mimeType)) { - if (!file.mkdir()) { - throw new IllegalStateException("Failed to mkdir " + file); - } - childId = getDocIdForFile(file); - onDocIdChanged(childId); - } else { - try { - if (!file.createNewFile()) { - throw new IllegalStateException("Failed to touch " + file); - } - childId = getDocIdForFile(file); - onDocIdChanged(childId); - } catch (IOException e) { - throw new IllegalStateException("Failed to touch " + file + ": " + e); - } - } - updateMediaStore(getContext(), file); - return childId; - } - - private static File buildUniqueFile(File parent, String displayName) - throws FileNotFoundException { - final String name; - final String ext; - // Extract requested extension from display name - final int lastDot = displayName.lastIndexOf('.'); - if (lastDot >= 0) { - name = displayName.substring(0, lastDot); - ext = displayName.substring(lastDot + 1); - } else { - name = displayName; - ext = null; - } - return buildUniqueFileWithExtension(parent, name, ext); - } - - @Override - public String renameDocument(String docId, String displayName) throws FileNotFoundException { - // Since this provider treats renames as generating a completely new - // docId, we're okay with letting the MIME type change. - displayName = buildValidFatFilename(displayName); - - final File before = getFileForDocId(docId); - final File beforeVisibleFile = getFileForDocId(docId, true); - final File after = buildUniqueFile(before.getParentFile(), displayName); - if (!before.renameTo(after)) { - throw new IllegalStateException("Failed to rename to " + after); - } - - final String afterDocId = getDocIdForFile(after); - onDocIdChanged(docId); - onDocIdDeleted(docId); - onDocIdChanged(afterDocId); - - final File afterVisibleFile = getFileForDocId(afterDocId, true); - - updateMediaStore(getContext(), beforeVisibleFile); - updateMediaStore(getContext(), afterVisibleFile); - - if (!TextUtils.equals(docId, afterDocId)) { - return afterDocId; - } else { - return null; - } - } - - @Override - public String moveDocument(String sourceDocumentId, String sourceParentDocumentId, - String targetParentDocumentId) - throws FileNotFoundException { - final File before = getFileForDocId(sourceDocumentId); - final File after = new File(getFileForDocId(targetParentDocumentId), before.getName()); - final File visibleFileBefore = getFileForDocId(sourceDocumentId, true); - - if (after.exists()) { - throw new IllegalStateException("Already exists " + after); - } - if (!before.renameTo(after)) { - throw new IllegalStateException("Failed to move to " + after); - } - - final String docId = getDocIdForFile(after); - onDocIdChanged(sourceDocumentId); - onDocIdDeleted(sourceDocumentId); - onDocIdChanged(docId); - // update the database - updateMediaStore(getContext(), visibleFileBefore); - updateMediaStore(getContext(), getFileForDocId(docId, true)); - return docId; - } - - private static void updateMediaStore(@NotNull Context context, File file) { - if (file != null) { - final ContentResolver resolver = context.getContentResolver(); - final String noMedia = ".nomedia"; - // For file, check whether the file name is .nomedia or not. - // If yes, scan the parent directory to update all files in the directory. - if (!file.isDirectory() && file.getName().toLowerCase(Locale.ROOT).endsWith(noMedia)) { - MediaScannerConnection.scanFile(context, new String[]{file.getParent()}, null, - null); - } else { - MediaScannerConnection.scanFile(context, new String[]{file.getParent()}, null, - null); - } - } - } - - private static boolean deleteContents(File dir) { - File[] files = dir.listFiles(); - boolean success = true; - if (files != null) { - for (File file : files) { - if (file.isDirectory()) { - success &= deleteContents(file); - } - if (!file.delete()) { - Log.w(TAG, "Failed to delete " + file); - success = false; - } - } - } - return success; - } - - @Override - public void deleteDocument(String docId) throws FileNotFoundException { - final File file = getFileForDocId(docId); - final File visibleFile = getFileForDocId(docId, true); - - final boolean isDirectory = file.isDirectory(); - if (isDirectory) { - deleteContents(file); - } - // We could be deleting pending media which doesn't have any content yet, so only throw - // if the file exists and we fail to delete it. - if (file.exists() && !file.delete()) { - throw new IllegalStateException("Failed to delete " + file); - } - - onDocIdChanged(docId); - onDocIdDeleted(docId); - updateMediaStore(getContext(), visibleFile); - } - - @Override - public Cursor queryDocument(String documentId, String[] projection) - throws FileNotFoundException { - final MatrixCursor result = new MatrixCursor(resolveProjection(projection)); - includeFile(result, documentId, null); - return result; - } - - /** - * This method is similar to - * {@link DocumentsProvider#queryChildDocuments(String, String[], String)}. This method returns - * all children documents including hidden directories/files. - * - *

- * In a scoped storage world, access to "Android/data" style directories are hidden for privacy - * reasons. This method may show privacy sensitive data, so its usage should only be in - * restricted modes. - * - * @param parentDocumentId the directory to return children for. - * @param projection list of {@link Document} columns to put into the cursor. If - * {@code null} all supported columns should be included. - * @param sortOrder how to order the rows, formatted as an SQL {@code ORDER BY} clause - * (excluding the ORDER BY itself). Passing {@code null} will use the - * default sort order, which may be unordered. This ordering is a hint - * that can be used to prioritize how data is fetched from the network, - * but UI may always enforce a specific ordering - * @throws FileNotFoundException when parent document doesn't exist or query fails - */ - protected Cursor queryChildDocumentsShowAll( - String parentDocumentId, String[] projection, String sortOrder) - throws FileNotFoundException { - return queryChildDocuments(parentDocumentId, projection, sortOrder, File -> true); - } - - @Override - public Cursor queryChildDocuments( - String parentDocumentId, String[] projection, String sortOrder) - throws FileNotFoundException { - // Access to some directories is hidden for privacy reasons. - return queryChildDocuments(parentDocumentId, projection, sortOrder, this::shouldShow); - } - - private static @NotNull File[] listFilesOrEmpty(@Nullable File dir) { - if (dir == null) { - return new File[]{}; - } else { - File[] files = dir.listFiles(); - if (files == null) { - return new File[]{}; - } else { - return files; - } - } - } - - private Cursor queryChildDocuments( - String parentDocumentId, String[] projection, String sortOrder, - @NotNull Predicate filter) throws FileNotFoundException { - final File parent = getFileForDocId(parentDocumentId); - final MatrixCursor result = new DirectoryCursor( - resolveProjection(projection), parentDocumentId, parent); - - if (!filter.test(parent)) { - Log.w(TAG, "No permission to access parentDocumentId: " + parentDocumentId); - return result; - } - - if (parent.isDirectory()) { - for (File file : listFilesOrEmpty(parent)) { - if (filter.test(file)) { - includeFile(result, null, file); - } - } - } else { - Log.w(TAG, "parentDocumentId '" + parentDocumentId + "' is not Directory"); - } - return result; - } - - private static String[] getHandledQueryArguments(Bundle queryArgs) { - if (queryArgs == null) { - return new String[0]; - } - final ArrayList args = new ArrayList<>(); - if (queryArgs.keySet().contains(QUERY_ARG_EXCLUDE_MEDIA)) { - args.add(QUERY_ARG_EXCLUDE_MEDIA); - } - if (queryArgs.keySet().contains(QUERY_ARG_DISPLAY_NAME)) { - args.add(QUERY_ARG_DISPLAY_NAME); - } - if (queryArgs.keySet().contains(QUERY_ARG_FILE_SIZE_OVER)) { - args.add(QUERY_ARG_FILE_SIZE_OVER); - } - if (queryArgs.keySet().contains(QUERY_ARG_LAST_MODIFIED_AFTER)) { - args.add(QUERY_ARG_LAST_MODIFIED_AFTER); - } - if (queryArgs.keySet().contains(QUERY_ARG_MIME_TYPES)) { - args.add(QUERY_ARG_MIME_TYPES); - } - return args.toArray(new String[0]); - } - - /** - * Searches documents under the given folder. - *

- * To avoid runtime explosion only returns the at most 23 items. - * - * @param folder the root folder where recursive search begins - * @param projection projection of the returned cursor - * @param exclusion absolute file paths to exclude from result - * @param queryArgs the query arguments for search - * @return cursor containing search result. Include {@link ContentResolver#EXTRA_HONORED_ARGS} - * in {@link Cursor} extras {@link Bundle} when any QUERY_ARG_* value was honored during the - * preparation of the results. - * @throws FileNotFoundException when root folder doesn't exist or search fails - * @see ContentResolver#EXTRA_HONORED_ARGS - */ - protected final Cursor querySearchDocuments( - File folder, String[] projection, Set exclusion, Bundle queryArgs) - throws FileNotFoundException { - final MatrixCursor result = new MatrixCursor(resolveProjection(projection)); - final LinkedList pending = new LinkedList<>(); - pending.add(folder); - while (!pending.isEmpty() && result.getCount() < 24) { - final File file = pending.removeFirst(); - if (shouldHide(file)) continue; - - if (file.isDirectory()) { - for (File child : listFilesOrEmpty(file)) { - pending.add(child); - } - } - if (!exclusion.contains(file.getAbsolutePath()) && matchSearchQueryArguments(file, - queryArgs)) { - includeFile(result, null, file); - } - } - - final String[] handledQueryArgs = getHandledQueryArguments(queryArgs); - if (handledQueryArgs.length > 0) { - final Bundle extras = new Bundle(); - extras.putStringArray(ContentResolver.EXTRA_HONORED_ARGS, handledQueryArgs); - result.setExtras(extras); - } - return result; - } - - @Override - public String getDocumentType(String documentId) throws FileNotFoundException { - return getDocumentType(documentId, getFileForDocId(documentId)); - } - - private String getDocumentType(final String documentId, final File file) - throws FileNotFoundException { - if (file.isDirectory()) { - return Document.MIME_TYPE_DIR; - } else { - final int lastDot = documentId.lastIndexOf('.'); - if (lastDot >= 0) { - final String extension = documentId.substring(lastDot + 1).toLowerCase(); - final String mime = MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension); - if (mime != null) { - return mime; - } - } - return "application/octet-stream"; - } - } - - @Override - public ParcelFileDescriptor openDocument( - String documentId, String mode, CancellationSignal signal) - throws FileNotFoundException { - final File file = getFileForDocId(documentId); - final File visibleFile = getFileForDocId(documentId, true); - - final int pfdMode = ParcelFileDescriptor.parseMode(mode); - if (visibleFile == null || pfdMode == ParcelFileDescriptor.MODE_READ_ONLY) { - return ParcelFileDescriptor.open(file, pfdMode); - } else { - try { - // When finished writing, kick off media scanner - return ParcelFileDescriptor.open( - file, pfdMode, mHandler, (IOException e) -> { - onDocIdChanged(documentId); - scanFile(visibleFile); - }); - } catch (IOException e) { - throw new FileNotFoundException("Failed to open for writing: " + e); - } - } - } - - public static boolean matchSearchQueryArguments(Bundle queryArgs, String displayName, - String mimeType, long lastModified, long size) { - if (queryArgs == null) { - return true; - } - final String argDisplayName = queryArgs.getString(QUERY_ARG_DISPLAY_NAME, ""); - if (!argDisplayName.isEmpty()) { - // TODO (118795812) : Enhance the search string handled in DocumentsProvider - if (!displayName.toLowerCase().contains(argDisplayName.toLowerCase())) { - return false; - } - } - final long argFileSize = queryArgs.getLong(QUERY_ARG_FILE_SIZE_OVER, -1 /* defaultValue */); - if (argFileSize != -1 && size < argFileSize) { - return false; - } - final long argLastModified = queryArgs.getLong(QUERY_ARG_LAST_MODIFIED_AFTER, - -1 /* defaultValue */); - if (argLastModified != -1 && lastModified < argLastModified) { - return false; - } - final String[] argMimeTypes = queryArgs.getStringArray(QUERY_ARG_MIME_TYPES); - if (argMimeTypes != null && argMimeTypes.length > 0) { - mimeType = Intent.normalizeMimeType(mimeType); - for (String type : argMimeTypes) { - if (MimeTypeFilter.matches(mimeType, Intent.normalizeMimeType(type))) { - return true; - } - } - return false; - } - return true; - } - - /** - * Test if the file matches the query arguments. - * - * @param file the file to test - * @param queryArgs the query arguments - */ - private boolean matchSearchQueryArguments(File file, Bundle queryArgs) { - if (file == null) { - return false; - } - - final String fileMimeType; - final String fileName = file.getName(); - - if (file.isDirectory()) { - fileMimeType = DocumentsContract.Document.MIME_TYPE_DIR; - } else { - int dotPos = fileName.lastIndexOf('.'); - if (dotPos < 0) { - return false; - } - final String extension = fileName.substring(dotPos + 1); - fileMimeType = MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension); - } - return matchSearchQueryArguments(queryArgs, fileName, fileMimeType, - file.lastModified(), file.length()); - } - - private void scanFile(File visibleFile) { - final Intent intent = new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE); - intent.setData(Uri.fromFile(visibleFile)); - getContext().sendBroadcast(intent); - } - - private static AssetFileDescriptor openImageThumbnail(File file) throws FileNotFoundException { - final ParcelFileDescriptor pfd = ParcelFileDescriptor.open( - file, ParcelFileDescriptor.MODE_READ_ONLY); - try { - final ExifInterface exif = new ExifInterface(file.getAbsolutePath()); - final long[] thumb = exif.getThumbnailRange(); - if (thumb != null) { - // If we use thumb to decode, we need to handle the rotation by ourselves. - Bundle extras = null; - switch (exif.getAttributeInt(ExifInterface.TAG_ORIENTATION, -1)) { - case ExifInterface.ORIENTATION_ROTATE_90: - extras = new Bundle(1); - extras.putInt(EXTRA_ORIENTATION, 90); - break; - case ExifInterface.ORIENTATION_ROTATE_180: - extras = new Bundle(1); - extras.putInt(EXTRA_ORIENTATION, 180); - break; - case ExifInterface.ORIENTATION_ROTATE_270: - extras = new Bundle(1); - extras.putInt(EXTRA_ORIENTATION, 270); - break; - } - return new AssetFileDescriptor(pfd, thumb[0], thumb[1], extras); - } - } catch (IOException ignored) { - } - // Do full file decoding, we don't need to handle the orientation - return new AssetFileDescriptor(pfd, 0, AssetFileDescriptor.UNKNOWN_LENGTH, null); - } - - @Override - public AssetFileDescriptor openDocumentThumbnail( - String documentId, Point sizeHint, CancellationSignal signal) - throws FileNotFoundException { - final File file = getFileForDocId(documentId); - return openImageThumbnail(file); - } - - protected RowBuilder includeFile(final MatrixCursor result, String docId, File file) - throws FileNotFoundException { - final String[] columns = result.getColumnNames(); - final RowBuilder row = result.newRow(); - - if (docId == null) { - docId = getDocIdForFile(file); - } else { - file = getFileForDocId(docId); - } - - final String mimeType = getDocumentType(docId, file); - row.add(Document.COLUMN_DOCUMENT_ID, docId); - row.add(Document.COLUMN_MIME_TYPE, mimeType); - - final int flagIndex = Arrays.asList(columns).indexOf(Document.COLUMN_FLAGS); - if (flagIndex != -1) { - int flags = 0; - if (file.canWrite()) { - if (mimeType.equals(Document.MIME_TYPE_DIR)) { - flags |= Document.FLAG_DIR_SUPPORTS_CREATE; - flags |= Document.FLAG_SUPPORTS_DELETE; - flags |= Document.FLAG_SUPPORTS_RENAME; - flags |= Document.FLAG_SUPPORTS_MOVE; - } else { - flags |= Document.FLAG_SUPPORTS_WRITE; - flags |= Document.FLAG_SUPPORTS_DELETE; - flags |= Document.FLAG_SUPPORTS_RENAME; - flags |= Document.FLAG_SUPPORTS_MOVE; - } - } - - if (mimeType.startsWith("image/")) { - flags |= Document.FLAG_SUPPORTS_THUMBNAIL; - } - - if (typeSupportsMetadata(mimeType)) { - flags |= Document.FLAG_SUPPORTS_METADATA; - } - row.add(Document.COLUMN_FLAGS, flags); - } - - final int displayNameIndex = Arrays.asList(columns).indexOf(Document.COLUMN_DISPLAY_NAME); - if (displayNameIndex != -1) { - row.add(Document.COLUMN_DISPLAY_NAME, file.getName()); - } - - final int lastModifiedIndex = Arrays.asList(columns).indexOf(Document.COLUMN_LAST_MODIFIED); - if (lastModifiedIndex != -1) { - final long lastModified = file.lastModified(); - // Only publish dates reasonably after epoch - if (lastModified > 31536000000L) { - row.add(Document.COLUMN_LAST_MODIFIED, lastModified); - } - } - final int sizeIndex = Arrays.asList(columns).indexOf(Document.COLUMN_SIZE); - if (sizeIndex != -1) { - row.add(Document.COLUMN_SIZE, file.length()); - } - - // Return the row builder just in case any subclass want to add more stuff to it. - return row; - } - - protected boolean shouldHide(@NotNull File file) { - return false; - } - - private boolean shouldShow(@NotNull File file) { - return !shouldHide(file); - } - - protected boolean typeSupportsMetadata(String mimeType) { - return Document.MIME_TYPE_DIR.equals(mimeType); - } - - protected final File getFileForDocId(String docId) throws FileNotFoundException { - return getFileForDocId(docId, false); - } - - private String[] resolveProjection(String[] projection) { - return projection == null ? mDefaultProjection : projection; - } - - private void startObserving(File file, Uri notifyUri, DirectoryCursor cursor) { - synchronized (mObservers) { - DirectoryObserver observer = mObservers.get(file); - if (observer == null) { - observer = - new DirectoryObserver(file, getContext().getContentResolver(), notifyUri); - observer.startWatching(); - mObservers.put(file, observer); - } - observer.mCursors.add(cursor); - - if (LOG_INOTIFY) Log.d(TAG, "after start: " + observer); - } - } - - private void stopObserving(File file, DirectoryCursor cursor) { - synchronized (mObservers) { - DirectoryObserver observer = mObservers.get(file); - if (observer == null) return; - - observer.mCursors.remove(cursor); - if (observer.mCursors.size() == 0) { - mObservers.remove(file); - observer.stopWatching(); - } - - if (LOG_INOTIFY) Log.d(TAG, "after stop: " + observer); - } - } - - private static class DirectoryObserver extends FileObserver { - private static final int NOTIFY_EVENTS = ATTRIB | CLOSE_WRITE | MOVED_FROM | MOVED_TO - | CREATE | DELETE | DELETE_SELF | MOVE_SELF; - - private final File mFile; - private final ContentResolver mResolver; - private final Uri mNotifyUri; - private final CopyOnWriteArrayList mCursors; - - DirectoryObserver(File file, ContentResolver resolver, Uri notifyUri) { - super(file.getAbsolutePath(), NOTIFY_EVENTS); - mFile = file; - mResolver = resolver; - mNotifyUri = notifyUri; - mCursors = new CopyOnWriteArrayList<>(); - } - - @Override - public void onEvent(int event, String path) { - if ((event & NOTIFY_EVENTS) != 0) { - if (LOG_INOTIFY) Log.d(TAG, "onEvent() " + event + " at " + path); - for (DirectoryCursor cursor : mCursors) { - cursor.notifyChanged(); - } - mResolver.notifyChange(mNotifyUri, null, false); - } - } - - @Override - public String toString() { - String filePath = mFile.getAbsolutePath(); - return "DirectoryObserver{file=" + filePath + ", ref=" + mCursors.size() + "}"; - } - } - - private class DirectoryCursor extends MatrixCursor { - private final File mFile; - - public DirectoryCursor(String[] columnNames, String docId, File file) { - super(columnNames); - - final Uri notifyUri = buildNotificationUri(docId); - boolean registerSelfObserver = false; // Our FileObserver sees all relevant changes. - setNotificationUris(getContext().getContentResolver(), Arrays.asList(notifyUri)); - - mFile = file; - startObserving(mFile, notifyUri, this); - } - - public void notifyChanged() { - onChange(false); - } - - @Override - public void close() { - super.close(); - stopObserving(mFile, this); - } - } -} diff --git a/desktop_version/VVVVVV-android/app/src/main/java/com/distractionware/vvvvvv/VVVVVV.java b/desktop_version/VVVVVV-android/app/src/main/java/com/distractionware/vvvvvv/VVVVVV.java deleted file mode 100644 index 6464389c..00000000 --- a/desktop_version/VVVVVV-android/app/src/main/java/com/distractionware/vvvvvv/VVVVVV.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.distractionware.vvvvvv; - -import org.libsdl.app.SDLActivity; - -public class VVVVVV extends SDLActivity { - @Override - protected String[] getLibraries() { - return new String[] { - "SDL2", - "VVVVVV" - }; - } - - @Override - protected String[] getArguments() { - // always pass -debug, logcat has level filtering anyway - return new String[] { - "-debug" - }; - } -} diff --git a/desktop_version/VVVVVV-android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/desktop_version/VVVVVV-android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml deleted file mode 100644 index 036d09bc..00000000 --- a/desktop_version/VVVVVV-android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/desktop_version/VVVVVV-android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/desktop_version/VVVVVV-android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml deleted file mode 100644 index 036d09bc..00000000 --- a/desktop_version/VVVVVV-android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/desktop_version/VVVVVV-android/app/src/main/res/mipmap-hdpi/ic_launcher.webp b/desktop_version/VVVVVV-android/app/src/main/res/mipmap-hdpi/ic_launcher.webp deleted file mode 100644 index e782b26e..00000000 Binary files a/desktop_version/VVVVVV-android/app/src/main/res/mipmap-hdpi/ic_launcher.webp and /dev/null differ diff --git a/desktop_version/VVVVVV-android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.webp b/desktop_version/VVVVVV-android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.webp deleted file mode 100644 index e87ebe65..00000000 Binary files a/desktop_version/VVVVVV-android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.webp and /dev/null differ diff --git a/desktop_version/VVVVVV-android/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp b/desktop_version/VVVVVV-android/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp deleted file mode 100644 index 8bfde690..00000000 Binary files a/desktop_version/VVVVVV-android/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp and /dev/null differ diff --git a/desktop_version/VVVVVV-android/app/src/main/res/mipmap-mdpi/ic_launcher.webp b/desktop_version/VVVVVV-android/app/src/main/res/mipmap-mdpi/ic_launcher.webp deleted file mode 100644 index eac960b2..00000000 Binary files a/desktop_version/VVVVVV-android/app/src/main/res/mipmap-mdpi/ic_launcher.webp and /dev/null differ diff --git a/desktop_version/VVVVVV-android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.webp b/desktop_version/VVVVVV-android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.webp deleted file mode 100644 index a4fef7f5..00000000 Binary files a/desktop_version/VVVVVV-android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.webp and /dev/null differ diff --git a/desktop_version/VVVVVV-android/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp b/desktop_version/VVVVVV-android/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp deleted file mode 100644 index 5bc0287b..00000000 Binary files a/desktop_version/VVVVVV-android/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp and /dev/null differ diff --git a/desktop_version/VVVVVV-android/app/src/main/res/mipmap-xhdpi/ic_launcher.webp b/desktop_version/VVVVVV-android/app/src/main/res/mipmap-xhdpi/ic_launcher.webp deleted file mode 100644 index d92e74a9..00000000 Binary files a/desktop_version/VVVVVV-android/app/src/main/res/mipmap-xhdpi/ic_launcher.webp and /dev/null differ diff --git a/desktop_version/VVVVVV-android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.webp b/desktop_version/VVVVVV-android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.webp deleted file mode 100644 index 4ddc5da0..00000000 Binary files a/desktop_version/VVVVVV-android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.webp and /dev/null differ diff --git a/desktop_version/VVVVVV-android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp b/desktop_version/VVVVVV-android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp deleted file mode 100644 index a1dfe0c0..00000000 Binary files a/desktop_version/VVVVVV-android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp and /dev/null differ diff --git a/desktop_version/VVVVVV-android/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp b/desktop_version/VVVVVV-android/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp deleted file mode 100644 index d185206c..00000000 Binary files a/desktop_version/VVVVVV-android/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp and /dev/null differ diff --git a/desktop_version/VVVVVV-android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.webp b/desktop_version/VVVVVV-android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.webp deleted file mode 100644 index 38d1d046..00000000 Binary files a/desktop_version/VVVVVV-android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.webp and /dev/null differ diff --git a/desktop_version/VVVVVV-android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp b/desktop_version/VVVVVV-android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp deleted file mode 100644 index bf9aa517..00000000 Binary files a/desktop_version/VVVVVV-android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp and /dev/null differ diff --git a/desktop_version/VVVVVV-android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp b/desktop_version/VVVVVV-android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp deleted file mode 100644 index d73d4b23..00000000 Binary files a/desktop_version/VVVVVV-android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp and /dev/null differ diff --git a/desktop_version/VVVVVV-android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.webp b/desktop_version/VVVVVV-android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.webp deleted file mode 100644 index 7444f82b..00000000 Binary files a/desktop_version/VVVVVV-android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.webp and /dev/null differ diff --git a/desktop_version/VVVVVV-android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp b/desktop_version/VVVVVV-android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp deleted file mode 100644 index 21d9abdf..00000000 Binary files a/desktop_version/VVVVVV-android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp and /dev/null differ diff --git a/desktop_version/VVVVVV-android/app/src/main/res/values/colors.xml b/desktop_version/VVVVVV-android/app/src/main/res/values/colors.xml deleted file mode 100644 index 3ab3e9cb..00000000 --- a/desktop_version/VVVVVV-android/app/src/main/res/values/colors.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - #3F51B5 - #303F9F - #FF4081 - diff --git a/desktop_version/VVVVVV-android/app/src/main/res/values/ic_launcher_background.xml b/desktop_version/VVVVVV-android/app/src/main/res/values/ic_launcher_background.xml deleted file mode 100644 index beab31f7..00000000 --- a/desktop_version/VVVVVV-android/app/src/main/res/values/ic_launcher_background.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - #000000 - \ No newline at end of file diff --git a/desktop_version/VVVVVV-android/app/src/main/res/values/strings.xml b/desktop_version/VVVVVV-android/app/src/main/res/values/strings.xml deleted file mode 100644 index 5a8b0831..00000000 --- a/desktop_version/VVVVVV-android/app/src/main/res/values/strings.xml +++ /dev/null @@ -1,3 +0,0 @@ - - VVVVVV - diff --git a/desktop_version/VVVVVV-android/app/src/main/res/values/styles.xml b/desktop_version/VVVVVV-android/app/src/main/res/values/styles.xml deleted file mode 100644 index ff6c9d2c..00000000 --- a/desktop_version/VVVVVV-android/app/src/main/res/values/styles.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - diff --git a/desktop_version/VVVVVV-android/build.gradle b/desktop_version/VVVVVV-android/build.gradle deleted file mode 100644 index d187bb2f..00000000 --- a/desktop_version/VVVVVV-android/build.gradle +++ /dev/null @@ -1,26 +0,0 @@ -// Top-level build file where you can add configuration options common to all sub-projects/modules. - -buildscript { - repositories { - mavenCentral() - google() - } - dependencies { - classpath 'com.android.tools.build:gradle:8.1.1' - - // NOTE: Do not place your application dependencies here; they belong - // in the individual module build.gradle files - } -} - -allprojects { - repositories { - mavenCentral() - google() - mavenLocal() - } -} - -task clean(type: Delete) { - delete rootProject.buildDir -} diff --git a/desktop_version/VVVVVV-android/gradle.properties b/desktop_version/VVVVVV-android/gradle.properties deleted file mode 100644 index e903b6a4..00000000 --- a/desktop_version/VVVVVV-android/gradle.properties +++ /dev/null @@ -1,20 +0,0 @@ -# Project-wide Gradle settings. - -# IDE (e.g. Android Studio) users: -# Gradle settings configured through the IDE *will override* -# any settings specified in this file. - -# For more details on how to configure your build environment visit -# http://www.gradle.org/docs/current/userguide/build_environment.html - -# Specifies the JVM arguments used for the daemon process. -# The setting is particularly useful for tweaking memory settings. -org.gradle.jvmargs=-Xmx1536m -XX:-UseContainerSupport - -# When configured, Gradle will run in incubating parallel mode. -# This option should only be used with decoupled projects. More details, visit -# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects -# org.gradle.parallel=true - -android.useAndroidX=true -android.enableJetifier=true \ No newline at end of file diff --git a/desktop_version/VVVVVV-android/gradle/wrapper/gradle-wrapper.jar b/desktop_version/VVVVVV-android/gradle/wrapper/gradle-wrapper.jar deleted file mode 100644 index 2b338a93..00000000 Binary files a/desktop_version/VVVVVV-android/gradle/wrapper/gradle-wrapper.jar and /dev/null differ diff --git a/desktop_version/VVVVVV-android/gradle/wrapper/gradle-wrapper.properties b/desktop_version/VVVVVV-android/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index 7c1bb846..00000000 --- a/desktop_version/VVVVVV-android/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,6 +0,0 @@ -#Thu Nov 11 18:20:34 PST 2021 -distributionBase=GRADLE_USER_HOME -distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-rc-2-bin.zip -distributionPath=wrapper/dists -zipStorePath=wrapper/dists -zipStoreBase=GRADLE_USER_HOME diff --git a/desktop_version/VVVVVV-android/gradlew b/desktop_version/VVVVVV-android/gradlew deleted file mode 100755 index 3427607f..00000000 --- a/desktop_version/VVVVVV-android/gradlew +++ /dev/null @@ -1,160 +0,0 @@ -#!/usr/bin/env bash - -############################################################################## -## -## Gradle start up script for UN*X -## -############################################################################## - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS="" - -APP_NAME="Gradle" -APP_BASE_NAME=`basename "$0"` - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" - -warn ( ) { - echo "$*" -} - -die ( ) { - echo - echo "$*" - echo - exit 1 -} - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; -esac - -# Attempt to set APP_HOME -# Resolve links: $0 may be a link -PRG="$0" -# Need this for relative symlinks. -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi -done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >/dev/null -APP_HOME="`pwd -P`" -cd "$SAVED" >/dev/null - -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar - -# Determine the Java command to use to start the JVM. -if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" - else - JAVACMD="$JAVA_HOME/bin/java" - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD="java" - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi - -# Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ $? -eq 0 ] ; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then - MAX_FD="$MAX_FD_LIMIT" - fi - ulimit -n $MAX_FD - if [ $? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: $MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" - fi -fi - -# For Darwin, add options to specify how the application appears in the dock -if $darwin; then - GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" -fi - -# For Cygwin, switch paths to Windows format before running java -if $cygwin ; then - APP_HOME=`cygpath --path --mixed "$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - JAVACMD=`cygpath --unix "$JAVACMD"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in $ROOTDIRSRAW ; do - ROOTDIRS="$ROOTDIRS$SEP$dir" - SEP="|" - done - OURCYGPATTERN="(^($ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" - fi - # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "$@" ; do - CHECK=`echo "$arg"|grep -E -c "$OURCYGPATTERN" -` - CHECK2=`echo "$arg"|grep -E -c "^-"` ### Determine if an option - - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` - else - eval `echo args$i`="\"$arg\"" - fi - i=$((i+1)) - done - case $i in - (0) set -- ;; - (1) set -- "$args0" ;; - (2) set -- "$args0" "$args1" ;; - (3) set -- "$args0" "$args1" "$args2" ;; - (4) set -- "$args0" "$args1" "$args2" "$args3" ;; - (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; - esac -fi - -# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules -function splitJvmOpts() { - JVM_OPTS=("$@") -} -eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS -JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" - -exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" diff --git a/desktop_version/VVVVVV-android/gradlew.bat b/desktop_version/VVVVVV-android/gradlew.bat deleted file mode 100644 index aec99730..00000000 --- a/desktop_version/VVVVVV-android/gradlew.bat +++ /dev/null @@ -1,90 +0,0 @@ -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS= - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto init - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:init -@rem Get command-line arguments, handling Windowz variants - -if not "%OS%" == "Windows_NT" goto win9xME_args -if "%@eval[2+2]" == "4" goto 4NT_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* -goto execute - -:4NT_args -@rem Get arguments from the 4NT Shell from JP Software -set CMD_LINE_ARGS=%$ - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega diff --git a/desktop_version/VVVVVV-android/settings.gradle b/desktop_version/VVVVVV-android/settings.gradle deleted file mode 100644 index e7b4def4..00000000 --- a/desktop_version/VVVVVV-android/settings.gradle +++ /dev/null @@ -1 +0,0 @@ -include ':app' diff --git a/desktop_version/fixupMac.sh b/desktop_version/fixupMac.sh index d84a10e0..8effd4f3 100755 --- a/desktop_version/fixupMac.sh +++ b/desktop_version/fixupMac.sh @@ -3,5 +3,6 @@ # flibit has this solely for convenience when cleaning up Mac binaries. install_name_tool -change /usr/local/lib/libSDL2-2.0.0.dylib @rpath/libSDL2-2.0.0.dylib VVVVVV +install_name_tool -change /usr/local/lib/libSDL2_mixer-2.0.0.dylib @rpath/libSDL2_mixer-2.0.0.dylib VVVVVV strip -S VVVVVV otool -L VVVVVV diff --git a/desktop_version/fonts/README.txt b/desktop_version/fonts/README.txt deleted file mode 100644 index feacebd2..00000000 --- a/desktop_version/fonts/README.txt +++ /dev/null @@ -1,57 +0,0 @@ -=== I N T R O D U C T I O N === - -This file will explain the font format. - -If you need a font (like a TTF) converted into the format that the game can read, for now you might want to ask Dav, who has tools for it. - - - -=== F O N T F O R M A T === - -Fonts consist of two files: a .png and a .fontmeta. The .png contains all the "images" for all glyphs, and the .fontmeta is an XML document containing all information about which characters are in the file and other metadata. - -For example, a font for Japanese might be called font_ja.png and font_ja.fontmeta. - -The fontmeta file looks like this: - - - - - 日本語 - 12 - 12 - 1 - - - - - - - - - - - - - buttons_12x12 - - - -* type: not specified for normal fonts. buttons is used in button glyph fonts. - -* display_name: the name of the language the font is specifically meant for - in the language itself. Users will see this in the level editor when choosing a font to use. If this font is used equally by multiple translations, this could be set to a combination like "繁體中文/한국어". (If you are creating a custom player level: don't worry about this) - -* width/height: the width and height of each glyph in the font. Every character will always be drawn as a rectangle of this size. VVVVVV is rated to support fonts up to 12 pixels high - anything higher may cause text overlapping or not fitting in place. - -* white_teeth: indicates that all characters in the font are white, so the game itself doesn't have to remove all color from the image and make all pixels white like it would in old versions of the game. If this is not set to 1, this font cannot have colored (button) glyphs, and the game has to specifically process the font every time it is loaded, so 1 is highly recommended. - -* chars: defines which characters are in the image. Starting at the top left of the image, each character is simply a rectangle of equal size (defined in and ) from left to right, top to bottom. In the example given above, the image first has Unicode every character from U+0020 up to and including U+007F, then every character from U+00A0 to U+017F, and so on. To include a single character, simply use a range with equal start and end attributes equal. - -* special: defines special attributes that will be applied to a range of characters. One or more of the following attributes can be used: - - - color: set to 1 if these glyphs should be drawn with its original colors (for button glyphs, or even emoji...) - - - advance: instead of , the cursor (for drawing the next character) should be advanced this amount of pixels to the right. This controls the width of a character, but it does not affect how characters are arranged in the image, and the full glyph will still be drawn. While this means the font system has support for variable-width fonts, it's recommended to not use this option. There are some problems arising from using a variable-width font (especially in text boxes), so please consider copying the font's fullwidth forms (U+FF01-U+FF5E) to ASCII U+0021-U+007E instead. One may argue that a monospaced font also fits more with the game's style. - -* fallback: specifies the button glyphs font to use. Make sure to choose one that fits fully within your [width]x[height] rectangle, so for an 8x12 font, choose buttons_8x8, not buttons_12x12. - diff --git a/desktop_version/fonts/buttons_10x10.fontmeta b/desktop_version/fonts/buttons_10x10.fontmeta deleted file mode 100644 index 7dde371c..00000000 --- a/desktop_version/fonts/buttons_10x10.fontmeta +++ /dev/null @@ -1,13 +0,0 @@ - - - buttons - 10 - 10 - 1 - - - - - - - diff --git a/desktop_version/fonts/buttons_10x10.png b/desktop_version/fonts/buttons_10x10.png deleted file mode 100644 index 4df5284d..00000000 Binary files a/desktop_version/fonts/buttons_10x10.png and /dev/null differ diff --git a/desktop_version/fonts/buttons_12x12.fontmeta b/desktop_version/fonts/buttons_12x12.fontmeta deleted file mode 100644 index ccfe3f0a..00000000 --- a/desktop_version/fonts/buttons_12x12.fontmeta +++ /dev/null @@ -1,13 +0,0 @@ - - - buttons - 12 - 12 - 1 - - - - - - - diff --git a/desktop_version/fonts/buttons_12x12.png b/desktop_version/fonts/buttons_12x12.png deleted file mode 100644 index f2184484..00000000 Binary files a/desktop_version/fonts/buttons_12x12.png and /dev/null differ diff --git a/desktop_version/fonts/buttons_8x8.fontmeta b/desktop_version/fonts/buttons_8x8.fontmeta deleted file mode 100644 index 60e2e566..00000000 --- a/desktop_version/fonts/buttons_8x8.fontmeta +++ /dev/null @@ -1,13 +0,0 @@ - - - buttons - 8 - 8 - 1 - - - - - - - diff --git a/desktop_version/fonts/buttons_8x8.png b/desktop_version/fonts/buttons_8x8.png deleted file mode 100644 index a3750e41..00000000 Binary files a/desktop_version/fonts/buttons_8x8.png and /dev/null differ diff --git a/desktop_version/fonts/font.fontmeta b/desktop_version/fonts/font.fontmeta deleted file mode 100644 index e4117f33..00000000 --- a/desktop_version/fonts/font.fontmeta +++ /dev/null @@ -1,108 +0,0 @@ - - - english/… - 8 - 8 - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - buttons_8x8 - diff --git a/desktop_version/fonts/font.png b/desktop_version/fonts/font.png deleted file mode 100644 index 5650b584..00000000 Binary files a/desktop_version/fonts/font.png and /dev/null differ diff --git a/desktop_version/fonts/font_ar.fontmeta b/desktop_version/fonts/font_ar.fontmeta deleted file mode 100644 index 0f6c09df..00000000 --- a/desktop_version/fonts/font_ar.fontmeta +++ /dev/null @@ -1,20 +0,0 @@ - - - العربية/فارسی - 8 - 10 - 1 - - - - - - - - - - - - - buttons_8x8 - diff --git a/desktop_version/fonts/font_ar.png b/desktop_version/fonts/font_ar.png deleted file mode 100644 index 3e6e8d79..00000000 Binary files a/desktop_version/fonts/font_ar.png and /dev/null differ diff --git a/desktop_version/fonts/font_ja.fontmeta b/desktop_version/fonts/font_ja.fontmeta deleted file mode 100644 index e01cd924..00000000 --- a/desktop_version/fonts/font_ja.fontmeta +++ /dev/null @@ -1,4173 +0,0 @@ - - - 日本語 - 8 - 12 - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - buttons_8x8 - diff --git a/desktop_version/fonts/font_ja.png b/desktop_version/fonts/font_ja.png deleted file mode 100644 index ceadb386..00000000 Binary files a/desktop_version/fonts/font_ja.png and /dev/null differ diff --git a/desktop_version/fonts/font_ko.fontmeta b/desktop_version/fonts/font_ko.fontmeta deleted file mode 100644 index 1ef86f89..00000000 --- a/desktop_version/fonts/font_ko.fontmeta +++ /dev/null @@ -1,4194 +0,0 @@ - - - 한국어 - 10 - 10 - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - buttons_10x10 - diff --git a/desktop_version/fonts/font_ko.png b/desktop_version/fonts/font_ko.png deleted file mode 100644 index 6947a57c..00000000 Binary files a/desktop_version/fonts/font_ko.png and /dev/null differ diff --git a/desktop_version/fonts/font_ko_license.txt b/desktop_version/fonts/font_ko_license.txt deleted file mode 100644 index 58a488d6..00000000 --- a/desktop_version/fonts/font_ko_license.txt +++ /dev/null @@ -1,94 +0,0 @@ -This is a Modified Version. -Original Version: Copyright (c) 2019-2023 Minseo Lee (itoupluk427@gmail.com) - -This Font Software is licensed under the SIL Open Font License, Version 1.1. -This license is copied below, and is also available with a FAQ at: -http://scripts.sil.org/OFL - - ------------------------------------------------------------ -SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 ------------------------------------------------------------ - -PREAMBLE -The goals of the Open Font License (OFL) are to stimulate worldwide -development of collaborative font projects, to support the font creation -efforts of academic and linguistic communities, and to provide a free and -open framework in which fonts may be shared and improved in partnership -with others. - -The OFL allows the licensed fonts to be used, studied, modified and -redistributed freely as long as they are not sold by themselves. The -fonts, including any derivative works, can be bundled, embedded, -redistributed and/or sold with any software provided that any reserved -names are not used by derivative works. The fonts and derivatives, -however, cannot be released under any other type of license. The -requirement for fonts to remain under this license does not apply -to any document created using the fonts or their derivatives. - -DEFINITIONS -"Font Software" refers to the set of files released by the Copyright -Holder(s) under this license and clearly marked as such. This may -include source files, build scripts and documentation. - -"Reserved Font Name" refers to any names specified as such after the -copyright statement(s). - -"Original Version" refers to the collection of Font Software components as -distributed by the Copyright Holder(s). - -"Modified Version" refers to any derivative made by adding to, deleting, -or substituting -- in part or in whole -- any of the components of the -Original Version, by changing formats or by porting the Font Software to a -new environment. - -"Author" refers to any designer, engineer, programmer, technical -writer or other person who contributed to the Font Software. - -PERMISSION & CONDITIONS -Permission is hereby granted, free of charge, to any person obtaining -a copy of the Font Software, to use, study, copy, merge, embed, modify, -redistribute, and sell modified and unmodified copies of the Font -Software, subject to the following conditions: - -1) Neither the Font Software nor any of its individual components, -in Original or Modified Versions, may be sold by itself. - -2) Original or Modified Versions of the Font Software may be bundled, -redistributed and/or sold with any software, provided that each copy -contains the above copyright notice and this license. These can be -included either as stand-alone text files, human-readable headers or -in the appropriate machine-readable metadata fields within text or -binary files as long as those fields can be easily viewed by the user. - -3) No Modified Version of the Font Software may use the Reserved Font -Name(s) unless explicit written permission is granted by the corresponding -Copyright Holder. This restriction only applies to the primary font name as -presented to the users. - -4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font -Software shall not be used to promote, endorse or advertise any -Modified Version, except to acknowledge the contribution(s) of the -Copyright Holder(s) and the Author(s) or with their explicit written -permission. - -5) The Font Software, modified or unmodified, in part or in whole, -must be distributed entirely under this license, and must not be -distributed under any other license. The requirement for fonts to -remain under this license does not apply to any document created -using the Font Software. - -TERMINATION -This license becomes null and void if any of the above conditions are -not met. - -DISCLAIMER -THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT -OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE -COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL -DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM -OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/desktop_version/fonts/font_sc.fontmeta b/desktop_version/fonts/font_sc.fontmeta deleted file mode 100644 index 960a1e81..00000000 --- a/desktop_version/fonts/font_sc.fontmeta +++ /dev/null @@ -1,3306 +0,0 @@ - - - 简体中文 - 12 - 12 - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - buttons_12x12 - diff --git a/desktop_version/fonts/font_sc.png b/desktop_version/fonts/font_sc.png deleted file mode 100644 index f19ef555..00000000 Binary files a/desktop_version/fonts/font_sc.png and /dev/null differ diff --git a/desktop_version/fonts/font_sc_tc_license.txt b/desktop_version/fonts/font_sc_tc_license.txt deleted file mode 100644 index 0b6545ff..00000000 --- a/desktop_version/fonts/font_sc_tc_license.txt +++ /dev/null @@ -1,426 +0,0 @@ -This is a Modified Version. -Original Version: Copyright (c) 2022, TakWolf (https://takwolf.com), -with Reserved Font Name 'Fusion Pixel'. - -This Font Software is licensed under the SIL Open Font License, Version 1.1. -This license is copied below, and is also available with a FAQ at: -http://scripts.sil.org/OFL - - ------------------------------------------------------------ -SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 ------------------------------------------------------------ - -PREAMBLE -The goals of the Open Font License (OFL) are to stimulate worldwide -development of collaborative font projects, to support the font creation -efforts of academic and linguistic communities, and to provide a free and -open framework in which fonts may be shared and improved in partnership -with others. - -The OFL allows the licensed fonts to be used, studied, modified and -redistributed freely as long as they are not sold by themselves. The -fonts, including any derivative works, can be bundled, embedded, -redistributed and/or sold with any software provided that any reserved -names are not used by derivative works. The fonts and derivatives, -however, cannot be released under any other type of license. The -requirement for fonts to remain under this license does not apply -to any document created using the fonts or their derivatives. - -DEFINITIONS -"Font Software" refers to the set of files released by the Copyright -Holder(s) under this license and clearly marked as such. This may -include source files, build scripts and documentation. - -"Reserved Font Name" refers to any names specified as such after the -copyright statement(s). - -"Original Version" refers to the collection of Font Software components as -distributed by the Copyright Holder(s). - -"Modified Version" refers to any derivative made by adding to, deleting, -or substituting -- in part or in whole -- any of the components of the -Original Version, by changing formats or by porting the Font Software to a -new environment. - -"Author" refers to any designer, engineer, programmer, technical -writer or other person who contributed to the Font Software. - -PERMISSION & CONDITIONS -Permission is hereby granted, free of charge, to any person obtaining -a copy of the Font Software, to use, study, copy, merge, embed, modify, -redistribute, and sell modified and unmodified copies of the Font -Software, subject to the following conditions: - -1) Neither the Font Software nor any of its individual components, -in Original or Modified Versions, may be sold by itself. - -2) Original or Modified Versions of the Font Software may be bundled, -redistributed and/or sold with any software, provided that each copy -contains the above copyright notice and this license. These can be -included either as stand-alone text files, human-readable headers or -in the appropriate machine-readable metadata fields within text or -binary files as long as those fields can be easily viewed by the user. - -3) No Modified Version of the Font Software may use the Reserved Font -Name(s) unless explicit written permission is granted by the corresponding -Copyright Holder. This restriction only applies to the primary font name as -presented to the users. - -4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font -Software shall not be used to promote, endorse or advertise any -Modified Version, except to acknowledge the contribution(s) of the -Copyright Holder(s) and the Author(s) or with their explicit written -permission. - -5) The Font Software, modified or unmodified, in part or in whole, -must be distributed entirely under this license, and must not be -distributed under any other license. The requirement for fonts to -remain under this license does not apply to any document created -using the Font Software. - -TERMINATION -This license becomes null and void if any of the above conditions are -not met. - -DISCLAIMER -THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT -OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE -COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL -DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM -OTHER DEALINGS IN THE FONT SOFTWARE. - - - - - - - - - - -The following font is part of the Original Version of the font -with Reserved Font Name 'Fusion Pixel' above: -Copyright (c) 2021, TakWolf (https://takwolf.com), -with Reserved Font Name 'Ark Pixel'. - -This Font Software is licensed under the SIL Open Font License, Version 1.1. -This license is copied below, and is also available with a FAQ at: -http://scripts.sil.org/OFL - - ------------------------------------------------------------ -SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 ------------------------------------------------------------ - -PREAMBLE -The goals of the Open Font License (OFL) are to stimulate worldwide -development of collaborative font projects, to support the font creation -efforts of academic and linguistic communities, and to provide a free and -open framework in which fonts may be shared and improved in partnership -with others. - -The OFL allows the licensed fonts to be used, studied, modified and -redistributed freely as long as they are not sold by themselves. The -fonts, including any derivative works, can be bundled, embedded, -redistributed and/or sold with any software provided that any reserved -names are not used by derivative works. The fonts and derivatives, -however, cannot be released under any other type of license. The -requirement for fonts to remain under this license does not apply -to any document created using the fonts or their derivatives. - -DEFINITIONS -"Font Software" refers to the set of files released by the Copyright -Holder(s) under this license and clearly marked as such. This may -include source files, build scripts and documentation. - -"Reserved Font Name" refers to any names specified as such after the -copyright statement(s). - -"Original Version" refers to the collection of Font Software components as -distributed by the Copyright Holder(s). - -"Modified Version" refers to any derivative made by adding to, deleting, -or substituting -- in part or in whole -- any of the components of the -Original Version, by changing formats or by porting the Font Software to a -new environment. - -"Author" refers to any designer, engineer, programmer, technical -writer or other person who contributed to the Font Software. - -PERMISSION & CONDITIONS -Permission is hereby granted, free of charge, to any person obtaining -a copy of the Font Software, to use, study, copy, merge, embed, modify, -redistribute, and sell modified and unmodified copies of the Font -Software, subject to the following conditions: - -1) Neither the Font Software nor any of its individual components, -in Original or Modified Versions, may be sold by itself. - -2) Original or Modified Versions of the Font Software may be bundled, -redistributed and/or sold with any software, provided that each copy -contains the above copyright notice and this license. These can be -included either as stand-alone text files, human-readable headers or -in the appropriate machine-readable metadata fields within text or -binary files as long as those fields can be easily viewed by the user. - -3) No Modified Version of the Font Software may use the Reserved Font -Name(s) unless explicit written permission is granted by the corresponding -Copyright Holder. This restriction only applies to the primary font name as -presented to the users. - -4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font -Software shall not be used to promote, endorse or advertise any -Modified Version, except to acknowledge the contribution(s) of the -Copyright Holder(s) and the Author(s) or with their explicit written -permission. - -5) The Font Software, modified or unmodified, in part or in whole, -must be distributed entirely under this license, and must not be -distributed under any other license. The requirement for fonts to -remain under this license does not apply to any document created -using the Font Software. - -TERMINATION -This license becomes null and void if any of the above conditions are -not met. - -DISCLAIMER -THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT -OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE -COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL -DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM -OTHER DEALINGS IN THE FONT SOFTWARE. - - - - - - - - - - -The following font is part of the Original Version of the font -with Reserved Font Name 'Fusion Pixel' above: -Copyright (c) 2019-2023 Minseo Lee (itoupluk427@gmail.com) - -This Font Software is licensed under the SIL Open Font License, Version 1.1. -This license is copied below, and is also available with a FAQ at: -http://scripts.sil.org/OFL - - ------------------------------------------------------------ -SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 ------------------------------------------------------------ - -PREAMBLE -The goals of the Open Font License (OFL) are to stimulate worldwide -development of collaborative font projects, to support the font creation -efforts of academic and linguistic communities, and to provide a free and -open framework in which fonts may be shared and improved in partnership -with others. - -The OFL allows the licensed fonts to be used, studied, modified and -redistributed freely as long as they are not sold by themselves. The -fonts, including any derivative works, can be bundled, embedded, -redistributed and/or sold with any software provided that any reserved -names are not used by derivative works. The fonts and derivatives, -however, cannot be released under any other type of license. The -requirement for fonts to remain under this license does not apply -to any document created using the fonts or their derivatives. - -DEFINITIONS -"Font Software" refers to the set of files released by the Copyright -Holder(s) under this license and clearly marked as such. This may -include source files, build scripts and documentation. - -"Reserved Font Name" refers to any names specified as such after the -copyright statement(s). - -"Original Version" refers to the collection of Font Software components as -distributed by the Copyright Holder(s). - -"Modified Version" refers to any derivative made by adding to, deleting, -or substituting -- in part or in whole -- any of the components of the -Original Version, by changing formats or by porting the Font Software to a -new environment. - -"Author" refers to any designer, engineer, programmer, technical -writer or other person who contributed to the Font Software. - -PERMISSION & CONDITIONS -Permission is hereby granted, free of charge, to any person obtaining -a copy of the Font Software, to use, study, copy, merge, embed, modify, -redistribute, and sell modified and unmodified copies of the Font -Software, subject to the following conditions: - -1) Neither the Font Software nor any of its individual components, -in Original or Modified Versions, may be sold by itself. - -2) Original or Modified Versions of the Font Software may be bundled, -redistributed and/or sold with any software, provided that each copy -contains the above copyright notice and this license. These can be -included either as stand-alone text files, human-readable headers or -in the appropriate machine-readable metadata fields within text or -binary files as long as those fields can be easily viewed by the user. - -3) No Modified Version of the Font Software may use the Reserved Font -Name(s) unless explicit written permission is granted by the corresponding -Copyright Holder. This restriction only applies to the primary font name as -presented to the users. - -4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font -Software shall not be used to promote, endorse or advertise any -Modified Version, except to acknowledge the contribution(s) of the -Copyright Holder(s) and the Author(s) or with their explicit written -permission. - -5) The Font Software, modified or unmodified, in part or in whole, -must be distributed entirely under this license, and must not be -distributed under any other license. The requirement for fonts to -remain under this license does not apply to any document created -using the Font Software. - -TERMINATION -This license becomes null and void if any of the above conditions are -not met. - -DISCLAIMER -THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT -OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE -COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL -DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM -OTHER DEALINGS IN THE FONT SOFTWARE. - - - - - - - - - - -The following font is part of the Original Version of the font -with Reserved Font Name 'Fusion Pixel' above: -[Cubic 11] -These fonts are free software. -Unlimited permission is granted to use, copy, and distribute them, with or without modification, either commercially or noncommercially. -THESE FONTS ARE PROVIDED "AS IS" WITHOUT WARRANTY. -此字型是免費的。 -無論您是否進行對本字型進行商業或非商業性修改,均可無限制地使用,複製和分發它們。 -本字型的衍生品之授權必須與此字型相同,且不作任何擔保。 -[JF Dot M+H 12] -Copyright(c) 2005 M+ FONTS PROJECT -[M+ BITMAP FONTS] -Copyright (C) 2002-2004 COZ -These fonts are free software. -Unlimited permission is granted to use, copy, and distribute it, with or without modification, either commercially and noncommercially. -THESE FONTS ARE PROVIDED "AS IS" WITHOUT WARRANTY. -これらのフォントはフリー(自由な)ソフトウエアです。 -あらゆる改変の有無に関わらず、また商業的な利用であっても、自由にご利用、複製、再配布することができますが、全て無保証とさせていただきます。 - -This Font Software is licensed under the SIL Open Font License, Version 1.1. -This license is copied below, and is also available with a FAQ at: -https://scripts.sil.org/OFL - - ------------------------------------------------------------ -SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 ------------------------------------------------------------ - -PREAMBLE -The goals of the Open Font License (OFL) are to stimulate worldwide -development of collaborative font projects, to support the font creation -efforts of academic and linguistic communities, and to provide a free and -open framework in which fonts may be shared and improved in partnership -with others. - -The OFL allows the licensed fonts to be used, studied, modified and -redistributed freely as long as they are not sold by themselves. The -fonts, including any derivative works, can be bundled, embedded, -redistributed and/or sold with any software provided that any reserved -names are not used by derivative works. The fonts and derivatives, -however, cannot be released under any other type of license. The -requirement for fonts to remain under this license does not apply -to any document created using the fonts or their derivatives. - -DEFINITIONS -"Font Software" refers to the set of files released by the Copyright -Holder(s) under this license and clearly marked as such. This may -include source files, build scripts and documentation. - -"Reserved Font Name" refers to any names specified as such after the -copyright statement(s). - -"Original Version" refers to the collection of Font Software components as -distributed by the Copyright Holder(s). - -"Modified Version" refers to any derivative made by adding to, deleting, -or substituting -- in part or in whole -- any of the components of the -Original Version, by changing formats or by porting the Font Software to a -new environment. - -"Author" refers to any designer, engineer, programmer, technical -writer or other person who contributed to the Font Software. - -PERMISSION & CONDITIONS -Permission is hereby granted, free of charge, to any person obtaining -a copy of the Font Software, to use, study, copy, merge, embed, modify, -redistribute, and sell modified and unmodified copies of the Font -Software, subject to the following conditions: - -1) Neither the Font Software nor any of its individual components, -in Original or Modified Versions, may be sold by itself. - -2) Original or Modified Versions of the Font Software may be bundled, -redistributed and/or sold with any software, provided that each copy -contains the above copyright notice and this license. These can be -included either as stand-alone text files, human-readable headers or -in the appropriate machine-readable metadata fields within text or -binary files as long as those fields can be easily viewed by the user. - -3) No Modified Version of the Font Software may use the Reserved Font -Name(s) unless explicit written permission is granted by the corresponding -Copyright Holder. This restriction only applies to the primary font name as -presented to the users. - -4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font -Software shall not be used to promote, endorse or advertise any -Modified Version, except to acknowledge the contribution(s) of the -Copyright Holder(s) and the Author(s) or with their explicit written -permission. - -5) The Font Software, modified or unmodified, in part or in whole, -must be distributed entirely under this license, and must not be -distributed under any other license. The requirement for fonts to -remain under this license does not apply to any document created -using the Font Software. - -TERMINATION -This license becomes null and void if any of the above conditions are -not met. - -DISCLAIMER -THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT -OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE -COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL -DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM -OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/desktop_version/fonts/font_tc.fontmeta b/desktop_version/fonts/font_tc.fontmeta deleted file mode 100644 index ead3b493..00000000 --- a/desktop_version/fonts/font_tc.fontmeta +++ /dev/null @@ -1,3306 +0,0 @@ - - - 繁體中文 - 12 - 12 - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - buttons_12x12 - diff --git a/desktop_version/fonts/font_tc.png b/desktop_version/fonts/font_tc.png deleted file mode 100644 index 127ec623..00000000 Binary files a/desktop_version/fonts/font_tc.png and /dev/null differ diff --git a/desktop_version/icon.ico b/desktop_version/icon.ico index 8ec3b883..d24203cb 100644 Binary files a/desktop_version/icon.ico and b/desktop_version/icon.ico differ diff --git a/desktop_version/lang/README-programmers.txt b/desktop_version/lang/README-programmers.txt deleted file mode 100644 index 71260a59..00000000 --- a/desktop_version/lang/README-programmers.txt +++ /dev/null @@ -1,177 +0,0 @@ -=== I N T R O D U C T I O N === - -This file will explain what you need to know when maintaining translations of VVVVVV (like adding new strings to the game and syncing them across languages). - -For making new translations of the game, read README-translators.txt instead. - - - -=== A D D I N G N E W S T R I N G S === - -If you want to add some new text to the game, all you generally need to do to make it translatable is wrap loc::gettext() around your raw strings in the code (you may need to add an #include "Localization.h"), and add the same strings to the English language file. The new strings can be automatically synced from English to all other language files using the translator menu. - -For example, "Game paused" can be made translatable by changing it to loc::gettext("Game paused"). Its entry in the English language file could look like this: - - - -The max value indicates how many characters of space there is for the text, and is further described below. It looks like "40" for single-line text, and "38*5" for multi-line text. The max value may not be applicable or may be hard to define, so this attribute can be completely left out. For example, when it's a diagonally-placed menu option, or because the limit depends on the lengths of other strings (like Low/Medium/High in the joystick menu), or a string looks progressively worse the longer it gets. As a general rule: if defining a hard limit would be misleading, then it can be exempt from having a limit. - - - -=== E D I T I N G E X I S T I N G S T R I N G S === - -Sometimes you need to make a partial change to text that has already been translated. - -For example: you need to change the string "Press ENTER to stop" to "Press {button} to stop" (because you made that hotkey configurable). - -Please do *not* simply find-and-replace the text in the language files, nor remove the old string when you add the new one. (Whether you keep the translations or not.) - -Instead, duplicate the string in the English language file, putting your version underneath the old version, and mark the old version with the explanation "***OUTDATED***". - -For example: - - - - ↓ ↓ ↓ - - - - - -The game won't be using the outdated string anymore - it's only still in the language files to carry the existing translations for reference. Once a translator updates the language files, they can reuse parts of the old translation for the new version of the string. - - english | translation | explanation - ================================================================================= - Press ENTER to stop | Appuyez sur ENTRÉE pour arrêter | ***OUTDATED*** - --------------------------------------------------------------------------------- - Press {button} to stop | ? ? ? | stop super gravitron - - -Eventually, once all languages are up-to-date, these outdated strings can be cleaned up. - -Of course, when you remove strings without replacement, you can simply remove them from the (English) language file. - - - -=== T E X T P R I N T I N G === - -These are the text printing functions: - - font::print(flags, x, y, text, r, g, b) - font::print_wrap(flags, x, y, text, r, g, b, linespacing = -1, maxwidth = -1) - -The flags argument can be 0, or a set of flags that do things like centering, enlarging, etc. - -Some examples (can also be found in Font.h): - - Standard print - font::print(0, 50, 50, "Hello world!", 255, 255, 255); - - Centered text - font::print(PR_CEN, -1, 50, "Hello world!", 255, 255, 255); - (set X to -1, unless you want to center *around* X) - - 2x scale - font::print(PR_2X, 50, 50, "V", 255, 255, 255); - - Centered 2x scale - font::print(PR_CEN | PR_2X, -1, 50, "V", 255, 255, 255); - - Right-aligned 3x scale with a border around it - font::print(PR_RIGHT | PR_3X | PR_BOR, 320, 50, "V", 255, 255, 255); - - Wordwrapped centered text - font::print_wrap(PR_CEN, -1, 50, "Hello world, this will wordwrap to the screen width", 255, 255, 255); - -A not-technically-exhaustive list of all flags (which are defined in Font.h): - -- PR_2X/PR_3X/.../PR_8X Print at larger scale (PR_1X is default) -- PR_FONT_INTERFACE [DEFAULT] Use interface (VVVVVV language) font -- PR_FONT_LEVEL Use level-specific font (room names, cutscenes, etc) -- PR_FONT_8X8 Use 8x8 font no matter what -- PR_BRIGHTNESS(value) Use this brightness 0-255 (this value is mixed with - r, g and b for an alpha effect, and accounts for - colored glyphs correctly) -- PR_BOR Draw a black border around the text -- PR_LEFT [DEFAULT] Left-align text/place at X coordinate -- PR_CEN Center-align text relative to X (X is center) - or to screen if X == -1 -- PR_RIGHT Right-align text to X - (X is now the right border, not left border) -- PR_CJK_CEN [DEFAULT] Large fonts (Chinese/Japanese/Korean) should - stick out on top and bottom compared to 8x8 font -- PR_CJK_LOW Larger fonts should stick out fully on the bottom - (draw at Y) -- PR_CJK_HIGH Larger fonts should stick out fully on the top -- PR_RTL_XFLIP In RTL languages, mirror the X axis, so left is 320 - and right is 0, and invert the meaning of PR_LEFT and - PR_RIGHT - - - -=== S T R I N G F O R M A T T I N G === - -Instead of sprintf-family functions, it is preferred to use VVVVVV's own formatting system, VFormat. - -Strings sometimes have placeholders, which look like {name} or {name|flags}. For example, "{n_trinkets} of {max_trinkets}". - -Placeholders can also have "flags" that modify their behavior. These can be added or removed in the translation as needed. Flags are separated by | (pipe). - -For more info, see the documentation at the top of VFormat.h. - -Full example: - - char buffer[100]; - vformat_buf(buffer, sizeof(buffer), - "{crewmate} got {number} out of {total} trinkets in {m}:{s|digits=2}.{ms|digits=3}", - "number:int, total:int, crewmate:str, m:int, s:int, ms:int", - 2, 20, "Vermilion", 2, 3, 1 - ); - - => "Vermilion got 2 out of 20 trinkets in 2:03.001" - - - -=== T R A N S L A T O R M E N U === - -The translator menu has options for both translators and maintainers - it allows testing menus, translating room names within the game, syncing all language files with the English template files, getting statistics on translation progress, and more. - -VVVVVV will show a "translator" menu in the main menu if either: -- The "lang" folder is NOT next to data.zip, and the game is running somewhere within a "desktop_version" folder, and desktop_version/lang IS found. This normally happens when compiling the game from source; -- The command line argument (or launch option) "-translator" is passed. -- ALWAYS_SHOW_TRANSLATOR_MENU is defined during compilation (see top of Localization.h) - -To add new strings, add them to only the English strings.xml or strings_plural.xml, and use the option to sync all languages from the translator menu. This will copy the new strings to all translated language files. - -The language file sync option has differing support for the language files. As indicated in the menu itself, it handles each file as follows: - -[Full syncing EN→All] -For these files, the English version of the file is fully copied and overwrites every language's version, while all existing translations and customizations are inserted for every language. This means newly added strings are copied to every language, and removed strings are simultaneously removed from every language, bringing them fully up-to-date. - - meta.xml - - strings.xml - - strings_plural.xml - - cutscenes.xml - - roomnames.xml - - roomnames_special.xml - -[Syncing not supported] -These files are untouched by the syncing feature. - - numbers.xml - - - -=== F I L E S === - -* meta.xml: This file contains some general information about a translation. - -* strings.xml: This file contains general strings for the interface and some parts of the game. - -* strings_plural.xml: Similar usage to strings.xml, but for strings that need different plural forms ("1 trinket", "2 trinkets") - -* numbers.xml: This file contains all numbers from 0 to 100 written out (Zero, One, etc). This file also allows you to define the plural forms used in strings_plural.xml. - -* cutscenes.xml: This file contains nearly all the cutscenes that appear in the main game. - -* roomnames.xml: This file contains nearly all the room names for the main game. - -* roomnames_special.xml: This file contains some special cases for roomnames, some names for rooms that usually aren't displayed as regular (like The Ship), and some general area names. diff --git a/desktop_version/lang/README-translators.txt b/desktop_version/lang/README-translators.txt deleted file mode 100644 index a11b7aa2..00000000 --- a/desktop_version/lang/README-translators.txt +++ /dev/null @@ -1,382 +0,0 @@ -=== I N T R O D U C T I O N === - -This file will explain everything you need to know when making translations of VVVVVV. - -WARNING TO VOLUNTEERS: VVVVVV translation is not a community effort where anyone can submit translations! It's *possible* that, on a case-by-case basis, someone can volunteer to become an official translator. But you would need to get approval from Terry first (or you can express interest in there being an official translation into your language, it may already be planned!) - -Likewise, you're welcome to report issues in existing translations (or to submit PRs to fix these issues), but it's not a good idea to rewrite significant parts of a translation, and then contribute it without warning. If you think there are errors or things that could be improved, please give an explanation as to why. (We may decide to discuss it with the official translator.) - -It *is* possible to make a fan translation for fun, for sharing with others, etc. But it probably won't be distributed with the game officially. - - - -=== A D D I N G A N E W L A N G U A G E === - -The English language files are basically templates for other languages (all the translations are empty). - -To create a new language, simply copy the `en` folder, and start by filling out meta.xml (further explained below). - -Alternatively, you can create an empty language folder, and then use the in-game sync tool (translator > maintenance > sync language files) to populate it. - - - -=== E X C E L === - -The game uses XML files for storing the translations. If you prefer, there is an .xlsm file which can be used as an editor. This can load in all the XML files, and then save changes back as XML. - -If you're an official translator, you should have received a version of this spreadsheet. If not, a blank version can be found here: https://github.com/Daaaav/TranslationEditor - - - -=== T R A N S L A T O R M E N U === - -The translator menu has options for both translators and maintainers - it allows testing menus, translating room names within the game, syncing all language files with the English template files, getting statistics on translation progress, and more. The translator menu is hidden from players in regular versions of the game. - -When the translator menu is unlocked, you can also press F8 anywhere in the game to reload the current language files. So you can save translations and immediately preview them (except for menu buttons and the current cutscene dialogue, which can't be reloaded on the fly). You will hear a coin sound when the language files have been reloaded via F8. - - - -=== L O W E R C A S E A N D U P P E R C A S E === - -If lowercase and uppercase does not exist in your language (Chinese, Japanese and Korean for example), you can set toupper to 0 in meta.xml, and ignore any directions about using lowercase or uppercase. - -VVVVVV's menu system has the style of using lowercase for unselected options and uppercase for selected options, for example: - - play - levels - [ OPTIONS ] - translator - credits - quit - -The menu options are stored as their full-lowercase version, and they're normally commented as "menu option" in the translation files. A built-in function (toupper in Localization.cpp) automatically converts the lowercase text to uppercase when needed. This function has support for a good number of accented characters, Cyrillic and Greek, but more could be added if needed. It also accounts for special cases in Turkish and Irish. - -Turkish: The uppercase of i is İ, for example, "dil" becomes "DİL" and not "DIL". To enable this, set toupper_i_dot to 1 in meta.xml. - -Irish: Specific letters may be kept in lowercase when making a string full-caps. For example, "mac tíre na hainnise" should be "MAC TÍRE NA hAINNISE" instead of "MAC TÍRE NA HAINNISE". If enabled, you can use the ~ character before the letter which should be forced in lowercase: "mac tíre na ~hainnise". This ~ character only has an effect in strings which are subject to automatic uppercasing (otherwise it'll be visible as å). This can be enabled by setting toupper_lower_escape_char to 1 in meta.xml. - - - -=== W O R D W R A P P I N G A N D L E N G T H L I M I T S === - -For most languages, VVVVVV can automatically wordwrap based on spaces. This may not work for some languages (like Chinese, Japanese and Korean), so instead, newlines can be inserted manually (see below) and automatic wordwrapping can be disabled in meta.xml. - -VVVVVV's resolution is 320x240, and the default font is 8x8, which means there is a 40x30 character grid (although we don't adhere to this grid for the UI, but it gives a good indication). Naturally, if the font has a different size like 12x12, less characters will fit on the screen too. - -Strings are usually annotated with their limits (for example, max="38*3"). This can be formatted like one of the following: - (A) 33 - (B) 33*3 - -(A) if it's a single number (for example "33"): the hard maximum number of characters that are known to fit. Being exactly on the limit may not look good, so try to go at least a character under it if possible. - -(B) if X*Y (for example 33*3): the text should fit within an area of X characters wide and Y lines high. The text is automatically word-wrapped to fit (unless disabled in meta.xml). If automatic word-wrapping is disabled, you need to manually insert newlines with |, or possibly as a literal newline. - -If your language uses a font with a different size than 8x8, there will be two limits given: `max`, which is the original limit based on the 8x8 font, and `max_local`, which is adapted to the size of your font. To get this notation, use the maintenance option to sync language files from within VVVVVV. Ensure the correct font is set in meta.xml first. - -The translator menu has an option ("limits check") to automatically find strings that break the given limits. There may be a few cases where this detection isn't perfect, but it should be a helpful quality assurance tool. - -The maximum lengths are not always given. Notoriously, menu option buttons are placed diagonally, thus they have maximums that are hard to look up. Even more so, making an option differ too much in length from the other options might make it look out of place. Best thing to do there is probably just translate as usual and then test all menus via the "menu test" option in the translator menu. However, menus do automatically reposition based on the text length, so worst-case scenario, if an option is 36 characters long, all options are displayed right underneath each other. - - - -=== F O N T S === - -The game uses an 8x8 pixel font by default (font.png and font.fontmeta in the "fonts" folder). If your language can be represented in 8x8 characters, it is preferable to use this font, or for this font to be extended. - -The fonts directory also has a README.txt file that explains how the font format works. - - - -=== N U M B E R S A N D P L U R A L F O R M S === - -In certain places, VVVVVV (perhaps unconventionally) writes out numbers as full words. For example: - - - One out of Fifteen - - Two crewmates remaining - - Two remaining - -These words can be found in numbers.xml. The numbers Zero through Twenty will be the most commonly seen. It's always possible for numbers up to One Hundred to be seen though (players can put up to 100 trinkets and crewmates in a custom level). - -Your language may not allow the same word to be used for the same number in different scenarios. For example, in Polish, "twenty out of twenty" may be "dwadzieścia z dwudziestu". Right now, you have two sets of wordy numbers to choose from, `translation` and `translation2`, but this will likely change to a more customizable system in the future. You can choose when these "wordy" numbers are used and when numeric forms (20 out of 20) are used (see "STRING FORMATTING" below). It's also possible to leave the translations for all the numbers empty. In that case, numeric forms will always be used. - -In English, using Title Case is appropriate, but in most other languages, it probably isn't. Therefore, you may want to translate all numbers in lowercase, when it's more appropriate to use "twenty out of twenty" than "Twenty out of Twenty". You can then apply auto-uppercasing to any placeholder you choose (see "STRING FORMATTING" below), making it possible to display "Twenty out of twenty". - -As for plural forms: English and some other languages have a singular (1 crewmate) and a plural (2 crewmates). Some languages may have different rules (like for 0, or numbers that end in 2, 3 and 4). VVVVVV can accommodate these rules and allows you to translate certain strings (strings_plural.xml) in different ways depending on the number. The different forms can be defined by changing the "form" attribute on each number in numbers.xml. For English, form "1" is used for singular, and form "0" is used for plural. You can set up any amount of plural forms you will need. - -Numbers that identify the forms do not need to be sequential, you may use any number between 0 and 254 to identify the different forms. So instead of using forms 0, 1, 2 and 3, you could also name them 1, 2, 5 and 7. - -Suppose you need a different form for the number 1, the numbers 2-4, and all other numbers. You could use "form 1" for the number 1, "form 2" for 2-4, and "form 0" for all other numbers: - - - - - - - - - - ... - -When translating the plural strings, you can add translations for every unique form. For example: - - - - - - - -Plural forms can appear both for wordy numbers ("you saved one crewmate") as well as numbery numbers ("you died 136 times in this room"), so we need the plural forms to go further than 100. - -For the numbers 100 and higher: as far as I can find (with information about plural rules across 160 languages) - the plural forms always repeat themselves every 100 numbers. So numbers 100-199 always have the same forms as 200-299, 300-399, and so on. However, 100-119 (200-219, etc) don't always work the same as 0-19 do (in English for example, it's not "101 trinket" despite ending in 01). Therefore, forms for 100-119 can also be filled in. The system will simply copy 20-99 for 120-199, and that should be enough to cover all numbers from 0 to infinity. Technically the system supports providing forms until 199, but it should never be necessary to go higher than 119, so they're not in the language files by default. - -Numbers higher than 100 cannot have a written out translation ("one hundred and one" does not exist). - - - -=== S T R I N G F O R M A T T I N G === - -Strings sometimes have placeholders, which look like {name} or {name|flags}. For example, "{n_trinkets} of {max_trinkets}". - -Placeholders can also have "flags" that modify their behavior. These can be added or removed in the translation as needed. Flags are separated by | (pipe). - -For example, "{n_trinkets|wordy}" makes the number of trinkets display as a "wordy" number (twenty instead of 20) (See "NUMBERS AND PLURAL FORMS"). "{n_trinkets|wordy|upper}" makes that word start with a capital letter (Twenty instead of twenty). So for example, "{n_trinkets|wordy|upper} of {max_trinkets|wordy}" may be displayed as "Twenty out of twenty" - assuming numbers.xml is translated all-lowercase. - -The valid flags are: - - wordy [ints only] use number words (Twenty) of the first set (translation), instead of digits (20) - - wordy2 [ints only] use number words of the second set (translation2), instead of digits - - digits=n [ints only] force minimum n digits, like n=5 --> 00031 - - spaces [only if using digits=n] use leading spaces instead of 0s - - upper uppercase the first character with loc::toupper_ch - - - -=== S T O R Y A N D C H A R A C T E R I N F O R M A T I O N === - -This is a brief story and character overview for reference. Any further questions can be directed to Terry: https://distractionware.com/email/ - -== The Crewmates == - -VVVVVV is about a crew of curious and super-intelligent aliens exploring the universe. There are six crewmates onboard the ship, in six different colours. They are: - -* Viridian (Cyan, the player character) -* Verdigris (Green) -* Vitellary (Yellow) -* Vermilion (Red) -* Victoria (Blue) -* Violet (Purple) - -All six characters have names that start with V. In addition, each crewmate's name is an obscure word that suggests their colour - for example, Verdigris is the name of the green pigment that forms on copper when it oxidises. This might be hard to translate! (So, potentially it just makes sense not to translate the names at all, unless you have a good idea about how to do it - for example, if you can pull off the same colour/name beginning with V trick in your language.) - -Each crewmate has the following "rank", i.e. their job on the ship. These are all basically just Star Trek inspired roles: - -* "Captain" Viridian (Captain as in leader) -* "Chief" Verdigris (Chief as in Lead Engineer) -* "Professor" Vitellary (Kind of the senior scientist on board) -* "Officer" Vermilion (Officer as in Away-Officer, the one who usually goes out exploring) -* "Doctor" Victoria (Doctor in the scientific sense) -* "Doctor" Violet (Doctor in the medical sense) - -Verdigris, Vitellary and Vermilion are male. Victoria and Violet are female. Viridian is deliberately unspecified - when translating cutscenes, if at all possible, try to avoid specifying their gender, even if that leads to some otherwise awkward phrasing or requires the use of some cutting edge grammar tricks in your language. - -== Personalities == - -If it helps with tone: the running joke in VVVVVV's writing is that all six characters are hyper intelligent prodigies, who will nevertheless speak to each other as if they're small children. E.g. Viridian "we were just playing with it!", Vermilion "I'm helping!", Verdigris "I'm an engineer!", etc. More specifically: - -* Viridian is a classic hero - unphased by danger, never worried, always completely certain that they'll be able to fix everything. -* Verdigris is a romantic - he has a huge (reciprocated!) crush on Violet, which he does a terrible job of keeping secret. -* Vitellary is an academic - he loves science, and has a dry and long winded science thing to tell you in almost every cutscene. -* Vermilion is bold and adventurous - after you rescue him, you'll find him exploring different parts of the world on his own quest to find the rest of the crew (he's not much help, though). -* Victoria is a worrier - she's quick to feelings of despair. Victoria's sprite is almost always sad! -* Violet is a caretaker - she's the ship's Doctor, and most of her cutscenes are status updates about the other crewmates. - -== Dimension VVVVVV == - -The world you're exploring is filled with terminals, with text logs from the previous inhabitants, who we never see. We don't know much about them. - -The ship you're all on is called the "D.S.S. Souleye", which is a minor easter egg. D.S.S. just stands for "Dimensional Space Ship" - a craft that warps between different dimensions. Souleye is the pseudonym for Magnus Pålsson, the game's composer. - - - -=== S P R I T E S T R A N S L A T I O N === - -There are several enemies in the game which contain words: STOP, YES, OBEY, LIES and TRUTH. These, as well as the C on checkpoints, can be translated. - -This may be a bit tricky - the sizes of the translated graphics should be as close to the original English as possible, which means that even though letters can be compressed a bit, they will quickly be too long. For example, if you'd like to translate LIES with 5 letters, it really doesn't help if one of those 5 letters is not an I (the most slim letter). - -Fortunately, the translation does not have to be literal, as the words themselves are only referenced in room names at most, and the exact meanings aren't that important, only the spirit of them is. OBEY is a They Live reference, so there are a lot of other signs you could use. Some inspiration: - -* STOP: this is on a stop sign, so may not need to be translated -* OBEY: maybe something like FOLLOW, or one of the other words in "They Live" (WORK, BUY, CONSUME, CONFORM, ...) -* LIES: maybe singular LIE, maybe some form of NONSENSE (as in BS but non-offensive), FALSE, FAKE, BLAH, FABLE -* TRUTH: maybe FACTS - - -== Implementation of translated sprites == - -If you'd like to pixel translated sprites yourself: Take sprites.png and flipsprites.png from the graphics folder in data.zip. These spritesheets are a 32x32 grid - for example, you cannot extend OBEY upwards or to the left. - -The translated file does not have to contain any untranslated sprites - these can simply be made transparent, for optimization. So: the files should be transparent sheets with some translations in the middle. - -The translated versions of sprites.png and flipsprites.png can be placed in a "graphics" subfolder of your language folder. - -Then, put a file next to them called "spritesmask.xml", with the following contents: - - - - - - - - - - - - - -This file defines which sprites in the translated files should overwrite the original ones. Remove any lines for sprites you did not translate. After that, your translated sprites should work! - -For completeness: sprite_w and sprite_h on the tag define the size of each unit in the attributes of . The possible attributes of are: - -* x, y: the position of the sprite to copy (in blocks of sprite_w by sprite_h) -* w, h: the width and height of the sprite to copy (default 1 for both) -* dx, dy: the destination position of the sprite (default x,y; so the same position as copied from) - - - -=== F I L E S === - -== meta.xml == -This file contains some general information about this translation. It contains the following attributes: - -* active: If 0, this language will not be shown in the languages menu - -* nativename: The name of the language in itself, fully in lowercase (so not "spanish" or "Español", but "español"). A language name can be at most 16 characters wide (in the 8x8 font) - -* credit: You can fill in credit here that will appear on the language screen, like "Spanish translation by X". May be in your language. Max 38*2 @8x8 - -* action_hint: This is displayed at the bottom of the language screen when your language is highlighted, to show that Space/Z/V sets the selected option as the language. Max 40 @8x8 - -* gamepad_hint: The same as action_hint, but now a gamepad button will be filled into {button}, such as (A), (X), etc - -* autowordwrap: Whether automatic wordwrapping is enabled. Can be disabled for CJK (in which case newlines have to be inserted manually in text) - -* toupper: Whether to enable automatic uppercasing of menu options (unselected, SELECTED). May be disabled for languages such as CJK that don't have lowercase and uppercase. - -* toupper_i_dot: When automatically uppercasing, map i to İ, as in Turkish. - -* toupper_lower_escape_char: When automatically uppercasing, allow ~ to be used to stop the next letter from being uppercased, for Irish. - -* rtl: This should be enabled for languages that are written right-to-left. It will horizontally flip many parts of the interface and allows text to be right-aligned in places like textboxes. - -* menu_select: The indication that a certain menu option or button is selected, in addition to the automatic uppercasing if "toupper" is enabled. For example, "[ {label} ]" looks like "[ SELECTED ]" - -* menu_select_tight: Similar to menu_select, except used in cases where space is a bit more limited (like the map screen). "[{label}]" looks like "[SELECTED]" - -* font: The filename of the font to use. The 8x8 font is called "font", the Japanese font is "font_ja", et cetera. - - -== strings.xml == -This file contains general strings for the interface and some parts of the game. In the XML, the tag for one string looks like this: - - - -To translate a string, simply fill in the translation attribute, like this: - - - -If the translation is left blank, the English text will be used as a fallback. Translations should NOT be left blank on purpose if the text is the same however; the string will be counted as untranslated and it'll be harder to keep track of what's new. Always just copy-paste the English string into the translation in that case. - -The following attributes may be found for each string: - -* english: the English text. - -* translation: the translation. - -* case: a number (1, 2, etc) for separate strings that are identical in English but may need different translations. - -* explanation: an explanation about the context, location and possibly the formatting. - -* max: length restrictions, described above in "WORDWRAPPING AND LENGTH LIMITS" - - -== strings_plural.xml == - -See "NUMBERS AND PLURAL FORMS" above. - -You can define the plural forms in numbers.xml. - -Then, simply add translations for each form you set up in numbers.xml. For example: - - - - - -The "wordy" flag indicates a word will be filled in (like twelve), otherwise a number (12). As described above in "STRING FORMATTING", you can change this as needed in your translations. - -The `var` attribute indicates which placeholder will be filled in, the `expect` attribute indicates how high the values are that you may expect to be filled in. For example, expect="20" means any value above 20 will probably not be used in this string. This is mainly needed so that the limits check knows not to worry about a number like "seventy seven" making the string too long, but it may also be a useful context clue. - - -== numbers.xml == -This file contains all numbers from 0 to 100 written out (Zero, One, etc). - -This will be filled in strings like: -- One out of Fifteen -- Two crewmates remaining -- Two remaining - -If this can't work for your language, or wordy numbers are really unfitting, you can leave all of these empty, in which case numbers will be used (20 out of 20). - -You may want to do it all-lowercase in order to not get English-style title casing. "Twenty out of Twenty" may be grammatically incorrect in MANY languages, and "twenty out of twenty" would be better. Translating the numbers all-lowercase allows you to apply context-specific uppercasing, like "Twenty out of twenty" (see "STRING FORMATTING" above) - -This file also allows you to define the plural forms used in strings_plural.xml. - -For more information, see "NUMBERS AND PLURAL FORMS" above. - - -== cutscenes.xml == -This file contains nearly all the cutscenes that appear in the main game. Each line has a "speaker" attribute, which is not used by the game - it's just for translators to know who says what and to establish context. - -The dialogues are automatically text-wrapped, except if automatic wrapping is disabled in meta.xml. In that case, the maximum line length is 36 8x8 characters (288 pixels) or 24 12x12 characters. - -In the few cases where the same text appears multiple times in a cutscene, these have the attribute "case" added to them (for example case="1", case="2", etc), so they can be translated separately if needed. (These match up with textcase(x) commands in the scripts themselves) - -You may find some additional formatting attributes on each tag. These are used to make spacing and formatting in translations consistent with the original English text (for example, centered text, padding on both sides, etc). You can change any of these if you need, and you can also add them yourself to ANY dialogue tag. - -* tt: teletype. if "1", disable automatic word wrapping, even if autowordwrap is enabled in meta.xml. You will have to add newlines manually for this textbox, either with hard enters, or with | - -* wraplimit: change the maximum width of the text before it wordwraps, in pixels. Only if tt is not enabled. Example: - [Hello world!] --[wraplimit="56"]--> [Hello ] (56=7*8) - [world!] - If autowordwrap is disabled in meta.xml, this also doesn't work, but it does give you an advisory maximum text width. - The default is 288 (36*8 or 24*12). - -* centertext: center the text (but keep it aligned to the grid), for example: - [You have rescued] --[centertext="1"]--> [You have rescued] - [a crewmember!] [ a crewmember! ] - -* pad: pad each line of text with a number of spaces (0 by default), for example: - [You have rescued] --[pad="2"]--> [ You have rescued ] - [ a crewmember! ] [ a crewmember! ] - This will automatically make the wrap limit smaller accordingly, unless a custom wraplimit is given. - -* pad_left/pad_right: same as pad, but only affects the left or right side. For example: - [You have rescued] --[ pad_left="5"]--\ [ You have rescued ] - [ a crewmember! ] --[pad_right="2"]--/ [ a crewmember! ] - -* padtowidth: pad the text on both sides if it's not this many pixels wide. For example: - [-= Personal Log =-] --[padtowidth="224"]--> [ -= Personal Log =- ] (224=28*8) - - -== roomnames.xml == -This file contains nearly all the room names for the main game. The limit is always 40 8x8 characters (320 pixels) or 26 12x12 characters. - -It's recommended to translate the room names in-game to see why all rooms are called what they are. To do this, enable room name translation mode in translator > translator options > translate room names. - - -== roomnames_special.xml == -This file contains some special cases for roomnames, some names for rooms that usually aren't displayed as regular (like The Ship), and some general area names. - -One room ("Prize for the Reckless") is intentionally missing spikes in a time trial and no death mode so the player does not have to die there, and the room is called differently in both cases (for time trial "Imagine Spikes There, if You Like", and for no death mode "I Can't Believe You Got This Far"). - -There are also some roomnames in the game which gradually transform into others or cycle through a few minor variations. - diff --git a/desktop_version/lang/ar/cutscenes.xml b/desktop_version/lang/ar/cutscenes.xml deleted file mode 100644 index 34f3617f..00000000 --- a/desktop_version/lang/ar/cutscenes.xml +++ /dev/null @@ -1,948 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/ar/graphics/flipsprites.png b/desktop_version/lang/ar/graphics/flipsprites.png deleted file mode 100644 index e8d4aed0..00000000 Binary files a/desktop_version/lang/ar/graphics/flipsprites.png and /dev/null differ diff --git a/desktop_version/lang/ar/graphics/sprites.png b/desktop_version/lang/ar/graphics/sprites.png deleted file mode 100644 index db27bf64..00000000 Binary files a/desktop_version/lang/ar/graphics/sprites.png and /dev/null differ diff --git a/desktop_version/lang/ar/graphics/spritesmask.xml b/desktop_version/lang/ar/graphics/spritesmask.xml deleted file mode 100644 index 57b33a7e..00000000 --- a/desktop_version/lang/ar/graphics/spritesmask.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/desktop_version/lang/ar/meta.xml b/desktop_version/lang/ar/meta.xml deleted file mode 100644 index 117ca976..00000000 --- a/desktop_version/lang/ar/meta.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - 1 - - - العربية - - - الترجمة العربية من -Eternal Dream Arabization - - - اضغط مسافة، زر Z، أو زر V للاختيار - - - اضغط {button} للاختيار - - - 1 - - - 1 - - - 0 - - - 0 - - - 1 - - - [ {label} ] - [{label}] - - - font_ar - diff --git a/desktop_version/lang/ar/numbers.xml b/desktop_version/lang/ar/numbers.xml deleted file mode 100644 index 5f67c89a..00000000 --- a/desktop_version/lang/ar/numbers.xml +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/ar/roomnames.xml b/desktop_version/lang/ar/roomnames.xml deleted file mode 100644 index ca3e6df0..00000000 --- a/desktop_version/lang/ar/roomnames.xml +++ /dev/null @@ -1,193 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/ar/roomnames_special.xml b/desktop_version/lang/ar/roomnames_special.xml deleted file mode 100644 index 2489c9a3..00000000 --- a/desktop_version/lang/ar/roomnames_special.xml +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/ar/strings.xml b/desktop_version/lang/ar/strings.xml deleted file mode 100644 index e2dd70db..00000000 --- a/desktop_version/lang/ar/strings.xml +++ /dev/null @@ -1,819 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/ar/strings_plural.xml b/desktop_version/lang/ar/strings_plural.xml deleted file mode 100644 index 9ccf291e..00000000 --- a/desktop_version/lang/ar/strings_plural.xml +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/ca/cutscenes.xml b/desktop_version/lang/ca/cutscenes.xml deleted file mode 100644 index a8d2b3cb..00000000 --- a/desktop_version/lang/ca/cutscenes.xml +++ /dev/null @@ -1,949 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/ca/graphics/flipsprites.png b/desktop_version/lang/ca/graphics/flipsprites.png deleted file mode 100644 index d4dc66cc..00000000 Binary files a/desktop_version/lang/ca/graphics/flipsprites.png and /dev/null differ diff --git a/desktop_version/lang/ca/graphics/sprites.png b/desktop_version/lang/ca/graphics/sprites.png deleted file mode 100644 index 5988d44f..00000000 Binary files a/desktop_version/lang/ca/graphics/sprites.png and /dev/null differ diff --git a/desktop_version/lang/ca/graphics/spritesmask.xml b/desktop_version/lang/ca/graphics/spritesmask.xml deleted file mode 100644 index 2b84a724..00000000 --- a/desktop_version/lang/ca/graphics/spritesmask.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/desktop_version/lang/ca/meta.xml b/desktop_version/lang/ca/meta.xml deleted file mode 100644 index f0042590..00000000 --- a/desktop_version/lang/ca/meta.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - 1 - - - català - - - Traducció al català|d’Eduard Ereza Martínez - - - Prem Espai, Z o V per a seleccionar - - - Prem {button} per a seleccionar - - - 1 - - - 1 - - - 0 - - - 0 - - - 0 - - - [ {label} ] - [{label}] - - - font - diff --git a/desktop_version/lang/ca/numbers.xml b/desktop_version/lang/ca/numbers.xml deleted file mode 100644 index 5c97ddf2..00000000 --- a/desktop_version/lang/ca/numbers.xml +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/ca/roomnames.xml b/desktop_version/lang/ca/roomnames.xml deleted file mode 100644 index e51a2c70..00000000 --- a/desktop_version/lang/ca/roomnames.xml +++ /dev/null @@ -1,193 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/ca/roomnames_special.xml b/desktop_version/lang/ca/roomnames_special.xml deleted file mode 100644 index af82eb57..00000000 --- a/desktop_version/lang/ca/roomnames_special.xml +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/ca/strings.xml b/desktop_version/lang/ca/strings.xml deleted file mode 100644 index 29d89131..00000000 --- a/desktop_version/lang/ca/strings.xml +++ /dev/null @@ -1,811 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/ca/strings_plural.xml b/desktop_version/lang/ca/strings_plural.xml deleted file mode 100644 index 52633056..00000000 --- a/desktop_version/lang/ca/strings_plural.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/cy/cutscenes.xml b/desktop_version/lang/cy/cutscenes.xml deleted file mode 100644 index b0d15334..00000000 --- a/desktop_version/lang/cy/cutscenes.xml +++ /dev/null @@ -1,956 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/cy/graphics/flipsprites.png b/desktop_version/lang/cy/graphics/flipsprites.png deleted file mode 100644 index 5ab9a525..00000000 Binary files a/desktop_version/lang/cy/graphics/flipsprites.png and /dev/null differ diff --git a/desktop_version/lang/cy/graphics/sprites.png b/desktop_version/lang/cy/graphics/sprites.png deleted file mode 100644 index 8fa0f29c..00000000 Binary files a/desktop_version/lang/cy/graphics/sprites.png and /dev/null differ diff --git a/desktop_version/lang/cy/graphics/spritesmask.xml b/desktop_version/lang/cy/graphics/spritesmask.xml deleted file mode 100644 index 2b84a724..00000000 --- a/desktop_version/lang/cy/graphics/spritesmask.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/desktop_version/lang/cy/meta.xml b/desktop_version/lang/cy/meta.xml deleted file mode 100644 index d85d4341..00000000 --- a/desktop_version/lang/cy/meta.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - 1 - - - cymraeg - - - Cyfieithiad Cymraeg gan Morgan Roberts (ynchwarae) - - - Pwyso, Z, neu V i'w dewis - - - Pwyswch {button} i ddewis - - - 1 - - - 1 - - - 0 - - - 0 - - - 0 - - - [ {label} ] - [{label}] - - - font - diff --git a/desktop_version/lang/cy/numbers.xml b/desktop_version/lang/cy/numbers.xml deleted file mode 100644 index beda93b7..00000000 --- a/desktop_version/lang/cy/numbers.xml +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/cy/roomnames.xml b/desktop_version/lang/cy/roomnames.xml deleted file mode 100644 index 141a81ce..00000000 --- a/desktop_version/lang/cy/roomnames.xml +++ /dev/null @@ -1,193 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/cy/roomnames_special.xml b/desktop_version/lang/cy/roomnames_special.xml deleted file mode 100644 index ba0a9c89..00000000 --- a/desktop_version/lang/cy/roomnames_special.xml +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/cy/strings.xml b/desktop_version/lang/cy/strings.xml deleted file mode 100644 index d9aa1816..00000000 --- a/desktop_version/lang/cy/strings.xml +++ /dev/null @@ -1,811 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/cy/strings_plural.xml b/desktop_version/lang/cy/strings_plural.xml deleted file mode 100644 index bdb2e17b..00000000 --- a/desktop_version/lang/cy/strings_plural.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/de/cutscenes.xml b/desktop_version/lang/de/cutscenes.xml deleted file mode 100644 index cfd1d378..00000000 --- a/desktop_version/lang/de/cutscenes.xml +++ /dev/null @@ -1,948 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/de/graphics/flipsprites.png b/desktop_version/lang/de/graphics/flipsprites.png deleted file mode 100644 index d982610a..00000000 Binary files a/desktop_version/lang/de/graphics/flipsprites.png and /dev/null differ diff --git a/desktop_version/lang/de/graphics/sprites.png b/desktop_version/lang/de/graphics/sprites.png deleted file mode 100644 index c4f18cde..00000000 Binary files a/desktop_version/lang/de/graphics/sprites.png and /dev/null differ diff --git a/desktop_version/lang/de/graphics/spritesmask.xml b/desktop_version/lang/de/graphics/spritesmask.xml deleted file mode 100644 index 2b84a724..00000000 --- a/desktop_version/lang/de/graphics/spritesmask.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/desktop_version/lang/de/meta.xml b/desktop_version/lang/de/meta.xml deleted file mode 100644 index cc7237e2..00000000 --- a/desktop_version/lang/de/meta.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - 1 - - - deutsch - - - Deutsche Übersetzung von Thomas Faust - - - Mit Leertaste, Z oder V auswählen - - - Mit {button} auswählen - - - 1 - - - 1 - - - 0 - - - 0 - - - 0 - - - [ {label} ] - [{label}] - - - font - diff --git a/desktop_version/lang/de/numbers.xml b/desktop_version/lang/de/numbers.xml deleted file mode 100644 index cf83add7..00000000 --- a/desktop_version/lang/de/numbers.xml +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/de/roomnames.xml b/desktop_version/lang/de/roomnames.xml deleted file mode 100644 index ba4bdc8d..00000000 --- a/desktop_version/lang/de/roomnames.xml +++ /dev/null @@ -1,193 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/de/roomnames_special.xml b/desktop_version/lang/de/roomnames_special.xml deleted file mode 100644 index dafe13b8..00000000 --- a/desktop_version/lang/de/roomnames_special.xml +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/de/strings.xml b/desktop_version/lang/de/strings.xml deleted file mode 100644 index 979aaad6..00000000 --- a/desktop_version/lang/de/strings.xml +++ /dev/null @@ -1,811 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/de/strings_plural.xml b/desktop_version/lang/de/strings_plural.xml deleted file mode 100644 index 19b917eb..00000000 --- a/desktop_version/lang/de/strings_plural.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/en/cutscenes.xml b/desktop_version/lang/en/cutscenes.xml deleted file mode 100644 index a1f873b8..00000000 --- a/desktop_version/lang/en/cutscenes.xml +++ /dev/null @@ -1,901 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/en/meta.xml b/desktop_version/lang/en/meta.xml deleted file mode 100644 index ef4fd119..00000000 --- a/desktop_version/lang/en/meta.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - 1 - - - english - - - - - - Press Space, Z, or V to select - - - Press {button} to select - - - 1 - - - 1 - - - 0 - - - 0 - - - 0 - - - [ {label} ] - [{label}] - - - font - diff --git a/desktop_version/lang/en/numbers.xml b/desktop_version/lang/en/numbers.xml deleted file mode 100644 index 00e1b8e3..00000000 --- a/desktop_version/lang/en/numbers.xml +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/en/roomnames.xml b/desktop_version/lang/en/roomnames.xml deleted file mode 100644 index 026430c6..00000000 --- a/desktop_version/lang/en/roomnames.xml +++ /dev/null @@ -1,193 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/en/roomnames_special.xml b/desktop_version/lang/en/roomnames_special.xml deleted file mode 100644 index c6850aad..00000000 --- a/desktop_version/lang/en/roomnames_special.xml +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/en/strings.xml b/desktop_version/lang/en/strings.xml deleted file mode 100644 index 45154fc9..00000000 --- a/desktop_version/lang/en/strings.xml +++ /dev/null @@ -1,805 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/en/strings_plural.xml b/desktop_version/lang/en/strings_plural.xml deleted file mode 100644 index d3db853a..00000000 --- a/desktop_version/lang/en/strings_plural.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/eo/cutscenes.xml b/desktop_version/lang/eo/cutscenes.xml deleted file mode 100644 index bd4b41f9..00000000 --- a/desktop_version/lang/eo/cutscenes.xml +++ /dev/null @@ -1,948 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/eo/graphics/flipsprites.png b/desktop_version/lang/eo/graphics/flipsprites.png deleted file mode 100644 index fa905b75..00000000 Binary files a/desktop_version/lang/eo/graphics/flipsprites.png and /dev/null differ diff --git a/desktop_version/lang/eo/graphics/sprites.png b/desktop_version/lang/eo/graphics/sprites.png deleted file mode 100644 index 759293d2..00000000 Binary files a/desktop_version/lang/eo/graphics/sprites.png and /dev/null differ diff --git a/desktop_version/lang/eo/graphics/spritesmask.xml b/desktop_version/lang/eo/graphics/spritesmask.xml deleted file mode 100644 index 57b33a7e..00000000 --- a/desktop_version/lang/eo/graphics/spritesmask.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/desktop_version/lang/eo/meta.xml b/desktop_version/lang/eo/meta.xml deleted file mode 100644 index 1ca5af07..00000000 --- a/desktop_version/lang/eo/meta.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - 1 - - - esperanto - - - Esperanta traduko de Reese Rivers - - - Premu spaceton, Z aŭ V por elekti - - - Premu {button} por elekti - - - 1 - - - 1 - - - 0 - - - 0 - - - 0 - - - [ {label} ] - [{label}] - - - font - diff --git a/desktop_version/lang/eo/numbers.xml b/desktop_version/lang/eo/numbers.xml deleted file mode 100644 index a8fdd420..00000000 --- a/desktop_version/lang/eo/numbers.xml +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/eo/roomnames.xml b/desktop_version/lang/eo/roomnames.xml deleted file mode 100644 index 83ba9a86..00000000 --- a/desktop_version/lang/eo/roomnames.xml +++ /dev/null @@ -1,193 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/eo/roomnames_special.xml b/desktop_version/lang/eo/roomnames_special.xml deleted file mode 100644 index ea4fe555..00000000 --- a/desktop_version/lang/eo/roomnames_special.xml +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/eo/strings.xml b/desktop_version/lang/eo/strings.xml deleted file mode 100644 index 735fe1e7..00000000 --- a/desktop_version/lang/eo/strings.xml +++ /dev/null @@ -1,811 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/eo/strings_plural.xml b/desktop_version/lang/eo/strings_plural.xml deleted file mode 100644 index 52a1bf4d..00000000 --- a/desktop_version/lang/eo/strings_plural.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/es/cutscenes.xml b/desktop_version/lang/es/cutscenes.xml deleted file mode 100644 index ec7144eb..00000000 --- a/desktop_version/lang/es/cutscenes.xml +++ /dev/null @@ -1,948 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/es/graphics/flipsprites.png b/desktop_version/lang/es/graphics/flipsprites.png deleted file mode 100644 index 606e3bd5..00000000 Binary files a/desktop_version/lang/es/graphics/flipsprites.png and /dev/null differ diff --git a/desktop_version/lang/es/graphics/sprites.png b/desktop_version/lang/es/graphics/sprites.png deleted file mode 100644 index 7687c985..00000000 Binary files a/desktop_version/lang/es/graphics/sprites.png and /dev/null differ diff --git a/desktop_version/lang/es/graphics/spritesmask.xml b/desktop_version/lang/es/graphics/spritesmask.xml deleted file mode 100644 index 2b84a724..00000000 --- a/desktop_version/lang/es/graphics/spritesmask.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/desktop_version/lang/es/meta.xml b/desktop_version/lang/es/meta.xml deleted file mode 100644 index 2c805b1d..00000000 --- a/desktop_version/lang/es/meta.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - 1 - - - español (es) - - - Traducción al español de Felipe Mercader y Sara Marín - - - Pulsa Espacio, Z, o V para seleccionar - - - Pulsa {button} para seleccionar - - - 1 - - - 1 - - - 0 - - - 0 - - - 0 - - - [ {label} ] - [{label}] - - - font - diff --git a/desktop_version/lang/es/numbers.xml b/desktop_version/lang/es/numbers.xml deleted file mode 100644 index dd1de8e0..00000000 --- a/desktop_version/lang/es/numbers.xml +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/es/roomnames.xml b/desktop_version/lang/es/roomnames.xml deleted file mode 100644 index bd131750..00000000 --- a/desktop_version/lang/es/roomnames.xml +++ /dev/null @@ -1,193 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/es/roomnames_special.xml b/desktop_version/lang/es/roomnames_special.xml deleted file mode 100644 index 3d8b54d4..00000000 --- a/desktop_version/lang/es/roomnames_special.xml +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/es/strings.xml b/desktop_version/lang/es/strings.xml deleted file mode 100644 index 4ad7b06c..00000000 --- a/desktop_version/lang/es/strings.xml +++ /dev/null @@ -1,811 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/es/strings_plural.xml b/desktop_version/lang/es/strings_plural.xml deleted file mode 100644 index c84c36d6..00000000 --- a/desktop_version/lang/es/strings_plural.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/es_419/cutscenes.xml b/desktop_version/lang/es_419/cutscenes.xml deleted file mode 100644 index aa2aafc8..00000000 --- a/desktop_version/lang/es_419/cutscenes.xml +++ /dev/null @@ -1,948 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/es_419/graphics/flipsprites.png b/desktop_version/lang/es_419/graphics/flipsprites.png deleted file mode 100644 index 606e3bd5..00000000 Binary files a/desktop_version/lang/es_419/graphics/flipsprites.png and /dev/null differ diff --git a/desktop_version/lang/es_419/graphics/sprites.png b/desktop_version/lang/es_419/graphics/sprites.png deleted file mode 100644 index 7687c985..00000000 Binary files a/desktop_version/lang/es_419/graphics/sprites.png and /dev/null differ diff --git a/desktop_version/lang/es_419/graphics/spritesmask.xml b/desktop_version/lang/es_419/graphics/spritesmask.xml deleted file mode 100644 index 2b84a724..00000000 --- a/desktop_version/lang/es_419/graphics/spritesmask.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/desktop_version/lang/es_419/meta.xml b/desktop_version/lang/es_419/meta.xml deleted file mode 100644 index cde0719d..00000000 --- a/desktop_version/lang/es_419/meta.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - 1 - - - español (latam) - - - Traducción al español de Latinoamérica por Guido Di Carlo - - - Pulsa Espacio, Z, o V para seleccionar - - - Pulsa {button} para seleccionar - - - 1 - - - 1 - - - 0 - - - 0 - - - 0 - - - [ {label} ] - [{label}] - - - font - diff --git a/desktop_version/lang/es_419/numbers.xml b/desktop_version/lang/es_419/numbers.xml deleted file mode 100644 index dd1de8e0..00000000 --- a/desktop_version/lang/es_419/numbers.xml +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/es_419/roomnames.xml b/desktop_version/lang/es_419/roomnames.xml deleted file mode 100644 index a9f452d0..00000000 --- a/desktop_version/lang/es_419/roomnames.xml +++ /dev/null @@ -1,193 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/es_419/roomnames_special.xml b/desktop_version/lang/es_419/roomnames_special.xml deleted file mode 100644 index efb8ddac..00000000 --- a/desktop_version/lang/es_419/roomnames_special.xml +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/es_419/strings.xml b/desktop_version/lang/es_419/strings.xml deleted file mode 100644 index 5c316b44..00000000 --- a/desktop_version/lang/es_419/strings.xml +++ /dev/null @@ -1,811 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/es_419/strings_plural.xml b/desktop_version/lang/es_419/strings_plural.xml deleted file mode 100644 index 1facc8f9..00000000 --- a/desktop_version/lang/es_419/strings_plural.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/es_AR/cutscenes.xml b/desktop_version/lang/es_AR/cutscenes.xml deleted file mode 100644 index 379ff952..00000000 --- a/desktop_version/lang/es_AR/cutscenes.xml +++ /dev/null @@ -1,948 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/es_AR/graphics/flipsprites.png b/desktop_version/lang/es_AR/graphics/flipsprites.png deleted file mode 100644 index 606e3bd5..00000000 Binary files a/desktop_version/lang/es_AR/graphics/flipsprites.png and /dev/null differ diff --git a/desktop_version/lang/es_AR/graphics/sprites.png b/desktop_version/lang/es_AR/graphics/sprites.png deleted file mode 100644 index 7687c985..00000000 Binary files a/desktop_version/lang/es_AR/graphics/sprites.png and /dev/null differ diff --git a/desktop_version/lang/es_AR/graphics/spritesmask.xml b/desktop_version/lang/es_AR/graphics/spritesmask.xml deleted file mode 100644 index 2b84a724..00000000 --- a/desktop_version/lang/es_AR/graphics/spritesmask.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/desktop_version/lang/es_AR/meta.xml b/desktop_version/lang/es_AR/meta.xml deleted file mode 100644 index 0669cb5d..00000000 --- a/desktop_version/lang/es_AR/meta.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - 1 - - - español (arg.) - - - Traducción al español de Argentina por Guido Di Carlo - - - Apretá Espacio, Z, o V para seleccionar - - - Apretá {button} para seleccionar - - - 1 - - - 1 - - - 0 - - - 0 - - - 0 - - - [ {label} ] - [{label}] - - - font - diff --git a/desktop_version/lang/es_AR/numbers.xml b/desktop_version/lang/es_AR/numbers.xml deleted file mode 100644 index dd1de8e0..00000000 --- a/desktop_version/lang/es_AR/numbers.xml +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/es_AR/roomnames.xml b/desktop_version/lang/es_AR/roomnames.xml deleted file mode 100644 index 518fe747..00000000 --- a/desktop_version/lang/es_AR/roomnames.xml +++ /dev/null @@ -1,193 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/es_AR/roomnames_special.xml b/desktop_version/lang/es_AR/roomnames_special.xml deleted file mode 100644 index 5186b1a6..00000000 --- a/desktop_version/lang/es_AR/roomnames_special.xml +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/es_AR/strings.xml b/desktop_version/lang/es_AR/strings.xml deleted file mode 100644 index 66d225b2..00000000 --- a/desktop_version/lang/es_AR/strings.xml +++ /dev/null @@ -1,811 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/es_AR/strings_plural.xml b/desktop_version/lang/es_AR/strings_plural.xml deleted file mode 100644 index 485e5a10..00000000 --- a/desktop_version/lang/es_AR/strings_plural.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/fa/cutscenes.xml b/desktop_version/lang/fa/cutscenes.xml deleted file mode 100644 index 0bae1ffd..00000000 --- a/desktop_version/lang/fa/cutscenes.xml +++ /dev/null @@ -1,944 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/fa/graphics/flipsprites.png b/desktop_version/lang/fa/graphics/flipsprites.png deleted file mode 100644 index d8c893e0..00000000 Binary files a/desktop_version/lang/fa/graphics/flipsprites.png and /dev/null differ diff --git a/desktop_version/lang/fa/graphics/sprites.png b/desktop_version/lang/fa/graphics/sprites.png deleted file mode 100644 index e8d9f564..00000000 Binary files a/desktop_version/lang/fa/graphics/sprites.png and /dev/null differ diff --git a/desktop_version/lang/fa/graphics/spritesmask.xml b/desktop_version/lang/fa/graphics/spritesmask.xml deleted file mode 100644 index 57b33a7e..00000000 --- a/desktop_version/lang/fa/graphics/spritesmask.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/desktop_version/lang/fa/meta.xml b/desktop_version/lang/fa/meta.xml deleted file mode 100644 index 1ee34692..00000000 --- a/desktop_version/lang/fa/meta.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - 1 - - - فارسی - - - Persian Localization: Amir Arzani & Masoud Varaste - - - برای انتخاب روی اسپیس، Z، یا V بزن - - - برای انتخاب روی {button} بزن - - - 1 - - - 1 - - - 0 - - - 0 - - - 1 - - - [ {label} ] - [{label}] - - - font_ar - diff --git a/desktop_version/lang/fa/numbers.xml b/desktop_version/lang/fa/numbers.xml deleted file mode 100644 index 705ecdce..00000000 --- a/desktop_version/lang/fa/numbers.xml +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/fa/roomnames.xml b/desktop_version/lang/fa/roomnames.xml deleted file mode 100644 index e7fdc0a8..00000000 --- a/desktop_version/lang/fa/roomnames.xml +++ /dev/null @@ -1,193 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/fa/roomnames_special.xml b/desktop_version/lang/fa/roomnames_special.xml deleted file mode 100644 index 0bdf5cfa..00000000 --- a/desktop_version/lang/fa/roomnames_special.xml +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/fa/strings.xml b/desktop_version/lang/fa/strings.xml deleted file mode 100644 index d81835a8..00000000 --- a/desktop_version/lang/fa/strings.xml +++ /dev/null @@ -1,811 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/fa/strings_plural.xml b/desktop_version/lang/fa/strings_plural.xml deleted file mode 100644 index 4dff7b4f..00000000 --- a/desktop_version/lang/fa/strings_plural.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/fr/cutscenes.xml b/desktop_version/lang/fr/cutscenes.xml deleted file mode 100644 index 45e574ef..00000000 --- a/desktop_version/lang/fr/cutscenes.xml +++ /dev/null @@ -1,949 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/fr/graphics/flipsprites.png b/desktop_version/lang/fr/graphics/flipsprites.png deleted file mode 100644 index 880b0f1e..00000000 Binary files a/desktop_version/lang/fr/graphics/flipsprites.png and /dev/null differ diff --git a/desktop_version/lang/fr/graphics/sprites.png b/desktop_version/lang/fr/graphics/sprites.png deleted file mode 100644 index a15db762..00000000 Binary files a/desktop_version/lang/fr/graphics/sprites.png and /dev/null differ diff --git a/desktop_version/lang/fr/graphics/spritesmask.xml b/desktop_version/lang/fr/graphics/spritesmask.xml deleted file mode 100644 index 2b84a724..00000000 --- a/desktop_version/lang/fr/graphics/spritesmask.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/desktop_version/lang/fr/meta.xml b/desktop_version/lang/fr/meta.xml deleted file mode 100644 index e34d568b..00000000 --- a/desktop_version/lang/fr/meta.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - 1 - - - français - - - Traduction française par|Words of Magic - - - Espace, Z ou V pour sélectionner - - - {button} pour sélectionner - - - 1 - - - 1 - - - 0 - - - 0 - - - 0 - - - [ {label} ] - [{label}] - - - font - diff --git a/desktop_version/lang/fr/numbers.xml b/desktop_version/lang/fr/numbers.xml deleted file mode 100644 index 954c247d..00000000 --- a/desktop_version/lang/fr/numbers.xml +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/fr/roomnames.xml b/desktop_version/lang/fr/roomnames.xml deleted file mode 100644 index 59561383..00000000 --- a/desktop_version/lang/fr/roomnames.xml +++ /dev/null @@ -1,193 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/fr/roomnames_special.xml b/desktop_version/lang/fr/roomnames_special.xml deleted file mode 100644 index b8a940c9..00000000 --- a/desktop_version/lang/fr/roomnames_special.xml +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/fr/strings.xml b/desktop_version/lang/fr/strings.xml deleted file mode 100644 index 8cfd849f..00000000 --- a/desktop_version/lang/fr/strings.xml +++ /dev/null @@ -1,811 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/fr/strings_plural.xml b/desktop_version/lang/fr/strings_plural.xml deleted file mode 100644 index 2d2e5f28..00000000 --- a/desktop_version/lang/fr/strings_plural.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/ga/cutscenes.xml b/desktop_version/lang/ga/cutscenes.xml deleted file mode 100644 index f2430912..00000000 --- a/desktop_version/lang/ga/cutscenes.xml +++ /dev/null @@ -1,947 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/ga/graphics/flipsprites.png b/desktop_version/lang/ga/graphics/flipsprites.png deleted file mode 100644 index bd737dc9..00000000 Binary files a/desktop_version/lang/ga/graphics/flipsprites.png and /dev/null differ diff --git a/desktop_version/lang/ga/graphics/sprites.png b/desktop_version/lang/ga/graphics/sprites.png deleted file mode 100644 index 18100da6..00000000 Binary files a/desktop_version/lang/ga/graphics/sprites.png and /dev/null differ diff --git a/desktop_version/lang/ga/graphics/spritesmask.xml b/desktop_version/lang/ga/graphics/spritesmask.xml deleted file mode 100644 index 5f1bca41..00000000 --- a/desktop_version/lang/ga/graphics/spritesmask.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/desktop_version/lang/ga/meta.xml b/desktop_version/lang/ga/meta.xml deleted file mode 100644 index 4edd5dab..00000000 --- a/desktop_version/lang/ga/meta.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - 1 - - - gaeilge - - - Úna-Minh Kavanagh, Seaghán Ó Modhráin, Davis Sandefur - - - Brúigh Space nó Z nó V chun roghnú - - - Brúigh {button} lena roghnú - - - 1 - - - 1 - - - 0 - - - 1 - - - 0 - - - [ {label} ] - [{label}] - - - font - diff --git a/desktop_version/lang/ga/numbers.xml b/desktop_version/lang/ga/numbers.xml deleted file mode 100644 index 5732980b..00000000 --- a/desktop_version/lang/ga/numbers.xml +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/ga/roomnames.xml b/desktop_version/lang/ga/roomnames.xml deleted file mode 100644 index 02411416..00000000 --- a/desktop_version/lang/ga/roomnames.xml +++ /dev/null @@ -1,193 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/ga/roomnames_special.xml b/desktop_version/lang/ga/roomnames_special.xml deleted file mode 100644 index fa0498fe..00000000 --- a/desktop_version/lang/ga/roomnames_special.xml +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/ga/strings.xml b/desktop_version/lang/ga/strings.xml deleted file mode 100644 index 625d9d6e..00000000 --- a/desktop_version/lang/ga/strings.xml +++ /dev/null @@ -1,813 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/ga/strings_plural.xml b/desktop_version/lang/ga/strings_plural.xml deleted file mode 100644 index d5529dd8..00000000 --- a/desktop_version/lang/ga/strings_plural.xml +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/it/cutscenes.xml b/desktop_version/lang/it/cutscenes.xml deleted file mode 100644 index 59bb352c..00000000 --- a/desktop_version/lang/it/cutscenes.xml +++ /dev/null @@ -1,948 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/it/graphics/flipsprites.png b/desktop_version/lang/it/graphics/flipsprites.png deleted file mode 100644 index d14c050a..00000000 Binary files a/desktop_version/lang/it/graphics/flipsprites.png and /dev/null differ diff --git a/desktop_version/lang/it/graphics/sprites.png b/desktop_version/lang/it/graphics/sprites.png deleted file mode 100644 index 4fdd607c..00000000 Binary files a/desktop_version/lang/it/graphics/sprites.png and /dev/null differ diff --git a/desktop_version/lang/it/graphics/spritesmask.xml b/desktop_version/lang/it/graphics/spritesmask.xml deleted file mode 100644 index 2b84a724..00000000 --- a/desktop_version/lang/it/graphics/spritesmask.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/desktop_version/lang/it/meta.xml b/desktop_version/lang/it/meta.xml deleted file mode 100644 index f0777d6d..00000000 --- a/desktop_version/lang/it/meta.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - 1 - - - italiano - - - Di A. Dellepiane, M. Scarabelli, L. Bertolucci e F. Bortolotti - - - Premi spazio, Z o V per selezionare - - - Premi {button} per selezione - - - 1 - - - 1 - - - 0 - - - 0 - - - 0 - - - [ {label} ] - [{label}] - - - font - diff --git a/desktop_version/lang/it/numbers.xml b/desktop_version/lang/it/numbers.xml deleted file mode 100644 index 9f5645f1..00000000 --- a/desktop_version/lang/it/numbers.xml +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/it/roomnames.xml b/desktop_version/lang/it/roomnames.xml deleted file mode 100644 index 26b16741..00000000 --- a/desktop_version/lang/it/roomnames.xml +++ /dev/null @@ -1,193 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/it/roomnames_special.xml b/desktop_version/lang/it/roomnames_special.xml deleted file mode 100644 index c5180050..00000000 --- a/desktop_version/lang/it/roomnames_special.xml +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/it/strings.xml b/desktop_version/lang/it/strings.xml deleted file mode 100644 index 5075f520..00000000 --- a/desktop_version/lang/it/strings.xml +++ /dev/null @@ -1,811 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/it/strings_plural.xml b/desktop_version/lang/it/strings_plural.xml deleted file mode 100644 index f85da078..00000000 --- a/desktop_version/lang/it/strings_plural.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/ja/cutscenes.xml b/desktop_version/lang/ja/cutscenes.xml deleted file mode 100644 index 86cdd5b5..00000000 --- a/desktop_version/lang/ja/cutscenes.xml +++ /dev/null @@ -1,1330 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/ja/graphics/flipsprites.png b/desktop_version/lang/ja/graphics/flipsprites.png deleted file mode 100644 index 053c05ba..00000000 Binary files a/desktop_version/lang/ja/graphics/flipsprites.png and /dev/null differ diff --git a/desktop_version/lang/ja/graphics/sprites.png b/desktop_version/lang/ja/graphics/sprites.png deleted file mode 100644 index ea867f28..00000000 Binary files a/desktop_version/lang/ja/graphics/sprites.png and /dev/null differ diff --git a/desktop_version/lang/ja/graphics/spritesmask.xml b/desktop_version/lang/ja/graphics/spritesmask.xml deleted file mode 100644 index 49c7ee23..00000000 --- a/desktop_version/lang/ja/graphics/spritesmask.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/desktop_version/lang/ja/meta.xml b/desktop_version/lang/ja/meta.xml deleted file mode 100644 index c9e7b35f..00000000 --- a/desktop_version/lang/ja/meta.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - 1 - - - 日本語 - - - 初版翻訳: Nicalis, Inc. -追加翻訳/校正: KabanFriends - - - スペース, Z または V を押して決定 - - - {button} を押して決定 - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - [ {label} ] - [{label}] - - - font_ja - diff --git a/desktop_version/lang/ja/numbers.xml b/desktop_version/lang/ja/numbers.xml deleted file mode 100644 index 65350359..00000000 --- a/desktop_version/lang/ja/numbers.xml +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/ja/roomnames.xml b/desktop_version/lang/ja/roomnames.xml deleted file mode 100644 index 743a6d6f..00000000 --- a/desktop_version/lang/ja/roomnames.xml +++ /dev/null @@ -1,193 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/ja/roomnames_special.xml b/desktop_version/lang/ja/roomnames_special.xml deleted file mode 100644 index 42333598..00000000 --- a/desktop_version/lang/ja/roomnames_special.xml +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/ja/strings.xml b/desktop_version/lang/ja/strings.xml deleted file mode 100644 index 166d1b58..00000000 --- a/desktop_version/lang/ja/strings.xml +++ /dev/null @@ -1,877 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/ja/strings_plural.xml b/desktop_version/lang/ja/strings_plural.xml deleted file mode 100644 index 7178ec0f..00000000 --- a/desktop_version/lang/ja/strings_plural.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/ko/cutscenes.xml b/desktop_version/lang/ko/cutscenes.xml deleted file mode 100755 index aca2b6e6..00000000 --- a/desktop_version/lang/ko/cutscenes.xml +++ /dev/null @@ -1,948 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/ko/graphics/flipsprites.png b/desktop_version/lang/ko/graphics/flipsprites.png deleted file mode 100644 index 2cb1e46e..00000000 Binary files a/desktop_version/lang/ko/graphics/flipsprites.png and /dev/null differ diff --git a/desktop_version/lang/ko/graphics/sprites.png b/desktop_version/lang/ko/graphics/sprites.png deleted file mode 100644 index 6d5cbb20..00000000 Binary files a/desktop_version/lang/ko/graphics/sprites.png and /dev/null differ diff --git a/desktop_version/lang/ko/graphics/spritesmask.xml b/desktop_version/lang/ko/graphics/spritesmask.xml deleted file mode 100644 index a3707f79..00000000 --- a/desktop_version/lang/ko/graphics/spritesmask.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/desktop_version/lang/ko/meta.xml b/desktop_version/lang/ko/meta.xml deleted file mode 100644 index f18ef7a3..00000000 --- a/desktop_version/lang/ko/meta.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - 1 - - - 한국어 - - - 번역: Bada Im, Hyungseok Cho - - - 스페이스 바, Z, V를 눌러 선택 - - - {button} 버튼을 눌러 선택 - - - 1 - - - 0 - - - 0 - - - 0 - - - 0 - - - [ {label} ] - [{label}] - - - font_ko - diff --git a/desktop_version/lang/ko/numbers.xml b/desktop_version/lang/ko/numbers.xml deleted file mode 100755 index 65350359..00000000 --- a/desktop_version/lang/ko/numbers.xml +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/ko/roomnames.xml b/desktop_version/lang/ko/roomnames.xml deleted file mode 100755 index ab60a491..00000000 --- a/desktop_version/lang/ko/roomnames.xml +++ /dev/null @@ -1,193 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/ko/roomnames_special.xml b/desktop_version/lang/ko/roomnames_special.xml deleted file mode 100755 index e5b82569..00000000 --- a/desktop_version/lang/ko/roomnames_special.xml +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/ko/strings.xml b/desktop_version/lang/ko/strings.xml deleted file mode 100755 index 9d47d4ec..00000000 --- a/desktop_version/lang/ko/strings.xml +++ /dev/null @@ -1,811 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/ko/strings_plural.xml b/desktop_version/lang/ko/strings_plural.xml deleted file mode 100755 index f0810b79..00000000 --- a/desktop_version/lang/ko/strings_plural.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/nl/cutscenes.xml b/desktop_version/lang/nl/cutscenes.xml deleted file mode 100644 index c4a8e466..00000000 --- a/desktop_version/lang/nl/cutscenes.xml +++ /dev/null @@ -1,948 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/nl/graphics/flipsprites.png b/desktop_version/lang/nl/graphics/flipsprites.png deleted file mode 100644 index 2cb16e04..00000000 Binary files a/desktop_version/lang/nl/graphics/flipsprites.png and /dev/null differ diff --git a/desktop_version/lang/nl/graphics/sprites.png b/desktop_version/lang/nl/graphics/sprites.png deleted file mode 100644 index 1072614b..00000000 Binary files a/desktop_version/lang/nl/graphics/sprites.png and /dev/null differ diff --git a/desktop_version/lang/nl/graphics/spritesmask.xml b/desktop_version/lang/nl/graphics/spritesmask.xml deleted file mode 100644 index 234b74e5..00000000 --- a/desktop_version/lang/nl/graphics/spritesmask.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/desktop_version/lang/nl/meta.xml b/desktop_version/lang/nl/meta.xml deleted file mode 100644 index 529d1307..00000000 --- a/desktop_version/lang/nl/meta.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - 1 - - - nederlands - - - Nederlandse vertaling door Dav999 - - - Druk op spatie, Z, of V om te kiezen - - - Druk op {button} om te kiezen - - - 1 - - - 1 - - - 0 - - - 0 - - - 0 - - - [ {label} ] - [{label}] - - - font - diff --git a/desktop_version/lang/nl/numbers.xml b/desktop_version/lang/nl/numbers.xml deleted file mode 100644 index f0bce780..00000000 --- a/desktop_version/lang/nl/numbers.xml +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/nl/roomnames.xml b/desktop_version/lang/nl/roomnames.xml deleted file mode 100644 index 81f8cd08..00000000 --- a/desktop_version/lang/nl/roomnames.xml +++ /dev/null @@ -1,193 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/nl/roomnames_special.xml b/desktop_version/lang/nl/roomnames_special.xml deleted file mode 100644 index 15773219..00000000 --- a/desktop_version/lang/nl/roomnames_special.xml +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/nl/strings.xml b/desktop_version/lang/nl/strings.xml deleted file mode 100644 index 4dd6a972..00000000 --- a/desktop_version/lang/nl/strings.xml +++ /dev/null @@ -1,812 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/nl/strings_plural.xml b/desktop_version/lang/nl/strings_plural.xml deleted file mode 100644 index 27be6255..00000000 --- a/desktop_version/lang/nl/strings_plural.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/pl/cutscenes.xml b/desktop_version/lang/pl/cutscenes.xml deleted file mode 100644 index 57c7ae3b..00000000 --- a/desktop_version/lang/pl/cutscenes.xml +++ /dev/null @@ -1,956 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/pl/graphics/flipsprites.png b/desktop_version/lang/pl/graphics/flipsprites.png deleted file mode 100644 index d2e966b3..00000000 Binary files a/desktop_version/lang/pl/graphics/flipsprites.png and /dev/null differ diff --git a/desktop_version/lang/pl/graphics/sprites.png b/desktop_version/lang/pl/graphics/sprites.png deleted file mode 100644 index c4447faa..00000000 Binary files a/desktop_version/lang/pl/graphics/sprites.png and /dev/null differ diff --git a/desktop_version/lang/pl/graphics/spritesmask.xml b/desktop_version/lang/pl/graphics/spritesmask.xml deleted file mode 100644 index 5f1bca41..00000000 --- a/desktop_version/lang/pl/graphics/spritesmask.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/desktop_version/lang/pl/meta.xml b/desktop_version/lang/pl/meta.xml deleted file mode 100644 index ae15300a..00000000 --- a/desktop_version/lang/pl/meta.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - 1 - - - polski - - - Polskie tłumaczenie: Kuba Kallus - - - Wciśnij Spację, Z, lub V by wybrać - - - Wciśnij {button} by wybrać - - - 1 - - - 1 - - - 0 - - - 0 - - - 0 - - - [ {label} ] - [{label}] - - - font - diff --git a/desktop_version/lang/pl/numbers.xml b/desktop_version/lang/pl/numbers.xml deleted file mode 100644 index 2f3f0510..00000000 --- a/desktop_version/lang/pl/numbers.xml +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/pl/roomnames.xml b/desktop_version/lang/pl/roomnames.xml deleted file mode 100644 index 0ea8a099..00000000 --- a/desktop_version/lang/pl/roomnames.xml +++ /dev/null @@ -1,193 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/pl/roomnames_special.xml b/desktop_version/lang/pl/roomnames_special.xml deleted file mode 100644 index 04aad40f..00000000 --- a/desktop_version/lang/pl/roomnames_special.xml +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/pl/strings.xml b/desktop_version/lang/pl/strings.xml deleted file mode 100644 index c0c44798..00000000 --- a/desktop_version/lang/pl/strings.xml +++ /dev/null @@ -1,811 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/pl/strings_plural.xml b/desktop_version/lang/pl/strings_plural.xml deleted file mode 100644 index a9972ac9..00000000 --- a/desktop_version/lang/pl/strings_plural.xml +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/pt_BR/cutscenes.xml b/desktop_version/lang/pt_BR/cutscenes.xml deleted file mode 100644 index 39d8a94c..00000000 --- a/desktop_version/lang/pt_BR/cutscenes.xml +++ /dev/null @@ -1,948 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/pt_BR/graphics/flipsprites.png b/desktop_version/lang/pt_BR/graphics/flipsprites.png deleted file mode 100644 index b21eaf3b..00000000 Binary files a/desktop_version/lang/pt_BR/graphics/flipsprites.png and /dev/null differ diff --git a/desktop_version/lang/pt_BR/graphics/sprites.png b/desktop_version/lang/pt_BR/graphics/sprites.png deleted file mode 100644 index 136f1de4..00000000 Binary files a/desktop_version/lang/pt_BR/graphics/sprites.png and /dev/null differ diff --git a/desktop_version/lang/pt_BR/graphics/spritesmask.xml b/desktop_version/lang/pt_BR/graphics/spritesmask.xml deleted file mode 100644 index a3707f79..00000000 --- a/desktop_version/lang/pt_BR/graphics/spritesmask.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/desktop_version/lang/pt_BR/meta.xml b/desktop_version/lang/pt_BR/meta.xml deleted file mode 100644 index 72877901..00000000 --- a/desktop_version/lang/pt_BR/meta.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - 1 - - - português (br) - - - Lucas Araujo e Thiago Araujo|Ivan Lopes e Lucas Nunes - - - Pressione Espaço, Z ou V para selecionar - - - Pressione {button} para selecionar - - - 1 - - - 1 - - - 0 - - - 0 - - - 0 - - - [ {label} ] - [{label}] - - - font - diff --git a/desktop_version/lang/pt_BR/numbers.xml b/desktop_version/lang/pt_BR/numbers.xml deleted file mode 100644 index 6f686092..00000000 --- a/desktop_version/lang/pt_BR/numbers.xml +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/pt_BR/roomnames.xml b/desktop_version/lang/pt_BR/roomnames.xml deleted file mode 100644 index ae2964cb..00000000 --- a/desktop_version/lang/pt_BR/roomnames.xml +++ /dev/null @@ -1,193 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/pt_BR/roomnames_special.xml b/desktop_version/lang/pt_BR/roomnames_special.xml deleted file mode 100644 index 942feea7..00000000 --- a/desktop_version/lang/pt_BR/roomnames_special.xml +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/pt_BR/strings.xml b/desktop_version/lang/pt_BR/strings.xml deleted file mode 100644 index 1a01283f..00000000 --- a/desktop_version/lang/pt_BR/strings.xml +++ /dev/null @@ -1,811 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/pt_BR/strings_plural.xml b/desktop_version/lang/pt_BR/strings_plural.xml deleted file mode 100644 index 0c2add4a..00000000 --- a/desktop_version/lang/pt_BR/strings_plural.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/pt_PT/cutscenes.xml b/desktop_version/lang/pt_PT/cutscenes.xml deleted file mode 100644 index 63169dc1..00000000 --- a/desktop_version/lang/pt_PT/cutscenes.xml +++ /dev/null @@ -1,948 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/pt_PT/graphics/flipsprites.png b/desktop_version/lang/pt_PT/graphics/flipsprites.png deleted file mode 100644 index 2792a1bc..00000000 Binary files a/desktop_version/lang/pt_PT/graphics/flipsprites.png and /dev/null differ diff --git a/desktop_version/lang/pt_PT/graphics/sprites.png b/desktop_version/lang/pt_PT/graphics/sprites.png deleted file mode 100644 index 4c01c3db..00000000 Binary files a/desktop_version/lang/pt_PT/graphics/sprites.png and /dev/null differ diff --git a/desktop_version/lang/pt_PT/graphics/spritesmask.xml b/desktop_version/lang/pt_PT/graphics/spritesmask.xml deleted file mode 100644 index 2b84a724..00000000 --- a/desktop_version/lang/pt_PT/graphics/spritesmask.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/desktop_version/lang/pt_PT/meta.xml b/desktop_version/lang/pt_PT/meta.xml deleted file mode 100644 index 41d2532a..00000000 --- a/desktop_version/lang/pt_PT/meta.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - 1 - - - português (pt) - - - Adaptação portuguesa por Locsmiths - - - Seleciona com Barra de Espaços, Z ou V - - - Seleciona com {button} - - - 1 - - - 1 - - - 0 - - - 0 - - - 0 - - - [ {label} ] - [{label}] - - - font - diff --git a/desktop_version/lang/pt_PT/numbers.xml b/desktop_version/lang/pt_PT/numbers.xml deleted file mode 100644 index 00e1b8e3..00000000 --- a/desktop_version/lang/pt_PT/numbers.xml +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/pt_PT/roomnames.xml b/desktop_version/lang/pt_PT/roomnames.xml deleted file mode 100644 index bec3349b..00000000 --- a/desktop_version/lang/pt_PT/roomnames.xml +++ /dev/null @@ -1,193 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/pt_PT/roomnames_special.xml b/desktop_version/lang/pt_PT/roomnames_special.xml deleted file mode 100644 index 3d423c58..00000000 --- a/desktop_version/lang/pt_PT/roomnames_special.xml +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/pt_PT/strings.xml b/desktop_version/lang/pt_PT/strings.xml deleted file mode 100644 index 3d009543..00000000 --- a/desktop_version/lang/pt_PT/strings.xml +++ /dev/null @@ -1,811 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/pt_PT/strings_plural.xml b/desktop_version/lang/pt_PT/strings_plural.xml deleted file mode 100644 index ff874cbe..00000000 --- a/desktop_version/lang/pt_PT/strings_plural.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/ru/cutscenes.xml b/desktop_version/lang/ru/cutscenes.xml deleted file mode 100644 index edb92270..00000000 --- a/desktop_version/lang/ru/cutscenes.xml +++ /dev/null @@ -1,956 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/ru/graphics/flipsprites.png b/desktop_version/lang/ru/graphics/flipsprites.png deleted file mode 100644 index c2f9c847..00000000 Binary files a/desktop_version/lang/ru/graphics/flipsprites.png and /dev/null differ diff --git a/desktop_version/lang/ru/graphics/sprites.png b/desktop_version/lang/ru/graphics/sprites.png deleted file mode 100644 index 69c46bdc..00000000 Binary files a/desktop_version/lang/ru/graphics/sprites.png and /dev/null differ diff --git a/desktop_version/lang/ru/graphics/spritesmask.xml b/desktop_version/lang/ru/graphics/spritesmask.xml deleted file mode 100644 index 2b84a724..00000000 --- a/desktop_version/lang/ru/graphics/spritesmask.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/desktop_version/lang/ru/meta.xml b/desktop_version/lang/ru/meta.xml deleted file mode 100644 index b26d67a4..00000000 --- a/desktop_version/lang/ru/meta.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - 1 - - - русский - - - Перевод на русский от TheMysticSword - - - Нажмите Пробел, Z или V, чтобы выбрать - - - Нажмите {button}, чтобы выбрать - - - 1 - - - 1 - - - 0 - - - 0 - - - 0 - - - [ {label} ] - [{label}] - - - font - diff --git a/desktop_version/lang/ru/numbers.xml b/desktop_version/lang/ru/numbers.xml deleted file mode 100644 index 66602bda..00000000 --- a/desktop_version/lang/ru/numbers.xml +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/ru/roomnames.xml b/desktop_version/lang/ru/roomnames.xml deleted file mode 100644 index 6d3c77ec..00000000 --- a/desktop_version/lang/ru/roomnames.xml +++ /dev/null @@ -1,193 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/ru/roomnames_special.xml b/desktop_version/lang/ru/roomnames_special.xml deleted file mode 100644 index 56bb63c7..00000000 --- a/desktop_version/lang/ru/roomnames_special.xml +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/ru/strings.xml b/desktop_version/lang/ru/strings.xml deleted file mode 100644 index d412935e..00000000 --- a/desktop_version/lang/ru/strings.xml +++ /dev/null @@ -1,836 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/ru/strings_plural.xml b/desktop_version/lang/ru/strings_plural.xml deleted file mode 100644 index 4e41befa..00000000 --- a/desktop_version/lang/ru/strings_plural.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/szl/cutscenes.xml b/desktop_version/lang/szl/cutscenes.xml deleted file mode 100644 index f8806e7a..00000000 --- a/desktop_version/lang/szl/cutscenes.xml +++ /dev/null @@ -1,956 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/szl/graphics/flipsprites.png b/desktop_version/lang/szl/graphics/flipsprites.png deleted file mode 100644 index f7fc7dc8..00000000 Binary files a/desktop_version/lang/szl/graphics/flipsprites.png and /dev/null differ diff --git a/desktop_version/lang/szl/graphics/sprites.png b/desktop_version/lang/szl/graphics/sprites.png deleted file mode 100644 index a86fa454..00000000 Binary files a/desktop_version/lang/szl/graphics/sprites.png and /dev/null differ diff --git a/desktop_version/lang/szl/graphics/spritesmask.xml b/desktop_version/lang/szl/graphics/spritesmask.xml deleted file mode 100644 index 5f1bca41..00000000 --- a/desktop_version/lang/szl/graphics/spritesmask.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/desktop_version/lang/szl/meta.xml b/desktop_version/lang/szl/meta.xml deleted file mode 100644 index fae781f1..00000000 --- a/desktop_version/lang/szl/meta.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - 1 - - - ślōnsko gŏdka - - - Ślōnski przekłŏd: Kuba Kallus - - - Tyknij Spacja, Z, abo V coby ôbrać - - - Tyknij {button} coby ôbrać - - - 1 - - - 1 - - - 0 - - - 0 - - - 0 - - - [ {label} ] - [{label}] - - - font - diff --git a/desktop_version/lang/szl/numbers.xml b/desktop_version/lang/szl/numbers.xml deleted file mode 100644 index 116f5e2a..00000000 --- a/desktop_version/lang/szl/numbers.xml +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/szl/roomnames.xml b/desktop_version/lang/szl/roomnames.xml deleted file mode 100644 index 5bae7f93..00000000 --- a/desktop_version/lang/szl/roomnames.xml +++ /dev/null @@ -1,193 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/szl/roomnames_special.xml b/desktop_version/lang/szl/roomnames_special.xml deleted file mode 100644 index a9c7069a..00000000 --- a/desktop_version/lang/szl/roomnames_special.xml +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/szl/strings.xml b/desktop_version/lang/szl/strings.xml deleted file mode 100644 index df9585b3..00000000 --- a/desktop_version/lang/szl/strings.xml +++ /dev/null @@ -1,811 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/szl/strings_plural.xml b/desktop_version/lang/szl/strings_plural.xml deleted file mode 100644 index a29704a1..00000000 --- a/desktop_version/lang/szl/strings_plural.xml +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/tr/cutscenes.xml b/desktop_version/lang/tr/cutscenes.xml deleted file mode 100644 index f6a3b302..00000000 --- a/desktop_version/lang/tr/cutscenes.xml +++ /dev/null @@ -1,948 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/tr/graphics/flipsprites.png b/desktop_version/lang/tr/graphics/flipsprites.png deleted file mode 100644 index 625bca5b..00000000 Binary files a/desktop_version/lang/tr/graphics/flipsprites.png and /dev/null differ diff --git a/desktop_version/lang/tr/graphics/sprites.png b/desktop_version/lang/tr/graphics/sprites.png deleted file mode 100644 index 593c7a39..00000000 Binary files a/desktop_version/lang/tr/graphics/sprites.png and /dev/null differ diff --git a/desktop_version/lang/tr/graphics/spritesmask.xml b/desktop_version/lang/tr/graphics/spritesmask.xml deleted file mode 100644 index 57b33a7e..00000000 --- a/desktop_version/lang/tr/graphics/spritesmask.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/desktop_version/lang/tr/meta.xml b/desktop_version/lang/tr/meta.xml deleted file mode 100644 index 6daf3fc4..00000000 --- a/desktop_version/lang/tr/meta.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - 1 - - - türkçe - - - Türkçe yerelleştirme: Engin İlkiz - - - Boşluk, Z veya V tuşu ile seç - - - {button} ile seç - - - 1 - - - 1 - - - 1 - - - 0 - - - 0 - - - [ {label} ] - [{label}] - - - font - diff --git a/desktop_version/lang/tr/numbers.xml b/desktop_version/lang/tr/numbers.xml deleted file mode 100644 index b52e50f2..00000000 --- a/desktop_version/lang/tr/numbers.xml +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/tr/roomnames.xml b/desktop_version/lang/tr/roomnames.xml deleted file mode 100644 index 904d415f..00000000 --- a/desktop_version/lang/tr/roomnames.xml +++ /dev/null @@ -1,193 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/tr/roomnames_special.xml b/desktop_version/lang/tr/roomnames_special.xml deleted file mode 100644 index ac578f8c..00000000 --- a/desktop_version/lang/tr/roomnames_special.xml +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/tr/strings.xml b/desktop_version/lang/tr/strings.xml deleted file mode 100644 index 5a8817f5..00000000 --- a/desktop_version/lang/tr/strings.xml +++ /dev/null @@ -1,811 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/tr/strings_plural.xml b/desktop_version/lang/tr/strings_plural.xml deleted file mode 100644 index c1780916..00000000 --- a/desktop_version/lang/tr/strings_plural.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/uk/cutscenes.xml b/desktop_version/lang/uk/cutscenes.xml deleted file mode 100644 index 94f261c6..00000000 --- a/desktop_version/lang/uk/cutscenes.xml +++ /dev/null @@ -1,948 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/uk/graphics/flipsprites.png b/desktop_version/lang/uk/graphics/flipsprites.png deleted file mode 100644 index 4e4b3f96..00000000 Binary files a/desktop_version/lang/uk/graphics/flipsprites.png and /dev/null differ diff --git a/desktop_version/lang/uk/graphics/sprites.png b/desktop_version/lang/uk/graphics/sprites.png deleted file mode 100644 index 5c66cffc..00000000 Binary files a/desktop_version/lang/uk/graphics/sprites.png and /dev/null differ diff --git a/desktop_version/lang/uk/graphics/spritesmask.xml b/desktop_version/lang/uk/graphics/spritesmask.xml deleted file mode 100644 index 5f1bca41..00000000 --- a/desktop_version/lang/uk/graphics/spritesmask.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/desktop_version/lang/uk/meta.xml b/desktop_version/lang/uk/meta.xml deleted file mode 100644 index c0de4109..00000000 --- a/desktop_version/lang/uk/meta.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - 1 - - - українська - - - Переклад українською|Оля Сушицька - - - Для вибору натисність пробіл, Z або V - - - Для вибору натисніть {button} - - - 1 - - - 1 - - - 0 - - - 0 - - - 0 - - - [ {label} ] - [{label}] - - - font - diff --git a/desktop_version/lang/uk/numbers.xml b/desktop_version/lang/uk/numbers.xml deleted file mode 100644 index 6e83a30c..00000000 --- a/desktop_version/lang/uk/numbers.xml +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/uk/roomnames.xml b/desktop_version/lang/uk/roomnames.xml deleted file mode 100644 index 1e02a5d4..00000000 --- a/desktop_version/lang/uk/roomnames.xml +++ /dev/null @@ -1,193 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/uk/roomnames_special.xml b/desktop_version/lang/uk/roomnames_special.xml deleted file mode 100644 index d2e0a578..00000000 --- a/desktop_version/lang/uk/roomnames_special.xml +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/uk/strings.xml b/desktop_version/lang/uk/strings.xml deleted file mode 100644 index 75ec7058..00000000 --- a/desktop_version/lang/uk/strings.xml +++ /dev/null @@ -1,811 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/uk/strings_plural.xml b/desktop_version/lang/uk/strings_plural.xml deleted file mode 100644 index ec3ccc6e..00000000 --- a/desktop_version/lang/uk/strings_plural.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/zh/cutscenes.xml b/desktop_version/lang/zh/cutscenes.xml deleted file mode 100644 index 706e2a61..00000000 --- a/desktop_version/lang/zh/cutscenes.xml +++ /dev/null @@ -1,983 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/zh/graphics/flipsprites.png b/desktop_version/lang/zh/graphics/flipsprites.png deleted file mode 100644 index fdb05f9d..00000000 Binary files a/desktop_version/lang/zh/graphics/flipsprites.png and /dev/null differ diff --git a/desktop_version/lang/zh/graphics/sprites.png b/desktop_version/lang/zh/graphics/sprites.png deleted file mode 100644 index d9ab3b8a..00000000 Binary files a/desktop_version/lang/zh/graphics/sprites.png and /dev/null differ diff --git a/desktop_version/lang/zh/graphics/spritesmask.xml b/desktop_version/lang/zh/graphics/spritesmask.xml deleted file mode 100644 index a3707f79..00000000 --- a/desktop_version/lang/zh/graphics/spritesmask.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/desktop_version/lang/zh/meta.xml b/desktop_version/lang/zh/meta.xml deleted file mode 100644 index 3e405654..00000000 --- a/desktop_version/lang/zh/meta.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - 1 - - - 简体中文 - - - 中文本地化 by 谜之声 - - - 按空格、Z或V键选择 - - - 按{button}选择 - - - 1 - - - 0 - - - 0 - - - 0 - - - 0 - - - [ {label} ] - [{label}] - - - font_sc - diff --git a/desktop_version/lang/zh/numbers.xml b/desktop_version/lang/zh/numbers.xml deleted file mode 100644 index 8419c98d..00000000 --- a/desktop_version/lang/zh/numbers.xml +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/zh/roomnames.xml b/desktop_version/lang/zh/roomnames.xml deleted file mode 100644 index ee518d68..00000000 --- a/desktop_version/lang/zh/roomnames.xml +++ /dev/null @@ -1,193 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/zh/roomnames_special.xml b/desktop_version/lang/zh/roomnames_special.xml deleted file mode 100644 index cb0a6fd0..00000000 --- a/desktop_version/lang/zh/roomnames_special.xml +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/zh/strings.xml b/desktop_version/lang/zh/strings.xml deleted file mode 100644 index 1487c97c..00000000 --- a/desktop_version/lang/zh/strings.xml +++ /dev/null @@ -1,821 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/zh/strings_plural.xml b/desktop_version/lang/zh/strings_plural.xml deleted file mode 100644 index 78731cc0..00000000 --- a/desktop_version/lang/zh/strings_plural.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/zh_TW/cutscenes.xml b/desktop_version/lang/zh_TW/cutscenes.xml deleted file mode 100644 index 2aceaa03..00000000 --- a/desktop_version/lang/zh_TW/cutscenes.xml +++ /dev/null @@ -1,983 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/zh_TW/graphics/flipsprites.png b/desktop_version/lang/zh_TW/graphics/flipsprites.png deleted file mode 100644 index fdb05f9d..00000000 Binary files a/desktop_version/lang/zh_TW/graphics/flipsprites.png and /dev/null differ diff --git a/desktop_version/lang/zh_TW/graphics/sprites.png b/desktop_version/lang/zh_TW/graphics/sprites.png deleted file mode 100644 index d9ab3b8a..00000000 Binary files a/desktop_version/lang/zh_TW/graphics/sprites.png and /dev/null differ diff --git a/desktop_version/lang/zh_TW/graphics/spritesmask.xml b/desktop_version/lang/zh_TW/graphics/spritesmask.xml deleted file mode 100644 index a3707f79..00000000 --- a/desktop_version/lang/zh_TW/graphics/spritesmask.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/desktop_version/lang/zh_TW/meta.xml b/desktop_version/lang/zh_TW/meta.xml deleted file mode 100644 index 92f33870..00000000 --- a/desktop_version/lang/zh_TW/meta.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - 1 - - - 繁體中文 - - - 繁體中文本地化 by 谜之声 and craft - - - 按空白鍵、Z或V鍵選擇 - - - 按{button}選擇 - - - 1 - - - 0 - - - 0 - - - 0 - - - 0 - - - [ {label} ] - [{label}] - - - font_tc - diff --git a/desktop_version/lang/zh_TW/numbers.xml b/desktop_version/lang/zh_TW/numbers.xml deleted file mode 100644 index 8419c98d..00000000 --- a/desktop_version/lang/zh_TW/numbers.xml +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/zh_TW/roomnames.xml b/desktop_version/lang/zh_TW/roomnames.xml deleted file mode 100644 index c6b0e47f..00000000 --- a/desktop_version/lang/zh_TW/roomnames.xml +++ /dev/null @@ -1,193 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/zh_TW/roomnames_special.xml b/desktop_version/lang/zh_TW/roomnames_special.xml deleted file mode 100644 index 9e0f0123..00000000 --- a/desktop_version/lang/zh_TW/roomnames_special.xml +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/zh_TW/strings.xml b/desktop_version/lang/zh_TW/strings.xml deleted file mode 100644 index cb176772..00000000 --- a/desktop_version/lang/zh_TW/strings.xml +++ /dev/null @@ -1,821 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/lang/zh_TW/strings_plural.xml b/desktop_version/lang/zh_TW/strings_plural.xml deleted file mode 100644 index c25b04f6..00000000 --- a/desktop_version/lang/zh_TW/strings_plural.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/desktop_version/src/ActionSets.h b/desktop_version/src/ActionSets.h deleted file mode 100644 index 4311c5a9..00000000 --- a/desktop_version/src/ActionSets.h +++ /dev/null @@ -1,90 +0,0 @@ -/* For now, this isn't really a foundation for action sets yet; button glyphs - * just need to be able to identify actions that are printed in text like - * "Press ENTER to teleport". Thus, this currently ONLY contains identifiers - * for the actions that button glyphs are needed for. - * - * Based on this comment: - * https://github.com/TerryCavanagh/VVVVVV/issues/834#issuecomment-1015692161 - */ - - -#ifndef ACTIONSETS_H -#define ACTIONSETS_H - - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/*----------------------------------------* - * List of all action sets (all "states") * - *----------------------------------------*/ -typedef enum -{ - //ActionSet_Global, - ActionSet_Menu, - ActionSet_InGame - //ActionSet_Editor -} -ActionSet; - - -/*----------------------------------------------------------* - * An enum for each actionset, with the actions in that set * - *----------------------------------------------------------*/ -/* -typedef enum -{ - Action_Global_Mute, - Action_Global_MuteMusic -} -Action_Global; -*/ - -typedef enum -{ - Action_Menu_Accept -} -Action_Menu; - -typedef enum -{ - Action_InGame_ACTION, - Action_InGame_Interact, - Action_InGame_Map, - Action_InGame_Restart, - Action_InGame_Esc -} -Action_InGame; - -/* -typedef enum -{ - //Action_Editor_PrevTool, - //Action_Editor_NextTool -} -Action_Editor; -*/ - - -/*-----------------------------------------* - * A union to represent any actionset enum * - *-----------------------------------------*/ -typedef union -{ - int intval; - //Action_Global Global; - Action_Menu Menu; - Action_InGame InGame; - //Action_Editor Editor; -} -Action; - - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // ACTIONSETS_H diff --git a/desktop_version/src/Alloc.h b/desktop_version/src/Alloc.h deleted file mode 100644 index 042cffb4..00000000 --- a/desktop_version/src/Alloc.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef ALLOCGAME_H -#define ALLOCGAME_H - -/* TODO: VVV_malloc, VVV_realloc, etc. */ - -#define VVV_freefunc(func, obj) \ - do \ - { \ - if (obj != NULL) \ - { \ - func(obj); \ - obj = NULL; \ - } \ - } \ - while (0) - -#define VVV_free(obj) VVV_freefunc(SDL_free, obj) - -#endif /* ALLOCGAME_H */ diff --git a/desktop_version/src/BinaryBlob.cpp b/desktop_version/src/BinaryBlob.cpp index 62d99f19..59e67600 100644 --- a/desktop_version/src/BinaryBlob.cpp +++ b/desktop_version/src/BinaryBlob.cpp @@ -1,153 +1,145 @@ #include "BinaryBlob.h" #include -#ifdef VVV_COMPILEMUSIC #include -#endif -#include "Alloc.h" #include "Exit.h" #include "FileSystemUtils.h" #include "UtilityClass.h" -#include "Vlogging.h" binaryBlob::binaryBlob(void) { -#ifdef VVV_COMPILEMUSIC - numberofHeaders = 0; -#endif - SDL_zeroa(m_headers); - SDL_zeroa(m_memblocks); + numberofHeaders = 0; + SDL_zeroa(m_headers); + SDL_zeroa(m_memblocks); } #ifdef VVV_COMPILEMUSIC void binaryBlob::AddFileToBinaryBlob(const char* _path) { - long size; - char * memblock; + long size; + char * memblock; - FILE *file = fopen(_path, "rb"); - if (file != NULL) - { - fseek(file, 0, SEEK_END); - size = ftell(file); - fseek(file, 0, SEEK_SET); + FILE *file = fopen(_path, "rb"); + if (file != NULL) + { + fseek(file, 0, SEEK_END); + size = ftell(file); + fseek(file, 0, SEEK_SET); - memblock = (char*) SDL_malloc(size); - if (memblock == NULL) - { - VVV_exit(1); - } - fread(memblock, 1, size, file); + memblock = (char*) SDL_malloc(size); + if (memblock == NULL) + { + VVV_exit(1); + } + fread(memblock, 1, size, file); - fclose(file); + fclose(file); - vlog_info("The complete file size: %li", size); + printf("The complete file size: %li\n", size); - m_memblocks[numberofHeaders] = memblock; - for (int i = 0; _path[i]; i += 1) - { - m_headers[numberofHeaders].name[i] = _path[i]; - } + m_memblocks[numberofHeaders] = memblock; + for (int i = 0; _path[i]; i += 1) + { + m_headers[numberofHeaders].name[i] = _path[i]; + } - m_headers[numberofHeaders].valid = true; - m_headers[numberofHeaders].size = size; - numberofHeaders += 1; - } - else - { - vlog_info("Unable to open file"); - } + m_headers[numberofHeaders].valid = true; + m_headers[numberofHeaders].size = size; + numberofHeaders += 1; + } + else + { + printf("Unable to open file\n"); + } } void binaryBlob::writeBinaryBlob(const char* _name) { - FILE *file = fopen(_name, "wb"); - if (file != NULL) - { - fwrite((char*) &m_headers, 1, sizeof(m_headers), file); + FILE *file = fopen(_name, "wb"); + if (file != NULL) + { + fwrite((char*) &m_headers, 1, sizeof(m_headers), file); - for (int i = 0; i < numberofHeaders; i += 1) - { - fwrite(m_memblocks[i], 1, m_headers[i].size, file); - } + for (int i = 0; i < numberofHeaders; i += 1) + { + fwrite(m_memblocks[i], 1, m_headers[i].size, file); + } - fclose(file); - } - else - { - vlog_info("Unable to open new file for writing. Feels bad."); - } + fclose(file); + } + else + { + printf("Unable to open new file for writing. Feels bad.\n"); + } } #endif bool binaryBlob::unPackBinary(const char* name) { - return FILESYSTEM_loadBinaryBlob(this, name); + return FILESYSTEM_loadBinaryBlob(this, name); } void binaryBlob::clear(void) { - for (size_t i = 0; i < SDL_arraysize(m_headers); i += 1) - { - if (m_memblocks[i] != NULL) - { - VVV_free(m_memblocks[i]); - } - } - SDL_zeroa(m_memblocks); - SDL_zeroa(m_headers); + for (size_t i = 0; i < SDL_arraysize(m_headers); i += 1) + { + SDL_free(m_memblocks[i]); + } + SDL_zeroa(m_memblocks); + SDL_zeroa(m_headers); } int binaryBlob::getIndex(const char* _name) { - for (size_t i = 0; i < SDL_arraysize(m_headers); i += 1) - { - if (SDL_strcmp(_name, m_headers[i].name) == 0 && m_headers[i].valid) - { - return i; - } - } - return -1; + for (size_t i = 0; i < SDL_arraysize(m_headers); i += 1) + { + if (SDL_strcmp(_name, m_headers[i].name) == 0 && m_headers[i].valid) + { + return i; + } + } + return -1; } int binaryBlob::getSize(int _index) { - if (!INBOUNDS_ARR(_index, m_headers)) - { - vlog_error("getSize() out-of-bounds!"); - return 0; - } - return m_headers[_index].size; + if (!INBOUNDS_ARR(_index, m_headers)) + { + puts("getSize() out-of-bounds!"); + return 0; + } + return m_headers[_index].size; } char* binaryBlob::getAddress(int _index) { - if (!INBOUNDS_ARR(_index, m_memblocks)) - { - vlog_error("getAddress() out-of-bounds!"); - return NULL; - } - return m_memblocks[_index]; + if (!INBOUNDS_ARR(_index, m_memblocks)) + { + puts("getAddress() out-of-bounds!"); + return NULL; + } + return m_memblocks[_index]; } bool binaryBlob::nextExtra(size_t* start) { - size_t* idx; + size_t* idx; - if (start == NULL) - { - return false; - } + if (start == NULL) + { + return false; + } - for (idx = start; *idx < SDL_arraysize(m_headers); *idx += 1) - { - if (m_headers[*idx].valid -#define FOREACH_TRACK(_, track_name) && SDL_strcmp(m_headers[*idx].name, "data/" track_name) != 0 - TRACK_NAMES(_) - ) { - return true; - } - } - return false; + for (idx = start; *idx < SDL_arraysize(m_headers); *idx += 1) + { + if (m_headers[*idx].valid +#define FOREACH_TRACK(_, track_name) && SDL_strcmp(m_headers[*idx].name, track_name) != 0 + TRACK_NAMES(_) +#undef FOREACH_TRACK + ) { + return true; + } + } + return false; } diff --git a/desktop_version/src/BinaryBlob.h b/desktop_version/src/BinaryBlob.h index f8089930..2907f82b 100644 --- a/desktop_version/src/BinaryBlob.h +++ b/desktop_version/src/BinaryBlob.h @@ -2,67 +2,64 @@ #define BINARYBLOB_H #include -#include /* Laaaazyyyyyyy -flibit */ // #define VVV_COMPILEMUSIC #define TRACK_NAMES(blob) \ - FOREACH_TRACK(blob, "music/0levelcomplete.ogg") \ - FOREACH_TRACK(blob, "music/1pushingonwards.ogg") \ - FOREACH_TRACK(blob, "music/2positiveforce.ogg") \ - FOREACH_TRACK(blob, "music/3potentialforanything.ogg") \ - FOREACH_TRACK(blob, "music/4passionforexploring.ogg") \ - FOREACH_TRACK(blob, "music/5intermission.ogg") \ - FOREACH_TRACK(blob, "music/6presentingvvvvvv.ogg") \ - FOREACH_TRACK(blob, "music/7gamecomplete.ogg") \ - FOREACH_TRACK(blob, "music/8predestinedfate.ogg") \ - FOREACH_TRACK(blob, "music/9positiveforcereversed.ogg") \ - FOREACH_TRACK(blob, "music/10popularpotpourri.ogg") \ - FOREACH_TRACK(blob, "music/11pipedream.ogg") \ - FOREACH_TRACK(blob, "music/12pressurecooker.ogg") \ - FOREACH_TRACK(blob, "music/13pacedenergy.ogg") \ - FOREACH_TRACK(blob, "music/14piercingthesky.ogg") \ - FOREACH_TRACK(blob, "music/predestinedfatefinallevel.ogg") + FOREACH_TRACK(blob, "data/music/0levelcomplete.ogg") \ + FOREACH_TRACK(blob, "data/music/1pushingonwards.ogg") \ + FOREACH_TRACK(blob, "data/music/2positiveforce.ogg") \ + FOREACH_TRACK(blob, "data/music/3potentialforanything.ogg") \ + FOREACH_TRACK(blob, "data/music/4passionforexploring.ogg") \ + FOREACH_TRACK(blob, "data/music/5intermission.ogg") \ + FOREACH_TRACK(blob, "data/music/6presentingvvvvvv.ogg") \ + FOREACH_TRACK(blob, "data/music/7gamecomplete.ogg") \ + FOREACH_TRACK(blob, "data/music/8predestinedfate.ogg") \ + FOREACH_TRACK(blob, "data/music/9positiveforcereversed.ogg") \ + FOREACH_TRACK(blob, "data/music/10popularpotpourri.ogg") \ + FOREACH_TRACK(blob, "data/music/11pipedream.ogg") \ + FOREACH_TRACK(blob, "data/music/12pressurecooker.ogg") \ + FOREACH_TRACK(blob, "data/music/13pacedenergy.ogg") \ + FOREACH_TRACK(blob, "data/music/14piercingthesky.ogg") \ + FOREACH_TRACK(blob, "data/music/predestinedfatefinallevel.ogg") struct resourceheader { - char name[48]; - int32_t start_UNUSED; - int32_t size; - uint8_t valid; + char name[48]; + int start_UNUSED; + int size; + bool valid; }; class binaryBlob { public: - binaryBlob(void); + binaryBlob(void); #ifdef VVV_COMPILEMUSIC - void AddFileToBinaryBlob(const char* _path); + void AddFileToBinaryBlob(const char* _path); - void writeBinaryBlob(const char* _name); + void writeBinaryBlob(const char* _name); #endif - bool unPackBinary(const char* _name); + bool unPackBinary(const char* _name); - int getIndex(const char* _name); + int getIndex(const char* _name); - int getSize(int _index); + int getSize(int _index); - bool nextExtra(size_t* start); + bool nextExtra(size_t* start); - char* getAddress(int _index); + char* getAddress(int _index); - void clear(void); + void clear(void); - static const int max_headers = 128; + static const int max_headers = 128; -#ifdef VVV_COMPILEMUSIC - int numberofHeaders; -#endif - resourceheader m_headers[max_headers]; - char* m_memblocks[max_headers]; + int numberofHeaders; + resourceheader m_headers[max_headers]; + char* m_memblocks[max_headers]; }; diff --git a/desktop_version/src/BlockV.cpp b/desktop_version/src/BlockV.cpp index 5eebec7c..1817c40a 100644 --- a/desktop_version/src/BlockV.cpp +++ b/desktop_version/src/BlockV.cpp @@ -1,56 +1,103 @@ #include "BlockV.h" -#include - -#include "Script.h" -#include "Font.h" - blockclass::blockclass(void) { - clear(); + clear(); } void blockclass::clear(void) { - type = 0; - trigger = 0; + type = 0; + trigger = 0; - xp = 0; - yp = 0; - wp = 0; - hp = 0; - rect.x = xp; - rect.y = yp; - rect.w = wp; - rect.h = hp; + xp = 0; + yp = 0; + wp = 0; + hp = 0; + rect.x = xp; + rect.y = yp; + rect.w = wp; + rect.h = hp; - r = 0; - g = 0; - b = 0; + r = 0; + g = 0; + b = 0; - activity_y = 0; - - /* std::strings get initialized automatically, but this is - * in case this function gets called again after construction */ - script.clear(); - prompt.clear(); - - gettext = true; + /* std::strings get initialized automatically, but this is */ + /* in case this function gets called again after construction */ + script.clear(); + prompt.clear(); } void blockclass::rectset(const int xi, const int yi, const int wi, const int hi) { - rect.x = xi; - rect.y = yi; - rect.w = wi; - rect.h = hi; + rect.x = xi; + rect.y = yi; + rect.w = wi; + rect.h = hi; } -void blockclass::setblockcolour(const char* col) +void blockclass::setblockcolour( std::string col ) { - bool exists = ::script.textbox_colours.count(col) != 0; - - r = ::script.textbox_colours[exists ? col : "gray"].r; - g = ::script.textbox_colours[exists ? col : "gray"].g; - b = ::script.textbox_colours[exists ? col : "gray"].b; + if (col == "cyan") + { + r = 164; + g = 164; + b = 255; + } + else if (col == "red") + { + r = 255; + g = 60; + b = 60; + } + else if (col == "green") + { + r = 144; + g = 255; + b = 144; + } + else if (col == "yellow") + { + r = 255; + g = 255; + b = 134; + } + else if (col == "blue") + { + r = 95; + g = 95; + b = 255; + } + else if (col == "purple") + { + r = 255; + g = 134; + b = 255; + } + else if (col == "white") + { + r = 244; + g = 244; + b = 244; + } + else if (col == "gray") + { + r = 174; + g = 174; + b = 174; + } + else if (col == "orange") + { + r = 255; + g = 130; + b = 20; + } + else + { + //use a gray + r = 174; + g = 174; + b = 174; + } } diff --git a/desktop_version/src/BlockV.h b/desktop_version/src/BlockV.h index 8ada5088..6753f913 100644 --- a/desktop_version/src/BlockV.h +++ b/desktop_version/src/BlockV.h @@ -2,7 +2,6 @@ #define BLOCKV_H #include -#include #include class blockclass @@ -13,7 +12,7 @@ public: void rectset(const int xi, const int yi, const int wi, const int hi); - void setblockcolour(const char* col); + void setblockcolour(std::string col); public: //Fundamentals SDL_Rect rect; @@ -22,8 +21,6 @@ public: int xp, yp, wp, hp; std::string script, prompt; int r, g, b; - int activity_y; - bool gettext; }; #endif /* BLOCKV_H */ diff --git a/desktop_version/src/ButtonGlyphs.cpp b/desktop_version/src/ButtonGlyphs.cpp deleted file mode 100644 index 82610025..00000000 --- a/desktop_version/src/ButtonGlyphs.cpp +++ /dev/null @@ -1,420 +0,0 @@ -#include "ButtonGlyphs.h" - -#include - -#include "Game.h" -#include "Localization.h" -#include "UTF8.h" - -extern "C" -{ - -typedef enum -{ - GLYPH_NINTENDO_DECK_A, // Note that for the Deck, the icons are same as Nintendo but the layout is the same as Xbox - GLYPH_NINTENDO_DECK_B, - GLYPH_NINTENDO_DECK_X, - GLYPH_NINTENDO_DECK_Y, - GLYPH_NINTENDO_PLUS, - GLYPH_NINTENDO_MINUS, - GLYPH_NINTENDO_L, - GLYPH_NINTENDO_R, - GLYPH_NINTENDO_ZL, - GLYPH_NINTENDO_ZR, - GLYPH_NINTENDO_XBOX_LSTICK, - GLYPH_NINTENDO_XBOX_RSTICK, - GLYPH_NINTENDO_SL, - GLYPH_NINTENDO_SR, - GLYPH_GENERIC_L, - GLYPH_GENERIC_R, - - GLYPH_PLAYSTATION_CIRCLE, - GLYPH_PLAYSTATION_CROSS, - GLYPH_PLAYSTATION_TRIANGLE, - GLYPH_PLAYSTATION_SQUARE, - GLYPH_PLAYSTATION_START, - GLYPH_PLAYSTATION_OPTIONS, - GLYPH_PLAYSTATION_DECK_L1, - GLYPH_PLAYSTATION_DECK_R1, - GLYPH_PLAYSTATION_DECK_L2, - GLYPH_PLAYSTATION_DECK_R2, - GLYPH_PLAYSTATION_DECK_L3, - GLYPH_PLAYSTATION_DECK_R3, - GLYPH_DECK_L4, - GLYPH_DECK_R4, - GLYPH_DECK_L5, - GLYPH_DECK_R5, - - GLYPH_XBOX_B, - GLYPH_XBOX_A, - GLYPH_XBOX_Y, - GLYPH_XBOX_X, - GLYPH_XBOX_DECK_VIEW, - GLYPH_XBOX_DECK_MENU, - GLYPH_XBOX_LB, - GLYPH_XBOX_RB, - GLYPH_XBOX_LT, - GLYPH_XBOX_RT, - GLYPH_NINTENDO_GENERIC_ACTIONRIGHT, - GLYPH_NINTENDO_GENERIC_ACTIONDOWN, - GLYPH_NINTENDO_GENERIC_ACTIONUP, - GLYPH_NINTENDO_GENERIC_ACTIONLEFT, - GLYPH_NINTENDO_GENERIC_STICK, - GLYPH_UNKNOWN, - - /* Added after 2.4 */ - GLYPH_NINTENDO_GAMECUBE_A, - GLYPH_NINTENDO_GAMECUBE_B, - GLYPH_NINTENDO_GAMECUBE_X, - GLYPH_NINTENDO_GAMECUBE_Y, - GLYPH_NINTENDO_GAMECUBE_L, - GLYPH_NINTENDO_GAMECUBE_R, - GLYPH_NINTENDO_GAMECUBE_Z, - - GLYPH_TOTAL -} -ButtonGlyphKey; - -static char glyph[GLYPH_TOTAL][5]; - -typedef enum -{ - LAYOUT_NINTENDO_SWITCH_PRO, - LAYOUT_NINTENDO_SWITCH_JOYCON_L, - LAYOUT_NINTENDO_SWITCH_JOYCON_R, - LAYOUT_DECK, - LAYOUT_PLAYSTATION, - LAYOUT_XBOX, - LAYOUT_GENERIC, - - /* Added after 2.4 */ - LAYOUT_GAMECUBE, - - LAYOUT_TOTAL -} -ButtonGlyphLayout; - -/* SDL provides Xbox buttons, we'd like to show the correct - * (controller-specific) glyphs or labels for those... */ -static const char* glyph_layout[LAYOUT_TOTAL][SDL_CONTROLLER_BUTTON_RIGHTSHOULDER + 1] = { - { // NINTENDO_SWITCH_PRO - glyph[GLYPH_NINTENDO_DECK_B], glyph[GLYPH_NINTENDO_DECK_A], - glyph[GLYPH_NINTENDO_DECK_Y], glyph[GLYPH_NINTENDO_DECK_X], - glyph[GLYPH_NINTENDO_MINUS], "HOME", glyph[GLYPH_NINTENDO_PLUS], - glyph[GLYPH_NINTENDO_XBOX_LSTICK], glyph[GLYPH_NINTENDO_XBOX_RSTICK], - glyph[GLYPH_NINTENDO_L], glyph[GLYPH_NINTENDO_R] - }, - { // NINTENDO_SWITCH_JOYCON_L - glyph[GLYPH_NINTENDO_GENERIC_ACTIONDOWN], glyph[GLYPH_NINTENDO_GENERIC_ACTIONRIGHT], - glyph[GLYPH_NINTENDO_GENERIC_ACTIONLEFT], glyph[GLYPH_NINTENDO_GENERIC_ACTIONUP], - "CAPTURE", "GUIDE", glyph[GLYPH_NINTENDO_MINUS], - glyph[GLYPH_NINTENDO_GENERIC_STICK], glyph[GLYPH_NINTENDO_XBOX_RSTICK], - glyph[GLYPH_NINTENDO_SL], glyph[GLYPH_NINTENDO_SR] - }, - { // NINTENDO_SWITCH_JOYCON_R - glyph[GLYPH_NINTENDO_GENERIC_ACTIONDOWN], glyph[GLYPH_NINTENDO_GENERIC_ACTIONRIGHT], - glyph[GLYPH_NINTENDO_GENERIC_ACTIONLEFT], glyph[GLYPH_NINTENDO_GENERIC_ACTIONUP], - "HOME", "GUIDE", glyph[GLYPH_NINTENDO_PLUS], - glyph[GLYPH_NINTENDO_GENERIC_STICK], glyph[GLYPH_NINTENDO_XBOX_RSTICK], - glyph[GLYPH_NINTENDO_SL], glyph[GLYPH_NINTENDO_SR] - }, - { // DECK - glyph[GLYPH_NINTENDO_DECK_A], glyph[GLYPH_NINTENDO_DECK_B], - glyph[GLYPH_NINTENDO_DECK_X], glyph[GLYPH_NINTENDO_DECK_Y], - glyph[GLYPH_XBOX_DECK_VIEW], "GUIDE", glyph[GLYPH_XBOX_DECK_MENU], - glyph[GLYPH_PLAYSTATION_DECK_L3], glyph[GLYPH_PLAYSTATION_DECK_R3], - glyph[GLYPH_PLAYSTATION_DECK_L1], glyph[GLYPH_PLAYSTATION_DECK_R1] - }, - { // PLAYSTATION - glyph[GLYPH_PLAYSTATION_CROSS], glyph[GLYPH_PLAYSTATION_CIRCLE], - glyph[GLYPH_PLAYSTATION_SQUARE], glyph[GLYPH_PLAYSTATION_TRIANGLE], - glyph[GLYPH_PLAYSTATION_OPTIONS], "PS", glyph[GLYPH_PLAYSTATION_START], - glyph[GLYPH_PLAYSTATION_DECK_L3], glyph[GLYPH_PLAYSTATION_DECK_R3], - glyph[GLYPH_PLAYSTATION_DECK_L1], glyph[GLYPH_PLAYSTATION_DECK_R1] - }, - { // XBOX - glyph[GLYPH_XBOX_A], glyph[GLYPH_XBOX_B], - glyph[GLYPH_XBOX_X], glyph[GLYPH_XBOX_Y], - glyph[GLYPH_XBOX_DECK_VIEW], "GUIDE", glyph[GLYPH_XBOX_DECK_MENU], - glyph[GLYPH_NINTENDO_XBOX_LSTICK], glyph[GLYPH_NINTENDO_XBOX_RSTICK], - glyph[GLYPH_XBOX_LB], glyph[GLYPH_XBOX_RB] - }, - { // GENERIC - glyph[GLYPH_NINTENDO_GENERIC_ACTIONDOWN], glyph[GLYPH_NINTENDO_GENERIC_ACTIONRIGHT], - glyph[GLYPH_NINTENDO_GENERIC_ACTIONLEFT], glyph[GLYPH_NINTENDO_GENERIC_ACTIONUP], - "SELECT", "GUIDE", "START", - glyph[GLYPH_NINTENDO_XBOX_LSTICK], glyph[GLYPH_NINTENDO_XBOX_RSTICK], - glyph[GLYPH_GENERIC_L], glyph[GLYPH_GENERIC_R] - }, - { // GAMECUBE - glyph[GLYPH_NINTENDO_GAMECUBE_A], glyph[GLYPH_NINTENDO_GAMECUBE_X], - glyph[GLYPH_NINTENDO_GAMECUBE_B], glyph[GLYPH_NINTENDO_GAMECUBE_Y], - glyph[GLYPH_UNKNOWN], glyph[GLYPH_UNKNOWN], "START", - glyph[GLYPH_UNKNOWN], glyph[GLYPH_UNKNOWN], - glyph[GLYPH_UNKNOWN], glyph[GLYPH_NINTENDO_GAMECUBE_Z] - } -}; - -static bool keyboard_is_active = true; -static ButtonGlyphLayout layout = LAYOUT_GENERIC; - -void BUTTONGLYPHS_init(void) -{ - /* Set glyph array to strings for all the button glyph codepoints (U+EBxx) */ - for (int i = 0; i < GLYPH_TOTAL; i++) - { - SDL_strlcpy(glyph[i], UTF8_encode(0xEB00+i).bytes, sizeof(glyph[i])); - } -} - -bool BUTTONGLYPHS_keyboard_is_available(void) -{ - /* Returns true if it makes sense to show button hints that are only available - * on keyboards (like press M to mute), false if we're on a console. */ - - if (BUTTONGLYPHS_keyboard_is_active()) - { - /* The keyboard is active, so there HAS to be a keyboard available */ - return true; - } - -#if defined(__ANDROID__) || TARGET_OS_IPHONE - return false; -#else - return !SDL_GetHintBoolean("SteamDeck", SDL_FALSE); -#endif -} - -bool BUTTONGLYPHS_keyboard_is_active(void) -{ - /* Returns true if, not only do we have a keyboard available, but it's also the - * active input method. (So, show keyboard keys, if false, show controller glyphs) */ - return keyboard_is_active; -} - -void BUTTONGLYPHS_keyboard_set_active(bool active) -{ - keyboard_is_active = active; -} - -void BUTTONGLYPHS_update_layout(SDL_GameController *c) -{ - Uint16 vendor = SDL_GameControllerGetVendor(c); - Uint16 product = SDL_GameControllerGetProduct(c); - - if (vendor == 0x054c) - { - layout = LAYOUT_PLAYSTATION; - } - else if (vendor == 0x28de) - { - /* Steam Virtual Gamepads can hypothetically tell us that the physical - * device is a PlayStation controller, so try to catch that scenario */ - SDL_GameControllerType gct = SDL_GameControllerGetType(c); - if ( gct == SDL_CONTROLLER_TYPE_PS3 || - gct == SDL_CONTROLLER_TYPE_PS4 || - gct == SDL_CONTROLLER_TYPE_PS5 ) - { - layout = LAYOUT_PLAYSTATION; - } - else - { - layout = LAYOUT_DECK; - } - } - else if (vendor == 0x057e) - { - if (product == 0x2006) - { - layout = LAYOUT_NINTENDO_SWITCH_JOYCON_L; - } - else if (product == 0x2007) - { - layout = LAYOUT_NINTENDO_SWITCH_JOYCON_R; - } - else if (product == 0x0337) - { - layout = LAYOUT_GAMECUBE; - } - else - { - layout = LAYOUT_NINTENDO_SWITCH_PRO; - } - } - else if (vendor == 0x2dc8) /* 8BitDo */ - { - if ( product == 0x2002 || /* Ultimate Wired Controller for Xbox */ - product == 0x3106 ) /* Ultimate Wireless / Pro 2 Wired Controller */ - { - layout = LAYOUT_XBOX; - } - else - { - layout = LAYOUT_NINTENDO_SWITCH_PRO; - } - } - else - { - /* For now we assume Xbox (0x045e), Generic will be used when - * migrating to SDL_ActionSet - */ - layout = LAYOUT_XBOX; - } -} - -const char* BUTTONGLYPHS_get_wasd_text(void) -{ - /* Returns the string to use in Welcome Aboard */ - if (BUTTONGLYPHS_keyboard_is_active()) - { - return loc::gettext("Press arrow keys or WASD to move"); - } - return loc::gettext("Press left/right to move"); -} - -const char* BUTTONGLYPHS_sdlbutton_to_glyph(const SDL_GameControllerButton button) -{ - if (button < 0 || button > SDL_CONTROLLER_BUTTON_RIGHTSHOULDER) - { - SDL_assert(0 && "Unhandled button!"); - return glyph[GLYPH_UNKNOWN]; - } - - return glyph_layout[layout][button]; -} - -static const char* glyph_for_vector( - const std::vector& buttons, - const int index -) { - if (index < 0 || index >= (int) buttons.size()) - { - return NULL; - } - - return BUTTONGLYPHS_sdlbutton_to_glyph(buttons[index]); -} - -const char* BUTTONGLYPHS_get_button(const ActionSet actionset, const Action action, int binding) -{ - /* Given a specific action (like INTERACT in-game), - * return either a (localized) keyboard key string like "ENTER" or "E", - * or a controller button glyph from the table above like glyph[GLYPH_XBOX_Y], - * to fill into strings like "Press {button} to activate terminal". - * - * Normally, set binding = -1. This will return the best keyboard key OR controller glyph. - * - * If binding >= 0, select a specific CONTROLLER binding glyph, - * or NULL if the index is higher than the max binding index. */ - - bool show_controller = binding >= 0 || !BUTTONGLYPHS_keyboard_is_active(); - if (binding < 0) - { - binding = 0; - } - - switch (actionset) - { - case ActionSet_Menu: - switch (action.Menu) - { - case Action_Menu_Accept: - if (show_controller) - { - return glyph_for_vector(game.controllerButton_flip, binding); - } - return loc::gettext("ACTION"); - } - break; - case ActionSet_InGame: - switch (action.InGame) - { - case Action_InGame_ACTION: - if (show_controller) - { - return glyph_for_vector(game.controllerButton_flip, binding); - } - return loc::gettext("ACTION"); - - case Action_InGame_Interact: - if (show_controller) - { - /* FIXME: this really does depend on the Enter/E speedrunner option... - * This is messy, but let's not show the wrong thing here... */ - if (game.separate_interact) - { - return glyph_for_vector(game.controllerButton_interact, binding); - } - return glyph_for_vector(game.controllerButton_map, binding); - } - if (game.separate_interact) - { - return "E"; - } - return loc::gettext("ENTER"); - - case Action_InGame_Map: - if (show_controller) - { - return glyph_for_vector(game.controllerButton_map, binding); - } - return loc::gettext("ENTER"); - - case Action_InGame_Esc: - if (show_controller) - { - return glyph_for_vector(game.controllerButton_esc, binding); - } - return loc::gettext("ESC"); - - case Action_InGame_Restart: - if (show_controller) - { - return glyph_for_vector(game.controllerButton_restart, binding); - } - return "R"; - } - break; - } - - SDL_assert(0 && "Trying to get label/glyph for unknown action!"); - return glyph[GLYPH_UNKNOWN]; -} - -char* BUTTONGLYPHS_get_all_gamepad_buttons( - char* buffer, - size_t buffer_len, - const ActionSet actionset, - const int action -) { - /* Gives a list of all controller bindings, for in the menu */ - Action union_action; - union_action.intval = action; - buffer[0] = '\0'; - size_t cur = 0; - const char* glyph; - int binding = 0; - while ((glyph = BUTTONGLYPHS_get_button(actionset, union_action, binding))) - { - if (binding > 0 && buffer_len >= 1) - { - buffer[cur] = '/'; - cur++; - buffer_len--; - } - - size_t glyph_len = SDL_strlcpy(&buffer[cur], glyph, buffer_len); - if (glyph_len >= buffer_len) - { - // Truncation occurred, we're done - return buffer; - } - cur += glyph_len; - buffer_len -= glyph_len; - - binding++; - } - return buffer; -} - -} // extern "C" diff --git a/desktop_version/src/ButtonGlyphs.h b/desktop_version/src/ButtonGlyphs.h deleted file mode 100644 index 78416117..00000000 --- a/desktop_version/src/ButtonGlyphs.h +++ /dev/null @@ -1,37 +0,0 @@ -#ifndef BUTTONGLYPHS_H -#define BUTTONGLYPHS_H - -#include -#include - -#include "ActionSets.h" - -#ifdef __cplusplus -extern "C" -{ -#endif - -void BUTTONGLYPHS_init(void); - -bool BUTTONGLYPHS_keyboard_is_available(void); -bool BUTTONGLYPHS_keyboard_is_active(void); -void BUTTONGLYPHS_keyboard_set_active(bool active); - -void BUTTONGLYPHS_update_layout(SDL_GameController *c); - -const char* BUTTONGLYPHS_get_wasd_text(void); -const char* BUTTONGLYPHS_sdlbutton_to_glyph(SDL_GameControllerButton button); -const char* BUTTONGLYPHS_get_button(ActionSet actionset, Action action, int binding); - -char* BUTTONGLYPHS_get_all_gamepad_buttons( - char* buffer, - size_t buffer_len, - ActionSet actionset, - int action -); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // BUTTONGLYPHS_H diff --git a/desktop_version/src/CWrappers.cpp b/desktop_version/src/CWrappers.cpp deleted file mode 100644 index 8eb31abc..00000000 --- a/desktop_version/src/CWrappers.cpp +++ /dev/null @@ -1,52 +0,0 @@ -#include "CWrappers.h" - -#include - -#include "Graphics.h" -#include "GraphicsUtil.h" -#include "Localization.h" -#include "UtilityClass.h" - -extern "C" -{ - -char* HELP_number_words(int _t, const char* number_class) -{ - /* C wrapper for UtilityClass::number_words. - * Caller must VVV_free. */ - - std::string str = help.number_words(_t, number_class); - - char* buffer = (char*) SDL_malloc(str.size() + 1); - str.copy(buffer, str.size()); - buffer[str.size()] = '\0'; - - return buffer; -} - -uint32_t LOC_toupper_ch(uint32_t ch) -{ - return loc::toupper_ch(ch); -} - -SDL_Surface* GRAPHICS_tempScreenshot(void) -{ - return graphics.tempScreenshot; -} - -SDL_Surface* GRAPHICS_tempScreenshot2x(void) -{ - return graphics.tempScreenshot2x; -} - -uint8_t UTIL_TakeScreenshot(SDL_Surface** surface) -{ - return TakeScreenshot(surface); -} - -uint8_t UTIL_UpscaleScreenshot2x(SDL_Surface* src, SDL_Surface** dest) -{ - return UpscaleScreenshot2x(src, dest); -} - -} /* extern "C" */ diff --git a/desktop_version/src/CWrappers.h b/desktop_version/src/CWrappers.h deleted file mode 100644 index 94fa1494..00000000 --- a/desktop_version/src/CWrappers.h +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef CWRAPPERS_H -#define CWRAPPERS_H - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -char* HELP_number_words(int _t, const char* number_class); -uint32_t LOC_toupper_ch(uint32_t ch); -SDL_Surface* GRAPHICS_tempScreenshot(void); -SDL_Surface* GRAPHICS_tempScreenshot2x(void); -uint8_t UTIL_TakeScreenshot(SDL_Surface** surface); -uint8_t UTIL_UpscaleScreenshot2x(SDL_Surface* src, SDL_Surface** dest); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* CWRAPPERS_H */ diff --git a/desktop_version/src/Constants.h b/desktop_version/src/Constants.h deleted file mode 100644 index 3a653d2a..00000000 --- a/desktop_version/src/Constants.h +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef CONSTANTS_H -#define CONSTANTS_H - -/* - * FIXME: These should be used everywhere... - * FIXME: This should include more constants! - */ - -#define SCREEN_WIDTH_TILES 40 -#define SCREEN_HEIGHT_TILES 30 - -#define SCREEN_WIDTH_PIXELS (SCREEN_WIDTH_TILES * 8) -#define SCREEN_HEIGHT_PIXELS (SCREEN_HEIGHT_TILES * 8) - -#define TILE_IDX(x, y) (x + y * SCREEN_WIDTH_TILES) - -/* 4 bytes per char, for UTF-8 encoding. */ -#define SCREEN_WIDTH_CHARS (SCREEN_WIDTH_TILES * 4) - -#endif /* CONSTANTS_H */ diff --git a/desktop_version/src/Credits.h b/desktop_version/src/Credits.h index a6c6f630..f626c809 100644 --- a/desktop_version/src/Credits.h +++ b/desktop_version/src/Credits.h @@ -5,84 +5,10 @@ namespace Credits { -/* Translators list; lines prefaced with a space aren't translatable */ -static const char* translators[] = { - "Arabic", - " Eternal Dream Arabization", - " Montassar Ghanmi", - " Mohammed Seif Eddine Chaib", - "Catalan", - " Eduard Ereza Martínez", - "Welsh", - " Morgan Roberts", - "German", - " Thomas Faust", - "Esperanto", - " Reese Rivers", - "Spanish (ES)", - " Felipe Mercader", - " Sara Marín", - "Spanish (LATAM)", - " LocQuest", - " Guido Di Carlo", - "Spanish (ARG.)", - " LocQuest", - " Guido Di Carlo", - "Persian", - " Amir Arzani", - " Masoud Varaste", - "French", - " Words of Magic", - "Irish", - " Úna-Minh Kavanagh", - " Seaghán Ó Modhráin", - " Davis Sandefur", - "Italian", - " gloc.team", - " Alain Dellepiane", - " Matteo Scarabelli", - " Lorenzo Bertolucci", - " Fabio Bortolotti", - "Japanese", - " Nicalis, Inc.", - " KabanFriends", - "Korean", - " Bada Im", - " Hyungseok Cho", - "Dutch", - " Dav999", - "Polish", - " Kuba Kallus", - "Brazilian Portuguese", - ">Translators", - " Lucas Araujo", - " Thiago Araujo", - ">Editing and LQA", - " Ivan Lopes", - " Lucas Nunes", - "European Portuguese", - " Locsmiths", - "Russian", - " TheMysticSword", - "Silesian", - " Kuba Kallus", - "Turkish", - " Engin İlkiz", - "Ukrainian", - " Olya Sushytska", - "Chinese (Simplified)", - " Sound of Mystery", - "Chinese (Traditional)", - " Sound of Mystery / craft", -}; - -/* Hardcoded pagesizes for the translator credits. Simplifies paging backwards and forwards */ -static const int translator_pagesize[] = { 6, 6, 12, 12, 10, 11, 10 }; - /* Terry's Patrons... */ static const char* superpatrons[] = { "Anders Ekermo", - "Andreas Kämper", + "Andreas K|mper", "Anthony Burch", "Bennett Foddy", "Brendan O'Sullivan", @@ -103,8 +29,8 @@ static const char* superpatrons[] = { static const char* patrons[] = { "Adam Wendt", - "Andreas Jörgensen", - "Ángel Louzao Penalva", + "Andreas J{rgensen", + "}ngel Louzao Penalva", "Ashley Burton", "Aubrey Hesselgren", "Bradley Rose", @@ -137,7 +63,7 @@ static const char* patrons[] = { "Joshua Buergel", "Joshua Hochner", "Kurt Ostfeld", - "Magnus Pålsson", + "Magnus P~lsson", "Mark Neschadimenko", "Matt Antonellis", "Matthew Reppert", @@ -156,27 +82,27 @@ static const char* patrons[] = { "Timothy Bragan", }; -/* CONTRIBUTORS.txt, again listed alphabetically (according to `sort`) by first name - * Misa is special; she gets to be listed in C++ credits alongside Ethan */ +/* CONTRIBUTORS.txt, again listed alphabetically (according to `sort`) by first name */ static const char* githubfriends[] = { - "Alexandra Fox", + "Misa \"Info Teddy\" Kai", + "", + "and", + "", "AlexApps99", "Allison Fleischer", + "AllyTally", "Brian Callahan", "Charlie Bruce", - "Christoph Böhmwalder", + "Christoph B{hmwalder", "Daniel Lee", "Dav999", "Elijah Stone", "Elliott Saltar", "Emmanuel Vadot", - "fraZ0R", "Fredrik Ljungdahl", - "iliana etaoin", - "Jules de Sartiges", "Keith Stellyes", "KyoZM", - "leo vriska", + "leo60228", "MAO3J1m0Op", "Malte Grimm", "Marvin Scholz", @@ -185,21 +111,18 @@ static const char* githubfriends[] = { "Nichole Mattera", "Pierre-Alain TORET", "Reese Rivers", - "Rémi Verschelde", - "SnDream", - "Space-G", - "Thomas Sänger", + "Remi Verschelde", // TODO: Change to "Rémi" if/when UTF-8 support is added + "Thomas S|nger", "Tynan Richards", "Wouter", "viri", "Vittorio Romeo", - "Yussur Mustafa Oraji", }; /* Calculate credits length, finally. */ -static const int creditmaxposition = 1348 + (10 * ( +static const int creditmaxposition = 1040 + (10 * ( SDL_arraysize(superpatrons) + SDL_arraysize(patrons) + SDL_arraysize(githubfriends) -)) + (12 * SDL_arraysize(translators)); +)); } /* namespace Credits */ diff --git a/desktop_version/src/CustomLevels.cpp b/desktop_version/src/CustomLevels.cpp deleted file mode 100644 index 58365528..00000000 --- a/desktop_version/src/CustomLevels.cpp +++ /dev/null @@ -1,1993 +0,0 @@ -#define CL_DEFINITION -#include "CustomLevels.h" - -#include -#include -#include -#include - -#include "Alloc.h" -#include "Constants.h" -#include "Editor.h" -#include "Enums.h" -#include "FileSystemUtils.h" -#include "Font.h" -#include "Game.h" -#include "Graphics.h" -#include "GraphicsUtil.h" -#include "KeyPoll.h" -#include "Localization.h" -#include "LocalizationStorage.h" -#include "Map.h" -#include "Screen.h" -#include "Script.h" -#include "UTF8.h" -#include "UtilityClass.h" -#include "Vlogging.h" -#include "XMLUtils.h" - -#ifdef _WIN32 -#define SCNx32 "x" -#define SCNu32 "u" -#else -#ifndef __STDC_FORMAT_MACROS -#define __STDC_FORMAT_MACROS -#endif -#ifndef _POSIX_SOURCE -#define _POSIX_SOURCE -#endif -#include -#endif - -#define VMULT(y) (y * SCREEN_WIDTH_TILES * maxwidth) -#define Y_INBOUNDS(y) (y >= 0 && y < SCREEN_HEIGHT_TILES * maxheight) - -RoomProperty::RoomProperty(void) -{ - tileset=0; - tilecol=0; - warpdir=0; - platx1=0; - platy1=0; - platx2=320; - platy2=240; - platv=4; - enemyx1=0; - enemyy1=0; - enemyx2=320; - enemyy2=240; - enemytype=0; - enemyv=0; - directmode=0; -} - -customlevelclass::customlevelclass(void) -{ - reset(); -} - -// comparison, not case sensitive. -static bool compare_nocase (std::string first, std::string second) -{ - unsigned int i=0; - while ( (iSDL_tolower(second[i])) - return false; - ++i; - } - if (first.length()"); - - //Encode general XML entities - size_t start_pos = 0; - while ((start_pos = value.find("&#", start_pos)) != std::string::npos) - { - if (start_pos + 2 >= value.length()) - { - return ""; - } - - bool hex = value[start_pos + 2] == 'x'; - size_t end = value.find(';', start_pos); - - if (end == std::string::npos) - { - return ""; - } - - size_t real_start = start_pos + 2 + ((int) hex); - std::string number(value.substr(real_start, end - real_start)); - - if (!is_positive_num(number.c_str(), hex)) - { - return ""; - } - - uint32_t character = 0; - if (hex) - { - SDL_sscanf(number.c_str(), "%" SCNx32, &character); - } - else - { - SDL_sscanf(number.c_str(), "%" SCNu32, &character); - } - value.replace(start_pos, end - start_pos + 1, UTF8_encode(character).bytes); - } - - return value; -} - -#define TAG_FINDER(NAME, TAG) \ -static std::string NAME(const std::string& buf) \ -{ \ - return find_tag(buf, "<" TAG ">", ""); \ -} - -TAG_FINDER(find_metadata, "MetaData") //only for checking that it exists - -TAG_FINDER(find_creator, "Creator") -TAG_FINDER(find_title, "Title") -TAG_FINDER(find_desc1, "Desc1") -TAG_FINDER(find_desc2, "Desc2") -TAG_FINDER(find_desc3, "Desc3") -TAG_FINDER(find_website, "website") -TAG_FINDER(find_font, "font") -TAG_FINDER(find_rtl, "rtl") - -/* For CliPlaytestArgs */ -TAG_FINDER(find_playtest, "Playtest") -TAG_FINDER(find_playx, "playx") -TAG_FINDER(find_playy, "playy") -TAG_FINDER(find_playrx, "playrx") -TAG_FINDER(find_playry, "playry") -TAG_FINDER(find_playgc, "playgc") -TAG_FINDER(find_playmusic, "playmusic") - -#undef TAG_FINDER - -static void levelMetaDataCallback(const char* filename) -{ - extern customlevelclass cl; - LevelMetaData temp; - std::string filename_ = filename; - - if (!endsWith(filename, ".vvvvvv") - || !FILESYSTEM_isFile(filename) - || FILESYSTEM_isMounted(filename)) - { - return; - } - - if (cl.getLevelMetaData(filename_, temp)) - { - cl.ListOfMetaData.push_back(temp); - } - else - { - vlog_warn("Level %s not found :(", filename_.c_str()); - } -} - -static void unloadZips(void) -{ - char** list = PHYSFS_getSearchPath(); - if (list == NULL) - { - return; - } - for (char** path = list; *path != NULL; path++) - { - if (SDL_strncmp(*path, "levels/", 7) == 0 && endsWith(*path, ".zip")) - { - PHYSFS_unmount(*path); - } - } - PHYSFS_freeList(list); -} - -void customlevelclass::getDirectoryData(void) -{ - - ListOfMetaData.clear(); - - FILESYSTEM_clearLevelDirError(); - - unloadZips(); - - loadZips(); - - FILESYSTEM_enumerateLevelDirFileNames(levelMetaDataCallback); - - for(size_t i = 0; i < ListOfMetaData.size(); i++) - { - for(size_t k = 0; k < ListOfMetaData.size(); k++) - { - if(compare_nocase(ListOfMetaData[i].title, ListOfMetaData[k].title )) - { - std::swap(ListOfMetaData[i] , ListOfMetaData[k]); - } - } - } - -} -bool customlevelclass::getLevelMetaDataAndPlaytestArgs(const std::string& _path, LevelMetaData& _data, CliPlaytestArgs* pt_args) -{ - unsigned char *uMem; - FILESYSTEM_loadFileToMemory(_path.c_str(), &uMem, NULL); - - if (uMem == NULL) - { - return false; - } - - std::string buf((char*) uMem); - - VVV_free(uMem); - - if (find_metadata(buf) == "") - { - vlog_warn("Couldn't load metadata for %s", _path.c_str()); - return false; - } - - _data.creator = find_creator(buf); - _data.creator_is_gettext = translate_creator(_data.creator); - _data.title = find_title(buf); - _data.title_is_gettext = translate_title(_data.title); - _data.Desc1 = find_desc1(buf); - _data.Desc2 = find_desc2(buf); - _data.Desc3 = find_desc3(buf); - _data.website = find_website(buf); - if (!font::find_main_font_by_name(find_font(buf).c_str(), &_data.level_main_font_idx)) - { - _data.level_main_font_idx = font::get_font_idx_8x8(); - } - _data.rtl = help.Int(find_rtl(buf).c_str()); - - - if (pt_args != NULL) - { - const std::string playtest = find_playtest(buf); - if (playtest == "") - { - pt_args->valid = false; - } - else - { - pt_args->valid = true; - pt_args->x = help.Int(find_playx(playtest).c_str()); - pt_args->y = help.Int(find_playy(playtest).c_str()); - pt_args->rx = help.Int(find_playrx(playtest).c_str()); - pt_args->ry = help.Int(find_playry(playtest).c_str()); - pt_args->gc = help.Int(find_playgc(playtest).c_str()); - pt_args->music = help.Int(find_playmusic(playtest).c_str()); - } - } - - _data.filename = _path; - return true; -} - -bool customlevelclass::getLevelMetaData(const std::string& _path, LevelMetaData& _data) -{ - return getLevelMetaDataAndPlaytestArgs(_path, _data, NULL); -} - -void customlevelclass::reset(void) -{ - version=2; //New smaller format change is 2 - - mapwidth=5; - mapheight=5; - - title="Untitled Level"; // Already translatable - creator="Unknown"; - - levmusic=0; - - customentities.clear(); - levmusic=0; - - for (int j = 0; j < maxheight; j++) - { - for (int i = 0; i < maxwidth; i++) - { - roomproperties[i+(j*maxwidth)].tileset=0; - roomproperties[i+(j*maxwidth)].tilecol=(i+j)%32; - roomproperties[i+(j*maxwidth)].roomname=""; - roomproperties[i+(j*maxwidth)].warpdir=0; - roomproperties[i+(j*maxwidth)].platx1=0; - roomproperties[i+(j*maxwidth)].platy1=0; - roomproperties[i+(j*maxwidth)].platx2=320; - roomproperties[i+(j*maxwidth)].platy2=240; - roomproperties[i+(j*maxwidth)].platv=4; - roomproperties[i+(j*maxwidth)].enemyx1=0; - roomproperties[i+(j*maxwidth)].enemyy1=0; - roomproperties[i+(j*maxwidth)].enemyx2=320; - roomproperties[i+(j*maxwidth)].enemyy2=240; - roomproperties[i+(j*maxwidth)].enemytype=0; - roomproperties[i+(j*maxwidth)].enemyv=0; - roomproperties[i+(j*maxwidth)].directmode=0; - } - } - - SDL_zeroa(contents); - - script.clearcustom(); - - onewaycol_override = false; - - script.textbox_colours.clear(); - script.add_default_colours(); - map.specialroomnames.clear(); - - player_colour = 0; -} - -const int* customlevelclass::loadlevel( int rxi, int ryi ) -{ - //Set up our buffer array to be picked up by mapclass - rxi -= 100; - ryi -= 100; - if(rxi<0)rxi+=mapwidth; - if(ryi<0)ryi+=mapheight; - if(rxi>=mapwidth)rxi-=mapwidth; - if(ryi>=mapheight)ryi-=mapheight; - - static int result[1200]; - - for (int j = 0; j < 30; j++) - { - for (int i = 0; i < 40; i++) - { - result[i + j*40] = gettile(rxi, ryi, i, j); - } - } - - return result; -} - -int customlevelclass::getlevelcol(const int tileset, const int tilecol) -{ - if(tileset==0) //Space Station - { - return tilecol; - } - else if(tileset==1) //Outside - { - return 32+tilecol; - } - else if(tileset==2) //Lab - { - return 40+tilecol; - } - else if(tileset==3) //Warp Zone - { - return 46+tilecol; - } - else if(tileset==4) //Ship - { - return 52+tilecol; - } - return 0; -} - -int customlevelclass::getenemycol(int t) -{ - switch(t) - { - //RED - case 3: - case 7: - case 12: - case 23: - case 28: - case 34: - case 42: - case 48: - case 58: - return 6; - break; - //GREEN - case 5: - case 9: - case 22: - case 25: - case 29: - case 31: - case 38: - case 46: - case 52: - case 53: - return 7; - break; - //BLUE - case 1: - case 6: - case 14: - case 27: - case 33: - case 44: - case 50: - case 57: - return 12; - break; - //YELLOW - case 4: - case 17: - case 24: - case 30: - case 37: - case 45: - case 51: - case 55: - return 9; - break; - //PURPLE - case 2: - case 11: - case 15: - case 19: - case 32: - case 36: - case 49: - return 20; - break; - //CYAN - case 8: - case 10: - case 13: - case 18: - case 26: - case 35: - case 41: - case 47: - case 54: - return 11; - break; - //PINK - case 16: - case 20: - case 39: - case 43: - case 56: - return 8; - break; - //ORANGE - case 21: - case 40: - return 17; - break; - default: - return 6; - break; - } -} - -int customlevelclass::getwarpbackground(int rx, int ry) -{ - const RoomProperty* const room = getroomprop(rx, ry); - switch(room->tileset) - { - case 0: //Space Station - switch(room->tilecol) - { - case 0: - return 3; - break; - case 1: - return 2; - break; - case 2: - return 1; - break; - case 3: - return 4; - break; - case 4: - return 5; - break; - case 5: - return 3; - break; - case 6: - return 1; - break; - case 7: - return 0; - break; - case 8: - return 5; - break; - case 9: - return 0; - break; - case 10: - return 2; - break; - case 11: - return 1; - break; - case 12: - return 5; - break; - case 13: - return 0; - break; - case 14: - return 3; - break; - case 15: - return 2; - break; - case 16: - return 4; - break; - case 17: - return 0; - break; - case 18: - return 3; - break; - case 19: - return 1; - break; - case 20: - return 4; - break; - case 21: - return 5; - break; - case 22: - return 1; - break; - case 23: - return 4; - break; - case 24: - return 5; - break; - case 25: - return 0; - break; - case 26: - return 3; - break; - case 27: - return 1; - break; - case 28: - return 5; - break; - case 29: - return 4; - break; - case 30: - return 5; - break; - case 31: - return 2; - break; - default: - return 6; - break; - } - break; - case 1: //Outside - switch(room->tilecol) - { - case 0: - return 3; - break; - case 1: - return 1; - break; - case 2: - return 0; - break; - case 3: - return 2; - break; - case 4: - return 4; - break; - case 5: - return 5; - break; - case 6: - return 2; - break; - case 7: - return 4; - break; - default: - return 6; - break; - } - break; - case 2: //Lab - switch(room->tilecol) - { - case 0: - return 0; - break; - case 1: - return 1; - break; - case 2: - return 2; - break; - case 3: - return 3; - break; - case 4: - return 4; - break; - case 5: - return 5; - break; - case 6: - return 6; - break; - default: - return 6; - break; - } - break; - case 3: //Warp Zone - switch(room->tilecol) - { - case 0: - return 0; - break; - case 1: - return 1; - break; - case 2: - return 2; - break; - case 3: - return 3; - break; - case 4: - return 4; - break; - case 5: - return 5; - break; - case 6: - return 6; - break; - default: - return 6; - break; - } - break; - case 4: //Ship - switch(room->tilecol) - { - case 0: - return 5; - break; - case 1: - return 0; - break; - case 2: - return 4; - break; - case 3: - return 2; - break; - case 4: - return 3; - break; - case 5: - return 1; - break; - case 6: - return 6; - break; - default: - return 6; - break; - } - break; - case 5: //Tower - return 6; - break; - default: - return 6; - break; - } -} - -int customlevelclass::gettileidx( - const int rx, - const int ry, - const int x, - const int y -) { - const int yoff = y + ry*30; - int mult; - int idx; - - if (Y_INBOUNDS(yoff)) - { - mult = VMULT(yoff); - } - else - { - mult = 0; - } - - idx = x + rx*40 + mult; - - return idx; -} - -void customlevelclass::settile( - const int rx, - const int ry, - const int x, - const int y, - const int t -) { - const int idx = gettileidx(rx, ry, x, y); - - if (!INBOUNDS_ARR(idx, contents)) - { - return; - } - - contents[idx] = t; -} - -int customlevelclass::gettile( - const int rx, - const int ry, - const int x, - const int y -) { - const int idx = gettileidx(rx, ry, x, y); - - if (!INBOUNDS_ARR(idx, contents)) - { - return 0; - } - - return contents[idx]; -} - -int customlevelclass::getabstile(const int x, const int y) -{ - int idx; - int yoff; - - if (Y_INBOUNDS(y)) - { - yoff = VMULT(y); - } - else - { - yoff = 0; - } - - idx = x + yoff; - - if (!INBOUNDS_ARR(idx, contents)) - { - return 0; - } - - return contents[idx]; -} - - -int customlevelclass::getroompropidx(const int rx, const int ry) -{ - return rx + ry*maxwidth; -} - -const RoomProperty* customlevelclass::getroomprop(const int rx, const int ry) -{ - const int idx = getroompropidx(rx, ry); - - if (INBOUNDS_ARR(idx, roomproperties)) - { - return &roomproperties[idx]; - } - - static RoomProperty blank; - blank.tileset = 1; - blank.directmode = 1; - blank.roomname.clear(); - - return ␣ -} - -#define FOREACH_PROP(NAME, TYPE) \ -void customlevelclass::setroom##NAME(const int rx, const int ry, const TYPE NAME) \ -{ \ - const int idx = getroompropidx(rx, ry); \ - \ - if (!INBOUNDS_ARR(idx, roomproperties)) \ - { \ - return; \ - } \ - \ - roomproperties[idx].NAME = NAME; \ -} - -ROOM_PROPERTIES - -#undef FOREACH_PROP - - -int customlevelclass::absfree( int x, int y ) -{ - //Returns 0 if tile is not a block, 1 otherwise, abs on grid - if(x>=0 && y>=0 && x=2 && getabstile(x, y)<80) - { - return 0; - } - if(getabstile(x, y)>=680) - { - return 0; - } - } - } - return 1; -} - -void customlevelclass::findstartpoint(void) -{ - //Ok! Scan the room for the closest checkpoint - int testeditor=-1; - //First up; is there a start point on this screen? - for(size_t i=0; iNextSiblingElement()) - { - const char* pKey = pElem->Value(); - const char* pText = pElem->GetText(); - if(pText == NULL) - { - pText = ""; - } - - if (SDL_strcmp(pKey, "MetaData") == 0) - { - - for( tinyxml2::XMLElement* subElem = pElem->FirstChildElement(); subElem; subElem= subElem->NextSiblingElement()) - { - const char* pKey_ = subElem->Value(); - const char* pText_ = subElem->GetText() ; - if(pText_ == NULL) - { - pText_ = ""; - } - - if(SDL_strcmp(pKey_, "Creator") == 0) - { - creator = pText_; - } - - if(SDL_strcmp(pKey_, "Title") == 0) - { - title = pText_; - } - - if(SDL_strcmp(pKey_, "Desc1") == 0) - { - Desc1 = pText_; - } - - if(SDL_strcmp(pKey_, "Desc2") == 0) - { - Desc2 = pText_; - } - - if(SDL_strcmp(pKey_, "Desc3") == 0) - { - Desc3 = pText_; - } - - if(SDL_strcmp(pKey_, "website") == 0) - { - website = pText_; - } - - if(SDL_strcmp(pKey_, "onewaycol_override") == 0) - { - onewaycol_override = help.Int(pText_); - } - - if(SDL_strcmp(pKey_, "font") == 0) - { - level_font_name = pText_; - } - - if(SDL_strcmp(pKey_, "rtl") == 0) - { - rtl = help.Int(pText_); - } - } - } - - if (SDL_strcmp(pKey, "mapwidth") == 0) - { - mapwidth = help.Int(pText); - } - if (SDL_strcmp(pKey, "mapheight") == 0) - { - mapheight = help.Int(pText); - } - if (SDL_strcmp(pKey, "levmusic") == 0) - { - levmusic = help.Int(pText); - } - - - if (SDL_strcmp(pKey, "contents") == 0 && pText[0] != '\0') - { - int x = 0; - int y = 0; - - char buffer[16]; - size_t start = 0; - - while (next_split_s(buffer, sizeof(buffer), &start, pText, ',')) - { - const int idx = x + maxwidth*40*y; - - if (INBOUNDS_ARR(idx, contents)) - { - contents[idx] = help.Int(buffer); - } - - ++x; - - if (x == mapwidth*40) - { - x = 0; - ++y; - } - } - } - - - if (SDL_strcmp(pKey, "edEntities") == 0) - { - for( tinyxml2::XMLElement* edEntityEl = pElem->FirstChildElement(); edEntityEl; edEntityEl=edEntityEl->NextSiblingElement()) - { - CustomEntity entity = CustomEntity(); - const char* text = edEntityEl->GetText(); - int global_x = 0; - int global_y = 0; - - if (text != NULL) - { - size_t len = SDL_strlen(text); - - // And now we come to the part where we have to deal with - // the terrible decisions of the past. - // - // For some reason, the closing tag of edentities generated - // by 2.2 and below has not only been put on a separate - // line, but also indented to match with the opening tag as - // well. Like this: - // - // contents - // - // - // Instead of doing contents. - // - // This is COMPLETELY terrible. This requires the XML to be - // parsed in an extremely specific and quirky way, which - // TinyXML-1 just happened to do. - // - // TinyXML-2 by default interprets the newline and the next - // indentation of whitespace literally, so you end up with - // tag contents that has a linefeed plus a bunch of extra - // spaces. You can't fix this by setting the whitespace - // mode to COLLAPSE_WHITESPACE, that does way more than - // TinyXML-1 ever did - it removes the leading whitespace - // from things like this, and - // collapses XML-encoded whitespace like - // this, which TinyXML-1 never did. - // - // Best solution here is to specifically hardcode removing - // the linefeed + the extremely specific amount of - // whitespace at the end of the contents. - - if (endsWith(text, "\n ")) // linefeed + exactly 12 spaces - { - // 12 spaces + 1 linefeed = 13 chars - len -= 13; - } - - entity.scriptname = std::string(text, len); - } - edEntityEl->QueryIntAttribute("x", &global_x); - edEntityEl->QueryIntAttribute("y", &global_y); - entity.rx = global_x / SCREEN_WIDTH_TILES; - entity.x = global_x % SCREEN_WIDTH_TILES; - entity.ry = global_y / SCREEN_HEIGHT_TILES; - entity.y = global_y % SCREEN_HEIGHT_TILES; - edEntityEl->QueryIntAttribute("t", &entity.t); - - edEntityEl->QueryIntAttribute("p1", &entity.p1); - edEntityEl->QueryIntAttribute("p2", &entity.p2); - edEntityEl->QueryIntAttribute("p3", &entity.p3); - edEntityEl->QueryIntAttribute("p4", &entity.p4); - edEntityEl->QueryIntAttribute("p5", &entity.p5); - edEntityEl->QueryIntAttribute("p6", &entity.p6); - - customentities.push_back(entity); - } - } - - if (SDL_strcmp(pKey, "levelMetaData") == 0) - { - int i = 0; - for( tinyxml2::XMLElement* edLevelClassElement = pElem->FirstChildElement(); edLevelClassElement; edLevelClassElement=edLevelClassElement->NextSiblingElement()) - { - if (!INBOUNDS_ARR(i, roomproperties)) - { - continue; - } - - if(edLevelClassElement->GetText() != NULL) - { - roomproperties[i].roomname = std::string(edLevelClassElement->GetText()) ; - } - - edLevelClassElement->QueryIntAttribute("tileset", &roomproperties[i].tileset); - edLevelClassElement->QueryIntAttribute("tilecol", &roomproperties[i].tilecol); - edLevelClassElement->QueryIntAttribute("platx1", &roomproperties[i].platx1); - edLevelClassElement->QueryIntAttribute("platy1", &roomproperties[i].platy1); - edLevelClassElement->QueryIntAttribute("platx2", &roomproperties[i].platx2); - edLevelClassElement->QueryIntAttribute("platy2", &roomproperties[i].platy2); - edLevelClassElement->QueryIntAttribute("platv", &roomproperties[i].platv); - edLevelClassElement->QueryIntAttribute("enemyx1", &roomproperties[i].enemyx1); - edLevelClassElement->QueryIntAttribute("enemyy1", &roomproperties[i].enemyy1); - edLevelClassElement->QueryIntAttribute("enemyx2", &roomproperties[i].enemyx2); - edLevelClassElement->QueryIntAttribute("enemyy2", &roomproperties[i].enemyy2); - edLevelClassElement->QueryIntAttribute("enemytype", &roomproperties[i].enemytype); - edLevelClassElement->QueryIntAttribute("enemyv", &roomproperties[i].enemyv); - edLevelClassElement->QueryIntAttribute("directmode", &roomproperties[i].directmode); - - edLevelClassElement->QueryIntAttribute("warpdir", &roomproperties[i].warpdir); - - i++; - - } - } - - if (SDL_strcmp(pKey, "script") == 0 && pText[0] != '\0') - { - Script script_; - bool headerfound = false; - - size_t start = 0; - size_t len = 0; - size_t prev_start = 0; - - while (next_split(&start, &len, &pText[start], '|')) - { - if (len > 0 && pText[prev_start + len - 1] == ':') - { - if (headerfound) - { - script.customscripts.push_back(script_); - } - - script_.name = std::string(&pText[prev_start], len - 1); - script_.contents.clear(); - headerfound = true; - - goto next; - } - - if (headerfound) - { - script_.contents.push_back(std::string(&pText[prev_start], len)); - } - -next: - prev_start = start; - } - - /* Add the last script */ - if (headerfound) - { - script.customscripts.push_back(script_); - } - } - - if (SDL_strcmp(pKey, "TextboxColours") == 0) - { - for (tinyxml2::XMLElement* textColourElement = pElem->FirstChildElement(); textColourElement; textColourElement = textColourElement->NextSiblingElement()) - { - if (SDL_strcmp(textColourElement->Value(), "colour") == 0) - { - int r = 255; - int g = 255; - int b = 255; - - textColourElement->QueryIntAttribute("r", &r); - textColourElement->QueryIntAttribute("g", &g); - textColourElement->QueryIntAttribute("b", &b); - - const char* name = textColourElement->Attribute("name"); - - if (name != NULL) - { - SDL_Colour colour; - colour.r = r; - colour.g = g; - colour.b = b; - - script.textbox_colours[name] = colour; - } - } - } - } - - if (SDL_strcmp(pKey, "SpecialRoomnames") == 0) - { - for (tinyxml2::XMLElement* roomnameElement = pElem->FirstChildElement(); roomnameElement; roomnameElement = roomnameElement->NextSiblingElement()) - { - const char* roomnameType = roomnameElement->Value(); - Roomname name; - name.x = 0; - name.y = 0; - name.flag = -1; - name.loop = false; - name.type = RoomnameType_STATIC; - name.progress = 0; - name.delay = 0; - if (SDL_strcmp(roomnameType, "transform") == 0) - { - name.type = RoomnameType_TRANSFORM; - name.delay = 2; - } - else if (SDL_strcmp(roomnameType, "glitch") == 0) - { - name.type = RoomnameType_GLITCH; - name.progress = 1; - name.delay = -1; - } - - name.text.clear(); - - roomnameElement->QueryIntAttribute("x", &name.x); - roomnameElement->QueryIntAttribute("y", &name.y); - roomnameElement->QueryIntAttribute("flag", &name.flag); - - roomnameElement->QueryBoolAttribute("loop", &name.loop); - - // Rooms start at (100, 100) instead of (0, 0), so offset the coordinates - name.x += 100; - name.y += 100; - - if (name.type == RoomnameType_STATIC) - { - const char* text = roomnameElement->GetText(); - if (text != NULL) - { - name.text.push_back(std::string(text)); - } - } - else - { - // Does it have children? - if (roomnameElement->FirstChildElement() == NULL) - { - continue; - } - for (tinyxml2::XMLElement* textElement = roomnameElement->FirstChildElement(); textElement; textElement = textElement->NextSiblingElement()) - { - if (SDL_strcmp(textElement->Value(), "text") == 0) - { - const char* text = textElement->GetText(); - if (text != NULL) - { - name.text.push_back(std::string(text)); - } - } - } - } - - map.specialroomnames.push_back(name); - } - } - - if (SDL_strcmp(pKey, "PlayerColour") == 0) - { - player_colour = help.Int(pText); - game.savecolour = player_colour; - } - } - - if (mapwidth < maxwidth) - { - /* Unscramble platv, since it was stored incorrectly - * in 2.2 and previous... */ - size_t i; - int x = 0; - int y = 0; - int temp_platv[numrooms]; - - for (i = 0; i < numrooms; ++i) - { - temp_platv[i] = roomproperties[i].platv; - } - - for (i = 0; i < numrooms; ++i) - { - if (x < mapwidth) - { - const int platv_idx = x + y * mapwidth; - if (INBOUNDS_ARR(platv_idx, temp_platv)) - { - roomproperties[i].platv = temp_platv[platv_idx]; - } - } - else - { - roomproperties[i].platv = 4; /* default */ - } - - ++x; - - if (x >= maxwidth) - { - x = 0; - ++y; - } - } - } - - loc::loadtext_custom(_path.c_str()); - font::load_custom(level_font_name.c_str()); - - version=2; - - return true; - -fail: - return false; -} - -bool customlevelclass::save(const std::string& _path) -{ - tinyxml2::XMLDocument doc; - - std::string newpath("levels/" + _path); - - // Try to preserve the XML of the currently-loaded one - bool already_exists = !ed.loaded_filepath.empty() - && FILESYSTEM_loadTiXml2Document(ed.loaded_filepath.c_str(), doc); - if (!already_exists && !ed.loaded_filepath.empty()) - { - vlog_error("Currently-loaded %s not found", ed.loaded_filepath.c_str()); - } - - ed.loaded_filepath = newpath; - - tinyxml2::XMLElement* msg; - - xml::update_declaration(doc); - - tinyxml2::XMLElement * root = xml::update_element(doc, "MapData"); - root->SetAttribute("version",version); - - xml::update_comment(root, " Save file "); - - tinyxml2::XMLElement * data = xml::update_element(root, "Data"); - - msg = xml::update_element(data, "MetaData"); - - //getUser - xml::update_tag(msg, "Creator", creator.c_str()); - - xml::update_tag(msg, "Title", title.c_str()); - - xml::update_tag(msg, "Created", version); - - xml::update_tag(msg, "Modified", modifier.c_str()); - - xml::update_tag(msg, "Modifiers", version); - - xml::update_tag(msg, "Desc1", Desc1.c_str()); - - xml::update_tag(msg, "Desc2", Desc2.c_str()); - - xml::update_tag(msg, "Desc3", Desc3.c_str()); - - xml::update_tag(msg, "website", website.c_str()); - - if (onewaycol_override) - { - xml::update_tag(msg, "onewaycol_override", onewaycol_override); - } - else - { - // Delete the element. I could just delete one, but just to be sure, - // I will delete all of them if there are more than one - tinyxml2::XMLElement* element; - while ((element = msg->FirstChildElement("onewaycol_override")) - != NULL) - { - doc.DeleteNode(element); - } - } - - if (level_font_name != "" && level_font_name != "font") - { - xml::update_tag(msg, "font", level_font_name.c_str()); - } - else - { - // Get rid of it completely, same as - tinyxml2::XMLElement* element; - while ((element = msg->FirstChildElement("font")) != NULL) - { - doc.DeleteNode(element); - } - } - - if (rtl) - { - xml::update_tag(msg, "rtl", rtl); - } - else - { - // Also get rid of this one... - tinyxml2::XMLElement* element; - while ((element = msg->FirstChildElement("rtl")) != NULL) - { - doc.DeleteNode(element); - } - } - - xml::update_tag(data, "mapwidth", mapwidth); - - xml::update_tag(data, "mapheight", mapheight); - - xml::update_tag(data, "levmusic", levmusic); - - //New save format - std::string contentsString=""; - for(int y = 0; y < mapheight*30; y++ ) - { - for(int x = 0; x < mapwidth*40; x++ ) - { - contentsString += help.String(getabstile(x, y)) + ","; - } - } - xml::update_tag(data, "contents", contentsString.c_str()); - - - msg = xml::update_element_delete_contents(data, "edEntities"); - for(size_t i = 0; i < customentities.size(); i++) - { - tinyxml2::XMLElement *edentityElement = doc.NewElement( "edentity" ); - const int global_x = customentities[i].rx * SCREEN_WIDTH_TILES + customentities[i].x; - const int global_y = customentities[i].ry * SCREEN_HEIGHT_TILES + customentities[i].y; - edentityElement->SetAttribute("x", global_x); - edentityElement->SetAttribute("y", global_y); - edentityElement->SetAttribute( "t", customentities[i].t); - edentityElement->SetAttribute( "p1", customentities[i].p1); - edentityElement->SetAttribute( "p2", customentities[i].p2); - edentityElement->SetAttribute( "p3", customentities[i].p3); - edentityElement->SetAttribute( "p4", customentities[i].p4); - edentityElement->SetAttribute( "p5", customentities[i].p5); - edentityElement->SetAttribute( "p6", customentities[i].p6); - edentityElement->LinkEndChild( doc.NewText( customentities[i].scriptname.c_str() )) ; - msg->LinkEndChild( edentityElement ); - } - - msg = xml::update_element_delete_contents(data, "levelMetaData"); - - int temp_platv[numrooms]; - for (size_t i = 0; i < SDL_arraysize(temp_platv); ++i) - { - temp_platv[i] = 4; /* default */ - } - - if (mapwidth < maxwidth) - { - /* Re-scramble platv, since it was stored incorrectly - * in 2.2 and previous... */ - size_t i; - int x = 0; - int y = 0; - for (i = 0; i < numrooms; ++i) - { - if (x < mapwidth) - { - const int platv_idx = x + y * mapwidth; - if (INBOUNDS_ARR(platv_idx, temp_platv)) - { - temp_platv[platv_idx] = roomproperties[i].platv; - } - } - - ++x; - - if (x >= mapwidth) - { - /* Skip to next actual row. */ - i += maxwidth - mapwidth; - x = 0; - ++y; - } - } - } - - for(size_t i = 0; i < SDL_arraysize(roomproperties); i++) - { - tinyxml2::XMLElement *roompropertyElement = doc.NewElement( "edLevelClass" ); - roompropertyElement->SetAttribute( "tileset", roomproperties[i].tileset); - roompropertyElement->SetAttribute( "tilecol", roomproperties[i].tilecol); - roompropertyElement->SetAttribute( "platx1", roomproperties[i].platx1); - roompropertyElement->SetAttribute( "platy1", roomproperties[i].platy1); - roompropertyElement->SetAttribute( "platx2", roomproperties[i].platx2); - roompropertyElement->SetAttribute( "platy2", roomproperties[i].platy2); - roompropertyElement->SetAttribute( "platv", temp_platv[i]); - roompropertyElement->SetAttribute( "enemyx1", roomproperties[i].enemyx1); - roompropertyElement->SetAttribute( "enemyy1", roomproperties[i].enemyy1); - roompropertyElement->SetAttribute( "enemyx2", roomproperties[i].enemyx2); - roompropertyElement->SetAttribute( "enemyy2", roomproperties[i].enemyy2); - roompropertyElement->SetAttribute( "enemytype", roomproperties[i].enemytype); - roompropertyElement->SetAttribute( "enemyv", roomproperties[i].enemyv); - roompropertyElement->SetAttribute( "directmode", roomproperties[i].directmode); - roompropertyElement->SetAttribute( "warpdir", roomproperties[i].warpdir); - - roompropertyElement->LinkEndChild( doc.NewText( roomproperties[i].roomname.c_str() )) ; - msg->LinkEndChild( roompropertyElement ); - } - - std::string scriptString; - for(size_t i = 0; i < script.customscripts.size(); i++) - { - Script& script_ = script.customscripts[i]; - - scriptString += script_.name + ":|"; - for (size_t ii = 0; ii < script_.contents.size(); ++ii) - { - scriptString += script_.contents[ii]; - - // Inserts a space if the line ends with a : - if (script_.contents[ii].length() && *script_.contents[ii].rbegin() == ':') - { - scriptString += " "; - } - - scriptString += "|"; - } - } - xml::update_tag(data, "script", scriptString.c_str()); - - - if (player_colour != 0) - { - xml::update_tag(data, "PlayerColour", player_colour); - } - else - { - // Get rid of this one as well, since older levels don't have this property anyways - tinyxml2::XMLElement* element; - while ((element = data->FirstChildElement("PlayerColour")) != NULL) - { - doc.DeleteNode(element); - } - } - - return FILESYSTEM_saveTiXml2Document(newpath.c_str(), doc); -} - -void customlevelclass::generatecustomminimap(void) -{ - const MapRenderData data = map.get_render_data(); - - // Start drawing the minimap - - SDL_Texture* target = SDL_GetRenderTarget(gameScreen.m_renderer); - graphics.set_render_target(graphics.images[IMAGE_CUSTOMMINIMAP]); - graphics.clear(); - - // Scan over the map size - for (int j2 = data.starty; j2 < data.starty + data.height; j2++) - { - for (int i2 = data.startx; i2 < data.startx + data.width; i2++) - { - std::vector dark_points; - std::vector light_points; - - bool dark = getroomprop(i2, j2)->tileset == 1; - - // Ok, now scan over each square - for (int j = 0; j < 9 * data.zoom; j++) - { - for (int i = 0; i < 12 * data.zoom; i++) - { - int tile; - switch (data.zoom) - { - case 4: - tile = absfree( - int(i * 0.83) + (i2 * 40), - int(j * 0.83) + (j2 * 30) - ); - break; - case 2: - tile = absfree( - int(i * 1.6) + (i2 * 40), - int(j * 1.6) + (j2 * 30) - ); - break; - default: - tile = absfree( - 3 + (i * 3) + (i2 * 40), - (j * 3) + (j2 * 30) - ); - break; - } - - if (tile >= 1) - { - // Add this pixel - SDL_Point point = { ((i2 - data.startx) * 12 * data.zoom) + i, ((j2 - data.starty) * 9 * data.zoom) + j }; - if (dark) - { - dark_points.push_back(point); - } - else - { - light_points.push_back(point); - } - } - } - } - // Draw them all at once - if (!dark_points.empty()) - { - graphics.draw_points(dark_points.data(), dark_points.size(), 96, 96, 96); - } - if (!light_points.empty()) - { - graphics.draw_points(light_points.data(), light_points.size(), 196, 196, 196); - } - } - } - - graphics.set_render_target(target); -} - -// Return a graphics-ready color based off of the given tileset and tilecol -// Much kudos to Dav999 for saving me a lot of work, because I stole these colors from const.lua in Ved! -Info Teddy -SDL_Color customlevelclass::getonewaycol(const int rx, const int ry) -{ - const RoomProperty* const room = getroomprop(rx, ry); - switch (room->tileset) { - - case 0: // Space Station - switch (room->tilecol) { - case -1: - return graphics.getRGB(109, 109, 109); - case 0: - return graphics.getRGB(131, 141, 235); - case 1: - return graphics.getRGB(227, 140, 227); - case 2: - return graphics.getRGB(242, 126, 151); - case 3: - return graphics.getRGB(229, 235, 133); - case 4: - return graphics.getRGB(148, 238, 130); - case 5: - return graphics.getRGB(140, 165, 227); - case 6: - return graphics.getRGB(227, 140, 148); - case 7: - return graphics.getRGB(140, 173, 228); - case 8: - return graphics.getRGB(142, 235, 137); - case 9: - return graphics.getRGB(137, 235, 206); - case 10: - return graphics.getRGB(235, 139, 223); - case 11: - return graphics.getRGB(238, 130, 138); - case 12: - return graphics.getRGB(137, 235, 178); - case 13: - return graphics.getRGB(125, 205, 247); - case 14: - return graphics.getRGB(190, 137, 235); - case 15: - return graphics.getRGB(235, 137, 206); - case 16: - return graphics.getRGB(229, 247, 127); - case 17: - return graphics.getRGB(127, 200, 247); - case 18: - return graphics.getRGB(197, 137, 235); - case 19: - return graphics.getRGB(235, 131, 175); - case 20: - return graphics.getRGB(242, 210, 123); - case 21: - return graphics.getRGB(131, 235, 158); - case 22: - return graphics.getRGB(242, 126, 151); - case 23: - return graphics.getRGB(219, 243, 123); - case 24: - return graphics.getRGB(131, 234, 145); - case 25: - return graphics.getRGB(131, 199, 234); - case 26: - return graphics.getRGB(141, 131, 234); - case 27: - return graphics.getRGB(226, 140, 144); - case 28: - return graphics.getRGB(129, 236, 144); - case 29: - return graphics.getRGB(235, 231, 131); - case 30: - return graphics.getRGB(153, 235, 131); - case 31: - return graphics.getRGB(207, 131, 235); - } - break; - - case 1: // Outside - switch (room->tilecol) { - case 0: - return graphics.getRGB(57, 86, 140); - case 1: - return graphics.getRGB(156, 42, 42); - case 2: - return graphics.getRGB(42, 156, 155); - case 3: - return graphics.getRGB(125, 36, 162); - case 4: - return graphics.getRGB(191, 198, 0); - case 5: - return graphics.getRGB(0, 198, 126); - case 6: - return graphics.getRGB(224, 110, 177); - case 7: - return graphics.getRGB(255, 142, 87); - } - break; - - case 2: // Lab - switch (room->tilecol) { - case 0: - return graphics.getRGB(0, 165, 206); - case 1: - return graphics.getRGB(206, 5, 0); - case 2: - return graphics.getRGB(222, 0, 173); - case 3: - return graphics.getRGB(27, 67, 255); - case 4: - return graphics.getRGB(194, 206, 0); - case 5: - return graphics.getRGB(0, 206, 39); - case 6: - return graphics.getRGB(0, 165, 206); - } - break; - - case 3: // Warp Zone - switch (room->tilecol) { - case 0: - return graphics.getRGB(113, 178, 197); - case 1: - return graphics.getRGB(197, 113, 119); - case 2: - return graphics.getRGB(196, 113, 197); - case 3: - return graphics.getRGB(149, 113, 197); - case 4: - return graphics.getRGB(197, 182, 113); - case 5: - return graphics.getRGB(141, 197, 113); - case 6: - return graphics.getRGB(109, 109, 109); - } - break; - - case 4: // Ship - switch (room->tilecol) { - case 0: - return graphics.getRGB(0, 206, 39); - case 1: - return graphics.getRGB(0, 165, 206); - case 2: - return graphics.getRGB(194, 206, 0); - case 3: - return graphics.getRGB(206, 0, 160); - case 4: - return graphics.getRGB(27, 67, 255); - case 5: - return graphics.getRGB(206, 5, 0); - } - break; - - } - - // Uh, I guess return solid white - return graphics.getRGB(255, 255, 255); -} - -// This version detects the room automatically -SDL_Color customlevelclass::getonewaycol(void) -{ - if (game.gamestate == EDITORMODE) - { - return getonewaycol(ed.levx, ed.levy); - } - else if (map.custommode) - { - return getonewaycol(game.roomx - 100, game.roomy - 100); - } - - // Uh, I guess return solid white - return graphics.getRGB(255, 255, 255); -} - -static SDL_INLINE bool inbounds(const CustomEntity* entity) -{ - extern customlevelclass cl; - return entity->x >= 0 - && entity->y >= 0 - && entity->x < cl.mapwidth * SCREEN_WIDTH_TILES - && entity->y < cl.mapheight * SCREEN_HEIGHT_TILES; -} - -int customlevelclass::numtrinkets(void) -{ - int temp = 0; - for (size_t i = 0; i < customentities.size(); i++) - { - if (customentities[i].t == 9 && inbounds(&customentities[i])) - { - temp++; - } - } - return temp; -} - -int customlevelclass::numcrewmates(void) -{ - int temp = 0; - for (size_t i = 0; i < customentities.size(); i++) - { - if (customentities[i].t == 15 && inbounds(&customentities[i])) - { - temp++; - } - } - return temp; -} diff --git a/desktop_version/src/CustomLevels.h b/desktop_version/src/CustomLevels.h deleted file mode 100644 index 22285182..00000000 --- a/desktop_version/src/CustomLevels.h +++ /dev/null @@ -1,186 +0,0 @@ -#ifndef CUSTOMLEVELS_H -#define CUSTOMLEVELS_H - -#include -#include -#include - -class CustomEntity -{ -public: - int rx, ry; - int x, y, t; - //parameters - int p1, p2, p3, p4, p5, p6; - std::string scriptname; -}; - - -#define ROOM_PROPERTIES \ - FOREACH_PROP(tileset, int) \ - FOREACH_PROP(tilecol, int) \ - FOREACH_PROP(roomname, std::string) \ - FOREACH_PROP(warpdir, int) \ - FOREACH_PROP(platx1, int) \ - FOREACH_PROP(platy1, int) \ - FOREACH_PROP(platx2, int) \ - FOREACH_PROP(platy2, int) \ - FOREACH_PROP(platv, int) \ - FOREACH_PROP(enemyx1, int) \ - FOREACH_PROP(enemyy1, int) \ - FOREACH_PROP(enemyx2, int) \ - FOREACH_PROP(enemyy2, int) \ - FOREACH_PROP(enemytype, int) \ - FOREACH_PROP(enemyv, int) \ - FOREACH_PROP(directmode, int) - -class RoomProperty -{ -public: - RoomProperty(void); -#define FOREACH_PROP(NAME, TYPE) TYPE NAME; - ROOM_PROPERTIES -#undef FOREACH_PROP -}; - -struct LevelMetaData -{ - std::string title; - std::string creator; - std::string Desc1; - std::string Desc2; - std::string Desc3; - std::string website; - std::string filename; - - std::string modifier; - std::string timeCreated; - std::string timeModified; - - int version; - - /* true if a system "Untitled Level"/"Unknown" - * was stored in this struct (for the levels list) */ - bool title_is_gettext; - bool creator_is_gettext; - - /* This is for the metadata in the levels list, - * so it will only be a main font (no custom ones). */ - uint8_t level_main_font_idx; - bool rtl; -}; - -struct CliPlaytestArgs -{ - int x; - int y; - int rx; - int ry; - int gc; - int music; - bool valid; -}; - - -extern std::vector customentities; - -class customlevelclass -{ -public: - customlevelclass(void); - - std::string title; - std::string creator; - std::string modifier; - std::string Desc1; - std::string Desc2; - std::string Desc3; - std::string website; - - std::vector ListOfMetaData; - - void loadZips(void); - void getDirectoryData(void); - bool getLevelMetaDataAndPlaytestArgs(const std::string& filename, LevelMetaData& _data, CliPlaytestArgs* pt_args); - bool getLevelMetaData(const std::string& filename, LevelMetaData& _data); - - void reset(void); - const int* loadlevel(int rxi, int ryi); - - int gettileidx( - const int rx, - const int ry, - const int x, - const int y - ); - void settile( - const int rx, - const int ry, - const int x, - const int y, - const int t - ); - int gettile( - const int rx, - const int ry, - const int x, - const int y - ); - int getabstile(const int x, const int y); - - int getroompropidx(const int rx, const int ry); - const RoomProperty* getroomprop(const int rx, const int ry); -#define FOREACH_PROP(NAME, TYPE) \ - void setroom##NAME(const int rx, const int ry, const TYPE NAME); - ROOM_PROPERTIES -#undef FOREACH_PROP - - int absfree(int x, int y); - - bool load(std::string _path); - bool save(const std::string& _path); - - void generatecustomminimap(void); - - int findtrinket(int t); - int findcrewmate(int t); - int findwarptoken(int t); - void findstartpoint(void); - int getlevelcol(const int tileset, const int tilecol); - int getenemycol(int t); - - //Colouring stuff - int getwarpbackground(int rx, int ry); - - static const int maxwidth = 20, maxheight = 20; //Special; the physical max the engine allows - static const int numrooms = maxwidth * maxheight; - int contents[40 * 30 * numrooms]; - int numtrinkets(void); - int numcrewmates(void); - RoomProperty roomproperties[numrooms]; //Maxwidth*maxheight - - int levmusic; - int mapwidth, mapheight; //Actual width and height of stage - - std::string level_font_name; - bool rtl; - - int version; - - SDL_Color getonewaycol(int rx, int ry); - SDL_Color getonewaycol(void); - bool onewaycol_override; - - int player_colour; -}; - -bool translate_title(const std::string& title); - -bool translate_creator(const std::string& creator); - -#ifndef CL_DEFINITION -extern customlevelclass cl; -#endif - -#endif /* CUSTOMLEVELS_H */ - diff --git a/desktop_version/src/Editor.cpp b/desktop_version/src/Editor.cpp deleted file mode 100644 index fe89d98d..00000000 --- a/desktop_version/src/Editor.cpp +++ /dev/null @@ -1,4342 +0,0 @@ -#define ED_DEFINITION -#include "Editor.h" - -#include -#include - -#include "Constants.h" -#include "CustomLevels.h" -#include "DeferCallbacks.h" -#include "Entity.h" -#include "Enums.h" -#include "Font.h" -#include "Game.h" -#include "Graphics.h" -#include "GraphicsUtil.h" -#include "KeyPoll.h" -#include "Localization.h" -#include "Map.h" -#include "Maths.h" -#include "Music.h" -#include "Screen.h" -#include "Script.h" -#include "UTF8.h" -#include "UtilityClass.h" -#include "VFormat.h" -#include "Vlogging.h" - -#define SCRIPT_LINE_PADDING 6 - -editorclass::editorclass(void) -{ - reset(); - - register_tool(EditorTool_WALLS, "Walls", "1", SDLK_1, false); - register_tool(EditorTool_BACKING, "Backing", "2", SDLK_2, false); - register_tool(EditorTool_SPIKES, "Spikes", "3", SDLK_3, false); - register_tool(EditorTool_TRINKETS, "Trinkets", "4", SDLK_4, false); - register_tool(EditorTool_CHECKPOINTS, "Checkpoints", "5", SDLK_5, false); - register_tool(EditorTool_DISAPPEARING_PLATFORMS, "Disappearing Platforms", "6", SDLK_6, false); - register_tool(EditorTool_CONVEYORS, "Conveyors", "7", SDLK_7, false); - register_tool(EditorTool_MOVING_PLATFORMS, "Moving Platforms", "8", SDLK_8, false); - register_tool(EditorTool_ENEMIES, "Enemies", "9", SDLK_9, false); - register_tool(EditorTool_GRAVITY_LINES, "Gravity Lines", "0", SDLK_0, false); - register_tool(EditorTool_ROOMTEXT, "Roomtext", "R", SDLK_r, false); - register_tool(EditorTool_TERMINALS, "Terminals", "T", SDLK_t, false); - register_tool(EditorTool_SCRIPTS, "Script Boxes", "Y", SDLK_y, false); - register_tool(EditorTool_WARP_TOKENS, "Warp Tokens", "U", SDLK_u, false); - register_tool(EditorTool_WARP_LINES, "Warp Lines", "I", SDLK_i, false); - register_tool(EditorTool_CREWMATES, "Crewmates", "O", SDLK_o, false); - register_tool(EditorTool_START_POINT, "Start Point", "P", SDLK_p, false); - - static const short basic[] = { - 121, 121, 121, 121, 121, 121, 121, 160, 121, 121, 121, 121, 121, 121, 121, - 160, 121, 121, 121, 121, 121, 121, 121, 160, 121, 121, 121, 121, 80, 80, 80, - 120, 121, 121, 121, 121, 121, 121, 121, 160, 121, 121, 121, 121, 121, 121, - 121, 160, 121, 121, 121, 121, 121, 121, 121, 160, 121, 121, 121, 121, 80, 80, - 80, 120, 121, 121, 121, 121, 121, 121, 121, 160, 121, 121, 121, 121, 121, 121, - 121, 160, 121, 121, 121, 121, 121, 121, 121, 160, 121, 121, 121, 121, 80, 80, - 80, 120, 121, 121, 121, 121, 121, 121, 121, 160, 121, 121, 121, 121, 121, 121, - 121, 160, 82, 82, 82, 82, 82, 82, 82, 0, 82, 82, 82, 82, 81, 81, 81, 42, 121, - 121, 121, 121, 121, 121, 121, 160, 121, 121, 121, 121, 121, 121, 121, 160, 121, - 121, 121, 121, 121, 121, 121, 160, 121, 121, 121, 121, 80, 80, 80, 120, 121, - 121, 121, 121, 121, 121, 121, 160, 121, 121, 121, 121, 121, 121, 121, 160, 121, - 121, 121, 121, 121, 121, 121, 160, 121, 121, 121, 121, 80, 80, 80, 120, 121, - 162, 121, 162, 121, 162, 121, 161, 121, 162, 121, 162, 121, 162, 121, 161, 121, - 162, 121, 162, 121, 162, 121, 161, 121, 162, 121, 162, 80, 0, 80, 2, 121, 162, - 121, 162, 121, 162, 121, 161, 121, 162, 121, 162, 121, 162, 121, 161, 82, 122, - 82, 122, 82, 122, 82, 1, 82, 122, 82, 122, 81, 41, 81, 0 - }; - - std::vector basic_vec; - basic_vec.assign(basic, basic + SDL_arraysize(basic)); - autotile_types["basic"] = basic_vec; - - static const short lab_cyan[] = { - 121, 184, 121, 184, 24, 160, 24, 160, 121, 184, 121, 184, 24, 160, 24, 160, 104, - 144, 104, 144, 80, 120, 80, 145, 104, 144, 104, 144, 80, 185, 80, 120, 121, 184, - 121, 184, 24, 160, 24, 160, 121, 184, 121, 184, 24, 160, 24, 160, 104, 144, 104, - 144, 80, 120, 80, 145, 104, 144, 104, 144, 80, 185, 80, 120, 26, 162, 26, 162, 25, - 161, 25, 106, 26, 162, 26, 162, 25, 161, 25, 106, 82, 122, 82, 186, 81, 0, 81, 0, - 82, 122, 82, 122, 66, 0, 66, 0, 26, 162, 26, 162, 25, 161, 25, 106, 26, 162, 26, - 162, 25, 161, 25, 106, 82, 186, 82, 186, 65, 0, 65, 0, 82, 186, 82, 186, 81, 199, - 81, 42, 121, 184, 121, 184, 24, 160, 24, 160, 121, 184, 121, 184, 24, 160, 24, 160, - 104, 144, 104, 144, 80, 120, 80, 145, 104, 144, 104, 144, 80, 185, 80, 120, 121, 184, - 121, 184, 24, 160, 24, 160, 121, 184, 121, 184, 24, 160, 24, 160, 104, 144, 104, 144, - 80, 120, 80, 145, 104, 144, 104, 144, 80, 185, 80, 120, 26, 162, 26, 162, 25, 105, 25, - 161, 26, 162, 26, 162, 25, 105, 25, 161, 82, 146, 82, 146, 81, 0, 81, 64, 82, 146, 82, - 146, 66, 0, 66, 2, 26, 162, 26, 162, 25, 105, 25, 161, 26, 162, 26, 162, 25, 105, 25, - 161, 82, 122, 82, 122, 65, 0, 65, 1, 82, 122, 82, 122, 81, 41, 81, 0 - }; - - std::vector lab_cyan_vec; - lab_cyan_vec.assign(lab_cyan, lab_cyan + SDL_arraysize(lab_cyan)); - autotile_types["lab_cyan"] = lab_cyan_vec; - - static const short lab_red[] = { - 121, 190, 121, 190, 30, 160, 30, 160, 121, 190, 121, 190, 30, 160, 30, 160, 110, 150, - 110, 150, 80, 120, 80, 151, 110, 150, 110, 150, 80, 191, 80, 120, 121, 190, 121, 190, - 30, 160, 30, 160, 121, 190, 121, 190, 30, 160, 30, 160, 110, 150, 110, 150, 80, 120, 80, - 151, 110, 150, 110, 150, 80, 191, 80, 120, 32, 162, 32, 162, 31, 161, 31, 112, 32, 162, - 32, 162, 31, 161, 31, 112, 82, 122, 82, 122, 81, 0, 81, 0, 82, 122, 82, 122, 72, 0, 81, - 0, 32, 162, 32, 162, 31, 161, 31, 112, 32, 162, 32, 162, 31, 161, 31, 112, 82, 192, 82, - 192, 71, 0, 71, 0, 82, 192, 82, 192, 81, 70, 81, 42, 121, 190, 121, 190, 30, 160, 30, - 160, 121, 190, 121, 190, 30, 160, 30, 160, 110, 150, 110, 150, 80, 120, 80, 151, 110, - 150, 110, 150, 80, 191, 80, 120, 121, 190, 121, 190, 30, 160, 30, 160, 121, 190, 121, - 190, 30, 160, 30, 160, 110, 150, 110, 150, 80, 120, 121, 151, 110, 150, 110, 150, 80, - 191, 80, 120, 32, 162, 32, 162, 31, 111, 31, 161, 32, 162, 32, 162, 31, 111, 31, 161, - 82, 152, 82, 152, 81, 0, 81, 76, 82, 152, 82, 152, 72, 0, 72, 2, 32, 162, 32, 162, 31, - 111, 31, 161, 32, 162, 32, 162, 31, 111, 31, 161, 82, 122, 82, 122, 71, 156, 71, 1, 82, - 122, 82, 122, 81, 41, 81, 0 - }; - - std::vector lab_red_vec; - lab_red_vec.assign(lab_red, lab_red + SDL_arraysize(lab_red)); - autotile_types["lab_red"] = lab_red_vec; - - static const short lab_pink[] = { - 121, 184, 121, 184, 24, 160, 24, 160, 121, 184, 121, 184, 24, 160, 24, 160, 104, 144, - 104, 144, 80, 120, 80, 145, 104, 144, 104, 144, 80, 185, 80, 120, 121, 184, 121, 184, - 24, 160, 24, 160, 121, 184, 121, 184, 24, 160, 24, 160, 104, 144, 104, 144, 80, 120, - 80, 145, 104, 144, 104, 144, 80, 185, 80, 120, 26, 162, 26, 162, 25, 161, 25, 106, 26, - 162, 26, 162, 25, 161, 25, 106, 82, 122, 82, 122, 81, 0, 81, 0, 82, 122, 82, 122, 66, - 0, 66, 0, 26, 162, 26, 162, 25, 161, 25, 106, 26, 162, 26, 162, 25, 161, 25, 106, 82, - 186, 82, 186, 65, 0, 65, 0, 82, 122, 82, 122, 81, 64, 81, 42, 121, 184, 121, 184, 24, - 160, 24, 160, 121, 184, 121, 184, 24, 160, 24, 160, 104, 144, 104, 144, 80, 120, 80, - 145, 104, 144, 104, 144, 80, 185, 80, 120, 121, 184, 121, 184, 24, 160, 24, 160, 121, - 184, 121, 184, 24, 160, 24, 160, 104, 144, 104, 144, 80, 120, 80, 145, 104, 144, 104, - 144, 80, 185, 80, 120, 26, 162, 26, 162, 25, 105, 25, 161, 26, 162, 26, 162, 25, 105, - 25, 161, 82, 146, 82, 146, 81, 0, 81, 113, 82, 146, 82, 146, 66, 0, 66, 2, 26, 162, - 26, 162, 25, 105, 25, 161, 26, 162, 26, 162, 25, 105, 25, 161, 82, 122, 82, 122, 65, - 0, 65, 1, 82, 122, 82, 122, 81, 41, 81, 0 - }; - - std::vector lab_pink_vec; - lab_pink_vec.assign(lab_pink, lab_pink + SDL_arraysize(lab_pink)); - autotile_types["lab_pink"] = lab_pink_vec; - - static const short lab_yellow[] = { - 121, 175, 121, 175, 15, 160, 15, 160, 121, 175, 121, 175, 15, 160, 15, 160, 95, - 135, 95, 135, 80, 120, 80, 136, 95, 135, 95, 135, 80, 176, 80, 120, 121, 175, - 121, 175, 15, 160, 15, 160, 121, 175, 121, 175, 15, 160, 15, 160, 95, 135, 95, - 135, 80, 120, 80, 136, 95, 135, 95, 135, 80, 176, 80, 120, 17, 162, 17, 162, 16, - 161, 16, 97, 17, 162, 17, 162, 16, 161, 16, 97, 82, 122, 82, 122, 81, 0, 81, 0, - 82, 122, 82, 122, 57, 0, 57, 0, 17, 162, 17, 162, 16, 161, 16, 97, 17, 162, 17, - 162, 16, 161, 16, 97, 82, 177, 82, 177, 56, 0, 56, 0, 82, 177, 82, 177, 81, 55, - 81, 42, 121, 175, 121, 175, 15, 160, 15, 160, 121, 175, 121, 175, 15, 160, 15, - 160, 95, 135, 95, 135, 80, 120, 80, 136, 95, 135, 95, 135, 80, 176, 80, 120, 121, - 175, 121, 175, 15, 160, 15, 160, 121, 175, 121, 175, 15, 160, 15, 160, 95, 135, - 95, 135, 80, 120, 80, 136, 95, 135, 95, 135, 80, 176, 80, 120, 17, 162, 17, 162, - 16, 96, 16, 161, 17, 162, 17, 162, 16, 96, 16, 161, 82, 137, 82, 137, 81, 0, 81, - 27, 82, 137, 82, 137, 57, 0, 57, 2, 17, 162, 17, 162, 16, 162, 16, 161, 17, 162, - 17, 162, 16, 96, 16, 161, 82, 122, 82, 122, 56, 0, 82, 1, 82, 122, 82, 122, 81, - 41, 81, 0 - }; - - std::vector lab_yellow_vec; - lab_yellow_vec.assign(lab_yellow, lab_yellow + SDL_arraysize(lab_yellow)); - autotile_types["lab_yellow"] = lab_yellow_vec; - - static const short lab_green[] = { - 121, 181, 121, 181, 21, 160, 21, 160, 121, 181, 121, 181, 21, 160, 21, 160, 101, - 141, 101, 141, 80, 120, 80, 142, 101, 141, 101, 141, 80, 182, 80, 120, 121, 181, - 121, 181, 21, 160, 21, 160, 121, 181, 121, 181, 21, 160, 21, 160, 101, 141, 101, - 141, 80, 120, 80, 142, 101, 141, 101, 141, 80, 182, 80, 120, 23, 162, 23, 162, 22, - 161, 22, 103, 23, 162, 23, 162, 22, 161, 22, 103, 82, 122, 82, 122, 81, 0, 81, 0, - 82, 122, 82, 122, 63, 0, 63, 0, 23, 162, 23, 162, 22, 161, 22, 103, 23, 162, 23, - 162, 22, 161, 22, 103, 82, 183, 82, 183, 62, 0, 62, 0, 82, 183, 82, 183, 81, 61, - 81, 42, 121, 181, 121, 181, 21, 160, 21, 160, 121, 181, 121, 181, 21, 160, 21, - 160, 101, 141, 101, 141, 80, 120, 80, 142, 101, 141, 101, 141, 80, 182, 80, 120, - 121, 181, 121, 181, 21, 160, 21, 160, 121, 181, 121, 181, 21, 160, 21, 160, 101, - 141, 101, 141, 80, 120, 80, 142, 101, 141, 101, 141, 80, 182, 80, 120, 23, 162, - 23, 162, 22, 102, 22, 161, 23, 162, 23, 162, 22, 102, 22, 161, 82, 143, 82, 143, - 81, 0, 81, 0, 82, 143, 82, 143, 63, 0, 63, 2, 23, 162, 23, 162, 22, 102, 22, 161, - 23, 162, 23, 162, 22, 102, 22, 161, 82, 122, 82, 122, 62, 0, 62, 1, 82, 122, 82, - 122, 81, 41, 81, 0 - }; - - std::vector lab_green_vec; - lab_green_vec.assign(lab_green, lab_green + SDL_arraysize(lab_green)); - autotile_types["lab_green"] = lab_green_vec; - - static const short outside[] = { - 2, 0, 2, 0, 1, 2, 1, 2, 2, 0, 2, 2, 1, 2, 1, 2, 0, 0, 0, 0, 2, 2, 2, 2, 0, 0, 0, - 0, 2, 2, 2, 2, 2, 0, 2, 0, 1, 2, 1, 2, 2, 0, 2, 0, 1, 2, 1, 2, 0, 0, 2, 0, 2, 2, - 2, 2, 0, 0, 0, 0, 2, 2, 2, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, - 1, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 0, 1, 2, 1, - 2, 2, 0, 2, 0, 1, 2, 1, 2, 0, 0, 0, 0, 2, 2, 2, 2, 2, 0, 2, 0, 2, 2, 2, 2, 2, 0, - 2, 0, 1, 2, 1, 2, 2, 0, 2, 0, 1, 2, 1, 2, 0, 0, 0, 0, 2, 2, 2, 2, 0, 0, 0, 0, 2, - 2, 2, 2, 1, 2, 1, 2, 1, 2, 1, 2, 2, 2, 2, 2, 1, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 - }; - - std::vector outside_vec; - outside_vec.assign(outside, outside + SDL_arraysize(outside)); - autotile_types["outside"] = outside_vec; - - // Everything gets initialized to 0 by default - static const short none[256] = {}; - - std::vector none_vec; - none_vec.assign(none, none + SDL_arraysize(none)); - autotile_types["none"] = none_vec; - - SDL_zeroa(tileset_min_colour); - SDL_zeroa(tileset_max_colour); - SDL_zeroa(tileset_min_colour_direct); - SDL_zeroa(tileset_max_colour_direct); - - register_tileset(EditorTileset_SPACE_STATION, "Space Station"); - register_tileset(EditorTileset_OUTSIDE, "Outside"); - register_tileset(EditorTileset_LAB, "Lab"); - register_tileset(EditorTileset_WARP_ZONE, "Warp Zone"); - register_tileset(EditorTileset_SHIP, "Ship"); - - register_tilecol(EditorTileset_SPACE_STATION, -1, "basic", 80, "basic", 680); - register_tilecol(EditorTileset_SPACE_STATION, 0, "basic", 83, "basic", 680); - register_tilecol(EditorTileset_SPACE_STATION, 1, "basic", 86, "basic", 698); - register_tilecol(EditorTileset_SPACE_STATION, 2, "basic", 89, "basic", 695); - register_tilecol(EditorTileset_SPACE_STATION, 3, "basic", 92, "basic", 683); - register_tilecol(EditorTileset_SPACE_STATION, 4, "basic", 95, "basic", 689); - register_tilecol(EditorTileset_SPACE_STATION, 5, "basic", 98, "basic", 680); - register_tilecol(EditorTileset_SPACE_STATION, 6, "basic", 101, "basic", 695); - register_tilecol(EditorTileset_SPACE_STATION, 7, "basic", 104, "basic", 704); - register_tilecol(EditorTileset_SPACE_STATION, 8, "basic", 107, "basic", 689); - register_tilecol(EditorTileset_SPACE_STATION, 9, "basic", 110, "basic", 686); - register_tilecol(EditorTileset_SPACE_STATION, 10, "basic", 113, "basic", 698); - - register_tilecol(EditorTileset_SPACE_STATION, 11, "basic", 283, "basic", 695); - register_tilecol(EditorTileset_SPACE_STATION, 12, "basic", 286, "basic", 686); - register_tilecol(EditorTileset_SPACE_STATION, 13, "basic", 289, "basic", 704); - register_tilecol(EditorTileset_SPACE_STATION, 14, "basic", 292, "basic", 701); - register_tilecol(EditorTileset_SPACE_STATION, 15, "basic", 295, "basic", 698); - register_tilecol(EditorTileset_SPACE_STATION, 16, "basic", 298, "basic", 683); - register_tilecol(EditorTileset_SPACE_STATION, 17, "basic", 301, "basic", 704); - register_tilecol(EditorTileset_SPACE_STATION, 18, "basic", 304, "basic", 701); - register_tilecol(EditorTileset_SPACE_STATION, 19, "basic", 307, "basic", 698); - register_tilecol(EditorTileset_SPACE_STATION, 20, "basic", 310, "basic", 692); - register_tilecol(EditorTileset_SPACE_STATION, 21, "basic", 313, "basic", 686); - - register_tilecol(EditorTileset_SPACE_STATION, 22, "basic", 483, "basic", 695); - register_tilecol(EditorTileset_SPACE_STATION, 23, "basic", 486, "basic", 683); - register_tilecol(EditorTileset_SPACE_STATION, 24, "basic", 489, "basic", 689); - register_tilecol(EditorTileset_SPACE_STATION, 25, "basic", 492, "basic", 704); - register_tilecol(EditorTileset_SPACE_STATION, 26, "basic", 495, "basic", 680); - register_tilecol(EditorTileset_SPACE_STATION, 27, "basic", 498, "basic", 695); - register_tilecol(EditorTileset_SPACE_STATION, 28, "basic", 501, "basic", 689); - register_tilecol(EditorTileset_SPACE_STATION, 29, "basic", 504, "basic", 692); - register_tilecol(EditorTileset_SPACE_STATION, 30, "basic", 507, "basic", 689); - register_tilecol(EditorTileset_SPACE_STATION, 31, "basic", 510, "basic", 698); - - register_tilecol(EditorTileset_OUTSIDE, 0, "basic", 480, "outside", 680, false, true); - register_tilecol(EditorTileset_OUTSIDE, 1, "basic", 483, "outside", 683, false, true); - register_tilecol(EditorTileset_OUTSIDE, 2, "basic", 486, "outside", 686, false, true); - register_tilecol(EditorTileset_OUTSIDE, 3, "basic", 489, "outside", 689, false, true); - register_tilecol(EditorTileset_OUTSIDE, 4, "basic", 492, "outside", 692, false, true); - register_tilecol(EditorTileset_OUTSIDE, 5, "basic", 495, "outside", 695, false, true); - register_tilecol(EditorTileset_OUTSIDE, 6, "basic", 498, "outside", 698, false, true); - register_tilecol(EditorTileset_OUTSIDE, 7, "basic", 501, "outside", 701, false, true); - - register_tilecol(EditorTileset_LAB, 0, "lab_cyan", 280, "none", 713); - register_tilecol(EditorTileset_LAB, 1, "lab_red", 283, "none", 713); - register_tilecol(EditorTileset_LAB, 2, "lab_pink", 286, "none", 713); - register_tilecol(EditorTileset_LAB, 3, "basic", 289, "none", 713); - register_tilecol(EditorTileset_LAB, 4, "lab_yellow", 292, "none", 713); - register_tilecol(EditorTileset_LAB, 5, "lab_green", 295, "none", 713); - register_tilecol(EditorTileset_LAB, 6, "none", 0, "none", 713, true); - - register_tilecol(EditorTileset_WARP_ZONE, 0, "basic", 80, "none", 120); - register_tilecol(EditorTileset_WARP_ZONE, 1, "basic", 83, "none", 123); - register_tilecol(EditorTileset_WARP_ZONE, 2, "basic", 86, "none", 126); - register_tilecol(EditorTileset_WARP_ZONE, 3, "basic", 89, "none", 129); - register_tilecol(EditorTileset_WARP_ZONE, 4, "basic", 92, "none", 132); - register_tilecol(EditorTileset_WARP_ZONE, 5, "basic", 95, "none", 135); - register_tilecol(EditorTileset_WARP_ZONE, 6, "basic", 98, "none", 138); - - register_tilecol(EditorTileset_SHIP, 0, "basic", 101, "basic", 741); - register_tilecol(EditorTileset_SHIP, 1, "basic", 104, "basic", 744); - register_tilecol(EditorTileset_SHIP, 2, "basic", 107, "basic", 747); - register_tilecol(EditorTileset_SHIP, 3, "basic", 110, "basic", 750); - register_tilecol(EditorTileset_SHIP, 4, "basic", 113, "basic", 753); - register_tilecol(EditorTileset_SHIP, 5, "basic", 116, "basic", 756); -} - -void editorclass::register_tileset(EditorTilesets tileset, const char* name) -{ - tileset_names[tileset] = name; -} - -void editorclass::register_tilecol( - EditorTilesets tileset, - const int index, - const char* foreground_type, - const int foreground_base, - const char* background_type, - const int background_base, - const bool direct, - const bool bg_ignores_walls -) { - EditorTilecolInfo info; - info.foreground_type = foreground_type; - info.foreground_base = foreground_base; - info.background_type = background_type; - info.background_base = background_base; - info.direct_mode = direct; - info.bg_ignores_walls = bg_ignores_walls; - tileset_colors[tileset][index] = info; - - if (!direct) - { - tileset_min_colour[tileset] = SDL_min(tileset_min_colour[tileset], index); - tileset_max_colour[tileset] = SDL_max(tileset_max_colour[tileset], index); - } - - tileset_min_colour_direct[tileset] = SDL_min(tileset_min_colour_direct[tileset], index); - tileset_max_colour_direct[tileset] = SDL_max(tileset_max_colour_direct[tileset], index); -} - -void editorclass::register_tilecol( - EditorTilesets tileset, - const int index, - const char* foreground_type, - const int foreground_base, - const char* background_type, - const int background_base, - const bool bg_ignores_walls -) { - register_tilecol(tileset, index, foreground_type, foreground_base, background_type, background_base, bg_ignores_walls, false); -} - -void editorclass::register_tilecol( - EditorTilesets tileset, - const int index, - const char* foreground_type, - const int foreground_base, - const char* background_type, - const int background_base -) { - register_tilecol(tileset, index, foreground_type, foreground_base, background_type, background_base, false); -} - -void editorclass::reset(void) -{ - current_tool = EditorTool_WALLS; - - roomnamehide = 0; - z_modifier = false; - x_modifier = false; - c_modifier = false; - v_modifier = false; - h_modifier = false; - b_modifier = false; - f_modifier = false; - toolbox_open = false; - help_open = false; - shiftkey = false; - saveandquit = false; - note = ""; - note_timer = 0; - old_note_timer = 0; - backspace_held = false; - current_text_mode = TEXT_NONE; - - warp_token_entity = -1; - - text_entity = 0; - scripttexttype = 0; - - direct_mode_tile = 0; - direct_mode_drawer = 0; - entcol = 0; - - old_tilex = 0; - old_tiley = 0; - tilex = 0; - tiley = 0; - levx = 0; - levy = 0; - keydelay = 0; - lclickdelay = 0; - savekey = false; - loadkey = false; - updatetiles = true; - changeroom = true; - - entframe = 0; - entframedelay = 0; - - SDL_zeroa(kludgewarpdir); - - script_buffer.clear(); - - clear_script_buffer(); - - script_cursor_x = 0; - script_cursor_y = 0; - script_offset = 0; - lines_visible = 25; - current_script = "null"; - - script_list_offset = 0; - selected_script = 0; - - return_message_timer = 0; - old_return_message_timer = 0; - - ghosts.clear(); - current_ghosts = 0; - - loaded_filepath = ""; - - state = EditorState_DRAW; - substate = EditorSubState_MAIN; -} - -void editorclass::show_note(const char* text) -{ - note_timer = 45; - note = text; -} - -void editorclass::register_tool(EditorTools tool, const char* name, const char* keychar, const SDL_KeyCode key, const bool shift) -{ - tool_names[tool] = name; - tool_key_chars[tool] = keychar; - tool_keys[tool] = key; - tool_requires_shift[tool] = shift; -} - -void editorclass::load_script_in_editor(const std::string& name) -{ - // Load script t into the script editor - clear_script_buffer(); - - for (size_t i = 0; i < script.customscripts.size(); i++) - { - if (script.customscripts[i].name == name) - { - script_buffer = script.customscripts[i].contents; - break; - } - } - - if (script_buffer.empty()) - { - // Always have one line or we'll have problems - script_buffer.resize(1); - } -} - -void editorclass::remove_script(const std::string& name) -{ - for (size_t i = 0; i < script.customscripts.size(); i++) - { - if (script.customscripts[i].name == name) - { - script.customscripts.erase(script.customscripts.begin() + i); - break; - } - } -} - -void editorclass::create_script(const std::string& name, const std::vector& contents) -{ - // Add a script. If there's an old one, delete it. - - remove_script(name); - - Script script_; - script_.name = name; - script_.contents = contents; - - script.customscripts.push_back(script_); -} - -void editorclass::create_script(const std::string& name) -{ - // Add an empty script. - - Script script_; - script_.name = name; - script_.contents.resize(1); - - script.customscripts.push_back(script_); -} - -bool editorclass::script_exists(const std::string& name) -{ - for (size_t i = 0; i < script.customscripts.size(); i++) - { - if (script.customscripts[i].name == name) - { - return true; - } - } - return false; -} - - -void editorclass::clear_script_buffer(void) -{ - script_buffer.clear(); -} - -void editorclass::remove_line(int t) -{ - //Remove line t from the script - if ((int) script_buffer.size() > 1) - { - script_buffer.erase(script_buffer.begin() + t); - } -} - -void editorclass::insert_line(int t) -{ - //insert a blank line into script at line t - script_buffer.insert(script_buffer.begin() + t, ""); -} - -static void editormenurender(int tr, int tg, int tb) -{ - extern editorclass ed; - - switch (game.currentmenuname) - { - case Menu::ed_settings: - font::print(PR_2X | PR_CEN, -1, 75, loc::gettext("Map Settings"), tr, tg, tb); - if (game.currentmenuoption == 3) - { - if (!game.ghostsenabled) - font::print(0, 2, 230, loc::gettext("Editor ghost trail is OFF"), tr/2, tg/2, tb/2); - else - font::print(0, 2, 230, loc::gettext("Editor ghost trail is ON"), tr, tg, tb); - } - break; - case Menu::ed_desc: - { - const std::string input_text = key.keybuffer + ((ed.entframe < 2) ? "_" : " "); - - if (ed.current_text_mode == TEXT_TITLE) - { - font::print(PR_2X | PR_CEN | PR_FONT_LEVEL, -1, 35, input_text, tr, tg, tb); - } - else - { - const char* title = cl.title.c_str(); - const bool title_is_gettext = translate_title(cl.title); - if (title_is_gettext) - { - title = loc::gettext(title); - } - font::print(PR_2X | PR_CEN | (title_is_gettext ? PR_FONT_INTERFACE : PR_FONT_LEVEL), -1, 35, title, tr, tg, tb); - } - - bool creator_is_gettext; - const char* creator; - if (ed.current_text_mode == TEXT_CREATOR) - { - creator_is_gettext = false; - creator = input_text.c_str(); - } - else - { - creator_is_gettext = translate_creator(cl.creator); - creator = cl.creator.c_str(); - } - if (creator_is_gettext) - { - creator = loc::gettext(creator); - } - - int sp = SDL_max(10, font::height(PR_FONT_LEVEL)); - graphics.print_level_creator((creator_is_gettext ? PR_FONT_INTERFACE : PR_FONT_LEVEL), 60, creator, tr, tg, tb); - - font::print(PR_CEN | PR_FONT_LEVEL, -1, 60 + sp, (ed.current_text_mode == TEXT_WEBSITE) ? input_text : cl.website, tr, tg, tb); - font::print(PR_CEN | PR_FONT_LEVEL, -1, 60 + sp * 3, (ed.current_text_mode == TEXT_DESC1) ? input_text : cl.Desc1, tr, tg, tb); - font::print(PR_CEN | PR_FONT_LEVEL, -1, 60 + sp * 4, (ed.current_text_mode == TEXT_DESC2) ? input_text : cl.Desc2, tr, tg, tb); - - - if (ed.current_text_mode == TEXT_DESC3) - { - font::print(PR_CEN | PR_FONT_LEVEL, -1, 60 + sp * 5, input_text, tr, tg, tb); - } - else if (sp <= 10) - { - font::print(PR_CEN | PR_FONT_LEVEL, -1, 60 + sp * 5, cl.Desc3, tr, tg, tb); - } - - const char* label = loc::gettext("Font: "); - int len_label = font::len(0, label); - const char* name = font::get_level_font_display_name(); - - int font_x = 2 + len_label; - uint32_t font_flags = PR_FONT_LEVEL; - if (font::is_rtl(PR_FONT_INTERFACE)) - { - font_x = SCREEN_WIDTH_PIXELS - font_x; - font_flags |= PR_RIGHT; - } - - font::print(PR_RTL_XFLIP, 2, 230, label, tr / 2, tg / 2, tb / 2); - font::print(font_flags, font_x, 230, name, tr / 2, tg / 2, tb / 2); - break; - } - case Menu::ed_music: - { - font::print(PR_2X | PR_CEN | PR_CJK_HIGH, -1, 65, loc::gettext("Map Music"), tr, tg, tb); - - font::print_wrap(PR_CEN | PR_CJK_LOW, -1, 85, loc::gettext("Current map music:"), tr, tg, tb); - const char* songname; - switch(cl.levmusic) - { - case 0: - songname = loc::gettext("No background music"); - break; - case Music_PUSHINGONWARDS: - songname = loc::gettext("1: Pushing Onwards"); - break; - case Music_POSITIVEFORCE: - songname = loc::gettext("2: Positive Force"); - break; - case Music_POTENTIALFORANYTHING: - songname = loc::gettext("3: Potential for Anything"); - break; - case Music_PASSIONFOREXPLORING: - songname = loc::gettext("4: Passion for Exploring"); - break; - case Music_PAUSE: - songname = loc::gettext("N/A: Pause"); - break; - case Music_PRESENTINGVVVVVV: - songname = loc::gettext("5: Presenting VVVVVV"); - break; - case Music_PLENARY: - songname = loc::gettext("N/A: Plenary"); - break; - case Music_PREDESTINEDFATE: - songname = loc::gettext("6: Predestined Fate"); - break; - case Music_POSITIVEFORCEREVERSED: - songname = loc::gettext("N/A: ecroF evitisoP"); - break; - case Music_POPULARPOTPOURRI: - songname = loc::gettext("7: Popular Potpourri"); - break; - case Music_PIPEDREAM: - songname = loc::gettext("8: Pipe Dream"); - break; - case Music_PRESSURECOOKER: - songname = loc::gettext("9: Pressure Cooker"); - break; - case Music_PACEDENERGY: - songname = loc::gettext("10: Paced Energy"); - break; - case Music_PIERCINGTHESKY: - songname = loc::gettext("11: Piercing the Sky"); - break; - case Music_PREDESTINEDFATEREMIX: - songname = loc::gettext("N/A: Predestined Fate Remix"); - break; - default: - songname = loc::gettext("?: something else"); - break; - } - font::print_wrap(PR_CEN, -1, 120, songname, tr, tg, tb); - break; - } - case Menu::ed_quit: - font::print_wrap(PR_CEN, -1, 90, loc::gettext("Save before quitting?"), tr, tg, tb); - break; - case Menu::ed_font: - { - font::print(PR_2X | PR_CEN, -1, 30, loc::gettext("Level Font"), tr, tg, tb); - font::print_wrap(PR_CEN, -1, 65, loc::gettext("Select the language in which the text in this level is written."), tr, tg, tb); - - const char* label = loc::gettext("Font: "); - int len_label = font::len(0, label); - const char* name = font::get_level_font_display_name(); - - int font_x = 2 + len_label; - uint32_t font_flags = PR_FONT_LEVEL; - if (font::is_rtl(PR_FONT_INTERFACE)) - { - font_x = SCREEN_WIDTH_PIXELS - font_x; - font_flags |= PR_RIGHT; - } - - font::print(PR_RTL_XFLIP, 2, 230, label, tr/2, tg/2, tb/2); - font::print(font_flags, font_x, 230, name, tr/2, tg/2, tb/2); - break; - } - default: - break; - } -} - -static void draw_background_grid(void) -{ - for (int j = 0; j < 30; j++) - { - for (int i = 0; i < 40; i++) - { - if (i == 19 || i == 20 || j == 14 || j == 29) - { - // Major guidelines - graphics.draw_rect(i * 8, j * 8, 7, 7, graphics.getRGB(32, 32, 32)); - } - else if (i == 9 || i == 30 || j == 6 || j == 7 || j == 21 || j == 22) - { - // Minor guidelines - graphics.draw_rect(i * 8, j * 8, 7, 7, graphics.getRGB(24, 24, 24)); - } - else if (i % 4 == 0 || j % 4 == 0) - { - graphics.draw_rect(i * 8, j * 8, 7, 7, graphics.getRGB(16, 16, 16)); - } - else - { - graphics.draw_rect(i * 8, j * 8, 7, 7, graphics.getRGB(8, 8, 8)); - } - } - } -} - -static void draw_background(int warpdir) -{ - extern editorclass ed; - - switch (warpdir) - { - case 1: - graphics.rcol = cl.getwarpbackground(ed.levx, ed.levy); - graphics.drawbackground(3); - break; - case 2: - graphics.rcol = cl.getwarpbackground(ed.levx, ed.levy); - graphics.drawbackground(4); - break; - case 3: - graphics.rcol = cl.getwarpbackground(ed.levx, ed.levy); - graphics.drawbackground(5); - break; - default: - break; - } -} - -static void draw_edgeguide(const TileTypes type, const int x, const int y, const bool vertical) -{ - static const SDL_Color white = graphics.getRGB(255 - help.glow, 255, 255); - static const SDL_Color red = graphics.getRGB(255 - help.glow, 127, 127); - - if (type != TileType_SOLID && type != TileType_SPIKE) - { - return; - } - - if (vertical) - { - graphics.fill_rect(x, y, 8, 2, (type == TileType_SOLID) ? white : red); - } - else - { - graphics.fill_rect(x, y, 2, 8, (type == TileType_SOLID) ? white : red); - } -} - -static void draw_edgeguides(void) -{ - extern editorclass ed; - - const int global_x = ed.levx * 40; - const int global_y = ed.levy * 30; - - // Draw edge-guides, so there's no room misalignments! - - for (int i = 0; i < 40; i++) - { - if (i < 30) - { - // Left edge - draw_edgeguide(ed.get_abs_tile_type(global_x - 1, global_y + i, true), 0, i * 8, false); - // Right edge - draw_edgeguide(ed.get_abs_tile_type(global_x + 40, global_y + i, true), 318, i * 8, false); - } - - // Top edge - draw_edgeguide(ed.get_abs_tile_type(global_x + i, global_y - 1, true), i * 8, 0, true); - // Bottom edge - draw_edgeguide(ed.get_abs_tile_type(global_x + i, global_y + 30, true), i * 8, 238, true); - } - - static const SDL_Color green = graphics.getRGB(127, 255 - help.glow, 127); - - // Horizontal gravity line edge-guides - - for (size_t i = 0; i < customentities.size(); ++i) - { - const CustomEntity* entity = &customentities[i]; - const bool is_horizontal_gravity_line = entity->t == 11 && entity->p1 == 0; - if (!is_horizontal_gravity_line) - { - continue; - } - const int x = entity->p2 * 8; - const int w = entity->p3; - if (entity->ry != ed.levy) - { - continue; - } - if (entity->rx == POS_MOD(ed.levx - 1, cl.mapwidth) - // It's to the left... - && x + w >= SCREEN_WIDTH_PIXELS - 8) - { - // And touching the right edge! - graphics.fill_rect(0, entity->y * 8, 2, 8, green); - } - else if (entity->rx == POS_MOD(ed.levx + 1, cl.mapwidth) - // It's to the right... - && x <= 0) - { - // And touching the left edge! - graphics.fill_rect(SCREEN_WIDTH_PIXELS - 2, entity->y * 8, 2, 8, green); - } - } -} - -static void update_entities(void) -{ - extern editorclass ed; - - for (size_t i = 0; i < customentities.size(); ++i) - { - CustomEntity* entity = &customentities[i]; - - if (entity->rx != ed.levx || entity->ry != ed.levy) - { - // It's not in this room, so just continue - continue; - } - - bool grav_line = (entity->t == 11); - bool warp_line = (entity->t == 50); - - if ((grav_line || warp_line) && entity->p4 != 1) - { - // If it's a grav line or a warp line, and it's not locked - if ((grav_line && entity->p1 == 0) || (warp_line && entity->p1 >= 2)) - { - /* Horizontal */ - int tx = entity->x; - int tx2 = tx; - int ty = entity->y; - while (ed.lines_can_pass(tx, ty)) - { - --tx; - } - while (ed.lines_can_pass(tx2, ty)) - { - ++tx2; - } - ++tx; - entity->p2 = tx; - entity->p3 = (tx2 - tx) * 8; - } - else - { - /* Vertical */ - int tx = entity->x; - int ty = entity->y; - int ty2 = ty; - while (ed.lines_can_pass(tx, ty)) - { - --ty; - } - while (ed.lines_can_pass(tx, ty2)) - { - ++ty2; - } - ++ty; - entity->p2 = ty; - entity->p3 = (ty2 - ty) * 8; - } - } - } -} - -static void draw_entities(void) -{ - extern editorclass ed; - - const RoomProperty* const room = cl.getroomprop(ed.levx, ed.levy); - - //Draw entities - obj.customplatformtile = game.customcol * 12; - - const int edent_under_cursor = ed.get_entity_at(ed.levx, ed.levy, ed.tilex, ed.tiley); - - // Special case for drawing gray entities - bool custom_gray = room->tileset == 3 && room->tilecol == 6; - - // Draw entities backward to remain accurate with ingame - for (int i = customentities.size() - 1; i >= 0; i--) - { - CustomEntity* entity = &customentities[i]; - - // If the entity is in the current room, draw it - if (entity->rx == ed.levx && entity->ry == ed.levy) - { - const int x = entity->x * 8; - const int y = entity->y * 8; - static const char arrows[] = "V^<>"; - - switch (entity->t) - { - case 1: // Enemies - { - const int movement = entity->p1; - - if (custom_gray) - { - ed.entcolreal = graphics.getcol(18); - } - - graphics.draw_sprite(x, y, ed.get_enemy_tile(room->enemytype), ed.entcolreal); - - if (movement >= 0 && movement < 4) - { - // If they have a basic movement type, draw an arrow to indicate direction - font::print(PR_FONT_8X8, x + 4, y + 4, std::string(1, arrows[movement]), 255, 255, 255 - help.glow); - } - - graphics.draw_rect(x, y, 16, 16, graphics.getRGB(255, 164, 255)); - break; - } - case 2: // Conveyors & Platforms - { - const int movement = entity->p1; - const short length = (movement == 7 || movement == 8) ? 8 : 4; - const short glow = 255 - help.glow; - - for (int j = 0; j < length; j++) { - graphics.draw_grid_tile(custom_gray ? graphics.grphx.im_entcolours_tint : graphics.grphx.im_entcolours, obj.customplatformtile, x + (j * 8), y, 8, 8); - } - - switch (movement) - { - case 0: - case 1: - case 2: - case 3: - // If they have a basic movement type, draw an arrow to indicate direction - font::print(PR_FONT_8X8, x + 12, y, std::string(1, arrows[movement]), glow, glow, glow); - break; - case 4: - // Always move right, stopping when hitting collision - font::print(PR_FONT_8X8, x + 8, y, ">I", glow, glow, glow); - break; - case 5: - font::print(PR_FONT_8X8, x, y, ">>>>", glow, glow, glow); - break; - case 6: - font::print(PR_FONT_8X8, x, y, "<<<<", glow, glow, glow); - break; - case 7: - font::print(PR_FONT_8X8, x + 4, y, "> > > > ", glow, glow, glow); - break; - case 8: - font::print(PR_FONT_8X8, x + 4, y, "< < < < ", glow, glow, glow); - break; - } - - if (movement < 0) - { - // Well, it's a negative type, so it'll just be still. - font::print(PR_FONT_8X8, x + 8, y, "[]", glow, glow, glow); - } - else if (movement > 8) - { - // Invalid... draw a scary red X - font::print(PR_FONT_8X8, x + 12, y, "X", glow, 0, 0); - } - - graphics.draw_rect(x, y, 8 * length, 8, graphics.getRGB(255, 255, 255)); - break; - } - case 3: // Disappearing Platforms - for (int j = 0; j < 4; j++) { - graphics.draw_grid_tile(custom_gray ? graphics.grphx.im_entcolours_tint : graphics.grphx.im_entcolours, obj.customplatformtile, x + (j * 8), y, 8, 8); - } - - font::print(PR_FONT_8X8, x, y, "////", 255 - help.glow, 255 - help.glow, 255 - help.glow); - graphics.draw_rect(x, y, 32, 8, graphics.getRGB(255, 255, 255)); - break; - case 9: // Shiny Trinkets - graphics.draw_sprite(x, y, 22, 196, 196, 196); - graphics.draw_rect(x, y, 16, 16, graphics.getRGB(255, 164, 164)); - break; - case 10: // Checkpoints - graphics.draw_sprite(x, y, 20 + entity->p1, 196, 196, 196); - graphics.draw_rect(x, y, 16, 16, graphics.getRGB(255, 164, 164)); - break; - case 11: // Gravity Lines - // p2 is in tiles, and p3 is in pixels - if (entity->p1 == 0) - { - // Horizontal gravity line - const int left = entity->p2 * 8; - const int width = entity->p3; - graphics.fill_rect(left, y + 4, width, 1, graphics.getRGB(194, 194, 194)); - } - else - { - // Vertical gravity line - const int top = entity->p2 * 8; - const int height = entity->p3; - graphics.fill_rect(x + 3, top, 1, height, graphics.getRGB(194, 194, 194)); - } - graphics.draw_rect(x, y, 8, 8, graphics.getRGB(164, 255, 164)); - break; - case 13: // Warp Tokens - { - std::string text; - - graphics.draw_sprite(x, y, 18 + (ed.entframe % 2), 196, 196, 196); - graphics.draw_rect(x, y, 16, 16, graphics.getRGB(255, 164, 164)); - - if (i == edent_under_cursor) - { - text = "(" + help.String(entity->p1 / 40 + 1) + "," + help.String(entity->p2 / 30 + 1) + ")"; - } - else - { - text = help.String(cl.findwarptoken(i)); - } - - font::print(PR_BOR | PR_CJK_HIGH, x, y - 8, text, 210, 210, 255); - break; - } - case 15: // Crewmates - graphics.draw_sprite(x - 4, y, 144, graphics.crewcolourreal(entity->p1)); - graphics.draw_rect(x, y, 16, 24, graphics.getRGB(164, 164, 164)); - break; - case 16: // Start Point - { - const short labelcol = ed.entframe < 2 ? 255 : 196; - - if (entity->p1 == 0) // Facing right - { - graphics.draw_sprite(x - 4, y, 0, graphics.getcol(cl.player_colour)); - } - else // Non-zero is facing left - { - graphics.draw_sprite(x - 4, y, 3, graphics.getcol(cl.player_colour)); - } - - graphics.draw_rect(x, y, 16, 24, graphics.getRGB(255, 255, 164)); - font::print(PR_BOR | PR_CEN | PR_CJK_HIGH, x + 8, y - 8, loc::gettext("START"), labelcol, labelcol, labelcol); - break; - } - case 17: // Roomtext - { - int width = 8; - int height = 8; - - if (entity->scriptname.length() > 0) - { - width = font::len(PR_FONT_LEVEL, entity->scriptname.c_str()); - height = font::height(PR_FONT_LEVEL); - } - - int rect_x = x; - if (entity->p1) - { - // RTL. The 8 is the size of a tile, not font width! - rect_x -= width - 8; - } - graphics.draw_rect(rect_x, y, width, height, graphics.getRGB(96, 96, 96)); - graphics.print_roomtext(x, y, entity->scriptname.c_str(), entity->p1); - break; - } - case 18: // Terminals - { - int sprite = entity->p1; - int corrected_y = y; - - // Not a boolean: just swapping 0 and 1, leaving the rest alone - if (sprite == 0) - { - sprite = 1; // Unflipped - } - else if (sprite == 1) - { - sprite = 0; // Flipped; - corrected_y -= 8; - } - - graphics.draw_sprite(x, corrected_y + 8, sprite + 16, 96, 96, 96); - graphics.draw_rect(x, y, 16, 24, graphics.getRGB(164, 164, 164)); - if (i == edent_under_cursor) - { - font::print(PR_FONT_LEVEL | PR_BOR | PR_CJK_HIGH, x, y - 8, entity->scriptname, 210, 210, 255); - } - break; - } - case 19: // Script Triggers - graphics.draw_rect(x, y, entity->p1 * 8, entity->p2 * 8, graphics.getRGB(255, 164, 255)); - graphics.draw_rect(x, y, 8, 8, graphics.getRGB(255, 255, 255)); - if (i == edent_under_cursor) - { - font::print(PR_FONT_LEVEL | PR_BOR | PR_CJK_HIGH, x, y - 8, entity->scriptname, 210, 210, 255); - } - break; - case 50: // Warp Lines - if (entity->p1 >= 2) // Horizontal - { - - int left = entity->p2; - int right = left + entity->p3 / 8; - - graphics.draw_rect((left * 8), y + 1, (right - left) * 8, 6, graphics.getRGB(194, 255, 255)); - graphics.draw_rect(x, y, 8, 8, graphics.getRGB(164, 255, 255)); - } - else // Vertical - { - int top = entity->p2; - int bottom = top + entity->p3 / 8; - - graphics.draw_rect(x + 1, (top * 8), 6, (bottom - top) * 8, graphics.getRGB(194, 255, 255)); - graphics.draw_rect(x, y, 8, 8, graphics.getRGB(164, 255, 255)); - } - break; - } - } - - // Need to also check warp point destinations - if (entity->t == 13 && ed.warp_token_entity != i && - entity->p1 / 40 == ed.levx && entity->p2 / 30 == ed.levy) - { - const int x = entity->p1 % 40 * 8; - const int y = entity->p2 % 30 * 8; - std::string text; - - graphics.draw_sprite(x, y, 18 + (ed.entframe % 2), 64, 64, 64); - graphics.draw_rect((entity->p1 * 8) - (ed.levx * 40 * 8), (entity->p2 * 8) - (ed.levy * 30 * 8), 16, 16, graphics.getRGB(96, 64, 64)); - - if (ed.tilex == x / 8 && ed.tiley == y / 8) - { - text = "(" + help.String(entity->rx + 1) + "," + help.String(entity->ry + 1) + ")"; - } - else - { - text = help.String(cl.findwarptoken(i)); - } - - font::print(PR_BOR | PR_CJK_HIGH, x, y - 8, text, 190, 190, 225); - } - } -} - -static void draw_ghosts(void) -{ - extern editorclass ed; - - //Draw ghosts (spooky!) - if (game.ghostsenabled) { - graphics.set_render_target(graphics.ghostTexture); - graphics.set_blendmode(graphics.ghostTexture, SDL_BLENDMODE_BLEND); - graphics.clear(0, 0, 0, 0); - - for (int i = 0; i < (int) ed.ghosts.size(); i++) { - if (i <= ed.current_ghosts) { // We don't want all of them to show up at once :) - if (ed.ghosts[i].rx != ed.levx || ed.ghosts[i].ry != ed.levy) - continue; - SDL_Color ct = ed.ghosts[i].realcol; - const int alpha = 3 * ct.a / 4; - ct.a = (Uint8)alpha; - graphics.draw_sprite(ed.ghosts[i].x, ed.ghosts[i].y, ed.ghosts[i].frame, ct); - } - } - - graphics.set_render_target(graphics.gameTexture); - graphics.set_texture_alpha_mod(graphics.ghostTexture, 128); - graphics.copy_texture(graphics.ghostTexture, NULL, NULL); - } -} - -static void adjust_box_coordinates(int x1, int y1, int x2, int y2, int* left, int* right, int* top, int* bottom) -{ - if (x1 < x2 + 8) - { - *right = x2 + 8; - *left = x1; - } - else - { - *right = x1 + 8; - *left = x2; - } - - if (y1 < y2 + 8) - { - *bottom = y2 + 8; - *top = y1; - } - else - { - *bottom = y1 + 8; - *top = y2; - } -} - -static void draw_bounds(void) -{ - extern editorclass ed; - - const RoomProperty* const room = cl.getroomprop(ed.levx, ed.levy); - - // Draw boundaries - if (room->enemyx1 != 0 || room->enemyy1 != 0 || room->enemyx2 != 320 || room->enemyy2 != 240) - { - graphics.draw_rect(room->enemyx1, room->enemyy1, room->enemyx2 - room->enemyx1, room->enemyy2 - room->enemyy1, graphics.getRGB(255 - (help.glow / 2), 64, 64)); - } - - if (room->platx1 != 0 || room->platy1 != 0 || room->platx2 != 320 || room->platy2 != 240) - { - graphics.draw_rect(room->platx1, room->platy1, room->platx2 - room->platx1, room->platy2 - room->platy1, graphics.getRGB(64, 64, 255 - (help.glow / 2))); - } - - if (ed.substate == EditorSubState_DRAW_BOX) - { - if (ed.box_corner == BoxCorner_FIRST) - { - graphics.draw_rect(ed.tilex * 8, ed.tiley * 8, 8, 8, graphics.getRGB(210 + help.glow / 2, 191 + help.glow, 255 - help.glow / 2)); - graphics.draw_rect((ed.tilex * 8) + 2, (ed.tiley * 8) + 2, 4, 4, graphics.getRGB(105 + help.glow / 4, 100 + help.glow / 2, 128 - help.glow / 4)); - } - else - { - int left; - int right; - int top; - int bottom; - - adjust_box_coordinates(ed.box_point.x, ed.box_point.y, ed.tilex * 8, ed.tiley * 8, &left, &right, &top, &bottom); - - graphics.draw_rect(left, top, right - left, bottom - top, graphics.getRGB(210 + help.glow / 2, 191 + help.glow, 255 - help.glow / 2)); - graphics.draw_rect(left + 2, top + 2, (right - left) - 4, (bottom - top) - 4, graphics.getRGB(105 + help.glow / 4, 100 + help.glow / 2, 128 - help.glow / 4)); - } - } -} - -static inline bool check_point(bool connected[SCREEN_HEIGHT_TILES][SCREEN_WIDTH_TILES], int x, int y) -{ - if (x < 0 || x >= SCREEN_WIDTH_TILES || y < 0 || y >= SCREEN_HEIGHT_TILES) - { - return false; - } - - return connected[y][x]; -} - -static void draw_cursor(void) -{ - extern editorclass ed; - - static const SDL_Color blue = graphics.getRGB(32, 32, 200); - - const int x = ed.tilex * 8; - const int y = ed.tiley * 8; - - if (ed.substate == EditorSubState_DRAW_BOX) - { - // Just draw a 1x1 cursor, overriding everything else - graphics.draw_rect(x, y, 8, 8, blue); - return; - } - - - switch (ed.current_tool) - { - case EditorTool_WALLS: - case EditorTool_BACKING: - // Modifiers! - if (ed.f_modifier) - { - bool connected[SCREEN_HEIGHT_TILES][SCREEN_WIDTH_TILES]; - SDL_zeroa(connected); - - ed.get_tile_fill(ed.tilex, ed.tiley, cl.gettile(ed.levx, ed.levy, ed.tilex, ed.tiley), connected); - - graphics.set_color(blue); - - for (int i = 0; i < SCREEN_WIDTH_TILES * SCREEN_HEIGHT_TILES; i++) - { - const int x = i % SCREEN_WIDTH_TILES; - const int y = i / SCREEN_WIDTH_TILES; - - if (!connected[y][x]) - continue; - - bool top_left = true; - bool top_right = true; - bool bottom_left = true; - bool bottom_right = true; - - if (!check_point(connected, x - 1, y)) - { - top_left = false; - bottom_left = false; - SDL_RenderDrawLine(gameScreen.m_renderer, x * 8, y * 8, x * 8, y * 8 + 7); - } - if (!check_point(connected, x + 1, y)) - { - top_right = false; - bottom_right = false; - SDL_RenderDrawLine(gameScreen.m_renderer, x * 8 + 7, y * 8, x * 8 + 7, y * 8 + 7); - } - if (!check_point(connected, x, y - 1)) - { - top_left = false; - top_right = false; - SDL_RenderDrawLine(gameScreen.m_renderer, x * 8, y * 8, x * 8 + 7, y * 8); - } - if (!check_point(connected, x, y + 1)) - { - bottom_left = false; - bottom_right = false; - SDL_RenderDrawLine(gameScreen.m_renderer, x * 8, y * 8 + 7, x * 8 + 7, y * 8 + 7); - } - - if (!check_point(connected, x - 1, y - 1) && top_left) - SDL_RenderDrawPoint(gameScreen.m_renderer, x * 8, y * 8); - if (!check_point(connected, x - 1, y + 1) && top_right) - SDL_RenderDrawPoint(gameScreen.m_renderer, x * 8, y * 8 + 7); - if (!check_point(connected, x + 1, y - 1) && bottom_left) - SDL_RenderDrawPoint(gameScreen.m_renderer, x * 8 + 7, y * 8); - if (!check_point(connected, x + 1, y + 1) && bottom_right) - SDL_RenderDrawPoint(gameScreen.m_renderer, x * 8 + 7, y * 8 + 7); - } - } - else if (ed.b_modifier) graphics.draw_rect(x, 0, 8, 240, blue); // Vertical - else if (ed.h_modifier) graphics.draw_rect(0, y, 320, 8, blue); // Horizontal - else if (ed.v_modifier) graphics.draw_rect(x - 32, y - 32, 24 + 48, 24 + 48, blue); // 9x9 - else if (ed.c_modifier) graphics.draw_rect(x - 24, y - 24, 24 + 32, 24 + 32, blue); // 7x7 - else if (ed.x_modifier) graphics.draw_rect(x - 16, y - 16, 24 + 16, 24 + 16, blue); // 5x5 - else if (ed.z_modifier) graphics.draw_rect(x - 8, y - 8, 24, 24, blue); // 3x3 - SDL_FALLTHROUGH; - case EditorTool_SPIKES: - case EditorTool_GRAVITY_LINES: - case EditorTool_ROOMTEXT: - case EditorTool_SCRIPTS: - // 1x1 - graphics.draw_rect(x, y, 8, 8, blue); - break; - case EditorTool_TRINKETS: - case EditorTool_CHECKPOINTS: - case EditorTool_ENEMIES: - case EditorTool_WARP_TOKENS: - // 2x2 - graphics.draw_rect(x, y, 16, 16, blue); - break; - case EditorTool_DISAPPEARING_PLATFORMS: - case EditorTool_CONVEYORS: - case EditorTool_MOVING_PLATFORMS: - // 1x4 (platforms) - graphics.draw_rect(x, y, 32, 8, blue); - break; - case EditorTool_WARP_LINES: - // 1x1, but X if not on an edge (warp lines) - if (ed.tilex == 0 || ed.tilex == 39 || ed.tiley == 0 || ed.tiley == 29) - { - graphics.draw_rect(x, y, 8, 8, blue); - } - else - { - font::print(PR_FONT_8X8, x, y, "X", 255, 0, 0); - } - break; - case EditorTool_TERMINALS: - case EditorTool_CREWMATES: - case EditorTool_START_POINT: - // 2x3 - graphics.draw_rect(x, y, 16, 24, blue); - break; - default: - break; - } -} - -static void draw_tile_drawer(int tileset) -{ - extern editorclass ed; - - // Tile drawer for direct mode - int t2 = 0; - if (ed.direct_mode_drawer > 0) - { - if (ed.direct_mode_drawer <= 4) - { - t2 = graphics.lerp((4 - ed.direct_mode_drawer + 1) * 12, (4 - ed.direct_mode_drawer) * 12); - } - - // Draw five lines of the editor - const int temp = ed.direct_mode_tile - (ed.direct_mode_tile % 40) - 80; - graphics.fill_rect(0, -t2, 320, 40, graphics.getRGB(0, 0, 0)); - graphics.fill_rect(0, -t2 + 40, 320, 2, graphics.getRGB(255, 255, 255)); - - int texturewidth; - int textureheight; - - if (graphics.query_texture(graphics.grphx.im_tiles, NULL, NULL, &texturewidth, &textureheight) != 0) - { - return; - } - - const int numtiles = (int)(texturewidth / 8) * (textureheight / 8); - - for (int x = 0; x < SCREEN_WIDTH_TILES; x++) - { - for (int y = 0; y < 5; y++) - { - if (tileset == 0) - { - graphics.drawtile(x * 8, (y * 8) - t2, (temp + numtiles + (y * SCREEN_WIDTH_TILES) + x) % numtiles); - } - else - { - graphics.drawtile2(x * 8, (y * 8) - t2, (temp + numtiles + (y * SCREEN_WIDTH_TILES) + x) % numtiles); - } - } - } - - // Highlight our little block - graphics.draw_rect(((ed.direct_mode_tile % SCREEN_WIDTH_TILES) * 8) - 2, 16 - t2 - 2, 12, 12, graphics.getRGB(255 - help.glow, 196, 196)); - graphics.draw_rect(((ed.direct_mode_tile % SCREEN_WIDTH_TILES) * 8) - 1, 16 - t2 - 1, 10, 10, graphics.getRGB(0, 0, 0)); - } - - if (ed.direct_mode_drawer > 0 && t2 <= 30) - { - short labellen = 2 + font::len(0, loc::gettext("Tile:")); - font::print(PR_BOR, 2, 45 - t2, loc::gettext("Tile:"), 196, 196, 255 - help.glow); - font::print(PR_BOR, labellen + 16, 45 - t2, help.String(ed.direct_mode_tile), 196, 196, 255 - help.glow); - graphics.fill_rect(labellen + 2, 44 - t2, 10, 10, graphics.getRGB(255 - help.glow, 196, 196)); - graphics.fill_rect(labellen + 3, 45 - t2, 8, 8, graphics.getRGB(0, 0, 0)); - - if (tileset == 0) - { - graphics.drawtile(labellen + 3, 45 - t2, ed.direct_mode_tile); - } - else - { - graphics.drawtile2(labellen + 3, 45 - t2, ed.direct_mode_tile); - } - } - else - { - short labellen = 2 + font::len(0, loc::gettext("Tile:")); - int y = 2 + font::height(0); - y = SDL_max(y, 12); - font::print(PR_BOR, 2, y, loc::gettext("Tile:"), 196, 196, 255 - help.glow); - font::print(PR_BOR, labellen + 16, y, help.String(ed.direct_mode_tile), 196, 196, 255 - help.glow); - graphics.fill_rect(labellen + 2, y - 1, 10, 10, graphics.getRGB(255 - help.glow, 196, 196)); - graphics.fill_rect(labellen + 3, y, 8, 8, graphics.getRGB(0, 0, 0)); - - if (tileset == 0) - { - graphics.drawtile(labellen + 3, 12, ed.direct_mode_tile); - } - else - { - graphics.drawtile2(labellen + 3, 12, ed.direct_mode_tile); - } - } -} - -static void draw_box_placer() -{ - extern editorclass ed; - - std::string message; - if (ed.box_corner == BoxCorner_FIRST) - { - switch (ed.box_type) - { - case BoxType_SCRIPT: - message = loc::gettext("SCRIPT BOX: Click on the first corner"); - break; - case BoxType_ENEMY: - message = loc::gettext("ENEMY BOUNDS: Click on the first corner"); - break; - case BoxType_PLATFORM: - message = loc::gettext("PLATFORM BOUNDS: Click on the first corner"); - break; - default: - message = loc::gettext("Click on the first corner"); - break; - } - } - else if (ed.box_corner == BoxCorner_LAST) - { - switch (ed.box_type) - { - case BoxType_SCRIPT: - message = loc::gettext("SCRIPT BOX: Click on the last corner"); - break; - case BoxType_ENEMY: - message = loc::gettext("ENEMY BOUNDS: Click on the last corner"); - break; - case BoxType_PLATFORM: - message = loc::gettext("PLATFORM BOUNDS: Click on the last corner"); - break; - default: - message = loc::gettext("Click on the last corner"); - break; - } - } - - short lines; - message = font::string_wordwrap(0, message, 312, &lines); - short textheight = font::height(0) * lines; - - graphics.fill_rect(0, 238 - textheight, 320, 240, graphics.getRGB(32, 32, 32)); - graphics.fill_rect(0, 239 - textheight, 320, 240, graphics.getRGB(0, 0, 0)); - - font::print_wrap(PR_RTL_XFLIP, 4, 240 - textheight, message.c_str(), 255, 255, 255, 8, 312); -} - -static void draw_note() -{ - extern editorclass ed; - - if (ed.note_timer > 0 || ed.old_note_timer > 0) - { - short lines; - std::string wrapped = font::string_wordwrap(0, ed.note, 304, &lines); - short textheight = 8 + (lines - 1) * SDL_max(10, font::height(0)); - short banner_y = 120 - textheight / 2 - 5; - - float alpha = graphics.lerp(ed.old_note_timer, ed.note_timer); - graphics.fill_rect(0, banner_y, 320, 10 + textheight, graphics.getRGB(92, 92, 92)); - graphics.fill_rect(0, banner_y + 1, 320, 8 + textheight, graphics.getRGB(0, 0, 0)); - font::print_wrap(PR_CEN, -1, banner_y + 5, wrapped.c_str(), 196 - ((45.0f - alpha) * 4), 196 - ((45.0f - alpha) * 4), 196 - ((45.0f - alpha) * 4)); - } -} - -static void draw_toolbox(const char* coords) -{ - extern editorclass ed; - - // Draw the toolbox background - graphics.fill_rect(0, 207, 320, 240, graphics.getRGB(32, 32, 32)); - graphics.fill_rect(0, 208, 320, 240, graphics.getRGB(0, 0, 0)); - - // Draw all tools! - const int tool_gap = 32; - - const int page = ed.current_tool / 10; - const int max_pages = SDL_ceil(NUM_EditorTools / 10); - const int page_tool_count = SDL_min(10, NUM_EditorTools - (page * 10)); - - for (int i = 0; i < page_tool_count; i++) - { - const int current_tool_id = i + (page * 10); - - // First, draw the background - graphics.fill_rect(4 + (i * tool_gap), 208, 20, 20, graphics.getRGB(32, 32, 32)); - - // Draw the actual tool icon - ed.draw_tool((EditorTools)current_tool_id, 4 + (i * tool_gap) + 2, 208 + 2); - - // Draw the tool outline... - graphics.draw_rect(4 + (i * tool_gap), 208, 20, 20, (current_tool_id == ed.current_tool) ? graphics.getRGB(200, 200, 200) : graphics.getRGB(96, 96, 96)); - - // ...and the hotkey - const int col = current_tool_id == ed.current_tool ? 255 : 164; - font::print(PR_FONT_8X8 | PR_BOR, 22 + i * tool_gap - 4, 224 - 4, ed.tool_key_chars[current_tool_id], col, col, col); - } - - // Draw the page number, limit is 1 digit, so the max is 9 pages - char buffer[4]; - SDL_snprintf(buffer, sizeof(buffer), "%d/%d", page + 1, max_pages + 1); - font::print(PR_CJK_HIGH, 4, 232, buffer, 196, 196, 255 - help.glow); - - // Draw the button hint text - char changetooltext[SCREEN_WIDTH_CHARS + 1]; - vformat_buf(changetooltext, sizeof(changetooltext), - loc::gettext("{button1} and {button2} keys change tool"), - "button1:str, button2:str", - ",", "." - ); - font::print(PR_CJK_HIGH | PR_RIGHT, 320, 232, changetooltext, 196, 196, 255 - help.glow); - - // Draw the current tool name - char toolname_english[SCREEN_WIDTH_CHARS + 1]; - SDL_snprintf(toolname_english, sizeof(toolname_english), "%s: %s", ed.tool_key_chars[ed.current_tool], ed.tool_names[ed.current_tool]); - - const char* toolname = loc::gettext(toolname_english); - - int bgheight = 2 + font::height(0); - int toolnamelen = font::len(0, toolname); - graphics.fill_rect(0, 206 - bgheight, toolnamelen + 8, bgheight + 1, graphics.getRGB(32, 32, 32)); - graphics.fill_rect(0, 207 - bgheight, toolnamelen + 7, bgheight, graphics.getRGB(0, 0, 0)); - font::print(PR_BOR | PR_CJK_HIGH, 2, 198, toolname, 196, 196, 255 - help.glow); - - // And finally, draw the current room's coordinates - int coordslen = font::len(0, coords); - graphics.fill_rect(319 - coordslen - 8, 206 - bgheight, coordslen + 8, bgheight + 1, graphics.getRGB(32, 32, 32)); - graphics.fill_rect(320 - coordslen - 8, 207 - bgheight, coordslen + 8, bgheight, graphics.getRGB(0, 0, 0)); - font::print(PR_BOR | PR_CJK_HIGH | PR_RIGHT, 316, 198, coords, 196, 196, 255 - help.glow); -} - -static void draw_main_ui(void) -{ - extern editorclass ed; - - const RoomProperty* const room = cl.getroomprop(ed.levx, ed.levy); - - char coords[8]; - SDL_snprintf(coords, sizeof(coords), "(%d,%d)", ed.levx + 1, ed.levy + 1); - - if (ed.toolbox_open) - { - draw_toolbox(coords); - } - else - { - if (room->roomname != "") - { - int font_height = font::height(PR_FONT_LEVEL); - if (font_height <= 8) - { - graphics.footerrect.h = font_height + 2; - } - else - { - graphics.footerrect.h = font_height + 1; - } - graphics.footerrect.y = 240 - graphics.footerrect.h + ed.roomnamehide; - - graphics.set_blendmode(SDL_BLENDMODE_BLEND); - graphics.fill_rect(&graphics.footerrect, graphics.getRGBA(0, 0, 0, graphics.translucentroomname ? 127 : 255)); - graphics.set_blendmode(SDL_BLENDMODE_NONE); - - font::print(PR_CEN | PR_BOR | PR_FONT_LEVEL | PR_CJK_LOW, -1, graphics.footerrect.y + 1 + ed.roomnamehide, room->roomname, 196, 196, 255 - help.glow); - font::print(PR_BOR | PR_CJK_HIGH, 4, 232 - graphics.footerrect.h, loc::gettext("SPACE ^ SHIFT ^"), 196, 196, 255 - help.glow); - font::print(PR_BOR | PR_CJK_HIGH | PR_RIGHT, 316, 232 - graphics.footerrect.h, coords, 196, 196, 255 - help.glow); - } - else - { - font::print(PR_BOR | PR_CJK_HIGH, 4, 232, loc::gettext("SPACE ^ SHIFT ^"), 196, 196, 255 - help.glow); - font::print(PR_BOR | PR_CJK_HIGH | PR_RIGHT, 316, 232, coords, 196, 196, 255 - help.glow); - } - } - - if (ed.help_open) - { - const char* shiftmenuoptions[] = { - loc::gettext("F1: Change Tileset"), - loc::gettext("F2: Change Colour"), - loc::gettext("F3: Change Enemies"), - loc::gettext("F4: Enemy Bounds"), - loc::gettext("F5: Platform Bounds"), - "", - loc::gettext("F9: Reload Resources"), - loc::gettext("F10: Direct Mode"), - "", - loc::gettext("W: Change Warp Dir"), - loc::gettext("E: Change Roomname"), - }; - int menuwidth = 0; - for (size_t i = 0; i < SDL_arraysize(shiftmenuoptions); i++) - { - int len = font::len(0, shiftmenuoptions[i]); - if (len > menuwidth) - menuwidth = len; - } - - int lineheight = font::height(0); - lineheight = SDL_max(10, lineheight); - int left_y = 230 - SDL_arraysize(shiftmenuoptions) * lineheight; - - graphics.draw_rect(0, left_y - 3, menuwidth + 17, 240, graphics.getRGB(64, 64, 64)); - graphics.fill_rect(0, left_y - 2, menuwidth + 16, 240, graphics.getRGB(0, 0, 0)); - for (size_t i = 0; i < SDL_arraysize(shiftmenuoptions); i++) - font::print(0, 4, left_y + i * lineheight, shiftmenuoptions[i], 164, 164, 164); - - graphics.draw_rect(220, 207, 100, 60, graphics.getRGB(64, 64, 64)); - graphics.fill_rect(221, 208, 160, 60, graphics.getRGB(0, 0, 0)); - font::print(0, 224, 210, loc::gettext("S: Save Map"), 164, 164, 164); - font::print(0, 224, 210 + lineheight, loc::gettext("L: Load Map"), 164, 164, 164); - } -} - -void editorclass::draw_tool(EditorTools tool, int x, int y) -{ - switch (tool) - { - case EditorTool_WALLS: - graphics.drawtile(x, y, 83); - graphics.drawtile(x + 8, y, 83); - graphics.drawtile(x, y + 8, 83); - graphics.drawtile(x + 8, y + 8, 83); - break; - case EditorTool_BACKING: - graphics.drawtile(x, y, 680); - graphics.drawtile(x + 8, y, 680); - graphics.drawtile(x, y + 8, 680); - graphics.drawtile(x + 8, y + 8, 680); - break; - case EditorTool_SPIKES: - graphics.drawtile(x + 4, y + 4, 8); - break; - case EditorTool_TRINKETS: - graphics.draw_sprite(x, y, 22, 196, 196, 196); - break; - case EditorTool_CHECKPOINTS: - graphics.draw_sprite(x, y, 21, 196, 196, 196); - break; - case EditorTool_DISAPPEARING_PLATFORMS: - graphics.drawtile(x, y + 4, 3); - graphics.drawtile(x + 8, y + 4, 4); - break; - case EditorTool_CONVEYORS: - graphics.drawtile(x, y + 4, 24); - graphics.drawtile(x + 8, y + 4, 24); - break; - case EditorTool_MOVING_PLATFORMS: - graphics.drawtile(x, y + 4, 1); - graphics.drawtile(x + 8, y + 4, 1); - break; - case EditorTool_ENEMIES: - graphics.draw_sprite(x, y, 78 + entframe, 196, 196, 196); - break; - case EditorTool_GRAVITY_LINES: - graphics.fill_rect(x + 2, y + 8, 12, 1, graphics.getRGB(255, 255, 255)); - break; - case EditorTool_ROOMTEXT: - font::print(PR_FONT_8X8, x + 1, y, "AB", 196, 196, 255 - help.glow); - font::print(PR_FONT_8X8, x + 1, y + 9, "CD", 196, 196, 255 - help.glow); - break; - case EditorTool_TERMINALS: - graphics.draw_sprite(x, y, 17, 196, 196, 196); - break; - case EditorTool_SCRIPTS: - graphics.draw_rect(x + 4, y + 4, 8, 8, graphics.getRGB(96, 96, 96)); - break; - case EditorTool_WARP_TOKENS: - graphics.draw_sprite(x, y, 18 + (entframe % 2), 196, 196, 196); - break; - case EditorTool_WARP_LINES: - graphics.fill_rect(x + 6, y + 2, 4, 12, graphics.getRGB(255, 255, 255)); - break; - case EditorTool_CREWMATES: - graphics.draw_sprite(x, y, 186, graphics.col_crewblue); - break; - case EditorTool_START_POINT: - graphics.draw_sprite(x, y, 184, graphics.col_crewcyan); - break; - default: - break; - } -} - -void editorrender(void) -{ - extern editorclass ed; - - const RoomProperty* const room = cl.getroomprop(ed.levx, ed.levy); - - graphics.clear(); - - switch (ed.state) - { - case EditorState_DRAW: - // Draw the editor guidelines - draw_background_grid(); - - // Draw the background, if any, over the guidelines - draw_background(room->warpdir); - - graphics.drawmap(); - draw_edgeguides(); - - draw_entities(); - draw_ghosts(); - - draw_bounds(); - - if (room->directmode == 1) - { - draw_tile_drawer(room->tileset); - } - - draw_cursor(); - - switch (ed.substate) - { - case EditorSubState_MAIN: - { - draw_main_ui(); - - // Draw the current tool name - char toolname_english[SCREEN_WIDTH_CHARS + 1]; - SDL_snprintf(toolname_english, sizeof(toolname_english), "%s: %s", ed.tool_key_chars[ed.current_tool], ed.tool_names[ed.current_tool]); - - const char* toolname = loc::gettext(toolname_english); - - font::print(PR_BOR, 2, 2, toolname, 196, 196, 255 - help.glow); - - break; - } - case EditorSubState_DRAW_BOX: - draw_box_placer(); - break; - case EditorSubState_DRAW_INPUT: - { - short lines; - std::string wrapped = font::string_wordwrap(0, loc::gettext(ed.current_text_desc.c_str()), 312, &lines); - short textheight = font::height(0) * lines + font::height(PR_FONT_LEVEL); - - graphics.fill_rect(0, 238 - textheight, 320, 240, graphics.getRGB(32, 32, 32)); - graphics.fill_rect(0, 239 - textheight, 320, 240, graphics.getRGB(0, 0, 0)); - font::print_wrap(PR_RTL_XFLIP, 4, 240 - textheight, wrapped.c_str(), 255, 255, 255, 8, 312); - std::string input = key.keybuffer; - if (ed.entframe < 2) - { - input += "_"; - } - else - { - input += " "; - } - font::print(PR_CEN | PR_FONT_LEVEL | PR_CJK_HIGH, -1, 232, input, 196, 196, 255 - help.glow); - break; - } - case EditorSubState_DRAW_WARPTOKEN: - { - // Placing warp token - int textheight = font::height(0); - graphics.fill_rect(0, 237 - textheight * 2, 320, 240, graphics.getRGB(32, 32, 32)); - graphics.fill_rect(0, 238 - textheight * 2, 320, 240, graphics.getRGB(0, 0, 0)); - font::print(PR_CJK_LOW | PR_RTL_XFLIP, 4, 240 - textheight * 2, loc::gettext("Left click to place warp destination"), 196, 196, 255 - help.glow); - font::print(PR_CJK_LOW | PR_RTL_XFLIP, 4, 240 - textheight, loc::gettext("Right click to cancel"), 196, 196, 255 - help.glow); - - break; - } - default: - break; - } - - break; - case EditorState_SCRIPTS: - // Intended to look like Commodore 64's UI - - graphics.fill_rect(0, 0, 320, 240, graphics.getRGB(123, 111, 218)); - graphics.fill_rect(14, 16, 292, 208, graphics.getRGB(61, 48, 162)); - - switch (ed.substate) - { - case EditorSubState_MAIN: - font::print(PR_CEN, -1, 28, loc::gettext("**** VVVVVV SCRIPT EDITOR ****"), 123, 111, 218); - font::print(PR_CEN, -1, 44, loc::gettext("PRESS ESC TO RETURN TO MENU"), 123, 111, 218); - - if (script.customscripts.empty()) - { - font::print(PR_CEN, -1, 110, loc::gettext("NO SCRIPT IDS FOUND"), 123, 111, 218); - font::print_wrap(PR_CEN, -1, 130, loc::gettext("CREATE A SCRIPT WITH EITHER THE TERMINAL OR SCRIPT BOX TOOLS"), 123, 111, 218, 10, 288); - break; - } - for (int i = 0; i < 9; i++) - { - const int offset = ed.script_list_offset + i; - const bool draw = offset < (int) script.customscripts.size(); - if (!draw) - { - continue; - } - if (offset == ed.selected_script) - { - std::string text_upper(loc::toupper(script.customscripts[script.customscripts.size() - 1 - offset].name)); - char buffer[SCREEN_WIDTH_CHARS + 1]; - vformat_buf(buffer, sizeof(buffer), loc::get_langmeta()->menu_select.c_str(), "label:str", text_upper.c_str()); - font::print(PR_CEN, -1, 68 + (i * 16), buffer, 123, 111, 218); - } - else - { - font::print(PR_CEN, -1, 68 + (i * 16), script.customscripts[script.customscripts.size() - 1 - offset].name, 123, 111, 218); - } - } - break; - case EditorSubState_SCRIPTS_EDIT: - { - // Draw the current script's name - graphics.fill_rect(14, 226, 292, 12, graphics.getRGB(61, 48, 162)); - char namebuffer[SCREEN_WIDTH_CHARS + 1]; - vformat_buf( - namebuffer, sizeof(namebuffer), - loc::gettext("CURRENT SCRIPT: {name}"), - "name:str", - ed.current_script.c_str() - ); - font::print(PR_CEN, -1, 228, namebuffer, 123, 111, 218); - - // Draw text - int font_height = font::height(PR_FONT_LEVEL); - for (int i = 0; i < ed.lines_visible; i++) - { - if (i + ed.script_offset < (int) ed.script_buffer.size()) - { - font::print(PR_FONT_LEVEL | PR_CJK_LOW, 16, 20 + (i * font_height), ed.script_buffer[i + ed.script_offset], 123, 111, 218); - } - } - - // Draw cursor - if (ed.entframe < 2) - { - font::print(PR_FONT_LEVEL | PR_CJK_LOW, 16 + font::len(PR_FONT_LEVEL, ed.script_buffer[ed.script_cursor_y].c_str()), 20 + ((ed.script_cursor_y - ed.script_offset) * font_height), "_", 123, 111, 218); - } - break; - } - default: - break; - } - break; - case EditorState_MENU: - { - if (!game.colourblindmode) - { - graphics.drawtowerbackground(graphics.titlebg); - } - else - { - graphics.clear(); - } - - int tr = SDL_clamp(graphics.titlebg.r - (help.glow / 4) - int(fRandom() * 4), 0, 255); - int tg = SDL_clamp(graphics.titlebg.g - (help.glow / 4) - int(fRandom() * 4), 0, 255); - int tb = SDL_clamp(graphics.titlebg.b - (help.glow / 4) - int(fRandom() * 4), 0, 255); - - editormenurender(tr, tg, tb); - graphics.drawmenu(tr, tg, tb, game.currentmenuname); - break; - } - default: - break; - } - - draw_note(); - - graphics.drawfade(); - - graphics.render(); -} - -void editorrenderfixed(void) -{ - extern editorclass ed; - const RoomProperty* const room = cl.getroomprop(ed.levx, ed.levy); - graphics.updatetitlecolours(); - - graphics.trinketcolset = false; - - game.customcol = cl.getlevelcol(room->tileset, room->tilecol) + 1; - ed.entcol = cl.getenemycol(game.customcol); - - ed.entcolreal = graphics.getcol(ed.entcol); - - if (game.ghostsenabled) - { - for (size_t i = 0; i < ed.ghosts.size(); i++) - { - GhostInfo* ghost = &ed.ghosts[i]; - - if ((int) i > ed.current_ghosts || ghost->rx != ed.levx || ghost->ry != ed.levy) - { - continue; - } - - ghost->realcol = graphics.getcol(ghost->col); - } - - ed.current_ghosts++; - if (ed.z_modifier) - { - ed.current_ghosts++; - } - - ed.current_ghosts = SDL_min(ed.current_ghosts, ed.ghosts.size()); - } - - switch (ed.state) - { - case EditorState_DRAW: - switch (room->warpdir) - { - case 1: - graphics.rcol = cl.getwarpbackground(ed.levx, ed.levy); - graphics.updatebackground(3); - break; - case 2: - graphics.rcol = cl.getwarpbackground(ed.levx, ed.levy); - graphics.updatebackground(4); - break; - case 3: - graphics.rcol = cl.getwarpbackground(ed.levx, ed.levy); - graphics.updatebackground(5); - break; - default: - break; - } - break; - case EditorState_MENU: - graphics.titlebg.bypos -= 2; - graphics.titlebg.bscroll = -2; - graphics.updatetowerbackground(graphics.titlebg); - break; - default: - break; - } - - if (cl.getroomprop(ed.levx, ed.levy)->directmode == 1) - { - if (ed.direct_mode_drawer > 0) - { - ed.direct_mode_drawer--; - } - } - else - { - ed.direct_mode_drawer = 0; - } - - if (cl.getroomprop(ed.levx, ed.levy)->roomname != "") - { - if (ed.tiley < 28) - { - if (ed.roomnamehide > 0) - { - ed.roomnamehide--; - } - } - else - { - if (ed.roomnamehide < 14) - { - ed.roomnamehide++; - } - } - } - else - { - if (ed.tiley < 28) - { - ed.roomnamehide = 0; - } - else - { - ed.roomnamehide = 14; - } - } -} - -static void input_submitted(void) -{ - extern editorclass ed; - - *ed.current_text_ptr = key.keybuffer; - - ed.help_open = false; - ed.shiftkey = false; - - bool reset_text_mode = true; - - key.disabletextentry(); - - ed.substate = EditorSubState_MAIN; - - switch (ed.current_text_mode) - { - case TEXT_GOTOROOM: - { - char coord_x[16]; - char coord_y[16]; - - const char* comma = SDL_strchr(key.keybuffer.c_str(), ','); - - bool valid_input = comma != NULL; - - if (valid_input) - { - SDL_strlcpy( - coord_x, - key.keybuffer.c_str(), - SDL_min((size_t) (comma - key.keybuffer.c_str() + 1), sizeof(coord_x)) - ); - SDL_strlcpy(coord_y, &comma[1], sizeof(coord_y)); - - valid_input = is_number(coord_x) && is_number(coord_y); - } - - if (!valid_input) - { - ed.show_note(loc::gettext("ERROR: Invalid format")); - break; - } - - ed.levx = SDL_clamp(help.Int(coord_x) - 1, 0, cl.mapwidth - 1); - ed.levy = SDL_clamp(help.Int(coord_y) - 1, 0, cl.mapheight - 1); - graphics.foregrounddrawn = false; - graphics.backgrounddrawn = false; - break; - } - case TEXT_LOAD: - { - std::string loadstring = ed.filename + ".vvvvvv"; - if (cl.load(loadstring)) - { - // don't use filename, it has the full path - char buffer[3 * SCREEN_WIDTH_CHARS + 1]; - vformat_buf(buffer, sizeof(buffer), loc::gettext("Loaded map: {filename}.vvvvvv"), "filename:str", ed.filename.c_str()); - ed.show_note(buffer); - } - else - { - ed.show_note(loc::gettext("ERROR: Could not load level")); - } - graphics.foregrounddrawn = false; - graphics.backgrounddrawn = false; - ed.substate = EditorSubState_MAIN; - break; - } - case TEXT_SAVE: - { - std::string savestring = ed.filename + ".vvvvvv"; - if (cl.save(savestring)) - { - char buffer[3 * SCREEN_WIDTH_CHARS + 1]; - vformat_buf(buffer, sizeof(buffer), loc::gettext("Saved map: {filename}.vvvvvv"), "filename:str", ed.filename.c_str()); - ed.show_note(buffer); - } - else - { - ed.show_note(loc::gettext("ERROR: Could not save level!")); - ed.saveandquit = false; - } - ed.note_timer = 45; - - if (ed.saveandquit) - { - graphics.fademode = FADE_START_FADEOUT; /* quit editor */ - } - break; - } - case TEXT_SCRIPT: - ed.clear_script_buffer(); - if (!ed.script_exists(key.keybuffer)) - { - ed.create_script(key.keybuffer); - } - break; - case TEXT_TITLE: - cl.title = key.keybuffer; - if (cl.title == "") - { - cl.title = "Untitled Level"; - } - break; - case TEXT_CREATOR: - cl.creator = key.keybuffer; - if (cl.creator == "") - { - cl.creator = "Unknown"; - } - break; - case TEXT_WEBSITE: - cl.website = key.keybuffer; - break; - case TEXT_DESC1: - cl.Desc1 = key.keybuffer; - ed.current_text_mode = TEXT_DESC2; - ed.substate = EditorSubState_MENU_INPUT; - reset_text_mode = false; - key.enabletextentry(); - ed.current_text_ptr = &(key.keybuffer); - key.keybuffer = cl.Desc2; - break; - case TEXT_DESC2: - cl.Desc2 = key.keybuffer; - - if (font::height(PR_FONT_LEVEL) <= 10) - { - ed.current_text_mode = TEXT_DESC3; - key.enabletextentry(); - ed.substate = EditorSubState_MENU_INPUT; - reset_text_mode = false; - ed.current_text_ptr = &(key.keybuffer); - key.keybuffer = cl.Desc3; - } - else - { - cl.Desc3 = ""; - } - - break; - case TEXT_DESC3: - cl.Desc3 = key.keybuffer; - break; - default: - break; - } - - if (reset_text_mode) - { - ed.current_text_mode = TEXT_NONE; - } -} - -void editorlogic(void) -{ - extern editorclass ed; - - //Misc - help.updateglow(); - - ed.entframedelay--; - if (ed.entframedelay <= 0) - { - ed.entframe = (ed.entframe + 1) % 4; - ed.entframedelay = 8; - } - - ed.old_note_timer = ed.note_timer; - ed.note_timer = SDL_max(ed.note_timer - 1, 0); - - update_entities(); - - if (graphics.fademode == FADE_FULLY_BLACK) - { - //Return to game - graphics.titlebg.colstate = 10; - map.nexttowercolour(); - game.quittomenu(); - music.play(Music_PRESENTINGVVVVVV); // should be before game.quittomenu() - } -} - -void editorclass::add_entity(int rx, int ry, int xp, int yp, int tp, int p1, int p2, int p3, int p4, int p5, int p6) -{ - CustomEntity entity; - - entity.rx = rx; - entity.ry = ry; - entity.x = xp; - entity.y = yp; - entity.t = tp; - entity.p1 = p1; - entity.p2 = p2; - entity.p3 = p3; - entity.p4 = p4; - entity.p5 = p5; - entity.p6 = p6; - entity.scriptname = ""; - - customentities.push_back(entity); -} - -void editorclass::remove_entity(int t) -{ - customentities.erase(customentities.begin() + t); -} - -int editorclass::get_entity_at(int rx, int ry, int xp, int yp) -{ - for (size_t i = 0; i < customentities.size(); i++) - { - const CustomEntity* entity = &customentities[i]; - if (entity->rx == rx && entity->ry == ry && - entity->x == xp && entity->y == yp) - { - return i; - } - } - return -1; -} - -static void set_tile_interpolated(const int x1, const int x2, const int y1, const int y2, const int tile) -{ - extern editorclass ed; - - // draw a line between (x1, y1) and (x2, y2) - - const int dx = x2 - x1; - const int dy = y2 - y1; - - const int steps = SDL_max(SDL_abs(dx), SDL_abs(dy)); - - if (steps == 0) - { - ed.set_tile(x1, y1, tile); - return; - } - - for (int i = 0; i <= steps; i++) - { - const int x = x1 + (dx * i) / steps; - const int y = y1 + (dy * i) / steps; - - ed.set_tile(x, y, tile); - } -} - -void editorclass::get_tile_fill(int tilex, int tiley, int tile, bool connected[SCREEN_HEIGHT_TILES][SCREEN_WIDTH_TILES]) -{ - if (tilex < 0 || tilex >= SCREEN_WIDTH_TILES || tiley < 0 || tiley >= SCREEN_HEIGHT_TILES) - { - // It's out of bounds - return; - } - - if (connected[tiley][tilex]) - { - // We've already visited this tile - return; - } - - if (cl.gettile(levx, levy, tilex, tiley) != tile) - { - // It's not the same tile - return; - } - - // Yep, this is connected! - connected[tiley][tilex] = true; - - // Check surrounding 4 tiles - get_tile_fill(tilex - 1, tiley, tile, connected); - get_tile_fill(tilex + 1, tiley, tile, connected); - get_tile_fill(tilex, tiley - 1, tile, connected); - get_tile_fill(tilex, tiley + 1, tile, connected); -} - -void editorclass::handle_tile_placement(const int tile) -{ - int range = 1; - - if (f_modifier) - { - bool connected[SCREEN_HEIGHT_TILES][SCREEN_WIDTH_TILES]; - SDL_zeroa(connected); - - get_tile_fill(tilex, tiley, cl.gettile(levx, levy, tilex, tiley), connected); - - for (int i = 0; i < SCREEN_WIDTH_TILES * SCREEN_HEIGHT_TILES; i++) - { - const int x = i % SCREEN_WIDTH_TILES; - const int y = i / SCREEN_WIDTH_TILES; - - if (connected[y][x]) - { - set_tile(x, y, tile); - } - } - return; - } - else if (b_modifier) - { - // Vertical line - for (int i = 0; i < SCREEN_HEIGHT_TILES; i++) - { - set_tile_interpolated(old_tilex, tilex, i, i, tile); - } - return; - } - else if (h_modifier) - { - // Horizontal line - for (int i = 0; i < SCREEN_WIDTH_TILES; i++) - { - set_tile_interpolated(i, i, old_tiley, tiley, tile); - } - return; - } - else if (v_modifier) - { - range = 4; - } - else if (c_modifier) - { - range = 3; - } - else if (x_modifier) - { - range = 2; - } - else if (z_modifier) - { - range = 1; - } - else - { - set_tile_interpolated(old_tilex, tilex, old_tiley, tiley, tile); - return; - } - - for (int i = -range; i <= range; i++) - { - for (int j = -range; j <= range; j++) - { - set_tile_interpolated(old_tilex + i, tilex + i, old_tiley + j, tiley + j, tile); - } - } -} - -void editorclass::tool_remove() -{ - switch (current_tool) - { - case EditorTool_WALLS: - case EditorTool_BACKING: - handle_tile_placement(0); - break; - case EditorTool_SPIKES: - set_tile_interpolated(old_tilex, tilex, old_tiley, tiley, 0); - break; - default: - break; - } - - for (size_t i = 0; i < customentities.size(); i++) - { - const CustomEntity* entity = &customentities[i]; - if (entity->rx == levx && entity->ry == levy && - entity->x == tilex && entity->y == tiley) - { - remove_entity(i); - } - } -} - -void editorclass::entity_clicked(const int index) -{ - CustomEntity* entity = &customentities[index]; - - lclickdelay = 1; - - switch (entity->t) - { - case 1: - // Enemies - entity->p1 = (entity->p1 + 1) % 4; - break; - case 2: - { - // Moving Platforms and Conveyors - const bool conveyor = entity->p1 >= 5; - entity->p1++; - if (conveyor) - { - entity->p1 = (entity->p1 - 5) % 4 + 5; - } - else - { - entity->p1 %= 4; - } - break; - } - case 10: - // Checkpoints - // If it's not textured as a checkpoint, then just leave it be - if (entity->p1 == 0 || entity->p1 == 1) - { - entity->p1 = (entity->p1 + 1) % 2; - } - break; - case 11: - case 16: - // Gravity Lines, Start Point - entity->p1 = (entity->p1 + 1) % 2; - break; - case 15: - // Crewmates - entity->p1 = (entity->p1 + 1) % 6; - break; - case 17: - // Roomtext - get_input_line(TEXT_ROOMTEXT, "Enter roomtext:", &entity->scriptname); - text_entity = index; - break; - case 18: - // Terminals - if (entity->p1 == 0 || entity->p1 == 1) - { - // Flip the terminal, but if it's not textured as a terminal leave it alone - entity->p1 = (entity->p1 + 1) % 2; - } - SDL_FALLTHROUGH; - case 19: - // Script Boxes (and terminals) - get_input_line(TEXT_SCRIPT, "Enter script name:", &entity->scriptname); - text_entity = index; - break; - } -} - -void editorclass::tool_place() -{ - const int entity = get_entity_at(levx, levy, tilex, tiley); - if (entity != -1) - { - entity_clicked(entity); - return; - } - - switch (current_tool) - { - case EditorTool_WALLS: - case EditorTool_BACKING: - { - int tile = 0; - - if (cl.getroomprop(levx, levy)->directmode >= 1) - { - tile = direct_mode_tile; - } - else if (current_tool == EditorTool_WALLS) - { - tile = 1; - } - else if (current_tool == EditorTool_BACKING) - { - tile = 2; - } - - handle_tile_placement(tile); - break; - } - case EditorTool_SPIKES: - set_tile_interpolated(old_tilex, tilex, old_tiley, tiley, 8); - break; - case EditorTool_TRINKETS: - if (cl.numtrinkets() < 100) - { - add_entity(levx, levy, tilex, tiley, 9); - lclickdelay = 1; - } - else - { - show_note(loc::gettext("ERROR: Max number of trinkets is 100")); - } - break; - case EditorTool_CHECKPOINTS: - add_entity(levx, levy, tilex, tiley, 10, 1); - lclickdelay = 1; - break; - case EditorTool_DISAPPEARING_PLATFORMS: - add_entity(levx, levy, tilex, tiley, 3); - lclickdelay = 1; - break; - case EditorTool_CONVEYORS: - add_entity(levx, levy, tilex, tiley, 2, 5); - lclickdelay = 1; - break; - case EditorTool_MOVING_PLATFORMS: - add_entity(levx, levy, tilex, tiley, 2, 0); - lclickdelay = 1; - break; - case EditorTool_ENEMIES: - add_entity(levx, levy, tilex, tiley, 1, 0); - lclickdelay = 1; - break; - case EditorTool_GRAVITY_LINES: - add_entity(levx, levy, tilex, tiley, 11, 0); - lclickdelay = 1; - break; - case EditorTool_ROOMTEXT: - lclickdelay = 1; - text_entity = customentities.size(); - add_entity(levx, levy, tilex, tiley, 17, cl.rtl ? 1 : 0); - get_input_line(TEXT_ROOMTEXT, "Enter roomtext:", &(customentities[text_entity].scriptname)); - break; - case EditorTool_TERMINALS: - lclickdelay = 1; - text_entity = customentities.size(); - add_entity(levx, levy, tilex, tiley, 18, 0); - get_input_line(TEXT_SCRIPT, "Enter script name:", &(customentities[text_entity].scriptname)); - break; - case EditorTool_SCRIPTS: - substate = EditorSubState_DRAW_BOX; - box_corner = BoxCorner_LAST; - box_type = BoxType_SCRIPT; - box_point.x = tilex * 8; - box_point.y = tiley * 8; - - lclickdelay = 1; - break; - case EditorTool_WARP_TOKENS: - substate = EditorSubState_DRAW_WARPTOKEN; - warp_token_entity = customentities.size(); - add_entity(levx, levy, tilex, tiley, 13); - lclickdelay = 1; - break; - case EditorTool_WARP_LINES: - //Warp lines - if (tilex == 0) - { - add_entity(levx, levy, tilex, tiley, 50, 0); - } - else if (tilex == 39) - { - add_entity(levx, levy, tilex, tiley, 50, 1); - } - else if (tiley == 0) - { - add_entity(levx, levy, tilex, tiley, 50, 2); - } - else if (tiley == 29) - { - add_entity(levx, levy, tilex, tiley, 50, 3); - } - else - { - show_note(loc::gettext("ERROR: Warp lines must be on edges")); - } - lclickdelay = 1; - break; - case EditorTool_CREWMATES: - if (cl.numcrewmates() < 100) - { - add_entity(levx, levy, tilex, tiley, 15, int(fRandom() * 6)); - lclickdelay = 1; - } - else - { - show_note(loc::gettext("ERROR: Max number of crewmates is 100")); - } - break; - case EditorTool_START_POINT: - //If there is another start point, destroy it - for (size_t i = 0; i < customentities.size(); i++) - { - if (customentities[i].t == 16) - { - remove_entity(i); - i--; - } - } - add_entity(levx, levy, tilex, tiley, 16, 0); - lclickdelay = 1; - break; - default: - break; - } -} - -static void creategameoptions(void) -{ - game.createmenu(Menu::options); -} - -static void nextbgcolor(void) -{ - map.nexttowercolour(); -} - -static void editormenuactionpress(void) -{ - extern editorclass ed; - - switch (game.currentmenuname) - { - case Menu::ed_desc: - switch (game.currentmenuoption) - { - case 0: - { - const bool title_is_gettext = translate_title(cl.title); - - ed.current_text_mode = TEXT_TITLE; - ed.substate = EditorSubState_MENU_INPUT; - key.enabletextentry(); - ed.current_text_ptr = &(key.keybuffer); - - if (title_is_gettext) - { - key.keybuffer = ""; - } - else - { - key.keybuffer = cl.title; - } - break; - } - case 1: - { - const bool creator_is_gettext = translate_creator(cl.creator); - - ed.current_text_mode = TEXT_CREATOR; - ed.substate = EditorSubState_MENU_INPUT; - key.enabletextentry(); - ed.current_text_ptr = &(key.keybuffer); - if (creator_is_gettext) - { - key.keybuffer = ""; - } - else - { - key.keybuffer = cl.creator; - } - break; - } - case 2: - ed.current_text_mode = TEXT_DESC1; - ed.substate = EditorSubState_MENU_INPUT; - key.enabletextentry(); - ed.current_text_ptr = &(key.keybuffer); - key.keybuffer = cl.Desc1; - break; - case 3: - ed.current_text_mode = TEXT_WEBSITE; - ed.substate = EditorSubState_MENU_INPUT; - key.enabletextentry(); - ed.current_text_ptr = &(key.keybuffer); - key.keybuffer=cl.website; - break; - case 4: - game.createmenu(Menu::ed_font); - map.nexttowercolour(); - break; - case 5: - game.returnmenu(); - map.nexttowercolour(); - break; - } - music.playef(Sound_VIRIDIAN); - break; - case Menu::ed_settings: - switch (game.currentmenuoption) - { - case 0: - //Change level description stuff - music.playef(Sound_VIRIDIAN); - game.createmenu(Menu::ed_desc); - map.nexttowercolour(); - break; - case 1: - //Enter script editormode - music.playef(Sound_VIRIDIAN); - - ed.state = EditorState_SCRIPTS; - ed.substate = EditorSubState_MAIN; - - ed.clear_script_buffer(); - key.keybuffer = ""; - ed.script_list_offset = 0; - ed.selected_script = 0; - - ed.script_cursor_y = 0; - ed.script_cursor_x = 0; - ed.script_offset = 0; - ed.lines_visible = 200 / font::height(PR_FONT_LEVEL); - break; - case 2: - music.playef(Sound_VIRIDIAN); - game.createmenu(Menu::ed_music); - map.nexttowercolour(); - if(cl.levmusic>0) music.play(cl.levmusic); - break; - case 3: - music.playef(Sound_VIRIDIAN); - game.ghostsenabled = !game.ghostsenabled; - break; - case 4: - //Load level - map.nexttowercolour(); - - ed.keydelay = 6; - ed.get_input_line(TEXT_LOAD, "Enter map filename to load:", &(ed.filename)); - game.mapheld = true; - graphics.backgrounddrawn = false; - break; - case 5: - //Save level - map.nexttowercolour(); - - ed.keydelay = 6; - ed.get_input_line(TEXT_SAVE, "Enter map filename to save as:", &(ed.filename)); - game.mapheld = true; - graphics.backgrounddrawn = false; - break; - case 6: - /* Game options */ - music.playef(Sound_VIRIDIAN); - game.gamestate = TITLEMODE; - game.ingame_titlemode = true; - game.ingame_editormode = true; - - DEFER_CALLBACK(creategameoptions); - DEFER_CALLBACK(nextbgcolor); - break; - default: - music.playef(Sound_VIRIDIAN); - game.createmenu(Menu::ed_quit); - map.nexttowercolour(); - break; - } - break; - case Menu::ed_music: - switch (game.currentmenuoption) - { - case 0: - case 1: - switch (game.currentmenuoption) - { - case 0: - cl.levmusic++; - break; - case 1: - cl.levmusic--; - break; - } - - cl.levmusic = POS_MOD(cl.levmusic, 16); - - if (cl.levmusic > 0) - { - music.play(cl.levmusic); - } - else - { - music.haltdasmusik(); - } - - music.playef(Sound_VIRIDIAN); - break; - case 2: - music.playef(Sound_VIRIDIAN); - music.fadeout(); - game.returnmenu(); - map.nexttowercolour(); - break; - } - break; - case Menu::ed_quit: - switch (game.currentmenuoption) - { - case 0: - //Saving and quit - ed.saveandquit = true; - - map.nexttowercolour(); - - ed.keydelay = 6; - ed.get_input_line(TEXT_SAVE, "Enter map filename to save as:", &(ed.filename)); - game.mapheld = true; - graphics.backgrounddrawn = false; - break; - case 1: - //Quit without saving - music.playef(Sound_VIRIDIAN); - music.fadeout(); - graphics.fademode = FADE_START_FADEOUT; - graphics.backgrounddrawn = false; - break; - case 2: - //Go back to editor - music.playef(Sound_VIRIDIAN); - game.returnmenu(); - map.nexttowercolour(); - break; - } - break; - case Menu::ed_font: - { - uint8_t idx_selected = font::font_idx_options[game.currentmenuoption]; - cl.level_font_name = font::get_main_font_name(idx_selected); - if (idx_selected == loc::get_langmeta()->font_idx) - { - loc::new_level_font = ""; - } - else - { - loc::new_level_font = cl.level_font_name; - } - font::set_level_font(cl.level_font_name.c_str()); - music.playef(Sound_VIRIDIAN); - game.returnmenu(); - map.nexttowercolour(); - game.savestatsandsettings_menu(); - break; - } - default: - break; - } -} - -static void start_at_checkpoint(void) -{ - extern editorclass ed; - - // Scan the room for a start point or a checkpoint, the start point taking priority - int testeditor = -1; - bool startpoint = false; - - for (size_t i = 0; i < customentities.size(); i++) - { - startpoint = customentities[i].t == 16; - const bool is_startpoint_or_checkpoint = startpoint || - customentities[i].t == 10; - if (!is_startpoint_or_checkpoint) - { - continue; - } - - const bool in_room = customentities[i].rx == ed.levx && - customentities[i].ry == ed.levy; - if (!in_room) - { - continue; - } - - if (startpoint) - { - // Oh, there's a start point! Let's use this. - testeditor = i; - break; - } - else if (testeditor == -1) - { - // This is the first thing we found, so let's use it (unless we find a start point later) - testeditor = i; - } - } - - if (testeditor == -1) - { - ed.show_note(loc::gettext("ERROR: No checkpoint to spawn at")); - } - else - { - ed.current_ghosts = 0; - - game.edsavex = (customentities[testeditor].x) * 8 - 4; - game.edsavey = customentities[testeditor].y * 8; - game.edsaverx = 100 + customentities[testeditor].rx; - game.edsavery = 100 + customentities[testeditor].ry; - - if (!startpoint) - { - // Checkpoint spawn - if (customentities[testeditor].p1 == 0) // NOT a bool check! - { - game.edsavegc = 1; - game.edsavey -= 2; - } - else - { - game.edsavegc = 0; - game.edsavey -= 7; - } - game.edsavedir = 0; - } - else - { - // Start point spawn - game.edsavegc = 0; - game.edsavey++; - game.edsavedir = 1 - customentities[testeditor].p1; - } - - music.haltdasmusik(); - ed.return_message_timer = 1000; // Let's start it higher than 255 since it gets clamped - ed.old_return_message_timer = 1000; - script.startgamemode(Start_EDITORPLAYTESTING); - } -} - -static void handle_draw_input() -{ - extern editorclass ed; - - bool shift_down = key.keymap[SDLK_LSHIFT] || key.keymap[SDLK_RSHIFT]; - - if (shift_down && !ed.shiftkey) - { - ed.shiftkey = true; - ed.help_open = !ed.help_open; - } - else if (!shift_down) - { - ed.shiftkey = false; - } - - if (ed.keydelay > 0) - { - ed.keydelay--; - } - else - { - if (key.keymap[SDLK_F1]) - { - ed.switch_tileset(shift_down); - ed.keydelay = 6; - } - if (key.keymap[SDLK_F2]) - { - ed.switch_tilecol(shift_down); - ed.keydelay = 6; - } - if (key.keymap[SDLK_F3]) - { - ed.switch_enemy(shift_down); - ed.keydelay = 6; - } - if (key.keymap[SDLK_F4]) - { - ed.keydelay = 6; - ed.substate = EditorSubState_DRAW_BOX; - ed.box_corner = BoxCorner_FIRST; - ed.box_type = BoxType_ENEMY; - } - if (key.keymap[SDLK_F5]) - { - ed.keydelay = 6; - ed.substate = EditorSubState_DRAW_BOX; - ed.box_corner = BoxCorner_FIRST; - ed.box_type = BoxType_PLATFORM; - } - if (key.keymap[SDLK_F10]) - { - if (cl.getroomprop(ed.levx, ed.levy)->directmode == 1) - { - cl.setroomdirectmode(ed.levx, ed.levy, 0); - ed.show_note(loc::gettext("Direct Mode Disabled")); - ed.clamp_tilecol(ed.levx, ed.levy, true); - } - else - { - cl.setroomdirectmode(ed.levx, ed.levy, 1); - ed.show_note(loc::gettext("Direct Mode Enabled")); - } - graphics.backgrounddrawn = false; - - ed.updatetiles = true; - ed.keydelay = 6; - } - - for (int i = 0; i < NUM_EditorTools; i++) - { - if (key.keymap[ed.tool_keys[i]] && - ((shift_down && ed.tool_requires_shift[i]) || - (!shift_down && !ed.tool_requires_shift[i]))) - { - ed.current_tool = (EditorTools) i; - } - } - - if (key.keymap[SDLK_w]) - { - ed.switch_warpdir(shift_down); - ed.keydelay = 6; - } - if (key.keymap[SDLK_e]) - { - ed.keydelay = 6; - ed.get_input_line(TEXT_ROOMNAME, "Enter new room name:", const_cast(&(cl.getroomprop(ed.levx, ed.levy)->roomname))); - game.mapheld = true; - } - if (key.keymap[SDLK_g]) - { - ed.keydelay = 6; - ed.get_input_line(TEXT_GOTOROOM, "Enter room coordinates x,y:", NULL); - game.mapheld = true; - } - - //Save and load - if (key.keymap[SDLK_s]) - { - ed.keydelay = 6; - ed.get_input_line(TEXT_SAVE, "Enter map filename to save as:", &(ed.filename)); - game.mapheld = true; - } - - if (key.keymap[SDLK_l]) - { - ed.keydelay = 6; - ed.get_input_line(TEXT_LOAD, "Enter map filename to load:", &(ed.filename)); - game.mapheld = true; - } - - ed.f_modifier = key.keymap[SDLK_f]; - ed.h_modifier = key.keymap[SDLK_h]; - ed.v_modifier = key.keymap[SDLK_v]; - ed.b_modifier = key.keymap[SDLK_b]; - ed.c_modifier = key.keymap[SDLK_c]; - ed.x_modifier = key.keymap[SDLK_x]; - ed.z_modifier = key.keymap[SDLK_z]; - - const int room = ed.levx + ed.levy * cl.maxwidth; - const int plat_speed = cl.roomproperties[room].platv; - const int enemy_speed = cl.roomproperties[room].enemyv; - - const bool ctrl = key.keymap[SDLK_LCTRL] || key.keymap[SDLK_RCTRL]; - const bool shift = key.keymap[SDLK_LSHIFT] || key.keymap[SDLK_RSHIFT]; - if (key.keymap[SDLK_COMMA]) - { - if (ctrl) - { - if (shift) - { - cl.roomproperties[room].enemyv = enemy_speed - 1; - } - else - { - cl.roomproperties[room].platv = plat_speed - 1; - } - } - else - { - ed.current_tool = (EditorTools) POS_MOD(ed.current_tool - 1, NUM_EditorTools); - } - ed.keydelay = 6; - } - else if (key.keymap[SDLK_PERIOD]) - { - if (ctrl) - { - if (shift) - { - cl.roomproperties[room].enemyv = enemy_speed + 1; - } - else - { - cl.roomproperties[room].platv = plat_speed + 1; - } - } - else - { - ed.current_tool = (EditorTools) POS_MOD(ed.current_tool + 1, NUM_EditorTools); - } - ed.keydelay = 6; - } - - if (plat_speed != cl.roomproperties[room].platv) - { - char buffer[3 * SCREEN_WIDTH_CHARS + 1]; - vformat_buf( - buffer, sizeof(buffer), - loc::gettext("Platform speed is now {speed}"), - "speed:int", - cl.roomproperties[room].platv - ); - ed.show_note(buffer); - } - - if (enemy_speed != cl.roomproperties[room].enemyv) - { - char buffer[3 * SCREEN_WIDTH_CHARS + 1]; - vformat_buf( - buffer, sizeof(buffer), - loc::gettext("Enemy speed is now {speed}"), - "speed:int", - cl.roomproperties[room].enemyv + 4 - ); - ed.show_note(buffer); - } - - if (key.keymap[SDLK_SPACE]) - { - ed.toolbox_open = !ed.toolbox_open; - ed.keydelay = 6; - } - } -} - -void editorclass::get_input_line(const enum TextMode mode, const std::string& prompt, std::string* ptr) -{ - state = EditorState_DRAW; - substate = EditorSubState_DRAW_INPUT; - current_text_mode = mode; - current_text_ptr = ptr; - current_text_desc = prompt; - key.enabletextentry(); - if (ptr) - { - key.keybuffer = *ptr; - } - else - { - key.keybuffer = ""; - current_text_ptr = &(key.keybuffer); - } - - old_entity_text = key.keybuffer; -} - -void editorinput(void) -{ - extern editorclass ed; - - if (graphics.fademode == FADE_FADING_OUT) - { - return; - } - - ed.old_tilex = ed.tilex; - ed.old_tiley = ed.tiley; - - ed.tilex = key.mousex / 8; - ed.tiley = key.mousey / 8; - - bool up_pressed = key.isDown(SDLK_UP) || key.isDown(SDL_CONTROLLER_BUTTON_DPAD_UP); - bool down_pressed = key.isDown(SDLK_DOWN) || key.isDown(SDL_CONTROLLER_BUTTON_DPAD_DOWN); - bool left_pressed = key.isDown(SDLK_LEFT) || key.isDown(SDL_CONTROLLER_BUTTON_DPAD_LEFT); - bool right_pressed = key.isDown(SDLK_RIGHT) || key.isDown(SDL_CONTROLLER_BUTTON_DPAD_RIGHT); - - game.press_left = false; - game.press_right = false; - game.press_action = false; - game.press_map = false; - game.press_interact = false; - - if (key.isDown(KEYBOARD_LEFT) || key.isDown(KEYBOARD_a) || key.controllerWantsLeft(false)) - { - game.press_left = true; - } - if (key.isDown(KEYBOARD_RIGHT) || key.isDown(KEYBOARD_d) || key.controllerWantsRight(false)) - { - game.press_right = true; - } - if (key.isDown(KEYBOARD_z) || key.isDown(KEYBOARD_SPACE) || key.isDown(KEYBOARD_v) || key.isDown(game.controllerButton_flip)) - { - game.press_action = true; - }; - - if (key.keymap[SDLK_F9] && (ed.keydelay == 0)) { - ed.keydelay = 30; - ed.show_note(loc::gettext("Reloaded resources")); - graphics.reloadresources(); - } - - // Was escape just pressed? - bool escape_pressed = false; - if (key.isDown(27) && !ed.settingskey) - { - ed.settingskey = true; - escape_pressed = true; - } - else if (!key.isDown(27)) - { - ed.settingskey = false; - } - - // What about enter? - bool enter_pressed = false; - if (key.isDown(KEYBOARD_ENTER) && !game.mapheld) - { - game.mapheld = true; - enter_pressed = true; - } - else if (!key.isDown(KEYBOARD_ENTER)) - { - game.mapheld = false; - } - - bool shift_down = key.keymap[SDLK_LSHIFT] || key.keymap[SDLK_RSHIFT]; - bool ctrl_down = key.keymap[SDLK_LCTRL] || key.keymap[SDLK_RCTRL]; - - // Do different things depending on the current state (and substate) - switch (ed.state) - { - // Draw mode, aka placing tiles and entities down - case EditorState_DRAW: - switch (ed.substate) - { - case EditorSubState_MAIN: - if (escape_pressed) - { - // We're just in draw mode, so go to the settings menu - music.playef(Sound_VIRIDIAN); - ed.state = EditorState_MENU; - ed.substate = EditorSubState_MAIN; - game.createmenu(Menu::ed_settings); - } - - if (ctrl_down) - { - // Holding ctrl, show the direct mode tile drawer - ed.direct_mode_drawer = 10; - } - - if (ed.keydelay > 0) - { - ed.keydelay--; - } - else if (up_pressed || down_pressed || left_pressed || right_pressed) - { - ed.keydelay = 6; - - if (ctrl_down) - { - // The direct mode drawer is open, so arrow keys should change what tile you have selected - // Also let's make it a little faster - ed.keydelay = 3; - - int texturewidth; - int textureheight; - - bool tiles1 = (cl.getroomprop(ed.levx, ed.levy)->tileset == 0); - - if (graphics.query_texture(tiles1 ? graphics.grphx.im_tiles : graphics.grphx.im_tiles2, NULL, NULL, &texturewidth, &textureheight) != 0) - return; - - const int numtiles = (int)(texturewidth / 8) * (textureheight / 8); - - if (left_pressed) ed.direct_mode_tile--; - if (right_pressed) ed.direct_mode_tile++; - if (up_pressed) ed.direct_mode_tile -= 40; - if (down_pressed) ed.direct_mode_tile += 40; - - ed.direct_mode_tile = POS_MOD(ed.direct_mode_tile, numtiles); - } - else if (shift_down) - { - - if (up_pressed) cl.mapheight--; - if (down_pressed) cl.mapheight++; - if (left_pressed) cl.mapwidth--; - if (right_pressed) cl.mapwidth++; - - cl.mapwidth = SDL_clamp(cl.mapwidth, 1, cl.maxwidth); - cl.mapheight = SDL_clamp(cl.mapheight, 1, cl.maxheight); - - ed.updatetiles = true; - ed.changeroom = true; - graphics.backgrounddrawn = false; - graphics.foregrounddrawn = false; - - ed.levx = POS_MOD(ed.levx, cl.mapwidth); - ed.levy = POS_MOD(ed.levy, cl.mapheight); - - char buffer[3 * SCREEN_WIDTH_CHARS + 1]; - vformat_buf( - buffer, sizeof(buffer), - loc::gettext("Mapsize is now [{width},{height}]"), - "width:int, height:int", - cl.mapwidth, cl.mapheight - ); - - ed.show_note(buffer); - } - else - { - ed.updatetiles = true; - ed.changeroom = true; - graphics.backgrounddrawn = false; - graphics.foregrounddrawn = false; - - if (up_pressed) ed.levy--; - if (down_pressed) ed.levy++; - if (left_pressed) ed.levx--; - if (right_pressed) ed.levx++; - - ed.levx = POS_MOD(ed.levx, cl.mapwidth); - ed.levy = POS_MOD(ed.levy, cl.mapheight); - - } - } - else - { - handle_draw_input(); - } - - // Mouse input - if (key.leftbutton && ed.lclickdelay == 0) - { - ed.tool_place(); - } - else if (!key.leftbutton) - { - ed.lclickdelay = 0; - } - - if (key.rightbutton) - { - ed.tool_remove(); - } - - if (key.middlebutton) - { - ed.direct_mode_tile = cl.gettile(ed.levx, ed.levy, ed.tilex, ed.tiley); - } - - if (enter_pressed) - { - start_at_checkpoint(); - } - - break; - - case EditorSubState_DRAW_BOX: - if (escape_pressed) - { - // Cancel box placement - ed.substate = EditorSubState_MAIN; - } - - if (key.leftbutton && ed.lclickdelay == 0) - { - if (ed.box_corner == BoxCorner_FIRST) - { - ed.lclickdelay = 1; - ed.box_point.x = ed.tilex * 8; - ed.box_point.y = ed.tiley * 8; - ed.box_corner = BoxCorner_LAST; - } - else if (ed.box_corner == BoxCorner_LAST) - { - int left; - int right; - int top; - int bottom; - - adjust_box_coordinates(ed.box_point.x, ed.box_point.y, ed.tilex * 8, ed.tiley * 8, &left, &right, &top, &bottom); - - ed.lclickdelay = 1; - ed.substate = EditorSubState_MAIN; - - switch (ed.box_type) - { - case BoxType_SCRIPT: - ed.text_entity = customentities.size(); - - ed.add_entity(ed.levx, ed.levy, left / 8, top / 8, 19, (right - left) / 8, (bottom - top) / 8); - - ed.get_input_line(TEXT_SCRIPT, "Enter script name:", &(customentities[ed.text_entity].scriptname)); - break; - case BoxType_ENEMY: - cl.setroomenemyx1(ed.levx, ed.levy, left); - cl.setroomenemyy1(ed.levx, ed.levy, top); - cl.setroomenemyx2(ed.levx, ed.levy, right); - cl.setroomenemyy2(ed.levx, ed.levy, bottom); - break; - case BoxType_PLATFORM: - cl.setroomplatx1(ed.levx, ed.levy, left); - cl.setroomplaty1(ed.levx, ed.levy, top); - cl.setroomplatx2(ed.levx, ed.levy, right); - cl.setroomplaty2(ed.levx, ed.levy, bottom); - break; - case BoxType_COPY: - // Unused - break; - } - } - } - else if (!key.leftbutton) - { - ed.lclickdelay = 0; - } - - if (key.rightbutton) - { - ed.substate = EditorSubState_MAIN; - } - - break; - - case EditorSubState_DRAW_WARPTOKEN: - if (escape_pressed || key.rightbutton) - { - // Cancel warp token placement - ed.substate = EditorSubState_MAIN; - ed.remove_entity(ed.warp_token_entity); - ed.warp_token_entity = -1; - } - - // Allow the user to change rooms while placing a warp token - if (ed.keydelay > 0) - { - ed.keydelay--; - } - else if (up_pressed || down_pressed || left_pressed || right_pressed) - { - ed.keydelay = 6; - - ed.updatetiles = true; - ed.changeroom = true; - graphics.backgrounddrawn = false; - graphics.foregrounddrawn = false; - - if (up_pressed) ed.levy--; - if (down_pressed) ed.levy++; - if (left_pressed) ed.levx--; - if (right_pressed) ed.levx++; - - ed.levx = POS_MOD(ed.levx, cl.mapwidth); - ed.levy = POS_MOD(ed.levy, cl.mapheight); - } - - // Left click means place! - if (key.leftbutton) - { - if (ed.lclickdelay == 0) - { - customentities[ed.warp_token_entity].p1 = ed.tilex + (ed.levx * 40); - customentities[ed.warp_token_entity].p2 = ed.tiley + (ed.levy * 30); - - ed.substate = EditorSubState_MAIN; - - ed.warp_token_entity = -1; - ed.lclickdelay = 1; - } - } - else - { - ed.lclickdelay = 0; - } - - break; - - case EditorSubState_DRAW_INPUT: - // We're taking input! - if (ed.current_text_mode == TEXT_SCRIPT) - { - // This is editing an entity's text field, currently only used as a script name. - // Remove all pipes, they are the line separator in the XML. - // When this loop reaches the end, it wraps to SIZE_MAX; SIZE_MAX + 1 is 0 - for (size_t i = key.keybuffer.length() - 1; i + 1 > 0; i--) - { - if (key.keybuffer[i] == '|') - { - key.keybuffer.erase(key.keybuffer.begin() + i); - } - } - } - - if (escape_pressed) - { - // Cancel it, and remove the enemy it's tied to if necessary - key.disabletextentry(); - if (ed.current_text_mode >= FIRST_ENTTEXT && ed.current_text_mode <= LAST_ENTTEXT) - { - *ed.current_text_ptr = ed.old_entity_text; - if (ed.old_entity_text == "") - { - ed.remove_entity(ed.text_entity); - } - } - - ed.current_text_mode = TEXT_NONE; - - ed.help_open = false; - - ed.substate = EditorSubState_MAIN; - } - - if (enter_pressed) - { - input_submitted(); - } - break; - default: - break; - } - break; - - // We're in the menu! - case EditorState_MENU: - up_pressed |= key.isDown(KEYBOARD_w); - down_pressed |= key.isDown(KEYBOARD_s); - - switch (ed.substate) - { - case EditorSubState_MAIN: - if (!game.press_action && !game.press_left && !game.press_right && !up_pressed && !down_pressed) - { - game.jumpheld = false; - } - - if (!game.jumpheld) - { - if (game.press_action || game.press_left || game.press_right || game.press_map || up_pressed || down_pressed) - { - game.jumpheld = true; - } - - if (game.menustart) - { - bool left, right; - if (!font::is_rtl(PR_FONT_INTERFACE)) - { - left = game.press_left; - right = game.press_right; - } - else - { - left = game.press_right; - right = game.press_left; - } - - if (left || up_pressed) - { - game.currentmenuoption--; - } - else if (right || down_pressed) - { - game.currentmenuoption++; - } - } - - game.currentmenuoption = POS_MOD(game.currentmenuoption, (int)game.menuoptions.size()); - - if (game.press_action) - { - editormenuactionpress(); - } - } - - // Was escape pressed? - if (escape_pressed) - { - bool esc_from_font = false; - music.playef(Sound_VIRIDIAN); - - if (game.currentmenuname == Menu::ed_settings) - { - ed.state = EditorState_DRAW; - gameScreen.recacheTextures(); - } - else - { - // Avoid double return - esc_from_font = game.currentmenuname == Menu::ed_font; - - game.returnmenu(); - map.nexttowercolour(); - } - - if (ed.state == EditorState_MENU && !esc_from_font) - { - bool edsettings_in_stack = game.currentmenuname == Menu::ed_settings; - if (!edsettings_in_stack) - { - size_t i; - for (i = 0; i < game.menustack.size(); ++i) - { - if (game.menustack[i].name == Menu::ed_settings) - { - edsettings_in_stack = true; - break; - } - } - } - if (edsettings_in_stack) - { - game.returntomenu(Menu::ed_settings); - } - else - { - game.createmenu(Menu::ed_settings); - } - map.nexttowercolour(); - } - } - break; - - case EditorSubState_MENU_INPUT: - if (escape_pressed && key.textentry()) - { - ed.substate = EditorSubState_MAIN; - key.disabletextentry(); - ed.current_text_mode = TEXT_NONE; - - music.playef(Sound_VIRIDIAN); - } - - if (enter_pressed) - { - input_submitted(); - } - break; - default: - break; - } - break; - - case EditorState_SCRIPTS: - { - switch (ed.substate) - { - case EditorSubState_MAIN: - { - up_pressed |= key.isDown(KEYBOARD_w); - down_pressed |= key.isDown(KEYBOARD_s); - - if (escape_pressed) - { - music.playef(Sound_VIRIDIAN); - ed.state = EditorState_MENU; - ed.substate = EditorSubState_MAIN; - } - - if (ed.keydelay > 0) ed.keydelay--; - - if (up_pressed && ed.keydelay <= 0) - { - ed.keydelay = 3; - ed.selected_script--; - } - - if (down_pressed && ed.keydelay <= 0) - { - ed.keydelay = 3; - ed.selected_script++; - } - - ed.selected_script = SDL_clamp(ed.selected_script, 0, (int) script.customscripts.size() - 1); - - if (ed.selected_script < ed.script_list_offset) - { - ed.script_list_offset = ed.selected_script; - } - - if (ed.selected_script >= ed.script_list_offset + 9) - { - ed.script_list_offset = ed.selected_script - 8; - } - - if (!key.keymap[SDLK_BACKSPACE]) - { - ed.backspace_held = false; - } - - if (key.keymap[SDLK_BACKSPACE] && !ed.backspace_held && !script.customscripts.empty()) - { - ed.backspace_held = true; - music.playef(Sound_CRY); - ed.remove_script(script.customscripts[(script.customscripts.size() - 1) - ed.selected_script].name); - } - - if (!game.press_action && !game.press_left && !game.press_right && !up_pressed && !down_pressed && !key.isDown(27)) - { - game.jumpheld = false; - } - - if (!game.jumpheld) - { - if (game.press_action || game.press_left || game.press_right || game.press_map || up_pressed || down_pressed || key.isDown(27)) - { - game.jumpheld = true; - } - - if ((game.press_action || game.press_map) && !script.customscripts.empty()) - { - game.mapheld = true; - ed.substate = EditorSubState_SCRIPTS_EDIT; - key.enabletextentry(); - key.keybuffer = ""; - ed.current_text_ptr = &(key.keybuffer); - ed.current_script = script.customscripts[(script.customscripts.size() - 1) - ed.selected_script].name; - ed.load_script_in_editor(ed.current_script); - - ed.script_cursor_y = ed.script_buffer.size() - 1; - ed.script_offset = SDL_max(ed.script_cursor_y - (ed.lines_visible - SCRIPT_LINE_PADDING), 0); - - key.keybuffer = ed.script_buffer[ed.script_cursor_y]; - ed.script_cursor_x = UTF8_total_codepoints(ed.script_buffer[ed.script_cursor_y].c_str()); - - music.playef(Sound_VIRIDIAN); - } - } - break; - } - case EditorSubState_SCRIPTS_EDIT: - { - // Script editor! - if (escape_pressed) - { - music.playef(Sound_VIRIDIAN); - ed.substate = EditorSubState_MAIN; - - // Alright, now re-add the script. - ed.create_script(ed.current_script, ed.script_buffer); - - key.disabletextentry(); - } - - if (ed.keydelay > 0) ed.keydelay--; - - if (up_pressed && ed.keydelay <= 0) - { - ed.keydelay = 3; - ed.script_cursor_y = SDL_max(0, ed.script_cursor_y - 1); - - key.keybuffer = ed.script_buffer[ed.script_cursor_y]; - } - - if (down_pressed && ed.keydelay <= 0) - { - ed.keydelay = 3; - ed.script_cursor_y = SDL_min((int) ed.script_buffer.size() - 1, ed.script_cursor_y + 1); - - key.keybuffer = ed.script_buffer[ed.script_cursor_y]; - } - - if (key.linealreadyemptykludge) - { - ed.keydelay = 6; - key.linealreadyemptykludge = false; - } - - if (key.pressedbackspace && ed.script_buffer[ed.script_cursor_y] == "" && ed.keydelay <= 0) - { - //Remove this line completely - ed.remove_line(ed.script_cursor_y); - ed.script_cursor_y = SDL_max(0, ed.script_cursor_y - 1); - key.keybuffer = ed.script_buffer[ed.script_cursor_y]; - ed.keydelay = 6; - } - - /* Remove all pipes, they are the line separator in the XML - * When this loop reaches the end, it wraps to SIZE_MAX; SIZE_MAX + 1 is 0 */ - {size_t i; for (i = key.keybuffer.length() - 1; i + 1 > 0; --i) - { - if (key.keybuffer[i] == '|') - { - key.keybuffer.erase(key.keybuffer.begin() + i); - } - }} - - ed.script_buffer[ed.script_cursor_y] = key.keybuffer; - ed.script_cursor_x = UTF8_total_codepoints(ed.script_buffer[ed.script_cursor_y].c_str()); - - if (enter_pressed) - { - //Continue to next line - if (ed.script_cursor_y >= (int)ed.script_buffer.size()) //we're on the last line - { - ed.script_cursor_y++; - - key.keybuffer = ed.script_buffer[ed.script_cursor_y]; - ed.script_cursor_x = UTF8_total_codepoints(ed.script_buffer[ed.script_cursor_y].c_str()); - } - else - { - //We're not, insert a line instead - ed.script_cursor_y++; - - ed.insert_line(ed.script_cursor_y); - key.keybuffer = ""; - ed.script_cursor_x = 0; - } - } - - if (ed.script_cursor_y < ed.script_offset + SCRIPT_LINE_PADDING) - { - ed.script_offset = SDL_max(0, ed.script_cursor_y - SCRIPT_LINE_PADDING); - } - - if (ed.script_cursor_y > ed.script_offset + ed.lines_visible - SCRIPT_LINE_PADDING) - { - ed.script_offset = SDL_min((int) ed.script_buffer.size() - ed.lines_visible + SCRIPT_LINE_PADDING, ed.script_cursor_y - ed.lines_visible + SCRIPT_LINE_PADDING); - } - - break; - } - default: - break; - } - break; - } - } - - if (ed.updatetiles && cl.getroomprop(ed.levx, ed.levy)->directmode == 0) - { - for (int i = 0; i < SCREEN_WIDTH_TILES * SCREEN_HEIGHT_TILES; i++) - { - int tile_x = i % SCREEN_WIDTH_TILES; - int tile_y = i / SCREEN_WIDTH_TILES; - ed.set_tile(tile_x, tile_y, ed.autotile(tile_x, tile_y)); - } - - ed.updatetiles = false; - graphics.foregrounddrawn = false; - } -} - -bool editorclass::is_warp_zone_background(int tile) -{ - if (cl.getroomprop(levx, levy)->tileset == EditorTileset_SPACE_STATION) - { - return false; - } - - return (tile == 120 || tile == 123 || tile == 126 || tile == 129 || tile == 132 || tile == 135 || tile == 138); -} - -int editorclass::autotile(const int x, const int y) -{ - int tile = get_tile(x, y); - TileTypes type = get_tile_type(x, y, false); - - if (tile == 0) - { - return 0; - } - - if (type == TileType_SPIKE) - { - bool tile_up = get_tile_type(x, y - 1, false) == TileType_SOLID; - bool tile_down = get_tile_type(x, y + 1, false) == TileType_SOLID; - bool tile_left = get_tile_type(x - 1, y, false) == TileType_SOLID; - bool tile_right = get_tile_type(x + 1, y, false) == TileType_SOLID; - - if (cl.getroomprop(levx, levy)->tileset == EditorTileset_LAB) - { - // If this is the lab, use the colourful lab spikes! - int mult = cl.getroomprop(levx, levy)->tilecol; - if (tile_down) - return 63 + mult * 2; - if (tile_up) - return 64 + mult * 2; - if (tile_left) - return 51 + mult * 2; - if (tile_right) - return 52 + mult * 2; - return 63 + mult * 2; - } - - // Not in the lab, so use the boring normal spikes - if (tile_down) - return 8; - if (tile_up) - return 9; - if (tile_left) - return 49; - if (tile_right) - return 50; - return 8; - } - - bool tile_up = autotile_connector(x, y - 1, type); - bool tile_down = autotile_connector(x, y + 1, type); - bool tile_left = autotile_connector(x - 1, y, type); - bool tile_right = autotile_connector(x + 1, y, type); - - bool tile_up_left = autotile_connector(x - 1, y - 1, type); - bool tile_up_right = autotile_connector(x + 1, y - 1, type); - bool tile_down_left = autotile_connector(x - 1, y + 1, type); - bool tile_down_right = autotile_connector(x + 1, y + 1, type); - - int tile_value = 0; - - if (tile_up) - tile_value += 1; - if (tile_up_right) - tile_value += 2; - if (tile_right) - tile_value += 4; - if (tile_down_right) - tile_value += 8; - if (tile_down) - tile_value += 16; - if (tile_down_left) - tile_value += 32; - if (tile_left) - tile_value += 64; - if (tile_up_left) - tile_value += 128; - - bool background = (type == TileType_NONSOLID || is_warp_zone_background(tile)); - EditorTilecolInfo data = get_tilecol_data(); - - int base = background ? data.background_base : data.foreground_base; - return base + autotile_types[background ? data.background_type : data.foreground_type][tile_value]; -} - -EditorTilecolInfo editorclass::get_tilecol_data(void) -{ - EditorTilesets tileset = (EditorTilesets) cl.getroomprop(levx, levy)->tileset; - int tilecol = cl.getroomprop(levx, levy)->tilecol; - - return tileset_colors[tileset][tilecol]; -} - -bool editorclass::autotile_connector(int x, int y, TileTypes original_type) -{ - if (x < 0 || x >= SCREEN_WIDTH_TILES || y < 0 || y >= SCREEN_HEIGHT_TILES) - { - return true; - } - - int tile = get_tile(x, y); - TileTypes new_type = get_tile_type(x, y, false); - - if (tile == 0) - { - return false; - } - - EditorTilecolInfo data = get_tilecol_data(); - - if (original_type == TileType_NONSOLID) - { - if (data.bg_ignores_walls) - { - return new_type == TileType_NONSOLID || is_warp_zone_background(tile); - } - return true; - } - - if (new_type == TileType_SOLID && !is_warp_zone_background(tile)) - { - return true; - } - - return false; -} - -int editorclass::get_enemy_tile(int t) -{ - switch(t) - { - case 0: - return 78; - break; - case 1: - return 88; - break; - case 2: - return 36; - break; - case 3: - return 164; - break; - case 4: - return 68; - break; - case 5: - return 48; - break; - case 6: - return 176; - break; - case 7: - return 168; - break; - case 8: - return 112; - break; - case 9: - return 114; - break; - default: - return 78; - break; - } -} - -void editorclass::set_tile(int x, int y, int t) -{ - if (x >= 0 && y >= 0 && x < SCREEN_WIDTH_TILES && y < SCREEN_HEIGHT_TILES) - { - cl.settile(levx, levy, x, y, t); - } - graphics.foregrounddrawn = false; - updatetiles = true; -} - -int editorclass::get_tile(const int x, const int y) -{ - if (x >= 0 && y >= 0 && x < SCREEN_WIDTH_TILES && y < SCREEN_HEIGHT_TILES) - { - return cl.gettile(levx, levy, x, y); - } - - return 0; -} - -TileTypes editorclass::get_abs_tile_type(int x, int y, const bool wrap) -{ - if (wrap) - { - x = POS_MOD(x, cl.mapwidth * 40); - y = POS_MOD(y, cl.mapheight * 30); - } - else - { - x = SDL_clamp(x, 0, cl.mapwidth * 40 - 1); - y = SDL_clamp(y, 0, cl.mapheight * 30 - 1); - } - - const RoomProperty* const room = cl.getroomprop(x / 40, y / 30); - int tile = cl.getabstile(x, y); - - if (tile == 1 || (tile >= 80 && tile <= 679)) - { - // It's solid. - return TileType_SOLID; - } - - if ((tile >= 6 && tile <= 9) || tile == 49 || tile == 50) - { - // It's a spike! - return TileType_SPIKE; - } - - if (room->tileset != 0) - { - // tiles2.png is slightly different. - - if (tile >= 51 && tile <= 74) - { - // It has more spikes! - return TileType_SPIKE; - } - - if (tile == 740) - { - // And a stray solid. - return TileType_SOLID; - } - } - - return TileType_NONSOLID; -} - -TileTypes editorclass::get_tile_type(int x, int y, bool wrap) -{ - if (wrap) - { - x = POS_MOD(x, 40); - y = POS_MOD(y, 30); - } - else - { - x = SDL_clamp(x, 0, 39); - y = SDL_clamp(y, 0, 29); - } - - return get_abs_tile_type(levx * 40 + x, levy * 30 + y, false); -} - -bool editorclass::lines_can_pass(int x, int y) -{ - const int tile = cl.gettile(levx, levy, x, y); - if (x >= 0 && y >= 0 && x < SCREEN_WIDTH_TILES && y < SCREEN_HEIGHT_TILES) - { - return tile == 0 || tile >= 680; - } - if (x == -1 || y == -1 || x == SCREEN_WIDTH_TILES || y == SCREEN_HEIGHT_TILES) - { - // If lines go offscreen, they stick out one tile - return true; - } - return false; -} - -void editorclass::make_autotiling_base(void) -{ - if (cl.getroomprop(levx, levy)->directmode == 1) - { - return; - } - - for (int i = 0; i < SCREEN_WIDTH_TILES * SCREEN_HEIGHT_TILES; i++) - { - int tile_x = i % SCREEN_WIDTH_TILES; - int tile_y = i / SCREEN_WIDTH_TILES; - int tile = get_tile(tile_x, tile_y); - - if (tile == 0) - { - continue; - } - - TileTypes type = get_tile_type(tile_x, tile_y, false); - - switch (type) - { - case TileType_NONSOLID: - set_tile(tile_x, tile_y, 2); - break; - case TileType_SOLID: - if (is_warp_zone_background(tile)) - { - set_tile(tile_x, tile_y, 2); - } - else - { - set_tile(tile_x, tile_y, 1); - } - break; - case TileType_SPIKE: - set_tile(tile_x, tile_y, 6); - break; - } - } -} - -void editorclass::switch_tileset(const bool reversed) -{ - make_autotiling_base(); - - int tiles = cl.getroomprop(levx, levy)->tileset; - - if (reversed) - { - tiles--; - } - else - { - tiles++; - } - - tiles = POS_MOD(tiles, NUM_EditorTilesets); - cl.setroomtileset(levx, levy, tiles); - - clamp_tilecol(levx, levy, false); - - char buffer[3*SCREEN_WIDTH_CHARS + 1]; - vformat_buf( - buffer, sizeof(buffer), - loc::gettext("Now using {area} Tileset"), - "area:str", - loc::gettext(tileset_names[tiles]) - ); - - show_note(buffer); - - updatetiles = true; - - graphics.backgrounddrawn = false; -} - -void editorclass::switch_tilecol(const bool reversed) -{ - make_autotiling_base(); - - int tilecol = cl.getroomprop(levx, levy)->tilecol; - - if (reversed) - { - tilecol--; - } - else - { - tilecol++; - } - - cl.setroomtilecol(levx, levy, tilecol); - - clamp_tilecol(levx, levy, true); - - show_note(loc::gettext("Tileset Colour Changed")); - - updatetiles = true; - - graphics.backgrounddrawn = false; -} - -void editorclass::clamp_tilecol(const int rx, const int ry, const bool wrap) -{ - const RoomProperty* const room = cl.getroomprop(rx, ry); - const int tileset = room->tileset; - int tilecol = room->tilecol; - - int mincol = (room->directmode ? tileset_min_colour_direct : tileset_min_colour)[tileset]; - int maxcol = (room->directmode ? tileset_max_colour_direct : tileset_max_colour)[tileset]; - - // If wrap is true, wrap-around, otherwise just cap - if (tilecol > maxcol) - { - tilecol = (wrap ? mincol : maxcol); - } - if (tilecol < mincol) - { - tilecol = (wrap ? maxcol : mincol); - } - - cl.setroomtilecol(rx, ry, tilecol); -} - -void editorclass::switch_enemy(const bool reversed) -{ - const RoomProperty* const room = cl.getroomprop(levx, levy); - - int enemy = room->enemytype; - - if (reversed) - { - enemy--; - } - else - { - enemy++; - } - - const int modulus = 10; - enemy = POS_MOD(enemy, modulus); - cl.setroomenemytype(levx, levy, enemy); - - show_note(loc::gettext("Enemy Type Changed")); -} - -void editorclass::switch_warpdir(const bool reversed) -{ - static const int modulus = 4; - const RoomProperty* const room = cl.getroomprop(levx, levy); - - int warpdir = room->warpdir; - - if (reversed) - { - --warpdir; - } - else - { - ++warpdir; - } - - warpdir = POS_MOD(warpdir, modulus); - cl.setroomwarpdir(levx, levy, warpdir); - - switch (warpdir) - { - default: - show_note(loc::gettext("Room warping disabled")); - break; - case 1: - show_note(loc::gettext("Room warps horizontally")); - break; - case 2: - show_note(loc::gettext("Room warps vertically")); - break; - case 3: - show_note(loc::gettext("Room warps in all directions")); - break; - } - - graphics.backgrounddrawn = false; -} diff --git a/desktop_version/src/Editor.h b/desktop_version/src/Editor.h deleted file mode 100644 index f9fff570..00000000 --- a/desktop_version/src/Editor.h +++ /dev/null @@ -1,299 +0,0 @@ -#ifndef EDITOR_H -#define EDITOR_H - -#include "Constants.h" -#include "CustomLevels.h" - -#include -#include -#include -#include - -enum EditorTilesets -{ - EditorTileset_SPACE_STATION = 0, - EditorTileset_OUTSIDE = 1, - EditorTileset_LAB = 2, - EditorTileset_WARP_ZONE = 3, - EditorTileset_SHIP = 4, - - NUM_EditorTilesets -}; - -struct EditorTilecolInfo -{ - const char* foreground_type; - int foreground_base; - const char* background_type; - int background_base; - bool direct_mode; - bool bg_ignores_walls; -}; - -enum EditorTools -{ - EditorTool_WALLS, - EditorTool_BACKING, - EditorTool_SPIKES, - EditorTool_TRINKETS, - EditorTool_CHECKPOINTS, - EditorTool_DISAPPEARING_PLATFORMS, - EditorTool_CONVEYORS, - EditorTool_MOVING_PLATFORMS, - EditorTool_ENEMIES, - EditorTool_GRAVITY_LINES, - EditorTool_ROOMTEXT, - EditorTool_TERMINALS, - EditorTool_SCRIPTS, - EditorTool_WARP_TOKENS, - EditorTool_WARP_LINES, - EditorTool_CREWMATES, - EditorTool_START_POINT, - - NUM_EditorTools -}; - -enum EditorStates -{ - EditorState_DRAW, - EditorState_SCRIPTS, - EditorState_MENU -}; - -enum EditorSubStates -{ - EditorSubState_MAIN, - - EditorSubState_DRAW_INPUT, - EditorSubState_DRAW_BOX, - EditorSubState_DRAW_WARPTOKEN, - - EditorSubState_SCRIPTS_EDIT, - - EditorSubState_MENU_INPUT -}; - -enum TileTypes -{ - TileType_NONSOLID, - TileType_SOLID, - TileType_SPIKE -}; - -enum BoxTypes -{ - BoxType_SCRIPT, - BoxType_ENEMY, - BoxType_PLATFORM, - BoxType_COPY -}; - -enum BoxCorner -{ - BoxCorner_FIRST, - BoxCorner_LAST -}; - -// Text entry field type -enum TextMode -{ - TEXT_NONE, - - // In-editor text fields - TEXT_LOAD, - TEXT_SAVE, - TEXT_ROOMNAME, - TEXT_SCRIPT, - TEXT_ROOMTEXT, - TEXT_GOTOROOM, - LAST_EDTEXT = TEXT_GOTOROOM, - - // Settings-mode text fields - TEXT_TITLE, - TEXT_DESC1, - TEXT_DESC2, - TEXT_DESC3, - TEXT_WEBSITE, - TEXT_CREATOR, - NUM_TEXTMODES, - - // Text modes with an entity - FIRST_ENTTEXT = TEXT_SCRIPT, - LAST_ENTTEXT = TEXT_ROOMTEXT -}; - -struct GhostInfo -{ - int rx; // game.roomx-100 - int ry; // game.roomy-100 - int x; // .xp - int y; // .yp - int col; // .colour - SDL_Color realcol; - int frame; // .drawframe -}; - -class editorclass -{ -public: - editorclass(void); - void reset(void); - - void register_tileset(EditorTilesets tileset, const char* name); - void register_tilecol(EditorTilesets tileset, int index, const char* foreground_type, int foreground_base, const char* background_type, int background_base, bool direct, bool bg_ignores_walls); - void register_tilecol(EditorTilesets tileset, int index, const char* foreground_type, int foreground_base, const char* background_type, int background_base, bool direct); - void register_tilecol(EditorTilesets tileset, int index, const char* foreground_type, int foreground_base, const char* background_type, int background_base); - - void register_tool(EditorTools tool, const char* name, const char* keychar, SDL_KeyCode key, bool shift); - - void draw_tool(EditorTools tool, int x, int y); - - void get_tile_fill(int tilex, int tiley, int tile, bool connected[SCREEN_HEIGHT_TILES][SCREEN_WIDTH_TILES]); - - void handle_tile_placement(int tile); - - void tool_remove(); - void entity_clicked(int index); - void tool_place(); - - void get_input_line(enum TextMode mode, const std::string& prompt, std::string* ptr); - - void show_note(const char* text); - - void add_entity(int rx, int ry, int xp, int yp, int tp, int p1 = 0, int p2 = 0, int p3 = 0, int p4 = 0, int p5 = 320, int p6 = 240); - - void remove_entity(int t); - - int get_entity_at(int rx, int ry, int xp, int yp); - - void set_tile(int x, int y, int t); - int get_tile(int x, int y); - - bool is_warp_zone_background(int tile); - int autotile(int tile_x, int tile_y); - bool autotile_connector(int x, int y, TileTypes original_type); - EditorTilecolInfo get_tilecol_data(void); - - TileTypes get_abs_tile_type(int x, int y, bool wrap); - TileTypes get_tile_type(int x, int y, bool wrap); - - bool lines_can_pass(int x, int y); - - void make_autotiling_base(void); - - int get_enemy_tile(int t); - - void switch_tileset(const bool reversed); - void switch_tilecol(const bool reversed); - void clamp_tilecol(const int rx, const int ry, const bool wrap); - void switch_enemy(const bool reversed); - void switch_warpdir(const bool reversed); - - EditorStates state; - EditorSubStates substate; - - std::map > autotile_types; - std::map > tileset_colors; - - const char* tileset_names[NUM_EditorTilesets]; - int tileset_min_colour[NUM_EditorTilesets]; - int tileset_max_colour[NUM_EditorTilesets]; - int tileset_min_colour_direct[NUM_EditorTilesets]; - int tileset_max_colour_direct[NUM_EditorTilesets]; - - const char* tool_names[NUM_EditorTools]; - const char* tool_key_chars[NUM_EditorTools]; - SDL_KeyCode tool_keys[NUM_EditorTools]; - bool tool_requires_shift[NUM_EditorTools]; - - EditorTools current_tool; - - BoxTypes box_type; - BoxCorner box_corner; - - SDL_Point box_point; - - int entcol; - SDL_Color entcolreal; - - int kludgewarpdir[customlevelclass::numrooms]; - - int note_timer; - int old_note_timer; - std::string note; - std::string keybuffer; - std::string filename; - std::string loaded_filepath; - - int old_tilex, old_tiley; - int tilex, tiley; - int keydelay, lclickdelay; - bool savekey, loadkey; - int levx, levy; - int entframe, entframedelay; - - int scripttexttype; - std::string old_entity_text; - - enum TextMode current_text_mode; // In text entry - std::string* current_text_ptr; // Pointer to text we're changing - std::string current_text_desc; // Description (for editor mode text fields) - union - { - int desc; // Which description row we're changing - int text_entity; // Entity ID for text prompt - }; - bool x_modifier, z_modifier, c_modifier, v_modifier, b_modifier, h_modifier, f_modifier, toolbox_open; - - int roomnamehide; - bool saveandquit; - bool help_open, shiftkey; - bool settingskey; - int warp_token_entity; - bool updatetiles, changeroom; - bool backspace_held; - - //Script editor stuff - void remove_line(int t); - void insert_line(int t); - - std::vector script_buffer; - std::string current_script; - int script_cursor_x, script_cursor_y; - int script_offset; - int lines_visible; - - //Functions for interfacing with the script: - void create_script(const std::string& name, const std::vector& contents); - void create_script(const std::string& name); - void remove_script(const std::string& name); - void load_script_in_editor(const std::string& name); - void clear_script_buffer(void); - bool script_exists(const std::string& name); - - int script_list_offset, selected_script; - - //Direct Mode variables - int direct_mode_tile; - int direct_mode_drawer; - - int return_message_timer; - int old_return_message_timer; - - std::vector ghosts; - int current_ghosts; -}; - -void editorrender(void); - -void editorrenderfixed(void); - -void editorlogic(void); - -void editorinput(void); - -#ifndef ED_DEFINITION -extern editorclass ed; -#endif - -#endif /* EDITOR_H */ diff --git a/desktop_version/src/Ent.cpp b/desktop_version/src/Ent.cpp index f78da9da..073dbc64 100644 --- a/desktop_version/src/Ent.cpp +++ b/desktop_version/src/Ent.cpp @@ -5,660 +5,660 @@ entclass::entclass(void) { - clear(); + clear(); } void entclass::clear(void) { - invis = false; - type = EntityType_PLAYER; - size = 0; - tile = 0; - rule = 0; - state = 0; - statedelay = 0; - life = 0; - colour = EntityColour_CREW_CYAN; - para = 0; - behave = 0; - animate = 0; + invis = false; + type = 0; + size = 0; + tile = 0; + rule = 0; + state = 0; + statedelay = 0; + life = 0; + colour = 0; + para = 0; + behave = 0; + animate = 0; - xp = 0; - yp = 0; - ax = 0; - ay = 0; - vx = 0; - vy = 0; - w = 16; - h = 16; - cx = 0; - cy = 0; - newxp = 0; - newyp = 0; - oldxp = 0; - oldyp = 0; + xp = 0; + yp = 0; + ax = 0; + ay = 0; + vx = 0; + vy = 0; + w = 16; + h = 16; + cx = 0; + cy = 0; + newxp = 0; + newyp = 0; + oldxp = 0; + oldyp = 0; - x1 = 0; - y1 = 0; - x2 = 320; - y2 = 240; + x1 = 0; + y1 = 0; + x2 = 320; + y2 = 240; - gravity = false; - onground = 0; - onroof = 0; - collisionframedelay = 0; - collisiondrawframe = 0; - collisionwalkingframe = 0; - visualonground = 0; - visualonroof = 0; + gravity = false; + onground = 0; + onroof = 0; + collisionframedelay = 0; + collisiondrawframe = 0; + collisionwalkingframe = 0; + visualonground = 0; + visualonroof = 0; - onentity = 0; - harmful = false; - onwall = 0; - onxwall = 0; - onywall = 0; - isplatform = false; + onentity = 0; + harmful = false; + onwall = 0; + onxwall = 0; + onywall = 0; + isplatform = false; - framedelay = 0; - drawframe = 0; - walkingframe = 0; - dir = 0; - actionframe = 0; + framedelay = 0; + drawframe = 0; + walkingframe = 0; + dir = 0; + actionframe = 0; - SDL_zero(realcol); - lerpoldxp = 0; - lerpoldyp = 0; + realcol = 0; + lerpoldxp = 0; + lerpoldyp = 0; } bool entclass::outside(void) { - // Returns true if any point of the entity is outside the map. - // Adjusts velocity for a clean collision. - if (xp < x1) - { - xp = x1; - return true; - } - if (yp < y1) - { - yp = y1; - return true; - } - if (xp + w > x2) - { - xp = x2 - w; - return true; - } - if (yp + h > y2) - { - yp = y2 - h; - return true; - } - return false; + // Returns true if any point of the entity is outside the map. + // Adjusts velocity for a clean collision. + if (xp < x1) + { + xp = x1; + return true; + } + if (yp < y1) + { + yp = y1; + return true; + } + if (xp + w > x2) + { + xp = x2 - w; + return true; + } + if (yp + h > y2) + { + yp = y2 - h; + return true; + } + return false; } void entclass::setenemy( int t ) { - switch(t) - { - case 0: - //lies emitter - switch ((int) para) - { - case 0: - tile = 60; - animate = 2; - colour = EntityColour_ENEMY_RED; - behave = 10; - w = 32; - h = 32; - x1 = -200; - break; - case 1: - yp += 10; - lerpoldyp += 10; - tile = 63; - animate = 100; //LIES - colour = EntityColour_ENEMY_RED; - behave = 11; - para = 9; //destroyed when outside - x1 = -200; - x2 = 400; - w = 26; - h = 10; - cx = 1; - cy = 1; - break; - case 2: - tile = 62; - animate = 100; - colour = EntityColour_ENEMY_RED; - behave = -1; - w = 32; - h = 32; - break; - } - break; - case 1: - //FACTORY emitter - switch ((int) para) - { - case 0: - tile = 72; - animate = 3; - size = 9; - colour = EntityColour_ENEMY_RED; - behave = 12; - w = 64; - h = 40; - cx = 0; - cy = 24; - break; - case 1: - xp += 4; - lerpoldxp += 4; - yp -= 4; - lerpoldyp -= 4; - tile = 76; - animate = 100; // Clouds - colour = EntityColour_ENEMY_RED; - behave = 13; - para = -6; //destroyed when outside - x2 = 400; - w = 32; - h = 12; - cx = 0; - cy = 6; - break; - case 2: - tile = 77; - animate = 100; - colour = EntityColour_ENEMY_RED; - behave = -1; - w = 32; - h = 16; - break; - } - break; - default: - break; - } + switch(t) + { + case 0: + //lies emitter + switch ((int) para) + { + case 0: + tile = 60; + animate = 2; + colour = 6; + behave = 10; + w = 32; + h = 32; + x1 = -200; + break; + case 1: + yp += 10; + lerpoldyp += 10; + tile = 63; + animate = 100; //LIES + colour = 6; + behave = 11; + para = 9; //destroyed when outside + x1 = -200; + x2 = 400; + w = 26; + h = 10; + cx = 1; + cy = 1; + break; + case 2: + tile = 62; + animate = 100; + colour = 6; + behave = -1; + w = 32; + h = 32; + break; + } + break; + case 1: + //FACTORY emitter + switch ((int) para) + { + case 0: + tile = 72; + animate = 3; + size = 9; + colour = 6; + behave = 12; + w = 64; + h = 40; + cx = 0; + cy = 24; + break; + case 1: + xp += 4; + lerpoldxp += 4; + yp -= 4; + lerpoldyp -= 4; + tile = 76; + animate = 100; // Clouds + colour = 6; + behave = 13; + para = -6; //destroyed when outside + x2 = 400; + w = 32; + h = 12; + cx = 0; + cy = 6; + break; + case 2: + tile = 77; + animate = 100; + colour = 6; + behave = -1; + w = 32; + h = 16; + break; + } + break; + default: + break; + } } void entclass::setenemyroom( int rx, int ry ) { - //Simple function to initilise simple enemies - rx -= 100; - ry -= 100; - switch(rn(rx, ry)) - { - //Space Station 1 - case rn(12, 3): //Security Drone - tile = 36; - colour = EntityColour_ENEMY_PINK; - animate = 1; - break; - case rn(13, 3): //Wavelengths - tile = 32; - colour = EntityColour_ENEMY_GREEN; - animate = 1; - w = 32; - break; - case rn(15, 3): //Traffic - tile = 28; - colour = EntityColour_ENEMY_RED; - animate = 1; - w = 22; - h = 32; - break; - case rn(12, 5): //The Yes Men - tile = 40; - colour = EntityColour_ENEMY_YELLOW; - animate = 1; - w = 20; - h = 20; - break; - case rn(13, 6): //Hunchbacked Guards - tile = 44; - colour = EntityColour_ENEMY_PINK; - animate = 1; - w = 16; - h = 20; - break; - case rn(13, 4): //Communication Station - harmful = false; - if (xp == 256) - { - //transmittor - tile = 104; - colour = EntityColour_INACTIVE_ENTITY; - animate = 7; - w = 16; - h = 16; - xp -= 24; - lerpoldxp -= 24; - yp -= 16; - lerpoldyp -= 16; - } - else - { - //radar dish - tile =124; - colour = EntityColour_INACTIVE_ENTITY; - animate = 6; - w = 32; - h = 32; - cx = 4; - size = 9; - xp -= 4; - lerpoldxp -= 4; - yp -= 32; - lerpoldyp -= 32; - } + //Simple function to initilise simple enemies + rx -= 100; + ry -= 100; + switch(rn(rx, ry)) + { + //Space Station 1 + case rn(12, 3): //Security Drone + tile = 36; + colour = 8; + animate = 1; + break; + case rn(13, 3): //Wavelengths + tile = 32; + colour = 7; + animate = 1; + w = 32; + break; + case rn(15, 3): //Traffic + tile = 28; + colour = 6; + animate = 1; + w = 22; + h = 32; + break; + case rn(12, 5): //The Yes Men + tile = 40; + colour = 9; + animate = 1; + w = 20; + h = 20; + break; + case rn(13, 6): //Hunchbacked Guards + tile = 44; + colour = 8; + animate = 1; + w = 16; + h = 20; + break; + case rn(13, 4): //Communication Station + harmful = false; + if (xp == 256) + { + //transmittor + tile = 104; + colour = 4; + animate = 7; + w = 16; + h = 16; + xp -= 24; + lerpoldxp -= 24; + yp -= 16; + lerpoldyp -= 16; + } + else + { + //radar dish + tile =124; + colour = 4; + animate = 6; + w = 32; + h = 32; + cx = 4; + size = 9; + xp -= 4; + lerpoldxp -= 4; + yp -= 32; + lerpoldyp -= 32; + } - break; - //The Lab - case rn(4, 0): - tile = 78; - colour = EntityColour_ENEMY_GREEN; - animate = 1; - w = 16; - h = 16; - break; - case rn(2, 0): - tile = 88; - colour = EntityColour_ENEMY_CYAN; - animate = 1; - w = 16; - h = 16; - break; - //Space Station 2 - case rn(14, 11): - colour = EntityColour_ENEMY_ORANGE; - break; //Lies - case rn(16, 11): - colour = EntityColour_ENEMY_PINK; - break; //Lies - case rn(13, 10): - colour = EntityColour_ENEMY_CYAN; - break; //Factory - case rn(13, 9): - colour = EntityColour_ENEMY_YELLOW; - break; //Factory - case rn(13, 8): - colour = EntityColour_ENEMY_PINK; - break; //Factory - case rn(11, 13): //Truth - tile = 64; - colour = EntityColour_ENEMY_GREEN; - animate = 100; - w = 44; - h = 10; - size = 10; - break; - case rn(17, 7): //Brass sent us under the top - tile =82; - colour = EntityColour_ENEMY_PINK; - animate = 5; - w = 28; - h = 32; - cx = 4; - break; - case rn(10, 7): // (deception) - tile = 92; - colour = EntityColour_ENEMY_RED; - animate = 1; - w = 16; - h = 16; - break; - case rn(14, 13): // (chose poorly) - tile = 56; - colour = EntityColour_ENEMY_RED; - animate = 1; - w = 15; - h = 24; - break; - case rn(13, 12): // (backsliders) - tile = 164; - colour = EntityColour_ENEMY_GREEN; - animate = 1; - w = 16; - h = 16; - break; - case rn(14, 8): // (wheel of fortune room) - tile = 116; - colour = EntityColour_ENEMY_BLUE; - animate = 1; - w = 32; - h = 32; - break; - case rn(16, 9): // (seeing dollar signs) - tile = 68; - colour = EntityColour_ENEMY_GREEN; - animate = 1; - w = 16; - h = 16; - break; - case rn(16, 7): // (tomb of mad carew) - tile = 106; - colour = EntityColour_ENEMY_GREEN; - animate = 2; - w = 24; - h = 25; - break; - //Warp Zone - case rn(15, 2): // (numbers) - tile = 100; - colour = EntityColour_ENEMY_RED; - animate = 1; - w = 32; - h = 14; - yp += 1; - lerpoldyp += 1; - break; - case rn(16, 2): // (Manequins) - tile = 52; - colour = EntityColour_ENEMY_GREEN; - animate = 5; - w = 16; - h = 25; - yp -= 4; - lerpoldyp -= 4; - break; - case rn(18, 0): // (Obey) - tile = 51; - colour = EntityColour_ENEMY_CYAN; - animate = 100; - w = 30; - h = 14; - break; - case rn(19, 1): // Ascending and Descending - tile = 48; - colour = EntityColour_ENEMY_YELLOW; - animate = 5; - w = 16; - h = 16; - break; - case rn(19, 2): // Shockwave Rider - tile = 176; - colour = EntityColour_ENEMY_RED; - animate = 1; - w = 16; - h = 16; - break; - case rn(18, 3): // Mind the gap - tile = 168; - colour = EntityColour_ENEMY_GREEN; - animate = 1; - w = 16; - h = 16; - break; - case rn(17, 3): // Edge Games - if (yp ==96) - { - tile = 160; - colour = EntityColour_ENEMY_PINK; - animate = 1; - w = 16; - h = 16; - } - else - { - tile = 156; - colour = EntityColour_ENEMY_PINK; - animate = 1; - w = 16; - h = 16; - } - break; - case rn(16, 0): // I love you - tile = 112; - colour = EntityColour_ENEMY_PINK; - animate = 5; - w = 16; - h = 16; - break; - case rn(14, 2): // That's why I have to kill you - tile = 114; - colour = EntityColour_ENEMY_RED; - animate = 5; - w = 16; - h = 16; - break; - case rn(18, 2): // Thinking with Portals - //depends on direction - if (xp ==88) - { - tile = 54+12; - colour = EntityColour_ENEMY_BLUE; - animate = 100; - w = 60; - h = 16; - size = 10; - } - else - { - tile = 54; - colour = EntityColour_ENEMY_BLUE; - animate = 100; - w = 60; - h = 16; - size = 10; - } - break; - //Final level - case rn(50-100, 53-100): //The Yes Men - tile = 40; - colour = EntityColour_ENEMY_YELLOW; - animate = 1; - w = 20; - h = 20; - break; - case rn(48-100, 51-100): //Wavelengths - tile = 32; - colour = EntityColour_ENEMY_GREEN; - animate = 1; - w = 32; - break; - case rn(43-100,52-100): // Ascending and Descending - tile = 48; - colour = EntityColour_ENEMY_YELLOW; - animate = 5; - w = 16; - h = 16; - break; - case rn(46-100,51-100): //kids his age - tile = 88; - colour = EntityColour_ENEMY_CYAN; - animate = 1; - w = 16; - h = 16; - break; - case rn(43-100,51-100): // Mind the gap - tile = 168; - colour = EntityColour_ENEMY_GREEN; - animate = 1; - w = 16; - h = 16; - break; - case rn(44-100,51-100): // vertigo? - tile = 172; - colour = EntityColour_ENEMY_GREEN; - animate = 100; - w = 32; - h = 32; - break; - case rn(44-100,52-100): // (backsliders) - tile = 164; - colour = EntityColour_ENEMY_GREEN; - animate = 1; - w = 16; - h = 16; - break; - case rn(43-100, 56-100): //Intermission 1 - tile = 88; - colour = EntityColour_ENEMY_GRAVITRON; - animate = 1; - w = 16; - h = 16; - break; - case rn(45-100, 56-100): //Intermission 1 - tile = 88; - colour = EntityColour_ENEMY_GRAVITRON; - animate = 1; - w = 16; - h = 16; - break; - //The elephant - case rn(11, 9): - case rn(12, 9): - case rn(11, 8): - case rn(12, 8): - tile = 0; - colour = EntityColour_TELEPORTER_FLASHING; - animate = 0; - w = 464; - h = 320; - size = 11; - harmful = false; - break; - } + break; + //The Lab + case rn(4, 0): + tile = 78; + colour = 7; + animate = 1; + w = 16; + h = 16; + break; + case rn(2, 0): + tile = 88; + colour = 11; + animate = 1; + w = 16; + h = 16; + break; + //Space Station 2 + case rn(14, 11): + colour = 17; + break; //Lies + case rn(16, 11): + colour = 8; + break; //Lies + case rn(13, 10): + colour = 11; + break; //Factory + case rn(13, 9): + colour = 9; + break; //Factory + case rn(13, 8): + colour = 8; + break; //Factory + case rn(11, 13): //Truth + tile = 64; + colour = 7; + animate = 100; + w = 44; + h = 10; + size = 10; + break; + case rn(17, 7): //Brass sent us under the top + tile =82; + colour = 8; + animate = 5; + w = 28; + h = 32; + cx = 4; + break; + case rn(10, 7): // (deception) + tile = 92; + colour = 6; + animate = 1; + w = 16; + h = 16; + break; + case rn(14, 13): // (chose poorly) + tile = 56; + colour = 6; + animate = 1; + w = 15; + h = 24; + break; + case rn(13, 12): // (backsliders) + tile = 164; + colour = 7; + animate = 1; + w = 16; + h = 16; + break; + case rn(14, 8): // (wheel of fortune room) + tile = 116; + colour = 12; + animate = 1; + w = 32; + h = 32; + break; + case rn(16, 9): // (seeing dollar signs) + tile = 68; + colour = 7; + animate = 1; + w = 16; + h = 16; + break; + case rn(16, 7): // (tomb of mad carew) + tile = 106; + colour = 7; + animate = 2; + w = 24; + h = 25; + break; + //Warp Zone + case rn(15, 2): // (numbers) + tile = 100; + colour = 6; + animate = 1; + w = 32; + h = 14; + yp += 1; + lerpoldyp += 1; + break; + case rn(16, 2): // (Manequins) + tile = 52; + colour = 7; + animate = 5; + w = 16; + h = 25; + yp -= 4; + lerpoldyp -= 4; + break; + case rn(18, 0): // (Obey) + tile = 51; + colour = 11; + animate = 100; + w = 30; + h = 14; + break; + case rn(19, 1): // Ascending and Descending + tile = 48; + colour = 9; + animate = 5; + w = 16; + h = 16; + break; + case rn(19, 2): // Shockwave Rider + tile = 176; + colour = 6; + animate = 1; + w = 16; + h = 16; + break; + case rn(18, 3): // Mind the gap + tile = 168; + colour = 7; + animate = 1; + w = 16; + h = 16; + break; + case rn(17, 3): // Edge Games + if (yp ==96) + { + tile = 160; + colour = 8; + animate = 1; + w = 16; + h = 16; + } + else + { + tile = 156; + colour = 8; + animate = 1; + w = 16; + h = 16; + } + break; + case rn(16, 0): // I love you + tile = 112; + colour = 8; + animate = 5; + w = 16; + h = 16; + break; + case rn(14, 2): // That's why I have to kill you + tile = 114; + colour = 6; + animate = 5; + w = 16; + h = 16; + break; + case rn(18, 2): // Thinking with Portals + //depends on direction + if (xp ==88) + { + tile = 54+12; + colour = 12; + animate = 100; + w = 60; + h = 16; + size = 10; + } + else + { + tile = 54; + colour = 12; + animate = 100; + w = 60; + h = 16; + size = 10; + } + break; + //Final level + case rn(50-100, 53-100): //The Yes Men + tile = 40; + colour = 9; + animate = 1; + w = 20; + h = 20; + break; + case rn(48-100, 51-100): //Wavelengths + tile = 32; + colour = 7; + animate = 1; + w = 32; + break; + case rn(43-100,52-100): // Ascending and Descending + tile = 48; + colour = 9; + animate = 5; + w = 16; + h = 16; + break; + case rn(46-100,51-100): //kids his age + tile = 88; + colour = 11; + animate = 1; + w = 16; + h = 16; + break; + case rn(43-100,51-100): // Mind the gap + tile = 168; + colour = 7; + animate = 1; + w = 16; + h = 16; + break; + case rn(44-100,51-100): // vertigo? + tile = 172; + colour = 7; + animate = 100; + w = 32; + h = 32; + break; + case rn(44-100,52-100): // (backsliders) + tile = 164; + colour = 7; + animate = 1; + w = 16; + h = 16; + break; + case rn(43-100, 56-100): //Intermission 1 + tile = 88; + colour = 21; + animate = 1; + w = 16; + h = 16; + break; + case rn(45-100, 56-100): //Intermission 1 + tile = 88; + colour = 21; + animate = 1; + w = 16; + h = 16; + break; + //The elephant + case rn(11, 9): + case rn(12, 9): + case rn(11, 8): + case rn(12, 8): + tile = 0; + colour = 102; + animate = 0; + w = 464; + h = 320; + size = 11; + harmful = false; + break; + } } void entclass::settreadmillcolour( int rx, int ry ) { - rx -= 100; - ry -= 100; - rx += 50 - 12; - ry += 50 - 14; //Space Station + rx -= 100; + ry -= 100; + rx += 50 - 12; + ry += 50 - 14; //Space Station - tile = 20; //default as blue - switch(rn(rx, ry)) - { - case rn(52, 48): - tile = 791; - break; //Cyan + tile = 20; //default as blue + switch(rn(rx, ry)) + { + case rn(52, 48): + tile = 791; + break; //Cyan - case rn(49, 47): - tile = 24; - break; //Yellow - case rn(56, 44): - tile = 24; - break; //Yellow - case rn(54, 49): - tile = 24; - break; //Yellow + case rn(49, 47): + tile = 24; + break; //Yellow + case rn(56, 44): + tile = 24; + break; //Yellow + case rn(54, 49): + tile = 24; + break; //Yellow - case rn(49, 49): - tile = 36; - break; //Green - case rn(55, 44): - tile = 36; - break; //Green - case rn(54, 43): - tile = 36; - break; //Green - case rn(53, 49): - tile = 36; - break; //Green - case rn(54, 45): - tile = 711; - break; //Green (special) - case rn(51, 48): - tile = 711; - break; //Green (special) + case rn(49, 49): + tile = 36; + break; //Green + case rn(55, 44): + tile = 36; + break; //Green + case rn(54, 43): + tile = 36; + break; //Green + case rn(53, 49): + tile = 36; + break; //Green + case rn(54, 45): + tile = 711; + break; //Green (special) + case rn(51, 48): + tile = 711; + break; //Green (special) - case rn(50, 49): - tile = 28; - break; //Purple - case rn(54, 44): - tile = 28; - break; //Purple - case rn(49, 42): - tile = 28; - break; //Purple - case rn(55, 43): - tile = 28; - break; //Purple - case rn(54, 47): - tile = 28; - break; //Purple - case rn(53, 48): - tile = 28; - break; //Purple + case rn(50, 49): + tile = 28; + break; //Purple + case rn(54, 44): + tile = 28; + break; //Purple + case rn(49, 42): + tile = 28; + break; //Purple + case rn(55, 43): + tile = 28; + break; //Purple + case rn(54, 47): + tile = 28; + break; //Purple + case rn(53, 48): + tile = 28; + break; //Purple - case rn(51, 47): - tile = 32; - break; //Red - case rn(52, 49): - tile = 32; - break; //Red - case rn(48, 43): - tile = 32; - break; //Red - case rn(55, 47): - tile = 32; - break; //Red - case rn(54, 48): - tile = 32; - break; //Red - default: - return; - break; - } + case rn(51, 47): + tile = 32; + break; //Red + case rn(52, 49): + tile = 32; + break; //Red + case rn(48, 43): + tile = 32; + break; //Red + case rn(55, 47): + tile = 32; + break; //Red + case rn(54, 48): + tile = 32; + break; //Red + default: + return; + break; + } } void entclass::updatecolour(void) { - switch (size) - { - case 0: // Sprites - case 3: // Big chunky pixels! - case 4: // Small pickups - case 7: // Teleporter - case 9: // Really Big Sprite! (2x2) - case 10: // 2x1 Sprite - case 13: // Special for epilogue: huge hero! - realcol = graphics.getcol(colour); - break; - case 5: // Horizontal gravity line - case 6: // Vertical gravity line - if (life == 0) - { - realcol = graphics.getcol(colour); - } - else - { - realcol = graphics.getcol(24); - } - break; - case 11: // The fucking elephant - if (game.noflashingmode) - { - realcol = graphics.getcol(22); - } - else - { - realcol = graphics.getcol(colour); - } - break; - case 12: // Regular sprites that don't wrap - // if we're outside the screen, we need to draw indicators - if ((xp < -20 && vx > 0) || (xp > 340 && vx < 0)) - { - realcol = graphics.getcol(23); - } - else - { - realcol = graphics.getcol(colour); - } - } + switch (size) + { + case 0: // Sprites + case 7: // Teleporter + case 9: // Really Big Sprite! (2x2) + case 10: // 2x1 Sprite + case 13: // Special for epilogue: huge hero! + graphics.setcol(colour); + realcol = graphics.ct.colour; + break; + case 3: // Big chunky pixels! + realcol = graphics.bigchunkygetcol(colour); + break; + case 4: // Small pickups + graphics.huetilesetcol(colour); + realcol = graphics.ct.colour; + break; + case 11: // The fucking elephant + if (game.noflashingmode) + { + graphics.setcol(22); + } + else + { + graphics.setcol(colour); + } + realcol = graphics.ct.colour; + break; + case 12: // Regular sprites that don't wrap + // if we're outside the screen, we need to draw indicators + if ((xp < -20 && vx > 0) || (xp > 340 && vx < 0)) + { + graphics.setcol(23); + } + else + { + graphics.setcol(colour); + } + realcol = graphics.ct.colour; + break; + default: + break; + } } bool entclass::ishumanoid(void) { - return type == EntityType_PLAYER - || type == EntityType_CREWMATE - || type == EntityType_SUPERCREWMATE - || type == EntityType_COLLECTABLE_CREWMATE; + return type == 0 + || type == 12 + || type == 14 + || type == 55; } diff --git a/desktop_version/src/Ent.h b/desktop_version/src/Ent.h index 3e375a53..046fbd68 100644 --- a/desktop_version/src/Ent.h +++ b/desktop_version/src/Ent.h @@ -3,35 +3,7 @@ #include -#define rn( rx, ry) ((rx) + ((ry) * 100)) - -enum EntityType -{ - EntityType_INVALID = -1, - EntityType_PLAYER, - EntityType_MOVING, - EntityType_DISAPPEARING_PLATFORM, - EntityType_QUICKSAND, - EntityType_GRAVITY_TOKEN, - EntityType_PARTICLE, - EntityType_COIN, - EntityType_TRINKET, - EntityType_CHECKPOINT, - EntityType_HORIZONTAL_GRAVITY_LINE, - EntityType_VERTICAL_GRAVITY_LINE, - EntityType_WARP_TOKEN, - EntityType_CREWMATE, - EntityType_TERMINAL, - EntityType_SUPERCREWMATE, - EntityType_TROPHY, - EntityType_GRAVITRON_ENEMY = 23, - EntityType_WARP_LINE_LEFT = 51, - EntityType_WARP_LINE_RIGHT = 52, - EntityType_WARP_LINE_TOP = 53, - EntityType_WARP_LINE_BOTTOM = 54, - EntityType_COLLECTABLE_CREWMATE = 55, - EntityType_TELEPORTER = 100 -}; +#define rn( rx, ry) ((rx) + ((ry) * 100)) class entclass { @@ -54,13 +26,11 @@ public: public: //Fundamentals bool invis; - EntityType type; - int size, tile, rule; + int type, size, tile, rule; int state, statedelay; int behave, animate; float para; - int life; - int colour; // As out-of-bounds colours are allowed, this should be an int instead of an EnemyColour. + int life, colour; //Position and velocity int oldxp, oldyp; @@ -83,7 +53,7 @@ public: int visualonground, visualonroof; int yp;int xp; - SDL_Color realcol; + Uint32 realcol; int lerpoldxp, lerpoldyp; }; diff --git a/desktop_version/src/Entity.cpp b/desktop_version/src/Entity.cpp index a1d5fc30..e334fec9 100644 --- a/desktop_version/src/Entity.cpp +++ b/desktop_version/src/Entity.cpp @@ -3,35 +3,21 @@ #include -#include "CustomLevels.h" -#include "Font.h" +#include "editor.h" #include "Game.h" #include "GlitchrunnerMode.h" #include "Graphics.h" -#include "Localization.h" #include "Map.h" -#include "Maths.h" #include "Music.h" #include "Script.h" #include "UtilityClass.h" -#include "Vlogging.h" #include "Xoshiro.h" -static int getgridpoint( int t ) -{ - return t / 8; -} - bool entityclass::checktowerspikes(int t) { - if (map.invincibility) - { - return false; - } - if (!INBOUNDS_VEC(t, entities)) { - vlog_error("checktowerspikes() out-of-bounds!"); + puts("checktowerspikes() out-of-bounds!"); return false; } @@ -45,25 +31,25 @@ bool entityclass::checktowerspikes(int t) int tempy = getgridpoint(temprect.y); int tempw = getgridpoint(temprect.x + temprect.w - 1); int temph = getgridpoint(temprect.y + temprect.h - 1); - if (map.towerspikecollide(tempx, tempy)) return true; - if (map.towerspikecollide(tempw, tempy)) return true; - if (map.towerspikecollide(tempx, temph)) return true; - if (map.towerspikecollide(tempw, temph)) return true; + if (map.spikecollide(tempx, tempy)) return true; + if (map.spikecollide(tempw, tempy)) return true; + if (map.spikecollide(tempx, temph)) return true; + if (map.spikecollide(tempw, temph)) return true; if (temprect.h >= 12) { int tpy1 = getgridpoint(temprect.y + 6); - if (map.towerspikecollide(tempx, tpy1)) return true; - if (map.towerspikecollide(tempw, tpy1)) return true; + if (map.spikecollide(tempx, tpy1)) return true; + if (map.spikecollide(tempw, tpy1)) return true; if (temprect.h >= 18) { tpy1 = getgridpoint(temprect.y + 12); - if (map.towerspikecollide(tempx, tpy1)) return true; - if (map.towerspikecollide(tempw, tpy1)) return true; + if (map.spikecollide(tempx, tpy1)) return true; + if (map.spikecollide(tempw, tpy1)) return true; if (temprect.h >= 24) { tpy1 = getgridpoint(temprect.y + 18); - if (map.towerspikecollide(tempx, tpy1)) return true; - if (map.towerspikecollide(tempw, tpy1)) return true; + if (map.spikecollide(tempx, tpy1)) return true; + if (map.spikecollide(tempw, tpy1)) return true; } } } @@ -81,12 +67,9 @@ void entityclass::init(void) upsetmode = false; upset = 0; - customenemy = 0; - customwarpmode = false; customwarpmodevon = false; customwarpmodehon = false; - customactivitycolour = ""; - customactivitypositiony = -1; - customactivitytext = ""; - trophytext = 0; + customenemy=0; + customwarpmode=false; customwarpmodevon=false; customwarpmodehon=false; + trophytext = 0 ; oldtrophytext = 0; trophytype = 0; altstates = 0; @@ -109,13 +92,13 @@ void entityclass::resetallflags(void) int entityclass::swncolour( int t ) { //given colour t, return colour in setcol - if (t == 0) return EntityColour_ENEMY_CYAN; - if (t == 1) return EntityColour_ENEMY_RED; - if (t == 2) return EntityColour_ENEMY_PINK; - if (t == 3) return EntityColour_ENEMY_BLUE; - if (t == 4) return EntityColour_ENEMY_YELLOW; - if (t == 5) return EntityColour_ENEMY_GREEN; - return EntityColour_CREW_CYAN; // Fallback to color 0 + if (t == 0) return 11; + if (t == 1) return 6; + if (t == 2) return 8; + if (t == 3) return 12; + if (t == 4) return 9; + if (t == 5) return 7; + return 0; } void entityclass::swnenemiescol( int t ) @@ -123,7 +106,7 @@ void entityclass::swnenemiescol( int t ) //change the colour of all SWN enemies to the current one for (size_t i = 0; i < entities.size(); i++) { - if (entities[i].type == EntityType_GRAVITRON_ENEMY) + if (entities[i].type == 23) { entities[i].colour = swncolour(t); } @@ -162,62 +145,62 @@ void entityclass::generateswnwave( int t ) game.swnstate = 9; game.swndelay = 8; } - else if (game.swntimer <= 300) //less than 10 seconds + else if (game.swntimer <= 300) //less than 10 seconds { game.swnstate = 6; game.swndelay = 12; } - else if (game.swntimer <= 360) //less than 12 seconds + else if (game.swntimer <= 360) //less than 12 seconds { game.swnstate = 5+game.swnstate2; game.swndelay = 15; } - else if (game.swntimer <= 420) //less than 14 seconds + else if (game.swntimer <= 420) //less than 14 seconds { game.swnstate = 7+game.swnstate2; game.swndelay = 15; } - else if (game.swntimer <= 480) //less than 16 seconds + else if (game.swntimer <= 480) //less than 16 seconds { game.swnstate = 5+game.swnstate2; game.swndelay = 15; } - else if (game.swntimer <= 540) //less than 18 seconds + else if (game.swntimer <= 540) //less than 18 seconds { game.swnstate = 7+game.swnstate2; game.swndelay = 15; } - else if (game.swntimer <= 600) //less than 20 seconds + else if (game.swntimer <= 600) //less than 20 seconds { game.swnstate = 5+game.swnstate2; game.swndelay = 15; } - else if (game.swntimer <= 900) //less than 30 seconds + else if (game.swntimer <= 900) //less than 30 seconds { game.swnstate = 4; game.swndelay = 20; } - else if (game.swntimer <= 1050) //less than 35 seconds + else if (game.swntimer <= 1050) //less than 35 seconds { game.swnstate = 3; game.swndelay = 10; } - else if (game.swntimer <= 1200) //less than 40 seconds + else if (game.swntimer <= 1200) //less than 40 seconds { game.swnstate = 3; game.swndelay = 20; } - else if (game.swntimer <= 1500) //less than 50 seconds + else if (game.swntimer <= 1500) //less than 50 seconds { game.swnstate = 2; game.swndelay = 10; } - else if (game.swntimer <= 1650) //less than 55 seconds + else if (game.swntimer <= 1650) //less than 55 seconds { game.swnstate = 1; game.swndelay = 15; } - else if (game.swntimer <= 1800) //less than 60 seconds + else if (game.swntimer <= 1800) //less than 60 seconds { game.swnstate = 1; game.swndelay = 25; @@ -776,7 +759,7 @@ void entityclass::generateswnwave( int t ) } } -void entityclass::createblock( int t, int xp, int yp, int w, int h, int trig /*= 0*/, const std::string& script /*= ""*/, bool custom /*= false*/) +void entityclass::createblock( int t, int xp, int yp, int w, int h, int trig /*= 0*/, const std::string& script /*= ""*/ ) { k = blocks.size(); @@ -858,151 +841,151 @@ void entityclass::createblock( int t, int xp, int yp, int w, int h, int trig /*= switch(trig) { case 0: //testing zone - block.prompt = "Press {button} to explode"; + block.prompt = "Press %s to explode"; block.script = "intro"; block.setblockcolour("orange"); trig=1; break; case 1: - block.prompt = "Press {button} to talk to Violet"; + block.prompt = "Press %s to talk to Violet"; block.script = "talkpurple"; block.setblockcolour("purple"); trig=0; break; case 2: - block.prompt = "Press {button} to talk to Vitellary"; + block.prompt = "Press %s to talk to Vitellary"; block.script = "talkyellow"; block.setblockcolour("yellow"); trig=0; break; case 3: - block.prompt = "Press {button} to talk to Vermilion"; + block.prompt = "Press %s to talk to Vermilion"; block.script = "talkred"; block.setblockcolour("red"); trig=0; break; case 4: - block.prompt = "Press {button} to talk to Verdigris"; + block.prompt = "Press %s to talk to Verdigris"; block.script = "talkgreen"; block.setblockcolour("green"); trig=0; break; case 5: - block.prompt = "Press {button} to talk to Victoria"; + block.prompt = "Press %s to talk to Victoria"; block.script = "talkblue"; block.setblockcolour("blue"); trig=0; break; case 6: - block.prompt = "Press {button} to activate terminal"; + block.prompt = "Press %s to activate terminal"; block.script = "terminal_station_1"; block.setblockcolour("orange"); trig=0; break; case 7: - block.prompt = "Press {button} to activate terminal"; + block.prompt = "Press %s to activate terminal"; block.script = "terminal_outside_1"; block.setblockcolour("orange"); trig=0; break; case 8: - block.prompt = "Press {button} to activate terminal"; + block.prompt = "Press %s to activate terminal"; block.script = "terminal_outside_2"; block.setblockcolour("orange"); trig=0; break; case 9: - block.prompt = "Press {button} to activate terminal"; + block.prompt = "Press %s to activate terminal"; block.script = "terminal_outside_3"; block.setblockcolour("orange"); trig=0; break; case 10: - block.prompt = "Press {button} to activate terminal"; + block.prompt = "Press %s to activate terminal"; block.script = "terminal_outside_4"; block.setblockcolour("orange"); trig=0; break; case 11: - block.prompt = "Press {button} to activate terminal"; + block.prompt = "Press %s to activate terminal"; block.script = "terminal_outside_5"; block.setblockcolour("orange"); trig=0; break; case 12: - block.prompt = "Press {button} to activate terminal"; + block.prompt = "Press %s to activate terminal"; block.script = "terminal_outside_6"; block.setblockcolour("orange"); trig=0; break; case 13: - block.prompt = "Press {button} to activate terminal"; + block.prompt = "Press %s to activate terminal"; block.script = "terminal_finallevel"; block.setblockcolour("orange"); trig=0; break; case 14: - block.prompt = "Press {button} to activate terminal"; + block.prompt = "Press %s to activate terminal"; block.script = "terminal_station_2"; block.setblockcolour("orange"); trig=0; break; case 15: - block.prompt = "Press {button} to activate terminal"; + block.prompt = "Press %s to activate terminal"; block.script = "terminal_station_3"; block.setblockcolour("orange"); trig=0; break; case 16: - block.prompt = "Press {button} to activate terminal"; + block.prompt = "Press %s to activate terminal"; block.script = "terminal_station_4"; block.setblockcolour("orange"); trig=0; break; case 17: - block.prompt = "Press {button} to activate terminal"; + block.prompt = "Press %s to activate terminal"; block.script = "terminal_warp_1"; block.setblockcolour("orange"); trig=0; break; case 18: - block.prompt = "Press {button} to activate terminal"; + block.prompt = "Press %s to activate terminal"; block.script = "terminal_warp_2"; block.setblockcolour("orange"); trig=0; break; case 19: - block.prompt = "Press {button} to activate terminal"; + block.prompt = "Press %s to activate terminal"; block.script = "terminal_lab_1"; block.setblockcolour("orange"); trig=0; break; case 20: - block.prompt = "Press {button} to activate terminal"; + block.prompt = "Press %s to activate terminal"; block.script = "terminal_lab_2"; block.setblockcolour("orange"); trig=0; break; case 21: - block.prompt = "Press {button} to activate terminal"; + block.prompt = "Press %s to activate terminal"; block.script = "terminal_secretlab"; block.setblockcolour("orange"); trig=0; break; case 22: - block.prompt = "Press {button} to activate terminal"; + block.prompt = "Press %s to activate terminal"; block.script = "terminal_shipcomputer"; block.setblockcolour("orange"); trig=0; break; case 23: - block.prompt = "Press {button} to activate terminals"; + block.prompt = "Press %s to activate terminals"; block.script = "terminal_radio"; block.setblockcolour("orange"); trig=0; break; case 24: - block.prompt = "Press {button} to activate terminal"; + block.prompt = "Press %s to activate terminal"; block.script = "terminal_jukebox"; block.setblockcolour("orange"); trig=0; @@ -1068,14 +1051,7 @@ void entityclass::createblock( int t, int xp, int yp, int w, int h, int trig /*= trig=0; break; case 35: - if (custom) - { - block.prompt = "Press {button} to interact"; - } - else - { - block.prompt = "Press {button} to activate terminal"; - } + block.prompt = "Press %s to activate terminal"; block.script = "custom_"+customscript; block.setblockcolour("orange"); trig=0; @@ -1084,33 +1060,6 @@ void entityclass::createblock( int t, int xp, int yp, int w, int h, int trig /*= break; } - if (customactivitytext != "") - { - block.prompt = customactivitytext; - block.gettext = false; - customactivitytext = ""; - } - else - { - block.gettext = true; - } - - if (customactivitycolour != "") - { - block.setblockcolour(customactivitycolour.c_str()); - customactivitycolour = ""; - } - - if (customactivitypositiony != -1) - { - block.activity_y = customactivitypositiony; - customactivitypositiony = -1; - } - else - { - block.activity_y = 0; - } - if (!reuse) { blocks.push_back(block); @@ -1122,7 +1071,7 @@ bool entityclass::disableentity(int t) { if (!INBOUNDS_VEC(t, entities)) { - vlog_error("disableentity() out-of-bounds!"); + puts("disableentity() out-of-bounds!"); return true; } if (entities[t].rule == 0 && t == getplayer()) @@ -1133,9 +1082,8 @@ bool entityclass::disableentity(int t) entities[t].invis = true; entities[t].size = -1; - entities[t].type = EntityType_INVALID; + entities[t].type = -1; entities[t].rule = -1; - entities[t].isplatform = false; return true; } @@ -1149,7 +1097,7 @@ void entityclass::disableblock( int t ) { if (!INBOUNDS_VEC(t, blocks)) { - vlog_error("disableblock() out-of-bounds!"); + puts("disableblock() out-of-bounds!"); return; } @@ -1200,22 +1148,22 @@ void entityclass::removetrigger( int t ) } } -void entityclass::copylinecross(std::vector& linecrosskludge, int t) +void entityclass::copylinecross( int t ) { if (!INBOUNDS_VEC(t, entities)) { - vlog_error("copylinecross() out-of-bounds!"); + puts("copylinecross() out-of-bounds!"); return; } //Copy entity t into the first free linecrosskludge entity linecrosskludge.push_back(entities[t]); } -void entityclass::revertlinecross(std::vector& linecrosskludge, int t, int s) +void entityclass::revertlinecross( int t, int s ) { if (!INBOUNDS_VEC(t, entities) || !INBOUNDS_VEC(s, linecrosskludge)) { - vlog_error("revertlinecross() out-of-bounds!"); + puts("revertlinecross() out-of-bounds!"); return; } //Restore entity t info from linecrossing s @@ -1224,32 +1172,42 @@ void entityclass::revertlinecross(std::vector& linecrosskludge, int t, entities[t].life = linecrosskludge[s].life; } -static bool gridmatch( int p1, int p2, int p3, int p4, int p11, int p21, int p31, int p41 ) +bool entityclass::gridmatch( int p1, int p2, int p3, int p4, int p11, int p21, int p31, int p41 ) { if (p1 == p11 && p2 == p21 && p3 == p31 && p4 == p41) return true; return false; } +int entityclass::crewcolour( int t ) +{ + //Return the colour of the indexed crewmate + switch(t) + { + case 0: + return 0; + break; + case 1: + return 20; + break; + case 2: + return 14; + break; + case 3: + return 15; + break; + case 4: + return 13; + break; + case 5: + return 16; + break; + } + return 0; +} + static void entityclonefix(entclass* entity) { - const bool is_lies_emitter = entity->behave == 10; - const bool is_factory_emitter = entity->behave == 12; - - const bool is_emitter = is_lies_emitter || is_factory_emitter; - if (!is_emitter) - { - return; - } - - const bool in_lies_emitter_room = - game.roomx >= 113 && game.roomx <= 117 && game.roomy == 111; - const bool in_factory_emitter_room = - game.roomx == 113 && game.roomy >= 108 && game.roomy <= 110; - - const bool valid = (is_lies_emitter && in_lies_emitter_room) - || (is_factory_emitter && in_factory_emitter_room); - - if (!valid) + if (entity->behave == 10 || entity->behave == 12) { /* Fix memory leak */ entity->behave = -1; @@ -1269,9 +1227,8 @@ void entityclass::createentity(int xp, int yp, int t, int meta1, int meta2, int { if (entities[i].invis && entities[i].size == -1 - && entities[i].type == EntityType_INVALID - && entities[i].rule == -1 - && !entities[i].isplatform) + && entities[i].type == -1 + && entities[i].rule == -1) { reuse = true; entptr = &entities[i]; @@ -1292,7 +1249,7 @@ void entityclass::createentity(int xp, int yp, int t, int meta1, int meta2, int //Size 1 is a tile //Beyond that are special cases (to do) //Size 2 is a moving platform of width 4 (32) - //Size 3 is apparently a "big chunky pixel" + //Size 3 is apparently a "bug chunky pixel" //Size 4 is a coin/small pickup //Size 5 is a horizontal line, 6 is vertical @@ -1303,34 +1260,29 @@ void entityclass::createentity(int xp, int yp, int t, int meta1, int meta2, int //Rule 4 is a horizontal line, 5 is vertical //Rule 6 is a crew member - bool custom_gray; +#if !defined(NO_CUSTOM_LEVELS) // Special case for gray Warp Zone tileset! - if (map.custommode) - { - const RoomProperty* const room = cl.getroomprop(game.roomx - 100, game.roomy - 100); - custom_gray = room->tileset == 3 && room->tilecol == 6; - } - else - { - custom_gray = false; - } + const edlevelclass* const room = ed.getroomprop(game.roomx - 100, game.roomy - 100); + bool custom_gray = room->tileset == 3 && room->tilecol == 6; +#else + bool custom_gray = false; +#endif entclass& entity = *entptr; entity.xp = xp; entity.yp = yp; - entity.type = EntityType_INVALID; + entity.type = t; switch(t) { case 0: //Player entity.rule = 0; //Playable character entity.tile = 0; - entity.colour = EntityColour_CREW_CYAN; + entity.colour = 0; entity.cx = 6; entity.cy = 2; entity.w = 12; entity.h = 21; entity.dir = 1; - entity.type = EntityType_PLAYER; /* Fix wrong y-position if spawning in on conveyor */ entity.newxp = xp; @@ -1357,9 +1309,7 @@ void entityclass::createentity(int xp, int yp, int t, int meta1, int meta2, int entity.harmful = true; entity.tile = 24; entity.animate = 0; - entity.colour = EntityColour_ENEMY_PINK; - - entity.type = EntityType_MOVING; + entity.colour = 8; if (game.roomy == 111 && (game.roomx >= 113 && game.roomx <= 117)) { @@ -1375,7 +1325,7 @@ void entityclass::createentity(int xp, int yp, int t, int meta1, int meta2, int { //MAVVERRRICK entity.tile = 96; - entity.colour = EntityColour_ENEMY_RED; + entity.colour = 6; entity.size = 9; entity.w = 64; entity.h = 44; @@ -1389,7 +1339,7 @@ void entityclass::createentity(int xp, int yp, int t, int meta1, int meta2, int break; case 2: //A moving platform entity.rule = 2; - entity.type = EntityType_MOVING; + entity.type = 1; entity.size = 2; entity.tile = 1; @@ -1457,7 +1407,7 @@ void entityclass::createentity(int xp, int yp, int t, int meta1, int meta2, int break; case 3: //Disappearing platforms entity.rule = 3; - entity.type = EntityType_DISAPPEARING_PLATFORM; + entity.type = 2; entity.size = 2; entity.tile = 2; //appearance again depends on location @@ -1487,7 +1437,7 @@ void entityclass::createentity(int xp, int yp, int t, int meta1, int meta2, int break; case 4: //Breakable blocks entity.rule = 6; - entity.type = EntityType_QUICKSAND; + entity.type = 3; entity.size = 1; entity.tile = 10; entity.cy = -1; @@ -1502,7 +1452,7 @@ void entityclass::createentity(int xp, int yp, int t, int meta1, int meta2, int break; case 5: //Gravity Tokens entity.rule = 3; - entity.type = EntityType_GRAVITY_TOKEN; + entity.type = 4; entity.size = 0; entity.tile = 11; entity.w = 16; @@ -1514,8 +1464,8 @@ void entityclass::createentity(int xp, int yp, int t, int meta1, int meta2, int break; case 6: //Decorative particles entity.rule = 2; - entity.type = EntityType_PARTICLE; //Particles - entity.colour = EntityColour_PARTICLE_RED; + entity.type = 5; //Particles + entity.colour = 1; entity.size = 3; entity.vx = meta1; entity.vy = meta2; @@ -1524,8 +1474,8 @@ void entityclass::createentity(int xp, int yp, int t, int meta1, int meta2, int break; case 7: //Decorative particles entity.rule = 2; - entity.type = EntityType_PARTICLE; //Particles - entity.colour = EntityColour_CREW_CYAN; + entity.type = 5; //Particles + entity.colour = 2; entity.size = 3; entity.vx = meta1; entity.vy = meta2; @@ -1534,9 +1484,8 @@ void entityclass::createentity(int xp, int yp, int t, int meta1, int meta2, int break; case 8: //Small collectibles entity.rule = 3; - entity.type = EntityType_COIN; + entity.type = 6; entity.size = 4; - entity.colour = EntityColour_COIN; entity.tile = 48; entity.w = 8; entity.h = 8; @@ -1549,12 +1498,12 @@ void entityclass::createentity(int xp, int yp, int t, int meta1, int meta2, int break; case 9: //Something Shiny entity.rule = 3; - entity.type = EntityType_TRINKET; + entity.type = 7; entity.size = 0; entity.tile = 22; entity.w = 16; entity.h = 16; - entity.colour = EntityColour_TRINKET; + entity.colour = 3; entity.onentity = 1; entity.animate = 100; @@ -1564,19 +1513,19 @@ void entityclass::createentity(int xp, int yp, int t, int meta1, int meta2, int break; case 10: //Savepoint entity.rule = 3; - entity.type = EntityType_CHECKPOINT; + entity.type = 8; entity.size = 0; entity.tile = 20 + meta1; entity.w = 16; entity.h = 16; - entity.colour = EntityColour_INACTIVE_ENTITY; + entity.colour = 4; entity.onentity = 1; entity.animate = 100; entity.para = meta2; if (game.savepoint == meta2) { - entity.colour = EntityColour_ACTIVE_ENTITY; + entity.colour = 5; entity.onentity = 0; } @@ -1587,33 +1536,31 @@ void entityclass::createentity(int xp, int yp, int t, int meta1, int meta2, int break; case 11: //Horizontal Gravity Line entity.rule = 4; - entity.type = EntityType_HORIZONTAL_GRAVITY_LINE; + entity.type = 9; entity.size = 5; entity.life = 0; - entity.colour = EntityColour_GRAVITY_LINE_ACTIVE; entity.w = meta1; entity.h = 1; entity.onentity = 1; break; case 12: //Vertical Gravity Line entity.rule = 5; - entity.type = EntityType_VERTICAL_GRAVITY_LINE; + entity.type = 10; entity.size = 6; entity.life = 0; - entity.colour = EntityColour_GRAVITY_LINE_ACTIVE; entity.w = 1; entity.h = meta1; - //entity.colour = EntityColour_CREW_CYAN; + //entity.colour = 0; entity.onentity = 1; break; case 13: //Warp token entity.rule = 3; - entity.type = EntityType_WARP_TOKEN; + entity.type = 11; entity.size = 0; entity.tile = 18; entity.w = 16; entity.h = 16; - entity.colour = EntityColour_WARP_TOKEN; + entity.colour = 10; entity.onentity = 1; entity.animate = 2; //Added in port, hope it doesn't break anything @@ -1622,21 +1569,21 @@ void entityclass::createentity(int xp, int yp, int t, int meta1, int meta2, int break; case 14: // Teleporter entity.rule = 3; - entity.type = EntityType_TELEPORTER; + entity.type = 100; entity.size = 7; entity.tile = 1; //inactive entity.w = 96; entity.h = 96; - entity.colour = EntityColour_TELEPORTER_INACTIVE; + entity.colour = 100; entity.onentity = 1; entity.animate = 100; entity.para = meta2; break; case 15: // Crew Member (warp zone) entity.rule = 6; - entity.type = EntityType_CREWMATE; //A special case! + entity.type = 12; //A special case! entity.tile = 144; - entity.colour = EntityColour_CREW_GREEN; //144 for sad :( + entity.colour = 13; //144 for sad :( entity.cx = 6; entity.cy = 2; entity.w = 12; @@ -1649,9 +1596,9 @@ void entityclass::createentity(int xp, int yp, int t, int meta1, int meta2, int break; case 16: // Crew Member, upside down (space station) entity.rule = 7; - entity.type = EntityType_CREWMATE; //A special case! + entity.type = 12; //A special case! entity.tile = 144+6; - entity.colour = EntityColour_CREW_YELLOW; //144 for sad (upside down+12):( + entity.colour = 14; //144 for sad (upside down+12):( entity.cx = 6; entity.cy = 2; entity.w = 12; @@ -1664,9 +1611,9 @@ void entityclass::createentity(int xp, int yp, int t, int meta1, int meta2, int break; case 17: // Crew Member (Lab) entity.rule = 6; - entity.type = EntityType_CREWMATE; //A special case! + entity.type = 12; //A special case! entity.tile = 144; - entity.colour = EntityColour_CREW_BLUE; //144 for sad :( + entity.colour = 16; //144 for sad :( entity.cx = 6; entity.cy = 2; entity.w = 12; @@ -1680,7 +1627,7 @@ void entityclass::createentity(int xp, int yp, int t, int meta1, int meta2, int case 18: // Crew Member (Ship) //This is the scriping crewmember entity.rule = 6; - entity.type = EntityType_CREWMATE; //A special case! + entity.type = 12; //A special case! entity.colour = meta1; if (meta2 == 0) { @@ -1708,9 +1655,9 @@ void entityclass::createentity(int xp, int yp, int t, int meta1, int meta2, int break; case 19: // Crew Member (Ship) More tests! entity.rule = 6; - entity.type = EntityType_CREWMATE; //A special case! + entity.type = 12; //A special case! entity.tile = 0; - entity.colour = EntityColour_ENEMY_RED; //54 for sad :( + entity.colour = 6; //54 for sad :( entity.cx = 6; entity.cy = 2; entity.w = 12; @@ -1723,36 +1670,36 @@ void entityclass::createentity(int xp, int yp, int t, int meta1, int meta2, int break; case 20: //Terminal entity.rule = 3; - entity.type = EntityType_TERMINAL; + entity.type = 13; entity.size = 0; entity.tile = 16 + meta1; entity.w = 16; entity.h = 16; - entity.colour = EntityColour_INACTIVE_ENTITY; + entity.colour = 4; entity.onentity = 1; entity.animate = 100; entity.para = meta2; break; case 21: //as above, except doesn't highlight entity.rule = 3; - entity.type = EntityType_TERMINAL; + entity.type = 13; entity.size = 0; entity.tile = 16 + meta1; entity.w = 16; entity.h = 16; - entity.colour = EntityColour_INACTIVE_ENTITY; + entity.colour = 4; entity.onentity = 0; entity.animate = 100; entity.para = meta2; break; case 22: //Fake trinkets, only appear if you've collected them entity.rule = 3; - entity.type = EntityType_TRINKET; + entity.type = 7; entity.size = 0; entity.tile = 22; entity.w = 16; entity.h = 16; - entity.colour = EntityColour_TRINKET; + entity.colour = 3; entity.onentity = 0; entity.animate = 100; @@ -1763,7 +1710,7 @@ void entityclass::createentity(int xp, int yp, int t, int meta1, int meta2, int case 23: //SWN Enemies //Given a different behavior, these enemies are especially for SWN mode and disappear outside the screen. entity.rule = 1; - entity.type = EntityType_GRAVITRON_ENEMY; + entity.type = 23; entity.behave = meta1; entity.para = meta2; entity.w = 16; @@ -1780,10 +1727,10 @@ void entityclass::createentity(int xp, int yp, int t, int meta1, int meta2, int //initilise tiles here based on behavior entity.size = 12; //don't wrap around - entity.colour = EntityColour_ENEMY_GRAVITRON; + entity.colour = 21; entity.tile = 78; //default case entity.animate = 1; - if (game.swngame == SWN_SUPERGRAVITRON) + if (game.swngame == 1) { //set colour based on current state entity.colour = swncolour(game.swncolstate); @@ -1792,7 +1739,7 @@ void entityclass::createentity(int xp, int yp, int t, int meta1, int meta2, int case 24: // Super Crew Member //This special crewmember is way more advanced than the usual kind, and can interact with game objects entity.rule = 6; - entity.type = EntityType_SUPERCREWMATE; //A special case! + entity.type = 14; //A special case! entity.colour = meta1; if (meta1 == 16) { @@ -1834,11 +1781,11 @@ void entityclass::createentity(int xp, int yp, int t, int meta1, int meta2, int break; case 25: //Trophies entity.rule = 3; - entity.type = EntityType_TROPHY; + entity.type = 15; entity.size = 0; entity.w = 16; entity.h = 16; - entity.colour = EntityColour_INACTIVE_ENTITY; + entity.colour = 4; entity.onentity = 1; entity.animate = 100; entity.para = meta2; @@ -1849,62 +1796,62 @@ void entityclass::createentity(int xp, int yp, int t, int meta1, int meta2, int switch (meta2) { case 1: - if (game.bestrank[TimeTrial_SPACESTATION1] >= 3) + if(game.bestrank[0]>=3) { entity.tile = 184 + meta1; - entity.colour = EntityColour_TROPHY_SPACE_STATION_1; + entity.colour = 31; } break; case 2: - if (game.bestrank[TimeTrial_LABORATORY] >= 3) + if(game.bestrank[1]>=3) { entity.tile = 186 + meta1; - entity.colour = EntityColour_TROPHY_LABORATORY; + entity.colour = 33; } break; case 3: - if (game.bestrank[TimeTrial_TOWER] >= 3) + if(game.bestrank[2]>=3) { entity.tile = 184 + meta1; - entity.colour = EntityColour_TROPHY_TOWER; + entity.colour = 35; } break; case 4: - if (game.bestrank[TimeTrial_SPACESTATION2] >= 3) + if(game.bestrank[3]>=3) { entity.tile = 184 + meta1; - entity.colour = EntityColour_TROPHY_SPACE_STATION_2; + entity.colour = 30; } break; case 5: - if (game.bestrank[TimeTrial_WARPZONE] >= 3) + if(game.bestrank[4]>=3) { entity.tile = 184 + meta1; - entity.colour = EntityColour_TROPHY_WARP_ZONE; + entity.colour = 34; } break; case 6: - if (game.bestrank[TimeTrial_FINALLEVEL] >= 3) + if(game.bestrank[5]>=3) { entity.tile = 184 + meta1; - entity.colour = EntityColour_TROPHY_FINAL_LEVEL; + entity.colour = 32; } break; case 7: - if (game.unlock[UnlockTrophy_GAME_COMPLETE]) + if(game.unlock[5]) { entity.tile = 188 + meta1; - entity.colour = EntityColour_TROPHY_GAME_COMPLETE; + entity.colour = 37; entity.h += 3; entity.yp -= 3; } break; case 8: - if (game.unlock[UnlockTrophy_FLIPMODE_COMPLETE]) + if(game.unlock[19]) { entity.tile = 188 + meta1; - entity.colour = EntityColour_TROPHY_GAME_COMPLETE; + entity.colour = 37; entity.h += 3; } break; @@ -1915,7 +1862,7 @@ void entityclass::createentity(int xp, int yp, int t, int meta1, int meta2, int if (game.bestgamedeaths <= 50) { entity.tile = 182 + meta1; - entity.colour = EntityColour_TROPHY_FLASHY; + entity.colour = 40; } } break; @@ -1925,7 +1872,7 @@ void entityclass::createentity(int xp, int yp, int t, int meta1, int meta2, int if (game.bestgamedeaths <= 100) { entity.tile = 182 + meta1; - entity.colour = EntityColour_TROPHY_GOLD; + entity.colour = 36; } } break; @@ -1935,7 +1882,7 @@ void entityclass::createentity(int xp, int yp, int t, int meta1, int meta2, int if (game.bestgamedeaths <= 250) { entity.tile = 182 + meta1; - entity.colour = EntityColour_TROPHY_SILVER; + entity.colour = 38; } } break; @@ -1945,7 +1892,7 @@ void entityclass::createentity(int xp, int yp, int t, int meta1, int meta2, int if (game.bestgamedeaths <= 500) { entity.tile = 182 + meta1; - entity.colour = EntityColour_TROPHY_BRONZE; + entity.colour = 39; } } break; @@ -1954,50 +1901,50 @@ void entityclass::createentity(int xp, int yp, int t, int meta1, int meta2, int if(game.swnbestrank>=1) { entity.tile = 182 + meta1; - entity.colour = EntityColour_TROPHY_BRONZE; + entity.colour = 39; } break; case 14: if(game.swnbestrank>=2) { entity.tile = 182 + meta1; - entity.colour = EntityColour_TROPHY_BRONZE; + entity.colour = 39; } break; case 15: if(game.swnbestrank>=3) { entity.tile = 182 + meta1; - entity.colour = EntityColour_TROPHY_BRONZE; + entity.colour = 39; } break; case 16: if(game.swnbestrank>=4) { entity.tile = 182 + meta1; - entity.colour = EntityColour_TROPHY_SILVER; + entity.colour = 38; } break; case 17: if(game.swnbestrank>=5) { entity.tile = 182 + meta1; - entity.colour = EntityColour_TROPHY_GOLD; + entity.colour = 36; } break; case 18: if(game.swnbestrank>=6) { entity.tile = 182 + meta1; - entity.colour = EntityColour_TROPHY_FLASHY; + entity.colour = 40; } break; case 19: - if (game.unlock[UnlockTrophy_NODEATHMODE_COMPLETE]) + if(game.unlock[20]) { entity.tile = 3; - entity.colour = EntityColour_TELEPORTER_FLASHING; + entity.colour = 102; entity.size = 13; entity.xp -= 64; entity.yp -= 128; @@ -2009,12 +1956,12 @@ void entityclass::createentity(int xp, int yp, int t, int meta1, int meta2, int break; case 26: //Epilogue super warp token entity.rule = 3; - entity.type = EntityType_WARP_TOKEN; + entity.type = 11; entity.size = 0; entity.tile = 18; entity.w = 16; entity.h = 16; - entity.colour = EntityColour_TRINKET; + entity.colour = 3; entity.onentity = 0; entity.animate = 100; entity.para = meta2; @@ -2026,23 +1973,7 @@ void entityclass::createentity(int xp, int yp, int t, int meta1, int meta2, int case 52: /* Vertical */ case 53: /* Horizontal */ case 54: /* Horizontal */ - if (t == 51) - { - entity.type = EntityType_WARP_LINE_LEFT; - } - else if (t == 52) - { - entity.type = EntityType_WARP_LINE_RIGHT; - } - else if (t == 53) - { - entity.type = EntityType_WARP_LINE_TOP; - } - else - { - entity.type = EntityType_WARP_LINE_BOTTOM; - } - + entity.type = t; entity.onentity = 1; entity.invis = true; entity.life = 0; @@ -2074,14 +2005,14 @@ void entityclass::createentity(int xp, int yp, int t, int meta1, int meta2, int //1 - position in array //2 - colour entity.rule = 3; - entity.type = EntityType_COLLECTABLE_CREWMATE; + entity.type = 55; if(INBOUNDS_ARR(meta2, customcrewmoods) && customcrewmoods[meta2]==1){ entity.tile = 144; }else{ entity.tile = 0; } - entity.colour = graphics.crewcolour(meta2); + entity.colour = crewcolour(meta2); entity.cx = 6; entity.cy = 2; entity.w = 12; @@ -2100,7 +2031,7 @@ void entityclass::createentity(int xp, int yp, int t, int meta1, int meta2, int break; case 56: //Custom enemy entity.rule = 1; - entity.type = EntityType_MOVING; + entity.type = 1; entity.behave = meta1; entity.para = meta2; entity.w = 16; @@ -2137,48 +2068,45 @@ void entityclass::createentity(int xp, int yp, int t, int meta1, int meta2, int //RED case 3: case 7: case 12: case 23: case 28: case 34: case 42: case 48: case 58: - entity.colour = EntityColour_ENEMY_RED; break; + entity.colour = 6; break; //GREEN case 5: case 9: case 22: case 25: case 29: case 31: case 38: case 46: case 52: case 53: - entity.colour = EntityColour_ENEMY_GREEN; break; + entity.colour = 7; break; //BLUE case 1: case 6: case 14: case 27: case 33: case 44: case 50: case 57: - entity.colour = EntityColour_ENEMY_BLUE; break; + entity.colour = 12; break; //YELLOW case 4: case 17: case 24: case 30: case 37: case 45: case 51: case 55: - entity.colour = EntityColour_ENEMY_YELLOW; break; + entity.colour = 9; break; //PURPLE case 2: case 11: case 15: case 19: case 32: case 36: case 49: - entity.colour = EntityColour_CREW_PURPLE; break; + entity.colour = 20; break; //CYAN case 8: case 10: case 13: case 18: case 26: case 35: case 41: case 47: case 54: - entity.colour = EntityColour_ENEMY_CYAN; break; + entity.colour = 11; break; //PINK case 16: case 20: case 39: case 43: case 56: - entity.colour = EntityColour_ENEMY_PINK; break; + entity.colour = 8; break; //ORANGE case 21: case 40: - entity.colour = EntityColour_ENEMY_ORANGE; break; + entity.colour = 17; break; default: - entity.colour = EntityColour_ENEMY_RED; + entity.colour = 6; break; } } if(custom_gray){ - entity.colour = EntityColour_ENEMY_GRAY; + entity.colour = 18; } entityclonefix(&entity); break; - case 100: // Invalid enemy, but gets treated as a teleporter - entity.type = EntityType_TELEPORTER; - break; } entity.lerpoldxp = entity.xp; @@ -2194,7 +2122,7 @@ void entityclass::createentity(int xp, int yp, int t, int meta1, int meta2, int * This is a bit kludge-y but it's better than copy-pasting * and is okay to do because entity 12 does not change state on its own */ - if (entity.type == EntityType_CREWMATE) + if (entity.type == 12) { size_t indice; if (reuse) @@ -2239,7 +2167,7 @@ bool entityclass::updateentities( int i ) { if (!INBOUNDS_VEC(i, entities)) { - vlog_error("updateentities() out-of-bounds!"); + puts("updateentities() out-of-bounds!"); return true; } @@ -2247,9 +2175,9 @@ bool entityclass::updateentities( int i ) { switch(entities[i].type) { - case EntityType_PLAYER: //Player + case 0: //Player break; - case EntityType_MOVING: //Movement behaviors + case 1: //Movement behaviors //Enemies can have a number of different behaviors: switch(entities[i].behave) { @@ -2479,7 +2407,7 @@ bool entityclass::updateentities( int i ) { for (size_t j = 0; j < entities.size(); j++) { - if (entities[j].type == EntityType_DISAPPEARING_PLATFORM && entities[j].state== 3 && entities[j].xp == (entities[i].xp-32) ) + if (entities[j].type == 2 && entities[j].state== 3 && entities[j].xp == (entities[i].xp-32) ) { entities[i].state = 3; bool entitygone = updateentities(i); @@ -2509,7 +2437,7 @@ bool entityclass::updateentities( int i ) { for (size_t j = 0; j < entities.size(); j++) { - if (entities[j].type == EntityType_DISAPPEARING_PLATFORM && entities[j].state==3 && entities[j].xp==entities[i].xp+32) + if (entities[j].type == 2 && entities[j].state==3 && entities[j].xp==entities[i].xp+32) { entities[i].state = 3; bool entitygone = updateentities(i); @@ -2607,7 +2535,7 @@ bool entityclass::updateentities( int i ) break; } break; - case EntityType_DISAPPEARING_PLATFORM: //Disappearing platforms + case 2: //Disappearing platforms //wait for collision if (entities[i].state == 1) { @@ -2615,7 +2543,7 @@ bool entityclass::updateentities( int i ) entities[i].state = 2; entities[i].onentity = 0; - music.playef(Sound_DISAPPEAR); + music.playef(7); } else if (entities[i].state == 2) { @@ -2654,14 +2582,14 @@ bool entityclass::updateentities( int i ) } } break; - case EntityType_QUICKSAND: //Breakable blocks + case 3: //Breakable blocks //Only counts if vy of player entity is non zero if (entities[i].state == 1) { entities[i].life = 4; entities[i].state = 2; entities[i].onentity = 0; - music.playef(Sound_CRUMBLE); + music.playef(6); } else if (entities[i].state == 2) { @@ -2674,7 +2602,7 @@ bool entityclass::updateentities( int i ) } } break; - case EntityType_GRAVITY_TOKEN: //Gravity token + case 4: //Gravity token //wait for collision if (entities[i].state == 1) { @@ -2684,7 +2612,7 @@ bool entityclass::updateentities( int i ) } break; - case EntityType_PARTICLE: //Particle sprays + case 5: //Particle sprays if (entities[i].state == 0) { entities[i].life--; @@ -2694,11 +2622,11 @@ bool entityclass::updateentities( int i ) } } break; - case EntityType_COIN: //Small pickup + case 6: //Small pickup //wait for collision if (entities[i].state == 1) { - music.playef(Sound_COIN); + music.playef(4); if (INBOUNDS_ARR(entities[i].para, collect)) { collect[(int) entities[i].para] = true; @@ -2707,7 +2635,7 @@ bool entityclass::updateentities( int i ) return disableentity(i); } break; - case EntityType_TRINKET: //Found a trinket + case 7: //Found a trinket //wait for collision if (entities[i].state == 1) { @@ -2718,13 +2646,13 @@ bool entityclass::updateentities( int i ) if (game.intimetrial) { - music.playef(Sound_NEWRECORD); + music.playef(25); } else { - game.setstate(1000); + game.state = 1000; if(music.currentsong!=-1) music.silencedasmusik(); - music.playef(Sound_TRINKET); + music.playef(3); if (game.trinkets() > game.stat_trinkets && !map.custommode) { game.stat_trinkets = game.trinkets(); @@ -2735,23 +2663,23 @@ bool entityclass::updateentities( int i ) return disableentity(i); } break; - case EntityType_CHECKPOINT: //Savepoints + case 8: //Savepoints //wait for collision if (entities[i].state == 1) { //First, deactivate all other savepoints for (size_t j = 0; j < entities.size(); j++) { - if (entities[j].type == EntityType_CHECKPOINT) + if (entities[j].type == 8) { - entities[j].colour = EntityColour_INACTIVE_ENTITY; + entities[j].colour = 4; entities[j].onentity = 1; } } - entities[i].colour = EntityColour_ACTIVE_ENTITY; + entities[i].colour = 5; entities[i].onentity = 0; game.savepoint = entities[i].para; - music.playef(Sound_CHECKPOINT); + music.playef(5); game.savex = entities[i].xp - 4; @@ -2774,11 +2702,9 @@ bool entityclass::updateentities( int i ) game.savedir = entities[player].dir; } entities[i].state = 0; - - game.checkpoint_save(); } break; - case EntityType_HORIZONTAL_GRAVITY_LINE: //Gravity Lines + case 9: //Gravity Lines if (entities[i].state == 1) { entities[i].life--; @@ -2791,14 +2717,14 @@ bool entityclass::updateentities( int i ) } } break; - case EntityType_VERTICAL_GRAVITY_LINE: //Vertical gravity Lines + case 10: //Vertical gravity Lines if (entities[i].state == 1) { entities[i].onentity = 3; entities[i].state = 2; - music.playef(Sound_GRAVITYLINE); + music.playef(8); game.gravitycontrol = (game.gravitycontrol + 1) % 2; game.totalflips++; int temp = getplayer(); @@ -2833,14 +2759,14 @@ bool entityclass::updateentities( int i ) entities[i].state = 2; } break; - case EntityType_WARP_TOKEN: //Warp point + case 11: //Warp point //wait for collision if (entities[i].state == 1) { //Depending on the room the warp point is in, teleport to a new location! entities[i].onentity = 0; //play a sound or somefink - music.playef(Sound_TELEPORT); + music.playef(10); game.teleport = true; game.edteleportent = i; @@ -2851,14 +2777,14 @@ bool entityclass::updateentities( int i ) if (int(entities[i].xp) == 21*8) game.teleportxpos = 4; } break; - case EntityType_CREWMATE: //Crew member + case 12: //Crew member //Somewhat complex AI: exactly what they do depends on room, location, state etc //At state 0, do nothing at all. if (entities[i].state == 1) { //happy! - if (INBOUNDS_VEC(k, entities) && entities[k].rule == 6) entities[k].tile = 0; - if (INBOUNDS_VEC(k, entities) && entities[k].rule == 7) entities[k].tile = 6; + if (INBOUNDS_VEC(k, entities) && entities[k].rule == 6) entities[k].tile = 0; + if (INBOUNDS_VEC(k, entities) && entities[k].rule == 7) entities[k].tile = 6; //Stay close to the hero! int j = getplayer(); if (INBOUNDS_VEC(j, entities) && entities[j].xp > entities[i].xp + 5) @@ -2936,7 +2862,7 @@ bool entityclass::updateentities( int i ) else if (entities[i].state == 11) { //11-15 means to follow a specific character, in crew order (cyan, purple, yellow, red, green, blue) - int j=getcrewman(EntityColour_CREW_PURPLE); + int j=getcrewman(1); //purple if (INBOUNDS_VEC(j, entities)) { if (entities[j].xp > entities[i].xp + 5) @@ -2961,7 +2887,7 @@ bool entityclass::updateentities( int i ) else if (entities[i].state == 12) { //11-15 means to follow a specific character, in crew order (cyan, purple, yellow, red, green, blue) - int j=getcrewman(EntityColour_CREW_YELLOW); + int j=getcrewman(2); //yellow if (INBOUNDS_VEC(j, entities)) { if (entities[j].xp > entities[i].xp + 5) @@ -2986,7 +2912,7 @@ bool entityclass::updateentities( int i ) else if (entities[i].state == 13) { //11-15 means to follow a specific character, in crew order (cyan, purple, yellow, red, green, blue) - int j=getcrewman(EntityColour_CREW_RED); + int j=getcrewman(3); //red if (INBOUNDS_VEC(j, entities)) { if (entities[j].xp > entities[i].xp + 5) @@ -3011,7 +2937,7 @@ bool entityclass::updateentities( int i ) else if (entities[i].state == 14) { //11-15 means to follow a specific character, in crew order (cyan, purple, yellow, red, green, blue) - int j=getcrewman(EntityColour_CREW_GREEN); + int j=getcrewman(4); //green if (INBOUNDS_VEC(j, entities)) { if (entities[j].xp > entities[i].xp + 5) @@ -3036,7 +2962,7 @@ bool entityclass::updateentities( int i ) else if (entities[i].state == 15) { //11-15 means to follow a specific character, in crew order (cyan, purple, yellow, red, green, blue) - int j=getcrewman(EntityColour_CREW_BLUE); + int j=getcrewman(5); //blue if (INBOUNDS_VEC(j, entities)) { if (entities[j].xp > entities[i].xp + 5) @@ -3139,7 +3065,7 @@ bool entityclass::updateentities( int i ) entities[i].para = 30; } } - else if (entities[i].life == 1) + else if (entities[i].life == 1) { //Stand around for a bit entities[i].para--; @@ -3175,7 +3101,7 @@ bool entityclass::updateentities( int i ) entities[i].para = 30; } } - else if (entities[i].life == 3) + else if (entities[i].life == 3) { //Stand around for a bit entities[i].para--; @@ -3186,18 +3112,18 @@ bool entityclass::updateentities( int i ) } } break; - case EntityType_TERMINAL: //Terminals (very similar to savepoints) + case 13: //Terminals (very similar to savepoints) //wait for collision if (entities[i].state == 1) { - entities[i].colour = EntityColour_ACTIVE_ENTITY; + entities[i].colour = 5; entities[i].onentity = 0; - music.playef(Sound_TERMINALTOUCH); + music.playef(17); entities[i].state = 0; } break; - case EntityType_SUPERCREWMATE: //Super Crew member + case 14: //Super Crew member //Actually needs less complex AI than the scripting crewmember if (entities[i].state == 0) { @@ -3253,7 +3179,7 @@ bool entityclass::updateentities( int i ) } } break; - case EntityType_TROPHY: //Trophy + case 15: //Trophy //wait for collision if (entities[i].state == 1) { @@ -3264,7 +3190,7 @@ bool entityclass::updateentities( int i ) entities[i].state = 0; } break; - case EntityType_GRAVITRON_ENEMY: + case 23: //swn game! switch(entities[i].behave) { @@ -3291,7 +3217,7 @@ bool entityclass::updateentities( int i ) } break; - case EntityType_WARP_LINE_LEFT: //Vertical warp line + case 51: //Vertical warp line if (entities[i].state == 2){ int j=getplayer(); if(INBOUNDS_VEC(j, entities) && entities[j].xp<=307){ @@ -3306,7 +3232,7 @@ bool entityclass::updateentities( int i ) customwarpmodevon=true; } break; - case EntityType_WARP_LINE_RIGHT: //Vertical warp line + case 52: //Vertical warp line if (entities[i].state == 2){ int j=getplayer(); if(INBOUNDS_VEC(j, entities) && entities[j].xp<=307){ @@ -3321,7 +3247,7 @@ bool entityclass::updateentities( int i ) customwarpmodevon=true; } break; - case EntityType_WARP_LINE_TOP: //Warp lines Horizonal + case 53: //Warp lines Horizonal if (entities[i].state == 2){ customwarpmodehon=false; entities[i].state = 0; @@ -3333,7 +3259,7 @@ bool entityclass::updateentities( int i ) customwarpmodehon=true; } break; - case EntityType_WARP_LINE_BOTTOM: //Warp lines Horizonal + case 54: //Warp lines Horizonal if (entities[i].state == 2){ customwarpmodehon=false; entities[i].state = 0; @@ -3345,7 +3271,7 @@ bool entityclass::updateentities( int i ) customwarpmodehon=true; } break; - case EntityType_COLLECTABLE_CREWMATE: //Collectable crewmate + case 55: //Collectable crewmate //wait for collision if (entities[i].state == 0) { @@ -3369,32 +3295,32 @@ bool entityclass::updateentities( int i ) if (game.intimetrial) { - music.playef(Sound_RESCUE); + music.playef(27); } else { - game.setstate(1010); + game.state = 1010; //music.haltdasmusik(); if(music.currentsong!=-1) music.silencedasmusik(); - music.playef(Sound_RESCUE); + music.playef(27); } return disableentity(i); } break; - case EntityType_TELEPORTER: //The teleporter + case 100: //The teleporter if (entities[i].state == 1) { //if inactive, activate! if (entities[i].tile == 1) { - music.playef(Sound_GAMESAVED); + music.playef(18); entities[i].tile = 2; - entities[i].colour = EntityColour_TELEPORTER_ACTIVE; + entities[i].colour = 101; if(!game.intimetrial && !game.nodeathmode) { - game.setstate(2000); - game.setstatedelay(0); + game.state = 2000; + game.statedelay = 0; } game.activetele = true; @@ -3408,9 +3334,9 @@ bool entityclass::updateentities( int i ) //First, deactivate all other savepoints for (size_t j = 0; j < entities.size(); j++) { - if (entities[j].type == EntityType_CHECKPOINT) + if (entities[j].type == 8) { - entities[j].colour = EntityColour_INACTIVE_ENTITY; + entities[j].colour = 4; entities[j].onentity = 1; } } @@ -3436,7 +3362,7 @@ bool entityclass::updateentities( int i ) //Initilise the teleporter without changing the game state or playing sound entities[i].onentity = 0; entities[i].tile = 6; - entities[i].colour = EntityColour_TELEPORTER_FLASHING; + entities[i].colour = 102; game.activetele = true; game.teleblock.x = entities[i].xp - 32; @@ -3447,8 +3373,6 @@ bool entityclass::updateentities( int i ) entities[i].state = 0; } break; - case EntityType_INVALID: // Invalid entity, do nothing! - break; } } else @@ -3467,7 +3391,7 @@ void entityclass::animateentities( int _i ) { if (!INBOUNDS_VEC(_i, entities)) { - vlog_error("animateentities() out-of-bounds!"); + puts("animateentities() out-of-bounds!"); return; } @@ -3475,7 +3399,7 @@ void entityclass::animateentities( int _i ) { switch(entities[_i].type) { - case EntityType_PLAYER: + case 0: entities[_i].framedelay--; if(entities[_i].dir==1) { @@ -3524,8 +3448,8 @@ void entityclass::animateentities( int _i ) if (game.gravitycontrol == 1) entities[_i].drawframe += 2; } break; - case EntityType_MOVING: - case EntityType_GRAVITRON_ENEMY: + case 1: + case 23: //Variable animation switch(entities[_i].animate) { @@ -3713,10 +3637,10 @@ void entityclass::animateentities( int _i ) break; } break; - case EntityType_DISAPPEARING_PLATFORM: //Disappearing platforms + case 2: //Disappearing platforms entities[_i].drawframe = entities[_i].tile + entities[_i].walkingframe; break; - case EntityType_WARP_TOKEN: + case 11: entities[_i].drawframe = entities[_i].tile; if(entities[_i].animate==2) { @@ -3736,9 +3660,9 @@ void entityclass::animateentities( int _i ) entities[_i].drawframe += entities[_i].walkingframe; } break; - case EntityType_CREWMATE: - case EntityType_COLLECTABLE_CREWMATE: - case EntityType_SUPERCREWMATE: //Crew member! Very similar to hero + case 12: + case 55: + case 14: //Crew member! Very similar to hero entities[_i].framedelay--; if(entities[_i].dir==1) { @@ -3769,7 +3693,7 @@ void entityclass::animateentities( int _i ) { entities[_i].drawframe ++; //if (game.gravitycontrol == 1) { - // entities[_i].drawframe += 6; + // entities[_i].drawframe += 6; //} } @@ -3781,8 +3705,8 @@ void entityclass::animateentities( int _i ) //if (game.gravitycontrol == 1) entities[_i].drawframe += 2; } break; - case EntityType_TELEPORTER: //the teleporter! - if (entities[_i].tile == 1 || game.noflashingmode) + case 100: //the teleporter! + if (entities[_i].tile == 1) { //it's inactive entities[_i].drawframe = entities[_i].tile; @@ -3792,10 +3716,10 @@ void entityclass::animateentities( int _i ) entities[_i].drawframe = entities[_i].tile; entities[_i].framedelay--; - if (entities[_i].framedelay <= 0) + if(entities[_i].framedelay<=0) { entities[_i].framedelay = 1; - entities[_i].walkingframe = (int) (fRandom() * 6); + entities[_i].walkingframe = int(fRandom() * 6); if (entities[_i].walkingframe >= 4) { entities[_i].walkingframe = -1; @@ -3812,10 +3736,10 @@ void entityclass::animateentities( int _i ) entities[_i].drawframe = entities[_i].tile; entities[_i].framedelay--; - if (entities[_i].framedelay <= 0) + if(entities[_i].framedelay<=0) { entities[_i].framedelay = 2; - entities[_i].walkingframe = (int) (fRandom() * 6); + entities[_i].walkingframe = int(fRandom() * 6); if (entities[_i].walkingframe >= 4) { entities[_i].walkingframe = -5; @@ -3852,7 +3776,7 @@ void entityclass::animatehumanoidcollision(const int i) if (!INBOUNDS_VEC(i, entities)) { - vlog_error("animatehumanoidcollision() out-of-bounds!"); + puts("animatehumanoidcollision() out-of-bounds!"); return; } @@ -3907,7 +3831,7 @@ void entityclass::animatehumanoidcollision(const int i) { ++entity->collisiondrawframe; - if (entity->type == EntityType_PLAYER && game.gravitycontrol == 1) + if (entity->type == 0 && game.gravitycontrol == 1) { entity->collisiondrawframe += 6; } @@ -3923,8 +3847,8 @@ void entityclass::animatehumanoidcollision(const int i) entity->collisiondrawframe = 12; } - if ((entity->type == EntityType_PLAYER && game.gravitycontrol == 1) - || (entity->type != EntityType_PLAYER && entity->rule == 7)) + if ((entity->type == 0 && game.gravitycontrol == 1) + || (entity->type != 0 && entity->rule == 7)) { entity->collisiondrawframe += 2; } @@ -3954,7 +3878,7 @@ int entityclass::getplayer(void) //Returns the index of the first player entity for (size_t i = 0; i < entities.size(); i++) { - if (entities[i].type == EntityType_PLAYER) + if(entities[i].type==0) { return i; } @@ -3968,7 +3892,7 @@ int entityclass::getscm(void) //Returns the supercrewmate for (size_t i = 0; i < entities.size(); i++) { - if (entities[i].type == EntityType_SUPERCREWMATE) + if(entities[i].type==14) { return i; } @@ -3994,39 +3918,46 @@ int entityclass::getlineat( int t ) return 0; } -int entityclass::getcrewman(int t) +int entityclass::getcrewman( int t ) { - // Returns the index of the crewman with colour index given by t. - // Note: this takes an int, not an EntityColour, as invalid colours are allowed in scripting + //Returns the index of the crewman with colour index given by t + if (t == 0) t = 0; + if (t == 1) t = 20; + if (t == 2) t = 14; + if (t == 3) t = 15; + if (t == 4) t = 13; + if (t == 5) t = 16; for (size_t i = 0; i < entities.size(); i++) { - if ((entities[i].type == EntityType_CREWMATE || entities[i].type == EntityType_SUPERCREWMATE) - && (entities[i].rule == 6 || entities[i].rule == 7)) + if ((entities[i].type == 12 || entities[i].type == 14) + && (entities[i].rule == 6 || entities[i].rule == 7)) { - if (entities[i].colour == t) + if(entities[i].colour==t) { return i; } } } - // Return entity 0 as a fallback - // Unfortunately some levels rely on this, where targeting a non-existent crewman returns the first entity... - // Which, most of the time, is the player. - return 0; } -int entityclass::getcustomcrewman(int t) +int entityclass::getcustomcrewman( int t ) { - // like getcrewman, this returns the index of the CUSTOM crewman with colour index given by t + //Returns the index of the crewman with colour index given by t + if (t == 0) t = 0; + if (t == 1) t = 20; + if (t == 2) t = 14; + if (t == 3) t = 15; + if (t == 4) t = 13; + if (t == 5) t = 16; for (size_t i = 0; i < entities.size(); i++) { - if (entities[i].type == EntityType_COLLECTABLE_CREWMATE) + if (entities[i].type == 55) { - if (entities[i].colour == t) + if(entities[i].colour==t) { return i; } @@ -4040,7 +3971,7 @@ int entityclass::getteleporter(void) { for (size_t i = 0; i < entities.size(); i++) { - if (entities[i].type == EntityType_TELEPORTER) + if(entities[i].type==100) { return i; } @@ -4053,7 +3984,7 @@ bool entityclass::entitycollide( int a, int b ) { if (!INBOUNDS_VEC(a, entities) || !INBOUNDS_VEC(b, entities)) { - vlog_error("entitycollide() out-of-bounds!"); + puts("entitycollide() out-of-bounds!"); return false; } @@ -4079,7 +4010,7 @@ bool entityclass::checkdamage(bool scm /*= false*/) //Returns true if player (or supercrewmate) collides with a damagepoint for(size_t i=0; i < entities.size(); i++) { - if((scm && entities[i].type == EntityType_SUPERCREWMATE) || (!scm && entities[i].rule == 0)) + if((scm && entities[i].type == 14) || (!scm && entities[i].rule == 0)) { SDL_Rect temprect; temprect.x = entities[i].xp + entities[i].cx; @@ -4152,6 +4083,12 @@ int entityclass::checkactivity(void) return -1; } +int entityclass::getgridpoint( int t ) +{ + t = (t - (t % 8)) / 8; + return t; +} + bool entityclass::checkplatform(const SDL_Rect& temprect, int* px, int* py) { //Return true if rectset intersects a moving platform, setups px & py to the platform x & y @@ -4167,7 +4104,7 @@ bool entityclass::checkplatform(const SDL_Rect& temprect, int* px, int* py) return false; } -bool entityclass::checkblocks(const SDL_Rect& temprect, const float dx, const float dy, const int dr, const bool skipdirblocks) +bool entityclass::checkblocks(const SDL_Rect& temprect, const float dx, const float dy, const float dr, const bool skipdirblocks) { for (size_t i = 0; i < blocks.size(); i++) { @@ -4190,7 +4127,7 @@ bool entityclass::checkblocks(const SDL_Rect& temprect, const float dx, const fl return false; } -bool entityclass::checkwall(const bool invincible, const SDL_Rect& temprect, const float dx, const float dy, const int dr, const bool skipblocks, const bool skipdirblocks) +bool entityclass::checkwall(const SDL_Rect& temprect, const float dx, const float dy, const float dr, const bool skipblocks, const bool skipdirblocks) { //Returns true if entity setup in temprect collides with a wall if(skipblocks) @@ -4202,41 +4139,41 @@ bool entityclass::checkwall(const bool invincible, const SDL_Rect& temprect, con int tempy = getgridpoint(temprect.y); int tempw = getgridpoint(temprect.x + temprect.w - 1); int temph = getgridpoint(temprect.y + temprect.h - 1); - if (map.collide(tempx, tempy, invincible)) return true; - if (map.collide(tempw, tempy, invincible)) return true; - if (map.collide(tempx, temph, invincible)) return true; - if (map.collide(tempw, temph, invincible)) return true; + if (map.collide(tempx, tempy)) return true; + if (map.collide(tempw, tempy)) return true; + if (map.collide(tempx, temph)) return true; + if (map.collide(tempw, temph)) return true; if (temprect.h >= 12) { int tpy1 = getgridpoint(temprect.y + 6); - if (map.collide(tempx, tpy1, invincible)) return true; - if (map.collide(tempw, tpy1, invincible)) return true; + if (map.collide(tempx, tpy1)) return true; + if (map.collide(tempw, tpy1)) return true; if (temprect.h >= 18) { tpy1 = getgridpoint(temprect.y + 12); - if (map.collide(tempx, tpy1, invincible)) return true; - if (map.collide(tempw, tpy1, invincible)) return true; + if (map.collide(tempx, tpy1)) return true; + if (map.collide(tempw, tpy1)) return true; if (temprect.h >= 24) { tpy1 = getgridpoint(temprect.y + 18); - if (map.collide(tempx, tpy1, invincible)) return true; - if (map.collide(tempw, tpy1, invincible)) return true; + if (map.collide(tempx, tpy1)) return true; + if (map.collide(tempw, tpy1)) return true; } } } if (temprect.w >= 12) { int tpx1 = getgridpoint(temprect.x + 6); - if (map.collide(tpx1, tempy, invincible)) return true; - if (map.collide(tpx1, temph, invincible)) return true; + if (map.collide(tpx1, tempy)) return true; + if (map.collide(tpx1, temph)) return true; } return false; } -bool entityclass::checkwall(const bool invincible, const SDL_Rect& temprect) +bool entityclass::checkwall(const SDL_Rect& temprect) { // Same as above but use default arguments for blocks - return checkwall(invincible, temprect, 0, 0, 0, true, false); + return checkwall(temprect, 0, 0, 0, true, false); } float entityclass::hplatformat(const int px, const int py) @@ -4264,7 +4201,7 @@ float entityclass::hplatformat(const int px, const int py) return -1000; } -static int yline( int a, int b ) +int entityclass::yline( int a, int b ) { if (a < b) return -1; return 1; @@ -4274,7 +4211,7 @@ bool entityclass::entityhlinecollide( int t, int l ) { if (!INBOUNDS_VEC(t, entities) || !INBOUNDS_VEC(l, entities)) { - vlog_error("entityhlinecollide() out-of-bounds!"); + puts("entityhlinecollide() out-of-bounds!"); return false; } @@ -4301,7 +4238,7 @@ bool entityclass::entityvlinecollide( int t, int l ) { if (!INBOUNDS_VEC(t, entities) || !INBOUNDS_VEC(l, entities)) { - vlog_error("entityvlinecollide() out-of-bounds!"); + puts("entityvlinecollide() out-of-bounds!"); return false; } @@ -4325,7 +4262,7 @@ bool entityclass::entityvlinecollide( int t, int l ) bool entityclass::entitywarphlinecollide(int t, int l) { if (!INBOUNDS_VEC(t, entities) || !INBOUNDS_VEC(l, entities)) { - vlog_error("entitywarphlinecollide() out-of-bounds!"); + puts("entitywarphlinecollide() out-of-bounds!"); return false; } @@ -4363,7 +4300,7 @@ bool entityclass::entitywarphlinecollide(int t, int l) { bool entityclass::entitywarpvlinecollide(int t, int l) { if (!INBOUNDS_VEC(t, entities) || !INBOUNDS_VEC(l, entities)) { - vlog_error("entitywarpvlinecollide() out-of-bounds!"); + puts("entitywarpvlinecollide() out-of-bounds!"); return false; } @@ -4398,7 +4335,7 @@ float entityclass::entitycollideplatformroof( int t ) { if (!INBOUNDS_VEC(t, entities)) { - vlog_error("entitycollideplatformroof() out-of-bounds!"); + puts("entitycollideplatformroof() out-of-bounds!"); return -1000; } @@ -4421,7 +4358,7 @@ float entityclass::entitycollideplatformfloor( int t ) { if (!INBOUNDS_VEC(t, entities)) { - vlog_error("entitycollideplatformfloor() out-of-bounds!"); + puts("entitycollideplatformfloor() out-of-bounds!"); return -1000; } @@ -4444,7 +4381,7 @@ bool entityclass::entitycollidefloor( int t ) { if (!INBOUNDS_VEC(t, entities)) { - vlog_error("entitycollidefloor() out-of-bounds!"); + puts("entitycollidefloor() out-of-bounds!"); return false; } @@ -4454,9 +4391,7 @@ bool entityclass::entitycollidefloor( int t ) temprect.w = entities[t].w; temprect.h = entities[t].h; - const bool invincible = map.invincibility && entities[t].ishumanoid(); - - if (checkwall(invincible, temprect)) return true; + if (checkwall(temprect)) return true; return false; } @@ -4464,7 +4399,7 @@ bool entityclass::entitycollideroof( int t ) { if (!INBOUNDS_VEC(t, entities)) { - vlog_error("entitycollideroof() out-of-bounds!"); + puts("entitycollideroof() out-of-bounds!"); return false; } @@ -4474,9 +4409,7 @@ bool entityclass::entitycollideroof( int t ) temprect.w = entities[t].w; temprect.h = entities[t].h; - const bool invincible = map.invincibility && entities[t].ishumanoid(); - - if (checkwall(invincible, temprect)) return true; + if (checkwall(temprect)) return true; return false; } @@ -4484,7 +4417,7 @@ bool entityclass::testwallsx( int t, int tx, int ty, const bool skipdirblocks ) { if (!INBOUNDS_VEC(t, entities)) { - vlog_error("testwallsx() out-of-bounds!"); + puts("testwallsx() out-of-bounds!"); return false; } @@ -4494,16 +4427,14 @@ bool entityclass::testwallsx( int t, int tx, int ty, const bool skipdirblocks ) temprect.w = entities[t].w; temprect.h = entities[t].h; - bool skipblocks = entities[t].rule < 2 || entities[t].type == EntityType_SUPERCREWMATE; + bool skipblocks = entities[t].rule < 2 || entities[t].type == 14; float dx = 0; float dy = 0; if (entities[t].rule == 0) dx = entities[t].vx; - int dr = entities[t].rule; - - const bool invincible = map.invincibility && entities[t].ishumanoid(); + float dr = entities[t].rule; //Ok, now we check walls - if (checkwall(invincible, temprect, dx, dy, dr, skipblocks, skipdirblocks)) + if (checkwall(temprect, dx, dy, dr, skipblocks, skipdirblocks)) { if (entities[t].vx > 1.0f) { @@ -4526,31 +4457,29 @@ bool entityclass::testwallsx( int t, int tx, int ty, const bool skipdirblocks ) return true; } -bool entityclass::testwallsy( int t, int tx, int ty ) +bool entityclass::testwallsy( int t, float tx, float ty ) { if (!INBOUNDS_VEC(t, entities)) { - vlog_error("testwallsy() out-of-bounds!"); + puts("testwallsy() out-of-bounds!"); return false; } SDL_Rect temprect; - temprect.x = tx + entities[t].cx; - temprect.y = ty + entities[t].cy; + temprect.x = static_cast(tx) + entities[t].cx; + temprect.y = static_cast(ty) + entities[t].cy; temprect.w = entities[t].w; temprect.h = entities[t].h; - bool skipblocks = entities[t].rule < 2 || entities[t].type == EntityType_SUPERCREWMATE; + bool skipblocks = entities[t].rule < 2 || entities[t].type == 14; float dx = 0; float dy = 0; if (entities[t].rule == 0) dy = entities[t].vy; - int dr = entities[t].rule; - - const bool invincible = map.invincibility && entities[t].ishumanoid(); + float dr = entities[t].rule; //Ok, now we check walls - if (checkwall(invincible, temprect, dx, dy, dr, skipblocks, false)) + if (checkwall(temprect, dx, dy, dr, skipblocks, false)) { if (entities[t].vy > 1) { @@ -4577,7 +4506,7 @@ void entityclass::applyfriction( int t, float xrate, float yrate ) { if (!INBOUNDS_VEC(t, entities)) { - vlog_error("applyfriction() out-of-bounds!"); + puts("applyfriction() out-of-bounds!"); return; } @@ -4598,7 +4527,7 @@ void entityclass::updateentitylogic( int t ) { if (!INBOUNDS_VEC(t, entities)) { - vlog_error("updateentitylogic() out-of-bounds!"); + puts("updateentitylogic() out-of-bounds!"); return; } @@ -4641,7 +4570,7 @@ void entityclass::entitymapcollision( int t ) { if (!INBOUNDS_VEC(t, entities)) { - vlog_error("entitymapcollision() out-of-bounds!"); + puts("entitymapcollision() out-of-bounds!"); return; } @@ -4669,7 +4598,7 @@ void entityclass::movingplatformfix( int t, int j ) { if (!INBOUNDS_VEC(t, entities) || !INBOUNDS_VEC(j, entities)) { - vlog_error("movingplatformfix() out-of-bounds!"); + puts("movingplatformfix() out-of-bounds!"); return; } @@ -4711,7 +4640,7 @@ void entityclass::movingplatformfix( int t, int j ) void entityclass::customwarplinecheck(int i) { if (!INBOUNDS_VEC(i, entities)) { - vlog_error("customwarplinecheck() out-of-bounds!"); + puts("customwarplinecheck() out-of-bounds!"); return; } @@ -4722,13 +4651,13 @@ void entityclass::customwarplinecheck(int i) { for (int j = 0; j < (int) entities.size(); j++) { if (i != j) { if (entities[i].rule == 0 && entities[j].rule == 5 //Player vs vertical line! - && (entities[j].type == EntityType_WARP_LINE_LEFT || entities[j].type == EntityType_WARP_LINE_RIGHT) + && (entities[j].type == 51 || entities[j].type == 52) && entitywarpvlinecollide(i, j)) { customwarpmodevon = true; } if (entities[i].rule == 0 && entities[j].rule == 7 //Player vs horizontal WARP line - && (entities[j].type == EntityType_WARP_LINE_TOP || entities[j].type == EntityType_WARP_LINE_BOTTOM) + && (entities[j].type == 53 || entities[j].type == 54) && entitywarphlinecollide(i, j)) { customwarpmodehon = true; } @@ -4741,7 +4670,7 @@ void entityclass::entitycollisioncheck(void) for (size_t i = 0; i < entities.size(); i++) { bool player = entities[i].rule == 0; - bool scm = game.supercrewmate && entities[i].type == EntityType_SUPERCREWMATE; + bool scm = game.supercrewmate && entities[i].type == 14; if (!player && !scm) { continue; @@ -4797,13 +4726,13 @@ void entityclass::entitycollisioncheck(void) game.startscript = true; game.newscript = blocks[block_idx].script; removetrigger(activetrigger); - game.setstate(0); + game.state = 0; } else { - game.setstate(activetrigger); + game.state = activetrigger; } - game.setstatedelay(0); + game.statedelay = 0; } } @@ -4811,7 +4740,7 @@ void entityclass::collisioncheck(int i, int j, bool scm /*= false*/) { if (!INBOUNDS_VEC(i, entities) || !INBOUNDS_VEC(j, entities)) { - vlog_error("collisioncheck() out-of-bounds!"); + puts("collisioncheck() out-of-bounds!"); return; } @@ -4829,16 +4758,15 @@ void entityclass::collisioncheck(int i, int j, bool scm /*= false*/) if (entities[i].size == 0 && (entities[j].size == 0 || entities[j].size == 12)) { //They're both sprites, so do a per pixel collision - SDL_Point colpoint1; + point colpoint1; colpoint1.x = entities[i].xp; colpoint1.y = entities[i].yp; - SDL_Point colpoint2; + point colpoint2; colpoint2.x = entities[j].xp; colpoint2.y = entities[j].yp; int drawframe1 = entities[i].collisiondrawframe; int drawframe2 = entities[j].drawframe; - - std::vector& spritesvec = graphics.flipmode ? graphics.flipsprites_surf : graphics.sprites_surf; + std::vector& spritesvec = graphics.flipmode ? graphics.flipsprites : graphics.sprites; if (INBOUNDS_VEC(drawframe1, spritesvec) && INBOUNDS_VEC(drawframe2, spritesvec) && graphics.Hitest(spritesvec[drawframe1], colpoint1, spritesvec[drawframe2], colpoint2)) @@ -4884,7 +4812,7 @@ void entityclass::collisioncheck(int i, int j, bool scm /*= false*/) { if (entityhlinecollide(i, j)) { - music.playef(Sound_GRAVITYLINE); + music.playef(8); game.gravitycontrol = (game.gravitycontrol + 1) % 2; game.totalflips++; if (game.gravitycontrol == 0) @@ -4946,7 +4874,7 @@ void entityclass::stuckprevention(int t) { if (!INBOUNDS_VEC(t, entities)) { - vlog_error("stuckprevention() out-of-bounds!"); + puts("stuckprevention() out-of-bounds!"); return; } diff --git a/desktop_version/src/Entity.h b/desktop_version/src/Entity.h index 25197a5e..309e02a0 100644 --- a/desktop_version/src/Entity.h +++ b/desktop_version/src/Entity.h @@ -5,10 +5,10 @@ #include #include -#include "BlockV.h" -#include "Ent.h" -#include "Game.h" #include "Maths.h" +#include "Ent.h" +#include "BlockV.h" +#include "Game.h" enum { @@ -44,7 +44,7 @@ public: createblock(DAMAGE, 312, -8, 16, 260); } - int swncolour(int t); + int swncolour(int t ); void swnenemiescol(int t); @@ -52,7 +52,7 @@ public: void generateswnwave(int t); - void createblock(int t, int xp, int yp, int w, int h, int trig = 0, const std::string& script = "", bool custom = false); + void createblock(int t, int xp, int yp, int w, int h, int trig = 0, const std::string& script = ""); bool disableentity(int t); @@ -66,9 +66,13 @@ public: void removetrigger(int t); - void copylinecross(std::vector& linecrosskludge, int t); + void copylinecross(int t); - void revertlinecross(std::vector& linecrosskludge, int t, int s); + void revertlinecross(int t, int s); + + bool gridmatch(int p1, int p2, int p3, int p4, int p11, int p21, int p31, int p41); + + int crewcolour(int t); void createentity(int xp, int yp, int t, int meta1, int meta2, int p1, int p2, int p3, int p4); @@ -84,7 +88,7 @@ public: void animateentities(int i); - void animatehumanoidcollision(int i); + void animatehumanoidcollision(const int i); int getcompanion(void); @@ -107,16 +111,20 @@ public: int checkactivity(void); + int getgridpoint(int t); + bool checkplatform(const SDL_Rect& temprect, int* px, int* py); - bool checkblocks(const SDL_Rect& temprect, float dx, float dy, int dr, bool skipdirblocks); + bool checkblocks(const SDL_Rect& temprect, const float dx, const float dy, const float dr, const bool skipdirblocks); bool checktowerspikes(int t); - bool checkwall(bool invincible, const SDL_Rect& temprect, float dx, float dy, int dr, bool skipblocks, bool skipdirblocks); - bool checkwall(bool invincible, const SDL_Rect& temprect); + bool checkwall(const SDL_Rect& temprect, const float dx, const float dy, const float dr, const bool skipblocks, const bool skipdirblocks); + bool checkwall(const SDL_Rect& temprect); - float hplatformat(int px, int py); + float hplatformat(const int px, const int py); + + int yline(int a, int b); bool entityhlinecollide(int t, int l); @@ -135,9 +143,9 @@ public: bool entitycollideroof(int t); - bool testwallsx(int t, int tx, int ty, bool skipdirblocks); + bool testwallsx(int t, int tx, int ty, const bool skipdirblocks); - bool testwallsy(int t, int tx, int ty); + bool testwallsy(int t, float tx, float ty); void applyfriction(int t, float xrate, float yrate); @@ -157,6 +165,8 @@ public: std::vector entities; + std::vector linecrosskludge; + int k; @@ -185,9 +195,6 @@ public: bool customwarpmode, customwarpmodevon, customwarpmodehon; std::string customscript; bool customcrewmoods[Game::numcrew]; - std::string customactivitycolour; - std::string customactivitytext; - int customactivitypositiony; }; #ifndef OBJ_DEFINITION diff --git a/desktop_version/src/Enums.h b/desktop_version/src/Enums.h index 088cc0cf..6f2e43b0 100644 --- a/desktop_version/src/Enums.h +++ b/desktop_version/src/Enums.h @@ -1,10 +1,10 @@ #ifndef ENUMGAME_H #define ENUMGAME_H -enum GameGamestate +enum { - GAMEMODE, TITLEMODE, MAPMODE, TELEPORTERMODE, GAMECOMPLETE, GAMECOMPLETE2, EDITORMODE, PRELOADER + GAMEMODE, TITLEMODE, CLICKTOSTART, FOCUSMODE, MAPMODE, TELEPORTERMODE, GAMECOMPLETE, GAMECOMPLETE2, EDITORMODE, PRELOADER }; diff --git a/desktop_version/src/Exit.h b/desktop_version/src/Exit.h index a80a3a0d..f3b9ff62 100644 --- a/desktop_version/src/Exit.h +++ b/desktop_version/src/Exit.h @@ -1,8 +1,6 @@ #ifndef VVV_EXIT_H #define VVV_EXIT_H -#include - -SDL_NORETURN void VVV_exit(const int exit_code); +void VVV_exit(const int exit_code); #endif /* VVV_EXIT_H */ diff --git a/desktop_version/src/FileSystemUtils.cpp b/desktop_version/src/FileSystemUtils.cpp index beb41917..833a3dea 100644 --- a/desktop_version/src/FileSystemUtils.cpp +++ b/desktop_version/src/FileSystemUtils.cpp @@ -1,1420 +1,1225 @@ -#include "FileSystemUtils.h" - +#include +#include #include #include #include #include +#include #include +#include -#include "Alloc.h" #include "BinaryBlob.h" -#include "Constants.h" #include "Exit.h" #include "Graphics.h" -#include "Localization.h" #include "Maths.h" -#include "Screen.h" #include "Unused.h" #include "UtilityClass.h" -#include "VFormat.h" -#include "Vlogging.h" /* These are needed for PLATFORM_* crap */ #if defined(_WIN32) -#define WIN32_LEAN_AND_MEAN #include #include -static int mkdir(char* path, int mode) +int mkdir(char* path, int mode) { - WCHAR utf16_path[MAX_PATH]; - MultiByteToWideChar(CP_UTF8, 0, path, -1, utf16_path, MAX_PATH); - return CreateDirectoryW(utf16_path, NULL); + WCHAR utf16_path[MAX_PATH]; + MultiByteToWideChar(CP_UTF8, 0, path, -1, utf16_path, MAX_PATH); + return CreateDirectoryW(utf16_path, NULL); } -#elif defined(__EMSCRIPTEN__) -#include -#include -#include -#define MAX_PATH PATH_MAX -#elif defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__HAIKU__) || defined(__DragonFly__) || defined(__unix__) +#define VNEEDS_MIGRATION (mkdirResult != 0) +#elif defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__HAIKU__) || defined(__DragonFly__) +#include +#include #include #include +#define VNEEDS_MIGRATION (mkdirResult == 0) #define MAX_PATH PATH_MAX #endif -static bool isInit = false; - -static const char* pathSep = NULL; -static char* basePath = NULL; -static char writeDir[MAX_PATH] = {'\0'}; static char saveDir[MAX_PATH] = {'\0'}; static char levelDir[MAX_PATH] = {'\0'}; -static char screenshotDir[MAX_PATH] = {'\0'}; -static char mainLangDir[MAX_PATH] = {'\0'}; -static bool isMainLangDirFromRepo = false; -static bool doesLangDirExist = false; -static bool doesFontsDirExist = false; static char assetDir[MAX_PATH] = {'\0'}; static char virtualMountPath[MAX_PATH] = {'\0'}; static int PLATFORM_getOSDirectory(char* output, const size_t output_size); +static void PLATFORM_migrateSaveData(char* output); +static void PLATFORM_copyFile(const char *oldLocation, const char *newLocation); static void* bridged_malloc(PHYSFS_uint64 size) { - return SDL_malloc(size); + return SDL_malloc(size); } static void* bridged_realloc(void* ptr, PHYSFS_uint64 size) { - return SDL_realloc(ptr, size); + return SDL_realloc(ptr, size); } static const PHYSFS_Allocator allocator = { - NULL, - NULL, - bridged_malloc, - bridged_realloc, - SDL_free + NULL, + NULL, + bridged_malloc, + bridged_realloc, + SDL_free }; -#ifndef __ANDROID__ -static bool mount_pre_datazip( - char* out_path, - const char* real_dirname, - const char* mount_point, - const char* user_path -) +int FILESYSTEM_init(char *argvZero, char* baseDir, char *assetsPath) { - /* Find and mount a directory (like the main language directory) in front of data.zip. - * This directory, if not user-supplied, can be either next to data.zip, - * or otherwise in desktop_version/ if that's found in the base path. - * - * out_path is assumed to be either NULL, or MAX_PATH long. If it isn't, boom */ + char output[MAX_PATH]; + int mkdirResult; + int retval; + const char* pathSep = PHYSFS_getDirSeparator(); + char* basePath; - if (user_path != NULL) - { - if (PHYSFS_mount(user_path, mount_point, 1)) - { - if (out_path != NULL) - { - SDL_strlcpy(out_path, user_path, MAX_PATH); - } - return true; - } + PHYSFS_setAllocator(&allocator); - vlog_warn("User-supplied %s directory is invalid!", real_dirname); - return false; - } + if (!PHYSFS_init(argvZero)) + { + printf( + "Unable to initialize PhysFS: %s\n", + PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode()) + ); + return 0; + } - /* Try to detect the directory, it's next to data.zip in distributed builds */ - bool dir_found = false; - char buffer[MAX_PATH]; + PHYSFS_permitSymbolicLinks(1); - SDL_snprintf(buffer, sizeof(buffer), "%s%s%s", - basePath, - real_dirname, - pathSep - ); - if (PHYSFS_mount(buffer, mount_point, 1)) - { - dir_found = true; - } - else - { - /* If you're a developer, you probably want to use the language files/fonts - * from the repo, otherwise it's a pain to keep everything in sync. - * And who knows how deep in build folders our binary is. */ - size_t buf_reserve = SDL_strlen(real_dirname)+1; - SDL_strlcpy(buffer, basePath, sizeof(buffer)-buf_reserve); + /* Determine the OS user directory */ + if (baseDir && baseDir[0] != '\0') + { + /* We later append to this path and assume it ends in a slash */ + bool trailing_pathsep = SDL_strcmp(baseDir + SDL_strlen(baseDir) - SDL_strlen(pathSep), pathSep) == 0; - char needle[32]; - SDL_snprintf(needle, sizeof(needle), "%sdesktop_version%s", - pathSep, - pathSep - ); + SDL_snprintf(output, sizeof(output), "%s%s", + baseDir, + !trailing_pathsep ? pathSep : "" + ); + } + else if (!PLATFORM_getOSDirectory(output, sizeof(output))) + { + return 0; + } - /* We want the last match */ - char* match_last = NULL; - char* match = buffer; - while ((match = SDL_strstr(match, needle))) - { - match_last = match; - match = &match[1]; - } + /* Mount our base user directory */ + if (!PHYSFS_mount(output, NULL, 0)) + { + printf( + "Could not mount %s: %s\n", + output, + PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode()) + ); + return 0; + } + if (!PHYSFS_setWriteDir(output)) + { + printf( + "Could not set write dir to %s: %s\n", + output, + PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode()) + ); + return 0; + } + printf("Base directory: %s\n", output); - if (match_last != NULL) - { - /* strstr only gives us a pointer and not a remaining buffer length, but that's - * why we pretended the buffer was `buf_reserve` chars shorter than it was! */ - SDL_strlcpy(&match_last[SDL_strlen(needle)], real_dirname, buf_reserve); - SDL_strlcat(buffer, pathSep, sizeof(buffer)); + /* Store full save directory */ + SDL_snprintf(saveDir, sizeof(saveDir), "%s%s%s", + output, + "saves", + pathSep + ); + mkdir(saveDir, 0777); /* FIXME: Why did I not | this? -flibit */ + printf("Save directory: %s\n", saveDir); - if (PHYSFS_mount(buffer, mount_point, 1)) - { - dir_found = true; + /* Store full level directory */ + SDL_snprintf(levelDir, sizeof(levelDir), "%s%s%s", + output, + "levels", + pathSep + ); + mkdirResult = mkdir(levelDir, 0777); + printf("Level directory: %s\n", levelDir); - if (SDL_strcmp(real_dirname, "lang") == 0) - { - loc::show_translator_menu = true; - isMainLangDirFromRepo = true; - } - } - } - } + /* We didn't exist until now, migrate files! */ + if (VNEEDS_MIGRATION) + { + PLATFORM_migrateSaveData(output); + } - if (dir_found) - { - if (out_path != NULL) - { - SDL_strlcpy(out_path, buffer, MAX_PATH); - } - } - else - { - vlog_warn("Cannot find the %s directory anywhere!", real_dirname); - } + basePath = SDL_GetBasePath(); - return dir_found; + if (basePath == NULL) + { + puts("Unable to determine base path, falling back to current directory"); + basePath = SDL_strdup("./"); + } + + /* Mount the stock content last */ + if (assetsPath) + { + SDL_strlcpy(output, assetsPath, sizeof(output)); + } + else + { + SDL_snprintf(output, sizeof(output), "%s%s", + basePath, + "data.zip" + ); + } + if (!PHYSFS_mount(output, NULL, 1)) + { + puts("Error: data.zip missing!"); + puts("You do not have data.zip!"); + puts("Grab it from your purchased copy of the game,"); + puts("or get it from the free Make and Play Edition."); + + SDL_ShowSimpleMessageBox( + SDL_MESSAGEBOX_ERROR, + "data.zip missing!", + "You do not have data.zip!" + "\n\nGrab it from your purchased copy of the game," + "\nor get it from the free Make and Play Edition.", + NULL + ); + retval = 0; + goto end; + } + + SDL_snprintf(output, sizeof(output), "%s%s", basePath, "gamecontrollerdb.txt"); + if (SDL_GameControllerAddMappingsFromFile(output) < 0) + { + printf("gamecontrollerdb.txt not found!\n"); + } + retval = 1; + +end: + SDL_free(basePath); + return retval; } -#endif - -int FILESYSTEM_init(char *argvZero, char* baseDir, char *assetsPath, char* langDir, char* fontsDir) -{ - char output[MAX_PATH]; - - pathSep = PHYSFS_getDirSeparator(); - - PHYSFS_setAllocator(&allocator); - - // Yes, this is actually how you're supposed to use PhysFS on Android. -#ifdef __ANDROID__ - PHYSFS_AndroidInit androidInit; - androidInit.jnienv = SDL_AndroidGetJNIEnv(); - androidInit.context = SDL_AndroidGetActivity(); - argvZero = (char*) &androidInit; -#endif - - if (!PHYSFS_init(argvZero)) - { - vlog_error( - "Unable to initialize PhysFS: %s", - PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode()) - ); - return 0; - } - - PHYSFS_permitSymbolicLinks(1); - - /* Determine the OS user directory */ - if (baseDir && baseDir[0] != '\0') - { - /* We later append to this path and assume it ends in a slash */ - bool trailing_pathsep = SDL_strcmp(baseDir + SDL_strlen(baseDir) - SDL_strlen(pathSep), pathSep) == 0; - - SDL_snprintf(output, sizeof(output), "%s%s", - baseDir, - !trailing_pathsep ? pathSep : "" - ); - } - else if (!PLATFORM_getOSDirectory(output, sizeof(output))) - { - return 0; - } - - /* Mount our base user directory */ - SDL_strlcpy(writeDir, output, sizeof(writeDir)); - if (!PHYSFS_mount(writeDir, NULL, 0)) - { - vlog_error( - "Could not mount %s: %s", - writeDir, - PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode()) - ); - return 0; - } - if (!PHYSFS_setWriteDir(writeDir)) - { - vlog_error( - "Could not set write dir to %s: %s", - writeDir, - PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode()) - ); - return 0; - } - vlog_info("Base directory: %s", writeDir); - - /* Store full save directory */ - SDL_snprintf(saveDir, sizeof(saveDir), "%s%s%s", - writeDir, - "saves", - pathSep - ); - mkdir(saveDir, 0777); - vlog_info("Save directory: %s", saveDir); - - /* Store full level directory */ - SDL_snprintf(levelDir, sizeof(levelDir), "%s%s%s", - writeDir, - "levels", - pathSep - ); - mkdir(levelDir, 0777); - vlog_info("Level directory: %s", levelDir); - - /* Store full screenshot directory */ - SDL_snprintf(screenshotDir, sizeof(screenshotDir), "%s%s%s", - writeDir, - "screenshots", - pathSep - ); - mkdir(screenshotDir, 0777); - vlog_info("Screenshot directory: %s", screenshotDir); - - /* We also need to make the subdirectories */ - { - char temp[MAX_PATH]; - SDL_snprintf(temp, sizeof(temp), "%s%s%s", - screenshotDir, "1x", pathSep - ); - mkdir(temp, 0777); - SDL_snprintf(temp, sizeof(temp), "%s%s%s", - screenshotDir, "2x", pathSep - ); - mkdir(temp, 0777); - } - - basePath = SDL_GetBasePath(); - - if (basePath == NULL) - { - vlog_warn("Unable to determine base path, falling back to current directory"); - basePath = SDL_strdup("./"); - } - -#ifdef __ANDROID__ - // This is kind of a mess, but that's not really solvable unless we expect the user to download the data.zip manually. - if (!PHYSFS_mount(PHYSFS_getBaseDir(), "/apk", 1)) - { - vlog_error("Failed to mount apk!"); - return 0; - } - - PHYSFS_File* repoZip = PHYSFS_openRead("/apk/assets/repo.zip"); - if (repoZip && PHYSFS_mountHandle(repoZip, "repo.zip", NULL, 1)) - { - doesLangDirExist = true; - doesFontsDirExist = true; - } - - PHYSFS_File* dataZip = PHYSFS_openRead("/apk/assets/data.zip"); - if (!dataZip || !PHYSFS_mountHandle(dataZip, "data.zip", NULL, 1)) -#else - doesLangDirExist = mount_pre_datazip(mainLangDir, "lang", "lang/", langDir); - vlog_info("Languages directory: %s", mainLangDir); - - doesFontsDirExist = mount_pre_datazip(NULL, "fonts", "graphics/", fontsDir); - - /* Mount the stock content last */ - if (assetsPath) - { - SDL_strlcpy(output, assetsPath, sizeof(output)); - } - else - { - SDL_snprintf(output, sizeof(output), "%s%s", - basePath, - "data.zip" - ); - } - if (!PHYSFS_mount(output, NULL, 1)) -#endif - { - vlog_error("Error: data.zip missing!"); - vlog_error("You do not have data.zip!"); - vlog_error("Grab it from your purchased copy of the game,"); - vlog_error("or get it from the free Make and Play Edition."); - - SDL_ShowSimpleMessageBox( - SDL_MESSAGEBOX_ERROR, - "data.zip missing!", - "You do not have data.zip!" - "\n\nGrab it from your purchased copy of the game," - "\nor get it from the free Make and Play Edition.", - NULL - ); - VVV_exit(1); - return 0; - } - - SDL_snprintf(output, sizeof(output), "%s%s", basePath, "gamecontrollerdb.txt"); - if (SDL_GameControllerAddMappingsFromFile(output) < 0) - { - vlog_info("gamecontrollerdb.txt not found!"); - } - - isInit = true; - return 1; -} - -bool FILESYSTEM_isInit(void) -{ - return isInit; -} - -static unsigned char* stdin_buffer = NULL; -static size_t stdin_length = 0; void FILESYSTEM_deinit(void) { - if (PHYSFS_isInit()) - { - PHYSFS_deinit(); - } - VVV_free(stdin_buffer); - VVV_free(basePath); - isInit = false; + if (PHYSFS_isInit()) + { + PHYSFS_deinit(); + } } char *FILESYSTEM_getUserSaveDirectory(void) { - return saveDir; + return saveDir; } char *FILESYSTEM_getUserLevelDirectory(void) { - return levelDir; -} - -char *FILESYSTEM_getUserMainLangDirectory(void) -{ - return mainLangDir; -} - -bool FILESYSTEM_isMainLangDirFromRepo(void) -{ - return isMainLangDirFromRepo; -} - -bool FILESYSTEM_doesLangDirExist(void) -{ - return doesLangDirExist; -} - -bool FILESYSTEM_doesFontsDirExist(void) -{ - return doesFontsDirExist; -} - -bool FILESYSTEM_restoreWriteDir(void) -{ - return PHYSFS_setWriteDir(writeDir); -} - -bool FILESYSTEM_setLangWriteDir(void) -{ - const char* realLangDir = PHYSFS_getRealDir("lang"); - if (realLangDir == NULL || SDL_strcmp(mainLangDir, realLangDir) != 0) - { - vlog_error("Not setting language write dir: %s overrules %s when loading", - realLangDir, mainLangDir - ); - return false; - } - if (!PHYSFS_setWriteDir(mainLangDir)) - { - FILESYSTEM_restoreWriteDir(); - return false; - } - return true; -} - -bool FILESYSTEM_isFileType(const char* filename, PHYSFS_FileType filetype) -{ - PHYSFS_Stat stat; - - bool success = PHYSFS_stat(filename, &stat); - - if (!success) - { - vlog_error( - "Could not stat file: %s", - PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode()) - ); - return false; - } - - /* We unfortunately cannot follow symlinks (PhysFS limitation). - * Let the caller deal with them. - */ - return stat.filetype == filetype - || stat.filetype == PHYSFS_FILETYPE_SYMLINK; + return levelDir; } bool FILESYSTEM_isFile(const char* filename) { - return FILESYSTEM_isFileType(filename, PHYSFS_FILETYPE_REGULAR); -} + PHYSFS_Stat stat; -bool FILESYSTEM_isDirectory(const char* filename) -{ - return FILESYSTEM_isFileType(filename, PHYSFS_FILETYPE_DIRECTORY); + bool success = PHYSFS_stat(filename, &stat); + + if (!success) + { + printf( + "Could not stat file: %s\n", + PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode()) + ); + return false; + } + + /* We unfortunately cannot follow symlinks (PhysFS limitation). + * Let the caller deal with them. + */ + return stat.filetype == PHYSFS_FILETYPE_REGULAR + || stat.filetype == PHYSFS_FILETYPE_SYMLINK; } bool FILESYSTEM_isMounted(const char* filename) { - return PHYSFS_getMountPoint(filename) != NULL; + return PHYSFS_getMountPoint(filename) != NULL; } static bool FILESYSTEM_exists(const char *fname) { - return PHYSFS_exists(fname); + return PHYSFS_exists(fname); } static void generateBase36(char* string, const size_t string_size) { - size_t i; - for (i = 0; i < string_size - 1; ++i) - { - /* a-z0-9 */ - char randchar = fRandom() * 35; - if (randchar < 26) - { - randchar += 'a'; - } - else - { - randchar -= 26; - randchar += '0'; - } - string[i] = randchar; - } - string[string_size - 1] = '\0'; + size_t i; + for (i = 0; i < string_size - 1; ++i) + { + /* a-z0-9 */ + char randchar = fRandom() * 35; + if (randchar < 26) + { + randchar += 'a'; + } + else + { + randchar -= 26; + randchar += '0'; + } + string[i] = randchar; + } + string[string_size - 1] = '\0'; } static void generateVirtualMountPath(char* path, const size_t path_size) { - char random_str[6 + 1]; - generateBase36(random_str, sizeof(random_str)); - SDL_snprintf( - path, - path_size, - ".vvv-mnt-virtual-%s/custom-assets/", - random_str - ); + char random_str[6 + 1]; + generateBase36(random_str, sizeof(random_str)); + SDL_snprintf( + path, + path_size, + ".vvv-mnt-virtual-%s/custom-assets/", + random_str + ); } -static char levelDirError[6*SCREEN_WIDTH_CHARS + 1] = {'\0'}; +static char levelDirError[256] = {'\0'}; static bool levelDirHasError = false; bool FILESYSTEM_levelDirHasError(void) { - return levelDirHasError; + return levelDirHasError; } void FILESYSTEM_clearLevelDirError(void) { - levelDirHasError = false; + levelDirHasError = false; } const char* FILESYSTEM_getLevelDirError(void) { - return levelDirError; + return levelDirError; } -void FILESYSTEM_setLevelDirError(const char* text, const char* args_index, ...) +static int setLevelDirError(const char* text, ...) { - levelDirHasError = true; + va_list list; + int retval; - va_list list; - va_start(list, args_index); - vformat_buf_valist(levelDirError, sizeof(levelDirError), text, args_index, list); - va_end(list); + levelDirHasError = true; - vlog_error("%s", levelDirError); + va_start(list, text); + retval = SDL_vsnprintf(levelDirError, sizeof(levelDirError), text, list); + va_end(list); + + puts(levelDirError); + + return retval; } static bool FILESYSTEM_mountAssetsFrom(const char *fname) { - const char* real_dir = PHYSFS_getRealDir(fname); - char path[MAX_PATH]; + const char* real_dir = PHYSFS_getRealDir(fname); + char path[MAX_PATH]; - if (real_dir == NULL) - { - FILESYSTEM_setLevelDirError( - loc::gettext("Could not mount {path}: real directory doesn't exist"), - "path:str", - fname - ); - return false; - } + if (real_dir == NULL) + { + setLevelDirError( + "Could not mount %s: real directory doesn't exist", + fname + ); + return false; + } - SDL_snprintf(path, sizeof(path), "%s/%s", real_dir, fname); + SDL_snprintf(path, sizeof(path), "%s/%s", real_dir, fname); - generateVirtualMountPath(virtualMountPath, sizeof(virtualMountPath)); + generateVirtualMountPath(virtualMountPath, sizeof(virtualMountPath)); - if (!PHYSFS_mount(path, virtualMountPath, 0)) - { - vlog_error( - "Error mounting %s: %s", - fname, - PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode()) - ); - return false; - } + if (!PHYSFS_mount(path, virtualMountPath, 0)) + { + printf( + "Error mounting %s: %s\n", + fname, + PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode()) + ); + return false; + } - SDL_strlcpy(assetDir, path, sizeof(assetDir)); - return true; + SDL_strlcpy(assetDir, path, sizeof(assetDir)); + return true; +} + +struct ArchiveState +{ + const char* filename; + bool has_extension; + bool other_level_files; +}; + +static PHYSFS_EnumerateCallbackResult zipCheckCallback( + void* data, + const char* origdir, + const char* filename +) { + struct ArchiveState* state = (struct ArchiveState*) data; + const bool has_extension = endsWith(filename, ".vvvvvv"); + UNUSED(origdir); + + if (!state->has_extension) + { + state->has_extension = has_extension; + } + if (!state->other_level_files && has_extension) + { + state->other_level_files = SDL_strcmp( + state->filename, + filename + ) != 0; + } + + if (state->has_extension && state->other_level_files) + { + /* We don't need to check any more files. */ + return PHYSFS_ENUM_STOP; + } + return PHYSFS_ENUM_OK; +} + +/* For technical reasons, the level file inside a zip named LEVELNAME.zip must + * be named LEVELNAME.vvvvvv, else its custom assets won't work; + * if there are .vvvvvv files other than LEVELNAME.vvvvvv, they would be loaded + * too but they won't load any assets + * + * For user-friendliness, we check this upfront and reject all zips that don't + * conform to this (regardless of them containing assets or not) - otherwise a + * level zip with assets can be played but its assets mysteriously won't work + */ +static bool checkZipStructure(const char* filename) +{ + const char* real_dir = PHYSFS_getRealDir(filename); + char base_name[MAX_PATH]; + char base_name_suffixed[MAX_PATH]; + char real_path[MAX_PATH]; + char mount_path[MAX_PATH]; + char check_path[MAX_PATH]; + char random_str[6 + 1]; + bool success; + bool file_exists; + struct ArchiveState zip_state; + + if (real_dir == NULL) + { + printf( + "Could not check %s: real directory doesn't exist\n", + filename + ); + return false; + } + + SDL_snprintf(real_path, sizeof(real_path), "%s/%s", real_dir, filename); + + generateBase36(random_str, sizeof(random_str)); + SDL_snprintf(mount_path, sizeof(mount_path), ".vvv-mnt-temp-%s/", random_str); + + if (!PHYSFS_mount(real_path, mount_path, 1)) + { + printf( + "Error mounting and checking %s: %s\n", + filename, + PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode()) + ); + return false; + } + + VVV_between(filename, "levels/", base_name, ".zip"); + + SDL_snprintf( + base_name_suffixed, + sizeof(base_name_suffixed), + "%s.vvvvvv", + base_name + ); + + SDL_snprintf( + check_path, + sizeof(check_path), + "%s%s", + mount_path, + base_name_suffixed + ); + + file_exists = PHYSFS_exists(check_path); + success = file_exists; + + SDL_zero(zip_state); + zip_state.filename = base_name_suffixed; + + PHYSFS_enumerate(mount_path, zipCheckCallback, (void*) &zip_state); + + /* If no .vvvvvv files in zip, don't print warning. */ + if (!success && zip_state.has_extension) + { + setLevelDirError( + "%s.zip is not structured correctly! It is missing %s.vvvvvv.", + base_name, + base_name + ); + } + + success &= !zip_state.other_level_files; + + /* ...But if other .vvvvvv file(s), do print warning. */ + /* This message is redundant if the correct file already DOESN'T exist. */ + if (file_exists && zip_state.other_level_files) + { + setLevelDirError( + "%s.zip is not structured correctly! It has .vvvvvv file(s) other than %s.vvvvvv.", + base_name, + base_name + ); + } + + if (!PHYSFS_unmount(real_path)) + { + printf( + "Could not unmount %s: %s\n", + mount_path, + PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode()) + ); + } + + return success; } void FILESYSTEM_loadZip(const char* filename) { - PHYSFS_File* zip = PHYSFS_openRead(filename); - if (zip == NULL) - { - vlog_error( - "Could not read zip %s: %s", - filename, - PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode()) - ); - } + PHYSFS_File* zip = PHYSFS_openRead(filename); - if (!PHYSFS_mountHandle(zip, filename, "levels", 1)) - { - vlog_error( - "Could not mount %s: %s", - filename, - PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode()) - ); - } + if (!checkZipStructure(filename)) + { + return; + } + + if (!PHYSFS_mountHandle(zip, filename, "levels", 1)) + { + printf( + "Could not mount %s: %s\n", + filename, + PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode()) + ); + } } +void FILESYSTEM_unmountAssets(void); + bool FILESYSTEM_mountAssets(const char* path) { - const char* real_dir = PHYSFS_getRealDir(path); + char filename[MAX_PATH]; + char virtual_path[MAX_PATH]; - if (real_dir != NULL && - SDL_strncmp(real_dir, "levels/", sizeof("levels/") - 1) == 0 && - endsWith(real_dir, ".zip")) - { - /* This is a level zip */ - vlog_info("Asset directory is .zip at %s", real_dir); + VVV_between(path, "levels/", filename, ".vvvvvv"); - if (!FILESYSTEM_mountAssetsFrom(real_dir)) - { - return false; - } + /* Check for a zipped up pack only containing assets first */ + SDL_snprintf( + virtual_path, + sizeof(virtual_path), + "levels/%s.data.zip", + filename + ); + if (FILESYSTEM_exists(virtual_path)) + { + printf("Asset directory is .data.zip at %s\n", virtual_path); - MAYBE_FAIL(graphics.reloadresources()); - } - else - { - /* If it's not a zip, look for a level folder */ - char filename[MAX_PATH]; - char virtual_path[MAX_PATH]; + if (!FILESYSTEM_mountAssetsFrom(virtual_path)) + { + return false; + } - VVV_between(path, "levels/", filename, ".vvvvvv"); + MAYBE_FAIL(graphics.reloadresources()); + } + else + { + SDL_snprintf( + virtual_path, + sizeof(virtual_path), + "levels/%s.zip", + filename + ); + if (FILESYSTEM_exists(virtual_path)) + { + /* This is a full zipped-up level including assets */ + printf("Asset directory is .zip at %s\n", virtual_path); - SDL_snprintf( - virtual_path, - sizeof(virtual_path), - "levels/%s/", - filename - ); + if (!FILESYSTEM_mountAssetsFrom(virtual_path)) + { + return false; + } - if (FILESYSTEM_exists(virtual_path)) - { - vlog_info("Asset directory exists at %s", virtual_path); + MAYBE_FAIL(graphics.reloadresources()); + } + else + { + /* If it's not a level or base zip, look for a level folder */ + SDL_snprintf( + virtual_path, + sizeof(virtual_path), + "levels/%s/", + filename + ); + if (FILESYSTEM_exists(virtual_path)) + { + printf("Asset directory exists at %s\n", virtual_path); - if (!FILESYSTEM_mountAssetsFrom(virtual_path)) - { - return false; - } + if (!FILESYSTEM_mountAssetsFrom(virtual_path)) + { + return false; + } - MAYBE_FAIL(graphics.reloadresources()); - } - else - { - /* Wasn't a level zip or folder! */ - vlog_debug("Asset directory does not exist"); - } - } + MAYBE_FAIL(graphics.reloadresources()); + } +#if 0 /* flibit removed this because it was noisy, maybe keep for debug? */ + else + { + /* Wasn't a level zip, base zip, or folder! */ + puts("Asset directory does not exist"); + } +#endif + } + } - return true; + return true; fail: - FILESYSTEM_unmountAssets(); - return false; + FILESYSTEM_unmountAssets(); + return false; } void FILESYSTEM_unmountAssets(void) { - if (assetDir[0] != '\0') - { - vlog_info("Unmounting %s", assetDir); - PHYSFS_unmount(assetDir); - assetDir[0] = '\0'; - graphics.reloadresources(); - } - else - { - vlog_debug("Cannot unmount when no asset directory is mounted"); - } + if (assetDir[0] != '\0') + { + printf("Unmounting %s\n", assetDir); + PHYSFS_unmount(assetDir); + assetDir[0] = '\0'; + graphics.reloadresources(); + } +#if 0 /* flibit removed this because it was noisy, maybe keep for debug? */ + else + { + printf("Cannot unmount when no asset directory is mounted\n"); + } +#endif } static void getMountedPath( - char* buffer, - const size_t buffer_size, - const char* filename + char* buffer, + const size_t buffer_size, + const char* filename ) { - const char* path; - const bool assets_mounted = assetDir[0] != '\0'; - char mounted_path[MAX_PATH]; + const char* path; + const bool assets_mounted = assetDir[0] != '\0'; + char mounted_path[MAX_PATH]; - if (assets_mounted) - { - SDL_snprintf( - mounted_path, - sizeof(mounted_path), - "%s%s", - virtualMountPath, - filename - ); - } + if (assets_mounted) + { + SDL_snprintf( + mounted_path, + sizeof(mounted_path), + "%s%s", + virtualMountPath, + filename + ); + } - if (assets_mounted && PHYSFS_exists(mounted_path)) - { - path = mounted_path; - } - else - { - path = filename; - } + if (assets_mounted && PHYSFS_exists(mounted_path)) + { + path = mounted_path; + } + else + { + path = filename; + } - SDL_strlcpy(buffer, path, buffer_size); + SDL_strlcpy(buffer, path, buffer_size); } bool FILESYSTEM_isAssetMounted(const char* filename) { - const char* realDir; - char path[MAX_PATH]; + const char* realDir; + char path[MAX_PATH]; - /* Fast path */ - if (assetDir[0] == '\0') - { - return false; - } + /* Fast path */ + if (assetDir[0] == '\0') + { + return false; + } - getMountedPath(path, sizeof(path), filename); + getMountedPath(path, sizeof(path), filename); - realDir = PHYSFS_getRealDir(path); + realDir = PHYSFS_getRealDir(path); - if (realDir == NULL) - { - return false; - } + if (realDir == NULL) + { + return false; + } - return SDL_strcmp(assetDir, realDir) == 0; + return SDL_strcmp(assetDir, realDir) == 0; } -bool FILESYSTEM_areAssetsInSameRealDir(const char* filenameA, const char* filenameB) -{ - char pathA[MAX_PATH]; - char pathB[MAX_PATH]; - - getMountedPath(pathA, sizeof(pathA), filenameA); - getMountedPath(pathB, sizeof(pathB), filenameB); - - const char* realDirA = PHYSFS_getRealDir(pathA); - const char* realDirB = PHYSFS_getRealDir(pathB); - - /* Both NULL, or both the same pointer? */ - if (realDirA == realDirB) - { - return true; - } - - if (realDirA == NULL || realDirB == NULL) - { - return false; - } - - return SDL_strcmp(realDirA, realDirB) == 0; -} - -static void load_stdin(void) -{ - size_t pos = 0; - /* A .vvvvvv file with nothing is at least 140K... - * initial size of 1K shouldn't hurt. */ -#define INITIAL_SIZE 1024 - size_t alloc_size = INITIAL_SIZE; - stdin_buffer = (unsigned char*) SDL_malloc(INITIAL_SIZE); -#undef INITIAL_SIZE - - if (stdin_buffer == NULL) - { - VVV_exit(1); - } - - while (true) - { - int ch = fgetc(stdin); - bool end = ch == EOF; - if (end) - { - /* Always add null terminator. */ - ch = '\0'; - } - - if (pos == alloc_size) - { - unsigned char *tmp; - alloc_size *= 2; - tmp = (unsigned char*) SDL_realloc((void*) stdin_buffer, alloc_size); - if (tmp == NULL) - { - VVV_exit(1); - } - stdin_buffer = tmp; - } - - stdin_buffer[pos] = ch; - ++pos; - - if (end) - { - break; - } - } - - stdin_length = pos - 1; -} - -static PHYSFS_sint64 read_bytes( - const char* name, PHYSFS_File* handle, void* buffer, - const PHYSFS_uint64 length -) { - const PHYSFS_sint64 bytes_read = PHYSFS_readBytes(handle, buffer, length); - if (bytes_read < 0) - { - vlog_error( - "Could not read bytes from file %s: %s", - name, - PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode()) - ); - } - else if ((unsigned) bytes_read != length) - { - const char* reason; - if (PHYSFS_eof(handle)) - { - reason = "Unexpected EOF"; - } - else - { - reason = PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode()); - } - vlog_warn( - "Partially read file %s: Expected %lli bytes, got %lli: %s", - name, length, bytes_read, reason - ); - } - return bytes_read; -} - -bool FILESYSTEM_saveFile(const char* name, const unsigned char* data, const size_t len) -{ - if (!isInit) - { - vlog_warn("Filesystem not initialized! Not writing just to be safe."); - return false; - } - - PHYSFS_File* handle = PHYSFS_openWrite(name); - if (handle == NULL) - { - vlog_error( - "Could not open PHYSFS handle for %s: %s", - name, PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode()) - ); - return false; - } - PHYSFS_sint64 bytes_written = PHYSFS_writeBytes(handle, data, len); - if ((size_t) bytes_written != len) - { - vlog_warn("%s: Number of bytes written is not as expected", name); - } - - int success = PHYSFS_close(handle); - if (success == 0) - { - vlog_error("%s: Could not close handle", name); - } - - return true; -} +void FILESYSTEM_freeMemory(unsigned char **mem); void FILESYSTEM_loadFileToMemory( - const char *name, - unsigned char **mem, - size_t *len + const char *name, + unsigned char **mem, + size_t *len, + bool addnull ) { - PHYSFS_File *handle; - PHYSFS_sint64 length; - PHYSFS_sint64 bytes_read; + PHYSFS_File *handle; + PHYSFS_sint64 length; + PHYSFS_sint64 success; - if (name == NULL || mem == NULL) - { - goto fail; - } + if (name == NULL || mem == NULL) + { + goto fail; + } - /* FIXME: Dumb hack to use `special/stdin.vvvvvv` here... - * This is also checked elsewhere... grep for `special/stdin`! */ - if (SDL_strcmp(name, "levels/special/stdin.vvvvvv") == 0) - { - // this isn't *technically* necessary when piping directly from a file, but checking for that is annoying - if (stdin_buffer == NULL) - { - load_stdin(); - } + if (SDL_strcmp(name, "levels/special/stdin.vvvvvv") == 0) + { + // this isn't *technically* necessary when piping directly from a file, but checking for that is annoying + static std::vector STDIN_BUFFER; + static bool STDIN_LOADED = false; + size_t stdin_length; + if (!STDIN_LOADED) + { + std::istreambuf_iterator begin(std::cin), end; + STDIN_BUFFER.assign(begin, end); + STDIN_BUFFER.push_back(0); // there's no observable change in behavior if addnull is always true, but not vice versa + STDIN_LOADED = true; + } - *mem = (unsigned char*) SDL_malloc(stdin_length + 1); /* + 1 for null */ - if (*mem == NULL) - { - VVV_exit(1); - } + stdin_length = STDIN_BUFFER.size() - 1; + if (len != NULL) + { + *len = stdin_length; + } - if (len != NULL) - { - *len = stdin_length; - } + ++stdin_length; + *mem = static_cast(SDL_malloc(stdin_length)); // STDIN_BUFFER.data() causes double-free + if (*mem == NULL) + { + VVV_exit(1); + } + std::copy(STDIN_BUFFER.begin(), STDIN_BUFFER.end(), reinterpret_cast(*mem)); + return; + } - SDL_memcpy((void*) *mem, (void*) stdin_buffer, stdin_length + 1); - return; - } - - handle = PHYSFS_openRead(name); - if (handle == NULL) - { - vlog_debug( - "Could not read file %s: %s", - name, - PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode()) - ); - goto fail; - } - length = PHYSFS_fileLength(handle); - if (len != NULL) - { - if (length < 0) - { - length = 0; - } - *len = length; - } - - *mem = (unsigned char *) SDL_calloc(length + 1, 1); - if (*mem == NULL) - { - VVV_exit(1); - } - - bytes_read = read_bytes(name, handle, *mem, length); - if (bytes_read < 0) - { - VVV_free(*mem); - } - PHYSFS_close(handle); - return; + handle = PHYSFS_openRead(name); + if (handle == NULL) + { + goto fail; + } + length = PHYSFS_fileLength(handle); + if (len != NULL) + { + if (length < 0) + { + length = 0; + } + *len = length; + } + if (addnull) + { + *mem = (unsigned char *) SDL_malloc(length + 1); + if (*mem == NULL) + { + VVV_exit(1); + } + (*mem)[length] = 0; + } + else + { + *mem = (unsigned char*) SDL_malloc(length); + if (*mem == NULL) + { + VVV_exit(1); + } + } + success = PHYSFS_readBytes(handle, *mem, length); + if (success == -1) + { + FILESYSTEM_freeMemory(mem); + } + PHYSFS_close(handle); + return; fail: - if (mem != NULL) - { - *mem = NULL; - } - if (len != NULL) - { - *len = 0; - } + if (mem != NULL) + { + *mem = NULL; + } + if (len != NULL) + { + *len = 0; + } } void FILESYSTEM_loadAssetToMemory( - const char* name, - unsigned char** mem, - size_t* len + const char* name, + unsigned char** mem, + size_t* len, + const bool addnull ) { - char path[MAX_PATH]; + char path[MAX_PATH]; - getMountedPath(path, sizeof(path), name); + getMountedPath(path, sizeof(path), name); - FILESYSTEM_loadFileToMemory(path, mem, len); + FILESYSTEM_loadFileToMemory(path, mem, len, addnull); +} + +void FILESYSTEM_freeMemory(unsigned char **mem) +{ + SDL_free(*mem); + *mem = NULL; } bool FILESYSTEM_loadBinaryBlob(binaryBlob* blob, const char* filename) { - PHYSFS_sint64 size; - PHYSFS_File* handle; - int valid, offset; - size_t i; - char path[MAX_PATH]; + PHYSFS_sint64 size; + PHYSFS_File* handle; + int offset; + size_t i; + char path[MAX_PATH]; - if (blob == NULL || filename == NULL) - { - return false; - } + if (blob == NULL || filename == NULL) + { + return false; + } - getMountedPath(path, sizeof(path), filename); + getMountedPath(path, sizeof(path), filename); - handle = PHYSFS_openRead(path); - if (handle == NULL) - { - vlog_debug( - "Could not read binary blob %s: %s", - filename, - PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode()) - ); - return false; - } + handle = PHYSFS_openRead(path); + if (handle == NULL) + { + printf("Unable to open file %s\n", filename); + return false; + } - size = PHYSFS_fileLength(handle); + size = PHYSFS_fileLength(handle); - read_bytes( - filename, - handle, - &blob->m_headers, - sizeof(blob->m_headers) - ); + PHYSFS_readBytes( + handle, + &blob->m_headers, + sizeof(blob->m_headers) + ); - valid = 0; - offset = sizeof(blob->m_headers); + offset = sizeof(blob->m_headers); - for (i = 0; i < SDL_arraysize(blob->m_headers); ++i) - { - resourceheader* header = &blob->m_headers[i]; - char** memblock = &blob->m_memblocks[i]; + for (i = 0; i < SDL_arraysize(blob->m_headers); ++i) + { + resourceheader* header = &blob->m_headers[i]; + char** memblock = &blob->m_memblocks[i]; - /* Name can be stupid, just needs to be terminated */ - static const size_t last_char = sizeof(header->name) - 1; - if (header->name[last_char] != '\0') - { - vlog_warn( - "%s: Name of header %li is not null-terminated", - filename, i - ); - } - header->name[last_char] = '\0'; + /* Name can be stupid, just needs to be terminated */ + static const size_t last_char = sizeof(header->name) - 1; + header->name[last_char] = '\0'; - if (header->valid & ~0x1 || !header->valid) - { - if (header->valid & ~0x1) - { - vlog_error( - "%s: Header %li's 'valid' value is invalid", - filename, i - ); - } - goto fail; /* Must be EXACTLY 1 or 0 */ - } - if (header->size < 1) - { - vlog_error( - "%s: Header %li's size value is zero or negative", - filename, i - ); - goto fail; /* Must be nonzero and positive */ - } - if (offset + header->size > size) - { - /* Not an error, VVVVVV 2.2 and below handled it gracefully */ - vlog_warn( - "%s: Header %li's size value goes past end of file", - filename, i - ); - } + if (header->valid & ~0x1 || !header->valid) + { + goto fail; /* Must be EXACTLY 1 or 0 */ + } + if (header->size < 1) + { + goto fail; /* Must be nonzero and positive */ + } + if (offset + header->size > size) + { + goto fail; /* Bogus size value */ + } - PHYSFS_seek(handle, offset); - *memblock = (char*) SDL_malloc(header->size); - if (*memblock == NULL) - { - VVV_exit(1); /* Oh god we're out of memory, just bail */ - } - offset += header->size; - header->size = read_bytes(filename, handle, *memblock, header->size); - valid += 1; + PHYSFS_seek(handle, offset); + *memblock = (char*) SDL_malloc(header->size); + if (*memblock == NULL) + { + VVV_exit(1); /* Oh god we're out of memory, just bail */ + } + PHYSFS_readBytes(handle, *memblock, header->size); + offset += header->size; + + continue; - continue; fail: - header->valid = false; - } + header->valid = false; + } - PHYSFS_close(handle); + PHYSFS_close(handle); - if (valid == 0) - { - return false; - } + printf("The complete reloaded file size: %lli\n", size); - vlog_debug("The complete reloaded file size: %lli", size); + for (i = 0; i < SDL_arraysize(blob->m_headers); ++i) + { + const resourceheader* header = &blob->m_headers[i]; - for (i = 0; i < SDL_arraysize(blob->m_headers); ++i) - { - const resourceheader* header = &blob->m_headers[i]; + if (!header->valid) + { + continue; + } - if (!header->valid) - { - continue; - } + printf("%s unpacked\n", header->name); + } - vlog_debug("%s unpacked", header->name); - } - - return true; + return true; } -bool FILESYSTEM_saveTiXml2Document(const char *name, tinyxml2::XMLDocument& doc, bool sync /*= true*/) +bool FILESYSTEM_saveTiXml2Document(const char *name, tinyxml2::XMLDocument& doc) { - if (!isInit) - { - vlog_warn("Filesystem not initialized! Not writing just to be safe."); - return false; - } - - /* XMLDocument.SaveFile doesn't account for Unicode paths, PHYSFS does */ - tinyxml2::XMLPrinter printer; - doc.Print(&printer); - PHYSFS_File* handle = PHYSFS_openWrite(name); - if (handle == NULL) - { - return false; - } - PHYSFS_writeBytes(handle, printer.CStr(), printer.CStrSize() - 1); // subtract one because CStrSize includes terminating null - PHYSFS_close(handle); - -#ifdef __EMSCRIPTEN__ - if (sync) - { - EM_ASM(FS.syncfs(false, function(err) - { - if (err) - { - console.warn("Error saving:", err); - alert("Error saving. Check console for more information."); - } - })); - } -#else - UNUSED(sync); -#endif - - return true; + /* XMLDocument.SaveFile doesn't account for Unicode paths, PHYSFS does */ + tinyxml2::XMLPrinter printer; + doc.Print(&printer); + PHYSFS_File* handle = PHYSFS_openWrite(name); + if (handle == NULL) + { + return false; + } + PHYSFS_writeBytes(handle, printer.CStr(), printer.CStrSize() - 1); // subtract one because CStrSize includes terminating null + PHYSFS_close(handle); + return true; } bool FILESYSTEM_loadTiXml2Document(const char *name, tinyxml2::XMLDocument& doc) { - /* XMLDocument.LoadFile doesn't account for Unicode paths, PHYSFS does */ - unsigned char *mem; - FILESYSTEM_loadFileToMemory(name, &mem, NULL); - if (mem == NULL) - { - return false; - } - doc.Parse((const char*) mem); - VVV_free(mem); - return true; -} - -bool FILESYSTEM_loadAssetTiXml2Document(const char *name, tinyxml2::XMLDocument& doc) -{ - /* Same as FILESYSTEM_loadTiXml2Document except for possible custom assets */ - unsigned char *mem; - FILESYSTEM_loadAssetToMemory(name, &mem, NULL); - if (mem == NULL) - { - return false; - } - doc.Parse((const char*) mem); - VVV_free(mem); - return true; + /* XMLDocument.LoadFile doesn't account for Unicode paths, PHYSFS does */ + unsigned char *mem; + FILESYSTEM_loadFileToMemory(name, &mem, NULL, true); + if (mem == NULL) + { + return false; + } + doc.Parse((const char*) mem); + FILESYSTEM_freeMemory(&mem); + return true; } struct CallbackWrapper { - void (*callback)(const char* filename); + void (*callback)(const char* filename); }; static PHYSFS_EnumerateCallbackResult enumerateCallback( - void* data, - const char* origdir, - const char* filename + void* data, + const char* origdir, + const char* filename ) { - struct CallbackWrapper* wrapper = (struct CallbackWrapper*) data; - void (*callback)(const char*) = wrapper->callback; - char builtLocation[MAX_PATH]; + struct CallbackWrapper* wrapper = (struct CallbackWrapper*) data; + void (*callback)(const char*) = wrapper->callback; + char builtLocation[MAX_PATH]; - SDL_snprintf( - builtLocation, - sizeof(builtLocation), - "%s/%s", - origdir, - filename - ); + SDL_snprintf( + builtLocation, + sizeof(builtLocation), + "%s/%s", + origdir, + filename + ); - callback(builtLocation); + callback(builtLocation); - return PHYSFS_ENUM_OK; + return PHYSFS_ENUM_OK; } void FILESYSTEM_enumerateLevelDirFileNames( - void (*callback)(const char* filename) + void (*callback)(const char* filename) ) { - int success; - struct CallbackWrapper wrapper = {callback}; + int success; + struct CallbackWrapper wrapper = {callback}; - success = PHYSFS_enumerate("levels", enumerateCallback, (void*) &wrapper); + success = PHYSFS_enumerate("levels", enumerateCallback, (void*) &wrapper); - if (success == 0) - { - vlog_error( - "Could not get list of levels: %s", - PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode()) - ); - } -} - -const char* FILESYSTEM_enumerate(const char* folder, EnumHandle* handle) -{ - /* List all files in a folder with PHYSFS_enumerateFiles. - * - * Doing it this way means we can decide and filter - * what's in the lists (in wrapper functions). - * - * Called like this: - * - * EnumHandle handle = {}; - * const char* item; - * while ((item = FILESYSTEM_enumerate("graphics", &handle)) != NULL) - * { - * puts(item); - * } - * FILESYSTEM_freeEnumerate(&handle); - */ - - if (handle->physfs_list == NULL) - { - // First iteration, set things up - handle->physfs_list = PHYSFS_enumerateFiles(folder); - handle->_item = handle->physfs_list; - } - - /* Return the next item, and increment the pointer. - * (once we return NULL, handle->_item points to 1 past end of array) */ - return *(handle->_item++); -} - -const char* FILESYSTEM_enumerateAssets(const char* folder, EnumHandle* handle) -{ - /* This function enumerates ONLY level-specific assets. - * If there are only global assets and no level-specific ones, - * we want an empty list. - * - * This function is called the same way as FILESYSTEM_enumerate, see above. */ - - if (!FILESYSTEM_isAssetMounted(folder)) - { - return NULL; - } - - char mounted_path[MAX_PATH]; - getMountedPath(mounted_path, sizeof(mounted_path), folder); - - const char* item; - while ((item = FILESYSTEM_enumerate(mounted_path, handle)) != NULL) - { - char full_name[128]; - SDL_snprintf(full_name, sizeof(full_name), "%s/%s", mounted_path, item); - if (FILESYSTEM_isFile(full_name) && item[0] != '.') - { - return item; - } - } - - return NULL; -} - -const char* FILESYSTEM_enumerateLanguageCodes(EnumHandle* handle) -{ - /* This function enumerates all the language codes. - * - * This function is called the same way as FILESYSTEM_enumerate, see above. */ - - const char* item; - while ((item = FILESYSTEM_enumerate("lang", handle)) != NULL) - { - char full_name[128]; - SDL_snprintf(full_name, sizeof(full_name), "lang/%s", item); - - if (FILESYSTEM_isDirectory(full_name) && item[0] != '.') - { - return item; - } - } - - return NULL; -} - -void FILESYSTEM_freeEnumerate(EnumHandle* handle) -{ - /* Call this function after enumerating with FILESYSTEM_enumerate or friends. */ - if (handle == NULL) - { - return; - } - - PHYSFS_freeList(handle->physfs_list); + if (success == 0) + { + printf( + "Could not get list of levels: %s\n", + PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode()) + ); + } } static int PLATFORM_getOSDirectory(char* output, const size_t output_size) { #ifdef _WIN32 - /* This block is here for compatibility, do not touch it! */ - WCHAR utf16_path[MAX_PATH]; - HRESULT retcode = SHGetFolderPathW( - NULL, - CSIDL_PERSONAL, - NULL, - SHGFP_TYPE_CURRENT, - utf16_path - ); - int num_bytes; + /* This block is here for compatibility, do not touch it! */ + WCHAR utf16_path[MAX_PATH]; + HRESULT retcode = SHGetFolderPathW( + NULL, + CSIDL_PERSONAL, + NULL, + SHGFP_TYPE_CURRENT, + utf16_path + ); + int num_bytes; - if (FAILED(retcode)) - { - vlog_error( - "Could not get OS directory: SHGetFolderPathW returned 0x%08x", - retcode - ); - return 0; - } + if (FAILED(retcode)) + { + printf( + "Could not get OS directory: SHGetFolderPathW returned 0x%08x\n", + retcode + ); + return 0; + } - num_bytes = WideCharToMultiByte( - CP_UTF8, - 0, - utf16_path, - -1, - output, - output_size, - NULL, - NULL - ); - if (num_bytes == 0) - { - vlog_error( - "Could not get OS directory: UTF-8 conversion failed with %d", - GetLastError() - ); - return 0; - } + num_bytes = WideCharToMultiByte( + CP_UTF8, + 0, + utf16_path, + -1, + output, + output_size, + NULL, + NULL + ); + if (num_bytes == 0) + { + printf( + "Could not get OS directory: UTF-8 conversion failed with %d\n", + GetLastError() + ); + return 0; + } - SDL_strlcat(output, "\\VVVVVV\\", MAX_PATH); - mkdir(output, 0777); - return 1; -#elif defined(__ANDROID__) - const char* externalStoragePath = SDL_AndroidGetExternalStoragePath(); - if (externalStoragePath == NULL) - { - vlog_error( - "Could not get OS directory: %s", - SDL_GetError() - ); - return 0; - } - SDL_snprintf(output, output_size, "%s/", externalStoragePath); - return 1; -#elif TARGET_OS_IPHONE - // (ab)use SDL APIs to get the path to the Documents folder without needing Objective-C - const char* prefsPath = SDL_GetPrefPath("", ""); - if (prefsPath == NULL) - { - vlog_error( - "Could not get OS directory: %s", - SDL_GetError() - ); - return 0; - } - SDL_snprintf(output, output_size, "%s/../../Documents/", prefsPath); - return 1; + SDL_strlcat(output, "\\VVVVVV\\", MAX_PATH); + mkdir(output, 0777); + return 1; #else - const char* prefDir = PHYSFS_getPrefDir("distractionware", "VVVVVV"); - if (prefDir == NULL) - { - vlog_error( - "Could not get OS directory: %s", - PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode()) - ); - return 0; - } - SDL_strlcpy(output, prefDir, output_size); - return 1; + const char* prefDir = PHYSFS_getPrefDir("distractionware", "VVVVVV"); + if (prefDir == NULL) + { + printf( + "Could not get OS directory: %s\n", + PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode()) + ); + return 0; + } + SDL_strlcpy(output, prefDir, output_size); + return 1; #endif } +static void PLATFORM_migrateSaveData(char* output) +{ + char oldLocation[MAX_PATH]; + char newLocation[MAX_PATH]; + char oldDirectory[MAX_PATH]; +#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__HAIKU__) || defined(__DragonFly__) + DIR *dir = NULL; + struct dirent *de = NULL; + DIR *subDir = NULL; + struct dirent *subDe = NULL; + char subDirLocation[MAX_PATH]; + const char *homeDir = SDL_getenv("HOME"); + if (homeDir == NULL) + { + /* Uhh, I don't want to get near this. -flibit */ + return; + } + const char oldPath[] = + #if defined(__linux__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__HAIKU__) || defined(__DragonFly__) + "/.vvvvvv/"; + #elif defined(__APPLE__) + "/Documents/VVVVVV/"; + #endif + SDL_snprintf(oldDirectory, sizeof(oldDirectory), "%s%s", homeDir, oldPath); + dir = opendir(oldDirectory); + if (!dir) + { + printf("Could not find directory %s\n", oldDirectory); + return; + } + + printf("Migrating old savedata to new location...\n"); + for (de = readdir(dir); de != NULL; de = readdir(dir)) + { + if ( SDL_strcmp(de->d_name, "..") == 0 || + SDL_strcmp(de->d_name, ".") == 0 ) + { + continue; + } + #define COPY_SAVEFILE(name) \ + else if (SDL_strcmp(de->d_name, name) == 0) \ + { \ + SDL_snprintf(oldLocation, sizeof(oldLocation), "%s%s", oldDirectory, name); \ + SDL_snprintf(newLocation, sizeof(newLocation), "%ssaves/%s", output, name); \ + PLATFORM_copyFile(oldLocation, newLocation); \ + } + COPY_SAVEFILE("unlock.vvv") + COPY_SAVEFILE("tsave.vvv") + COPY_SAVEFILE("qsave.vvv") + #undef COPY_SAVEFILE + else if (SDL_strstr(de->d_name, ".vvvvvv.vvv") != NULL) + { + SDL_snprintf(oldLocation, sizeof(oldLocation), "%s%s", oldDirectory, de->d_name); + SDL_snprintf(newLocation, sizeof(newLocation), "%ssaves/%s", output, de->d_name); + PLATFORM_copyFile(oldLocation, newLocation); + } + else if (SDL_strstr(de->d_name, ".vvvvvv") != NULL) + { + SDL_snprintf(oldLocation, sizeof(oldLocation), "%s%s", oldDirectory, de->d_name); + SDL_snprintf(newLocation, sizeof(newLocation), "%slevels/%s", output, de->d_name); + PLATFORM_copyFile(oldLocation, newLocation); + } + else if (SDL_strcmp(de->d_name, "Saves") == 0) + { + SDL_snprintf(subDirLocation, sizeof(subDirLocation), "%sSaves/", oldDirectory); + subDir = opendir(subDirLocation); + if (!subDir) + { + printf("Could not open Saves/ subdir!\n"); + continue; + } + for ( + subDe = readdir(subDir); + subDe != NULL; + subDe = readdir(subDir) + ) { + #define COPY_SAVEFILE(name) \ + (SDL_strcmp(subDe->d_name, name) == 0) \ + { \ + SDL_snprintf(oldLocation, sizeof(oldLocation), "%s%s", subDirLocation, name); \ + SDL_snprintf(newLocation, sizeof(newLocation), "%ssaves/%s", output, name); \ + PLATFORM_copyFile(oldLocation, newLocation); \ + } + if COPY_SAVEFILE("unlock.vvv") + else if COPY_SAVEFILE("tsave.vvv") + else if COPY_SAVEFILE("qsave.vvv") + #undef COPY_SAVEFILE + } + } + } +#elif defined(_WIN32) + WIN32_FIND_DATA findHandle; + HANDLE hFind = NULL; + char fileSearch[MAX_PATH]; + + /* Same place, different layout. */ + SDL_strlcpy(oldDirectory, output, sizeof(oldDirectory)); + + SDL_snprintf(fileSearch, sizeof(fileSearch), "%s\\*.vvvvvv", oldDirectory); + hFind = FindFirstFile(fileSearch, &findHandle); + if (hFind == INVALID_HANDLE_VALUE) + { + printf("Could not find directory %s\n", oldDirectory); + } + else do + { + if ((findHandle.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0) + { + SDL_snprintf(oldLocation, sizeof(oldLocation), "%s%s", oldDirectory, findHandle.cFileName); + SDL_snprintf(newLocation, sizeof(newLocation), "%slevels\\%s", output, findHandle.cFileName); + PLATFORM_copyFile(oldLocation, newLocation); + } + } while (FindNextFile(hFind, &findHandle)); +#else +#error See PLATFORM_migrateSaveData +#endif +} + +static void PLATFORM_copyFile(const char *oldLocation, const char *newLocation) +{ + char *data; + size_t length, bytes_read, bytes_written; + + /* Read data */ + FILE *file = fopen(oldLocation, "rb"); + if (!file) + { + printf("Cannot open/copy %s\n", oldLocation); + return; + } + fseek(file, 0, SEEK_END); + length = ftell(file); + fseek(file, 0, SEEK_SET); + data = (char*) SDL_malloc(length); + if (data == NULL) + { + VVV_exit(1); + } + bytes_read = fread(data, 1, length, file); + fclose(file); + if (bytes_read != length) + { + printf("An error occurred when reading from %s\n", oldLocation); + SDL_free(data); + return; + } + + /* Write data */ + file = fopen(newLocation, "wb"); + if (!file) + { + printf("Could not write to %s\n", newLocation); + SDL_free(data); + return; + } + bytes_written = fwrite(data, 1, length, file); + fclose(file); + SDL_free(data); + + /* WTF did we just do */ + printf("Copied:\n\tOld: %s\n\tNew: %s\n", oldLocation, newLocation); + if (bytes_written != length) + { + printf("Warning: an error occurred when writing to %s\n", newLocation); + } +} + bool FILESYSTEM_openDirectoryEnabled(void) { - return !gameScreen.isForcedFullscreen(); + /* This is just a check to see if we're on a desktop or tenfoot setup. + * If you're working on a tenfoot-only build, add a def that always + * returns false! + */ + return !SDL_GetHintBoolean("SteamTenfoot", SDL_FALSE); } -#if defined(__EMSCRIPTEN__) bool FILESYSTEM_openDirectory(const char *dname) { - return false; + char url[MAX_PATH]; + SDL_snprintf(url, sizeof(url), "file://%s", dname); + if (SDL_OpenURL(url) == -1) + { + printf("Error opening directory: %s\n", SDL_GetError()); + return false; + } + return true; } -#else -bool FILESYSTEM_openDirectory(const char *dname) -{ - char url[MAX_PATH]; - SDL_snprintf(url, sizeof(url), "file://%s", dname); - if (SDL_OpenURL(url) == -1) - { - vlog_error("Error opening directory: %s", SDL_GetError()); - return false; - } - return true; -} -#endif bool FILESYSTEM_delete(const char *name) { - return PHYSFS_delete(name) != 0; + return PHYSFS_delete(name) != 0; } static void levelSaveCallback(const char* filename) { - if (endsWith(filename, ".vvvvvv.vvv")) - { - if (!FILESYSTEM_delete(filename)) - { - vlog_error("Error deleting %s", filename); - } - } + if (endsWith(filename, ".vvvvvv.vvv")) + { + if (!FILESYSTEM_delete(filename)) + { + printf("Error deleting %s\n", filename); + } + } } void FILESYSTEM_deleteLevelSaves(void) { - int success; - struct CallbackWrapper wrapper = {levelSaveCallback}; + int success; + struct CallbackWrapper wrapper = {levelSaveCallback}; - success = PHYSFS_enumerate( - "saves", - enumerateCallback, - (void*) &wrapper - ); + success = PHYSFS_enumerate( + "saves", + enumerateCallback, + (void*) &wrapper + ); - if (success == 0) - { - vlog_error( - "Could not enumerate saves/: %s", - PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode()) - ); - } + if (success == 0) + { + printf( + "Could not enumerate saves/: %s\n", + PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode()) + ); + } } diff --git a/desktop_version/src/FileSystemUtils.h b/desktop_version/src/FileSystemUtils.h index e5c65031..60b1309e 100644 --- a/desktop_version/src/FileSystemUtils.h +++ b/desktop_version/src/FileSystemUtils.h @@ -9,19 +9,11 @@ class binaryBlob; // Forward declaration, including the entirety of tinyxml2.h across all files this file is included in is unnecessary namespace tinyxml2 { class XMLDocument; } -int FILESYSTEM_init(char *argvZero, char* baseDir, char* assetsPath, char* langDir, char* fontsDir); -bool FILESYSTEM_isInit(void); +int FILESYSTEM_init(char *argvZero, char* baseDir, char* assetsPath); void FILESYSTEM_deinit(void); char *FILESYSTEM_getUserSaveDirectory(void); char *FILESYSTEM_getUserLevelDirectory(void); -char *FILESYSTEM_getUserMainLangDirectory(void); -bool FILESYSTEM_isMainLangDirFromRepo(void); -bool FILESYSTEM_doesLangDirExist(void); -bool FILESYSTEM_doesFontsDirExist(void); - -bool FILESYSTEM_setLangWriteDir(void); -bool FILESYSTEM_restoreWriteDir(void); bool FILESYSTEM_isFile(const char* filename); bool FILESYSTEM_isMounted(const char* filename); @@ -30,40 +22,27 @@ void FILESYSTEM_loadZip(const char* filename); bool FILESYSTEM_mountAssets(const char *path); void FILESYSTEM_unmountAssets(void); bool FILESYSTEM_isAssetMounted(const char* filename); -bool FILESYSTEM_areAssetsInSameRealDir(const char* filenameA, const char* filenameB); -bool FILESYSTEM_saveFile(const char* name, const unsigned char* data, size_t len); void FILESYSTEM_loadFileToMemory(const char *name, unsigned char **mem, - size_t *len); + size_t *len, bool addnull); void FILESYSTEM_loadAssetToMemory( const char* name, unsigned char** mem, - size_t* len + size_t* len, + const bool addnull ); +void FILESYSTEM_freeMemory(unsigned char **mem); bool FILESYSTEM_loadBinaryBlob(binaryBlob* blob, const char* filename); -bool FILESYSTEM_saveTiXml2Document(const char *name, tinyxml2::XMLDocument& doc, bool sync = true); +bool FILESYSTEM_saveTiXml2Document(const char *name, tinyxml2::XMLDocument& doc); bool FILESYSTEM_loadTiXml2Document(const char *name, tinyxml2::XMLDocument& doc); -bool FILESYSTEM_loadAssetTiXml2Document(const char *name, tinyxml2::XMLDocument& doc); void FILESYSTEM_enumerateLevelDirFileNames(void (*callback)(const char* filename)); -struct EnumHandle -{ - char** physfs_list; - char** _item; -}; - -const char* FILESYSTEM_enumerate(const char* folder, EnumHandle* handle); -const char* FILESYSTEM_enumerateAssets(const char* folder, EnumHandle* handle); -const char* FILESYSTEM_enumerateLanguageCodes(EnumHandle* handle); -void FILESYSTEM_freeEnumerate(EnumHandle* handle); - bool FILESYSTEM_levelDirHasError(void); void FILESYSTEM_clearLevelDirError(void); const char* FILESYSTEM_getLevelDirError(void); -void FILESYSTEM_setLevelDirError(const char* text, const char* args_index, ...); bool FILESYSTEM_openDirectoryEnabled(void); bool FILESYSTEM_openDirectory(const char *dname); diff --git a/desktop_version/src/Finalclass.cpp b/desktop_version/src/Finalclass.cpp index ae6e0d7e..a22ce1fc 100644 --- a/desktop_version/src/Finalclass.cpp +++ b/desktop_version/src/Finalclass.cpp @@ -3,2628 +3,2616 @@ #include "Game.h" #include "Entity.h" #include "MakeAndPlay.h" +#include "UtilityClass.h" const short* finalclass::loadlevel(int rx, int ry) { - int t; + int t; - t = rx + (ry * 100); - const short* result; - warpx = false; - warpy = false; + t = rx + (ry * 100); + const short* result; + warpx = false; + warpy = false; - roomname_special = false; + roomname = "Untitled room ["+help.String(rx) + "," + help.String(ry)+"]"; - switch(t) - { + switch(t) + { #if !defined(MAKEANDPLAY) - case rn(50,52): - { - - static const short contents[] = { - 98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,0,0,0,0,0,0,0,218,98,98,98, - 98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,0,0,0,0,0,0,0,218,98,98,98, - 259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,260,0,0,0,0,0,0,0,258,259,259,259, - 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,0,0,0,0,0,0,0,7,7,7,7, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,0,0,0,0,0,0,0,6,6,6,6,6,6,6,6,6,6,6,6, - 179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,180,0,0,0,0,0,0,0,178,179,179,179,179,179,179,179,179,179,179,179, - 98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,0,0,0,0,0,0,0,218,98,98,98,98,98,98,98,98,98,98,98, - 98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,0,0,0,0,0,0,0,218,98,98,98,98,98,98,98,98,98,98,98, - 98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,0,0,0,0,0,0,0,218,98,98,98,98,98,98,98,98,98,98,98, - }; - - obj.createentity(163, 32, 12, 168); // (vertical gravity line) - obj.createentity(99, 32, 12, 168); // (vertical gravity line) - obj.createentity(227, 32, 12, 168); // (vertical gravity line) - obj.createentity(35, 32, 12, 168); // (vertical gravity line) - obj.createentity(291, 32, 12, 168); // (vertical gravity line) - - warpx = true; - roomname = "1954 World Cup Vinyl"; - result = contents; - break; - } - - case rn(50,51): - { - - static const short contents[] = { - 0,0,0,218,98,98,220,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,218,98,220,740, - 0,0,0,258,259,259,260,0,0,0,0,0,0,0,258,259,259,260,0,0,0,0,0,0,0,258,259,259,260,0,0,0,0,0,0,0,218,98,220,740, - 0,0,0,7,7,7,7,0,0,0,0,0,0,0,7,7,7,7,0,0,0,0,0,0,0,7,7,7,7,0,0,0,0,0,0,0,218,98,220,740, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740, - 0,0,0,0,178,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,178,179,179,179,179,179,180,218,98,220,740, - 0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,98,98,98,220,218,98,220,740, - 0,0,0,0,258,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,258,259,259,259,259,259,260,218,98,220,740, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740, - 0,0,0,6,6,6,6,0,0,0,0,0,0,0,6,6,6,6,0,0,0,0,0,0,0,6,6,6,6,0,0,0,0,0,0,0,218,98,220,740, - 0,0,0,178,179,179,180,0,0,0,0,0,0,0,178,179,179,180,0,0,0,0,0,0,0,178,179,179,180,0,0,0,0,0,0,0,218,98,220,740, - 0,0,0,218,98,98,220,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,218,98,220,740, - 0,0,0,218,98,98,220,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,218,98,220,740, - }; - - obj.createentity(-8, 116, 11, 40); // (horizontal gravity line) - obj.createentity(48, 116, 11, 184); // (horizontal gravity line) - obj.createentity(32, 88, 10, 1, 51500); // (savepoint) - obj.createentity(32, 128, 10, 0, 51501); // (savepoint) - obj.createentity(256, 88, 10, 1, 51502); // (savepoint) - obj.createentity(256, 128, 10, 0, 51503); // (savepoint) - warpy = true; - roomname = "The V Stooges"; - result = contents; - break; - } - - - case rn(49,51): - { - - static const short contents[] = { - 0,0,0,0,0,0,0,0,0,0,50,218,98,98,220,49,0,0,0,0,0,0,0,0,50,218,98,98,220,49,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,50,258,259,259,260,49,0,0,0,0,0,0,0,0,50,258,259,259,260,49,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,7,7,7,7,0,0,0,0,0,0,0,0,0,0,7,7,7,7,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,6,6,6,0,0,0,0,0,0,0,0,0,0,6,6,6,6,6,6,0,0,0,0,0,0,0,0,0,0,6,6,6,0,0,0,0, - 0,0,0,0,178,179,180,49,0,0,0,0,0,0,0,0,50,178,179,179,179,179,180,49,0,0,0,0,0,0,0,0,50,178,179,180,0,0,0,0, - 0,0,0,0,218,98,220,49,0,0,0,0,0,0,0,0,50,218,98,98,98,98,220,49,0,0,0,0,0,0,0,0,50,218,98,220,0,0,0,0, - 0,0,0,0,258,259,260,49,0,0,0,0,0,0,0,0,50,258,259,259,259,259,260,49,0,0,0,0,0,0,0,0,50,258,259,260,0,0,0,0, - 0,0,0,0,7,7,7,0,0,0,0,0,0,0,0,0,0,7,7,7,7,7,7,0,0,0,0,0,0,0,0,0,0,7,7,7,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,6,6,6,6,0,0,0,0,0,0,0,0,0,0,6,6,6,6,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,50,178,179,179,180,49,0,0,0,0,0,0,0,0,50,178,179,179,180,49,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,50,218,98,98,220,49,0,0,0,0,0,0,0,0,50,218,98,98,220,49,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,50,218,98,98,220,49,0,0,0,0,0,0,0,0,50,218,98,98,220,49,0,0,0,0,0,0,0,0,0,0, - }; - - obj.createentity(-8, 116, 11, 40); // (horizontal gravity line) - obj.createentity(288, 116, 11, 32); // (horizontal gravity line) - obj.createentity(64, 116, 11, 64); // (horizontal gravity line) - obj.createentity(192, 116, 11, 64); // (horizontal gravity line) - - warpy = true; - roomname = "The Untouchables"; - roomname_special = true; - result = contents; - break; - } - - case rn(48,51): - { - - static const short contents[] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,178,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,178,180,0,0,0,0, - 0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0, - 0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0, - 0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0, - 0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0, - 0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0, - 0,0,0,0,258,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,258,260,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - }; - - obj.createentity(-8, 116, 11, 40); // (horizontal gravity line) - obj.createentity(48, 116, 11, 224); // (horizontal gravity line) - obj.createentity(288, 116, 11, 32); // (horizontal gravity line) - obj.createentity(56, 88, 1, 3, 10); // Enemy - obj.createentity(248-16, 128, 1, 2, 10); // Enemy - obj.createentity(272, 168, 10, 0, 51480); // (savepoint) - obj.createentity(32, 48, 10, 1, 51481); // (savepoint) - - warpy = true; - roomname = "On the Waterfront"; - roomname_special = true; - result = contents; - break; - } - - case rn(47,51): - { - - static const short contents[] = { - 0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,258,260,0,0,0,0,0,0,258,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,178,179,179,179,179,179,179,179,179,179,179,179,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,218,98,98,98,98,98,98,98,98,98,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,258,259,259,259,259,259,259,259,259,259,259,259,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,178,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,178,180,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - }; - - obj.createentity(-8, 148, 11, 104); // (horizontal gravity line) - obj.createentity(-8, 84, 11, 80); // (horizontal gravity line) - obj.createentity(176, 116, 11, 144); // (horizontal gravity line) - obj.createentity(128, 96, 10, 0, 51470); // (savepoint) - obj.createentity(128, 56, 10, 1, 51471); // (savepoint) - - warpy = true; - roomname = "Gvnsmoke"; - roomname_special = true; - result = contents; - break; - } - - case rn(46,51): - { - - static const short contents[] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - }; - - obj.createentity(-8, 84, 11, 328); // (horizontal gravity line) - obj.createentity(-8, 148, 11, 328); // (horizontal gravity line) - obj.createentity(96, 120, 1, 2, 4); // Enemy - obj.createentity(144, 96, 1, 2, 4); // Enemy - obj.createentity(192, 120, 1, 2, 4); // Enemy - obj.createentity(240, 96, 1, 2, 4); // Enemy - obj.createentity(288, 120, 1, 2, 4); // Enemy - - warpy = true; - roomname = "Vwitched"; - roomname_special = true; - result = contents; - break; - } - - case rn(45,51): - { - - static const short contents[] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,258,260,0,0,0,0,0,0,258,260,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,178,179,179,179,179,179,179,179,179,179,179,179,180,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,98,98,98,98,98,98,98,98,98,220,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,258,259,259,259,259,259,259,259,259,259,259,259,260,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,178,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,178,180,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0, - }; - - obj.createentity(248, 84, 11, 72); // (horizontal gravity line) - obj.createentity(224, 148, 11, 96); // (horizontal gravity line) - obj.createentity(176, 56, 10, 1, 51450); // (savepoint) - obj.createentity(176, 96, 10, 0, 51451); // (savepoint) - - warpy = true; - roomname = "Television Newsveel"; - roomname_special = true; - result = contents; - break; - } - - - case rn(44,51): - { - - static const short contents[] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - }; - - obj.createentity(64+32-8, 32-16, 1, 0, 7, 0, -48, 320, 312); // Enemy, bounded - obj.createentity(96+32-8, 32-16, 1, 0, 7, 0, -56, 320, 320); // Enemy, bounded - obj.createentity(128+32-8, 32-16, 1, 0, 7, 0, -40, 320, 320); // Enemy, bounded - obj.createentity(160+32-8, 32-16, 1, 0, 7, 0, -56, 320, 320); // Enemy, bounded - obj.createentity(192+32-8, 32-16, 1, 0, 7, 0, -64, 320, 336); // Enemy, bounded - obj.createentity(64+32-8, 64-16, 1, 0, 7, 0, -56, 320, 320); // Enemy, bounded - obj.createentity(64+32-8, 96-16, 1, 0, 7, 0, -56, 320, 320); // Enemy, bounded - obj.createentity(64+32-8, 128-16, 1, 0, 7, 0, -64, 320, 320); // Enemy, bounded - obj.createentity(64+32-8, 160-16, 1, 0, 7, 0, -56, 320, 320); // Enemy, bounded - obj.createentity(192+32-8, 128-16+8, 1, 0, 7, 0, -64, 320, 320); // Enemy, bounded - obj.createentity(192+32-8, 160-16+8, 1, 0, 7, 0, -80, 320, 320); // Enemy, bounded - obj.createentity(192+32-8, 192-16+8, 1, 0, 7, 0, -80, 320, 304); // Enemy, bounded - obj.createentity(192+32-8, 192+24, 1, 0, 7, 0, -80, 320, 304); // Enemy, bounded - - warpy = true; - roomname = "Vertigo"; - result = contents; - break; - } - - case rn(43,51): - { - - static const short contents[] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,258,259,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,7,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,6,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,178,179,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - }; - - obj.createentity(155, 24, 12, 184); // (vertical gravity line) - obj.createentity(120, 152, 1, 1, 8, 0, -56, 320, 296); // Enemy, bounded - obj.createentity(104, 136, 1, 1, 8, 0, -64, 320, 296); // Enemy, bounded - obj.createentity(88, 120, 1, 1, 8, 0, -56, 320, 312); // Enemy, bounded - obj.createentity(72, 104, 1, 1, 8, 0, -56, 320, 296); // Enemy, bounded - obj.createentity(56, 88, 1, 1, 8, 0, -48, 320, 328); // Enemy, bounded - obj.createentity(176, 56, 1, 0, 8, 0, -64, 320, 288); // Enemy, bounded - obj.createentity(192, 72, 1, 0, 8, 0, -48, 320, 296); // Enemy, bounded - obj.createentity(208, 88, 1, 0, 8, 0, -72, 320, 296); // Enemy, bounded - obj.createentity(224, 104, 1, 0, 8, 0, -56, 320, 296); // Enemy, bounded - obj.createentity(240, 120, 1, 0, 8, 0, -48, 320, 296); // Enemy, bounded - - warpy = true; - roomname = "The Voon Show"; - result = contents; - break; - } - - case rn(42,51): - { - - static const short contents[] = { - 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,140,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 179,179,180,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,178,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,178,179,179,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 259,259,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,258,260,258,259,259,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,50,740,49,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,50,740,49,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 179,179,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,178,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 259,259,260,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,258,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,100,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - }; - - obj.createentity(168, 72, 10, 0, 51420); // (savepoint) - obj.createentity(24, 60, 11, 120); // (horizontal gravity line) - obj.createentity(24, 148, 11, 120); // (horizontal gravity line) - - warpy = true; - roomname = "Rear Window"; - roomname_special = true; - result = contents; - break; - } - - - case rn(41,51): - { - - static const short contents[] = { - 740,740,218,98,220,258,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,260,218,220,218,98,220,740,740,740,740,740,740, - 740,740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,218,98,220,740,740,740,740,740,740, - 740,740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,218,98,220,740,740,740,740,740,740, - 740,740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,218,98,220,740,740,740,740,740,740, - 740,740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,218,98,220,740,740,740,740,740,740, - 740,740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,218,98,220,740,740,740,740,740,740, - 179,179,140,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,218,98,139,179,179,179,179,179,179, - 98,98,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,218,98,98,98,98,98,98,98,98, - 259,259,259,259,260,0,0,0,0,0,6,6,0,0,0,0,0,0,0,0,0,0,0,6,6,0,0,0,0,218,220,258,259,259,259,259,259,259,259,259, - 0,0,0,178,180,0,0,0,0,0,178,180,0,0,0,0,0,0,0,0,0,0,0,178,180,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0, - 0,0,0,218,220,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0, - 0,0,0,218,220,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0, - 0,0,0,218,220,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0, - 0,0,0,218,220,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,258,260,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0, - 0,0,0,218,220,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,7,7,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0, - 0,0,0,218,220,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0, - 0,0,0,258,260,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0, - 179,179,179,179,180,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,178,179,179,179,179, - 98,98,98,98,220,0,0,0,0,0,218,220,0,0,0,0,6,6,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,218,98,98,98,98, - 98,98,98,98,220,0,0,0,0,0,218,220,0,0,0,0,740,740,0,0,0,0,0,0,0,0,0,0,0,258,260,0,0,0,0,218,98,98,98,98, - 98,98,98,98,220,0,0,0,0,0,218,220,0,0,0,0,7,7,0,0,0,0,0,0,0,0,0,0,0,7,7,0,0,0,0,218,98,98,98,98, - 259,259,100,98,220,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,98,98, - 740,740,218,98,220,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,98,98, - 740,740,218,98,220,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,258,259,259,259,259, - 740,740,218,98,220,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,178,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179, - 740,740,218,98,220,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98, - 740,740,218,98,220,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,218,98,99,259,259,259,259,259,259,259,259,259,259,259,259,259,259, - 740,740,218,98,220,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740,740,740,740,740,740,740,740,740,740,740,740,740,740, - 740,740,218,98,220,0,0,0,0,0,218,220,178,179,179,179,179,179,179,179,179,179,180,218,98,220,740,740,740,740,740,740,740,740,740,740,740,740,740,740, - 740,740,218,98,220,0,0,0,0,0,218,220,218,98,98,98,98,98,98,98,98,98,220,218,98,220,740,740,740,740,740,740,740,740,740,740,740,740,740,740, - }; - - obj.createentity(280, 120, 10, 1, 51410); // (savepoint) - obj.createentity(40, 28, 11, 192); // (horizontal gravity line) - obj.createentity(96, 204, 11, 88); // (horizontal gravity line) - obj.createentity(144, 156, 11, 88); // (horizontal gravity line) - obj.createentity(96, 92, 11, 88); // (horizontal gravity line) - - warpx = true; - roomname = "1950 Silverstone Grand V"; - result = contents; - break; - } - - - case rn(41,52): - { - - static const short contents[] = { - 740,740,218,98,220,0,0,0,0,0,218,98,220,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, - 179,179,140,98,220,0,0,0,0,0,218,98,139,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179, - 98,98,98,98,220,0,0,0,0,0,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98, - 259,259,259,259,260,0,0,0,0,0,258,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259, - 0,0,0,0,0,0,0,0,0,0,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,740,740,740,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,740,740,740,0,0,0,0, - 740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,740,740,740,740,0,0,0,0,0,0,740,740,740,740,0,0,0,0,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,740,740,740,0,0,0,0,0,0,0,0,740,740,740,0,0,0,0,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740, - 0,0,0,0,0,0,0,0,0,740,740,740,0,0,0,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,740,740,0,0,0,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,740,740,0,0,0,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,740,740,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,740,740,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,740,740,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 179,179,179,179,180,0,0,0,0,0,178,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179, - 98,98,98,98,220,0,0,0,0,0,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98, - 259,259,100,98,220,0,0,0,0,0,218,98,99,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259, - 740,740,218,98,220,0,0,0,0,0,218,98,220,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, - 740,740,218,98,220,0,0,0,0,0,218,98,220,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, - 740,740,218,98,220,0,0,0,0,0,218,98,220,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, - 740,740,218,98,220,0,0,0,0,0,218,98,220,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, - }; - - obj.createentity(264, 168, 10, 1, 52410); // (savepoint) - obj.createentity(152, 112, 20, 1); // (terminal) - - if(!obj.flags[72]) - { - if ((game.intimetrial || game.nocutscenes) && !game.translator_exploring) - { - obj.createblock(1, 152 - 4, 112, 20, 16, 85); - } - else - { - obj.createblock(5, 152 - 4, 112, 20, 16, 13); - } - } - - warpx = true; - warpy = true; - roomname = "DIY V Repair"; - result = contents; - break; - }; - - case rn(42,52): - { - - static const short contents[] = { - 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, - 179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179, - 98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98, - 259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 179,179,179,179,179,179,179,179,179,179,179,179,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,178,179,179,179,179,179,179,179,179,179,179,179,179, - 98,98,98,98,98,98,98,98,98,98,98,98,220,6,6,6,6,6,6,6,6,6,6,6,6,6,6,218,98,98,98,98,98,98,98,98,98,98,98,98, - 259,259,259,259,259,259,259,259,259,259,100,98,220,178,179,179,179,179,179,179,179,179,179,179,179,179,180,218,98,99,259,259,259,259,259,259,259,259,259,259, - 740,740,740,740,740,740,740,740,740,740,218,98,220,218,98,98,98,98,98,98,98,98,98,98,98,98,220,218,98,220,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,218,98,220,218,98,99,259,259,259,259,259,259,259,259,100,98,220,218,98,220,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,218,98,220,218,98,220,740,740,740,740,740,740,740,740,218,98,220,218,98,220,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,218,98,220,218,98,220,740,740,740,740,740,740,740,740,218,98,220,218,98,220,740,740,740,740,740,740,740,740,740,740, - }; - roomname = "Party Time!"; - result = contents; - break; - } - - - case rn(43,52): - { - - static const short contents[] = { - 218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220, - 218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220,258,259,259,260,218,98,98,220,218,98,98,220,218,98,98,220, - 218,98,98,220,218,98,98,220,218,98,98,220,258,259,259,260,218,98,98,220,258,259,259,260,0,0,0,0,258,259,259,260,218,98,98,220,218,98,98,220, - 218,98,98,220,218,98,98,220,258,259,259,260,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,218,98,98,220, - 218,98,98,220,258,259,259,260,0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,218,98,98,220, - 218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,218,98,98,220, - 218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,218,98,98,220, - 218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,218,98,98,220, - 218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,218,98,98,220, - 218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,218,98,98,220, - 218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,258,259,259,260,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,218,98,98,220, - 218,98,98,220,0,0,0,0,178,179,179,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,218,98,98,220, - 258,259,259,260,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,218,98,98,220, - 0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,178,179,179,180,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,218,98,98,220, - 0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,258,259,259,260,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,218,98,98,220, - 0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,178,179,179,180,0,0,0,0,218,98,98,220,218,98,98,220, - 0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,258,259,259,260,0,0,0,0,218,98,98,220,218,98,98,220, - 0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,258,259,259,260, - 0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,258,259,259,260,0,0,0,0, - 0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,178,179,179,180,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,178,179,179,180,218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0, - 178,179,179,180,218,98,98,220,218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,178,179,179,180,0,0,0,0,0,0,0,0, - 218,98,98,220,218,98,98,220,218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,218,98,98,220,178,179,179,180,0,0,0,0, - 218,98,98,220,218,98,98,220,218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,218,98,98,220,218,98,98,220,178,179,179,180, - 218,98,98,220,218,98,98,220,218,98,98,220,178,179,179,180,0,0,0,0,178,179,179,180,218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220, - 218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220,178,179,179,180,218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220, - 218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220, - 218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220, - }; - - obj.createentity(264, 176, 10, 1, 52430); // (savepoint) - obj.createentity(96, 180, 11, 96); // (horizontal gravity line) - obj.createentity(160, 52, 11, 96); // (horizontal gravity line) - obj.createentity(240, 136, 1, 2, 8); // Enemy - obj.createentity(96, 88, 1, 3, 8); // Enemy - obj.createentity(72, 32, 10, 0, 52431); // (savepoint) - roomname = "Upstairs, Downstairs"; - result = contents; - break; - } - - - case rn(44,52): - { - - static const short contents[] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,218,98,98,98,98,98,98,98, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,218,98,98,98,98,98,98,98, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,258,259,259,260,258,259,259,259,259,259,259,259, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,178,179,179,180,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,0,178,179,179, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,0,218,98,98, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,0,218,98,98, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,0,218,98,98, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,0,218,98,98, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,0,218,98,98, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,258,259,259,260,0,0,0,0,0,218,98,98, - 179,179,179,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98, - 98,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98, - 98,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98, - 259,259,259,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98, - 0,0,0,0,0,0,0,178,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98, - 179,179,179,179,179,179,180,218,220,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,218,98,98, - 98,98,98,98,98,98,220,218,220,178,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,180,218,98,98, - 98,98,98,98,98,98,220,218,220,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,218,98,98, - 98,98,98,98,98,98,220,218,220,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,218,98,98, - 98,98,98,98,98,98,220,218,220,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,218,98,98, - }; - - obj.createentity(64, 112, 2, 11, 4); //Big Threadmill, <<<<<< - obj.createentity(128, 112, 2, 11, 4); //Big Threadmill, <<<<<< - obj.createentity(192, 112, 2, 11, 4); //Big Threadmill, <<<<<< - obj.createentity(32, 112, 2, 9, 4); //Threadmill, <<< - - obj.createentity(0, 104, 2, 10, 4); //Big Threadmill, >>>>>> - obj.createentity(64, 104, 2, 10, 4); //Big Threadmill, >>>>>> - obj.createentity(128, 104, 2, 10, 4); //Big Threadmill, >>>>>> - obj.createentity(192, 104, 2, 8, 4); //Threadmill, >>> - - obj.createentity(80+8, 128, 1, 0, 5, 0, 120, 320, 200); // Enemy, bounded - obj.createentity(128+16, 168, 1, 1, 5, 0, 120, 320, 200); // Enemy, bounded - obj.createentity(176+24, 128, 1, 0, 5, 0, 120, 320, 200); // Enemy, bounded - //obj.createentity(224, 168, 1, 1, 5, 0, 120, 320, 200); // Enemy, bounded - obj.createentity(24, 184, 10, 1, 52440); // (savepoint) - roomname = "Timeslip"; - result = contents; - break; - } - - case rn(45,52): - { - - static const short contents[] = { - 98,98,98,98,98,98,98,220,218,98,220,740,740,740,740,740,740,218,98,220,0,0,0,0,0,0,218,98,98,98,220,218,98,220,740,740,740,740,740,740, - 98,98,98,98,98,98,98,220,218,98,220,740,740,740,740,740,740,218,98,220,0,0,0,0,0,0,218,98,98,98,220,218,98,220,740,740,740,740,740,740, - 259,259,259,259,259,259,259,260,218,98,220,740,740,740,740,740,740,218,98,220,0,0,0,0,0,0,258,259,259,259,260,218,98,139,179,179,179,179,179,179, - 0,0,0,0,0,0,0,0,218,98,220,740,740,740,740,740,740,218,98,220,0,0,0,0,0,0,7,7,7,7,7,218,98,98,98,98,98,98,98,98, - 0,0,0,0,0,0,0,0,218,98,220,740,740,740,740,740,740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,258,259,259,259,259,259,259,259,259, - 0,0,0,0,0,0,0,0,218,98,220,740,740,740,740,740,740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,178,179,179, - 0,0,0,0,0,0,0,0,218,98,220,740,740,740,740,740,740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98, - 179,179,179,180,0,0,0,0,218,98,139,179,179,179,179,179,179,140,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98, - 98,98,98,220,0,0,0,0,218,98,98,98,98,98,98,98,98,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98, - 259,100,98,220,0,0,0,0,258,259,259,259,259,259,259,259,259,259,259,260,0,0,0,0,0,0,0,0,0,0,0,0,740,740,0,0,0,218,98,98, - 740,218,98,220,0,0,0,0,178,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98, - 740,218,98,220,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98, - 740,218,98,220,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98, - 740,218,98,220,0,0,0,0,218,220,0,0,0,0,0,178,179,179,180,740,740,6,6,740,740,6,6,740,740,6,6,178,179,179,179,179,180,218,98,98, - 740,218,98,220,0,0,0,0,218,220,0,0,0,0,0,258,259,259,260,7,7,740,740,7,7,740,740,7,7,740,740,258,259,259,259,259,260,218,98,98, - 740,218,98,220,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98, - 740,218,98,220,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98, - 740,218,98,220,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98, - 740,218,98,220,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98, - 740,218,98,220,0,0,0,0,258,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,0,0,0,218,98,98, - 740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98, - 740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98, - 740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98, - 740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,258,259,259, - 740,218,98,220,178,179,179,179,179,179,179,180,0,0,0,0,0,740,0,0,0,0,0,0,740,0,0,0,0,0,178,179,179,179,179,179,179,179,179,179, - 740,218,98,220,218,98,98,98,98,98,98,220,6,6,6,6,6,740,6,6,6,6,6,6,740,6,6,6,6,6,218,98,98,98,98,98,98,98,98,98, - 740,218,98,220,218,98,99,259,259,100,98,220,178,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,180,218,98,99,259,259,259,259,259,259,259, - 740,218,98,220,218,98,220,740,740,218,98,220,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,218,98,220,740,740,740,740,740,740,740, - 740,218,98,220,218,98,220,740,740,218,98,220,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,218,98,220,740,740,740,740,740,740,740, - 740,218,98,220,218,98,220,740,740,218,98,220,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,218,98,220,740,740,740,740,740,740,740, - }; - - obj.createentity(40, 176, 10, 1, 52450); // (savepoint) - obj.createentity(80, 156, 11, 176); // (horizontal gravity line) - obj.createentity(128, 88, 10, 1, 52451); // (savepoint) - obj.createentity(160, 76, 11, 96); // (horizontal gravity line) - roomname = "Three's Company"; - result = contents; - break; - } - - case rn(47,52): - { - - static const short contents[] = { - 740,218,98,220,218,98,98,98,98,98,98,98,98,220,0,0,0,0,0,0,218,98,220,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, - 740,218,98,220,258,259,259,259,259,259,259,259,259,260,0,0,0,0,0,0,218,98,139,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179, - 740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98, - 740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,258,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259, - 740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,178,179,179,180,7,7,7,7,7,7,7,7,7,7,7,7,7,178,179,179, - 740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98, - 740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98, - 740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,258,259,259,260,0,0,0,0,0,0,0,0,0,0,0,0,0,258,259,259, - 740,218,98,220,0,0,0,0,178,179,179,179,179,179,179,179,179,179,179,179,179,179,179,180,0,0,0,0,0,0,0,0,0,0,0,0,0,7,7,7, - 740,218,98,220,0,0,0,0,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 740,218,98,220,0,0,0,0,258,259,259,259,259,259,259,259,259,259,259,259,259,259,259,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 740,218,98,220,0,0,0,0,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,178,179,179,179,179,179,179,179,179,179,179,179, - 740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,98,98,98,98,98,98,98,98,98, - 740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,99,259,259,259,259,259,259,259,259,259, - 740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740,740,740,740,740,740,740,740,740, - 740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740,740,740,740,740,740,740,740,740, - 740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740,740,740,740,740,740,740,740,740, - 740,218,98,220,0,0,0,0,0,0,0,0,0,6,6,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740,740,740,740,740,740,740,740,740, - 740,218,98,220,0,0,0,0,0,0,0,0,0,178,180,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740,740,740,740,740,740,740,740,740, - 740,218,98,220,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740,740,740,740,740,740,740,740,740, - 740,218,98,220,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740,740,740,740,740,740,740,740,740, - 740,218,98,220,6,6,6,6,6,6,6,6,6,218,220,6,6,6,6,6,6,6,6,6,6,6,6,6,218,98,220,740,740,740,740,740,740,740,740,740, - 740,218,98,220,178,179,179,179,179,179,179,179,180,218,220,178,179,179,179,179,179,179,179,179,179,179,179,180,218,98,220,740,740,740,740,740,740,740,740,740, - 740,218,98,220,218,98,98,98,98,98,98,98,220,218,220,218,98,98,98,98,98,98,98,98,98,98,98,220,218,98,220,740,740,740,740,740,740,740,740,740, - 740,218,98,220,218,98,98,98,98,98,98,98,220,218,220,218,98,98,98,98,98,98,98,98,98,98,98,220,218,98,220,740,740,740,740,740,740,740,740,740, - }; - - obj.createentity(68-4, 56, 2, 11, 4); //Big Threadmill, <<<<<< - obj.createentity(132-4, 56, 2, 9, 4); //Threadmill, <<< - obj.createentity(44, 192, 3); //Disappearing Platform - obj.createentity(92, 104, 3); //Disappearing Platform - obj.createentity(120, 192, 2, 3, 6); // Platform - obj.createentity(264, 48, 2, 2, 6); // Platform - roomname = "Cosmic Creepers"; - result = contents; - break; - }; - - case rn(48,52): - { - - static const short contents[] = { - 98,98,220,218,98,98,98,98,98,98,98,98,98,220,218,98,220,218,98,98,98,98,98,98,98,98,98,98,220,218,98,98,98,98,98,98,98,98,98,98, - 98,98,220,258,259,259,259,259,259,259,259,259,259,260,218,98,220,258,259,259,259,259,259,259,259,259,259,259,260,218,98,98,98,98,98,98,98,98,98,98, - 259,259,260,7,7,7,7,7,7,7,7,7,7,7,258,259,260,7,7,7,7,7,7,7,7,7,7,7,7,258,259,259,259,259,259,259,259,259,259,259, - 179,180,49,0,0,0,0,0,0,0,0,0,0,0,50,740,49,0,0,0,0,0,0,0,0,0,0,0,0,50,178,179,179,179,179,179,179,179,179,179, - 98,220,49,0,0,0,0,0,0,0,0,0,0,0,50,740,49,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,98,98,98,98,98,98,98,98, - 98,220,49,0,0,0,0,0,0,0,0,0,0,0,50,740,49,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,99,259,259,259,259,259,259,259, - 98,220,49,0,0,0,0,0,0,0,0,0,0,0,50,740,49,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,220,740,740,740,740,740,740,740, - 259,260,49,0,0,0,0,0,0,0,0,0,0,0,50,740,49,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,220,740,740,740,740,740,740,740, - 7,7,0,0,0,0,0,0,0,0,0,0,0,0,50,740,49,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,220,740,740,740,740,740,740,740, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,740,49,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,220,740,740,740,740,740,740,740, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,740,49,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,139,179,179,179,179,179,179,179, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,740,49,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,98,98,98,98,98,98,98,98, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,740,49,0,0,0,0,0,0,0,0,0,0,0,0,50,258,259,259,259,259,259,259,259,259,259, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,740,49,0,0,0,0,0,0,6,0,0,0,0,0,0,7,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,740,49,0,0,0,0,0,50,740,49,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,6,0,0,0,0,0,0,7,0,0,0,0,0,0,50,740,49,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 179,179,179,179,179,179,179,179,180,49,0,0,0,0,0,0,0,0,0,0,0,0,50,740,49,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 98,98,98,98,98,98,98,98,220,49,0,0,0,0,0,0,0,0,0,0,0,0,50,740,49,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 259,259,259,259,259,259,100,98,220,49,0,0,0,0,0,0,0,0,0,0,0,0,50,740,49,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 740,740,740,740,740,740,218,98,220,49,0,0,0,0,0,0,0,0,0,0,0,0,50,740,49,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 740,740,740,740,740,740,218,98,220,49,0,0,0,0,0,0,0,0,0,0,0,0,50,740,49,0,0,0,0,0,0,0,0,0,0,0,0,0,6,6, - 740,740,740,740,740,740,218,98,220,49,0,0,0,0,0,0,0,0,0,0,0,0,50,740,49,0,0,0,0,0,0,0,0,0,0,0,0,50,178,179, - 740,740,740,740,740,740,218,98,220,49,0,0,0,0,0,0,0,0,0,0,0,0,50,740,49,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98, - 740,740,740,740,740,740,218,98,220,49,0,0,0,0,0,0,0,0,0,0,0,0,50,740,49,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98, - 179,179,179,179,179,179,140,98,220,49,0,0,0,0,0,0,0,0,0,0,0,0,50,740,49,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98, - 98,98,98,98,98,98,98,98,220,49,0,0,0,0,0,0,0,0,0,0,0,0,50,740,49,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98, - 259,259,259,259,259,259,259,259,260,49,0,0,0,0,0,0,0,0,0,0,0,0,50,740,49,0,0,0,0,0,0,0,0,0,0,0,0,50,258,259, - 179,179,179,179,179,179,179,179,179,180,6,6,6,6,6,6,6,6,6,6,6,6,178,179,180,6,6,6,6,6,6,6,6,6,6,6,6,178,179,179, - 98,98,98,98,98,98,98,98,98,220,178,179,179,179,179,179,179,179,179,179,179,180,218,98,220,178,179,179,179,179,179,179,179,179,179,179,180,218,98,98, - 98,98,98,98,98,98,98,98,98,220,218,98,98,98,98,98,98,98,98,98,98,220,218,98,220,218,98,98,98,98,98,98,98,98,98,98,220,218,98,98, - }; - - obj.createentity(16, 112, 10, 1, 52480); // (savepoint) - obj.createentity(67, 24, 12, 96); // (vertical gravity line) - obj.createentity(243, 112, 12, 104); // (vertical gravity line) - obj.createentity(288, 104, 10, 0, 52481); // (savepoint) - obj.createentity(187, 24, 12, 80); // (vertical gravity line) - obj.createentity(123, 128, 12, 88); // (vertical gravity line) - - roomname = "The Villi People"; - result = contents; - break; - } - - case rn(50,53): - { - - static const short contents[] = { - 98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,0,0,0,0,0,0,0,218,220,218,98,220,740,740,740,740,740,740,740, - 98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,0,0,0,0,0,0,0,218,220,218,98,139,179,179,179,179,179,179,179, - 98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,0,0,0,0,0,0,0,218,220,218,98,98,98,98,98,98,98,98,98, - 259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,260,0,0,0,0,0,0,0,218,220,258,259,259,259,259,259,259,259,259,259, - 0,0,0,0,0,178,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0, - 6,6,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,258,260,0,0,0,6,6,6,6,6,6,6, - 179,180,0,0,0,218,220,0,0,0,178,179,179,179,179,179,179,179,179,179,180,178,179,179,179,179,179,179,179,180,0,0,0,178,179,179,179,179,179,179, - 98,220,0,0,0,218,220,0,0,0,218,98,98,98,98,98,98,98,98,98,220,218,98,98,98,98,98,98,98,220,0,0,0,218,98,98,98,98,98,98, - 98,220,0,0,0,218,220,0,0,0,218,98,98,98,98,98,98,98,98,98,220,258,259,259,259,259,259,259,259,260,0,0,0,218,98,98,98,98,98,98, - 259,260,0,0,0,218,220,0,0,0,218,98,98,98,98,98,98,98,98,98,220,0,0,0,0,0,0,0,178,180,0,0,0,258,259,259,259,259,259,259, - 0,0,0,0,0,218,220,0,0,0,218,98,98,98,98,98,98,98,98,98,220,0,0,0,0,0,0,0,218,220,0,0,0,178,180,0,0,0,0,0, - 0,0,0,0,0,218,220,0,0,0,258,259,259,259,259,259,259,259,259,259,260,0,0,0,0,0,0,0,258,260,0,0,0,218,220,0,0,0,0,0, - 0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0, - 0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0, - 0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0, - 179,179,179,179,180,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,178,179, - 98,98,98,98,220,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,218,98, - 259,259,259,259,260,258,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,258,259, - 0,0,0,0,0,178,179,179,179,179,180,0,0,0,0,0,0,0,178,179,179,179,179,179,179,179,179,179,179,179,179,179,180,218,220,0,0,0,0,0, - 0,0,0,0,0,218,98,98,98,98,220,0,0,0,0,0,0,0,218,98,98,98,98,98,98,98,98,98,98,98,98,98,220,218,220,0,0,0,0,0, - 0,0,0,0,0,218,98,98,98,98,220,0,0,0,0,0,0,0,218,98,99,259,259,259,259,259,259,259,259,259,100,98,220,218,220,0,0,0,0,0, - 0,0,0,0,0,218,98,98,98,98,220,178,179,179,179,179,179,180,218,98,220,740,740,740,740,740,740,740,740,740,218,98,220,218,220,0,0,0,0,0, - 0,0,0,0,0,218,98,98,98,98,220,218,98,98,98,98,98,220,218,98,220,740,740,740,740,740,740,740,740,740,218,98,220,258,260,0,0,0,0,0, - 179,180,0,0,0,218,98,98,98,98,220,218,98,98,98,98,98,220,218,98,220,740,740,740,740,740,740,740,740,740,218,98,220,178,179,179,179,179,179,179, - 98,220,0,0,0,218,98,98,98,98,220,218,98,98,98,98,98,220,218,98,220,740,740,740,740,740,740,740,740,740,218,98,220,218,98,98,98,98,98,98, - 98,220,0,0,0,218,98,98,98,98,220,218,98,98,98,98,98,220,218,98,220,740,740,740,740,740,740,740,740,740,218,98,220,218,98,98,98,98,98,98, - 98,220,0,0,0,218,98,98,98,98,220,218,98,98,98,98,98,220,218,98,220,740,740,740,740,740,740,740,740,740,218,98,220,218,98,98,98,98,98,98, - }; - - obj.createentity(192, 56, 10, 1, 53500); // (savepoint) - obj.createentity(288, 104, 10, 0, 53501); // (savepoint) - - obj.createentity(168, 96, 1, 0, 5); // Enemy - obj.createentity(184+2, 104, 1, 0, 5); // Enemy - obj.createentity(200+4, 112, 1, 0, 5); // Enemy - - obj.createentity(88, 176-4, 1, 1, 5); // Enemy - obj.createentity(104+2, 168-4, 1, 1, 5); // Enemy - obj.createentity(120 + 4, 160 - 4, 1, 1, 5); // Enemy - - warpx = true; - roomname = "Please enjoy these repeats"; - roomname_special = true; - result = contents; - break; - } - - case rn(50,54): - { - - static const short contents[] = { - 98,220,0,0,0,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98, - 98,220,0,0,0,258,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,100,98, - 98,220,0,0,0,740,740,7,7,7,7,7,7,7,740,740,740,740,7,7,7,7,7,7,740,740,740,740,7,7,7,7,7,7,7,7,7,7,218,98, - 98,220,0,0,0,740,740,0,0,0,0,0,0,0,50,740,740,49,0,0,0,0,0,0,50,740,740,49,0,0,0,0,0,0,0,0,0,0,218,98, - 98,220,0,0,0,740,740,0,0,0,0,0,0,0,50,740,740,49,0,0,0,0,0,0,50,740,740,49,0,0,0,0,0,0,0,0,0,0,218,98, - 98,220,0,0,0,740,740,0,0,0,0,0,0,0,50,740,740,49,0,0,0,0,0,0,0,50,740,49,0,0,0,0,0,0,0,0,0,0,218,98, - 98,220,0,0,0,7,7,0,0,0,0,0,0,0,50,740,740,49,0,0,0,0,0,0,0,50,740,49,0,0,0,0,0,0,0,0,0,0,218,98, - 98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,7,740,49,0,0,0,0,0,0,0,50,740,49,0,0,0,0,0,0,0,0,0,0,218,98, - 98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,0,0,0,0,0,0,0,0,50,740,49,0,0,0,0,0,0,0,0,0,0,218,98, - 98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,0,0,0,0,0,0,0,0,0,0,0,218,98, - 98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98, - 98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98, - 259,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,0,0,0,0,218,98, - 179,179,179,179,179,179,179,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,740,0,0,0,0,218,98, - 98,98,98,98,98,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,740,740,0,0,0,0,218,98, - 259,259,259,259,259,100,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,0,0,0,0,218,98, - 740,740,740,740,740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,0,0,0,0,218,98, - 740,740,740,740,740,218,98,220,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,740,740,740,0,0,0,0,218,98, - 179,179,179,179,179,140,98,220,178,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,180,0,0,0,0,218,98, - 98,98,98,98,98,98,98,220,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,0,0,0,0,218,98, - 259,259,259,259,259,259,259,260,258,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,260,0,0,0,0,258,259, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,178,179,180,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,258,259,260,0,0,0,0,0,0, - 179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179, - 98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98, - 259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259, - 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, - }; - - obj.createentity(24, 88, 10, 1, 54500); // (savepoint) - obj.createentity(280, 184, 10, 1, 54501); // (savepoint) - obj.createentity(56, 44, 11, 56); // (horizontal gravity line) - obj.createentity(131, 72, 12, 64); // (vertical gravity line) - obj.createentity(144, 36, 11, 48); // (horizontal gravity line) - obj.createentity(211, 80, 12, 56); // (vertical gravity line) - obj.createentity(224, 52, 11, 80); // (horizontal gravity line) - - warpx = true; - roomname = "Try Jiggling the Antenna"; - roomname_special = true; - result = contents; - break; - } - - - case rn(52,53): - { - - static const short contents[] = { - 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, - 0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, - 0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, - 0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,7,7,7,7,7,7,740,740,740,740,740,740,740, - 0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,7,7,7,0,0,0,0,0,0,7,7,7,740,740,740,740, - 740,740,740,740,740,740,740,0,0,0,0,0,0,7,740,740,740,740,740,740,740,740,7,7,0,0,0,0,0,0,0,0,0,0,0,0,7,7,7,7, - 740,740,740,740,740,740,740,740,0,0,0,0,0,0,7,7,7,7,7,7,7,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 740,740,740,740,740,740,740,740,740,740,6,6,6,6,6,6,6,6,6,6,6,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,6, - 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,6,6,6,6,6,6,6,0,0,0,0,0,6,6,6,6,740,740, - 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,6,6,6,6,6,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, - }; - - obj.createentity(16, 48, 10, 1, 53520); // (savepoint) - obj.createentity(96, 144, 3); //Disappearing Platform - obj.createentity(128, 144, 3); //Disappearing Platform - obj.createentity(160, 144, 3); //Disappearing Platform - obj.createentity(208, 80, 3); //Disappearing Platform - obj.createentity(240, 80, 3); //Disappearing Platform - obj.createentity(272, 80, 3); //Disappearing Platform - obj.createentity(304, 80, 3); //Disappearing Platform - roomname = "The Last Straw"; - result = contents; - break; - } - - case rn(53,53): - { - - static const short contents[] = { - 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,7,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,7,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,7,0,7,740,740,740,740,740,740,740, - 740,740,740,740,740,7,0,7,740,740,740,740,740,740,740,740,740,740,740,7,740,740,740,740,740,740,740,740,740,7,0,0,0,7,740,740,740,740,740,740, - 740,740,740,740,7,0,0,0,7,740,740,740,740,740,740,740,740,740,7,0,7,740,740,740,740,740,740,740,7,0,0,0,0,0,7,740,740,740,740,740, - 740,740,740,7,0,0,0,0,0,7,740,740,740,740,740,740,740,7,0,0,0,7,740,740,740,740,740,7,0,0,0,0,0,0,0,7,740,740,740,740, - 740,740,7,0,0,0,0,0,0,0,7,740,740,740,740,740,7,0,0,0,0,0,7,740,740,740,7,0,0,0,0,0,0,0,0,0,7,740,740,740, - 740,7,0,0,0,0,0,0,0,0,0,7,740,740,740,7,0,0,0,0,0,0,0,7,740,7,0,0,0,0,0,0,0,0,0,0,0,7,740,740, - 7,0,0,0,0,0,0,0,0,0,0,0,7,740,7,0,0,0,0,0,0,0,0,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,7,7, - 0,0,0,0,0,0,0,0,0,0,0,0,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,6,740,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,6,740,740,740,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 6,6,740,740,740,740,740,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6, - 740,740,740,740,740,740,740,740,6,0,0,0,0,0,0,0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,6,0,0,0,0,0,0,0,6,740, - 740,740,740,740,740,740,740,740,740,6,0,0,0,0,0,0,0,6,740,6,0,0,0,0,0,0,0,0,0,6,740,6,0,0,0,0,0,6,740,740, - 740,740,740,740,740,740,740,740,740,740,6,0,0,0,0,0,6,740,740,740,6,0,0,0,0,0,0,0,6,740,740,740,6,0,0,0,6,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,6,0,0,0,6,740,740,740,740,740,6,0,0,0,0,0,6,740,740,740,740,740,6,0,6,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,740,6,0,6,740,740,740,740,740,740,740,6,0,0,0,6,740,740,740,740,740,740,740,6,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,740,740,6,740,740,740,740,740,740,740,740,740,6,0,6,740,740,740,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,6,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, - }; - - obj.createentity(0, 80, 3); //Disappearing Platform - obj.createentity(288, 88, 3); //Disappearing Platform - obj.createentity(32, 80, 3); //Disappearing Platform - obj.createentity(64, 136, 3); //Disappearing Platform - obj.createentity(96, 136, 3); //Disappearing Platform - obj.createentity(224, 144, 3); //Disappearing Platform - obj.createentity(192, 144, 3); //Disappearing Platform - obj.createentity(256, 88, 3); //Disappearing Platform - obj.createentity(128, 88, 3); //Disappearing Platform - obj.createentity(160, 88, 3); //Disappearing Platform - roomname = "W"; - result = contents; - break; - } - - case rn(54,53): - { - - static const short contents[] = { - 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, - 7,7,7,7,7,7,7,7,7,7,7,7,7,7,740,740,740,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,7,7,7,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, - 0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, - 6,6,6,6,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,6,6,6,6,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,6,6,6,6,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, - }; - - obj.createentity(0, 88, 3); //Disappearing Platform - obj.createentity(32, 88, 3); //Disappearing Platform - obj.createentity(64, 88, 3); //Disappearing Platform - obj.createentity(120, 128, 9, 19); // (shiny trinket) - - roomname="V"; - result = contents; - break; - } - - - case rn(54,52): - { - - static const short contents[] = { - 740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, - }; - roomname = "VV"; - result = contents; - break; - } - - - case rn(54,51): - { - - static const short contents[] = { - 740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740, - }; - roomname = "VVV"; - result = contents; - break; - } - - - case rn(54,50): - { - - static const short contents[] = { - 740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740, - }; - roomname = "VVVV"; - result = contents; - break; - } - - case rn(54,49): - { - - static const short contents[] = { - 740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740, - 740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740, - 740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740, - 740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740, - 740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740, - 740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740, - 740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740, - 740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740, - 740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740, - 740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740, - 740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740, - 740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740, - 740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740, - 740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740, - 740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740, - 740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740, - 740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740, - 740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740, - 740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740, - 740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740, - }; - - roomname = "VVVVV"; - result = contents; - break; - } - - case rn(54,48): - { - - static const short contents[] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740, - 740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740, - 740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740, - 740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740, - 740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740, - 740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740, - 740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740, - 740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740, - }; - - obj.createblock(0, 0, 0, 5, 240); - obj.createblock(0, 315, 0, 5, 240); - - - if (game.translator_exploring) - { - obj.createblock(1, 0, 0, 320, 120, 3091); - } - else if(game.intimetrial) - { - obj.createblock(1, 0, 0, 320, 120, 82); - } - else - { - obj.createblock(1, 0, 0, 320, 120, 3500); //Game complete - } - roomname = "VVVVVV"; - result = contents; - break; - } - - - case rn(46,54): - { - - static const short contents[] = { - 98,98,220,218,98,98,98,98,98,98,98,98,98,98,98,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 98,98,220,218,98,98,98,98,98,98,98,98,98,98,98,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 98,98,220,258,259,259,259,259,259,259,259,259,259,259,259,259,259,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 98,98,220,0,178,179,179,179,179,179,179,179,179,179,179,179,179,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 98,98,220,0,258,259,259,259,259,259,259,259,259,259,259,259,259,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 98,98,220,0,178,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 98,98,220,0,218,220,0,178,179,179,179,179,179,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 98,98,220,0,218,220,0,258,259,259,259,259,259,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 98,98,220,0,218,220,0,178,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 98,98,220,0,218,220,0,218,220,0,178,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 98,98,220,0,218,220,0,218,220,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 98,98,220,0,218,220,0,218,220,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 98,98,220,0,218,220,0,218,220,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 98,98,220,0,218,220,0,218,220,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 98,98,220,0,218,220,0,218,220,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 98,98,220,0,218,220,0,218,220,0,258,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 98,98,220,0,218,220,0,218,220,0,178,179,179,179,179,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 98,98,220,0,218,220,0,218,220,0,258,259,259,259,259,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 98,98,220,0,218,220,0,258,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 98,98,220,0,218,220,0,178,179,179,179,179,179,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 98,98,220,0,218,220,0,258,259,259,259,259,259,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 98,98,220,0,258,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 98,98,220,0,178,179,179,179,179,179,179,179,179,179,179,179,179,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 98,98,220,0,258,259,259,259,259,259,259,259,259,259,259,259,259,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 98,98,220,178,179,179,179,179,179,179,179,179,179,179,179,179,179,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 98,98,220,218,98,98,98,98,98,98,98,98,98,98,98,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 98,98,220,218,98,98,98,98,98,98,98,98,98,98,98,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 98,98,220,218,98,98,98,98,98,98,98,98,98,98,98,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - }; - - warpy = true; - roomname = "Temporary Fault..."; - result = contents; - break; - } - - case rn(47,54): - { - - static const short contents[] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - }; - warpy = true; - roomname = "Do Not Adjust the V-hold"; - result = contents; - break; - } - - case rn(48,54): - { - - static const short contents[] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,139,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,258,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,178,179,179,179,179,179,179,179,179, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,98,98,98,98,98,98, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,99,259,259,259,259,259,259, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740,740,740,740,740,740, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740,740,740,740,740,740, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740,740,740,740,740,740, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740,740,740,740,740,740, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740,740,740,740,740,740, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740,740,740,740,740,740, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740,740,740,740,740,740, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740,740,740,740,740,740, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740,740,740,740,740,740, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740,740,740,740,740,740, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740,740,740,740,740,740, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740,740,740,740,740,740, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,178,179,180,218,98,220,740,740,740,740,740,740, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,178,179,180,218,98,220,218,98,220,740,740,740,740,740,740, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,178,179,180,218,98,220,218,98,220,218,98,220,740,740,740,740,740,740, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,178,179,180,218,98,220,218,98,220,218,98,220,218,98,220,740,740,740,740,740,740, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,178,179,180,218,98,220,218,98,220,218,98,220,218,98,220,218,98,220,740,740,740,740,740,740, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,218,98,220,218,98,220,218,98,220,218,98,220,218,98,220,740,740,740,740,740,740, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,218,98,220,218,98,220,218,98,220,218,98,220,218,98,220,740,740,740,740,740,740, - }; - - obj.createentity(264, 32, 10, 0, 54480); // (savepoint) - - /*if(!game.nocutscenes && !obj.flags[71]){ - obj.createblock(1, 72, 0, 320, 240, 49); - }*/ - - warpy = true; - roomname = "Regular Service Will Return Shortly"; - result = contents; - break; - } - - case rn(49,54): - { - - static const short contents[] = { - 98,98,98,98,98,220,0,0,218,220,0,0,218,98,220,0,0,0,0,218,220,0,0,0,0,218,98,220,0,0,218,220,0,0,218,98,220,740,740,740, - 98,98,98,98,98,220,0,0,218,220,0,0,218,98,220,0,0,0,0,218,220,0,0,0,0,218,98,220,0,0,218,220,0,0,218,98,220,740,740,740, - 98,98,98,98,98,220,0,0,218,220,0,0,218,98,220,0,0,0,0,218,220,0,0,0,0,258,259,260,0,0,218,220,0,0,218,98,220,740,740,740, - 259,259,259,259,259,260,0,0,218,220,0,0,218,98,220,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,218,220,0,0,218,98,220,740,740,740, - 0,0,0,0,0,0,0,0,218,220,0,0,218,98,220,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,218,220,0,0,218,98,220,740,740,740, - 0,0,0,0,0,0,0,0,218,220,0,0,218,98,220,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,218,220,0,0,218,98,220,740,740,740, - 0,0,0,0,0,0,0,0,218,220,0,0,218,98,220,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,218,220,0,0,218,98,220,740,740,740, - 0,0,0,0,0,0,0,0,258,260,0,0,218,98,220,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,258,260,0,0,218,98,220,740,740,740, - 179,179,179,179,179,179,179,179,179,180,0,0,218,98,220,0,0,0,0,258,260,0,0,0,0,178,179,179,179,179,179,180,0,0,218,98,220,740,740,740, - 98,98,98,98,98,98,98,98,98,220,0,0,218,98,220,0,0,0,0,7,7,0,0,0,0,218,98,98,98,98,98,220,0,0,218,98,220,740,740,740, - 98,98,98,98,98,98,98,98,98,220,0,0,218,98,220,0,0,0,0,0,0,0,0,0,0,218,98,98,98,98,98,220,0,0,218,98,220,740,740,740, - 259,259,259,259,259,259,259,259,259,260,0,0,218,98,220,0,0,0,0,0,0,0,0,0,0,258,259,259,259,259,259,260,0,0,218,98,220,740,740,740, - 179,179,179,179,179,180,0,0,0,0,0,0,218,98,220,0,0,0,0,0,0,0,0,0,0,178,179,180,0,0,0,0,0,0,218,98,220,740,740,740, - 98,98,98,98,98,220,0,0,0,0,0,0,218,98,220,0,0,0,0,0,0,0,0,0,0,218,98,220,0,0,0,0,0,0,218,98,220,740,740,740, - 259,259,259,100,98,220,0,0,0,0,0,0,218,98,220,0,0,0,0,0,0,0,0,0,0,218,98,220,0,0,0,0,0,0,218,98,139,179,179,179, - 740,740,740,218,98,220,0,0,0,0,0,0,218,98,220,0,0,0,0,0,0,0,0,0,0,218,98,220,0,0,0,0,0,0,218,98,98,98,98,98, - 740,740,740,218,98,220,0,0,0,0,0,0,258,259,260,0,0,0,0,0,0,0,0,0,0,218,98,220,0,0,0,0,0,0,258,259,259,259,259,259, - 740,740,740,218,98,220,0,0,178,179,179,179,179,179,180,0,0,0,0,0,0,0,0,0,0,218,98,220,0,0,178,179,179,179,179,179,179,179,179,179, - 740,740,740,218,98,220,0,0,218,98,98,98,98,98,220,0,0,0,0,0,0,0,0,0,0,218,98,220,0,0,218,98,98,98,98,98,98,98,98,98, - 740,740,740,218,98,220,0,0,218,98,98,98,98,98,220,0,0,0,0,6,6,0,0,0,0,218,98,220,0,0,218,98,98,98,98,98,98,98,98,98, - 740,740,740,218,98,220,0,0,258,259,259,259,259,259,260,0,0,0,0,178,180,0,0,0,0,218,98,220,0,0,258,259,259,259,259,259,259,259,259,259, - 740,740,740,218,98,220,0,0,178,180,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,218,98,220,0,0,178,180,0,0,0,0,0,0,0,0, - 740,740,740,218,98,220,0,0,218,220,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,218,98,220,0,0,218,220,0,0,0,0,0,0,0,0, - 740,740,740,218,98,220,0,0,218,220,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,218,98,220,0,0,218,220,0,0,0,0,0,0,0,0, - 740,740,740,218,98,220,0,0,218,220,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,218,98,220,0,0,218,220,0,0,0,0,0,0,0,0, - 740,740,740,218,98,220,0,0,218,220,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,218,98,220,0,0,218,220,0,0,178,179,179,179,179,179, - 740,740,740,218,98,220,0,0,218,220,0,0,178,179,180,0,0,0,0,218,220,0,0,0,0,218,98,220,0,0,218,220,0,0,218,98,98,98,98,98, - 740,740,740,218,98,220,0,0,218,220,0,0,218,98,220,0,0,0,0,218,220,0,0,0,0,218,98,220,0,0,218,220,0,0,218,98,98,98,98,98, - 740,740,740,218,98,220,0,0,218,220,0,0,218,98,220,0,0,0,0,218,220,0,0,0,0,218,98,220,0,0,218,220,0,0,218,98,98,98,98,98, - 740,740,740,218,98,220,0,0,218,220,0,0,218,98,220,0,0,0,0,218,220,0,0,0,0,218,98,220,0,0,218,220,0,0,218,98,98,98,98,98, - }; - - obj.createentity(120, 116, 11, 80); // (horizontal gravity line) - warpy = true; - roomname = "Origami Room"; - result = contents; - break; - } - - - //Tower Hallways from here - case rn(108,109): - { - - static const short contents[] = { - 12,12,12,12,13,23,23,23,23,23,23,14,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,21,7,7,9,7,7,7,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,21,28,28,0,28,28,28,20,13,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,14,12,12,12,12,12,12,12, - 12,12,12,12,21,28,28,0,28,28,28,20,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12, - 12,12,12,12,21,28,28,0,28,28,28,20,21,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,22,14,12,12,12,12,12,12, - 12,12,12,12,21,28,28,0,28,28,28,20,21,28,0,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12, - 12,12,12,12,21,28,28,0,28,28,28,20,21,28,0,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,22,23,23,23,23,23,23, - 23,23,23,23,24,28,28,0,28,28,28,20,21,28,0,28,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,0,28,28,28,28, - 0,0,0,28,28,28,28,0,28,28,28,20,21,28,0,28,28,0,28,28,28,28,28,28,28,28,28,28,28,28,28,28,0,28,28,0,28,28,28,28, - 0,0,0,28,28,28,28,0,28,28,28,20,21,28,0,28,28,0,28,28,28,28,28,28,28,28,28,28,28,28,28,28,0,28,28,0,28,28,28,28, - 0,0,0,28,28,28,28,0,28,28,28,20,21,28,0,28,28,0,28,28,0,0,0,0,0,0,0,0,0,0,28,28,0,28,28,0,28,28,28,28, - 0,0,0,28,28,28,28,0,28,28,28,20,21,28,0,28,28,0,28,28,0,28,28,28,28,28,28,28,28,0,28,28,0,28,28,0,28,28,28,28, - 0,0,0,28,17,18,18,19,28,28,28,20,21,28,0,28,28,0,28,28,0,28,28,28,28,28,28,28,28,0,28,28,0,28,28,0,28,28,28,28, - 0,0,0,28,20,12,12,21,28,28,28,20,21,28,0,28,28,0,28,28,0,28,28,0,0,0,0,28,28,0,28,28,0,28,28,17,18,18,18,18, - 0,0,0,28,20,12,12,21,28,28,28,20,21,28,0,28,28,0,28,28,0,28,28,0,28,28,0,28,28,0,28,28,0,28,28,22,14,12,12,12, - 0,0,0,28,20,12,12,21,28,28,28,20,21,28,0,28,28,0,28,28,0,28,28,0,28,28,0,28,28,0,28,28,0,28,28,0,20,12,12,12, - 0,0,0,28,20,12,12,21,28,28,28,20,21,28,0,28,28,0,28,28,0,28,28,0,0,0,0,28,28,0,28,28,0,28,28,0,22,14,12,12, - 0,0,0,28,20,12,12,21,28,28,28,20,21,28,0,28,28,0,28,28,0,28,28,28,28,28,28,28,28,0,28,28,0,28,28,0,28,20,12,12, - 0,0,0,28,20,12,12,21,28,28,28,20,21,28,0,28,28,0,28,28,0,28,28,28,28,28,28,28,28,0,28,28,0,28,28,0,28,22,14,12, - 0,0,0,28,20,12,12,21,28,28,28,20,21,28,0,28,28,0,28,28,0,0,0,0,0,0,0,0,0,0,28,28,0,28,28,0,28,28,20,12, - 0,0,0,28,20,12,12,21,28,28,28,22,24,28,0,28,28,0,28,28,28,28,28,28,28,28,28,28,28,28,28,28,0,28,28,0,28,28,20,12, - 18,18,18,18,16,12,12,21,28,28,28,0,28,28,0,28,28,0,28,28,28,28,28,28,28,28,28,28,28,28,28,28,0,28,28,0,28,28,20,12, - 12,12,12,12,12,12,12,21,28,28,28,0,28,28,0,28,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,0,28,28,20,12, - 12,12,12,12,12,12,12,21,28,28,28,0,28,28,0,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,0,28,28,20,12, - 12,12,12,12,12,12,12,21,28,28,28,0,28,28,0,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,0,28,28,20,12, - 12,12,12,12,12,12,12,21,28,28,28,0,28,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,20,12, - 12,12,12,12,12,12,12,21,28,28,28,0,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,20,12, - 12,12,12,12,12,12,12,15,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,16,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - }; - - obj.createentity(40, 80, 10, 1, 50500); // (savepoint) - - roomname = "Teleporter Divot"; - result = contents; - break; - } - - case rn(110,104): - { - - static const short contents[] = { - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 23,23,23,23,23,23,23,23,23,23,23,23,14,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 18,18,18,18,18,18,18,19,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,21,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,21,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,21,28,28,28,28,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, - 12,12,12,12,12,12,12,21,28,28,28,28,28,28,0,0,0,0,28,28,28,28,0,0,0,0,28,28,28,28,0,0,0,0,28,28,28,28,0,0, - 12,12,12,12,12,12,12,21,28,28,28,28,28,28,0,0,0,0,28,28,28,28,0,0,0,0,28,28,28,28,0,0,0,0,28,28,28,28,0,0, - 12,12,12,12,12,12,12,21,28,28,28,28,28,28,0,0,0,0,28,28,28,28,0,0,0,0,28,28,28,28,0,0,0,0,28,28,28,28,0,0, - 12,12,12,12,12,12,12,21,28,28,28,28,28,28,0,0,0,0,28,28,28,28,0,0,0,0,28,28,28,28,0,0,0,0,28,28,28,28,0,0, - 12,12,12,12,12,12,12,21,28,28,28,28,28,28,0,0,0,0,28,28,28,28,0,0,0,0,28,28,28,28,0,0,0,0,28,28,28,28,0,0, - 12,12,12,12,12,12,12,21,28,28,28,28,28,28,0,0,0,0,28,28,28,28,0,0,0,0,28,28,28,28,0,0,0,0,28,28,28,28,0,0, - 12,12,12,12,12,12,12,15,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - }; - - obj.createentity(16, 112, 10, 1, 50520); // (savepoint) - roomname = "Seeing Red"; - - if(!game.intimetrial || game.translator_exploring) - { - if(game.companion==0 && !obj.flags[8] && !game.crewstats[3]) //also need to check if he's rescued in a previous game - { - obj.createentity(264, 185, 18, 15, 1, 17, 0); - obj.createblock(1, 26*8, 0, 32, 240, 36); - } - } - result = contents; - break; - } - - case rn(111,104): - { - - static const short contents[] = { - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,13,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,14,12,12, - 12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12, - 12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12, - 12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12, - 12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12, - 12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12, - 12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12, - 12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12, - 12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12, - 12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12, - 12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12, - 12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12, - 12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12, - 12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12, - 12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12, - 12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12, - 12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12, - 23,23,24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,17,18,18,19,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,22,23,23,24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12, - 18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,16,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - }; - - obj.createentity(128-16, 80-32, 14); //Teleporter! - roomname = "Building Apport"; - - if(game.intimetrial) - { - obj.createblock(1, 40, 0, 32, 240, 82); - } - result = contents; - break; - } - - //Intermission level 2 - case rn(53,48): - { - - static const short contents[] = { - 98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,0,0,0,0,0,0,0,0,0,0,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98, - 98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,0,178,179,179,179,179,180,178,180,0,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98, - 259,259,259,259,259,259,259,259,259,259,259,259,259,259,260,0,258,259,259,259,259,260,218,220,0,258,259,259,259,259,259,259,259,259,259,259,259,259,259,259, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 179,179,179,179,179,179,179,179,179,179,179,179,179,179,180,0,178,180,0,0,0,0,218,220,0,0,0,0,0,178,179,179,180,178,179,179,179,179,179,179, - 98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,0,258,260,0,0,0,0,258,260,0,0,0,0,0,218,98,98,220,218,98,98,98,98,98,98, - 259,259,259,259,259,259,259,259,259,259,259,259,259,259,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,258,259,259,259,259,259,259, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,178,179,179,180,0,0,0,0,178,179,180,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,218,98,220,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,218,98,220,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,218,98,220,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0, - 179,179,179,179,179,180,178,179,179,180,0,0,0,0,218,98,98,220,0,0,0,0,218,98,220,0,0,0,0,218,98,98,220,0,0,0,0,178,179,179, - 98,98,98,98,98,220,218,98,98,220,0,0,0,0,218,98,98,220,0,0,0,0,218,98,220,0,0,0,0,218,98,98,220,0,0,0,0,218,98,98, - 259,259,259,259,259,260,218,98,98,220,0,0,0,0,218,98,98,220,0,0,0,0,218,98,220,0,0,0,0,218,98,98,220,0,0,0,0,258,259,259, - 0,0,0,0,0,0,218,98,98,220,0,0,0,0,218,98,98,220,0,0,0,0,218,98,220,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0, - 0,0,0,0,0,0,218,98,98,220,0,0,0,0,218,98,98,220,0,0,0,0,218,98,220,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0, - 0,0,0,0,0,0,218,98,98,220,0,0,0,0,218,98,98,220,0,0,0,0,218,98,220,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0, - 0,0,0,0,0,0,218,98,98,220,0,0,0,0,218,98,98,220,0,0,0,0,218,98,220,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0, - 179,179,180,0,0,0,218,98,98,220,0,0,0,0,218,98,98,220,0,0,0,0,218,98,220,0,0,0,0,218,98,98,220,178,179,179,179,179,179,179, - 98,98,220,0,0,0,218,98,98,220,0,0,0,0,218,98,98,220,0,0,0,0,218,98,220,0,0,0,0,218,98,98,220,218,98,98,98,98,98,98, - 259,259,260,0,0,0,218,98,98,220,0,0,0,0,218,98,98,220,0,0,0,0,218,98,220,0,0,0,0,258,259,259,260,258,259,259,259,259,259,259, - 0,0,0,0,0,0,218,98,98,220,0,0,0,0,218,98,98,220,0,0,0,0,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,218,98,98,220,0,0,0,0,218,98,98,220,0,0,0,0,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,218,98,98,220,0,0,0,0,218,98,98,220,0,0,0,0,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,258,259,259,260,0,0,0,0,218,98,98,220,0,0,0,0,258,259,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 179,179,179,179,179,179,179,179,179,180,0,0,0,0,218,98,98,220,0,0,0,0,178,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179, - 98,98,98,98,98,98,98,98,98,220,0,0,0,0,218,98,98,220,0,0,0,0,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98, - }; - - roomname = "Whee Sports"; - warpx = true; - result = contents; - break; - } - - case rn(53,49): - { - - static const short contents[] = { - 98,98,98,98,98,98,98,98,98,220,0,0,0,0,218,98,98,220,0,0,0,0,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98, - 259,259,259,259,259,259,259,100,98,220,0,0,0,0,218,98,98,220,0,0,0,0,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98, - 219,219,219,219,219,219,219,218,98,220,0,0,0,0,218,98,98,220,0,0,0,0,258,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259, - 219,219,219,219,219,219,219,218,98,220,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 219,219,219,219,219,219,219,218,98,220,0,0,0,0,218,98,98,220,0,0,0,0,178,179,179,179,179,179,179,179,179,179,179,179,179,179,180,178,179,179, - 219,219,219,219,219,219,219,218,98,220,0,0,0,0,218,98,98,220,0,0,0,0,218,98,98,98,98,98,98,98,98,98,98,98,98,98,220,218,98,98, - 219,219,219,219,219,219,219,218,98,220,0,0,0,0,218,98,98,220,0,0,0,0,258,259,259,259,259,259,259,259,259,259,259,259,259,259,260,218,98,98, - 219,219,219,219,219,219,219,218,98,220,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98, - 219,219,219,219,219,219,219,218,98,220,0,0,0,0,218,98,98,220,0,0,0,0,178,179,180,178,179,179,179,179,179,179,180,178,179,180,0,218,98,98, - 219,219,219,219,219,219,219,218,98,220,0,0,0,0,218,98,98,220,0,0,0,0,218,98,220,218,98,98,98,98,98,98,220,218,98,220,0,218,98,98, - 179,179,179,179,179,179,179,140,98,220,0,0,0,0,218,98,98,220,0,0,0,0,218,98,220,258,259,259,259,259,259,259,260,218,98,220,0,218,98,98, - 98,98,98,98,98,98,98,98,98,220,0,0,0,0,218,98,98,220,0,0,0,0,218,98,220,0,0,0,0,0,0,0,0,258,259,260,0,218,98,98, - 259,259,259,259,259,259,259,259,259,260,0,0,0,0,218,98,98,220,0,0,0,0,218,98,220,0,178,179,179,180,0,0,0,0,0,0,0,258,259,259, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,218,98,220,0,258,259,259,260,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,218,98,220,0,178,180,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,218,98,220,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,218,98,220,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0, - 179,179,179,179,179,179,179,179,179,179,179,179,179,180,218,98,98,220,0,0,0,0,218,98,220,0,258,260,0,0,0,0,0,178,179,180,0,178,179,179, - 98,98,98,98,98,98,98,98,98,98,98,98,98,220,218,98,98,220,0,0,0,0,218,98,220,0,0,0,0,0,0,0,0,218,98,220,0,218,98,98, - 259,259,259,259,259,259,259,259,259,259,259,100,98,220,218,98,98,220,0,0,0,0,218,98,220,178,179,179,179,179,179,179,180,218,98,220,0,218,98,98, - 219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,98,220,0,0,0,0,218,98,220,218,98,98,98,98,98,98,220,218,98,220,0,218,98,98, - 219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,98,220,0,0,0,0,258,259,260,258,259,259,259,259,259,259,260,258,259,260,0,218,98,98, - 179,179,179,179,179,179,179,179,179,179,179,140,98,220,218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98, - 98,98,98,98,98,98,98,98,98,98,98,98,98,220,218,98,98,220,0,0,0,0,178,179,179,179,179,179,179,179,179,179,179,179,179,179,180,218,98,98, - 259,259,259,259,259,259,259,259,259,259,259,259,259,260,258,259,259,260,0,0,0,0,258,259,259,259,259,259,259,259,259,259,259,259,259,259,260,258,259,259, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - }; - - roomname = "Whizz Down The Shaft"; - warpx = true; - result = contents; - break; - } - - case rn(53, 50): - { - static const short contents[] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - }; - - - //obj.createentity(-8, 84-32, 11, 328); // (horizontal gravity line) - obj.createentity(-8, 148 + 32, 11, 328); // (horizontal gravity line) - - obj.createblock(1, -10, 84 - 16, 340, 32, 10); //create the second line! - - roomname = "The Gravitron"; - warpx = true; //warpy = true; - result = contents; - break; - } - - case rn(53,51): - { - - static const short contents[] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,180,0,0,0,0,178,179,179,179, - 98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,0,0,0,0,218,98,98,98, - 98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,0,0,0,0,218,98,99,259, - 98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,0,0,0,0,218,98,220,219, - 259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,260,0,0,0,0,218,98,220,219, - 179,179,179,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219, - 98,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219, - 259,100,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219, - 219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,139,179, - 219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,98, - 219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,258,259,259,259, - 219,218,98,220,0,0,0,0,178,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179, - 219,218,98,220,0,0,0,0,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98, - 219,218,98,220,0,0,0,0,218,98,99,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259, - 219,218,98,220,0,0,0,0,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - 219,218,98,220,0,0,0,0,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - 219,218,98,220,0,0,0,0,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - }; - - obj.createentity(264, 176, 10, 1, 51530); // (savepoint) - - if(game.companion==0) //also need to check if he's rescued in a previous game - { - if (game.lastsaved == 2) - { - obj.createentity(112, 169, 18, 14, 0, 17, 1); - obj.createblock(1, 22 * 8, 16*8, 32, 240, 37); - } - else if (game.lastsaved ==3) - { - obj.createentity(112, 169, 18, 15, 0, 17, 1); - obj.createblock(1, 22 * 8, 16*8, 32, 240, 38); - } - else if (game.lastsaved == 4) - { - obj.createentity(112, 169, 18, 13, 0, 17, 1); - obj.createblock(1, 22 * 8, 16*8, 32, 240, 39); - } - else - { - obj.createentity(112, 169, 18, 16, 1, 17, 1); - obj.createblock(1, 22 * 8, 16*8, 32, 240, 40); - } - } - - roomname = "Tunnel of Terror"; - warpx = true; - - game.swnmode = false; - result = contents; - break; - } - - - case rn(53,52): - { - - static const short contents[] = { - 219,218,98,220,0,0,0,0,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - 219,218,98,220,0,0,0,0,218,98,139,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179, - 219,218,98,220,0,0,0,0,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98, - 219,218,98,220,0,0,0,0,258,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259, - 219,218,98,220,0,0,0,0,178,179,180,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - 219,218,98,220,0,0,0,0,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - 219,218,98,220,0,0,0,0,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,0,0,0,0,0,0,0,0,0,219,219,219,219,219,219,219, - 219,218,98,220,0,0,0,0,218,98,220,219,219,219,219,219,219,219,219,219,219,219,0,0,0,0,0,0,0,0,0,0,0,0,0,219,219,219,219,219, - 219,218,98,220,0,0,0,0,218,98,220,219,219,219,219,219,219,219,219,219,219,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,219,219,219,219, - 219,218,98,220,0,0,0,0,218,98,220,219,219,219,219,219,219,219,219,219,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,219,219,219, - 219,218,98,220,0,0,0,0,218,98,220,219,219,219,219,219,219,219,219,219,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,219,219,219, - 219,218,98,220,0,0,0,0,218,98,220,219,219,219,219,219,219,219,219,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,219,219, - 219,218,98,220,0,0,0,0,218,98,220,219,219,219,219,219,219,219,219,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,219,219, - 219,218,98,220,0,0,0,0,218,98,220,219,219,219,219,219,219,219,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,219,219, - 219,218,98,220,0,0,0,0,218,98,220,219,219,219,219,219,219,219,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,219,219, - 219,218,98,220,0,0,0,0,218,98,220,219,219,219,219,219,219,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,219,219, - 219,218,98,220,0,0,0,0,218,98,220,219,219,219,219,219,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,219,219, - 219,218,98,220,0,0,0,0,218,98,220,219,219,219,219,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,219,219, - 219,218,98,220,0,0,0,0,258,259,260,219,219,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,219,219, - 219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,219,219, - 179,140,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,219,219,219, - 98,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,219,219,219, - 259,259,259,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,219,219,219,219, - 179,179,179,179,179,179,179,179,179,179,180,219,219,219,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,219,219,219,219,219, - 98,98,98,98,98,98,98,98,98,98,220,219,219,219,219,219,219,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,219,219,219,219,219,219,219, - 259,259,259,259,259,259,259,259,100,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - 219,219,219,219,219,219,219,219,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - 219,219,219,219,219,219,219,219,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - 219,219,219,219,219,219,219,219,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - 219,219,219,219,219,219,219,219,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - }; - - obj.createentity((22 * 8)+4, (9 * 8) + 4, 14); //Teleporter! - - roomname = "House of Mirrors"; - warpx = true; - result = contents; - break; - } - - //Intermission 1 - - case rn(41,56): - { - - static const short contents[] = { - 259,259,259,259,259,259,259,259,259,260,218,98,220,0,218,98,98,220,0,218,98,98,98,220,0,218,98,98,98,98,220,0,218,98,220,219,219,219,219,219, - 0,0,0,0,0,0,0,0,0,0,218,98,220,0,218,98,98,220,0,218,98,98,98,220,0,218,98,98,98,98,220,0,218,98,220,219,219,219,219,219, - 179,179,179,179,179,179,180,178,180,0,218,98,220,0,218,98,98,220,0,218,98,98,98,220,0,218,98,98,98,98,220,0,218,98,220,219,219,219,219,219, - 259,259,259,259,259,259,260,218,220,0,218,98,220,0,218,98,98,220,0,218,98,98,98,220,0,218,98,98,98,98,220,0,218,98,220,219,219,219,219,219, - 0,0,0,0,0,0,0,218,220,0,218,98,220,0,218,98,98,220,0,218,98,98,98,220,0,218,98,98,98,98,220,0,218,98,139,179,179,179,179,179, - 179,179,180,178,179,180,0,218,220,0,258,259,260,0,218,98,98,220,0,258,259,259,259,260,0,218,98,98,98,98,220,0,218,98,98,98,98,98,98,98, - 98,98,220,258,259,260,0,258,260,0,0,0,0,0,258,259,259,260,0,7,7,7,7,7,0,218,98,98,98,98,220,0,258,259,259,259,259,259,259,259, - 98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,258,259,259,259,259,260,0,7,7,7,7,7,7,7,7, - 98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 98,98,220,178,179,180,0,178,179,179,179,179,180,0,6,6,6,6,0,178,179,179,179,180,0,0,0,0,0,0,0,0,178,179,179,179,179,179,179,179, - 259,259,260,258,259,260,0,218,98,98,98,98,220,0,178,179,179,180,0,218,98,98,98,220,0,6,6,6,6,6,6,0,218,98,98,98,98,98,98,98, - 0,0,0,0,0,0,0,258,259,259,259,259,260,0,258,259,259,260,0,258,259,259,259,260,0,178,179,179,179,179,180,0,258,259,259,259,259,259,259,259, - 179,179,179,179,179,179,179,179,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,258,259,259,259,259,260,0,0,0,0,0,0,0,0,0, - 259,259,259,259,259,259,259,259,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 179,179,179,179,179,179,179,179,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 259,259,259,259,259,259,259,259,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 179,179,179,179,179,179,179,179,179,179,179,179,180,0,178,179,179,180,0,178,179,179,179,180,0,178,179,179,179,179,180,0,0,0,0,0,0,0,0,0, - 98,98,98,98,98,98,98,98,98,98,98,98,220,0,218,98,98,220,0,218,98,98,98,220,0,218,98,98,98,98,220,0,178,179,179,179,179,179,179,179, - 259,259,259,259,259,259,259,259,259,259,100,98,220,0,218,98,98,220,0,218,98,98,98,220,0,218,98,98,98,98,220,0,218,98,98,98,98,98,98,98, - 219,219,219,219,219,219,219,219,219,219,218,98,220,0,218,98,98,220,0,218,98,98,98,220,0,218,98,98,98,98,220,0,218,98,99,259,259,259,259,259, - 219,219,219,219,219,219,219,219,219,219,218,98,220,0,218,98,98,220,0,218,98,98,98,220,0,218,98,98,98,98,220,0,218,98,220,219,219,219,219,219, - 219,219,219,219,219,219,219,219,219,219,218,98,220,0,218,98,98,220,0,218,98,98,98,220,0,218,98,98,98,98,220,0,218,98,220,219,219,219,219,219, - 219,219,219,219,219,219,219,219,219,219,218,98,220,0,218,98,98,220,0,218,98,98,98,220,0,218,98,98,98,98,220,0,218,98,220,219,219,219,219,219, - }; - - //obj.createentity(164, 96, 10, 1, 56410); // (savepoint) - - warpy = true; - roomname = "Now Take My Lead"; - result = contents; - break; - } - - - case rn(42,56): - { - - static const short contents[] = { - 219,219,219,219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,220,219,219,219, - 219,219,219,219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,220,219,219,219, - 219,219,219,219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,220,219,219,219, - 219,219,219,219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,139,179,179,179, - 179,179,179,179,179,140,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,98,98,98,98, - 98,98,98,98,98,98,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,258,259,259,259,259,259, - 259,259,259,259,259,259,259,260,218,98,139,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,140,98,220,7,7,7,7,7,7, - 7,7,7,7,7,7,7,7,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,258,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,260,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 179,179,179,179,179,179,179,180,178,179,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,178,179,179,179,179,179,179,179,179,179,179, - 98,98,98,98,98,98,98,220,218,98,220,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,218,98,98,98,98,98,98,98,98,98,98, - 259,259,259,259,259,259,259,260,218,98,220,178,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,180,218,98,98,98,98,98,98,98,98,98,98, - 0,0,0,0,0,0,0,0,218,98,220,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,218,98,98,98,98,98,98,98,98,98,98, - 0,0,0,0,0,0,0,0,258,259,260,258,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,260,258,259,259,259,259,259,259,259,259,259,259, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 179,179,179,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 98,98,98,220,178,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179, - 259,100,98,220,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98, - 219,218,98,220,218,98,99,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259, - 219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - 219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - }; - - if(!game.nodeathmode) - { - obj.createblock(1, 0, 0, 32, 240, 41); //scene 2 - obj.createblock(1, 280, 0, 32, 240, 12); //scene 2 - } - - roomname = "What Are You Waiting For?"; - warpy = true; - result = contents; - break; - } - - case rn(43,56): - { - - static const short contents[] = { - 219,218,98,220,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98, - 219,218,98,220,258,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259, - 219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 179,140,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 98,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 259,259,259,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 7,7,7,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,178,179,179,180,0,0,0,0,178,179,179,180,0,0,0,0,178,179,179,180,0,0,0,0,178,179,179,179, - 0,0,0,0,0,0,0,0,6,6,6,6,218,98,98,220,6,6,6,6,218,98,98,220,6,6,6,6,218,98,98,220,6,6,6,6,218,98,98,98, - 0,0,0,0,0,0,0,0,178,179,179,180,218,98,98,220,178,179,179,180,218,98,98,220,178,179,179,180,218,98,98,220,178,179,179,180,218,98,99,259, - 0,0,0,0,0,0,0,0,218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220,218,98,220,219, - 0,0,0,0,0,0,0,0,218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220,218,98,220,219, - 0,0,0,0,0,0,0,0,218,98,98,220,258,259,259,260,218,98,98,220,258,259,259,260,218,98,98,220,258,259,259,260,218,98,98,220,218,98,220,219, - 179,179,179,179,179,179,179,180,218,98,98,220,0,0,0,0,218,98,98,220,0,0,0,0,218,98,98,220,0,0,0,0,218,98,98,220,218,98,220,219, - 98,98,98,98,98,98,98,220,218,98,98,220,0,0,0,0,218,98,98,220,0,0,0,0,218,98,98,220,0,0,0,0,218,98,98,220,218,98,220,219, - 98,98,98,98,98,98,98,220,218,98,98,220,0,0,0,0,218,98,98,220,0,0,0,0,218,98,98,220,0,0,0,0,218,98,98,220,218,98,139,179, - 98,98,98,98,98,98,98,220,218,98,98,220,0,0,0,0,218,98,98,220,0,0,0,0,218,98,98,220,0,0,0,0,218,98,98,220,218,98,98,98, - 259,259,259,259,259,259,259,260,218,98,98,220,0,0,0,0,218,98,98,220,0,0,0,0,218,98,98,220,0,0,0,0,218,98,98,220,258,259,259,259, - 0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,218,98,98,220,0,0,0,0,218,98,98,220,0,0,0,0,218,98,98,220,0,0,0,0, - 0,0,0,0,0,0,0,0,258,259,259,260,0,0,0,0,258,259,259,260,0,0,0,0,258,259,259,260,0,0,0,0,258,259,259,260,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179, - 98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98, - 259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259, - 219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - 219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - }; - - if(!game.nodeathmode) - { - obj.createblock(1, 20, 0, 32, 240, 13); //scene 2 - } - obj.createentity(104, 120, 1, 0, 3); // Enemy - obj.createentity(168, 176, 1, 1, 3); // Enemy - obj.createentity(232, 120, 1, 0, 3); // Enemy - - warpy = true; - roomname = "Don't Get Ahead of Yourself!"; - result = contents; - break; - } - - case rn(44,56): - { - - static const short contents[] = { - 98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98, - 259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,178,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,178,179,179,180,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98, - 179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,180,218,98,98,220,218,98,99,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259, - 98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,218,98,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - 259,259,259,259,259,259,259,259,259,259,259,259,259,259,100,98,220,218,98,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - 219,219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - 219,219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - 219,219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - 219,219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - 219,219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - 179,179,179,179,179,179,179,179,179,179,179,179,179,179,140,98,220,258,259,259,260,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - 98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,0,0,0,0,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - 259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,260,0,0,0,0,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,139,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,258,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,178,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179, - 259,259,259,259,259,259,259,259,259,259,259,259,259,100,98,220,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98, - 219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,99,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259, - 219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - }; - - obj.createentity(144, 40, 10, 1, 56440); // (savepoint) - - if(!game.nodeathmode) - { - obj.createblock(1, 200, 0, 32, 240, 42); //scene 3 - } - - - roomname = "Very Good"; - warpy = true; - result = contents; - break; - } - - case rn(45,56): - { - - static const short contents[] = { - 98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,218,98,220,219,219,219,219,219, - 259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,260,218,98,220,219,219,219,219,219, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,219,219,219,219, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,219,219,219,219, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,219,219,219,219, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,219,219,219,219, - 179,179,179,179,179,179,179,180,178,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,180,0,0,0,0,218,98,220,219,219,219,219,219, - 98,98,98,98,98,98,98,220,258,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,260,0,0,0,0,218,98,220,219,219,219,219,219, - 259,259,259,259,259,100,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,219,219,219,219, - 219,219,219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,219,219,219,219, - 219,219,219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,139,179,179,179,179,179, - 219,219,219,219,219,218,98,220,0,0,0,0,178,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,180,218,98,98,98,98,98,98,98, - 219,219,219,219,219,218,98,220,0,0,0,0,258,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,260,258,259,259,259,259,259,259,259, - 219,219,219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 219,219,219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 219,219,219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 219,219,219,219,219,218,98,220,178,179,179,180,178,179,179,180,178,179,179,179,179,179,179,180,178,179,179,180,178,179,179,179,180,0,0,0,0,0,0,0, - 219,219,219,219,219,218,98,220,218,98,98,220,258,259,259,260,218,98,98,98,98,98,98,220,258,259,259,260,218,98,98,98,220,0,0,0,0,0,0,0, - 219,219,219,219,219,218,98,220,218,98,98,220,0,0,0,0,218,98,98,98,98,98,98,220,0,0,0,0,218,98,98,98,220,178,179,179,179,179,179,179, - 179,179,179,179,179,140,98,220,218,98,98,220,0,0,0,0,218,98,98,98,98,98,98,220,0,0,0,0,218,98,98,98,220,218,98,98,98,98,98,98, - 98,98,98,98,98,98,98,220,218,98,98,220,0,0,0,0,258,259,259,259,259,259,259,260,0,0,0,0,218,98,98,98,220,218,98,98,98,98,98,98, - 259,259,259,259,259,259,259,260,218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,98,220,258,259,259,259,259,259,259, - 0,0,0,0,0,0,0,0,258,259,259,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,258,259,259,259,260,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179, - 98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98, - 259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259, - 219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - }; - - obj.createentity(104, 152, 1, 0, 3); // Enemy - obj.createentity(200, 152, 1, 0, 3); // Enemy - - roomname = "Must I Do Everything For You?"; - warpy = true; - - result = contents; - break; - } - - case rn(46,56): - { - - static const short contents[] = { - 219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - 219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - 219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - 219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - 219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - 219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - 219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - 219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - 219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - 219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - 179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,140,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - 98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - 259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,260,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - 179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,180,0,0,0,0,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - 98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,0,0,0,0,218,98,139,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179, - 98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,0,0,0,0,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98, - 259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,260,0,0,0,0,258,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179, - 98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98, - 259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259, - 219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - }; - - obj.createentity(56, 192, 10, 1, 56460); // (savepoint) - - if(!game.nodeathmode) - { - obj.createblock(1, 200, 0, 32, 240, 43); //scene 3 - } - - roomname = "Now Stay Close To Me..."; - warpy = true; - result = contents; - break; - } - - case rn(47,56): - { - - static const short contents[] = { - 219,219,219,218,98,220,218,98,139,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179, - 219,219,219,218,98,220,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98, - 219,219,219,218,98,220,258,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259, - 219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,178,179,179,180,178,179,179,179,179,179,179,179,179,179,179,179,179,179, - 219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,218,98,98,98,98,98,98,98,98,98,98,98,98,98, - 219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,218,98,99,259,259,259,259,259,259,259,259,259,259,259, - 219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219, - 219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219, - 219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,258,259,259,260,218,98,220,219,219,219,219,219,219,219,219,219,219,219, - 219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,220,219,219,219,219,219,219,219,219,219,219,219, - 219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,220,219,219,219,219,219,219,219,219,219,219,219, - 219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,220,219,219,219,219,219,219,219,219,219,219,219, - 219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,220,219,219,219,219,219,219,219,219,219,219,219, - 219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,220,219,219,219,219,219,219,219,219,219,219,219, - 179,179,179,140,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,220,219,219,219,219,219,219,219,219,219,219,219, - 98,98,98,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,220,219,219,219,219,219,219,219,219,219,219,219, - 259,259,259,259,259,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,178,179,179,180,218,98,220,219,219,219,219,219,219,219,219,219,219,219, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219, - 179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,180,0,0,0,0,218,98,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219, - 98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,6,6,6,6,218,98,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219, - 259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,100,98,220,178,179,179,180,218,98,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219, - 219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,98,220,218,98,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219, - }; - - obj.createentity(144, 64, 2, 0, 2, 144, 64, 176, 216); // Platform, bounded - - roomname = "...But Not Too Close"; - warpy = true; - result = contents; - break; - } - - case rn(48,56): - { - - static const short contents[] = { - 179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,140,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219, - 98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219, - 259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,260,218,98,220,219,219,219,219,219,219,219,219,219,219,219, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,178,179,179,179,180,218,98,220,219,219,219,219,219,219,219,219,219,219,219, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,258,259,259,259,260,218,98,220,219,219,219,219,219,219,219,219,219,219,219, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,178,180,218,98,220,219,219,219,219,219,219,219,219,219,219,219, - 179,179,179,179,179,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219, - 98,98,98,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219, - 259,259,259,100,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,258,260,218,98,220,219,219,219,219,219,219,219,219,219,219,219, - 219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,220,219,219,219,219,219,219,219,219,219,219,219, - 219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,220,219,219,219,219,219,219,219,219,219,219,219, - 219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,220,219,219,219,219,219,219,219,219,219,219,219, - 219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,220,219,219,219,219,219,219,219,219,219,219,219, - 219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,220,219,219,219,219,219,219,219,219,219,219,219, - 219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,220,219,219,219,219,219,219,219,219,219,219,219, - 219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,139,179,179,179,179,179,179,179,179,179,179,179, - 219,219,219,218,98,220,0,0,0,0,0,0,0,0,178,179,179,179,179,179,179,180,0,0,0,50,218,98,98,98,98,98,98,98,98,98,98,98,98,98, - 219,219,219,218,98,220,0,0,0,0,0,0,0,0,218,98,98,98,98,98,98,220,0,0,0,50,258,259,259,259,259,259,259,259,259,259,259,259,259,259, - 219,219,219,218,98,220,0,0,0,0,0,0,0,0,218,98,98,98,98,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 219,219,219,218,98,220,0,0,0,0,0,0,0,0,218,98,98,98,98,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 219,219,219,218,98,220,0,0,0,0,0,0,0,0,218,98,98,98,98,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 219,219,219,218,98,220,6,6,6,6,6,6,6,6,258,259,259,259,259,259,259,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 219,219,219,218,98,220,178,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179, - 219,219,219,218,98,220,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98, - 219,219,219,218,98,220,218,98,99,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259, - 219,219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - 219,219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - 219,219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - }; - - warpy = true; - roomname = "Don't Be Afraid"; - result = contents; - break; - } - - case rn(49,56): - { - - static const short contents[] = { - 219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - 219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - 219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - 219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - 219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - 219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - 219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - 219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - 219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - 219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - 219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - 219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - 219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - 219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - 219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - 219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - 219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - 179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179, - 98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98, - 259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179, - 98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98, - 259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259, - 219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - 219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - 219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - }; - - obj.createentity(152, 176, 10, 1, 56490); // (savepoint) - if(!game.nodeathmode) - { - obj.createblock(1, 200, 0, 32, 240, 44); //scene 3 - } - warpy = true; - roomname = "Do as I Say..."; - result = contents; - break; - } - - case rn(50,56): - { - - static const short contents[] = { - 219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - 219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - 219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - 219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - 219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - 219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - 219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - 219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - 219,219,218,98,220,218,98,139,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179, - 219,219,218,98,220,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98, - 219,219,218,98,220,258,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259, - 219,219,218,98,220,178,179,179,180,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, - 219,219,218,98,220,218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 219,219,218,98,220,218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 219,219,218,98,220,258,259,259,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 179,179,140,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 98,98,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 259,259,259,259,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,178,179,179,179,179,179,179,179,180,178,179, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,98,98,98,98,98,220,218,98, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,258,259,259,259,259,259,259,259,260,218,98, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98, - 179,179,179,179,179,179,179,179,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98, - 98,98,98,98,98,98,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98, - 259,259,259,259,259,259,100,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,178,179,179,180,218,98, - 219,219,219,219,219,219,218,98,220,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,218,98,98,220,218,98, - 219,219,219,219,219,219,218,98,220,178,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,180,218,98,98,220,218,98, - 219,219,219,219,219,219,218,98,220,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,218,98,98,220,218,98, - }; - - obj.createentity(88, 200, 2, 1, 4, 88, 128, 216, 208); // Platform, bounded - obj.createentity(136, 136, 2, 0, 4, 88, 128, 216, 208); // Platform, bounded - obj.createentity(184, 200, 2, 1, 4, 88, 128, 216, 208); // Platform, bounded - - roomname = "...Not as I Do"; - warpy = true; - result = contents; - break; - } - - case rn(51,56): - { - - static const short contents[] = { - 219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,98,220,218,98,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - 219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,98,220,218,98,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - 219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,98,220,218,98,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - 219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,98,220,218,98,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - 219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,98,220,218,98,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - 219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,98,220,218,98,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - 219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,98,220,218,98,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - 219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,98,220,218,98,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - 179,179,179,179,179,179,179,179,179,179,179,140,98,220,218,98,98,220,218,98,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - 98,98,98,98,98,98,98,98,98,98,98,98,98,220,218,98,98,220,218,98,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - 259,259,259,259,259,259,259,259,259,259,259,259,259,260,218,98,98,220,218,98,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,258,259,259,260,218,98,98,220,218,98,139,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,258,259,259,260,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,258,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179, - 98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98, - 259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259, - 219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - 219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - 219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - 219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - 219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - 219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - 219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - 219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - }; - - obj.createentity(192, 136, 10, 1, 56510); // (savepoint) - if(!game.nodeathmode) - { - obj.createblock(1, 80, 0, 32, 240, 45); //scene 3 - } - warpy = true; - roomname = "Mind Your Head"; - result = contents; - break; - } - - case rn(52,56): - { - - static const short contents[] = { - 219,218,98,220,258,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,260,218,98,220,219, - 219,218,98,220,7,7,7,7,7,178,180,7,7,7,7,7,7,7,178,180,7,7,7,7,178,179,179,180,7,7,7,7,7,7,7,7,218,98,220,219, - 219,218,98,220,0,0,0,0,0,218,220,0,0,0,0,0,0,0,218,220,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,0,218,98,220,219, - 219,218,98,220,0,0,0,0,0,258,260,0,0,0,0,0,0,0,258,260,0,0,0,0,258,259,259,260,0,0,0,0,0,0,0,0,218,98,139,179, - 219,218,98,220,0,0,0,0,0,7,7,0,0,0,0,0,0,0,7,7,0,0,0,0,7,7,7,7,0,0,0,0,0,0,0,0,218,98,98,98, - 219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,258,259,259,259, - 219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,7,7,7, - 219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 179,140,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,178,179,179,179, - 98,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,98, - 259,259,259,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,99,259, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219, - 179,179,179,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219, - 98,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219, - 259,100,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219, - 219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219, - 219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219, - 219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219, - 219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219, - 219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219, - 219,218,98,220,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,218,98,220,219, - 219,218,98,220,178,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,180,218,98,220,219, - 219,218,98,220,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,218,98,220,219, - }; - - obj.createentity(48, 200, 2, 1, 6, 48, 48, 272, 208); // Platform, bounded - obj.createentity(80, 200, 2, 1, 6, 48, 48, 272, 208); // Platform, bounded - obj.createentity(112, 200, 2, 1, 6, 48, 48, 272, 208); // Platform, bounded - obj.createentity(144, 200, 2, 1, 6, 48, 48, 272, 208); // Platform, bounded - obj.createentity(176, 200, 2, 1, 6, 48, 48, 272, 208); // Platform, bounded - obj.createentity(208, 200, 2, 1, 6, 48, 48, 272, 208); // Platform, bounded - obj.createentity(240, 200, 2, 1, 6, 48, 48, 272, 208); // Platform, bounded - - roomname = "Do Try To Keep Up"; - warpy = true; - result = contents; - break; - } - - case rn(53,56): - { - - static const short contents[] = { - 219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,220,219,219,219,219,219, - 219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,220,219,219,219,219,219, - 219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,220,219,219,219,219,219, - 179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,140,98,220,218,98,220,219,219,219,219,219, - 98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,218,98,220,219,219,219,219,219, - 259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,260,218,98,220,219,219,219,219,219, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,219,219,219,219, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,219,219,219,219, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,219,219,219,219, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,219,219,219,219, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,219,219,219,219, - 179,179,179,179,179,179,179,180,178,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,180,0,0,218,98,220,219,219,219,219,219, - 98,98,98,98,98,98,98,220,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,0,0,218,98,220,219,219,219,219,219, - 259,259,259,259,259,100,98,220,258,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,260,0,0,218,98,220,219,219,219,219,219, - 219,219,219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,219,219,219,219, - 219,219,219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,219,219,219,219, - 219,219,219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,219,219,219,219, - 219,219,219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,219,219,219,219, - 219,219,219,219,219,218,98,220,0,0,178,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,180,218,98,139,179,179,179,179,179, - 219,219,219,219,219,218,98,220,0,0,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,218,98,98,98,98,98,98,98, - 219,219,219,219,219,218,98,220,0,0,258,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,260,258,259,259,259,259,259,259,259, - 219,219,219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 219,219,219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 219,219,219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 219,219,219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 219,219,219,219,219,218,98,220,178,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179, - 219,219,219,219,219,218,98,220,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98, - 219,219,219,219,219,218,98,220,218,98,99,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259, - 219,219,219,219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - 219,219,219,219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - }; - - obj.createentity(72, 72, 10, 1, 56530); // (savepoint) - - roomname = "You're Falling Behind"; - warpy = true; - result = contents; - break; - } - - case rn(54,56): - { - - static const short contents[] = { - 219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,220,219,219,219,219, - 219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,220,219,219,219,219, - 219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,220,219,219,219,219, - 219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,220,219,219,219,219, - 219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,220,219,219,219,219, - 219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,220,219,219,219,219, - 219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,139,179,179,179,179,179,179,179,179,179,179,179,140,98,220,218,98,220,219,219,219,219, - 219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,218,98,220,219,219,219,219, - 219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,258,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,260,218,98,220,219,219,219,219, - 219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,219,219,219, - 219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,219,219,219, - 219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,219,219,219, - 219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,219,219,219, - 219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,219,219,219, - 219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,219,219,219, - 219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,219,219,219, - 219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,219,219,219, - 219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,219,219,219, - 179,179,179,179,179,179,179,179,179,179,179,179,179,140,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,219,219,219, - 98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,219,219,219, - 259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,219,219,219, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,219,219,219, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,139,179,179,179,179, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,98,98,98,98, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,258,259,259,259,259,259,259, - 179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179, - 98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98, - 259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259, - 219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - 219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, - }; - - obj.createentity((18 * 8) + 4, (10 * 8) + 4, 14); //Teleporter! - - if(!game.nodeathmode) - { - obj.createblock(1, 104, 0, 32, 240, 46); //scene 3 - } - - roomname = "Class Dismissed!"; - warpy = true; - result = contents; - break; - } + case rn(50,52): + { + + static const short contents[] = { + 98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,0,0,0,0,0,0,0,218,98,98,98, + 98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,0,0,0,0,0,0,0,218,98,98,98, + 259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,260,0,0,0,0,0,0,0,258,259,259,259, + 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,0,0,0,0,0,0,0,7,7,7,7, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,0,0,0,0,0,0,0,6,6,6,6,6,6,6,6,6,6,6,6, + 179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,180,0,0,0,0,0,0,0,178,179,179,179,179,179,179,179,179,179,179,179, + 98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,0,0,0,0,0,0,0,218,98,98,98,98,98,98,98,98,98,98,98, + 98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,0,0,0,0,0,0,0,218,98,98,98,98,98,98,98,98,98,98,98, + 98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,0,0,0,0,0,0,0,218,98,98,98,98,98,98,98,98,98,98,98, + }; + + obj.createentity(163, 32, 12, 168); // (vertical gravity line) + obj.createentity(99, 32, 12, 168); // (vertical gravity line) + obj.createentity(227, 32, 12, 168); // (vertical gravity line) + obj.createentity(35, 32, 12, 168); // (vertical gravity line) + obj.createentity(291, 32, 12, 168); // (vertical gravity line) + + warpx = true; + roomname = "1954 World Cup Vinyl"; + result = contents; + break; + } + + case rn(50,51): + { + + static const short contents[] = { + 0,0,0,218,98,98,220,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,218,98,220,740, + 0,0,0,258,259,259,260,0,0,0,0,0,0,0,258,259,259,260,0,0,0,0,0,0,0,258,259,259,260,0,0,0,0,0,0,0,218,98,220,740, + 0,0,0,7,7,7,7,0,0,0,0,0,0,0,7,7,7,7,0,0,0,0,0,0,0,7,7,7,7,0,0,0,0,0,0,0,218,98,220,740, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740, + 0,0,0,0,178,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,178,179,179,179,179,179,180,218,98,220,740, + 0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,98,98,98,220,218,98,220,740, + 0,0,0,0,258,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,258,259,259,259,259,259,260,218,98,220,740, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740, + 0,0,0,6,6,6,6,0,0,0,0,0,0,0,6,6,6,6,0,0,0,0,0,0,0,6,6,6,6,0,0,0,0,0,0,0,218,98,220,740, + 0,0,0,178,179,179,180,0,0,0,0,0,0,0,178,179,179,180,0,0,0,0,0,0,0,178,179,179,180,0,0,0,0,0,0,0,218,98,220,740, + 0,0,0,218,98,98,220,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,218,98,220,740, + 0,0,0,218,98,98,220,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,218,98,220,740, + }; + + obj.createentity(-8, 116, 11, 40); // (horizontal gravity line) + obj.createentity(48, 116, 11, 184); // (horizontal gravity line) + obj.createentity(32, 88, 10, 1, 51500); // (savepoint) + obj.createentity(32, 128, 10, 0, 51501); // (savepoint) + obj.createentity(256, 88, 10, 1, 51502); // (savepoint) + obj.createentity(256, 128, 10, 0, 51503); // (savepoint) + warpy = true; + roomname = "The V Stooges"; + result = contents; + break; + } + + + case rn(49,51): + { + + static const short contents[] = { + 0,0,0,0,0,0,0,0,0,0,50,218,98,98,220,49,0,0,0,0,0,0,0,0,50,218,98,98,220,49,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,50,258,259,259,260,49,0,0,0,0,0,0,0,0,50,258,259,259,260,49,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,7,7,7,7,0,0,0,0,0,0,0,0,0,0,7,7,7,7,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,6,6,6,0,0,0,0,0,0,0,0,0,0,6,6,6,6,6,6,0,0,0,0,0,0,0,0,0,0,6,6,6,0,0,0,0, + 0,0,0,0,178,179,180,49,0,0,0,0,0,0,0,0,50,178,179,179,179,179,180,49,0,0,0,0,0,0,0,0,50,178,179,180,0,0,0,0, + 0,0,0,0,218,98,220,49,0,0,0,0,0,0,0,0,50,218,98,98,98,98,220,49,0,0,0,0,0,0,0,0,50,218,98,220,0,0,0,0, + 0,0,0,0,258,259,260,49,0,0,0,0,0,0,0,0,50,258,259,259,259,259,260,49,0,0,0,0,0,0,0,0,50,258,259,260,0,0,0,0, + 0,0,0,0,7,7,7,0,0,0,0,0,0,0,0,0,0,7,7,7,7,7,7,0,0,0,0,0,0,0,0,0,0,7,7,7,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,6,6,6,6,0,0,0,0,0,0,0,0,0,0,6,6,6,6,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,50,178,179,179,180,49,0,0,0,0,0,0,0,0,50,178,179,179,180,49,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,50,218,98,98,220,49,0,0,0,0,0,0,0,0,50,218,98,98,220,49,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,50,218,98,98,220,49,0,0,0,0,0,0,0,0,50,218,98,98,220,49,0,0,0,0,0,0,0,0,0,0, + }; + + obj.createentity(-8, 116, 11, 40); // (horizontal gravity line) + obj.createentity(288, 116, 11, 32); // (horizontal gravity line) + obj.createentity(64, 116, 11, 64); // (horizontal gravity line) + obj.createentity(192, 116, 11, 64); // (horizontal gravity line) + + warpy = true; + roomname = "glitch"; + result = contents; + break; + } + + case rn(48,51): + { + + static const short contents[] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,178,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,178,180,0,0,0,0, + 0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0, + 0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0, + 0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0, + 0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0, + 0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0, + 0,0,0,0,258,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,258,260,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + obj.createentity(-8, 116, 11, 40); // (horizontal gravity line) + obj.createentity(48, 116, 11, 224); // (horizontal gravity line) + obj.createentity(288, 116, 11, 32); // (horizontal gravity line) + obj.createentity(56, 88, 1, 3, 10); // Enemy + obj.createentity(248-16, 128, 1, 2, 10); // Enemy + obj.createentity(272, 168, 10, 0, 51480); // (savepoint) + obj.createentity(32, 48, 10, 1, 51481); // (savepoint) + + warpy = true; + roomname = "glitch"; + result = contents; + break; + } + + case rn(47,51): + { + + static const short contents[] = { + 0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,258,260,0,0,0,0,0,0,258,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,178,179,179,179,179,179,179,179,179,179,179,179,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,218,98,98,98,98,98,98,98,98,98,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,258,259,259,259,259,259,259,259,259,259,259,259,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,178,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,178,180,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + obj.createentity(-8, 148, 11, 104); // (horizontal gravity line) + obj.createentity(-8, 84, 11, 80); // (horizontal gravity line) + obj.createentity(176, 116, 11, 144); // (horizontal gravity line) + obj.createentity(128, 96, 10, 0, 51470); // (savepoint) + obj.createentity(128, 56, 10, 1, 51471); // (savepoint) + + warpy = true; + roomname = "change"; + result = contents; + break; + } + + case rn(46,51): + { + + static const short contents[] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + obj.createentity(-8, 84, 11, 328); // (horizontal gravity line) + obj.createentity(-8, 148, 11, 328); // (horizontal gravity line) + obj.createentity(96, 120, 1, 2, 4); // Enemy + obj.createentity(144, 96, 1, 2, 4); // Enemy + obj.createentity(192, 120, 1, 2, 4); // Enemy + obj.createentity(240, 96, 1, 2, 4); // Enemy + obj.createentity(288, 120, 1, 2, 4); // Enemy + + warpy = true; + roomname = "change"; + result = contents; + break; + } + + case rn(45,51): + { + + static const short contents[] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,258,260,0,0,0,0,0,0,258,260,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,178,179,179,179,179,179,179,179,179,179,179,179,180,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,98,98,98,98,98,98,98,98,98,220,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,258,259,259,259,259,259,259,259,259,259,259,259,260,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,178,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,178,180,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + obj.createentity(248, 84, 11, 72); // (horizontal gravity line) + obj.createentity(224, 148, 11, 96); // (horizontal gravity line) + obj.createentity(176, 56, 10, 1, 51450); // (savepoint) + obj.createentity(176, 96, 10, 0, 51451); // (savepoint) + + warpy = true; + roomname = "change"; + result = contents; + break; + } + + + case rn(44,51): + { + + static const short contents[] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + obj.createentity(64+32-8, 32-16, 1, 0, 7, 0, -48, 320, 312); // Enemy, bounded + obj.createentity(96+32-8, 32-16, 1, 0, 7, 0, -56, 320, 320); // Enemy, bounded + obj.createentity(128+32-8, 32-16, 1, 0, 7, 0, -40, 320, 320); // Enemy, bounded + obj.createentity(160+32-8, 32-16, 1, 0, 7, 0, -56, 320, 320); // Enemy, bounded + obj.createentity(192+32-8, 32-16, 1, 0, 7, 0, -64, 320, 336); // Enemy, bounded + obj.createentity(64+32-8, 64-16, 1, 0, 7, 0, -56, 320, 320); // Enemy, bounded + obj.createentity(64+32-8, 96-16, 1, 0, 7, 0, -56, 320, 320); // Enemy, bounded + obj.createentity(64+32-8, 128-16, 1, 0, 7, 0, -64, 320, 320); // Enemy, bounded + obj.createentity(64+32-8, 160-16, 1, 0, 7, 0, -56, 320, 320); // Enemy, bounded + obj.createentity(192+32-8, 128-16+8, 1, 0, 7, 0, -64, 320, 320); // Enemy, bounded + obj.createentity(192+32-8, 160-16+8, 1, 0, 7, 0, -80, 320, 320); // Enemy, bounded + obj.createentity(192+32-8, 192-16+8, 1, 0, 7, 0, -80, 320, 304); // Enemy, bounded + obj.createentity(192+32-8, 192+24, 1, 0, 7, 0, -80, 320, 304); // Enemy, bounded + + warpy = true; + roomname = "Vertigo"; + result = contents; + break; + } + + case rn(43,51): + { + + static const short contents[] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,258,259,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,7,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,6,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,178,179,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + obj.createentity(155, 24, 12, 184); // (vertical gravity line) + obj.createentity(120, 152, 1, 1, 8, 0, -56, 320, 296); // Enemy, bounded + obj.createentity(104, 136, 1, 1, 8, 0, -64, 320, 296); // Enemy, bounded + obj.createentity(88, 120, 1, 1, 8, 0, -56, 320, 312); // Enemy, bounded + obj.createentity(72, 104, 1, 1, 8, 0, -56, 320, 296); // Enemy, bounded + obj.createentity(56, 88, 1, 1, 8, 0, -48, 320, 328); // Enemy, bounded + obj.createentity(176, 56, 1, 0, 8, 0, -64, 320, 288); // Enemy, bounded + obj.createentity(192, 72, 1, 0, 8, 0, -48, 320, 296); // Enemy, bounded + obj.createentity(208, 88, 1, 0, 8, 0, -72, 320, 296); // Enemy, bounded + obj.createentity(224, 104, 1, 0, 8, 0, -56, 320, 296); // Enemy, bounded + obj.createentity(240, 120, 1, 0, 8, 0, -48, 320, 296); // Enemy, bounded + + warpy = true; + roomname = "The Voon Show"; + result = contents; + break; + } + + case rn(42,51): + { + + static const short contents[] = { + 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,140,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 179,179,180,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,178,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,178,179,179,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 259,259,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,258,260,258,259,259,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,50,740,49,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,50,740,49,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 179,179,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,178,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 259,259,260,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,258,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,100,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + obj.createentity(168, 72, 10, 0, 51420); // (savepoint) + obj.createentity(24, 60, 11, 120); // (horizontal gravity line) + obj.createentity(24, 148, 11, 120); // (horizontal gravity line) + + warpy = true; + roomname = "glitch"; + result = contents; + break; + } + + + case rn(41,51): + { + + static const short contents[] = { + 740,740,218,98,220,258,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,260,218,220,218,98,220,740,740,740,740,740,740, + 740,740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,218,98,220,740,740,740,740,740,740, + 740,740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,218,98,220,740,740,740,740,740,740, + 740,740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,218,98,220,740,740,740,740,740,740, + 740,740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,218,98,220,740,740,740,740,740,740, + 740,740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,218,98,220,740,740,740,740,740,740, + 179,179,140,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,218,98,139,179,179,179,179,179,179, + 98,98,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,218,98,98,98,98,98,98,98,98, + 259,259,259,259,260,0,0,0,0,0,6,6,0,0,0,0,0,0,0,0,0,0,0,6,6,0,0,0,0,218,220,258,259,259,259,259,259,259,259,259, + 0,0,0,178,180,0,0,0,0,0,178,180,0,0,0,0,0,0,0,0,0,0,0,178,180,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0, + 0,0,0,218,220,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0, + 0,0,0,218,220,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0, + 0,0,0,218,220,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0, + 0,0,0,218,220,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,258,260,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0, + 0,0,0,218,220,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,7,7,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0, + 0,0,0,218,220,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0, + 0,0,0,258,260,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0, + 179,179,179,179,180,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,178,179,179,179,179, + 98,98,98,98,220,0,0,0,0,0,218,220,0,0,0,0,6,6,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,218,98,98,98,98, + 98,98,98,98,220,0,0,0,0,0,218,220,0,0,0,0,740,740,0,0,0,0,0,0,0,0,0,0,0,258,260,0,0,0,0,218,98,98,98,98, + 98,98,98,98,220,0,0,0,0,0,218,220,0,0,0,0,7,7,0,0,0,0,0,0,0,0,0,0,0,7,7,0,0,0,0,218,98,98,98,98, + 259,259,100,98,220,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,98,98, + 740,740,218,98,220,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,98,98, + 740,740,218,98,220,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,258,259,259,259,259, + 740,740,218,98,220,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,178,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179, + 740,740,218,98,220,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98, + 740,740,218,98,220,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,218,98,99,259,259,259,259,259,259,259,259,259,259,259,259,259,259, + 740,740,218,98,220,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740,740,740,740,740,740,740,740,740,740,740,740,740,740, + 740,740,218,98,220,0,0,0,0,0,218,220,178,179,179,179,179,179,179,179,179,179,180,218,98,220,740,740,740,740,740,740,740,740,740,740,740,740,740,740, + 740,740,218,98,220,0,0,0,0,0,218,220,218,98,98,98,98,98,98,98,98,98,220,218,98,220,740,740,740,740,740,740,740,740,740,740,740,740,740,740, + }; + + obj.createentity(280, 120, 10, 1, 51410); // (savepoint) + obj.createentity(40, 28, 11, 192); // (horizontal gravity line) + obj.createentity(96, 204, 11, 88); // (horizontal gravity line) + obj.createentity(144, 156, 11, 88); // (horizontal gravity line) + obj.createentity(96, 92, 11, 88); // (horizontal gravity line) + + warpx = true; + roomname = "1950 Silverstone Grand V"; + result = contents; + break; + } + + + case rn(41,52): + { + + static const short contents[] = { + 740,740,218,98,220,0,0,0,0,0,218,98,220,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, + 179,179,140,98,220,0,0,0,0,0,218,98,139,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179, + 98,98,98,98,220,0,0,0,0,0,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98, + 259,259,259,259,260,0,0,0,0,0,258,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259, + 0,0,0,0,0,0,0,0,0,0,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,740,740,740,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,740,740,740,0,0,0,0, + 740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,740,740,740,740,0,0,0,0,0,0,740,740,740,740,0,0,0,0,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,740,740,740,0,0,0,0,0,0,0,0,740,740,740,0,0,0,0,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740, + 0,0,0,0,0,0,0,0,0,740,740,740,0,0,0,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,740,740,0,0,0,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,740,740,0,0,0,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,740,740,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,740,740,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,740,740,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 179,179,179,179,180,0,0,0,0,0,178,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179, + 98,98,98,98,220,0,0,0,0,0,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98, + 259,259,100,98,220,0,0,0,0,0,218,98,99,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259, + 740,740,218,98,220,0,0,0,0,0,218,98,220,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, + 740,740,218,98,220,0,0,0,0,0,218,98,220,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, + 740,740,218,98,220,0,0,0,0,0,218,98,220,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, + 740,740,218,98,220,0,0,0,0,0,218,98,220,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, + }; + + obj.createentity(264, 168, 10, 1, 52410); // (savepoint) + obj.createentity(152, 112, 20, 1); // (terminal) + + if(!obj.flags[72]) + { + if (game.intimetrial || game.nocutscenes) + { + obj.createblock(1, 152 - 4, 112, 20, 16, 85); + } + else + { + obj.createblock(5, 152 - 4, 112, 20, 16, 13); + } + } + + warpx = true; + warpy = true; + roomname = "DIY V Repair"; + result = contents; + break; + }; + + case rn(42,52): + { + + static const short contents[] = { + 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, + 179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179, + 98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98, + 259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 179,179,179,179,179,179,179,179,179,179,179,179,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,178,179,179,179,179,179,179,179,179,179,179,179,179, + 98,98,98,98,98,98,98,98,98,98,98,98,220,6,6,6,6,6,6,6,6,6,6,6,6,6,6,218,98,98,98,98,98,98,98,98,98,98,98,98, + 259,259,259,259,259,259,259,259,259,259,100,98,220,178,179,179,179,179,179,179,179,179,179,179,179,179,180,218,98,99,259,259,259,259,259,259,259,259,259,259, + 740,740,740,740,740,740,740,740,740,740,218,98,220,218,98,98,98,98,98,98,98,98,98,98,98,98,220,218,98,220,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,218,98,220,218,98,99,259,259,259,259,259,259,259,259,100,98,220,218,98,220,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,218,98,220,218,98,220,740,740,740,740,740,740,740,740,218,98,220,218,98,220,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,218,98,220,218,98,220,740,740,740,740,740,740,740,740,218,98,220,218,98,220,740,740,740,740,740,740,740,740,740,740, + }; + roomname = "Party Time!"; + result = contents; + break; + } + + + case rn(43,52): + { + + static const short contents[] = { + 218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220, + 218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220,258,259,259,260,218,98,98,220,218,98,98,220,218,98,98,220, + 218,98,98,220,218,98,98,220,218,98,98,220,258,259,259,260,218,98,98,220,258,259,259,260,0,0,0,0,258,259,259,260,218,98,98,220,218,98,98,220, + 218,98,98,220,218,98,98,220,258,259,259,260,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,218,98,98,220, + 218,98,98,220,258,259,259,260,0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,218,98,98,220, + 218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,218,98,98,220, + 218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,218,98,98,220, + 218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,218,98,98,220, + 218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,218,98,98,220, + 218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,218,98,98,220, + 218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,258,259,259,260,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,218,98,98,220, + 218,98,98,220,0,0,0,0,178,179,179,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,218,98,98,220, + 258,259,259,260,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,218,98,98,220, + 0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,178,179,179,180,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,218,98,98,220, + 0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,258,259,259,260,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,218,98,98,220, + 0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,178,179,179,180,0,0,0,0,218,98,98,220,218,98,98,220, + 0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,258,259,259,260,0,0,0,0,218,98,98,220,218,98,98,220, + 0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,258,259,259,260, + 0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,258,259,259,260,0,0,0,0, + 0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,178,179,179,180,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,178,179,179,180,218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0, + 178,179,179,180,218,98,98,220,218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,178,179,179,180,0,0,0,0,0,0,0,0, + 218,98,98,220,218,98,98,220,218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,218,98,98,220,178,179,179,180,0,0,0,0, + 218,98,98,220,218,98,98,220,218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,218,98,98,220,218,98,98,220,178,179,179,180, + 218,98,98,220,218,98,98,220,218,98,98,220,178,179,179,180,0,0,0,0,178,179,179,180,218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220, + 218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220,178,179,179,180,218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220, + 218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220, + 218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220, + }; + + obj.createentity(264, 176, 10, 1, 52430); // (savepoint) + obj.createentity(96, 180, 11, 96); // (horizontal gravity line) + obj.createentity(160, 52, 11, 96); // (horizontal gravity line) + obj.createentity(240, 136, 1, 2, 8); // Enemy + obj.createentity(96, 88, 1, 3, 8); // Enemy + obj.createentity(72, 32, 10, 0, 52431); // (savepoint) + roomname = "Upstairs, Downstairs"; + result = contents; + break; + } + + + case rn(44,52): + { + + static const short contents[] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,218,98,98,98,98,98,98,98, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,218,98,98,98,98,98,98,98, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,258,259,259,260,258,259,259,259,259,259,259,259, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,178,179,179,180,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,0,178,179,179, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,0,218,98,98, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,0,218,98,98, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,0,218,98,98, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,0,218,98,98, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,0,218,98,98, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,258,259,259,260,0,0,0,0,0,218,98,98, + 179,179,179,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98, + 98,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98, + 98,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98, + 259,259,259,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98, + 0,0,0,0,0,0,0,178,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98, + 179,179,179,179,179,179,180,218,220,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,218,98,98, + 98,98,98,98,98,98,220,218,220,178,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,180,218,98,98, + 98,98,98,98,98,98,220,218,220,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,218,98,98, + 98,98,98,98,98,98,220,218,220,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,218,98,98, + 98,98,98,98,98,98,220,218,220,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,218,98,98, + }; + + obj.createentity(64, 112, 2, 11, 4); //Big Threadmill, <<<<<< + obj.createentity(128, 112, 2, 11, 4); //Big Threadmill, <<<<<< + obj.createentity(192, 112, 2, 11, 4); //Big Threadmill, <<<<<< + obj.createentity(32, 112, 2, 9, 4); //Threadmill, <<< + + obj.createentity(0, 104, 2, 10, 4); //Big Threadmill, >>>>>> + obj.createentity(64, 104, 2, 10, 4); //Big Threadmill, >>>>>> + obj.createentity(128, 104, 2, 10, 4); //Big Threadmill, >>>>>> + obj.createentity(192, 104, 2, 8, 4); //Threadmill, >>> + + obj.createentity(80+8, 128, 1, 0, 5, 0, 120, 320, 200); // Enemy, bounded + obj.createentity(128+16, 168, 1, 1, 5, 0, 120, 320, 200); // Enemy, bounded + obj.createentity(176+24, 128, 1, 0, 5, 0, 120, 320, 200); // Enemy, bounded + //obj.createentity(224, 168, 1, 1, 5, 0, 120, 320, 200); // Enemy, bounded + obj.createentity(24, 184, 10, 1, 52440); // (savepoint) + roomname = "Timeslip"; + result = contents; + break; + } + + case rn(45,52): + { + + static const short contents[] = { + 98,98,98,98,98,98,98,220,218,98,220,740,740,740,740,740,740,218,98,220,0,0,0,0,0,0,218,98,98,98,220,218,98,220,740,740,740,740,740,740, + 98,98,98,98,98,98,98,220,218,98,220,740,740,740,740,740,740,218,98,220,0,0,0,0,0,0,218,98,98,98,220,218,98,220,740,740,740,740,740,740, + 259,259,259,259,259,259,259,260,218,98,220,740,740,740,740,740,740,218,98,220,0,0,0,0,0,0,258,259,259,259,260,218,98,139,179,179,179,179,179,179, + 0,0,0,0,0,0,0,0,218,98,220,740,740,740,740,740,740,218,98,220,0,0,0,0,0,0,7,7,7,7,7,218,98,98,98,98,98,98,98,98, + 0,0,0,0,0,0,0,0,218,98,220,740,740,740,740,740,740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,258,259,259,259,259,259,259,259,259, + 0,0,0,0,0,0,0,0,218,98,220,740,740,740,740,740,740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,178,179,179, + 0,0,0,0,0,0,0,0,218,98,220,740,740,740,740,740,740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98, + 179,179,179,180,0,0,0,0,218,98,139,179,179,179,179,179,179,140,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98, + 98,98,98,220,0,0,0,0,218,98,98,98,98,98,98,98,98,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98, + 259,100,98,220,0,0,0,0,258,259,259,259,259,259,259,259,259,259,259,260,0,0,0,0,0,0,0,0,0,0,0,0,740,740,0,0,0,218,98,98, + 740,218,98,220,0,0,0,0,178,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98, + 740,218,98,220,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98, + 740,218,98,220,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98, + 740,218,98,220,0,0,0,0,218,220,0,0,0,0,0,178,179,179,180,740,740,6,6,740,740,6,6,740,740,6,6,178,179,179,179,179,180,218,98,98, + 740,218,98,220,0,0,0,0,218,220,0,0,0,0,0,258,259,259,260,7,7,740,740,7,7,740,740,7,7,740,740,258,259,259,259,259,260,218,98,98, + 740,218,98,220,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98, + 740,218,98,220,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98, + 740,218,98,220,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98, + 740,218,98,220,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98, + 740,218,98,220,0,0,0,0,258,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,0,0,0,218,98,98, + 740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98, + 740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98, + 740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98, + 740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,258,259,259, + 740,218,98,220,178,179,179,179,179,179,179,180,0,0,0,0,0,740,0,0,0,0,0,0,740,0,0,0,0,0,178,179,179,179,179,179,179,179,179,179, + 740,218,98,220,218,98,98,98,98,98,98,220,6,6,6,6,6,740,6,6,6,6,6,6,740,6,6,6,6,6,218,98,98,98,98,98,98,98,98,98, + 740,218,98,220,218,98,99,259,259,100,98,220,178,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,180,218,98,99,259,259,259,259,259,259,259, + 740,218,98,220,218,98,220,740,740,218,98,220,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,218,98,220,740,740,740,740,740,740,740, + 740,218,98,220,218,98,220,740,740,218,98,220,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,218,98,220,740,740,740,740,740,740,740, + 740,218,98,220,218,98,220,740,740,218,98,220,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,218,98,220,740,740,740,740,740,740,740, + }; + + obj.createentity(40, 176, 10, 1, 52450); // (savepoint) + obj.createentity(80, 156, 11, 176); // (horizontal gravity line) + obj.createentity(128, 88, 10, 1, 52451); // (savepoint) + obj.createentity(160, 76, 11, 96); // (horizontal gravity line) + roomname = "Three's Company"; + result = contents; + break; + } + + case rn(47,52): + { + + static const short contents[] = { + 740,218,98,220,218,98,98,98,98,98,98,98,98,220,0,0,0,0,0,0,218,98,220,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, + 740,218,98,220,258,259,259,259,259,259,259,259,259,260,0,0,0,0,0,0,218,98,139,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179, + 740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98, + 740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,258,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259, + 740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,178,179,179,180,7,7,7,7,7,7,7,7,7,7,7,7,7,178,179,179, + 740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98, + 740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98, + 740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,258,259,259,260,0,0,0,0,0,0,0,0,0,0,0,0,0,258,259,259, + 740,218,98,220,0,0,0,0,178,179,179,179,179,179,179,179,179,179,179,179,179,179,179,180,0,0,0,0,0,0,0,0,0,0,0,0,0,7,7,7, + 740,218,98,220,0,0,0,0,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 740,218,98,220,0,0,0,0,258,259,259,259,259,259,259,259,259,259,259,259,259,259,259,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 740,218,98,220,0,0,0,0,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,178,179,179,179,179,179,179,179,179,179,179,179, + 740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,98,98,98,98,98,98,98,98,98, + 740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,99,259,259,259,259,259,259,259,259,259, + 740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740,740,740,740,740,740,740,740,740, + 740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740,740,740,740,740,740,740,740,740, + 740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740,740,740,740,740,740,740,740,740, + 740,218,98,220,0,0,0,0,0,0,0,0,0,6,6,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740,740,740,740,740,740,740,740,740, + 740,218,98,220,0,0,0,0,0,0,0,0,0,178,180,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740,740,740,740,740,740,740,740,740, + 740,218,98,220,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740,740,740,740,740,740,740,740,740, + 740,218,98,220,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740,740,740,740,740,740,740,740,740, + 740,218,98,220,6,6,6,6,6,6,6,6,6,218,220,6,6,6,6,6,6,6,6,6,6,6,6,6,218,98,220,740,740,740,740,740,740,740,740,740, + 740,218,98,220,178,179,179,179,179,179,179,179,180,218,220,178,179,179,179,179,179,179,179,179,179,179,179,180,218,98,220,740,740,740,740,740,740,740,740,740, + 740,218,98,220,218,98,98,98,98,98,98,98,220,218,220,218,98,98,98,98,98,98,98,98,98,98,98,220,218,98,220,740,740,740,740,740,740,740,740,740, + 740,218,98,220,218,98,98,98,98,98,98,98,220,218,220,218,98,98,98,98,98,98,98,98,98,98,98,220,218,98,220,740,740,740,740,740,740,740,740,740, + }; + + obj.createentity(68-4, 56, 2, 11, 4); //Big Threadmill, <<<<<< + obj.createentity(132-4, 56, 2, 9, 4); //Threadmill, <<< + obj.createentity(44, 192, 3); //Disappearing Platform + obj.createentity(92, 104, 3); //Disappearing Platform + obj.createentity(120, 192, 2, 3, 6); // Platform + obj.createentity(264, 48, 2, 2, 6); // Platform + roomname = "Cosmic Creepers"; + result = contents; + break; + }; + + case rn(48,52): + { + + static const short contents[] = { + 98,98,220,218,98,98,98,98,98,98,98,98,98,220,218,98,220,218,98,98,98,98,98,98,98,98,98,98,220,218,98,98,98,98,98,98,98,98,98,98, + 98,98,220,258,259,259,259,259,259,259,259,259,259,260,218,98,220,258,259,259,259,259,259,259,259,259,259,259,260,218,98,98,98,98,98,98,98,98,98,98, + 259,259,260,7,7,7,7,7,7,7,7,7,7,7,258,259,260,7,7,7,7,7,7,7,7,7,7,7,7,258,259,259,259,259,259,259,259,259,259,259, + 179,180,49,0,0,0,0,0,0,0,0,0,0,0,50,740,49,0,0,0,0,0,0,0,0,0,0,0,0,50,178,179,179,179,179,179,179,179,179,179, + 98,220,49,0,0,0,0,0,0,0,0,0,0,0,50,740,49,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,98,98,98,98,98,98,98,98, + 98,220,49,0,0,0,0,0,0,0,0,0,0,0,50,740,49,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,99,259,259,259,259,259,259,259, + 98,220,49,0,0,0,0,0,0,0,0,0,0,0,50,740,49,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,220,740,740,740,740,740,740,740, + 259,260,49,0,0,0,0,0,0,0,0,0,0,0,50,740,49,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,220,740,740,740,740,740,740,740, + 7,7,0,0,0,0,0,0,0,0,0,0,0,0,50,740,49,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,220,740,740,740,740,740,740,740, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,740,49,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,220,740,740,740,740,740,740,740, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,740,49,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,139,179,179,179,179,179,179,179, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,740,49,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,98,98,98,98,98,98,98,98, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,740,49,0,0,0,0,0,0,0,0,0,0,0,0,50,258,259,259,259,259,259,259,259,259,259, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,740,49,0,0,0,0,0,0,6,0,0,0,0,0,0,7,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,740,49,0,0,0,0,0,50,740,49,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,6,0,0,0,0,0,0,7,0,0,0,0,0,0,50,740,49,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 179,179,179,179,179,179,179,179,180,49,0,0,0,0,0,0,0,0,0,0,0,0,50,740,49,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 98,98,98,98,98,98,98,98,220,49,0,0,0,0,0,0,0,0,0,0,0,0,50,740,49,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 259,259,259,259,259,259,100,98,220,49,0,0,0,0,0,0,0,0,0,0,0,0,50,740,49,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 740,740,740,740,740,740,218,98,220,49,0,0,0,0,0,0,0,0,0,0,0,0,50,740,49,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 740,740,740,740,740,740,218,98,220,49,0,0,0,0,0,0,0,0,0,0,0,0,50,740,49,0,0,0,0,0,0,0,0,0,0,0,0,0,6,6, + 740,740,740,740,740,740,218,98,220,49,0,0,0,0,0,0,0,0,0,0,0,0,50,740,49,0,0,0,0,0,0,0,0,0,0,0,0,50,178,179, + 740,740,740,740,740,740,218,98,220,49,0,0,0,0,0,0,0,0,0,0,0,0,50,740,49,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98, + 740,740,740,740,740,740,218,98,220,49,0,0,0,0,0,0,0,0,0,0,0,0,50,740,49,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98, + 179,179,179,179,179,179,140,98,220,49,0,0,0,0,0,0,0,0,0,0,0,0,50,740,49,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98, + 98,98,98,98,98,98,98,98,220,49,0,0,0,0,0,0,0,0,0,0,0,0,50,740,49,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98, + 259,259,259,259,259,259,259,259,260,49,0,0,0,0,0,0,0,0,0,0,0,0,50,740,49,0,0,0,0,0,0,0,0,0,0,0,0,50,258,259, + 179,179,179,179,179,179,179,179,179,180,6,6,6,6,6,6,6,6,6,6,6,6,178,179,180,6,6,6,6,6,6,6,6,6,6,6,6,178,179,179, + 98,98,98,98,98,98,98,98,98,220,178,179,179,179,179,179,179,179,179,179,179,180,218,98,220,178,179,179,179,179,179,179,179,179,179,179,180,218,98,98, + 98,98,98,98,98,98,98,98,98,220,218,98,98,98,98,98,98,98,98,98,98,220,218,98,220,218,98,98,98,98,98,98,98,98,98,98,220,218,98,98, + }; + + obj.createentity(16, 112, 10, 1, 52480); // (savepoint) + obj.createentity(67, 24, 12, 96); // (vertical gravity line) + obj.createentity(243, 112, 12, 104); // (vertical gravity line) + obj.createentity(288, 104, 10, 0, 52481); // (savepoint) + obj.createentity(187, 24, 12, 80); // (vertical gravity line) + obj.createentity(123, 128, 12, 88); // (vertical gravity line) + + roomname = "The Villi People"; + result = contents; + break; + } + + case rn(50,53): + { + + static const short contents[] = { + 98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,0,0,0,0,0,0,0,218,220,218,98,220,740,740,740,740,740,740,740, + 98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,0,0,0,0,0,0,0,218,220,218,98,139,179,179,179,179,179,179,179, + 98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,0,0,0,0,0,0,0,218,220,218,98,98,98,98,98,98,98,98,98, + 259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,260,0,0,0,0,0,0,0,218,220,258,259,259,259,259,259,259,259,259,259, + 0,0,0,0,0,178,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0, + 6,6,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,258,260,0,0,0,6,6,6,6,6,6,6, + 179,180,0,0,0,218,220,0,0,0,178,179,179,179,179,179,179,179,179,179,180,178,179,179,179,179,179,179,179,180,0,0,0,178,179,179,179,179,179,179, + 98,220,0,0,0,218,220,0,0,0,218,98,98,98,98,98,98,98,98,98,220,218,98,98,98,98,98,98,98,220,0,0,0,218,98,98,98,98,98,98, + 98,220,0,0,0,218,220,0,0,0,218,98,98,98,98,98,98,98,98,98,220,258,259,259,259,259,259,259,259,260,0,0,0,218,98,98,98,98,98,98, + 259,260,0,0,0,218,220,0,0,0,218,98,98,98,98,98,98,98,98,98,220,0,0,0,0,0,0,0,178,180,0,0,0,258,259,259,259,259,259,259, + 0,0,0,0,0,218,220,0,0,0,218,98,98,98,98,98,98,98,98,98,220,0,0,0,0,0,0,0,218,220,0,0,0,178,180,0,0,0,0,0, + 0,0,0,0,0,218,220,0,0,0,258,259,259,259,259,259,259,259,259,259,260,0,0,0,0,0,0,0,258,260,0,0,0,218,220,0,0,0,0,0, + 0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0, + 0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0, + 0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0, + 179,179,179,179,180,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,178,179, + 98,98,98,98,220,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,218,98, + 259,259,259,259,260,258,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,258,259, + 0,0,0,0,0,178,179,179,179,179,180,0,0,0,0,0,0,0,178,179,179,179,179,179,179,179,179,179,179,179,179,179,180,218,220,0,0,0,0,0, + 0,0,0,0,0,218,98,98,98,98,220,0,0,0,0,0,0,0,218,98,98,98,98,98,98,98,98,98,98,98,98,98,220,218,220,0,0,0,0,0, + 0,0,0,0,0,218,98,98,98,98,220,0,0,0,0,0,0,0,218,98,99,259,259,259,259,259,259,259,259,259,100,98,220,218,220,0,0,0,0,0, + 0,0,0,0,0,218,98,98,98,98,220,178,179,179,179,179,179,180,218,98,220,740,740,740,740,740,740,740,740,740,218,98,220,218,220,0,0,0,0,0, + 0,0,0,0,0,218,98,98,98,98,220,218,98,98,98,98,98,220,218,98,220,740,740,740,740,740,740,740,740,740,218,98,220,258,260,0,0,0,0,0, + 179,180,0,0,0,218,98,98,98,98,220,218,98,98,98,98,98,220,218,98,220,740,740,740,740,740,740,740,740,740,218,98,220,178,179,179,179,179,179,179, + 98,220,0,0,0,218,98,98,98,98,220,218,98,98,98,98,98,220,218,98,220,740,740,740,740,740,740,740,740,740,218,98,220,218,98,98,98,98,98,98, + 98,220,0,0,0,218,98,98,98,98,220,218,98,98,98,98,98,220,218,98,220,740,740,740,740,740,740,740,740,740,218,98,220,218,98,98,98,98,98,98, + 98,220,0,0,0,218,98,98,98,98,220,218,98,98,98,98,98,220,218,98,220,740,740,740,740,740,740,740,740,740,218,98,220,218,98,98,98,98,98,98, + }; + + obj.createentity(192, 56, 10, 1, 53500); // (savepoint) + obj.createentity(288, 104, 10, 0, 53501); // (savepoint) + + obj.createentity(168, 96, 1, 0, 5); // Enemy + obj.createentity(184+2, 104, 1, 0, 5); // Enemy + obj.createentity(200+4, 112, 1, 0, 5); // Enemy + + obj.createentity(88, 176-4, 1, 1, 5); // Enemy + obj.createentity(104+2, 168-4, 1, 1, 5); // Enemy + obj.createentity(120 + 4, 160 - 4, 1, 1, 5); // Enemy + + warpx = true; + roomname = "change"; + result = contents; + break; + } + + case rn(50,54): + { + + static const short contents[] = { + 98,220,0,0,0,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98, + 98,220,0,0,0,258,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,100,98, + 98,220,0,0,0,740,740,7,7,7,7,7,7,7,740,740,740,740,7,7,7,7,7,7,740,740,740,740,7,7,7,7,7,7,7,7,7,7,218,98, + 98,220,0,0,0,740,740,0,0,0,0,0,0,0,50,740,740,49,0,0,0,0,0,0,50,740,740,49,0,0,0,0,0,0,0,0,0,0,218,98, + 98,220,0,0,0,740,740,0,0,0,0,0,0,0,50,740,740,49,0,0,0,0,0,0,50,740,740,49,0,0,0,0,0,0,0,0,0,0,218,98, + 98,220,0,0,0,740,740,0,0,0,0,0,0,0,50,740,740,49,0,0,0,0,0,0,0,50,740,49,0,0,0,0,0,0,0,0,0,0,218,98, + 98,220,0,0,0,7,7,0,0,0,0,0,0,0,50,740,740,49,0,0,0,0,0,0,0,50,740,49,0,0,0,0,0,0,0,0,0,0,218,98, + 98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,7,740,49,0,0,0,0,0,0,0,50,740,49,0,0,0,0,0,0,0,0,0,0,218,98, + 98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,0,0,0,0,0,0,0,0,50,740,49,0,0,0,0,0,0,0,0,0,0,218,98, + 98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,0,0,0,0,0,0,0,0,0,0,0,218,98, + 98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98, + 98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98, + 259,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,0,0,0,0,218,98, + 179,179,179,179,179,179,179,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,740,0,0,0,0,218,98, + 98,98,98,98,98,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,740,740,0,0,0,0,218,98, + 259,259,259,259,259,100,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,0,0,0,0,218,98, + 740,740,740,740,740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,0,0,0,0,218,98, + 740,740,740,740,740,218,98,220,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,740,740,740,0,0,0,0,218,98, + 179,179,179,179,179,140,98,220,178,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,180,0,0,0,0,218,98, + 98,98,98,98,98,98,98,220,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,0,0,0,0,218,98, + 259,259,259,259,259,259,259,260,258,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,260,0,0,0,0,258,259, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,178,179,180,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,258,259,260,0,0,0,0,0,0, + 179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179, + 98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98, + 259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259, + 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, + }; + + obj.createentity(24, 88, 10, 1, 54500); // (savepoint) + obj.createentity(280, 184, 10, 1, 54501); // (savepoint) + obj.createentity(56, 44, 11, 56); // (horizontal gravity line) + obj.createentity(131, 72, 12, 64); // (vertical gravity line) + obj.createentity(144, 36, 11, 48); // (horizontal gravity line) + obj.createentity(211, 80, 12, 56); // (vertical gravity line) + obj.createentity(224, 52, 11, 80); // (horizontal gravity line) + + warpx = true; + roomname = "change"; + result = contents; + break; + } + + + case rn(52,53): + { + + static const short contents[] = { + 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, + 0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, + 0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, + 0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,7,7,7,7,7,7,740,740,740,740,740,740,740, + 0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,7,7,7,0,0,0,0,0,0,7,7,7,740,740,740,740, + 740,740,740,740,740,740,740,0,0,0,0,0,0,7,740,740,740,740,740,740,740,740,7,7,0,0,0,0,0,0,0,0,0,0,0,0,7,7,7,7, + 740,740,740,740,740,740,740,740,0,0,0,0,0,0,7,7,7,7,7,7,7,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 740,740,740,740,740,740,740,740,740,740,6,6,6,6,6,6,6,6,6,6,6,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,6, + 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,6,6,6,6,6,6,6,0,0,0,0,0,6,6,6,6,740,740, + 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,6,6,6,6,6,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, + }; + + obj.createentity(16, 48, 10, 1, 53520); // (savepoint) + obj.createentity(96, 144, 3); //Disappearing Platform + obj.createentity(128, 144, 3); //Disappearing Platform + obj.createentity(160, 144, 3); //Disappearing Platform + obj.createentity(208, 80, 3); //Disappearing Platform + obj.createentity(240, 80, 3); //Disappearing Platform + obj.createentity(272, 80, 3); //Disappearing Platform + obj.createentity(304, 80, 3); //Disappearing Platform + roomname = "The Last Straw"; + result = contents; + break; + } + + case rn(53,53): + { + + static const short contents[] = { + 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,7,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,7,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,7,0,7,740,740,740,740,740,740,740, + 740,740,740,740,740,7,0,7,740,740,740,740,740,740,740,740,740,740,740,7,740,740,740,740,740,740,740,740,740,7,0,0,0,7,740,740,740,740,740,740, + 740,740,740,740,7,0,0,0,7,740,740,740,740,740,740,740,740,740,7,0,7,740,740,740,740,740,740,740,7,0,0,0,0,0,7,740,740,740,740,740, + 740,740,740,7,0,0,0,0,0,7,740,740,740,740,740,740,740,7,0,0,0,7,740,740,740,740,740,7,0,0,0,0,0,0,0,7,740,740,740,740, + 740,740,7,0,0,0,0,0,0,0,7,740,740,740,740,740,7,0,0,0,0,0,7,740,740,740,7,0,0,0,0,0,0,0,0,0,7,740,740,740, + 740,7,0,0,0,0,0,0,0,0,0,7,740,740,740,7,0,0,0,0,0,0,0,7,740,7,0,0,0,0,0,0,0,0,0,0,0,7,740,740, + 7,0,0,0,0,0,0,0,0,0,0,0,7,740,7,0,0,0,0,0,0,0,0,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,7,7, + 0,0,0,0,0,0,0,0,0,0,0,0,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,6,740,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,6,740,740,740,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 6,6,740,740,740,740,740,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6, + 740,740,740,740,740,740,740,740,6,0,0,0,0,0,0,0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,6,0,0,0,0,0,0,0,6,740, + 740,740,740,740,740,740,740,740,740,6,0,0,0,0,0,0,0,6,740,6,0,0,0,0,0,0,0,0,0,6,740,6,0,0,0,0,0,6,740,740, + 740,740,740,740,740,740,740,740,740,740,6,0,0,0,0,0,6,740,740,740,6,0,0,0,0,0,0,0,6,740,740,740,6,0,0,0,6,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,6,0,0,0,6,740,740,740,740,740,6,0,0,0,0,0,6,740,740,740,740,740,6,0,6,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,740,6,0,6,740,740,740,740,740,740,740,6,0,0,0,6,740,740,740,740,740,740,740,6,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,740,740,6,740,740,740,740,740,740,740,740,740,6,0,6,740,740,740,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,6,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, + }; + + obj.createentity(0, 80, 3); //Disappearing Platform + obj.createentity(288, 88, 3); //Disappearing Platform + obj.createentity(32, 80, 3); //Disappearing Platform + obj.createentity(64, 136, 3); //Disappearing Platform + obj.createentity(96, 136, 3); //Disappearing Platform + obj.createentity(224, 144, 3); //Disappearing Platform + obj.createentity(192, 144, 3); //Disappearing Platform + obj.createentity(256, 88, 3); //Disappearing Platform + obj.createentity(128, 88, 3); //Disappearing Platform + obj.createentity(160, 88, 3); //Disappearing Platform + roomname = "W"; + result = contents; + break; + } + + case rn(54,53): + { + + static const short contents[] = { + 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, + 7,7,7,7,7,7,7,7,7,7,7,7,7,7,740,740,740,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,7,7,7,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, + 0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, + 6,6,6,6,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,6,6,6,6,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,6,6,6,6,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, + }; + + obj.createentity(0, 88, 3); //Disappearing Platform + obj.createentity(32, 88, 3); //Disappearing Platform + obj.createentity(64, 88, 3); //Disappearing Platform + obj.createentity(120, 128, 9, 19); // (shiny trinket) + + roomname="V"; + result = contents; + break; + } + + + case rn(54,52): + { + + static const short contents[] = { + 740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, + }; + roomname = "VV"; + result = contents; + break; + } + + + case rn(54,51): + { + + static const short contents[] = { + 740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740, + }; + roomname = "VVV"; + result = contents; + break; + } + + + case rn(54,50): + { + + static const short contents[] = { + 740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740, + }; + roomname = "VVVV"; + result = contents; + break; + } + + case rn(54,49): + { + + static const short contents[] = { + 740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740, + 740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740, + 740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740, + 740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740, + 740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740, + 740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740, + 740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740, + 740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740, + 740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740, + 740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740, + 740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740, + 740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740, + 740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740, + 740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740, + 740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740, + 740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740, + 740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740, + 740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740, + 740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740, + 740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740, + }; + + roomname = "VVVVV"; + result = contents; + break; + } + + case rn(54,48): + { + + static const short contents[] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740, + 740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740, + 740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740, + 740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740, + 740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740, + 740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740, + 740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740, + 740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740, + }; + + obj.createblock(0, 0, 0, 5, 240); + obj.createblock(0, 315, 0, 5, 240); + + + if(game.intimetrial) + { + obj.createblock(1, 0, 0, 320, 120, 82); + } + else + { + obj.createblock(1, 0, 0, 320, 120, 3500); //Game complete + } + roomname = "VVVVVV"; + result = contents; + break; + } + + + case rn(46,54): + { + + static const short contents[] = { + 98,98,220,218,98,98,98,98,98,98,98,98,98,98,98,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 98,98,220,218,98,98,98,98,98,98,98,98,98,98,98,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 98,98,220,258,259,259,259,259,259,259,259,259,259,259,259,259,259,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 98,98,220,0,178,179,179,179,179,179,179,179,179,179,179,179,179,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 98,98,220,0,258,259,259,259,259,259,259,259,259,259,259,259,259,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 98,98,220,0,178,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 98,98,220,0,218,220,0,178,179,179,179,179,179,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 98,98,220,0,218,220,0,258,259,259,259,259,259,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 98,98,220,0,218,220,0,178,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 98,98,220,0,218,220,0,218,220,0,178,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 98,98,220,0,218,220,0,218,220,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 98,98,220,0,218,220,0,218,220,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 98,98,220,0,218,220,0,218,220,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 98,98,220,0,218,220,0,218,220,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 98,98,220,0,218,220,0,218,220,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 98,98,220,0,218,220,0,218,220,0,258,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 98,98,220,0,218,220,0,218,220,0,178,179,179,179,179,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 98,98,220,0,218,220,0,218,220,0,258,259,259,259,259,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 98,98,220,0,218,220,0,258,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 98,98,220,0,218,220,0,178,179,179,179,179,179,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 98,98,220,0,218,220,0,258,259,259,259,259,259,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 98,98,220,0,258,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 98,98,220,0,178,179,179,179,179,179,179,179,179,179,179,179,179,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 98,98,220,0,258,259,259,259,259,259,259,259,259,259,259,259,259,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 98,98,220,178,179,179,179,179,179,179,179,179,179,179,179,179,179,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 98,98,220,218,98,98,98,98,98,98,98,98,98,98,98,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 98,98,220,218,98,98,98,98,98,98,98,98,98,98,98,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 98,98,220,218,98,98,98,98,98,98,98,98,98,98,98,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + warpy = true; + roomname = "Temporary Fault..."; + result = contents; + break; + } + + case rn(47,54): + { + + static const short contents[] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + warpy = true; + roomname = "Do Not Adjust the V-hold"; + result = contents; + break; + } + + case rn(48,54): + { + + static const short contents[] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,139,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,258,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,178,179,179,179,179,179,179,179,179, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,98,98,98,98,98,98, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,99,259,259,259,259,259,259, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740,740,740,740,740,740, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740,740,740,740,740,740, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740,740,740,740,740,740, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740,740,740,740,740,740, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740,740,740,740,740,740, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740,740,740,740,740,740, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740,740,740,740,740,740, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740,740,740,740,740,740, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740,740,740,740,740,740, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740,740,740,740,740,740, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740,740,740,740,740,740, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740,740,740,740,740,740, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,178,179,180,218,98,220,740,740,740,740,740,740, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,178,179,180,218,98,220,218,98,220,740,740,740,740,740,740, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,178,179,180,218,98,220,218,98,220,218,98,220,740,740,740,740,740,740, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,178,179,180,218,98,220,218,98,220,218,98,220,218,98,220,740,740,740,740,740,740, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,178,179,180,218,98,220,218,98,220,218,98,220,218,98,220,218,98,220,740,740,740,740,740,740, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,218,98,220,218,98,220,218,98,220,218,98,220,218,98,220,740,740,740,740,740,740, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,218,98,220,218,98,220,218,98,220,218,98,220,218,98,220,740,740,740,740,740,740, + }; + + obj.createentity(264, 32, 10, 0, 54480); // (savepoint) + + /*if(!game.nocutscenes && !obj.flags[71]){ + obj.createblock(1, 72, 0, 320, 240, 49); + }*/ + + warpy = true; + roomname = "Regular Service Will Return Shortly"; + result = contents; + break; + } + + case rn(49,54): + { + + static const short contents[] = { + 98,98,98,98,98,220,0,0,218,220,0,0,218,98,220,0,0,0,0,218,220,0,0,0,0,218,98,220,0,0,218,220,0,0,218,98,220,740,740,740, + 98,98,98,98,98,220,0,0,218,220,0,0,218,98,220,0,0,0,0,218,220,0,0,0,0,218,98,220,0,0,218,220,0,0,218,98,220,740,740,740, + 98,98,98,98,98,220,0,0,218,220,0,0,218,98,220,0,0,0,0,218,220,0,0,0,0,258,259,260,0,0,218,220,0,0,218,98,220,740,740,740, + 259,259,259,259,259,260,0,0,218,220,0,0,218,98,220,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,218,220,0,0,218,98,220,740,740,740, + 0,0,0,0,0,0,0,0,218,220,0,0,218,98,220,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,218,220,0,0,218,98,220,740,740,740, + 0,0,0,0,0,0,0,0,218,220,0,0,218,98,220,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,218,220,0,0,218,98,220,740,740,740, + 0,0,0,0,0,0,0,0,218,220,0,0,218,98,220,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,218,220,0,0,218,98,220,740,740,740, + 0,0,0,0,0,0,0,0,258,260,0,0,218,98,220,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,258,260,0,0,218,98,220,740,740,740, + 179,179,179,179,179,179,179,179,179,180,0,0,218,98,220,0,0,0,0,258,260,0,0,0,0,178,179,179,179,179,179,180,0,0,218,98,220,740,740,740, + 98,98,98,98,98,98,98,98,98,220,0,0,218,98,220,0,0,0,0,7,7,0,0,0,0,218,98,98,98,98,98,220,0,0,218,98,220,740,740,740, + 98,98,98,98,98,98,98,98,98,220,0,0,218,98,220,0,0,0,0,0,0,0,0,0,0,218,98,98,98,98,98,220,0,0,218,98,220,740,740,740, + 259,259,259,259,259,259,259,259,259,260,0,0,218,98,220,0,0,0,0,0,0,0,0,0,0,258,259,259,259,259,259,260,0,0,218,98,220,740,740,740, + 179,179,179,179,179,180,0,0,0,0,0,0,218,98,220,0,0,0,0,0,0,0,0,0,0,178,179,180,0,0,0,0,0,0,218,98,220,740,740,740, + 98,98,98,98,98,220,0,0,0,0,0,0,218,98,220,0,0,0,0,0,0,0,0,0,0,218,98,220,0,0,0,0,0,0,218,98,220,740,740,740, + 259,259,259,100,98,220,0,0,0,0,0,0,218,98,220,0,0,0,0,0,0,0,0,0,0,218,98,220,0,0,0,0,0,0,218,98,139,179,179,179, + 740,740,740,218,98,220,0,0,0,0,0,0,218,98,220,0,0,0,0,0,0,0,0,0,0,218,98,220,0,0,0,0,0,0,218,98,98,98,98,98, + 740,740,740,218,98,220,0,0,0,0,0,0,258,259,260,0,0,0,0,0,0,0,0,0,0,218,98,220,0,0,0,0,0,0,258,259,259,259,259,259, + 740,740,740,218,98,220,0,0,178,179,179,179,179,179,180,0,0,0,0,0,0,0,0,0,0,218,98,220,0,0,178,179,179,179,179,179,179,179,179,179, + 740,740,740,218,98,220,0,0,218,98,98,98,98,98,220,0,0,0,0,0,0,0,0,0,0,218,98,220,0,0,218,98,98,98,98,98,98,98,98,98, + 740,740,740,218,98,220,0,0,218,98,98,98,98,98,220,0,0,0,0,6,6,0,0,0,0,218,98,220,0,0,218,98,98,98,98,98,98,98,98,98, + 740,740,740,218,98,220,0,0,258,259,259,259,259,259,260,0,0,0,0,178,180,0,0,0,0,218,98,220,0,0,258,259,259,259,259,259,259,259,259,259, + 740,740,740,218,98,220,0,0,178,180,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,218,98,220,0,0,178,180,0,0,0,0,0,0,0,0, + 740,740,740,218,98,220,0,0,218,220,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,218,98,220,0,0,218,220,0,0,0,0,0,0,0,0, + 740,740,740,218,98,220,0,0,218,220,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,218,98,220,0,0,218,220,0,0,0,0,0,0,0,0, + 740,740,740,218,98,220,0,0,218,220,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,218,98,220,0,0,218,220,0,0,0,0,0,0,0,0, + 740,740,740,218,98,220,0,0,218,220,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,218,98,220,0,0,218,220,0,0,178,179,179,179,179,179, + 740,740,740,218,98,220,0,0,218,220,0,0,178,179,180,0,0,0,0,218,220,0,0,0,0,218,98,220,0,0,218,220,0,0,218,98,98,98,98,98, + 740,740,740,218,98,220,0,0,218,220,0,0,218,98,220,0,0,0,0,218,220,0,0,0,0,218,98,220,0,0,218,220,0,0,218,98,98,98,98,98, + 740,740,740,218,98,220,0,0,218,220,0,0,218,98,220,0,0,0,0,218,220,0,0,0,0,218,98,220,0,0,218,220,0,0,218,98,98,98,98,98, + 740,740,740,218,98,220,0,0,218,220,0,0,218,98,220,0,0,0,0,218,220,0,0,0,0,218,98,220,0,0,218,220,0,0,218,98,98,98,98,98, + }; + + obj.createentity(120, 116, 11, 80); // (horizontal gravity line) + warpy = true; + roomname = "Origami Room"; + result = contents; + break; + } + + + //Tower Hallways from here + case rn(108,109): + { + + static const short contents[] = { + 12,12,12,12,13,23,23,23,23,23,23,14,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,21,7,7,9,7,7,7,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,21,28,28,0,28,28,28,20,13,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,14,12,12,12,12,12,12,12, + 12,12,12,12,21,28,28,0,28,28,28,20,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12, + 12,12,12,12,21,28,28,0,28,28,28,20,21,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,22,14,12,12,12,12,12,12, + 12,12,12,12,21,28,28,0,28,28,28,20,21,28,0,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12, + 12,12,12,12,21,28,28,0,28,28,28,20,21,28,0,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,22,23,23,23,23,23,23, + 23,23,23,23,24,28,28,0,28,28,28,20,21,28,0,28,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,0,28,28,28,28, + 0,0,0,28,28,28,28,0,28,28,28,20,21,28,0,28,28,0,28,28,28,28,28,28,28,28,28,28,28,28,28,28,0,28,28,0,28,28,28,28, + 0,0,0,28,28,28,28,0,28,28,28,20,21,28,0,28,28,0,28,28,28,28,28,28,28,28,28,28,28,28,28,28,0,28,28,0,28,28,28,28, + 0,0,0,28,28,28,28,0,28,28,28,20,21,28,0,28,28,0,28,28,0,0,0,0,0,0,0,0,0,0,28,28,0,28,28,0,28,28,28,28, + 0,0,0,28,28,28,28,0,28,28,28,20,21,28,0,28,28,0,28,28,0,28,28,28,28,28,28,28,28,0,28,28,0,28,28,0,28,28,28,28, + 0,0,0,28,17,18,18,19,28,28,28,20,21,28,0,28,28,0,28,28,0,28,28,28,28,28,28,28,28,0,28,28,0,28,28,0,28,28,28,28, + 0,0,0,28,20,12,12,21,28,28,28,20,21,28,0,28,28,0,28,28,0,28,28,0,0,0,0,28,28,0,28,28,0,28,28,17,18,18,18,18, + 0,0,0,28,20,12,12,21,28,28,28,20,21,28,0,28,28,0,28,28,0,28,28,0,28,28,0,28,28,0,28,28,0,28,28,22,14,12,12,12, + 0,0,0,28,20,12,12,21,28,28,28,20,21,28,0,28,28,0,28,28,0,28,28,0,28,28,0,28,28,0,28,28,0,28,28,0,20,12,12,12, + 0,0,0,28,20,12,12,21,28,28,28,20,21,28,0,28,28,0,28,28,0,28,28,0,0,0,0,28,28,0,28,28,0,28,28,0,22,14,12,12, + 0,0,0,28,20,12,12,21,28,28,28,20,21,28,0,28,28,0,28,28,0,28,28,28,28,28,28,28,28,0,28,28,0,28,28,0,28,20,12,12, + 0,0,0,28,20,12,12,21,28,28,28,20,21,28,0,28,28,0,28,28,0,28,28,28,28,28,28,28,28,0,28,28,0,28,28,0,28,22,14,12, + 0,0,0,28,20,12,12,21,28,28,28,20,21,28,0,28,28,0,28,28,0,0,0,0,0,0,0,0,0,0,28,28,0,28,28,0,28,28,20,12, + 0,0,0,28,20,12,12,21,28,28,28,22,24,28,0,28,28,0,28,28,28,28,28,28,28,28,28,28,28,28,28,28,0,28,28,0,28,28,20,12, + 18,18,18,18,16,12,12,21,28,28,28,0,28,28,0,28,28,0,28,28,28,28,28,28,28,28,28,28,28,28,28,28,0,28,28,0,28,28,20,12, + 12,12,12,12,12,12,12,21,28,28,28,0,28,28,0,28,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,0,28,28,20,12, + 12,12,12,12,12,12,12,21,28,28,28,0,28,28,0,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,0,28,28,20,12, + 12,12,12,12,12,12,12,21,28,28,28,0,28,28,0,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,0,28,28,20,12, + 12,12,12,12,12,12,12,21,28,28,28,0,28,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,20,12, + 12,12,12,12,12,12,12,21,28,28,28,0,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,20,12, + 12,12,12,12,12,12,12,15,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,16,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + }; + + obj.createentity(40, 80, 10, 1, 50500); // (savepoint) + + roomname = "Teleporter Divot"; + result = contents; + break; + } + + case rn(110,104): + { + + static const short contents[] = { + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 23,23,23,23,23,23,23,23,23,23,23,23,14,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 18,18,18,18,18,18,18,19,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,21,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,21,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,21,28,28,28,28,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, + 12,12,12,12,12,12,12,21,28,28,28,28,28,28,0,0,0,0,28,28,28,28,0,0,0,0,28,28,28,28,0,0,0,0,28,28,28,28,0,0, + 12,12,12,12,12,12,12,21,28,28,28,28,28,28,0,0,0,0,28,28,28,28,0,0,0,0,28,28,28,28,0,0,0,0,28,28,28,28,0,0, + 12,12,12,12,12,12,12,21,28,28,28,28,28,28,0,0,0,0,28,28,28,28,0,0,0,0,28,28,28,28,0,0,0,0,28,28,28,28,0,0, + 12,12,12,12,12,12,12,21,28,28,28,28,28,28,0,0,0,0,28,28,28,28,0,0,0,0,28,28,28,28,0,0,0,0,28,28,28,28,0,0, + 12,12,12,12,12,12,12,21,28,28,28,28,28,28,0,0,0,0,28,28,28,28,0,0,0,0,28,28,28,28,0,0,0,0,28,28,28,28,0,0, + 12,12,12,12,12,12,12,21,28,28,28,28,28,28,0,0,0,0,28,28,28,28,0,0,0,0,28,28,28,28,0,0,0,0,28,28,28,28,0,0, + 12,12,12,12,12,12,12,15,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + }; + + obj.createentity(16, 112, 10, 1, 50520); // (savepoint) + roomname = "Seeing Red"; + + if(!game.intimetrial) + { + if(game.companion==0 && !obj.flags[8] && !game.crewstats[3]) //also need to check if he's rescued in a previous game + { + obj.createentity(264, 185, 18, 15, 1, 17, 0); + obj.createblock(1, 26*8, 0, 32, 240, 36); + } + } + result = contents; + break; + } + + case rn(111,104): + { + + static const short contents[] = { + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,13,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,14,12,12, + 12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12, + 12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12, + 12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12, + 12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12, + 12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12, + 12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12, + 12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12, + 12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12, + 12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12, + 12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12, + 12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12, + 12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12, + 12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12, + 12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12, + 12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12, + 12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12, + 23,23,24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,17,18,18,19,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,22,23,23,24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12, + 18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,16,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + }; + + obj.createentity(128-16, 80-32, 14); //Teleporter! + roomname = "Building Apport"; + + if(game.intimetrial) + { + obj.createblock(1, 40, 0, 32, 240, 82); + } + result = contents; + break; + } + + //Intermission level 2 + case rn(53,48): + { + + static const short contents[] = { + 98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,0,0,0,0,0,0,0,0,0,0,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98, + 98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,0,178,179,179,179,179,180,178,180,0,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98, + 259,259,259,259,259,259,259,259,259,259,259,259,259,259,260,0,258,259,259,259,259,260,218,220,0,258,259,259,259,259,259,259,259,259,259,259,259,259,259,259, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 179,179,179,179,179,179,179,179,179,179,179,179,179,179,180,0,178,180,0,0,0,0,218,220,0,0,0,0,0,178,179,179,180,178,179,179,179,179,179,179, + 98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,0,258,260,0,0,0,0,258,260,0,0,0,0,0,218,98,98,220,218,98,98,98,98,98,98, + 259,259,259,259,259,259,259,259,259,259,259,259,259,259,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,258,259,259,259,259,259,259, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,178,179,179,180,0,0,0,0,178,179,180,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,218,98,220,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,218,98,220,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,218,98,220,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0, + 179,179,179,179,179,180,178,179,179,180,0,0,0,0,218,98,98,220,0,0,0,0,218,98,220,0,0,0,0,218,98,98,220,0,0,0,0,178,179,179, + 98,98,98,98,98,220,218,98,98,220,0,0,0,0,218,98,98,220,0,0,0,0,218,98,220,0,0,0,0,218,98,98,220,0,0,0,0,218,98,98, + 259,259,259,259,259,260,218,98,98,220,0,0,0,0,218,98,98,220,0,0,0,0,218,98,220,0,0,0,0,218,98,98,220,0,0,0,0,258,259,259, + 0,0,0,0,0,0,218,98,98,220,0,0,0,0,218,98,98,220,0,0,0,0,218,98,220,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0, + 0,0,0,0,0,0,218,98,98,220,0,0,0,0,218,98,98,220,0,0,0,0,218,98,220,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0, + 0,0,0,0,0,0,218,98,98,220,0,0,0,0,218,98,98,220,0,0,0,0,218,98,220,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0, + 0,0,0,0,0,0,218,98,98,220,0,0,0,0,218,98,98,220,0,0,0,0,218,98,220,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0, + 179,179,180,0,0,0,218,98,98,220,0,0,0,0,218,98,98,220,0,0,0,0,218,98,220,0,0,0,0,218,98,98,220,178,179,179,179,179,179,179, + 98,98,220,0,0,0,218,98,98,220,0,0,0,0,218,98,98,220,0,0,0,0,218,98,220,0,0,0,0,218,98,98,220,218,98,98,98,98,98,98, + 259,259,260,0,0,0,218,98,98,220,0,0,0,0,218,98,98,220,0,0,0,0,218,98,220,0,0,0,0,258,259,259,260,258,259,259,259,259,259,259, + 0,0,0,0,0,0,218,98,98,220,0,0,0,0,218,98,98,220,0,0,0,0,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,218,98,98,220,0,0,0,0,218,98,98,220,0,0,0,0,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,218,98,98,220,0,0,0,0,218,98,98,220,0,0,0,0,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,258,259,259,260,0,0,0,0,218,98,98,220,0,0,0,0,258,259,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 179,179,179,179,179,179,179,179,179,180,0,0,0,0,218,98,98,220,0,0,0,0,178,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179, + 98,98,98,98,98,98,98,98,98,220,0,0,0,0,218,98,98,220,0,0,0,0,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98, + }; + + roomname = "Whee Sports"; + warpx = true; + result = contents; + break; + } + + case rn(53,49): + { + + static const short contents[] = { + 98,98,98,98,98,98,98,98,98,220,0,0,0,0,218,98,98,220,0,0,0,0,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98, + 259,259,259,259,259,259,259,100,98,220,0,0,0,0,218,98,98,220,0,0,0,0,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98, + 219,219,219,219,219,219,219,218,98,220,0,0,0,0,218,98,98,220,0,0,0,0,258,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259, + 219,219,219,219,219,219,219,218,98,220,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 219,219,219,219,219,219,219,218,98,220,0,0,0,0,218,98,98,220,0,0,0,0,178,179,179,179,179,179,179,179,179,179,179,179,179,179,180,178,179,179, + 219,219,219,219,219,219,219,218,98,220,0,0,0,0,218,98,98,220,0,0,0,0,218,98,98,98,98,98,98,98,98,98,98,98,98,98,220,218,98,98, + 219,219,219,219,219,219,219,218,98,220,0,0,0,0,218,98,98,220,0,0,0,0,258,259,259,259,259,259,259,259,259,259,259,259,259,259,260,218,98,98, + 219,219,219,219,219,219,219,218,98,220,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98, + 219,219,219,219,219,219,219,218,98,220,0,0,0,0,218,98,98,220,0,0,0,0,178,179,180,178,179,179,179,179,179,179,180,178,179,180,0,218,98,98, + 219,219,219,219,219,219,219,218,98,220,0,0,0,0,218,98,98,220,0,0,0,0,218,98,220,218,98,98,98,98,98,98,220,218,98,220,0,218,98,98, + 179,179,179,179,179,179,179,140,98,220,0,0,0,0,218,98,98,220,0,0,0,0,218,98,220,258,259,259,259,259,259,259,260,218,98,220,0,218,98,98, + 98,98,98,98,98,98,98,98,98,220,0,0,0,0,218,98,98,220,0,0,0,0,218,98,220,0,0,0,0,0,0,0,0,258,259,260,0,218,98,98, + 259,259,259,259,259,259,259,259,259,260,0,0,0,0,218,98,98,220,0,0,0,0,218,98,220,0,178,179,179,180,0,0,0,0,0,0,0,258,259,259, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,218,98,220,0,258,259,259,260,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,218,98,220,0,178,180,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,218,98,220,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,218,98,220,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0, + 179,179,179,179,179,179,179,179,179,179,179,179,179,180,218,98,98,220,0,0,0,0,218,98,220,0,258,260,0,0,0,0,0,178,179,180,0,178,179,179, + 98,98,98,98,98,98,98,98,98,98,98,98,98,220,218,98,98,220,0,0,0,0,218,98,220,0,0,0,0,0,0,0,0,218,98,220,0,218,98,98, + 259,259,259,259,259,259,259,259,259,259,259,100,98,220,218,98,98,220,0,0,0,0,218,98,220,178,179,179,179,179,179,179,180,218,98,220,0,218,98,98, + 219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,98,220,0,0,0,0,218,98,220,218,98,98,98,98,98,98,220,218,98,220,0,218,98,98, + 219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,98,220,0,0,0,0,258,259,260,258,259,259,259,259,259,259,260,258,259,260,0,218,98,98, + 179,179,179,179,179,179,179,179,179,179,179,140,98,220,218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98, + 98,98,98,98,98,98,98,98,98,98,98,98,98,220,218,98,98,220,0,0,0,0,178,179,179,179,179,179,179,179,179,179,179,179,179,179,180,218,98,98, + 259,259,259,259,259,259,259,259,259,259,259,259,259,260,258,259,259,260,0,0,0,0,258,259,259,259,259,259,259,259,259,259,259,259,259,259,260,258,259,259, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + roomname = "Whizz Down The Shaft"; + warpx = true; + result = contents; + break; + } + + case rn(53, 50): + { + static const short contents[] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + + //obj.createentity(-8, 84-32, 11, 328); // (horizontal gravity line) + obj.createentity(-8, 148 + 32, 11, 328); // (horizontal gravity line) + + obj.createblock(1, -10, 84 - 16, 340, 32, 10); //create the second line! + + roomname = "The Gravitron"; + warpx = true; //warpy = true; + result = contents; + break; + } + + case rn(53,51): + { + + static const short contents[] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,180,0,0,0,0,178,179,179,179, + 98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,0,0,0,0,218,98,98,98, + 98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,0,0,0,0,218,98,99,259, + 98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,0,0,0,0,218,98,220,219, + 259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,260,0,0,0,0,218,98,220,219, + 179,179,179,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219, + 98,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219, + 259,100,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219, + 219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,139,179, + 219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,98, + 219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,258,259,259,259, + 219,218,98,220,0,0,0,0,178,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179, + 219,218,98,220,0,0,0,0,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98, + 219,218,98,220,0,0,0,0,218,98,99,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259, + 219,218,98,220,0,0,0,0,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + 219,218,98,220,0,0,0,0,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + 219,218,98,220,0,0,0,0,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + }; + + obj.createentity(264, 176, 10, 1, 51530); // (savepoint) + + if(game.companion==0) //also need to check if he's rescued in a previous game + { + if (game.lastsaved == 2) + { + obj.createentity(112, 169, 18, 14, 0, 17, 1); + obj.createblock(1, 22 * 8, 16*8, 32, 240, 37); + } + else if (game.lastsaved ==3) + { + obj.createentity(112, 169, 18, 15, 0, 17, 1); + obj.createblock(1, 22 * 8, 16*8, 32, 240, 38); + } + else if (game.lastsaved == 4) + { + obj.createentity(112, 169, 18, 13, 0, 17, 1); + obj.createblock(1, 22 * 8, 16*8, 32, 240, 39); + } + else + { + obj.createentity(112, 169, 18, 16, 1, 17, 1); + obj.createblock(1, 22 * 8, 16*8, 32, 240, 40); + } + } + + roomname = "Tunnel of Terror"; + warpx = true; + + game.swnmode = false; + result = contents; + break; + } + + + case rn(53,52): + { + + static const short contents[] = { + 219,218,98,220,0,0,0,0,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + 219,218,98,220,0,0,0,0,218,98,139,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179, + 219,218,98,220,0,0,0,0,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98, + 219,218,98,220,0,0,0,0,258,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259, + 219,218,98,220,0,0,0,0,178,179,180,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + 219,218,98,220,0,0,0,0,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + 219,218,98,220,0,0,0,0,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,0,0,0,0,0,0,0,0,0,219,219,219,219,219,219,219, + 219,218,98,220,0,0,0,0,218,98,220,219,219,219,219,219,219,219,219,219,219,219,0,0,0,0,0,0,0,0,0,0,0,0,0,219,219,219,219,219, + 219,218,98,220,0,0,0,0,218,98,220,219,219,219,219,219,219,219,219,219,219,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,219,219,219,219, + 219,218,98,220,0,0,0,0,218,98,220,219,219,219,219,219,219,219,219,219,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,219,219,219, + 219,218,98,220,0,0,0,0,218,98,220,219,219,219,219,219,219,219,219,219,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,219,219,219, + 219,218,98,220,0,0,0,0,218,98,220,219,219,219,219,219,219,219,219,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,219,219, + 219,218,98,220,0,0,0,0,218,98,220,219,219,219,219,219,219,219,219,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,219,219, + 219,218,98,220,0,0,0,0,218,98,220,219,219,219,219,219,219,219,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,219,219, + 219,218,98,220,0,0,0,0,218,98,220,219,219,219,219,219,219,219,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,219,219, + 219,218,98,220,0,0,0,0,218,98,220,219,219,219,219,219,219,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,219,219, + 219,218,98,220,0,0,0,0,218,98,220,219,219,219,219,219,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,219,219, + 219,218,98,220,0,0,0,0,218,98,220,219,219,219,219,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,219,219, + 219,218,98,220,0,0,0,0,258,259,260,219,219,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,219,219, + 219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,219,219, + 179,140,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,219,219,219, + 98,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,219,219,219, + 259,259,259,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,219,219,219,219, + 179,179,179,179,179,179,179,179,179,179,180,219,219,219,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,219,219,219,219,219, + 98,98,98,98,98,98,98,98,98,98,220,219,219,219,219,219,219,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,219,219,219,219,219,219,219, + 259,259,259,259,259,259,259,259,100,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + 219,219,219,219,219,219,219,219,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + 219,219,219,219,219,219,219,219,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + 219,219,219,219,219,219,219,219,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + 219,219,219,219,219,219,219,219,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + }; + + obj.createentity((22 * 8)+4, (9 * 8) + 4, 14); //Teleporter! + + roomname = "House of Mirrors"; + warpx = true; + result = contents; + break; + } + + //Intermission 1 + + case rn(41,56): + { + + static const short contents[] = { + 259,259,259,259,259,259,259,259,259,260,218,98,220,0,218,98,98,220,0,218,98,98,98,220,0,218,98,98,98,98,220,0,218,98,220,219,219,219,219,219, + 0,0,0,0,0,0,0,0,0,0,218,98,220,0,218,98,98,220,0,218,98,98,98,220,0,218,98,98,98,98,220,0,218,98,220,219,219,219,219,219, + 179,179,179,179,179,179,180,178,180,0,218,98,220,0,218,98,98,220,0,218,98,98,98,220,0,218,98,98,98,98,220,0,218,98,220,219,219,219,219,219, + 259,259,259,259,259,259,260,218,220,0,218,98,220,0,218,98,98,220,0,218,98,98,98,220,0,218,98,98,98,98,220,0,218,98,220,219,219,219,219,219, + 0,0,0,0,0,0,0,218,220,0,218,98,220,0,218,98,98,220,0,218,98,98,98,220,0,218,98,98,98,98,220,0,218,98,139,179,179,179,179,179, + 179,179,180,178,179,180,0,218,220,0,258,259,260,0,218,98,98,220,0,258,259,259,259,260,0,218,98,98,98,98,220,0,218,98,98,98,98,98,98,98, + 98,98,220,258,259,260,0,258,260,0,0,0,0,0,258,259,259,260,0,7,7,7,7,7,0,218,98,98,98,98,220,0,258,259,259,259,259,259,259,259, + 98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,258,259,259,259,259,260,0,7,7,7,7,7,7,7,7, + 98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 98,98,220,178,179,180,0,178,179,179,179,179,180,0,6,6,6,6,0,178,179,179,179,180,0,0,0,0,0,0,0,0,178,179,179,179,179,179,179,179, + 259,259,260,258,259,260,0,218,98,98,98,98,220,0,178,179,179,180,0,218,98,98,98,220,0,6,6,6,6,6,6,0,218,98,98,98,98,98,98,98, + 0,0,0,0,0,0,0,258,259,259,259,259,260,0,258,259,259,260,0,258,259,259,259,260,0,178,179,179,179,179,180,0,258,259,259,259,259,259,259,259, + 179,179,179,179,179,179,179,179,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,258,259,259,259,259,260,0,0,0,0,0,0,0,0,0, + 259,259,259,259,259,259,259,259,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 179,179,179,179,179,179,179,179,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 259,259,259,259,259,259,259,259,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 179,179,179,179,179,179,179,179,179,179,179,179,180,0,178,179,179,180,0,178,179,179,179,180,0,178,179,179,179,179,180,0,0,0,0,0,0,0,0,0, + 98,98,98,98,98,98,98,98,98,98,98,98,220,0,218,98,98,220,0,218,98,98,98,220,0,218,98,98,98,98,220,0,178,179,179,179,179,179,179,179, + 259,259,259,259,259,259,259,259,259,259,100,98,220,0,218,98,98,220,0,218,98,98,98,220,0,218,98,98,98,98,220,0,218,98,98,98,98,98,98,98, + 219,219,219,219,219,219,219,219,219,219,218,98,220,0,218,98,98,220,0,218,98,98,98,220,0,218,98,98,98,98,220,0,218,98,99,259,259,259,259,259, + 219,219,219,219,219,219,219,219,219,219,218,98,220,0,218,98,98,220,0,218,98,98,98,220,0,218,98,98,98,98,220,0,218,98,220,219,219,219,219,219, + 219,219,219,219,219,219,219,219,219,219,218,98,220,0,218,98,98,220,0,218,98,98,98,220,0,218,98,98,98,98,220,0,218,98,220,219,219,219,219,219, + 219,219,219,219,219,219,219,219,219,219,218,98,220,0,218,98,98,220,0,218,98,98,98,220,0,218,98,98,98,98,220,0,218,98,220,219,219,219,219,219, + }; + + //obj.createentity(164, 96, 10, 1, 56410); // (savepoint) + + warpy = true; + roomname = "Now Take My Lead"; + result = contents; + break; + } + + + case rn(42,56): + { + + static const short contents[] = { + 219,219,219,219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,220,219,219,219, + 219,219,219,219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,220,219,219,219, + 219,219,219,219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,220,219,219,219, + 219,219,219,219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,139,179,179,179, + 179,179,179,179,179,140,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,98,98,98,98, + 98,98,98,98,98,98,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,258,259,259,259,259,259, + 259,259,259,259,259,259,259,260,218,98,139,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,140,98,220,7,7,7,7,7,7, + 7,7,7,7,7,7,7,7,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,258,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,260,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 179,179,179,179,179,179,179,180,178,179,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,178,179,179,179,179,179,179,179,179,179,179, + 98,98,98,98,98,98,98,220,218,98,220,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,218,98,98,98,98,98,98,98,98,98,98, + 259,259,259,259,259,259,259,260,218,98,220,178,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,180,218,98,98,98,98,98,98,98,98,98,98, + 0,0,0,0,0,0,0,0,218,98,220,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,218,98,98,98,98,98,98,98,98,98,98, + 0,0,0,0,0,0,0,0,258,259,260,258,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,260,258,259,259,259,259,259,259,259,259,259,259, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 179,179,179,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 98,98,98,220,178,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179, + 259,100,98,220,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98, + 219,218,98,220,218,98,99,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259, + 219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + 219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + }; + + if(!game.nodeathmode) + { + obj.createblock(1, 0, 0, 32, 240, 41); //scene 2 + obj.createblock(1, 280, 0, 32, 240, 12); //scene 2 + } + + roomname = "What Are You Waiting For?"; + warpy = true; + result = contents; + break; + } + + case rn(43,56): + { + + static const short contents[] = { + 219,218,98,220,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98, + 219,218,98,220,258,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259, + 219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 179,140,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 98,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 259,259,259,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 7,7,7,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,178,179,179,180,0,0,0,0,178,179,179,180,0,0,0,0,178,179,179,180,0,0,0,0,178,179,179,179, + 0,0,0,0,0,0,0,0,6,6,6,6,218,98,98,220,6,6,6,6,218,98,98,220,6,6,6,6,218,98,98,220,6,6,6,6,218,98,98,98, + 0,0,0,0,0,0,0,0,178,179,179,180,218,98,98,220,178,179,179,180,218,98,98,220,178,179,179,180,218,98,98,220,178,179,179,180,218,98,99,259, + 0,0,0,0,0,0,0,0,218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220,218,98,220,219, + 0,0,0,0,0,0,0,0,218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220,218,98,220,219, + 0,0,0,0,0,0,0,0,218,98,98,220,258,259,259,260,218,98,98,220,258,259,259,260,218,98,98,220,258,259,259,260,218,98,98,220,218,98,220,219, + 179,179,179,179,179,179,179,180,218,98,98,220,0,0,0,0,218,98,98,220,0,0,0,0,218,98,98,220,0,0,0,0,218,98,98,220,218,98,220,219, + 98,98,98,98,98,98,98,220,218,98,98,220,0,0,0,0,218,98,98,220,0,0,0,0,218,98,98,220,0,0,0,0,218,98,98,220,218,98,220,219, + 98,98,98,98,98,98,98,220,218,98,98,220,0,0,0,0,218,98,98,220,0,0,0,0,218,98,98,220,0,0,0,0,218,98,98,220,218,98,139,179, + 98,98,98,98,98,98,98,220,218,98,98,220,0,0,0,0,218,98,98,220,0,0,0,0,218,98,98,220,0,0,0,0,218,98,98,220,218,98,98,98, + 259,259,259,259,259,259,259,260,218,98,98,220,0,0,0,0,218,98,98,220,0,0,0,0,218,98,98,220,0,0,0,0,218,98,98,220,258,259,259,259, + 0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,218,98,98,220,0,0,0,0,218,98,98,220,0,0,0,0,218,98,98,220,0,0,0,0, + 0,0,0,0,0,0,0,0,258,259,259,260,0,0,0,0,258,259,259,260,0,0,0,0,258,259,259,260,0,0,0,0,258,259,259,260,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179, + 98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98, + 259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259, + 219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + 219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + }; + + if(!game.nodeathmode) + { + obj.createblock(1, 20, 0, 32, 240, 13); //scene 2 + } + obj.createentity(104, 120, 1, 0, 3); // Enemy + obj.createentity(168, 176, 1, 1, 3); // Enemy + obj.createentity(232, 120, 1, 0, 3); // Enemy + + warpy = true; + roomname = "Don't Get Ahead of Yourself!"; + result = contents; + break; + } + + case rn(44,56): + { + + static const short contents[] = { + 98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98, + 259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,178,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,178,179,179,180,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98, + 179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,180,218,98,98,220,218,98,99,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259, + 98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,218,98,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + 259,259,259,259,259,259,259,259,259,259,259,259,259,259,100,98,220,218,98,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + 219,219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + 219,219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + 219,219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + 219,219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + 219,219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + 179,179,179,179,179,179,179,179,179,179,179,179,179,179,140,98,220,258,259,259,260,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + 98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,0,0,0,0,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + 259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,260,0,0,0,0,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,139,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,258,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,178,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179, + 259,259,259,259,259,259,259,259,259,259,259,259,259,100,98,220,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98, + 219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,99,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259, + 219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + }; + + obj.createentity(144, 40, 10, 1, 56440); // (savepoint) + + if(!game.nodeathmode) + { + obj.createblock(1, 200, 0, 32, 240, 42); //scene 3 + } + + + roomname = "Very Good"; + warpy = true; + result = contents; + break; + } + + case rn(45,56): + { + + static const short contents[] = { + 98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,218,98,220,219,219,219,219,219, + 259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,260,218,98,220,219,219,219,219,219, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,219,219,219,219, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,219,219,219,219, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,219,219,219,219, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,219,219,219,219, + 179,179,179,179,179,179,179,180,178,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,180,0,0,0,0,218,98,220,219,219,219,219,219, + 98,98,98,98,98,98,98,220,258,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,260,0,0,0,0,218,98,220,219,219,219,219,219, + 259,259,259,259,259,100,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,219,219,219,219, + 219,219,219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,219,219,219,219, + 219,219,219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,139,179,179,179,179,179, + 219,219,219,219,219,218,98,220,0,0,0,0,178,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,180,218,98,98,98,98,98,98,98, + 219,219,219,219,219,218,98,220,0,0,0,0,258,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,260,258,259,259,259,259,259,259,259, + 219,219,219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 219,219,219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 219,219,219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 219,219,219,219,219,218,98,220,178,179,179,180,178,179,179,180,178,179,179,179,179,179,179,180,178,179,179,180,178,179,179,179,180,0,0,0,0,0,0,0, + 219,219,219,219,219,218,98,220,218,98,98,220,258,259,259,260,218,98,98,98,98,98,98,220,258,259,259,260,218,98,98,98,220,0,0,0,0,0,0,0, + 219,219,219,219,219,218,98,220,218,98,98,220,0,0,0,0,218,98,98,98,98,98,98,220,0,0,0,0,218,98,98,98,220,178,179,179,179,179,179,179, + 179,179,179,179,179,140,98,220,218,98,98,220,0,0,0,0,218,98,98,98,98,98,98,220,0,0,0,0,218,98,98,98,220,218,98,98,98,98,98,98, + 98,98,98,98,98,98,98,220,218,98,98,220,0,0,0,0,258,259,259,259,259,259,259,260,0,0,0,0,218,98,98,98,220,218,98,98,98,98,98,98, + 259,259,259,259,259,259,259,260,218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,98,220,258,259,259,259,259,259,259, + 0,0,0,0,0,0,0,0,258,259,259,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,258,259,259,259,260,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179, + 98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98, + 259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259, + 219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + }; + + obj.createentity(104, 152, 1, 0, 3); // Enemy + obj.createentity(200, 152, 1, 0, 3); // Enemy + + roomname = "Must I Do Everything For You?"; + warpy = true; + + result = contents; + break; + } + + case rn(46,56): + { + + static const short contents[] = { + 219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + 219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + 219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + 219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + 219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + 219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + 219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + 219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + 219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + 219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + 179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,140,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + 98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + 259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,260,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + 179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,180,0,0,0,0,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + 98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,0,0,0,0,218,98,139,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179, + 98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,0,0,0,0,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98, + 259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,260,0,0,0,0,258,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179, + 98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98, + 259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259, + 219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + }; + + obj.createentity(56, 192, 10, 1, 56460); // (savepoint) + + if(!game.nodeathmode) + { + obj.createblock(1, 200, 0, 32, 240, 43); //scene 3 + } + + roomname = "Now Stay Close To Me..."; + warpy = true; + result = contents; + break; + } + + case rn(47,56): + { + + static const short contents[] = { + 219,219,219,218,98,220,218,98,139,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179, + 219,219,219,218,98,220,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98, + 219,219,219,218,98,220,258,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259, + 219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,178,179,179,180,178,179,179,179,179,179,179,179,179,179,179,179,179,179, + 219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,218,98,98,98,98,98,98,98,98,98,98,98,98,98, + 219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,218,98,99,259,259,259,259,259,259,259,259,259,259,259, + 219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219, + 219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219, + 219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,258,259,259,260,218,98,220,219,219,219,219,219,219,219,219,219,219,219, + 219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,220,219,219,219,219,219,219,219,219,219,219,219, + 219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,220,219,219,219,219,219,219,219,219,219,219,219, + 219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,220,219,219,219,219,219,219,219,219,219,219,219, + 219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,220,219,219,219,219,219,219,219,219,219,219,219, + 219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,220,219,219,219,219,219,219,219,219,219,219,219, + 179,179,179,140,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,220,219,219,219,219,219,219,219,219,219,219,219, + 98,98,98,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,220,219,219,219,219,219,219,219,219,219,219,219, + 259,259,259,259,259,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,178,179,179,180,218,98,220,219,219,219,219,219,219,219,219,219,219,219, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219, + 179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,180,0,0,0,0,218,98,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219, + 98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,6,6,6,6,218,98,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219, + 259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,100,98,220,178,179,179,180,218,98,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219, + 219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,98,220,218,98,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219, + }; + + obj.createentity(144, 64, 2, 0, 2, 144, 64, 176, 216); // Platform, bounded + + roomname = "...But Not Too Close"; + warpy = true; + result = contents; + break; + } + + case rn(48,56): + { + + static const short contents[] = { + 179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,140,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219, + 98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219, + 259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,260,218,98,220,219,219,219,219,219,219,219,219,219,219,219, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,178,179,179,179,180,218,98,220,219,219,219,219,219,219,219,219,219,219,219, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,258,259,259,259,260,218,98,220,219,219,219,219,219,219,219,219,219,219,219, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,178,180,218,98,220,219,219,219,219,219,219,219,219,219,219,219, + 179,179,179,179,179,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219, + 98,98,98,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219, + 259,259,259,100,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,258,260,218,98,220,219,219,219,219,219,219,219,219,219,219,219, + 219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,220,219,219,219,219,219,219,219,219,219,219,219, + 219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,220,219,219,219,219,219,219,219,219,219,219,219, + 219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,220,219,219,219,219,219,219,219,219,219,219,219, + 219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,220,219,219,219,219,219,219,219,219,219,219,219, + 219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,220,219,219,219,219,219,219,219,219,219,219,219, + 219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,220,219,219,219,219,219,219,219,219,219,219,219, + 219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,139,179,179,179,179,179,179,179,179,179,179,179, + 219,219,219,218,98,220,0,0,0,0,0,0,0,0,178,179,179,179,179,179,179,180,0,0,0,50,218,98,98,98,98,98,98,98,98,98,98,98,98,98, + 219,219,219,218,98,220,0,0,0,0,0,0,0,0,218,98,98,98,98,98,98,220,0,0,0,50,258,259,259,259,259,259,259,259,259,259,259,259,259,259, + 219,219,219,218,98,220,0,0,0,0,0,0,0,0,218,98,98,98,98,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 219,219,219,218,98,220,0,0,0,0,0,0,0,0,218,98,98,98,98,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 219,219,219,218,98,220,0,0,0,0,0,0,0,0,218,98,98,98,98,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 219,219,219,218,98,220,6,6,6,6,6,6,6,6,258,259,259,259,259,259,259,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 219,219,219,218,98,220,178,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179, + 219,219,219,218,98,220,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98, + 219,219,219,218,98,220,218,98,99,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259, + 219,219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + 219,219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + 219,219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + }; + + warpy = true; + roomname = "Don't Be Afraid"; + result = contents; + break; + } + + case rn(49,56): + { + + static const short contents[] = { + 219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + 219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + 219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + 219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + 219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + 219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + 219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + 219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + 219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + 219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + 219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + 219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + 219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + 219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + 219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + 219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + 219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + 179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179, + 98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98, + 259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179, + 98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98, + 259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259, + 219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + 219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + 219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + }; + + obj.createentity(152, 176, 10, 1, 56490); // (savepoint) + if(!game.nodeathmode) + { + obj.createblock(1, 200, 0, 32, 240, 44); //scene 3 + } + warpy = true; + roomname = "Do as I Say..."; + result = contents; + break; + } + + case rn(50,56): + { + + static const short contents[] = { + 219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + 219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + 219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + 219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + 219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + 219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + 219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + 219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + 219,219,218,98,220,218,98,139,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179, + 219,219,218,98,220,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98, + 219,219,218,98,220,258,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259, + 219,219,218,98,220,178,179,179,180,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, + 219,219,218,98,220,218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 219,219,218,98,220,218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 219,219,218,98,220,258,259,259,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 179,179,140,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 98,98,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 259,259,259,259,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,178,179,179,179,179,179,179,179,180,178,179, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,98,98,98,98,98,220,218,98, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,258,259,259,259,259,259,259,259,260,218,98, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98, + 179,179,179,179,179,179,179,179,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98, + 98,98,98,98,98,98,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98, + 259,259,259,259,259,259,100,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,178,179,179,180,218,98, + 219,219,219,219,219,219,218,98,220,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,218,98,98,220,218,98, + 219,219,219,219,219,219,218,98,220,178,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,180,218,98,98,220,218,98, + 219,219,219,219,219,219,218,98,220,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,218,98,98,220,218,98, + }; + + obj.createentity(88, 200, 2, 1, 4, 88, 128, 216, 208); // Platform, bounded + obj.createentity(136, 136, 2, 0, 4, 88, 128, 216, 208); // Platform, bounded + obj.createentity(184, 200, 2, 1, 4, 88, 128, 216, 208); // Platform, bounded + + roomname = "...Not as I Do"; + warpy = true; + result = contents; + break; + } + + case rn(51,56): + { + + static const short contents[] = { + 219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,98,220,218,98,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + 219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,98,220,218,98,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + 219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,98,220,218,98,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + 219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,98,220,218,98,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + 219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,98,220,218,98,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + 219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,98,220,218,98,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + 219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,98,220,218,98,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + 219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,98,220,218,98,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + 179,179,179,179,179,179,179,179,179,179,179,140,98,220,218,98,98,220,218,98,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + 98,98,98,98,98,98,98,98,98,98,98,98,98,220,218,98,98,220,218,98,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + 259,259,259,259,259,259,259,259,259,259,259,259,259,260,218,98,98,220,218,98,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,258,259,259,260,218,98,98,220,218,98,139,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,258,259,259,260,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,258,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179, + 98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98, + 259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259, + 219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + 219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + 219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + 219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + 219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + 219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + 219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + 219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + }; + + obj.createentity(192, 136, 10, 1, 56510); // (savepoint) + if(!game.nodeathmode) + { + obj.createblock(1, 80, 0, 32, 240, 45); //scene 3 + } + warpy = true; + roomname = "Mind Your Head"; + result = contents; + break; + } + + case rn(52,56): + { + + static const short contents[] = { + 219,218,98,220,258,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,260,218,98,220,219, + 219,218,98,220,7,7,7,7,7,178,180,7,7,7,7,7,7,7,178,180,7,7,7,7,178,179,179,180,7,7,7,7,7,7,7,7,218,98,220,219, + 219,218,98,220,0,0,0,0,0,218,220,0,0,0,0,0,0,0,218,220,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,0,218,98,220,219, + 219,218,98,220,0,0,0,0,0,258,260,0,0,0,0,0,0,0,258,260,0,0,0,0,258,259,259,260,0,0,0,0,0,0,0,0,218,98,139,179, + 219,218,98,220,0,0,0,0,0,7,7,0,0,0,0,0,0,0,7,7,0,0,0,0,7,7,7,7,0,0,0,0,0,0,0,0,218,98,98,98, + 219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,258,259,259,259, + 219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,7,7,7, + 219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 179,140,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,178,179,179,179, + 98,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,98, + 259,259,259,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,99,259, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219, + 179,179,179,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219, + 98,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219, + 259,100,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219, + 219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219, + 219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219, + 219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219, + 219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219, + 219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219, + 219,218,98,220,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,218,98,220,219, + 219,218,98,220,178,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,180,218,98,220,219, + 219,218,98,220,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,218,98,220,219, + }; + + obj.createentity(48, 200, 2, 1, 6, 48, 48, 272, 208); // Platform, bounded + obj.createentity(80, 200, 2, 1, 6, 48, 48, 272, 208); // Platform, bounded + obj.createentity(112, 200, 2, 1, 6, 48, 48, 272, 208); // Platform, bounded + obj.createentity(144, 200, 2, 1, 6, 48, 48, 272, 208); // Platform, bounded + obj.createentity(176, 200, 2, 1, 6, 48, 48, 272, 208); // Platform, bounded + obj.createentity(208, 200, 2, 1, 6, 48, 48, 272, 208); // Platform, bounded + obj.createentity(240, 200, 2, 1, 6, 48, 48, 272, 208); // Platform, bounded + + roomname = "Do Try To Keep Up"; + warpy = true; + result = contents; + break; + } + + case rn(53,56): + { + + static const short contents[] = { + 219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,220,219,219,219,219,219, + 219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,220,219,219,219,219,219, + 219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,220,219,219,219,219,219, + 179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,140,98,220,218,98,220,219,219,219,219,219, + 98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,218,98,220,219,219,219,219,219, + 259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,260,218,98,220,219,219,219,219,219, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,219,219,219,219, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,219,219,219,219, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,219,219,219,219, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,219,219,219,219, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,219,219,219,219, + 179,179,179,179,179,179,179,180,178,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,180,0,0,218,98,220,219,219,219,219,219, + 98,98,98,98,98,98,98,220,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,0,0,218,98,220,219,219,219,219,219, + 259,259,259,259,259,100,98,220,258,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,260,0,0,218,98,220,219,219,219,219,219, + 219,219,219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,219,219,219,219, + 219,219,219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,219,219,219,219, + 219,219,219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,219,219,219,219, + 219,219,219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,219,219,219,219, + 219,219,219,219,219,218,98,220,0,0,178,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,180,218,98,139,179,179,179,179,179, + 219,219,219,219,219,218,98,220,0,0,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,218,98,98,98,98,98,98,98, + 219,219,219,219,219,218,98,220,0,0,258,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,260,258,259,259,259,259,259,259,259, + 219,219,219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 219,219,219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 219,219,219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 219,219,219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 219,219,219,219,219,218,98,220,178,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179, + 219,219,219,219,219,218,98,220,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98, + 219,219,219,219,219,218,98,220,218,98,99,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259, + 219,219,219,219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + 219,219,219,219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + }; + + obj.createentity(72, 72, 10, 1, 56530); // (savepoint) + + roomname = "You're Falling Behind"; + warpy = true; + result = contents; + break; + } + + case rn(54,56): + { + + static const short contents[] = { + 219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,220,219,219,219,219, + 219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,220,219,219,219,219, + 219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,220,219,219,219,219, + 219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,220,219,219,219,219, + 219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,220,219,219,219,219, + 219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,220,219,219,219,219, + 219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,139,179,179,179,179,179,179,179,179,179,179,179,140,98,220,218,98,220,219,219,219,219, + 219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,218,98,220,219,219,219,219, + 219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,258,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,260,218,98,220,219,219,219,219, + 219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,219,219,219, + 219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,219,219,219, + 219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,219,219,219, + 219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,219,219,219, + 219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,219,219,219, + 219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,219,219,219, + 219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,219,219,219, + 219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,219,219,219, + 219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,219,219,219, + 179,179,179,179,179,179,179,179,179,179,179,179,179,140,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,219,219,219, + 98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,219,219,219, + 259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,219,219,219, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,219,219,219, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,139,179,179,179,179, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,98,98,98,98, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,258,259,259,259,259,259,259, + 179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179, + 98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98, + 259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259, + 219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + 219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219, + }; + + obj.createentity((18 * 8) + 4, (10 * 8) + 4, 14); //Teleporter! + + if(!game.nodeathmode) + { + obj.createblock(1, 104, 0, 32, 240, 46); //scene 3 + } + + roomname = "Class Dismissed!"; + warpy = true; + result = contents; + break; + } #endif - default: - { - static const short contents[1200] = {0}; - roomname = "Outer Space"; - roomname_special = true; + default: + { + static const short contents[1200] = {0}; + roomname = "Outer Space"; - //game.test = true; - //game.teststring = "ERROR: Map not found in Final Area"; - result = contents; - break; - } - } + //game.test = true; + //game.teststring = "ERROR: Map not found in Final Area"; + result = contents; + break; + } + } - return result; + return result; } diff --git a/desktop_version/src/Finalclass.h b/desktop_version/src/Finalclass.h index 35a4d304..eb0572b7 100644 --- a/desktop_version/src/Finalclass.h +++ b/desktop_version/src/Finalclass.h @@ -1,13 +1,14 @@ #ifndef FINALCLASS_H #define FINALCLASS_H +#include + class finalclass { public: const short* loadlevel(int rx, int ry); - const char* roomname; - bool roomname_special; + std::string roomname; bool warpx, warpy; }; diff --git a/desktop_version/src/Font.cpp b/desktop_version/src/Font.cpp deleted file mode 100644 index a8af8e1d..00000000 --- a/desktop_version/src/Font.cpp +++ /dev/null @@ -1,1481 +0,0 @@ -#include "Font.h" - -#include - -#include "Alloc.h" -#include "Constants.h" -#include "CustomLevels.h" -#include "FileSystemUtils.h" -#include "FontBidi.h" -#include "Graphics.h" -#include "GraphicsResources.h" -#include "GraphicsUtil.h" -#include "Localization.h" -#include "UTF8.h" -#include "UtilityClass.h" -#include "Vlogging.h" -#include "XMLUtils.h" - -extern "C" -{ -#include -} - -namespace font -{ - -#define GLYPH_EXISTS 0x1 -#define GLYPH_COLOR 0x2 - -struct GlyphInfo -{ - uint16_t image_idx; - uint8_t advance; - uint8_t flags; -}; - -/* Codepoints go up to U+10FFFF, so we have 0x110 (272) pages - * of 0x1000 (4096) glyphs, allocated as needed */ -#define FONT_N_PAGES 0x110 -#define FONT_PAGE_SIZE 0x1000 - -enum FontType -{ - FontType_FONT, - FontType_BUTTONS -}; - -struct Font -{ - char name[64]; - char display_name[SCREEN_WIDTH_CHARS + 1]; - - FontType type; - - uint8_t glyph_w; - uint8_t glyph_h; - - SDL_Texture* image; - - GlyphInfo* glyph_page[FONT_N_PAGES]; - - char fallback_key[64]; - uint8_t fallback_idx; - bool fallback_idx_valid; -}; - -struct FontContainer -{ - uint8_t count; - Font* fonts; - hashmap* map_name_idx; -}; - -struct PrintFlags -{ - uint8_t scale; - Font* font_sel; - uint8_t brightness; - bool border; - bool full_border; - bool align_cen; - bool align_right; - bool cjk_low; - bool cjk_high; - bool rtl; - bool rtl_xflip; -}; - -static FontContainer fonts_main = {}; -static FontContainer fonts_custom = {}; - -static uint8_t font_idx_8x8 = 0; - -uint8_t font_idx_options_n = 0; -uint8_t font_idx_options[20]; - -static bool font_level_is_interface = false; -bool font_idx_level_is_custom = false; -uint8_t font_idx_level = 0; - -static void codepoint_split( - const uint32_t codepoint, - short* page, - short* glyph -) -{ - // Splits a code point (0x10FFFF) into page (0x10F) and glyph (0xFFF) - if (codepoint > 0x10FFFF) - { - codepoint_split(0xFFFD, page, glyph); - return; - } - *page = codepoint >> 12; - *glyph = codepoint % FONT_PAGE_SIZE; -} - -static GlyphInfo* get_glyphinfo( - const Font* f, - const uint32_t codepoint -) -{ - short page, glyph; - codepoint_split(codepoint, &page, &glyph); - - if (f->glyph_page[page] == NULL) - { - return NULL; - } - - return &f->glyph_page[page][glyph]; -} - -static void add_glyphinfo( - Font* f, - const uint32_t codepoint, - const int image_idx -) -{ - if (image_idx < 0 || image_idx > 65535) - { - return; - } - - short page, glyph; - codepoint_split(codepoint, &page, &glyph); - - if (f->glyph_page[page] == NULL) - { - f->glyph_page[page] = (GlyphInfo*) SDL_calloc(FONT_PAGE_SIZE, sizeof(GlyphInfo)); - if (f->glyph_page[page] == NULL) - { - return; - } - } - - f->glyph_page[page][glyph].image_idx = image_idx; - f->glyph_page[page][glyph].advance = f->glyph_w; - f->glyph_page[page][glyph].flags = GLYPH_EXISTS; -} - -static bool glyph_is_valid(const GlyphInfo* glyph) -{ - return glyph->flags & GLYPH_EXISTS; -} - -static Font* fallback_for(const Font* f) -{ - if (!f->fallback_idx_valid) - { - return NULL; - } - return &fonts_main.fonts[f->fallback_idx]; -} - -static GlyphInfo* find_glyphinfo(const Font* f, const uint32_t codepoint, const Font** f_glyph) -{ - /* Get the GlyphInfo for a specific codepoint, or or ? if it doesn't exist. - * f_glyph may be either set to f (the main specified font) or its fallback font, if it exists. - * As a last resort, may return NULL. */ - *f_glyph = f; - - GlyphInfo* glyph = get_glyphinfo(f, codepoint); - if (glyph != NULL && glyph_is_valid(glyph)) - { - return glyph; - } - - Font* f_fallback = fallback_for(f); - if (f_fallback != NULL && (glyph = get_glyphinfo(f_fallback, codepoint)) != NULL && glyph_is_valid(glyph)) - { - *f_glyph = f_fallback; - return glyph; - } - - glyph = get_glyphinfo(f, 0xFFFD); - if (glyph != NULL && glyph_is_valid(glyph)) - { - return glyph; - } - glyph = get_glyphinfo(f, '?'); - if (glyph != NULL && glyph_is_valid(glyph)) - { - return glyph; - } - - return NULL; -} - -static int get_advance_ff(const Font* f, const Font* f_glyph, const GlyphInfo* glyph) -{ - /* Internal function - get the correct advance after we have - * determined whether the glyph is from the fallback font or not. */ - - if (glyph == NULL) - { - return f->glyph_w; - } - - /* If the glyph is a fallback glyph, center it relative to the main font - * instead of trusting the fallback's width */ - if (f_glyph != f) - { - return f->glyph_w; - } - - return glyph->advance; -} - -int get_advance(const Font* f, const uint32_t codepoint) -{ - // Get the width of a single character in a font - if (f == NULL) - { - return 8; - } - - const Font* f_glyph; - GlyphInfo* glyph = find_glyphinfo(f, codepoint, &f_glyph); - return get_advance_ff(f, f_glyph, glyph); -} - -static bool decode_xml_range(tinyxml2::XMLElement* elem, unsigned* start, unsigned* end) -{ - // We do support hexadecimal start/end like "0x10FFFF" - if (elem->QueryUnsignedAttribute("start", start) != tinyxml2::XML_SUCCESS - || elem->QueryUnsignedAttribute("end", end) != tinyxml2::XML_SUCCESS - || *end < *start || *start > 0x10FFFF - ) - { - return false; - } - - *end = SDL_min(*end, 0x10FFFF); - return true; -} - -static uint8_t load_font(FontContainer* container, const char* name) -{ - if (container->count >= 254) - { - return 0; - } - Font* new_fonts = (Font*) SDL_realloc(container->fonts, sizeof(Font)*(container->count+1)); - if (new_fonts == NULL) - { - return 0; - } - container->fonts = new_fonts; - uint8_t f_idx = container->count++; - Font* f = &container->fonts[f_idx]; - - vlog_info("Loading font \"%s\"...", name); - - char name_png[256]; - char name_txt[256]; - char name_xml[256]; - SDL_snprintf(name_png, sizeof(name_png), "graphics/%s.png", name); - SDL_snprintf(name_txt, sizeof(name_txt), "graphics/%s.txt", name); - SDL_snprintf(name_xml, sizeof(name_xml), "graphics/%s.fontmeta", name); - SDL_strlcpy(f->name, name, sizeof(f->name)); - SDL_strlcpy(f->display_name, name, sizeof(f->display_name)); - - f->type = FontType_FONT; - - f->glyph_w = 8; - f->glyph_h = 8; - - f->fallback_key[0] = '\0'; - f->fallback_idx_valid = false; - - bool white_teeth = false; - - tinyxml2::XMLDocument doc; - tinyxml2::XMLHandle hDoc(&doc); - tinyxml2::XMLElement* pElem; - bool xml_loaded = false; - - if (FILESYSTEM_areAssetsInSameRealDir(name_png, name_xml) - && FILESYSTEM_loadAssetTiXml2Document(name_xml, doc) - ) - { - xml_loaded = true; - hDoc = hDoc.FirstChildElement("font_metadata"); - - if ((pElem = hDoc.FirstChildElement("display_name").ToElement()) != NULL) - { - SDL_strlcpy(f->display_name, pElem->GetText(), sizeof(f->display_name)); - } - if ((pElem = hDoc.FirstChildElement("type").ToElement()) != NULL) - { - if (SDL_strcmp(pElem->GetText(), "buttons") == 0) - { - f->type = FontType_BUTTONS; - } - } - if ((pElem = hDoc.FirstChildElement("width").ToElement()) != NULL) - { - f->glyph_w = help.Int(pElem->GetText()); - } - if ((pElem = hDoc.FirstChildElement("height").ToElement()) != NULL) - { - f->glyph_h = help.Int(pElem->GetText()); - } - if ((pElem = hDoc.FirstChildElement("white_teeth").ToElement()) != NULL) - { - // If 1, we don't need to whiten the entire font (like in old versions) - white_teeth = help.Int(pElem->GetText()); - } - if ((pElem = hDoc.FirstChildElement("fallback").ToElement()) != NULL) - { - SDL_strlcpy(f->fallback_key, pElem->GetText(), sizeof(f->fallback_key)); - } - } - - f->image = LoadImage(name_png, white_teeth ? TEX_COLOR : TEX_WHITE); - SDL_zeroa(f->glyph_page); - - if (f->image == NULL) - { - return f_idx; - } - - /* We may have a 2.3-style font.txt with all the characters. - * font.txt takes priority over in the XML. - * If neither exist, it's just ASCII. */ - bool charset_loaded = false; - bool special_loaded = false; - unsigned char* charmap = NULL; - size_t length; - if (FILESYSTEM_areAssetsInSameRealDir(name_png, name_txt)) - { - /* The .txt can contain null bytes, but it's still null-terminated - it protects - * against incomplete sequences getting the UTF-8 decoder to read out of bounds. */ - FILESYSTEM_loadAssetToMemory(name_txt, &charmap, &length); - } - if (charmap != NULL) - { - // We have a .txt! It's an obsolete system, but it takes priority if the file exists. - const char* current = (char*) charmap; - const char* end = (char*) charmap + length; - int pos = 0; - while (current < end) - { - uint32_t codepoint = UTF8_next(¤t); - add_glyphinfo(f, codepoint, pos); - ++pos; - } - - VVV_free(charmap); - charset_loaded = true; - } - - if (xml_loaded && !charset_loaded && (pElem = hDoc.FirstChildElement("chars").ToElement()) != NULL) - { - // in the XML is the preferred system. - int pos = 0; - tinyxml2::XMLElement* subElem; - FOR_EACH_XML_SUB_ELEMENT(pElem, subElem) - { - EXPECT_ELEM(subElem, "range"); - - unsigned start, end; - if (!decode_xml_range(subElem, &start, &end)) - { - continue; - } - - for (uint32_t codepoint = start; codepoint <= end; codepoint++) - { - add_glyphinfo(f, codepoint, pos); - ++pos; - } - } - charset_loaded = true; - } - - if (!charset_loaded) - { - /* If we don't have font.txt and no tag either, - * this font is 2.2-and-below-style plain ASCII. - * Or well... 2.3 interpreted these as - * "all unicode from 0 to however much is in the image"... */ - - SDL_Surface* temp_surface = LoadImageSurface(name_png); - if (temp_surface != NULL) - { - const uint32_t chars_per_line = temp_surface->w / f->glyph_w; - const uint32_t max_codepoint = (temp_surface->h / f->glyph_h) * chars_per_line; - - for (uint32_t codepoint = 0x00; codepoint < max_codepoint; codepoint++) - { - if (codepoint > 0x7F) - { - /* Only include characters with actual pixels... - * If the font.png is too big (normally it is) we _want_ question marks. */ - const int glyph_x = (codepoint % chars_per_line) * f->glyph_w; - const int glyph_y = (codepoint / chars_per_line) * f->glyph_h; - - bool found_pixel = false; - for (int pixel_y = 0; pixel_y < f->glyph_h; pixel_y++) - { - for (int pixel_x = 0; pixel_x < f->glyph_w; pixel_x++) - { - if (ReadPixel(temp_surface, glyph_x+pixel_x, glyph_y+pixel_y).a > 0) - { - found_pixel = true; - goto no_more_pixels; - } - } - } - no_more_pixels: - if (!found_pixel) - { - // Do not add it - continue; - } - } - add_glyphinfo(f, codepoint, codepoint); - } - - VVV_freefunc(SDL_FreeSurface, temp_surface); - } - } - - if (xml_loaded && (pElem = hDoc.FirstChildElement("special").ToElement()) != NULL) - { - tinyxml2::XMLElement* subElem; - FOR_EACH_XML_SUB_ELEMENT(pElem, subElem) - { - EXPECT_ELEM(subElem, "range"); - - unsigned start, end; - if (!decode_xml_range(subElem, &start, &end)) - { - continue; - } - - int advance = subElem->IntAttribute("advance", -1); - int color = subElem->IntAttribute("color", -1); - - for (uint32_t codepoint = start; codepoint <= end; codepoint++) - { - GlyphInfo* glyph = get_glyphinfo(f, codepoint); - if (glyph == NULL) - { - continue; - } - if (advance >= 0 && advance < 256) - { - glyph->advance = advance; - } - if (color == 0) - { - glyph->flags &= ~GLYPH_COLOR; - } - else if (color == 1) - { - glyph->flags |= GLYPH_COLOR; - } - } - } - special_loaded = true; - } - - if (!special_loaded && f->glyph_w == 8 && f->glyph_h == 8) - { - /* If we don't have , and the font is 8x8, - * 0x00-0x1F will be less wide because that's how it has always been. */ - for (uint32_t codepoint = 0x00; codepoint < 0x20; codepoint++) - { - GlyphInfo* glyph = get_glyphinfo(f, codepoint); - if (glyph != NULL) - { - glyph->advance = 6; - } - } - } - - return f_idx; -} - -static bool find_font_by_name(FontContainer* container, const char* name, uint8_t* idx) -{ - // Returns true if font found (and idx is set), false if not found - if (container->map_name_idx == NULL) - { - // No fonts yet... - return false; - } - - uintptr_t i; - if (hashmap_get(container->map_name_idx, name, SDL_strlen(name), &i)) - { - *idx = i; - return true; - } - return false; -} - -bool find_main_font_by_name(const char* name, uint8_t* idx) -{ - return find_font_by_name(&fonts_main, name, idx); -} - -uint8_t get_font_idx_8x8(void) -{ - return font_idx_8x8; -} - -bool level_font_is_main_idx(const uint8_t idx) -{ - return !font_idx_level_is_custom && font_idx_level == idx; -} - -void set_level_font(const char* name) -{ - /* Apply the choice for a certain level-specific font. - * This function is for custom levels. */ - font_level_is_interface = false; - - if (find_font_by_name(&fonts_custom, name, &font_idx_level)) - { - font_idx_level_is_custom = true; - } - else - { - font_idx_level_is_custom = false; - if (!find_font_by_name(&fonts_main, name, &font_idx_level)) - { - if (SDL_strcmp(name, "font") != 0) - { - set_level_font("font"); - } - else - { - font_idx_level = font_idx_8x8; - } - } - } - - cl.rtl = SDL_strcmp(name, "font_ar") == 0; // FIXME: make different menu options for choosing LTR/RTL of the same font -} - -void set_level_font_interface(void) -{ - /* Set the level font equal to the interface font. - * This function is for the main game. */ - font_level_is_interface = true; -} - -void set_level_font_new(void) -{ - /* Set the level font to the default font for new levels. - * This function is for starting the editor. */ - font_level_is_interface = false; - font_idx_level_is_custom = false; - if (loc::new_level_font == "") - { - /* Just take the language's font - * (Japanese VVVVVV can make Japanese levels by default, etc) */ - font_idx_level = loc::get_langmeta()->font_idx; - } - else - { - /* If the user has changed the font (wants to make levels - * for a different userbase) then remember that choice. */ - if (!find_main_font_by_name(loc::new_level_font.c_str(), &font_idx_level)) - { - font_idx_level = font_idx_8x8; - } - } - - cl.level_font_name = get_main_font_name(font_idx_level); - cl.rtl = cl.level_font_name == "font_ar"; // FIXME: make different menu options for choosing LTR/RTL of the same font -} - -static void fill_map_name_idx(FontContainer* container) -{ - /* Initialize the name->idx hashmap for the fonts in this container. - * This should only be done once, after all the fonts are added. */ - container->map_name_idx = hashmap_create(); - - for (uint8_t i = 0; i < container->count; i++) - { - Font* f = &container->fonts[i]; - hashmap_set(container->map_name_idx, f->name, SDL_strlen(f->name), i); - } -} - -static void set_fallbacks(FontContainer* container) -{ - /* Initialize the value of fallback_idx for all fonts in this container. - * Only main fonts can be fallback fonts. */ - for (uint8_t i = 0; i < container->count; i++) - { - Font* f = &container->fonts[i]; - if (find_main_font_by_name(f->fallback_key, &f->fallback_idx)) - { - f->fallback_idx_valid = true; - } - } -} - -static void load_font_filename(bool is_custom, const char* filename) -{ - // Load font.png, and everything that matches *.fontmeta (but not font.fontmeta) - size_t expected_ext_start; - bool is_fontpng = SDL_strcmp(filename, "font.png") == 0; - if (is_fontpng) - { - expected_ext_start = SDL_strlen(filename)-4; - } - else - { - expected_ext_start = SDL_strlen(filename)-9; - } - if (is_fontpng || (endsWith(filename, ".fontmeta") && SDL_strcmp(filename, "font.fontmeta") != 0)) - { - char font_name[64]; - SDL_strlcpy(font_name, filename, sizeof(font_name)); - font_name[SDL_min(63, expected_ext_start)] = '\0'; - - uint8_t f_idx = load_font(is_custom ? &fonts_custom : &fonts_main, font_name); - - if (is_fontpng && !is_custom) - { - font_idx_8x8 = f_idx; - } - } -} - -void load_main(void) -{ - // Load all global fonts - EnumHandle handle = {}; - const char* item; - while ((item = FILESYSTEM_enumerate("graphics", &handle)) != NULL) - { - load_font_filename(false, item); - } - FILESYSTEM_freeEnumerate(&handle); - font_idx_level = font_idx_8x8; - - fill_map_name_idx(&fonts_main); - set_fallbacks(&fonts_main); - - // Initialize the font menu options, 8x8 font first - font_idx_options[0] = font_idx_8x8; - font_idx_options_n = 1; - - for (uint8_t i = 0; i < fonts_main.count; i++) - { - if (i == font_idx_8x8) - { - continue; - } - if (fonts_main.fonts[i].type != FontType_FONT) - { - continue; - } - font_idx_options[font_idx_options_n++] = i; - if (font_idx_options_n >= sizeof(font_idx_options)) - { - break; - } - } -} - -void load_custom(const char* name) -{ - // Load all custom (level-specific assets) fonts - unload_custom(); - EnumHandle handle = {}; - const char* item; - while ((item = FILESYSTEM_enumerateAssets("graphics", &handle)) != NULL) - { - load_font_filename(true, item); - } - FILESYSTEM_freeEnumerate(&handle); - - fill_map_name_idx(&fonts_custom); - set_fallbacks(&fonts_custom); - - set_level_font(name); -} - -void unload_font(Font* f) -{ - VVV_freefunc(SDL_DestroyTexture, f->image); - - for (int i = 0; i < FONT_N_PAGES; i++) - { - VVV_free(f->glyph_page[i]); - } -} - -void unload_font_container(FontContainer* container) -{ - VVV_freefunc(hashmap_free, container->map_name_idx); - - for (uint8_t i = 0; i < container->count; i++) - { - unload_font(&container->fonts[i]); - } - VVV_free(container->fonts); - container->fonts = NULL; - container->count = 0; -} - -void unload_custom(void) -{ - // Unload all custom fonts - unload_font_container(&fonts_custom); -} - -void destroy(void) -{ - // Unload all fonts (main and custom) for exiting - unload_custom(); - unload_font_container(&fonts_main); -} - -static Font* container_get(FontContainer* container, uint8_t idx) -{ - /* Get a certain font from the given container (with bounds checking). - * Does its best to return at least something, - * but if there are no fonts whatsoever, can return NULL. */ - - if (idx < container->count) - { - return &container->fonts[idx]; - } - if (font_idx_8x8 < fonts_main.count) - { - return &fonts_main.fonts[font_idx_8x8]; - } - if (fonts_main.count > 0) - { - return &fonts_main.fonts[0]; - } - if (fonts_custom.count > 0) - { - return &fonts_custom.fonts[0]; - } - return NULL; -} - -static Font* fontsel_to_font(int sel, bool* rtl, bool custom) -{ - /* Take font selection integer (0-31) and turn it into the correct Font - * 0: PR_FONT_INTERFACE - use interface font - * 1: PR_FONT_LEVEL - use level font - * 2: PR_FONT_8X8 - use 8x8 font no matter what - * 3-31: - use font index 0-28 (depending on custom, from - * PR_FONT_IDX_IS_CUSTOM) - * - * rtl will be set depending on whether we're requesting the interface - * font (take it from the lang attributes) or level font (take it from - * the level attributes), or false otherwise. */ - - *rtl = false; - - if (sel < 0) - { - // Shouldn't happen but better safe than sorry... - return NULL; - } - - switch (sel) - { - case 1: - if (!font_level_is_interface) - { - *rtl = cl.rtl; - if (font_idx_level_is_custom) - { - return container_get(&fonts_custom, font_idx_level); - } - else - { - return container_get(&fonts_main, font_idx_level); - } - } - SDL_FALLTHROUGH; - case 0: - *rtl = loc::get_langmeta()->rtl; - return container_get(&fonts_main, loc::get_langmeta()->font_idx); - case 2: - return container_get(&fonts_main, font_idx_8x8); - } - - if (custom) - { - return container_get(&fonts_custom, sel-3); - } - return container_get(&fonts_main, sel-3); -} - -#define FLAG_PART(start, count) ((flags >> start) % (1 << count)) -static PrintFlags decode_print_flags(uint32_t flags) -{ - PrintFlags pf; - pf.scale = FLAG_PART(0, 3) + 1; - pf.font_sel = fontsel_to_font( - FLAG_PART(3, 5), &pf.rtl, flags & PR_FONT_IDX_IS_CUSTOM - ); - if (flags & PR_RTL_FORCE) - { - pf.rtl = true; - } - pf.brightness = ~FLAG_PART(8, 8) & 0xff; - pf.border = flags & PR_BOR; - pf.full_border = flags & PR_FULLBOR; - pf.align_cen = flags & PR_CEN; - pf.align_right = flags & PR_RIGHT; - pf.cjk_low = flags & PR_CJK_LOW; - pf.cjk_high = flags & PR_CJK_HIGH; - pf.rtl_xflip = flags & PR_RTL_XFLIP; - - if (pf.full_border) - { - pf.border = false; - } - - return pf; -} -#undef FLAG_PART - -static bool next_wrap( - Font* f, - size_t* start, - size_t* len, - const char* str, - const int maxwidth -) { - /* Get information about the current line in wordwrapped text, - * given this line starts at str[*start]. - * *start is updated to the start of the next line. */ - size_t idx = 0; - size_t lenfromlastspace = 0; - size_t lastspace = 0; - int linewidth = 0; - *len = 0; - - if (str[idx] == '\0') - { - return false; - } - - while (true) - { - uint8_t codepoint_nbytes; - uint32_t codepoint = UTF8_peek_next(&str[idx], &codepoint_nbytes); - - switch (codepoint) - { - case ' ': - if (loc::get_langmeta()->autowordwrap) - { - lenfromlastspace = idx; - lastspace = *start; - } - break; - case '\n': - case '|': - *start += 1; - SDL_FALLTHROUGH; - case '\0': - return true; - } - - linewidth += get_advance(f, codepoint); - - if (linewidth > maxwidth) - { - if (lenfromlastspace != 0) - { - *len = lenfromlastspace; - *start = lastspace + 1; - } - if (idx == 0) - { - // Oops, we're stuck at a single character - *len = 1; - *start += 1; - } - return true; - } - - idx += codepoint_nbytes; - *start += codepoint_nbytes; - *len += codepoint_nbytes; - } -} - -static bool next_wrap_buf( - Font* f, - char buffer[], - const size_t buffer_size, - size_t* start, - const char* str, - const int maxwidth -) { - /* Get each line of wordwrapped text, writing one line at a time to a buffer. - * Call as follows: - * - * char buf[256]; - * size_t start = 0; - * while (next_wrap_buf(font, buf, sizeof(buf), &start, "String to wordwrap", 320)) - * { - * // buf contains a line of text - * } - */ - size_t len = 0; - const size_t prev_start = *start; - - const bool retval = next_wrap(f, start, &len, &str[*start], maxwidth); - - if (retval) - { - /* Like next_split_s(), don't use SDL_strlcpy() here. */ - const size_t length = SDL_min(buffer_size - 1, len); - SDL_memcpy(buffer, &str[prev_start], length); - buffer[length] = '\0'; - } - - return retval; -} - -std::string string_wordwrap(const uint32_t flags, const std::string& s, int maxwidth, short *lines /*= NULL*/) -{ - /* Return a string wordwrapped to a maximum limit by adding newlines. - * CJK will need to have autowordwrap disabled and have manually inserted newlines. */ - - if (lines != NULL) - { - *lines = 1; - } - - PrintFlags pf = decode_print_flags(flags); - if (pf.font_sel == NULL) - { - return s; - } - - const char* orig = s.c_str(); - - std::string result; - size_t start = 0; - bool first = true; - - while (true) - { - size_t len = 0; - const char* part = &orig[start]; - - const bool retval = next_wrap(pf.font_sel, &start, &len, part, maxwidth); - - if (!retval) - { - return result; - } - - if (first) - { - first = false; - } - else - { - result.push_back('\n'); - - if (lines != NULL) - { - (*lines)++; - } - } - result.append(part, len); - } -} - -std::string string_wordwrap_balanced(const uint32_t flags, const std::string& s, int maxwidth) -{ - /* Return a string wordwrapped to a limit of maxwidth by adding newlines. - * Try to fill the lines as far as possible, and return result where lines are most filled. - * Goal is to have all lines in textboxes be about as long and to avoid wrapping just one word to a new line. - * CJK will need to have autowordwrap disabled and have manually inserted newlines. */ - - if (!loc::get_langmeta()->autowordwrap) - { - return s; - } - - short lines; - string_wordwrap(flags, s, maxwidth, &lines); - - int bestwidth = maxwidth; - if (lines > 1) - { - for (int curlimit = maxwidth; curlimit > 1; curlimit -= 8) - { - short try_lines; - string_wordwrap(flags, s, curlimit, &try_lines); - - if (try_lines > lines) - { - bestwidth = curlimit + 8; - break; - } - } - } - - return string_wordwrap(flags, s, bestwidth); -} - -std::string string_unwordwrap(const std::string& s) -{ - /* Takes a string wordwrapped by newlines, and turns it into a single line, undoing the wrapping. - * Also trims any leading/trailing whitespace and collapses multiple spaces into one (to undo manual centering) - * Only applied to English, so langmeta.autowordwrap isn't used here (it'd break looking up strings) */ - - std::string result; - result.reserve(s.length()); - bool latest_was_space = true; // last character was a space (or the beginning, don't want leading whitespace) - int consecutive_newlines = 0; // number of newlines currently encountered in a row (multiple newlines should stay!) - - const char* str = s.c_str(); - uint32_t ch; - while ((ch = UTF8_next(&str))) - { - if (ch == '\n') - { - if (consecutive_newlines == 0) - { - ch = ' '; - } - else if (consecutive_newlines == 1) - { - if (!result.empty()) - { - // The last character was already a newline, so change it back from the space we thought it should have become. - result[result.size()-1] = '\n'; - } - else - { - // The string starts with two or more newlines, in this case we didn't add the first one at all. - result.append("\n\n"); - } - } - consecutive_newlines++; - } - else - { - consecutive_newlines = 0; - } - - if (ch != ' ' || !latest_was_space) - { - result.append(UTF8_encode(ch).bytes); - } - - latest_was_space = (ch == ' ' || ch == '\n'); - } - - // We could have one trailing space - if (!result.empty() && result[result.size()-1] == ' ') - { - result.erase(result.end()-1); - } - - return result; -} - -static int print_char( - const Font* f, - const uint32_t codepoint, - int x, - int y, - const int scale, - uint8_t r, - uint8_t g, - uint8_t b, - const uint8_t brightness -) -{ - /* Draws the glyph for a codepoint at x,y. - * Returns the amount of pixels to advance the cursor. */ - if (is_directional_character(codepoint) || is_joiner(codepoint)) - { - // Some characters should be completely invisible - return 0; - } - - const Font* f_glyph; - GlyphInfo* glyph = find_glyphinfo(f, codepoint, &f_glyph); - if (glyph == NULL) - { - return f->glyph_w * scale; - } - - if (glyph->flags & GLYPH_COLOR && (r | g | b) != 0) - { - r = g = b = brightness; - } - else if (brightness < 255) - { - float bri_factor = brightness / (float) 255; - r *= bri_factor; - g *= bri_factor; - b *= bri_factor; - } - - // If the glyph is a fallback glyph, center it - if (f_glyph != f) - { - x += (f->glyph_w - f_glyph->glyph_w) / 2; - y += (f->glyph_h - f_glyph->glyph_h) / 2; - } - - graphics.draw_grid_tile( - f_glyph->image, - glyph->image_idx, - x, - y, - f_glyph->glyph_w, - f_glyph->glyph_h, - r, g, b, - scale, - scale * (graphics.flipmode ? -1 : 1) - ); - - return get_advance_ff(f, f_glyph, glyph) * scale; -} - -const char* get_main_font_name(uint8_t idx) -{ - Font* f = container_get(&fonts_main, idx); - if (f == NULL) - { - return ""; - } - return f->name; -} - -const char* get_main_font_display_name(uint8_t idx) -{ - Font* f = container_get(&fonts_main, idx); - if (f == NULL) - { - return ""; - } - - if (idx == font_idx_8x8) - { - // Deciding the name for the 8x8 font was harder than I'd like to admit. - if (loc::lang == "en" || loc::get_langmeta()->font_idx != font_idx_8x8) - { - // If you use English, or a CJK language: "english/..." - SDL_strlcpy( - f->display_name, - "english/…", - sizeof(f->display_name) - ); - } - else - { - // If you use another, e.g. German: "english/deutsch/..." - SDL_snprintf( - f->display_name, sizeof(f->display_name), - "english/%s/…", - loc::get_langmeta()->nativename.c_str() - ); - } - } - - return f->display_name; -} - -const char* get_level_font_display_name(void) -{ - if (font_idx_level_is_custom) - { - Font* f = container_get(&fonts_custom, font_idx_level); - if (f == NULL) - { - return ""; - } - return f->display_name; - } - - return get_main_font_display_name(font_idx_level); -} - -bool glyph_dimensions(uint32_t flags, uint8_t* glyph_w, uint8_t* glyph_h) -{ - /* Gets the dimensions (glyph_w and glyph_h) of a certain font. - * Returns true if the font is valid (glyph_w and/or glyph_h were written to if not NULL), false if not. */ - - PrintFlags pf = decode_print_flags(flags); - - if (pf.font_sel == NULL) - { - return false; - } - if (glyph_w != NULL) - { - *glyph_w = pf.font_sel->glyph_w; - } - if (glyph_h != NULL) - { - *glyph_h = pf.font_sel->glyph_h; - } - return true; -} - -int len(const uint32_t flags, const char* text) -{ - PrintFlags pf = decode_print_flags(flags); - - if (bidi_should_transform(pf.rtl, text)) - { - text = bidi_transform(pf.rtl, text); - } - - int text_len = 0; - uint32_t codepoint; - while ((codepoint = UTF8_next(&text))) - { - if (!is_directional_character(codepoint) && !is_joiner(codepoint)) - { - text_len += get_advance(pf.font_sel, codepoint); - } - } - return text_len * pf.scale; -} - -int height(const uint32_t flags) -{ - PrintFlags pf = decode_print_flags(flags); - if (pf.font_sel == NULL) - { - return 8; - } - - return pf.font_sel->glyph_h * pf.scale; -} - -bool is_rtl(const uint32_t flags) -{ - PrintFlags pf = decode_print_flags(flags); - return pf.rtl; -} - -void print( - const uint32_t flags, - int x, - int y, - const char* text, - const uint8_t r, - const uint8_t g, - const uint8_t b -) -{ - PrintFlags pf = decode_print_flags(flags); - if (pf.font_sel == NULL) - { - return; - } - - if (pf.rtl && pf.rtl_xflip && (!pf.align_cen || x != -1)) - { - x = SCREEN_WIDTH_PIXELS - x; - pf.align_right = !pf.align_right; - } - - if (pf.align_cen || pf.align_right) - { - const int textlen = len(flags, text); - - if (pf.align_cen) - { - if (x == -1) - { - x = SCREEN_WIDTH_PIXELS / 2; - } - x -= textlen/2; - - if (!pf.rtl) - { - x = SDL_max(x, 0); - } - else - { - x = SDL_min(x, SCREEN_WIDTH_PIXELS - textlen); - } - } - else - { - x -= textlen; - } - } - - if (pf.border && !graphics.notextoutline) - { - static const int offsets[4][2] = {{0,-1}, {-1,0}, {1,0}, {0,1}}; - - for (int offset = 0; offset < 4; offset++) - { - print( - flags & ~PR_BOR & ~PR_CEN & ~PR_RIGHT & ~PR_RTL_XFLIP, - x + offsets[offset][0]*pf.scale, - y + offsets[offset][1]*pf.scale, - text, - 0, 0, 0 - ); - } - } - - if (pf.full_border) - { - static const int offsets[8][2] = { {0,-1}, {-1,0}, {1,0}, {0,1}, {-1,-1}, {1,1}, {-1,1}, {1,-1} }; - - for (int offset = 0; offset < 8; offset++) - { - print( - flags & ~PR_FULLBOR & ~PR_CEN & ~PR_RIGHT & ~PR_RTL_XFLIP, - x + offsets[offset][0] * pf.scale, - y + offsets[offset][1] * pf.scale, - text, - 0, 0, 0 - ); - } - } - - int h_diff_8 = (pf.font_sel->glyph_h-8)*pf.scale; - if (h_diff_8 < 0) - { - /* If the font is less high than 8, - * just center it (lower on screen) */ - y -= h_diff_8/2; - } - else if (pf.cjk_high) - { - y -= h_diff_8; - } - else if (!pf.cjk_low) - { - y -= h_diff_8/2; - } - - if (bidi_should_transform(pf.rtl, text)) - { - text = bidi_transform(pf.rtl, text); - } - - int position = 0; - uint32_t codepoint; - while ((codepoint = UTF8_next(&text))) - { - position += font::print_char( - pf.font_sel, - codepoint, - x + position, - y, - pf.scale, - r, - g, - b, - pf.brightness - ); - } -} - -void print( - const uint32_t flags, - int x, - int y, - const std::string& text, - const uint8_t r, - const uint8_t g, - const uint8_t b -) -{ - // Just a std::string overload for now because it's more .c_str() to add than I'm comfortable with... - print(flags, x, y, text.c_str(), r, g, b); -} - -int print_wrap( - uint32_t flags, - const int x, - int y, - const char* text, - const uint8_t r, - const uint8_t g, - const uint8_t b, - int linespacing /*= -1*/, - int maxwidth /*= -1*/ -) -{ - PrintFlags pf = decode_print_flags(flags); - if (pf.font_sel == NULL) - { - return y; - } - - if (linespacing == -1) - { - linespacing = 10; - } - linespacing = SDL_max(linespacing, pf.font_sel->glyph_h * pf.scale); - - if (maxwidth == -1) - { - maxwidth = 304; - } - - if (pf.border && !graphics.notextoutline && (r|g|b) != 0) - { - print_wrap(flags, x, y, text, 0, 0, 0, linespacing, maxwidth); - flags &= ~PR_BOR; - } - - if (pf.full_border && (r | g | b) != 0) - { - print_wrap(flags, x, y, text, 0, 0, 0, linespacing, maxwidth); - flags &= ~PR_FULLBOR; - } - - // This could fit 64 non-BMP characters onscreen, should be plenty - char buffer[256]; - size_t start = 0; - - if (graphics.flipmode) - { - // Correct for the height of the resulting print. - size_t len = 0; - while (next_wrap(pf.font_sel, &start, &len, &text[start], maxwidth)) - { - y += linespacing; - } - y -= linespacing; - start = 0; - } - - while (next_wrap_buf(pf.font_sel, buffer, sizeof(buffer), &start, text, maxwidth)) - { - print(flags, x, y, buffer, r, g, b); - - if (graphics.flipmode) - { - y -= linespacing; - } - else - { - y += linespacing; - } - } - - return y + linespacing; -} - -} // namespace font diff --git a/desktop_version/src/Font.h b/desktop_version/src/Font.h deleted file mode 100644 index 74de6d2d..00000000 --- a/desktop_version/src/Font.h +++ /dev/null @@ -1,126 +0,0 @@ -/* - * == SOME TEXT PRINTING EXAMPLES == - * - * Standard print - * font::print(0, 50, 50, "Hello world!", 255, 255, 255); - * - * Centered text - * font::print(PR_CEN, -1, 50, "Hello world!", 255, 255, 255); - * (set X to -1, unless you want to center *around* X) - * - * 2x scale - * font::print(PR_2X, 50, 50, "V", 255, 255, 255); - * - * Centered 2x scale - * font::print(PR_CEN | PR_2X, -1, 50, "V", 255, 255, 255); - * - * Right-aligned 3x scale with a border around it - * font::print(PR_RIGHT | PR_3X | PR_BOR, 320, 50, "V", 255, 255, 255); - * - * Wordwrapped centered text - * font::print_wrap(PR_CEN, -1, 50, "Hello world, this will wordwrap to the screen width", 255, 255, 255); - * - */ - - -#ifndef FONT_H -#define FONT_H - -#include -#include -#include - - -#define PR_1X (0 << 0) /* default, 1x scale */ -#define PR_2X (1 << 0) /* 2x scale */ -#define PR_3X (2 << 0) /* etc */ -#define PR_4X (3 << 0) -#define PR_5X (4 << 0) -#define PR_6X (5 << 0) -#define PR_7X (6 << 0) -#define PR_8X (7 << 0) -#define PR_FONT_INTERFACE (0 << 3) /* default, use interface font */ -#define PR_FONT_LEVEL (1 << 3) /* use level-specific font (room names, cutscene dialogue, etc) */ -#define PR_FONT_8X8 (2 << 3) /* use 8x8 font no matter what */ -#define PR_FONT_IDX(idx, rtl) /* use given font index */\ - (((SDL_clamp(idx, 0, 28) + 3) << 3) | (rtl ? PR_RTL_FORCE : 0)) -#define PR_BRIGHTNESS(value) /* use this brightness 0-255 for the text (accounts for button glyphs correctly) */\ - (((~SDL_clamp((int)(value), 0, 255) & 0xff) << 8)) -#define PR_FULLBOR (1 << 16) /* draw a black border around the text, filling in the corners (for the map legend) */ -#define PR_BOR (1 << 17) /* draw a black border around the text (was bprint/bigbprint) */ -#define PR_LEFT (0 << 18) /* default, left-align text/place at x coordinate */ -#define PR_CEN (1 << 18) /* center-align text relative to X (X is center) or to screen if X == -1 */ -#define PR_RIGHT (2 << 18) /* right-align text to X (X is now the right border, not left border) */ -#define PR_CJK_CEN (0 << 20) /* default, larger fonts should stick out on top and bottom compared to 8x8 font */ -#define PR_CJK_LOW (1 << 20) /* larger fonts should stick out fully on the bottom (draw at Y) */ -#define PR_CJK_HIGH (2 << 20) /* larger fonts should stick out fully on the top */ -#define PR_RTL_FORCE (1 << 22) /* force the RTL flag, not needed if the font is set to INTERFACE or LEVEL */ -#define PR_RTL_XFLIP (1 << 23) /* in RTL languages, mirror the X axis, so left is 320 and right is 0, and invert the meaning of PR_LEFT and PR_RIGHT */ -#define PR_FONT_IDX_IS_CUSTOM (1 << 24) /* with PR_FONT_IDX, mark that the font index is of a custom font */ - - -namespace font -{ -// Options in font selection menu -extern uint8_t font_idx_options_n; -extern uint8_t font_idx_options[20]; - -extern uint8_t font_idx_level; -extern bool font_idx_level_is_custom; - -bool find_main_font_by_name(const char* name, uint8_t* idx); -const char* get_main_font_name(uint8_t idx); -const char* get_main_font_display_name(uint8_t idx); -const char* get_level_font_display_name(void); -uint8_t get_font_idx_8x8(void); -bool level_font_is_main_idx(uint8_t idx); - -void set_level_font(const char* name); -void set_level_font_interface(void); -void set_level_font_new(void); -void load_main(void); -void load_custom(const char* name); -void unload_custom(void); -void destroy(void); - -std::string string_wordwrap(uint32_t flags, const std::string& s, int maxwidth, short *lines = NULL); -std::string string_wordwrap_balanced(uint32_t flags, const std::string& s, int maxwidth); -std::string string_unwordwrap(const std::string& s); - -bool glyph_dimensions(uint32_t flags, uint8_t* glyph_w, uint8_t* glyph_h); - -int len(uint32_t flags, const char* text); -int height(uint32_t flags); -bool is_rtl(uint32_t flags); - -void print( - uint32_t flags, - int x, - int y, - const char* text, - uint8_t r, uint8_t g, uint8_t b -); - -// std::string overload for only font::print (use .c_str() for the others) -void print( - uint32_t flags, - int x, - int y, - const std::string& text, - uint8_t r, uint8_t g, uint8_t b -); - -int print_wrap( - uint32_t flags, - int x, - int y, - const char* text, - uint8_t r, uint8_t g, uint8_t b, - int linespacing = -1, - int maxwidth = -1 -); - -} // namespace font - - -#endif // FONT_H diff --git a/desktop_version/src/FontBidi.cpp b/desktop_version/src/FontBidi.cpp deleted file mode 100644 index 6f09b3fe..00000000 --- a/desktop_version/src/FontBidi.cpp +++ /dev/null @@ -1,552 +0,0 @@ -#include "FontBidi.h" - -#include -#include - -#include "Alloc.h" -#include "UTF8.h" - -extern "C" -{ -#include -} - -namespace font -{ - -struct ArabicLetter -{ - uint32_t letter; - - uint32_t isolated; - uint32_t initial; - uint32_t medial; - uint32_t final; -}; - -// Arabic reshaping lookup table from https://github.com/TerryCavanagh/hx_arabic_shaper -static ArabicLetter arabic_letters[] = { - // ARABIC LETTER HAMZA - {0x0621, 0xFE80, 0, 0, 0}, - // ARABIC LETTER ALEF WITH MADDA ABOVE - {0x0622, 0xFE81, 0, 0, 0xFE82}, - // ARABIC LETTER ALEF WITH HAMZA ABOVE - {0x0623, 0xFE83, 0, 0, 0xFE84}, - // ARABIC LETTER WAW WITH HAMZA ABOVE - {0x0624, 0xFE85, 0, 0, 0xFE86}, - // ARABIC LETTER ALEF WITH HAMZA BELOW - {0x0625, 0xFE87, 0, 0, 0xFE88}, - // ARABIC LETTER YEH WITH HAMZA ABOVE - {0x0626, 0xFE89, 0xFE8B, 0xFE8C, 0xFE8A}, - // ARABIC LETTER ALEF - {0x0627, 0xFE8D, 0, 0, 0xFE8E}, - // ARABIC LETTER BEH - {0x0628, 0xFE8F, 0xFE91, 0xFE92, 0xFE90}, - // ARABIC LETTER TEH MARBUTA - {0x0629, 0xFE93, 0, 0, 0xFE94}, - // ARABIC LETTER TEH - {0x062A, 0xFE95, 0xFE97, 0xFE98, 0xFE96}, - // ARABIC LETTER THEH - {0x062B, 0xFE99, 0xFE9B, 0xFE9C, 0xFE9A}, - // ARABIC LETTER JEEM - {0x062C, 0xFE9D, 0xFE9F, 0xFEA0, 0xFE9E}, - // ARABIC LETTER HAH - {0x062D, 0xFEA1, 0xFEA3, 0xFEA4, 0xFEA2}, - // ARABIC LETTER KHAH - {0x062E, 0xFEA5, 0xFEA7, 0xFEA8, 0xFEA6}, - // ARABIC LETTER DAL - {0x062F, 0xFEA9, 0, 0, 0xFEAA}, - // ARABIC LETTER THAL - {0x0630, 0xFEAB, 0, 0, 0xFEAC}, - // ARABIC LETTER REH - {0x0631, 0xFEAD, 0, 0, 0xFEAE}, - // ARABIC LETTER ZAIN - {0x0632, 0xFEAF, 0, 0, 0xFEB0}, - // ARABIC LETTER SEEN - {0x0633, 0xFEB1, 0xFEB3, 0xFEB4, 0xFEB2}, - // ARABIC LETTER SHEEN - {0x0634, 0xFEB5, 0xFEB7, 0xFEB8, 0xFEB6}, - // ARABIC LETTER SAD - {0x0635, 0xFEB9, 0xFEBB, 0xFEBC, 0xFEBA}, - // ARABIC LETTER DAD - {0x0636, 0xFEBD, 0xFEBF, 0xFEC0, 0xFEBE}, - // ARABIC LETTER TAH - {0x0637, 0xFEC1, 0xFEC3, 0xFEC4, 0xFEC2}, - // ARABIC LETTER ZAH - {0x0638, 0xFEC5, 0xFEC7, 0xFEC8, 0xFEC6}, - // ARABIC LETTER AIN - {0x0639, 0xFEC9, 0xFECB, 0xFECC, 0xFECA}, - // ARABIC LETTER GHAIN - {0x063A, 0xFECD, 0xFECF, 0xFED0, 0xFECE}, - // ARABIC TATWEEL - {0x0640, 0x0640, 0x0640, 0x0640, 0x0640}, - // ARABIC LETTER FEH - {0x0641, 0xFED1, 0xFED3, 0xFED4, 0xFED2}, - // ARABIC LETTER QAF - {0x0642, 0xFED5, 0xFED7, 0xFED8, 0xFED6}, - // ARABIC LETTER KAF - {0x0643, 0xFED9, 0xFEDB, 0xFEDC, 0xFEDA}, - // ARABIC LETTER LAM - {0x0644, 0xFEDD, 0xFEDF, 0xFEE0, 0xFEDE}, - // ARABIC LETTER MEEM - {0x0645, 0xFEE1, 0xFEE3, 0xFEE4, 0xFEE2}, - // ARABIC LETTER NOON - {0x0646, 0xFEE5, 0xFEE7, 0xFEE8, 0xFEE6}, - // ARABIC LETTER HEH - {0x0647, 0xFEE9, 0xFEEB, 0xFEEC, 0xFEEA}, - // ARABIC LETTER WAW - {0x0648, 0xFEED, 0, 0, 0xFEEE}, - // ARABIC LETTER [UIGHUR KAZAKH KIRGHIZ]? ALEF MAKSURA - {0x0649, 0xFEEF, 0xFBE8, 0xFBE9, 0xFEF0}, - // ARABIC LETTER YEH - {0x064A, 0xFEF1, 0xFEF3, 0xFEF4, 0xFEF2}, - // ARABIC LETTER ALEF WASLA - {0x0671, 0xFB50, 0, 0, 0xFB51}, - // ARABIC LETTER U WITH HAMZA ABOVE - {0x0677, 0xFBDD, 0, 0, 0}, - // ARABIC LETTER TTEH - {0x0679, 0xFB66, 0xFB68, 0xFB69, 0xFB67}, - // ARABIC LETTER TTEHEH - {0x067A, 0xFB5E, 0xFB60, 0xFB61, 0xFB5F}, - // ARABIC LETTER BEEH - {0x067B, 0xFB52, 0xFB54, 0xFB55, 0xFB53}, - // ARABIC LETTER PEH - {0x067E, 0xFB56, 0xFB58, 0xFB59, 0xFB57}, - // ARABIC LETTER TEHEH - {0x067F, 0xFB62, 0xFB64, 0xFB65, 0xFB63}, - // ARABIC LETTER BEHEH - {0x0680, 0xFB5A, 0xFB5C, 0xFB5D, 0xFB5B}, - // ARABIC LETTER NYEH - {0x0683, 0xFB76, 0xFB78, 0xFB79, 0xFB77}, - // ARABIC LETTER DYEH - {0x0684, 0xFB72, 0xFB74, 0xFB75, 0xFB73}, - // ARABIC LETTER TCHEH - {0x0686, 0xFB7A, 0xFB7C, 0xFB7D, 0xFB7B}, - // ARABIC LETTER TCHEHEH - {0x0687, 0xFB7E, 0xFB80, 0xFB81, 0xFB7F}, - // ARABIC LETTER DDAL - {0x0688, 0xFB88, 0, 0, 0xFB89}, - // ARABIC LETTER DAHAL - {0x068C, 0xFB84, 0, 0, 0xFB85}, - // ARABIC LETTER DDAHAL - {0x068D, 0xFB82, 0, 0, 0xFB83}, - // ARABIC LETTER DUL - {0x068E, 0xFB86, 0, 0, 0xFB87}, - // ARABIC LETTER RREH - {0x0691, 0xFB8C, 0, 0, 0xFB8D}, - // ARABIC LETTER JEH - {0x0698, 0xFB8A, 0, 0, 0xFB8B}, - // ARABIC LETTER VEH - {0x06A4, 0xFB6A, 0xFB6C, 0xFB6D, 0xFB6B}, - // ARABIC LETTER PEHEH - {0x06A6, 0xFB6E, 0xFB70, 0xFB71, 0xFB6F}, - // ARABIC LETTER KEHEH - {0x06A9, 0xFB8E, 0xFB90, 0xFB91, 0xFB8F}, - // ARABIC LETTER NG - {0x06AD, 0xFBD3, 0xFBD5, 0xFBD6, 0xFBD4}, - // ARABIC LETTER GAF - {0x06AF, 0xFB92, 0xFB94, 0xFB95, 0xFB93}, - // ARABIC LETTER NGOEH - {0x06B1, 0xFB9A, 0xFB9C, 0xFB9D, 0xFB9B}, - // ARABIC LETTER GUEH - {0x06B3, 0xFB96, 0xFB98, 0xFB99, 0xFB97}, - // ARABIC LETTER NOON GHUNNA - {0x06BA, 0xFB9E, 0, 0, 0xFB9F}, - // ARABIC LETTER RNOON - {0x06BB, 0xFBA0, 0xFBA2, 0xFBA3, 0xFBA1}, - // ARABIC LETTER HEH DOACHASHMEE - {0x06BE, 0xFBAA, 0xFBAC, 0xFBAD, 0xFBAB}, - // ARABIC LETTER HEH WITH YEH ABOVE - {0x06C0, 0xFBA4, 0, 0, 0xFBA5}, - // ARABIC LETTER HEH GOAL - {0x06C1, 0xFBA6, 0xFBA8, 0xFBA9, 0xFBA7}, - // ARABIC LETTER KIRGHIZ OE - {0x06C5, 0xFBE0, 0, 0, 0xFBE1}, - // ARABIC LETTER OE - {0x06C6, 0xFBD9, 0, 0, 0xFBDA}, - // ARABIC LETTER U - {0x06C7, 0xFBD7, 0, 0, 0xFBD8}, - // ARABIC LETTER YU - {0x06C8, 0xFBDB, 0, 0, 0xFBDC}, - // ARABIC LETTER KIRGHIZ YU - {0x06C9, 0xFBE2, 0, 0, 0xFBE3}, - // ARABIC LETTER VE - {0x06CB, 0xFBDE, 0, 0, 0xFBDF}, - // ARABIC LETTER FARSI YEH - {0x06CC, 0xFBFC, 0xFBFE, 0xFBFF, 0xFBFD}, - // ARABIC LETTER E - {0x06D0, 0xFBE4, 0xFBE6, 0xFBE7, 0xFBE5}, - // ARABIC LETTER YEH BARREE - {0x06D2, 0xFBAE, 0, 0, 0xFBAF}, - // ARABIC LETTER YEH BARREE WITH HAMZA ABOVE - {0x06D3, 0xFBB0, 0, 0, 0xFBB1}, - - // ZWJ - {0x200D, 0x200D, 0x200D, 0x200D, 0x200D}, -}; - -// Our ligatures are all simple A+B -> C conversions -struct ArabicLigature -{ - uint32_t source[2]; - uint32_t target; - bool mandatory; -}; - -static ArabicLigature arabic_ligatures[] = { - {{0xFEDF, 0xFE8E}, 0xFEFB, true}, - {{0xFEDF, 0xFE82}, 0xFEF5, true}, - {{0xFEDF, 0xFE84}, 0xFEF7, true}, - {{0xFEDF, 0xFE88}, 0xFEF9, true}, - {{0xFEE0, 0xFE8E}, 0xFEFC, true}, - {{0xFEE0, 0xFE82}, 0xFEF6, true}, - {{0xFEE0, 0xFE84}, 0xFEF8, true}, - {{0xFEE0, 0xFE88}, 0xFEFA, true}, - {{0xFE8D, 0xFEDF}, 0xFBF0, false}, - {{0xFE8E, 0xFEDF}, 0xFBF0, false}, - {{0xFEDF, 0xFEDF}, 0xFBF1, false}, - {{0xFEE0, 0xFEDF}, 0xFBF1, false}, - {{0xFE8B, 0xFE8E}, 0xFBF2, false}, - {{0xFE8C, 0xFE8E}, 0xFBF2, false}, - {{0xFEE7, 0xFE8E}, 0xFBF3, false}, - {{0xFEE8, 0xFE8E}, 0xFBF3, false}, - {{0xFE91, 0xFE8E}, 0xFBF4, false}, - {{0xFE92, 0xFE8E}, 0xFBF4, false}, - {{0xFEF3, 0xFE8E}, 0xFBF5, false}, - {{0xFEF4, 0xFE8E}, 0xFBF5, false}, - {{0xFEAD, 0xFE8D}, 0xFBF6, false}, - {{0xFEAE, 0xFE8D}, 0xFBF6, false}, - {{0xFEAF, 0xFE8D}, 0xFBF7, false}, - {{0xFEB0, 0xFE8D}, 0xFBF7, false}, - {{0xFEAD, 0xFEDF}, 0xFBF8, false}, - {{0xFEAE, 0xFEDF}, 0xFBF8, false}, - {{0xFEAF, 0xFEDF}, 0xFBF9, false}, - {{0xFEB0, 0xFEDF}, 0xFBF9, false}, - {{0xFEDF, 0xFEE0}, 0xFBF1, false}, - {{0xFEE0, 0xFEE0}, 0xFBF1, false}, -}; - -static hashmap* arabic_letters_map; -static hashmap* arabic_ligatures_map; - -void bidi_init(void) -{ - arabic_letters_map = hashmap_create(); - - for (size_t i = 0; i < sizeof(arabic_letters)/sizeof(ArabicLetter); i++) - { - hashmap_set( - arabic_letters_map, - &arabic_letters[i].letter, - sizeof(uint32_t), - (uintptr_t) &arabic_letters[i] - ); - } - - arabic_ligatures_map = hashmap_create(); - - for (size_t i = 0; i < sizeof(arabic_ligatures)/sizeof(ArabicLigature); i++) - { - hashmap_set( - arabic_ligatures_map, - &arabic_ligatures[i].source, - sizeof(uint32_t) * 2, - (uintptr_t) &arabic_ligatures[i] - ); - } -} - -void bidi_destroy(void) -{ - VVV_freefunc(hashmap_free, arabic_ligatures_map); - VVV_freefunc(hashmap_free, arabic_letters_map); -} - - -bool is_directional_character(const uint32_t codepoint) -{ - // LEFT-TO-RIGHT MARK and RIGHT-TO-LEFT MARK - if (codepoint == 0x200E || codepoint == 0x200F) return true; - - // Some other directional formatting: LRE, RLE, PDF, RLO, LRO - if (codepoint >= 0x202A && codepoint <= 0x202E) return true; - - // The more recent isolates: LRI, RLI, FSI, PDI - if (codepoint >= 0x2066 && codepoint <= 0x2069) return true; - - return false; -} - -bool is_joiner(const uint32_t codepoint) -{ - return codepoint == 0x200C || codepoint == 0x200D; -} - -bool bidi_should_transform(const bool rtl, const char* text) -{ - /* Just as an optimization, only run the whole bidi machinery if the - * language is actually an RTL one, _or_ if an RTL character is found. */ - - if (rtl) - { - return true; - } - - const char* text_ptr = text; - uint32_t ch; - while ((ch = UTF8_next(&text_ptr))) - { - // The standard Hebrew and Arabic blocks - if (ch >= 0x590 && ch <= 0x77F) return true; - - // Extended Arabic B and A - if (ch >= 0x870 && ch <= 0x8FF) return true; - - // Any directional control character - if (is_directional_character(ch)) return true; - - // Hebrew presentation forms - if (ch >= 0xFB1D && ch <= 0xFB4F) return true; - - // Arabic presentation forms A - if (ch >= 0xFB50 && ch <= 0xFDFF) return true; - - // Arabic presentation forms B - if (ch >= 0xFE70 && ch <= 0xFEFE) return true; - } - - return false; -} - -const char* bidi_transform(const bool rtl, const char* text) -{ - uint32_t utf32_in[1024]; - int n_codepoints = 0; - - const char* text_ptr = text; - uint32_t codepoint; - while ((codepoint = UTF8_next(&text_ptr))) - { - if (codepoint == '\r' || codepoint == '\n') - { - // Don't treat newlines in font::print differently in bidi - codepoint = ' '; - } - - utf32_in[n_codepoints++] = codepoint; - - if (n_codepoints >= 1023) - { - break; - } - } - utf32_in[n_codepoints] = 0; - - if (n_codepoints == 0) - { - return text; - } - - static char utf8_out[1024]; - size_t utf8_out_cur = 0; - - SBCodepointSequence codepoint_sequence = {SBStringEncodingUTF32, (void*) utf32_in, (SBUInteger) n_codepoints}; - - SBAlgorithmRef algorithm = SBAlgorithmCreate(&codepoint_sequence); - if (algorithm == NULL) - { - return text; - } - SBParagraphRef paragraph = SBAlgorithmCreateParagraph( - algorithm, - 0, - INT32_MAX, - rtl ? SBLevelDefaultRTL : SBLevelDefaultLTR - ); - SDL_assert(paragraph != NULL); - SBUInteger paragraph_len = SBParagraphGetLength(paragraph); - SBLineRef paragraph_line = SBParagraphCreateLine(paragraph, 0, paragraph_len); - SDL_assert(paragraph_line != NULL); - - // Make sure )brackets( are mirrored correctly... - SBMirrorLocatorRef mirror_locator = SBMirrorLocatorCreate(); - if (mirror_locator != NULL) - { - SBMirrorLocatorLoadLine(mirror_locator, paragraph_line, (void*) utf32_in); - const SBMirrorAgent *mirror_agent = SBMirrorLocatorGetAgent(mirror_locator); - while (SBMirrorLocatorMoveNext(mirror_locator)) - { - utf32_in[mirror_agent->index] = mirror_agent->mirror; - } - VVV_freefunc(SBMirrorLocatorRelease, mirror_locator); - } - - SBUInteger n_runs = SBLineGetRunCount(paragraph_line); - const SBRun *runs = SBLineGetRunsPtr(paragraph_line); - - for (SBUInteger i = 0; i < n_runs; i++) - { - bool is_ltr = runs[i].level % 2 == 0; - if (!is_ltr) - { - // Time for reshaping! - enum arabic_form { NONE, ISOLATED, INITIAL, MEDIAL, FINAL }; - arabic_form forms[1024]; - uint32_t replacements[1024]; - - const ArabicLetter* letter; - const ArabicLetter* previous_letter = NULL; - arabic_form previous_form = NONE; - for (size_t c = 0; c < runs[i].length; c++) - { - uintptr_t letter_ptr; - bool found = hashmap_get(arabic_letters_map, &utf32_in[runs[i].offset + c], sizeof(uint32_t), &letter_ptr); - if (!found) - { - forms[c] = NONE; - replacements[c] = 0; - previous_form = NONE; - previous_letter = NULL; - continue; - } - letter = (const ArabicLetter*) letter_ptr; - - if (previous_form == NONE) - { - // Maybe the first letter, or the one after an unknown one - forms[c] = ISOLATED; - replacements[c] = letter->isolated; - } - else if (letter->final == 0 && letter->medial == 0) - { - // letter doesn't connect with the one before - forms[c] = ISOLATED; - replacements[c] = letter->isolated; - } - else if (previous_letter->initial == 0 && previous_letter->medial == 0) - { - // previous_letter doesn't connect with the one after - forms[c] = ISOLATED; - replacements[c] = letter->isolated; - } - else if (previous_form == FINAL && previous_letter->medial == 0) - { - // previous_letter doesn't connect with the ones before and after - forms[c] = ISOLATED; - replacements[c] = letter->isolated; - } - else if (previous_form == ISOLATED) - { - forms[c-1] = INITIAL; - forms[c] = FINAL; - replacements[c-1] = previous_letter->initial; - replacements[c] = letter->final; - } - else - { - /* Otherwise, we will change the previous letter - * to connect to the current letter */ - forms[c-1] = MEDIAL; - forms[c] = FINAL; - replacements[c-1] = previous_letter->medial; - replacements[c] = letter->final; - } - - previous_form = forms[c]; - previous_letter = (const ArabicLetter*) letter; - } - - // Now that we have all the forms, time to change the codepoints! - for (size_t c = 0; c < runs[i].length; c++) - { - if (replacements[c] != 0) - { - utf32_in[runs[i].offset + c] = replacements[c]; - } - } - - /* Ligature time! We have to do these after the reshaping process, that is, now! - * Again, all our ligatures are just A+B -> C, so we can just do a single pass, - * up until the second-to-last character (because the last character can't form - * a ligature with the character after). - * Actually, did I say single pass... The mandatory ligatures must be prioritized - * over the optional ones... */ - for (char pass = 0; pass < 2; pass++) - { - for (size_t c = 0; c < runs[i].length - 1; c++) - { - if (pass == 1 && utf32_in[runs[i].offset + c + 1] == 0xFFFFFFFF) - { - c++; - continue; - } - - uintptr_t ligature_ptr; - bool found = hashmap_get(arabic_ligatures_map, &utf32_in[runs[i].offset + c], sizeof(uint32_t)*2, &ligature_ptr); - if (!found) - { - continue; - } - - const ArabicLigature* ligature = (const ArabicLigature*) ligature_ptr; - if (pass == 0 && !ligature->mandatory) - { - continue; - } - - /* We have a match, that means [c]+[c+1] needs to be replaced! - * We'll use 0xFFFFFFFF as a special tombstone character, - * otherwise we'd have to keep shifting the array contents... */ - utf32_in[runs[i].offset + c] = ligature->target; - utf32_in[runs[i].offset + c + 1] = 0xFFFFFFFF; - - // Don't bother comparing the tombstone with the next letter - c++; - } - } - } - for (size_t c = 0; c < runs[i].length; c++) - { - size_t ix; - if (is_ltr) - { - ix = runs[i].offset + c; - } - else - { - ix = runs[i].offset + runs[i].length - 1 - c; - } - - if (utf32_in[ix] == 0xFFFFFFFF) - { - continue; - } - - int out_room_left = sizeof(utf8_out) - 1 - utf8_out_cur; - if (out_room_left <= 0) - { - goto no_more_runs; - } - - UTF8_encoding enc = UTF8_encode(utf32_in[ix]); - size_t n_copy = SDL_min(enc.nbytes, (size_t) out_room_left); - SDL_memcpy( - &utf8_out[utf8_out_cur], - enc.bytes, - n_copy - ); - - utf8_out_cur += n_copy; - } - } - no_more_runs: - utf8_out[utf8_out_cur] = '\0'; - - VVV_freefunc(SBLineRelease, paragraph_line); - VVV_freefunc(SBParagraphRelease, paragraph); - VVV_freefunc(SBAlgorithmRelease, algorithm); - - return utf8_out; -} - -} // namespace font diff --git a/desktop_version/src/FontBidi.h b/desktop_version/src/FontBidi.h deleted file mode 100644 index bad7ed09..00000000 --- a/desktop_version/src/FontBidi.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef FONTBIDI_H -#define FONTBIDI_H - -#include - -namespace font -{ - -void bidi_init(void); -void bidi_destroy(void); -bool is_directional_character(uint32_t codepoint); -bool is_joiner(uint32_t codepoint); -bool bidi_should_transform(bool rtl, const char* text); -const char* bidi_transform(bool rtl, const char* text); - -} // namespace font - -#endif // FONTBIDI_H diff --git a/desktop_version/src/GOGNetwork.c b/desktop_version/src/GOGNetwork.c index 10846d16..54a4b927 100644 --- a/desktop_version/src/GOGNetwork.c +++ b/desktop_version/src/GOGNetwork.c @@ -8,7 +8,7 @@ int32_t GOG_init(void) { - return 0; + return 0; } void GOG_shutdown(void) @@ -23,4 +23,13 @@ void GOG_unlockAchievement(const char *name) { } +int32_t GOG_getAchievementProgress(const char *name) +{ + return 0; +} + +void GOG_setAchievementProgress(const char *name, int32_t stat) +{ +} + #endif /* MAKEANDPLAY */ diff --git a/desktop_version/src/Game.cpp b/desktop_version/src/Game.cpp index d41d63c9..475ccce7 100644 --- a/desktop_version/src/Game.cpp +++ b/desktop_version/src/Game.cpp @@ -2,36 +2,25 @@ #include "Game.h" #include +#include #include #include #include -#include "ButtonGlyphs.h" -#include "Constants.h" -#include "CustomLevels.h" #include "DeferCallbacks.h" -#include "Editor.h" +#include "editor.h" #include "Entity.h" #include "Enums.h" #include "FileSystemUtils.h" #include "GlitchrunnerMode.h" #include "Graphics.h" -#include "LevelDebugger.h" -#include "Localization.h" -#include "LocalizationStorage.h" #include "KeyPoll.h" #include "MakeAndPlay.h" #include "Map.h" #include "Music.h" #include "Network.h" -#include "RoomnameTranslator.h" -#include "Screen.h" #include "Script.h" -#include "Unused.h" -#include "UTF8.h" #include "UtilityClass.h" -#include "VFormat.h" -#include "Vlogging.h" #include "XMLUtils.h" static bool GetButtonFromString(const char *pText, SDL_GameControllerButton *button) @@ -109,44 +98,15 @@ static bool GetButtonFromString(const char *pText, SDL_GameControllerButton *but return false; } -// Unfortunate forward-declare... My hands are pretty tied -static void loadthissummary( - const char* filename, - struct Game::Summary* summary, - tinyxml2::XMLDocument& doc -); - -static struct Game::Summary get_summary( - const char* filename, - const char* savename, - tinyxml2::XMLDocument& doc -) { - tinyxml2::XMLHandle hDoc(&doc); - struct Game::Summary summary; - SDL_zero(summary); - - if (!FILESYSTEM_loadTiXml2Document(filename, doc)) - { - vlog_info("%s not found", savename); - return summary; - } - - loadthissummary(savename, &summary, doc); - - return summary; -} void Game::init(void) { - SDL_strlcpy(magic, "[vVvVvV]game", sizeof(magic)); - roomx = 0; roomy = 0; prevroomx = 0; prevroomy = 0; saverx = 0; savery = 0; - savecolour = EntityColour_CREW_CYAN; mutebutton = 0; muted = false; @@ -164,6 +124,7 @@ void Game::init(void) teleport = false; edteleportent = 0; //Added in the port! companion = 0; + roomchange = false; quickrestartkludge = false; @@ -207,7 +168,6 @@ void Game::init(void) activity_r = 0; activity_g = 0; activity_b = 0; - activity_y = 0; creditposition = 0; oldcreditposition = 0; bestgamedeaths = -1; @@ -221,16 +181,13 @@ void Game::init(void) nocutscenes = false; ndmresultcrewrescued = 0; ndmresulttrinkets = 0; - ndmresulthardestroom.clear(); - ndmresulthardestroom_x = hardestroom_x; - ndmresulthardestroom_y = hardestroom_y; - ndmresulthardestroom_specialname = false; - nodeatheligible = false; customcol=0; SDL_memset(crewstats, false, sizeof(crewstats)); SDL_memset(ndmresultcrewstats, false, sizeof(ndmresultcrewstats)); + SDL_memset(tele_crewstats, false, sizeof(tele_crewstats)); + SDL_memset(quick_crewstats, false, sizeof(quick_crewstats)); SDL_memset(besttimes, -1, sizeof(besttimes)); SDL_memset(bestframes, -1, sizeof(bestframes)); SDL_memset(besttrinkets, -1, sizeof(besttrinkets)); @@ -240,71 +197,58 @@ void Game::init(void) crewstats[0] = true; lastsaved = 0; + tele_gametime = "00:00"; + tele_trinkets = 0; + tele_currentarea = "Error! Error!"; + quick_gametime = "00:00"; + quick_trinkets = 0; + quick_currentarea = "Error! Error!"; + //Menu stuff initiliased here: SDL_memset(unlock, false, sizeof(unlock)); SDL_memset(unlocknotify, false, sizeof(unlock)); currentmenuoption = 0; - menutestmode = false; current_credits_list_index = 0; - translator_credits_pagenum = 0; menuxoff = 0; menuyoff = 0; menucountdown = 0; levelpage=0; playcustomlevel=0; - - gpmenu_lastbutton = SDL_CONTROLLER_BUTTON_INVALID; - gpmenu_confirming = false; - gpmenu_showremove = false; + createmenu(Menu::mainmenu); silence_settings_error = false; deathcounts = 0; gameoverdelay = 0; - framecounter = 0; - seed_use_sdl_getticks = false; - editor_disabled = false; resetgameclock(); gamesaved = false; gamesavefailed = false; savetime = "00:00"; + savearea = "nowhere"; savetrinkets = 0; - /* These are only used some of the time. */ - saveframes = 0; - saveseconds = 0; - intimetrial = false; timetrialcountdown = 0; timetrialshinytarget = 0; timetrialparlost = false; timetrialpar = 0; - timetrialcheater = false; timetrialresulttime = 0; timetrialresultframes = 0; timetrialresultshinytarget = 0; timetrialresulttrinkets = 0; timetrialresultpar = 0; timetrialresultdeaths = 0; - start_translator_exploring = false; - translator_exploring = false; - translator_exploring_allowtele = false; - translator_cutscene_test = false; totalflips = 0; hardestroom = "Welcome Aboard"; hardestroomdeaths = 0; - hardestroom_x = 13; - hardestroom_y = 5; - hardestroom_specialname = false; - hardestroom_finalstretch = false; currentroomdeaths=0; inertia = 1.1f; swnmode = false; swntimer = 0; - swngame = SWN_NONE; // Not playing sine wave ninja! + swngame = 0;//Not playing sine wave ninja! swnstate = 0; swnstate2 = 0; swnstate3 = 0; @@ -314,6 +258,7 @@ void Game::init(void) supercrewmate = false; scmhurt = false; scmprogress = 0; + scmmoveme = false; swncolstate = 0; swncoldelay = 0; swnrecord = 0; @@ -326,11 +271,89 @@ void Game::init(void) saveFilePath = FILESYSTEM_getUserSaveDirectory(); tinyxml2::XMLDocument doc; - last_quicksave = get_summary("saves/qsave.vvv", "qsave.vvv", doc); + if (!FILESYSTEM_loadTiXml2Document("saves/qsave.vvv", doc)) + { + quicksummary = ""; + printf("Quick Save Not Found\n"); + } + else + { + tinyxml2::XMLHandle hDoc(&doc); + tinyxml2::XMLElement* pElem; + tinyxml2::XMLHandle hRoot(NULL); + + pElem=hDoc.FirstChildElement().ToElement(); + if (!pElem) + { + printf("Quick Save Appears Corrupted: No XML Root\n"); + } + + // save this for later + hRoot=tinyxml2::XMLHandle(pElem); + + for( pElem = hRoot.FirstChildElement( "Data" ).FirstChild().ToElement(); pElem; pElem=pElem->NextSiblingElement()) + { + const char* pKey = pElem->Value(); + const char* pText = pElem->GetText() ; + + if (pText == NULL) + { + pText = ""; + } + + if (SDL_strcmp(pKey, "summary") == 0) + { + quicksummary = pText; + } + + + } + } tinyxml2::XMLDocument docTele; - last_telesave = get_summary("saves/tsave.vvv", "tsave.vvv", doc); + if (!FILESYSTEM_loadTiXml2Document("saves/tsave.vvv", docTele)) + { + telesummary = ""; + printf("Teleporter Save Not Found\n"); + } + else + { + tinyxml2::XMLHandle hDoc(&docTele); + tinyxml2::XMLElement* pElem; + tinyxml2::XMLHandle hRoot(NULL); + + + { + pElem=hDoc.FirstChildElement().ToElement(); + // should always have a valid root but handle gracefully if it does + if (!pElem) + { + printf("Teleporter Save Appears Corrupted: No XML Root\n"); + } + + // save this for later + hRoot=tinyxml2::XMLHandle(pElem); + } + + for( pElem = hRoot.FirstChildElement( "Data" ).FirstChild().ToElement(); pElem; pElem=pElem->NextSiblingElement()) + { + const char* pKey = pElem->Value(); + const char* pText = pElem->GetText() ; + + if (pText == NULL) + { + pText = ""; + } + + if (SDL_strcmp(pKey, "summary") == 0) + { + telesummary = pText; + } + + + } + } screenshake = flashlight = 0 ; @@ -338,7 +361,6 @@ void Game::init(void) state = 1; statedelay = 0; - statelocked = false; //updatestate(); skipfakeload = false; @@ -361,8 +383,9 @@ void Game::init(void) showingametimer = false; ingame_titlemode = false; +#if !defined(NO_CUSTOM_LEVELS) && !defined(NO_EDITOR) ingame_editormode = false; - +#endif kludge_ingametemp = Menu::mainmenu; slidermode = SLIDER_NONE; @@ -370,64 +393,6 @@ void Game::init(void) disableaudiopause = false; disabletemporaryaudiopause = true; inputdelay = false; - - old_skip_message_timer = 0; - skip_message_timer = 0; - - old_mode_indicator_timer = 0; - mode_indicator_timer = 0; - - old_screenshot_border_timer = 0; - screenshot_border_timer = 0; - screenshot_saved_success = false; - -#if defined(__ANDROID__) || TARGET_OS_IPHONE - checkpoint_saving = true; -#else - checkpoint_saving = false; -#endif - - setdefaultcontrollerbuttons(); -} - -void Game::setdefaultcontrollerbuttons(void) -{ - if (controllerButton_flip.size() < 1) - { - controllerButton_flip.push_back(SDL_CONTROLLER_BUTTON_A); - } - if (controllerButton_map.size() < 1) - { - controllerButton_map.push_back(SDL_CONTROLLER_BUTTON_Y); - } - if (controllerButton_esc.size() < 1) - { - controllerButton_esc.push_back(SDL_CONTROLLER_BUTTON_B); - } - if (controllerButton_restart.size() < 1) - { - controllerButton_restart.push_back(SDL_CONTROLLER_BUTTON_RIGHTSHOULDER); - } - if (controllerButton_interact.size() < 1) - { - controllerButton_interact.push_back(SDL_CONTROLLER_BUTTON_X); - } - - /* If one of the arrays was empty, and others weren't, we might now have conflicts... - * A crucial one is if the ACTION button is also "ESC", because then you can't - * fix it with just a controller anymore, which might make the game unplayable. - * This is similar to updatebuttonmappings() in Input.cpp, except less... complete? */ - for (size_t f = 0; f < controllerButton_flip.size(); f++) - { - for (size_t e = 0; e < controllerButton_esc.size(); e++) - { - if (controllerButton_flip[f] == controllerButton_esc[e]) - { - controllerButton_esc.erase(controllerButton_esc.begin() + e); - break; - } - } - } } void Game::lifesequence(void) @@ -445,7 +410,7 @@ void Game::lifesequence(void) if (lifeseq > 5) gravitycontrol = savegc; lifeseq--; - if (INBOUNDS_VEC(i, obj.entities) && (lifeseq <= 0 || noflashingmode)) + if (INBOUNDS_VEC(i, obj.entities) && lifeseq <= 0) { obj.entities[i].invis = false; } @@ -461,19 +426,33 @@ void Game::clearcustomlevelstats(void) void Game::updatecustomlevelstats(std::string clevel, int cscore) { - if (!map.custommodeforreal) - { - /* We are playtesting, don't update level stats */ - return; - } - if (clevel.find("levels/") != std::string::npos) { clevel = clevel.substr(7); } - if (customlevelstats.count(clevel) == 0 || cscore > customlevelstats[clevel]) + int tvar=-1; + for(size_t j=0; j=0) + { + // We have an existing entry + // Don't update it unless it's a higher score + if (cscore > customlevelstats[tvar].score) + { + customlevelstats[tvar].score=cscore; + } + } + else + { + //add a new entry + CustomLevelStat levelstat = {clevel, cscore}; + customlevelstats.push_back(levelstat); } savecustomlevelstats(); } @@ -484,7 +463,7 @@ void Game::deletecustomlevelstats(void) if (!FILESYSTEM_delete("saves/levelstats.vvv")) { - vlog_error("Error deleting levelstats.vvv"); + puts("Error deleting levelstats.vvv"); } } @@ -514,8 +493,6 @@ void Game::deletecustomlevelstats(void) void Game::loadcustomlevelstats(void) { tinyxml2::XMLDocument doc; - tinyxml2::XMLHandle hDoc(&doc); - if (!FILESYSTEM_loadTiXml2Document("saves/levelstats.vvv", doc)) { //No levelstats file exists; start new @@ -524,26 +501,29 @@ void Game::loadcustomlevelstats(void) return; } - if (doc.Error()) - { - vlog_error("Error parsing levelstats.vvv: %s", doc.ErrorStr()); - return; - } - - customlevelstats.clear(); + // Old system + std::vector customlevelnames; + std::vector customlevelscores; + tinyxml2::XMLHandle hDoc(&doc); tinyxml2::XMLElement* pElem; - tinyxml2::XMLElement* firstElement; + tinyxml2::XMLHandle hRoot(NULL); - firstElement = hDoc - .FirstChildElement() - .FirstChildElement("Data") - .FirstChildElement() - .ToElement(); + { + pElem=hDoc.FirstChildElement().ToElement(); + // should always have a valid root but handle gracefully if it does + if (!pElem) + { + printf("Error: Levelstats file corrupted\n"); + } + + // save this for later + hRoot=tinyxml2::XMLHandle(pElem); + } // First pass, look for the new system of storing stats // If they don't exist, then fall back to the old system - for (pElem = firstElement; pElem != NULL; pElem = pElem->NextSiblingElement()) + for (pElem = hRoot.FirstChildElement("Data").FirstChild().ToElement(); pElem; pElem = pElem->NextSiblingElement()) { const char* pKey = pElem->Value(); const char* pText = pElem->GetText(); @@ -554,40 +534,21 @@ void Game::loadcustomlevelstats(void) if (SDL_strcmp(pKey, "stats") == 0) { - bool file_has_duplicates = false; - for (tinyxml2::XMLElement* stat_el = pElem->FirstChildElement(); stat_el; stat_el = stat_el->NextSiblingElement()) { - int score = 0; - std::string name; + CustomLevelStat stat = {}; if (stat_el->GetText() != NULL) { - score = help.Int(stat_el->GetText()); + stat.score = help.Int(stat_el->GetText()); } if (stat_el->Attribute("name")) { - name = stat_el->Attribute("name"); + stat.name = stat_el->Attribute("name"); } - int existing = customlevelstats.count(name); - if (existing > 0) - { - file_has_duplicates = true; - } - - if (existing == 0 || score > customlevelstats[name]) - { - customlevelstats[name] = score; - } - } - - if (file_has_duplicates) - { - /* This might be really inflated, so simply save the map we have now, - * so we don't have to keep loading a 90 MB file. */ - savecustomlevelstats(); + customlevelstats.push_back(stat); } return; @@ -596,10 +557,7 @@ void Game::loadcustomlevelstats(void) // Since we're still here, we must be on the old system - std::vector customlevelnames; - std::vector customlevelscores; - - for (pElem = firstElement; pElem; pElem=pElem->NextSiblingElement()) + for( pElem = hRoot.FirstChildElement( "Data" ).FirstChild().ToElement(); pElem; pElem=pElem->NextSiblingElement()) { const char* pKey = pElem->Value(); const char* pText = pElem->GetText() ; @@ -635,15 +593,10 @@ void Game::loadcustomlevelstats(void) } // If the two arrays happen to differ in length, just go with the smallest one - for (size_t i = 0; i < SDL_min(customlevelnames.size(), customlevelscores.size()); i++) + for (int i = 0; i < VVV_min(customlevelnames.size(), customlevelscores.size()); i++) { - const std::string& name = customlevelnames[i]; - const int score = customlevelscores[i]; - - if (customlevelstats.count(name) == 0 || score > customlevelstats[name]) - { - customlevelstats[name] = score; - } + CustomLevelStat stat = {customlevelnames[i], customlevelscores[i]}; + customlevelstats.push_back(stat); } } @@ -653,12 +606,7 @@ void Game::savecustomlevelstats(void) bool already_exists = FILESYSTEM_loadTiXml2Document("saves/levelstats.vvv", doc); if (!already_exists) { - vlog_info("No levelstats.vvv found. Creating new file"); - } - else if (doc.Error()) - { - vlog_error("Error parsing existing levelstats.vvv: %s", doc.ErrorStr()); - vlog_info("Creating new levelstats.vvv"); + puts("No levelstats.vvv found. Creating new file"); } xml::update_declaration(doc); @@ -674,195 +622,94 @@ void Game::savecustomlevelstats(void) xml::update_tag(msgs, "numcustomlevelstats", numcustomlevelstats); std::string customlevelscorestr; - std::string customlevelstatsstr; - std::map::iterator iter; - for (iter = customlevelstats.begin(); iter != customlevelstats.end(); iter++) + for(int i = 0; i < numcustomlevelstats; i++ ) { - customlevelscorestr += help.String(iter->second) + ","; - customlevelstatsstr += iter->first + "|"; + customlevelscorestr += help.String(customlevelstats[i].score) + ","; } xml::update_tag(msgs, "customlevelscore", customlevelscorestr.c_str()); + + std::string customlevelstatsstr; + for(int i = 0; i < numcustomlevelstats; i++ ) + { + customlevelstatsstr += customlevelstats[i].name + "|"; + } xml::update_tag(msgs, "customlevelstats", customlevelstatsstr.c_str()); // New system tinyxml2::XMLElement* msg = xml::update_element_delete_contents(msgs, "stats"); tinyxml2::XMLElement* stat_el; - for (iter = customlevelstats.begin(); iter != customlevelstats.end(); iter++) + for (size_t i = 0; i < customlevelstats.size(); i++) { stat_el = doc.NewElement("stat"); + CustomLevelStat& stat = customlevelstats[i]; - stat_el->SetAttribute("name", iter->first.c_str()); - stat_el->LinkEndChild(doc.NewText(help.String(iter->second).c_str())); + stat_el->SetAttribute("name", stat.name.c_str()); + stat_el->LinkEndChild(doc.NewText(help.String(stat.score).c_str())); msg->LinkEndChild(stat_el); } if(FILESYSTEM_saveTiXml2Document("saves/levelstats.vvv", doc)) { - vlog_info("Level stats saved"); + printf("Level stats saved\n"); } else { - vlog_error("Could Not Save level stats!"); - vlog_error("Failed: %s%s", saveFilePath, "levelstats.vvv"); + printf("Could Not Save level stats!\n"); + printf("Failed: %s%s\n", saveFilePath, "levelstats.vvv"); } } void Game::levelcomplete_textbox(void) { - graphics.createtextboxflipme("", -1, 12, TEXT_COLOUR("cyan")); - graphics.addline(" "); + graphics.createtextboxflipme("", -1, 12, 165, 165, 255); + graphics.addline(" "); graphics.addline(""); graphics.addline(""); - graphics.textboxoriginalcontextauto(); - graphics.textboxprintflags(PR_FONT_8X8); graphics.textboxcenterx(); - graphics.setimage(TEXTIMAGE_LEVELCOMPLETE); - graphics.setlinegap(0); - graphics.textboxapplyposition(); } -static void compute_crewmate_textbox(textboxclass* THIS) +void Game::crewmate_textbox(const int r, const int g, const int b) { - THIS->lines.clear(); - THIS->addline(""); - - const int extra_cjk_height = (font::height(PR_FONT_INTERFACE) * 4) - 32; - THIS->yp = 64 + 8 + 16 - extra_cjk_height/2; - - /* This is a special case for wrapping, we MUST have two lines. - * So just make sure it can't fit in one line. */ - const char* text = loc::gettext("You have rescued a crew member!"); - std::string wrapped = font::string_wordwrap_balanced(PR_FONT_INTERFACE, text, font::len(PR_FONT_INTERFACE, text)-1); - - size_t startline = 0; - size_t newline; - do { - size_t pos_n = wrapped.find('\n', startline); - size_t pos_p = wrapped.find('|', startline); - newline = SDL_min(pos_n, pos_p); - THIS->addline(wrapped.substr(startline, newline-startline)); - startline = newline+1; - } while (newline != std::string::npos); - - THIS->addline(""); - THIS->centertext(); - float spaces_per_8 = font::len(PR_FONT_INTERFACE, " ")/8.0f; - THIS->pad(SDL_ceilf(5/spaces_per_8), SDL_ceilf(2/spaces_per_8)); - if (!THIS->sprites.empty()) - { - THIS->sprites[0].y = 12 + extra_cjk_height/2; - } -} - -void Game::crewmate_textbox(const int color) -{ - const int extra_cjk_height = (font::height(PR_FONT_INTERFACE) * 4) - 32; - graphics.createtextboxflipme("", -1, 64 + 8 + 16, TEXT_COLOUR("gray")); - graphics.textboxprintflags(PR_FONT_INTERFACE); + graphics.createtextboxflipme("", -1, 64 + 8 + 16, r, g, b); + graphics.addline(" You have rescued "); + graphics.addline(" a crew member! "); + graphics.addline(""); graphics.textboxcenterx(); - graphics.addsprite(14, 12 + extra_cjk_height/2, 0, color); - graphics.textboxtranslate(TEXTTRANSLATE_FUNCTION, compute_crewmate_textbox); - graphics.setlinegap(0); - graphics.textboxapplyposition(); -} - -static void compute_remaining_textbox(textboxclass* THIS) -{ - extern Game game; - const int remaining = 6 - game.crewrescued(); - char buffer[SCREEN_WIDTH_CHARS + 1]; - if (remaining > 0) - { - loc::gettext_plural_fill(buffer, sizeof(buffer), "{n_crew|wordy} remain", "{n_crew|wordy} remains", "n_crew:int", remaining); - } - else - { - SDL_strlcpy(buffer, loc::gettext("All Crew Members Rescued!"), sizeof(buffer)); - } - - THIS->lines.clear(); - THIS->lines.push_back(buffer); - - // In CJK, the "You have rescued" box becomes so big we should lower this one a bit... - const int cjk_lowering = font::height(PR_FONT_INTERFACE) - 8; - THIS->yp = 128 + 16 + cjk_lowering; - THIS->pad(2, 2); - } void Game::remaining_textbox(void) { - graphics.createtextboxflipme("", -1, 128 + 16, TEXT_COLOUR("gray")); - graphics.textboxprintflags(PR_FONT_INTERFACE); + const int remaining = 6 - crewrescued(); + const char* string; + char buffer[161]; /* 4 bytes per 40 chars (whole screen) plus 1 for null terminator */ + if (remaining == 1) + { + string = " One remains "; + } + else if (remaining > 0) + { + SDL_snprintf( + buffer, + sizeof(buffer), + " %s remain ", + help.number(remaining).c_str() + ); + string = buffer; + } + else + { + string = " All Crew Members Rescued! "; + } + + graphics.createtextboxflipme(string, -1, 128 + 16, 174, 174, 174); graphics.textboxcenterx(); - graphics.textboxtranslate(TEXTTRANSLATE_FUNCTION, compute_remaining_textbox); - graphics.textboxapplyposition(); -} - -static void compute_actionprompt_textbox(textboxclass* THIS) -{ - THIS->lines.clear(); - - char buffer[SCREEN_WIDTH_CHARS + 1]; - vformat_buf( - buffer, sizeof(buffer), - loc::gettext("Press {button} to continue"), - "button:but", - vformat_button(ActionSet_InGame, Action_InGame_ACTION) - ); - - THIS->lines.push_back(buffer); - THIS->pad(1, 1); } void Game::actionprompt_textbox(void) { - graphics.createtextboxflipme("", -1, 196, TEXT_COLOUR("cyan")); - graphics.textboxprintflags(PR_FONT_INTERFACE); + graphics.createtextboxflipme(" Press ACTION to continue ", -1, 196, 164, 164, 255); graphics.textboxcenterx(); - graphics.textboxtranslate(TEXTTRANSLATE_FUNCTION, compute_actionprompt_textbox); - graphics.textboxapplyposition(); -} - -static void savetele_textbox_success(textboxclass* THIS) -{ - THIS->lines.clear(); - THIS->lines.push_back(loc::gettext("Game Saved")); - THIS->pad(3, 3); -} - -static void save_textbox_fail(textboxclass* THIS) -{ - THIS->lines.clear(); - THIS->lines.push_back(loc::gettext("ERROR: Could not save game!")); - THIS->wrap(2); - THIS->pad(1, 1); -} - -void Game::show_save_fail(void) -{ - graphics.createtextboxflipme("", -1, 12, TEXT_COLOUR("red")); - graphics.textboxprintflags(PR_FONT_INTERFACE); - graphics.textboxcenterx(); - graphics.textboxtimer(50); - graphics.textboxtranslate(TEXTTRANSLATE_FUNCTION, save_textbox_fail); -} - -void Game::checkpoint_save(void) -{ - if (checkpoint_saving && !inspecial() && (!map.custommode || (map.custommode && map.custommodeforreal)) && !cliplaytest) - { - bool success = map.custommode ? customsavequick(cl.ListOfMetaData[playcustomlevel].filename) : savequick(); - gamesaved = success; - gamesavefailed = !success; - - if (gamesavefailed) - { - show_save_fail(); - graphics.textboxapplyposition(); - } - } } void Game::savetele_textbox(void) @@ -874,388 +721,21 @@ void Game::savetele_textbox(void) if (savetele()) { - graphics.createtextboxflipme("", -1, 12, TEXT_COLOUR("gray")); - graphics.textboxprintflags(PR_FONT_INTERFACE); - graphics.textboxcenterx(); + graphics.createtextboxflipme(" Game Saved ", -1, 12, 174, 174, 174); graphics.textboxtimer(25); - graphics.textboxtranslate(TEXTTRANSLATE_FUNCTION, savetele_textbox_success); } else { - show_save_fail(); + graphics.createtextboxflipme(" ERROR: Could not save game! ", -1, 12, 255, 60, 60); + graphics.textboxtimer(50); } - graphics.textboxapplyposition(); -} - -static void wasd_textbox(textboxclass* THIS) -{ - THIS->lines.clear(); - THIS->lines.push_back(BUTTONGLYPHS_get_wasd_text()); - THIS->wrap(4); - THIS->centertext(); - THIS->pad(2, 2); -} - -static void flip_textbox(textboxclass* THIS) -{ - THIS->lines.clear(); - - char buffer[SCREEN_WIDTH_CHARS*3 + 1]; - vformat_buf( - buffer, sizeof(buffer), - loc::gettext("Press {button} to flip"), - "button:but", - vformat_button(ActionSet_InGame, Action_InGame_ACTION) - ); - THIS->lines.push_back(buffer); - THIS->wrap(4); - THIS->centertext(); - THIS->pad(2, 2); -} - -static void arrowkey_textbox(textboxclass* THIS) -{ - THIS->lines.clear(); - THIS->lines.push_back(loc::gettext("If you prefer, you can press UP or DOWN instead of ACTION to flip.")); - THIS->wrap(2); - THIS->centertext(); - THIS->pad(1, 1); -} - -static void map_textbox(textboxclass* THIS) -{ - THIS->lines.clear(); - - char buffer[SCREEN_WIDTH_CHARS*3 + 1]; - vformat_buf( - buffer, sizeof(buffer), - loc::gettext("Press {button} to view map and quicksave"), - "button:but", - vformat_button(ActionSet_InGame, Action_InGame_Map) - ); - - THIS->lines.push_back(buffer); - THIS->wrap(4); - THIS->centertext(); - THIS->pad(2, 2); -} - -static void im1_instructions_textbox1(textboxclass* THIS) -{ - extern Game game; - THIS->lines.clear(); - - // Intermission 1 instructional textbox, depends on last saved - const char* floorceiling = graphics.flipmode ? "ceiling" : "floor"; - const char* crewmate; - switch (game.lastsaved) - { - case 2: - crewmate = "Vitellary"; - break; - case 3: - crewmate = "Vermilion"; - break; - case 4: - crewmate = "Verdigris"; - break; - case 5: - crewmate = "Victoria"; - break; - default: - crewmate = "your companion"; - } - char english[SCREEN_WIDTH_TILES*3 + 1]; /* ASCII only */ - vformat_buf(english, sizeof(english), - "When you're standing on the {floorceiling}, {crewmate} will try to walk to you.", - "floorceiling:str, crewmate:str", - floorceiling, crewmate - ); - - THIS->lines.push_back(loc::gettext(english)); - THIS->wrap(2); - THIS->padtowidth(36*8); -} - -static void im1_instructions_textbox2(textboxclass* THIS) -{ - extern Game game; - THIS->lines.clear(); - - // Intermission 1 instructional textbox, depends on last saved - const char* floorceiling = graphics.flipmode ? "ceiling" : "floor"; - const char* crewmate; - switch (game.lastsaved) - { - case 2: - crewmate = "Vitellary"; - break; - case 3: - crewmate = "Vermilion"; - break; - case 4: - crewmate = "Verdigris"; - break; - case 5: - crewmate = "Victoria"; - break; - default: - crewmate = "your companion"; - } - char english[SCREEN_WIDTH_TILES*3 + 1]; /* ASCII only */ - vformat_buf(english, sizeof(english), - "When you're NOT standing on the {floorceiling}, {crewmate} will stop and wait for you.", - "floorceiling:str, crewmate:str", - floorceiling, crewmate - ); - - THIS->lines.push_back(loc::gettext(english)); - THIS->wrap(2); - THIS->padtowidth(36*8); -} - -static void im1_instructions_textbox3(textboxclass* THIS) -{ - extern Game game; - THIS->lines.clear(); - - // Intermission 1 instructional textbox, depends on last saved - const char* english; - switch (game.lastsaved) - { - case 2: - case 3: - case 4: - english = "You can't continue to the next room until he is safely across."; - break; - case 5: - english = "You can't continue to the next room until she is safely across."; - break; - default: - english = "You can't continue to the next room until they are safely across."; - } - - THIS->lines.push_back(loc::gettext(english)); - THIS->wrap(2); - THIS->padtowidth(36*8); -} - -/* Also used in foundtrinket() script command. */ -void foundtrinket_textbox1(textboxclass* THIS) -{ - THIS->lines.clear(); - - THIS->lines.push_back(loc::gettext("Congratulations!\n\nYou have found a shiny trinket!")); - THIS->wrap(2); - THIS->centertext(); - THIS->pad(1, 1); -} - -/* Also used in foundtrinket() script command. */ -void foundtrinket_textbox2(textboxclass* THIS) -{ - extern Game game; - THIS->lines.clear(); - - const int max_trinkets = map.custommode ? cl.numtrinkets() : 20; - - char buffer[SCREEN_WIDTH_CHARS + 1]; - vformat_buf( - buffer, sizeof(buffer), - loc::gettext("{n_trinkets|wordy} out of {max_trinkets|wordy}"), - "n_trinkets:int, max_trinkets:int", - game.trinkets(), max_trinkets - ); - THIS->lines.push_back(buffer); - - if (INBOUNDS_VEC(THIS->other_textbox_index, graphics.textboxes) - && &graphics.textboxes[THIS->other_textbox_index] != THIS) - { - THIS->yp = 95 + graphics.textboxes[THIS->other_textbox_index].h; - } - THIS->wrap(2); - THIS->centertext(); - THIS->pad(1, 1); -} - -static void foundcrewmate_textbox1(textboxclass* THIS) -{ - THIS->lines.clear(); - - THIS->lines.push_back(loc::gettext("Congratulations!\n\nYou have found a lost crewmate!")); - THIS->wrap(2); - THIS->centertext(); - THIS->pad(1, 1); -} - -static void foundcrewmate_textbox2(textboxclass* THIS) -{ - extern Game game; - THIS->lines.clear(); - - const int num_remaining = cl.numcrewmates() - game.crewmates(); - if (num_remaining == 0) - { - THIS->lines.push_back(loc::gettext("All crewmates rescued!")); - } - else - { - char buffer[SCREEN_WIDTH_CHARS + 1]; - loc::gettext_plural_fill( - buffer, sizeof(buffer), - "{n_crew|wordy} remain", "{n_crew|wordy} remains", - "n_crew:int", - num_remaining - ); - THIS->lines.push_back(buffer); - } - - if (INBOUNDS_VEC(THIS->other_textbox_index, graphics.textboxes) - && &graphics.textboxes[THIS->other_textbox_index] != THIS) - { - THIS->yp = 95 + graphics.textboxes[THIS->other_textbox_index].h; - } - THIS->wrap(4); - THIS->centertext(); - THIS->pad(2, 2); -} - -static void gamecomplete_textbox2(textboxclass* THIS) -{ - THIS->lines.clear(); - THIS->lines.push_back(loc::gettext("All Crew Members Rescued!")); -} - -static void gamecomplete_textbox3(textboxclass* THIS) -{ - THIS->lines.clear(); - - const char* label = loc::gettext("Trinkets Found:"); - THIS->lines.push_back(label); - THIS->xp = 170 - font::len(PR_FONT_INTERFACE, label); -} - -static void gamecomplete_textbox4(textboxclass* THIS) -{ - extern Game game; - THIS->lines.clear(); - - char buffer[SCREEN_WIDTH_CHARS + 1]; - vformat_buf(buffer, sizeof(buffer), - loc::gettext("{gamecomplete_n_trinkets|wordy}"), - "gamecomplete_n_trinkets:int", - game.trinkets() - ); - THIS->lines.push_back(buffer); -} - -static void gamecomplete_textbox5(textboxclass* THIS) -{ - THIS->lines.clear(); - - const char* label = loc::gettext("Game Time:"); - THIS->lines.push_back(label); - THIS->xp = 170 - font::len(PR_FONT_INTERFACE, label); -} - -static void gamecomplete_textbox6(textboxclass* THIS) -{ - extern Game game; - THIS->lines.clear(); - - char buffer[SCREEN_WIDTH_CHARS + 1]; - help.format_time(buffer, sizeof(buffer), game.saveseconds, game.saveframes, true); - THIS->lines.push_back(buffer); -} - -static void gamecomplete_textbox7(textboxclass* THIS) -{ - THIS->lines.clear(); - - const char* label = loc::gettext("Total Flips:"); - THIS->lines.push_back(label); - THIS->xp = 170 - font::len(PR_FONT_INTERFACE, label); -} - -static void gamecomplete_textbox9(textboxclass* THIS) -{ - THIS->lines.clear(); - - const char* label = loc::gettext("Total Deaths:"); - THIS->lines.push_back(label); - THIS->xp = 170 - font::len(PR_FONT_INTERFACE, label); -} - -static void gamecomplete_textbox11(textboxclass* THIS) -{ - extern Game game; - THIS->lines.clear(); - - char buffer[SCREEN_WIDTH_CHARS + 1]; - loc::gettext_plural_fill( - buffer, sizeof(buffer), - "Hardest Room (with {n_deaths} deaths)", - "Hardest Room (with {n_deaths} death)", - "n_deaths:int", - game.hardestroomdeaths - ); - THIS->lines.push_back(buffer); -} - -static void gamecomplete_textbox12(textboxclass* THIS) -{ - extern Game game; - THIS->lines.clear(); - - THIS->lines.push_back( - loc::gettext_roomname( - map.custommode, - game.hardestroom_x, game.hardestroom_y, - game.hardestroom.c_str(), game.hardestroom_specialname - ) - ); -} - -void Game::setstate(const int gamestate) -{ - if (!statelocked || GlitchrunnerMode_less_than_or_equal(Glitchrunner2_2)) - { - state = gamestate; - } -} - -void Game::incstate(void) -{ - if (!statelocked || GlitchrunnerMode_less_than_or_equal(Glitchrunner2_2)) - { - state++; - } -} - -void Game::setstatedelay(const int delay) -{ - if (!statelocked || GlitchrunnerMode_less_than_or_equal(Glitchrunner2_2)) - { - statedelay = delay; - } -} - -void Game::lockstate(void) -{ - statelocked = true; -} - -void Game::unlockstate(void) -{ - statelocked = false; } void Game::updatestate(void) { statedelay--; - if (statedelay <= 0) - { - statedelay = 0; + if(statedelay<=0){ + statedelay=0; glitchrunkludge=false; } if (statedelay <= 0) @@ -1275,12 +755,6 @@ void Game::updatestate(void) } else { - if (completestop) - { - /* Close potential collection dialogue if warping to ship */ - graphics.textboxremove(); - graphics.showcutscenebars = false; - } /* Prevent softlocks if there's no cutscene running right now */ hascontrol = true; completestop = false; @@ -1288,28 +762,22 @@ void Game::updatestate(void) break; case 1: //Game initilisation - setstate(0); + state = 0; break; case 2: //Opening cutscene advancetext = true; hascontrol = false; - setstate(3); - graphics.createtextbox("To do: write quick", 50, 80, TEXT_COLOUR("cyan")); + state = 3; + graphics.createtextbox("To do: write quick", 50, 80, 164, 164, 255); graphics.addline("intro to story!"); - graphics.textboxoriginalcontextauto(); - graphics.textboxprintflags(PR_FONT_8X8); //Oh no! what happen to rest of crew etc crash into dimension break; case 4: //End of opening cutscene for now - graphics.createtextbox("", -1, 195, TEXT_COLOUR("gray")); - graphics.textboxprintflags(PR_FONT_INTERFACE); - graphics.textboxcenterx(); + graphics.createtextbox(" Press arrow keys or WASD to move ", -1, 195, 174, 174, 174); graphics.textboxtimer(60); - graphics.textboxtranslate(TEXTTRANSLATE_FUNCTION, wasd_textbox); - graphics.textboxapplyposition(); - setstate(0); + state = 0; break; case 5: //Demo over @@ -1319,14 +787,14 @@ void Game::updatestate(void) startscript = true; newscript="returntohub"; obj.removetrigger(5); - setstate(6); + state = 6; break; case 7: //End of opening cutscene for now graphics.textboxremove(); hascontrol = true; advancetext = false; - setstate(0); + state = 0; break; case 8: //Enter dialogue @@ -1334,26 +802,18 @@ void Game::updatestate(void) if (!obj.flags[13]) { obj.flags[13] = true; - - graphics.createtextbox("", -1, 155, TEXT_COLOUR("gray")); - graphics.textboxprintflags(PR_FONT_INTERFACE); - graphics.textboxcenterx(); + graphics.createtextbox(" Press ENTER to view map ", -1, 155, 174, 174, 174); + graphics.addline(" and quicksave"); graphics.textboxtimer(60); - graphics.textboxtranslate(TEXTTRANSLATE_FUNCTION, map_textbox); - graphics.textboxapplyposition(); } - setstate(0); + state = 0; break; case 9: if (!map.custommode && nocompetitive()) { returntolab(); - - startscript = true; - newscript = "disableaccessibility"; - - setstate(0); + state = 0; break; } @@ -1361,7 +821,7 @@ void Game::updatestate(void) obj.removetrigger(9); swnmode = true; - swngame = SWN_START_SUPERGRAVITRON_STEP_1; + swngame = 6; swndelay = 150; swntimer = 60 * 30; @@ -1374,7 +834,7 @@ void Game::updatestate(void) savery = roomy; savedir = 0; - setstate(0); + state = 0; break; case 10: @@ -1382,7 +842,7 @@ void Game::updatestate(void) obj.removetrigger(10); swnmode = true; - swngame = SWN_START_GRAVITRON_STEP_1; + swngame = 4; swndelay = 150; swntimer = 60 * 30; @@ -1395,50 +855,113 @@ void Game::updatestate(void) savery = roomy; savedir = 0; - setstate(0); + state = 0; break; case 11: + //Intermission 1 instructional textbox, depends on last saved graphics.textboxremovefast(); - graphics.createtextbox("", -1, 3, TEXT_COLOUR("gray")); - graphics.textboxprintflags(PR_FONT_INTERFACE); - graphics.textboxcenterx(); + graphics.createtextbox(" When you're NOT standing on ", -1, 3, 174, 174, 174); + if (graphics.flipmode) + { + if (lastsaved == 2) + { + graphics.addline(" the ceiling, Vitellary will"); + } + else if (lastsaved == 3) + { + graphics.addline(" the ceiling, Vermilion will"); + } + else if (lastsaved == 4) + { + graphics.addline(" the ceiling, Verdigris will"); + } + else if (lastsaved == 5) + { + graphics.addline(" the ceiling, Victoria will"); + } + } + else + { + if (lastsaved == 2) + { + graphics.addline(" the floor, Vitellary will"); + } + else if (lastsaved == 3) + { + graphics.addline(" the floor, Vermilion will"); + } + else if (lastsaved == 4) + { + graphics.addline(" the floor, Verdigris will"); + } + else if (lastsaved == 5) + { + graphics.addline(" the floor, Victoria will"); + } + } + + graphics.addline(" stop and wait for you."); graphics.textboxtimer(180); - graphics.textboxtranslate(TEXTTRANSLATE_FUNCTION, im1_instructions_textbox2); - graphics.textboxapplyposition(); - setstate(0); + state = 0; break; case 12: + //Intermission 1 instructional textbox, depends on last saved obj.removetrigger(12); if (!obj.flags[61]) { obj.flags[61] = true; graphics.textboxremovefast(); - graphics.createtextbox("", -1, 3, TEXT_COLOUR("gray")); - graphics.textboxprintflags(PR_FONT_INTERFACE); - graphics.textboxcenterx(); + graphics.createtextbox(" You can't continue to the next ", -1, 8, 174, 174, 174); + if (lastsaved == 5) + { + graphics.addline(" room until she is safely across. "); + } + else + { + graphics.addline(" room until he is safely across. "); + } graphics.textboxtimer(120); - graphics.textboxtranslate(TEXTTRANSLATE_FUNCTION, im1_instructions_textbox3); - graphics.textboxapplyposition(); } - setstate(0); + state = 0; break; case 13: //textbox removal obj.removetrigger(13); graphics.textboxremovefast(); - setstate(0); + state = 0; break; case 14: - graphics.createtextbox("", -1, 3, TEXT_COLOUR("gray")); - graphics.textboxprintflags(PR_FONT_INTERFACE); - graphics.textboxcenterx(); + //Intermission 1 instructional textbox, depends on last saved + if (graphics.flipmode) + { + graphics.createtextbox(" When you're standing on the ceiling, ", -1, 3, 174, 174, 174); + } + else + { + graphics.createtextbox(" When you're standing on the floor, ", -1, 3, 174, 174, 174); + } + if (lastsaved == 2) + { + graphics.addline(" Vitellary will try to walk to you. "); + } + else if (lastsaved == 3) + { + graphics.addline(" Vermilion will try to walk to you. "); + } + else if (lastsaved == 4) + { + graphics.addline(" Verdigris will try to walk to you. "); + } + else if (lastsaved == 5) + { + graphics.addline(" Victoria will try to walk to you. "); + } graphics.textboxtimer(280); - graphics.textboxtranslate(TEXTTRANSLATE_FUNCTION, im1_instructions_textbox1); - graphics.textboxapplyposition(); - setstate(0); + state = 0; break; + case 15: { //leaving the naughty corner @@ -1447,7 +970,7 @@ void Game::updatestate(void) { obj.entities[obj.getplayer()].tile = 0; } - setstate(0); + state = 0; break; } case 16: @@ -1457,32 +980,26 @@ void Game::updatestate(void) if(INBOUNDS_VEC(i, obj.entities) && obj.entities[i].tile == 0) { obj.entities[i].tile = 144; - music.playef(Sound_CRY); + music.playef(2); } - setstate(0); + state = 0; break; } case 17: //Arrow key tutorial obj.removetrigger(17); - if (BUTTONGLYPHS_keyboard_is_active()) - { - graphics.createtextbox("", -1, 187, TEXT_COLOUR("gray")); - graphics.textboxprintflags(PR_FONT_INTERFACE); - graphics.textboxcenterx(); - graphics.textboxtimer(100); - graphics.textboxtranslate(TEXTTRANSLATE_FUNCTION, arrowkey_textbox); - graphics.textboxapplyposition(); - } - setstate(0); + graphics.createtextbox(" If you prefer, you can press UP or ", -1, 195, 174, 174, 174); + graphics.addline(" DOWN instead of ACTION to flip."); + graphics.textboxtimer(100); + state = 0; break; case 20: if (!obj.flags[1]) { obj.flags[1] = true; - setstate(0); + state = 0; graphics.textboxremove(); } obj.removetrigger(20); @@ -1491,7 +1008,7 @@ void Game::updatestate(void) if (!obj.flags[2]) { obj.flags[2] = true; - setstate(0); + state = 0; graphics.textboxremove(); } obj.removetrigger(21); @@ -1501,14 +1018,9 @@ void Game::updatestate(void) { graphics.textboxremovefast(); obj.flags[3] = true; - setstate(0); - - graphics.createtextbox("", -1, 25, TEXT_COLOUR("gray")); - graphics.textboxprintflags(PR_FONT_INTERFACE); - graphics.textboxcenterx(); + state = 0; + graphics.createtextbox(" Press ACTION to flip ", -1, 25, 174, 174, 174); graphics.textboxtimer(60); - graphics.textboxtranslate(TEXTTRANSLATE_FUNCTION, flip_textbox); - graphics.textboxapplyposition(); } obj.removetrigger(22); break; @@ -1520,15 +1032,15 @@ void Game::updatestate(void) obj.flags[4] = true; startscript = true; newscript="firststeps"; - setstate(0); + state = 0; } obj.removetrigger(30); - setstate(0); + state = 0; break; case 31: - //state = 55; setstatedelay(50); - setstate(0); - setstatedelay(0); + //state = 55; statedelay = 50; + state = 0; + statedelay = 0; if (!obj.flags[6]) { obj.flags[6] = true; @@ -1536,8 +1048,8 @@ void Game::updatestate(void) obj.flags[5] = true; startscript = true; newscript="communicationstation"; - setstate(0); - setstatedelay(0); + state = 0; + statedelay = 0; } obj.removetrigger(31); break; @@ -1548,10 +1060,10 @@ void Game::updatestate(void) obj.flags[7] = true; startscript = true; newscript="teleporterback"; - setstate(0); + state = 0; } obj.removetrigger(32); - setstate(0); + state = 0; break; case 33: //Generic "run script" @@ -1560,10 +1072,10 @@ void Game::updatestate(void) obj.flags[9] = true; startscript = true; newscript="rescueblue"; - setstate(0); + state = 0; } obj.removetrigger(33); - setstate(0); + state = 0; break; case 34: //Generic "run script" @@ -1572,10 +1084,10 @@ void Game::updatestate(void) obj.flags[10] = true; startscript = true; newscript="rescueyellow"; - setstate(0); + state = 0; } obj.removetrigger(34); - setstate(0); + state = 0; break; case 35: //Generic "run script" @@ -1584,10 +1096,10 @@ void Game::updatestate(void) obj.flags[11] = true; startscript = true; newscript="rescuegreen"; - setstate(0); + state = 0; } obj.removetrigger(35); - setstate(0); + state = 0; break; case 36: //Generic "run script" @@ -1596,10 +1108,10 @@ void Game::updatestate(void) obj.flags[8] = true; startscript = true; newscript="rescuered"; - setstate(0); + state = 0; } obj.removetrigger(36); - setstate(0); + state = 0; break; case 37: @@ -1608,10 +1120,10 @@ void Game::updatestate(void) { startscript = true; newscript="int2_yellow"; - setstate(0); + state = 0; } obj.removetrigger(37); - setstate(0); + state = 0; break; case 38: //Generic "run script" @@ -1619,10 +1131,10 @@ void Game::updatestate(void) { startscript = true; newscript="int2_red"; - setstate(0); + state = 0; } obj.removetrigger(38); - setstate(0); + state = 0; break; case 39: //Generic "run script" @@ -1630,10 +1142,10 @@ void Game::updatestate(void) { startscript = true; newscript="int2_green"; - setstate(0); + state = 0; } obj.removetrigger(39); - setstate(0); + state = 0; break; case 40: //Generic "run script" @@ -1641,10 +1153,10 @@ void Game::updatestate(void) { startscript = true; newscript="int2_blue"; - setstate(0); + state = 0; } obj.removetrigger(40); - setstate(0); + state = 0; break; case 41: @@ -1669,10 +1181,10 @@ void Game::updatestate(void) { newscript = "int1blue_2"; } - setstate(0); + state = 0; } obj.removetrigger(41); - setstate(0); + state = 0; break; case 42: //Generic "run script" @@ -1696,10 +1208,10 @@ void Game::updatestate(void) { newscript = "int1blue_3"; } - setstate(0); + state = 0; } obj.removetrigger(42); - setstate(0); + state = 0; break; case 43: //Generic "run script" @@ -1723,10 +1235,10 @@ void Game::updatestate(void) { newscript = "int1blue_4"; } - setstate(0); + state = 0; } obj.removetrigger(43); - setstate(0); + state = 0; break; case 44: //Generic "run script" @@ -1750,10 +1262,10 @@ void Game::updatestate(void) { newscript = "int1blue_5"; } - setstate(0); + state = 0; } obj.removetrigger(44); - setstate(0); + state = 0; break; case 45: //Generic "run script" @@ -1777,10 +1289,10 @@ void Game::updatestate(void) { newscript = "int1blue_6"; } - setstate(0); + state = 0; } obj.removetrigger(45); - setstate(0); + state = 0; break; case 46: //Generic "run script" @@ -1804,10 +1316,10 @@ void Game::updatestate(void) { newscript = "int1blue_7"; } - setstate(0); + state = 0; } obj.removetrigger(46); - setstate(0); + state = 0; break; case 47: @@ -1817,10 +1329,10 @@ void Game::updatestate(void) obj.flags[69] = true; startscript = true; newscript="trenchwarfare"; - setstate(0); + state = 0; } obj.removetrigger(47); - setstate(0); + state = 0; break; case 48: //Generic "run script" @@ -1829,118 +1341,94 @@ void Game::updatestate(void) obj.flags[70] = true; startscript = true; newscript="trinketcollector"; - setstate(0); + state = 0; } obj.removetrigger(48); - setstate(0); + state = 0; break; case 49: //Start final level music if (!obj.flags[71]) { obj.flags[71] = true; - music.niceplay(Music_PREDESTINEDFATEREMIX); - setstate(0); + music.niceplay(15); //Final level remix + state = 0; } obj.removetrigger(49); - setstate(0); + state = 0; break; case 50: - music.playef(Sound_VIOLET); - graphics.createtextbox("", 5, 8, TEXT_COLOUR("purple")); - graphics.textboxcommsrelay("Help! Can anyone hear this message?"); + music.playef(15); + graphics.createtextbox("Help! Can anyone hear", 35, 15, 255, 134, 255); + graphics.addline("this message?"); graphics.textboxtimer(60); - incstate(); - setstatedelay(100); + state++; + statedelay = 100; break; case 51: - music.playef(Sound_VIOLET); - graphics.createtextbox("", 5, 8, TEXT_COLOUR("purple")); - graphics.textboxcommsrelay("Verdigris? Are you out there? Are you ok?"); + music.playef(15); + graphics.createtextbox("Verdigris? Are you out", 30, 12, 255, 134, 255); + graphics.addline("there? Are you ok?"); graphics.textboxtimer(60); - incstate(); - setstatedelay(100); + state++; + statedelay = 100; break; case 52: - music.playef(Sound_VIOLET); - graphics.createtextbox("", 5, 8, TEXT_COLOUR("purple")); - graphics.textboxcommsrelay("Please help us! We've crashed and need assistance!"); + music.playef(15); + graphics.createtextbox("Please help us! We've crashed", 5, 22, 255, 134, 255); + graphics.addline("and need assistance!"); graphics.textboxtimer(60); - incstate(); - setstatedelay(100); + state++; + statedelay = 100; break; case 53: - music.playef(Sound_VIOLET); - graphics.createtextbox("", 5, 8, TEXT_COLOUR("purple")); - graphics.textboxcommsrelay("Hello? Anyone out there?"); + music.playef(15); + graphics.createtextbox("Hello? Anyone out there?", 40, 15, 255, 134, 255); graphics.textboxtimer(60); - incstate(); - setstatedelay(100); + state++; + statedelay = 100; break; case 54: - music.playef(Sound_VIOLET); - graphics.createtextbox("", 5, 8, TEXT_COLOUR("purple")); - graphics.textboxcommsrelay("This is Doctor Violet from the D.S.S. Souleye! Please respond!"); + music.playef(15); + graphics.createtextbox("This is Doctor Violet from the", 5, 8, 255, 134, 255); + graphics.addline("D.S.S. Souleye! Please respond!"); graphics.textboxtimer(60); - incstate(); - setstatedelay(100); + state++; + statedelay = 100; break; case 55: - music.playef(Sound_VIOLET); - graphics.createtextbox("", 5, 8, TEXT_COLOUR("purple")); - graphics.textboxcommsrelay("Please... Anyone..."); + music.playef(15); + graphics.createtextbox("Please... Anyone...", 45, 14, 255, 134, 255); graphics.textboxtimer(60); - incstate(); - setstatedelay(100); + state++; + statedelay = 100; break; case 56: - music.playef(Sound_VIOLET); - graphics.createtextbox("", 5, 8, TEXT_COLOUR("purple")); - graphics.textboxcommsrelay("Please be alright, everyone..."); + music.playef(15); + graphics.createtextbox("Please be alright, everyone...", 25, 18, 255, 134, 255); graphics.textboxtimer(60); - setstate(50); - setstatedelay(100); + state=50; + statedelay = 100; break; case 80: //Used to return to menu from the game - if (graphics.fademode == FADE_FULLY_BLACK) - { - incstate(); - } + if(graphics.fademode == 1) state++; break; case 81: quittomenu(); - music.play(Music_PRESENTINGVVVVVV); //should be after quittomenu() - setstate(0); + music.play(6); //should be after quittomenu() + state = 0; break; case 82: //Time Trial Complete! obj.removetrigger(82); - if (map.custommode && !map.custommodeforreal) - { - returntoeditor(); - ed.show_note(loc::gettext("Time trial completed")); - break; - } - - if (translator_exploring) - { - translator_exploring_allowtele = true; - setstate(0); - break; - } hascontrol = false; - if (timetrialcheater) - { - SDL_zeroa(obj.collect); - } - - timetrialresulttime = help.hms_to_seconds(hours, minutes, seconds); + timetrialresulttime = seconds + (minutes * 60) + (hours * 60 * 60); timetrialresultframes = frames; timetrialresulttrinkets = trinkets(); timetrialresultshinytarget = timetrialshinytarget; @@ -1970,48 +1458,30 @@ void Game::updatestate(void) if (timetrialrank > bestrank[timetriallevel] || bestrank[timetriallevel]==-1) { bestrank[timetriallevel] = timetrialrank; - if (timetrialrank >= 3) - { - switch (timetriallevel) - { - case TimeTrial_SPACESTATION1: - unlockAchievement("vvvvvvtimetrial_station1_fixed"); - break; - case TimeTrial_LABORATORY: - unlockAchievement("vvvvvvtimetrial_lab_fixed"); - break; - case TimeTrial_TOWER: - unlockAchievement("vvvvvvtimetrial_tower_fixed"); - break; - case TimeTrial_SPACESTATION2: - unlockAchievement("vvvvvvtimetrial_station2_fixed"); - break; - case TimeTrial_WARPZONE: - unlockAchievement("vvvvvvtimetrial_warp_fixed"); - break; - case TimeTrial_FINALLEVEL: - unlockAchievement("vvvvvvtimetrial_final_fixed"); - } + if(timetrialrank>=3){ + if(timetriallevel==0) unlockAchievement("vvvvvvtimetrial_station1_fixed"); + if(timetriallevel==1) unlockAchievement("vvvvvvtimetrial_lab_fixed"); + if(timetriallevel==2) unlockAchievement("vvvvvvtimetrial_tower_fixed"); + if(timetriallevel==3) unlockAchievement("vvvvvvtimetrial_station2_fixed"); + if(timetriallevel==4) unlockAchievement("vvvvvvtimetrial_warp_fixed"); + if(timetriallevel==5) unlockAchievement("vvvvvvtimetrial_final_fixed"); } } savestatsandsettings(); - graphics.fademode = FADE_START_FADEOUT; + graphics.fademode = 2; music.fadeout(); - incstate(); + state++; break; case 83: frames--; - if (graphics.fademode == FADE_FULLY_BLACK) - { - incstate(); - } + if(graphics.fademode == 1) state++; break; case 84: quittomenu(); createmenu(Menu::timetrialcomplete); - setstate(0); + state = 0; break; @@ -2019,9 +1489,9 @@ void Game::updatestate(void) //Cutscene skip version of final level change obj.removetrigger(85); //Init final stretch - incstate(); - music.playef(Sound_FLASH); - music.play(Music_POSITIVEFORCE); + state++; + music.playef(9); + music.play(2); obj.flags[72] = true; screenshake = 10; @@ -2034,7 +1504,7 @@ void Game::updatestate(void) map.final_colormode = true; map.final_colorframe = 1; - setstate(0); + state = 0; break; //From 90-100 are run scripts for the eurogamer expo only, remove later @@ -2043,54 +1513,51 @@ void Game::updatestate(void) startscript = true; newscript="startexpolevel_station1"; obj.removetrigger(90); - setstate(0); + state = 0; break; case 91: //Generic "run script" startscript = true; newscript="startexpolevel_lab"; obj.removetrigger(91); - setstate(0); + state = 0; break; case 92: //Generic "run script" startscript = true; newscript="startexpolevel_warp"; obj.removetrigger(92); - setstate(0); + state = 0; break; case 93: //Generic "run script" startscript = true; newscript="startexpolevel_tower"; obj.removetrigger(93); - setstate(0); + state = 0; break; case 94: //Generic "run script" startscript = true; newscript="startexpolevel_station2"; obj.removetrigger(94); - setstate(0); + state = 0; break; case 95: //Generic "run script" startscript = true; newscript="startexpolevel_final"; obj.removetrigger(95); - setstate(0); + state = 0; break; case 96: //Used to return to gravitron to game - if (graphics.fademode == FADE_FULLY_BLACK) - { - incstate(); - } + if(graphics.fademode == 1) state++; break; case 97: returntolab(); - setstate(0); + state = 0; break; case 100: @@ -2101,7 +1568,7 @@ void Game::updatestate(void) if (!obj.flags[4]) { obj.flags[4] = true; - incstate(); + state++; } break; case 101: @@ -2113,11 +1580,11 @@ void Game::updatestate(void) if (INBOUNDS_VEC(i, obj.entities) && obj.entities[i].onroof > 0 && gravitycontrol == 1) { gravitycontrol = 0; - music.playef(Sound_UNFLIP); + music.playef(1); } if (INBOUNDS_VEC(i, obj.entities) && obj.entities[i].onground > 0) { - incstate(); + state++; } } break; @@ -2137,18 +1604,14 @@ void Game::updatestate(void) hascontrol = false; graphics.createtextbox("Captain! I've been so worried!", 60, 90, 164, 255, 164); - graphics.textboxoriginalcontextauto(); - graphics.textboxprintflags(PR_FONT_8X8); - incstate(); - music.playef(Sound_VERDIGRIS); + state++; + music.playef(12); } break; case 104: - graphics.createtextbox("I'm glad you're ok!", 135, 152, TEXT_COLOUR("cyan")); - graphics.textboxoriginalcontextauto(); - graphics.textboxprintflags(PR_FONT_8X8); - incstate(); - music.playef(Sound_VIRIDIAN); + graphics.createtextbox("I'm glad you're ok!", 135, 152, 164, 164, 255); + state++; + music.playef(11); graphics.textboxactive(); break; case 106: @@ -2156,10 +1619,8 @@ void Game::updatestate(void) graphics.createtextbox("I've been trying to find a", 74, 70, 164, 255, 164); graphics.addline("way out, but I keep going"); graphics.addline("around in circles..."); - graphics.textboxoriginalcontextauto(); - graphics.textboxprintflags(PR_FONT_8X8); - incstate(); - music.playef(Sound_CRY); + state++; + music.playef(2); graphics.textboxactive(); int i = obj.getcompanion(); if (INBOUNDS_VEC(i, obj.entities)) @@ -2170,12 +1631,10 @@ void Game::updatestate(void) } break; case 108: - graphics.createtextbox("Don't worry! I have a", 125, 152, TEXT_COLOUR("cyan")); + graphics.createtextbox("Don't worry! I have a", 125, 152, 164, 164, 255); graphics.addline("teleporter key!"); - graphics.textboxoriginalcontextauto(); - graphics.textboxprintflags(PR_FONT_8X8); - incstate(); - music.playef(Sound_VIRIDIAN); + state++; + music.playef(11); graphics.textboxactive(); break; case 110: @@ -2187,11 +1646,9 @@ void Game::updatestate(void) obj.entities[i].tile = 0; obj.entities[i].state = 1; } - graphics.createtextbox("Follow me!", 185, 154, TEXT_COLOUR("cyan")); - graphics.textboxoriginalcontextauto(); - graphics.textboxprintflags(PR_FONT_8X8); - incstate(); - music.playef(Sound_VIRIDIAN); + graphics.createtextbox("Follow me!", 185, 154, 164, 164, 255); + state++; + music.playef(11); graphics.textboxactive(); } @@ -2201,7 +1658,7 @@ void Game::updatestate(void) hascontrol = true; advancetext = false; - setstate(0); + state = 0; break; case 115: @@ -2209,7 +1666,7 @@ void Game::updatestate(void) // Test script for space station, totally delete me! // hascontrol = false; - incstate(); + state++; break; case 116: advancetext = true; @@ -2217,17 +1674,15 @@ void Game::updatestate(void) graphics.createtextbox("Sorry Eurogamers! Teleporting around", 60 - 20, 200, 255, 64, 64); graphics.addline("the map doesn't work in this version!"); - graphics.textboxoriginalcontextauto(); - graphics.textboxprintflags(PR_FONT_8X8); graphics.textboxcenterx(); - incstate(); + state++; break; case 118: graphics.textboxremove(); hascontrol = true; advancetext = false; - setstate(0); + state = 0; break; case 120: @@ -2238,7 +1693,7 @@ void Game::updatestate(void) if (!obj.flags[5]) { obj.flags[5] = true; - incstate(); + state++; } break; case 121: @@ -2249,11 +1704,11 @@ void Game::updatestate(void) if (INBOUNDS_VEC(i, obj.entities) && obj.entities[i].onground > 0 && gravitycontrol == 0) { gravitycontrol = 1; - music.playef(Sound_UNFLIP); + music.playef(1); } if (INBOUNDS_VEC(i, obj.entities) && obj.entities[i].onroof > 0) { - incstate(); + state++; } } @@ -2271,49 +1726,39 @@ void Game::updatestate(void) advancetext = true; hascontrol = false; - graphics.createtextbox("Captain! You're ok!", 60-10, 90-40, TEXT_COLOUR("yellow")); - graphics.textboxoriginalcontextauto(); - graphics.textboxprintflags(PR_FONT_8X8); - incstate(); - music.playef(Sound_VITELLARY); + graphics.createtextbox("Captain! You're ok!", 60-10, 90-40, 255, 255, 134); + state++; + music.playef(14); break; } case 124: { - graphics.createtextbox("I've found a teleporter, but", 60-20, 90 - 40, TEXT_COLOUR("yellow")); + graphics.createtextbox("I've found a teleporter, but", 60-20, 90 - 40, 255, 255, 134); graphics.addline("I can't get it to go anywhere..."); - graphics.textboxoriginalcontextauto(); - graphics.textboxprintflags(PR_FONT_8X8); - incstate(); - music.playef(Sound_CRY); + state++; + music.playef(2); graphics.textboxactive(); break; } case 126: - graphics.createtextbox("I can help with that!", 125, 152-40, TEXT_COLOUR("cyan")); - graphics.textboxoriginalcontextauto(); - graphics.textboxprintflags(PR_FONT_8X8); - incstate(); - music.playef(Sound_VIRIDIAN); + graphics.createtextbox("I can help with that!", 125, 152-40, 164, 164, 255); + state++; + music.playef(11); graphics.textboxactive(); break; case 128: - graphics.createtextbox("I have the teleporter", 130, 152-35, TEXT_COLOUR("cyan")); + graphics.createtextbox("I have the teleporter", 130, 152-35, 164, 164, 255); graphics.addline("codex for our ship!"); - graphics.textboxoriginalcontextauto(); - graphics.textboxprintflags(PR_FONT_8X8); - incstate(); - music.playef(Sound_VIRIDIAN); + state++; + music.playef(11); graphics.textboxactive(); break; case 130: { - graphics.createtextbox("Yey! Let's go home!", 60-30, 90-35, TEXT_COLOUR("yellow")); - graphics.textboxoriginalcontextauto(); - graphics.textboxprintflags(PR_FONT_8X8); - incstate(); - music.playef(Sound_VITELLARY); + graphics.createtextbox("Yey! Let's go home!", 60-30, 90-35, 255, 255, 134); + state++; + music.playef(14); graphics.textboxactive(); int i = obj.getcompanion(); if (INBOUNDS_VEC(i, obj.entities)) @@ -2328,13 +1773,13 @@ void Game::updatestate(void) hascontrol = true; advancetext = false; - setstate(0); + state = 0; break; case 200: //Init final stretch - incstate(); - music.playef(Sound_FLASH); + state++; + music.playef(9); obj.flags[72] = true; screenshake = 10; @@ -2349,7 +1794,7 @@ void Game::updatestate(void) startscript = true; newscript="finalterminal_finish"; - setstate(0); + state = 0; break; @@ -2394,38 +1839,43 @@ void Game::updatestate(void) startscript = true; newscript="custom_"+customscript[state - 300]; obj.removetrigger(state); - setstate(0); + state = 0; break; case 1000: graphics.showcutscenebars = true; hascontrol = false; completestop = true; - incstate(); - setstatedelay(15); + state++; + statedelay = 15; break; case 1001: //Found a trinket! advancetext = true; - incstate(); - graphics.createtextboxflipme("", 50, 85, TEXT_COLOUR("gray")); - graphics.textboxprintflags(PR_FONT_INTERFACE); + state++; + graphics.createtextboxflipme(" Congratulations! ", 50, 85, 174, 174, 174); + graphics.addline(""); + graphics.addline("You have found a shiny trinket!"); graphics.textboxcenterx(); - graphics.textboxtranslate(TEXTTRANSLATE_FUNCTION, foundtrinket_textbox1); - graphics.textboxapplyposition(); - graphics.createtextboxflipme("", 50, 95, TEXT_COLOUR("gray")); - graphics.textboxprintflags(PR_FONT_INTERFACE); - graphics.textboxcenterx(); - graphics.textboxindex(graphics.textboxes.size() - 2); - graphics.textboxtranslate(TEXTTRANSLATE_FUNCTION, foundtrinket_textbox2); - graphics.textboxapplyposition(); +#if !defined(NO_CUSTOM_LEVELS) + if(map.custommode) + { + graphics.createtextboxflipme(" " + help.number(trinkets()) + " out of " + help.number(ed.numtrinkets())+ " ", 50, 135, 174, 174, 174); + graphics.textboxcenterx(); + } + else +#endif + { + graphics.createtextboxflipme(" " + help.number(trinkets()) + " out of Twenty ", 50, 135, 174, 174, 174); + graphics.textboxcenterx(); + } break; case 1002: if (!advancetext) { // Prevent softlocks if we somehow don't have advancetext - incstate(); + state++; } break; case 1003: @@ -2433,11 +1883,8 @@ void Game::updatestate(void) hascontrol = true; advancetext = false; completestop = false; - setstate(0); - if (music.currentsong > -1) - { - music.fadeMusicVolumeIn(3000); - } + state = 0; + if(!muted && music.currentsong>-1) music.fadeMusicVolumeIn(3000); graphics.showcutscenebars = false; break; @@ -2445,31 +1892,38 @@ void Game::updatestate(void) graphics.showcutscenebars = true; hascontrol = false; completestop = true; - incstate(); - setstatedelay(15); + state++; + statedelay = 15; break; +#if !defined(NO_CUSTOM_LEVELS) case 1011: //Found a crewmate! advancetext = true; - incstate(); - graphics.createtextboxflipme("", 50, 85, TEXT_COLOUR("gray")); - graphics.textboxprintflags(PR_FONT_INTERFACE); + state++; + graphics.createtextboxflipme(" Congratulations! ", 50, 85, 174, 174, 174); + graphics.addline(""); + graphics.addline("You have found a lost crewmate!"); graphics.textboxcenterx(); - graphics.textboxtranslate(TEXTTRANSLATE_FUNCTION, foundcrewmate_textbox1); - graphics.textboxapplyposition(); - graphics.createtextboxflipme("", 50, 95, TEXT_COLOUR("gray")); - graphics.textboxprintflags(PR_FONT_INTERFACE); + if(ed.numcrewmates()-crewmates()==0) + { + graphics.createtextboxflipme(" All crewmates rescued! ", 50, 135, 174, 174, 174); + } + else if(ed.numcrewmates()-crewmates()==1) + { + graphics.createtextboxflipme(" " + help.number(ed.numcrewmates()-crewmates())+ " remains ", 50, 135, 174, 174, 174); + } + else + { + graphics.createtextboxflipme(" " + help.number(ed.numcrewmates()-crewmates())+ " remain ", 50, 135, 174, 174, 174); + } graphics.textboxcenterx(); - graphics.textboxindex(graphics.textboxes.size() - 2); - graphics.textboxtranslate(TEXTTRANSLATE_FUNCTION, foundcrewmate_textbox2); - graphics.textboxapplyposition(); break; case 1012: if (!advancetext) { // Prevent softlocks if we somehow don't have advancetext - incstate(); + state++; } break; case 1013: @@ -2477,46 +1931,42 @@ void Game::updatestate(void) hascontrol = true; advancetext = false; completestop = false; - setstate(0); + state = 0; - if(cl.numcrewmates()-crewmates()==0) + if(ed.numcrewmates()-crewmates()==0) { if(map.custommodeforreal) { - graphics.fademode = FADE_START_FADEOUT; - setstate(1014); + graphics.fademode = 2; + if(!muted && ed.levmusic>0) music.fadeMusicVolumeIn(3000); + if(ed.levmusic>0) music.fadeout(); + state=1014; } else { returntoeditor(); - ed.show_note(loc::gettext("Level completed")); + if(!muted && ed.levmusic>0) music.fadeMusicVolumeIn(3000); + if(ed.levmusic>0) music.fadeout(); } } else { - if (cl.levmusic > 0) - { - music.fadeMusicVolumeIn(3000); - } + if(!muted && ed.levmusic>0) music.fadeMusicVolumeIn(3000); } graphics.showcutscenebars = false; break; +#endif case 1014: frames--; - if (graphics.fademode == FADE_FULLY_BLACK) - { - incstate(); - } + if(graphics.fademode == 1) state++; break; case 1015: +#if !defined(NO_CUSTOM_LEVELS) //Update level stats - /* FIXME: Have to add check to not save stats for the dumb hack - * `special/stdin.vvvvvv` filename... see elsewhere, grep for - * `special/stdin`! */ - if(cl.numcrewmates()-crewmates()==0 && customlevelfilename != "levels/special/stdin.vvvvvv") + if(ed.numcrewmates()-crewmates()==0) { //Finished level - if (trinkets() >= cl.numtrinkets()) + if (trinkets() >= ed.numtrinkets()) { //and got all the trinkets! updatecustomlevelstats(customlevelfilename, 3); @@ -2526,48 +1976,48 @@ void Game::updatestate(void) updatecustomlevelstats(customlevelfilename, 1); } } - +#endif quittomenu(); - music.play(Music_PRESENTINGVVVVVV); //should be after quittomenu() - setstate(0); + music.play(6); //should be after quittomenu() + state = 0; break; case 2000: //Game Saved! savetele_textbox(); - setstate(0); + state = 0; break; case 2500: - music.play(Music_PAUSE); + music.play(5); //Activating a teleporter (appear) - incstate(); - setstatedelay(15); + state++; + statedelay = 15; flashlight = 5; screenshake = 90; - music.playef(Sound_FLASH); + music.playef(9); break; case 2501: //Activating a teleporter 2 - incstate(); - setstatedelay(0); + state++; + statedelay = 0; flashlight = 5; screenshake = 0; //we're done here! - music.playef(Sound_TELEPORT); + music.playef(10); break; case 2502: { //Activating a teleporter 2 - incstate(); - setstatedelay(5); + state++; + statedelay = 5; int i = obj.getplayer(); if (INBOUNDS_VEC(i, obj.entities)) { - obj.entities[i].colour = EntityColour_CREW_CYAN; + obj.entities[i].colour = 0; obj.entities[i].invis = false; int j = obj.getteleporter(); @@ -2588,13 +2038,13 @@ void Game::updatestate(void) if (INBOUNDS_VEC(i, obj.entities)) { obj.entities[i].tile = 1; - obj.entities[i].colour = EntityColour_TELEPORTER_ACTIVE; + obj.entities[i].colour = 101; } break; } case 2503: { - incstate(); + state++; int i = obj.getplayer(); if (INBOUNDS_VEC(i, obj.entities)) { @@ -2604,7 +2054,7 @@ void Game::updatestate(void) } case 2504: { - incstate(); + state++; int i = obj.getplayer(); if (INBOUNDS_VEC(i, obj.entities)) { @@ -2614,7 +2064,7 @@ void Game::updatestate(void) } case 2505: { - incstate(); + state++; int i = obj.getplayer(); if (INBOUNDS_VEC(i, obj.entities)) { @@ -2624,7 +2074,7 @@ void Game::updatestate(void) } case 2506: { - incstate(); + state++; int i = obj.getplayer(); if (INBOUNDS_VEC(i, obj.entities)) { @@ -2634,12 +2084,12 @@ void Game::updatestate(void) } case 2507: { - incstate(); + state++; break; } case 2508: { - incstate(); + state++; int i = obj.getplayer(); if (INBOUNDS_VEC(i, obj.entities)) { @@ -2649,8 +2099,8 @@ void Game::updatestate(void) } case 2509: { - incstate(); - setstatedelay(15); + state++; + statedelay = 15; int i = obj.getplayer(); if (INBOUNDS_VEC(i, obj.entities)) { @@ -2661,21 +2111,17 @@ void Game::updatestate(void) case 2510: advancetext = true; hascontrol = false; - graphics.createtextbox("Hello?", 125+24, 152-20, TEXT_COLOUR("cyan")); - graphics.textboxoriginalcontextauto(); - graphics.textboxprintflags(PR_FONT_8X8); - incstate(); - music.playef(Sound_VIRIDIAN); + graphics.createtextbox("Hello?", 125+24, 152-20, 164, 164, 255); + state++; + music.playef(11); graphics.textboxactive(); break; case 2512: advancetext = true; hascontrol = false; - graphics.createtextbox("Is anyone there?", 125+8, 152-24, TEXT_COLOUR("cyan")); - graphics.textboxoriginalcontextauto(); - graphics.textboxprintflags(PR_FONT_8X8); - incstate(); - music.playef(Sound_VIRIDIAN); + graphics.createtextbox("Is anyone there?", 125+8, 152-24, 164, 164, 255); + state++; + music.playef(11); graphics.textboxactive(); break; case 2514: @@ -2683,85 +2129,80 @@ void Game::updatestate(void) hascontrol = true; advancetext = false; - setstate(0); - music.play(Music_POTENTIALFORANYTHING); + state = 0; + music.play(3); break; case 3000: //Activating a teleporter (long version for level complete) - incstate(); - setstatedelay(30); + state++; + statedelay = 30; flashlight = 5; screenshake = 90; - music.playef(Sound_FLASH); + music.playef(9); break; case 3001: //Activating a teleporter 2 - incstate(); - setstatedelay(15); + state++; + statedelay = 15; flashlight = 5; - music.playef(Sound_FLASH); + music.playef(9); break; case 3002: //Activating a teleporter 2 - incstate(); - setstatedelay(15); + state++; + statedelay = 15; flashlight = 5; - music.playef(Sound_FLASH); + music.playef(9); break; case 3003: //Activating a teleporter 2 - incstate(); - setstatedelay(15); + state++; + statedelay = 15; flashlight = 5; - music.playef(Sound_FLASH); + music.playef(9); break; case 3004: //Activating a teleporter 2 - incstate(); - setstatedelay(0); + state++; + statedelay = 0; flashlight = 5; screenshake = 0; //we're done here! - music.playef(Sound_TELEPORT); + music.playef(10); break; case 3005: { //Activating a teleporter 2 - incstate(); - setstatedelay(50); + state++; + statedelay = 50; switch(companion) { case 6: - setstate(3006); + state = 3006; break; //Warp Zone case 7: - setstate(3020); + state = 3020; break; //Space Station case 8: - setstate(3040); + state = 3040; break; //Lab case 9: - setstate(3060); + state = 3060; break; //Tower case 10: - setstate(3080); + state = 3080; break; //Intermission 2 case 11: - setstate(3085); + state = 3085; break; //Intermission 1 } - if (translator_exploring_allowtele) - { - setstate(3090); - } - int i = obj.getplayer(); if (INBOUNDS_VEC(i, obj.entities)) { - obj.entities[i].colour = EntityColour_CREW_CYAN; + obj.entities[i].colour = 0; obj.entities[i].invis = true; } @@ -2775,180 +2216,180 @@ void Game::updatestate(void) if (INBOUNDS_VEC(i, obj.entities)) { obj.entities[i].tile = 1; - obj.entities[i].colour = EntityColour_TELEPORTER_INACTIVE; + obj.entities[i].colour = 100; } break; } case 3006: //Level complete! (warp zone) - unlocknum(Unlock_WARPZONE_COMPLETE); + unlocknum(4); lastsaved = 4; - music.play(Music_PATHCOMPLETE); - incstate(); - setstatedelay(75); + music.play(0); + state++; + statedelay = 75; levelcomplete_textbox(); break; case 3007: - incstate(); - setstatedelay(45); + state++; + statedelay = 45; - crewmate_textbox(13); + crewmate_textbox(175, 174, 174); break; case 3008: - incstate(); - setstatedelay(45); + state++; + statedelay = 45; remaining_textbox(); break; case 3009: - incstate(); - setstatedelay(0); + state++; + statedelay = 0; actionprompt_textbox(); break; case 3010: if (jumppressed) { - incstate(); - setstatedelay(30); + state++; + statedelay = 30; graphics.textboxremove(); } break; case 3011: - setstate(3070); - setstatedelay(0); + state = 3070; + statedelay = 0; break; case 3020: //Level complete! (Space Station 2) - unlocknum(Unlock_SPACESTATION2_COMPLETE); + unlocknum(3); lastsaved = 2; - music.play(Music_PATHCOMPLETE); - incstate(); - setstatedelay(75); + music.play(0); + state++; + statedelay = 75; levelcomplete_textbox(); break; case 3021: - incstate(); - setstatedelay(45); + state++; + statedelay = 45; - crewmate_textbox(14); + crewmate_textbox(174, 175, 174); break; case 3022: - incstate(); - setstatedelay(45); + state++; + statedelay = 45; remaining_textbox(); break; case 3023: - incstate(); - setstatedelay(0); + state++; + statedelay = 0; actionprompt_textbox(); break; case 3024: if (jumppressed) { - incstate(); - setstatedelay(30); + state++; + statedelay = 30; graphics.textboxremove(); } break; case 3025: - setstate(3070); - setstatedelay(0); + state = 3070; + statedelay = 0; break; case 3040: //Level complete! (Lab) - unlocknum(Unlock_LABORATORY_COMPLETE); + unlocknum(1); lastsaved = 5; - music.play(Music_PATHCOMPLETE); - incstate(); - setstatedelay(75); + music.play(0); + state++; + statedelay = 75; levelcomplete_textbox(); break; case 3041: - incstate(); - setstatedelay(45); + state++; + statedelay = 45; - crewmate_textbox(16); + crewmate_textbox(174, 174, 175); break; case 3042: - incstate(); - setstatedelay(45); + state++; + statedelay = 45; remaining_textbox(); break; case 3043: - incstate(); - setstatedelay(0); + state++; + statedelay = 0; actionprompt_textbox(); break; case 3044: if (jumppressed) { - incstate(); - setstatedelay(30); + state++; + statedelay = 30; graphics.textboxremove(); } break; case 3045: - setstate(3070); - setstatedelay(0); + state = 3070; + statedelay = 0; break; case 3050: //Level complete! (Space Station 1) - unlocknum(Unlock_SPACESTATION1_COMPLETE); + unlocknum(0); lastsaved = 1; - music.play(Music_PATHCOMPLETE); - incstate(); - setstatedelay(75); + music.play(0); + state++; + statedelay = 75; levelcomplete_textbox(); break; case 3051: - incstate(); - setstatedelay(45); + state++; + statedelay = 45; - crewmate_textbox(20); + crewmate_textbox(175, 175, 174); break; case 3052: - incstate(); - setstatedelay(45); + state++; + statedelay = 45; remaining_textbox(); break; case 3053: - incstate(); - setstatedelay(0); + state++; + statedelay = 0; actionprompt_textbox(); break; case 3054: if (jumppressed) { - incstate(); - setstatedelay(30); + state++; + statedelay = 30; graphics.textboxremove(); teleportscript = ""; } break; case 3055: - graphics.fademode = FADE_START_FADEOUT; - incstate(); - setstatedelay(10); + graphics.fademode = 2; + state++; + statedelay = 10; break; case 3056: - if (graphics.fademode == FADE_FULLY_BLACK) + if(graphics.fademode==1) { startscript = true; if (crewrescued() == 6) @@ -2966,62 +2407,59 @@ void Game::updatestate(void) newscript = "bigopenworld"; } } - setstate(0); + state = 0; } break; case 3060: //Level complete! (Tower) - unlocknum(Unlock_TOWER_COMPLETE); + unlocknum(2); lastsaved = 3; - music.play(Music_PATHCOMPLETE); - incstate(); - setstatedelay(75); + music.play(0); + state++; + statedelay = 75; levelcomplete_textbox(); break; case 3061: - incstate(); - setstatedelay(45); + state++; + statedelay = 45; - crewmate_textbox(15); + crewmate_textbox(175, 174, 175); break; case 3062: - incstate(); - setstatedelay(45); + state++; + statedelay = 45; remaining_textbox(); break; case 3063: - incstate(); - setstatedelay(0); + state++; + statedelay = 0; actionprompt_textbox(); break; case 3064: if (jumppressed) { - incstate(); - setstatedelay(30); + state++; + statedelay = 30; graphics.textboxremove(); } break; case 3065: - setstate(3070); - setstatedelay(0); + state = 3070; + statedelay = 0; break; case 3070: - graphics.fademode = FADE_START_FADEOUT; - incstate(); + graphics.fademode = 2; + state++; break; case 3071: - if (graphics.fademode == FADE_FULLY_BLACK) - { - incstate(); - } + if (graphics.fademode == 1) state++; break; case 3072: //Ok, we need to adjust some flags based on who've we've rescued. Some of there conversation options @@ -3056,7 +2494,7 @@ void Game::updatestate(void) { startscript = true; newscript="startlevel_final"; - setstate(0); + state = 0; } else if (crewrescued() == 4) { @@ -3071,7 +2509,7 @@ void Game::updatestate(void) if (lastsaved == 3) obj.flags[35] = true; if (lastsaved == 4) obj.flags[34] = true; if (lastsaved == 5) obj.flags[33] = true; - setstate(0); + state = 0; } else if (crewrescued() == 5) { @@ -3082,13 +2520,13 @@ void Game::updatestate(void) if (lastsaved == 3) obj.flags[35] = true; if (lastsaved == 4) obj.flags[34] = true; if (lastsaved == 5) obj.flags[33] = true; - setstate(0); + state = 0; } else { startscript = true; newscript="regularreturn"; - setstate(0); + state = 0; } break; @@ -3096,29 +2534,26 @@ void Game::updatestate(void) //returning from an intermission, very like 3070 if (inintermission) { - graphics.fademode = FADE_START_FADEOUT; + graphics.fademode = 2; companion = 0; - setstate(3100); + state=3100; } else { - unlocknum(Unlock_INTERMISSION2_COMPLETE); - graphics.fademode = FADE_START_FADEOUT; + unlocknum(7); + graphics.fademode = 2; companion = 0; - incstate(); + state++; } break; case 3081: - if (graphics.fademode == FADE_FULLY_BLACK) - { - incstate(); - } + if (graphics.fademode == 1) state++; break; case 3082: map.finalmode = false; startscript = true; newscript="regularreturn"; - setstate(0); + state = 0; break; case 3085: @@ -3128,178 +2563,122 @@ void Game::updatestate(void) { companion = 0; supercrewmate = false; - incstate(); - graphics.fademode = FADE_START_FADEOUT; + state++; + graphics.fademode = 2; music.fadeout(); - setstate(3100); + state=3100; } else { - unlocknum(Unlock_INTERMISSION1_COMPLETE); - graphics.fademode = FADE_START_FADEOUT; + unlocknum(6); + graphics.fademode = 2; companion = 0; supercrewmate = false; - incstate(); + state++; } break; case 3086: - if (graphics.fademode == FADE_FULLY_BLACK) - { - incstate(); - } + if (graphics.fademode == 1) state++; break; case 3087: map.finalmode = false; startscript = true; newscript="regularreturn"; - setstate(0); - break; - - case 3090: - /* Teleporting in translator_exploring should be just like - * the intermission replays: simply return to the menu */ - companion = 0; - supercrewmate = false; - graphics.fademode = FADE_START_FADEOUT; - music.fadeout(); - setstate(3100); - break; - case 3091: - /* Different Final Level ending for translator_exploring */ - music.fadeout(); - incstate(); - setstatedelay(60); - break; - case 3092: - graphics.fademode = FADE_START_FADEOUT; - setstate(3100); + state = 0; break; case 3100: - if (graphics.fademode == FADE_FULLY_BLACK) - { - incstate(); - } + if(graphics.fademode == 1) state++; break; case 3101: quittomenu(); - music.play(Music_PRESENTINGVVVVVV); //should be after quittomenu(); - setstate(0); + music.play(6); //should be after quittomenu(); + state = 0; break; case 3500: music.fadeout(); - incstate(); - setstatedelay(120); + state++; + statedelay = 120; break; case 3501: //Game complete! unlockAchievement("vvvvvvgamecomplete"); - unlocknum(UnlockTrophy_GAME_COMPLETE); + unlocknum(5); crewstats[0] = true; - incstate(); - setstatedelay(75); - music.play(Music_PLENARY); + state++; + statedelay = 75; + music.play(7); - graphics.createtextboxflipme("", -1, 12, TEXT_COLOUR("cyan")); - graphics.addline(" "); + graphics.createtextboxflipme("", -1, 12, 164, 165, 255); + graphics.addline(" "); graphics.addline(""); graphics.addline(""); - graphics.textboxoriginalcontextauto(); - graphics.textboxprintflags(PR_FONT_8X8); graphics.textboxcenterx(); - graphics.setimage(TEXTIMAGE_GAMECOMPLETE); - graphics.setlinegap(0); - graphics.textboxapplyposition(); break; case 3502: - incstate(); - setstatedelay(45+15); + state++; + statedelay = 45+15; - graphics.createtextboxflipme("", -1, 64, TEXT_COLOUR("transparent")); - graphics.textboxprintflags(PR_FONT_INTERFACE); - graphics.textboxcenterx(); - graphics.textboxtranslate(TEXTTRANSLATE_FUNCTION, gamecomplete_textbox2); - graphics.textboxapplyposition(); - saveframes = frames; - saveseconds = help.hms_to_seconds(hours, minutes, seconds); + graphics.createtextboxflipme(" All Crew Members Rescued! ", -1, 64, 0, 0, 0); + savetime = timestring(); + savetime += "." + help.twodigits(frames*100 / 30); break; case 3503: - incstate(); - setstatedelay(45); + { + state++; + statedelay = 45; - graphics.createtextboxflipme("", 170, 84, TEXT_COLOUR("transparent")); - graphics.textboxprintflags(PR_FONT_INTERFACE | PR_RTL_XFLIP); - graphics.textboxtranslate(TEXTTRANSLATE_FUNCTION, gamecomplete_textbox3); - graphics.textboxapplyposition(); - graphics.createtextboxflipme("", 180, 84, TEXT_COLOUR("transparent")); - graphics.textboxprintflags(PR_FONT_INTERFACE | PR_RTL_XFLIP); - graphics.textboxtranslate(TEXTTRANSLATE_FUNCTION, gamecomplete_textbox4); - graphics.textboxapplyposition(); + std::string tempstring = help.number(trinkets()); + graphics.createtextboxflipme("Trinkets Found:", 48, 84, 0,0,0); + graphics.createtextboxflipme(tempstring, 180, 84, 0, 0, 0); break; + } case 3504: - incstate(); - setstatedelay(45+15); + { + state++; + statedelay = 45+15; - graphics.createtextboxflipme("", 170, 96, TEXT_COLOUR("transparent")); - graphics.textboxprintflags(PR_FONT_INTERFACE | PR_RTL_XFLIP); - graphics.textboxtranslate(TEXTTRANSLATE_FUNCTION, gamecomplete_textbox5); - graphics.textboxapplyposition(); - graphics.createtextboxflipme("", 180, 96, TEXT_COLOUR("transparent")); - graphics.textboxprintflags(PR_FONT_INTERFACE | PR_RTL_XFLIP); - graphics.textboxtranslate(TEXTTRANSLATE_FUNCTION, gamecomplete_textbox6); - graphics.textboxapplyposition(); + std::string tempstring = savetime; + graphics.createtextboxflipme(" Game Time:", 64, 96, 0,0,0); + graphics.createtextboxflipme(tempstring, 180, 96, 0, 0, 0); break; + } case 3505: - incstate(); - setstatedelay(45); + state++; + statedelay = 45; - graphics.createtextboxflipme("", 170, 123, TEXT_COLOUR("transparent")); - graphics.textboxprintflags(PR_FONT_INTERFACE | PR_RTL_XFLIP); - graphics.textboxtranslate(TEXTTRANSLATE_FUNCTION, gamecomplete_textbox7); - graphics.textboxapplyposition(); - graphics.createtextboxflipme(help.String(totalflips), 180, 123, TEXT_COLOUR("transparent")); - graphics.textboxoriginalcontextauto(); - graphics.textboxprintflags(PR_FONT_INTERFACE | PR_RTL_XFLIP); + graphics.createtextboxflipme(" Total Flips:", 64, 123, 0,0,0); + graphics.createtextboxflipme(help.String(totalflips), 180, 123, 0, 0, 0); break; case 3506: - incstate(); - setstatedelay(45+15); + state++; + statedelay = 45+15; - graphics.createtextboxflipme("", 170, 135, TEXT_COLOUR("transparent")); - graphics.textboxprintflags(PR_FONT_INTERFACE | PR_RTL_XFLIP); - graphics.textboxtranslate(TEXTTRANSLATE_FUNCTION, gamecomplete_textbox9); - graphics.textboxapplyposition(); - graphics.createtextboxflipme(help.String(deathcounts), 180, 135, TEXT_COLOUR("transparent")); - graphics.textboxoriginalcontextauto(); - graphics.textboxprintflags(PR_FONT_INTERFACE | PR_RTL_XFLIP); + graphics.createtextboxflipme("Total Deaths:", 64, 135, 0,0,0); + graphics.createtextboxflipme(help.String(deathcounts), 180, 135, 0, 0, 0); break; case 3507: - incstate(); - setstatedelay(45+15); + { + state++; + statedelay = 45+15; - graphics.createtextboxflipme("", -1, 158, TEXT_COLOUR("transparent")); - graphics.textboxprintflags(PR_FONT_INTERFACE); - graphics.textboxcenterx(); - graphics.textboxtranslate(TEXTTRANSLATE_FUNCTION, gamecomplete_textbox11); - graphics.textboxapplyposition(); - graphics.createtextboxflipme("", -1, 170, TEXT_COLOUR("transparent")); - graphics.textboxprintflags(PR_FONT_INTERFACE); - graphics.textboxcenterx(); - graphics.textboxtranslate(TEXTTRANSLATE_FUNCTION, gamecomplete_textbox12); - graphics.textboxapplyposition(); + std::string tempstring = "Hardest Room (with " + help.String(hardestroomdeaths) + " deaths)"; + graphics.createtextboxflipme(tempstring, -1, 158, 0,0,0); + graphics.createtextboxflipme(hardestroom, -1, 170, 0, 0, 0); break; + } case 3508: - incstate(); - setstatedelay(0); + state++; + statedelay = 0; actionprompt_textbox(); break; case 3509: if (jumppressed) { - incstate(); - setstatedelay(30); + state++; + statedelay = 30; graphics.textboxremove(); } break; @@ -3309,7 +2688,7 @@ void Game::updatestate(void) { //flip mode complete unlockAchievement("vvvvvvgamecompleteflip"); - unlocknum(UnlockTrophy_FLIPMODE_COMPLETE); + unlocknum(19); } #ifndef MAKEANDPLAY @@ -3344,24 +2723,20 @@ void Game::updatestate(void) } } - if (nodeathmode || nodeatheligible) - { - unlockAchievement("vvvvvvmaster"); //bloody hell - unlocknum(UnlockTrophy_NODEATHMODE_COMPLETE); - } + savestatsandsettings(); if (nodeathmode) { - setstate(3520); - setstatedelay(0); + unlockAchievement("vvvvvvmaster"); //bloody hell + unlocknum(20); + state = 3520; + statedelay = 0; } else { - setstatedelay(120); - incstate(); + statedelay = 120; + state++; } - - savestatsandsettings(); break; case 3511: { @@ -3369,79 +2744,78 @@ void Game::updatestate(void) int i = obj.getplayer(); if (INBOUNDS_VEC(i, obj.entities)) { - obj.entities[i].colour = EntityColour_TELEPORTER_FLASHING; + obj.entities[i].colour = 102; } - incstate(); - setstatedelay(30); + state++; + statedelay = 30; flashlight = 5; screenshake = 90; - music.playef(Sound_FLASH); + music.playef(9); break; } case 3512: //Activating a teleporter 2 - incstate(); - setstatedelay(15); + state++; + statedelay = 15; flashlight = 5; - music.playef(Sound_FLASH); + music.playef(9); break; case 3513: //Activating a teleporter 2 - incstate(); - setstatedelay(15); + state++; + statedelay = 15; flashlight = 5; - music.playef(Sound_FLASH); + music.playef(9); break; case 3514: //Activating a teleporter 2 - incstate(); - setstatedelay(15); + state++; + statedelay = 15; flashlight = 5; - music.playef(Sound_FLASH); + music.playef(9); break; case 3515: { //Activating a teleporter 2 - incstate(); - setstatedelay(0); + state++; + statedelay = 0; flashlight = 5; screenshake = 0; int i = obj.getplayer(); if (INBOUNDS_VEC(i, obj.entities)) { - obj.entities[i].colour = EntityColour_CREW_CYAN; + obj.entities[i].colour = 0; obj.entities[i].invis = true; } //we're done here! - music.playef(Sound_TELEPORT); - setstatedelay(60); + music.playef(10); + statedelay = 60; break; } case 3516: - graphics.fademode = FADE_START_FADEOUT; - incstate(); + graphics.fademode = 2; + state++; break; case 3517: - if (graphics.fademode == FADE_FULLY_BLACK) + if (graphics.fademode == 1) { - incstate(); - setstatedelay(30); + state++; + statedelay = 30; } break; case 3518: - graphics.fademode = FADE_START_FADEIN; - setstate(0); - setstatedelay(30); + graphics.fademode = 4; + state = 0; + statedelay = 30; map.finalmode = false; map.final_colormode = false; map.final_mapcol = 0; map.final_colorframe = 0; map.finalstretch = false; - obj.flags[72] = false; graphics.setbars(320); @@ -3454,29 +2828,26 @@ void Game::updatestate(void) hascontrol = false; crewstats[0] = true; - graphics.fademode = FADE_START_FADEOUT; - incstate(); + graphics.fademode = 2; + state++; break; case 3521: - if (graphics.fademode == FADE_FULLY_BLACK) - { - incstate(); - } + if(graphics.fademode == 1) state++; break; case 3522: copyndmresults(); quittomenu(); createmenu(Menu::nodeathmodecomplete); - setstate(0); + state = 0; break; case 4000: //Activating a teleporter (short version) - state++; // Increment manually -- gamestate modification might be locked at this point + state++; statedelay = 10; flashlight = 5; screenshake = 10; - music.playef(Sound_FLASH); + music.playef(9); break; case 4001: //Activating a teleporter 2 @@ -3485,7 +2856,7 @@ void Game::updatestate(void) flashlight = 5; screenshake = 0; //we're done here! - music.playef(Sound_TELEPORT); + music.playef(10); break; case 4002: { @@ -3496,7 +2867,7 @@ void Game::updatestate(void) int i = obj.getplayer(); if (INBOUNDS_VEC(i, obj.entities)) { - obj.entities[i].colour = EntityColour_CREW_CYAN; + obj.entities[i].colour = 0; obj.entities[i].invis = true; } @@ -3504,7 +2875,7 @@ void Game::updatestate(void) if(INBOUNDS_VEC(i, obj.entities)) { obj.entities[i].tile = 1; - obj.entities[i].colour = EntityColour_TELEPORTER_INACTIVE; + obj.entities[i].colour = 100; } break; } @@ -3512,30 +2883,29 @@ void Game::updatestate(void) state = 0; statedelay = 0; teleport_to_new_area = true; - unlockstate(); break; case 4010: //Activating a teleporter (default appear) - incstate(); - setstatedelay(15); + state++; + statedelay = 15; flashlight = 5; screenshake = 90; - music.playef(Sound_FLASH); + music.playef(9); break; case 4011: //Activating a teleporter 2 - incstate(); - setstatedelay(0); + state++; + statedelay = 0; flashlight = 5; screenshake = 0; - music.playef(Sound_TELEPORT); + music.playef(10); break; case 4012: { //Activating a teleporter 2 - incstate(); - setstatedelay(5); + state++; + statedelay = 5; int i = obj.getplayer(); int j = obj.getteleporter(); @@ -3548,9 +2918,9 @@ void Game::updatestate(void) obj.entities[i].lerpoldxp = obj.entities[i].xp; obj.entities[i].lerpoldyp = obj.entities[i].yp; obj.entities[j].tile = 2; - obj.entities[j].colour = EntityColour_TELEPORTER_ACTIVE; + obj.entities[j].colour = 101; } - obj.entities[i].colour = EntityColour_CREW_CYAN; + obj.entities[i].colour = 0; obj.entities[i].invis = false; obj.entities[i].dir = 1; @@ -3563,7 +2933,7 @@ void Game::updatestate(void) } case 4013: { - incstate(); + state++; int i = obj.getplayer(); if (INBOUNDS_VEC(i, obj.entities)) { @@ -3573,7 +2943,7 @@ void Game::updatestate(void) } case 4014: { - incstate(); + state++; int i = obj.getplayer(); if (INBOUNDS_VEC(i, obj.entities)) { @@ -3583,7 +2953,7 @@ void Game::updatestate(void) } case 4015: { - incstate(); + state++; int i = obj.getplayer(); if (INBOUNDS_VEC(i, obj.entities)) { @@ -3593,7 +2963,7 @@ void Game::updatestate(void) } case 4016: { - incstate(); + state++; int i = obj.getplayer(); if (INBOUNDS_VEC(i, obj.entities)) { @@ -3603,7 +2973,7 @@ void Game::updatestate(void) } case 4017: { - incstate(); + state++; int i = obj.getplayer(); if (INBOUNDS_VEC(i, obj.entities)) { @@ -3613,8 +2983,8 @@ void Game::updatestate(void) } case 4018: { - incstate(); - setstatedelay(15); + state++; + statedelay = 15; int i = obj.getplayer(); if (INBOUNDS_VEC(i, obj.entities)) { @@ -3642,31 +3012,31 @@ void Game::updatestate(void) teleblock.h = 160; hascontrol = true; advancetext = false; - setstate(0); + state = 0; break; } case 4020: //Activating a teleporter (default appear) - incstate(); - setstatedelay(15); + state++; + statedelay = 15; flashlight = 5; screenshake = 90; - music.playef(Sound_FLASH); + music.playef(9); break; case 4021: //Activating a teleporter 2 - incstate(); - setstatedelay(0); + state++; + statedelay = 0; flashlight = 5; screenshake = 0; - music.playef(Sound_TELEPORT); + music.playef(10); break; case 4022: { //Activating a teleporter 2 - incstate(); - setstatedelay(5); + state++; + statedelay = 5; int i = obj.getplayer(); int j = obj.getteleporter(); @@ -3679,9 +3049,9 @@ void Game::updatestate(void) obj.entities[i].lerpoldxp = obj.entities[i].xp; obj.entities[i].lerpoldyp = obj.entities[i].yp; obj.entities[j].tile = 2; - obj.entities[j].colour = EntityColour_TELEPORTER_ACTIVE; + obj.entities[j].colour = 101; } - obj.entities[i].colour = EntityColour_CREW_CYAN; + obj.entities[i].colour = 0; obj.entities[i].invis = false; obj.entities[i].dir = 1; @@ -3694,7 +3064,7 @@ void Game::updatestate(void) } case 4023: { - incstate(); + state++; int i = obj.getplayer(); if (INBOUNDS_VEC(i, obj.entities)) { @@ -3704,7 +3074,7 @@ void Game::updatestate(void) } case 4024: { - incstate(); + state++; int i = obj.getplayer(); if (INBOUNDS_VEC(i, obj.entities)) { @@ -3714,7 +3084,7 @@ void Game::updatestate(void) } case 4025: { - incstate(); + state++; int i = obj.getplayer(); if (INBOUNDS_VEC(i, obj.entities)) { @@ -3724,7 +3094,7 @@ void Game::updatestate(void) } case 4026: { - incstate(); + state++; int i = obj.getplayer(); if (INBOUNDS_VEC(i, obj.entities)) { @@ -3734,7 +3104,7 @@ void Game::updatestate(void) } case 4027: { - incstate(); + state++; int i = obj.getplayer(); if (INBOUNDS_VEC(i, obj.entities)) { @@ -3744,8 +3114,8 @@ void Game::updatestate(void) } case 4028: { - incstate(); - setstatedelay(15); + state++; + statedelay = 15; int i = obj.getplayer(); if (INBOUNDS_VEC(i, obj.entities)) { @@ -3756,30 +3126,30 @@ void Game::updatestate(void) case 4029: hascontrol = true; advancetext = false; - setstate(0); + state = 0; break; case 4030: //Activating a teleporter (default appear) - incstate(); - setstatedelay(15); + state++; + statedelay = 15; flashlight = 5; screenshake = 90; - music.playef(Sound_FLASH); + music.playef(9); break; case 4031: //Activating a teleporter 2 - incstate(); - setstatedelay(0); + state++; + statedelay = 0; flashlight = 5; screenshake = 0; - music.playef(Sound_TELEPORT); + music.playef(10); break; case 4032: { //Activating a teleporter 2 - incstate(); - setstatedelay(5); + state++; + statedelay = 5; int i = obj.getplayer(); int j = obj.getteleporter(); @@ -3792,9 +3162,9 @@ void Game::updatestate(void) obj.entities[i].lerpoldxp = obj.entities[i].xp; obj.entities[i].lerpoldyp = obj.entities[i].yp; obj.entities[j].tile = 2; - obj.entities[j].colour = EntityColour_TELEPORTER_ACTIVE; + obj.entities[j].colour = 101; } - obj.entities[i].colour = EntityColour_CREW_CYAN; + obj.entities[i].colour = 0; obj.entities[i].invis = false; obj.entities[i].dir = 0; @@ -3807,7 +3177,7 @@ void Game::updatestate(void) } case 4033: { - incstate(); + state++; int i = obj.getplayer(); if (INBOUNDS_VEC(i, obj.entities)) { @@ -3817,7 +3187,7 @@ void Game::updatestate(void) } case 4034: { - incstate(); + state++; int i = obj.getplayer(); if (INBOUNDS_VEC(i, obj.entities)) { @@ -3827,7 +3197,7 @@ void Game::updatestate(void) } case 4035: { - incstate(); + state++; int i = obj.getplayer(); if (INBOUNDS_VEC(i, obj.entities)) { @@ -3837,7 +3207,7 @@ void Game::updatestate(void) } case 4036: { - incstate(); + state++; int i = obj.getplayer(); if (INBOUNDS_VEC(i, obj.entities)) { @@ -3847,7 +3217,7 @@ void Game::updatestate(void) } case 4037: { - incstate(); + state++; int i = obj.getplayer(); if (INBOUNDS_VEC(i, obj.entities)) { @@ -3857,8 +3227,8 @@ void Game::updatestate(void) } case 4038: { - incstate(); - setstatedelay(15); + state++; + statedelay = 15; int i = obj.getplayer(); if (INBOUNDS_VEC(i, obj.entities)) { @@ -3869,30 +3239,30 @@ void Game::updatestate(void) case 4039: hascontrol = true; advancetext = false; - setstate(0); + state = 0; break; case 4040: //Activating a teleporter (default appear) - incstate(); - setstatedelay(15); + state++; + statedelay = 15; flashlight = 5; screenshake = 90; - music.playef(Sound_FLASH); + music.playef(9); break; case 4041: //Activating a teleporter 2 - incstate(); - setstatedelay(0); + state++; + statedelay = 0; flashlight = 5; screenshake = 0; - music.playef(Sound_TELEPORT); + music.playef(10); break; case 4042: { //Activating a teleporter 2 - incstate(); - setstatedelay(5); + state++; + statedelay = 5; int i = obj.getplayer(); int j = obj.getteleporter(); @@ -3905,9 +3275,9 @@ void Game::updatestate(void) obj.entities[i].lerpoldxp = obj.entities[i].xp; obj.entities[i].lerpoldyp = obj.entities[i].yp; obj.entities[j].tile = 2; - obj.entities[j].colour = EntityColour_TELEPORTER_ACTIVE; + obj.entities[j].colour = 101; } - obj.entities[i].colour = EntityColour_CREW_CYAN; + obj.entities[i].colour = 0; obj.entities[i].invis = false; obj.entities[i].dir = 1; @@ -3920,7 +3290,7 @@ void Game::updatestate(void) } case 4043: { - incstate(); + state++; int i = obj.getplayer(); if (INBOUNDS_VEC(i, obj.entities)) { @@ -3931,7 +3301,7 @@ void Game::updatestate(void) } case 4044: { - incstate(); + state++; int i = obj.getplayer(); if (INBOUNDS_VEC(i, obj.entities)) { @@ -3942,7 +3312,7 @@ void Game::updatestate(void) } case 4045: { - incstate(); + state++; int i = obj.getplayer(); if (INBOUNDS_VEC(i, obj.entities)) { @@ -3953,7 +3323,7 @@ void Game::updatestate(void) } case 4046: { - incstate(); + state++; int i = obj.getplayer(); if (INBOUNDS_VEC(i, obj.entities)) { @@ -3964,7 +3334,7 @@ void Game::updatestate(void) } case 4047: { - incstate(); + state++; int i = obj.getplayer(); if (INBOUNDS_VEC(i, obj.entities)) { @@ -3975,8 +3345,8 @@ void Game::updatestate(void) } case 4048: { - incstate(); - setstatedelay(15); + state++; + statedelay = 15; int i = obj.getplayer(); if (INBOUNDS_VEC(i, obj.entities)) { @@ -3987,30 +3357,30 @@ void Game::updatestate(void) case 4049: hascontrol = true; advancetext = false; - setstate(0); + state = 0; break; case 4050: //Activating a teleporter (default appear) - incstate(); - setstatedelay(15); + state++; + statedelay = 15; flashlight = 5; screenshake = 90; - music.playef(Sound_FLASH); + music.playef(9); break; case 4051: //Activating a teleporter 2 - incstate(); - setstatedelay(0); + state++; + statedelay = 0; flashlight = 5; screenshake = 0; - music.playef(Sound_TELEPORT); + music.playef(10); break; case 4052: { //Activating a teleporter 2 - incstate(); - setstatedelay(5); + state++; + statedelay = 5; int i = obj.getplayer(); int j = obj.getteleporter(); @@ -4023,9 +3393,9 @@ void Game::updatestate(void) obj.entities[i].lerpoldxp = obj.entities[i].xp; obj.entities[i].lerpoldyp = obj.entities[i].yp; obj.entities[j].tile = 2; - obj.entities[j].colour = EntityColour_TELEPORTER_ACTIVE; + obj.entities[j].colour = 101; } - obj.entities[i].colour = EntityColour_CREW_CYAN; + obj.entities[i].colour = 0; obj.entities[i].invis = false; obj.entities[i].dir = 1; @@ -4038,7 +3408,7 @@ void Game::updatestate(void) } case 4053: { - incstate(); + state++; int i = obj.getplayer(); if (INBOUNDS_VEC(i, obj.entities)) { @@ -4049,7 +3419,7 @@ void Game::updatestate(void) } case 4054: { - incstate(); + state++; int i = obj.getplayer(); if (INBOUNDS_VEC(i, obj.entities)) { @@ -4060,7 +3430,7 @@ void Game::updatestate(void) } case 4055: { - incstate(); + state++; int i = obj.getplayer(); if (INBOUNDS_VEC(i, obj.entities)) { @@ -4071,7 +3441,7 @@ void Game::updatestate(void) } case 4056: { - incstate(); + state++; int i = obj.getplayer(); if (INBOUNDS_VEC(i, obj.entities)) { @@ -4082,7 +3452,7 @@ void Game::updatestate(void) } case 4057: { - incstate(); + state++; int i = obj.getplayer(); if (INBOUNDS_VEC(i, obj.entities)) { @@ -4093,8 +3463,8 @@ void Game::updatestate(void) } case 4058: { - incstate(); - setstatedelay(15); + state++; + statedelay = 15; int i = obj.getplayer(); if (INBOUNDS_VEC(i, obj.entities)) { @@ -4105,30 +3475,30 @@ void Game::updatestate(void) case 4059: hascontrol = true; advancetext = false; - setstate(0); + state = 0; break; case 4060: //Activating a teleporter (default appear) - incstate(); - setstatedelay(15); + state++; + statedelay = 15; flashlight = 5; screenshake = 90; - music.playef(Sound_FLASH); + music.playef(9); break; case 4061: //Activating a teleporter 2 - incstate(); - setstatedelay(0); + state++; + statedelay = 0; flashlight = 5; screenshake = 0; - music.playef(Sound_TELEPORT); + music.playef(10); break; case 4062: { //Activating a teleporter 2 - incstate(); - setstatedelay(5); + state++; + statedelay = 5; int i = obj.getplayer(); int j = obj.getteleporter(); @@ -4141,9 +3511,9 @@ void Game::updatestate(void) obj.entities[i].lerpoldxp = obj.entities[i].xp; obj.entities[i].lerpoldyp = obj.entities[i].yp; obj.entities[j].tile = 2; - obj.entities[j].colour = EntityColour_TELEPORTER_ACTIVE; + obj.entities[j].colour = 101; } - obj.entities[i].colour = EntityColour_CREW_CYAN; + obj.entities[i].colour = 0; obj.entities[i].invis = false; obj.entities[i].dir = 0; @@ -4156,7 +3526,7 @@ void Game::updatestate(void) } case 4063: { - incstate(); + state++; int i = obj.getplayer(); if (INBOUNDS_VEC(i, obj.entities)) { @@ -4167,7 +3537,7 @@ void Game::updatestate(void) } case 4064: { - incstate(); + state++; int i = obj.getplayer(); if (INBOUNDS_VEC(i, obj.entities)) { @@ -4178,7 +3548,7 @@ void Game::updatestate(void) } case 4065: { - incstate(); + state++; int i = obj.getplayer(); if (INBOUNDS_VEC(i, obj.entities)) { @@ -4188,7 +3558,7 @@ void Game::updatestate(void) } case 4066: { - incstate(); + state++; int i = obj.getplayer(); if (INBOUNDS_VEC(i, obj.entities)) { @@ -4198,7 +3568,7 @@ void Game::updatestate(void) } case 4067: { - incstate(); + state++; int i = obj.getplayer(); if (INBOUNDS_VEC(i, obj.entities)) { @@ -4208,8 +3578,8 @@ void Game::updatestate(void) } case 4068: { - incstate(); - setstatedelay(15); + state++; + statedelay = 15; int i = obj.getplayer(); if (INBOUNDS_VEC(i, obj.entities)) { @@ -4220,31 +3590,31 @@ void Game::updatestate(void) case 4069: hascontrol = true; advancetext = false; - setstate(0); + state = 0; break; case 4070: //Activating a teleporter (special for final script, player has colour changed to match rescued crewmate) - incstate(); - setstatedelay(15); + state++; + statedelay = 15; flashlight = 5; screenshake = 90; - music.playef(Sound_FLASH); + music.playef(9); break; case 4071: //Activating a teleporter 2 - incstate(); - setstatedelay(0); + state++; + statedelay = 0; flashlight = 5; screenshake = 0; - music.playef(Sound_TELEPORT); + music.playef(10); break; case 4072: { //Activating a teleporter 2 - incstate(); - setstatedelay(5); + state++; + statedelay = 5; int i = obj.getplayer(); int j = obj.getteleporter(); @@ -4257,11 +3627,11 @@ void Game::updatestate(void) obj.entities[i].lerpoldxp = obj.entities[i].xp; obj.entities[i].lerpoldyp = obj.entities[i].yp; obj.entities[j].tile = 2; - obj.entities[j].colour = EntityColour_TELEPORTER_ACTIVE; + obj.entities[j].colour = 101; } obj.entities[i].invis = false; obj.entities[i].dir = 1; - obj.entities[i].colour = graphics.crewcolour(lastsaved); + obj.entities[i].colour = obj.crewcolour(lastsaved); obj.entities[i].ay = -6; obj.entities[i].ax = 6; @@ -4272,7 +3642,7 @@ void Game::updatestate(void) } case 4073: { - incstate(); + state++; int i = obj.getplayer(); if (INBOUNDS_VEC(i, obj.entities)) { @@ -4282,7 +3652,7 @@ void Game::updatestate(void) } case 4074: { - incstate(); + state++; int i = obj.getplayer(); if (INBOUNDS_VEC(i, obj.entities)) { @@ -4292,7 +3662,7 @@ void Game::updatestate(void) } case 4075: { - incstate(); + state++; int i = obj.getplayer(); if (INBOUNDS_VEC(i, obj.entities)) { @@ -4302,7 +3672,7 @@ void Game::updatestate(void) } case 4076: { - incstate(); + state++; int i = obj.getplayer(); if (INBOUNDS_VEC(i, obj.entities)) { @@ -4312,7 +3682,7 @@ void Game::updatestate(void) } case 4077: { - incstate(); + state++; int i = obj.getplayer(); if (INBOUNDS_VEC(i, obj.entities)) { @@ -4322,8 +3692,8 @@ void Game::updatestate(void) } case 4078: { - incstate(); - setstatedelay(15); + state++; + statedelay = 15; int i = obj.getplayer(); if (INBOUNDS_VEC(i, obj.entities)) { @@ -4332,32 +3702,32 @@ void Game::updatestate(void) break; } case 4079: - setstate(0); + state = 0; startscript = true; newscript = "finallevel_teleporter"; break; case 4080: //Activating a teleporter (default appear) - incstate(); - setstatedelay(15); + state++; + statedelay = 15; flashlight = 5; screenshake = 90; - music.playef(Sound_FLASH); + music.playef(9); break; case 4081: //Activating a teleporter 2 - incstate(); - setstatedelay(0); + state++; + statedelay = 0; flashlight = 5; screenshake = 0; - music.playef(Sound_TELEPORT); + music.playef(10); break; case 4082: { //Activating a teleporter 2 - incstate(); - setstatedelay(5); + state++; + statedelay = 5; int i = obj.getplayer(); int j = obj.getteleporter(); @@ -4370,9 +3740,9 @@ void Game::updatestate(void) obj.entities[i].lerpoldxp = obj.entities[i].xp; obj.entities[i].lerpoldyp = obj.entities[i].yp; obj.entities[j].tile = 2; - obj.entities[j].colour = EntityColour_TELEPORTER_ACTIVE; + obj.entities[j].colour = 101; } - obj.entities[i].colour = EntityColour_CREW_CYAN; + obj.entities[i].colour = 0; obj.entities[i].invis = false; obj.entities[i].dir = 1; @@ -4385,7 +3755,7 @@ void Game::updatestate(void) } case 4083: { - incstate(); + state++; int i = obj.getplayer(); if (INBOUNDS_VEC(i, obj.entities)) { @@ -4395,7 +3765,7 @@ void Game::updatestate(void) } case 4084: { - incstate(); + state++; int i = obj.getplayer(); if (INBOUNDS_VEC(i, obj.entities)) { @@ -4405,7 +3775,7 @@ void Game::updatestate(void) } case 4085: { - incstate(); + state++; int i = obj.getplayer(); if (INBOUNDS_VEC(i, obj.entities)) { @@ -4415,7 +3785,7 @@ void Game::updatestate(void) } case 4086: { - incstate(); + state++; int i = obj.getplayer(); if (INBOUNDS_VEC(i, obj.entities)) { @@ -4425,7 +3795,7 @@ void Game::updatestate(void) } case 4087: { - incstate(); + state++; int i = obj.getplayer(); if (INBOUNDS_VEC(i, obj.entities)) { @@ -4435,8 +3805,8 @@ void Game::updatestate(void) } case 4088: { - incstate(); - setstatedelay(15); + state++; + statedelay = 15; int i = obj.getplayer(); if (INBOUNDS_VEC(i, obj.entities)) { @@ -4447,30 +3817,30 @@ void Game::updatestate(void) case 4089: startscript = true; newscript = "gamecomplete_ending"; - setstate(0); + state = 0; break; case 4090: //Activating a teleporter (default appear) - incstate(); - setstatedelay(15); + state++; + statedelay = 15; flashlight = 5; screenshake = 90; - music.playef(Sound_FLASH); + music.playef(9); break; case 4091: //Activating a teleporter 2 - incstate(); - setstatedelay(0); + state++; + statedelay = 0; flashlight = 5; screenshake = 0; - music.playef(Sound_TELEPORT); + music.playef(10); break; case 4092: { //Activating a teleporter 2 - incstate(); - setstatedelay(5); + state++; + statedelay = 5; int i = obj.getplayer(); int j = obj.getteleporter(); @@ -4483,9 +3853,9 @@ void Game::updatestate(void) obj.entities[i].lerpoldxp = obj.entities[i].xp; obj.entities[i].lerpoldyp = obj.entities[i].yp; obj.entities[j].tile = 2; - obj.entities[j].colour = EntityColour_TELEPORTER_ACTIVE; + obj.entities[j].colour = 101; } - obj.entities[i].colour = EntityColour_CREW_CYAN; + obj.entities[i].colour = 0; obj.entities[i].invis = false; obj.entities[i].dir = 1; @@ -4498,7 +3868,7 @@ void Game::updatestate(void) } case 4093: { - incstate(); + state++; int i = obj.getplayer(); if (INBOUNDS_VEC(i, obj.entities)) { @@ -4508,7 +3878,7 @@ void Game::updatestate(void) } case 4094: { - incstate(); + state++; int i = obj.getplayer(); if (INBOUNDS_VEC(i, obj.entities)) { @@ -4518,7 +3888,7 @@ void Game::updatestate(void) } case 4095: { - incstate(); + state++; int i = obj.getplayer(); if (INBOUNDS_VEC(i, obj.entities)) { @@ -4528,7 +3898,7 @@ void Game::updatestate(void) } case 4096: { - incstate(); + state++; int i = obj.getplayer(); if (INBOUNDS_VEC(i, obj.entities)) { @@ -4538,7 +3908,7 @@ void Game::updatestate(void) } case 4097: { - incstate(); + state++; int i = obj.getplayer(); if (INBOUNDS_VEC(i, obj.entities)) { @@ -4548,8 +3918,8 @@ void Game::updatestate(void) } case 4098: { - incstate(); - setstatedelay(15); + state++; + statedelay = 15; int i = obj.getplayer(); if (INBOUNDS_VEC(i, obj.entities)) { @@ -4568,7 +3938,7 @@ void Game::updatestate(void) startscript = true; newscript = "levelonecomplete_ending"; } - setstate(0); + state = 0; break; } } @@ -4579,20 +3949,33 @@ void Game::gethardestroom(void) if (currentroomdeaths > hardestroomdeaths) { hardestroomdeaths = currentroomdeaths; - - hardestroom_x = roomx; - hardestroom_y = roomy; - hardestroom_finalstretch = map.finalstretch; - - if (map.roomname[0] == '\0') + hardestroom = map.roomname; + if (map.roomname == "glitch") + { + if (roomx == 42 && roomy == 51) + { + hardestroom = "Rear Vindow"; + } + else if (roomx == 48 && roomy == 51) + { + hardestroom = "On the Vaterfront"; + } + else if (roomx == 49 && roomy == 51) + { + hardestroom = "The Untouchavles"; + } + } + else if (map.roomname == "change") + { + if (roomx == 45 && roomy == 51) hardestroom =map.specialnames[3]; + if (roomx == 46 && roomy == 51) hardestroom =map.specialnames[4]; + if (roomx == 47 && roomy == 51) hardestroom =map.specialnames[5]; + if (roomx == 50 && roomy == 53) hardestroom =map.specialnames[6]; + if (roomx == 50 && roomy == 54) hardestroom = map.specialnames[7]; + } + else if (map.roomname == "") { hardestroom = map.hiddenname; - hardestroom_specialname = true; - } - else - { - hardestroom = map.roomname; - hardestroom_specialname = map.roomname_special; } } } @@ -4601,7 +3984,7 @@ void Game::deletestats(void) { if (!FILESYSTEM_delete("saves/unlock.vvv")) { - vlog_error("Error deleting saves/unlock.vvv"); + puts("Error deleting saves/unlock.vvv"); } else { @@ -4618,9 +4001,6 @@ void Game::deletestats(void) bestlives[i] = -1; bestrank[i] = -1; } - swnrecord = 0; - swnbestrank = 0; - bestgamedeaths = -1; #ifndef MAKEANDPLAY graphics.setflipmode = false; #endif @@ -4632,15 +4012,13 @@ void Game::deletesettings(void) { if (!FILESYSTEM_delete("saves/settings.vvv")) { - vlog_error("Error deleting saves/settings.vvv"); + puts("Error deleting saves/settings.vvv"); } } void Game::unlocknum( int t ) { -#ifdef MAKEANDPLAY - UNUSED(t); -#else +#if !defined(MAKEANDPLAY) if (map.custommode) { //Don't let custom levels unlock things! @@ -4652,38 +4030,39 @@ void Game::unlocknum( int t ) #endif } -static bool stats_loaded = false; - -void Game::loadstats(struct ScreenSettings* screen_settings) +void Game::loadstats(ScreenSettings* screen_settings) { tinyxml2::XMLDocument doc; - tinyxml2::XMLHandle hDoc(&doc); - tinyxml2::XMLElement* pElem; - tinyxml2::XMLElement* dataNode; - - stats_loaded = true; - if (!FILESYSTEM_loadTiXml2Document("saves/unlock.vvv", doc)) { // Save unlock.vvv only. Maybe we have a settings.vvv laying around too, // and we don't want to overwrite that! savestats(screen_settings); - return; + + printf("No Stats found. Assuming a new player\n"); } - if (doc.Error()) + tinyxml2::XMLHandle hDoc(&doc); + tinyxml2::XMLElement* pElem; + tinyxml2::XMLHandle hRoot(NULL); + + { - vlog_error("Error parsing unlock.vvv: %s", doc.ErrorStr()); - return; + pElem=hDoc.FirstChildElement().ToElement(); + // should always have a valid root but handle gracefully if it does + if (!pElem) + { + + } + ; + + // save this for later + hRoot=tinyxml2::XMLHandle(pElem); } - dataNode = hDoc - .FirstChildElement() - .FirstChildElement("Data") - .FirstChildElement() - .ToElement(); + tinyxml2::XMLElement* dataNode = hRoot.FirstChildElement("Data").FirstChild().ToElement(); - for (pElem = dataNode; pElem != NULL; pElem=pElem->NextSiblingElement()) + for( pElem = dataNode; pElem; pElem=pElem->NextSiblingElement()) { const char* pKey = pElem->Value(); const char* pText = pElem->GetText() ; @@ -4735,7 +4114,7 @@ void Game::loadstats(struct ScreenSettings* screen_settings) deserializesettings(dataNode, screen_settings); } -void Game::deserializesettings(tinyxml2::XMLElement* dataNode, struct ScreenSettings* screen_settings) +void Game::deserializesettings(tinyxml2::XMLElement* dataNode, ScreenSettings* screen_settings) { // Don't duplicate controller buttons! controllerButton_flip.clear(); @@ -4763,13 +4142,7 @@ void Game::deserializesettings(tinyxml2::XMLElement* dataNode, struct ScreenSett if (SDL_strcmp(pKey, "stretch") == 0) { - int mode = help.Int(pText); - if (mode < 0 || mode >= NUM_SCALING_MODES) - { - /* Pick a sane default. */ - mode = SCALING_INTEGER; - } - screen_settings->scalingMode = mode; + screen_settings->stretch = help.Int(pText); } if (SDL_strcmp(pKey, "useLinearFilter") == 0) @@ -4777,10 +4150,6 @@ void Game::deserializesettings(tinyxml2::XMLElement* dataNode, struct ScreenSett screen_settings->linearFilter = help.Int(pText); } - if (SDL_strcmp(pKey, "window_display") == 0) - { - screen_settings->windowDisplay = help.Int(pText); - } if (SDL_strcmp(pKey, "window_width") == 0) { screen_settings->windowWidth = help.Int(pText); @@ -4946,69 +4315,50 @@ void Game::deserializesettings(tinyxml2::XMLElement* dataNode, struct ScreenSett key.sensitivity = help.Int(pText); } - if (SDL_strcmp(pKey, "lang") == 0) - { - loc::lang = std::string(pText); - } - - if (SDL_strcmp(pKey, "lang_set") == 0) - { - loc::lang_set = help.Int(pText); - } - - if (SDL_strcmp(pKey, "english_sprites") == 0) - { - loc::english_sprites = help.Int(pText); - } - - if (SDL_strcmp(pKey, "new_level_font") == 0) - { - loc::new_level_font = std::string(pText); - } - - if (SDL_strcmp(pKey, "roomname_translator") == 0 && loc::show_translator_menu) - { - roomname_translator::set_enabled(help.Int(pText)); - } - - if (SDL_strcmp(pKey, "checkpoint_saving") == 0) - { - checkpoint_saving = help.Int(pText); - } } - setdefaultcontrollerbuttons(); -} - -bool Game::savestats(bool sync /*= true*/) -{ - struct ScreenSettings screen_settings; - SDL_zero(screen_settings); - gameScreen.GetSettings(&screen_settings); - - return savestats(&screen_settings, sync); -} - -bool Game::savestats(const struct ScreenSettings* screen_settings, bool sync /*= true*/) -{ - tinyxml2::XMLDocument doc; - bool already_exists; - - if (!stats_loaded) + if (controllerButton_flip.size() < 1) + { + controllerButton_flip.push_back(SDL_CONTROLLER_BUTTON_A); + } + if (controllerButton_map.size() < 1) + { + controllerButton_map.push_back(SDL_CONTROLLER_BUTTON_Y); + } + if (controllerButton_esc.size() < 1) + { + controllerButton_esc.push_back(SDL_CONTROLLER_BUTTON_B); + } + if (controllerButton_restart.size() < 1) + { + controllerButton_restart.push_back(SDL_CONTROLLER_BUTTON_RIGHTSHOULDER); + } + if (controllerButton_interact.size() < 1) + { + controllerButton_interact.push_back(SDL_CONTROLLER_BUTTON_X); + } +} + +bool Game::savestats(void) +{ + if (graphics.screenbuffer == NULL) { - vlog_warn("Stats not loaded! Not writing unlock.vvv."); return false; } - already_exists = FILESYSTEM_loadTiXml2Document("saves/unlock.vvv", doc); + ScreenSettings screen_settings; + graphics.screenbuffer->GetSettings(&screen_settings); + + return savestats(&screen_settings); +} + +bool Game::savestats(const ScreenSettings* screen_settings) +{ + tinyxml2::XMLDocument doc; + bool already_exists = FILESYSTEM_loadTiXml2Document("saves/unlock.vvv", doc); if (!already_exists) { - vlog_info("No unlock.vvv found. Creating new file"); - } - else if (doc.Error()) - { - vlog_error("Error parsing existing unlock.vvv: %s", doc.ErrorStr()); - vlog_info("Creating new unlock.vvv"); + puts("No unlock.vvv found. Creating new file"); } xml::update_declaration(doc); @@ -5078,12 +4428,12 @@ bool Game::savestats(const struct ScreenSettings* screen_settings, bool sync /*= serializesettings(dataNode, screen_settings); - return FILESYSTEM_saveTiXml2Document("saves/unlock.vvv", doc, sync); + return FILESYSTEM_saveTiXml2Document("saves/unlock.vvv", doc); } bool Game::savestatsandsettings(void) { - const bool stats_saved = savestats(false); + const bool stats_saved = savestats(); const bool settings_saved = savesettings(); @@ -5100,18 +4450,16 @@ void Game::savestatsandsettings_menu(void) } } -void Game::serializesettings(tinyxml2::XMLElement* dataNode, const struct ScreenSettings* screen_settings) +void Game::serializesettings(tinyxml2::XMLElement* dataNode, const ScreenSettings* screen_settings) { tinyxml2::XMLDocument& doc = xml::get_document(dataNode); xml::update_tag(dataNode, "fullscreen", (int) screen_settings->fullscreen); - xml::update_tag(dataNode, "stretch", screen_settings->scalingMode); + xml::update_tag(dataNode, "stretch", screen_settings->stretch); xml::update_tag(dataNode, "useLinearFilter", (int) screen_settings->linearFilter); - xml::update_tag(dataNode, "window_display", screen_settings->windowDisplay); - xml::update_tag(dataNode, "window_width", screen_settings->windowWidth); xml::update_tag(dataNode, "window_height", screen_settings->windowHeight); @@ -5227,76 +4575,58 @@ void Game::serializesettings(tinyxml2::XMLElement* dataNode, const struct Screen } xml::update_tag(dataNode, "controllerSensitivity", key.sensitivity); - - xml::update_tag(dataNode, "lang", loc::lang.c_str()); - xml::update_tag(dataNode, "lang_set", (int) loc::lang_set); - xml::update_tag(dataNode, "english_sprites", (int) loc::english_sprites); - xml::update_tag(dataNode, "new_level_font", loc::new_level_font.c_str()); - xml::update_tag(dataNode, "roomname_translator", (int) roomname_translator::enabled); - - xml::update_tag(dataNode, "checkpoint_saving", (int) checkpoint_saving); } -static bool settings_loaded = false; - -void Game::loadsettings(struct ScreenSettings* screen_settings) +void Game::loadsettings(ScreenSettings* screen_settings) { tinyxml2::XMLDocument doc; - tinyxml2::XMLHandle hDoc(&doc); - tinyxml2::XMLElement* dataNode; - - settings_loaded = true; - if (!FILESYSTEM_loadTiXml2Document("saves/settings.vvv", doc)) { savesettings(screen_settings); - return; + puts("No settings.vvv found"); } - if (doc.Error()) + tinyxml2::XMLHandle hDoc(&doc); + tinyxml2::XMLElement* pElem; + tinyxml2::XMLHandle hRoot(NULL); + { - vlog_error("Error parsing settings.vvv: %s", doc.ErrorStr()); - return; + pElem = hDoc.FirstChildElement().ToElement(); + // should always have a valid root but handle gracefully if it doesn't + if (!pElem) + { + } + ; + + // save this for later + hRoot = tinyxml2::XMLHandle(pElem); } - dataNode = hDoc - .FirstChildElement() - .FirstChildElement("Data") - .FirstChildElement() - .ToElement(); + tinyxml2::XMLElement* dataNode = hRoot.FirstChildElement("Data").FirstChild().ToElement(); deserializesettings(dataNode, screen_settings); } bool Game::savesettings(void) { - struct ScreenSettings screen_settings; - SDL_zero(screen_settings); - gameScreen.GetSettings(&screen_settings); + if (graphics.screenbuffer == NULL) + { + return false; + } + + ScreenSettings screen_settings; + graphics.screenbuffer->GetSettings(&screen_settings); return savesettings(&screen_settings); } -bool Game::savesettings(const struct ScreenSettings* screen_settings) +bool Game::savesettings(const ScreenSettings* screen_settings) { tinyxml2::XMLDocument doc; - bool already_exists; - - if (!settings_loaded) - { - vlog_warn("Settings not loaded! Not writing settings.vvv."); - return false; - } - - already_exists = FILESYSTEM_loadTiXml2Document("saves/settings.vvv", doc); + bool already_exists = FILESYSTEM_loadTiXml2Document("saves/settings.vvv", doc); if (!already_exists) { - vlog_info("No settings.vvv found. Creating new file"); - } - else if (doc.Error()) - { - vlog_error("Error parsing existing settings.vvv: %s", doc.ErrorStr()); - vlog_info("Creating new settings.vvv"); + puts("No settings.vvv found. Creating new file"); } xml::update_declaration(doc); @@ -5326,7 +4656,7 @@ void Game::customstart(void) savepoint = 0; gravitycontrol = savegc; - setstate(0); + state = 0; deathseq = -1; lifeseq = 0; } @@ -5344,14 +4674,11 @@ void Game::start(void) savepoint = 0; gravitycontrol = savegc; - setstate(0); + state = 0; deathseq = -1; lifeseq = 0; - if (!nocutscenes) - { - music.play(Music_PAUSE); - } + if (!nocutscenes) music.play(5); } void Game::deathsequence(void) @@ -5367,7 +4694,7 @@ void Game::deathsequence(void) } if (INBOUNDS_VEC(i, obj.entities)) { - obj.entities[i].colour = EntityColour_DEAD; + obj.entities[i].colour = 1; obj.entities[i].invis = false; } @@ -5377,13 +4704,10 @@ void Game::deathsequence(void) { music.fadeout(); gameoverdelay = 60; - - /* Fix a bug being able to play music on the Game Over screen */ - music.nicefade = false; } deathcounts++; - music.playef(Sound_CRY); - if (INBOUNDS_VEC(i, obj.entities) && !noflashingmode) + music.playef(2); + if (INBOUNDS_VEC(i, obj.entities)) { obj.entities[i].invis = true; } @@ -5404,7 +4728,7 @@ void Game::deathsequence(void) } } } - if (INBOUNDS_VEC(i, obj.entities) && !noflashingmode) + if (INBOUNDS_VEC(i, obj.entities)) { if (deathseq == 25) obj.entities[i].invis = true; if (deathseq == 20) obj.entities[i].invis = true; @@ -5457,7 +4781,7 @@ void Game::startspecial( int t ) savepoint = 0; gravitycontrol = savegc; - setstate(0); + state = 0; deathseq = -1; lifeseq = 0; } @@ -5528,7 +4852,7 @@ void Game::starttrial( int t ) savepoint = 0; gravitycontrol = savegc; - setstate(0); + state = 0; deathseq = -1; lifeseq = 0; } @@ -5538,37 +4862,32 @@ void Game::loadquick(void) tinyxml2::XMLDocument doc; if (!FILESYSTEM_loadTiXml2Document("saves/qsave.vvv", doc)) return; - readmaingamesave("qsave.vvv", doc); + readmaingamesave(doc); } -void Game::readmaingamesave(const char* savename, tinyxml2::XMLDocument& doc) +void Game::readmaingamesave(tinyxml2::XMLDocument& doc) { tinyxml2::XMLHandle hDoc(&doc); tinyxml2::XMLElement* pElem; + tinyxml2::XMLHandle hRoot(NULL); + - if (doc.Error()) { - vlog_error("Error parsing %s: %s", savename, doc.ErrorStr()); - return; + pElem=hDoc.FirstChildElement().ToElement(); + // should always have a valid root but handle gracefully if it does + if (!pElem) + { + printf("Save Not Found\n"); + } + + // save this for later + hRoot=tinyxml2::XMLHandle(pElem); } - /* Even if we want the default hardest room to be Welcome Aboard, there are pre-2.4 - * saves with JUST which should take priority over the coords */ - hardestroom_x = -1; - hardestroom_y = -1; - hardestroom_specialname = false; - hardestroom_finalstretch = false; - - for (pElem = hDoc - .FirstChildElement() - .FirstChildElement("Data") - .FirstChildElement() - .ToElement(); - pElem != NULL; - pElem = pElem->NextSiblingElement()) + for( pElem = hRoot.FirstChildElement( "Data" ).FirstChild().ToElement(); pElem; pElem=pElem->NextSiblingElement()) { - const char* pKey = pElem->Value(); - const char* pText = pElem->GetText(); + const char* pKey = pElem->Value();; + const char* pText = pElem->GetText() ; if(pText == NULL) { pText = ""; @@ -5639,6 +4958,10 @@ void Game::readmaingamesave(const char* savename, tinyxml2::XMLDocument& doc) { scmprogress = help.Int(pText); } + else if (SDL_strcmp(pKey, "scmmoveme") == 0) + { + scmmoveme = help.Int(pText); + } else if (SDL_strcmp(pKey, "frames") == 0) { frames = help.Int(pText); @@ -5671,22 +4994,6 @@ void Game::readmaingamesave(const char* savename, tinyxml2::XMLDocument& doc) { hardestroomdeaths = help.Int(pText); } - else if (SDL_strcmp(pKey, "hardestroom_x") == 0) - { - hardestroom_x = help.Int(pText); - } - else if (SDL_strcmp(pKey, "hardestroom_y") == 0) - { - hardestroom_y = help.Int(pText); - } - else if (SDL_strcmp(pKey, "hardestroom_specialname") == 0) - { - hardestroom_specialname = help.Int(pText); - } - else if (SDL_strcmp(pKey, "hardestroom_finalstretch") == 0) - { - hardestroom_finalstretch = help.Int(pText); - } else if (SDL_strcmp(pKey, "currentsong") == 0) { int song = help.Int(pText); @@ -5723,53 +5030,40 @@ void Game::readmaingamesave(const char* savename, tinyxml2::XMLDocument& doc) } -void Game::customloadquick(const std::string& savfile) +void Game::customloadquick(std::string savfile) { - tinyxml2::XMLDocument doc; - tinyxml2::XMLHandle hDoc(&doc); - tinyxml2::XMLElement* pElem; - std::string levelfile; - - if (cliplaytest) - { + if (cliplaytest) { savex = playx; savey = playy; saverx = playrx; savery = playry; savegc = playgc; - if (playmusic > -1) + music.play(playmusic); + return; + } + + std::string levelfile = savfile.substr(7); + tinyxml2::XMLDocument doc; + if (!FILESYSTEM_loadTiXml2Document(("saves/"+levelfile+".vvv").c_str(), doc)) return; + + tinyxml2::XMLHandle hDoc(&doc); + tinyxml2::XMLElement* pElem; + tinyxml2::XMLHandle hRoot(NULL); + + + { + pElem=hDoc.FirstChildElement().ToElement(); + // should always have a valid root but handle gracefully if it does + if (!pElem) { - music.play(playmusic); + printf("Save Not Found\n"); } - return; + + // save this for later + hRoot=tinyxml2::XMLHandle(pElem); } - levelfile = savfile.substr(7); - if (!FILESYSTEM_loadTiXml2Document(("saves/"+levelfile+".vvv").c_str(), doc)) - { - vlog_error("%s.vvv not found", levelfile.c_str()); - return; - } - - if (doc.Error()) - { - vlog_error("Error parsing %s.vvv: %s", levelfile.c_str(), doc.ErrorStr()); - return; - } - - // Like readmaingamesave(...), old saves have just - hardestroom_x = -1; - hardestroom_y = -1; - hardestroom_specialname = false; - hardestroom_finalstretch = false; - - for (pElem = hDoc - .FirstChildElement() - .FirstChildElement("Data") - .FirstChildElement() - .ToElement(); - pElem != NULL; - pElem = pElem->NextSiblingElement()) + for( pElem = hRoot.FirstChildElement( "Data" ).FirstChild().ToElement(); pElem; pElem=pElem->NextSiblingElement()) { const char* pKey = pElem->Value(); const char* pText = pElem->GetText() ; @@ -5842,10 +5136,6 @@ void Game::customloadquick(const std::string& savfile) { savepoint = help.Int(pText); } - else if (SDL_strcmp(pKey, "savecolour") == 0) - { - savecolour = help.Int(pText); - } else if (SDL_strcmp(pKey, "companion") == 0) { companion = help.Int(pText); @@ -5866,6 +5156,10 @@ void Game::customloadquick(const std::string& savfile) { scmprogress = help.Int(pText); } + else if (SDL_strcmp(pKey, "scmmoveme") == 0) + { + scmmoveme = help.Int(pText); + } else if (SDL_strcmp(pKey, "frames") == 0) { frames = help.Int(pText); @@ -5898,22 +5192,6 @@ void Game::customloadquick(const std::string& savfile) { hardestroomdeaths = help.Int(pText); } - else if (SDL_strcmp(pKey, "hardestroom_x") == 0) - { - hardestroom_x = help.Int(pText); - } - else if (SDL_strcmp(pKey, "hardestroom_y") == 0) - { - hardestroom_y = help.Int(pText); - } - else if (SDL_strcmp(pKey, "hardestroom_specialname") == 0) - { - hardestroom_specialname = help.Int(pText); - } - else if (SDL_strcmp(pKey, "hardestroom_finalstretch") == 0) - { - hardestroom_finalstretch = help.Int(pText); - } else if (SDL_strcmp(pKey, "currentsong") == 0) { int song = help.Int(pText); @@ -5922,22 +5200,10 @@ void Game::customloadquick(const std::string& savfile) music.play(song); } } - else if (SDL_strcmp(pKey, "lang_custom") == 0) - { - loc::lang_custom = pText; - if (pText[0] != '\0') - { - loc::loadtext_custom(NULL); - } - } else if (SDL_strcmp(pKey, "showminimap") == 0) { map.customshowmm = help.Int(pText); } - else if (SDL_strcmp(pKey, "mapreveal") == 0) - { - map.revealmap = help.Int(pText); - } else if (SDL_strcmp(pKey, "disabletemporaryaudiopause") == 0) { disabletemporaryaudiopause = help.Int(pText); @@ -5946,134 +5212,183 @@ void Game::customloadquick(const std::string& savfile) { map.showtrinkets = help.Int(pText); } - else if (SDL_strcmp(pKey, "roomname") == 0) - { - map.setroomname(pText); - map.roomnameset = true; - map.roomname_special = true; - } - else if (SDL_strcmp(pKey, "currentregion") == 0) - { - map.currentregion = help.Int(pText); - } - else if (SDL_strcmp(pKey, "regions") == 0) - { - tinyxml2::XMLElement* pElem2; - for (pElem2 = pElem->FirstChildElement(); pElem2 != NULL; pElem2 = pElem2->NextSiblingElement()) - { - int thisid = 0; - int thisrx = 0; - int thisry = 0; - int thisrx2 = (cl.mapwidth - 1); - int thisry2 = (cl.mapheight - 1); - if (pElem2->Attribute("id")) - { - thisid = help.Int(pElem2->Attribute("id")); - } - for (tinyxml2::XMLElement* pElem3 = pElem2->FirstChildElement(); pElem3 != NULL; pElem3 = pElem3->NextSiblingElement()) - { - if (SDL_strcmp(pElem3->Value(), "rx") == 0 && pElem3->GetText() != NULL) - { - thisrx = help.Int(pElem3->GetText()); - } - if (SDL_strcmp(pElem3->Value(), "ry") == 0 && pElem3->GetText() != NULL) - { - thisry = help.Int(pElem3->GetText()); - } - if (SDL_strcmp(pElem3->Value(), "rx2") == 0 && pElem3->GetText() != NULL) - { - thisrx2 = help.Int(pElem3->GetText()); - } - if (SDL_strcmp(pElem3->Value(), "ry2") == 0 && pElem3->GetText() != NULL) - { - thisry2 = help.Int(pElem3->GetText()); - } - } - - map.setregion(thisid, thisrx, thisry, thisrx2, thisry2); - } - } - } -} - -static void loadthissummary( - const char* filename, - struct Game::Summary* summary, - tinyxml2::XMLDocument& doc -) { - tinyxml2::XMLHandle hDoc(&doc); - tinyxml2::XMLElement* pElem; - - if (doc.Error()) - { - vlog_error("Error parsing %s: %s", filename, doc.ErrorStr()); - return; } - summary->exists = true; + map.showteleporters = true; + if(obj.flags[12]) map.showtargets = true; - for (pElem = hDoc - .FirstChildElement() - .FirstChildElement("Data") - .FirstChildElement() - .ToElement(); - pElem != NULL; - pElem = pElem->NextSiblingElement()) - { - const char* pKey = pElem->Value(); - const char* pText = pElem->GetText(); - - if (pText == NULL) - { - pText = ""; - } - - if (SDL_strcmp(pKey, "seconds") == 0) - { - summary->seconds = help.Int(pText); - } - else if (SDL_strcmp(pKey, "minutes") == 0) - { - summary->minutes = help.Int(pText); - } - else if (SDL_strcmp(pKey, "hours") == 0) - { - summary->hours = help.Int(pText); - } - else if (SDL_strcmp(pKey, "saverx") == 0) - { - summary->saverx = help.Int(pText); - } - else if (SDL_strcmp(pKey, "savery") == 0) - { - summary->savery = help.Int(pText); - } - else if (SDL_strcmp(pKey, "trinkets") == 0) - { - summary->trinkets = help.Int(pText); - } - - LOAD_ARRAY_RENAME(crewstats, summary->crewstats) - } } void Game::loadsummary(void) { + tinyxml2::XMLDocument docTele; + if (!FILESYSTEM_loadTiXml2Document("saves/tsave.vvv", docTele)) + { + telesummary = ""; + } + else + { + tinyxml2::XMLHandle hDoc(&docTele); + tinyxml2::XMLElement* pElem; + tinyxml2::XMLHandle hRoot(NULL); + + + { + pElem=hDoc.FirstChildElement().ToElement(); + // should always have a valid root but handle gracefully if it does + if (!pElem) + { + printf("Save Not Found\n"); + } + + // save this for later + hRoot=tinyxml2::XMLHandle(pElem); + } + int l_minute, l_second, l_hours; + l_minute = l_second= l_hours = 0; + int l_saveX = 0; + int l_saveY = 0; + for( pElem = hRoot.FirstChildElement( "Data" ).FirstChild().ToElement(); pElem; pElem=pElem->NextSiblingElement()) + { + const char* pKey = pElem->Value(); + const char* pText = pElem->GetText() ; + + if (pText == NULL) + { + pText = ""; + } + + if (SDL_strcmp(pKey, "summary") == 0) + { + telesummary = pText; + } + + else if (SDL_strcmp(pKey, "seconds") == 0) + { + l_second = help.Int(pText); + } + else if (SDL_strcmp(pKey, "minutes") == 0) + { + l_minute = help.Int(pText); + } + else if (SDL_strcmp(pKey, "hours") == 0) + { + l_hours = help.Int(pText); + } + else if (SDL_strcmp(pKey, "savery") == 0) + { + l_saveY = help.Int(pText); + } + else if (SDL_strcmp(pKey, "saverx") == 0) + { + l_saveX = help.Int(pText); + } + else if (SDL_strcmp(pKey, "trinkets") == 0) + { + tele_trinkets = help.Int(pText); + } + else if (SDL_strcmp(pKey, "finalmode") == 0) + { + map.finalmode = help.Int(pText); + } + else if (SDL_strcmp(pKey, "finalstretch") == 0) + { + map.finalstretch = help.Int(pText); + } + + LOAD_ARRAY_RENAME(crewstats, tele_crewstats) + + } + tele_gametime = giventimestring(l_hours,l_minute, l_second); + tele_currentarea = map.currentarea(map.area(l_saveX, l_saveY)); + } + tinyxml2::XMLDocument doc; - - SDL_zero(last_telesave); - SDL_zero(last_quicksave); - - if (FILESYSTEM_loadTiXml2Document("saves/tsave.vvv", doc)) + if (!FILESYSTEM_loadTiXml2Document("saves/qsave.vvv", doc)) { - loadthissummary("tsave.vvv", &last_telesave, doc); + quicksummary = ""; + } + else + { + tinyxml2::XMLHandle hDoc(&doc); + tinyxml2::XMLElement* pElem; + tinyxml2::XMLHandle hRoot(NULL); + + + { + pElem=hDoc.FirstChildElement().ToElement(); + // should always have a valid root but handle gracefully if it does + if (!pElem) + { + printf("Save Not Found\n"); + } + + // save this for later + hRoot=tinyxml2::XMLHandle(pElem); + } + int l_minute, l_second, l_hours; + l_minute = l_second= l_hours = 0; + int l_saveX = 0; + int l_saveY = 0; + for( pElem = hRoot.FirstChildElement( "Data" ).FirstChild().ToElement(); pElem; pElem=pElem->NextSiblingElement()) + { + const char* pKey = pElem->Value(); + const char* pText = pElem->GetText() ; + + if (pText == NULL) + { + pText = ""; + } + + if (SDL_strcmp(pKey, "summary") == 0) + { + quicksummary = pText; + } + + else if (SDL_strcmp(pKey, "seconds") == 0) + { + l_second = help.Int(pText); + } + else if (SDL_strcmp(pKey, "minutes") == 0) + { + l_minute = help.Int(pText); + } + else if (SDL_strcmp(pKey, "hours") == 0) + { + l_hours = help.Int(pText); + } + else if (SDL_strcmp(pKey, "savery") == 0) + { + l_saveY = help.Int(pText); + } + else if (SDL_strcmp(pKey, "saverx") == 0) + { + l_saveX = help.Int(pText); + } + else if (SDL_strcmp(pKey, "trinkets") == 0) + { + quick_trinkets = help.Int(pText); + } + else if (SDL_strcmp(pKey, "finalmode") == 0) + { + map.finalmode = help.Int(pText); + } + else if (SDL_strcmp(pKey, "finalstretch") == 0) + { + map.finalstretch = help.Int(pText); + } + + LOAD_ARRAY_RENAME(crewstats, quick_crewstats) + + } + + quick_gametime = giventimestring(l_hours,l_minute, l_second); + quick_currentarea = map.currentarea(map.area(l_saveX, l_saveY)); } - if (FILESYSTEM_loadTiXml2Document("saves/qsave.vvv", doc)) - { - loadthissummary("qsave.vvv", &last_quicksave, doc); - } + + } void Game::initteleportermode(void) @@ -6102,23 +5417,17 @@ bool Game::savetele(void) bool already_exists = FILESYSTEM_loadTiXml2Document("saves/tsave.vvv", doc); if (!already_exists) { - vlog_info("No tsave.vvv found. Creating new file"); + puts("No tsave.vvv found. Creating new file"); } - else if (doc.Error()) - { - vlog_error("Error parsing existing tsave.vvv: %s", doc.ErrorStr()); - vlog_info("Creating new tsave.vvv"); - } - - last_telesave = writemaingamesave(doc); + telesummary = writemaingamesave(doc); if(!FILESYSTEM_saveTiXml2Document("saves/tsave.vvv", doc)) { - vlog_error("Could Not Save game!"); - vlog_error("Failed: %s%s", saveFilePath, "tsave.vvv"); + printf("Could Not Save game!\n"); + printf("Failed: %s%s\n", saveFilePath, "tsave.vvv"); return false; } - vlog_info("Game saved"); + printf("Game saved\n"); return true; } @@ -6135,38 +5444,29 @@ bool Game::savequick(void) bool already_exists = FILESYSTEM_loadTiXml2Document("saves/qsave.vvv", doc); if (!already_exists) { - vlog_info("No qsave.vvv found. Creating new file"); + puts("No qsave.vvv found. Creating new file"); } - else if (doc.Error()) - { - vlog_error("Error parsing existing qsave.vvv: %s", doc.ErrorStr()); - vlog_info("Creating new qsave.vvv"); - } - - last_quicksave = writemaingamesave(doc); + quicksummary = writemaingamesave(doc); if(!FILESYSTEM_saveTiXml2Document("saves/qsave.vvv", doc)) { - vlog_error("Could Not Save game!"); - vlog_error("Failed: %s%s", saveFilePath, "qsave.vvv"); + printf("Could Not Save game!\n"); + printf("Failed: %s%s\n", saveFilePath, "qsave.vvv"); return false; } - vlog_info("Game saved"); + printf("Game saved\n"); return true; } // Returns summary of save -struct Game::Summary Game::writemaingamesave(tinyxml2::XMLDocument& doc) +std::string Game::writemaingamesave(tinyxml2::XMLDocument& doc) { //TODO make this code a bit cleaner. - struct Game::Summary summary; - SDL_zero(summary); - if (map.custommode || inspecial()) { //Don't trash save data! - return summary; + return ""; } xml::update_declaration(doc); @@ -6224,8 +5524,7 @@ struct Game::Summary Game::writemaingamesave(tinyxml2::XMLDocument& doc) xml::update_tag(msgs, "savepoint", savepoint); - int n_trinkets = trinkets(); - xml::update_tag(msgs, "trinkets", n_trinkets); + xml::update_tag(msgs, "trinkets", trinkets()); //Special stats @@ -6248,6 +5547,7 @@ struct Game::Summary Game::writemaingamesave(tinyxml2::XMLDocument& doc) xml::update_tag(msgs, "supercrewmate", (int) supercrewmate); xml::update_tag(msgs, "scmprogress", scmprogress); + xml::update_tag(msgs, "scmmoveme", (int) scmmoveme); xml::update_tag(msgs, "frames", frames); @@ -6261,33 +5561,19 @@ struct Game::Summary Game::writemaingamesave(tinyxml2::XMLDocument& doc) xml::update_tag(msgs, "hardestroom", hardestroom.c_str()); xml::update_tag(msgs, "hardestroomdeaths", hardestroomdeaths); - xml::update_tag(msgs, "hardestroom_x", hardestroom_x); - xml::update_tag(msgs, "hardestroom_y", hardestroom_y); - xml::update_tag(msgs, "hardestroom_specialname", (int) hardestroom_specialname); - xml::update_tag(msgs, "hardestroom_finalstretch", (int) hardestroom_finalstretch); xml::update_tag(msgs, "finalmode", (int) map.finalmode); xml::update_tag(msgs, "finalstretch", (int) map.finalstretch); - std::string legacy_summary = std::string(map.currentarea(saverx, savery)) + ", " + timestring(); - xml::update_tag(msgs, "summary", legacy_summary.c_str()); - - - summary.exists = true; - summary.seconds = seconds; - summary.minutes = minutes; - summary.hours = hours; - summary.saverx = saverx; - summary.savery = savery; - summary.trinkets = n_trinkets; - SDL_memcpy(summary.crewstats, crewstats, sizeof(summary.crewstats)); + std::string summary = savearea + ", " + timestring(); + xml::update_tag(msgs, "summary", summary.c_str()); return summary; } -bool Game::customsavequick(const std::string& savfile) +bool Game::customsavequick(std::string savfile) { const std::string levelfile = savfile.substr(7); @@ -6295,12 +5581,7 @@ bool Game::customsavequick(const std::string& savfile) bool already_exists = FILESYSTEM_loadTiXml2Document(("saves/" + levelfile + ".vvv").c_str(), doc); if (!already_exists) { - vlog_info("No %s.vvv found. Creating new file", levelfile.c_str()); - } - else if (doc.Error()) - { - vlog_error("Error parsing existing %s.vvv: %s", levelfile.c_str(), doc.ErrorStr()); - vlog_info("Creating new %s.vvv", levelfile.c_str()); + printf("No %s.vvv found. Creating new file\n", levelfile.c_str()); } xml::update_declaration(doc); @@ -6372,47 +5653,10 @@ bool Game::customsavequick(const std::string& savfile) xml::update_tag(msgs, "savepoint", savepoint); - xml::update_tag(msgs, "savecolour", savecolour); - xml::update_tag(msgs, "trinkets", trinkets()); xml::update_tag(msgs, "crewmates", crewmates()); - xml::update_tag(msgs, "currentregion", map.currentregion); - - tinyxml2::XMLElement* msg = xml::update_element_delete_contents(msgs, "regions"); - for (size_t i = 0; i < SDL_arraysize(map.region); i++) - { - if (map.region[i].isvalid) - { - tinyxml2::XMLElement* region_el; - region_el = doc.NewElement("region"); - - region_el->SetAttribute("id", (help.String(i).c_str())); - - tinyxml2::XMLElement* rx_el; - rx_el = doc.NewElement("rx"); - rx_el->LinkEndChild(doc.NewText(help.String(map.region[i].rx).c_str())); - region_el->LinkEndChild(rx_el); - - tinyxml2::XMLElement* ry_el; - ry_el = doc.NewElement("ry"); - ry_el->LinkEndChild(doc.NewText(help.String(map.region[i].ry).c_str())); - region_el->LinkEndChild(ry_el); - - tinyxml2::XMLElement* rx2_el; - rx2_el = doc.NewElement("rx2"); - rx2_el->LinkEndChild(doc.NewText(help.String(map.region[i].rx2).c_str())); - region_el->LinkEndChild(rx2_el); - - tinyxml2::XMLElement* ry2_el; - ry2_el = doc.NewElement("ry2"); - ry2_el->LinkEndChild(doc.NewText(help.String(map.region[i].ry2).c_str())); - region_el->LinkEndChild(ry2_el); - - msg->LinkEndChild(region_el); - } - } //Special stats @@ -6425,8 +5669,6 @@ bool Game::customsavequick(const std::string& savfile) xml::update_tag(msgs, "currentsong", music.currentsong); } - xml::update_tag(msgs, "lang_custom", loc::lang_custom.c_str()); - xml::update_tag(msgs, "teleportscript", teleportscript.c_str()); xml::update_tag(msgs, "companion", companion); @@ -6434,6 +5676,7 @@ bool Game::customsavequick(const std::string& savfile) xml::update_tag(msgs, "supercrewmate", (int) supercrewmate); xml::update_tag(msgs, "scmprogress", scmprogress); + xml::update_tag(msgs, "scmmoveme", (int) scmmoveme); xml::update_tag(msgs, "frames", frames); @@ -6447,43 +5690,25 @@ bool Game::customsavequick(const std::string& savfile) xml::update_tag(msgs, "hardestroom", hardestroom.c_str()); xml::update_tag(msgs, "hardestroomdeaths", hardestroomdeaths); - xml::update_tag(msgs, "hardestroom_x", hardestroom_x); - xml::update_tag(msgs, "hardestroom_y", hardestroom_y); - xml::update_tag(msgs, "hardestroom_specialname", (int) hardestroom_specialname); - xml::update_tag(msgs, "hardestroom_finalstretch", (int) hardestroom_finalstretch); xml::update_tag(msgs, "showminimap", (int) map.customshowmm); - xml::update_tag(msgs, "mapreveal", (int) map.revealmap); - xml::update_tag(msgs, "disabletemporaryaudiopause", (int) disabletemporaryaudiopause); xml::update_tag(msgs, "showtrinkets", (int) map.showtrinkets); - if (map.roomnameset) - { - xml::update_tag(msgs, "roomname", map.roomname); - } - else - { - // If there's roomname tags, remove them. There will probably only always be one, but just in case... - tinyxml2::XMLElement* element; - while ((element = msgs->FirstChildElement("roomname")) != NULL) - { - doc.DeleteNode(element); - } - } + std::string summary = savearea + ", " + timestring(); + xml::update_tag(msgs, "summary", summary.c_str()); - std::string legacy_summary = customleveltitle + ", " + timestring(); - xml::update_tag(msgs, "summary", legacy_summary.c_str()); + customquicksummary = summary; if(!FILESYSTEM_saveTiXml2Document(("saves/"+levelfile+".vvv").c_str(), doc)) { - vlog_error("Could Not Save game!"); - vlog_error("Failed: %s%s%s", saveFilePath, levelfile.c_str(), ".vvv"); + printf("Could Not Save game!\n"); + printf("Failed: %s%s%s\n", saveFilePath, levelfile.c_str(), ".vvv"); return false; } - vlog_info("Game saved"); + printf("Game saved\n"); return true; } @@ -6493,13 +5718,12 @@ void Game::loadtele(void) tinyxml2::XMLDocument doc; if (!FILESYSTEM_loadTiXml2Document("saves/tsave.vvv", doc)) return; - readmaingamesave("tsave.vvv", doc); + readmaingamesave(doc); } std::string Game::unrescued(void) { //Randomly return the name of an unrescued crewmate - //Localization is handled with regular cutscene dialogue if (fRandom() * 100 > 50) { if (!crewstats[5]) return "Victoria"; @@ -6554,57 +5778,81 @@ void Game::gameclock(void) std::string Game::giventimestring( int hrs, int min, int sec ) { - return timetstring(help.hms_to_seconds(hrs, min, sec)); + std::string tempstring = ""; + if (hrs > 0) + { + tempstring += help.String(hrs) + ":"; + } + tempstring += help.twodigits(min) + ":" + help.twodigits(sec); + return tempstring; } std::string Game::timestring(void) { - return giventimestring(hours, minutes, seconds); + std::string tempstring = ""; + if (hours > 0) + { + tempstring += help.String(hours) + ":"; + } + tempstring += help.twodigits(minutes) + ":" + help.twodigits(seconds); + return tempstring; +} + +std::string Game::partimestring(void) +{ + //given par time in seconds: + std::string tempstring = ""; + if (timetrialpar >= 60) + { + tempstring = help.twodigits(int((timetrialpar - (timetrialpar % 60)) / 60)) + ":" + help.twodigits(timetrialpar % 60); + } + else + { + tempstring = "00:" + help.twodigits(timetrialpar); + } + return tempstring; } std::string Game::resulttimestring(void) { //given result time in seconds: - char output[SCREEN_WIDTH_CHARS + 1]; - help.format_time(output, sizeof(output), timetrialresulttime, timetrialresultframes, true); - return output; + std::string tempstring = ""; + if (timetrialresulttime >= 60) + { + tempstring = help.twodigits(int((timetrialresulttime - (timetrialresulttime % 60)) / 60)) + ":" + + help.twodigits(timetrialresulttime % 60); + } + else + { + tempstring = "00:" + help.twodigits(timetrialresulttime); + } + tempstring += "." + help.twodigits(timetrialresultframes*100 / 30); + return tempstring; } std::string Game::timetstring( int t ) { //given par time in seconds: - char output[SCREEN_WIDTH_CHARS + 1]; - help.format_time(output, sizeof(output), t, -1, true); - return output; -} - -void Game::timestringcenti(char* buffer, const size_t buffer_size) -{ - help.format_time(buffer, buffer_size, help.hms_to_seconds(hours, minutes, seconds), frames, true); + std::string tempstring = ""; + if (t >= 60) + { + tempstring = help.twodigits(int((t - (t % 60)) / 60)) + ":" + help.twodigits(t % 60); + } + else + { + tempstring = "00:" + help.twodigits(t); + } + return tempstring; } void Game::returnmenu(void) { if (menustack.empty()) { - vlog_error("Error: returning to previous menu frame on empty stack!"); + puts("Error: returning to previous menu frame on empty stack!"); return; } - /* FIXME: Super bad kludge, don't hardcode this! */ - if (currentmenuname == Menu::ed_music) - { - music.fadeout(); - } - else if (currentmenuname == Menu::gamecompletecontinue - || currentmenuname == Menu::timetrialcomplete3 - || currentmenuname == Menu::gameover2 - || currentmenuname == Menu::nodeathmodecomplete2) - { - music.play(Music_PRESENTINGVVVVVV); - } - enum Menu::MenuName camefrom = currentmenuname; - MenuStackFrame& frame = menustack[menustack.size()-1]; //Store this in case createmenu() removes the stack frame @@ -6619,15 +5867,6 @@ void Game::returnmenu(void) { menustack.pop_back(); } - - /* FIXME: Even more horrible kludge! */ - if (camefrom == Menu::timetrialcomplete3) - { - if (can_unlock_ndm()) - { - unlock_ndm(); - } - } } void Game::returntomenu(enum Menu::MenuName t) @@ -6658,7 +5897,7 @@ void Game::returntomenu(enum Menu::MenuName t) void Game::createmenu( enum Menu::MenuName t, bool samemenu/*= false*/ ) { - if (t == Menu::mainmenu && !menutestmode) + if (t == Menu::mainmenu) { //Either we've just booted up the game or returned from gamemode //Whichever it is, we shouldn't have a stack, @@ -6683,145 +5922,116 @@ void Game::createmenu( enum Menu::MenuName t, bool samemenu/*= false*/ ) switch (t) { case Menu::mainmenu: - if (ingame_titlemode) - { - /* We shouldn't be here! */ - SDL_assert(0 && "Entering main menu from in-game options!"); - break; - } #if !defined(MAKEANDPLAY) - option(loc::gettext("play")); + option("play"); #endif - option(loc::gettext("levels")); - option(loc::gettext("options")); - if (loc::show_translator_menu) - { - option(loc::gettext("translator")); - } - option(loc::gettext("credits")); - option(loc::gettext("quit")); +#if !defined(NO_CUSTOM_LEVELS) + option("levels"); +#endif + option("options"); +#if !defined(MAKEANDPLAY) + option("credits"); +#endif + option("quit"); menuyoff = -10; maxspacing = 15; break; +#if !defined(NO_CUSTOM_LEVELS) case Menu::playerworlds: - option(loc::gettext("play a level")); - option(loc::gettext("level editor"), !editor_disabled); - if (!editor_disabled) - { - option(loc::gettext("open level folder"), FILESYSTEM_openDirectoryEnabled()); - option(loc::gettext("show level folder path")); - } - option(loc::gettext("return")); + option("play a level"); + #if !defined(NO_EDITOR) + option("level editor"); + #endif + option("open level folder", FILESYSTEM_openDirectoryEnabled()); + option("back to menu"); menuyoff = -40; maxspacing = 15; break; - case Menu::confirmshowlevelspath: - option(loc::gettext("no, don't show me")); - option(loc::gettext("yes, reveal the path")); - menuyoff = -10; - break; - case Menu::showlevelspath: - option(loc::gettext("return to levels")); - menuyoff = 60; - break; case Menu::levellist: - if(cl.ListOfMetaData.size()==0) + if(ed.ListOfMetaData.size()==0) { - option(loc::gettext("ok")); + option("ok"); menuyoff = -20; } else { - for(int i=0; i<(int) cl.ListOfMetaData.size(); i++) // FIXME: int/size_t! -flibit + for(int i=0; i<(int) ed.ListOfMetaData.size(); i++) // FIXME: int/size_t! -flibit { if(i>=levelpage*8 && i< (levelpage*8)+8) { - const std::string filename = cl.ListOfMetaData[i].filename.substr(7); - int score = 0; - if (customlevelstats.count(filename) > 0) + //This is, er, suboptimal. Whatever, life optimisation and all that + int tvar=-1; + for(size_t j=0; j=0) { - case 0: + switch (customlevelstats[tvar].score) + { + case 0: + { + static const char tmp[] = " "; + prefix = tmp; + break; + } + case 1: + { + static const char tmp[] = " * "; + prefix = tmp; + break; + } + case 3: + { + static const char tmp[] = "** "; + prefix = tmp; + break; + } + default: + SDL_assert(0 && "Unhandled menu text prefix!"); + prefix = ""; + break; + } + } + else { static const char tmp[] = " "; prefix = tmp; - break; } - case 1: - { - static const char tmp[] = " * "; - prefix = tmp; - break; - } - case 3: - { - static const char tmp[] = "** "; - prefix = tmp; - break; - } - default: - SDL_assert(0 && "Unhandled menu text prefix!"); - prefix = ""; - break; - } - const char* title = cl.ListOfMetaData[i].title.c_str(); - if (cl.ListOfMetaData[i].title_is_gettext) - { - title = loc::gettext(title); - } - /* We have to make sure the stars and spaces are consistently on the - * correct side of the title, no matter what bidi characters are in there. - * So just always let the bidi engine handle it, with a few control chars. */ char text[MENU_TEXT_BYTES]; - SDL_snprintf( - text, sizeof(text), - "%s%s%s%s%s", - // LRM or RLM depending on UI language, to make the stars aligned to left or right - UTF8_encode(font::is_rtl(PR_FONT_INTERFACE) ? 0x200F : 0x200E).bytes, - prefix, - // FIRST STRONG ISOLATE, to start an isolated block oriented however bidi sees fit - UTF8_encode(0x2068).bytes, - title, - // POP DIRECTIONAL ISOLATE, exit isolated level title - UTF8_encode(0x2069).bytes - ); + SDL_snprintf(text, sizeof(text), "%s%s", prefix, ed.ListOfMetaData[i].title.c_str()); for (size_t ii = 0; text[ii] != '\0'; ++ii) { text[ii] = SDL_tolower(text[ii]); } - option( - text, - true, - (cl.ListOfMetaData[i].title_is_gettext ? PR_FONT_INTERFACE : PR_FONT_IDX( - cl.ListOfMetaData[i].level_main_font_idx, font::is_rtl(PR_FONT_INTERFACE) - )) | PR_RTL_XFLIP - ); + option(text); } } - if (cl.ListOfMetaData.size() > 8) + if (ed.ListOfMetaData.size() > 8) { - if((size_t) ((levelpage*8)+8) isWindowed); + option("toggle filter"); + option("toggle analogue"); + option("toggle vsync"); + option("return"); menuyoff = -10; maxspacing = 15; break; case Menu::ed_settings: - option(loc::gettext("change description")); - option(loc::gettext("edit scripts")); - option(loc::gettext("change music")); - option(loc::gettext("editor ghosts")); - option(loc::gettext("load level")); - option(loc::gettext("save level")); - option(loc::gettext("options")); - option(loc::gettext("quit to main menu")); + option("change description"); + option("edit scripts"); + option("change music"); + option("editor ghosts"); + option("load level"); + option("save level"); + option("options"); + option("quit to main menu"); menuyoff = -20; maxspacing = 15; break; case Menu::ed_desc: - option(loc::gettext("change name")); - option(loc::gettext("change author")); - option(loc::gettext("change description")); - option(loc::gettext("change website")); - option(loc::gettext("change font")); - option(loc::gettext("return")); + option("change name"); + option("change author"); + option("change description"); + option("change website"); + option("back to settings"); menuyoff = 6; maxspacing = 15; break; case Menu::ed_music: - option(loc::gettext("next song")); - option(loc::gettext("previous song")); - option(loc::gettext("return")); + option("next song"); + option("previous song"); + option("back"); menuyoff = 16; maxspacing = 15; break; case Menu::ed_quit: - option(loc::gettext("yes, save and quit")); - option(loc::gettext("no, quit without saving")); - option(loc::gettext("return to editor")); + option("yes, save and quit"); + option("no, quit without saving"); + option("return to editor"); menuyoff = 8; maxspacing = 15; break; - case Menu::ed_font: - { - int option_match = -1; - for (uint8_t i = 0; i < font::font_idx_options_n; i++) - { - uint8_t idx = font::font_idx_options[i]; - option(font::get_main_font_display_name(idx), true, PR_FONT_IDX(idx, font::is_rtl(PR_FONT_INTERFACE)) | PR_RTL_XFLIP); - if (font::level_font_is_main_idx(idx)) - { - option_match = i; - } - } - - currentmenuoption = option_match != -1 ? option_match : 0; - maxspacing = 15; - break; - } case Menu::options: - option(loc::gettext("gameplay")); - option(loc::gettext("graphics")); - option(loc::gettext("audio")); - option(loc::gettext("game pad")); - option(loc::gettext("accessibility")); - option(loc::gettext("language"), !translator_cutscene_test); - option(loc::gettext("return")); + option("gameplay"); + option("graphics"); + option("audio"); + option("game pad"); + option("accessibility"); + option("return"); menuyoff = 0; maxspacing = 15; break; case Menu::speedrunneroptions: - option(loc::gettext("glitchrunner mode")); - option(loc::gettext("input delay")); - option(loc::gettext("interact button")); - option(loc::gettext("fake load screen")); - option(loc::gettext("toggle in-game timer")); - option(loc::gettext("english sprites")); - option(loc::gettext("return")); + option("glitchrunner mode"); + option("input delay"); + option("interact button"); + option("fake load screen"); + option("toggle in-game timer"); + option("return"); menuyoff = 0; maxspacing = 15; break; @@ -6964,222 +6149,125 @@ void Game::createmenu( enum Menu::MenuName t, bool samemenu/*= false*/ ) { int i; - option(loc::gettext("none")); + option("none"); for (i = 1; i < GlitchrunnerNumVersions; ++i) { - option(loc::gettext(GlitchrunnerMode_enum_to_string((enum GlitchrunnerMode) i))); + option(GlitchrunnerMode_enum_to_string((enum GlitchrunnerMode) i)); } break; } case Menu::advancedoptions: - option(loc::gettext("unfocus pause")); - option(loc::gettext("unfocus audio pause")); - option(loc::gettext("room name background")); - option(loc::gettext("checkpoint saving")); - option(loc::gettext("return")); + option("unfocus pause"); + option("unfocus audio pause"); + option("room name background"); + option("return"); menuyoff = 0; maxspacing = 15; break; case Menu::audiooptions: - option(loc::gettext("music volume")); - option(loc::gettext("sound volume")); + option("music volume"); + option("sound volume"); if (music.mmmmmm) { - option(loc::gettext("soundtrack")); + option("soundtrack"); } - option(loc::gettext("return")); + option("return"); menuyoff = 0; maxspacing = 15; break; case Menu::accessibility: #if !defined(MAKEANDPLAY) - option(loc::gettext("unlock play modes")); + option("unlock play modes"); #endif - option(loc::gettext("invincibility"), !ingame_titlemode || !incompetitive()); - option(loc::gettext("slowdown"), !ingame_titlemode || !incompetitive()); - option(loc::gettext("animated backgrounds")); - option(loc::gettext("screen effects")); - option(loc::gettext("text outline")); - option(loc::gettext("return")); + option("invincibility", !ingame_titlemode || !incompetitive()); + option("slowdown", !ingame_titlemode || !incompetitive()); + option("animated backgrounds"); + option("screen effects"); + option("text outline"); + option("return"); menuyoff = 0; maxspacing = 15; break; case Menu::controller: - option(loc::gettext("analog stick sensitivity")); - option(loc::gettext("bind flip")); - option(loc::gettext("bind enter")); - option(loc::gettext("bind menu")); - option(loc::gettext("bind restart")); - option(loc::gettext("bind interact"), separate_interact); - option(loc::gettext("return")); - menuyoff = 12; + option("analog stick sensitivity"); + option("bind flip"); + option("bind enter"); + option("bind menu"); + option("bind restart"); + option("bind interact"); + option("return"); + menuyoff = 0; maxspacing = 10; break; - case Menu::language: - if (loc::languagelist.empty()) - { - option(loc::gettext("ok")); - menuyoff = -20; - } - else - { - for (size_t i = 0; i < loc::languagelist.size(); i++) - { - if (loc::languagelist[i].nativename.empty()) - { - option(loc::languagelist[i].code.c_str()); - } - else - { - option( - loc::languagelist[i].nativename.c_str(), - true, - PR_FONT_IDX(loc::languagelist[i].font_idx, loc::languagelist[i].rtl) - ); - } - } - - menuyoff = 70-(menuoptions.size()*10); - maxspacing = 5; - } - break; - case Menu::translator_main: - option(loc::gettext("translator options")); - option(loc::gettext("maintenance")); - option(loc::gettext("open lang folder"), FILESYSTEM_openDirectoryEnabled()); - option(loc::gettext("return")); - menuyoff = 0; - break; - case Menu::translator_options: - option(loc::gettext("language statistics")); - option(loc::gettext("translate room names")); - option(loc::gettext("explore game")); - option(loc::gettext("menu test")); - option(loc::gettext("cutscene test"), loc::lang != "en"); - option(loc::gettext("limits check")); - option(loc::gettext("return")); - menuyoff = 0; - break; - case Menu::translator_options_limitscheck: - option(loc::gettext("next page")); - option(loc::gettext("return")); - menuyoff = 64; - break; - case Menu::translator_options_stats: - option(loc::gettext("return")); - menuyoff = 64; - break; - case Menu::translator_options_exploregame: - option(loc::gettext("space station 1")); - option(loc::gettext("the laboratory")); - option(loc::gettext("the tower")); - option(loc::gettext("space station 2")); - option(loc::gettext("the warp zone")); - option(loc::gettext("intermission 1")); - option(loc::gettext("intermission 2")); - option(loc::gettext("the final level")); - option(loc::gettext("return")); - menuyoff = -20; - break; - case Menu::translator_options_cutscenetest: - for ( - size_t i = (cutscenetest_menu_page*14); - i < (cutscenetest_menu_page*14)+14 && i < loc::testable_script_ids.size(); - i++ - ) - { - option(loc::testable_script_ids[i].c_str()); - } - if((cutscenetest_menu_page*14)+14 < loc::testable_script_ids.size()) - { - option(loc::gettext("next page")); - } - else - { - option(loc::gettext("first page")); - } - if (cutscenetest_menu_page == 0) - { - option(loc::gettext("last page")); - } - else - { - option(loc::gettext("previous page")); - } - option(loc::gettext("from clipboard")); - option(loc::gettext("return")); - - menuxoff = 20; - menuyoff = 55-(menuoptions.size()*10); - menuspacing = 5; - return; // skip automatic centering, will turn out bad with scripts list - case Menu::translator_maintenance: - option(loc::gettext("sync language files")); - option(loc::gettext("global statistics"), false); - option(loc::gettext("global limits check")); - option(loc::gettext("return")); - menuyoff = 0; - break; - case Menu::translator_maintenance_sync: - option(loc::gettext("sync")); - option(loc::gettext("return")); - menuyoff = 64; - break; - case Menu::translator_error_setlangwritedir: - option(loc::gettext("ok")); - menuyoff = 10; - break; case Menu::cleardatamenu: case Menu::clearcustomdatamenu: - option(loc::gettext("no! don't delete")); - option(loc::gettext("yes, delete everything")); + option("no! don't delete"); + option("yes, delete everything"); menuyoff = 64; break; case Menu::setinvincibility: - option(loc::gettext("no, return to options")); - option(loc::gettext("yes, enable")); + option("no, return to options"); + option("yes, enable"); menuyoff = 64; break; case Menu::setslowdown: - option(loc::gettext("normal speed")); - option(loc::gettext("80% speed")); - option(loc::gettext("60% speed")); - option(loc::gettext("40% speed")); + option("normal speed"); + option("80% speed"); + option("60% speed"); + option("40% speed"); menuyoff = 16; break; case Menu::unlockmenu: - option(loc::gettext("unlock time trials")); - option(loc::gettext("unlock intermissions"), !unlock[Unlock_INTERMISSION_REPLAYS]); - option(loc::gettext("unlock no death mode"), !unlock[Unlock_NODEATHMODE]); - option(loc::gettext("unlock flip mode"), !unlock[Unlock_FLIPMODE]); - option(loc::gettext("unlock ship jukebox"), (stat_trinkets<20)); - option(loc::gettext("unlock secret lab"), !unlock[Unlock_SECRETLAB]); - option(loc::gettext("return")); + option("unlock time trials"); + option("unlock intermissions", !unlock[16]); + option("unlock no death mode", !unlock[17]); + option("unlock flip mode", !unlock[18]); + option("unlock ship jukebox", (stat_trinkets<20)); + option("unlock secret lab", !unlock[8]); + option("return"); menuyoff = -20; break; case Menu::credits: - option(loc::gettext("next page")); - option(loc::gettext("last page")); - option(loc::gettext("return")); + option("next page"); + option("last page"); + option("return"); menuyoff = 64; break; case Menu::credits2: + option("next page"); + option("previous page"); + option("return"); + menuyoff = 64; + break; case Menu::credits25: + option("next page"); + option("previous page"); + option("return"); + menuyoff = 64; + break; case Menu::credits3: + option("next page"); + option("previous page"); + option("return"); + menuyoff = 64; + break; case Menu::credits4: + option("next page"); + option("previous page"); + option("return"); + menuyoff = 64; + break; case Menu::credits5: - case Menu::credits_localisations_implementation: - case Menu::credits_localisations_translations: - option(loc::gettext("next page")); - option(loc::gettext("previous page")); - option(loc::gettext("return")); + option("next page"); + option("previous page"); + option("return"); menuyoff = 64; break; case Menu::credits6: - option(loc::gettext("first page")); - option(loc::gettext("previous page")); - option(loc::gettext("return")); + option("first page"); + option("previous page"); + option("return"); menuyoff = 64; break; case Menu::play: @@ -7187,74 +6275,44 @@ void Game::createmenu( enum Menu::MenuName t, bool samemenu/*= false*/ ) //Ok, here's where the unlock stuff comes into it: //First up, time trials: int temp = 0; - if (unlock[Unlock_SPACESTATION1_COMPLETE] - && stat_trinkets >= 3 - && !unlocknotify[Unlock_TIMETRIAL_SPACESTATION1]) - { - temp++; - } - if (unlock[Unlock_LABORATORY_COMPLETE] - && stat_trinkets >= 6 - && !unlocknotify[Unlock_TIMETRIAL_LABORATORY]) - { - temp++; - } - if (unlock[Unlock_TOWER_COMPLETE] - && stat_trinkets >= 9 - && !unlocknotify[Unlock_TIMETRIAL_TOWER]) - { - temp++; - } - if (unlock[Unlock_SPACESTATION2_COMPLETE] - && stat_trinkets >= 12 - && !unlocknotify[Unlock_TIMETRIAL_SPACESTATION2]) - { - temp++; - } - if (unlock[Unlock_WARPZONE_COMPLETE] - && stat_trinkets >= 15 - && !unlocknotify[Unlock_TIMETRIAL_WARPZONE]) - { - temp++; - } - if (unlock[UnlockTrophy_GAME_COMPLETE] - && stat_trinkets >= 18 - && !unlocknotify[Unlock_TIMETRIAL_FINALLEVEL]) - { - temp++; - } + if (unlock[0] && stat_trinkets >= 3 && !unlocknotify[9]) temp++; + if (unlock[1] && stat_trinkets >= 6 && !unlocknotify[10]) temp++; + if (unlock[2] && stat_trinkets >= 9 && !unlocknotify[11]) temp++; + if (unlock[3] && stat_trinkets >= 12 && !unlocknotify[12]) temp++; + if (unlock[4] && stat_trinkets >= 15 && !unlocknotify[13]) temp++; + if (unlock[5] && stat_trinkets >= 18 && !unlocknotify[14]) temp++; if (temp > 0) { //you've unlocked a time trial! - if (unlock[Unlock_SPACESTATION1_COMPLETE] && stat_trinkets >= 3) + if (unlock[0] && stat_trinkets >= 3) { - unlocknotify[Unlock_TIMETRIAL_SPACESTATION1] = true; - unlock[Unlock_TIMETRIAL_SPACESTATION1] = true; + unlocknotify[9] = true; + unlock[9] = true; } - if (unlock[Unlock_LABORATORY_COMPLETE] && stat_trinkets >= 6) + if (unlock[1] && stat_trinkets >= 6) { - unlocknotify[Unlock_TIMETRIAL_LABORATORY] = true; - unlock[Unlock_TIMETRIAL_LABORATORY] = true; + unlocknotify[10] = true; + unlock[10] = true; } - if (unlock[Unlock_TOWER_COMPLETE] && stat_trinkets >= 9) + if (unlock[2] && stat_trinkets >= 9) { - unlocknotify[Unlock_TIMETRIAL_TOWER] = true; - unlock[Unlock_TIMETRIAL_TOWER] = true; + unlocknotify[11] = true; + unlock[11] = true; } - if (unlock[Unlock_SPACESTATION2_COMPLETE] && stat_trinkets >= 12) + if (unlock[3] && stat_trinkets >= 12) { - unlocknotify[Unlock_TIMETRIAL_SPACESTATION2] = true; - unlock[Unlock_TIMETRIAL_SPACESTATION2] = true; + unlocknotify[12] = true; + unlock[12] = true; } - if (unlock[Unlock_WARPZONE_COMPLETE] && stat_trinkets >= 15) + if (unlock[4] && stat_trinkets >= 15) { - unlocknotify[Unlock_TIMETRIAL_WARPZONE] = true; - unlock[Unlock_TIMETRIAL_WARPZONE] = true; + unlocknotify[13] = true; + unlock[13] = true; } - if (unlock[UnlockTrophy_GAME_COMPLETE] && stat_trinkets >= 18) + if (unlock[5] && stat_trinkets >= 18) { - unlocknotify[Unlock_TIMETRIAL_FINALLEVEL] = true; - unlock[Unlock_TIMETRIAL_FINALLEVEL] = true; + unlocknotify[14] = true; + unlock[14] = true; } if (temp == 1) @@ -7271,25 +6329,34 @@ void Game::createmenu( enum Menu::MenuName t, bool samemenu/*= false*/ ) else { //Alright, we haven't unlocked any time trials. How about no death mode? - if (can_unlock_ndm()) + temp = 0; + if (bestrank[0] >= 2) temp++; + if (bestrank[1] >= 2) temp++; + if (bestrank[2] >= 2) temp++; + if (bestrank[3] >= 2) temp++; + if (bestrank[4] >= 2) temp++; + if (bestrank[5] >= 2) temp++; + if (temp >= 4 && !unlocknotify[17]) { - unlock_ndm(); + //Unlock No Death Mode + unlocknotify[17] = true; + unlock[17] = true; + createmenu(Menu::unlocknodeathmode, true); + savestatsandsettings(); } //Alright then! Flip mode? - else if (unlock[UnlockTrophy_GAME_COMPLETE] - && !unlocknotify[Unlock_FLIPMODE]) + else if (unlock[5] && !unlocknotify[18]) { - unlock[Unlock_FLIPMODE] = true; - unlocknotify[Unlock_FLIPMODE] = true; + unlock[18] = true; + unlocknotify[18] = true; createmenu(Menu::unlockflipmode, true); savestatsandsettings(); } //What about the intermission levels? - else if (unlock[Unlock_INTERMISSION2_COMPLETE] - && !unlocknotify[Unlock_INTERMISSION_REPLAYS]) + else if (unlock[7] && !unlocknotify[16]) { - unlock[Unlock_INTERMISSION_REPLAYS] = true; - unlocknotify[Unlock_INTERMISSION_REPLAYS] = true; + unlock[16] = true; + unlocknotify[16] = true; createmenu(Menu::unlockintermission, true); savestatsandsettings(); } @@ -7297,24 +6364,24 @@ void Game::createmenu( enum Menu::MenuName t, bool samemenu/*= false*/ ) { if (save_exists()) { - option(loc::gettext("continue")); + option("continue"); } else { - option(loc::gettext("new game")); + option("new game"); } //ok, secret lab! no notification, but test: - if (unlock[Unlock_SECRETLAB]) + if (unlock[8]) { - option(loc::gettext("secret lab")); + option("secret lab"); } - option(loc::gettext("play modes")); + option("play modes"); if (save_exists()) { - option(loc::gettext("new game")); + option("new game"); } - option(loc::gettext("return")); - if (unlock[Unlock_SECRETLAB]) + option("return"); + if (unlock[8]) { menuyoff = -30; } @@ -7331,58 +6398,56 @@ void Game::createmenu( enum Menu::MenuName t, bool samemenu/*= false*/ ) case Menu::unlocknodeathmode: case Menu::unlockintermission: case Menu::unlockflipmode: - option(loc::gettext("proceed")); + option("continue"); menuyoff = 70; break; case Menu::newgamewarning: - option(loc::gettext("start new game")); - option(loc::gettext("return")); + option("start new game"); + option("return to menu"); menuyoff = 64; break; case Menu::playmodes: - option(loc::gettext("time trials"), !nocompetitive_unless_translator()); - option(loc::gettext("intermissions"), unlock[Unlock_INTERMISSION_REPLAYS]); - option(loc::gettext("no death mode"), unlock[Unlock_NODEATHMODE] && !nocompetitive()); - option(loc::gettext("flip mode"), unlock[Unlock_FLIPMODE]); - option(loc::gettext("return")); + option("time trials", !nocompetitive()); + option("intermissions", unlock[16]); + option("no death mode", unlock[17] && !nocompetitive()); + option("flip mode", unlock[18]); + option("return to play menu"); menuyoff = 8; maxspacing = 20; break; case Menu::intermissionmenu: - option(loc::gettext("play intermission 1")); - option(loc::gettext("play intermission 2")); - option(loc::gettext("return")); + option("play intermission 1"); + option("play intermission 2"); + option("return to play menu"); menuyoff = -35; break; case Menu::playint1: - start_translator_exploring = false; - option(loc::gettext_case("Vitellary", 1)); - option(loc::gettext_case("Vermilion", 1)); - option(loc::gettext_case("Verdigris", 1)); - option(loc::gettext_case("Victoria", 1)); - option(loc::gettext("return")); + option("Vitellary"); + option("Vermilion"); + option("Verdigris"); + option("Victoria"); + option("return"); menuyoff = 10; break; case Menu::playint2: - start_translator_exploring = false; - option(loc::gettext_case("Vitellary", 1)); - option(loc::gettext_case("Vermilion", 1)); - option(loc::gettext_case("Verdigris", 1)); - option(loc::gettext_case("Victoria", 1)); - option(loc::gettext("return")); + option("Vitellary"); + option("Vermilion"); + option("Verdigris"); + option("Victoria"); + option("return"); menuyoff = 10; break; case Menu::continuemenu: map.settowercolour(3); - option(loc::gettext("continue from teleporter")); - option(loc::gettext("continue from quicksave")); - option(loc::gettext("return")); + option("continue from teleporter"); + option("continue from quicksave"); + option("return to play menu"); menuyoff = 20; break; case Menu::startnodeathmode: - option(loc::gettext("disable cutscenes")); - option(loc::gettext("enable cutscenes")); - option(loc::gettext("return")); + option("disable cutscenes"); + option("enable cutscenes"); + option("return to play menu"); menuyoff = 40; break; case Menu::gameover: @@ -7390,35 +6455,29 @@ void Game::createmenu( enum Menu::MenuName t, bool samemenu/*= false*/ ) menudest=Menu::gameover2; break; case Menu::gameover2: - option(loc::gettext("return to play menu")); + option("return to play menu"); menuyoff = 80; break; case Menu::unlockmenutrials: - option(loc::gettext("space station 1"), !unlock[Unlock_TIMETRIAL_SPACESTATION1]); - option(loc::gettext("the laboratory"), !unlock[Unlock_TIMETRIAL_LABORATORY]); - option(loc::gettext("the tower"), !unlock[Unlock_TIMETRIAL_TOWER]); - option(loc::gettext("space station 2"), !unlock[Unlock_TIMETRIAL_SPACESTATION2]); - option(loc::gettext("the warp zone"), !unlock[Unlock_TIMETRIAL_WARPZONE]); - option(loc::gettext("the final level"), !unlock[Unlock_TIMETRIAL_FINALLEVEL]); + option("space station 1", !unlock[9]); + option("the laboratory", !unlock[10]); + option("the tower", !unlock[11]); + option("space station 2", !unlock[12]); + option("the warp zone", !unlock[13]); + option("the final level", !unlock[14]); - option(loc::gettext("return")); + option("return to unlock menu"); menuyoff = 0; break; case Menu::timetrials: - option(loc::gettext(unlock[Unlock_TIMETRIAL_SPACESTATION1] ? "space station 1" : "???"), - unlock[Unlock_TIMETRIAL_SPACESTATION1]); - option(loc::gettext(unlock[Unlock_TIMETRIAL_LABORATORY] ? "the laboratory" : "???"), - unlock[Unlock_TIMETRIAL_LABORATORY]); - option(loc::gettext(unlock[Unlock_TIMETRIAL_TOWER] ? "the tower" : "???"), - unlock[Unlock_TIMETRIAL_TOWER]); - option(loc::gettext(unlock[Unlock_TIMETRIAL_SPACESTATION2] ? "space station 2" : "???"), - unlock[Unlock_TIMETRIAL_SPACESTATION2]); - option(loc::gettext(unlock[Unlock_TIMETRIAL_WARPZONE] ? "the warp zone" : "???"), - unlock[Unlock_TIMETRIAL_WARPZONE]); - option(loc::gettext(unlock[Unlock_TIMETRIAL_FINALLEVEL] ? "the final level" : "???"), - unlock[Unlock_TIMETRIAL_FINALLEVEL]); + option(unlock[9] ? "space station 1" : "???", unlock[9]); + option(unlock[10] ? "the laboratory" : "???", unlock[10]); + option(unlock[11] ? "the tower" : "???", unlock[11]); + option(unlock[12] ? "space station 2" : "???", unlock[12]); + option(unlock[13] ? "the warp zone" : "???", unlock[13]); + option(unlock[14] ? "the final level" : "???", unlock[14]); - option(loc::gettext("return")); + option("return to play menu"); menuyoff = 0; maxspacing = 15; break; @@ -7427,7 +6486,7 @@ void Game::createmenu( enum Menu::MenuName t, bool samemenu/*= false*/ ) menudest = Menu::nodeathmodecomplete2; break; case Menu::nodeathmodecomplete2: - option(loc::gettext("return to play menu")); + option("return to play menu"); menuyoff = 70; break; case Menu::timetrialcomplete: @@ -7439,22 +6498,22 @@ void Game::createmenu( enum Menu::MenuName t, bool samemenu/*= false*/ ) menudest=Menu::timetrialcomplete3; break; case Menu::timetrialcomplete3: - option(loc::gettext("return to play menu")); - option(loc::gettext("try again")); + option("return to play menu"); + option("try again"); menuyoff = 70; break; case Menu::gamecompletecontinue: - option(loc::gettext("return to play menu")); + option("return to play menu"); menuyoff = 70; break; case Menu::errorsavingsettings: - option(loc::gettext("ok")); - option(loc::gettext("silence")); + option("ok"); + option("silence"); menuyoff = 10; break; case Menu::errorloadinglevel: case Menu::warninglevellist: - option(loc::gettext("ok")); + option("ok"); menuyoff = 50; break; } @@ -7472,7 +6531,7 @@ void Game::createmenu( enum Menu::MenuName t, bool samemenu/*= false*/ ) menuwidth = 0; for (size_t i = 0; i < menuoptions.size(); i++) { - int width = i*menuspacing + font::len(menuoptions[i].print_flags, menuoptions[i].text); + int width = i*menuspacing + graphics.len(menuoptions[i].text); if (width > menuwidth) menuwidth = width; } @@ -7480,58 +6539,20 @@ void Game::createmenu( enum Menu::MenuName t, bool samemenu/*= false*/ ) menuxoff = (320-menuwidth)/2; } -bool Game::can_unlock_ndm(void) -{ - int temp = 0; - if (bestrank[TimeTrial_SPACESTATION1] >= 2) temp++; - if (bestrank[TimeTrial_LABORATORY] >= 2) temp++; - if (bestrank[TimeTrial_TOWER] >= 2) temp++; - if (bestrank[TimeTrial_SPACESTATION2] >= 2) temp++; - if (bestrank[TimeTrial_WARPZONE] >= 2) temp++; - if (bestrank[TimeTrial_FINALLEVEL] >= 2) temp++; - return temp >= 4 && !unlocknotify[Unlock_NODEATHMODE]; -} - -void Game::unlock_ndm(void) -{ - unlocknotify[Unlock_NODEATHMODE] = true; - unlock[Unlock_NODEATHMODE] = true; - createmenu(Menu::unlocknodeathmode, true); - savestatsandsettings(); -} - void Game::deletequick(void) { - if (inspecial() || map.custommode) - { - return; - } - - if (!FILESYSTEM_delete("saves/qsave.vvv")) - { - vlog_error("Error deleting saves/qsave.vvv"); - } + if( !FILESYSTEM_delete( "saves/qsave.vvv" ) ) + puts("Error deleting saves/qsave.vvv"); else - { - SDL_zero(last_quicksave); - } + quicksummary = ""; } void Game::deletetele(void) { - if (inspecial() || map.custommode) - { - return; - } - - if (!FILESYSTEM_delete("saves/tsave.vvv")) - { - vlog_error("Error deleting saves/tsave.vvv"); - } + if( !FILESYSTEM_delete( "saves/tsave.vvv" ) ) + puts("Error deleting saves/tsave.vvv"); else - { - SDL_zero(last_telesave); - } + telesummary = ""; } void Game::customdeletequick(const std::string& file) @@ -7540,7 +6561,7 @@ void Game::customdeletequick(const std::string& file) if (!FILESYSTEM_delete(path.c_str())) { - vlog_error("Error deleting %s", path.c_str()); + printf("Error deleting %s\n", path.c_str()); } } @@ -7685,37 +6706,14 @@ bool Game::anything_unlocked(void) bool Game::save_exists(void) { - return last_telesave.exists || last_quicksave.exists; -} - -static void hardreset(void) -{ - script.hardreset(); -} - -static void returntoeditor_callback(void) -{ - extern Game game; - game.returntoeditor(); - ed.show_note(loc::gettext("Level quits to menu")); + return telesummary != "" || quicksummary != ""; } void Game::quittomenu(void) { - if (gamestate != EDITORMODE && map.custommode && !map.custommodeforreal) - { - /* We are playtesting! Go back to the editor - * instead of losing unsaved changes. */ - /* This needs to be deferred, otherwise some state would persist. */ - DEFER_CALLBACK(returntoeditor_callback); - return; - } - gamestate = TITLEMODE; - graphics.fademode = FADE_START_FADEIN; + graphics.fademode = 4; FILESYSTEM_unmountAssets(); - loc::unloadtext_custom(); - font::unload_custom(); cliplaytest = false; graphics.titlebg.tdrawback = true; graphics.flipmode = false; @@ -7723,15 +6721,7 @@ void Game::quittomenu(void) //or "who do you want to play the level with?" //or "do you want cutscenes?" //or the confirm-load-quicksave menu - if (translator_cutscene_test) - { - returntomenu(Menu::translator_options_cutscenetest); - } - else if (translator_exploring) - { - returntomenu(Menu::translator_options_exploregame); - } - else if (intimetrial) + if (intimetrial) { returntomenu(Menu::timetrials); } @@ -7752,7 +6742,6 @@ void Game::quittomenu(void) else { //Returning from editor - editor_disabled = !BUTTONGLYPHS_keyboard_is_available(); returntomenu(Menu::playerworlds); } } @@ -7769,15 +6758,13 @@ void Game::quittomenu(void) { createmenu(Menu::mainmenu); } - /* We might not be at the end of the frame yet. - * If we hardreset() now, some state might still persist. */ - DEFER_CALLBACK(hardreset); + script.hardreset(); } void Game::returntolab(void) { gamestate = GAMEMODE; - graphics.fademode = FADE_START_FADEIN; + graphics.fademode = 4; map.gotoroom(119, 107); int player = obj.getplayer(); if (INBOUNDS_VEC(player, obj.entities)) @@ -7798,9 +6785,10 @@ void Game::returntolab(void) savedir = obj.entities[player].dir; } - music.play(Music_PIPEDREAM); + music.play(11); } +#if !defined(NO_CUSTOM_LEVELS) static void resetbg(void) { graphics.backgrounddrawn = false; @@ -7810,37 +6798,33 @@ void Game::returntoeditor(void) { gamestate = EDITORMODE; - graphics.textboxes.clear(); + graphics.textbox.clear(); hascontrol = true; advancetext = false; completestop = false; - setstate(0); + state = 0; graphics.showcutscenebars = false; - graphics.fademode = FADE_NONE; + graphics.fademode = 0; ed.keydelay = 6; ed.settingskey = true; - ed.old_note_timer = 0; - ed.note_timer = 0; + ed.oldnotedelay = 0; + ed.notedelay = 0; ed.roomnamehide = 0; - // Might've been changed in a script - font::set_level_font(cl.level_font_name.c_str()); - DEFER_CALLBACK(resetbg); music.fadeout(); //If warpdir() is used during playtesting, we need to set it back after! - for (int j = 0; j < cl.maxheight; j++) + for (int j = 0; j < ed.maxheight; j++) { - for (int i = 0; i < cl.maxwidth; i++) + for (int i = 0; i < ed.maxwidth; i++) { - cl.roomproperties[i+(j*cl.maxwidth)].warpdir=ed.kludgewarpdir[i+(j*cl.maxwidth)]; + ed.level[i+(j*ed.maxwidth)].warpdir=ed.kludgewarpdir[i+(j*ed.maxwidth)]; } } graphics.titlebg.scrolldir = 0; - graphics.backgrounddrawn = false; - graphics.foregrounddrawn = false; } +#endif static void returntoingametemp(void) { @@ -7848,11 +6832,13 @@ static void returntoingametemp(void) game.returntomenu(game.kludge_ingametemp); } +#if !defined(NO_CUSTOM_LEVELS) && !defined(NO_EDITOR) static void returntoedsettings(void) { extern Game game; game.returntomenu(Menu::ed_settings); } +#endif static void nextbgcolor(void) { @@ -7873,7 +6859,7 @@ void Game::returntoingame(void) { ingame_titlemode = false; mapheld = true; - +#if !defined(NO_CUSTOM_LEVELS) && !defined(NO_EDITOR) if (ingame_editormode) { ingame_editormode = false; @@ -7882,6 +6868,7 @@ void Game::returntoingame(void) ed.settingskey = true; } else +#endif { DEFER_CALLBACK(returntoingametemp); gamestate = MAPMODE; @@ -7893,44 +6880,28 @@ void Game::returntoingame(void) } } DEFER_CALLBACK(nextbgcolor); - - if (nocompetitive()) - { - invalidate_ndm_trophy(); - } } -void Game::unlockAchievement(const char* name) -{ -#ifdef MAKEANDPLAY - UNUSED(name); -#else - if (map.custommode) - { - return; - } - - vlog_debug("Achievement \"%s\" unlocked.", name); - NETWORK_unlockAchievement(name); +void Game::unlockAchievement(const char *name) { +#if !defined(MAKEANDPLAY) + if (!map.custommode) NETWORK_unlockAchievement(name); #endif } -void Game::mapmenuchange(const enum GameGamestate newgamestate, const bool user_initiated) +void Game::mapmenuchange(const int newgamestate) { - if (user_initiated && graphics.resumegamemode) - { - return; - } - prevgamestate = gamestate; gamestate = newgamestate; graphics.resumegamemode = false; mapheld = true; - gameScreen.recacheTextures(); if (prevgamestate == GAMEMODE) { graphics.menuoffset = 240; + if (map.extrarow) + { + graphics.menuoffset -= 10; + } } else { @@ -7944,28 +6915,11 @@ void Game::copyndmresults(void) ndmresultcrewrescued = crewrescued(); ndmresulttrinkets = trinkets(); ndmresulthardestroom = hardestroom; - ndmresulthardestroom_x = hardestroom_x; - ndmresulthardestroom_y = hardestroom_y; - ndmresulthardestroom_specialname = hardestroom_specialname; SDL_memcpy(ndmresultcrewstats, crewstats, sizeof(ndmresultcrewstats)); } -void Game::invalidate_ndm_trophy(void) +static inline int get_framerate(const int slowdown) { - if (nodeatheligible) - { - vlog_debug("NDM trophy is invalidated!"); - } - nodeatheligible = false; -} - -static inline int get_framerate(const int slowdown, const int deathseq) -{ - if (deathseq != -1) - { - return 34; - } - switch (slowdown) { case 30: @@ -7983,36 +6937,23 @@ static inline int get_framerate(const int slowdown, const int deathseq) int Game::get_timestep(void) { - if ((gamestate == GAMEMODE || (gamestate == TELEPORTERMODE && !useteleporter)) && - level_debugger::is_active() && - !level_debugger::is_pausing() && - key.isDown(SDLK_f)) - { - return 1; - } - switch (gamestate) { + case EDITORMODE: + return 24; case GAMEMODE: - return get_framerate(slowdown, deathseq); + return get_framerate(slowdown); default: return 34; } } -bool Game::physics_frozen(void) -{ - return roomname_translator::is_pausing() || level_debugger::is_pausing(); -} - bool Game::incompetitive(void) { return ( !map.custommode && swnmode - && (swngame == SWN_SUPERGRAVITRON || - swngame == SWN_START_SUPERGRAVITRON_STEP_1 || - swngame == SWN_START_SUPERGRAVITRON_STEP_2) + && (swngame == 1 || swngame == 6 || swngame == 7) ) || intimetrial || nodeathmode; @@ -8023,20 +6964,7 @@ bool Game::nocompetitive(void) return slowdown < 30 || map.invincibility; } -bool Game::nocompetitive_unless_translator(void) -{ - return slowdown < 30 || (map.invincibility && !roomname_translator::enabled); -} - -void Game::sabotage_time_trial(void) -{ - timetrialcheater = true; - hours++; - deathcounts += 100; - timetrialparlost = true; -} - -bool Game::isingamecompletescreen(void) +bool Game::isingamecompletescreen() { return (state >= 3501 && state <= 3518) || (state >= 3520 && state <= 3522); } diff --git a/desktop_version/src/Game.h b/desktop_version/src/Game.h index b053d1b4..c52cd954 100644 --- a/desktop_version/src/Game.h +++ b/desktop_version/src/Game.h @@ -2,20 +2,11 @@ #define GAME_H #include -#include #include #include -#include "Font.h" #include "ScreenSettings.h" -/* FIXME: Can't forward declare this enum in C++, unfortunately. - * In C, enum sizes are always the same, so you can forward declare them. - * In C++ instead, enum sizes are based on how many enums there are. - * You cannot specify the underlying type until C++11. - * But bumping the standard opens up a can of worms. I'd rather just move to C. -Misa */ -#include "Enums.h" - // Forward decl without including all of namespace tinyxml2 { @@ -30,7 +21,6 @@ struct MenuOption { char text[MENU_TEXT_BYTES]; bool active; - uint32_t print_flags; }; //Menu IDs @@ -40,8 +30,6 @@ namespace Menu { mainmenu, playerworlds, - confirmshowlevelspath, - showlevelspath, levellist, quickloadlevel, deletequicklevel, @@ -55,7 +43,6 @@ namespace Menu ed_desc, ed_music, ed_quit, - ed_font, options, gameplayoptions, speedrunneroptions, @@ -64,16 +51,6 @@ namespace Menu audiooptions, accessibility, controller, - language, - translator_main, - translator_options, - translator_options_limitscheck, - translator_options_stats, - translator_options_exploregame, - translator_options_cutscenetest, - translator_maintenance, - translator_maintenance_sync, - translator_error_setlangwritedir, cleardatamenu, clearcustomdatamenu, setinvincibility, @@ -86,8 +63,6 @@ namespace Menu credits4, credits5, credits6, - credits_localisations_implementation, - credits_localisations_translations, play, unlocktimetrial, unlocktimetrials, @@ -121,73 +96,23 @@ enum SLIDERMODE SLIDER_SOUNDVOLUME }; -/* enums for swngame variable */ -enum SWNMODE -{ - SWN_GRAVITRON, - SWN_SUPERGRAVITRON, - SWN_START_GRAVITRON_STEP_3, - SWN_START_GRAVITRON_STEP_2, - SWN_START_GRAVITRON_STEP_1, - SWN_FINISH_GRAVITRON_STEP_1, - SWN_START_SUPERGRAVITRON_STEP_1, - SWN_START_SUPERGRAVITRON_STEP_2, - SWN_FINISH_GRAVITRON_STEP_2, - SWN_NONE -}; - -/* enums for unlock, unlocknotify arrays and unlocknum function */ -enum -{ - Unlock_SPACESTATION1_COMPLETE = 0, - Unlock_LABORATORY_COMPLETE = 1, - Unlock_TOWER_COMPLETE = 2, - Unlock_SPACESTATION2_COMPLETE = 3, - Unlock_WARPZONE_COMPLETE = 4, - UnlockTrophy_GAME_COMPLETE = 5, - Unlock_INTERMISSION1_COMPLETE = 6, - Unlock_INTERMISSION2_COMPLETE = 7, - Unlock_SECRETLAB = 8, - Unlock_TIMETRIAL_SPACESTATION1 = 9, - Unlock_TIMETRIAL_LABORATORY = 10, - Unlock_TIMETRIAL_TOWER = 11, - Unlock_TIMETRIAL_SPACESTATION2 = 12, - Unlock_TIMETRIAL_WARPZONE = 13, - Unlock_TIMETRIAL_FINALLEVEL = 14, - Unlock_INTERMISSION_UNUSED = 15, - Unlock_INTERMISSION_REPLAYS = 16, - Unlock_NODEATHMODE = 17, - Unlock_FLIPMODE = 18, - UnlockTrophy_FLIPMODE_COMPLETE = 19, - UnlockTrophy_NODEATHMODE_COMPLETE = 20 -}; - -/* enums for bestrank, bestlives, besttrinkets, besttimes, bestframes arrays - * and timetriallevel */ -enum -{ - TimeTrial_SPACESTATION1 = 0, - TimeTrial_LABORATORY = 1, - TimeTrial_TOWER = 2, - TimeTrial_SPACESTATION2 = 3, - TimeTrial_WARPZONE = 4, - TimeTrial_FINALLEVEL = 5 -}; - struct MenuStackFrame { int option; enum Menu::MenuName name; }; +struct CustomLevelStat +{ + std::string name; + int score; //0 - not played, 1 - finished, 2 - all trinkets, 3 - finished, all trinkets +}; + class Game { - char magic[16]; - public: void init(void); - void setdefaultcontrollerbuttons(void); int crewrescued(void); @@ -196,7 +121,7 @@ public: void resetgameclock(void); - bool customsavequick(const std::string& savfile); + bool customsavequick(std::string savfile); bool savequick(void); void gameclock(void); @@ -205,58 +130,44 @@ public: std::string timestring(void); + std::string partimestring(void); + std::string resulttimestring(void); std::string timetstring(int t); - void timestringcenti(char* buffer, size_t buffer_size); - void returnmenu(void); void returntomenu(enum Menu::MenuName t); void createmenu(enum Menu::MenuName t, bool samemenu = false); - bool can_unlock_ndm(void); - void unlock_ndm(void); void lifesequence(void); void gethardestroom(void); void levelcomplete_textbox(void); - void crewmate_textbox(const int color); + void crewmate_textbox(const int r, const int g, const int b); void remaining_textbox(void); void actionprompt_textbox(void); - void show_save_fail(void); - void checkpoint_save(void); void savetele_textbox(void); - void setstate(int gamestate); - - void incstate(void); - - void setstatedelay(int delay); - - void lockstate(void); - - void unlockstate(void); - void updatestate(void); void unlocknum(int t); - void loadstats(struct ScreenSettings* screen_settings); + void loadstats(ScreenSettings* screen_settings); - bool savestats(const struct ScreenSettings* screen_settings, bool sync = true); - bool savestats(bool sync = true); + bool savestats(const ScreenSettings* screen_settings); + bool savestats(void); void deletestats(void); - void deserializesettings(tinyxml2::XMLElement* dataNode, struct ScreenSettings* screen_settings); + void deserializesettings(tinyxml2::XMLElement* dataNode, ScreenSettings* screen_settings); - void serializesettings(tinyxml2::XMLElement* dataNode, const struct ScreenSettings* screen_settings); + void serializesettings(tinyxml2::XMLElement* dataNode, const ScreenSettings* screen_settings); - void loadsettings(struct ScreenSettings* screen_settings); + void loadsettings(ScreenSettings* screen_settings); - bool savesettings(const struct ScreenSettings* screen_settings); + bool savesettings(const ScreenSettings* screen_settings); bool savesettings(void); bool savestatsandsettings(void); @@ -285,44 +196,30 @@ public: void deathsequence(void); - void customloadquick(const std::string& savfile); + void customloadquick(std::string savfile); void loadquick(void); void customdeletequick(const std::string& file); void loadsummary(void); - static const int numcrew = 6; - - struct Summary - { - bool exists; - int seconds; - int minutes; - int hours; - int saverx; - int savery; - int trinkets; - bool crewstats[numcrew]; - }; - - struct Summary last_telesave, last_quicksave; - bool save_exists(void); - - void readmaingamesave(const char* savename, tinyxml2::XMLDocument& doc); - struct Summary writemaingamesave(tinyxml2::XMLDocument& doc); + void readmaingamesave(tinyxml2::XMLDocument& doc); + std::string writemaingamesave(tinyxml2::XMLDocument& doc); void initteleportermode(void); const char* saveFilePath; - int roomx, roomy; + int door_left; + int door_right; + int door_up; + int door_down; + int roomx, roomy, roomchangedir; int prevroomx, prevroomy; int savex, savey, saverx, savery; int savegc, savedir; - int savecolour; //Added for port int edsavex, edsavey, edsaverx, edsavery; @@ -333,12 +230,12 @@ public: bool glitchrunkludge; - enum GameGamestate gamestate; - enum GameGamestate prevgamestate; //only used sometimes + int gamestate; + int prevgamestate; //only used sometimes bool hascontrol, jumpheld; int jumppressed; int gravitycontrol; - bool isingamecompletescreen(void); + bool isingamecompletescreen(); bool muted; int mutebutton; @@ -348,24 +245,20 @@ public: int tapleft, tapright; //Menu interaction stuff - void mapmenuchange(const enum GameGamestate newgamestate, const bool user_initiated); + void mapmenuchange(const int newgamestate); bool mapheld; int menupage; int lastsaved; int deathcounts; - int framecounter; - bool seed_use_sdl_getticks; - bool editor_disabled; int frames, seconds, minutes, hours; bool gamesaved; bool gamesavefailed; std::string savetime; - int saveframes, saveseconds; + std::string savearea; int savetrinkets; bool startscript; std::string newscript; - bool checkpoint_saving; bool menustart; @@ -379,22 +272,19 @@ public: //Main Menu Variables std::vector menuoptions; int currentmenuoption ; - bool menutestmode; enum Menu::MenuName currentmenuname; enum Menu::MenuName kludge_ingametemp; enum SLIDERMODE slidermode; int current_credits_list_index; - int translator_credits_pagenum; int menuxoff, menuyoff; int menuspacing; std::vector menustack; - void inline option(const char* text, bool active = true, uint32_t print_flags = PR_RTL_XFLIP) + void inline option(const char* text, bool active = true) { MenuOption menuoption; SDL_strlcpy(menuoption.text, text, sizeof(menuoption.text)); menuoption.active = active; - menuoption.print_flags = print_flags; menuoptions.push_back(menuoption); } @@ -404,22 +294,17 @@ public: int creditposx, creditposy, creditposdelay; int oldcreditposx; - SDL_GameControllerButton gpmenu_lastbutton; - bool gpmenu_confirming; - bool gpmenu_showremove; - bool silence_settings_error; //Sine Wave Ninja Minigame bool swnmode; - enum SWNMODE swngame; - int swnstate, swnstate2, swnstate3, swnstate4, swndelay, swndeaths; + int swngame, swnstate, swnstate2, swnstate3, swnstate4, swndelay, swndeaths; int swntimer, swncolstate, swncoldelay; int swnrecord, swnbestrank, swnrank, swnmessage; //SuperCrewMate Stuff - bool supercrewmate, scmhurt; + bool supercrewmate, scmhurt, scmmoveme; int scmprogress; //Accessibility Options @@ -427,7 +312,6 @@ public: bool noflashingmode; int slowdown; int get_timestep(void); - bool physics_frozen(void); bool nodeathmode; int gameoverdelay; @@ -435,35 +319,22 @@ public: int ndmresultcrewrescued; int ndmresulttrinkets; std::string ndmresulthardestroom; - int ndmresulthardestroom_x; - int ndmresulthardestroom_y; - bool ndmresulthardestroom_specialname; void copyndmresults(void); - bool nodeatheligible; - void invalidate_ndm_trophy(void); //Time Trials bool intimetrial, timetrialparlost; int timetrialcountdown, timetrialshinytarget, timetriallevel; int timetrialpar, timetrialresulttime, timetrialresultframes, timetrialrank; - bool timetrialcheater; int timetrialresultshinytarget, timetrialresulttrinkets, timetrialresultpar; int timetrialresultdeaths; - bool start_translator_exploring; - bool translator_exploring; - bool translator_exploring_allowtele; - bool translator_cutscene_test; - - size_t cutscenetest_menu_page; - std::string cutscenetest_menu_play_id; - int creditposition; int oldcreditposition; bool insecretlab; bool inintermission; + static const int numcrew = 6; bool crewstats[numcrew]; bool ndmresultcrewstats[numcrew]; @@ -471,6 +342,10 @@ public: int alarmdelay; bool blackout; + bool tele_crewstats[numcrew]; + + bool quick_crewstats[numcrew]; + static const int numunlock = 25; bool unlock[numunlock]; bool unlocknotify[numunlock]; @@ -486,6 +361,14 @@ public: int bestlives[numtrials]; int bestrank[numtrials]; + std::string tele_gametime; + int tele_trinkets; + std::string tele_currentarea; + std::string quick_gametime; + int quick_trinkets; + std::string quick_currentarea; + + int mx, my; int screenshake, flashlight; bool advancetext, pausescript; @@ -501,13 +384,16 @@ public: float inertia; int companion; + bool roomchange; SDL_Rect teleblock; bool activetele; int readytotele; int oldreadytotele; - int activity_r, activity_g, activity_b, activity_y; + int activity_r, activity_g, activity_b; std::string activity_lastprompt; - bool activity_gettext; + + std::string telesummary, quicksummary, customquicksummary; + bool save_exists(void); bool backgroundtext; @@ -520,11 +406,8 @@ public: //Some stats: int totalflips; - std::string hardestroom; // don't change to C string unless you wanna handle when this string is loaded from the XML + std::string hardestroom; int hardestroomdeaths, currentroomdeaths; - int hardestroom_x, hardestroom_y; - bool hardestroom_specialname; - bool hardestroom_finalstretch; bool quickrestartkludge; @@ -543,8 +426,7 @@ public: void updatecustomlevelstats(std::string clevel, int cscore); void deletecustomlevelstats(void); - // name -> score. 0 - not played, 1 - finished, 2 - all trinkets, 3 - finished, all trinkets - std::map customlevelstats; + std::vector customlevelstats; std::vector controllerButton_map; @@ -572,25 +454,26 @@ public: bool fadetolab; int fadetolabdelay; +#if !defined(NO_CUSTOM_LEVELS) void returntoeditor(void); +#endif bool inline inspecial(void) { - return inintermission || insecretlab || intimetrial || nodeathmode || translator_exploring; + return inintermission || insecretlab || intimetrial || nodeathmode; } bool incompetitive(void); bool nocompetitive(void); - bool nocompetitive_unless_translator(void); - - void sabotage_time_trial(void); bool over30mode; bool showingametimer; bool ingame_titlemode; +#if !defined(NO_CUSTOM_LEVELS) && !defined(NO_EDITOR) bool ingame_editormode; +#endif void returntoingame(void); void unlockAchievement(const char *name); @@ -599,18 +482,6 @@ public: bool disableaudiopause; bool disabletemporaryaudiopause; bool inputdelay; - - bool statelocked; - - int old_skip_message_timer; - int skip_message_timer; - - int old_mode_indicator_timer; - int mode_indicator_timer; - - int old_screenshot_border_timer; - int screenshot_border_timer; - bool screenshot_saved_success; }; #ifndef GAME_DEFINITION diff --git a/desktop_version/src/Graphics.cpp b/desktop_version/src/Graphics.cpp index 6df6c6f7..ac9c75e3 100644 --- a/desktop_version/src/Graphics.cpp +++ b/desktop_version/src/Graphics.cpp @@ -1,41 +1,38 @@ #define GRAPHICS_DEFINITION #include "Graphics.h" -#include +#include +#include -#include "Alloc.h" -#include "Constants.h" -#include "CustomLevels.h" -#include "Editor.h" +#include "editor.h" #include "Entity.h" #include "Exit.h" #include "FileSystemUtils.h" -#include "Font.h" #include "GraphicsUtil.h" -#include "IMERender.h" -#include "Localization.h" #include "Map.h" -#include "Maths.h" #include "Music.h" -#include "RoomnameTranslator.h" #include "Screen.h" -#include "Script.h" #include "UtilityClass.h" -#include "VFormat.h" -#include "Vlogging.h" void Graphics::init(void) { flipmode = false; - setRect(tiles_rect, 0, 0, 8, 8); - setRect(sprites_rect, 0, 0, 32, 32); + setRect(tiles_rect, 0,0,8,8); + setRect(sprites_rect, 0,0,32,32); + setRect(bfont_rect, 0,0,8,8); + setRect(bg_rect, 0,0,320,240); setRect(footerrect, 0, 230, 320, 10); - setRect(tele_rect, 0, 0, 96, 96); + setRect(prect, 0, 0, 4, 4); + setRect(line_rect, 0,0,0,0); + setRect(tele_rect,0,0,96,96); + setRect(towerbuffer_rect, 8, 8, 320, 240); - // We initialise a few things + + //We initialise a few things linestate = 0; + trinketcolset = false; showcutscenebars = false; @@ -45,12 +42,13 @@ void Graphics::init(void) flipmode = false; setflipmode = false; - // Initialize backgrounds + //Background inits for (int i = 0; i < numstars; i++) { - const SDL_Rect star = {(int) (fRandom() * 320), (int) (fRandom() * 240), 2, 2}; - stars[i] = star; - starsspeed[i] = 4 + (fRandom() * 4); + SDL_Rect s = {(int) (fRandom() * 320), (int) (fRandom() * 240), 2, 2}; + int s2 = 4+(fRandom()*4); + stars[i] = s; + starsspeed[i] = s2; } for (int i = 0; i < numbackboxes; i++) @@ -58,7 +56,7 @@ void Graphics::init(void) SDL_Rect bb; int bvx = 0; int bvy = 0; - if (fRandom() * 100 > 50) + if(fRandom()*100 > 50) { bvx = 9 - (fRandom() * 19); if (bvx > -6 && bvx < 6) bvx = 6; @@ -70,20 +68,20 @@ void Graphics::init(void) bvy = 9 - (fRandom() * 19); if (bvy > -6 && bvy < 6) bvy = 6; bvy = bvy * 1.5; - setRect(bb, fRandom() * 320, fRandom() * 240, 12, 32); + setRect(bb, fRandom() * 320, fRandom() * 240, 12, 32) ; } + float bint = 0.5 + ((fRandom() * 100) / 200); backboxes[i] = bb; backboxvx[i] = bvx; backboxvy[i] = bvy; + backboxint[i] = bint; } - - backboxmult = 0.5 + ((fRandom() * 100) / 200); - backoffset = 0; - foregrounddrawn = false; backgrounddrawn = false; warpskip = 0; + warpfcol = 0x000000; + warpbcol = 0x000000; spcol = 0; spcoldel = 0; @@ -99,26 +97,32 @@ void Graphics::init(void) SDL_memset(fadebars, 0, sizeof(fadebars)); setfade(0); - fademode = FADE_NONE; - ingame_fademode = FADE_NONE; + fademode = 0; + ingame_fademode = 0; // initialize everything else to zero + backBuffer = NULL; + ct = colourTransform(); + foot_rect = SDL_Rect(); + foregrounddrawn = false; + foregroundBuffer = NULL; + backgrounddrawn = false; + images_rect = SDL_Rect(); m = 0; linedelay = 0; - gameTexture = NULL; - gameplayTexture = NULL; - menuTexture = NULL; - ghostTexture = NULL; - tempShakeTexture = NULL; - backgroundTexture = NULL; - foregroundTexture = NULL; - tempScreenshot = NULL; - tempScreenshot2x = NULL; + menubuffer = NULL; + screenbuffer = NULL; + tempBuffer = NULL; + warpbuffer = NULL; + warpbuffer_lerp = NULL; + footerbuffer = NULL; + ghostbuffer = NULL; towerbg = TowerBG(); titlebg = TowerBG(); trinketr = 0; trinketg = 0; trinketb = 0; + warprect = SDL_Rect(); translucentroomname = false; @@ -127,138 +131,316 @@ void Graphics::init(void) screenshake_x = 0; screenshake_y = 0; - SDL_zero(col_crewred); - SDL_zero(col_crewyellow); - SDL_zero(col_crewgreen); - SDL_zero(col_crewcyan); - SDL_zero(col_crewblue); - SDL_zero(col_crewpurple); - SDL_zero(col_crewinactive); - SDL_zero(col_clock); - SDL_zero(col_trinket); + col_crewred = 0x00000000; + col_crewyellow = 0x00000000; + col_crewgreen = 0x00000000; + col_crewcyan = 0x00000000; + col_crewblue = 0x00000000; + col_crewpurple = 0x00000000; + col_crewinactive = 0x00000000; + col_clock = 0x00000000; + col_trinket = 0x00000000; col_tr = 0; col_tg = 0; col_tb = 0; kludgeswnlinewidth = false; +#ifndef NO_CUSTOM_LEVELS tiles1_mounted = false; tiles2_mounted = false; minimap_mounted = false; +#endif - gamecomplete_mounted = false; - levelcomplete_mounted = false; - flipgamecomplete_mounted = false; - fliplevelcomplete_mounted = false; + SDL_zeroa(error); + SDL_zeroa(error_title); } void Graphics::destroy(void) { -#define CLEAR_ARRAY(name) \ - for (size_t i = 0; i < name.size(); i += 1) \ - { \ - VVV_freefunc(SDL_FreeSurface, name[i]); \ - } \ - name.clear(); + #define CLEAR_ARRAY(name) \ + for (size_t i = 0; i < name.size(); i += 1) \ + { \ + SDL_FreeSurface(name[i]); \ + } \ + name.clear(); - CLEAR_ARRAY(sprites_surf) - CLEAR_ARRAY(flipsprites_surf) + CLEAR_ARRAY(tiles) + CLEAR_ARRAY(tiles2) + CLEAR_ARRAY(tiles3) + CLEAR_ARRAY(entcolours) + CLEAR_ARRAY(sprites) + CLEAR_ARRAY(flipsprites) + CLEAR_ARRAY(tele) + CLEAR_ARRAY(bfont) + CLEAR_ARRAY(flipbfont) -#undef CLEAR_ARRAY + #undef CLEAR_ARRAY } -static SDL_Surface* tempFilterSrc = NULL; -static SDL_Surface* tempFilterDest = NULL; - -void Graphics::create_buffers(void) +void Graphics::create_buffers(const SDL_PixelFormat* fmt) { -#define CREATE_TEXTURE_WITH_DIMENSIONS(w, h) \ - SDL_CreateTexture( \ - gameScreen.m_renderer, \ - SDL_PIXELFORMAT_ARGB8888, SDL_TEXTUREACCESS_TARGET, \ - (w), (h) \ - ) -#define CREATE_TEXTURE \ - CREATE_TEXTURE_WITH_DIMENSIONS(SCREEN_WIDTH_PIXELS, SCREEN_HEIGHT_PIXELS) -#define CREATE_SCROLL_TEXTURE \ - CREATE_TEXTURE_WITH_DIMENSIONS(SCREEN_WIDTH_PIXELS + 16, SCREEN_WIDTH_PIXELS + 16) + #define CREATE_SURFACE(w, h) \ + SDL_CreateRGBSurface( \ + SDL_SWSURFACE, \ + w, h, \ + fmt->BitsPerPixel, \ + fmt->Rmask, fmt->Gmask, fmt->Bmask, fmt->Amask \ + ) + backBuffer = CREATE_SURFACE(320, 240); + SDL_SetSurfaceBlendMode(backBuffer, SDL_BLENDMODE_NONE); - gameTexture = CREATE_TEXTURE; - gameplayTexture = CREATE_TEXTURE; - menuTexture = CREATE_TEXTURE; - ghostTexture = CREATE_TEXTURE; - tempShakeTexture = CREATE_TEXTURE; - foregroundTexture = CREATE_TEXTURE; - backgroundTexture = CREATE_SCROLL_TEXTURE; - tempScrollingTexture = CREATE_SCROLL_TEXTURE; - towerbg.texture = CREATE_SCROLL_TEXTURE; - titlebg.texture = CREATE_SCROLL_TEXTURE; + footerbuffer = CREATE_SURFACE(320, 10); + SDL_SetSurfaceBlendMode(footerbuffer, SDL_BLENDMODE_BLEND); + SDL_SetSurfaceAlphaMod(footerbuffer, 127); + FillRect(footerbuffer, SDL_MapRGB(fmt, 0, 0, 0)); -#undef CREATE_SCROLL_TEXTURE -#undef CREATE_TEXTURE -#undef CREATE_TEXTURE_WITH_DIMENSIONS + ghostbuffer = CREATE_SURFACE(320, 240); + SDL_SetSurfaceBlendMode(ghostbuffer, SDL_BLENDMODE_BLEND); + SDL_SetSurfaceAlphaMod(ghostbuffer, 127); - SDL_SetTextureScaleMode( - gameTexture, - gameScreen.isFiltered ? SDL_ScaleModeLinear : SDL_ScaleModeNearest - ); + foregroundBuffer = CREATE_SURFACE(320, 240); + SDL_SetSurfaceBlendMode(foregroundBuffer, SDL_BLENDMODE_BLEND); - SDL_SetTextureScaleMode( - tempShakeTexture, - gameScreen.isFiltered ? SDL_ScaleModeLinear : SDL_ScaleModeNearest - ); + menubuffer = CREATE_SURFACE(320, 240); + SDL_SetSurfaceBlendMode(menubuffer, SDL_BLENDMODE_NONE); + + warpbuffer = CREATE_SURFACE(320 + 16, 240 + 16); + SDL_SetSurfaceBlendMode(warpbuffer, SDL_BLENDMODE_NONE); + + warpbuffer_lerp = CREATE_SURFACE(320 + 16, 240 + 16); + SDL_SetSurfaceBlendMode(warpbuffer_lerp, SDL_BLENDMODE_NONE); + + towerbg.buffer = CREATE_SURFACE(320 + 16, 240 + 16); + SDL_SetSurfaceBlendMode(towerbg.buffer, SDL_BLENDMODE_NONE); + + towerbg.buffer_lerp = CREATE_SURFACE(320 + 16, 240 + 16); + SDL_SetSurfaceBlendMode(towerbg.buffer_lerp, SDL_BLENDMODE_NONE); + + titlebg.buffer = CREATE_SURFACE(320 + 16, 240 + 16); + SDL_SetSurfaceBlendMode(titlebg.buffer, SDL_BLENDMODE_NONE); + + titlebg.buffer_lerp = CREATE_SURFACE(320 + 16, 240 + 16); + SDL_SetSurfaceBlendMode(titlebg.buffer_lerp, SDL_BLENDMODE_NONE); + + tempBuffer = CREATE_SURFACE(320, 240); + SDL_SetSurfaceBlendMode(tempBuffer, SDL_BLENDMODE_NONE); + + #undef CREATE_SURFACE } void Graphics::destroy_buffers(void) { - VVV_freefunc(SDL_DestroyTexture, gameTexture); - VVV_freefunc(SDL_DestroyTexture, gameplayTexture); - VVV_freefunc(SDL_DestroyTexture, menuTexture); - VVV_freefunc(SDL_DestroyTexture, ghostTexture); - VVV_freefunc(SDL_DestroyTexture, tempShakeTexture); - VVV_freefunc(SDL_DestroyTexture, foregroundTexture); - VVV_freefunc(SDL_DestroyTexture, backgroundTexture); - VVV_freefunc(SDL_DestroyTexture, tempScrollingTexture); - VVV_freefunc(SDL_DestroyTexture, towerbg.texture); - VVV_freefunc(SDL_DestroyTexture, titlebg.texture); - VVV_freefunc(SDL_FreeSurface, tempFilterSrc); - VVV_freefunc(SDL_FreeSurface, tempFilterDest); - VVV_freefunc(SDL_FreeSurface, tempScreenshot); - VVV_freefunc(SDL_FreeSurface, tempScreenshot2x); +#define FREE_SURFACE(SURFACE) \ + SDL_FreeSurface(SURFACE); \ + SURFACE = NULL; + + FREE_SURFACE(backBuffer) + FREE_SURFACE(footerbuffer) + FREE_SURFACE(ghostbuffer) + FREE_SURFACE(foregroundBuffer) + FREE_SURFACE(menubuffer) + FREE_SURFACE(warpbuffer) + FREE_SURFACE(warpbuffer_lerp) + FREE_SURFACE(towerbg.buffer) + FREE_SURFACE(towerbg.buffer_lerp) + FREE_SURFACE(titlebg.buffer) + FREE_SURFACE(titlebg.buffer_lerp) + FREE_SURFACE(tempBuffer) + +#undef FREE_SURFACE +} + +int Graphics::font_idx(uint32_t ch) +{ + if (font_positions.size() > 0) + { + std::map::iterator iter = font_positions.find(ch); + if (iter == font_positions.end()) + { + iter = font_positions.find('?'); + if (iter == font_positions.end()) + { + WHINE_ONCE("font.txt missing fallback character!"); + return -1; + } + } + return iter->second; + } + else + { + return ch; + } } void Graphics::drawspritesetcol(int x, int y, int t, int c) { - draw_grid_tile(grphx.im_sprites, t, x, y, sprites_rect.w, sprites_rect.h, getcol(c)); + if (!INBOUNDS_VEC(t, sprites)) + { + return; + } + SDL_Rect rect; + setRect(rect,x,y,sprites_rect.w,sprites_rect.h); + setcol(c); + + BlitSurfaceColoured(sprites[t],NULL,backBuffer, &rect, ct); } void Graphics::updatetitlecolours(void) { - col_crewred = getcol(15); - col_crewyellow = getcol(14); - col_crewgreen = getcol(13); - col_crewcyan = getcol(0); - col_crewblue = getcol(16); - col_crewpurple = getcol(20); - col_crewinactive = getcol(19); + setcol(15); + col_crewred = ct.colour; + setcol(14); + col_crewyellow = ct.colour; + setcol(13); + col_crewgreen = ct.colour; + setcol(0); + col_crewcyan = ct.colour; + setcol(16); + col_crewblue = ct.colour; + setcol(20); + col_crewpurple = ct.colour; + setcol(19); + col_crewinactive = ct.colour; - col_clock = getcol(18); - col_trinket = getcol(18); + setcol(18); + col_clock = ct.colour; + setcol(18); + col_trinket = ct.colour; } +#define PROCESS_TILESHEET_CHECK_ERROR(tilesheet, tile_square) \ + if (grphx.im_##tilesheet == NULL) \ + { \ + /* We have already asserted; just no-op. */ \ + } \ + else if (grphx.im_##tilesheet->w % tile_square != 0 \ + || grphx.im_##tilesheet->h % tile_square != 0) \ + { \ + static const char error_fmt[] = "%s.png dimensions not exact multiples of %i!"; \ + static const char error_title_fmt[] = "Error with %s.png"; \ + \ + SDL_snprintf(error, sizeof(error), error_fmt, #tilesheet, tile_square); \ + SDL_snprintf(error_title, sizeof(error_title), error_title_fmt, #tilesheet); \ + \ + puts(error); \ + \ + return false; \ + } -void Graphics::map_tab(int opt, const char* text, bool selected /*= false*/) +#define PROCESS_TILESHEET_RENAME(tilesheet, vector, tile_square, extra_code) \ + PROCESS_TILESHEET_CHECK_ERROR(tilesheet, tile_square) \ + \ + else \ + { \ + int j; \ + for (j = 0; j < grphx.im_##tilesheet->h / tile_square; ++j) \ + { \ + int i; \ + for (i = 0; i < grphx.im_##tilesheet->w / tile_square; ++i) \ + { \ + SDL_Surface* temp = GetSubSurface( \ + grphx.im_##tilesheet, \ + i * tile_square, j * tile_square, \ + tile_square, tile_square \ + ); \ + vector.push_back(temp); \ + \ + extra_code \ + } \ + } \ + \ + SDL_FreeSurface(grphx.im_##tilesheet); \ + grphx.im_##tilesheet = NULL; \ + } + +#define PROCESS_TILESHEET(tilesheet, tile_square, extra_code) \ + PROCESS_TILESHEET_RENAME(tilesheet, tilesheet, tile_square, extra_code) + +bool Graphics::Makebfont(void) { - int x = opt*80 + 40; - if (selected) + PROCESS_TILESHEET(bfont, 8, { - char buffer[SCREEN_WIDTH_CHARS + 1]; - vformat_buf(buffer, sizeof(buffer), loc::get_langmeta()->menu_select_tight.c_str(), "label:str", text); - font::print(PR_CEN | PR_CJK_LOW | PR_RTL_XFLIP, x, 220, buffer, 196, 196, 255 - help.glow); + SDL_Surface* TempFlipped = FlipSurfaceVerticle(temp); + flipbfont.push_back(TempFlipped); + }) + + unsigned char* charmap; + size_t length; + FILESYSTEM_loadAssetToMemory("graphics/font.txt", &charmap, &length, false); + if (charmap != NULL) + { + unsigned char* current = charmap; + unsigned char* end = charmap + length; + int pos = 0; + while (current != end) + { + int codepoint = utf8::unchecked::next(current); + font_positions[codepoint] = pos; + ++pos; + } + FILESYSTEM_freeMemory(&charmap); } else { - font::print(PR_CEN | PR_CJK_LOW | PR_RTL_XFLIP, x, 220, text, 64, 64, 64); + font_positions.clear(); + } + + return true; +} + +int Graphics::bfontlen(uint32_t ch) +{ + if (ch < 32) + { + return 6; + } + else + { + return 8; + } +} + +bool Graphics::MakeTileArray(void) +{ + PROCESS_TILESHEET(tiles, 8, {}) + PROCESS_TILESHEET(tiles2, 8, {}) + PROCESS_TILESHEET(tiles3, 8, {}) + PROCESS_TILESHEET(entcolours, 8, {}) + + return true; +} + +bool Graphics::maketelearray(void) +{ + PROCESS_TILESHEET_RENAME(teleporter, tele, 96, {}) + + return true; +} + +bool Graphics::MakeSpriteArray(void) +{ + PROCESS_TILESHEET(sprites, 32, {}) + PROCESS_TILESHEET(flipsprites, 32, {}) + + return true; +} + +#undef PROCESS_TILESHEET +#undef PROCESS_TILESHEET_RENAME +#undef PROCESS_TILESHEET_CHECK_ERROR + + +void Graphics::map_tab(int opt, const std::string& text, bool selected /*= false*/) +{ + int x = opt*80 + 40 - len(text)/2; + if (selected) + { + Print(x-8, 220, "[" + text + "]", 196, 196, 255 - help.glow); + } + else + { + Print(x, 220, text, 64, 64, 64); } } @@ -282,46 +464,322 @@ void Graphics::map_option(int opt, int num_opts, const std::string& text, bool s if (selected) { - std::string text_upper(loc::toupper(text)); - - char buffer[SCREEN_WIDTH_CHARS + 1]; - vformat_buf(buffer, sizeof(buffer), loc::get_langmeta()->menu_select.c_str(), "label:str", text_upper.c_str()); - - // Account for brackets - x -= (font::len(0, buffer) - font::len(0, text_upper.c_str())) / 2; - - font::print(PR_RTL_XFLIP, x, y, buffer, 196, 196, 255 - help.glow); + std::string text_upper(text); + for (size_t i = 0; i < text_upper.length(); i++) + { + text_upper[i] = SDL_toupper(text_upper[i]); + } + Print(x - 16, y, "[ " + text_upper + " ]", 196, 196, 255 - help.glow); } else { - font::print(PR_RTL_XFLIP, x, y, loc::remove_toupper_escape_chars(text), 96, 96, 96); + Print(x, y, text, 96, 96, 96); + } +} + +void Graphics::Print( int _x, int _y, std::string _s, int r, int g, int b, bool cen /*= false*/ ) { + return PrintAlpha(_x,_y,_s,r,g,b,255,cen); +} + +void Graphics::PrintAlpha( int _x, int _y, std::string _s, int r, int g, int b, int a, bool cen /*= false*/ ) +{ + std::vector& font = flipmode ? flipbfont : bfont; + + r = clamp(r,0,255); + g = clamp(g,0,255); + b = clamp(b,0,255); + a = clamp(a,0,255); + + ct.colour = getRGBA(r, g, b, a); + + if (cen) + _x = ((160 ) - ((len(_s)) / 2)); + int bfontpos = 0; + int curr; + int idx; + std::string::iterator iter = _s.begin(); + while (iter != _s.end()) { + curr = utf8::unchecked::next(iter); + point tpoint; + tpoint.x = _x + bfontpos; + tpoint.y = _y; + + SDL_Rect fontRect = bfont_rect; + fontRect.x = tpoint.x ; + fontRect.y = tpoint.y ; + + idx = font_idx(curr); + if (INBOUNDS_VEC(idx, font)) + { + BlitSurfaceColoured( font[idx], NULL, backBuffer, &fontRect , ct); + } + bfontpos+=bfontlen(curr) ; + } +} + +bool Graphics::next_wrap( + size_t* start, + size_t* len, + const char* str, + const int maxwidth +) { + /* This function is UTF-8 aware. But start/len still are bytes. */ + size_t idx = 0; + size_t lenfromlastspace = 0; + size_t lastspace = 0; + int linewidth = 0; + *len = 0; + + if (str[idx] == '\0') + { + return false; + } + + while (true) + { + /* FIXME: This only checks one byte, not multiple! */ + if ((str[idx] & 0xC0) == 0x80) + { + /* Skip continuation byte. */ + goto next; + } + + linewidth += bfontlen(str[idx]); + + switch (str[idx]) + { + case ' ': + lenfromlastspace = idx; + lastspace = *start; + break; + case '\n': + *start += 1; + VVV_fallthrough; + case '\0': + return true; + } + + if (linewidth > maxwidth) + { + if (lenfromlastspace != 0) + { + *len = lenfromlastspace; + *start = lastspace + 1; + } + return true; + } + +next: + idx += 1; + *start += 1; + *len += 1; + } +} + +bool Graphics::next_wrap_s( + char buffer[], + const size_t buffer_size, + size_t* start, + const char* str, + const int maxwidth +) { + size_t len = 0; + const size_t prev_start = *start; + + const bool retval = next_wrap(start, &len, &str[*start], maxwidth); + + if (retval) + { + /* Like next_split_s(), don't use SDL_strlcpy() here. */ + const size_t length = VVV_min(buffer_size - 1, len); + SDL_memcpy(buffer, &str[prev_start], length); + buffer[length] = '\0'; + } + + return retval; +} + +void Graphics::PrintWrap( + const int x, + int y, + const char* str, + const int r, + const int g, + const int b, + const bool cen, + const int linespacing, + const int maxwidth +) { + /* Screen width is 320 pixels. The shortest a char can be is 6 pixels wide. + * 320 / 6 is 54, rounded up. 4 bytes per char. */ + char buffer[54*4 + 1]; + size_t start = 0; + + while (next_wrap_s(buffer, sizeof(buffer), &start, str, maxwidth)) + { + Print(x, y, buffer, r, g, b, cen); + + if (flipmode) + { + y -= linespacing; + } + else + { + y += linespacing; + } } } +void Graphics::bigprint( int _x, int _y, std::string _s, int r, int g, int b, bool cen, int sc ) +{ + std::vector& font = flipmode ? flipbfont : bfont; + + r = clamp(r,0,255); + g = clamp(g,0,255); + b = clamp(b,0,255); + + ct.colour = getRGB(r, g, b); + + if (cen) + { + _x = VVV_max(160 - (int((len(_s)/ 2.0)*sc)), 0 ); + } + + int bfontpos = 0; + int curr; + int idx; + std::string::iterator iter = _s.begin(); + while (iter != _s.end()) { + curr = utf8::unchecked::next(iter); + + idx = font_idx(curr); + if (INBOUNDS_VEC(idx, font)) + { + SDL_Surface* tempPrint = ScaleSurface(font[idx], font[idx]->w *sc,font[idx]->h *sc); + SDL_Rect printrect = {_x + bfontpos, _y, bfont_rect.w*sc + 1, bfont_rect.h*sc + 1}; + BlitSurfaceColoured(tempPrint, NULL, backBuffer, &printrect, ct); + SDL_FreeSurface(tempPrint); + } + bfontpos+=bfontlen(curr) *sc; + } +} + +void Graphics::bigbprint(int x, int y, std::string s, int r, int g, int b, bool cen, int sc) +{ + if (!notextoutline) + { + bigprint(x, y - sc, s, 0, 0, 0, cen, sc); + if (cen) + { + int x_cen = VVV_max(160 - (len(s) / 2) * sc, 0); + bigprint(x_cen - sc, y, s, 0, 0, 0, false, sc); + bigprint(x_cen + sc, y, s, 0, 0, 0, false, sc); + } + else + { + bigprint(x - sc, y, s, 0, 0, 0, cen, sc); + bigprint(x + sc, y, s, 0, 0, 0, cen, sc); + } + bigprint(x, y + sc, s, 0, 0, 0, cen, sc); + } + + bigprint(x, y, s, r, g, b, cen, sc); +} + +int Graphics::len(std::string t) +{ + int bfontpos = 0; + std::string::iterator iter = t.begin(); + while (iter != t.end()) { + int cur = utf8::unchecked::next(iter); + bfontpos += bfontlen(cur); + } + return bfontpos; +} + +void Graphics::PrintOffAlpha( int _x, int _y, std::string _s, int r, int g, int b, int a, bool cen /*= false*/ ) +{ + std::vector& font = flipmode ? flipbfont : bfont; + + r = clamp(r,0,255); + g = clamp(g,0,255); + b = clamp(b,0,255); + a = clamp(a,0,255); + + ct.colour = getRGB(r, g, b); + + if (cen) + _x = ((160) - (len(_s) / 2))+_x; + int bfontpos = 0; + int idx; + std::string::iterator iter = _s.begin(); + while (iter != _s.end()) { + int curr = utf8::unchecked::next(iter); + point tpoint; + tpoint.x = _x + bfontpos; + tpoint.y = _y; + + SDL_Rect fontRect = bfont_rect; + fontRect.x = tpoint.x ; + fontRect.y = tpoint.y ; + + idx = font_idx(curr); + if (INBOUNDS_VEC(idx, font)) + { + BlitSurfaceColoured( font[idx], NULL, backBuffer, &fontRect , ct); + } + bfontpos+=bfontlen(curr) ; + } +} + +void Graphics::bprint( int x, int y, std::string t, int r, int g, int b, bool cen /*= false*/ ) { + bprintalpha(x,y,t,r,g,b,255,cen); +} + +void Graphics::bprintalpha( int x, int y, std::string t, int r, int g, int b, int a, bool cen /*= false*/ ) +{ + if (!notextoutline) + { + PrintAlpha(x, y - 1, t, 0, 0, 0, a, cen); + if (cen) + { + PrintOffAlpha(-1, y, t, 0, 0, 0, a, cen); + PrintOffAlpha(1, y, t, 0, 0, 0, a, cen); + } + else + { + PrintAlpha(x -1, y, t, 0, 0, 0, a, cen); + PrintAlpha(x +1, y, t, 0, 0, 0, a, cen); + } + PrintAlpha(x, y+1, t, 0, 0, 0, a, cen); + } + + PrintAlpha(x, y, t, r, g, b, a, cen); +} + void Graphics::printcrewname( int x, int y, int t ) { //Print the name of crew member t in the right colour - const uint32_t flags = flipmode ? PR_CJK_LOW : PR_CJK_HIGH; switch(t) { case 0: - font::print(flags, x, y, loc::gettext("Viridian"), 16, 240, 240); + Print(x, y, "Viridian", 16, 240, 240,false ); break; case 1: - font::print(flags, x, y, loc::gettext("Violet"), 240, 16, 240); + Print(x, y, "Violet", 240, 16, 240,false); break; case 2: - font::print(flags, x, y, loc::gettext("Vitellary"), 240, 240, 16); + Print(x, y, "Vitellary", 240, 240, 16,false); break; case 3: - font::print(flags, x, y, loc::gettext("Vermilion"), 240, 16, 16); + Print(x, y, "Vermilion", 240, 16, 16,false); break; case 4: - font::print(flags, x, y, loc::gettext("Verdigris"), 16, 240, 16); + Print(x, y, "Verdigris", 16, 240, 16,false); break; case 5: - font::print(flags, x, y, loc::gettext("Victoria"), 16, 16, 240); + Print(x, y, "Victoria", 16, 16, 240,false); break; } } @@ -329,978 +787,439 @@ void Graphics::printcrewname( int x, int y, int t ) void Graphics::printcrewnamedark( int x, int y, int t ) { //Print the name of crew member t as above, but in black and white - const uint32_t flags = flipmode ? PR_CJK_LOW : PR_CJK_HIGH; switch(t) { case 0: - font::print(flags, x, y, loc::gettext("Viridian"), 128,128,128); + Print(x, y, "Viridian", 128,128,128,false); break; case 1: - font::print(flags, x, y, loc::gettext("Violet"), 128,128,128); + Print(x, y, "Violet", 128,128,128,false); break; case 2: - font::print(flags, x, y, loc::gettext("Vitellary"), 128,128,128); + Print(x, y, "Vitellary", 128,128,128,false); break; case 3: - font::print(flags, x, y, loc::gettext("Vermilion"), 128,128,128); + Print(x, y, "Vermilion", 128,128,128,false); break; case 4: - font::print(flags, x, y, loc::gettext("Verdigris"), 128,128,128); + Print(x, y, "Verdigris", 128,128,128,false); break; case 5: - font::print(flags, x, y, loc::gettext("Victoria"), 128,128,128); + Print(x, y, "Victoria", 128,128,128,false); break; } } -void Graphics::printcrewnamestatus( int x, int y, int t, bool rescued ) +void Graphics::printcrewnamestatus( int x, int y, int t ) { //Print the status of crew member t in the right colour - int r, g, b; - char gender; - switch(t) { case 0: - r = 12; g = 140, b = 140; - gender = 3; + Print(x, y, "(that's you!)", 12, 140, 140,false); break; case 1: - r = 140; g = 12; b = 140; - gender = 2; + Print(x, y, "Rescued!", 140, 12, 140,false); break; case 2: - r = 140; g = 140; b = 12; - gender = 1; + Print(x, y, "Rescued!", 140, 140, 12,false); break; case 3: - r = 140; g = 12; b = 12; - gender = 1; + Print(x, y, "Rescued!", 140, 12, 12,false); break; case 4: - r = 12; g = 140; b = 12; - gender = 1; + Print(x, y, "Rescued!", 12, 140, 12,false); break; case 5: - r = 12; g = 12; b = 140; - gender = 2; + Print(x, y, "Rescued!", 12, 12, 140,false); break; - default: + } +} + +void Graphics::drawsprite( int x, int y, int t, int r, int g, int b ) +{ + if (!INBOUNDS_VEC(t, sprites)) + { + WHINE_ONCE("drawsprite() out-of-bounds!"); return; } - const char* status_text; - if (gender == 3 && rescued) + SDL_Rect rect = {x, y, sprites_rect.w, sprites_rect.h}; + setcolreal(getRGB(r,g,b)); + BlitSurfaceColoured(sprites[t], NULL, backBuffer, &rect, ct); +} + +void Graphics::drawsprite(int x, int y, int t, Uint32 c) +{ + if (!INBOUNDS_VEC(t, sprites)) { - status_text = loc::gettext("(that's you!)"); - } - else if (rescued) - { - status_text = loc::gettext_case("Rescued!", gender); - } - else - { - r = 64; g = 64; b = 64; - status_text = loc::gettext_case("Missing...", gender); + WHINE_ONCE("drawsprite() out-of-bounds!"); + return; } - font::print(flipmode ? PR_CJK_HIGH : PR_CJK_LOW, x, y, status_text, r, g, b); -} - -void Graphics::print_level_creator( - uint32_t print_flags, - const int y, - const std::string& creator, - const uint8_t r, - const uint8_t g, - const uint8_t b -) { - /* We now display a face instead of "by {author}" for several reasons: - * - "by" may be in a different language than the author and look weird ("por various people") - * - "by" will be longer in different languages and break the limit that levels assume - * - "by" and author may need mutually incompatible fonts, e.g. Japanese level in Korean VVVVVV - * - avoids likely grammar problems: male/female difference, name inflection in user-written text... - * - it makes sense to make it a face - * - if anyone is sad about this decision, the happy face will cheer them up anyway :D */ - int width_for_face = 17; - int total_width = width_for_face + font::len(print_flags, creator.c_str()); - int face_x, text_x, sprite_x; - int offset_x = -7; - if (!font::is_rtl(print_flags)) - { - face_x = (SCREEN_WIDTH_PIXELS - total_width) / 2; - text_x = face_x + width_for_face; - sprite_x = 0; - } - else - { - face_x = (SCREEN_WIDTH_PIXELS + total_width) / 2; - text_x = face_x - width_for_face; - face_x -= 10; // sprite origin - sprite_x = 96; - print_flags |= PR_RIGHT; - } - set_texture_color_mod(grphx.im_sprites, r, g, b); - draw_texture_part(grphx.im_sprites, face_x + offset_x, y - 3, sprite_x, 0, 24, 12, 1, 1); - set_texture_color_mod(grphx.im_sprites, 255, 255, 255); - font::print(print_flags, text_x, y, creator, r, g, b); -} - -int Graphics::set_render_target(SDL_Texture* texture) -{ - const int result = SDL_SetRenderTarget(gameScreen.m_renderer, texture); - if (result != 0) - { - WHINE_ONCE_ARGS(("Could not set render target: %s", SDL_GetError())); - } - return result; -} - -int Graphics::set_texture_color_mod(SDL_Texture* texture, const Uint8 r, const Uint8 g, const Uint8 b) -{ - const int result = SDL_SetTextureColorMod(texture, r, g, b); - if (result != 0) - { - WHINE_ONCE_ARGS(("Could not set texture color mod: %s", SDL_GetError())); - } - return result; -} - -int Graphics::set_texture_alpha_mod(SDL_Texture* texture, const Uint8 alpha) -{ - const int result = SDL_SetTextureAlphaMod(texture, alpha); - if (result != 0) - { - WHINE_ONCE_ARGS(("Could not set texture alpha mod: %s", SDL_GetError())); - } - return result; -} - -int Graphics::query_texture(SDL_Texture* texture, Uint32* format, int* access, int* w, int* h) -{ - const int result = SDL_QueryTexture(texture, format, access, w, h); - if (result != 0) - { - WHINE_ONCE_ARGS(("Could not query texture: %s", SDL_GetError())); - } - return result; -} - -int Graphics::set_blendmode(const SDL_BlendMode blendmode) -{ - const int result = SDL_SetRenderDrawBlendMode(gameScreen.m_renderer, blendmode); - if (result != 0) - { - WHINE_ONCE_ARGS(("Could not set draw mode: %s", SDL_GetError())); - } - return result; -} - -int Graphics::set_blendmode(SDL_Texture* texture, const SDL_BlendMode blendmode) -{ - const int result = SDL_SetTextureBlendMode(texture, blendmode); - if (result != 0) - { - WHINE_ONCE_ARGS(("Could not set texture blend mode: %s", SDL_GetError())); - } - return result; -} - -int Graphics::clear(const int r, const int g, const int b, const int a) -{ - set_color(r, g, b, a); - - const int result = SDL_RenderClear(gameScreen.m_renderer); - if (result != 0) - { - WHINE_ONCE_ARGS(("Could not clear current render target: %s", SDL_GetError())); - } - return result; -} - -int Graphics::clear(void) -{ - return clear(0, 0, 0, 255); -} - -bool Graphics::substitute(SDL_Texture** texture) -{ - /* Either keep the given texture the same and return false, - * or substitute it for a translation and return true. */ - - if (loc::english_sprites) - { - return false; - } - - SDL_Texture* subst = NULL; - - if (*texture == grphx.im_sprites) - { - subst = grphx.im_sprites_translated; - } - else if (*texture == grphx.im_flipsprites) - { - subst = grphx.im_flipsprites_translated; - } - - if (subst == NULL) - { - return false; - } - - // Apply the same colors as on the original - Uint8 r, g, b, a; - SDL_GetTextureColorMod(*texture, &r, &g, &b); - SDL_GetTextureAlphaMod(*texture, &a); - set_texture_color_mod(subst, r, g, b); - set_texture_alpha_mod(subst, a); - - *texture = subst; - return true; -} - -void Graphics::post_substitute(SDL_Texture* subst) -{ - set_texture_color_mod(subst, 255, 255, 255); - set_texture_alpha_mod(subst, 255); -} - -int Graphics::copy_texture(SDL_Texture* texture, const SDL_Rect* src, const SDL_Rect* dest) -{ - bool is_substituted = substitute(&texture); - - const int result = SDL_RenderCopy(gameScreen.m_renderer, texture, src, dest); - if (result != 0) - { - WHINE_ONCE_ARGS(("Could not copy texture: %s", SDL_GetError())); - } - - if (is_substituted) - { - post_substitute(texture); - } - - return result; -} - -int Graphics::copy_texture(SDL_Texture* texture, const SDL_Rect* src, const SDL_Rect* dest, const double angle, const SDL_Point* center, const SDL_RendererFlip flip) -{ - bool is_substituted = substitute(&texture); - - const int result = SDL_RenderCopyEx(gameScreen.m_renderer, texture, src, dest, angle, center, flip); - if (result != 0) - { - WHINE_ONCE_ARGS(("Could not copy texture: %s", SDL_GetError())); - } - - if (is_substituted) - { - post_substitute(texture); - } - - return result; -} - -int Graphics::set_color(const Uint8 r, const Uint8 g, const Uint8 b, const Uint8 a) -{ - const int result = SDL_SetRenderDrawColor(gameScreen.m_renderer, r, g, b, a); - if (result != 0) - { - WHINE_ONCE_ARGS(("Could not set draw color: %s", SDL_GetError())); - } - return result; -} - -int Graphics::set_color(const Uint8 r, const Uint8 g, const Uint8 b) -{ - return set_color(r, g, b, 255); -} - -int Graphics::set_color(const SDL_Color color) -{ - return set_color(color.r, color.g, color.b, color.a); -} - -int Graphics::fill_rect(const SDL_Rect* rect) -{ - const int result = SDL_RenderFillRect(gameScreen.m_renderer, rect); - if (result != 0) - { - WHINE_ONCE_ARGS(("Could not draw filled rectangle: %s", SDL_GetError())); - } - return result; -} - -int Graphics::fill_rect(const SDL_Rect* rect, const int r, const int g, const int b, const int a) -{ - set_color(r, g, b, a); - return fill_rect(rect); -} - -int Graphics::fill_rect(const SDL_Rect* rect, const int r, const int g, const int b) -{ - return fill_rect(rect, r, g, b, 255); -} - -int Graphics::fill_rect(const int r, const int g, const int b) -{ - return fill_rect(NULL, r, g, b, 255); -} - -int Graphics::fill_rect(const SDL_Rect* rect, const SDL_Color color) -{ - return fill_rect(rect, color.r, color.g, color.b, color.a); -} - -int Graphics::fill_rect(const int x, const int y, const int w, const int h, const int r, const int g, const int b, const int a) -{ - const SDL_Rect rect = {x, y, w, h}; - return fill_rect(&rect, r, g, b, a); -} - -int Graphics::fill_rect(const int x, const int y, const int w, const int h, const int r, const int g, const int b) -{ - return fill_rect(x, y, w, h, r, g, b, 255); -} - -int Graphics::fill_rect(const SDL_Color color) -{ - return fill_rect(NULL, color); -} - -int Graphics::fill_rect(const int x, const int y, const int w, const int h, const SDL_Color color) -{ - return fill_rect(x, y, w, h, color.r, color.g, color.b, color.a); -} - -int Graphics::draw_rect(const SDL_Rect* rect) -{ - const int result = SDL_RenderDrawRect(gameScreen.m_renderer, rect); - if (result != 0) - { - WHINE_ONCE_ARGS(("Could not draw rectangle: %s", SDL_GetError())); - } - return result; -} - -int Graphics::draw_rect(const SDL_Rect* rect, const int r, const int g, const int b, const int a) -{ - set_color(r, g, b, a); - return draw_rect(rect); -} - -int Graphics::draw_rect(const SDL_Rect* rect, const int r, const int g, const int b) -{ - return draw_rect(rect, r, g, b, 255); -} - -int Graphics::draw_rect(const SDL_Rect* rect, const SDL_Color color) -{ - return draw_rect(rect, color.r, color.g, color.b, color.a); -} - -int Graphics::draw_rect(const int x, const int y, const int w, const int h, const int r, const int g, const int b, const int a) -{ - const SDL_Rect rect = {x, y, w, h}; - return draw_rect(&rect, r, g, b, a); -} - -int Graphics::draw_rect(const int x, const int y, const int w, const int h, const int r, const int g, const int b) -{ - return draw_rect(x, y, w, h, r, g, b, 255); -} - -int Graphics::draw_rect(const int x, const int y, const int w, const int h, const SDL_Color color) -{ - return draw_rect(x, y, w, h, color.r, color.g, color.b, color.a); -} - -int Graphics::draw_line(const int x, const int y, const int x2, const int y2) -{ - const int result = SDL_RenderDrawLine(gameScreen.m_renderer, x, y, x2, y2); - if (result != 0) - { - WHINE_ONCE_ARGS(("Could not draw line: %s", SDL_GetError())); - } - return result; -} - -int Graphics::draw_points(const SDL_Point* points, const int count) -{ - const int result = SDL_RenderDrawPoints(gameScreen.m_renderer, points, count); - if (result != 0) - { - WHINE_ONCE_ARGS(("Could not draw points: %s", SDL_GetError())); - } - return result; -} - -int Graphics::draw_points(const SDL_Point* points, const int count, const int r, const int g, const int b) -{ - set_color(r, g, b); - return draw_points(points, count); -} - -void Graphics::draw_sprite(const int x, const int y, const int t, const int r, const int g, const int b) -{ - draw_grid_tile(grphx.im_sprites, t, x, y, sprites_rect.w, sprites_rect.h, r, g, b); -} - -void Graphics::draw_sprite(const int x, const int y, const int t, const SDL_Color color) -{ - draw_grid_tile(grphx.im_sprites, t, x, y, sprites_rect.w, sprites_rect.h, color); -} - -void Graphics::draw_flipsprite(const int x, const int y, const int t, const SDL_Color color) -{ - draw_grid_tile(grphx.im_flipsprites, t, x, y, sprites_rect.w, sprites_rect.h, color); -} - -void Graphics::scroll_texture(SDL_Texture* texture, SDL_Texture* temp, const int x, const int y) -{ - SDL_Texture* target = SDL_GetRenderTarget(gameScreen.m_renderer); - SDL_Rect texture_rect = {0, 0, 0, 0}; - SDL_QueryTexture(texture, NULL, NULL, &texture_rect.w, &texture_rect.h); - - const SDL_Rect src = {0, 0, texture_rect.w, texture_rect.h}; - const SDL_Rect dest = {x, y, texture_rect.w, texture_rect.h}; - - set_render_target(temp); - clear(); - copy_texture(texture, &src, &dest); - set_render_target(target); - copy_texture(temp, &src, &src); + SDL_Rect rect = {x, y, sprites_rect.w, sprites_rect.h}; + setcolreal(c); + BlitSurfaceColoured(sprites[t], NULL, backBuffer, &rect, ct); } +#ifndef NO_CUSTOM_LEVELS bool Graphics::shouldrecoloroneway(const int tilenum, const bool mounted) { return (tilenum >= 14 && tilenum <= 17 && (!mounted - || cl.onewaycol_override)); + || ed.onewaycol_override)); } +#endif -void Graphics::drawtile(int x, int y, int t) +void Graphics::drawtile( int x, int y, int t ) { - if (shouldrecoloroneway(t, tiles1_mounted)) - { - draw_grid_tile(grphx.im_tiles_tint, t, x, y, tiles_rect.w, tiles_rect.h, cl.getonewaycol()); - } - else - { - draw_grid_tile(grphx.im_tiles, t, x, y, tiles_rect.w, tiles_rect.h); - } -} - - -void Graphics::drawtile2(int x, int y, int t) -{ - if (shouldrecoloroneway(t, tiles2_mounted)) - { - draw_grid_tile(grphx.im_tiles2_tint, t, x, y, tiles_rect.w, tiles_rect.h, cl.getonewaycol()); - } - else - { - draw_grid_tile(grphx.im_tiles2, t, x, y, tiles_rect.w, tiles_rect.h); - } -} - -void Graphics::drawtile3(int x, int y, int t, int off, int height_subtract /*= 0*/) -{ - t += off * 30; - - // Can't use drawgridtile because we want to draw a slice of the tile, - // so do the logic ourselves (except include height_subtract in the final call) - - int width; - if (query_texture(grphx.im_tiles3, NULL, NULL, &width, NULL) != 0) + if (!INBOUNDS_VEC(t, tiles)) { + WHINE_ONCE("drawtile() out-of-bounds!"); return; } - const int x2 = (t % (width / 8)) * 8; - const int y2 = (t / (width / 8)) * 8; - draw_texture_part(grphx.im_tiles3, x, y, x2, y2, 8, 8 - height_subtract, 1, 1); + + SDL_Rect rect = {x, y, tiles_rect.w, tiles_rect.h}; + +#if !defined(NO_CUSTOM_LEVELS) + if (shouldrecoloroneway(t, tiles1_mounted)) + { + colourTransform thect = {ed.getonewaycol()}; + BlitSurfaceTinted(tiles[t], NULL, backBuffer, &rect, thect); + } + else +#endif + { + BlitSurfaceStandard(tiles[t], NULL, backBuffer, &rect); + } } -const char* Graphics::textbox_line( - char* buffer, - const size_t buffer_len, - const size_t textbox_i, - const size_t line_i -) { - /* Gets a line in a textbox, accounting for filling button placeholders like {b_map}. - * Takes a buffer as an argument, but DOESN'T ALWAYS write to that buffer. - * Always use the return value! ^^ - * Does not check boundaries. */ - const char* line = textboxes[textbox_i].lines[line_i].c_str(); - if (!textboxes[textbox_i].fill_buttons) +void Graphics::drawtile2( int x, int y, int t ) +{ + if (!INBOUNDS_VEC(t, tiles2)) { - return line; + WHINE_ONCE("drawtile2() out-of-bounds!"); + return; } - vformat_buf(buffer, buffer_len, - line, - "b_act:but," - "b_int:but," - "b_map:but," - "b_res:but," - "b_esc:but", - vformat_button(ActionSet_InGame, Action_InGame_ACTION), - vformat_button(ActionSet_InGame, Action_InGame_Interact), - vformat_button(ActionSet_InGame, Action_InGame_Map), - vformat_button(ActionSet_InGame, Action_InGame_Restart), - vformat_button(ActionSet_InGame, Action_InGame_Esc) - ); - return buffer; + SDL_Rect rect = {x, y, tiles_rect.w, tiles_rect.h}; + +#if !defined(NO_CUSTOM_LEVELS) + if (shouldrecoloroneway(t, tiles2_mounted)) + { + colourTransform thect = {ed.getonewaycol()}; + BlitSurfaceTinted(tiles2[t], NULL, backBuffer, &rect, thect); + } + else +#endif + { + BlitSurfaceStandard(tiles2[t], NULL, backBuffer, &rect); + } +} + + + +void Graphics::drawtile3( int x, int y, int t, int off, int height_subtract /*= 0*/ ) +{ + t += off * 30; + if (!INBOUNDS_VEC(t, tiles3)) + { + WHINE_ONCE("drawtile3() out-of-bounds!"); + return; + } + SDL_Rect src_rect = { 0, 0, tiles_rect.w, tiles_rect.h - height_subtract }; + SDL_Rect rect = {x, y, tiles_rect.w, tiles_rect.h}; + BlitSurfaceStandard(tiles3[t], &src_rect, backBuffer, &rect); +} + +void Graphics::drawtowertile( int x, int y, int t ) +{ + if (!INBOUNDS_VEC(t, tiles2)) + { + WHINE_ONCE("drawtowertile() out-of-bounds!"); + return; + } + x += 8; + y += 8; + SDL_Rect rect = {x, y, tiles_rect.w, tiles_rect.h}; + BlitSurfaceStandard(tiles2[t], NULL, warpbuffer, &rect); +} + + +void Graphics::drawtowertile3( int x, int y, int t, TowerBG& bg_obj ) +{ + t += bg_obj.colstate*30; + if (!INBOUNDS_VEC(t, tiles3)) + { + WHINE_ONCE("drawtowertile3() out-of-bounds!"); + return; + } + x += 8; + y += 8; + SDL_Rect rect = {x, y, tiles_rect.w, tiles_rect.h}; + BlitSurfaceStandard(tiles3[t], NULL, bg_obj.buffer, &rect); } void Graphics::drawgui(void) { int text_sign; - + int crew_yp; + int crew_sprite; if (flipmode) { text_sign = -1; + crew_yp = 64 + 48 + 4; + crew_sprite = 6; } else { text_sign = 1; + crew_yp = 64 + 32 + 4; + crew_sprite = 0; } //Draw all the textboxes to the screen - for (size_t i = 0; i < textboxes.size(); i++) + for (size_t i = 0; i max) - { - max = len; - } - } - w = max + 16; - } - - uint32_t print_flags = textboxes[i].print_flags | PR_CJK_LOW; - int text_xp; - - if (font::is_rtl(print_flags)) - { - print_flags |= PR_RIGHT; - text_xp = textboxes[i].xp + w - 8; - } - else - { - text_xp = textboxes[i].xp + 8; - } - - const bool transparent = (textboxes[i].r | textboxes[i].g | textboxes[i].b) == 0; - - if (transparent) - { - /* To avoid the outlines for different lines overlapping the text itself, - * first draw all the outlines and then draw the text. */ - size_t j; - for (j = 0; j < textboxes[i].lines.size(); j++) - { - const int x = text_xp; - const int y = yp + text_yoff + text_sign * (j * (font_height + textboxes[i].linegap)); - if (!textboxes[i].force_outline) - { - font::print(print_flags | PR_BOR, x, y, textbox_line(buffer, sizeof(buffer), i, j), 0, 0, 0); - } - else if (textboxes[i].outline) - { - // We're forcing an outline, so we'll have to draw it ourselves instead of relying on PR_BOR. - font::print(print_flags, x - 1, y, textbox_line(buffer, sizeof(buffer), i, j), 0, 0, 0); - font::print(print_flags, x + 1, y, textbox_line(buffer, sizeof(buffer), i, j), 0, 0, 0); - font::print(print_flags, x, y - 1, textbox_line(buffer, sizeof(buffer), i, j), 0, 0, 0); - font::print(print_flags, x, y + 1, textbox_line(buffer, sizeof(buffer), i, j), 0, 0, 0); - } - } - for (j = 0; j < textboxes[i].lines.size(); j++) - { - font::print( - print_flags, - text_xp, - yp + text_yoff + text_sign * (j * (font_height + textboxes[i].linegap)), - textbox_line(buffer, sizeof(buffer), i, j), - 196, 196, 255 - help.glow - ); + bprint(textbox[i].xp + 8, yp + text_yoff + text_sign * (j * 8), textbox[i].line[j], 196, 196, 255 - help.glow); } } else { - const float tl_lerp = lerp(textboxes[i].prev_tl, textboxes[i].tl); - const int r = textboxes[i].r * tl_lerp; - const int g = textboxes[i].g * tl_lerp; - const int b = textboxes[i].b * tl_lerp; + SDL_Rect textrect = {textbox[i].xp, yp, textbox[i].w, textbox[i].h}; - drawpixeltextbox(textboxes[i].xp, yp, w, textboxes[i].h, r, g, b); + FillRect(backBuffer, textrect, textbox[i].r/6, textbox[i].g/6, textbox[i].b / 6 ); - for (size_t j = 0; j < textboxes[i].lines.size(); j++) + drawcoloredtile(textbox[i].xp, yp, 40, textbox[i].r, textbox[i].g, textbox[i].b); + drawcoloredtile(textbox[i].xp+textbox[i].w-8, yp, 42, textbox[i].r, textbox[i].g, textbox[i].b); + drawcoloredtile(textbox[i].xp, yp+textbox[i].h-8, 45, textbox[i].r, textbox[i].g, textbox[i].b); + drawcoloredtile(textbox[i].xp+textbox[i].w-8, yp+textbox[i].h-8, 47, textbox[i].r, textbox[i].g, textbox[i].b); + for (int k = 0; k < textbox[i].lw; k++) { - font::print( - print_flags | PR_BRIGHTNESS(tl_lerp*255), - text_xp, - yp + text_yoff + text_sign * (j * (font_height + textboxes[i].linegap)), - textbox_line(buffer, sizeof(buffer), i, j), - textboxes[i].r, textboxes[i].g, textboxes[i].b - ); + drawcoloredtile(textbox[i].xp + 8 + (k * 8), yp, 41, textbox[i].r, textbox[i].g, textbox[i].b); + drawcoloredtile(textbox[i].xp + 8 + (k * 8), yp+textbox[i].h-8, 46, textbox[i].r, textbox[i].g, textbox[i].b); + } + for (size_t k = 0; k < textbox[i].line.size(); k++) + { + drawcoloredtile(textbox[i].xp, yp + 8 + (k * 8), 43, textbox[i].r, textbox[i].g, textbox[i].b); + drawcoloredtile(textbox[i].xp + textbox[i].w-8, yp + 8 + (k * 8), 44, textbox[i].r, textbox[i].g, textbox[i].b); + } + + for (size_t j = 0; j < textbox[i].line.size(); j++) + { + Print(textbox[i].xp + 8, yp + text_yoff + text_sign * (j * 8), textbox[i].line[j], textbox[i].r, textbox[i].g, textbox[i].b); } } - const bool opaque = textboxes[i].tl >= 1.0; - const bool draw_overlays = opaque || transparent; + opaque = textbox[i].tl >= 1.0; - if (!draw_overlays) + if (!opaque) { continue; } - if (textboxes[i].image == TEXTIMAGE_LEVELCOMPLETE) + if (textbox[i].yp == 12 && textbox[i].tr == 165) { - // Level complete - const char* english = "Level Complete!"; - const char* translation = loc::gettext(english); - if (SDL_strcmp(english, translation) != 0 - && !(flipmode && fliplevelcomplete_mounted) - && !(!flipmode && levelcomplete_mounted) - ) - { - int sc = 2; - int y = 28; - if (font::len(0, translation) > 144) - { - // We told translators how long it could be... Ah well, mitigate the damage. - sc = 1; - y += 4; - } - if (flipmode) - { - y = 240 - y - 8 * sc; - } - SDL_Color color = TEXT_COLOUR("cyan"); - font::print((sc == 2 ? PR_2X : PR_1X) | PR_CEN, -1, y, translation, color.r, color.g, color.b); - } - else - { - if (flipmode) - { - drawimage(IMAGE_FLIPLEVELCOMPLETE, 0, 180, true); - } - else - { - drawimage(IMAGE_LEVELCOMPLETE, 0, 12, true); - } - } - } - else if (textboxes[i].image == TEXTIMAGE_GAMECOMPLETE) - { - // Game complete - const char* english = "Game Complete!"; - const char* translation = loc::gettext(english); - if (SDL_strcmp(english, translation) != 0 - && !(flipmode && flipgamecomplete_mounted) - && !(!flipmode && gamecomplete_mounted) - ) - { - int sc = 2; - int y = 28; - if (font::len(0, translation) > 144) - { - // We told translators how long it could be... Ah well, mitigate the damage. - sc = 1; - y += 4; - } - if (flipmode) - { - y = 240 - y - 8 * sc; - } - font::print((sc == 2 ? PR_2X : PR_1X) | PR_CEN, -1, y, translation, 196, 196, 243); - } - else - { - if (flipmode) - { - drawimage(IMAGE_FLIPGAMECOMPLETE, 0, 180, true); - } - else - { - drawimage(IMAGE_GAMECOMPLETE, 0, 12, true); - } - } - } - - for (size_t index = 0; index < textboxes[i].sprites.size(); index++) - { - TextboxSprite* sprite = &textboxes[i].sprites[index]; - int y = sprite->y + yp; - if (flipmode) { - y = yp + textboxes[i].h - sprite->y - sprites_rect.h; + drawimage(5, 0, 180, true); } - - draw_grid_tile( - grphx.im_sprites, - sprite->tile, - sprite->x + textboxes[i].xp, - y, - sprites_rect.w, - sprites_rect.h, - getcol(sprite->col), - 1, - (flipmode ? -1 : 1) - ); + else + { + drawimage(0, 0, 12, true); + } + } + else if (textbox[i].yp == 12 && textbox[i].tg == 165) + { + if (flipmode) + { + drawimage(6, 0, 180, true); + } + else + { + drawimage(4, 0, 12, true); + } + } + if (textbox[i].tr == 175 && textbox[i].tg == 175) + { + //purple guy + drawsprite(80 - 6, crew_yp, crew_sprite, 220- help.glow/4 - textbox[i].rand, 120- help.glow/4, 210 - help.glow/4); + } + else if (textbox[i].tr == 175 && textbox[i].tb == 175) + { + //red guy + drawsprite(80 - 6, crew_yp, crew_sprite, 255 - help.glow/8, 70 - help.glow/4, 70 - help.glow / 4); + } + else if (textbox[i].tr == 175) + { + //green guy + drawsprite(80 - 6, crew_yp, crew_sprite, 120 - help.glow / 4 - textbox[i].rand, 220 - help.glow / 4, 120 - help.glow / 4); + } + else if (textbox[i].tg == 175) + { + //yellow guy + drawsprite(80 - 6, crew_yp, crew_sprite, 220- help.glow/4 - textbox[i].rand, 210 - help.glow/4, 120- help.glow/4); + } + else if (textbox[i].tb == 175) + { + //blue guy + drawsprite(80 - 6, crew_yp, crew_sprite, 75, 75, 255- help.glow/4 - textbox[i].rand); } } } void Graphics::updatetextboxes(void) { - for (size_t i = 0; i < textboxes.size(); i++) + for (size_t i = 0; i < textbox.size(); i++) { - textboxes[i].update(); + textbox[i].update(); - if (textboxes[i].tm == 2 && textboxes[i].tl <= 0.5) + if (textbox[i].tm == 2 && textbox[i].tl <= 0.5) { - textboxes.erase(textboxes.begin() + i); + textbox.erase(textbox.begin() + i); i--; continue; } - if (textboxes[i].tl >= 1.0f - && ((textboxes[i].r == 175 && textboxes[i].g == 175) - || textboxes[i].r == 175 - || textboxes[i].g == 175 - || textboxes[i].b == 175) - && (textboxes[i].r != 175 || textboxes[i].b != 175)) + if (textbox[i].tl >= 1.0f + && ((textbox[i].tr == 175 && textbox[i].tg == 175) + || textbox[i].tr == 175 + || textbox[i].tg == 175 + || textbox[i].tb == 175) + && (textbox[i].tr != 175 || textbox[i].tb != 175)) { - textboxes[i].rand = fRandom() * 20; + textbox[i].rand = fRandom() * 20; } } } -void Graphics::drawimagecol( int t, int xp, int yp, const SDL_Color ct, bool cent/*= false*/ ) +void Graphics::drawimagecol( int t, int xp, int yp, int r = 0, int g = 0, int b = 0, bool cent/*= false*/ ) { - if (!INBOUNDS_ARR(t, images) || images[t] == NULL) + if (!INBOUNDS_VEC(t, images)) { return; } SDL_Rect trect; - - trect.x = xp; - trect.y = yp; - - if (query_texture(images[t], NULL, NULL, &trect.w, &trect.h) != 0) + if(r+g+b != 0) { - return; + RGBf(r,g,b); } + point tpoint; if (cent) { - trect.x = (int) ((SCREEN_WIDTH_PIXELS - trect.w) / 2); - } + tpoint.x = 160 - int(images[t]->w / 2); + tpoint.y = yp; + trect.x = tpoint.x ; + trect.y = tpoint.y; + trect.w = images[t]->w; + trect.h= images[t]->h; + BlitSurfaceColoured(images[t], NULL, backBuffer, &trect, ct); - set_texture_color_mod(images[t], ct.r, ct.g, ct.b); - draw_texture(images[t], trect.x, trect.y); - set_texture_color_mod(images[t], 255, 255, 255); + } + else + { + trect.x = xp; + trect.y = yp; + trect.w = images[t]->w; + trect.h = images[t]->h; + BlitSurfaceColoured(images[t], NULL, backBuffer, &trect, ct); + + } } void Graphics::drawimage( int t, int xp, int yp, bool cent/*=false*/ ) { - if (!INBOUNDS_ARR(t, images) || images[t] == NULL) + if (!INBOUNDS_VEC(t, images)) { return; } SDL_Rect trect; - - trect.x = xp; - trect.y = yp; - - if (query_texture(images[t], NULL, NULL, &trect.w, &trect.h) != 0) - { - return; - } - if (cent) { - trect.x = (int) ((SCREEN_WIDTH_PIXELS - trect.w) / 2); + trect.x = 160 - int(images[t]->w / 2); + trect.y = yp; + trect.w = images[t]->w; + trect.h = images[t]->h; + BlitSurfaceStandard(images[t], NULL, backBuffer, &trect); } + else + { - draw_texture(images[t], trect.x, trect.y); + trect.x = xp; + trect.y = yp; + trect.w = images[t]->w; + trect.h= images[t]->h; + + BlitSurfaceStandard(images[t], NULL, backBuffer, &trect); + } } -void Graphics::drawpartimage(const int t, const int xp, const int yp, const int wp, const int hp) +void Graphics::drawpartimage( int t, int xp, int yp, int wp, int hp) { - if (!INBOUNDS_ARR(t, images) || images[t] == NULL) - { - return; - } - draw_texture_part(images[t], xp, yp, 0, 0, wp, hp, 1, 1); -} + if (!INBOUNDS_VEC(t, images)) + { + return; + } -void Graphics::draw_texture(SDL_Texture* image, const int x, const int y) -{ - int w, h; + SDL_Rect trect; - if (query_texture(image, NULL, NULL, &w, &h) != 0) - { - return; - } + trect.x = xp; + trect.y = yp; + trect.w = wp; + trect.h= hp; - const SDL_Rect dstrect = {x, y, w, h}; + SDL_Rect trect2; - copy_texture(image, NULL, &dstrect); -} + trect2.x = 0; + trect2.y = 0; + trect2.w = wp; + trect2.h= hp; -void Graphics::draw_texture_part(SDL_Texture* image, const int x, const int y, const int x2, const int y2, const int w, const int h, const int scalex, const int scaley) -{ - const SDL_Rect srcrect = {x2, y2, w, h}; - - int flip = SDL_FLIP_NONE; - - if (scalex < 0) - { - flip |= SDL_FLIP_HORIZONTAL; - } - if (scaley < 0) - { - flip |= SDL_FLIP_VERTICAL; - } - - const SDL_Rect dstrect = {x, y, w * SDL_abs(scalex), h * SDL_abs(scaley)}; - - copy_texture(image, &srcrect, &dstrect, 0, NULL, (SDL_RendererFlip) flip); -} - -void Graphics::draw_grid_tile(SDL_Texture* texture, const int t, const int x, const int y, const int width, const int height, const int scalex, const int scaley) -{ - int tex_width; - - if (query_texture(texture, NULL, NULL, &tex_width, NULL) != 0) - { - return; - } - - const int x2 = (t % (tex_width / width)) * width; - const int y2 = (t / (tex_width / width)) * height; - draw_texture_part(texture, x, y, x2, y2, width, height, scalex, scaley); -} - -void Graphics::draw_grid_tile( - SDL_Texture* texture, const int t, - const int x, const int y, const int width, const int height -) { - draw_grid_tile(texture, t, x, y, width, height, 1, 1); -} - -void Graphics::draw_grid_tile( - SDL_Texture* texture, const int t, - const int x, const int y, const int width, const int height, - const int r, const int g, const int b, const int a, - const int scalex, const int scaley -) { - set_texture_color_mod(texture, r, g, b); - set_texture_alpha_mod(texture, a); - draw_grid_tile(texture, t, x, y, width, height, scalex, scaley); - set_texture_color_mod(texture, 255, 255, 255); - set_texture_alpha_mod(texture, 255); -} - -void Graphics::draw_grid_tile( - SDL_Texture* texture, const int t, - const int x, const int y, const int width, const int height, - const int r, const int g, const int b, const int a -) { - draw_grid_tile(texture, t, x, y, width, height, r, g, b, a, 1, 1); -} - -void Graphics::draw_grid_tile( - SDL_Texture* texture, const int t, - const int x, const int y, const int width, const int height, - const int r, const int g, const int b, - const int scalex, const int scaley -) { - draw_grid_tile(texture, t, x, y, width, height, r, g, b, 255, scalex, scaley); -} - -void Graphics::draw_grid_tile( - SDL_Texture* texture, const int t, - const int x, const int y, const int width, const int height, - const int r, const int g, const int b -) { - draw_grid_tile(texture, t, x, y, width, height, r, g, b, 255); -} - -void Graphics::draw_grid_tile( - SDL_Texture* texture, const int t, - const int x, const int y, const int width, const int height, - const SDL_Color color, - const int scalex, const int scaley -) { - draw_grid_tile(texture, t, x, y, width, height, color.r, color.g, color.b, color.a, scalex, scaley); -} - -void Graphics::draw_grid_tile( - SDL_Texture* texture, const int t, - const int x, const int y, const int width, const int height, - const SDL_Color color -) { - draw_grid_tile(texture, t, x, y, width, height, color, 1, 1); -} - -void Graphics::draw_region_image(int t, int xp, int yp, int wp, int hp) -{ - if (!INBOUNDS_ARR(t, customminimaps) || customminimaps[t] == NULL) - { - return; - } - draw_texture_part(customminimaps[t], xp, yp, 0, 0, wp, hp, 1, 1); + BlitSurfaceStandard(images[t], &trect2, backBuffer, &trect); } void Graphics::cutscenebars(void) { - const int usethispos = lerp(oldcutscenebarspos, cutscenebarspos); + int usethispos = lerp(oldcutscenebarspos, cutscenebarspos); if (showcutscenebars) { - fill_rect(0, 0, usethispos, 16, 0, 0, 0); - fill_rect(360 - usethispos, 224, usethispos, 16, 0, 0, 0); + FillRect(backBuffer, 0, 0, usethispos, 16, 0x000000); + FillRect(backBuffer, 360-usethispos, 224, usethispos, 16, 0x000000); } else if (cutscenebarspos > 0) //disappearing { //draw - fill_rect(0, 0, usethispos, 16, 0, 0, 0); - fill_rect(360 - usethispos, 224, usethispos, 16, 0, 0, 0); + FillRect(backBuffer, 0, 0, usethispos, 16, 0x000000); + FillRect(backBuffer, 360-usethispos, 224, usethispos, 16, 0x000000); } } @@ -1310,13 +1229,13 @@ void Graphics::cutscenebarstimer(void) if (showcutscenebars) { cutscenebarspos += 25; - cutscenebarspos = SDL_min(cutscenebarspos, 361); + cutscenebarspos = VVV_min(cutscenebarspos, 361); } else if (cutscenebarspos > 0) { //disappearing cutscenebarspos -= 25; - cutscenebarspos = SDL_max(cutscenebarspos, 0); + cutscenebarspos = VVV_max(cutscenebarspos, 0); } } @@ -1326,7 +1245,7 @@ void Graphics::setbars(const int position) oldcutscenebarspos = position; } -void Graphics::drawcrewman(int x, int y, int t, bool act, bool noshift /*=false*/) +void Graphics::drawcrewman( int x, int y, int t, bool act, bool noshift /*=false*/ ) { if (!act) { @@ -1334,22 +1253,22 @@ void Graphics::drawcrewman(int x, int y, int t, bool act, bool noshift /*=false* { if (flipmode) { - draw_sprite(x, y, 14, col_crewinactive); + drawsprite(x, y, 14, col_crewinactive); } else { - draw_sprite(x, y, 12, col_crewinactive); + drawsprite(x, y, 12, col_crewinactive); } } else { if (flipmode) { - draw_sprite(x - 8, y, 14, col_crewinactive); + drawsprite(x - 8, y, 14, col_crewinactive); } else { - draw_sprite(x - 8, y, 12, col_crewinactive); + drawsprite(x - 8, y, 12, col_crewinactive); } } } @@ -1360,22 +1279,22 @@ void Graphics::drawcrewman(int x, int y, int t, bool act, bool noshift /*=false* switch(t) { case 0: - draw_sprite(x, y, crewframe, col_crewcyan); + drawsprite(x, y, crewframe, col_crewcyan); break; case 1: - draw_sprite(x, y, crewframe, col_crewpurple); + drawsprite(x, y, crewframe, col_crewpurple); break; case 2: - draw_sprite(x, y, crewframe, col_crewyellow); + drawsprite(x, y, crewframe, col_crewyellow); break; case 3: - draw_sprite(x, y, crewframe, col_crewred); + drawsprite(x, y, crewframe, col_crewred); break; case 4: - draw_sprite(x, y, crewframe, col_crewgreen); + drawsprite(x, y, crewframe, col_crewgreen); break; case 5: - draw_sprite(x, y, crewframe, col_crewblue); + drawsprite(x, y, crewframe, col_crewblue); break; } @@ -1383,308 +1302,263 @@ void Graphics::drawcrewman(int x, int y, int t, bool act, bool noshift /*=false* } } -void Graphics::drawpixeltextbox( - const int x, - const int y, - const int w, - const int h, - const int r, - const int g, - const int b -) { - int k; +void Graphics::drawpixeltextbox( int x, int y, int w, int h, int w2, int h2, int r, int g, int b, int xo, int yo ) +{ + //given these parameters, draw a textbox with a pixel width - fill_rect(x, y, w, h, r / 6, g / 6, b / 6); + //madrect.x = x; madrect.y = y; madrect.w = w; madrect.h = h; + FillRect(backBuffer,x,y,w,h, r/6, g/6, b/6 ); - /* Horizontal tiles */ - for (k = 0; k < w / 8 - 2; ++k) + for (int k = 0; k < w2-2; k++) { - drawcoloredtile(x + 8 + k * 8, y, 41, r, g, b); - drawcoloredtile(x + 8 + k * 8, y + h - 8, 46, r, g, b); + drawcoloredtile(x + 8-xo + (k * 8), y, 41, r, g, b); + drawcoloredtile(x + 8-xo + (k * 8), y + (h) - 8, 46, r, g, b); } - if (w % 8 != 0) + for (int k = 0; k < h2-2; k++) { - /* Fill in horizontal gap */ - drawcoloredtile(x + w - 16, y, 41, r, g, b); - drawcoloredtile(x + w - 16, y + h - 8, 46, r, g, b); + drawcoloredtile(x, y + 8-yo + (k * 8), 43, r, g, b); + drawcoloredtile(x + (w) - 8, y + 8-yo + (k * 8), 44, r, g, b); } - /* Vertical tiles */ - for (k = 0; k < h / 8 - 2; ++k) - { - drawcoloredtile(x, y + 8 + k * 8, 43, r, g, b); - drawcoloredtile(x + w - 8, y + 8 + k * 8, 44, r, g, b); - } - - if (h % 8 != 0) - { - /* Fill in vertical gap */ - drawcoloredtile(x, y + h - 16, 43, r, g, b); - drawcoloredtile(x + w - 8, y + h - 16, 44, r, g, b); - } - - /* Corners */ drawcoloredtile(x, y, 40, r, g, b); - drawcoloredtile(x + w - 8, y, 42, r, g, b); - drawcoloredtile(x, y + h - 8, 45, r, g, b); - drawcoloredtile(x + w - 8, y + h - 8, 47, r, g, b); + drawcoloredtile(x + (w) - 8, y, 42, r, g, b); + drawcoloredtile(x, y + (h) - 8, 45, r, g, b); + drawcoloredtile(x + (w) - 8, y + (h) - 8, 47, r, g, b); +} + +void Graphics::drawcustompixeltextbox( int x, int y, int w, int h, int w2, int h2, int r, int g, int b, int xo, int yo ) +{ + //given these parameters, draw a textbox with a pixel width + + FillRect(backBuffer,x,y,w,h, r/6, g/6, b/6 ); + + for (int k = 0; k < w2-2; k++) + { + drawcoloredtile(x + 8-xo + (k * 8), y, 41, r, g, b); + drawcoloredtile(x + 8-xo + (k * 8), y + (h) - 8, 46, r, g, b); + } + + + drawcoloredtile(x+ (w) - 16, y, 41, r, g, b); + drawcoloredtile(x+ (w) - 16, y + (h) - 8, 46, r, g, b); + drawcoloredtile(x+ (w) - 24, y, 41, r, g, b); + drawcoloredtile(x+ (w) - 24, y + (h) - 8, 46, r, g, b); + + for (int k = 0; k < h2-2; k++) + { + drawcoloredtile(x, y + 8-yo + (k * 8), 43, r, g, b); + drawcoloredtile(x + (w) - 8, y + 8-yo + (k * 8), 44, r, g, b); + } + + drawcoloredtile(x, y + (h) - 16, 43, r, g, b); + drawcoloredtile(x + (w) - 8, y + (h) - 16, 44, r, g, b); + drawcoloredtile(x, y + (h) - 24, 43, r, g, b); + drawcoloredtile(x + (w) - 8, y + (h) - 24, 44, r, g, b); + + drawcoloredtile(x, y, 40, r, g, b); + drawcoloredtile(x + (w) - 8, y, 42, r, g, b); + drawcoloredtile(x, y + (h) - 8, 45, r, g, b); + drawcoloredtile(x + (w) - 8, y + (h) - 8, 47, r, g, b); +} + +void Graphics::drawtextbox( int x, int y, int w, int h, int r, int g, int b ) +{ + //given these parameters, draw a textbox + FillRect(backBuffer,x,y,w*8,h*8, r/6, g/6, b/6 ); + + drawcoloredtile(x, y, 40, r, g, b); + drawcoloredtile(x + (w*8) - 8, y, 42, r, g, b); + drawcoloredtile(x, y + (h*8) - 8, 45, r, g, b); + drawcoloredtile(x + (w*8) - 8, y + (h*8) - 8, 47, r, g, b); + + for (int k = 0; k < w-2; k++) + { + drawcoloredtile(x + 8 + (k * 8), y, 41, r, g, b); + drawcoloredtile(x + 8 + (k * 8), y + (h * 8) - 8, 46, r, g, b); + } + + for (int k = 0; k < h-2; k++) + { + drawcoloredtile(x, y + 8 + (k * 8), 43, r, g, b); + drawcoloredtile(x + (w * 8) - 8, y + 8 + (k * 8), 44, r, g, b); + } } void Graphics::textboxactive(void) { //Remove all but the most recent textbox - for (int i = 0; i < (int) textboxes.size(); i++) + for (int i = 0; i < (int) textbox.size(); i++) { - if (m != i) textboxes[i].remove(); + if (m != i) textbox[i].remove(); } } void Graphics::textboxremovefast(void) { //Remove all textboxes - for (size_t i = 0; i < textboxes.size(); i++) + for (size_t i = 0; i < textbox.size(); i++) { - textboxes[i].removefast(); + textbox[i].removefast(); } } void Graphics::textboxremove(void) { //Remove all textboxes - for (size_t i = 0; i < textboxes.size(); i++) + for (size_t i = 0; i < textbox.size(); i++) { - textboxes[i].remove(); + textbox[i].remove(); } } -void Graphics::textboxtimer(int t) +void Graphics::textboxtimer( int t ) { - if (!INBOUNDS_VEC(m, textboxes)) + if (!INBOUNDS_VEC(m, textbox)) { - vlog_error("textboxtimer() out-of-bounds!"); + puts("textboxtimer() out-of-bounds!"); return; } - textboxes[m].timer = t; + textbox[m].timer=t; } -void Graphics::addsprite(int x, int y, int tile, int col) +void Graphics::addline( std::string t ) { - if (!INBOUNDS_VEC(m, textboxes)) + if (!INBOUNDS_VEC(m, textbox)) { - vlog_error("addsprite() out-of-bounds!"); + puts("addline() out-of-bounds!"); return; } - textboxes[m].addsprite(x, y, tile, col); + textbox[m].addline(t); } -void Graphics::setimage(TextboxImage image) +void Graphics::textboxadjust(void) { - if (!INBOUNDS_VEC(m, textboxes)) + if (!INBOUNDS_VEC(m, textbox)) { - vlog_error("setimage() out-of-bounds!"); + puts("textboxadjust() out-of-bounds!"); return; } - textboxes[m].setimage(image); + textbox[m].adjust(); } -void Graphics::textboxoutline(bool enabled) -{ - if (!INBOUNDS_VEC(m, textboxes)) - { - vlog_error("textboxoutline() out-of-bounds!"); - return; - } - - textboxes[m].force_outline = true; - textboxes[m].outline = enabled; -} - -void Graphics::addline( const std::string& t ) -{ - if (!INBOUNDS_VEC(m, textboxes)) - { - vlog_error("addline() out-of-bounds!"); - return; - } - - textboxes[m].addline(t); -} - -void Graphics::setlarge(bool large) -{ - if (!INBOUNDS_VEC(m, textboxes)) - { - vlog_error("setlarge() out-of-bounds!"); - return; - } - - textboxes[m].large = large; -} - -void Graphics::textboxapplyposition(void) -{ - if (!INBOUNDS_VEC(m, textboxes)) - { - vlog_error("textboxapplyposition() out-of-bounds!"); - return; - } - - textboxes[m].applyposition(); -} - -void Graphics::setlinegap(int customvalue) -{ - if (!INBOUNDS_VEC(m, textboxes)) - { - vlog_error("setlinegap() out-of-bounds!"); - return; - } - - textboxes[m].linegap = customvalue; - textboxes[m].resize(); -} - -int Graphics::getlinegap(void) -{ - // Don't use linegaps in custom levels, for now anyway - if (map.custommode) return 0; - return 1; -} - -void Graphics::textboxindex(const int index) -{ - if (!INBOUNDS_VEC(m, textboxes)) - { - vlog_error("textboxindex() out-of-bounds!"); - return; - } - - textboxes[m].other_textbox_index = index; -} void Graphics::createtextboxreal( - const std::string& t, - int xp, int yp, - int r, int g, int b, + std::string t, + int xp, + int yp, + int r, + int g, + int b, bool flipme ) { - m = textboxes.size(); + m = textbox.size(); - if (m < 20) + if(m<20) { - textboxclass text(getlinegap()); - text.lines.push_back(t); + textboxclass text; + text.line.push_back(t); text.xp = xp; - if (xp == -1) text.xp = 160 - ((font::len(PR_FONT_LEVEL, t.c_str()) / 2) + 8); + int length = utf8::unchecked::distance(t.begin(), t.end()); + if (xp == -1) text.xp = 160 - (((length / 2) + 1) * 8); text.yp = yp; text.initcol(r, g, b); text.flipme = flipme; text.resize(); - textboxes.push_back(text); + textbox.push_back(text); } } void Graphics::createtextbox( - const std::string& t, - int xp, int yp, - SDL_Color color -) { - createtextboxreal(t, xp, yp, color.r, color.g, color.b, false); -} - -void Graphics::createtextbox( - const std::string& t, - int xp, int yp, - int r, int g, int b + std::string t, + int xp, + int yp, + int r, + int g, + int b ) { createtextboxreal(t, xp, yp, r, g, b, false); } void Graphics::createtextboxflipme( - const std::string& t, - int xp, int yp, - SDL_Color color -) { - createtextboxreal(t, xp, yp, color.r, color.g, color.b, true); -} - -void Graphics::createtextboxflipme( - const std::string& t, - int xp, int yp, - int r, int g, int b + std::string t, + int xp, + int yp, + int r, + int g, + int b ) { createtextboxreal(t, xp, yp, r, g, b, true); } void Graphics::drawfade(void) { - const int usethisamount = lerp(oldfadeamount, fadeamount); - switch (fademode) + int usethisamount = lerp(oldfadeamount, fadeamount); + if ((fademode == 1)||(fademode == 4)) { - case FADE_FULLY_BLACK: - case FADE_START_FADEIN: - fill_rect(0, 0, 0); - break; - case FADE_FADING_OUT: - for (size_t i = 0; i < SDL_arraysize(fadebars); i++) - { - fill_rect(fadebars[i], i * 16, usethisamount, 16, 0, 0, 0); - } - break; - case FADE_FADING_IN: - for (size_t i = 0; i < SDL_arraysize(fadebars); i++) - { - fill_rect(fadebars[i] - usethisamount, i * 16, 500, 16, 0, 0, 0); - } - break; - case FADE_NONE: - case FADE_START_FADEOUT: - break; + ClearSurface(backBuffer); } + else if(fademode==3) + { + for (size_t i = 0; i < SDL_arraysize(fadebars); i++) + { + FillRect(backBuffer, fadebars[i], i * 16, usethisamount, 16, 0x000000 ); + } + } + else if(fademode==5 ) + { + for (size_t i = 0; i < SDL_arraysize(fadebars); i++) + { + FillRect(backBuffer, fadebars[i]-usethisamount, i * 16, 500, 16, 0x000000 ); + } + } + } void Graphics::processfade(void) { oldfadeamount = fadeamount; - switch (fademode) + if (fademode > 1) { - case FADE_START_FADEOUT: - for (size_t i = 0; i < SDL_arraysize(fadebars); i++) + if (fademode == 2) { - fadebars[i] = -(int)(fRandom() * 12) * 8; + //prepare fade out + for (size_t i = 0; i < SDL_arraysize(fadebars); i++) + { + fadebars[i] = -int(fRandom() * 12) * 8; + } + setfade(0); + fademode = 3; } - setfade(0); - fademode = FADE_FADING_OUT; - break; - case FADE_FADING_OUT: - fadeamount += 24; - if (fadeamount > 416) + else if (fademode == 3) { - fademode = FADE_FULLY_BLACK; + fadeamount += 24; + if (fadeamount > 416) + { + fademode = 1; //faded + } } - break; - case FADE_START_FADEIN: - for (size_t i = 0; i < SDL_arraysize(fadebars); i++) + else if (fademode == 4) { - fadebars[i] = 320 + (int)(fRandom() * 12) * 8; + //prepare fade in + for (size_t i = 0; i < SDL_arraysize(fadebars); i++) + { + fadebars[i] = 320 + int(fRandom() * 12) * 8; + } + setfade(416); + fademode = 5; } - setfade(416); - fademode = FADE_FADING_IN; - break; - case FADE_FADING_IN: - fadeamount -= 24; - if (fadeamount <= 0) + else if (fademode == 5) { - fademode = FADE_NONE; + fadeamount -= 24; + if (fadeamount <= 0) + { + fademode = 0; //normal + } } - break; - case FADE_NONE: - case FADE_FULLY_BLACK: - break; } } @@ -1694,19 +1568,8 @@ void Graphics::setfade(const int amount) oldfadeamount = amount; } -void Graphics::drawmenu(int cr, int cg, int cb, enum Menu::MenuName menu) +void Graphics::drawmenu( int cr, int cg, int cb, bool levelmenu /*= false*/ ) { - /* The MenuName is only used for some special cases, - * like the levels list and the language screen. */ - - bool language_screen = menu == Menu::language && !loc::languagelist.empty(); - unsigned int twocol_voptions; - if (language_screen) - { - size_t n_options = game.menuoptions.size(); - twocol_voptions = n_options - (n_options / 2); - } - for (size_t i = 0; i < game.menuoptions.size(); i++) { MenuOption& opt = game.menuoptions[i]; @@ -1727,23 +1590,14 @@ void Graphics::drawmenu(int cr, int cg, int cb, enum Menu::MenuName menu) fb = 128; } - int x, y; - if (language_screen) - { - int name_len = font::len(opt.print_flags, opt.text); - x = (i < twocol_voptions ? 80 : 240) - name_len / 2; - y = 36 + (i % twocol_voptions) * 12; - } - else - { - x = i * game.menuspacing + game.menuxoff; - y = 140 + i * 12 + game.menuyoff; - } + int x = i*game.menuspacing + game.menuxoff; + int y = 140 + i*12 + game.menuyoff; - if (menu == Menu::levellist) +#ifndef NO_CUSTOM_LEVELS + if (levelmenu) { size_t separator; - if (cl.ListOfMetaData.size() > 8) + if (ed.ListOfMetaData.size() > 8) { separator = 3; } @@ -1762,55 +1616,55 @@ void Graphics::drawmenu(int cr, int cg, int cb, enum Menu::MenuName menu) y += 4; } } +#endif - if (menu == Menu::translator_options_cutscenetest) - { - size_t separator = 4; - if (game.menuoptions.size() - i <= separator) - { - y += 4; - } - } + char tempstring[MENU_TEXT_BYTES]; + SDL_strlcpy(tempstring, opt.text, sizeof(tempstring)); char buffer[MENU_TEXT_BYTES]; if ((int) i == game.currentmenuoption && game.slidermode == SLIDER_NONE) { - std::string opt_text; if (opt.active) { // Uppercase the text - opt_text = loc::toupper(opt.text); - } - else - { - opt_text = loc::remove_toupper_escape_chars(opt.text); + // FIXME: This isn't UTF-8 aware! + size_t templen = SDL_strlen(tempstring); + for (size_t ii = 0; ii < templen; ii++) + { + tempstring[ii] = SDL_toupper(tempstring[ii]); + } } - vformat_buf(buffer, sizeof(buffer), loc::get_langmeta()->menu_select.c_str(), "label:str", opt_text.c_str()); - + // Add brackets + SDL_snprintf(buffer, sizeof(buffer), "[ %s ]", tempstring); // Account for brackets - x -= (font::len(opt.print_flags, buffer) - font::len(opt.print_flags, opt_text.c_str())) / 2; + x -= 16; } else { - SDL_strlcpy(buffer, loc::remove_toupper_escape_chars(opt.text).c_str(), sizeof(buffer)); + SDL_strlcpy(buffer, tempstring, sizeof(buffer)); } - font::print(opt.print_flags, x, y, buffer, fr, fg, fb); + Print(x, y, buffer, fr, fg, fb); } } -void Graphics::drawcoloredtile( - const int x, const int y, - const int t, - const int r, const int g, const int b -) { - draw_grid_tile(grphx.im_tiles_white, t, x, y, tiles_rect.w, tiles_rect.h, r, g, b); +void Graphics::drawcoloredtile( int x, int y, int t, int r, int g, int b ) +{ + if (!INBOUNDS_VEC(t, tiles)) + { + return; + } + setcolreal(getRGB(r,g,b)); + + SDL_Rect rect; + setRect(rect,x,y,tiles_rect.w,tiles_rect.h); + BlitSurfaceColoured(tiles[t],NULL, backBuffer, &rect, ct ); } -bool Graphics::Hitest(SDL_Surface* surface1, SDL_Point p1, SDL_Surface* surface2, SDL_Point p2) +bool Graphics::Hitest(SDL_Surface* surface1, point p1, SDL_Surface* surface2, point p2) { //find rectangle where they intersect: @@ -1831,22 +1685,19 @@ bool Graphics::Hitest(SDL_Surface* surface1, SDL_Point p1, SDL_Surface* surface2 if(intersection) { - int r3_left = SDL_max(r1_left, r2_left); - int r3_top = SDL_min(r1_top, r2_top); - int r3_right = SDL_min(r1_right, r2_right); - int r3_bottom= SDL_max(r1_bottom, r2_bottom); + int r3_left = VVV_max(r1_left, r2_left); + int r3_top = VVV_min(r1_top, r2_top); + int r3_right = VVV_min(r1_right, r2_right); + int r3_bottom= VVV_max(r1_bottom, r2_bottom); //for every pixel inside rectangle for(int x = r3_left; x < r3_right; x++) { for(int y = r3_bottom; y < r3_top; y++) { - const SDL_Color pixel1 = ReadPixel(surface1, x - p1.x, y - p1.y); - const SDL_Color pixel2 = ReadPixel(surface2, x - p2.x, y - p2.y); - /* INTENTIONAL BUG! In previous versions, the game mistakenly - * checked the red channel, not the alpha channel. - * We preserve it here because some people abuse this. */ - if (pixel1.r != 0 && pixel2.r != 0) + Uint32 pixel1 = ReadPixel(surface1 , x - p1.x, y - p1.y); + Uint32 pixel2 = ReadPixel(surface2 , x - p2.x, y - p2.y); + if ((pixel1 & 0x000000FF) && (pixel2 & 0x000000FF)) { return true; } @@ -1857,7 +1708,7 @@ bool Graphics::Hitest(SDL_Surface* surface1, SDL_Point p1, SDL_Surface* surface2 } -void Graphics::drawgravityline(const int t, const int x, const int y, const int w, const int h) +void Graphics::drawgravityline( int t ) { if (!INBOUNDS_VEC(t, obj.entities)) { @@ -1865,117 +1716,134 @@ void Graphics::drawgravityline(const int t, const int x, const int y, const int return; } - if (w <= 0 && h <= 0) + if (obj.entities[t].life == 0) { - return; + switch(linestate) + { + case 0: + FillRect(backBuffer,line_rect, getRGB(200-20, 200-20, 200-20)); + break; + case 1: + FillRect(backBuffer,line_rect, getRGB(225-30, 245-30, 245-30)); + break; + case 2: + FillRect(backBuffer,line_rect, getRGB(245-30, 245-30, 225-30)); + break; + case 3: + FillRect(backBuffer,line_rect, getRGB(164-10, 200-20, 200-20)); + break; + case 4: + FillRect(backBuffer,line_rect, getRGB(224-20, 255-30, 196-20)); + break; + case 5: + FillRect(backBuffer,line_rect, getRGB(205-20, 235-30, 196-20)); + break; + case 6: + FillRect(backBuffer,line_rect, getRGB(164-10, 164-10, 164-10)); + break; + case 7: + FillRect(backBuffer,line_rect, getRGB(225-30, 245-30, 205-20)); + break; + case 8: + FillRect(backBuffer,line_rect, getRGB(205-20, 255-30, 225-30)); + break; + case 9: + FillRect(backBuffer,line_rect, getRGB(245-30, 245-30, 245-30)); + break; + } + } + else + { + FillRect(backBuffer,line_rect, getRGB(96, 96, 96)); } - - set_color(obj.entities[t].realcol); - - draw_line(x, y, x + w, y + h); } void Graphics::drawtrophytext(void) { - int brightness; + int temp, temp2, temp3; if (obj.trophytext < 15) { - const int usethismult = lerp(obj.oldtrophytext, obj.trophytext); - brightness = (usethismult / 15.0) * 255; + int usethismult = lerp(obj.oldtrophytext, obj.trophytext); + temp = (196 * usethismult) / 15; + temp2 = (196 * usethismult) / 15; + temp3 = ((255 - help.glow) * usethismult) / 15; } else { - brightness = 255; + temp = 196; + temp2 = 196; + temp3 = 255 - help.glow; } - - /* These were originally all at the top of the screen, but might be too tight for localization. - * It probably makes sense to make them all have a top text now, but for now this is probably fine. - * Look at the Steam achievements, they have pretty logical titles that should probably be used. */ - const char* top_text = NULL; - const char* bottom_text = NULL; - switch(obj.trophytype) { case 1: - top_text = loc::gettext("SPACE STATION 1 MASTERED"); - bottom_text = loc::gettext("Obtain a V Rank in this Time Trial"); + Print( -1, 6, "SPACE STATION 1 MASTERED", temp, temp2, temp3, true); + Print( -1, 16, "Obtain a V Rank in this Time Trial", temp, temp2, temp3, true); break; case 2: - top_text = loc::gettext("LABORATORY MASTERED"); - bottom_text = loc::gettext("Obtain a V Rank in this Time Trial"); + Print( -1, 6, "LABORATORY MASTERED", temp, temp2, temp3, true); + Print( -1, 16, "Obtain a V Rank in this Time Trial", temp, temp2, temp3, true); break; case 3: - top_text = loc::gettext("THE TOWER MASTERED"); - bottom_text = loc::gettext("Obtain a V Rank in this Time Trial"); + Print( -1, 6, "THE TOWER MASTERED", temp, temp2, temp3, true); + Print( -1, 16, "Obtain a V Rank in this Time Trial", temp, temp2, temp3, true); break; case 4: - top_text = loc::gettext("SPACE STATION 2 MASTERED"); - bottom_text = loc::gettext("Obtain a V Rank in this Time Trial"); + Print( -1, 6, "SPACE STATION 2 MASTERED", temp, temp2, temp3, true); + Print( -1, 16, "Obtain a V Rank in this Time Trial", temp, temp2, temp3, true); break; case 5: - top_text = loc::gettext("WARP ZONE MASTERED"); - bottom_text = loc::gettext("Obtain a V Rank in this Time Trial"); + Print( -1, 6, "WARP ZONE MASTERED", temp, temp2, temp3, true); + Print( -1, 16, "Obtain a V Rank in this Time Trial", temp, temp2, temp3, true); break; case 6: - top_text = loc::gettext("FINAL LEVEL MASTERED"); - bottom_text = loc::gettext("Obtain a V Rank in this Time Trial"); + Print( -1, 6, "FINAL LEVEL MASTERED", temp, temp2, temp3, true); + Print( -1, 16, "Obtain a V Rank in this Time Trial", temp, temp2, temp3, true); break; case 7: - top_text = loc::gettext("GAME COMPLETE"); - bottom_text = loc::gettext_case("Complete the game", 1); + Print( -1, 6, "GAME COMPLETE", temp, temp2, temp3, true); + Print( -1, 16, "Complete the game", temp, temp2, temp3, true); break; case 8: - top_text = loc::gettext("FLIP MODE COMPLETE"); - bottom_text = loc::gettext("Complete the game in flip mode"); + Print( -1, 6, "FLIP MODE COMPLETE", temp, temp2, temp3, true); + Print( -1, 16, "Complete the game in flip mode", temp, temp2, temp3, true); break; case 9: - bottom_text = loc::gettext("Win with less than 50 deaths"); + Print( -1, 11, "Win with less than 50 deaths", temp, temp2, temp3, true); break; case 10: - bottom_text = loc::gettext("Win with less than 100 deaths"); + Print( -1, 11, "Win with less than 100 deaths", temp, temp2, temp3, true); break; case 11: - bottom_text = loc::gettext("Win with less than 250 deaths"); + Print( -1, 11, "Win with less than 250 deaths", temp, temp2, temp3, true); break; case 12: - bottom_text = loc::gettext("Win with less than 500 deaths"); + Print( -1, 11, "Win with less than 500 deaths", temp, temp2, temp3, true); break; case 13: - bottom_text = loc::gettext("Last 5 seconds on the Super Gravitron"); + Print( -1, 11, "Last 5 seconds on the Super Gravitron", temp, temp2, temp3, true); break; case 14: - bottom_text = loc::gettext("Last 10 seconds on the Super Gravitron"); + Print( -1, 11, "Last 10 seconds on the Super Gravitron", temp, temp2, temp3, true); break; case 15: - bottom_text = loc::gettext("Last 15 seconds on the Super Gravitron"); + Print( -1, 11, "Last 15 seconds on the Super Gravitron", temp, temp2, temp3, true); break; case 16: - bottom_text = loc::gettext("Last 20 seconds on the Super Gravitron"); + Print( -1, 11, "Last 20 seconds on the Super Gravitron", temp, temp2, temp3, true); break; case 17: - bottom_text = loc::gettext("Last 30 seconds on the Super Gravitron"); + Print( -1, 11, "Last 30 seconds on the Super Gravitron", temp, temp2, temp3, true); break; case 18: - bottom_text = loc::gettext("Last 1 minute on the Super Gravitron"); + Print( -1, 11, "Last 1 minute on the Super Gravitron", temp, temp2, temp3, true); break; case 20: - top_text = loc::gettext("MASTER OF THE UNIVERSE"); - bottom_text = loc::gettext("Complete the game in no death mode"); + Print( -1, 6, "MASTER OF THE UNIVERSE", temp, temp2, temp3, true); + Print( -1, 16, "Complete the game in no death mode", temp, temp2, temp3, true); break; } - - short lines; - if (top_text != NULL) - { - font::string_wordwrap(0, top_text, 304, &lines); - font::print_wrap(PR_CEN | PR_BRIGHTNESS(brightness) | PR_BOR, -1, 11 - (lines - 1) * 5, top_text, 196, 196, 255 - help.glow); - } - if (bottom_text != NULL) - { - font::string_wordwrap(0, bottom_text, 304, &lines); - font::print_wrap(PR_CEN | PR_BRIGHTNESS(brightness) | PR_BOR, -1, 221 - (lines - 1) * 5, bottom_text, 196, 196, 255 - help.glow); - } } void Graphics::drawentities(void) @@ -2022,26 +1890,21 @@ void Graphics::drawentity(const int i, const int yoff) return; } - SDL_Point tpoint; + point tpoint; SDL_Rect drawRect; - bool custom_gray; - +#if !defined(NO_CUSTOM_LEVELS) // Special case for gray Warp Zone tileset! - if (map.custommode) - { - const RoomProperty* const room = cl.getroomprop(game.roomx - 100, game.roomy - 100); - custom_gray = room->tileset == 3 && room->tilecol == 6; - } - else - { - custom_gray = false; - } + const edlevelclass* const room = ed.getroomprop(game.roomx - 100, game.roomy - 100); + const bool custom_gray = room->tileset == 3 && room->tilecol == 6; +#else + const bool custom_gray = false; +#endif - SDL_Texture* sprites = flipmode ? grphx.im_flipsprites : grphx.im_sprites; - SDL_Texture* tiles = (map.custommode && !map.finalmode) ? grphx.im_entcolours : grphx.im_tiles; - SDL_Texture* tiles_tint = (map.custommode && !map.finalmode) ? grphx.im_entcolours_tint : grphx.im_tiles_tint; + std::vector& tilesvec = (map.custommode && !map.finalmode) ? entcolours : tiles; + + std::vector& spritesvec = flipmode ? flipsprites : sprites; const int xp = lerp(obj.entities[i].lerpoldxp, obj.entities[i].xp); const int yp = lerp(obj.entities[i].lerpoldyp, obj.entities[i].yp); @@ -2051,18 +1914,21 @@ void Graphics::drawentity(const int i, const int yoff) case 0: { // Sprites + if (!INBOUNDS_VEC(obj.entities[i].drawframe, spritesvec)) + { + return; + } tpoint.x = xp; tpoint.y = yp - yoff; - const SDL_Color ct = obj.entities[i].realcol; + setcolreal(obj.entities[i].realcol); drawRect = sprites_rect; drawRect.x += tpoint.x; drawRect.y += tpoint.y; + BlitSurfaceColoured(spritesvec[obj.entities[i].drawframe], NULL, backBuffer, &drawRect, ct); - draw_grid_tile(sprites, obj.entities[i].drawframe, drawRect.x, drawRect.y, 32, 32, ct); - - // screenwrapping! - SDL_Point wrappedPoint; + //screenwrapping! + point wrappedPoint; bool wrapX = false; bool wrapY = false; @@ -2072,7 +1938,7 @@ void Graphics::drawentity(const int i, const int yoff) wrapX = true; wrappedPoint.x += 320; } - else if (tpoint.x > 288) + else if (tpoint.x > 300) { wrapX = true; wrappedPoint.x -= 320; @@ -2084,7 +1950,7 @@ void Graphics::drawentity(const int i, const int yoff) wrapY = true; wrappedPoint.y += 232; } - else if (tpoint.y > 200) + else if (tpoint.y > 210) { wrapY = true; wrappedPoint.y -= 232; @@ -2096,39 +1962,45 @@ void Graphics::drawentity(const int i, const int yoff) drawRect = sprites_rect; drawRect.x += wrappedPoint.x; drawRect.y += tpoint.y; - draw_grid_tile(sprites, obj.entities[i].drawframe, drawRect.x, drawRect.y, 32, 32, ct); + BlitSurfaceColoured(spritesvec[obj.entities[i].drawframe], NULL, backBuffer, &drawRect, ct); } if (wrapY && map.warpy) { drawRect = sprites_rect; drawRect.x += tpoint.x; drawRect.y += wrappedPoint.y; - draw_grid_tile(sprites, obj.entities[i].drawframe, drawRect.x, drawRect.y, 32, 32, ct); + BlitSurfaceColoured(spritesvec[obj.entities[i].drawframe], NULL, backBuffer, &drawRect, ct); } if (wrapX && wrapY && map.warpx && map.warpy) { drawRect = sprites_rect; drawRect.x += wrappedPoint.x; drawRect.y += wrappedPoint.y; - draw_grid_tile(sprites, obj.entities[i].drawframe, drawRect.x, drawRect.y, 32, 32, ct); + BlitSurfaceColoured(spritesvec[obj.entities[i].drawframe], NULL, backBuffer, &drawRect, ct); } break; } case 1: // Tiles + if (!INBOUNDS_VEC(obj.entities[i].drawframe, tiles)) + { + return; + } tpoint.x = xp; tpoint.y = yp - yoff; drawRect = tiles_rect; drawRect.x += tpoint.x; drawRect.y += tpoint.y; - - draw_grid_tile(grphx.im_tiles, obj.entities[i].drawframe, drawRect.x, drawRect.y, 8, 8); + BlitSurfaceStandard(tiles[obj.entities[i].drawframe],NULL, backBuffer, &drawRect); break; case 2: case 8: { // Special: Moving platform, 4 tiles or 8 tiles - + if (!INBOUNDS_VEC(obj.entities[i].drawframe, tilesvec)) + { + return; + } tpoint.x = xp; tpoint.y = yp - yoff; int thiswidth = 4; @@ -2144,47 +2016,55 @@ void Graphics::drawentity(const int i, const int yoff) drawRect.x += 8 * ii; if (custom_gray) { - draw_grid_tile(tiles_tint, obj.entities[i].drawframe, drawRect.x, drawRect.y, 8, 8); + colourTransform temp_ct; + temp_ct.colour = 0xFFFFFFFF; + BlitSurfaceTinted(tilesvec[obj.entities[i].drawframe],NULL, backBuffer, &drawRect, temp_ct); } else { - draw_grid_tile(tiles, obj.entities[i].drawframe, drawRect.x, drawRect.y, 8, 8); + BlitSurfaceStandard(tilesvec[obj.entities[i].drawframe],NULL, backBuffer, &drawRect); } } break; } - case 3: // Big chunky pixels! - fill_rect(xp, yp - yoff, 4, 4, obj.entities[i].realcol); + case 3: // Big chunky pixels! + prect.x = xp; + prect.y = yp - yoff; + FillRect(backBuffer, prect, obj.entities[i].realcol); break; - case 4: // Small pickups - { - const SDL_Color color = obj.entities[i].realcol; - drawcoloredtile(xp, yp - yoff, obj.entities[i].tile, color.r, color.g, color.b); + case 4: // Small pickups + setcolreal(obj.entities[i].realcol); + drawhuetile(xp, yp - yoff, obj.entities[i].tile); break; - } - case 5: // Horizontal Line + case 5: //Horizontal Line { int oldw = obj.entities[i].w; - if ((game.swngame == SWN_START_GRAVITRON_STEP_2 || kludgeswnlinewidth) - && obj.getlineat(84 - 32) == i) + if ((game.swngame == 3 || kludgeswnlinewidth) && obj.getlineat(84 - 32) == i) { oldw -= 24; } - drawgravityline(i, xp, yp - yoff, lerp(oldw, obj.entities[i].w) - 1, 0); + line_rect.x = xp; + line_rect.y = yp - yoff; + line_rect.w = lerp(oldw, obj.entities[i].w); + line_rect.h = 1; + drawgravityline(i); break; } - case 6: // Vertical Line - drawgravityline(i, xp, yp - yoff, 0, obj.entities[i].h - 1); + case 6: //Vertical Line + line_rect.x = xp; + line_rect.y = yp - yoff; + line_rect.w = 1; + line_rect.h = obj.entities[i].h; + drawgravityline(i); break; - case 7: // Teleporter + case 7: //Teleporter drawtele(xp, yp - yoff, obj.entities[i].drawframe, obj.entities[i].realcol); break; - // case 8: // Special: Moving platform, 8 tiles + //case 8: // Special: Moving platform, 8 tiles // Note: This code is in the 4-tile code break; - case 9: // Really Big Sprite! (2x2) - { - const SDL_Color ct = obj.entities[i].realcol; + case 9: // Really Big Sprite! (2x2) + setcolreal(obj.entities[i].realcol); tpoint.x = xp; tpoint.y = yp - yoff; @@ -2192,103 +2072,117 @@ void Graphics::drawentity(const int i, const int yoff) drawRect = sprites_rect; drawRect.x += tpoint.x; drawRect.y += tpoint.y; + if (INBOUNDS_VEC(obj.entities[i].drawframe, spritesvec)) + { + BlitSurfaceColoured(spritesvec[obj.entities[i].drawframe],NULL, backBuffer, &drawRect, ct); + } - draw_grid_tile(sprites, obj.entities[i].drawframe, drawRect.x, drawRect.y, 32, 32, ct); - - tpoint.x = xp + 32; + tpoint.x = xp+32; tpoint.y = yp - yoff; - + // drawRect = sprites_rect; drawRect.x += tpoint.x; drawRect.y += tpoint.y; - - draw_grid_tile(sprites, obj.entities[i].drawframe + 1, drawRect.x, drawRect.y, 32, 32, ct); + if (INBOUNDS_VEC(obj.entities[i].drawframe+1, spritesvec)) + { + BlitSurfaceColoured(spritesvec[obj.entities[i].drawframe+1],NULL, backBuffer, &drawRect, ct); + } tpoint.x = xp; - tpoint.y = yp + 32 - yoff; - + tpoint.y = yp+32 - yoff; + // drawRect = sprites_rect; drawRect.x += tpoint.x; drawRect.y += tpoint.y; + if (INBOUNDS_VEC(obj.entities[i].drawframe+12, spritesvec)) + { + BlitSurfaceColoured(spritesvec[obj.entities[i].drawframe+12],NULL, backBuffer, &drawRect, ct); + } - draw_grid_tile(sprites, obj.entities[i].drawframe + 12, drawRect.x, drawRect.y, 32, 32, ct); - - tpoint.x = xp + 32; - tpoint.y = yp + 32 - yoff; - + tpoint.x = xp+32; + tpoint.y = yp+32 - yoff; + // drawRect = sprites_rect; drawRect.x += tpoint.x; drawRect.y += tpoint.y; - - draw_grid_tile(sprites, obj.entities[i].drawframe + 13, drawRect.x, drawRect.y, 32, 32, ct); + if (INBOUNDS_VEC(obj.entities[i].drawframe+13, spritesvec)) + { + BlitSurfaceColoured(spritesvec[obj.entities[i].drawframe + 13],NULL, backBuffer, &drawRect, ct); + } break; - } - case 10: // 2x1 Sprite - { - const SDL_Color ct = obj.entities[i].realcol; + case 10: // 2x1 Sprite + setcolreal(obj.entities[i].realcol); tpoint.x = xp; tpoint.y = yp - yoff; - + // drawRect = sprites_rect; drawRect.x += tpoint.x; drawRect.y += tpoint.y; + if (INBOUNDS_VEC(obj.entities[i].drawframe, spritesvec)) + { + BlitSurfaceColoured(spritesvec[obj.entities[i].drawframe],NULL, backBuffer, &drawRect, ct); + } - draw_grid_tile(sprites, obj.entities[i].drawframe, drawRect.x, drawRect.y, 32, 32, ct); - - tpoint.x = xp + 32; + tpoint.x = xp+32; tpoint.y = yp - yoff; - + // drawRect = sprites_rect; drawRect.x += tpoint.x; drawRect.y += tpoint.y; - - draw_grid_tile(sprites, obj.entities[i].drawframe + 1, drawRect.x, drawRect.y, 32, 32, ct); + if (INBOUNDS_VEC(obj.entities[i].drawframe+1, spritesvec)) + { + BlitSurfaceColoured(spritesvec[obj.entities[i].drawframe+1],NULL, backBuffer, &drawRect, ct); + } break; - } - case 11: // The fucking elephant - drawimagecol(IMAGE_ELEPHANT, xp, yp - yoff, obj.entities[i].realcol); + case 11: //The fucking elephant + setcolreal(obj.entities[i].realcol); + drawimagecol(3, xp, yp - yoff); break; - case 12: // Regular sprites that don't wrap - { + case 12: // Regular sprites that don't wrap tpoint.x = xp; tpoint.y = yp - yoff; - const SDL_Color ct = obj.entities[i].realcol; - + setcolreal(obj.entities[i].realcol); + // drawRect = sprites_rect; drawRect.x += tpoint.x; drawRect.y += tpoint.y; + if (INBOUNDS_VEC(obj.entities[i].drawframe, spritesvec)) + { + BlitSurfaceColoured(spritesvec[obj.entities[i].drawframe],NULL, backBuffer, &drawRect, ct); + } - draw_grid_tile(sprites, obj.entities[i].drawframe, drawRect.x, drawRect.y, 32, 32, ct); - // if we're outside the screen, we need to draw indicators + //if we're outside the screen, we need to draw indicators if (obj.entities[i].xp < -20 && obj.entities[i].vx > 0) { if (obj.entities[i].xp < -100) { - tpoint.x = -5 + (int) (-xp / 10); + tpoint.x = -5 + (int(( -xp) / 10)); } else { tpoint.x = 5; } - tpoint.y = tpoint.y + 4; + tpoint.y = tpoint.y+4; drawRect = tiles_rect; drawRect.x += tpoint.x; drawRect.y += tpoint.y; - - draw_grid_tile(grphx.im_tiles_white, 1167, drawRect.x, drawRect.y, 8, 8, ct); + if (INBOUNDS_VEC(1167, tiles)) + { + BlitSurfaceColoured(tiles[1167],NULL, backBuffer, &drawRect, ct); + } } else if (obj.entities[i].xp > 340 && obj.entities[i].vx < 0) { if (obj.entities[i].xp > 420) { - tpoint.x = 320 - (int) ((xp - 320) / 10); + tpoint.x = 320 - (int(( xp-320) / 10)); } else { @@ -2296,19 +2190,34 @@ void Graphics::drawentity(const int i, const int yoff) } tpoint.y = tpoint.y+4; + // drawRect = tiles_rect; drawRect.x += tpoint.x; drawRect.y += tpoint.y; - - draw_grid_tile(grphx.im_tiles_white, 1166, drawRect.x, drawRect.y, 8, 8, ct); + if (INBOUNDS_VEC(1166, tiles)) + { + BlitSurfaceColoured(tiles[1166],NULL, backBuffer, &drawRect, ct); + } } break; - } case 13: { - // Special for epilogue: huge hero! - draw_grid_tile(grphx.im_sprites, obj.entities[i].drawframe, xp, yp - yoff, sprites_rect.w, sprites_rect.h, obj.entities[i].realcol, 6, 6); + //Special for epilogue: huge hero! + if (!INBOUNDS_VEC(obj.entities[i].drawframe, spritesvec)) + { + return; + } + + tpoint.x = xp; tpoint.y = yp - yoff; + setcolreal(obj.entities[i].realcol); + setRect(drawRect, xp, yp - yoff, sprites_rect.x * 6, sprites_rect.y * 6); + SDL_Surface* TempSurface = ScaleSurface( spritesvec[obj.entities[i].drawframe], 6 * sprites_rect.w,6* sprites_rect.h ); + BlitSurfaceColoured(TempSurface, NULL , backBuffer, &drawRect, ct ); + SDL_FreeSurface(TempSurface); + + + break; } } @@ -2316,162 +2225,163 @@ void Graphics::drawentity(const int i, const int yoff) void Graphics::drawbackground( int t ) { + int temp = 0; + switch(t) { case 1: - // Starfield - fill_rect(0, 0, 0); + //Starfield + ClearSurface(backBuffer); for (int i = 0; i < numstars; i++) { + stars[i].w = 2; + stars[i].h = 2; SDL_Rect star_rect = stars[i]; star_rect.x = lerp(star_rect.x + starsspeed[i], star_rect.x); if (starsspeed[i] <= 6) { - fill_rect(&star_rect, getRGB(0x22,0x22,0x22)); + FillRect(backBuffer,star_rect, getRGB(0x22,0x22,0x22)); } else { - fill_rect(&star_rect, getRGB(0x55,0x55,0x55)); + FillRect(backBuffer,star_rect, getRGB(0x55,0x55,0x55)); } } break; case 2: { - SDL_Color bcol; - SDL_Color bcol2; - SDL_zero(bcol); - SDL_zero(bcol2); + int bcol = 0, bcol2 = 0; - // Lab - switch (rcol) - { - // Akward ordering to match tileset - case 0: - bcol2 = getRGB(0, 16 * backboxmult, 16 * backboxmult); - break; // Cyan - case 1: - bcol2 = getRGB(16 * backboxmult, 0, 0); - break; // Red - case 2: - bcol2 = getRGB(16 * backboxmult, 0, 16 * backboxmult); - break; // Purple - case 3: - bcol2 = getRGB(0, 0, 16 * backboxmult); - break; // Blue - case 4: - bcol2 = getRGB(16 * backboxmult, 16 * backboxmult, 0); - break; // Yellow - case 5: - bcol2 = getRGB(0, 16 * backboxmult, 0); - break; // Green - case 6: - // crazy case - switch (spcol) + //Lab + switch(rcol) { + //Akward ordering to match tileset case 0: - bcol2 = getRGB(0, 16 * backboxmult, 16 * backboxmult); - break; // Cyan + bcol2 = RGBflip(0, 16*backboxint[0], 16*backboxint[0]); + break; //Cyan case 1: - bcol2 = getRGB(0, (spcoldel + 1) * backboxmult, 16 * backboxmult); - break; // Cyan + bcol2 = RGBflip(16*backboxint[0], 0, 0); + break; //Red case 2: - bcol2 = getRGB(0, 0, 16 * backboxmult); - break; // Blue + bcol2 = RGBflip(16*backboxint[0], 0, 16*backboxint[0]); + break; //Purple case 3: - bcol2 = getRGB((16 - spcoldel) * backboxmult, 0, 16 * backboxmult); - break; // Blue + bcol2 = RGBflip(0, 0, 16*backboxint[0]); + break; //Blue case 4: - bcol2 = getRGB(16 * backboxmult, 0, 16 * backboxmult); - break; // Purple + bcol2 = RGBflip(16*backboxint[0], 16*backboxint[0], 0); + break; //Yellow case 5: - bcol2 = getRGB(16 * backboxmult, 0, (spcoldel + 1) * backboxmult); - break; // Purple + bcol2 = RGBflip(0, 16 * backboxint[0], 0); + break; //Green case 6: - bcol2 = getRGB(16 * backboxmult, 0, 0); - break; // Red - case 7: - bcol2 = getRGB(16 * backboxmult, (16 - spcoldel) * backboxmult, 0); - break; // Red - case 8: - bcol2 = getRGB(16 * backboxmult, 16 * backboxmult, 0); - break; // Yellow - case 9: - bcol2 = getRGB((spcoldel + 1) * backboxmult, 16 * backboxmult, 0); - break; // Yellow - case 10: - bcol2 = getRGB(0, 16 * backboxmult, 0); - break; // Green - case 11: - bcol2 = getRGB(0, 16 * backboxmult, (16 - spcoldel) * backboxmult); - break; // Green - } + //crazy case + switch(spcol) + { + case 0: + bcol2 = RGBflip(0, 16*backboxint[0], 16*backboxint[0]); + break; //Cyan + case 1: + bcol2 = RGBflip(0, (spcoldel+1)*backboxint[0], 16*backboxint[0]); + break; //Cyan + case 2: + bcol2 = RGBflip(0, 0, 16*backboxint[0]); + break; //Blue + case 3: + bcol2 = RGBflip((16-spcoldel)*backboxint[0], 0, 16*backboxint[0]); + break; //Blue + case 4: + bcol2 = RGBflip(16*backboxint[0], 0, 16*backboxint[0]); + break; //Purple + case 5: + bcol2 = RGBflip(16*backboxint[0], 0, (spcoldel+1)*backboxint[0]); + break; //Purple + case 6: + bcol2 = RGBflip(16*backboxint[0], 0, 0); + break; //Red + case 7: + bcol2 = RGBflip(16*backboxint[0], (16-spcoldel)*backboxint[0], 0); + break; //Red + case 8: + bcol2 = RGBflip(16*backboxint[0], 16*backboxint[0], 0); + break; //Yellow + case 9: + bcol2 = RGBflip((spcoldel+1)*backboxint[0], 16*backboxint[0], 0); + break; //Yellow + case 10: + bcol2 = RGBflip(0, 16 * backboxint[0], 0); + break; //Green + case 11: + bcol2 = RGBflip(0, 16 * backboxint[0], (16-spcoldel)*backboxint[0]); + break; //Green + } break; } - fill_rect(bcol2); + FillRect(backBuffer,bcol2); for (int i = 0; i < numbackboxes; i++) { - switch (rcol) + switch(rcol) { - // Akward ordering to match tileset + //Akward ordering to match tileset case 0: - bcol = getRGB(16, 128 * backboxmult, 128 * backboxmult); - break; // Cyan + bcol = RGBflip(16, 128*backboxint[0], 128*backboxint[0]); + break; //Cyan case 1: - bcol = getRGB(128 * backboxmult, 16, 16); - break; // Red + bcol = RGBflip(128*backboxint[0], 16, 16); + break; //Red case 2: - bcol = getRGB(128 * backboxmult, 16, 128 * backboxmult); - break; // Purple + bcol = RGBflip(128*backboxint[0], 16, 128*backboxint[0]); + break; //Purple case 3: - bcol = getRGB(16, 16, 128 * backboxmult); - break; // Blue + bcol = RGBflip(16, 16, 128*backboxint[0]); + break; //Blue case 4: - bcol = getRGB(128 * backboxmult, 128 * backboxmult, 16); - break; // Yellow + bcol = RGBflip(128*backboxint[0], 128*backboxint[0], 16); + break; //Yellow case 5: - bcol = getRGB(16, 128 * backboxmult, 16); - break; // Green + bcol = RGBflip(16, 128 * backboxint[0], 16); + break; //Green case 6: - // crazy case - switch (spcol) + //crazy case + switch(spcol) { case 0: - bcol = getRGB(16, 128 * backboxmult, 128 * backboxmult); - break; // Cyan + bcol = RGBflip(16, 128*backboxint[0], 128*backboxint[0]); + break; //Cyan case 1: - bcol = getRGB(16, ((spcoldel + 1) * 8) * backboxmult, 128 * backboxmult); - break; // Cyan + bcol = RGBflip(16, ((spcoldel+1)*8)*backboxint[0], 128*backboxint[0]); + break; //Cyan case 2: - bcol = getRGB(16, 16, 128 * backboxmult); - break; // Blue + bcol = RGBflip(16, 16, 128*backboxint[0]); + break; //Blue case 3: - bcol = getRGB((128 - (spcoldel * 8)) * backboxmult, 16, 128 * backboxmult); - break; // Blue + bcol = RGBflip((128-(spcoldel*8))*backboxint[0], 16, 128*backboxint[0]); + break; //Blue case 4: - bcol = getRGB(128 * backboxmult, 16, 128 * backboxmult); - break; // Purple + bcol = RGBflip(128*backboxint[0], 16, 128*backboxint[0]); + break; //Purple case 5: - bcol = getRGB(128 * backboxmult, 16, ((spcoldel + 1) * 8) * backboxmult); - break; // Purple + bcol = RGBflip(128*backboxint[0], 16, ((spcoldel+1)*8)*backboxint[0]); + break; //Purple case 6: - bcol = getRGB(128 * backboxmult, 16, 16); - break; // Red + bcol = RGBflip(128*backboxint[0], 16, 16); + break; //Red case 7: - bcol = getRGB(128 * backboxmult, (128 - (spcoldel * 8)) * backboxmult, 16); - break; // Red + bcol = RGBflip(128*backboxint[0], (128-(spcoldel*8))*backboxint[0], 16); + break; //Red case 8: - bcol = getRGB(128 * backboxmult, 128 * backboxmult, 16); - break; // Yellow + bcol = RGBflip(128*backboxint[0], 128*backboxint[0], 16); + break; //Yellow case 9: - bcol = getRGB(((spcoldel + 1) * 8) * backboxmult, 128 * backboxmult, 16); - break; // Yellow + bcol = RGBflip(((spcoldel+1)*8)*backboxint[0], 128*backboxint[0], 16); + break; //Yellow case 10: - bcol = getRGB(16, 128 * backboxmult, 16); - break; // Green + bcol = RGBflip(16, 128 * backboxint[0], 16); + break; //Green case 11: - bcol = getRGB(16, 128 * backboxmult, (128 - (spcoldel * 8)) * backboxmult); - break; // Green + bcol = RGBflip(16, 128 * backboxint[0], (128-(spcoldel*8))*backboxint[0]); + break; //Green } break; } @@ -2480,111 +2390,100 @@ void Graphics::drawbackground( int t ) backboxrect.x = lerp(backboxes[i].x - backboxvx[i], backboxes[i].x); backboxrect.y = lerp(backboxes[i].y - backboxvy[i], backboxes[i].y); - fill_rect(&backboxrect, bcol); - backboxrect.x++; - backboxrect.y++; + FillRect(backBuffer, backboxrect, bcol); + backboxrect.x += 1; + backboxrect.y += 1; backboxrect.w -= 2; backboxrect.h -= 2; - fill_rect(&backboxrect, bcol2); + FillRect(backBuffer,backboxrect, bcol2); } break; } case 3: //Warp zone (horizontal) - { - clear(); - - const int offset = (int) lerp(-3, 0); - const SDL_Rect srcRect = {8 + offset, 0, SCREEN_WIDTH_PIXELS, SCREEN_HEIGHT_PIXELS}; - - copy_texture(backgroundTexture, &srcRect, NULL); + ClearSurface(backBuffer); + BlitSurfaceStandard(warpbuffer, NULL, warpbuffer_lerp, NULL); + ScrollSurface(warpbuffer_lerp, lerp(0, -3), 0); + BlitSurfaceStandard(warpbuffer_lerp, &towerbuffer_rect, backBuffer, NULL); break; - } case 4: //Warp zone (vertical) - { - clear(); - - const int offset = (int) lerp(-3, 0); - const SDL_Rect srcRect = {0, 8 + offset, SCREEN_WIDTH_PIXELS, SCREEN_HEIGHT_PIXELS}; - - copy_texture(backgroundTexture, &srcRect, NULL); + ClearSurface(backBuffer); + SDL_BlitSurface(warpbuffer, NULL, warpbuffer_lerp, NULL); + ScrollSurface(warpbuffer_lerp, 0, lerp(0, -3)); + SDL_BlitSurface(warpbuffer_lerp, &towerbuffer_rect, backBuffer, NULL); break; - } case 5: - { - // Warp zone, central - SDL_Color warpbcol; - SDL_Color warpfcol; - + //Warp zone, central switch(rcol) { - // Akward ordering to match tileset + //Akward ordering to match tileset case 0: - warpbcol = getRGB(0x0A, 0x10, 0x0E); - warpfcol = getRGB(0x10, 0x22, 0x21); - break; // Cyan + warpbcol = RGBflip(0x0A, 0x10, 0x0E); + warpfcol = RGBflip(0x10, 0x22, 0x21); + break; //Cyan case 1: - warpbcol = getRGB(0x11, 0x09, 0x0B); - warpfcol = getRGB(0x22, 0x10, 0x11); - break; // Red + warpbcol = RGBflip(0x11, 0x09, 0x0B); + warpfcol = RGBflip(0x22, 0x10, 0x11); + break; //Red case 2: - warpbcol = getRGB(0x0F, 0x0A, 0x10); - warpfcol = getRGB(0x22,0x10,0x22); - break; // Purple + warpbcol = RGBflip(0x0F, 0x0A, 0x10); + warpfcol = RGBflip(0x22,0x10,0x22); + break; //Purple case 3: - warpbcol = getRGB(0x0A, 0x0B, 0x10); - warpfcol = getRGB(0x10, 0x10, 0x22); - break; // Blue + warpbcol = RGBflip(0x0A, 0x0B, 0x10); + warpfcol = RGBflip(0x10, 0x10, 0x22); + break; //Blue case 4: - warpbcol = getRGB(0x10, 0x0D, 0x0A); - warpfcol = getRGB(0x22, 0x1E, 0x10); - break; // Yellow + warpbcol = RGBflip(0x10, 0x0D, 0x0A); + warpfcol = RGBflip(0x22, 0x1E, 0x10); + break; //Yellow case 5: - warpbcol = getRGB(0x0D, 0x10, 0x0A); - warpfcol = getRGB(0x14, 0x22, 0x10); - break; // Green + warpbcol = RGBflip(0x0D, 0x10, 0x0A); + warpfcol = RGBflip(0x14, 0x22, 0x10); + break; //Green case 6: - warpbcol = getRGB(0x0A, 0x0A, 0x0A); - warpfcol = getRGB(0x12, 0x12, 0x12); - break; // Gray + warpbcol = RGBflip(0x0A, 0x0A, 0x0A); + warpfcol = RGBflip(0x12, 0x12, 0x12); + break; //Gray default: - warpbcol = getRGB(0xFF, 0xFF, 0xFF); - warpfcol = getRGB(0xFF, 0xFF, 0xFF); + warpbcol = RGBflip(0xFF, 0xFF, 0xFF); + warpfcol = RGBflip(0xFF, 0xFF, 0xFF); } - for (int i = 10; i >= 0; i--) + for (int i = 10 ; i >= 0; i--) { - const int temp = (i * 16) + backoffset; - const SDL_Rect warprect = {160 - temp, 120 - temp, temp * 2, temp * 2}; + temp = (i << 4) + backoffset; + setwarprect(160 - temp, 120 - temp, temp * 2, temp * 2); if (i % 2 == warpskip) { - fill_rect(&warprect, warpbcol); + FillRect(backBuffer, warprect, warpbcol); } else { - fill_rect(&warprect, warpfcol); + FillRect(backBuffer,warprect, warpfcol); } } break; - } case 6: - // Final Starfield - fill_rect(0, 0, 0); + //Final Starfield + ClearSurface(backBuffer); for (int i = 0; i < numstars; i++) { + stars[i].w = 2; + stars[i].h = 2; SDL_Rect star_rect = stars[i]; star_rect.y = lerp(star_rect.y + starsspeed[i], star_rect.y); if (starsspeed[i] <= 8) { - fill_rect(&star_rect, getRGB(0x22, 0x22, 0x22)); + FillRect(backBuffer, star_rect, getRGB(0x22, 0x22, 0x22)); } else { - fill_rect(&star_rect, getRGB(0x55, 0x55, 0x55)); + FillRect(backBuffer, star_rect, getRGB(0x55, 0x55, 0x55)); } } break; case 7: - // Static, unscrolling section of the tower + //Static, unscrolling section of the tower for (int j = 0; j < 30; j++) { for (int i = 0; i < 40; i++) @@ -2594,7 +2493,7 @@ void Graphics::drawbackground( int t ) } break; case 8: - // Static, unscrolling section of the tower + //Static, unscrolling section of the tower for (int j = 0; j < 30; j++) { for (int i = 0; i < 40; i++) @@ -2604,7 +2503,7 @@ void Graphics::drawbackground( int t ) } break; case 9: - // Static, unscrolling section of the tower + //Static, unscrolling section of the tower for (int j = 0; j < 30; j++) { for (int i = 0; i < 40; i++) @@ -2614,7 +2513,8 @@ void Graphics::drawbackground( int t ) } break; default: - fill_rect(0, 0, 0); + ClearSurface(backBuffer); + break; } } @@ -2624,23 +2524,26 @@ void Graphics::updatebackground(int t) switch (t) { case 1: - // Starfield + //Starfield for (int i = 0; i < numstars; i++) { + stars[i].w = 2; + stars[i].h = 2; stars[i].x -= starsspeed[i]; if (stars[i].x < -10) { stars[i].x += 340; - stars[i].y = (int) (fRandom() * 240); - starsspeed[i] = 4 + (int) (fRandom() * 4); + stars[i].y = int(fRandom() * 240); + stars[i].w = 2; + starsspeed[i] = 4+int(fRandom()*4); } } break; case 2: - // Lab + //Lab if (rcol == 6) { - // crazy caze + //crazy caze spcoldel--; if (spcoldel <= 0) { @@ -2675,96 +2578,88 @@ void Graphics::updatebackground(int t) } } break; - case 3: // Warp zone (horizontal) + case 3: //Warp zone (horizontal) { - const int temp = 680 + (rcol * 3); - backoffset += 3; + int temp = 680 + (rcol * 3); + backoffset+=3; if (backoffset >= 16) backoffset -= 16; - SDL_Texture* target = SDL_GetRenderTarget(gameScreen.m_renderer); - set_render_target(backgroundTexture); - if (backgrounddrawn) { - scroll_texture(backgroundTexture, tempScrollingTexture, -3, 0); + ScrollSurface(warpbuffer, -3, 0 ); for (int j = 0; j < 15; j++) { for (int i = 0; i < 2; i++) { - drawtile2(317 - backoffset + (i * 16), (j * 16), temp + 40); // 20*16 = 320 - drawtile2(317 - backoffset + (i * 16) + 8, (j * 16), temp + 41); - drawtile2(317 - backoffset + (i * 16), (j * 16) + 8, temp + 80); - drawtile2(317 - backoffset + (i * 16) + 8, (j * 16) + 8, temp + 81); + drawtowertile(317 - backoffset + (i * 16), (j * 16), temp+40); //20*16 = 320 + drawtowertile(317 - backoffset + (i * 16) + 8, (j * 16), temp + 41); + drawtowertile(317 - backoffset + (i * 16), (j * 16) + 8, temp + 80); + drawtowertile(317 - backoffset + (i * 16) + 8, (j * 16) + 8, temp + 81); } } } else { - // draw the whole thing for the first time! + //draw the whole thing for the first time! backoffset = 0; - clear(); + ClearSurface(warpbuffer); for (int j = 0; j < 15; j++) { for (int i = 0; i < 21; i++) { - drawtile2((i * 16) - backoffset - 3, (j * 16), temp + 40); - drawtile2((i * 16) - backoffset + 8 - 3, (j * 16), temp + 41); - drawtile2((i * 16) - backoffset - 3, (j * 16) + 8, temp + 80); - drawtile2((i * 16) - backoffset + 8 - 3, (j * 16) + 8, temp + 81); + drawtowertile((i * 16) - backoffset - 3, (j * 16), temp+40); + drawtowertile((i * 16) - backoffset + 8 - 3, (j * 16), temp + 41); + drawtowertile((i * 16) - backoffset - 3, (j * 16) + 8, temp + 80); + drawtowertile((i * 16) - backoffset + 8 - 3, (j * 16) + 8, temp + 81); } } backgrounddrawn = true; } - set_render_target(target); break; } - case 4: // Warp zone (vertical) + case 4: //Warp zone (vertical) { - const int temp = 760 + (rcol * 3); - backoffset += 3; + int temp = 760 + (rcol * 3); + backoffset+=3; if (backoffset >= 16) backoffset -= 16; - SDL_Texture* target = SDL_GetRenderTarget(gameScreen.m_renderer); - set_render_target(backgroundTexture); - if (backgrounddrawn) { - scroll_texture(backgroundTexture, tempScrollingTexture, 0, -3); + ScrollSurface(warpbuffer,0,-3); for (int j = 0; j < 2; j++) { for (int i = 0; i < 21; i++) { - drawtile2((i * 16), 237 - backoffset + (j * 16), temp + 40); // 14*17=240 - 3 - drawtile2((i * 16) + 8, 237 - backoffset + (j * 16), temp + 41); - drawtile2((i * 16), 237 - backoffset + (j * 16) + 8, temp + 80); - drawtile2((i * 16) + 8, 237 - backoffset + (j * 16) + 8, temp + 81); + drawtowertile((i * 16), 237 - backoffset + (j * 16), temp + 40); //14*17=240 - 3 + drawtowertile((i * 16) + 8, 237 - backoffset + (j * 16), temp + 41); + drawtowertile((i * 16), 237 - backoffset + (j * 16) + 8, temp + 80); + drawtowertile((i * 16) + 8, 237 - backoffset + (j * 16) + 8, temp + 81); } } } else { - // draw the whole thing for the first time! + //draw the whole thing for the first time! backoffset = 0; - clear(); + ClearSurface(warpbuffer); for (int j = 0; j < 16; j++) { for (int i = 0; i < 21; i++) { - drawtile2((i * 16), (j * 16) - backoffset - 3, temp + 40); - drawtile2((i * 16) + 8, (j * 16) - backoffset - 3, temp + 41); - drawtile2((i * 16), (j * 16) - backoffset + 8 - 3, temp + 80); - drawtile2((i * 16) + 8, (j * 16) - backoffset + 8 - 3, temp + 81); + drawtowertile((i * 16), (j * 16)- backoffset - 3, temp+40); + drawtowertile((i * 16)+ 8, (j * 16)- backoffset - 3, temp + 41); + drawtowertile((i * 16), (j * 16)- backoffset + 8 - 3, temp + 80); + drawtowertile((i * 16)+ 8, (j * 16)- backoffset + 8 - 3, temp + 81); } } backgrounddrawn = true; } - set_render_target(target); break; } case 5: - // Warp zone, central + //Warp zone, central - backoffset++; + backoffset += 1; if (backoffset >= 16) { backoffset -= 16; @@ -2772,15 +2667,17 @@ void Graphics::updatebackground(int t) } break; case 6: - // Final Starfield + //Final Starfield for (int i = 0; i < numstars; i++) { + stars[i].w = 2; + stars[i].h = 2; stars[i].y -= starsspeed[i]; if (stars[i].y < -10) { stars[i].y += 260; stars[i].x = fRandom() * 320; - starsspeed[i] = 5 + (fRandom() * 5); + starsspeed[i] = 5+(fRandom()*5); } } break; @@ -2791,98 +2688,78 @@ void Graphics::drawmap(void) { if (!foregrounddrawn) { - SDL_Texture* target = SDL_GetRenderTarget(gameScreen.m_renderer); - - set_render_target(foregroundTexture); - set_blendmode(foregroundTexture, SDL_BLENDMODE_BLEND); - clear(0, 0, 0, 0); - - for (int y = 0; y < 30; y++) + ClearSurface(foregroundBuffer); + if(map.tileset==0) { - for (int x = 0; x < 40; x++) + for (int j = 0; j < 30; j++) { - int tile; - int tileset; - if (game.gamestate == EDITORMODE) + for (int i = 0; i < 40; i++) { - tile = cl.gettile(ed.levx, ed.levy, x, y); - tileset = (cl.getroomprop(ed.levx, ed.levy)->tileset == 0) ? 0 : 1; - } - else - { - tile = map.contents[TILE_IDX(x, y)]; - tileset = map.tileset; - } - - if (tile > 0) - { - if (tileset == 0) - { - drawtile(x * 8, y * 8, tile); - } - else if (tileset == 1) - { - drawtile2(x * 8, y * 8, tile); - } - else if (tileset == 2) - { - drawtile3(x * 8, y * 8, tile, map.rcol); - } + if(map.contents[i + map.vmult[j]]>0) drawforetile(i * 8, j * 8, map.contents[i + map.vmult[j]]); + } + } + } + else if (map.tileset == 1) + { + for (int jt = 0; jt < 30; jt++) + { + for (int it = 0; it < 40; it++) + { + if(map.contents[it + map.vmult[jt]]>0) drawforetile2(it * 8, jt * 8, map.contents[it + map.vmult[jt]]); + } + } + } + else if (map.tileset == 2) + { + for (int j = 0; j < 30; j++) + { + for (int i = 0; i < 40; i++) + { + if(map.contents[i + map.vmult[j]]>0) drawforetile3(i * 8, j * 8, map.contents[i + map.vmult[j]],map.rcol); } } } - - set_render_target(target); foregrounddrawn = true; } + SDL_BlitSurface(foregroundBuffer, NULL, backBuffer, NULL); - copy_texture(foregroundTexture, NULL, NULL); } void Graphics::drawfinalmap(void) { - if (!foregrounddrawn) - { - SDL_Texture* target = SDL_GetRenderTarget(gameScreen.m_renderer); - - set_render_target(foregroundTexture); - set_blendmode(foregroundTexture, SDL_BLENDMODE_BLEND); - clear(0, 0, 0, 0); - if (map.tileset == 0) { + if (!foregrounddrawn) { + ClearSurface(foregroundBuffer); + if(map.tileset==0){ for (int j = 0; j < 30; j++) { for (int i = 0; i < 40; i++) { - if ((map.contents[TILE_IDX(i, j)]) > 0) - drawtile(i * 8, j * 8, map.finalat(i, j)); + if((map.contents[i + map.vmult[j]])>0) + drawforetile(i * 8, j * 8, map.finalat(i,j)); + } + } + }else if (map.tileset == 1) { + for (int j = 0; j < 30; j++) { + for (int i = 0; i < 40; i++) { + if((map.contents[i + map.vmult[j]])>0) + drawforetile2(i * 8, j * 8, map.finalat(i,j)); } } } - else if (map.tileset == 1) { - for (int j = 0; j < 30; j++) { - for (int i = 0; i < 40; i++) { - if ((map.contents[TILE_IDX(i, j)]) > 0) - drawtile2(i * 8, j * 8, map.finalat(i, j)); - } - } - } - set_render_target(target); - foregrounddrawn = true; + foregrounddrawn=true; } - copy_texture(foregroundTexture, NULL, NULL); + SDL_BlitSurface(foregroundBuffer, NULL, backBuffer, NULL); } void Graphics::drawtowermap(void) { - const int yoff = lerp(map.oldypos, map.ypos); + int temp; + int yoff = lerp(map.oldypos, map.ypos); for (int j = 0; j < 31; j++) { for (int i = 0; i < 40; i++) { - const int temp = map.tower.at(i, j, yoff); - if (temp > 0) - { - drawtile3(i * 8, (j * 8) - (yoff % 8), temp, towerbg.colstate); - } + temp = map.tower.at(i, j, yoff); + if (temp > 0) drawtile3(i * 8, (j * 8) - (yoff % 8), temp, towerbg.colstate); } } } @@ -2900,32 +2777,28 @@ void Graphics::drawtowerspikes(void) void Graphics::drawtowerbackground(const TowerBG& bg_obj) { - clear(); - - const int offset = (int) lerp(-bg_obj.bscroll, 0); - const SDL_Rect srcRect = {0, 8 + offset, SCREEN_WIDTH_PIXELS, SCREEN_HEIGHT_PIXELS}; - - copy_texture(bg_obj.texture, &srcRect, NULL); + ClearSurface(backBuffer); + SDL_BlitSurface(bg_obj.buffer, NULL, bg_obj.buffer_lerp, NULL); + ScrollSurface(bg_obj.buffer_lerp, 0, lerp(0, -bg_obj.bscroll)); + SDL_BlitSurface(bg_obj.buffer_lerp, &towerbuffer_rect, backBuffer, NULL); } void Graphics::updatetowerbackground(TowerBG& bg_obj) { - if (bg_obj.bypos < 0) bg_obj.bypos += 120 * 8; + int temp; - SDL_Texture* target = SDL_GetRenderTarget(gameScreen.m_renderer); - set_render_target(bg_obj.texture); + if (bg_obj.bypos < 0) bg_obj.bypos += 120 * 8; if (bg_obj.tdrawback) { int off = bg_obj.scrolldir == 0 ? 0 : bg_obj.bscroll; //Draw the whole thing; needed for every colour cycle! - clear(); for (int j = -1; j < 32; j++) { for (int i = 0; i < 40; i++) { - const int temp = map.tower.backat(i, j, bg_obj.bypos); - drawtile3(i * 8, (j * 8) - (bg_obj.bypos % 8) - off, temp, bg_obj.colstate); + temp = map.tower.backat(i, j, bg_obj.bypos); + drawtowertile3(i * 8, (j * 8) - (bg_obj.bypos % 8) - off, temp, bg_obj); } } @@ -2933,917 +2806,764 @@ void Graphics::updatetowerbackground(TowerBG& bg_obj) } else { - // just update the bottom - scroll_texture(bg_obj.texture, tempScrollingTexture, 0, -bg_obj.bscroll); + //just update the bottom + ScrollSurface(bg_obj.buffer, 0, -bg_obj.bscroll); if (bg_obj.scrolldir == 0) { for (int i = 0; i < 40; i++) { - int temp = map.tower.backat(i, -1, bg_obj.bypos); - drawtile3(i * 8, -1 * 8 - (bg_obj.bypos % 8), temp, bg_obj.colstate); + temp = map.tower.backat(i, -1, bg_obj.bypos); + drawtowertile3(i * 8, -1*8 - (bg_obj.bypos % 8), temp, bg_obj); temp = map.tower.backat(i, 0, bg_obj.bypos); - drawtile3(i * 8, -(bg_obj.bypos % 8), temp, bg_obj.colstate); + drawtowertile3(i * 8, -(bg_obj.bypos % 8), temp, bg_obj); } } else { for (int i = 0; i < 40; i++) { - int temp = map.tower.backat(i, 29, bg_obj.bypos); - drawtile3(i * 8, 29 * 8 - (bg_obj.bypos % 8) - bg_obj.bscroll, temp, bg_obj.colstate); + temp = map.tower.backat(i, 29, bg_obj.bypos); + drawtowertile3(i * 8, 29*8 - (bg_obj.bypos % 8) - bg_obj.bscroll, temp, bg_obj); temp = map.tower.backat(i, 30, bg_obj.bypos); - drawtile3(i * 8, 30 * 8 - (bg_obj.bypos % 8) - bg_obj.bscroll, temp, bg_obj.colstate); + drawtowertile3(i * 8, 30*8 - (bg_obj.bypos % 8) - bg_obj.bscroll, temp, bg_obj); temp = map.tower.backat(i, 31, bg_obj.bypos); - drawtile3(i * 8, 31 * 8 - (bg_obj.bypos % 8) - bg_obj.bscroll, temp, bg_obj.colstate); + drawtowertile3(i * 8, 31*8 - (bg_obj.bypos % 8) - bg_obj.bscroll, temp, bg_obj); temp = map.tower.backat(i, 32, bg_obj.bypos); - drawtile3(i * 8, 32 * 8 - (bg_obj.bypos % 8) - bg_obj.bscroll, temp, bg_obj.colstate); + drawtowertile3(i * 8, 32*8 - (bg_obj.bypos % 8) - bg_obj.bscroll, temp, bg_obj); } } } - set_render_target(target); } -#define GETCOL_RANDOM (game.noflashingmode ? 0.5 : fRandom()) -SDL_Color Graphics::getcol( int t ) +void Graphics::setcol( int t ) { - // Setup predefinied colours as per our zany palette - switch(t) - { - // Player Normal - case 0: - return getRGB(160 - help.glow/2 - (int) (GETCOL_RANDOM * 20), 200 - help.glow/2, 220 - help.glow); - // Player Hurt - case 1: - return getRGB(196 - (GETCOL_RANDOM * 64), 10, 10); - // Enemies and stuff - case 2: - return getRGB(225 - (help.glow / 2), 75, 30); - case 3: // Trinket - if (!trinketcolset) - { - trinketr = 200 - (GETCOL_RANDOM * 64); - trinketg = 200 - (GETCOL_RANDOM * 128); - trinketb = 164 + (GETCOL_RANDOM * 60); - trinketcolset = true; - } - return getRGB(trinketr, trinketg, trinketb); - case 4: // Inactive savepoint - { - const int temp = (help.glow / 2) + (int) (GETCOL_RANDOM * 8); - return getRGB(80 + temp, 80 + temp, 80 + temp); - } - case 5: // Active savepoint - return getRGB(164 + (GETCOL_RANDOM * 64), 164 + (GETCOL_RANDOM * 64), 255 - (GETCOL_RANDOM * 64)); - case 6: // Enemy : Red - return getRGB(250 - help.glow / 2, 60 - help.glow / 2, 60 - help.glow / 2); - case 7: // Enemy : Green - return getRGB(100 - help.glow / 2 - (int) (GETCOL_RANDOM * 30), 250 - help.glow / 2, 100 - help.glow / 2 - (int) (GETCOL_RANDOM * 30)); - case 8: // Enemy : Purple - return getRGB(250 - help.glow / 2, 20, 128 - help.glow / 2 + (int) (GETCOL_RANDOM * 30)); - case 9: // Enemy : Yellow - return getRGB(250 - help.glow / 2, 250 - help.glow / 2, 20); - case 10: // Warp point (white) - return getRGB(255 - (GETCOL_RANDOM * 64), 255 - (GETCOL_RANDOM * 64), 255 - (GETCOL_RANDOM * 64)); - case 11: // Enemy : Cyan - return getRGB(20, 250 - help.glow / 2, 250 - help.glow / 2); - case 12: // Enemy : Blue - return getRGB(90 - help.glow / 2, 90 - help.glow / 2, 250 - help.glow / 2); - // Crew Members - // green - case 13: - return getRGB(120 - help.glow / 4 - (int) (GETCOL_RANDOM * 20), 220 - help.glow / 4, 120 - help.glow / 4); - // Yellow - case 14: - return getRGB(220 - help.glow / 4 - (int) (GETCOL_RANDOM * 20), 210 - help.glow / 4, 120 - help.glow / 4); - // pink - case 15: - return getRGB(255 - help.glow / 8, 70 - help.glow / 4, 70 - help.glow / 4); - // Blue - case 16: - return getRGB(75, 75, 255 - help.glow / 4 - (int) (GETCOL_RANDOM * 20)); + int temp; - case 17: // Enemy : Orange - return getRGB(250 - help.glow / 2, 130 - help.glow / 2, 20); - case 18: // Enemy : Gray - return getRGB(130 - help.glow / 2, 130 - help.glow / 2, 130 - help.glow / 2); - case 19: // Enemy : Dark gray - return getRGB(60 - help.glow / 8, 60 - help.glow / 8, 60 - help.glow / 8); - // Purple - case 20: - return getRGB(220 - help.glow / 4 - (int) (GETCOL_RANDOM * 20), 120 - help.glow/4, 210 - help.glow/4); + //Setup predefinied colours as per our zany palette + switch(t) + { + //Player Normal + case 0: + ct.colour = getRGB(160- help.glow/2 - (fRandom()*20), 200- help.glow/2, 220 - help.glow); + break; + //Player Hurt + case 1: + ct.colour = getRGB(196 - (fRandom() * 64), 10, 10); + break; + //Enemies and stuff + case 2: + ct.colour = getRGB(225-(help.glow/2), 75, 30); + break; + case 3: //Trinket + if (!trinketcolset) + { + trinketr = 200 - (fRandom() * 64); + trinketg = 200 - (fRandom() * 128); + trinketb = 164 + (fRandom() * 60); + trinketcolset = true; + } + ct.colour = getRGB(trinketr, trinketg, trinketb); + break; + case 4: //Inactive savepoint + temp = (help.glow/2) + (fRandom() * 8); + ct.colour = getRGB(80 + temp, 80 + temp, 80 + temp); + break; + case 5: //Active savepoint + ct.colour = getRGB(164+(fRandom()*64),164+(fRandom()*64), 255-(fRandom()*64)); + break; + case 6: //Enemy : Red + ct.colour = getRGB(250 - help.glow/2, 60- help.glow/2, 60 - help.glow/2); + break; + case 7: //Enemy : Green + ct.colour = getRGB(100 - help.glow/2 - (fRandom()*30), 250 - help.glow/2, 100 - help.glow/2 - (fRandom()*30)); + break; + case 8: //Enemy : Purple + ct.colour = getRGB(250 - help.glow/2, 20, 128 - help.glow/2 + (fRandom()*30)); + break; + case 9: //Enemy : Yellow + ct.colour = getRGB(250 - help.glow/2, 250 - help.glow/2, 20); + break; + case 10: //Warp point (white) + ct.colour = getRGB(255 - (fRandom() * 64), 255 - (fRandom() * 64), 255 - (fRandom() * 64)); + break; + case 11: //Enemy : Cyan + ct.colour = getRGB(20, 250 - help.glow/2, 250 - help.glow/2); + break; + case 12: //Enemy : Blue + ct.colour = getRGB(90- help.glow/2, 90 - help.glow/2, 250 - help.glow/2); + break; + //Crew Members + //green + case 13: + ct.colour = getRGB(120- help.glow/4 - (fRandom()*20), 220 - help.glow/4, 120- help.glow/4); + break; + //Yellow + case 14: + ct.colour = getRGB(220- help.glow/4 - (fRandom()*20), 210 - help.glow/4, 120- help.glow/4); + break; + //pink + case 15: + ct.colour = getRGB(255 - help.glow/8, 70 - help.glow/4, 70 - help.glow / 4); + break; + //Blue + case 16: + ct.colour = getRGB(75, 75, 255- help.glow/4 - (fRandom()*20)); + break; - case 21: // Enemy : Light Gray - return getRGB(180 - help.glow/2, 180 - help.glow/2, 180 - help.glow/2); - case 22: // Enemy : Indicator Gray - return getRGB(230 - help.glow/2, 230 - help.glow/2, 230 - help.glow/2); - case 23: // Enemy : Indicator Gray - return getRGB(255 - help.glow / 2 - (int) (GETCOL_RANDOM * 40), 255 - help.glow/2 - (int) (GETCOL_RANDOM * 40), 255 - help.glow/2 - (int) (GETCOL_RANDOM * 40)); - case 24: // Gravity line (Inactive) - return getRGB(96, 96, 96); - case 25: // Gravity line (Active) - if (game.noflashingmode) - { - return getRGB(200 - 20, 200 - 20, 200 - 20); - } + case 17: //Enemy : Orange + ct.colour = getRGB(250 - help.glow/2, 130 - help.glow/2, 20); + break; + case 18: //Enemy : Gray + ct.colour = getRGB(130- help.glow/2, 130 - help.glow/2, 130 - help.glow/2); + break; + case 19: //Enemy : Dark gray + ct.colour = getRGB(60- help.glow/8, 60 - help.glow/8, 60 - help.glow/8); + break; + //Purple + case 20: + ct.colour = getRGB(220 - help.glow / 4 - (fRandom() * 20), 120 - help.glow / 4, 210 - help.glow / 4); + break; - switch (linestate) - { - default: - case 0: - return getRGB(200 - 20, 200 - 20, 200 - 20); - case 1: - return getRGB(245 - 30, 245 - 30, 225 - 30); - case 2: - return getRGB(225 - 30, 245 - 30, 245 - 30); - case 3: - return getRGB(200 - 20, 200 - 20, 164 - 10); - case 4: - return getRGB(196 - 20, 255 - 30, 224 - 20); - case 5: - return getRGB(196 - 20, 235 - 30, 205 - 20); - case 6: - return getRGB(164 - 10, 164 - 10, 164 - 10); - case 7: - return getRGB(205 - 20, 245 - 30, 225 - 30); - case 8: - return getRGB(225 - 30, 255 - 30, 205 - 20); - case 9: - return getRGB(245 - 30, 245 - 30, 245 - 30); - } - case 26: // Coin - if (game.noflashingmode) - { - return getRGB(234, 234, 10); - } - return getRGB(250 - (int) (GETCOL_RANDOM * 32), 250 - (int) (GETCOL_RANDOM * 32), 10); - case 27: // Particle flashy red - return getRGB((GETCOL_RANDOM * 64), 10, 10); + case 21: //Enemy : Light Gray + ct.colour = getRGB(180- help.glow/2, 180 - help.glow/2, 180 - help.glow/2); + break; + case 22: //Enemy : Indicator Gray + ct.colour = getRGB(230- help.glow/2, 230- help.glow/2, 230- help.glow/2); + break; + case 23: //Enemy : Indicator Gray + ct.colour = getRGB(255- help.glow/2 - (fRandom() * 40) , 255- help.glow/2 - (fRandom() * 40), 255- help.glow/2 - (fRandom() * 40)); + break; - // Trophies - // cyan - case 30: - return RGBf(160, 200, 220); - // Purple - case 31: - return RGBf(220, 120, 210); - // Yellow - case 32: - return RGBf(220, 210, 120); - // red - case 33: - return RGBf(255, 70, 70); - // green - case 34: - return RGBf(120, 220, 120); - // Blue - case 35: - return RGBf(75, 75, 255); - // Gold - case 36: - return getRGB(180, 120, 20); - case 37: // Trinket - if (!trinketcolset) - { - trinketr = 200 - (GETCOL_RANDOM * 64); - trinketg = 200 - (GETCOL_RANDOM * 128); - trinketb = 164 + (GETCOL_RANDOM * 60); - trinketcolset = true; - } - return RGBf(trinketr, trinketg, trinketb); - // Silver - case 38: - return RGBf(196, 196, 196); - // Bronze - case 39: - return RGBf(128, 64, 10); - // Awesome - case 40: // Teleporter in action! - { - if (game.noflashingmode) - { - return getRGB(196, 196, 223); - } + //Trophies + //Yellow + case 30: + ct.colour = RGBf(160, 200, 220); + break; + //Purple + case 31: + ct.colour = RGBf(220, 120, 210); + break; + //cyan + case 32: + ct.colour = RGBf(220, 210, 120); + break; + //Blue + case 33: + ct.colour = RGBf(255, 70, 70); + break; + //green + case 34: + ct.colour = RGBf(120, 220, 120); + break; + //red + case 35: + ct.colour = RGBf(75, 75, 255); + break; + //Gold + case 36: + ct.colour = getRGB(180, 120, 20); + break; + case 37: //Trinket + if (!trinketcolset) + { + trinketr = 200 - (fRandom() * 64); + trinketg = 200 - (fRandom() * 128); + trinketb = 164 + (fRandom() * 60); + trinketcolset = true; + } + ct.colour = RGBf(trinketr, trinketg, trinketb); + break; + //Silver + case 38: + ct.colour = RGBf(196, 196, 196); + break; + //Bronze + case 39: + ct.colour = RGBf(128, 64, 10); + break; + //Awesome + case 40: //Teleporter in action! + temp = fRandom() * 150; + if(temp<33) + { + ct.colour = RGBf(255 - (fRandom() * 64), 64 + (fRandom() * 64), 64 + (fRandom() * 64)); + } + else if (temp < 66) + { + ct.colour = RGBf(64 + (fRandom() * 64), 255 - (fRandom() * 64), 64 + (fRandom() * 64)); + } + else if (temp < 100) + { + ct.colour = RGBf(64 + (fRandom() * 64), 64 + (fRandom() * 64), 255 - (fRandom() * 64)); + } + else + { + ct.colour = RGBf(164+(fRandom()*64),164+(fRandom()*64), 255-(fRandom()*64)); + } + break; - const int temp = GETCOL_RANDOM * 150; - if (temp < 33) - { - return RGBf(255 - (GETCOL_RANDOM * 64), 64 + (GETCOL_RANDOM * 64), 64 + (GETCOL_RANDOM * 64)); - } - else if (temp < 66) - { - return RGBf(64 + (GETCOL_RANDOM * 64), 255 - (GETCOL_RANDOM * 64), 64 + (GETCOL_RANDOM * 64)); - } - else if (temp < 100) - { - return RGBf(64 + (GETCOL_RANDOM * 64), 64 + (GETCOL_RANDOM * 64), 255 - (GETCOL_RANDOM * 64)); - } - else - { - return RGBf(164 + (GETCOL_RANDOM * 64), 164 + (GETCOL_RANDOM * 64), 255 - (GETCOL_RANDOM * 64)); - } - } + case 100: //Inactive Teleporter + temp = (help.glow/2) + (fRandom() * 8); + ct.colour = getRGB(42 + temp, 42 + temp, 42 + temp); + break; + case 101: //Active Teleporter + ct.colour = getRGB(164+(fRandom()*64),164+(fRandom()*64), 255-(fRandom()*64)); + break; + case 102: //Teleporter in action! + temp = fRandom() * 150; + if(temp<33) + { + ct.colour = getRGB(255 - (fRandom() * 64), 64 + (fRandom() * 64), 64 + (fRandom() * 64)); + } + else if (temp < 66) + { + ct.colour = getRGB(64 + (fRandom() * 64), 255 - (fRandom() * 64), 64 + (fRandom() * 64)); + } + else if (temp < 100) + { + ct.colour = getRGB(64 + (fRandom() * 64), 64 + (fRandom() * 64), 255 - (fRandom() * 64)); + } + else + { + ct.colour = getRGB(164+(fRandom()*64),164+(fRandom()*64), 255-(fRandom()*64)); + } + break; - case 100: // Inactive Teleporter - { - const int temp = (help.glow / 2) + (GETCOL_RANDOM * 8); - return getRGB(42 + temp, 42 + temp, 42 + temp); - } - case 101: // Active Teleporter - return getRGB(164 + (GETCOL_RANDOM * 64), 164 + (GETCOL_RANDOM * 64), 255 - (GETCOL_RANDOM * 64)); - case 102: // Teleporter in action! - { - if (game.noflashingmode) - { - return getRGB(196, 196, 223); - } - - const int temp = GETCOL_RANDOM * 150; - if (temp < 33) - { - return getRGB(255 - (GETCOL_RANDOM * 64), 64 + (GETCOL_RANDOM * 64), 64 + (GETCOL_RANDOM * 64)); - } - else if (temp < 66) - { - return getRGB(64 + (GETCOL_RANDOM * 64), 255 - (GETCOL_RANDOM * 64), 64 + (GETCOL_RANDOM * 64)); - } - else if (temp < 100) - { - return getRGB(64 + (GETCOL_RANDOM * 64), 64 + (GETCOL_RANDOM * 64), 255 - (GETCOL_RANDOM * 64)); - } - else - { - return getRGB(164 + (GETCOL_RANDOM * 64), 164 + (GETCOL_RANDOM * 64), 255 - (GETCOL_RANDOM * 64)); - } - } - } - - return getRGB(255, 255, 255); + default: + ct.colour = getRGB(255, 255, 255); + break; + } } -#undef GETCOL_RANDOM void Graphics::menuoffrender(void) { - if (copy_texture(gameplayTexture, NULL, NULL) != 0) - { - return; - } + SDL_Rect offsetRect1; + setRect (offsetRect1, 0, 0, backBuffer->w ,backBuffer->h); - const int offset = (int) lerp(oldmenuoffset, menuoffset); - const SDL_Rect offsetRect = {0, offset, SCREEN_WIDTH_PIXELS, SCREEN_HEIGHT_PIXELS}; + //put the back buffer in the menubuffer + BlitSurfaceStandard(backBuffer, NULL, menubuffer, NULL); - if (copy_texture(menuTexture, NULL, &offsetRect) != 0) - { - return; - } + + + int usethisoffset = lerp(oldmenuoffset, menuoffset); + if(flipmode) + { + SDL_Surface* tempbufferFlipped = FlipSurfaceVerticle(tempBuffer); + //put the stored backbuffer in the backbuffer. + ClearSurface(backBuffer); + BlitSurfaceStandard(tempbufferFlipped, NULL, backBuffer, NULL); + SDL_FreeSurface(tempbufferFlipped); + SDL_Rect offsetRect; + setRect (offsetRect, 0, -usethisoffset, backBuffer->w ,backBuffer->h); + SDL_Surface* temp = FlipSurfaceVerticle(menubuffer); + BlitSurfaceStandard(temp,NULL,backBuffer,&offsetRect); + SDL_FreeSurface(temp); + } + else + { + //put the stored backbuffer in the backbuffer. + BlitSurfaceStandard(tempBuffer, NULL, backBuffer, NULL); + + SDL_Rect offsetRect; + setRect (offsetRect, 0, usethisoffset, backBuffer->w ,backBuffer->h); + BlitSurfaceStandard(menubuffer,NULL,backBuffer,&offsetRect); + } + + SDL_Rect rect; + setRect(rect, 0, 0, backBuffer->w, backBuffer->h); + screenbuffer->UpdateScreen(backBuffer,&rect); + ClearSurface(backBuffer); } -void Graphics::textboxabsolutepos(int x, int y) +void Graphics::drawhuetile( int x, int y, int t ) { - if (!INBOUNDS_VEC(m, textboxes)) - { - vlog_error("textboxabsolutepos() out-of-bounds!"); - return; - } + if (!INBOUNDS_VEC(t, tiles)) + { + return; + } + point tpoint; + tpoint.x = x; + tpoint.y = y; - textboxes[m].position_absolute = true; - textboxes[m].xp = x; - textboxes[m].yp = y; + + SDL_Rect rect; + setRect(rect,tpoint.x,tpoint.y,tiles_rect.w, tiles_rect.h); + BlitSurfaceColoured(tiles[t],NULL,backBuffer, &rect, ct); +} + +void Graphics::huetilesetcol(int t) +{ + switch (t) + { + case 0: + setcolreal(getRGB(250-int(fRandom()*32), 250-int(fRandom()*32), 10)); + break; + case 1: + setcolreal(getRGB(250-int(fRandom()*32), 250-int(fRandom()*32), 10)); + break; + default: + setcolreal(getRGB(250-int(fRandom()*32), 250-int(fRandom()*32), 10)); + break; + } +} + +Uint32 Graphics::bigchunkygetcol(int t) +{ + //A seperate index of colours, for simplicity + switch (t) + { + case 1: + return getBGR((fRandom() * 64), 10, 10); + case 2: + return getBGR(int(160- help.glow/2 - (fRandom()*20)), 200- help.glow/2, 220 - help.glow); + } + return 0x00000000; +} + +void Graphics::setwarprect( int a, int b, int c, int d ) +{ + warprect.x = a; + warprect.y = b; + warprect.w = c; + warprect.h = d; } void Graphics::textboxcenterx(void) { - if (!INBOUNDS_VEC(m, textboxes)) - { - vlog_error("textboxcenterx() out-of-bounds!"); - return; - } + if (!INBOUNDS_VEC(m, textbox)) + { + puts("textboxcenterx() out-of-bounds!"); + return; + } - textboxes[m].should_centerx = true; + textbox[m].centerx(); } int Graphics::textboxwidth(void) { - if (!INBOUNDS_VEC(m, textboxes)) - { - vlog_error("textboxwidth() out-of-bounds!"); - return 0; - } + if (!INBOUNDS_VEC(m, textbox)) + { + puts("textboxwidth() out-of-bounds!"); + return 0; + } - return textboxes[m].w; + return textbox[m].w; } void Graphics::textboxmoveto(int xo) { - if (!INBOUNDS_VEC(m, textboxes)) - { - vlog_error("textboxmoveto() out-of-bounds!"); - return; - } + if (!INBOUNDS_VEC(m, textbox)) + { + puts("textboxmoveto() out-of-bounds!"); + return; + } - textboxes[m].xp = xo; + textbox[m].xp = xo; } void Graphics::textboxcentery(void) { - if (!INBOUNDS_VEC(m, textboxes)) - { - vlog_error("textboxcentery() out-of-bounds!"); - return; - } + if (!INBOUNDS_VEC(m, textbox)) + { + puts("textboxcentery() out-of-bounds!"); + return; + } - textboxes[m].should_centery = true; -} - -void Graphics::textboxpad(size_t left_pad, size_t right_pad) -{ - if (!INBOUNDS_VEC(m, textboxes)) - { - vlog_error("textboxpad() out-of-bounds!"); - return; - } - - textboxes[m].spacing.pad_left = left_pad; - textboxes[m].spacing.pad_right = right_pad; -} - -void Graphics::textboxpadtowidth(size_t new_w) -{ - if (!INBOUNDS_VEC(m, textboxes)) - { - vlog_error("textboxpadtowidth() out-of-bounds!"); - return; - } - - textboxes[m].spacing.padtowidth = new_w; -} - -void Graphics::textboxcentertext(void) -{ - if (!INBOUNDS_VEC(m, textboxes)) - { - vlog_error("textboxcentertext() out-of-bounds!"); - return; - } - - textboxes[m].spacing.centertext = true; -} - -void Graphics::textboxprintflags(const uint32_t flags) -{ - if (!INBOUNDS_VEC(m, textboxes)) - { - vlog_error("textboxprintflags() out-of-bounds!"); - return; - } - - textboxes[m].print_flags = flags; - textboxes[m].resize(); -} - -void Graphics::textboxbuttons(void) -{ - if (!INBOUNDS_VEC(m, textboxes)) - { - vlog_error("textboxbuttons() out-of-bounds!"); - return; - } - - textboxes[m].fill_buttons = true; -} - -void Graphics::textboxcrewmateposition(const TextboxCrewmatePosition* crewmate_position) -{ - if (!INBOUNDS_VEC(m, textboxes)) - { - vlog_error("textboxcrewmateposition() out-of-bounds!"); - return; - } - - textboxes[m].crewmate_position = *crewmate_position; -} - -void Graphics::textboxoriginalcontext(const TextboxOriginalContext* original_context) -{ - if (!INBOUNDS_VEC(m, textboxes)) - { - vlog_error("textboxoriginalcontext() out-of-bounds!"); - return; - } - - textboxes[m].original = *original_context; -} - -void Graphics::textboxoriginalcontextauto(void) -{ - if (!INBOUNDS_VEC(m, textboxes)) - { - vlog_error("textboxoriginalcontextauto() out-of-bounds!"); - return; - } - - TextboxOriginalContext context = TextboxOriginalContext(); - context.text_case = 1; - context.lines = textboxes[m].lines; - if (script.running) - { - context.script_name = script.scriptname; - } - context.x = textboxes[m].xp; - context.y = textboxes[m].yp; - - textboxes[m].original = context; -} - -void Graphics::textboxcase(char text_case) -{ - if (!INBOUNDS_VEC(m, textboxes)) - { - vlog_error("textboxcase() out-of-bounds!"); - return; - } - - textboxes[m].original.text_case = text_case; -} - -void Graphics::textboxtranslate(const TextboxTranslate translate, const TextboxFunction function) -{ - if (!INBOUNDS_VEC(m, textboxes)) - { - vlog_error("textboxtranslate() out-of-bounds!"); - return; - } - - if (translate == TEXTTRANSLATE_FUNCTION && function == NULL) - { - SDL_assert(0 && "function is NULL!"); - return; - } - if (translate != TEXTTRANSLATE_FUNCTION && function != NULL) - { - SDL_assert(0 && "function provided when it won't be used!"); - return; - } - - textboxes[m].translate = translate; - textboxes[m].function = function; - textboxes[m].updatetext(); -} - -static void commsrelay_textbox(textboxclass* THIS) -{ - THIS->lines.clear(); - - if (THIS->original.lines.empty()) - { - return; - } - THIS->lines.push_back(loc::gettext(THIS->original.lines[0].c_str())); - THIS->wrap(11); - THIS->resize(); - THIS->xp = 224 - THIS->w; - THIS->yp = 32 - THIS->h/2; -} - -void Graphics::textboxcommsrelay(const char* text) -{ - // Special treatment for the gamestate textboxes in Comms Relay - if (!INBOUNDS_VEC(m, textboxes)) - { - vlog_error("textboxcommsrelay() out-of-bounds!"); - return; - } - textboxprintflags(PR_FONT_INTERFACE); - textboxes[m].original.lines.push_back(text); - textboxtranslate(TEXTTRANSLATE_FUNCTION, commsrelay_textbox); + textbox[m].centery(); } int Graphics::crewcolour(const int t) { - // Given crewmate t, return colour - switch (t) - { - case 0: - return EntityColour_CREW_CYAN; - case 1: - return EntityColour_CREW_PURPLE; - case 2: - return EntityColour_CREW_YELLOW; - case 3: - return EntityColour_CREW_RED; - case 4: - return EntityColour_CREW_GREEN; - case 5: - return EntityColour_CREW_BLUE; - default: - return EntityColour_CREW_CYAN; - } + //given crewmate t, return colour in setcol + if (t == 0) return 0; + if (t == 1) return 20; + if (t == 2) return 14; + if (t == 3) return 15; + if (t == 4) return 13; + if (t == 5) return 16; + return 0; } void Graphics::flashlight(void) { - set_blendmode(SDL_BLENDMODE_NONE); - - fill_rect(NULL, 0xBB, 0xBB, 0xBB, 0xBB); + FillRect(backBuffer, 0xBBBBBBBB); } void Graphics::screenshake(void) { - if (gameScreen.badSignalEffect) - { - ApplyFilter(&tempFilterSrc, &tempFilterDest); - } + if(flipmode) + { + SDL_Rect shakeRect; + setRect(shakeRect,screenshake_x, screenshake_y, backBuffer->w, backBuffer->h); + SDL_Surface* flipBackBuffer = FlipSurfaceVerticle(backBuffer); + screenbuffer->UpdateScreen( flipBackBuffer, &shakeRect); + SDL_FreeSurface(flipBackBuffer); + } + else + { + SDL_Rect shakeRect; + setRect(shakeRect,screenshake_x, screenshake_y, backBuffer->w, backBuffer->h); + screenbuffer->UpdateScreen( backBuffer, &shakeRect); + } - set_render_target(tempShakeTexture); - set_blendmode(SDL_BLENDMODE_NONE); - clear(); - - const SDL_Rect shake = {screenshake_x, screenshake_y, SCREEN_WIDTH_PIXELS, SCREEN_HEIGHT_PIXELS}; - - copy_texture(gameTexture, NULL, &shake); - - draw_screenshot_border(); - - set_render_target(gameTexture); - clear(); - - // Clear the gameplay texture so blackout() is actually black after a screenshake - if (game.gamestate == GAMEMODE && game.blackout) - { - set_render_target(gameplayTexture); - clear(); - } - - set_render_target(NULL); - set_blendmode(SDL_BLENDMODE_NONE); - draw_window_background(); - - SDL_Rect rect; - get_stretch_info(&rect); - - copy_texture(tempShakeTexture, NULL, &rect, 0, NULL, flipmode ? SDL_FLIP_VERTICAL : SDL_FLIP_NONE); + ClearSurface(backBuffer); } void Graphics::updatescreenshake(void) { - screenshake_x = static_cast((fRandom() * 7) - 4); - screenshake_y = static_cast((fRandom() * 7) - 4); -} - -void Graphics::draw_window_background(void) -{ - clear(); -} - -void Graphics::get_stretch_info(SDL_Rect* rect) -{ - int width; - int height; - gameScreen.GetScreenSize(&width, &height); - - switch (gameScreen.scalingMode) - { - case SCALING_INTEGER: - { - int scale = SDL_min(width / SCREEN_WIDTH_PIXELS, height / SCREEN_HEIGHT_PIXELS); - rect->x = (width - SCREEN_WIDTH_PIXELS * scale) / 2; - rect->y = (height - SCREEN_HEIGHT_PIXELS * scale) / 2; - rect->w = SCREEN_WIDTH_PIXELS * scale; - rect->h = SCREEN_HEIGHT_PIXELS * scale; - break; - } - case SCALING_LETTERBOX: - if (width * SCREEN_HEIGHT_PIXELS > height * SCREEN_WIDTH_PIXELS) - { - rect->x = (width - height * SCREEN_WIDTH_PIXELS / SCREEN_HEIGHT_PIXELS) / 2; - rect->y = 0; - rect->w = height * SCREEN_WIDTH_PIXELS / SCREEN_HEIGHT_PIXELS; - rect->h = height; - } - else - { - rect->x = 0; - rect->y = (height - width * SCREEN_HEIGHT_PIXELS / SCREEN_WIDTH_PIXELS) / 2; - rect->w = width; - rect->h = width * SCREEN_HEIGHT_PIXELS / SCREEN_WIDTH_PIXELS; - } - break; - case SCALING_STRETCH: - /* Could pass NULL to copy_texture instead, but this feels better */ - rect->x = 0; - rect->y = 0; - rect->w = width; - rect->h = height; - break; - default: - SDL_assert(0 && "Invalid scaling mode!"); - rect->x = 0; - rect->y = 0; - rect->w = width; - rect->h = height; - } - - // In case anything accidentally set the width/height to 0, we'll clamp it to avoid crashing from a division by 0 - rect->w = SDL_max(1, rect->w); - rect->h = SDL_max(1, rect->h); + screenshake_x = static_cast((fRandom() * 7) - 4); + screenshake_y = static_cast((fRandom() * 7) - 4); } void Graphics::render(void) { - ime_render(); - draw_screenshot_border(); - - if (gameScreen.badSignalEffect) - { - ApplyFilter(&tempFilterSrc, &tempFilterDest); - } - - set_render_target(NULL); - set_blendmode(SDL_BLENDMODE_NONE); - - draw_window_background(); - - SDL_Rect stretch_info; - get_stretch_info(&stretch_info); - - ime_set_rect(&stretch_info); - - copy_texture(gameTexture, NULL, &stretch_info, 0, NULL, flipmode ? SDL_FLIP_VERTICAL : SDL_FLIP_NONE); + if(screenbuffer == NULL) + { + return; + } + if(flipmode) + { + SDL_Rect rect; + setRect(rect, 0, 0, backBuffer->w, backBuffer->h); + SDL_Surface* tempsurface = FlipSurfaceVerticle(backBuffer); + if(tempsurface != NULL) + { + screenbuffer->UpdateScreen( tempsurface, &rect); + SDL_FreeSurface(tempsurface); + } + } + else + { + SDL_Rect rect; + setRect(rect, 0, 0, backBuffer->w, backBuffer->h); + screenbuffer->UpdateScreen( backBuffer, &rect); + } } void Graphics::renderwithscreeneffects(void) { - if (game.flashlight > 0 && !game.noflashingmode) - { - flashlight(); - } + if (game.flashlight > 0 && !game.noflashingmode) + { + flashlight(); + } - if (game.screenshake > 0 && !game.noflashingmode) - { - screenshake(); - } - else - { - render(); - } + if (game.screenshake > 0 && !game.noflashingmode) + { + screenshake(); + } + else + { + render(); + } } void Graphics::renderfixedpre(void) { - if (game.screenshake > 0) - { - updatescreenshake(); - } + if (game.screenshake > 0) + { + updatescreenshake(); + } - if (gameScreen.badSignalEffect) - { - UpdateFilter(); - } + if (screenbuffer != NULL && screenbuffer->badSignalEffect) + { + UpdateFilter(); + } } void Graphics::renderfixedpost(void) { - /* Screen effects timers */ - if (game.flashlight > 0) - { - --game.flashlight; - } - if (game.screenshake > 0) - { - --game.screenshake; - } - - game.old_screenshot_border_timer = game.screenshot_border_timer; - if (game.screenshot_border_timer > 0) - { - game.screenshot_border_timer -= 15; - } + /* Screen effects timers */ + if (game.flashlight > 0) + { + --game.flashlight; + } + if (game.screenshake > 0) + { + --game.screenshake; + } } -void Graphics::draw_screenshot_border(void) +void Graphics::bigrprint(int x, int y, std::string& t, int r, int g, int b, bool cen, float sc) { - const int border_alpha = lerp(game.old_screenshot_border_timer, game.screenshot_border_timer); + std::vector& font = flipmode ? flipbfont : bfont; - if (border_alpha <= 100) - { - return; - } + r = clamp(r, 0, 255); + g = clamp(g, 0, 255); + b = clamp(b, 0, 255); + ct.colour = getRGB(r, g, b); - int width = 0; - int height = 0; - int result = query_texture(gameTexture, NULL, NULL, &width, &height); - if (result != 0) - { - return; - } + x = x / (sc); - const SDL_Rect rect_inner = {1, 1, width - 2, height - 2}; + x -= (len(t)); - if (game.screenshot_saved_success) - { - set_color(196, 196, 20, border_alpha); - } - else - { - set_color(196, 20, 20, border_alpha); - } + if (cen) + { + x = VVV_max(160 - (int((len(t)/ 2.0)*sc)), 0 ); + } + else + { + x *= (sc); + } - set_blendmode(SDL_BLENDMODE_BLEND); - draw_rect(NULL); - draw_rect(&rect_inner); - set_blendmode(SDL_BLENDMODE_NONE); + int bfontpos = 0; + int cur; + int idx; + std::string::iterator iter = t.begin(); + while (iter != t.end()) { + cur = utf8::unchecked::next(iter); + idx = font_idx(cur); + if (INBOUNDS_VEC(idx, font)) + { + SDL_Surface* tempPrint = ScaleSurface(font[idx], font[idx]->w *sc,font[idx]->h *sc); + SDL_Rect printrect = {x + bfontpos, y, (int) (bfont_rect.w * sc), (int) (bfont_rect.h * sc)}; + BlitSurfaceColoured(tempPrint, NULL, backBuffer, &printrect, ct); + SDL_FreeSurface(tempPrint); + } + bfontpos+=bfontlen(cur)* sc; + } } -void Graphics::drawtele(int x, int y, int t, const SDL_Color color) +void Graphics::bigbrprint(int x, int y, std::string& s, int r, int g, int b, bool cen, float sc) { - SDL_Rect telerect; - setRect(telerect, x, y, tele_rect.w, tele_rect.h); + if (!notextoutline) + { + int x_o = x / sc - len(s); + bigrprint(x, y - sc, s, 0, 0, 0, cen, sc); + if (cen) + { + x_o = VVV_max(160 - (len(s) / 2) * sc, 0); + bigprint(x_o - sc, y, s, 0, 0, 0, false, sc); + bigprint(x_o + sc, y, s, 0, 0, 0, false, sc); + } + else + { + x_o *= sc; + bigprint(x_o - sc, y, s, 0, 0, 0, false, sc); + bigprint(x_o + sc, y, s, 0, 0, 0, false, sc); + } + bigrprint(x, y + sc, s, 0, 0, 0, cen, sc); + } - draw_grid_tile(grphx.im_teleporter, 0, x, y, tele_rect.w, tele_rect.h, 16, 16, 16); - - if (t > 9) t = 8; - if (t < 1) t = 1; - - draw_grid_tile(grphx.im_teleporter, t, x, y, tele_rect.w, tele_rect.h, color); + bigrprint(x, y, s, r, g, b, cen, sc); } -SDL_Color Graphics::getRGBA(const Uint8 r, const Uint8 g, const Uint8 b, const Uint8 a) +void Graphics::drawtele(int x, int y, int t, Uint32 c) { - const SDL_Color color = {r, g, b, a}; - return color; + setcolreal(getRGB(16,16,16)); + + SDL_Rect telerect; + setRect(telerect, x , y, tele_rect.w, tele_rect.h ); + if (INBOUNDS_VEC(0, tele)) + { + BlitSurfaceColoured(tele[0], NULL, backBuffer, &telerect, ct); + } + + setcolreal(c); + if (t > 9) t = 8; + if (t < 1) t = 1; + + setRect(telerect, x , y, tele_rect.w, tele_rect.h ); + if (INBOUNDS_VEC(t, tele)) + { + BlitSurfaceColoured(tele[t], NULL, backBuffer, &telerect, ct); + } } -SDL_Color Graphics::getRGB(const Uint8 r, const Uint8 g, const Uint8 b) +Uint32 Graphics::getRGBA(Uint8 r, Uint8 g, Uint8 b, Uint8 a) { - const SDL_Color color = {r, g, b, 255}; - return color; + return SDL_MapRGBA(backBuffer->format, b, g, r, a); } -SDL_Color Graphics::RGBf(int r, int g, int b) +Uint32 Graphics::getRGB(Uint8 r, Uint8 g, Uint8 b) { - r = (r + 128) / 3; - g = (g + 128) / 3; - b = (b + 128) / 3; - const SDL_Color color = {(Uint8) r, (Uint8) g, (Uint8) b, 255}; - return color; + return SDL_MapRGB(backBuffer->format, b, g, r); +} + +Uint32 Graphics::getBGR(Uint8 r, Uint8 g, Uint8 b) +{ + return SDL_MapRGB(backBuffer->format, r, g, b); +} + +Uint32 Graphics::getRGB(Uint32 _col) +{ + return ( _col); +} + +Uint32 Graphics::RGBflip(Uint8 r, Uint8 g, Uint8 b) +{ + return SDL_MapRGB(backBuffer->format, r, g, b); +} + +Uint32 Graphics::RGBf(int r, int g, int b) +{ + r = (r+128) / 3; + g = (g+128) / 3; + b = (b+128) / 3; + return SDL_MapRGB(backBuffer->format, r, g, b); +} + +void Graphics::setcolreal(Uint32 t) +{ + ct.colour = t; +} + +void Graphics::drawforetile(int x, int y, int t) +{ + if (!INBOUNDS_VEC(t, tiles)) + { + WHINE_ONCE("drawforetile() out-of-bounds!"); + return; + } + + SDL_Rect rect; + setRect(rect, x,y,tiles_rect.w, tiles_rect.h); + +#if !defined(NO_CUSTOM_LEVELS) + if (shouldrecoloroneway(t, tiles1_mounted)) + { + colourTransform thect = {ed.getonewaycol()}; + BlitSurfaceTinted(tiles[t], NULL, foregroundBuffer, &rect, thect); + } + else +#endif + { + BlitSurfaceStandard(tiles[t],NULL, foregroundBuffer, &rect ); + } +} + +void Graphics::drawforetile2(int x, int y, int t) +{ + if (!INBOUNDS_VEC(t, tiles2)) + { + WHINE_ONCE("drawforetile2() out-of-bounds!"); + return; + } + + SDL_Rect rect; + setRect(rect, x,y,tiles_rect.w, tiles_rect.h); + +#if !defined(NO_CUSTOM_LEVELS) + if (shouldrecoloroneway(t, tiles2_mounted)) + { + colourTransform thect = {ed.getonewaycol()}; + BlitSurfaceTinted(tiles2[t], NULL, foregroundBuffer, &rect, thect); + } + else +#endif + { + BlitSurfaceStandard(tiles2[t],NULL, foregroundBuffer, &rect ); + } +} + +void Graphics::drawforetile3(int x, int y, int t, int off) +{ + t += off * 30; + if (!INBOUNDS_VEC(t, tiles3)) + { + WHINE_ONCE("drawforetile3() out-of-bounds!"); + return; + } + SDL_Rect rect; + setRect(rect, x,y,tiles_rect.w, tiles_rect.h); + BlitSurfaceStandard(tiles3[t],NULL, foregroundBuffer, &rect ); +} + +void Graphics::drawrect(int x, int y, int w, int h, int r, int g, int b) +{ + SDL_Rect madrect; + //Draw the retangle indicated by that object + madrect.x = x; + madrect.y = y; + madrect.w = w; + madrect.h = 1; + FillRect(backBuffer, madrect, getRGB(b,g,r)); + + madrect.w = 1; + madrect.h = h; + FillRect(backBuffer, madrect, getRGB(b,g,r)); + + madrect.x = x + w - 1; + madrect.w = 1; + madrect.h = h; + FillRect(backBuffer, madrect, getRGB(b,g,r)); + madrect.x = x; + madrect.y = y + h - 1; + madrect.w = w; + madrect.h = 1; + FillRect(backBuffer, madrect, getRGB(b,g,r)); } bool Graphics::onscreen(int t) { - return (t >= -40 && t <= 280); -} - -bool Graphics::checktexturesize( - const char* filename, SDL_Texture* texture, - const int tilewidth, const int tileheight -) { - int texturewidth; - int textureheight; - if (query_texture(texture, NULL, NULL, &texturewidth, &textureheight) != 0) - { - /* Just give it the benefit of the doubt. */ - vlog_warn( - "Assuming the dimensions of %s are exact multiples of %i by %i!", - filename, tilewidth, tileheight - ); - return true; - } - - const bool valid = texturewidth % tilewidth == 0 && textureheight % tileheight == 0; - if (!valid) - { - FILESYSTEM_setLevelDirError( - loc::gettext("{filename} dimensions not exact multiples of {width} by {height}!"), - "filename:str, width:int, height:int", - filename, tilewidth, tileheight - ); - return false; - } - - return true; -} - -static void make_array( - SDL_Surface** tilesheet, - std::vector& vector, - const int tile_square -) { - int j; - for (j = 0; j < (*tilesheet)->h / tile_square; j++) - { - int i; - for (i = 0; i < (*tilesheet)->w / tile_square; i++) - { - SDL_Surface* temp = GetSubSurface( - *tilesheet, - i * tile_square, j * tile_square, - tile_square, tile_square - ); - vector.push_back(temp); - } - } + return (t >= -40 && t <= 280); } bool Graphics::reloadresources(void) { - grphx.destroy(); - grphx.init(); + grphx.destroy(); + grphx.init(); - MAYBE_FAIL(checktexturesize("tiles.png", grphx.im_tiles, 8, 8)); - MAYBE_FAIL(checktexturesize("tiles2.png", grphx.im_tiles2, 8, 8)); - MAYBE_FAIL(checktexturesize("tiles3.png", grphx.im_tiles3, 8, 8)); - MAYBE_FAIL(checktexturesize("entcolours.png", grphx.im_entcolours, 8, 8)); - MAYBE_FAIL(checktexturesize("sprites.png", grphx.im_sprites, 32, 32)); - MAYBE_FAIL(checktexturesize("flipsprites.png", grphx.im_flipsprites, 32, 32)); - MAYBE_FAIL(checktexturesize("teleporter.png", grphx.im_teleporter, 96, 96)); + destroy(); - destroy(); + MAYBE_FAIL(MakeTileArray()); + MAYBE_FAIL(MakeSpriteArray()); + MAYBE_FAIL(maketelearray()); + MAYBE_FAIL(Makebfont()); - make_array(&grphx.im_sprites_surf, sprites_surf, 32); - make_array(&grphx.im_flipsprites_surf, flipsprites_surf, 32); + images.clear(); - images[IMAGE_LEVELCOMPLETE] = grphx.im_image0; - images[IMAGE_MINIMAP] = grphx.im_image1; - images[IMAGE_COVERED] = grphx.im_image2; - images[IMAGE_ELEPHANT] = grphx.im_image3; - images[IMAGE_GAMECOMPLETE] = grphx.im_image4; - images[IMAGE_FLIPLEVELCOMPLETE] = grphx.im_image5; - images[IMAGE_FLIPGAMECOMPLETE] = grphx.im_image6; + images.push_back(grphx.im_image0); + images.push_back(grphx.im_image1); + images.push_back(grphx.im_image2); + images.push_back(grphx.im_image3); + images.push_back(grphx.im_image4); + images.push_back(grphx.im_image5); + images.push_back(grphx.im_image6); - images[IMAGE_SITE] = grphx.im_image7; - images[IMAGE_SITE2] = grphx.im_image8; - images[IMAGE_SITE3] = grphx.im_image9; - images[IMAGE_ENDING] = grphx.im_image10; - images[IMAGE_SITE4] = grphx.im_image11; - images[IMAGE_CUSTOMMINIMAP] = grphx.im_image12; + images.push_back(grphx.im_image7); + images.push_back(grphx.im_image8); + images.push_back(grphx.im_image9); + images.push_back(grphx.im_image10); + images.push_back(grphx.im_image11); + images.push_back(grphx.im_image12); - gameScreen.LoadIcon(); + if (screenbuffer != NULL) + { + screenbuffer->LoadIcon(); + } - music.destroy(); - music.init(); + music.destroy(); + music.init(); - tiles1_mounted = FILESYSTEM_isAssetMounted("graphics/tiles.png"); - tiles2_mounted = FILESYSTEM_isAssetMounted("graphics/tiles2.png"); - minimap_mounted = FILESYSTEM_isAssetMounted("graphics/minimap.png"); +#ifndef NO_CUSTOM_LEVELS + tiles1_mounted = FILESYSTEM_isAssetMounted("graphics/tiles.png"); + tiles2_mounted = FILESYSTEM_isAssetMounted("graphics/tiles2.png"); + minimap_mounted = FILESYSTEM_isAssetMounted("graphics/minimap.png"); +#endif - gamecomplete_mounted = FILESYSTEM_isAssetMounted("graphics/gamecomplete.png"); - levelcomplete_mounted = FILESYSTEM_isAssetMounted("graphics/levelcomplete.png"); - flipgamecomplete_mounted = FILESYSTEM_isAssetMounted("graphics/flipgamecomplete.png"); - fliplevelcomplete_mounted = FILESYSTEM_isAssetMounted("graphics/fliplevelcomplete.png"); - - return true; + return true; fail: - return false; + return false; } -SDL_Color Graphics::crewcolourreal(int t) +Uint32 Graphics::crewcolourreal(int t) { - switch (t) - { - case 0: - return col_crewcyan; - case 1: - return col_crewpurple; - case 2: - return col_crewyellow; - case 3: - return col_crewred; - case 4: - return col_crewgreen; - case 5: - return col_crewblue; - } - return col_crewcyan; -} - -void Graphics::render_roomname(uint32_t font_flag, const char* roomname, int r, int g, int b) -{ - int font_height = font::height(font_flag); - if (font_height <= 8) - { - footerrect.h = font_height + 2; - } - else - { - footerrect.h = font_height + 1; - } - footerrect.y = 240 - footerrect.h; - - set_blendmode(SDL_BLENDMODE_BLEND); - fill_rect(&footerrect, getRGBA(0, 0, 0, translucentroomname ? 127 : 255)); - font::print(font_flag | PR_CEN | PR_BOR | PR_CJK_LOW, -1, footerrect.y+1, roomname, r, g, b); - set_blendmode(SDL_BLENDMODE_NONE); -} - -void Graphics::print_roomtext(int x, const int y, const char* text, const bool rtl) -{ - uint32_t flags = PR_FONT_LEVEL | PR_CJK_LOW; - - if (rtl) - { - flags |= PR_RIGHT; - x += 8; // the size of a tile, not font width! - } - font::print(flags, x, y, text, 196, 196, 255 - help.glow); + switch (t) + { + case 0: + return col_crewcyan; + case 1: + return col_crewpurple; + case 2: + return col_crewyellow; + case 3: + return col_crewred; + case 4: + return col_crewgreen; + case 5: + return col_crewblue; + } + return col_crewcyan; } diff --git a/desktop_version/src/Graphics.h b/desktop_version/src/Graphics.h index b9c9a53f..1ec6818d 100644 --- a/desktop_version/src/Graphics.h +++ b/desktop_version/src/Graphics.h @@ -5,489 +5,361 @@ #include #include -#include "Game.h" #include "GraphicsResources.h" +#include "GraphicsUtil.h" +#include "Maths.h" +#include "Screen.h" #include "Textbox.h" #include "TowerBG.h" -enum FadeBars -{ - FADE_NONE, - FADE_FULLY_BLACK, - FADE_START_FADEOUT, - FADE_FADING_OUT, - FADE_START_FADEIN, - FADE_FADING_IN -}; - -enum ImageNames -{ - IMAGE_LEVELCOMPLETE, - IMAGE_MINIMAP, - IMAGE_COVERED, - IMAGE_ELEPHANT, - IMAGE_GAMECOMPLETE, - IMAGE_FLIPLEVELCOMPLETE, - IMAGE_FLIPGAMECOMPLETE, - IMAGE_SITE, - IMAGE_SITE2, - IMAGE_SITE3, - IMAGE_ENDING, - IMAGE_SITE4, - IMAGE_CUSTOMMINIMAP, - NUM_IMAGES -}; - -#define FADEMODE_IS_FADING(mode) ((mode) != FADE_NONE && (mode) != FADE_FULLY_BLACK) - -enum EntityColour -{ - EntityColour_CREW_CYAN = 0, - EntityColour_DEAD = 1, - EntityColour_ENEMY_DARK_ORANGE = 2, - EntityColour_TRINKET = 3, - EntityColour_INACTIVE_ENTITY = 4, - EntityColour_ACTIVE_ENTITY = 5, - EntityColour_ENEMY_RED = 6, - EntityColour_ENEMY_GREEN = 7, - EntityColour_ENEMY_PINK = 8, - EntityColour_ENEMY_YELLOW = 9, - EntityColour_WARP_TOKEN = 10, - EntityColour_ENEMY_CYAN = 11, - EntityColour_ENEMY_BLUE = 12, - EntityColour_CREW_GREEN = 13, - EntityColour_CREW_YELLOW = 14, - EntityColour_CREW_RED = 15, - EntityColour_CREW_BLUE = 16, - EntityColour_ENEMY_ORANGE = 17, - EntityColour_ENEMY_GRAY = 18, - - EntityColour_CREW_GRAY = 19, // Despite the comment in the color code saying this is for enemies, it's used as a fallback for crew colors. - - EntityColour_CREW_PURPLE = 20, - EntityColour_ENEMY_GRAVITRON = 21, - EntityColour_ENEMY_LIGHT_GRAY = 22, - EntityColour_GRAVITRON_INDICATOR = 23, - EntityColour_GRAVITY_LINE_TOUCHED = 24, - EntityColour_GRAVITY_LINE_ACTIVE = 25, - EntityColour_COIN = 26, - EntityColour_PARTICLE_RED = 27, - EntityColour_TROPHY_FINAL_LEVEL = 30, - EntityColour_TROPHY_SPACE_STATION_1 = 31, - EntityColour_TROPHY_SPACE_STATION_2 = 32, - EntityColour_TROPHY_TOWER = 33, - EntityColour_TROPHY_WARP_ZONE = 34, - EntityColour_TROPHY_LABORATORY = 35, - EntityColour_TROPHY_GOLD = 36, - EntityColour_TROPHY_GAME_COMPLETE = 37, - EntityColour_TROPHY_SILVER = 38, - EntityColour_TROPHY_BRONZE = 39, - EntityColour_TROPHY_FLASHY = 40, - EntityColour_TELEPORTER_INACTIVE = 100, - EntityColour_TELEPORTER_ACTIVE = 101, - EntityColour_TELEPORTER_FLASHING = 102 -}; - class Graphics { public: - void init(void); - void destroy(void); + void init(void); + void destroy(void); - void create_buffers(void); - void destroy_buffers(void); + void create_buffers(const SDL_PixelFormat* fmt); + void destroy_buffers(void); - GraphicsResources grphx; + GraphicsResources grphx; - void drawgravityline(int t, int x, int y, int w, int h); + int bfontlen(uint32_t ch); + int font_idx(uint32_t ch); - void drawcoloredtile(int x, int y, int t, int r, int g, int b); + bool Makebfont(void); - void drawmenu(int cr, int cg, int cb, enum Menu::MenuName menu); + void drawhuetile(int x, int y, int t); + void huetilesetcol(int t); + Uint32 bigchunkygetcol(int t); - void processfade(void); - void setfade(const int amount); + void drawgravityline(int t); - void drawfade(void); + bool MakeTileArray(void); - void setlinegap(int); - int getlinegap(void); - void createtextboxreal( - const std::string& t, - int xp, int yp, - int r, int g, int b, - bool flipme - ); - void createtextbox( - const std::string& t, - int xp, int yp, - SDL_Color color - ); - void createtextbox( - const std::string& t, - int xp, int yp, - int r, int g, int b - ); - void createtextboxflipme( - const std::string& t, - int xp, int yp, - SDL_Color color - ); - void createtextboxflipme( - const std::string& t, - int xp, int yp, - int r, int g, int b - ); + bool MakeSpriteArray(void); - void textboxabsolutepos(int x, int y); + bool maketelearray(void); - void textboxcenterx(void); + void drawcoloredtile(int x, int y, int t, int r, int g, int b); - int textboxwidth(void); + void drawmenu(int cr, int cg, int cb, bool levelmenu = false); - void textboxmoveto(int xo); + void processfade(void); + void setfade(const int amount); - void textboxcentery(void); + void drawfade(void); - void textboxpad(size_t left_pad, size_t right_pad); + void setwarprect(int a, int b, int c, int d); - void textboxpadtowidth(size_t new_w); + void createtextboxreal( + std::string t, + int xp, + int yp, + int r, + int g, + int b, + bool flipme + ); + void createtextbox( + std::string t, + int xp, + int yp, + int r, + int g, + int b + ); + void createtextboxflipme( + std::string t, + int xp, + int yp, + int r, + int g, + int b + ); - void textboxcentertext(void); + void textboxcenterx(void); - void textboxprintflags(uint32_t flags); + int textboxwidth(void); - void textboxbuttons(void); + void textboxmoveto(int xo); - void textboxcrewmateposition(const TextboxCrewmatePosition* crewmate_position); + void textboxcentery(void); - void textboxoriginalcontext(const TextboxOriginalContext* original_context); - void textboxoriginalcontextauto(void); + void textboxadjust(void); - void textboxcase(char text_case); + void addline(std::string t); - void textboxtranslate(TextboxTranslate translate, TextboxFunction function); + void textboxtimer(int t); - void textboxcommsrelay(const char* text); + void textboxremove(void); - void textboxapplyposition(void); + void textboxremovefast(void); - void addline(const std::string& t); + void textboxactive(void); - void setlarge(bool large); + void drawtextbox(int x, int y, int w, int h, int r, int g, int b); - void textboxtimer(int t); + void drawpixeltextbox(int x, int y, int w, int h, int w2, int h2, int r, int g, int b, int xo, int yo); + void drawcustompixeltextbox(int x, int y, int w, int h, int w2, int h2, int r, int g, int b, int xo, int yo); - void addsprite(int x, int y, int tile, int col); + void drawcrewman(int x, int y, int t, bool act, bool noshift =false); - void setimage(TextboxImage image); + int crewcolour(const int t); - void textboxoutline(bool enabled); + void cutscenebars(void); + void cutscenebarstimer(void); + void setbars(const int position); - void textboxindex(int index); + void drawpartimage(int t, int xp, int yp, int wp, int hp); - void textboxremove(void); + void drawimage(int t, int xp, int yp, bool cent=false); - void textboxremovefast(void); + void drawimagecol(int t, int xp, int yp, int r, int g, int b, bool cent= false); - void textboxactive(void); + void updatetextboxes(void); + void drawgui(void); - void drawpixeltextbox(int x, int y, int w, int h, int r, int g, int b); + void drawsprite(int x, int y, int t, int r, int g, int b); + void drawsprite(int x, int y, int t, Uint32 c); - void drawcrewman(int x, int y, int t, bool act, bool noshift =false); + void printcrewname(int x, int y, int t); - int crewcolour(const int t); + void printcrewnamestatus(int x, int y, int t); - void cutscenebars(void); - void cutscenebarstimer(void); - void setbars(const int position); + void printcrewnamedark(int x, int y, int t); - void drawpartimage(int t, int xp, int yp, int wp, int hp); + void map_tab(int opt, const std::string& text, bool selected = false); - void drawimage(int t, int xp, int yp, bool cent=false); + void map_option(int opt, int num_opts, const std::string& text, bool selected = false); - void drawimagecol(int t, int xp, int yp, SDL_Color ct, bool cent= false); + void Print(int _x, int _y, std::string _s, int r, int g, int b, bool cen = false); - void draw_texture(SDL_Texture* image, int x, int y); + void PrintAlpha(int _x, int _y, std::string _s, int r, int g, int b, int a, bool cen = false); - void draw_texture_part(SDL_Texture* image, int x, int y, int x2, int y2, int w, int h, int scalex, int scaley); + bool next_wrap(size_t* start, size_t* len, const char* str, int maxwidth); - void draw_grid_tile(SDL_Texture* texture, int t, int x, int y, int width, int height, int scalex, int scaley); - void draw_grid_tile(SDL_Texture* texture, int t, int x, int y, int width, int height); - void draw_grid_tile(SDL_Texture* texture, int t, int x, int y, int width, int height, int r, int g, int b, int a, int scalex, int scaley); - void draw_grid_tile(SDL_Texture* texture, int t, int x, int y, int width, int height, int r, int g, int b, int a); - void draw_grid_tile(SDL_Texture* texture, int t, int x, int y, int width, int height, int r, int g, int b, int scalex, int scaley); - void draw_grid_tile(SDL_Texture* texture, int t, int x, int y, int width, int height, int r, int g, int b); - void draw_grid_tile(SDL_Texture* texture, int t, int x, int y, int width, int height, SDL_Color color, int scalex, int scaley); - void draw_grid_tile(SDL_Texture* texture, int t, int x, int y, int width, int height, SDL_Color color); + bool next_wrap_s(char buffer[], size_t buffer_size, size_t* start, const char* str, int maxwidth); - void draw_region_image(int t, int xp, int yp, int wp, int hp); + void PrintWrap(int x, int y, const char* str, int r, int g, int b, bool cen, int linespacing, int maxwidth); - void updatetextboxes(void); - const char* textbox_line(char* buffer, size_t buffer_len, size_t textbox_i, size_t line_i); - void drawgui(void); + void PrintOffAlpha(int _x, int _y, std::string _s, int r, int g, int b, int a, bool cen = false); - void draw_sprite(int x, int y, int t, int r, int g, int b); - void draw_sprite(int x, int y, int t, SDL_Color color); + void bprint(int x, int y, std::string t, int r, int g, int b, bool cen = false); - void draw_flipsprite(int x, int y, int t, SDL_Color color); + void bprintalpha(int x, int y, std::string t, int r, int g, int b, int a, bool cen = false); - void scroll_texture(SDL_Texture* texture, SDL_Texture* temp, int x, int y); + int len(std::string t); + void bigprint( int _x, int _y, std::string _s, int r, int g, int b, bool cen = false, int sc = 2 ); + void bigbprint(int x, int y, std::string s, int r, int g, int b, bool cen = false, int sc = 2); + void drawspritesetcol(int x, int y, int t, int c); - void printcrewname(int x, int y, int t); - void printcrewnamedark(int x, int y, int t); - void printcrewnamestatus(int x, int y, int t, bool rescued); + void flashlight(void); + void screenshake(void); + void updatescreenshake(void); - void print_level_creator( - uint32_t print_flags, - int y, - const std::string& creator, - uint8_t r, - uint8_t g, - uint8_t b - ); + int screenshake_x; + int screenshake_y; - int set_render_target(SDL_Texture* texture); + void render(void); + void renderwithscreeneffects(void); + void renderfixedpre(void); + void renderfixedpost(void); - int set_texture_color_mod(SDL_Texture* texture, Uint8 r, Uint8 g, Uint8 b); + bool Hitest(SDL_Surface* surface1, point p1, SDL_Surface* surface2, point p2); - int set_texture_alpha_mod(SDL_Texture* texture, Uint8 alpha); + void drawentities(void); - int query_texture(SDL_Texture* texture, Uint32* format, int* access, int* w, int* h); + void drawentity(const int i, const int yoff); - int set_blendmode(SDL_BlendMode blendmode); - int set_blendmode(SDL_Texture* texture, SDL_BlendMode blendmode); + void drawtrophytext(void); - int clear(int r, int g, int b, int a); - int clear(void); + void bigrprint(int x, int y, std::string& t, int r, int g, int b, bool cen = false, float sc = 2); + void bigbrprint(int x, int y, std::string& t, int r, int g, int b, bool cen = false, float sc = 2); - bool substitute(SDL_Texture** texture); - void post_substitute(SDL_Texture* subst); - int copy_texture(SDL_Texture* texture, const SDL_Rect* src, const SDL_Rect* dest); - int copy_texture(SDL_Texture* texture, const SDL_Rect* src, const SDL_Rect* dest, double angle, const SDL_Point* center, SDL_RendererFlip flip); + void drawtele(int x, int y, int t, Uint32 c); - int set_color(Uint8 r, Uint8 g, Uint8 b, Uint8 a); - int set_color(Uint8 r, Uint8 g, Uint8 b); - int set_color(SDL_Color color); + Uint32 getRGBA(Uint8 r, Uint8 g, Uint8 b, Uint8 a); - int fill_rect(const SDL_Rect* rect); - int fill_rect(const SDL_Rect* rect, int r, int g, int b, int a); - int fill_rect(int x, int y, int w, int h, int r, int g, int b, int a); - int fill_rect(int x, int y, int w, int h, int r, int g, int b); - int fill_rect(const SDL_Rect* rect, int r, int g, int b); - int fill_rect(int r, int g, int b); - int fill_rect(const SDL_Rect* rect, SDL_Color color); - int fill_rect(int x, int y, int w, int h, SDL_Color color); - int fill_rect(SDL_Color color); + Uint32 getRGB(Uint8 r, Uint8 g, Uint8 b); - int draw_rect(const SDL_Rect* rect); - int draw_rect(const SDL_Rect* rect, int r, int g, int b, int a); - int draw_rect(int x, int y, int w, int h, int r, int g, int b, int a); - int draw_rect(int x, int y, int w, int h, int r, int g, int b); - int draw_rect(const SDL_Rect* rect, int r, int g, int b); - int draw_rect(const SDL_Rect* rect, SDL_Color color); - int draw_rect(int x, int y, int w, int h, SDL_Color color); + Uint32 getBGR(Uint8 r, Uint8 g, Uint8 b); - int draw_line(int x, int y, int x2, int y2); + Uint32 getRGB(Uint32 _col); - int draw_points(const SDL_Point* points, int count); - int draw_points(const SDL_Point* points, int count, int r, int g, int b); + Uint32 RGBflip(Uint8 r, Uint8 g, Uint8 b); - void map_tab(int opt, const char* text, bool selected = false); - void map_option(int opt, int num_opts, const std::string& text, bool selected = false); + Uint32 RGBf(int r, int g, int b); - void drawspritesetcol(int x, int y, int t, int c); + void setcolreal(Uint32 t); - - void flashlight(void); - void screenshake(void); - void updatescreenshake(void); - - int screenshake_x; - int screenshake_y; - - void draw_window_background(void); - - void get_stretch_info(SDL_Rect* rect); - - void render(void); - void renderwithscreeneffects(void); - void renderfixedpre(void); - void renderfixedpost(void); - - void draw_screenshot_border(void); - - bool Hitest(SDL_Surface* surface1, SDL_Point p1, SDL_Surface* surface2, SDL_Point p2); - - void drawentities(void); - - void drawentity(const int i, const int yoff); - - void drawtrophytext(void); - - void drawtele(int x, int y, int t, SDL_Color c); - - SDL_Color getRGBA(Uint8 r, Uint8 g, Uint8 b, Uint8 a); - - SDL_Color getRGB(Uint8 r, Uint8 g, Uint8 b); - - SDL_Color RGBf(int r, int g, int b); - - void drawbackground(int t); - void updatebackground(int t); - - bool shouldrecoloroneway(const int tilenum, const bool mounted); - - void drawtile3(int x, int y, int t, int off, int height_subtract = 0); - void drawtile2(int x, int y, int t); - void drawtile(int x, int y, int t); - - void drawmap(void); - - void drawtowermap(void); - - void drawtowerspikes(void); - - bool onscreen(int t); - - bool reloadresources(void); - bool checktexturesize( - const char* filename, SDL_Texture* texture, - int tilewidth, int tileheight - ); - - bool tiles1_mounted; - bool tiles2_mounted; - bool minimap_mounted; - - bool gamecomplete_mounted; - bool levelcomplete_mounted; - bool flipgamecomplete_mounted; - bool fliplevelcomplete_mounted; - - - void menuoffrender(void); - - void drawtowerbackground(const TowerBG& bg_obj); - void updatetowerbackground(TowerBG& bg_obj); - - SDL_Color getcol(int t); - void drawfinalmap(void); - - int rcol; - - - - int m; - - std::vector sprites_surf; - std::vector flipsprites_surf; - - SDL_Texture* images[NUM_IMAGES]; - - SDL_Texture* customminimaps[401]; - - bool flipmode; - bool setflipmode; - bool notextoutline; - - SDL_Texture* gameTexture; - SDL_Texture* tempShakeTexture; - SDL_Texture* gameplayTexture; - SDL_Texture* menuTexture; - SDL_Texture* ghostTexture; - SDL_Texture* backgroundTexture; - SDL_Texture* foregroundTexture; - SDL_Texture* tempScrollingTexture; - SDL_Surface* tempScreenshot; - SDL_Surface* tempScreenshot2x; - - TowerBG towerbg; - TowerBG titlebg; - - SDL_Rect tiles_rect; - SDL_Rect sprites_rect; - SDL_Rect tele_rect; - - SDL_Rect footerrect; - - int linestate, linedelay; - int backoffset; - bool backgrounddrawn, foregrounddrawn; - - int menuoffset; - int oldmenuoffset; - bool resumegamemode; - - int crewframe; - int crewframedelay; - - enum FadeBars fademode; - int fadeamount; - int oldfadeamount; - int fadebars[15]; - enum FadeBars ingame_fademode; - - bool trinketcolset; - int trinketr, trinketg, trinketb; - - std::vector textboxes; - - bool showcutscenebars; - int cutscenebarspos; - int oldcutscenebarspos; - - static const int numstars = 50; - SDL_Rect stars[numstars]; - int starsspeed[numstars]; - - static const int numbackboxes = 18; - int spcol, spcoldel; - SDL_Rect backboxes[numbackboxes]; - int backboxvx[numbackboxes]; - int backboxvy[numbackboxes]; - float backboxmult; - - int warpskip; - - bool translucentroomname; - -#ifndef GAME_DEFINITION - float inline lerp(const float v0, const float v1) - { - if (game.physics_frozen()) - { - return v1; - } - return v0 + alpha * (v1 - v0); - } + void drawbackground(int t); + void updatebackground(int t); +#ifndef NO_CUSTOM_LEVELS + bool shouldrecoloroneway(const int tilenum, const bool mounted); #endif - float alpha; + void drawtile3( int x, int y, int t, int off, int height_subtract = 0 ); + void drawtile2( int x, int y, int t ); + void drawtile( int x, int y, int t ); + void drawtowertile( int x, int y, int t ); + void drawtowertile3( int x, int y, int t, TowerBG& bg_obj ); - SDL_Color col_crewred; - SDL_Color col_crewyellow; - SDL_Color col_crewgreen; - SDL_Color col_crewcyan; - SDL_Color col_crewblue; - SDL_Color col_crewpurple; //actually pink - SDL_Color col_crewinactive; - SDL_Color col_clock; - SDL_Color col_trinket; - int col_tr; - int col_tg; - int col_tb; - void updatetitlecolours(void); + void drawmap(void); - bool kludgeswnlinewidth; + void drawforetile(int x, int y, int t); - SDL_Color crewcolourreal(int t); + void drawforetile2(int x, int y, int t); - void render_roomname(uint32_t font_flag, const char* roomname, int r, int g, int b); + void drawforetile3(int x, int y, int t, int off); - void print_roomtext(int x, int y, const char* text, bool rtl); + void drawrect(int x, int y, int w, int h, int r, int g, int b); + + void drawtowermap(void); + + void drawtowerspikes(void); + + bool onscreen(int t); + + bool reloadresources(void); +#ifndef NO_CUSTOM_LEVELS + bool tiles1_mounted; + bool tiles2_mounted; + bool minimap_mounted; +#endif + + + void menuoffrender(void); + + void drawtowerbackground(const TowerBG& bg_obj); + void updatetowerbackground(TowerBG& bg_obj); + + void setcol(int t); + void drawfinalmap(void); + + colourTransform ct; + + int rcol; + + + + int m; + + std::vector images; + + std::vector tele; + std::vector tiles; + std::vector tiles2; + std::vector tiles3; + std::vector entcolours; + std::vector sprites; + std::vector flipsprites; + std::vector bfont; + std::vector flipbfont; + + bool flipmode; + bool setflipmode; + bool notextoutline; + //buffer objects. //TODO refactor buffer objects + SDL_Surface* backBuffer; + Screen* screenbuffer; + SDL_Surface* menubuffer; + SDL_Surface* foregroundBuffer; + SDL_Surface* tempBuffer; + SDL_Surface* warpbuffer; + SDL_Surface* warpbuffer_lerp; + + TowerBG towerbg; + TowerBG titlebg; + + SDL_Rect bfont_rect; + SDL_Rect tiles_rect; + SDL_Rect sprites_rect; + SDL_Rect images_rect; + SDL_Rect bg_rect; + SDL_Rect line_rect; + SDL_Rect tele_rect; + SDL_Rect towerbuffer_rect; + + SDL_Rect foot_rect; + SDL_Rect prect; + SDL_Rect footerrect; + SDL_Surface* footerbuffer; + + int linestate, linedelay; + int backoffset; + bool backgrounddrawn, foregrounddrawn; + + int menuoffset; + int oldmenuoffset; + bool resumegamemode; + + SDL_Rect warprect; + + int crewframe; + int crewframedelay; + + int fademode; + int fadeamount; + int oldfadeamount; + int fadebars[15]; + int ingame_fademode; + + bool trinketcolset; + int trinketr, trinketg, trinketb; + + std::vector textbox; + + bool showcutscenebars; + int cutscenebarspos; + int oldcutscenebarspos; + + static const int numstars = 50; + SDL_Rect stars[numstars]; + int starsspeed[numstars]; + + static const int numbackboxes = 18; + int spcol, spcoldel; + SDL_Rect backboxes[numbackboxes]; + int backboxvx[numbackboxes]; + int backboxvy[numbackboxes]; + float backboxint[numbackboxes]; + + int warpskip, warpfcol, warpbcol; + + bool translucentroomname; + + std::map font_positions; + + SDL_Surface* ghostbuffer; + + float inline lerp(const float v0, const float v1) + { + return v0 + alpha * (v1 - v0); + } + float alpha; + + Uint32 col_crewred; + Uint32 col_crewyellow; + Uint32 col_crewgreen; + Uint32 col_crewcyan; + Uint32 col_crewblue; + Uint32 col_crewpurple; //actually pink + Uint32 col_crewinactive; + Uint32 col_clock; + Uint32 col_trinket; + int col_tr; + int col_tg; + int col_tb; + void updatetitlecolours(void); + + bool kludgeswnlinewidth; + + Uint32 crewcolourreal(int t); + + char error[128]; + char error_title[128]; /* for SDL_ShowSimpleMessageBox */ }; #ifndef GRAPHICS_DEFINITION diff --git a/desktop_version/src/GraphicsResources.cpp b/desktop_version/src/GraphicsResources.cpp index 8d13f8df..0b07cd3e 100644 --- a/desktop_version/src/GraphicsResources.cpp +++ b/desktop_version/src/GraphicsResources.cpp @@ -1,608 +1,147 @@ #include "GraphicsResources.h" -#include -#include +#include +#include -#include "Alloc.h" #include "FileSystemUtils.h" -#include "Graphics.h" -#include "GraphicsUtil.h" -#include "Localization.h" -#include "Vlogging.h" -#include "Screen.h" -#include "XMLUtils.h" // Used to load PNG data extern "C" { - extern unsigned lodepng_decode32( - unsigned char** out, - unsigned* w, - unsigned* h, - const unsigned char* in, - size_t insize - ); - extern unsigned lodepng_encode24( - unsigned char** out, - size_t* outsize, - const unsigned char* image, - unsigned w, - unsigned h - ); - extern const char* lodepng_error_text(unsigned code); + extern unsigned lodepng_decode24( + unsigned char** out, + unsigned* w, + unsigned* h, + const unsigned char* in, + size_t insize + ); + extern unsigned lodepng_decode32( + unsigned char** out, + unsigned* w, + unsigned* h, + const unsigned char* in, + size_t insize + ); } -static SDL_Surface* LoadImageRaw(const char* filename, unsigned char** data) +static SDL_Surface* LoadImage(const char *filename, bool noBlend = true, bool noAlpha = false) { - *data = NULL; + //Temporary storage for the image that's loaded + SDL_Surface* loadedImage = NULL; + //The optimized image that will be used + SDL_Surface* optimizedImage = NULL; - // Temporary storage for the image that's loaded - SDL_Surface* loadedImage = NULL; + unsigned char *data; + unsigned int width, height; - unsigned int width, height; - unsigned int error; + unsigned char *fileIn; + size_t length; + FILESYSTEM_loadAssetToMemory(filename, &fileIn, &length, false); + if (fileIn == NULL) + { + SDL_assert(0 && "Image file missing!"); + return NULL; + } + if (noAlpha) + { + lodepng_decode24(&data, &width, &height, fileIn, length); + } + else + { + lodepng_decode32(&data, &width, &height, fileIn, length); + } + FILESYSTEM_freeMemory(&fileIn); - unsigned char* fileIn; - size_t length; - FILESYSTEM_loadAssetToMemory(filename, &fileIn, &length); - if (fileIn == NULL) - { - SDL_assert(0 && "Image file missing!"); - return NULL; - } - error = lodepng_decode32(data, &width, &height, fileIn, length); - VVV_free(fileIn); + loadedImage = SDL_CreateRGBSurfaceFrom( + data, + width, + height, + noAlpha ? 24 : 32, + width * (noAlpha ? 3 : 4), + 0x000000FF, + 0x0000FF00, + 0x00FF0000, + noAlpha ? 0x00000000 : 0xFF000000 + ); - if (error != 0) - { - vlog_error("Could not load %s: %s", filename, lodepng_error_text(error)); - return NULL; - } - - loadedImage = SDL_CreateRGBSurfaceWithFormatFrom( - *data, - width, - height, - 32, - width * 4, -#if SDL_BYTEORDER == SDL_BIG_ENDIAN - SDL_PIXELFORMAT_RGBA8888 -#else - SDL_PIXELFORMAT_ABGR8888 -#endif - ); - - return loadedImage; -} - -static SDL_Surface* LoadSurfaceFromRaw(SDL_Surface* loadedImage) -{ - SDL_Surface* optimizedImage = SDL_ConvertSurfaceFormat( - loadedImage, - SDL_PIXELFORMAT_ARGB8888, - 0 - ); - SDL_SetSurfaceBlendMode(optimizedImage, SDL_BLENDMODE_BLEND); - return optimizedImage; -} - -SDL_Surface* LoadImageSurface(const char* filename) -{ - unsigned char* data; - - SDL_Surface* loadedImage = LoadImageRaw(filename, &data); - - SDL_Surface* optimizedImage = LoadSurfaceFromRaw(loadedImage); - if (loadedImage != NULL) - { - VVV_freefunc(SDL_FreeSurface, loadedImage); - } - - VVV_free(data); - - if (optimizedImage == NULL) - { - vlog_error("Image not found: %s", filename); - SDL_assert(0 && "Image not found! See stderr."); - } - - return optimizedImage; -} - -static SDL_Texture* LoadTextureFromRaw(const char* filename, SDL_Surface* loadedImage, const TextureLoadType loadtype) -{ - if (loadedImage == NULL) - { - return NULL; - } - - // Modify the surface with the load type. - // This could be done in LoadImageRaw, however currently, surfaces are only used for - // pixel perfect collision (which will be changed later) and the window icon. - - switch (loadtype) - { - case TEX_WHITE: - SDL_LockSurface(loadedImage); - for (int y = 0; y < loadedImage->h; y++) - { - for (int x = 0; x < loadedImage->w; x++) - { - SDL_Color color = ReadPixel(loadedImage, x, y); - color.r = 255; - color.g = 255; - color.b = 255; - DrawPixel(loadedImage, x, y, color); - } - } - SDL_UnlockSurface(loadedImage); - break; - case TEX_GRAYSCALE: - SDL_LockSurface(loadedImage); - for (int y = 0; y < loadedImage->h; y++) - { - for (int x = 0; x < loadedImage->w; x++) - { - SDL_Color color = ReadPixel(loadedImage, x, y); - - // Magic numbers used for grayscaling (eyes perceive certain colors brighter than others) - Uint8 r = color.r * 0.299; - Uint8 g = color.g * 0.587; - Uint8 b = color.b * 0.114; - - const double gray = SDL_floor(r + g + b + 0.5); - - color.r = gray; - color.g = gray; - color.b = gray; - - DrawPixel(loadedImage, x, y, color); - } - } - SDL_UnlockSurface(loadedImage); - break; - default: - break; - } - - //Create texture from surface pixels - SDL_Texture* texture = SDL_CreateTextureFromSurface(gameScreen.m_renderer, loadedImage); - if (texture == NULL) - { - vlog_error("Failed creating texture: %s. SDL error: %s\n", filename, SDL_GetError()); - } - - return texture; -} - -SDL_Texture* LoadImage(const char *filename, const TextureLoadType loadtype) -{ - unsigned char* data; - - SDL_Surface* loadedImage = LoadImageRaw(filename, &data); - - SDL_Texture* texture = LoadTextureFromRaw(filename, loadedImage, loadtype); - - if (loadedImage != NULL) - { - VVV_freefunc(SDL_FreeSurface, loadedImage); - } - - VVV_free(data); - - if (texture == NULL) - { - vlog_error("Image not found: %s", filename); - SDL_assert(0 && "Image not found! See stderr."); - } - - return texture; -} - -static SDL_Texture* LoadImage(const char* filename) -{ - return LoadImage(filename, TEX_COLOR); -} - -/* Any unneeded variants can be NULL */ -static void LoadVariants(const char* filename, SDL_Texture** colored, SDL_Texture** white, SDL_Texture** grayscale) -{ - unsigned char* data; - SDL_Surface* loadedImage = LoadImageRaw(filename, &data); - - if (colored != NULL) - { - *colored = LoadTextureFromRaw(filename, loadedImage, TEX_COLOR); - if (*colored == NULL) - { - vlog_error("Image not found: %s", filename); - SDL_assert(0 && "Image not found! See stderr."); - } - } - - if (grayscale != NULL) - { - *grayscale = LoadTextureFromRaw(filename, loadedImage, TEX_GRAYSCALE); - if (*grayscale == NULL) - { - vlog_error("Image not found: %s", filename); - SDL_assert(0 && "Image not found! See stderr."); - } - } - - if (white != NULL) - { - *white = LoadTextureFromRaw(filename, loadedImage, TEX_WHITE); - if (*white == NULL) - { - vlog_error("Image not found: %s", filename); - SDL_assert(0 && "Image not found! See stderr."); - } - } - - if (loadedImage != NULL) - { - VVV_freefunc(SDL_FreeSurface, loadedImage); - } - - VVV_free(data); -} - -/* The pointers `texture` and `surface` cannot be NULL */ -static void LoadSprites(const char* filename, SDL_Texture** texture, SDL_Surface** surface) -{ - unsigned char* data; - SDL_Surface* loadedImage = LoadImageRaw(filename, &data); - - *surface = LoadSurfaceFromRaw(loadedImage); - if (*surface == NULL) - { - vlog_error("Image not found: %s", filename); - SDL_assert(0 && "Image not found! See stderr."); - } - - *texture = LoadTextureFromRaw(filename, loadedImage, TEX_WHITE); - if (*texture == NULL) - { - vlog_error("Image not found: %s", filename); - SDL_assert(0 && "Image not found! See stderr."); - } - - if (loadedImage != NULL) - { - VVV_freefunc(SDL_FreeSurface, loadedImage); - } - - VVV_free(data); -} - -static void LoadSpritesTranslation( - const char* filename, - tinyxml2::XMLDocument* mask, - SDL_Surface* surface_english, - SDL_Texture** texture -) { - /* Create a sprites texture for display in another language. - * surface_english is used as a base. Parts of the translation (filename) - * will replace parts of the base, as instructed in the mask XML. */ - - if (surface_english == NULL) - { - vlog_error("LoadSpritesTranslation: English surface is NULL!"); - return; - } - - // Make a copy of the English sprites, for working with - SDL_Surface* working = GetSubSurface( - surface_english, - 0, 0, surface_english->w, surface_english->h - ); - if (working == NULL) - { - return; - } - - SDL_Surface* translated; - { - unsigned char* data; - SDL_Surface* loaded_image = LoadImageRaw(filename, &data); - translated = LoadSurfaceFromRaw(loaded_image); - - VVV_freefunc(SDL_FreeSurface, loaded_image); - VVV_free(data); - } - SDL_SetSurfaceBlendMode(translated, SDL_BLENDMODE_NONE); - - tinyxml2::XMLHandle hMask(mask); - tinyxml2::XMLElement* pElem; - - int sprite_w = 1, sprite_h = 1; - if ((pElem = mask->FirstChildElement()) != NULL) - { - sprite_w = pElem->IntAttribute("sprite_w", 1); - sprite_h = pElem->IntAttribute("sprite_h", 1); - } - - FOR_EACH_XML_ELEMENT(hMask, pElem) - { - EXPECT_ELEM(pElem, "sprite"); - - int x = pElem->IntAttribute("x", 0); - int y = pElem->IntAttribute("y", 0); - SDL_Rect src; - src.x = x * sprite_w; - src.y = y * sprite_h; - src.w = pElem->IntAttribute("w", 1) * sprite_w; - src.h = pElem->IntAttribute("h", 1) * sprite_h; - - SDL_Rect dst; - dst.x = pElem->IntAttribute("dx", x) * sprite_w; - dst.y = pElem->IntAttribute("dy", y) * sprite_h; - - SDL_BlitSurface(translated, &src, working, &dst); - } - - *texture = LoadTextureFromRaw(filename, working, TEX_WHITE); - - VVV_freefunc(SDL_FreeSurface, translated); - VVV_freefunc(SDL_FreeSurface, working); -} - -void GraphicsResources::init_translations(void) -{ - VVV_freefunc(SDL_DestroyTexture, im_sprites_translated); - VVV_freefunc(SDL_DestroyTexture, im_flipsprites_translated); - - if (loc::english_sprites) - { - return; - } - - const char* langcode = loc::lang.c_str(); - - const char* path_template = "lang/%s/graphics/%s"; - char path_xml[256]; - char path_sprites[256]; - char path_flipsprites[256]; - SDL_snprintf(path_xml, sizeof(path_xml), path_template, langcode, "spritesmask.xml"); - SDL_snprintf(path_sprites, sizeof(path_sprites), path_template, langcode, "sprites.png"); - SDL_snprintf(path_flipsprites, sizeof(path_flipsprites), path_template, langcode, "flipsprites.png"); - - /* We don't want to apply main-game translations to level-specific (custom) sprites. - * Either sprites and translations are BOTH main-game, or BOTH level-specific. - * Our pivots are the XML (it _has_ to exist for translated sprites to work) and - * graphics/sprites.png (what sense does it make to have only flipsprites). */ - if (FILESYSTEM_isAssetMounted(path_xml) != FILESYSTEM_isAssetMounted("graphics/sprites.png")) - { - return; - } - - tinyxml2::XMLDocument doc_mask; - if (!FILESYSTEM_loadAssetTiXml2Document(path_xml, doc_mask)) - { - // Only try to load the images if the XML document exists - return; - } - - if (FILESYSTEM_areAssetsInSameRealDir(path_xml, path_sprites)) - { - LoadSpritesTranslation( - path_sprites, - &doc_mask, - im_sprites_surf, - &im_sprites_translated - ); - } - if (FILESYSTEM_areAssetsInSameRealDir(path_xml, path_flipsprites)) - { - LoadSpritesTranslation( - path_flipsprites, - &doc_mask, - im_flipsprites_surf, - &im_flipsprites_translated - ); - } + if (loadedImage != NULL) + { + optimizedImage = SDL_ConvertSurfaceFormat( + loadedImage, + SDL_PIXELFORMAT_ABGR8888, // FIXME: Format? -flibit + 0 + ); + SDL_FreeSurface( loadedImage ); + SDL_free(data); + if (noBlend) + { + SDL_SetSurfaceBlendMode(optimizedImage, SDL_BLENDMODE_BLEND); + } + return optimizedImage; + } + else + { + SDL_free(data); + fprintf(stderr,"Image not found: %s\n", filename); + SDL_assert(0 && "Image not found! See stderr."); + return NULL; + } } void GraphicsResources::init(void) { - LoadVariants("graphics/tiles.png", &im_tiles, &im_tiles_white, &im_tiles_tint); - LoadVariants("graphics/tiles2.png", &im_tiles2, NULL, &im_tiles2_tint); - LoadVariants("graphics/entcolours.png", &im_entcolours, NULL, &im_entcolours_tint); + im_tiles = LoadImage("graphics/tiles.png"); + im_tiles2 = LoadImage("graphics/tiles2.png"); + im_tiles3 = LoadImage("graphics/tiles3.png"); + im_entcolours = LoadImage("graphics/entcolours.png"); + im_sprites = LoadImage("graphics/sprites.png"); + im_flipsprites = LoadImage("graphics/flipsprites.png"); + im_bfont = LoadImage("graphics/font.png"); + im_teleporter = LoadImage("graphics/teleporter.png"); - LoadSprites("graphics/sprites.png", &im_sprites, &im_sprites_surf); - LoadSprites("graphics/flipsprites.png", &im_flipsprites, &im_flipsprites_surf); - - im_tiles3 = LoadImage("graphics/tiles3.png"); - im_teleporter = LoadImage("graphics/teleporter.png", TEX_WHITE); - - im_image0 = LoadImage("graphics/levelcomplete.png"); - im_image1 = LoadImage("graphics/minimap.png"); - im_image2 = LoadImage("graphics/covered.png"); - im_image3 = LoadImage("graphics/elephant.png", TEX_WHITE); - im_image4 = LoadImage("graphics/gamecomplete.png"); - im_image5 = LoadImage("graphics/fliplevelcomplete.png"); - im_image6 = LoadImage("graphics/flipgamecomplete.png"); - im_image7 = LoadImage("graphics/site.png", TEX_WHITE); - im_image8 = LoadImage("graphics/site2.png", TEX_WHITE); - im_image9 = LoadImage("graphics/site3.png", TEX_WHITE); - im_image10 = LoadImage("graphics/ending.png"); - im_image11 = LoadImage("graphics/site4.png", TEX_WHITE); - - im_sprites_translated = NULL; - im_flipsprites_translated = NULL; - - init_translations(); - - im_image12 = SDL_CreateTexture(gameScreen.m_renderer, SDL_PIXELFORMAT_ARGB8888, SDL_TEXTUREACCESS_TARGET, 240, 180); - - if (im_image12 == NULL) - { - vlog_error("Failed to create minimap texture: %s", SDL_GetError()); - SDL_assert(0 && "Failed to create minimap texture! See stderr."); - return; - } - - SDL_zeroa(graphics.customminimaps); - - EnumHandle handle = {}; - const char* item; - char full_item[64]; - while ((item = FILESYSTEM_enumerateAssets("graphics", &handle)) != NULL) - { - if (SDL_strncmp(item, "region", 6) != 0) - { - continue; - } - char* end; - int i = SDL_strtol(&item[6], &end, 10); - // make sure the region id is actually in bounds! - if (i < 1 || i > 400) - { - continue; - } - if (item == end || SDL_strcmp(end, ".png") != 0) - { - continue; - } - SDL_snprintf(full_item, sizeof(full_item), "graphics/%s", item); - graphics.customminimaps[i] = LoadImage(full_item); - } - FILESYSTEM_freeEnumerate(&handle); + im_image0 = LoadImage("graphics/levelcomplete.png", false); + im_image1 = LoadImage("graphics/minimap.png", true, true); + im_image2 = LoadImage("graphics/covered.png", true, true); + im_image3 = LoadImage("graphics/elephant.png"); + im_image4 = LoadImage("graphics/gamecomplete.png", false); + im_image5 = LoadImage("graphics/fliplevelcomplete.png", false); + im_image6 = LoadImage("graphics/flipgamecomplete.png", false); + im_image7 = LoadImage("graphics/site.png", false); + im_image8 = LoadImage("graphics/site2.png"); + im_image9 = LoadImage("graphics/site3.png"); + im_image10 = LoadImage("graphics/ending.png"); + im_image11 = LoadImage("graphics/site4.png"); + im_image12 = LoadImage("graphics/minimap.png"); } void GraphicsResources::destroy(void) { -#define CLEAR(img) VVV_freefunc(SDL_DestroyTexture, img) - CLEAR(im_tiles); - CLEAR(im_tiles_white); - CLEAR(im_tiles_tint); - CLEAR(im_tiles2); - CLEAR(im_tiles2_tint); - CLEAR(im_tiles3); - CLEAR(im_entcolours); - CLEAR(im_entcolours_tint); - CLEAR(im_sprites); - CLEAR(im_flipsprites); - CLEAR(im_teleporter); +#define CLEAR(img) \ + SDL_FreeSurface(img); \ + img = NULL; - CLEAR(im_image0); - CLEAR(im_image1); - CLEAR(im_image2); - CLEAR(im_image3); - CLEAR(im_image4); - CLEAR(im_image5); - CLEAR(im_image6); - CLEAR(im_image7); - CLEAR(im_image8); - CLEAR(im_image9); - CLEAR(im_image10); - CLEAR(im_image11); - CLEAR(im_image12); + CLEAR(im_tiles); + CLEAR(im_tiles2); + CLEAR(im_tiles3); + CLEAR(im_entcolours); + CLEAR(im_sprites); + CLEAR(im_flipsprites); + CLEAR(im_bfont); + CLEAR(im_teleporter); - CLEAR(im_sprites_translated); - CLEAR(im_flipsprites_translated); - - for (size_t i = 0; i < SDL_arraysize(graphics.customminimaps); i++) - { - CLEAR(graphics.customminimaps[i]); - } + CLEAR(im_image0); + CLEAR(im_image1); + CLEAR(im_image2); + CLEAR(im_image3); + CLEAR(im_image4); + CLEAR(im_image5); + CLEAR(im_image6); + CLEAR(im_image7); + CLEAR(im_image8); + CLEAR(im_image9); + CLEAR(im_image10); + CLEAR(im_image11); + CLEAR(im_image12); #undef CLEAR - - VVV_freefunc(SDL_FreeSurface, im_sprites_surf); - VVV_freefunc(SDL_FreeSurface, im_flipsprites_surf); -} - -bool SaveImage(const SDL_Surface* surface, const char* filename) -{ - unsigned char* out; - size_t outsize; - unsigned int error; - bool success; - - error = lodepng_encode24( - &out, &outsize, - (const unsigned char*) surface->pixels, - surface->w, surface->h - ); - - if (error != 0) - { - vlog_error("Could not save image: %s", lodepng_error_text(error)); - return false; - } - - success = FILESYSTEM_saveFile(filename, out, outsize); - SDL_free(out); - - if (!success) - { - vlog_error("Could not save image"); - } - - return success; -} - -bool SaveScreenshot(void) -{ - static time_t last_time = 0; - static int subsecond_counter = 0; - - bool success = TakeScreenshot(&graphics.tempScreenshot); - if (!success) - { - vlog_error("Could not take screenshot"); - return false; - } - - const time_t now = time(NULL); - const tm* date = localtime(&now); - - if (now != last_time) - { - last_time = now; - subsecond_counter = 0; - } - subsecond_counter++; - - char timestamp[32]; - strftime(timestamp, sizeof(timestamp), "%Y-%m-%d_%H-%M-%S", date); - - char name[32]; - if (subsecond_counter > 1) - { - SDL_snprintf(name, sizeof(name), "%s_%i", timestamp, subsecond_counter); - } - else - { - SDL_strlcpy(name, timestamp, sizeof(name)); - } - - char filename[64]; - SDL_snprintf(filename, sizeof(filename), "screenshots/1x/%s_1x.png", name); - - success = SaveImage(graphics.tempScreenshot, filename); - if (!success) - { - return false; - } - - success = UpscaleScreenshot2x(graphics.tempScreenshot, &graphics.tempScreenshot2x); - if (!success) - { - vlog_error("Could not upscale screenshot to 2x"); - return false; - } - - SDL_snprintf(filename, sizeof(filename), "screenshots/2x/%s_2x.png", name); - - success = SaveImage(graphics.tempScreenshot2x, filename); - if (!success) - { - return false; - } - - vlog_info("Saved screenshot %s", name); - return true; } diff --git a/desktop_version/src/GraphicsResources.h b/desktop_version/src/GraphicsResources.h index f7973c68..9a46706a 100644 --- a/desktop_version/src/GraphicsResources.h +++ b/desktop_version/src/GraphicsResources.h @@ -3,57 +3,33 @@ #include -enum TextureLoadType -{ - TEX_COLOR, - TEX_WHITE, - TEX_GRAYSCALE -}; - class GraphicsResources { public: void init(void); void destroy(void); - void init_translations(void); - - SDL_Surface* im_sprites_surf; - SDL_Surface* im_flipsprites_surf; - - SDL_Texture* im_tiles; - SDL_Texture* im_tiles_white; - SDL_Texture* im_tiles_tint; - SDL_Texture* im_tiles2; - SDL_Texture* im_tiles2_tint; - SDL_Texture* im_tiles3; - SDL_Texture* im_entcolours; - SDL_Texture* im_entcolours_tint; - SDL_Texture* im_sprites; - SDL_Texture* im_flipsprites; - SDL_Texture* im_teleporter; - SDL_Texture* im_image0; - SDL_Texture* im_image1; - SDL_Texture* im_image2; - SDL_Texture* im_image3; - SDL_Texture* im_image4; - SDL_Texture* im_image5; - SDL_Texture* im_image6; - SDL_Texture* im_image7; - SDL_Texture* im_image8; - SDL_Texture* im_image9; - SDL_Texture* im_image10; - SDL_Texture* im_image11; - SDL_Texture* im_image12; - - SDL_Texture* im_sprites_translated; - SDL_Texture* im_flipsprites_translated; + SDL_Surface* im_tiles; + SDL_Surface* im_tiles2; + SDL_Surface* im_tiles3; + SDL_Surface* im_entcolours; + SDL_Surface* im_sprites; + SDL_Surface* im_flipsprites; + SDL_Surface* im_bfont; + SDL_Surface* im_teleporter; + SDL_Surface* im_image0; + SDL_Surface* im_image1; + SDL_Surface* im_image2; + SDL_Surface* im_image3; + SDL_Surface* im_image4; + SDL_Surface* im_image5; + SDL_Surface* im_image6; + SDL_Surface* im_image7; + SDL_Surface* im_image8; + SDL_Surface* im_image9; + SDL_Surface* im_image10; + SDL_Surface* im_image11; + SDL_Surface* im_image12; }; -SDL_Surface* LoadImageSurface(const char* filename); -SDL_Texture* LoadImage(const char *filename, TextureLoadType loadtype); - -bool SaveImage(const SDL_Surface* surface, const char* filename); -bool SaveScreenshot(void); - #endif /* GRAPHICSRESOURCES_H */ diff --git a/desktop_version/src/GraphicsUtil.cpp b/desktop_version/src/GraphicsUtil.cpp index 33ffb256..3bdaadfd 100644 --- a/desktop_version/src/GraphicsUtil.cpp +++ b/desktop_version/src/GraphicsUtil.cpp @@ -1,14 +1,11 @@ +#include "GraphicsUtil.h" + #include #include #include -#include "Alloc.h" -#include "Constants.h" #include "Graphics.h" #include "Maths.h" -#include "Screen.h" -#include "UtilityClass.h" -#include "Vlogging.h" @@ -56,6 +53,20 @@ static SDL_Surface* RecreateSurfaceWithDimensions( return retval; } +static SDL_Surface* RecreateSurface(SDL_Surface* surface) +{ + if (surface == NULL) + { + return NULL; + } + + return RecreateSurfaceWithDimensions( + surface, + surface->w, + surface->h + ); +} + SDL_Surface* GetSubSurface( SDL_Surface* metaSurface, int x, int y, int width, int height ) { // Create an SDL_Rect with the area of the _surface @@ -79,92 +90,216 @@ SDL_Surface* GetSubSurface( SDL_Surface* metaSurface, int x, int y, int width, i return preSurface; } -void DrawPixel(SDL_Surface* surface, const int x, const int y, const SDL_Color color) +static void DrawPixel( SDL_Surface *_surface, int x, int y, Uint32 pixel ) { - const SDL_Point point = {x, y}; - const SDL_Rect rect = {0, 0, surface->w, surface->h}; - const bool inbounds = SDL_PointInRect(&point, &rect); - if (!inbounds) - { - WHINE_ONCE_ARGS(( - "Pixel draw is not inbounds: " - "Attempted to draw to %i,%i in %ix%i surface", - x, y, surface->w, surface->h - )); - SDL_assert(0 && "Pixel draw is not inbounds!"); - return; - } + int bpp = _surface->format->BytesPerPixel; + /* Here p is the address to the pixel we want to set */ + Uint8 *p = (Uint8 *)_surface->pixels + y * _surface->pitch + x * bpp; - const SDL_PixelFormat* fmt = surface->format; - const int bpp = fmt->BytesPerPixel; - Uint8* pixel = (Uint8*) surface->pixels + y * surface->pitch + x * bpp; - Uint32* pixel32 = (Uint32*) pixel; - - switch (bpp) + switch(bpp) { case 1: + *p = pixel; + break; + case 2: - SDL_assert(0 && "Colors other than 24- or 32- bit unsupported!"); + *(Uint16 *)p = pixel; break; case 3: - { - const Uint32 single = SDL_MapRGB(fmt, color.r, color.g, color.b); - pixel[0] = (single & 0xFF0000) >> 16; - pixel[1] = (single & 0x00FF00) >> 8; - pixel[2] = (single & 0x0000FF) >> 0; + p[0] = (pixel >> 16) & 0xff; + p[1] = (pixel >> 8) & 0xff; + p[2] = pixel & 0xff; break; - } case 4: - *pixel32 = SDL_MapRGBA(fmt, color.r, color.g, color.b, color.a); + *(Uint32 *)p = pixel; + break; } } -SDL_Color ReadPixel(const SDL_Surface* surface, const int x, const int y) +Uint32 ReadPixel( SDL_Surface *_surface, int x, int y ) { - SDL_Color color = {0, 0, 0, 0}; - const SDL_Point point = {x, y}; - const SDL_Rect rect = {0, 0, surface->w, surface->h}; - const bool inbounds = SDL_PointInRect(&point, &rect); - if (!inbounds) - { - WHINE_ONCE_ARGS(( - "Pixel read is not inbounds: " - "Attempted to read %i,%i in %ix%i surface", - x, y, surface->w, surface->h - )); - SDL_assert(0 && "Pixel read is not inbounds!"); - return color; - } + int bpp = _surface->format->BytesPerPixel; + /* Here p is the address to the pixel we want to retrieve */ + Uint8 *p = (Uint8 *)_surface->pixels + y * _surface->pitch + x * bpp; - const SDL_PixelFormat* fmt = surface->format; - const int bpp = surface->format->BytesPerPixel; - const Uint8* pixel = (Uint8*) surface->pixels + y * surface->pitch + x * bpp; - const Uint32* pixel32 = (Uint32*) pixel; - - switch (bpp) + switch(bpp) { case 1: + return *p; + break; + case 2: - SDL_assert(0 && "Colors other than 24- or 32- bit unsupported!"); + return *(Uint16 *)p; break; case 3: - { - const Uint32 single = (pixel[0] << 16) | (pixel[1] << 8) | (pixel[2] << 0); - SDL_GetRGB(single, fmt, &color.r, &color.g, &color.b); - color.a = 255; - break; - } + return p[0] | p[1] << 8 | p[2] << 16; case 4: - SDL_GetRGBA(*pixel32, fmt, &color.r, &color.g, &color.b, &color.a); + return *(Uint32 *)p; + break; + + default: + return 0; /* shouldn't happen, but avoids warnings */ + } +} + +SDL_Surface * ScaleSurface( SDL_Surface *_surface, int Width, int Height, SDL_Surface * Dest ) +{ + if(!_surface || !Width || !Height) + return 0; + + SDL_Surface *_ret; + if(Dest == NULL) + { + _ret = RecreateSurfaceWithDimensions(_surface, Width, Height); + if(_ret == NULL) + { + return NULL; + } + + } + else + { + _ret = Dest; } - return color; + float _stretch_factor_x = (static_cast(Width) / static_cast(_surface->w)), _stretch_factor_y = (static_cast(Height) / static_cast(_surface->h)); + + + SDL_Rect gigantoPixel; + for(Sint32 y = 0; y < _surface->h; y++) + for(Sint32 x = 0; x < _surface->w; x++) + { + setRect(gigantoPixel, static_cast(float(x)*_stretch_factor_x), static_cast(float(y) *_stretch_factor_y), static_cast(_stretch_factor_x),static_cast( _stretch_factor_y)) ; + SDL_FillRect(_ret, &gigantoPixel, ReadPixel(_surface, x, y)); + } + + return _ret; } +SDL_Surface * FlipSurfaceVerticle(SDL_Surface* _src) +{ + SDL_Surface * ret = RecreateSurface(_src); + if(ret == NULL) + { + return NULL; + } + + for(Sint32 y = 0; y < _src->h; y++) + { + for(Sint32 x = 0; x < _src->w; x++) + { + DrawPixel(ret, x ,(_src->h-1) - y ,ReadPixel(_src, x, y)); + } + + + } + + return ret; +} + +void BlitSurfaceStandard( SDL_Surface* _src, SDL_Rect* _srcRect, SDL_Surface* _dest, SDL_Rect* _destRect ) +{ + SDL_BlitSurface( _src, _srcRect, _dest, _destRect ); +} + +void BlitSurfaceColoured( + SDL_Surface* _src, + SDL_Rect* _srcRect, + SDL_Surface* _dest, + SDL_Rect* _destRect, + colourTransform& ct +) { + SDL_Rect *tempRect = _destRect; + + const SDL_PixelFormat& fmt = *(_src->format); + + SDL_Surface* tempsurface = RecreateSurface(_src); + + for(int x = 0; x < tempsurface->w; x++) + { + for(int y = 0; y < tempsurface->h; y++) + { + Uint32 pixel = ReadPixel(_src, x, y); + Uint32 Alpha = pixel & fmt.Amask; + Uint32 result = ct.colour & 0x00FFFFFF; + Uint32 CTAlpha = ct.colour & fmt.Amask; + float div1 = ((Alpha >> 24) / 255.0f); + float div2 = ((CTAlpha >> 24) / 255.0f); + Uint32 UseAlpha = (div1 * div2) * 255.0f; + DrawPixel(tempsurface, x, y, result | (UseAlpha << 24)); + } + } + + SDL_BlitSurface(tempsurface, _srcRect, _dest, tempRect); + SDL_FreeSurface(tempsurface); +} + +void BlitSurfaceTinted( + SDL_Surface* _src, + SDL_Rect* _srcRect, + SDL_Surface* _dest, + SDL_Rect* _destRect, + colourTransform& ct +) { + SDL_Rect *tempRect = _destRect; + + const SDL_PixelFormat& fmt = *(_src->format); + + SDL_Surface* tempsurface = RecreateSurface(_src); + + for (int x = 0; x < tempsurface->w; x++) { + for (int y = 0; y < tempsurface->h; y++) { + Uint32 pixel = ReadPixel(_src, x, y); + + Uint8 pixred = (pixel & _src->format->Rmask) >> 16; + Uint8 pixgreen = (pixel & _src->format->Gmask) >> 8; + Uint8 pixblue = (pixel & _src->format->Bmask) >> 0; + + double temp_pixred = pixred * 0.299; + double temp_pixgreen = pixgreen * 0.587; + double temp_pixblue = pixblue * 0.114; + + double gray = SDL_floor((temp_pixred + temp_pixgreen + temp_pixblue + 0.5)); + + Uint8 ctred = (ct.colour & graphics.backBuffer->format->Rmask) >> 16; + Uint8 ctgreen = (ct.colour & graphics.backBuffer->format->Gmask) >> 8; + Uint8 ctblue = (ct.colour & graphics.backBuffer->format->Bmask) >> 0; + + temp_pixred = gray * ctred / 255.0; + temp_pixgreen = gray * ctgreen / 255.0; + temp_pixblue = gray * ctblue / 255.0; + + if (temp_pixred > 255) + temp_pixred = 255; + if (temp_pixgreen > 255) + temp_pixgreen = 255; + if (temp_pixblue > 255) + temp_pixblue = 255; + + pixred = temp_pixred; + pixgreen = temp_pixgreen; + pixblue = temp_pixblue; + + Uint32 Alpha = pixel & fmt.Amask; + Uint32 result = (pixred << 16) + (pixgreen << 8) + (pixblue << 0); + Uint32 CTAlpha = ct.colour & fmt.Amask; + float div1 = ((Alpha >> 24) / 255.0f); + float div2 = ((CTAlpha >> 24) / 255.0f); + Uint32 UseAlpha = (div1 * div2) * 255.0f; + + DrawPixel(tempsurface, x, y, result | (UseAlpha << 24)); + } + } + + SDL_BlitSurface(tempsurface, _srcRect, _dest, tempRect); + SDL_FreeSurface(tempsurface); +} + + static int oldscrollamount = 0; static int scrollamount = 0; static bool isscrolling = 0; @@ -189,206 +324,177 @@ void UpdateFilter(void) } } -static bool disabled_filter = false; - -void ApplyFilter(SDL_Surface** src, SDL_Surface** dest) +SDL_Surface* ApplyFilter( SDL_Surface* _src ) { - if (disabled_filter) - { - return; - } + SDL_Surface* _ret = RecreateSurface(_src); - if (src == NULL || dest == NULL) - { - SDL_assert(0 && "NULL src or dest!"); - return; - } + int redOffset = rand() % 4; - if (*src == NULL) + for(int x = 0; x < _src->w; x++) { - *src = SDL_CreateRGBSurface(0, SCREEN_WIDTH_PIXELS, SCREEN_HEIGHT_PIXELS, 32, 0, 0, 0, 0); - } - if (*dest == NULL) - { - *dest = SDL_CreateRGBSurface(0, SCREEN_WIDTH_PIXELS, SCREEN_HEIGHT_PIXELS, 32, 0, 0, 0, 0); - } - if (*src == NULL || *dest == NULL) - { - WHINE_ONCE_ARGS(("Could not create temporary surfaces: %s", SDL_GetError())); - return; - } - - const int result = SDL_RenderReadPixels(gameScreen.m_renderer, NULL, 0, (*src)->pixels, (*src)->pitch); - if (result != 0) - { - disabled_filter = true; - VVV_freefunc(SDL_FreeSurface, *src); - VVV_freefunc(SDL_FreeSurface, *dest); - WHINE_ONCE_ARGS(("Could not read pixels from renderer: %s", SDL_GetError())); - return; - } - - const int red_offset = rand() % 4; - - for (int x = 0; x < (*src)->w; x++) - { - for (int y = 0; y < (*src)->h; y++) + for(int y = 0; y < _src->h; y++) { - const int sampley = (y + (int) graphics.lerp(oldscrollamount, scrollamount)) % 240; + int sampley = (y + (int) graphics.lerp(oldscrollamount, scrollamount) )% 240; - const SDL_Color pixel = ReadPixel(*src, x, sampley); + Uint32 pixel = ReadPixel(_src, x,sampley); - Uint8 green = pixel.g; - Uint8 blue = pixel.b; + Uint8 green = (pixel & _src->format->Gmask) >> 8; + Uint8 blue = (pixel & _src->format->Bmask) >> 0; - const SDL_Color pixel_offset = ReadPixel(*src, SDL_min(x + red_offset, 319), sampley); - Uint8 red = pixel_offset.r; + Uint32 pixelOffset = ReadPixel(_src, VVV_min(x+redOffset, 319), sampley) ; + Uint8 red = (pixelOffset & _src->format->Rmask) >> 16 ; - double mult; - int tmp; /* needed to avoid char overflow */ - if (isscrolling && sampley > 220 && ((rand() % 10) < 4)) + if(isscrolling && sampley > 220 && ((rand() %10) < 4)) { - mult = 0.6; + red = VVV_min(int(red+(fRandom() * 0.6) * 254) , 255); + green = VVV_min(int(green+(fRandom() * 0.6) * 254) , 255); + blue = VVV_min(int(blue+(fRandom() * 0.6) * 254) , 255); } else { - mult = 0.2; + red = VVV_min(int(red+(fRandom() * 0.2) * 254) , 255); + green = VVV_min(int(green+(fRandom() * 0.2) * 254) , 255); + blue = VVV_min(int(blue+(fRandom() * 0.2) * 254) , 255); } - tmp = red + fRandom() * mult * 254; - red = SDL_min(tmp, 255); - tmp = green + fRandom() * mult * 254; - green = SDL_min(tmp, 255); - tmp = blue + fRandom() * mult * 254; - blue = SDL_min(tmp, 255); - if (y % 2 == 0) + if(y % 2 == 0) { - red = (Uint8) (red / 1.2f); - green = (Uint8) (green / 1.2f); - blue = (Uint8) (blue / 1.2f); + red = static_cast(red / 1.2f); + green = static_cast(green / 1.2f); + blue = static_cast(blue / 1.2f); } - int distX = (int) ((SDL_abs(160.0f - x) / 160.0f) * 16); - int distY = (int) ((SDL_abs(120.0f - y) / 120.0f) * 32); + int distX = static_cast((SDL_abs (160.0f -x ) / 160.0f) *16); + int distY = static_cast((SDL_abs (120.0f -y ) / 120.0f)*32); - red = SDL_max(red - (distX + distY), 0); - green = SDL_max(green - (distX + distY), 0); - blue = SDL_max(blue - (distX + distY), 0); + red = VVV_max(red - ( distX +distY), 0); + green = VVV_max(green - ( distX +distY), 0); + blue = VVV_max(blue - ( distX +distY), 0); + + Uint32 finalPixel = ((red<<16) + (green<<8) + (blue<<0)) | (pixel &_src->format->Amask); + DrawPixel(_ret,x,y, finalPixel); - const SDL_Color color = {red, green, blue, pixel.a}; - DrawPixel(*dest, x, y, color); } } - - SDL_UpdateTexture(graphics.gameTexture, NULL, (*dest)->pixels, (*dest)->pitch); + return _ret; } -bool TakeScreenshot(SDL_Surface** surface) +void FillRect( SDL_Surface* _surface, const int _x, const int _y, const int _w, const int _h, const int r, int g, int b ) { - if (surface == NULL) - { - SDL_assert(0 && "surface is NULL!"); - return false; - } - - int width = 0; - int height = 0; - int result = graphics.query_texture( - graphics.gameTexture, NULL, NULL, &width, &height - ); - if (result != 0) - { - return false; - } - - if (*surface == NULL) - { - *surface = SDL_CreateRGBSurface(0, width, height, 24, 0, 0, 0, 0); - if (*surface == NULL) - { - WHINE_ONCE_ARGS( - ("Could not create temporary surface: %s", SDL_GetError()) - ); - return false; - } - } - - if ((*surface)->w != width || (*surface)->h != height) - { - SDL_assert(0 && "Width and height of surface and texture mismatch!"); - return false; - } - - result = graphics.set_render_target(graphics.gameTexture); - if (result != 0) - { - return false; - } - - result = SDL_RenderReadPixels( - gameScreen.m_renderer, NULL, SDL_PIXELFORMAT_RGB24, - (*surface)->pixels, (*surface)->pitch - ); - if (result != 0) - { - WHINE_ONCE_ARGS( - ("Could not read pixels from renderer: %s", SDL_GetError()) - ); - return false; - } - - /* Need to manually vertically reverse pixels in Flip Mode. */ - if (graphics.flipmode) - { - for (int x = 0; x < (*surface)->w; x++) - { - for (int y = 0; y < (*surface)->h / 2; y++) - { - const SDL_Color upper = ReadPixel(*surface, x, y); - const SDL_Color lower = ReadPixel(*surface, x, (*surface)->h - 1 - y); - DrawPixel(*surface, x, y, lower); - DrawPixel(*surface, x, (*surface)->h - 1 - y, upper); - } - } - } - - return true; + SDL_Rect rect = {_x, _y, _w, _h}; + Uint32 color = SDL_MapRGB(_surface->format, r, g, b); + SDL_FillRect(_surface, &rect, color); } -bool UpscaleScreenshot2x(SDL_Surface* src, SDL_Surface** dest) +void FillRect( SDL_Surface* _surface, const int r, int g, int b ) { - if (src == NULL) - { - SDL_assert(0 && "src is NULL!"); - return false; - } - if (dest == NULL) - { - SDL_assert(0 && "dest is NULL!"); - return false; - } - - if (*dest == NULL) - { - *dest = SDL_CreateRGBSurface( - 0, src->w * 2, src->h * 2, src->format->BitsPerPixel, 0, 0, 0, 0 - ); - if (*dest == NULL) - { - WHINE_ONCE_ARGS( - ("Could not create temporary surface: %s", SDL_GetError()) - ); - return false; - } - } - - int result = SDL_BlitScaled(src, NULL, *dest, NULL); - if (result != 0) - { - WHINE_ONCE_ARGS(("Could not blit surface: %s", SDL_GetError())); - return false; - } - - return true; + Uint32 color = SDL_MapRGB(_surface->format, r, g, b); + SDL_FillRect(_surface, NULL, color); +} + +void FillRect( SDL_Surface* _surface, const int color ) +{ + SDL_FillRect(_surface, NULL, color); +} + +void FillRect( SDL_Surface* _surface, const int x, const int y, const int w, const int h, int rgba ) +{ + SDL_Rect rect = {x, y, w, h}; + SDL_FillRect(_surface, &rect, rgba); +} + +void FillRect( SDL_Surface* _surface, SDL_Rect& _rect, const int r, int g, int b ) +{ + Uint32 color = SDL_MapRGB(_surface->format, r, g, b); + SDL_FillRect(_surface, &_rect, color); +} + +void FillRect( SDL_Surface* _surface, SDL_Rect rect, int rgba ) +{ + SDL_FillRect(_surface, &rect, rgba); +} + +void ClearSurface(SDL_Surface* surface) +{ + SDL_FillRect(surface, NULL, 0x00000000); +} + +void ScrollSurface( SDL_Surface* _src, int _pX, int _pY ) +{ + SDL_Surface* part1 = NULL; + + SDL_Rect rect1; + SDL_Rect rect2; + //scrolling up; + if(_pY < 0) + { + setRect(rect2, 0, 0, _src->w, _src->h - _pY); + + part1 = GetSubSurface(_src, rect2.x, rect2.y, rect2.w, rect2.h); + + SDL_Rect destrect1; + + SDL_SetSurfaceBlendMode(part1, SDL_BLENDMODE_NONE); + + setRect(destrect1, 0, _pY, _pX, _src->h); + + SDL_BlitSurface (part1, NULL, _src, &destrect1); + } + + else if(_pY > 0) + { + + setRect(rect1, 0, 0, _src->w, _src->h - _pY); + + part1 = GetSubSurface(_src, rect1.x, rect1.y, rect1.w, rect1.h); + + SDL_Rect destrect1; + + SDL_SetSurfaceBlendMode(part1, SDL_BLENDMODE_NONE); + + setRect(destrect1, _pX, _pY, _src->w, _src->h - _pY); + + SDL_BlitSurface (part1, NULL, _src, &destrect1); + + } + + //Right + else if(_pX <= 0) + { + setRect(rect2, 0, 0, _src->w - _pX, _src->h ); + + part1 = GetSubSurface(_src, rect2.x, rect2.y, rect2.w, rect2.h); + + SDL_Rect destrect1; + + SDL_SetSurfaceBlendMode(part1, SDL_BLENDMODE_NONE); + + setRect(destrect1, _pX, 0, _src->w - _pX, _src->h); + + SDL_BlitSurface (part1, NULL, _src, &destrect1); + } + + else if(_pX > 0) + { + + setRect(rect1, _pX, 0, _src->w - _pX, _src->h ); + + part1 = GetSubSurface(_src, rect1.x, rect1.y, rect1.w, rect1.h); + + SDL_Rect destrect1; + + SDL_SetSurfaceBlendMode(part1, SDL_BLENDMODE_NONE); + + setRect(destrect1, 0, 0, _src->w - _pX, _src->h); + + SDL_BlitSurface (part1, NULL, _src, &destrect1); + + } + //Cleanup temp surface + if (part1) + { + SDL_FreeSurface(part1); + } + } diff --git a/desktop_version/src/GraphicsUtil.h b/desktop_version/src/GraphicsUtil.h index 4bdd217a..2ffa4461 100644 --- a/desktop_version/src/GraphicsUtil.h +++ b/desktop_version/src/GraphicsUtil.h @@ -3,18 +3,44 @@ #include +struct colourTransform +{ + Uint32 colour; +}; + + void setRect(SDL_Rect& _r, int x, int y, int w, int h); SDL_Surface* GetSubSurface( SDL_Surface* metaSurface, int x, int y, int width, int height ); -void DrawPixel(SDL_Surface* surface, int x, int y, SDL_Color color); +Uint32 ReadPixel( SDL_Surface *surface, int x, int y ); -SDL_Color ReadPixel(const SDL_Surface* surface, int x, int y); +SDL_Surface * ScaleSurface( SDL_Surface *Surface, int Width, int Height, SDL_Surface * Dest = NULL ); +void BlitSurfaceStandard( SDL_Surface* _src, SDL_Rect* _srcRect, SDL_Surface* _dest, SDL_Rect* _destRect ); + +void BlitSurfaceColoured( SDL_Surface* _src, SDL_Rect* _srcRect, SDL_Surface* _dest, SDL_Rect* _destRect, colourTransform& ct ); + +void BlitSurfaceTinted( SDL_Surface* _src, SDL_Rect* _srcRect, SDL_Surface* _dest, SDL_Rect* _destRect, colourTransform& ct ); + +void FillRect( SDL_Surface* surface, const int x, const int y, const int w, const int h, const int r, int g, int b ); + +void FillRect( SDL_Surface* surface, const int r, int g, int b ); + +void FillRect( SDL_Surface* surface, const int color ); + +void FillRect( SDL_Surface* surface, const int x, const int y, const int w, const int h, int rgba ); + +void FillRect( SDL_Surface* surface, SDL_Rect& rect, const int r, int g, int b ); + +void FillRect( SDL_Surface* surface, SDL_Rect rect, int rgba ); + +void ClearSurface(SDL_Surface* surface); + +void ScrollSurface(SDL_Surface* _src, int pX, int py); + +SDL_Surface * FlipSurfaceVerticle(SDL_Surface* _src); void UpdateFilter(void); -void ApplyFilter(SDL_Surface** src, SDL_Surface** dest); - -bool TakeScreenshot(SDL_Surface** surface); -bool UpscaleScreenshot2x(SDL_Surface* src, SDL_Surface** dest); +SDL_Surface* ApplyFilter( SDL_Surface* _src ); #endif /* GRAPHICSUTIL_H */ diff --git a/desktop_version/src/IMERender.cpp b/desktop_version/src/IMERender.cpp deleted file mode 100644 index 5771c33b..00000000 --- a/desktop_version/src/IMERender.cpp +++ /dev/null @@ -1,109 +0,0 @@ -#include - -#include "Constants.h" -#include "Font.h" -#include "Graphics.h" -#include "KeyPoll.h" -#include "UTF8.h" - -static bool render_done = false; -static SDL_Rect imebox; - -void ime_render(void) -{ - render_done = false; - - if (!SDL_IsTextInputActive() || key.imebuffer == "") - { - return; - } - - int fontheight = font::height(PR_FONT_LEVEL); - imebox.x = 8; - imebox.y = SCREEN_HEIGHT_PIXELS - 32 - fontheight; - imebox.w = font::len(PR_FONT_LEVEL, key.imebuffer.c_str()) + 1; - imebox.h = fontheight + 1; - - SDL_Rect imebox_border = imebox; - imebox_border.x -= 1; - imebox_border.y -= 1; - imebox_border.w += 2; - imebox_border.h += 2; - - graphics.fill_rect(&imebox_border, 128, 128, 128); - graphics.fill_rect(&imebox, 0, 0, 0); - - if (key.imebuffer_length > 0) - { - /* Also show a selection, so we need to know where and how long it is... - * Because SDL gives us the number of "characters" (so, codepoints)... */ - const char* imebuffer_ptr = key.imebuffer.c_str(); - const char* sel_start_ptr = imebuffer_ptr; - for (int i = 0; i < key.imebuffer_start; i++) - { - if (UTF8_next(&sel_start_ptr) == 0) - { - // Already past the '\0'... - sel_start_ptr--; - break; - } - } - const char* sel_end_ptr = sel_start_ptr; - for (int i = 0; i < key.imebuffer_length; i++) - { - if (UTF8_next(&sel_end_ptr) == 0) - { - break; - } - } - size_t before_sel_nbytes = sel_start_ptr - imebuffer_ptr; - size_t in_sel_nbytes = sel_end_ptr - sel_start_ptr; - char* before_sel = (char*) SDL_malloc(before_sel_nbytes + 1); - char* in_sel = (char*) SDL_malloc(in_sel_nbytes + 1); - if (before_sel != NULL && in_sel != NULL) - { - SDL_memcpy(before_sel, imebuffer_ptr, before_sel_nbytes); - before_sel[before_sel_nbytes] = '\0'; - SDL_memcpy(in_sel, sel_start_ptr, in_sel_nbytes); - in_sel[in_sel_nbytes] = '\0'; - - int before_sel_pixels = font::len(PR_FONT_LEVEL, before_sel) - 1; - int in_sel_pixels = font::len(PR_FONT_LEVEL, in_sel); - if (in_sel_pixels > 0) - { - in_sel_pixels += 1; - } - - SDL_Rect selrect = imebox; - selrect.x += before_sel_pixels + 1; - selrect.w = in_sel_pixels; - graphics.fill_rect(&selrect, 128, 64, 0); - } - SDL_free(before_sel); - SDL_free(in_sel); - } - - font::print(PR_FONT_LEVEL | PR_CJK_LOW, imebox.x + 1, imebox.y + 1, key.imebuffer, 255, 255, 255); - - render_done = true; -} - -void ime_set_rect(SDL_Rect* stretch_info) -{ - if (!render_done) - { - return; - } - - SDL_Rect imebox_scaled = imebox; - float x_scale = (float) stretch_info->w / SCREEN_WIDTH_PIXELS; - float y_scale = (float) stretch_info->h / SCREEN_HEIGHT_PIXELS; - imebox_scaled.x *= x_scale; - imebox_scaled.y *= y_scale; - imebox_scaled.w *= x_scale; - imebox_scaled.h *= y_scale; - imebox_scaled.x += stretch_info->x; - imebox_scaled.y += stretch_info->y; - - SDL_SetTextInputRect(&imebox_scaled); -} diff --git a/desktop_version/src/IMERender.h b/desktop_version/src/IMERender.h deleted file mode 100644 index 9e48ebd1..00000000 --- a/desktop_version/src/IMERender.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef IMERENDER_H -#define IMERENDER_H - -void ime_render(void); -void ime_set_rect(SDL_Rect* stretch_info); - -#endif /* IMERENDER_H */ diff --git a/desktop_version/src/Input.cpp b/desktop_version/src/Input.cpp index 4ee34af7..bb86e810 100644 --- a/desktop_version/src/Input.cpp +++ b/desktop_version/src/Input.cpp @@ -1,30 +1,19 @@ #include -#include -#include "ButtonGlyphs.h" #include "Credits.h" -#include "CustomLevels.h" -#include "Editor.h" +#include "editor.h" #include "Entity.h" #include "Enums.h" #include "FileSystemUtils.h" #include "Game.h" #include "GlitchrunnerMode.h" #include "Graphics.h" -#include "GraphicsUtil.h" #include "KeyPoll.h" -#include "LevelDebugger.h" -#include "Localization.h" -#include "LocalizationMaint.h" -#include "LocalizationStorage.h" #include "MakeAndPlay.h" #include "Map.h" #include "Music.h" -#include "RoomnameTranslator.h" -#include "Screen.h" #include "Script.h" #include "UtilityClass.h" -#include "Vlogging.h" static void updatebuttonmappings(int bind) { @@ -35,37 +24,6 @@ static void updatebuttonmappings(int bind) ) { if (key.isDown(i)) { - if (!game.gpmenu_confirming || i != game.gpmenu_lastbutton) - { - game.gpmenu_confirming = true; - game.gpmenu_lastbutton = i; - - // Is this button already in the list for this action? - std::vector* vec = NULL; - switch (bind) - { - case 1: vec = &game.controllerButton_flip; break; - case 2: vec = &game.controllerButton_map; break; - case 3: vec = &game.controllerButton_esc; break; - case 4: vec = &game.controllerButton_restart; break; - case 5: vec = &game.controllerButton_interact; break; - default: return; - } - - game.gpmenu_showremove = false; - for (size_t j = 0; j < vec->size(); j += 1) - { - if (i == (*vec)[j]) - { - game.gpmenu_showremove = true; - break; - } - } - - return; - } - game.gpmenu_confirming = false; - bool dupe = false; switch (bind) { @@ -77,14 +35,13 @@ static void updatebuttonmappings(int bind) if (i == game.controllerButton_flip[j]) { dupe = true; - game.controllerButton_flip.erase(game.controllerButton_flip.begin() + j); } } if (!dupe) { game.controllerButton_flip.push_back(i); + music.playef(11); } - music.playef(Sound_VIRIDIAN); for (j = 0; j < game.controllerButton_map.size(); j += 1) { if (i == game.controllerButton_map[j]) @@ -123,14 +80,13 @@ static void updatebuttonmappings(int bind) if (i == game.controllerButton_map[j]) { dupe = true; - game.controllerButton_map.erase(game.controllerButton_map.begin() + j); } } if (!dupe) { game.controllerButton_map.push_back(i); + music.playef(11); } - music.playef(Sound_VIRIDIAN); for (j = 0; j < game.controllerButton_flip.size(); j += 1) { if (i == game.controllerButton_flip[j]) @@ -169,14 +125,13 @@ static void updatebuttonmappings(int bind) if (i == game.controllerButton_esc[j]) { dupe = true; - game.controllerButton_esc.erase(game.controllerButton_esc.begin() + j); } } if (!dupe) { game.controllerButton_esc.push_back(i); + music.playef(11); } - music.playef(Sound_VIRIDIAN); for (j = 0; j < game.controllerButton_flip.size(); j += 1) { if (i == game.controllerButton_flip[j]) @@ -215,14 +170,13 @@ static void updatebuttonmappings(int bind) if (i == game.controllerButton_restart[j]) { dupe = true; - game.controllerButton_restart.erase(game.controllerButton_restart.begin() + j); } } if (!dupe) { game.controllerButton_restart.push_back(i); + music.playef(11); } - music.playef(Sound_VIRIDIAN); for (j = 0; j < game.controllerButton_flip.size(); j += 1) { if (i == game.controllerButton_flip[j]) @@ -261,14 +215,13 @@ static void updatebuttonmappings(int bind) if (i == game.controllerButton_interact[j]) { dupe = true; - game.controllerButton_interact.erase(game.controllerButton_interact.begin() + j); } } if (!dupe) { game.controllerButton_interact.push_back(i); + music.playef(11); } - music.playef(Sound_VIRIDIAN); for (j = 0; j < game.controllerButton_flip.size(); j += 1) { if (i == game.controllerButton_flip[j]) @@ -305,72 +258,34 @@ static void updatebuttonmappings(int bind) } } -/* Also used in KeyPoll.cpp. */ -void recomputetextboxes(void) -{ - /* Retranslate and reposition all text boxes. - * WARNING: Needs to update in linear order, starting from 0. */ - for (size_t i = 0; i < graphics.textboxes.size(); i++) - { - graphics.textboxes[i].updatetext(); - graphics.textboxes[i].applyposition(); - } -} - static void toggleflipmode(void) { graphics.setflipmode = !graphics.setflipmode; game.savestatsandsettings_menu(); if (graphics.setflipmode) { - music.playef(Sound_GAMESAVED); + music.playef(18); game.screenshake = 10; game.flashlight = 5; } else { - music.playef(Sound_VIRIDIAN); + music.playef(11); } - - /* Some text boxes change depending on Flip Mode, so update text boxes. */ - const bool temp = graphics.flipmode; - graphics.flipmode = graphics.setflipmode; - recomputetextboxes(); - graphics.flipmode = temp; } static bool fadetomode = false; static int fadetomodedelay = 0; -static enum StartMode gotomode = Start_MAINGAME; +static int gotomode = 0; -static void startmode(const enum StartMode mode) +static void startmode(const int mode) { gotomode = mode; - graphics.fademode = FADE_START_FADEOUT; + graphics.fademode = 2; /* fading out */ fadetomode = true; fadetomodedelay = 19; } -static void handlefadetomode(void) -{ - if (game.ingame_titlemode) - { - /* We shouldn't be here! */ - SDL_assert(0 && "Loading a mode from in-game options!"); - return; - } - - if (fadetomodedelay > 0) - { - --fadetomodedelay; - } - else - { - fadetomode = false; - script.startgamemode(gotomode); - } -} - static int* user_changing_volume = NULL; static int previous_volume = 0; @@ -418,48 +333,29 @@ static void slidermodeinput(void) { *user_changing_volume += USER_VOLUME_STEP; } - *user_changing_volume = SDL_clamp(*user_changing_volume, 0, USER_VOLUME_MAX); + *user_changing_volume = clamp(*user_changing_volume, 0, USER_VOLUME_MAX); } static void menuactionpress(void) { - if (game.menutestmode) - { - music.playef(Sound_CRUMBLE); - Menu::MenuName nextmenu = (Menu::MenuName) (game.currentmenuname + 1); - game.returnmenu(); - game.createmenu(nextmenu); - return; - } - switch (game.currentmenuname) { case Menu::mainmenu: - { - int option_id = -1; - int option_seq = 0; /* option number in YOUR configuration */ -#define OPTION_ID(id) \ - if (option_seq == game.currentmenuoption) \ - { \ - option_id = id; \ - } \ - option_seq++; -#if !defined(MAKEANDPLAY) - OPTION_ID(0) /* play */ +#if defined(MAKEANDPLAY) +#define MPOFFSET -1 +#else +#define MPOFFSET 0 #endif - OPTION_ID(1) /* levels */ - OPTION_ID(2) /* options */ - if (loc::show_translator_menu) - { - OPTION_ID(3) /* translator */ - } - OPTION_ID(4) /* credits */ - OPTION_ID(5) /* quit */ -#undef OPTION_ID +#if defined(NO_CUSTOM_LEVELS) +#define NOCUSTOMSOFFSET -1 +#else +#define NOCUSTOMSOFFSET 0 +#endif +#define OFFSET (MPOFFSET+NOCUSTOMSOFFSET) - switch (option_id) + switch (game.currentmenuoption) { #if !defined(MAKEANDPLAY) case 0: @@ -467,64 +363,67 @@ static void menuactionpress(void) if (!game.save_exists() && !game.anything_unlocked()) { //No saves exist, just start a new game - music.playef(Sound_VIRIDIAN); - startmode(Start_MAINGAME); + music.playef(11); + startmode(0); } else { //Bring you to the normal playmenu - music.playef(Sound_VIRIDIAN); + music.playef(11); game.createmenu(Menu::play); map.nexttowercolour(); } break; #endif - case 1: +#if !defined(NO_CUSTOM_LEVELS) + case OFFSET+1: //Bring you to the normal playmenu - music.playef(Sound_VIRIDIAN); - game.editor_disabled = !BUTTONGLYPHS_keyboard_is_available(); + music.playef(11); game.createmenu(Menu::playerworlds); map.nexttowercolour(); break; - case 2: +#endif + case OFFSET+2: //Options - music.playef(Sound_VIRIDIAN); + music.playef(11); game.createmenu(Menu::options); map.nexttowercolour(); break; - case 3: - //Translator - music.playef(Sound_VIRIDIAN); - game.createmenu(Menu::translator_main); - map.nexttowercolour(); - break; - case 4: +#if !defined(MAKEANDPLAY) + case OFFSET+3: //Credits - music.playef(Sound_VIRIDIAN); + music.playef(11); game.createmenu(Menu::credits); map.nexttowercolour(); break; - case 5: - music.playef(Sound_VIRIDIAN); +#else + #undef MPOFFSET + #define MPOFFSET -2 +#endif + case OFFSET+4: + music.playef(11); game.createmenu(Menu::youwannaquit); map.nexttowercolour(); break; +#undef OFFSET +#undef NOCUSTOMSOFFSET +#undef MPOFFSET } break; - } +#if !defined(NO_CUSTOM_LEVELS) case Menu::levellist: { - const bool nextlastoptions = cl.ListOfMetaData.size() > 8; + const bool nextlastoptions = ed.ListOfMetaData.size() > 8; if(game.currentmenuoption==(int)game.menuoptions.size()-1){ //go back to menu - music.playef(Sound_VIRIDIAN); + music.playef(11); game.returnmenu(); map.nexttowercolour(); }else if(nextlastoptions && game.currentmenuoption==(int)game.menuoptions.size()-2){ //previous page - music.playef(Sound_VIRIDIAN); + music.playef(11); if(game.levelpage==0){ - game.levelpage=(cl.ListOfMetaData.size()-1)/8; + game.levelpage=(ed.ListOfMetaData.size()-1)/8; }else{ game.levelpage--; } @@ -533,8 +432,8 @@ static void menuactionpress(void) map.nexttowercolour(); }else if(nextlastoptions && game.currentmenuoption==(int)game.menuoptions.size()-3){ //next page - music.playef(Sound_VIRIDIAN); - if((size_t) ((game.levelpage*8)+8) >= cl.ListOfMetaData.size()){ + music.playef(11); + if((size_t) ((game.levelpage*8)+8) >= ed.ListOfMetaData.size()){ game.levelpage=0; }else{ game.levelpage++; @@ -545,15 +444,15 @@ static void menuactionpress(void) }else{ //Ok, launch the level! //PLAY CUSTOM LEVEL HOOK - music.playef(Sound_VIRIDIAN); + music.playef(11); game.playcustomlevel=(game.levelpage*8)+game.currentmenuoption; - game.customleveltitle=cl.ListOfMetaData[game.playcustomlevel].title; - game.customlevelfilename=cl.ListOfMetaData[game.playcustomlevel].filename; + game.customleveltitle=ed.ListOfMetaData[game.playcustomlevel].title; + game.customlevelfilename=ed.ListOfMetaData[game.playcustomlevel].filename; - std::string name = "saves/" + cl.ListOfMetaData[game.playcustomlevel].filename.substr(7) + ".vvv"; + std::string name = "saves/" + ed.ListOfMetaData[game.playcustomlevel].filename.substr(7) + ".vvv"; tinyxml2::XMLDocument doc; if (!FILESYSTEM_loadTiXml2Document(name.c_str(), doc)){ - startmode(Start_CUSTOM); + startmode(22); }else{ game.createmenu(Menu::quickloadlevel); map.nexttowercolour(); @@ -561,52 +460,61 @@ static void menuactionpress(void) } break; } +#endif case Menu::quickloadlevel: switch (game.currentmenuoption) { case 0: //continue save - music.playef(Sound_VIRIDIAN); - startmode(Start_CUSTOM_QUICKSAVE); + music.playef(11); + startmode(23); break; case 1: - music.playef(Sound_VIRIDIAN); - startmode(Start_CUSTOM); + music.playef(11); + startmode(22); break; case 2: - music.playef(Sound_VIRIDIAN); + music.playef(11); game.createmenu(Menu::deletequicklevel); map.nexttowercolour(); break; default: - music.playef(Sound_VIRIDIAN); + music.playef(11); game.returnmenu(); map.nexttowercolour(); break; } break; +#if !defined(NO_CUSTOM_LEVELS) case Menu::deletequicklevel: switch (game.currentmenuoption) { default: - music.playef(Sound_VIRIDIAN); + music.playef(11); game.returnmenu(); break; case 1: - game.customdeletequick(cl.ListOfMetaData[game.playcustomlevel].filename); + game.customdeletequick(ed.ListOfMetaData[game.playcustomlevel].filename); game.returntomenu(Menu::levellist); game.flashlight = 5; game.screenshake = 15; - music.playef(Sound_DESTROY); + music.playef(23); break; } map.nexttowercolour(); break; case Menu::playerworlds: - if (game.currentmenuoption == 0) + #if defined(NO_EDITOR) + #define OFFSET -1 + #else + #define OFFSET 0 + #endif + switch (game.currentmenuoption) { - music.playef(Sound_VIRIDIAN); - game.levelpage = 0; - cl.getDirectoryData(); + case 0: + + music.playef(11); + game.levelpage=0; + ed.getDirectoryData(); game.loadcustomlevelstats(); //Should only load a file if it's needed game.createmenu(Menu::levellist); if (FILESYSTEM_levelDirHasError()) @@ -614,154 +522,113 @@ static void menuactionpress(void) game.createmenu(Menu::warninglevellist); } map.nexttowercolour(); - } - else if (game.currentmenuoption == 1) - { - // LEVEL EDITOR HOOK - if (game.editor_disabled) - { - music.playef(Sound_CRY); - } - else - { - music.playef(Sound_VIRIDIAN); - startmode(Start_EDITOR); - ed.filename = ""; - } - } - else if (!game.editor_disabled && game.currentmenuoption == 2) - { + break; + #if !defined(NO_EDITOR) + case 1: + //LEVEL EDITOR HOOK + music.playef(11); + startmode(20); + ed.filename=""; + break; + #endif + case OFFSET+2: //"OPENFOLDERHOOK" if (FILESYSTEM_openDirectoryEnabled() - && FILESYSTEM_openDirectory(FILESYSTEM_getUserLevelDirectory())) + && FILESYSTEM_openDirectory(FILESYSTEM_getUserLevelDirectory())) { - music.playef(Sound_VIRIDIAN); - SDL_MinimizeWindow(gameScreen.m_window); + music.playef(11); + SDL_MinimizeWindow(graphics.screenbuffer->m_window); } else { - music.playef(Sound_CRY); + music.playef(2); } - } - else if (!game.editor_disabled && game.currentmenuoption == 3) - { - music.playef(Sound_VIRIDIAN); - game.createmenu(Menu::confirmshowlevelspath); - map.nexttowercolour(); - } - else if (game.currentmenuoption == 4 || (game.editor_disabled && game.currentmenuoption == 2)) - { - // back - music.playef(Sound_VIRIDIAN); + break; + case OFFSET+3: + //back + music.playef(11); game.returnmenu(); map.nexttowercolour(); + break; } +#undef OFFSET break; - case Menu::confirmshowlevelspath: - { - int prevmenuoption = game.currentmenuoption; /* returnmenu destroys this */ - music.playef(Sound_VIRIDIAN); - game.returnmenu(); - map.nexttowercolour(); - if (prevmenuoption == 1) - { - game.createmenu(Menu::showlevelspath); - } - break; - } - case Menu::showlevelspath: - music.playef(Sound_VIRIDIAN); - game.editor_disabled = !BUTTONGLYPHS_keyboard_is_available(); - game.returntomenu(Menu::playerworlds); - map.nexttowercolour(); - break; +#endif case Menu::errornostart: - music.playef(Sound_VIRIDIAN); + music.playef(11); game.createmenu(Menu::mainmenu); map.nexttowercolour(); break; case Menu::graphicoptions: - { - int offset = 0; - bool processed = false; - if (game.currentmenuoption == offset + 0 && !gameScreen.isForcedFullscreen()) + if (graphics.screenbuffer == NULL) { - processed = true; - music.playef(Sound_VIRIDIAN); - gameScreen.toggleFullScreen(); + SDL_assert(0 && "Screenbuffer is NULL!"); + break; } - if (gameScreen.isForcedFullscreen()) + + switch (game.currentmenuoption) { - --offset; - } - if (game.currentmenuoption == offset + 1) - { - processed = true; - music.playef(Sound_VIRIDIAN); - gameScreen.toggleScalingMode(); + case 0: + music.playef(11); + graphics.screenbuffer->toggleFullScreen(); game.savestatsandsettings_menu(); - } - if (game.currentmenuoption == offset + 2 && !gameScreen.isForcedFullscreen()) - { - processed = true; + break; + case 1: + music.playef(11); + graphics.screenbuffer->toggleStretchMode(); + game.savestatsandsettings_menu(); + break; + case 2: // resize to nearest multiple - if (gameScreen.isWindowed) + if (graphics.screenbuffer->isWindowed) { - music.playef(Sound_VIRIDIAN); - gameScreen.ResizeToNearestMultiple(); + music.playef(11); + graphics.screenbuffer->ResizeToNearestMultiple(); game.savestatsandsettings_menu(); } else { - music.playef(Sound_CRY); + music.playef(2); } - } - if (gameScreen.isForcedFullscreen()) - { - --offset; - } - if (game.currentmenuoption == offset + 3) - { - processed = true; - music.playef(Sound_VIRIDIAN); - gameScreen.toggleLinearFilter(); + break; + case 3: + music.playef(11); + graphics.screenbuffer->toggleLinearFilter(); game.savestatsandsettings_menu(); - } - if (game.currentmenuoption == offset + 4) - { - processed = true; + break; + case 4: //change smoothing - music.playef(Sound_VIRIDIAN); - gameScreen.badSignalEffect= !gameScreen.badSignalEffect; + music.playef(11); + graphics.screenbuffer->badSignalEffect= !graphics.screenbuffer->badSignalEffect; game.savestatsandsettings_menu(); - } - if (game.currentmenuoption == offset + 5) - { - processed = true; + break; + case 5: //toggle vsync - music.playef(Sound_VIRIDIAN); - gameScreen.toggleVSync(); + music.playef(11); +#ifndef __HAIKU__ // FIXME: Remove after SDL VSync bug is fixed! -flibit + graphics.screenbuffer->vsync = !graphics.screenbuffer->vsync; + graphics.screenbuffer->resetRendererWorkaround(); game.savestatsandsettings_menu(); - } - if (!processed) - { +#endif + break; + default: //back - music.playef(Sound_VIRIDIAN); + music.playef(11); game.returnmenu(); map.nexttowercolour(); + break; } break; - } case Menu::youwannaquit: switch (game.currentmenuoption) { case 0: //bye! - music.playef(Sound_CRY); - startmode(Start_QUIT); + music.playef(2); + startmode(100); break; default: - music.playef(Sound_VIRIDIAN); + music.playef(11); game.returnmenu(); map.nexttowercolour(); } @@ -771,13 +638,13 @@ static void menuactionpress(void) { case 0: //back - music.playef(Sound_VIRIDIAN); + music.playef(11); game.returnmenu(); map.nexttowercolour(); break; default: map.invincibility = !map.invincibility; - music.playef(Sound_VIRIDIAN); + music.playef(11); game.returnmenu(); map.nexttowercolour(); game.savestatsandsettings_menu(); @@ -790,28 +657,28 @@ static void menuactionpress(void) case 0: //back game.slowdown = 30; - music.playef(Sound_VIRIDIAN); + music.playef(11); game.returnmenu(); map.nexttowercolour(); game.savestatsandsettings_menu(); break; case 1: game.slowdown = 24; - music.playef(Sound_VIRIDIAN); + music.playef(11); game.returnmenu(); map.nexttowercolour(); game.savestatsandsettings_menu(); break; case 2: game.slowdown = 18; - music.playef(Sound_VIRIDIAN); + music.playef(11); game.returnmenu(); map.nexttowercolour(); game.savestatsandsettings_menu(); break; case 3: game.slowdown = 12; - music.playef(Sound_VIRIDIAN); + music.playef(11); game.returnmenu(); map.nexttowercolour(); game.savestatsandsettings_menu(); @@ -823,20 +690,20 @@ static void menuactionpress(void) { case 0: // Glitchrunner mode - music.playef(Sound_VIRIDIAN); + music.playef(11); game.createmenu(Menu::setglitchrunner); game.currentmenuoption = GlitchrunnerMode_get(); map.nexttowercolour(); break; case 1: /* Input delay */ - music.playef(Sound_VIRIDIAN); + music.playef(11); game.inputdelay = !game.inputdelay; game.savestatsandsettings_menu(); break; case 2: /* Interact button toggle */ - music.playef(Sound_VIRIDIAN); + music.playef(11); game.separate_interact = !game.separate_interact; game.savestatsandsettings_menu(); break; @@ -844,27 +711,17 @@ static void menuactionpress(void) // toggle fake load screen game.skipfakeload = !game.skipfakeload; game.savestatsandsettings_menu(); - music.playef(Sound_VIRIDIAN); + music.playef(11); break; case 4: // toggle in game timer game.showingametimer = !game.showingametimer; game.savestatsandsettings_menu(); - music.playef(Sound_VIRIDIAN); - break; - case 5: - // english sprites - loc::english_sprites = !loc::english_sprites; - if (!loc::english_sprites) - { - graphics.grphx.init_translations(); - } - game.savestatsandsettings_menu(); - music.playef(Sound_VIRIDIAN); + music.playef(11); break; default: //back - music.playef(Sound_VIRIDIAN); + music.playef(11); game.returnmenu(); map.nexttowercolour(); break; @@ -872,7 +729,7 @@ static void menuactionpress(void) break; case Menu::setglitchrunner: GlitchrunnerMode_set((enum GlitchrunnerMode) game.currentmenuoption); - music.playef(Sound_VIRIDIAN); + music.playef(11); game.returnmenu(); game.savestatsandsettings_menu(); map.nexttowercolour(); @@ -884,29 +741,23 @@ static void menuactionpress(void) // toggle unfocus pause game.disablepause = !game.disablepause; game.savestatsandsettings_menu(); - music.playef(Sound_VIRIDIAN); + music.playef(11); break; case 1: /* toggle unfocus music pause */ game.disableaudiopause = !game.disableaudiopause; game.savestatsandsettings_menu(); - music.playef(Sound_VIRIDIAN); + music.playef(11); break; case 2: // toggle translucent roomname BG graphics.translucentroomname = !graphics.translucentroomname; game.savestatsandsettings_menu(); - music.playef(Sound_VIRIDIAN); - break; - case 3: - // toggle checkpoint saving - game.checkpoint_saving = !game.checkpoint_saving; - game.savestatsandsettings_menu(); - music.playef(Sound_VIRIDIAN); + music.playef(11); break; default: //back - music.playef(Sound_VIRIDIAN); + music.playef(11); game.returnmenu(); map.nexttowercolour(); break; @@ -919,7 +770,7 @@ static void menuactionpress(void) accessibilityoffset = 1; if (game.currentmenuoption == 0) { //unlock play options - music.playef(Sound_VIRIDIAN); + music.playef(11); game.createmenu(Menu::unlockmenu); map.nexttowercolour(); } @@ -938,11 +789,11 @@ static void menuactionpress(void) map.invincibility = !map.invincibility; game.savestatsandsettings_menu(); } - music.playef(Sound_VIRIDIAN); + music.playef(11); } else { - music.playef(Sound_CRY); + music.playef(2); map.invincibility = false; } } @@ -952,11 +803,11 @@ static void menuactionpress(void) { game.createmenu(Menu::setslowdown); map.nexttowercolour(); - music.playef(Sound_VIRIDIAN); + music.playef(11); } else { - music.playef(Sound_CRY); + music.playef(2); game.slowdown = 30; } } @@ -966,7 +817,7 @@ static void menuactionpress(void) game.savestatsandsettings_menu(); graphics.towerbg.tdrawback = true; graphics.titlebg.tdrawback = true; - music.playef(Sound_VIRIDIAN); + music.playef(11); } else if (game.currentmenuoption == accessibilityoffset + 3) { //disable screeneffects @@ -974,23 +825,23 @@ static void menuactionpress(void) game.savestatsandsettings_menu(); if (!game.noflashingmode) { - music.playef(Sound_GAMESAVED); + music.playef(18); game.screenshake = 10; game.flashlight = 5; } else { - music.playef(Sound_VIRIDIAN); + music.playef(11); } } else if (game.currentmenuoption == accessibilityoffset + 4) { //disable text outline graphics.notextoutline = !graphics.notextoutline; game.savestatsandsettings_menu(); - music.playef(Sound_VIRIDIAN); + music.playef(11); } else if (game.currentmenuoption == accessibilityoffset + 5) { //back - music.playef(Sound_VIRIDIAN); + music.playef(11); game.returnmenu(); map.nexttowercolour(); } @@ -1000,7 +851,7 @@ static void menuactionpress(void) { int gameplayoptionsoffset = 0; #if !defined(MAKEANDPLAY) - if (game.ingame_titlemode && game.unlock[Unlock_FLIPMODE]) + if (game.ingame_titlemode && game.unlock[18]) #endif { gameplayoptionsoffset = 1; @@ -1016,11 +867,11 @@ static void menuactionpress(void) { if (graphics.setflipmode) { - music.play(Music_POSITIVEFORCEREVERSED); + music.play(9); // ecroF evitisoP } else { - music.play(Music_POSITIVEFORCE); + music.play(2); // Positive Force } } } @@ -1029,40 +880,40 @@ static void menuactionpress(void) if (game.currentmenuoption == gameplayoptionsoffset + 0) { //Toggle 30+ FPS - music.playef(Sound_VIRIDIAN); + music.playef(11); game.over30mode = !game.over30mode; game.savestatsandsettings_menu(); } else if (game.currentmenuoption == gameplayoptionsoffset + 1) { //Speedrunner options - music.playef(Sound_VIRIDIAN); + music.playef(11); game.createmenu(Menu::speedrunneroptions); map.nexttowercolour(); } else if (game.currentmenuoption == gameplayoptionsoffset + 2) { //Advanced options - music.playef(Sound_VIRIDIAN); + music.playef(11); game.createmenu(Menu::advancedoptions); map.nexttowercolour(); } else if (game.currentmenuoption == gameplayoptionsoffset + 3) { //Clear Data - music.playef(Sound_VIRIDIAN); + music.playef(11); game.createmenu(Menu::cleardatamenu); map.nexttowercolour(); } else if (game.currentmenuoption == gameplayoptionsoffset + 4) { - music.playef(Sound_VIRIDIAN); + music.playef(11); game.createmenu(Menu::clearcustomdatamenu); map.nexttowercolour(); } else if (game.currentmenuoption == gameplayoptionsoffset + 5) { //return to previous menu - music.playef(Sound_VIRIDIAN); + music.playef(11); game.returnmenu(); map.nexttowercolour(); } @@ -1074,52 +925,37 @@ static void menuactionpress(void) { case 0: //gameplay options - music.playef(Sound_VIRIDIAN); + music.playef(11); game.createmenu(Menu::gameplayoptions); map.nexttowercolour(); break; case 1: //graphic options - music.playef(Sound_VIRIDIAN); + music.playef(11); game.createmenu(Menu::graphicoptions); map.nexttowercolour(); break; case 2: /* Audio options */ - music.playef(Sound_VIRIDIAN); + music.playef(11); game.createmenu(Menu::audiooptions); map.nexttowercolour(); break; case 3: //gamepad options - music.playef(Sound_VIRIDIAN); + music.playef(11); game.createmenu(Menu::controller); map.nexttowercolour(); break; case 4: //accessibility options - music.playef(Sound_VIRIDIAN); + music.playef(11); game.createmenu(Menu::accessibility); map.nexttowercolour(); break; - case 5: - //language options - if (game.translator_cutscene_test) - { - music.playef(Sound_CRY); - break; - } - - music.playef(Sound_VIRIDIAN); - loc::loadlanguagelist(); - loc::pre_title_lang_menu = false; - game.createmenu(Menu::language); - game.currentmenuoption = loc::languagelist_curlang; - map.nexttowercolour(); - break; default: /* Return */ - music.playef(Sound_VIRIDIAN); + music.playef(11); if (game.ingame_titlemode) { game.returntoingame(); @@ -1137,7 +973,7 @@ static void menuactionpress(void) { case 0: case 1: - music.playef(Sound_VIRIDIAN); + music.playef(11); if (game.slidermode == SLIDER_NONE) { initvolumeslider(game.currentmenuoption); @@ -1155,7 +991,7 @@ static void menuactionpress(void) /* Toggle MMMMMM */ music.usingmmmmmm = !music.usingmmmmmm; - music.playef(Sound_VIRIDIAN); + music.playef(11); if (music.currentsong > -1) { music.play(music.currentsong); @@ -1169,358 +1005,57 @@ static void menuactionpress(void) /* Return */ game.returnmenu(); map.nexttowercolour(); - music.playef(Sound_VIRIDIAN); + music.playef(11); } break; - case Menu::language: - { - std::string prev_lang = std::string(loc::lang); - - music.playef(Sound_VIRIDIAN); - - if (loc::languagelist.size() != 0 && (unsigned)game.currentmenuoption < loc::languagelist.size()) - { - /* Update code also used in KeyPoll.cpp. */ - loc::languagelist_curlang = game.currentmenuoption; - loc::lang = loc::languagelist[game.currentmenuoption].code; - loc::loadtext(false); - loc::lang_set = loc::lang_set_current; - graphics.grphx.init_translations(); - } - - if (loc::pre_title_lang_menu) - { - /* Make the title screen appear, we haven't seen it yet. - * game.returnmenu() works because Menu::mainmenu - * is created before the language menu. */ - game.menustart = false; - loc::pre_title_lang_menu = false; - } - - if (prev_lang != loc::lang) - { - recomputetextboxes(); - } - - game.returnmenu(); - map.nexttowercolour(); - game.savestatsandsettings_menu(); - - break; - } - case Menu::translator_main: - switch (game.currentmenuoption) - { - case 0: - // translator options - music.playef(Sound_VIRIDIAN); - game.createmenu(Menu::translator_options); - map.nexttowercolour(); - break; - case 1: - // maintenance - music.playef(Sound_VIRIDIAN); - game.createmenu(Menu::translator_maintenance); - map.nexttowercolour(); - break; - case 2: - // open lang folder - if (FILESYSTEM_openDirectoryEnabled() - && FILESYSTEM_openDirectory(FILESYSTEM_getUserMainLangDirectory())) - { - music.playef(Sound_VIRIDIAN); - SDL_MinimizeWindow(gameScreen.m_window); - } - else - { - music.playef(Sound_CRY); - } - break; - default: - // return - music.playef(Sound_VIRIDIAN); - game.returnmenu(); - map.nexttowercolour(); - break; - } - break; - case Menu::translator_options: - switch (game.currentmenuoption) - { - case 0: - // language statistics - music.playef(Sound_VIRIDIAN); - game.createmenu(Menu::translator_options_stats); - map.nexttowercolour(); - break; - case 1: - // translate room names - music.playef(Sound_VIRIDIAN); - roomname_translator::set_enabled(!roomname_translator::enabled); - game.savestatsandsettings_menu(); - break; - case 2: - // explore game - music.playef(Sound_VIRIDIAN); - game.createmenu(Menu::translator_options_exploregame); - map.nexttowercolour(); - break; - case 3: - // menu test - music.playef(Sound_GAMESAVED); - game.menutestmode = true; - game.createmenu((Menu::MenuName) 0); - map.nexttowercolour(); - break; - case 4: - // cutscene test - if (loc::lang == "en") - { - music.playef(Sound_CRY); - } - else - { - music.playef(Sound_VIRIDIAN); - game.cutscenetest_menu_page = 0; - loc::populate_testable_script_ids(); - game.createmenu(Menu::translator_options_cutscenetest); - map.nexttowercolour(); - } - break; - case 5: - // limits check - music.playef(Sound_VIRIDIAN); - loc::local_limits_check(); - game.createmenu(Menu::translator_options_limitscheck); - map.nexttowercolour(); - break; - default: - // return - music.playef(Sound_VIRIDIAN); - game.returnmenu(); - map.nexttowercolour(); - break; - } - break; - case Menu::translator_options_limitscheck: - switch (game.currentmenuoption) - { - case 0: - // next - if (loc::limitscheck_current_overflow < loc::text_overflows.size()) - { - music.playef(Sound_VIRIDIAN); - loc::limitscheck_current_overflow++; - } - break; - default: - // return - music.playef(Sound_VIRIDIAN); - game.returnmenu(); - map.nexttowercolour(); - break; - } - break; - case Menu::translator_options_stats: - music.playef(Sound_VIRIDIAN); - game.returnmenu(); - map.nexttowercolour(); - break; - case Menu::translator_options_exploregame: - music.playef(Sound_VIRIDIAN); - switch (game.currentmenuoption) - { - case 0: - game.start_translator_exploring = true; - startmode(Start_TIMETRIAL_SPACESTATION1); - break; - case 1: - game.start_translator_exploring = true; - startmode(Start_TIMETRIAL_LABORATORY); - break; - case 2: - game.start_translator_exploring = true; - startmode(Start_TIMETRIAL_TOWER); - break; - case 3: - game.start_translator_exploring = true; - startmode(Start_TIMETRIAL_SPACESTATION2); - break; - case 4: - game.start_translator_exploring = true; - startmode(Start_TIMETRIAL_WARPZONE); - break; - case 5: - game.createmenu(Menu::playint1); - game.start_translator_exploring = true; - map.nexttowercolour(); - break; - case 6: - game.createmenu(Menu::playint2); - game.start_translator_exploring = true; - map.nexttowercolour(); - break; - case 7: - game.start_translator_exploring = true; - startmode(Start_TIMETRIAL_FINALLEVEL); - break; - default: - // return - game.returnmenu(); - map.nexttowercolour(); - break; - } - break; - case Menu::translator_options_cutscenetest: - if (game.currentmenuoption == (int)game.menuoptions.size()-4) - { - // next page - music.playef(Sound_VIRIDIAN); - if ((size_t) ((game.cutscenetest_menu_page*14)+14) >= loc::testable_script_ids.size()) - { - game.cutscenetest_menu_page = 0; - } - else - { - game.cutscenetest_menu_page++; - } - game.createmenu(Menu::translator_options_cutscenetest, true); - game.currentmenuoption=game.menuoptions.size()-4; - map.nexttowercolour(); - } - else if (game.currentmenuoption == (int)game.menuoptions.size()-3) - { - // previous page - music.playef(Sound_VIRIDIAN); - if (game.cutscenetest_menu_page == 0) - { - game.cutscenetest_menu_page = (loc::testable_script_ids.size()-1)/14; - } - else - { - game.cutscenetest_menu_page--; - } - game.createmenu(Menu::translator_options_cutscenetest, true); - game.currentmenuoption=game.menuoptions.size()-3; - map.nexttowercolour(); - } - else if (game.currentmenuoption == (int)game.menuoptions.size()-2) - { - // play the cutscene, from clipboard - game.cutscenetest_menu_play_id = std::string(SDL_GetClipboardText()); - startmode(Start_CUTSCENETEST); - } - else if (game.currentmenuoption == (int)game.menuoptions.size()-1) - { - // go back to menu - music.playef(Sound_VIRIDIAN); - game.returnmenu(); - map.nexttowercolour(); - } - else - { - // play the cutscene! - game.cutscenetest_menu_play_id = loc::testable_script_ids[(game.cutscenetest_menu_page*14)+game.currentmenuoption]; - startmode(Start_CUTSCENETEST); - } - break; - case Menu::translator_maintenance: - music.playef(Sound_VIRIDIAN); - switch (game.currentmenuoption) - { - case 0: - // sync languages - game.createmenu(Menu::translator_maintenance_sync); - map.nexttowercolour(); - break; - case 1: - // global statistics - // TODO - map.nexttowercolour(); - break; - case 2: - // global limits check - loc::global_limits_check(); - game.createmenu(Menu::translator_options_limitscheck); - map.nexttowercolour(); - break; - default: - // return - game.returnmenu(); - map.nexttowercolour(); - break; - } - break; - case Menu::translator_maintenance_sync: - { - music.playef(Sound_VIRIDIAN); - bool sync_success = true; - if (game.currentmenuoption == 0) - { - // yes, sync files - sync_success = loc::sync_lang_files(); - } - game.returnmenu(); - map.nexttowercolour(); - if (!sync_success) - { - game.createmenu(Menu::translator_error_setlangwritedir); - } - break; - } - case Menu::translator_error_setlangwritedir: - music.playef(Sound_VIRIDIAN); - game.returnmenu(); - map.nexttowercolour(); - break; case Menu::unlockmenutrials: switch (game.currentmenuoption) { - case 0: //unlock 1 - game.unlock[Unlock_TIMETRIAL_SPACESTATION1] = true; - game.unlocknotify[Unlock_TIMETRIAL_SPACESTATION1] = true; - music.playef(Sound_VIRIDIAN); + case 0: //unlock 1 + game.unlock[9] = true; + game.unlocknotify[9] = true; + music.playef(11); game.createmenu(Menu::unlockmenutrials, true); game.savestatsandsettings_menu(); break; - case 1: //unlock 2 - game.unlock[Unlock_TIMETRIAL_LABORATORY] = true; - game.unlocknotify[Unlock_TIMETRIAL_LABORATORY] = true; - music.playef(Sound_VIRIDIAN); + case 1: //unlock 2 + game.unlock[10] = true; + game.unlocknotify[10] = true; + music.playef(11); game.createmenu(Menu::unlockmenutrials, true); game.savestatsandsettings_menu(); break; - case 2: //unlock 3 - game.unlock[Unlock_TIMETRIAL_TOWER] = true; - game.unlocknotify[Unlock_TIMETRIAL_TOWER] = true; - music.playef(Sound_VIRIDIAN); + case 2: //unlock 3 + game.unlock[11] = true; + game.unlocknotify[11] = true; + music.playef(11); game.createmenu(Menu::unlockmenutrials, true); game.savestatsandsettings_menu(); break; - case 3: //unlock 4 - game.unlock[Unlock_TIMETRIAL_SPACESTATION2] = true; - game.unlocknotify[Unlock_TIMETRIAL_SPACESTATION2] = true; - music.playef(Sound_VIRIDIAN); + case 3: //unlock 4 + game.unlock[12] = true; + game.unlocknotify[12] = true; + music.playef(11); game.createmenu(Menu::unlockmenutrials, true); game.savestatsandsettings_menu(); break; - case 4: //unlock 5 - game.unlock[Unlock_TIMETRIAL_WARPZONE] = true; - game.unlocknotify[Unlock_TIMETRIAL_WARPZONE] = true; - music.playef(Sound_VIRIDIAN); + case 4: //unlock 5 + game.unlock[13] = true; + game.unlocknotify[13] = true; + music.playef(11); game.createmenu(Menu::unlockmenutrials, true); game.savestatsandsettings_menu(); break; - case 5: //unlock 6 - game.unlock[Unlock_TIMETRIAL_FINALLEVEL] = true; - game.unlocknotify[Unlock_TIMETRIAL_FINALLEVEL] = true; - music.playef(Sound_VIRIDIAN); + case 5: //unlock 6 + game.unlock[14] = true; + game.unlocknotify[14] = true; + music.playef(11); game.createmenu(Menu::unlockmenutrials, true); game.savestatsandsettings_menu(); break; - case 6: //back + case 6: //back //back - music.playef(Sound_VIRIDIAN); + music.playef(11); game.returnmenu(); map.nexttowercolour(); break; @@ -1531,54 +1066,54 @@ static void menuactionpress(void) { case 0: //unlock time trials separately... - music.playef(Sound_VIRIDIAN); + music.playef(11); game.createmenu(Menu::unlockmenutrials); map.nexttowercolour(); break; case 1: //unlock intermissions - music.playef(Sound_VIRIDIAN); - game.unlock[Unlock_INTERMISSION_REPLAYS] = true; - game.unlocknotify[Unlock_INTERMISSION_REPLAYS] = true; - game.unlock[Unlock_INTERMISSION1_COMPLETE] = true; - game.unlock[Unlock_INTERMISSION2_COMPLETE] = true; + music.playef(11); + game.unlock[16] = true; + game.unlocknotify[16] = true; + game.unlock[6] = true; + game.unlock[7] = true; game.createmenu(Menu::unlockmenu, true); game.savestatsandsettings_menu(); break; case 2: //unlock no death mode - music.playef(Sound_VIRIDIAN); - game.unlock[Unlock_NODEATHMODE] = true; - game.unlocknotify[Unlock_NODEATHMODE] = true; + music.playef(11); + game.unlock[17] = true; + game.unlocknotify[17] = true; game.createmenu(Menu::unlockmenu, true); game.savestatsandsettings_menu(); break; case 3: //unlock flip mode - music.playef(Sound_VIRIDIAN); - game.unlock[Unlock_FLIPMODE] = true; - game.unlocknotify[Unlock_FLIPMODE] = true; + music.playef(11); + game.unlock[18] = true; + game.unlocknotify[18] = true; game.createmenu(Menu::unlockmenu, true); game.savestatsandsettings_menu(); break; case 4: //unlock jukebox - music.playef(Sound_VIRIDIAN); + music.playef(11); game.stat_trinkets = 20; game.createmenu(Menu::unlockmenu, true); game.savestatsandsettings_menu(); break; case 5: //unlock secret lab - music.playef(Sound_VIRIDIAN); - game.unlock[Unlock_SECRETLAB] = true; - game.unlocknotify[Unlock_SECRETLAB] = true; + music.playef(11); + game.unlock[8] = true; + game.unlocknotify[8] = true; game.createmenu(Menu::unlockmenu, true); game.savestatsandsettings_menu(); break; default: //back - music.playef(Sound_VIRIDIAN); + music.playef(11); game.returnmenu(); map.nexttowercolour(); break; @@ -1589,19 +1124,19 @@ static void menuactionpress(void) { case 0: //next page - music.playef(Sound_VIRIDIAN); + music.playef(11); game.createmenu(Menu::credits2, true); map.nexttowercolour(); break; case 1: //last page - music.playef(Sound_VIRIDIAN); + music.playef(11); game.createmenu(Menu::credits6, true); map.nexttowercolour(); break; default: //back - music.playef(Sound_VIRIDIAN); + music.playef(11); game.returnmenu(); map.nexttowercolour(); break; @@ -1612,19 +1147,19 @@ static void menuactionpress(void) { case 0: //next page - music.playef(Sound_VIRIDIAN); + music.playef(11); game.createmenu(Menu::credits25, true); map.nexttowercolour(); break; case 1: //previous page - music.playef(Sound_VIRIDIAN); + music.playef(11); game.createmenu(Menu::credits, true); map.nexttowercolour(); break; case 2: //back - music.playef(Sound_VIRIDIAN); + music.playef(11); game.returnmenu(); map.nexttowercolour(); break; @@ -1635,101 +1170,19 @@ static void menuactionpress(void) { case 0: //next page - music.playef(Sound_VIRIDIAN); - game.createmenu(Menu::credits_localisations_implementation, true); + music.playef(11); + game.createmenu(Menu::credits3, true); map.nexttowercolour(); break; case 1: //previous page - music.playef(Sound_VIRIDIAN); + music.playef(11); game.createmenu(Menu::credits2, true); map.nexttowercolour(); break; default: //back - music.playef(Sound_VIRIDIAN); - game.returnmenu(); - map.nexttowercolour(); - break; - } - break; - case Menu::credits_localisations_implementation: - switch (game.currentmenuoption) - { - case 0: - //next page - music.playef(Sound_VIRIDIAN); - game.translator_credits_pagenum = 0; - game.current_credits_list_index = 0; - game.createmenu(Menu::credits_localisations_translations, true); - map.nexttowercolour(); - break; - case 1: - //previous page - music.playef(Sound_VIRIDIAN); - game.createmenu(Menu::credits25, true); - map.nexttowercolour(); - break; - default: - //back - music.playef(Sound_VIRIDIAN); - game.returnmenu(); - map.nexttowercolour(); - break; - } - break; - case Menu::credits_localisations_translations: - switch (game.currentmenuoption) - { - case 0: - //next page - music.playef(Sound_VIRIDIAN); - game.translator_credits_pagenum++; - - if (game.translator_credits_pagenum >= (int)SDL_arraysize(Credits::translator_pagesize)) - { - // No more translators. Move to the next credits section - game.current_credits_list_index = 0; - game.createmenu(Menu::credits3, true); - } - else - { - // There are more translators. Refresh the menu with the next ones - game.current_credits_list_index = 0; - for (int i = 0; i < game.translator_credits_pagenum; i += 1) - { - game.current_credits_list_index += Credits::translator_pagesize[i]; - } - - game.createmenu(Menu::credits_localisations_translations, true); - } - - map.nexttowercolour(); - break; - case 1: - //previous page - music.playef(Sound_VIRIDIAN); - game.translator_credits_pagenum--; - if (game.translator_credits_pagenum >= 0) - { - game.current_credits_list_index = 0; - for (int i = 0; i < game.translator_credits_pagenum; i += 1) - { - game.current_credits_list_index += Credits::translator_pagesize[i]; - } - game.createmenu(Menu::credits_localisations_translations, true); - }else { - //No more translators. Move to the previous credits section - game.current_credits_list_index = 0; - game.createmenu(Menu::credits_localisations_implementation, true); - } - - map.nexttowercolour(); - break; - default: - //back - music.playef(Sound_VIRIDIAN); - game.current_credits_list_index = 0; + music.playef(11); game.returnmenu(); map.nexttowercolour(); break; @@ -1740,7 +1193,7 @@ static void menuactionpress(void) { case 0: //next page - music.playef(Sound_VIRIDIAN); + music.playef(11); game.current_credits_list_index += 9; if (game.current_credits_list_index >= (int)SDL_arraysize(Credits::superpatrons)) @@ -1759,19 +1212,14 @@ static void menuactionpress(void) break; case 1: //previous page - music.playef(Sound_VIRIDIAN); + music.playef(11); game.current_credits_list_index -= 9; if (game.current_credits_list_index < 0) { //No more super patrons. Move to the previous credits section - game.translator_credits_pagenum = (int)SDL_arraysize(Credits::translator_pagesize) - 1; game.current_credits_list_index = 0; - for (int i = 0; i < game.translator_credits_pagenum; i += 1) - { - game.current_credits_list_index += Credits::translator_pagesize[i]; - } - game.createmenu(Menu::credits_localisations_translations, true); + game.createmenu(Menu::credits25, true); } else { @@ -1783,7 +1231,7 @@ static void menuactionpress(void) break; default: //back - music.playef(Sound_VIRIDIAN); + music.playef(11); game.current_credits_list_index = 0; game.returnmenu(); map.nexttowercolour(); @@ -1795,7 +1243,7 @@ static void menuactionpress(void) { case 0: //next page - music.playef(Sound_VIRIDIAN); + music.playef(11); game.current_credits_list_index += 14; if (game.current_credits_list_index >= (int)SDL_arraysize(Credits::patrons)) @@ -1814,7 +1262,7 @@ static void menuactionpress(void) break; case 1: //previous page - music.playef(Sound_VIRIDIAN); + music.playef(11); game.current_credits_list_index -= 14; if (game.current_credits_list_index < 0) @@ -1833,7 +1281,7 @@ static void menuactionpress(void) break; default: //back - music.playef(Sound_VIRIDIAN); + music.playef(11); game.current_credits_list_index = 0; game.returnmenu(); map.nexttowercolour(); @@ -1845,7 +1293,7 @@ static void menuactionpress(void) { case 0: //next page - music.playef(Sound_VIRIDIAN); + music.playef(11); game.current_credits_list_index += 9; if (game.current_credits_list_index >= (int)SDL_arraysize(Credits::githubfriends)) @@ -1864,7 +1312,7 @@ static void menuactionpress(void) break; case 1: //previous page - music.playef(Sound_VIRIDIAN); + music.playef(11); game.current_credits_list_index -= 9; if (game.current_credits_list_index < 0) @@ -1883,7 +1331,7 @@ static void menuactionpress(void) break; default: //back - music.playef(Sound_VIRIDIAN); + music.playef(11); game.current_credits_list_index = 0; game.returnmenu(); map.nexttowercolour(); @@ -1895,20 +1343,20 @@ static void menuactionpress(void) { case 0: //first page - music.playef(Sound_VIRIDIAN); + music.playef(11); game.createmenu(Menu::credits, true); map.nexttowercolour(); break; case 1: //previous page - music.playef(Sound_VIRIDIAN); + music.playef(11); game.current_credits_list_index = SDL_arraysize(Credits::githubfriends) - 1 - (SDL_arraysize(Credits::githubfriends)-1)%9; game.createmenu(Menu::credits5, true); map.nexttowercolour(); break; default: //back - music.playef(Sound_VIRIDIAN); + music.playef(11); game.returnmenu(); map.nexttowercolour(); break; @@ -1917,7 +1365,7 @@ static void menuactionpress(void) case Menu::play: { //Do we have the Secret Lab option? - int sloffset = game.unlock[Unlock_SECRETLAB] ? 0 : -1; + int sloffset = game.unlock[8] ? 0 : -1; //Do we have a telesave or quicksave? int ngoffset = game.save_exists() ? 0 : -1; if (game.currentmenuoption == 0) @@ -1927,52 +1375,52 @@ static void menuactionpress(void) if (!game.save_exists()) { //You have no saves but have something unlocked, or you couldn't have gotten here - music.playef(Sound_VIRIDIAN); - startmode(Start_MAINGAME); + music.playef(11); + startmode(0); } - else if (!game.last_telesave.exists) + else if (game.telesummary == "") { //You at least have a quicksave, or you couldn't have gotten here - music.playef(Sound_VIRIDIAN); - startmode(Start_MAINGAME_QUICKSAVE); + music.playef(11); + startmode(2); } - else if (!game.last_quicksave.exists) + else if (game.quicksummary == "") { //You at least have a telesave, or you couldn't have gotten here - music.playef(Sound_VIRIDIAN); - startmode(Start_MAINGAME_TELESAVE); + music.playef(11); + startmode(1); } else { //go to a menu! - music.playef(Sound_VIRIDIAN); + music.playef(11); game.loadsummary(); //Prepare save slots to display game.createmenu(Menu::continuemenu); } } - else if (game.currentmenuoption == 1 && game.unlock[Unlock_SECRETLAB]) + else if (game.currentmenuoption == 1 && game.unlock[8]) { - music.playef(Sound_VIRIDIAN); - startmode(Start_SECRETLAB); + music.playef(11); + startmode(11); } else if (game.currentmenuoption == sloffset+2) { //play modes - music.playef(Sound_VIRIDIAN); + music.playef(11); game.createmenu(Menu::playmodes); map.nexttowercolour(); } else if (game.currentmenuoption == sloffset+3 && game.save_exists()) { //newgame - music.playef(Sound_VIRIDIAN); + music.playef(11); game.createmenu(Menu::newgamewarning); map.nexttowercolour(); } else if (game.currentmenuoption == sloffset+ngoffset+4) { //back - music.playef(Sound_VIRIDIAN); + music.playef(11); game.returnmenu(); map.nexttowercolour(); } @@ -1983,14 +1431,14 @@ static void menuactionpress(void) { case 0: //yep - music.playef(Sound_VIRIDIAN); - startmode(Start_MAINGAME); + music.playef(11); + startmode(0); game.deletequick(); game.deletetele(); break; default: //back - music.playef(Sound_VIRIDIAN); + music.playef(11); game.returnmenu(); map.nexttowercolour(); break; @@ -2002,7 +1450,7 @@ static void menuactionpress(void) { case 0: key.sensitivity++; - music.playef(Sound_VIRIDIAN); + music.playef(11); if(key.sensitivity > 4) { key.sensitivity = 0; @@ -2011,7 +1459,7 @@ static void menuactionpress(void) break; case 6: - music.playef(Sound_VIRIDIAN); + music.playef(11); game.returnmenu(); map.nexttowercolour(); break; @@ -2022,32 +1470,34 @@ static void menuactionpress(void) { case 0: //back - music.playef(Sound_VIRIDIAN); + music.playef(11); + game.returnmenu(); + map.nexttowercolour(); break; default: //yep - music.playef(Sound_DESTROY); + music.playef(23); game.deletequick(); game.deletetele(); game.deletestats(); game.deletesettings(); game.flashlight = 5; game.screenshake = 15; + game.createmenu(Menu::mainmenu); + map.nexttowercolour(); break; } - game.returnmenu(); - map.nexttowercolour(); break; case Menu::clearcustomdatamenu: switch (game.currentmenuoption) { default: - music.playef(Sound_VIRIDIAN); + music.playef(11); break; case 1: game.deletecustomlevelstats(); FILESYSTEM_deleteLevelSaves(); - music.playef(Sound_DESTROY); + music.playef(23); game.flashlight = 5; game.screenshake = 15; break; @@ -2056,61 +1506,56 @@ static void menuactionpress(void) map.nexttowercolour(); break; case Menu::playmodes: - if (game.currentmenuoption == 0 - && !game.nocompetitive_unless_translator()) //go to the time trial menu + if (game.currentmenuoption == 0 && !game.nocompetitive()) //go to the time trial menu { - music.playef(Sound_VIRIDIAN); + music.playef(11); game.createmenu(Menu::timetrials); map.nexttowercolour(); } - else if (game.currentmenuoption == 1 - && game.unlock[Unlock_INTERMISSION_REPLAYS]) + else if (game.currentmenuoption == 1 && game.unlock[16]) { //intermission mode menu - music.playef(Sound_VIRIDIAN); + music.playef(11); game.createmenu(Menu::intermissionmenu); map.nexttowercolour(); } - else if (game.currentmenuoption == 2 - && game.unlock[Unlock_NODEATHMODE] - && !game.nocompetitive()) //start a game in no death mode + else if (game.currentmenuoption == 2 && game.unlock[17] && !game.nocompetitive()) //start a game in no death mode { - music.playef(Sound_VIRIDIAN); + music.playef(11); game.createmenu(Menu::startnodeathmode); map.nexttowercolour(); } - else if (game.currentmenuoption == 3 - && game.unlock[Unlock_FLIPMODE]) //enable/disable flip mode + else if (game.currentmenuoption == 3 && game.unlock[18]) //enable/disable flip mode { toggleflipmode(); } else if (game.currentmenuoption == 4) { //back - music.playef(Sound_VIRIDIAN); + music.playef(11); game.returnmenu(); map.nexttowercolour(); } else { - //Can't do yet! - music.playef(Sound_CRY); + //Can't do yet! play sad sound + music.playef(2); } break; case Menu::startnodeathmode: switch (game.currentmenuoption) { case 0: //start no death mode, disabling cutscenes - music.playef(Sound_VIRIDIAN); - startmode(Start_NODEATHMODE_NOCUTSCENES); + music.playef(11); + startmode(10); break; case 1: - music.playef(Sound_VIRIDIAN); - startmode(Start_NODEATHMODE_WITHCUTSCENES); + music.playef(11); + startmode(9); break; case 2: //back - music.playef(Sound_VIRIDIAN); + music.playef(11); game.returnmenu(); map.nexttowercolour(); break; @@ -2120,16 +1565,16 @@ static void menuactionpress(void) switch (game.currentmenuoption) { case 0: - music.playef(Sound_VIRIDIAN); - startmode(Start_MAINGAME_TELESAVE); + music.playef(11); + startmode(1); break; case 1: - music.playef(Sound_VIRIDIAN); - startmode(Start_MAINGAME_QUICKSAVE); + music.playef(11); + startmode(2); break; case 2: //back - music.playef(Sound_VIRIDIAN); + music.playef(11); game.returnmenu(); map.nexttowercolour(); break; @@ -2139,18 +1584,20 @@ static void menuactionpress(void) switch (game.currentmenuoption) { case 0: - music.playef(Sound_VIRIDIAN); + music.playef(11); + music.play(6); game.createmenu(Menu::playint1); map.nexttowercolour(); break; case 1: - music.playef(Sound_VIRIDIAN); + music.playef(11); + music.play(6); game.createmenu(Menu::playint2); map.nexttowercolour(); break; case 2: //back - music.playef(Sound_VIRIDIAN); + music.playef(11); game.returnmenu(); map.nexttowercolour(); break; @@ -2160,24 +1607,24 @@ static void menuactionpress(void) switch (game.currentmenuoption) { case 0: - music.playef(Sound_VIRIDIAN); - startmode(Start_INTERMISSION1_VITELLARY); + music.playef(11); + startmode(12); break; case 1: - music.playef(Sound_VIRIDIAN); - startmode(Start_INTERMISSION1_VERMILION); + music.playef(11); + startmode(13); break; case 2: - music.playef(Sound_VIRIDIAN); - startmode(Start_INTERMISSION1_VERDIGRIS); + music.playef(11); + startmode(14); break; case 3: - music.playef(Sound_VIRIDIAN); - startmode(Start_INTERMISSION1_VICTORIA); + music.playef(11); + startmode(15); break; case 4: //back - music.playef(Sound_VIRIDIAN); + music.playef(11); game.returnmenu(); map.nexttowercolour(); break; @@ -2187,24 +1634,24 @@ static void menuactionpress(void) switch (game.currentmenuoption) { case 0: - music.playef(Sound_VIRIDIAN); - startmode(Start_INTERMISSION2_VITELLARY); + music.playef(11); + startmode(16); break; case 1: - music.playef(Sound_VIRIDIAN); - startmode(Start_INTERMISSION2_VERMILION); + music.playef(11); + startmode(17); break; case 2: - music.playef(Sound_VIRIDIAN); - startmode(Start_INTERMISSION2_VERDIGRIS); + music.playef(11); + startmode(18); break; case 3: - music.playef(Sound_VIRIDIAN); - startmode(Start_INTERMISSION2_VICTORIA); + music.playef(11); + startmode(19); break; case 4: //back - music.playef(Sound_VIRIDIAN); + music.playef(11); game.returnmenu(); map.nexttowercolour(); break; @@ -2212,8 +1659,8 @@ static void menuactionpress(void) break; case Menu::gameover2: //back - music.playef(Sound_VIRIDIAN); - music.play(Music_PRESENTINGVVVVVV); + music.playef(11); + music.play(6); game.returntomenu(Menu::playmodes); map.nexttowercolour(); break; @@ -2223,58 +1670,52 @@ static void menuactionpress(void) case Menu::unlockintermission: case Menu::unlockflipmode: //back - music.playef(Sound_VIRIDIAN); + music.playef(11); game.createmenu(Menu::play, true); map.nexttowercolour(); break; case Menu::timetrials: - if (game.currentmenuoption == 0 - && game.unlock[Unlock_TIMETRIAL_SPACESTATION1]) + if (game.currentmenuoption == 0 && game.unlock[9]) //space station 1 { - music.playef(Sound_VIRIDIAN); - startmode(Start_TIMETRIAL_SPACESTATION1); + music.playef(11); + startmode(3); } - else if (game.currentmenuoption == 1 - && game.unlock[Unlock_TIMETRIAL_LABORATORY]) + else if (game.currentmenuoption == 1 && game.unlock[10]) //lab { - music.playef(Sound_VIRIDIAN); - startmode(Start_TIMETRIAL_LABORATORY); + music.playef(11); + startmode(4); } - else if (game.currentmenuoption == 2 - && game.unlock[Unlock_TIMETRIAL_TOWER]) + else if (game.currentmenuoption == 2 && game.unlock[11]) //tower { - music.playef(Sound_VIRIDIAN); - startmode(Start_TIMETRIAL_TOWER); + music.playef(11); + startmode(5); } - else if (game.currentmenuoption == 3 - && game.unlock[Unlock_TIMETRIAL_SPACESTATION2]) + else if (game.currentmenuoption == 3 && game.unlock[12]) //station 2 { - music.playef(Sound_VIRIDIAN); - startmode(Start_TIMETRIAL_SPACESTATION2); + music.playef(11); + startmode(6); } - else if (game.currentmenuoption == 4 - && game.unlock[Unlock_TIMETRIAL_WARPZONE]) + else if (game.currentmenuoption == 4 && game.unlock[13]) //warp { - music.playef(Sound_VIRIDIAN); - startmode(Start_TIMETRIAL_WARPZONE); + music.playef(11); + startmode(7); } - else if (game.currentmenuoption == 5 - && game.unlock[Unlock_TIMETRIAL_FINALLEVEL]) + else if (game.currentmenuoption == 5 && game.unlock[14]) //final { - music.playef(Sound_VIRIDIAN); - startmode(Start_TIMETRIAL_FINALLEVEL); + music.playef(11); + startmode(8); } - else if (game.currentmenuoption == 6) + else if (game.currentmenuoption == 6) //go to the time trial menu { //back - music.playef(Sound_VIRIDIAN); + music.playef(11); game.returnmenu(); map.nexttowercolour(); } else { - //Can't do yet! - music.playef(Sound_CRY); + //Can't do yet! play sad sound + music.playef(2); } break; case Menu::timetrialcomplete3: @@ -2282,31 +1723,50 @@ static void menuactionpress(void) { case 0: //back - music.playef(Sound_VIRIDIAN); - music.play(Music_PRESENTINGVVVVVV); + music.playef(11); + music.play(6); game.returntomenu(Menu::timetrials); map.nexttowercolour(); - - /* FIXME: This is kinda bad kludge... but if we unlocked No Death Mode - * while in a Time Trial, the player wouldn't be notified until they went - * back to Menu::play first. This is the only case where something can be - * unlocked without being immediately notified after returning to title. */ - if (game.can_unlock_ndm()) - { - game.unlock_ndm(); - } break; case 1: - /* Replay time trial */ - music.playef(Sound_VIRIDIAN); - startmode((enum StartMode) (game.timetriallevel + Start_FIRST_TIMETRIAL)); + //duplicate the above based on given time trial level! + if (game.timetriallevel == 0) //space station 1 + { + music.playef(11); + startmode(3); + } + else if (game.timetriallevel == 1) //lab + { + music.playef(11); + startmode(4); + } + else if (game.timetriallevel == 2) //tower + { + music.playef(11); + startmode(5); + } + else if (game.timetriallevel == 3) //station 2 + { + music.playef(11); + startmode(6); + } + else if (game.timetriallevel == 4) //warp + { + music.playef(11); + startmode(7); + } + else if (game.timetriallevel == 5) //final + { + music.playef(11); + startmode(8); + } break; } break; case Menu::gamecompletecontinue: case Menu::nodeathmodecomplete2: - music.play(Music_PRESENTINGVVVVVV); - music.playef(Sound_VIRIDIAN); + music.play(6); + music.playef(11); game.returnmenu(); map.nexttowercolour(); break; @@ -2315,13 +1775,13 @@ static void menuactionpress(void) { game.silence_settings_error = true; } - music.playef(Sound_VIRIDIAN); + music.playef(11); game.returnmenu(); map.nexttowercolour(); break; case Menu::errorloadinglevel: case Menu::warninglevellist: - music.playef(Sound_VIRIDIAN); + music.playef(11); game.returnmenu(); map.nexttowercolour(); break; @@ -2341,59 +1801,18 @@ void titleinput(void) game.press_map = false; game.press_interact = false; - bool lang_press_horizontal = false; - if (graphics.flipmode) { if (key.isDown(KEYBOARD_LEFT) || key.isDown(KEYBOARD_DOWN) || key.isDown(KEYBOARD_a) || key.isDown(KEYBOARD_s) || key.controllerWantsRight(true)) game.press_left = true; if (key.isDown(KEYBOARD_RIGHT) || key.isDown(KEYBOARD_UP) || key.isDown(KEYBOARD_d) || key.isDown(KEYBOARD_w) || key.controllerWantsLeft(true)) game.press_right = true; } - else if (game.currentmenuname == Menu::language) - { - if (key.isDown(KEYBOARD_UP) || key.isDown(KEYBOARD_w) || key.controllerWantsUp()) - { - game.press_left = true; - } - if (key.isDown(KEYBOARD_DOWN) || key.isDown(KEYBOARD_s) || key.controllerWantsDown()) - { - game.press_right = true; - } - if (key.isDown(KEYBOARD_LEFT) || key.isDown(KEYBOARD_a) || key.controllerWantsLeft(false) - || key.isDown(KEYBOARD_RIGHT) || key.isDown(KEYBOARD_d) || key.controllerWantsRight(false)) - { - lang_press_horizontal = true; - game.press_right = true; - } - } else { - SDL_Keycode left, right, a, d; - bool controller_up = key.controllerWantsUp(); - bool controller_down = key.controllerWantsDown(); - if (!font::is_rtl(PR_FONT_INTERFACE)) - { - left = KEYBOARD_LEFT; - right = KEYBOARD_RIGHT; - a = KEYBOARD_a; - d = KEYBOARD_d; - controller_up |= key.controllerWantsLeft(false); - controller_down |= key.controllerWantsRight(false); - } - else - { - left = KEYBOARD_RIGHT; - right = KEYBOARD_LEFT; - a = KEYBOARD_d; - d = KEYBOARD_a; - controller_up |= key.controllerWantsRight(false); - controller_down |= key.controllerWantsLeft(false); - } - - if (key.isDown(left) || key.isDown(KEYBOARD_UP) || key.isDown(a) || key.isDown(KEYBOARD_w) || controller_up) + if (key.isDown(KEYBOARD_LEFT) || key.isDown(KEYBOARD_UP) || key.isDown(KEYBOARD_a) || key.isDown(KEYBOARD_w) || key.controllerWantsLeft(true)) { game.press_left = true; } - if (key.isDown(right) || key.isDown(KEYBOARD_DOWN) || key.isDown(d) || key.isDown(KEYBOARD_s) || controller_down) + if (key.isDown(KEYBOARD_RIGHT) || key.isDown(KEYBOARD_DOWN) || key.isDown(KEYBOARD_d) || key.isDown(KEYBOARD_s) || key.controllerWantsRight(true)) { game.press_right = true; } @@ -2406,55 +1825,19 @@ void titleinput(void) if (!game.press_action && !game.press_left && !game.press_right && !key.isDown(27) && !key.isDown(game.controllerButton_esc)) game.jumpheld = false; if (!game.press_map) game.mapheld = false; - if (!game.jumpheld && graphics.fademode == FADE_NONE) + if (!game.jumpheld && graphics.fademode==0) { if (game.press_action || game.press_left || game.press_right || game.press_map || key.isDown(27) || key.isDown(game.controllerButton_esc)) { game.jumpheld = true; } - static bool controller_held = false; - - if ( game.currentmenuname == Menu::controller && - game.currentmenuoption > 0 && - game.currentmenuoption < 6 && - (game.separate_interact || game.currentmenuoption < 5) && - key.controllerButtonDown() ) - { - if (!controller_held) - { - controller_held = true; - updatebuttonmappings(game.currentmenuoption); - game.savestatsandsettings_menu(); - } - return; - } - else - { - controller_held = false; - } - if (game.menustart && game.menucountdown <= 0 && (key.isDown(27) || key.isDown(game.controllerButton_esc))) { - if (game.currentmenuname == Menu::language && loc::pre_title_lang_menu) - { - /* Don't exit from the initial language screen, - * you can't do this on the loading/title screen either. */ - return; - } - else - { - music.playef(Sound_VIRIDIAN); - } - if (game.menutestmode) - { - game.menutestmode = false; - game.returnmenu(); - map.nexttowercolour(); - } - else if (game.currentmenuname == Menu::mainmenu) + music.playef(11); + if (game.currentmenuname == Menu::mainmenu) { game.createmenu(Menu::youwannaquit); map.nexttowercolour(); @@ -2498,63 +1881,7 @@ void titleinput(void) { if (game.slidermode == SLIDER_NONE) { - if (game.currentmenuname == Menu::language) - { - /* The language screen has two columns and navigation in four directions. - * The second column may have one less option than the first. */ - int n_options = game.menuoptions.size(); - int twocol_voptions = n_options - (n_options/2); - - if (lang_press_horizontal) - { - if (game.currentmenuoption < twocol_voptions) - { - game.currentmenuoption += twocol_voptions; - if (game.currentmenuoption >= n_options) - { - game.currentmenuoption = n_options - 1; - } - } - else - { - game.currentmenuoption -= twocol_voptions; - } - } - else - { - /* Vertical movement */ - int min_option; - int max_option; - if (game.currentmenuoption < twocol_voptions) - { - min_option = 0; - max_option = twocol_voptions-1; - } - else - { - min_option = twocol_voptions; - max_option = n_options-1; - } - - if (game.press_left) /* Up, lol */ - { - game.currentmenuoption--; - if (game.currentmenuoption < min_option) - { - game.currentmenuoption = max_option; - } - } - else if (game.press_right) /* Down, lol */ - { - game.currentmenuoption++; - if (game.currentmenuoption > max_option) - { - game.currentmenuoption = min_option; - } - } - } - } - else if (game.press_left) + if (game.press_left) { game.currentmenuoption--; } @@ -2562,11 +1889,6 @@ void titleinput(void) { game.currentmenuoption++; } - - if (game.currentmenuname == Menu::controller && (game.press_left || game.press_right)) - { - game.gpmenu_confirming = false; - } } else { @@ -2582,8 +1904,8 @@ void titleinput(void) if (!game.menustart) { game.menustart = true; - music.play(Music_PRESENTINGVVVVVV); - music.playef(Sound_GAMESAVED); + music.play(6); + music.playef(18); game.screenshake = 10; game.flashlight = 5; } @@ -2592,11 +1914,29 @@ void titleinput(void) menuactionpress(); } } + if ( game.currentmenuname == Menu::controller && + game.currentmenuoption > 0 && + game.currentmenuoption < 6 && + key.controllerButtonDown() ) + { + updatebuttonmappings(game.currentmenuoption); + music.playef(11); + game.savestatsandsettings_menu(); + } + } if (fadetomode) { - handlefadetomode(); + if (fadetomodedelay > 0) + { + --fadetomodedelay; + } + else + { + fadetomode = false; + script.startgamemode(gotomode); + } } } @@ -2608,11 +1948,6 @@ void gameinput(void) if(!script.running) { - if (roomname_translator::enabled && roomname_translator::overlay_input()) - { - return; - } - game.press_left = false; game.press_right = false; game.press_action = false; @@ -2644,12 +1979,6 @@ void gameinput(void) game.press_map = true; } - level_debugger::input(); - if (level_debugger::is_pausing()) - { - return; - } - if (game.advancetext) { if (game.pausescript) @@ -2673,7 +2002,6 @@ void gameinput(void) || !game.glitchrunkludge) { game.state++; - game.unlockstate(); } game.jumpheld = true; game.glitchrunkludge=true; @@ -2699,17 +2027,18 @@ void gameinput(void) game.interactheld = false; } - if (game.intimetrial && graphics.fademode == FADE_FULLY_BLACK && game.quickrestartkludge && !game.translator_exploring) + if (game.intimetrial && graphics.fademode == 1 && game.quickrestartkludge) { //restart the time trial game.quickrestartkludge = false; - script.startgamemode((enum StartMode) (game.timetriallevel + Start_FIRST_TIMETRIAL)); + script.startgamemode(game.timetriallevel + 3); game.deathseq = -1; game.completestop = false; game.hascontrol = false; } //Returning to editor mode must always be possible +#if !defined(NO_CUSTOM_LEVELS) if (map.custommode && !map.custommodeforreal) { if ((game.press_map || key.isDown(27)) && !game.mapheld) @@ -2728,6 +2057,7 @@ void gameinput(void) } } } +#endif //Entity type 0 is player controled bool has_control = false; @@ -2760,7 +2090,7 @@ void gameinput(void) if (interact_pressed && !script.running) { - if (game.activetele && game.readytotele > 20 && (!game.intimetrial || game.translator_exploring_allowtele)) + if (game.activetele && game.readytotele > 20 && !game.intimetrial) { enter_already_processed = true; if(int(SDL_fabsf(obj.entities[ie].vx))<=1 && int(obj.entities[ie].vy)==0) @@ -2778,23 +2108,23 @@ void gameinput(void) int player = obj.getplayer(); if (INBOUNDS_VEC(player, obj.entities)) { - obj.entities[player].colour = EntityColour_TELEPORTER_FLASHING; + obj.entities[player].colour = 102; } int teleporter = obj.getteleporter(); if (INBOUNDS_VEC(teleporter, obj.entities)) { obj.entities[teleporter].tile = 6; - obj.entities[teleporter].colour = EntityColour_TELEPORTER_FLASHING; + obj.entities[teleporter].colour = 102; } //which teleporter script do we use? it depends on the companion! - game.setstate(4000); - game.setstatedelay(0); + game.state = 4000; + game.statedelay = 0; } - else if (game.companion == 0 && !game.translator_exploring_allowtele) + else if (game.companion == 0) { //Alright, normal teleporting - game.mapmenuchange(TELEPORTERMODE, true); + game.mapmenuchange(TELEPORTERMODE); game.useteleporter = true; game.initteleportermode(); @@ -2809,20 +2139,20 @@ void gameinput(void) int player = obj.getplayer(); if (INBOUNDS_VEC(player, obj.entities)) { - obj.entities[player].colour = EntityColour_TELEPORTER_FLASHING; + obj.entities[player].colour = 102; } int companion = obj.getcompanion(); - if(INBOUNDS_VEC(companion, obj.entities)) obj.entities[companion].colour = EntityColour_TELEPORTER_FLASHING; + if(INBOUNDS_VEC(companion, obj.entities)) obj.entities[companion].colour = 102; int teleporter = obj.getteleporter(); if (INBOUNDS_VEC(teleporter, obj.entities)) { obj.entities[teleporter].tile = 6; - obj.entities[teleporter].colour = EntityColour_TELEPORTER_FLASHING; + obj.entities[teleporter].colour = 102; } //which teleporter script do we use? it depends on the companion! - game.setstate(3000); - game.setstatedelay(0); + game.state = 3000; + game.statedelay = 0; } } } @@ -2838,6 +2168,38 @@ void gameinput(void) } } + if (game.press_left) + { + game.tapleft++; + } + else + { + if (game.tapleft <= 4 && game.tapleft > 0) + { + if (obj.entities[ie].vx < 0.0f) + { + obj.entities[ie].vx = 0.0f; + } + } + game.tapleft = 0; + } + if (game.press_right) + { + game.tapright++; + } + else + { + if (game.tapright <= 4 && game.tapright > 0) + { + if (obj.entities[ie].vx > 0.0f) + { + obj.entities[ie].vx = 0.0f; + } + } + game.tapright = 0; + } + + if(game.press_left) { obj.entities[ie].ax = -3; @@ -2848,121 +2210,46 @@ void gameinput(void) obj.entities[ie].ax = 3; obj.entities[ie].dir = 1; } + + if (!game.press_action) + { + game.jumppressed = 0; + game.jumpheld = false; + } + + if (game.press_action && !game.jumpheld) + { + game.jumppressed = 5; + game.jumpheld = true; + } + + if (game.jumppressed > 0) + { + game.jumppressed--; + if (obj.entities[ie].onground>0 && game.gravitycontrol == 0) + { + game.gravitycontrol = 1; + obj.entities[ie].vy = -4; + obj.entities[ie].ay = -3; + music.playef(0); + game.jumppressed = 0; + game.totalflips++; + } + if (obj.entities[ie].onroof>0 && game.gravitycontrol == 1) + { + game.gravitycontrol = 0; + obj.entities[ie].vy = 4; + obj.entities[ie].ay = 3; + music.playef(1); + game.jumppressed = 0; + game.totalflips++; + } + } } } } - if (has_control) - { - if (game.press_left) - { - game.tapleft++; - } - else - { - if (game.tapleft <= 4 && game.tapleft > 0) - { - for (size_t ie = 0; ie < obj.entities.size(); ++ie) - { - if (obj.entities[ie].rule == 0) - { - if (obj.entities[ie].vx < 0.0f) - { - obj.entities[ie].vx = 0.0f; - } - } - } - } - game.tapleft = 0; - } - if (game.press_right) - { - game.tapright++; - } - else - { - if (game.tapright <= 4 && game.tapright > 0) - { - for (size_t ie = 0; ie < obj.entities.size(); ++ie) - { - if (obj.entities[ie].rule == 0) - { - if (obj.entities[ie].vx > 0.0f) - { - obj.entities[ie].vx = 0.0f; - } - } - } - } - game.tapright = 0; - } - - if (!game.press_action) - { - game.jumppressed = 0; - game.jumpheld = false; - } - - if (game.press_action && !game.jumpheld) - { - game.jumppressed = 5; - game.jumpheld = true; - } - - std::vector player_entities; - for (size_t ie = 0; ie < obj.entities.size(); ie++) - { - if (obj.entities[ie].rule == 0) - { - player_entities.push_back(ie); - } - } - - for (size_t ie = 0; ie < obj.entities.size(); ie++) - { - const bool process_flip = obj.entities[ie].rule == 0 && - game.jumppressed > 0; - if (!process_flip) - { - continue; - } - - game.jumppressed--; - if (obj.entities[ie].onground > 0 && game.gravitycontrol == 0) - { - game.gravitycontrol = 1; - for (size_t j = 0; j < player_entities.size(); j++) - { - const size_t e = player_entities[j]; - if (obj.entities[e].onground > 0 || obj.entities[e].onroof > 0) - { - obj.entities[e].vy = -4; - obj.entities[e].ay = -3; - } - } - music.playef(Sound_FLIP); - game.jumppressed = 0; - game.totalflips++; - } - if (obj.entities[ie].onroof > 0 && game.gravitycontrol == 1) - { - game.gravitycontrol = 0; - for (size_t j = 0; j < player_entities.size(); j++) - { - const size_t e = player_entities[j]; - if (obj.entities[e].onground > 0 || obj.entities[e].onroof > 0) - { - obj.entities[e].vy = 4; - obj.entities[e].ay = 3; - } - } - music.playef(Sound_UNFLIP); - game.jumppressed = 0; - game.totalflips++; - } - } - } - else + if (!has_control) { //Simple detection of keypresses outside player control, will probably scrap this (expand on //advance text function) @@ -2987,38 +2274,32 @@ void gameinput(void) // Do nothing } else if (game.swnmode == 1 - && (game.swngame == SWN_SUPERGRAVITRON || - game.swngame == SWN_START_SUPERGRAVITRON_STEP_1 || - game.swngame == SWN_START_SUPERGRAVITRON_STEP_2)) + && (game.swngame == 1 || game.swngame == 6 || game.swngame == 7)) { //quitting the super gravitron game.mapheld = true; //Quit menu, same conditions as in game menu - game.mapmenuchange(MAPMODE, true); + game.mapmenuchange(MAPMODE); game.gamesaved = false; game.gamesavefailed = false; game.menupage = 20; // The Map Page } - else if (game.intimetrial && graphics.fademode == FADE_NONE && !game.translator_exploring) + else if (game.intimetrial && graphics.fademode == 0) { //Quick restart of time trial - graphics.fademode = FADE_START_FADEOUT; + graphics.fademode = 2; game.completestop = true; music.fadeout(); game.quickrestartkludge = true; } - else if (game.intimetrial && !game.translator_exploring) + else if (game.intimetrial) { //Do nothing if we're in a Time Trial but a fade animation is playing } - else if (map.custommode && !map.custommodeforreal) - { - // We're playtesting in the editor so don't do anything - } else { //Normal map screen, do transition later - game.mapmenuchange(MAPMODE, true); + game.mapmenuchange(MAPMODE); map.cursordelay = 0; map.cursorstate = 0; game.gamesaved = false; @@ -3039,7 +2320,7 @@ void gameinput(void) { game.mapheld = true; //Quit menu, same conditions as in game menu - game.mapmenuchange(MAPMODE, true); + game.mapmenuchange(MAPMODE); game.gamesaved = false; game.gamesavefailed = false; game.menupage = 30; // Pause screen @@ -3067,7 +2348,7 @@ void mapinput(void) game.press_map = false; game.press_interact = false; - if (version2_2 && graphics.fademode == FADE_FULLY_BLACK && graphics.menuoffset == 0) + if (version2_2 && graphics.fademode == 1 && graphics.menuoffset == 0) { // Deliberate re-addition of the glitchy gamestate-based fadeout! @@ -3089,17 +2370,17 @@ void mapinput(void) if (game.menupage >= 20 && game.menupage <= 21) { - game.setstate(96); - game.setstatedelay(0); + game.state = 96; + game.statedelay = 0; } else { // Produces more glitchiness! Necessary for credits warp to work. script.running = false; - graphics.textboxes.clear(); + graphics.textbox.clear(); - game.setstate(80); - game.setstatedelay(0); + game.state = 80; + game.statedelay = 0; } } @@ -3112,7 +2393,7 @@ void mapinput(void) else { game.quittomenu(); - music.play(Music_PRESENTINGVVVVVV); // should be after game.quittomenu() + music.play(6); //should be after game.quittomenu() game.fadetomenu = false; } } @@ -3132,35 +2413,13 @@ void mapinput(void) if(graphics.menuoffset==0 && ((!version2_2 && !game.fadetomenu && game.fadetomenudelay <= 0 && !game.fadetolab && game.fadetolabdelay <= 0) - || graphics.fademode == FADE_NONE)) + || graphics.fademode == 0)) { - SDL_Keycode left, right, a, d; - bool controller_up = key.controllerWantsUp(); - bool controller_down = key.controllerWantsDown(); - if (!font::is_rtl(PR_FONT_INTERFACE)) - { - left = KEYBOARD_LEFT; - right = KEYBOARD_RIGHT; - a = KEYBOARD_a; - d = KEYBOARD_d; - controller_up |= key.controllerWantsLeft(false); - controller_down |= key.controllerWantsRight(false); - } - else - { - left = KEYBOARD_RIGHT; - right = KEYBOARD_LEFT; - a = KEYBOARD_d; - d = KEYBOARD_a; - controller_up |= key.controllerWantsRight(false); - controller_down |= key.controllerWantsLeft(false); - } - - if (key.isDown(left) || key.isDown(KEYBOARD_UP) || key.isDown(a) || key.isDown(KEYBOARD_w)|| controller_up) + if (key.isDown(KEYBOARD_LEFT) || key.isDown(KEYBOARD_UP) || key.isDown(KEYBOARD_a) || key.isDown(KEYBOARD_w)|| key.controllerWantsLeft(true)) { game.press_left = true; } - if (key.isDown(right) || key.isDown(KEYBOARD_DOWN) || key.isDown(d) || key.isDown(KEYBOARD_s)|| controller_down) + if (key.isDown(KEYBOARD_RIGHT) || key.isDown(KEYBOARD_DOWN) || key.isDown(KEYBOARD_d) || key.isDown(KEYBOARD_s)|| key.controllerWantsRight(true)) { game.press_right = true; } @@ -3189,7 +2448,7 @@ void mapinput(void) { graphics.resumegamemode = true; } - music.playef(Sound_VIRIDIAN); + music.playef(11); } } else @@ -3282,13 +2541,12 @@ static void mapmenuactionpress(const bool version2_2) int i = obj.getplayer(); if (INBOUNDS_VEC(i, obj.entities)) { - obj.entities[i].colour = EntityColour_TELEPORTER_FLASHING; + obj.entities[i].colour = 102; } //which teleporter script do we use? it depends on the companion! - game.setstate(4000); - game.setstatedelay(0); - game.lockstate(); + game.state = 4000; + game.statedelay = 0; } break; case 3: @@ -3296,18 +2554,22 @@ static void mapmenuactionpress(const bool version2_2) { game.flashlight = 5; game.screenshake = 10; - music.playef(Sound_GAMESAVED); + music.playef(18); game.savetime = game.timestring(); + game.savearea = map.currentarea(map.area(game.roomx, game.roomy)); game.savetrinkets = game.trinkets(); - bool success; + if (game.roomx >= 102 && game.roomx <= 104 && game.roomy >= 110 && game.roomy <= 111) game.savearea = "The Ship"; + bool success; +#if !defined(NO_CUSTOM_LEVELS) if(map.custommodeforreal) { - success = game.customsavequick(cl.ListOfMetaData[game.playcustomlevel].filename); + success = game.customsavequick(ed.ListOfMetaData[game.playcustomlevel].filename); } else +#endif { success = game.savequick(); } @@ -3318,13 +2580,16 @@ static void mapmenuactionpress(const bool version2_2) case 10: //return to pause menu - music.playef(Sound_VIRIDIAN); + music.playef(11); game.menupage = 32; break; case 11: //quit to menu - graphics.fademode = FADE_START_FADEOUT; + //Kill contents of offset render buffer, since we do that for some reason. + //This fixes an apparent frame flicker. + ClearSurface(graphics.tempBuffer); + graphics.fademode = 2; music.fadeout(); map.nexttowercolour(); if (!version2_2) @@ -3332,39 +2597,39 @@ static void mapmenuactionpress(const bool version2_2) game.fadetomenu = true; game.fadetomenudelay = 19; } - music.playef(Sound_VIRIDIAN); + music.playef(11); break; case 20: //return to game graphics.resumegamemode = true; - music.playef(Sound_VIRIDIAN); + music.playef(11); break; case 21: //quit to menu game.swnmode = false; - graphics.fademode = FADE_START_FADEOUT; + graphics.fademode = 2; music.fadeout(); if (!version2_2) { game.fadetolab = true; game.fadetolabdelay = 19; } - music.playef(Sound_VIRIDIAN); + music.playef(11); break; case 30: // Return to game graphics.resumegamemode = true; - music.playef(Sound_VIRIDIAN); + music.playef(11); break; case 31: // Graphic options and game options - music.playef(Sound_VIRIDIAN); + music.playef(11); game.gamestate = TITLEMODE; graphics.flipmode = false; game.ingame_titlemode = true; graphics.ingame_fademode = graphics.fademode; - graphics.fademode = FADE_NONE; + graphics.fademode = 0; // Set this before we create the menu game.kludge_ingametemp = game.currentmenuname; @@ -3373,7 +2638,7 @@ static void mapmenuactionpress(const bool version2_2) break; case 32: // Go to quit prompt - music.playef(Sound_VIRIDIAN); + music.playef(11); game.menupage = 10; break; } @@ -3426,7 +2691,7 @@ void teleporterinput(void) // Close teleporter menu graphics.resumegamemode = true; } - music.playef(Sound_VIRIDIAN); + music.playef(11); } } else @@ -3447,7 +2712,7 @@ void teleporterinput(void) { for (size_t i = 0; i < map.teleporters.size(); i++) { - SDL_Point& tele = map.teleporters[i]; + point& tele = map.teleporters[i]; if (map.isexplored(tele.x, tele.y)) { @@ -3504,18 +2769,18 @@ void teleporterinput(void) int i = obj.getplayer(); if (INBOUNDS_VEC(i, obj.entities)) { - obj.entities[i].colour = EntityColour_TELEPORTER_FLASHING; + obj.entities[i].colour = 102; } i = obj.getteleporter(); if (INBOUNDS_VEC(i, obj.entities)) { obj.entities[i].tile = 6; - obj.entities[i].colour = EntityColour_TELEPORTER_FLASHING; + obj.entities[i].colour = 102; } //which teleporter script do we use? it depends on the companion! - game.setstate(4000); - game.setstatedelay(0); + game.state = 4000; + game.statedelay = 0; } } } @@ -3544,9 +2809,9 @@ void gamecompleteinput(void) game.creditposition -= 6; if (game.creditposition <= -Credits::creditmaxposition) { - if (graphics.fademode == FADE_NONE) + if(graphics.fademode==0) { - graphics.fademode = FADE_START_FADEOUT; + graphics.fademode = 2; } game.creditposition = -Credits::creditmaxposition; } @@ -3563,17 +2828,12 @@ void gamecompleteinput(void) if(game.press_map) { //Return to game - if(graphics.fademode == FADE_NONE) + if(graphics.fademode==0) { - graphics.fademode = FADE_START_FADEOUT; + graphics.fademode = 2; } } } - - if (!game.press_map) - { - game.mapheld = false; - } } void gamecompleteinput2(void) @@ -3593,9 +2853,9 @@ void gamecompleteinput2(void) game.oldcreditposx++; if (game.creditposy >= 30) { - if(graphics.fademode == FADE_NONE) + if(graphics.fademode==0) { - graphics.fademode = FADE_START_FADEOUT; + graphics.fademode = 2; music.fadeout(); } } @@ -3608,16 +2868,11 @@ void gamecompleteinput2(void) if(game.press_map) { //Return to game - if(graphics.fademode == FADE_NONE) + if(graphics.fademode==0) { - graphics.fademode = FADE_START_FADEOUT; + graphics.fademode = 2; music.fadeout(); } } } - - if (!game.press_map) - { - game.mapheld = false; - } } diff --git a/desktop_version/src/InterimVersion.h b/desktop_version/src/InterimVersion.h deleted file mode 100644 index f2780b6c..00000000 --- a/desktop_version/src/InterimVersion.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef INTERIMVERSION_H -#define INTERIMVERSION_H - -#ifdef INTERIM_VERSION_EXISTS - -#ifdef __cplusplus -extern "C" -{ -#endif - -extern const char* INTERIM_COMMIT; - -extern const char* COMMIT_DATE; - -extern const char* BRANCH_NAME; - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif /* INTERIM_VERSION_EXISTS */ - -#endif /* INTERIMVERSION_H */ diff --git a/desktop_version/src/InterimVersion.in.c b/desktop_version/src/InterimVersion.in.c deleted file mode 100644 index d5d361a3..00000000 --- a/desktop_version/src/InterimVersion.in.c +++ /dev/null @@ -1,5 +0,0 @@ -const char* INTERIM_COMMIT = "@INTERIM_COMMIT@"; - -const char* COMMIT_DATE = "@COMMIT_DATE@"; - -const char* BRANCH_NAME = "@BRANCH_NAME@"; diff --git a/desktop_version/src/KeyPoll.cpp b/desktop_version/src/KeyPoll.cpp index 4439d470..bce3720e 100644 --- a/desktop_version/src/KeyPoll.cpp +++ b/desktop_version/src/KeyPoll.cpp @@ -1,660 +1,472 @@ #define KEY_DEFINITION #include "KeyPoll.h" +#include #include +#include -#include "Alloc.h" -#include "ButtonGlyphs.h" -#include "Constants.h" -#include "Editor.h" #include "Exit.h" #include "Game.h" #include "GlitchrunnerMode.h" #include "Graphics.h" -#include "GraphicsUtil.h" -#include "Localization.h" -#include "LocalizationMaint.h" -#include "LocalizationStorage.h" #include "Music.h" -#include "Screen.h" -#include "UTF8.h" -#include "UtilityClass.h" -#include "Vlogging.h" - -bool SaveScreenshot(void); int inline KeyPoll::getThreshold(void) { - switch (sensitivity) - { - case 0: - return 28000; - case 1: - return 16000; - case 2: - return 8000; - case 3: - return 4000; - case 4: - return 2000; - } + switch (sensitivity) + { + case 0: + return 28000; + case 1: + return 16000; + case 2: + return 8000; + case 3: + return 4000; + case 4: + return 2000; + } - return 8000; + return 8000; } KeyPoll::KeyPoll(void) { - xVel = 0; - yVel = 0; - // 0..5 - sensitivity = 2; + xVel = 0; + yVel = 0; + // 0..5 + sensitivity = 2; - keybuffer = ""; - imebuffer = ""; - imebuffer_start = 0; - imebuffer_length = 0; - leftbutton=0; rightbutton=0; middlebutton=0; - mousex = 0; - mousey = 0; - resetWindow = 0; - pressedbackspace=false; + keybuffer=""; + leftbutton=0; rightbutton=0; middlebutton=0; + mx=0; my=0; + resetWindow = 0; + pressedbackspace=false; - linealreadyemptykludge = false; + linealreadyemptykludge = false; - isActive = true; + isActive = true; } void KeyPoll::enabletextentry(void) { - keybuffer = ""; - imebuffer = ""; - imebuffer_start = 0; - imebuffer_length = 0; - SDL_StartTextInput(); + keybuffer=""; + SDL_StartTextInput(); } void KeyPoll::disabletextentry(void) { - SDL_StopTextInput(); - imebuffer = ""; - imebuffer_start = 0; - imebuffer_length = 0; + SDL_StopTextInput(); } bool KeyPoll::textentry(void) { - return SDL_IsTextInputActive() == SDL_TRUE; + return SDL_IsTextInputActive() == SDL_TRUE; } void KeyPoll::toggleFullscreen(void) { - gameScreen.toggleFullScreen(); + if (graphics.screenbuffer != NULL) + { + graphics.screenbuffer->toggleFullScreen(); + } - keymap.clear(); /* we lost the input due to a new window. */ - if (GlitchrunnerMode_less_than_or_equal(Glitchrunner2_2)) - { - game.press_left = false; - game.press_right = false; - game.press_action = true; - game.press_map = false; - } + keymap.clear(); /* we lost the input due to a new window. */ + if (GlitchrunnerMode_less_than_or_equal(Glitchrunner2_2)) + { + game.press_left = false; + game.press_right = false; + game.press_action = true; + game.press_map = false; + } } static int changemousestate( - int timeout, - const bool show, - const bool hide + int timeout, + const bool show, + const bool hide ) { - int prev; - int new_; + int prev; + int new_; - if (timeout > 0) - { - return --timeout; - } + if (timeout > 0) + { + return --timeout; + } - /* If we want to both show and hide at the same time, prioritize showing */ - if (show) - { - new_ = SDL_ENABLE; - } - else if (hide) - { - new_ = SDL_DISABLE; - } - else - { - return timeout; - } + /* If we want to both show and hide at the same time, prioritize showing */ + if (show) + { + new_ = SDL_ENABLE; + } + else if (hide) + { + new_ = SDL_DISABLE; + } + else + { + return timeout; + } - prev = SDL_ShowCursor(SDL_QUERY); + prev = SDL_ShowCursor(SDL_QUERY); - if (prev == new_) - { - return timeout; - } + if (prev == new_) + { + return timeout; + } - SDL_ShowCursor(new_); + SDL_ShowCursor(new_); - switch (new_) - { - case SDL_DISABLE: - timeout = 0; - break; - case SDL_ENABLE: - timeout = 30; - break; - } + switch (new_) + { + case SDL_DISABLE: + timeout = 0; + break; + case SDL_ENABLE: + timeout = 30; + break; + } - return timeout; -} - -/* Also used in Input.cpp. */ -void recomputetextboxes(void); - -bool cycle_language(bool should_recompute_textboxes) -{ - extern KeyPoll key; - - if (game.gamestate == TITLEMODE - && game.currentmenuname == Menu::translator_options_cutscenetest) - { - /* Unfortunately, despite how it may appear to be working, the options - * are actually language-specific, and the order could be totally - * different between languages too. So we can't cycle in this menu. */ - music.playef(Sound_CRY); - return should_recompute_textboxes; - } - if (game.translator_cutscene_test) - { - /* Refuse cycling here for similar reasons, even if it seems like it's - * working. The text boxes are based off of the language XML and - * could be completely different between languages. */ - music.playef(Sound_CRY); - return should_recompute_textboxes; - } - - int i = loc::languagelist_curlang; - if (key.keymap[SDLK_LSHIFT]) - { - /* Backwards */ - i--; - } - else - { - /* Forwards */ - i++; - } - if (!loc::languagelist.empty()) - { - i = POS_MOD(i, (int) loc::languagelist.size()); - - loc::languagelist_curlang = i; - loc::lang = loc::languagelist[i].code; - loc::loadtext(false); - graphics.grphx.init_translations(); - - should_recompute_textboxes = true; - } - - if (game.gamestate == TITLEMODE - || (game.gamestate == EDITORMODE && ed.state == EditorState_MENU)) - { - if (game.currentmenuname == Menu::translator_options_limitscheck) - { - loc::local_limits_check(); - } - - int temp = game.menucountdown; - game.createmenu(game.currentmenuname, true); - game.menucountdown = temp; - - if (game.currentmenuname == Menu::language) - { - game.currentmenuoption = i; - } - } - - return should_recompute_textboxes; + return timeout; } void KeyPoll::Poll(void) { - static int raw_mousex = 0; - static int raw_mousey = 0; - static int mousetoggletimeout = 0; - bool showmouse = false; - bool hidemouse = false; - bool altpressed = false; - bool fullscreenkeybind = false; - SDL_GameController *controller = NULL; - SDL_Event evt; - bool should_recompute_textboxes = false; - bool active_input_device_changed = false; - bool keyboard_was_active = BUTTONGLYPHS_keyboard_is_active(); - while (SDL_PollEvent(&evt)) - { - switch (evt.type) - { - /* Keyboard Input */ - case SDL_KEYDOWN: - { - keymap[evt.key.keysym.sym] = true; + static int mousetoggletimeout = 0; + bool showmouse = false; + bool hidemouse = false; + bool altpressed = false; + bool fullscreenkeybind = false; + SDL_Event evt; + while (SDL_PollEvent(&evt)) + { + switch (evt.type) + { + /* Keyboard Input */ + case SDL_KEYDOWN: + { + keymap[evt.key.keysym.sym] = true; - if (evt.key.keysym.sym == SDLK_BACKSPACE) - { - pressedbackspace = true; - } + if (evt.key.keysym.sym == SDLK_BACKSPACE) + { + pressedbackspace = true; + } #ifdef __APPLE__ /* OSX prefers the command keys over the alt keys. -flibit */ - altpressed = keymap[SDLK_LGUI] || keymap[SDLK_RGUI]; + altpressed = keymap[SDLK_LGUI] || keymap[SDLK_RGUI]; #else - altpressed = keymap[SDLK_LALT] || keymap[SDLK_RALT]; + altpressed = keymap[SDLK_LALT] || keymap[SDLK_RALT]; #endif - bool returnpressed = evt.key.keysym.sym == SDLK_RETURN; - bool fpressed = evt.key.keysym.sym == SDLK_f; - bool f11pressed = evt.key.keysym.sym == SDLK_F11; - if ((altpressed && (returnpressed || fpressed)) || f11pressed) - { - fullscreenkeybind = true; - } + bool returnpressed = evt.key.keysym.sym == SDLK_RETURN; + bool fpressed = evt.key.keysym.sym == SDLK_f; + bool f11pressed = evt.key.keysym.sym == SDLK_F11; + if ((altpressed && (returnpressed || fpressed)) || f11pressed) + { + fullscreenkeybind = true; + } - if (loc::show_translator_menu && evt.key.keysym.sym == SDLK_F8 && !evt.key.repeat) - { - if (keymap[SDLK_LCTRL]) - { - /* Debug keybind to cycle language. */ - should_recompute_textboxes = cycle_language(should_recompute_textboxes); - } - else - { - /* Reload language files */ - loc::loadtext(false); - graphics.grphx.init_translations(); - music.playef(Sound_COIN); - } - } + if (textentry()) + { + if (evt.key.keysym.sym == SDLK_BACKSPACE && !keybuffer.empty()) + { + std::string::iterator iter = keybuffer.end(); + utf8::unchecked::prior(iter); + keybuffer = keybuffer.substr(0, iter - keybuffer.begin()); + if (keybuffer.empty()) + { + linealreadyemptykludge = true; + } + } + else if ( evt.key.keysym.sym == SDLK_v && + keymap[SDLK_LCTRL] ) + { + char* text = SDL_GetClipboardText(); + if (text != NULL) + { + keybuffer += text; + SDL_free(text); + } + } + } + break; + } + case SDL_KEYUP: + keymap[evt.key.keysym.sym] = false; + if (evt.key.keysym.sym == SDLK_BACKSPACE) + { + pressedbackspace = false; + } + break; + case SDL_TEXTINPUT: + if (!altpressed) + { + keybuffer += evt.text.text; + } + break; - if (evt.key.keysym.sym == SDLK_F6 && !evt.key.repeat) - { - const bool success = SaveScreenshot(); - game.old_screenshot_border_timer = 255; - game.screenshot_border_timer = 255; - game.screenshot_saved_success = success; - } + /* Mouse Input */ + case SDL_MOUSEMOTION: + mx = evt.motion.x; + my = evt.motion.y; + break; + case SDL_MOUSEBUTTONDOWN: + switch (evt.button.button) + { + case SDL_BUTTON_LEFT: + mx = evt.button.x; + my = evt.button.y; + leftbutton = 1; + break; + case SDL_BUTTON_RIGHT: + mx = evt.button.x; + my = evt.button.y; + rightbutton = 1; + break; + case SDL_BUTTON_MIDDLE: + mx = evt.button.x; + my = evt.button.y; + middlebutton = 1; + break; + } + break; + case SDL_MOUSEBUTTONUP: + switch (evt.button.button) + { + case SDL_BUTTON_LEFT: + mx = evt.button.x; + my = evt.button.y; + leftbutton=0; + break; + case SDL_BUTTON_RIGHT: + mx = evt.button.x; + my = evt.button.y; + rightbutton=0; + break; + case SDL_BUTTON_MIDDLE: + mx = evt.button.x; + my = evt.button.y; + middlebutton=0; + break; + } + break; - BUTTONGLYPHS_keyboard_set_active(true); + /* Controller Input */ + case SDL_CONTROLLERBUTTONDOWN: + buttonmap[(SDL_GameControllerButton) evt.cbutton.button] = true; + break; + case SDL_CONTROLLERBUTTONUP: + buttonmap[(SDL_GameControllerButton) evt.cbutton.button] = false; + break; + case SDL_CONTROLLERAXISMOTION: + { + const int threshold = getThreshold(); + switch (evt.caxis.axis) + { + case SDL_CONTROLLER_AXIS_LEFTX: + if ( evt.caxis.value > -threshold && + evt.caxis.value < threshold ) + { + xVel = 0; + } + else + { + xVel = (evt.caxis.value > 0) ? 1 : -1; + } + break; + case SDL_CONTROLLER_AXIS_LEFTY: + if ( evt.caxis.value > -threshold && + evt.caxis.value < threshold ) + { + yVel = 0; + } + else + { + yVel = (evt.caxis.value > 0) ? 1 : -1; + } + break; + } + break; + } + case SDL_CONTROLLERDEVICEADDED: + { + SDL_GameController *toOpen = SDL_GameControllerOpen(evt.cdevice.which); + printf( + "Opened SDL_GameController ID #%i, %s\n", + evt.cdevice.which, + SDL_GameControllerName(toOpen) + ); + controllers[SDL_JoystickInstanceID(SDL_GameControllerGetJoystick(toOpen))] = toOpen; + break; + } + case SDL_CONTROLLERDEVICEREMOVED: + { + SDL_GameController *toClose = controllers[evt.cdevice.which]; + controllers.erase(evt.cdevice.which); + printf("Closing %s\n", SDL_GameControllerName(toClose)); + SDL_GameControllerClose(toClose); + break; + } - if (textentry()) - { - if (evt.key.keysym.sym == SDLK_BACKSPACE && !keybuffer.empty()) - { - keybuffer.erase(UTF8_backspace(keybuffer.c_str(), keybuffer.length())); - if (keybuffer.empty()) - { - linealreadyemptykludge = true; - } - } - else if ( evt.key.keysym.sym == SDLK_v && - keymap[SDLK_LCTRL] ) - { - char* text = SDL_GetClipboardText(); - if (text != NULL) - { - keybuffer += text; - VVV_free(text); - } - } - else if ( evt.key.keysym.sym == SDLK_x && - keymap[SDLK_LCTRL] ) - { - if (SDL_SetClipboardText(keybuffer.c_str()) == 0) - { - keybuffer = ""; - } - } - } - break; - } - case SDL_KEYUP: - keymap[evt.key.keysym.sym] = false; - if (evt.key.keysym.sym == SDLK_BACKSPACE) - { - pressedbackspace = false; - } - break; - case SDL_TEXTINPUT: - if (!altpressed) - { - keybuffer += evt.text.text; - } - break; - case SDL_TEXTEDITING: - imebuffer = evt.edit.text; - imebuffer_start = evt.edit.start; - imebuffer_length = evt.edit.length; - break; - case SDL_TEXTEDITING_EXT: - imebuffer = evt.editExt.text; - imebuffer_start = evt.editExt.start; - imebuffer_length = evt.editExt.length; - SDL_free(evt.editExt.text); - break; + /* Window Events */ + case SDL_WINDOWEVENT: + switch (evt.window.event) + { + /* Window Resize */ + case SDL_WINDOWEVENT_RESIZED: + if (SDL_GetWindowFlags( + SDL_GetWindowFromID(evt.window.windowID) + ) & SDL_WINDOW_INPUT_FOCUS) + { + resetWindow = true; + } + break; - /* Mouse Input */ - case SDL_MOUSEMOTION: - raw_mousex = evt.motion.x; - raw_mousey = evt.motion.y; - break; - case SDL_MOUSEBUTTONDOWN: - switch (evt.button.button) - { - case SDL_BUTTON_LEFT: - raw_mousex = evt.button.x; - raw_mousey = evt.button.y; - leftbutton = 1; - break; - case SDL_BUTTON_RIGHT: - raw_mousex = evt.button.x; - raw_mousey = evt.button.y; - rightbutton = 1; - break; - case SDL_BUTTON_MIDDLE: - raw_mousex = evt.button.x; - raw_mousey = evt.button.y; - middlebutton = 1; - break; - } - break; - case SDL_MOUSEBUTTONUP: - switch (evt.button.button) - { - case SDL_BUTTON_LEFT: - raw_mousex = evt.button.x; - raw_mousey = evt.button.y; - leftbutton=0; - break; - case SDL_BUTTON_RIGHT: - raw_mousex = evt.button.x; - raw_mousey = evt.button.y; - rightbutton=0; - break; - case SDL_BUTTON_MIDDLE: - raw_mousex = evt.button.x; - raw_mousey = evt.button.y; - middlebutton=0; - break; - } - break; + /* Window Focus */ + case SDL_WINDOWEVENT_FOCUS_GAINED: + if (!game.disablepause) + { + isActive = true; + if ((!game.disableaudiopause || !game.disabletemporaryaudiopause) && music.currentsong != -1) + { + music.resume(); + music.resumeef(); + } + } + if (SDL_strcmp(SDL_GetCurrentVideoDriver(), "x11") == 0) + { + if (wasFullscreen) + { + graphics.screenbuffer->isWindowed = false; + SDL_SetWindowFullscreen( + SDL_GetWindowFromID(evt.window.windowID), + SDL_WINDOW_FULLSCREEN_DESKTOP + ); + } + } + SDL_DisableScreenSaver(); + break; + case SDL_WINDOWEVENT_FOCUS_LOST: + if (!game.disablepause) + { + isActive = false; + if (!game.disableaudiopause || !game.disabletemporaryaudiopause) + { + music.pause(); + music.pauseef(); + } + } + if (SDL_strcmp(SDL_GetCurrentVideoDriver(), "x11") == 0) + { + wasFullscreen = !graphics.screenbuffer->isWindowed; + graphics.screenbuffer->isWindowed = true; + SDL_SetWindowFullscreen( + SDL_GetWindowFromID(evt.window.windowID), + 0 + ); + } + SDL_EnableScreenSaver(); + break; - /* Controller Input */ - case SDL_CONTROLLERBUTTONDOWN: - buttonmap[(SDL_GameControllerButton) evt.cbutton.button] = true; - BUTTONGLYPHS_keyboard_set_active(false); + /* Mouse Focus */ + case SDL_WINDOWEVENT_ENTER: + SDL_DisableScreenSaver(); + break; + case SDL_WINDOWEVENT_LEAVE: + SDL_EnableScreenSaver(); + break; + } + break; - controller = controllers[evt.cbutton.which]; - BUTTONGLYPHS_update_layout(controller); - break; - case SDL_CONTROLLERBUTTONUP: - buttonmap[(SDL_GameControllerButton) evt.cbutton.button] = false; - break; - case SDL_CONTROLLERAXISMOTION: - { - const int threshold = getThreshold(); - switch (evt.caxis.axis) - { - case SDL_CONTROLLER_AXIS_LEFTX: - if ( evt.caxis.value > -threshold && - evt.caxis.value < threshold ) - { - xVel = 0; - } - else - { - xVel = (evt.caxis.value > 0) ? 1 : -1; - } - break; - case SDL_CONTROLLER_AXIS_LEFTY: - if ( evt.caxis.value > -threshold && - evt.caxis.value < threshold ) - { - yVel = 0; - } - else - { - yVel = (evt.caxis.value > 0) ? 1 : -1; - } - break; - } - BUTTONGLYPHS_keyboard_set_active(false); + /* Quit Event */ + case SDL_QUIT: + VVV_exit(0); + break; + } - controller = controllers[evt.caxis.which]; - BUTTONGLYPHS_update_layout(controller); - break; - } - case SDL_CONTROLLERDEVICEADDED: - { - controller = SDL_GameControllerOpen(evt.cdevice.which); - vlog_info( - "Opened SDL_GameController ID #%i, %s", - evt.cdevice.which, - SDL_GameControllerName(controller) - ); - controllers[SDL_JoystickInstanceID(SDL_GameControllerGetJoystick(controller))] = controller; - BUTTONGLYPHS_keyboard_set_active(false); - BUTTONGLYPHS_update_layout(controller); - break; - } - case SDL_CONTROLLERDEVICEREMOVED: - { - controller = controllers[evt.cdevice.which]; - controllers.erase(evt.cdevice.which); - vlog_info("Closing %s", SDL_GameControllerName(controller)); - SDL_GameControllerClose(controller); - if (controllers.empty()) - { - BUTTONGLYPHS_keyboard_set_active(true); - } - break; - } + switch (evt.type) + { + case SDL_KEYDOWN: + if (evt.key.repeat == 0) + { + hidemouse = true; + } + break; + case SDL_TEXTINPUT: + case SDL_CONTROLLERBUTTONDOWN: + case SDL_CONTROLLERAXISMOTION: + hidemouse = true; + break; + case SDL_MOUSEMOTION: + case SDL_MOUSEBUTTONDOWN: + showmouse = true; + break; + } + } - /* Window Events */ - case SDL_WINDOWEVENT: - switch (evt.window.event) - { - /* Window Resize */ - case SDL_WINDOWEVENT_RESIZED: - if (SDL_GetWindowFlags( - SDL_GetWindowFromID(evt.window.windowID) - ) & SDL_WINDOW_INPUT_FOCUS) - { - resetWindow = true; - } - break; + mousetoggletimeout = changemousestate( + mousetoggletimeout, + showmouse, + hidemouse + ); - /* Window Focus */ - case SDL_WINDOWEVENT_FOCUS_GAINED: - if (!game.disablepause) - { - isActive = true; - if ((!game.disableaudiopause || !game.disabletemporaryaudiopause) && music.currentsong != -1) - { - music.resume(); - music.resumeef(); - } - } - if (SDL_strcmp(SDL_GetCurrentVideoDriver(), "x11") == 0) - { - if (wasFullscreen) - { - gameScreen.isWindowed = false; - SDL_SetWindowFullscreen( - SDL_GetWindowFromID(evt.window.windowID), - SDL_WINDOW_FULLSCREEN_DESKTOP - ); - } - } - SDL_DisableScreenSaver(); - gameScreen.recacheTextures(); - break; - case SDL_WINDOWEVENT_FOCUS_LOST: - if (!game.disablepause) - { - isActive = false; - if (!game.disableaudiopause || !game.disabletemporaryaudiopause) - { - music.pause(); - music.pauseef(); - } - } - - if (SDL_strcmp(SDL_GetCurrentVideoDriver(), "x11") == 0) - { - wasFullscreen = !gameScreen.isWindowed; - gameScreen.isWindowed = true; - SDL_SetWindowFullscreen( - SDL_GetWindowFromID(evt.window.windowID), - 0 - ); - } - SDL_EnableScreenSaver(); - break; - - /* Mouse Focus */ - case SDL_WINDOWEVENT_ENTER: - SDL_DisableScreenSaver(); - break; - case SDL_WINDOWEVENT_LEAVE: - SDL_EnableScreenSaver(); - break; - } - break; - - /* Quit Event */ - case SDL_QUIT: - VVV_exit(0); - break; - } - - switch (evt.type) - { - case SDL_KEYDOWN: - if (evt.key.repeat == 0) - { - hidemouse = true; - } - break; - case SDL_TEXTINPUT: - case SDL_CONTROLLERBUTTONDOWN: - case SDL_CONTROLLERAXISMOTION: - hidemouse = true; - break; - case SDL_MOUSEMOTION: - case SDL_MOUSEBUTTONDOWN: - showmouse = true; - break; - } - } - - mousetoggletimeout = changemousestate( - mousetoggletimeout, - showmouse, - hidemouse - ); - - if (fullscreenkeybind) - { - toggleFullscreen(); - } - - SDL_Rect rect; - graphics.get_stretch_info(&rect); - - int window_width; - int window_height; - SDL_GetWindowSizeInPixels(gameScreen.m_window, &window_width, &window_height); - - int scaled_window_width; - int scaled_window_height; - SDL_GetWindowSize(gameScreen.m_window, &scaled_window_width, &scaled_window_height); - - float scale_x = (float)window_width / (float)scaled_window_width; - float scale_y = (float)window_height / (float)scaled_window_height; - - // Use screen stretch information to modify the coordinates (as we implement stretching manually) - mousex = ((raw_mousex * scale_x) - rect.x) * SCREEN_WIDTH_PIXELS / rect.w; - mousey = ((raw_mousey * scale_y) - rect.y) * SCREEN_HEIGHT_PIXELS / rect.h; - - active_input_device_changed = keyboard_was_active != BUTTONGLYPHS_keyboard_is_active(); - should_recompute_textboxes |= active_input_device_changed; - if (should_recompute_textboxes) - { - recomputetextboxes(); - } + if (fullscreenkeybind) + { + toggleFullscreen(); + } } bool KeyPoll::isDown(SDL_Keycode key) { - return keymap[key]; + return keymap[key]; } bool KeyPoll::isDown(std::vector buttons) { - for (size_t i = 0; i < buttons.size(); i += 1) - { - if (buttonmap[buttons[i]]) - { - return true; - } - } - return false; + for (size_t i = 0; i < buttons.size(); i += 1) + { + if (buttonmap[buttons[i]]) + { + return true; + } + } + return false; } bool KeyPoll::isDown(SDL_GameControllerButton button) { - return buttonmap[button]; + return buttonmap[button]; } bool KeyPoll::controllerButtonDown(void) { - for ( - SDL_GameControllerButton button = SDL_CONTROLLER_BUTTON_A; - button < SDL_CONTROLLER_BUTTON_DPAD_UP; - button = (SDL_GameControllerButton) (button + 1) - ) { - if (isDown(button)) - { - return true; - } - } - return false; + for ( + SDL_GameControllerButton button = SDL_CONTROLLER_BUTTON_A; + button < SDL_CONTROLLER_BUTTON_DPAD_UP; + button = (SDL_GameControllerButton) (button + 1) + ) { + if (isDown(button)) + { + return true; + } + } + return false; } bool KeyPoll::controllerWantsLeft(bool includeVert) { - return ( buttonmap[SDL_CONTROLLER_BUTTON_DPAD_LEFT] || - xVel < 0 || - ( includeVert && - ( buttonmap[SDL_CONTROLLER_BUTTON_DPAD_UP] || - yVel < 0 ) ) ); + return ( buttonmap[SDL_CONTROLLER_BUTTON_DPAD_LEFT] || + xVel < 0 || + ( includeVert && + ( buttonmap[SDL_CONTROLLER_BUTTON_DPAD_UP] || + yVel < 0 ) ) ); } bool KeyPoll::controllerWantsRight(bool includeVert) { - return ( buttonmap[SDL_CONTROLLER_BUTTON_DPAD_RIGHT] || - xVel > 0 || - ( includeVert && - ( buttonmap[SDL_CONTROLLER_BUTTON_DPAD_DOWN] || - yVel > 0 ) ) ); -} - -bool KeyPoll::controllerWantsUp(void) -{ - return buttonmap[SDL_CONTROLLER_BUTTON_DPAD_UP] || yVel < 0; -} - -bool KeyPoll::controllerWantsDown(void) -{ - return buttonmap[SDL_CONTROLLER_BUTTON_DPAD_DOWN] || yVel > 0; + return ( buttonmap[SDL_CONTROLLER_BUTTON_DPAD_RIGHT] || + xVel > 0 || + ( includeVert && + ( buttonmap[SDL_CONTROLLER_BUTTON_DPAD_DOWN] || + yVel > 0 ) ) ); } diff --git a/desktop_version/src/KeyPoll.h b/desktop_version/src/KeyPoll.h index d51a6b26..038218ba 100644 --- a/desktop_version/src/KeyPoll.h +++ b/desktop_version/src/KeyPoll.h @@ -8,78 +8,72 @@ enum Kybrd { - KEYBOARD_UP = SDLK_UP, - KEYBOARD_DOWN = SDLK_DOWN, - KEYBOARD_LEFT = SDLK_LEFT, - KEYBOARD_RIGHT = SDLK_RIGHT, - KEYBOARD_ENTER = SDLK_RETURN, - KEYBOARD_SPACE = SDLK_SPACE, + KEYBOARD_UP = SDLK_UP, + KEYBOARD_DOWN = SDLK_DOWN, + KEYBOARD_LEFT = SDLK_LEFT, + KEYBOARD_RIGHT = SDLK_RIGHT, + KEYBOARD_ENTER = SDLK_RETURN, + KEYBOARD_SPACE = SDLK_SPACE, - KEYBOARD_w = SDLK_w, - KEYBOARD_s = SDLK_s, - KEYBOARD_a = SDLK_a, - KEYBOARD_d = SDLK_d, - KEYBOARD_e = SDLK_e, - KEYBOARD_m = SDLK_m, - KEYBOARD_n = SDLK_n, + KEYBOARD_w = SDLK_w, + KEYBOARD_s = SDLK_s, + KEYBOARD_a = SDLK_a, + KEYBOARD_d = SDLK_d, + KEYBOARD_e = SDLK_e, + KEYBOARD_m = SDLK_m, + KEYBOARD_n = SDLK_n, - KEYBOARD_v = SDLK_v, - KEYBOARD_z = SDLK_z, + KEYBOARD_v = SDLK_v, + KEYBOARD_z = SDLK_z, - KEYBOARD_BACKSPACE = SDLK_BACKSPACE + KEYBOARD_BACKSPACE = SDLK_BACKSPACE }; class KeyPoll { public: - std::map keymap; + std::map keymap; - bool isActive; + bool isActive; - bool resetWindow; + bool resetWindow; - void toggleFullscreen(void); + void toggleFullscreen(void); - int sensitivity; + int sensitivity; - int inline getThreshold(void); + int inline getThreshold(void); - KeyPoll(void); + KeyPoll(void); - void enabletextentry(void); + void enabletextentry(void); - void disabletextentry(void); + void disabletextentry(void); - void Poll(void); + void Poll(void); - bool isDown(SDL_Keycode key); + bool isDown(SDL_Keycode key); - bool isDown(std::vector buttons); - bool isDown(SDL_GameControllerButton button); - bool controllerButtonDown(void); - bool controllerWantsLeft(bool includeVert); - bool controllerWantsRight(bool includeVert); - bool controllerWantsUp(void); - bool controllerWantsDown(void); + bool isDown(std::vector buttons); + bool isDown(SDL_GameControllerButton button); + bool controllerButtonDown(void); + bool controllerWantsLeft(bool includeVert); + bool controllerWantsRight(bool includeVert); - int leftbutton, rightbutton, middlebutton; - int mousex; - int mousey; + int leftbutton, rightbutton, middlebutton; + int mx, my; - bool textentry(void); - bool pressedbackspace; - std::string keybuffer; - std::string imebuffer; - int imebuffer_start; - int imebuffer_length; + bool textentry(void); + bool pressedbackspace; + std::string keybuffer; - bool linealreadyemptykludge; + bool linealreadyemptykludge; private: - std::map controllers; - std::map buttonmap; - int xVel, yVel; - Uint32 wasFullscreen; + std::map controllers; + std::map buttonmap; + int xVel, yVel; + Uint32 wasFullscreen; }; #ifndef KEY_DEFINITION diff --git a/desktop_version/src/Labclass.cpp b/desktop_version/src/Labclass.cpp index 280e85a1..1ed2dbc2 100644 --- a/desktop_version/src/Labclass.cpp +++ b/desktop_version/src/Labclass.cpp @@ -3,2101 +3,2098 @@ #include "Game.h" #include "Entity.h" #include "MakeAndPlay.h" +#include "UtilityClass.h" const short* labclass::loadlevel(int rx, int ry) { - int t; + int t; - rx=rx-100; - ry=ry-100; - if(ry<5) - { - rx+=50-2; - ry+=54; //lab - } - else - { - rx+=50-2; - ry+=50-16; //lab - } + rx=rx-100; + ry=ry-100; + if(ry<5) + { + rx+=50-2; + ry+=54; //lab + } + else + { + rx+=50-2; + ry+=50-16; //lab + } - t = rx + (ry * 100); - const short* result; - rcol = 0; - roomname = ""; - roomname_special = false; + t = rx + (ry * 100); + const short* result; + rcol = 0; + roomname = "Untitled room ["+help.String(rx) + "," + help.String(ry)+"]"; - switch(t) - { + switch(t) + { #if !defined(MAKEANDPLAY) - case rn(50,50): - { - - static const short contents[] = { - 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, - 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, - 283,283,283,283,283,283,283,283,284,444,444,444,444,444,444,444,444,444,285,283,284,444,444,444,444,444,444,444,444,444,444,444,444,285,283,283,283,283,283,283, - 283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,0,0,0,0,0,0,403,283,283,283,283,283,283, - 283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,0,0,0,0,0,0,403,283,283,283,283,283,283, - 283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,0,0,0,0,0,0,403,283,283,283,283,283,283, - 283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,0,0,0,0,0,0,403,283,283,283,283,283,283, - 283,283,283,283,283,283,283,283,405,0,0,0,363,364,365,0,0,0,403,283,405,0,0,0,363,364,365,0,0,0,0,0,0,403,283,283,283,283,283,283, - 283,283,283,283,283,283,283,283,405,0,0,0,403,283,405,0,0,0,443,444,445,0,0,0,403,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283, - 283,283,283,283,283,283,283,283,405,0,0,0,403,283,405,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283, - 444,444,444,444,444,444,285,283,405,0,0,0,403,283,405,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283, - 0,0,0,0,0,0,403,283,405,0,0,0,403,283,405,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283, - 0,0,0,0,0,0,403,283,405,0,0,0,403,283,405,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283, - 0,0,0,0,0,0,403,283,405,0,0,0,403,283,324,364,364,364,364,364,364,364,364,364,325,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283, - 0,0,0,0,0,0,403,283,405,0,0,0,403,283,283,283,283,283,283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283, - 0,0,0,0,0,0,403,283,405,0,0,0,443,444,444,444,444,444,444,444,444,444,444,444,285,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283, - 0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283, - 364,364,365,0,0,0,403,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283, - 283,283,405,0,0,0,403,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283, - 283,283,405,0,0,0,403,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283, - 283,283,405,0,0,0,403,283,324,364,364,364,364,364,364,364,364,364,364,364,365,0,0,0,403,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283, - 283,283,405,0,0,0,403,283,283,283,283,283,283,283,283,283,283,283,283,283,405,0,0,0,403,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283, - 283,283,405,0,0,0,443,444,444,444,444,444,444,444,444,444,444,444,444,444,445,0,0,0,403,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283, - 283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283, - 283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283, - 283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283, - 283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283, - 283,283,324,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,325,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283, - 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283, - 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283, - }; - - obj.createentity(232, 24, 10, 0, 250500); // (savepoint) - - if(game.intimetrial) - { - obj.createblock(0, 0, 0, 8, 240); - } - - rcol=1; - roomname = "Get Ready To Bounce"; - result = contents; - break; - } - - case rn(50,51): - { - - static const short contents[] = { - 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,402,0,0,0,0,0,0,400,280,280,280,280,280,280, - 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,402,0,0,0,0,0,0,400,280,280,280,280,280,280, - 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,281,441,442,0,0,0,0,0,0,440,441,441,441,441,282,280, - 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,281,442,64,64,0,0,0,0,0,0,64,64,64,64,64,440,282, - 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400, - 441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,442,51,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400, - 63,63,63,63,63,63,63,63,63,63,63,63,63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400, - 361,361,361,361,361,361,361,361,361,361,361,361,362,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400, - 280,280,280,280,280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400, - 280,280,280,280,280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400, - 280,280,280,280,280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400, - 280,280,280,280,280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400, - 280,280,280,280,280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400, - 280,280,280,280,280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400, - 280,280,280,280,280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400, - 280,280,280,280,280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400, - 280,280,280,280,280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400, - 280,280,280,280,280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400, - 280,280,280,280,280,280,280,280,280,280,280,280,321,362,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,360,322, - 280,280,280,280,280,280,280,280,280,280,280,280,280,321,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,322,280, - 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280, - 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280, - }; - - obj.createentity(112, 180, 11, 192); // (horizontal gravity line) - rcol = 0; - - roomname = "It's Perfectly Safe"; - result = contents; - break; - } - - case rn(49,51): - { - - static const short contents[] = { - 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, - 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, - 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, - 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, - 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, - 292,293,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453, - 292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,72,72,72,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 292,414,0,0,0,0,0,0,0,0,71,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,71,71,71,71,71,71,71,71,71,71,71,71, - 292,414,0,0,0,0,0,0,0,60,413,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,307,308,308,308,308,308,308,349,373,373,373,373, - 292,414,0,0,0,0,0,0,0,0,72,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,292,292, - 292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,292,292, - 292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,292,292, - 292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,292,292, - 292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,292,292, - 292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,292,292, - 292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,292,292, - 292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,292,292, - 292,414,0,0,0,0,0,0,0,0,0,0,0,0,71,71,71,0,0,0,0,0,71,71,71,0,0,0,0,0,0,0,0,0,0,412,292,292,292,292, - 292,333,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,374,0,0,0,0,0,0,0,412,292,292,292,292, - 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,0,0,0,0,0,0,0,412,292,292,292,292, - 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,0,0,0,0,0,0,0,412,292,292,292,292, - 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,0,0,0,0,0,0,0,412,292,292,292,292, - 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,0,0,0,0,0,0,0,412,292,292,292,292, - }; - - obj.createentity(96, 124, 11, 120); // (horizontal gravity line) - obj.createentity(248, 48, 10, 0, 251490); // (savepoint) - rcol = 4; - - roomname = "Rascasse"; - result = contents; - break; - } - - case rn(49,52): - { - - static const short contents[] = { - 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,408,0,0,0,0,0,0,0,406,286,286,286,286, - 286,287,447,447,447,447,447,447,447,447,288,286,286,287,447,447,447,447,447,447,447,447,288,286,286,287,447,448,0,0,0,0,0,0,0,406,286,286,286,286, - 286,408,68,68,68,68,68,68,68,68,406,286,286,408,68,68,68,68,68,68,68,68,406,286,286,408,68,68,0,0,0,0,0,0,0,406,286,286,286,286, - 286,408,0,0,0,0,0,0,0,0,406,286,286,408,0,0,0,0,0,0,0,0,406,286,286,408,0,0,0,0,0,0,0,0,0,406,286,286,286,286, - 286,408,0,0,0,0,0,0,0,0,406,286,286,408,0,0,0,0,0,0,0,0,406,286,286,408,0,0,0,0,0,0,0,0,0,406,286,286,286,286, - 286,408,0,0,0,0,0,0,0,0,406,286,286,408,0,0,0,0,0,0,0,0,406,286,286,408,0,0,0,0,0,0,0,0,0,406,286,286,286,286, - 286,408,0,0,0,0,0,0,0,0,406,286,286,408,0,0,0,0,0,0,0,0,406,286,286,408,0,0,0,0,0,0,0,0,0,406,286,286,286,286, - 286,408,0,0,0,0,0,0,0,0,406,286,286,408,0,0,0,0,0,0,0,0,406,286,286,408,0,0,0,0,0,0,0,0,0,406,286,286,286,286, - 286,408,0,0,0,0,0,0,0,0,406,286,286,408,0,0,0,0,0,0,0,0,406,286,286,408,0,0,0,0,0,0,0,0,0,406,286,286,286,286, - 447,448,0,0,0,0,0,0,0,0,446,447,447,448,0,0,0,0,0,0,0,0,446,447,447,448,0,0,0,0,0,0,0,0,0,406,286,286,286,286, - 0,0,0,0,0,0,0,0,0,0,68,68,68,68,0,0,0,0,0,0,0,0,68,68,68,68,0,0,0,0,0,0,0,0,0,406,286,286,286,286, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,67,67,67,67,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286, - 367,367,367,367,367,367,367,368,0,0,0,0,0,0,0,0,366,367,367,368,0,0,0,0,0,0,0,0,366,367,367,367,367,367,367,328,286,286,286,286, - 286,286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,406,286,286,408,0,0,0,0,0,0,0,0,406,286,286,286,286,286,286,286,286,286,286,286, - 286,286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,406,286,286,408,0,0,0,0,0,0,0,0,406,286,286,286,286,286,286,286,286,286,286,286, - 286,286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,406,286,286,408,0,0,0,0,0,0,0,0,406,286,286,286,286,286,286,286,286,286,286,286, - 286,286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,406,286,286,408,0,0,0,0,0,0,0,0,406,286,286,286,286,286,286,286,286,286,286,286, - 286,286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,406,286,286,408,0,0,0,0,0,0,0,0,406,286,286,286,286,286,286,286,286,286,286,286, - 286,286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,406,286,286,408,0,0,0,0,0,0,0,0,406,286,286,286,286,286,286,286,286,286,286,286, - 286,286,286,286,286,286,286,408,67,67,67,67,67,67,67,67,406,286,286,408,67,67,67,67,67,67,67,67,406,286,286,286,286,286,286,286,286,286,286,286, - 286,286,286,286,286,286,286,327,367,367,367,367,367,367,367,367,328,286,286,327,367,367,367,367,367,367,367,367,328,286,286,286,286,286,286,286,286,286,286,286, - 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, - 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, - }; - - obj.createentity(248, 136, 10, 1, 252490); // (savepoint) - obj.createentity(16, 68, 11, 64); // (horizontal gravity line) - obj.createentity(112, 68, 11, 64); // (horizontal gravity line) - obj.createentity(64, 164, 11, 64); // (horizontal gravity line) - obj.createentity(160, 164, 11, 64); // (horizontal gravity line) - rcol = 2; - - roomname = "Keep Going"; - result = contents; - break; - } - - case rn(48,52): - { - - static const short contents[] = { - 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, - 289,289,289,289,289,290,450,450,450,450,450,450,450,450,450,450,450,450,450,291,289,289,289,290,450,450,450,450,450,450,450,450,450,450,450,450,450,291,289,289, - 289,289,289,289,289,411,70,70,70,70,70,70,70,70,70,70,70,70,70,409,289,289,289,411,70,70,70,70,70,70,70,70,70,70,70,70,70,409,289,289, - 289,289,289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289, - 289,289,289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289, - 289,289,289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289, - 289,289,289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289, - 289,289,289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289, - 289,289,289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289, - 289,290,450,450,450,451,0,0,0,0,0,0,0,0,0,0,0,0,0,449,450,450,450,451,0,0,0,0,0,0,0,0,0,0,0,0,0,449,450,450, - 289,411,70,70,70,70,0,0,0,0,0,0,0,0,0,0,0,0,0,70,70,70,70,70,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 289,411,0,0,0,0,0,0,0,0,0,69,69,69,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 289,411,0,0,0,0,0,0,0,0,0,369,370,371,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,369,370,370,370,370,370,370,370,370,370,370, - 289,411,0,0,0,0,0,0,0,0,0,409,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289,289,289,289,289,289,289,289, - 289,411,0,0,0,0,0,0,0,0,0,409,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289,289,289,289,289,289,289,289, - 289,411,0,0,0,0,0,0,0,0,0,409,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289,289,289,289,289,289,289,289, - 289,411,0,0,0,0,0,0,0,0,0,409,289,411,69,69,69,69,69,0,0,0,0,0,69,69,69,69,69,409,289,289,289,289,289,289,289,289,289,289, - 289,411,0,0,0,0,0,0,0,0,0,409,289,330,370,370,370,370,371,0,0,0,0,0,369,370,370,370,370,331,289,289,289,289,289,289,289,289,289,289, - 289,411,0,0,0,0,0,0,0,0,0,409,289,289,289,289,289,289,411,0,0,0,0,0,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, - 289,411,0,0,0,0,0,0,0,0,0,409,289,289,289,289,289,289,411,0,0,0,0,0,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, - 289,411,0,0,0,0,0,0,0,0,0,409,289,289,289,289,289,289,330,370,370,370,370,370,331,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, - 289,411,0,0,0,0,0,0,0,0,0,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, - 289,411,0,0,0,0,0,0,0,0,0,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, - }; - - obj.createentity(280, 136, 10, 1, 252480); // (savepoint) - obj.createentity(48, 52, 11, 104); // (horizontal gravity line) - obj.createentity(192, 52, 11, 104); // (horizontal gravity line) - obj.createentity(152, 196, 11, 40); // (horizontal gravity line) - rcol=3; - - roomname = "Single-slit Experiment"; - result = contents; - break; - } - - - case rn(48,53): - { - - static const short contents[] = { - 295,417,0,0,0,0,0,0,0,0,0,415,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, - 295,417,0,0,0,0,0,0,0,0,0,415,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, - 295,417,0,0,0,0,0,0,0,0,0,415,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, - 295,417,0,0,0,0,0,0,0,0,0,415,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, - 295,417,0,0,0,0,0,0,0,0,0,415,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, - 295,417,0,0,0,0,0,0,0,0,0,415,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, - 295,417,0,0,0,0,0,0,0,0,0,415,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, - 295,417,0,0,0,0,0,0,0,0,0,415,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, - 295,417,0,0,0,0,0,0,0,0,0,415,295,295,295,295,295,295,295,295,295,295,295,295,295,296,456,456,456,456,456,456,456,456,456,456,456,456,456,456, - 295,417,0,0,0,0,0,0,0,0,0,415,295,295,295,295,295,295,295,295,295,295,295,295,295,417,74,74,74,74,74,74,74,74,74,74,74,74,74,74, - 295,417,0,0,0,0,0,0,0,0,0,455,456,456,456,456,456,456,456,456,456,456,456,456,456,457,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 295,336,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376, - 295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, - 295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, - 295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, - 295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, - 295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, - 295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, - 295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, - 295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, - 295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, - 295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, - 295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, - }; - - obj.createentity(32, 128, 10, 1, 253480); // (savepoint) - obj.createentity(187, 88, 12, 56); // (vertical gravity line) - obj.createentity(107, 88, 12, 56); // (vertical gravity line) - rcol = 5; - - roomname = "Don't Flip Out"; - result = contents; - break; - } - - case rn(49,53): - { - - static const short contents[] = { - 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, - 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, - 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, - 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, - 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, - 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, - 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, - 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,284,444,444,444,444,444,444,444,444,444,285,283,283,283,283,283,283,283,283,283,283,283,283,283,283, - 444,444,444,444,444,285,283,283,283,283,283,283,283,283,283,405,66,66,66,66,66,66,66,66,66,403,283,283,283,283,283,283,283,283,283,284,444,444,444,444, - 66,66,66,66,66,403,283,283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,0,0,0,403,283,283,283,283,283,283,283,283,283,405,66,66,66,66, - 0,0,0,0,0,443,444,444,444,444,444,444,444,444,444,445,0,0,0,0,0,0,0,0,0,443,444,444,444,444,444,444,444,444,444,445,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 364,364,364,364,364,365,0,0,0,0,0,0,0,0,0,363,364,364,364,364,364,364,364,364,364,365,0,0,0,0,0,0,0,0,0,363,364,364,364,364, - 283,283,283,283,283,405,0,0,0,0,0,0,0,0,0,403,283,283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,0,0,0,403,283,283,283,283, - 283,283,283,283,283,405,65,65,65,65,65,65,65,65,65,403,283,283,283,283,283,283,283,283,283,405,65,65,65,65,65,65,65,65,65,403,283,283,283,283, - 283,283,283,283,283,324,364,364,364,364,364,364,364,364,364,325,283,283,283,283,283,283,283,283,283,324,364,364,364,364,364,364,364,364,364,325,283,283,283,283, - 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, - 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, - 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, - 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, - 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, - 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, - 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, - 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, - }; - - obj.createentity(43, 88, 12, 56); // (vertical gravity line) - obj.createentity(123, 88, 12, 56); // (vertical gravity line) - obj.createentity(203, 88, 12, 56); // (vertical gravity line) - obj.createentity(283, 88, 12, 56); // (vertical gravity line) - - obj.createentity(156, 128, 20, 1); // (terminal) - obj.createblock(5, 156-8, 128, 20, 16, 19); - rcol = 1; - - roomname = "Shuffled Hallway"; - result = contents; - break; - } - - case rn(50,53): - { - - static const short contents[] = { - 289,289,289,289,289,289,289,289,411,0,0,0,0,0,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, - 289,289,289,289,289,289,289,289,411,0,0,0,0,0,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, - 289,289,289,289,289,289,289,289,411,0,0,0,0,0,449,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,291,289,289,289,289,289,289,289, - 289,289,289,289,289,289,289,289,411,0,0,0,0,0,0,0,0,0,70,70,70,70,70,0,0,0,0,0,0,0,0,0,409,289,289,289,289,289,289,289, - 289,289,289,289,289,289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289,289,289,289,289, - 289,289,289,289,289,289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289,289,289,289,289, - 289,289,289,289,289,289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289,289,289,289,289, - 289,289,289,289,289,289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289,289,289,289,289, - 450,450,450,450,450,450,450,450,451,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289,289,289,289,289, - 70,70,70,70,70,70,70,70,70,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289,289,289,289,289, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289,289,289,289,289, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289,289,289,289,289, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289,289,289,289,289, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,449,450,450,450,450,450,450,450, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 370,370,370,370,370,370,370,370,371,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 289,289,289,289,289,289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 289,289,289,289,289,289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 289,289,289,289,289,289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 289,289,289,289,289,289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 289,289,289,289,289,289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 289,289,289,289,289,289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 289,289,289,289,289,289,289,289,411,0,0,0,0,0,0,0,0,0,69,69,69,69,69,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 289,289,289,289,289,289,289,289,330,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,371,0,0,0,0,0,0,0,0, - 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,69,69,69,69,69,69,69,69, - 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,330,370,370,370,370,370,370,370,370, - 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, - }; - - obj.createentity(96, 192, 10, 1, 253500); // (savepoint) - obj.createentity(163, 32, 12, 168); // (vertical gravity line) - rcol = 3; - - roomname = "Double-slit Experiment"; - result = contents; - break; - } - - case rn(51,53): - { - - static const short contents[] = { - 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,287,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447, - 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,408,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68, - 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,448,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,68,0,0,0,0,0,0,67,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,366,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, - 67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,406,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, - 367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,328,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, - 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, - }; - - obj.createentity(264, 104, 10, 1, 253510); // (savepoint) - obj.createentity(131, 120, 12, 96); // (vertical gravity line) - obj.createentity(187, 16, 12, 96); // (vertical gravity line) - obj.createentity(40, 112, 10, 0, 253511); // (savepoint) - rcol = 2; - roomname = "They Call Him Flipper"; - result = contents; - break; - } - - case rn(52,53): - { - - static const short contents[] = { - 453,453,453,453,453,453,294,414,0,0,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, - 72,72,0,0,0,0,412,414,0,0,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, - 0,0,0,0,0,0,412,414,0,0,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, - 0,0,0,0,0,0,412,414,0,0,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, - 0,0,0,0,0,0,412,414,0,0,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, - 0,0,0,0,0,0,412,414,0,0,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, - 0,0,0,0,0,0,412,414,0,0,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, - 0,0,0,0,0,0,412,414,0,0,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, - 0,0,0,0,0,0,412,414,0,0,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, - 0,0,0,0,0,0,412,414,0,0,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, - 0,0,0,0,0,0,412,414,0,0,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, - 0,0,0,0,0,0,412,414,0,0,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, - 0,0,0,0,0,0,412,414,0,0,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, - 0,0,0,0,0,0,412,414,0,0,0,0,0,0,412,293,453,453,453,294,292,293,453,453,453,294,292,293,453,453,453,294,292,292,292,292,292,292,292,292, - 0,0,0,0,0,0,412,414,0,0,0,0,0,0,412,414,72,72,72,412,292,414,72,72,72,412,292,414,72,72,72,412,292,292,292,292,292,292,292,292, - 373,374,0,0,0,0,412,414,0,0,0,0,0,0,452,454,0,0,0,452,453,454,0,0,0,452,453,454,0,0,0,452,453,453,453,453,453,453,294,292, - 292,414,0,0,0,0,412,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292, - 292,414,0,0,0,0,412,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292, - 292,414,0,0,0,0,412,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292, - 292,414,0,0,0,0,412,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,71,71,0,0,0,412,292, - 292,414,0,0,0,0,452,454,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,307,309,0,0,0,412,292, - 292,414,0,0,0,0,72,72,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,72,72,0,0,0,412,292, - 292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292, - 292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292, - 292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292, - 292,333,373,373,373,373,373,373,373,373,373,373,373,374,0,0,0,0,0,372,373,373,373,374,0,0,0,0,0,372,373,373,373,373,373,373,373,373,334,292, - 292,292,292,292,292,292,292,292,292,292,292,292,292,414,71,71,71,71,71,412,292,292,292,414,71,71,71,71,71,412,292,292,292,292,292,292,292,292,292,292, - 292,292,292,292,292,292,292,292,292,292,292,292,292,333,373,373,373,373,373,334,292,292,292,333,373,373,373,373,373,334,292,292,292,292,292,292,292,292,292,292, - 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, - 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, - }; - - obj.createentity(24, 184, 10, 1, 253520); // (savepoint) - obj.createentity(64, 164, 11, 200); // (horizontal gravity line) - rcol = 4; - roomname = "Three's a Crowd"; - result = contents; - break; - } - - case rn(52,52): - { - - static const short contents[] = { - 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, - 447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,288,286,286,286,286,286, - 68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,406,286,286,286,286,286, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,67,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286, - 367,367,367,367,367,367,367,351,311,311,311,311,311,311,311,311,311,311,311,311,311,311,311,311,312,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286, - 286,286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,68,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286, - 286,286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286, - 286,286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286, - 286,286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286, - 286,286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286, - 286,286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286, - 286,286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286, - 286,286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286, - 286,286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286, - 286,286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286, - 286,286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286, - 286,286,286,286,286,286,286,408,0,0,0,0,0,0,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,406,286,286,286,286,286, - 286,286,286,286,286,286,286,408,0,0,0,0,0,0,366,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,328,286,286,286,286,286, - 286,286,286,286,286,286,286,408,0,0,0,0,0,0,406,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, - 286,286,286,286,286,286,286,408,0,0,0,0,0,0,406,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, - }; - - obj.createentity(195, 24, 12, 80); // (vertical gravity line) - obj.createentity(195, 128, 12, 80); // (vertical gravity line) - obj.createentity(80, 120, 10, 0, 252520); // (savepoint) - obj.createentity(80, 96, 10, 1, 252521); // (savepoint) - rcol = 2; - roomname = "Hitting the Apex"; - result = contents; - break; - } - - case rn(51,52): - { - - static const short contents[] = { - 280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280, - 280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,280,280,280,280,280,280,280,280,280,281,441,441,441,441,441,441,441,441,441,441, - 280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,280,280,280,280,280,280,280,280,281,442,64,64,64,64,64,64,64,64,64,64, - 280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,280,280,280,281,441,441,441,441,442,51,0,0,0,0,0,0,0,0,0,0, - 280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,280,280,281,442,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,440,282,280,281,442,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,440,344,442,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,464,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,360,361,361,361,361,361,361,361, - 280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,400,280,280,280,280,280,280,280, - 280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,400,280,280,280,280,280,280,280, - 280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,280,280,280,280,280,280, - 280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,280,280,280,280,280,280, - 280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,280,280,280,280,280,280, - 280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,280,280,280,280,280,280, - 280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,280,280,280,280,280,280, - 280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,280,280,280,280,280,280, - 280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,280,280,280,280,280,280, - 280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,280,280,280,280,280,280, - 280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,280,280,280,280,280,280, - 280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,280,280,280,280,280,280, - 280,321,362,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,360,322,280,280,280,280,280,280,280, - 280,280,321,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,322,280,280,280,280,280,280,280,280, - 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280, - }; - - obj.createentity(24, 188, 11, 224); // (horizontal gravity line) - obj.createentity(280, 96, 10, 1, 252510); // (savepoint) - - obj.createentity(204, 32, 20, 0); // (terminal) - obj.createblock(5, 204-8, 32, 20, 16, 20); - rcol=0; - - roomname = "Square Root"; - result = contents; - break; - } - - - case rn(51,51): - { - - static const short contents[] = { - 292,292,293,453,453,453,453,453,453,453,453,453,453,453,453,453,453,294,292,292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292, - 292,293,454,72,72,72,72,72,72,72,72,72,72,72,72,72,72,452,294,292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292, - 292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292, - 292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292, - 292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292, - 292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,452,319,454,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292, - 292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,72,467,72,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292, - 292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,72,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292, - 292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292, - 292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292, - 292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292, - 292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292, - 292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292, - 292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292, - 292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292, - 292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292, - 292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292, - 292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292, - 292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292, - 292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292, - 292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,71,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292, - 292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,71,387,71,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292, - 292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,372,347,374,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292, - 292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292, - 292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292, - 292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292, - 292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,333,374,71,71,71,71,71,71,71,71,71,71,71,71,71,71,372,334,292,292, - 292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292,333,373,373,373,373,373,373,373,373,373,373,373,373,373,373,334,292,292,292, - 292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, - 292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, - }; - - obj.createentity(24, 44, 11, 112); // (horizontal gravity line) - obj.createentity(176, 180, 11, 112); // (horizontal gravity line) - rcol = 4; - roomname = "Thorny Exchange"; - result = contents; - break; - } - - case rn(51,50): - { - - static const short contents[] = { - 283,283,283,284,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444, - 283,283,284,445,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66, - 283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 283,283,405,53,0,0,0,0,0,363,364,364,364,364,365,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,363,364,364, - 283,283,405,53,0,0,0,0,54,403,283,283,283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,283, - 283,283,405,53,0,0,0,0,0,443,444,444,444,444,445,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,283, - 283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,283, - 283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,283, - 283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,283, - 283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,283, - 283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,283, - 283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,283, - 283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,283, - 283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,65,65,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,283, - 283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,363,365,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,283, - 283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,283, - 283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,283, - 283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,283, - 283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,283, - 283,283,324,365,65,65,65,65,65,65,65,65,65,65,65,65,65,65,363,325,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,283, - 283,283,283,324,364,364,364,364,364,364,364,364,364,364,364,364,364,364,325,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,283, - 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,283, - }; - - obj.createentity(32, 28, 11, 296); // (horizontal gravity line) - obj.createentity(32, 196, 11, 112); // (horizontal gravity line) - obj.createentity(128, 100, 11, 160); // (horizontal gravity line) - obj.createentity(88, 112, 10, 0, 250510); // (savepoint) - roomname = "Brought to you by the letter G"; - rcol = 1; - result = contents; - break; - } - - case rn(52,50): - { - - static const short contents[] = { - 447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447, - 68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 367,367,367,367,367,367,367,367,368,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 286,286,286,286,286,286,286,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 286,286,286,286,286,286,286,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 286,286,286,286,286,286,286,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 286,286,286,286,286,286,286,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 286,286,286,286,286,286,286,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 286,286,286,286,286,286,286,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 286,286,286,286,286,286,286,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 286,286,286,286,286,286,286,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 286,286,286,286,286,286,286,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 286,286,286,286,286,286,286,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 286,286,286,286,286,286,286,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 286,286,286,286,286,286,286,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 286,286,286,286,286,286,286,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 286,286,286,286,286,286,286,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 286,286,286,286,286,286,286,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 286,286,286,286,286,286,286,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 286,286,286,286,286,286,286,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 286,286,286,286,286,286,286,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - }; - - obj.createentity(-8, 28, 11, 336); // (horizontal gravity line) - obj.createentity(32, 72, 10, 1, 250520); // (savepoint) - rcol=2; - - roomname = "Free Your Mind"; - result = contents; - break; - } - - case rn(52,51): - { - - static const short contents[] = { - 280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 280,280,280,280,280,280,280,280,321,362,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63, - 280,280,280,280,280,280,280,280,280,321,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361, - 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280, - 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280, - 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280, - }; - - obj.createentity(80, 180, 11, 248); // (horizontal gravity line) - rcol=0; - roomname = "I Changed My Mind, Thelma..."; - result = contents; - break; - } - - case rn(53,51): - { - - static const short contents[] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,414,59,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,414,59,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,414,59,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,414,59,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,414,59,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,414,59,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,414,59,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,414,59,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,414,59,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,414,59,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,414,59,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,414,59,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,414,59,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,414,59,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,414,59,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,414,59,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,414,59,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,414,59,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,414,59,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,414,59,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,414,59,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,414,59,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,414,59,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,414,59,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,414,59,0,0,0,0,0,0,0,0,0,0, - 71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,372,334,292,333,374,71,71,71,71,71,71,71,71,71,71, - 373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,334,292,292,292,333,373,373,373,373,373,373,373,373,373,373, - 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, - 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, - 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, - }; - - obj.createentity(-8, 180, 11, 208); // (horizontal gravity line) - obj.createentity(240, 180, 11, 88); // (horizontal gravity line) - rcol=4; - - roomname = "Indirect Jump Vector"; - result = contents; - break; - } - - case rn(53,50): - { - - static const short contents[] = { - 456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456, - 74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,73,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,73,396,73,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,375,356,377,61,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295,417,61,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295,417,61,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295,417,61,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295,417,61,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295,417,61,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295,417,61,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295,417,61,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295,417,61,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295,417,61,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295,417,61,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295,417,61,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295,417,61,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295,417,61,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295,417,61,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295,417,61,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295,417,61,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295,417,61,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295,417,61,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295,417,61,0,0,0,0,0,0,0,0,0,0, - }; - - obj.createentity(-8, 28, 11, 336); // (horizontal gravity line) - rcol=5; - - roomname = "In a Single Bound"; - result = contents; - break; - } - - case rn(54,50): - { - - static const short contents[] = { - 444,444,444,444,444,444,444,444,444,285,283,283,283,284,444,444,444,444,444,444,444,444,444,444,444,444,285,283,283,283,284,444,444,444,444,444,444,444,444,444, - 66,66,66,66,66,66,66,66,66,443,285,283,284,445,66,66,66,66,66,66,66,66,66,66,66,66,443,285,283,284,445,66,66,66,66,66,66,66,66,66, - 0,0,0,0,0,0,0,0,0,54,403,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,53,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,54,403,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,53,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,54,403,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,53,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,54,443,359,445,53,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,53,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,66,473,66,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,53,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,66,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,53,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,53,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,53,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,53,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,53,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,53,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,53,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,53,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,53,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,53,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,53,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,53,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,53,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,53,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,53,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,53,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,53,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,65,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,53,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,65,393,65,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,53,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,54,363,353,365,53,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,53,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,54,403,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,53,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,54,403,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,53,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,54,403,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,53,0,0,0,0,0,0,0,0,0, - }; - - obj.createentity(-8, 28, 11, 80); // (horizontal gravity line) - obj.createentity(112, 28, 11, 96); // (horizontal gravity line) - obj.createentity(248, 28, 11, 80); // (horizontal gravity line) - rcol=1; - - roomname = "Barani, Barani"; - result = contents; - break; - } - - - case rn(54,51): - { - - static const short contents[] = { - 0,0,0,0,0,0,0,0,0,56,406,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,56,406,286,408,55,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,56,406,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,56,406,286,408,55,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,56,406,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,56,446,399,448,55,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,56,406,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,68,470,68,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,56,406,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,68,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,56,406,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,56,406,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,56,406,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,56,406,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,56,406,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,56,406,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,56,406,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,56,406,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,56,406,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,56,406,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,56,406,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,56,406,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,56,406,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,56,406,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,67,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,56,406,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,67,390,67,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,56,406,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,56,366,350,368,55,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,56,406,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,56,406,286,408,55,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,56,406,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,56,406,286,408,55,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,56,406,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,56,406,286,408,55,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,56,406,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,56,406,286,408,55,0,0,0,0,0,0,0,0,0, - 67,67,67,67,67,67,67,67,67,366,328,286,327,368,67,67,67,67,67,67,67,67,67,67,67,67,366,328,286,327,368,67,67,67,67,67,67,67,67,67, - 367,367,367,367,367,367,367,367,367,328,286,286,286,327,367,367,367,367,367,367,367,367,367,367,367,367,328,286,286,286,327,367,367,367,367,367,367,367,367,367, - 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, - 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, - 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, - }; - - obj.createentity(-8, 180, 11, 80); // (horizontal gravity line) - obj.createentity(112, 180, 11, 96); // (horizontal gravity line) - obj.createentity(248, 180, 11, 80); // (horizontal gravity line) - rcol=2; - - roomname = "Safety Dance"; - result = contents; - break; - } - - case rn(55,50): - { - - static const short contents[] = { - 450,450,450,450,291,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58,409,289, - 70,70,70,70,409,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58,409,289, - 0,0,0,0,409,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58,409,289, - 0,0,0,0,409,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58,409,289, - 0,0,0,0,449,450,451,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58,409,289, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58,409,289, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58,409,289, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58,409,289, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58,409,289, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58,409,289, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58,409,289, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58,409,289, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58,409,289, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58,409,289, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58,409,289, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58,409,289, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,69,69,0,0,0,0,0,0,69,369,331,289, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58,369,371,0,0,0,0,0,0,369,331,289,289, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58,409,411,0,0,0,0,0,0,409,289,289,289, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58,409,411,0,0,0,0,0,0,409,289,289,289, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58,409,411,0,0,0,0,0,0,409,289,289,289, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58,409,411,0,0,0,0,0,0,409,289,289,289, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58,409,411,0,0,0,0,0,0,409,289,289,289, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58,409,411,0,0,0,0,0,0,409,289,289,289, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58,409,411,0,0,0,0,0,0,409,289,289,289, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58,409,411,0,0,0,0,0,0,409,289,289,289, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58,409,411,0,0,0,0,0,0,409,289,289,289, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58,409,411,0,0,0,0,0,0,409,289,289,289, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58,409,411,0,0,0,0,0,0,409,289,289,289, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58,409,411,0,0,0,0,0,0,409,289,289,289, - }; - - obj.createentity(-8, 28, 11, 40); // (horizontal gravity line) - - rcol=3; - roomname = "Heady Heights"; - result = contents; - break; - } - - case rn(55,49): - { - - static const short contents[] = { - 295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, - 295,296,456,456,456,456,456,456,456,456,456,456,297,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, - 295,417,0,0,0,0,0,0,0,0,0,62,415,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, - 295,417,0,0,0,0,0,0,0,0,0,62,415,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, - 456,457,0,0,0,0,0,0,0,0,0,62,455,456,456,456,456,456,456,456,456,456,456,456,456,297,296,456,456,456,456,456,456,456,456,456,456,456,297,295, - 0,0,0,0,375,376,377,61,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,417,61,0,0,0,0,0,0,0,0,0,62,415,295, - 0,0,0,0,415,295,417,61,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,417,61,0,0,0,0,0,0,0,0,0,62,415,295, - 0,0,0,0,415,295,417,61,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,417,61,0,0,0,0,0,0,0,0,0,62,415,295, - 0,0,0,0,415,295,417,61,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,417,61,0,0,0,0,0,0,0,0,0,62,415,295, - 376,376,376,376,337,295,417,61,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,417,61,0,0,0,0,0,0,0,0,0,62,415,295, - 295,295,295,295,295,295,417,61,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,417,61,0,0,0,0,0,0,0,0,0,62,415,295, - 295,295,295,295,295,295,417,61,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,417,61,0,0,0,0,0,0,0,0,0,62,415,295, - 295,295,295,295,295,295,417,61,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,455,457,61,0,0,0,0,0,0,0,0,0,62,415,295, - 295,295,295,295,295,295,417,61,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295, - 295,295,295,295,295,295,417,61,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295, - 295,295,295,295,295,295,417,61,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295, - 295,295,295,295,295,295,417,61,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295, - 295,295,295,295,295,295,417,61,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295, - 295,295,295,295,295,295,417,61,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295, - 295,295,295,295,295,295,417,61,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295, - 295,295,295,295,295,295,336,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,377,0,0,0,0,0,0,0,62,415,295, - 295,295,295,295,295,295,296,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,457,0,0,0,0,0,0,0,62,415,295, - 295,295,295,295,295,295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295, - 295,295,295,295,295,295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295, - 295,295,295,295,295,295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295, - 295,295,295,295,295,295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295, - 295,295,295,295,295,295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295, - 295,295,295,295,295,295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295, - 295,295,295,295,295,295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295, - 295,295,295,295,295,295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295, - }; - - - obj.createentity(160, 176, 10, 0, 249550); // (savepoint) - obj.createentity(224, 68, 11, 72); // (horizontal gravity line) - - - //obj.createentity(224, 192, 10, 0, 249550); // (savepoint) - - if(!game.intimetrial || game.translator_exploring) - { - obj.createentity((12 * 8)-4, (6 * 8) + 4, 14); //Teleporter! - } - rcol = 5; - - roomname = "Entanglement Generator"; - result = contents; - break; - } - - - case rn(55,51): - { - - static const short contents[] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,402,0,0,0,0,0,0,400,280,280,280, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,402,0,0,0,0,0,0,400,280,280,280, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,402,0,0,0,0,0,0,400,280,280,280, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,402,0,0,0,0,0,0,400,280,280,280, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,402,0,0,0,0,0,0,400,280,280,280, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,402,0,0,0,0,0,0,400,280,280,280, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,402,0,0,0,0,0,0,400,280,280,280, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,402,0,0,0,0,0,0,400,280,280,280, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,402,0,0,0,0,0,0,400,280,280,280, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,402,0,0,0,0,0,0,400,280,280,280, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,402,0,0,0,0,0,0,400,280,280,280, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,402,0,0,0,0,0,0,400,280,280,280, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,402,0,0,0,0,0,0,400,280,280,280, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,402,0,0,0,0,0,0,400,280,280,280, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,402,0,0,0,0,0,0,400,280,280,280, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,402,0,0,0,0,0,0,400,280,280,280, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,402,0,0,0,0,0,0,400,280,280,280, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,402,0,0,0,0,0,0,400,280,280,280, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,402,0,0,0,0,0,0,400,280,280,280, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,402,0,0,0,0,0,0,400,280,280,280, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,402,0,0,0,0,0,0,400,280,280,280, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,402,0,0,0,0,0,0,400,280,280,280, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,402,0,0,0,0,0,0,400,280,280,280, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,402,0,0,0,0,0,0,400,280,280,280, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,402,0,0,0,0,0,0,400,280,280,280, - 63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,360,322,402,0,0,0,0,0,0,400,280,280,280, - 361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,322,280,402,0,0,0,0,0,0,400,280,280,280, - 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,402,0,0,0,0,0,0,400,280,280,280, - 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,402,0,0,0,0,0,0,400,280,280,280, - 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,402,0,0,0,0,0,0,400,280,280,280, - }; - - obj.createentity(-8, 180, 11, 224); // (horizontal gravity line) - - rcol = 0; - roomname = "Exhausted?"; - result = contents; - break; - } - - - case rn(55,52): - { - - static const short contents[] = { - 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,0,0,0,0,0,0,412,292,292,292, - 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,0,0,0,0,0,0,412,292,292,292, - 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,0,0,0,0,0,0,412,292,292,292, - 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,0,0,0,0,0,0,412,292,292,292, - 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,0,0,0,0,0,0,412,292,292,292, - 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,0,0,0,0,0,0,412,292,292,292, - 292,292,293,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,294,292,414,0,0,0,0,0,0,412,292,292,292, - 292,292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,414,0,0,0,0,0,0,412,292,292,292, - 292,292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,414,0,0,0,0,0,0,412,292,292,292, - 292,292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,414,0,0,0,0,0,0,412,292,292,292, - 292,292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,414,0,0,0,0,0,0,412,292,292,292, - 292,292,333,373,373,373,373,373,373,373,373,373,373,373,373,373,373,374,0,0,0,0,0,0,0,0,0,412,292,414,0,0,0,0,0,0,412,292,292,292, - 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,0,0,0,0,0,0,0,0,0,412,292,414,0,0,0,0,0,0,412,292,292,292, - 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,0,0,0,0,0,0,0,0,0,412,292,414,0,0,0,0,0,0,412,292,292,292, - 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,0,0,0,0,0,0,0,0,0,412,292,414,0,0,0,0,0,0,412,292,292,292, - 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,59,0,0,0,0,0,0,0,60,412,292,414,0,0,0,0,0,0,412,292,292,292, - 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,59,0,0,0,0,0,0,0,60,412,292,414,0,0,0,0,0,0,412,292,292,292, - 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,59,0,0,0,0,0,0,0,60,412,292,414,0,0,0,0,0,0,412,292,292,292, - 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,59,0,0,0,0,0,0,0,60,412,292,414,0,0,0,0,0,0,412,292,292,292, - 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,59,0,0,0,0,0,0,0,60,412,292,414,0,0,0,0,0,0,412,292,292,292, - 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,59,0,0,0,0,0,0,0,60,412,292,414,0,0,0,0,0,0,412,292,292,292, - 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,59,0,0,0,0,0,0,0,60,412,292,414,0,0,0,0,0,0,412,292,292,292, - 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,59,0,0,0,0,0,0,0,60,412,292,414,0,0,0,0,0,0,412,292,292,292, - 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,59,0,0,0,0,0,0,0,60,412,292,414,0,0,0,0,0,0,412,292,292,292, - 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,59,0,0,0,0,0,0,0,60,412,292,414,0,0,0,0,0,0,412,292,292,292, - 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,59,0,0,0,0,0,0,0,60,412,292,414,0,0,0,0,0,0,412,292,292,292, - 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,59,0,0,0,0,0,0,0,60,412,292,414,0,0,0,0,0,0,412,292,292,292, - 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,59,0,0,0,0,0,0,0,60,412,292,414,0,0,0,0,0,0,412,292,292,292, - 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,59,0,0,0,0,0,0,0,60,412,292,414,0,0,0,0,0,0,412,292,292,292, - 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,59,0,0,0,0,0,0,0,60,412,292,414,0,0,0,0,0,0,412,292,292,292, - }; - - obj.createentity(32, 64, 9, 10); // (shiny trinket) - obj.createentity(120, 72, 10, 1, 252550); // (savepoint) - rcol = 4; - - roomname = "The Tantalizing Trinket"; - result = contents; - break; - } - - case rn(55,53): - { - - static const short contents[] = { - 283,283,283,283,283,283,283,283,283,284,444,444,444,444,444,444,444,445,53,0,0,0,0,0,0,0,54,403,283,405,0,0,0,0,0,0,403,283,283,283, - 283,283,283,283,283,283,283,283,284,445,66,66,66,66,66,66,66,66,0,0,0,0,0,0,0,0,54,403,283,405,0,0,0,0,0,0,403,283,283,283, - 283,283,283,283,283,283,283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,0,0,0,0,0,0,403,283,283,283, - 283,283,283,283,283,283,283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,0,0,0,0,0,0,403,283,283,283, - 283,283,283,283,283,283,283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,0,0,0,0,0,0,403,283,283,283, - 283,283,283,283,283,283,283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,0,0,0,0,0,0,403,283,283,283, - 283,283,283,283,283,283,283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,0,0,0,0,0,0,403,283,283,283, - 283,283,283,283,283,283,283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,0,0,0,363,364,364,325,283,283,283, - 283,283,283,283,283,283,283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,0,0,0,443,444,444,444,444,285,283, - 283,283,283,283,283,283,283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,0,0,0,0,0,0,0,0,403,283, - 283,283,283,283,283,283,283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,0,0,0,0,0,0,0,0,403,283, - 283,283,283,283,283,283,283,283,405,53,0,0,0,0,0,0,0,65,0,0,0,0,0,0,0,0,54,403,283,405,0,0,0,0,0,0,0,0,403,283, - 283,283,283,283,283,283,283,283,405,53,0,0,0,0,0,0,54,393,53,0,0,0,0,0,0,0,54,403,283,405,0,0,0,0,0,0,0,0,403,283, - 283,283,283,283,283,283,283,283,405,53,0,0,0,0,0,0,54,433,53,0,0,0,0,0,0,0,54,403,283,405,0,0,0,0,0,0,0,0,403,283, - 283,283,283,283,283,283,283,283,405,53,0,0,0,0,0,0,54,433,53,0,0,0,0,0,0,0,54,403,283,439,314,314,314,314,315,0,0,0,403,283, - 283,283,283,283,283,283,283,283,405,53,0,0,0,0,0,0,54,433,53,0,0,0,0,0,0,0,54,403,283,405,0,0,0,0,0,0,0,0,403,283, - 283,283,283,283,283,283,283,283,405,53,0,0,0,0,0,0,54,473,53,0,0,0,0,0,0,0,54,403,283,405,0,0,0,0,0,0,0,0,403,283, - 283,283,283,283,283,283,283,283,405,53,0,0,0,0,0,0,0,66,0,0,0,0,0,0,0,0,54,403,283,405,0,0,0,0,0,0,0,0,403,283, - 283,283,283,283,283,283,283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,0,0,0,0,0,0,0,0,403,283, - 283,283,283,283,283,283,283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,0,0,0,0,0,0,0,0,403,283, - 283,283,283,283,283,283,283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,0,0,0,363,364,364,364,364,325,283, - 283,283,283,283,283,283,283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,0,0,0,443,444,444,285,283,283,283, - 283,283,283,283,283,283,283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,0,0,0,0,0,0,403,283,283,283, - 283,283,283,283,283,283,283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,0,0,0,0,0,0,403,283,283,283, - 283,283,283,283,283,283,283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,0,0,0,0,0,0,403,283,283,283, - 283,283,283,283,283,283,283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,0,0,0,0,0,0,403,283,283,283, - 283,283,283,283,283,283,283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,0,0,0,0,0,0,403,283,283,283, - 283,283,283,283,283,283,283,283,324,365,65,65,65,65,65,65,65,65,0,0,0,0,0,0,0,0,54,403,283,405,0,0,0,0,0,0,403,283,283,283, - 283,283,283,283,283,283,283,283,283,324,364,364,364,364,364,364,364,365,53,0,0,0,0,0,0,0,54,403,283,405,0,0,0,0,0,0,403,283,283,283, - 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,405,53,0,0,0,0,0,0,0,54,403,283,405,0,0,0,0,0,0,403,283,283,283, - }; - - obj.createentity(272, 144, 10, 1, 253550); // (savepoint) - obj.createentity(152, 116, 11, 56); // (horizontal gravity line) - obj.createentity(139, 16, 12, 72); // (vertical gravity line) - obj.createentity(139, 144, 12, 72); // (vertical gravity line) - rcol=1; - - roomname = "The Bernoulli Principle"; - result = contents; - break; - } - - case rn(55,54): - { - - static const short contents[] = { - 295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,417,61,0,0,0,0,0,0,0,62,415,295,417,0,0,0,0,0,0,415,295,295,295, - 295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,417,61,0,0,0,0,0,0,0,62,415,295,417,0,0,0,0,0,0,415,295,295,295, - 295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,417,61,0,0,0,0,0,0,0,62,415,295,417,0,0,0,0,0,0,415,295,295,295, - 456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,297,417,61,0,0,0,0,0,0,0,62,415,295,417,0,0,0,0,0,0,415,295,295,295, - 74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,415,417,61,0,0,0,0,0,0,0,62,415,295,417,0,0,0,0,0,0,415,295,295,295, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,417,61,0,0,0,0,0,0,0,62,415,295,417,0,0,0,0,0,0,415,295,295,295, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,417,61,0,0,0,0,0,0,0,62,415,295,417,0,0,0,0,0,0,415,295,295,295, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,417,61,0,0,0,0,0,0,0,62,415,295,417,0,0,0,0,0,0,415,295,295,295, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,455,457,0,0,0,0,0,0,0,0,0,455,456,457,0,0,0,0,0,0,415,295,295,295, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,375,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,337,295,295,295, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, - 73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,415,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, - 376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,337,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, - 295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, - 295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, - 295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, - 295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, - }; - - obj.createentity(216, 144, 10, 1, 254550); // (savepoint) - obj.createentity(-8, 60, 11, 136); // (horizontal gravity line) - obj.createentity(-8, 172, 11, 136); // (horizontal gravity line) - rcol = 5; - - roomname = "Standing Wave"; - result = contents; - break; - } - - case rn(54,54): - { - - static const short contents[] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286,286,286,286,286,286,286, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286,286,286,286,286,286,286, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,446,288,286,286,286,286,286,286,286,286,286,286, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,68,446,447,447,447,447,447,447,447,447,447,447, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,68,68,68,68,68,68,68,68,68,68,68, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,67,67,67,67,67,67,67,67,67,67,67, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,67,366,367,367,367,367,367,367,367,367,367,367, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,366,328,286,286,286,286,286,286,286,286,286,286, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286,286,286,286,286,286,286, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286,286,286,286,286,286,286, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286,286,286,286,286,286,286, - }; - - obj.createentity(-8, 60, 11, 336); // (horizontal gravity line) - obj.createentity(-8, 172, 11, 336); // (horizontal gravity line) - rcol=2; - - obj.fatal_top(); - roomname = "Topsy Turvyism"; - result = contents; - break; - } - - case rn(53,54): - { - - static const short contents[] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,369,370,370,370,370,371,0,0,0,0,0,0,369,370,370,370,370,370,370,370,370,371,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,449,450,450,450,450,451,0,0,0,0,0,0,449,450,450,450,450,450,291,289,289,411,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,70,70,70,70,70,70,0,0,0,0,0,0,70,70,70,70,70,70,449,450,450,451,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,369,370,370,371,69,69,69,69,69,69,0,0,0,0,0,0,69,69,69,69,69,69,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,409,289,289,330,370,370,370,370,370,371,0,0,0,0,0,0,369,370,370,370,370,371,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,449,450,450,450,450,450,450,450,450,451,0,0,0,0,0,0,449,450,450,450,450,451,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - }; - - obj.createentity(-8, 60, 11, 120); // (horizontal gravity line) - obj.createentity(-8, 172, 11, 40); // (horizontal gravity line) - obj.createentity(264, 72, 10, 0, 254530); // (savepoint) - obj.createentity(40, 144, 10, 1, 254531); // (savepoint) - obj.createentity(160, 60, 11, 48); // (horizontal gravity line) - obj.createentity(288, 60, 11, 40); // (horizontal gravity line) - obj.createentity(112, 172, 11, 48); // (horizontal gravity line) - obj.createentity(208, 172, 11, 120); // (horizontal gravity line) - rcol=3; - - obj.fatal_top(); - roomname = "Spike Strip Deployed"; - result = contents; - break; - } - - case rn(52,54): - { - - static const short contents[] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - }; - - obj.createentity(-8, 60, 11, 336); // (horizontal gravity line) - obj.createentity(-8, 172, 11, 336); // (horizontal gravity line) - obj.createentity(72, 64, 1, 0, 8, 72, 64, 248, 168); // Enemy, bounded - obj.createentity(232, 64, 1, 0, 8, 72, 64, 248, 168); // Enemy, bounded - obj.createentity(152, 152, 1, 1, 8, 72, 64, 248, 168); // Enemy, bounded - - obj.fatal_top(); - roomname = "Vibrating String Problem"; - rcol = 5; - result = contents; - break; - } - - case rn(51,54): - { - - static const short contents[] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,363,364,365,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,443,444,445,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,363,364,365,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,443,444,445,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - }; - - obj.createentity(176, 60, 11, 152); // (horizontal gravity line) - obj.createentity(176, 172, 11, 152); // (horizontal gravity line) - obj.createentity(-8, 84, 11, 160); // (horizontal gravity line) - obj.createentity(-8, 148, 11, 160); // (horizontal gravity line) - obj.createentity(160-4, 120, 10, 1, 254510); // (savepoint) - rcol=1; - - obj.fatal_top(); - roomname = "Merge"; - result = contents; - break; - } - - case rn(50,54): - { - - static const short contents[] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - }; - - obj.createentity(-8, 84, 11, 336); // (horizontal gravity line) - obj.createentity(-8, 148, 11, 336); // (horizontal gravity line) - obj.createentity(88, 96, 1, 3, 3); // Enemy - obj.createentity(40, 120, 1, 3, 3); // Enemy - obj.createentity(136, 120, 1, 3, 3); // Enemy - rcol = 0; - - obj.fatal_top(); - - roomname = "Kids His Age Bounce"; - result = contents; - break; - } - - case rn(49,54): - { - - static const short contents[] = { - 286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 286,286,286,286,287,448,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,310,352,368,0,0,0,0,0,0,0, - 286,286,286,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,56,406,408,0,0,0,0,0,0,0, - 286,286,286,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,56,406,408,0,0,0,0,0,0,0, - 286,286,286,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,56,406,408,0,0,0,0,0,0,0, - 286,286,286,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,56,406,408,0,0,0,0,0,0,0, - 286,286,286,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,56,406,408,0,0,0,0,0,0,0, - 286,286,286,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,56,406,408,0,0,0,0,0,0,0, - 286,286,286,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,67,0,0,0,0,0,0,0,56,406,408,0,0,0,0,0,0,0, - 286,286,286,286,408,55,0,0,0,0,0,0,0,67,0,0,0,0,0,0,0,56,390,55,0,0,0,0,0,0,56,406,408,0,0,0,0,0,0,0, - 286,286,286,286,408,55,0,0,0,0,0,0,56,390,55,0,0,0,0,0,0,56,430,55,0,0,0,0,0,0,56,406,408,0,0,0,0,0,0,0, - 286,286,286,286,408,55,0,0,0,0,0,0,56,430,55,0,0,0,0,0,0,56,430,55,0,0,0,0,0,0,310,392,448,0,0,0,0,0,0,0, - 286,286,286,286,408,55,0,0,0,0,0,0,56,430,55,0,0,0,0,0,0,56,430,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 286,286,286,286,408,55,0,0,0,0,0,0,56,430,55,0,0,0,0,0,0,56,430,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 286,286,286,286,408,55,0,0,0,0,0,0,56,430,55,0,0,0,0,0,0,56,470,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 286,286,286,286,408,55,0,0,0,0,0,0,56,430,55,0,0,0,0,0,0,0,68,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 286,286,286,286,408,55,0,0,0,0,0,0,56,430,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 286,286,286,286,408,55,0,0,0,0,0,0,56,430,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 286,286,286,286,408,55,0,0,0,0,0,0,56,430,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 286,286,286,286,408,55,0,0,0,0,0,0,56,430,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 286,286,286,286,408,55,0,0,0,0,0,0,56,430,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 286,286,286,286,408,55,0,0,0,0,0,0,56,430,55,0,0,0,0,0,0,0,67,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 286,286,286,286,408,55,0,0,0,0,0,0,56,430,55,0,0,0,0,0,0,56,390,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 286,286,286,286,408,55,0,0,0,0,0,0,56,430,55,0,0,0,0,0,0,56,430,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 286,286,286,286,408,55,0,0,0,0,0,0,56,430,55,0,0,0,0,0,0,56,430,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 286,286,286,286,408,55,0,0,0,0,0,0,56,430,55,0,0,0,0,0,0,56,430,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 286,286,286,286,408,55,0,0,0,0,0,0,56,430,55,0,0,0,0,0,0,56,430,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 286,286,286,286,408,55,0,0,0,0,0,0,56,430,55,0,0,0,0,0,0,56,430,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 286,286,286,286,408,55,0,0,0,0,0,0,56,430,55,0,0,0,0,0,0,56,430,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 286,286,286,286,408,55,0,0,0,0,0,0,56,430,55,0,0,0,0,0,0,56,430,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - }; - - obj.createentity(264, 84, 11, 64); // (horizontal gravity line) - obj.createentity(240+4, 96, 10, 0, 254490); // (savepoint) - obj.createentity(48, 28, 11, 192); // (horizontal gravity line) - obj.createentity(120, 148, 11, 208); // (horizontal gravity line) - rcol=2; - - roomname = "I'm Sorry"; - result = contents; - break; - } - - - case rn(49,55): - { - - static const short contents[] = { - 292,292,292,292,414,59,0,0,0,0,0,0,60,427,59,0,0,0,0,0,0,60,427,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 292,292,292,292,414,59,0,0,0,0,0,0,60,427,59,0,0,0,0,0,0,60,427,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 292,292,292,292,414,59,0,0,0,0,0,0,60,427,59,0,0,0,0,0,0,60,427,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 292,292,292,292,414,59,0,0,0,0,0,0,60,427,59,0,0,0,0,0,0,60,427,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 292,292,292,292,414,59,0,0,0,0,0,0,60,427,59,0,0,0,0,0,0,60,468,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373, - 292,292,292,292,414,59,0,0,0,0,0,0,60,427,59,0,0,0,0,0,0,60,412,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, - 292,292,292,292,414,59,0,0,0,0,0,0,60,427,59,0,0,0,0,0,0,60,428,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453, - 292,292,292,292,414,59,0,0,0,0,0,0,60,427,59,0,0,0,0,0,0,60,427,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 292,292,292,292,414,59,0,0,0,0,0,0,60,427,59,0,0,0,0,0,0,60,427,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 292,292,292,292,414,59,0,0,0,0,0,0,60,427,59,0,0,0,0,0,0,60,427,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 292,292,292,292,414,59,0,0,0,0,0,0,60,427,59,0,0,0,0,0,0,60,427,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 292,292,292,292,414,59,0,0,0,0,0,0,60,427,59,0,0,0,0,0,0,60,427,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 292,292,292,292,414,59,0,0,0,0,0,0,60,467,59,0,0,0,0,0,0,60,467,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 292,292,292,292,414,59,0,0,0,0,0,0,0,72,0,0,0,0,0,0,0,0,72,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 292,292,292,292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,372,373,373,373,373,373,373,373, - 292,292,292,292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,292,292,292,292,292, - 292,292,292,292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292,292,292,292,292,292, - 292,292,292,292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292,292,292,292,292,292, - 292,292,292,292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292,292,292,292,292,292, - 292,292,292,292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292,292,292,292,292,292, - 292,292,292,292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292,292,292,292,292,292, - 292,292,292,292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292,292,292,292,292,292, - 292,292,292,292,333,374,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,372,334,292,292,292,292,292,292,292, - 292,292,292,292,292,333,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,334,292,292,292,292,292,292,292,292, - 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, - 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, - 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, - 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, - 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, - 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, - }; - - obj.createentity(48, 156, 11, 200); // (horizontal gravity line) - obj.createentity(216, 56, 10, 0, 255490); // (savepoint) - rcol=4; - - roomname = "Please Forgive Me!"; - result = contents; - break; - } - - case rn(50,55): - { - - static const short contents[] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 364,364,364,364,364,364,364,364,364,354,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,355,364,364, - 283,283,283,283,283,283,283,283,283,405,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,443,444,444, - 444,444,444,444,444,444,444,444,444,445,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 364,364,364,364,364,364,364,364,364,365,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 283,283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 283,283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 283,283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 283,283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 283,283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 283,283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 283,283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 283,283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 283,283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 283,283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 283,283,283,283,283,283,283,283,283,405,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,363,364,364, - 283,283,283,283,283,283,283,283,283,324,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,325,283,283, - 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, - 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, - 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, - }; - - obj.createentity(131, 48, 12, 152); // (vertical gravity line) - obj.createentity(179, 48, 12, 152); // (vertical gravity line) - obj.createentity(227, 48, 12, 152); // (vertical gravity line) - obj.createentity(275, 48, 12, 152); // (vertical gravity line) - rcol=1; - - roomname = "Playing Foosball"; - result = contents; - break; - } - - case rn(51,55): - { - - static const short contents[] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 376,376,376,376,376,357,317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,358,376,376,376,376, - 456,456,456,456,456,457,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,455,456,456,456,456, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,416,61,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,416,61,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,416,61,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,62,416,61,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 376,376,376,376,376,377,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,375,376,376,376,376, - 295,295,295,295,295,336,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,337,295,295,295,295, - 295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, - 295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, - 295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, - }; - - obj.createentity(91, 168, 12, 32); // (vertical gravity line) - obj.createentity(139, 80, 12, 120); // (vertical gravity line) - obj.createentity(235, 104, 12, 96); // (vertical gravity line) - obj.createentity(187, 144, 12, 56); // (vertical gravity line) - obj.createentity(43, 48, 12, 152); // (vertical gravity line) - obj.createentity(91, 48, 12, 112); // (vertical gravity line) - obj.createentity(139, 48, 12, 24); // (vertical gravity line) - obj.createentity(187, 48, 12, 88); // (vertical gravity line) - obj.createentity(235, 48, 12, 48); // (vertical gravity line) - obj.createentity(283, 48, 12, 152); // (vertical gravity line) - obj.createentity(8, 48, 10, 0, 255510); // (savepoint) - rcol=5; - - roomname = "A Difficult Chord"; - result = contents; - break; - } - - case rn(52,55): - { - - static const short contents[] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 361,361,345,305,305,305,305,346,361,345,305,305,305,305,305,346,361,345,305,305,305,305,305,346,361,345,305,305,305,305,305,346,361,361,361,361,361,361,361,361, - 441,441,442,64,64,64,64,440,344,442,64,64,64,64,64,440,344,442,64,64,64,64,64,440,344,442,64,64,64,64,64,440,282,280,280,280,280,280,280,280, - 0,0,0,0,0,0,0,0,464,0,0,0,0,0,0,52,424,51,0,0,0,0,0,64,464,64,0,0,0,0,0,52,400,280,280,280,280,280,280,280, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,424,51,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,280,280,280,280,280,280, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,424,51,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,280,280,280,280,280,280, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,424,51,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,280,280,280,280,280,280, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,464,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,280,280,280,280,280,280, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,280,280,280,280,280,280, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,280,280,280,280,280,280, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,280,280,280,280,280,280, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,280,280,280,280,280,280, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,280,280,280,280,280,280, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,280,280,280,280,280,280, - 0,0,0,0,0,0,0,0,384,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,384,0,0,0,0,0,0,52,400,280,280,280,280,280,280,280, - 0,0,0,0,0,0,0,0,424,51,0,0,0,0,0,0,0,0,0,0,0,0,0,52,424,51,0,0,0,0,0,52,400,280,280,280,280,280,280,280, - 0,0,0,0,0,0,0,0,424,51,0,0,0,0,0,0,0,0,0,0,0,0,0,52,424,51,0,0,0,0,0,52,400,280,280,280,280,280,280,280, - 0,0,0,0,0,0,0,0,424,51,0,0,0,0,0,0,0,0,0,0,0,0,0,52,424,51,0,0,0,0,0,52,400,280,280,280,280,280,280,280, - 0,0,0,0,0,0,0,0,424,51,0,0,0,0,0,0,0,0,0,0,0,0,0,52,424,51,0,0,0,0,0,52,400,280,280,280,280,280,280,280, - 0,0,0,0,0,0,0,0,424,51,0,0,0,0,0,0,0,0,0,0,0,0,0,52,424,51,0,0,0,0,0,52,400,280,280,280,280,280,280,280, - 0,0,0,0,0,0,0,0,424,51,0,0,0,0,0,0,384,0,0,0,0,0,0,52,424,51,0,0,0,0,0,52,400,280,280,280,280,280,280,280, - 0,0,0,0,0,0,0,0,424,51,0,0,0,0,0,52,424,51,0,0,0,0,0,52,424,51,0,0,0,0,0,52,400,280,280,280,280,280,280,280, - 361,361,361,361,361,361,361,361,479,362,63,63,63,63,63,360,466,51,0,0,0,0,0,52,465,362,63,63,63,63,63,360,322,280,280,280,280,280,280,280, - 280,280,280,280,280,280,280,280,280,321,361,361,361,361,361,322,402,51,0,0,0,0,0,52,400,321,361,361,361,361,361,322,280,280,280,280,280,280,280,280, - 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,52,400,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280, - 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,52,400,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280, - 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,52,400,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280, - }; - - obj.createentity(16, 184, 10, 1, 255520); // (savepoint) - obj.createentity(131, 88, 12, 96); // (vertical gravity line) - obj.createentity(208, 180, 11, 40); // (horizontal gravity line) - obj.createentity(67, 56, 12, 80); // (vertical gravity line) - obj.createentity(195, 56, 12, 80); // (vertical gravity line) - rcol = 0; - - roomname = "The Living Dead End"; - result = contents; - break; - } - - case rn(52,56): - { - - static const short contents[] = { - 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,57,0,0,0,0,0,58,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, - 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,57,0,0,0,0,0,58,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, - 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,57,0,0,0,0,0,58,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, - 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,57,0,0,0,0,0,58,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, - 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,57,0,0,0,0,0,58,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, - 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,57,0,0,0,0,0,58,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, - 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,57,0,0,0,0,0,58,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, - 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,57,0,0,0,0,0,58,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, - 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,57,0,0,0,0,0,58,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, - 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,57,0,0,0,0,0,58,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, - 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,57,0,0,0,0,0,58,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, - 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,57,0,0,0,0,0,58,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, - 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,57,0,0,0,0,0,58,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, - 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,57,0,0,0,0,0,58,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, - 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,57,0,0,0,0,0,58,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, - 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,57,0,0,0,0,0,58,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, - 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,57,0,0,0,0,0,58,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, - 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,57,0,0,0,0,0,58,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, - 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,57,0,0,0,0,0,58,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, - 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,57,0,0,0,0,0,58,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, - 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,57,0,0,0,0,0,58,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, - 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,57,0,0,0,0,0,58,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, - 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,57,0,0,0,0,0,58,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, - 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,57,0,0,0,0,0,58,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, - 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,57,0,0,0,0,0,58,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, - 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,57,0,0,0,0,0,58,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, - 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,57,0,0,0,0,0,58,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, - 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,57,0,0,0,0,0,58,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, - 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,57,0,0,0,0,0,58,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, - 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,57,0,0,0,0,0,58,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, - }; - rcol=3; - - roomname = "AAAAAA"; - result = contents; - break; - } - - case rn(52,57): - { - - static const short contents[] = { - 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,408,55,0,0,0,0,0,56,406,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, - 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,408,55,0,0,0,0,0,56,406,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, - 286,286,286,286,286,286,287,447,447,447,288,286,286,286,286,286,408,55,0,0,0,0,0,56,406,286,286,286,286,286,287,447,447,447,288,286,286,286,286,286, - 286,286,286,286,286,286,408,68,68,68,406,286,286,286,286,286,408,55,0,0,0,0,0,56,406,286,286,286,286,286,408,68,68,68,406,286,286,286,286,286, - 286,286,286,286,286,286,408,0,0,0,446,288,286,286,286,286,408,55,0,0,0,0,0,56,406,286,286,286,286,287,448,0,0,0,406,286,286,286,286,286, - 286,286,286,286,286,286,408,0,0,0,68,406,286,286,286,286,408,55,0,0,0,0,0,56,406,286,286,286,286,408,68,0,0,0,406,286,286,286,286,286, - 286,286,286,286,286,286,408,0,0,0,0,446,447,447,447,447,448,55,0,0,0,0,0,56,446,447,447,447,447,448,0,0,0,0,406,286,286,286,286,286, - 286,286,286,286,286,286,408,0,0,0,0,68,68,68,68,68,68,0,0,0,0,0,0,0,68,68,68,68,68,68,0,0,0,0,406,286,286,286,286,286, - 286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286, - 286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286, - 286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286, - 286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,366,367,367,367,368,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286, - 286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,366,367,328,286,286,286,327,367,368,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286, - 286,286,286,286,286,286,408,0,0,0,0,0,0,366,367,367,328,286,286,286,286,286,286,286,327,367,367,368,0,0,0,0,0,0,406,286,286,286,286,286, - 286,286,286,286,286,286,408,0,0,0,0,0,0,406,286,286,286,286,286,286,286,286,286,286,286,286,286,408,0,0,0,0,0,0,406,286,286,286,286,286, - 286,286,286,286,286,286,408,0,0,0,0,0,0,446,447,288,286,286,286,286,286,286,286,286,286,287,447,448,0,0,0,0,0,0,406,286,286,286,286,286, - 286,286,286,286,286,286,408,0,0,0,0,0,0,68,68,446,447,288,286,286,286,286,286,287,447,448,68,68,0,0,0,0,0,0,406,286,286,286,286,286, - 286,286,286,286,286,286,327,368,0,0,0,0,0,0,0,68,68,446,447,288,286,287,447,448,68,68,0,0,0,0,0,0,0,366,328,286,286,286,286,286, - 286,286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,68,68,446,447,448,68,68,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286,286, - 286,286,286,286,286,286,286,327,368,0,0,0,0,0,0,0,0,0,0,68,68,68,0,0,0,0,0,0,0,0,0,0,366,328,286,286,286,286,286,286, - 286,286,286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286,286,286, - 286,286,286,286,286,286,286,286,327,368,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,366,328,286,286,286,286,286,286,286, - 286,286,286,286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286,286,286,286, - 286,286,286,286,286,286,286,286,286,327,367,368,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,366,367,328,286,286,286,286,286,286,286,286, - 286,286,286,286,286,286,286,286,286,286,286,327,367,368,0,0,0,0,0,0,0,0,0,0,0,0,0,366,367,328,286,286,286,286,286,286,286,286,286,286, - 286,286,286,286,286,286,286,286,286,286,286,286,286,327,367,368,0,0,0,0,0,0,0,0,0,366,367,328,286,286,286,286,286,286,286,286,286,286,286,286, - 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,327,367,368,0,0,0,0,0,366,367,328,286,286,286,286,286,286,286,286,286,286,286,286,286,286, - 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,408,0,0,0,0,0,406,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, - 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,408,0,0,0,0,0,406,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, - 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,408,0,0,0,0,0,406,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, - }; - rcol = 2; - - roomname = "Diode"; - result = contents; - break; - } - - - case rn(50,52): - { - - static const short contents[] = { - 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280, - 281,441,441,441,441,282,281,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,282,280,280, - 402,0,0,0,0,400,402,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,440,282,280, - 402,0,0,0,0,400,402,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280, - 402,0,0,0,0,400,402,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280, - 402,0,0,0,0,440,442,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280, - 402,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280, - 402,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280, - 402,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280, - 402,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280, - 402,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280, - 321,361,361,361,361,361,361,361,361,362,0,0,0,0,0,0,0,0,0,0,0,0,0,63,0,0,360,361,361,361,345,306,0,0,0,0,0,52,400,280, - 280,280,280,280,280,280,280,280,280,402,0,0,0,0,0,0,0,0,0,0,0,0,0,384,0,0,400,280,280,280,402,51,0,0,0,0,0,52,400,280, - 280,280,280,280,280,280,280,280,280,402,0,0,63,0,0,0,0,0,0,0,0,0,0,424,0,0,400,280,280,280,402,51,0,0,0,0,0,52,400,280, - 280,280,280,280,280,280,280,280,280,402,0,0,384,0,0,0,0,0,0,0,0,0,0,424,0,0,400,280,280,280,402,51,0,0,0,0,0,52,400,280, - 280,280,280,280,280,280,280,280,280,402,0,0,424,0,0,0,0,0,0,0,0,0,0,424,0,0,400,280,280,280,402,51,0,0,0,0,0,52,400,280, - 280,280,280,280,280,280,280,280,280,402,0,0,424,0,0,0,0,0,0,0,0,0,0,424,0,0,400,280,280,280,402,51,0,0,0,0,0,52,400,280, - 280,280,280,280,280,280,280,280,280,402,0,0,424,0,0,0,0,0,0,0,0,0,0,424,0,0,400,280,280,280,402,51,0,0,0,0,0,52,400,280, - 280,280,280,280,280,280,280,280,280,402,63,63,424,63,63,63,63,63,63,63,63,63,63,424,63,63,400,280,280,280,402,51,0,0,0,0,0,52,400,280, - 280,280,280,280,280,280,280,280,280,321,361,361,479,361,361,361,361,361,361,361,361,361,361,479,361,361,322,280,280,280,402,51,0,0,0,0,0,52,400,280, - 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,52,400,280, - 280,280,280,280,280,280,280,280,281,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,385,306,0,0,0,0,0,52,400,280, - 280,280,280,280,280,280,280,280,402,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280, - 280,280,280,280,280,280,280,280,402,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280, - 280,280,280,280,280,280,280,280,402,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280, - 280,280,280,280,280,280,280,280,402,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280, - 280,280,280,280,280,280,280,280,402,0,0,0,0,0,360,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,322,280, - 280,280,280,280,280,280,280,280,402,0,0,0,0,0,400,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280, - 280,280,280,280,280,280,280,280,402,0,0,0,0,0,400,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280, - 280,280,280,280,280,280,280,280,402,0,0,0,0,0,400,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280, - }; - - obj.createentity(267, 24, 12, 184); // (vertical gravity line) - obj.createentity(16, 24, 9, 9); // (shiny trinket) - obj.createentity(187, 24, 12, 64); // (vertical gravity line) - obj.createentity(104, 124, 11, 80); // (horizontal gravity line) - obj.createentity(48, 72, 10, 1, 252500); // (savepoint) - obj.createentity(224, 72, 10, 1, 252501); // (savepoint) - obj.createentity(99, 24, 12, 80); // (vertical gravity line) - rcol=0; - - roomname = "Young Man, It's Worth the Challenge"; - result = contents; - break; - } - - case rn(53,55): - { - - static const short contents[] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 367,367,367,367,367,367,368,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,360,361,362,372,373,374,0,0,0,0,0,0,0,0,0,0, - 286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,400,280,402,412,292,414,0,0,0,0,0,0,0,0,0,0, - 447,447,447,447,288,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,400,280,402,412,292,414,0,0,0,0,0,0,0,0,0,0, - 364,364,364,365,406,286,408,0,0,0,0,0,0,0,0,0,0,360,361,362,0,0,0,0,400,280,402,452,453,454,0,0,0,0,366,367,367,368,0,0, - 283,283,283,405,406,286,408,0,0,0,0,0,0,0,0,0,0,400,280,402,0,0,0,0,400,280,321,361,361,362,0,0,0,0,406,286,286,408,0,0, - 283,283,283,405,406,286,408,0,0,0,0,0,0,0,0,0,0,400,280,402,0,0,0,0,440,441,441,282,280,402,0,0,0,0,406,286,286,408,0,0, - 283,283,283,405,406,286,408,0,0,0,0,369,370,371,360,361,361,322,280,402,0,0,0,0,0,0,0,400,280,402,0,0,0,0,406,286,286,408,0,0, - 283,283,283,405,406,286,408,0,0,0,0,409,289,411,400,280,280,280,280,402,0,0,0,0,0,0,0,400,280,402,0,0,0,0,406,286,286,408,0,0, - 283,283,283,405,446,447,448,0,0,0,0,409,289,411,440,441,441,441,441,442,0,0,0,0,0,0,0,440,441,442,0,0,0,0,406,286,286,408,0,0, - 283,283,283,324,364,364,365,0,0,0,0,409,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,408,0,0, - 283,283,283,283,283,283,405,0,0,0,0,409,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,408,0,0, - 283,283,283,283,283,283,405,0,0,0,0,409,289,411,0,0,0,0,0,0,0,0,0,0,363,364,364,364,364,365,0,0,0,0,406,287,447,448,0,0, - 283,283,283,283,283,283,405,0,0,0,0,409,289,411,0,0,0,0,0,0,0,0,0,0,443,444,285,283,283,405,0,0,0,0,406,408,375,377,0,0, - 444,444,444,444,444,444,445,0,0,0,0,409,289,411,0,0,0,369,370,370,370,370,370,370,370,371,403,284,444,445,0,0,0,0,406,408,415,417,0,0, - 373,373,373,373,373,373,374,0,0,0,0,409,289,411,0,0,0,409,289,290,450,450,450,450,450,451,403,405,0,0,0,0,0,0,406,408,415,417,0,0, - 292,292,292,292,292,292,414,375,376,376,377,409,289,411,0,0,0,409,289,411,363,364,364,364,364,364,325,405,0,0,0,0,0,0,406,408,415,417,0,0, - 292,292,292,293,453,453,454,415,295,295,417,409,289,411,0,0,0,449,450,451,443,444,444,444,444,444,444,445,0,0,0,0,0,0,446,448,415,336,376,376, - 292,292,292,414,360,361,362,415,295,295,417,409,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,375,376,376,376,376,337,295,295,295, - 292,292,292,414,400,280,402,415,295,295,417,409,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295,295,295,295,295,295, - 292,292,292,414,400,280,402,455,456,456,457,409,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295,295,295,295,295,295, - 292,292,292,414,400,280,321,361,361,361,362,409,289,330,370,370,370,370,370,370,370,370,370,370,371,375,376,376,376,376,376,337,295,295,295,295,295,295,295,295, - 292,292,292,414,400,280,280,280,280,280,402,409,289,289,289,289,289,289,289,290,450,450,450,450,451,415,295,295,295,295,295,295,295,295,295,295,295,295,295,295, - 292,292,292,414,400,280,280,280,280,280,402,409,289,289,289,289,289,289,289,411,375,376,376,376,376,337,295,295,295,295,295,295,295,295,295,295,295,295,295,295, - 292,292,292,414,400,280,280,280,280,280,402,409,289,289,289,289,289,289,289,411,415,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, - 292,292,292,414,400,280,280,280,280,280,402,409,289,289,289,289,289,289,289,411,415,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, - }; - - rcol = 6; - - roomname = "Anomaly"; - result = contents; - break; - } - - case rn(54,55): - { - - static const short contents[] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295,295,295,295,295,295,417,412,292, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295,295,295,295,295,295,417,412,292, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295,295,295,295,296,456,457,412,292, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295,295,295,295,417,372,373,334,292, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295,295,296,456,457,412,292,292,292, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295,295,417,372,373,334,292,292,292, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,296,456,457,412,292,292,292,292,292, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,417,372,373,334,292,292,292,292,292, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,296,456,457,412,292,292,292,292,292,292,292, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,417,372,373,334,292,292,292,292,292,292,292, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,455,457,412,292,292,292,292,292,292,292,292,292, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,372,373,334,292,292,292,292,292,292,292,292,292, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,372,373,334,292,292,292,292,292,292,292,292,292,292,292, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292,292,292, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,372,373,334,292,292,292,292,292,292,292,292,292,292,292,292,292, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, - 0,0,0,0,0,0,0,0,0,0,0,360,361,361,361,361,362,0,0,0,0,0,366,368,412,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, - 0,0,0,0,0,0,0,0,0,0,0,400,280,280,280,280,402,0,0,0,0,0,406,408,452,453,453,453,294,292,292,292,292,292,292,292,292,292,292,292, - 370,370,370,371,366,367,367,368,363,364,365,440,282,280,280,281,442,363,364,365,366,367,328,408,369,370,370,371,452,453,294,292,292,292,292,292,292,292,292,292, - 289,289,289,411,406,286,286,408,403,283,324,365,440,282,281,442,363,325,283,405,406,286,286,408,409,289,289,330,370,371,452,453,294,292,292,292,292,292,292,292, - 289,289,289,411,446,288,286,408,443,285,283,324,365,440,442,363,325,283,284,445,406,286,287,448,409,289,289,289,289,330,370,371,452,453,294,292,292,292,292,292, - 289,289,289,330,371,446,288,327,368,443,285,283,324,364,364,325,283,284,445,366,328,287,448,369,331,289,289,289,289,289,289,330,370,371,452,453,294,292,292,292, - 289,289,289,289,330,371,406,286,327,368,443,444,285,283,283,284,444,445,366,328,286,408,369,331,289,289,289,289,289,289,289,289,289,330,370,371,452,453,294,292, - 289,289,289,289,289,411,446,288,286,327,367,368,443,444,444,445,366,367,328,286,287,448,409,289,289,289,289,289,289,289,289,289,289,289,289,330,370,371,452,453, - 289,289,289,289,289,330,371,446,447,288,286,327,367,367,367,367,328,286,287,447,448,369,331,289,289,289,289,289,289,289,289,289,289,289,289,289,289,330,370,370, - 289,289,289,289,289,289,330,370,371,406,286,286,286,286,286,286,286,286,408,369,370,331,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, - 289,289,289,289,289,289,289,289,411,406,286,286,286,286,286,286,286,286,408,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, - }; - - obj.createentity(104, 128, 9, 11); // (shiny trinket) - rcol = 6; - - roomname = "Purest Unobtainium"; - result = contents; - break; - } - - - case rn(52,58): - { - - static const short contents[] = { - 295,295,295,295,295,417,0,415,295,295,295,295,295,295,295,295,295,417,0,0,0,0,0,415,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, - 295,295,295,295,295,417,0,415,295,295,295,295,295,295,295,295,295,417,0,0,0,0,0,415,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, - 295,295,295,295,295,417,0,415,295,295,295,295,295,295,295,295,295,417,0,0,0,0,0,415,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, - 295,295,295,295,295,417,0,415,295,295,296,456,456,456,456,456,456,457,0,0,0,0,0,455,456,456,456,456,456,456,456,456,456,456,456,297,295,295,295,295, - 295,295,295,295,295,417,0,415,295,295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295,295, - 295,295,295,295,295,417,0,415,295,295,417,0,375,376,376,376,376,377,0,0,0,0,0,375,376,376,376,376,376,376,376,376,376,377,0,415,295,295,295,295, - 295,295,295,295,295,417,0,415,295,295,417,0,415,295,295,295,295,417,0,0,0,0,0,415,295,295,295,295,295,295,295,295,295,417,0,415,295,295,295,295, - 295,295,295,295,295,417,0,415,295,295,417,0,415,295,296,456,456,457,0,0,0,0,0,455,456,456,456,456,456,456,456,297,295,417,0,415,295,295,295,295, - 295,295,295,295,295,417,0,415,295,295,417,0,415,295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,417,0,415,295,295,295,295, - 295,295,295,295,295,417,0,415,295,295,417,0,415,295,417,0,375,377,0,0,0,0,0,375,376,376,376,376,376,377,0,415,295,417,0,415,295,295,295,295, - 295,295,295,295,295,417,0,415,295,295,417,0,415,295,417,0,415,417,0,0,0,0,0,455,456,456,456,456,297,417,0,415,295,417,0,415,295,295,295,295, - 295,295,295,295,295,417,0,415,295,295,417,0,415,295,417,0,415,417,0,0,0,0,0,0,0,0,0,0,415,417,0,415,295,417,0,415,295,295,295,295, - 295,295,295,295,295,417,0,415,295,295,417,0,415,295,417,0,415,417,0,0,0,0,0,375,376,376,377,0,415,417,0,415,295,417,0,415,295,295,295,295, - 295,295,295,295,295,417,0,415,295,295,417,0,415,295,417,0,415,417,0,0,0,0,0,455,456,297,417,0,415,417,0,415,295,417,0,415,295,295,295,295, - 295,295,295,295,295,417,0,415,295,295,417,0,415,295,417,0,415,417,0,0,0,0,0,0,0,415,417,0,415,417,0,415,295,417,0,415,295,295,295,295, - 295,295,295,295,295,417,0,415,295,295,417,0,415,295,417,0,415,417,0,0,0,0,0,396,0,415,417,0,415,417,0,415,295,417,0,415,295,295,295,295, - 295,295,295,295,295,417,0,415,295,295,417,0,415,295,417,0,415,417,0,0,0,0,0,476,0,415,417,0,415,417,0,415,295,417,0,415,295,295,295,295, - 295,295,295,295,295,417,0,415,295,295,417,0,415,295,417,0,415,417,0,0,0,0,0,0,0,415,417,0,415,417,0,415,295,417,0,415,295,295,295,295, - 295,295,295,295,295,417,0,415,295,295,417,0,415,295,417,0,415,417,0,0,0,0,0,375,376,337,417,0,415,417,0,415,295,417,0,415,295,295,295,295, - 456,456,456,456,456,457,0,455,456,456,457,0,455,456,457,0,455,457,0,0,0,0,0,455,456,456,457,0,415,417,0,415,295,417,0,415,295,295,295,295, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,417,0,415,295,417,0,415,295,295,295,295, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,375,376,376,376,376,337,417,0,415,295,417,0,415,295,295,295,295, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,455,456,456,456,456,456,457,0,415,295,417,0,415,295,295,295,295, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,417,0,415,295,295,295,295, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,375,376,376,376,376,376,376,376,337,295,417,0,415,295,295,295,295, - 376,376,376,376,376,377,0,375,376,376,377,0,375,376,376,376,376,376,376,376,376,376,376,337,295,295,295,295,295,295,295,295,295,417,0,415,295,295,295,295, - 295,295,295,295,295,417,0,415,295,295,417,0,455,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,457,0,415,295,295,295,295, - 295,295,295,295,295,417,0,415,295,295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295,295, - 295,295,295,295,295,417,0,415,295,295,336,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,337,295,295,295,295, - 295,295,295,295,295,417,0,415,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, - }; - - obj.createentity(112, 184, 10, 1, 258520); // (savepoint) - rcol = 5; - - roomname = "I Smell Ozone"; - result = contents; - break; - } - - case rn(51,58): - { - - static const short contents[] = { - 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280, - 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280, - 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280, - 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280, - 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280, - 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280, - 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280, - 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280, - 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280, - 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280, - 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280, - 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280, - 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280, - 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280, - 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280, - 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280, - 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280, - 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280, - 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280, - 441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361, - 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280, - 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280, - 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280, - 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280, - }; - rcol=0; - - if(!game.intimetrial || game.translator_exploring) - { - if(game.companion==0 && !obj.flags[9] && !game.crewstats[5]) //also need to check if he's rescued in a previous game - { - obj.createentity(32, 177, 18, 16, 1, 17, 1); - obj.createblock(1, 24*8, 0, 32, 240, 33); - } - } - - roomname = "Why So Blue?"; - - result = contents; - break; - } - - case rn(50,58): - { - - static const short contents[] = { - 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, - 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, - 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, - 289,289,289,290,450,450,450,450,450,450,450,450,450,291,289,289,289,290,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,291,289,289,289,289,289,289, - 289,289,289,411,0,0,0,0,0,0,0,0,0,409,289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289,289,289,289, - 289,289,289,411,0,0,0,0,0,0,0,0,0,409,289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289,289,289,289, - 289,289,289,411,0,0,0,0,0,0,0,0,369,331,289,289,289,330,371,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289,289,289,289, - 289,289,289,411,0,0,0,0,0,0,0,0,449,450,450,450,450,450,451,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289,289,289,289, - 289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289,289,289,289, - 289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289,289,289,289, - 289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289,289,289,289, - 289,289,289,411,0,0,0,369,371,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289,289,289,289, - 289,289,289,330,370,370,370,331,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289,289,289,289, - 289,289,289,289,289,289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289,289,289,289, - 289,289,289,289,289,289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289,289,289,289, - 289,289,289,289,289,289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289,289,289,289, - 289,289,289,290,450,450,450,291,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289,289,289,289, - 289,289,289,411,0,0,0,449,451,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289,289,289,289, - 289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289,289,289,289, - 289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,449,450,450,450,450,450,450, - 289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 289,289,289,411,0,0,0,0,0,0,0,0,369,370,370,370,370,370,371,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 289,289,289,411,0,0,0,0,0,0,0,0,449,291,289,289,289,290,451,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 289,289,289,411,0,0,0,0,0,0,0,0,0,409,289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 289,289,289,411,0,0,0,0,0,0,0,0,0,409,289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 289,289,289,330,370,370,370,370,370,370,370,370,370,331,289,289,289,330,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370, - 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, - 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, - 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, - 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, - }; - rcol=3; - - - obj.createentity((10 * 8)-4, (8 * 8) + 4, 14); //Teleporter! - - if(game.intimetrial) - { - obj.createblock(1, 280, 0, 32, 240, 82); - } - - roomname = "Philadelphia Experiment"; - result = contents; - break; - } + case rn(50,50): + { + + static const short contents[] = { + 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, + 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, + 283,283,283,283,283,283,283,283,284,444,444,444,444,444,444,444,444,444,285,283,284,444,444,444,444,444,444,444,444,444,444,444,444,285,283,283,283,283,283,283, + 283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,0,0,0,0,0,0,403,283,283,283,283,283,283, + 283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,0,0,0,0,0,0,403,283,283,283,283,283,283, + 283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,0,0,0,0,0,0,403,283,283,283,283,283,283, + 283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,0,0,0,0,0,0,403,283,283,283,283,283,283, + 283,283,283,283,283,283,283,283,405,0,0,0,363,364,365,0,0,0,403,283,405,0,0,0,363,364,365,0,0,0,0,0,0,403,283,283,283,283,283,283, + 283,283,283,283,283,283,283,283,405,0,0,0,403,283,405,0,0,0,443,444,445,0,0,0,403,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283, + 283,283,283,283,283,283,283,283,405,0,0,0,403,283,405,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283, + 444,444,444,444,444,444,285,283,405,0,0,0,403,283,405,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283, + 0,0,0,0,0,0,403,283,405,0,0,0,403,283,405,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283, + 0,0,0,0,0,0,403,283,405,0,0,0,403,283,405,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283, + 0,0,0,0,0,0,403,283,405,0,0,0,403,283,324,364,364,364,364,364,364,364,364,364,325,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283, + 0,0,0,0,0,0,403,283,405,0,0,0,403,283,283,283,283,283,283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283, + 0,0,0,0,0,0,403,283,405,0,0,0,443,444,444,444,444,444,444,444,444,444,444,444,285,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283, + 0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283, + 364,364,365,0,0,0,403,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283, + 283,283,405,0,0,0,403,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283, + 283,283,405,0,0,0,403,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283, + 283,283,405,0,0,0,403,283,324,364,364,364,364,364,364,364,364,364,364,364,365,0,0,0,403,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283, + 283,283,405,0,0,0,403,283,283,283,283,283,283,283,283,283,283,283,283,283,405,0,0,0,403,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283, + 283,283,405,0,0,0,443,444,444,444,444,444,444,444,444,444,444,444,444,444,445,0,0,0,403,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283, + 283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283, + 283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283, + 283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283, + 283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283, + 283,283,324,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,325,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283, + 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283, + 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283, + }; + + obj.createentity(232, 24, 10, 0, 250500); // (savepoint) + + if(game.intimetrial) + { + obj.createblock(0, 0, 0, 8, 240); + } + + rcol=1; + roomname = "Get Ready To Bounce"; + result = contents; + break; + } + + case rn(50,51): + { + + static const short contents[] = { + 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,402,0,0,0,0,0,0,400,280,280,280,280,280,280, + 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,402,0,0,0,0,0,0,400,280,280,280,280,280,280, + 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,281,441,442,0,0,0,0,0,0,440,441,441,441,441,282,280, + 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,281,442,64,64,0,0,0,0,0,0,64,64,64,64,64,440,282, + 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400, + 441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,442,51,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400, + 63,63,63,63,63,63,63,63,63,63,63,63,63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400, + 361,361,361,361,361,361,361,361,361,361,361,361,362,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400, + 280,280,280,280,280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400, + 280,280,280,280,280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400, + 280,280,280,280,280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400, + 280,280,280,280,280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400, + 280,280,280,280,280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400, + 280,280,280,280,280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400, + 280,280,280,280,280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400, + 280,280,280,280,280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400, + 280,280,280,280,280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400, + 280,280,280,280,280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400, + 280,280,280,280,280,280,280,280,280,280,280,280,321,362,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,360,322, + 280,280,280,280,280,280,280,280,280,280,280,280,280,321,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,322,280, + 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280, + 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280, + }; + + obj.createentity(112, 180, 11, 192); // (horizontal gravity line) + rcol = 0; + + roomname = "It's Perfectly Safe"; + result = contents; + break; + } + + case rn(49,51): + { + + static const short contents[] = { + 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, + 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, + 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, + 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, + 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, + 292,293,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453, + 292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,72,72,72,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 292,414,0,0,0,0,0,0,0,0,71,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,71,71,71,71,71,71,71,71,71,71,71,71, + 292,414,0,0,0,0,0,0,0,60,413,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,307,308,308,308,308,308,308,349,373,373,373,373, + 292,414,0,0,0,0,0,0,0,0,72,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,292,292, + 292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,292,292, + 292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,292,292, + 292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,292,292, + 292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,292,292, + 292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,292,292, + 292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,292,292, + 292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,292,292, + 292,414,0,0,0,0,0,0,0,0,0,0,0,0,71,71,71,0,0,0,0,0,71,71,71,0,0,0,0,0,0,0,0,0,0,412,292,292,292,292, + 292,333,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,374,0,0,0,0,0,0,0,412,292,292,292,292, + 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,0,0,0,0,0,0,0,412,292,292,292,292, + 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,0,0,0,0,0,0,0,412,292,292,292,292, + 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,0,0,0,0,0,0,0,412,292,292,292,292, + 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,0,0,0,0,0,0,0,412,292,292,292,292, + }; + + obj.createentity(96, 124, 11, 120); // (horizontal gravity line) + obj.createentity(248, 48, 10, 0, 251490); // (savepoint) + rcol = 4; + + roomname = "Rascasse"; + result = contents; + break; + } + + case rn(49,52): + { + + static const short contents[] = { + 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,408,0,0,0,0,0,0,0,406,286,286,286,286, + 286,287,447,447,447,447,447,447,447,447,288,286,286,287,447,447,447,447,447,447,447,447,288,286,286,287,447,448,0,0,0,0,0,0,0,406,286,286,286,286, + 286,408,68,68,68,68,68,68,68,68,406,286,286,408,68,68,68,68,68,68,68,68,406,286,286,408,68,68,0,0,0,0,0,0,0,406,286,286,286,286, + 286,408,0,0,0,0,0,0,0,0,406,286,286,408,0,0,0,0,0,0,0,0,406,286,286,408,0,0,0,0,0,0,0,0,0,406,286,286,286,286, + 286,408,0,0,0,0,0,0,0,0,406,286,286,408,0,0,0,0,0,0,0,0,406,286,286,408,0,0,0,0,0,0,0,0,0,406,286,286,286,286, + 286,408,0,0,0,0,0,0,0,0,406,286,286,408,0,0,0,0,0,0,0,0,406,286,286,408,0,0,0,0,0,0,0,0,0,406,286,286,286,286, + 286,408,0,0,0,0,0,0,0,0,406,286,286,408,0,0,0,0,0,0,0,0,406,286,286,408,0,0,0,0,0,0,0,0,0,406,286,286,286,286, + 286,408,0,0,0,0,0,0,0,0,406,286,286,408,0,0,0,0,0,0,0,0,406,286,286,408,0,0,0,0,0,0,0,0,0,406,286,286,286,286, + 286,408,0,0,0,0,0,0,0,0,406,286,286,408,0,0,0,0,0,0,0,0,406,286,286,408,0,0,0,0,0,0,0,0,0,406,286,286,286,286, + 447,448,0,0,0,0,0,0,0,0,446,447,447,448,0,0,0,0,0,0,0,0,446,447,447,448,0,0,0,0,0,0,0,0,0,406,286,286,286,286, + 0,0,0,0,0,0,0,0,0,0,68,68,68,68,0,0,0,0,0,0,0,0,68,68,68,68,0,0,0,0,0,0,0,0,0,406,286,286,286,286, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,67,67,67,67,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286, + 367,367,367,367,367,367,367,368,0,0,0,0,0,0,0,0,366,367,367,368,0,0,0,0,0,0,0,0,366,367,367,367,367,367,367,328,286,286,286,286, + 286,286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,406,286,286,408,0,0,0,0,0,0,0,0,406,286,286,286,286,286,286,286,286,286,286,286, + 286,286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,406,286,286,408,0,0,0,0,0,0,0,0,406,286,286,286,286,286,286,286,286,286,286,286, + 286,286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,406,286,286,408,0,0,0,0,0,0,0,0,406,286,286,286,286,286,286,286,286,286,286,286, + 286,286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,406,286,286,408,0,0,0,0,0,0,0,0,406,286,286,286,286,286,286,286,286,286,286,286, + 286,286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,406,286,286,408,0,0,0,0,0,0,0,0,406,286,286,286,286,286,286,286,286,286,286,286, + 286,286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,406,286,286,408,0,0,0,0,0,0,0,0,406,286,286,286,286,286,286,286,286,286,286,286, + 286,286,286,286,286,286,286,408,67,67,67,67,67,67,67,67,406,286,286,408,67,67,67,67,67,67,67,67,406,286,286,286,286,286,286,286,286,286,286,286, + 286,286,286,286,286,286,286,327,367,367,367,367,367,367,367,367,328,286,286,327,367,367,367,367,367,367,367,367,328,286,286,286,286,286,286,286,286,286,286,286, + 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, + 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, + }; + + obj.createentity(248, 136, 10, 1, 252490); // (savepoint) + obj.createentity(16, 68, 11, 64); // (horizontal gravity line) + obj.createentity(112, 68, 11, 64); // (horizontal gravity line) + obj.createentity(64, 164, 11, 64); // (horizontal gravity line) + obj.createentity(160, 164, 11, 64); // (horizontal gravity line) + rcol = 2; + + roomname = "Keep Going"; + result = contents; + break; + } + + case rn(48,52): + { + + static const short contents[] = { + 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, + 289,289,289,289,289,290,450,450,450,450,450,450,450,450,450,450,450,450,450,291,289,289,289,290,450,450,450,450,450,450,450,450,450,450,450,450,450,291,289,289, + 289,289,289,289,289,411,70,70,70,70,70,70,70,70,70,70,70,70,70,409,289,289,289,411,70,70,70,70,70,70,70,70,70,70,70,70,70,409,289,289, + 289,289,289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289, + 289,289,289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289, + 289,289,289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289, + 289,289,289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289, + 289,289,289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289, + 289,289,289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289, + 289,290,450,450,450,451,0,0,0,0,0,0,0,0,0,0,0,0,0,449,450,450,450,451,0,0,0,0,0,0,0,0,0,0,0,0,0,449,450,450, + 289,411,70,70,70,70,0,0,0,0,0,0,0,0,0,0,0,0,0,70,70,70,70,70,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 289,411,0,0,0,0,0,0,0,0,0,69,69,69,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 289,411,0,0,0,0,0,0,0,0,0,369,370,371,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,369,370,370,370,370,370,370,370,370,370,370, + 289,411,0,0,0,0,0,0,0,0,0,409,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289,289,289,289,289,289,289,289, + 289,411,0,0,0,0,0,0,0,0,0,409,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289,289,289,289,289,289,289,289, + 289,411,0,0,0,0,0,0,0,0,0,409,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289,289,289,289,289,289,289,289, + 289,411,0,0,0,0,0,0,0,0,0,409,289,411,69,69,69,69,69,0,0,0,0,0,69,69,69,69,69,409,289,289,289,289,289,289,289,289,289,289, + 289,411,0,0,0,0,0,0,0,0,0,409,289,330,370,370,370,370,371,0,0,0,0,0,369,370,370,370,370,331,289,289,289,289,289,289,289,289,289,289, + 289,411,0,0,0,0,0,0,0,0,0,409,289,289,289,289,289,289,411,0,0,0,0,0,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, + 289,411,0,0,0,0,0,0,0,0,0,409,289,289,289,289,289,289,411,0,0,0,0,0,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, + 289,411,0,0,0,0,0,0,0,0,0,409,289,289,289,289,289,289,330,370,370,370,370,370,331,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, + 289,411,0,0,0,0,0,0,0,0,0,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, + 289,411,0,0,0,0,0,0,0,0,0,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, + }; + + obj.createentity(280, 136, 10, 1, 252480); // (savepoint) + obj.createentity(48, 52, 11, 104); // (horizontal gravity line) + obj.createentity(192, 52, 11, 104); // (horizontal gravity line) + obj.createentity(152, 196, 11, 40); // (horizontal gravity line) + rcol=3; + + roomname = "Single-slit Experiment"; + result = contents; + break; + } + + + case rn(48,53): + { + + static const short contents[] = { + 295,417,0,0,0,0,0,0,0,0,0,415,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, + 295,417,0,0,0,0,0,0,0,0,0,415,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, + 295,417,0,0,0,0,0,0,0,0,0,415,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, + 295,417,0,0,0,0,0,0,0,0,0,415,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, + 295,417,0,0,0,0,0,0,0,0,0,415,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, + 295,417,0,0,0,0,0,0,0,0,0,415,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, + 295,417,0,0,0,0,0,0,0,0,0,415,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, + 295,417,0,0,0,0,0,0,0,0,0,415,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, + 295,417,0,0,0,0,0,0,0,0,0,415,295,295,295,295,295,295,295,295,295,295,295,295,295,296,456,456,456,456,456,456,456,456,456,456,456,456,456,456, + 295,417,0,0,0,0,0,0,0,0,0,415,295,295,295,295,295,295,295,295,295,295,295,295,295,417,74,74,74,74,74,74,74,74,74,74,74,74,74,74, + 295,417,0,0,0,0,0,0,0,0,0,455,456,456,456,456,456,456,456,456,456,456,456,456,456,457,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 295,336,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376, + 295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, + 295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, + 295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, + 295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, + 295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, + 295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, + 295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, + 295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, + 295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, + 295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, + 295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, + }; + + obj.createentity(32, 128, 10, 1, 253480); // (savepoint) + obj.createentity(187, 88, 12, 56); // (vertical gravity line) + obj.createentity(107, 88, 12, 56); // (vertical gravity line) + rcol = 5; + + roomname = "Don't Flip Out"; + result = contents; + break; + } + + case rn(49,53): + { + + static const short contents[] = { + 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, + 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, + 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, + 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, + 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, + 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, + 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, + 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,284,444,444,444,444,444,444,444,444,444,285,283,283,283,283,283,283,283,283,283,283,283,283,283,283, + 444,444,444,444,444,285,283,283,283,283,283,283,283,283,283,405,66,66,66,66,66,66,66,66,66,403,283,283,283,283,283,283,283,283,283,284,444,444,444,444, + 66,66,66,66,66,403,283,283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,0,0,0,403,283,283,283,283,283,283,283,283,283,405,66,66,66,66, + 0,0,0,0,0,443,444,444,444,444,444,444,444,444,444,445,0,0,0,0,0,0,0,0,0,443,444,444,444,444,444,444,444,444,444,445,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 364,364,364,364,364,365,0,0,0,0,0,0,0,0,0,363,364,364,364,364,364,364,364,364,364,365,0,0,0,0,0,0,0,0,0,363,364,364,364,364, + 283,283,283,283,283,405,0,0,0,0,0,0,0,0,0,403,283,283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,0,0,0,403,283,283,283,283, + 283,283,283,283,283,405,65,65,65,65,65,65,65,65,65,403,283,283,283,283,283,283,283,283,283,405,65,65,65,65,65,65,65,65,65,403,283,283,283,283, + 283,283,283,283,283,324,364,364,364,364,364,364,364,364,364,325,283,283,283,283,283,283,283,283,283,324,364,364,364,364,364,364,364,364,364,325,283,283,283,283, + 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, + 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, + 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, + 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, + 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, + 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, + 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, + 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, + }; + + obj.createentity(43, 88, 12, 56); // (vertical gravity line) + obj.createentity(123, 88, 12, 56); // (vertical gravity line) + obj.createentity(203, 88, 12, 56); // (vertical gravity line) + obj.createentity(283, 88, 12, 56); // (vertical gravity line) + + obj.createentity(156, 128, 20, 1); // (terminal) + obj.createblock(5, 156-8, 128, 20, 16, 19); + rcol = 1; + + roomname = "Shuffled Hallway"; + result = contents; + break; + } + + case rn(50,53): + { + + static const short contents[] = { + 289,289,289,289,289,289,289,289,411,0,0,0,0,0,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, + 289,289,289,289,289,289,289,289,411,0,0,0,0,0,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, + 289,289,289,289,289,289,289,289,411,0,0,0,0,0,449,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,291,289,289,289,289,289,289,289, + 289,289,289,289,289,289,289,289,411,0,0,0,0,0,0,0,0,0,70,70,70,70,70,0,0,0,0,0,0,0,0,0,409,289,289,289,289,289,289,289, + 289,289,289,289,289,289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289,289,289,289,289, + 289,289,289,289,289,289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289,289,289,289,289, + 289,289,289,289,289,289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289,289,289,289,289, + 289,289,289,289,289,289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289,289,289,289,289, + 450,450,450,450,450,450,450,450,451,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289,289,289,289,289, + 70,70,70,70,70,70,70,70,70,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289,289,289,289,289, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289,289,289,289,289, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289,289,289,289,289, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289,289,289,289,289, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,449,450,450,450,450,450,450,450, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 370,370,370,370,370,370,370,370,371,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 289,289,289,289,289,289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 289,289,289,289,289,289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 289,289,289,289,289,289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 289,289,289,289,289,289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 289,289,289,289,289,289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 289,289,289,289,289,289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 289,289,289,289,289,289,289,289,411,0,0,0,0,0,0,0,0,0,69,69,69,69,69,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 289,289,289,289,289,289,289,289,330,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,371,0,0,0,0,0,0,0,0, + 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,69,69,69,69,69,69,69,69, + 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,330,370,370,370,370,370,370,370,370, + 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, + }; + + obj.createentity(96, 192, 10, 1, 253500); // (savepoint) + obj.createentity(163, 32, 12, 168); // (vertical gravity line) + rcol = 3; + + roomname = "Double-slit Experiment"; + result = contents; + break; + } + + case rn(51,53): + { + + static const short contents[] = { + 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,287,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447, + 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,408,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68, + 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,448,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,68,0,0,0,0,0,0,67,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,366,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, + 67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,406,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, + 367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,328,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, + 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, + }; + + obj.createentity(264, 104, 10, 1, 253510); // (savepoint) + obj.createentity(131, 120, 12, 96); // (vertical gravity line) + obj.createentity(187, 16, 12, 96); // (vertical gravity line) + obj.createentity(40, 112, 10, 0, 253511); // (savepoint) + rcol = 2; + roomname = "They Call Him Flipper"; + result = contents; + break; + } + + case rn(52,53): + { + + static const short contents[] = { + 453,453,453,453,453,453,294,414,0,0,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, + 72,72,0,0,0,0,412,414,0,0,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, + 0,0,0,0,0,0,412,414,0,0,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, + 0,0,0,0,0,0,412,414,0,0,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, + 0,0,0,0,0,0,412,414,0,0,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, + 0,0,0,0,0,0,412,414,0,0,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, + 0,0,0,0,0,0,412,414,0,0,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, + 0,0,0,0,0,0,412,414,0,0,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, + 0,0,0,0,0,0,412,414,0,0,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, + 0,0,0,0,0,0,412,414,0,0,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, + 0,0,0,0,0,0,412,414,0,0,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, + 0,0,0,0,0,0,412,414,0,0,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, + 0,0,0,0,0,0,412,414,0,0,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, + 0,0,0,0,0,0,412,414,0,0,0,0,0,0,412,293,453,453,453,294,292,293,453,453,453,294,292,293,453,453,453,294,292,292,292,292,292,292,292,292, + 0,0,0,0,0,0,412,414,0,0,0,0,0,0,412,414,72,72,72,412,292,414,72,72,72,412,292,414,72,72,72,412,292,292,292,292,292,292,292,292, + 373,374,0,0,0,0,412,414,0,0,0,0,0,0,452,454,0,0,0,452,453,454,0,0,0,452,453,454,0,0,0,452,453,453,453,453,453,453,294,292, + 292,414,0,0,0,0,412,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292, + 292,414,0,0,0,0,412,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292, + 292,414,0,0,0,0,412,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292, + 292,414,0,0,0,0,412,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,71,71,0,0,0,412,292, + 292,414,0,0,0,0,452,454,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,307,309,0,0,0,412,292, + 292,414,0,0,0,0,72,72,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,72,72,0,0,0,412,292, + 292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292, + 292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292, + 292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292, + 292,333,373,373,373,373,373,373,373,373,373,373,373,374,0,0,0,0,0,372,373,373,373,374,0,0,0,0,0,372,373,373,373,373,373,373,373,373,334,292, + 292,292,292,292,292,292,292,292,292,292,292,292,292,414,71,71,71,71,71,412,292,292,292,414,71,71,71,71,71,412,292,292,292,292,292,292,292,292,292,292, + 292,292,292,292,292,292,292,292,292,292,292,292,292,333,373,373,373,373,373,334,292,292,292,333,373,373,373,373,373,334,292,292,292,292,292,292,292,292,292,292, + 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, + 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, + }; + + obj.createentity(24, 184, 10, 1, 253520); // (savepoint) + obj.createentity(64, 164, 11, 200); // (horizontal gravity line) + rcol = 4; + roomname = "Three's a Crowd"; + result = contents; + break; + } + + case rn(52,52): + { + + static const short contents[] = { + 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, + 447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,288,286,286,286,286,286, + 68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,406,286,286,286,286,286, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,67,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286, + 367,367,367,367,367,367,367,351,311,311,311,311,311,311,311,311,311,311,311,311,311,311,311,311,312,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286, + 286,286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,68,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286, + 286,286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286, + 286,286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286, + 286,286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286, + 286,286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286, + 286,286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286, + 286,286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286, + 286,286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286, + 286,286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286, + 286,286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286, + 286,286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286, + 286,286,286,286,286,286,286,408,0,0,0,0,0,0,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,406,286,286,286,286,286, + 286,286,286,286,286,286,286,408,0,0,0,0,0,0,366,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,328,286,286,286,286,286, + 286,286,286,286,286,286,286,408,0,0,0,0,0,0,406,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, + 286,286,286,286,286,286,286,408,0,0,0,0,0,0,406,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, + }; + + obj.createentity(195, 24, 12, 80); // (vertical gravity line) + obj.createentity(195, 128, 12, 80); // (vertical gravity line) + obj.createentity(80, 120, 10, 0, 252520); // (savepoint) + obj.createentity(80, 96, 10, 1, 252521); // (savepoint) + rcol = 2; + roomname = "Hitting the Apex"; + result = contents; + break; + } + + case rn(51,52): + { + + static const short contents[] = { + 280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280, + 280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,280,280,280,280,280,280,280,280,280,281,441,441,441,441,441,441,441,441,441,441, + 280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,280,280,280,280,280,280,280,280,281,442,64,64,64,64,64,64,64,64,64,64, + 280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,280,280,280,281,441,441,441,441,442,51,0,0,0,0,0,0,0,0,0,0, + 280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,280,280,281,442,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,440,282,280,281,442,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,440,344,442,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,464,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,360,361,361,361,361,361,361,361, + 280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,400,280,280,280,280,280,280,280, + 280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,400,280,280,280,280,280,280,280, + 280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,280,280,280,280,280,280, + 280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,280,280,280,280,280,280, + 280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,280,280,280,280,280,280, + 280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,280,280,280,280,280,280, + 280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,280,280,280,280,280,280, + 280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,280,280,280,280,280,280, + 280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,280,280,280,280,280,280, + 280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,280,280,280,280,280,280, + 280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,280,280,280,280,280,280, + 280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,280,280,280,280,280,280, + 280,321,362,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,360,322,280,280,280,280,280,280,280, + 280,280,321,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,322,280,280,280,280,280,280,280,280, + 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280, + }; + + obj.createentity(24, 188, 11, 224); // (horizontal gravity line) + obj.createentity(280, 96, 10, 1, 252510); // (savepoint) + + obj.createentity(204, 32, 20, 0); // (terminal) + obj.createblock(5, 204-8, 32, 20, 16, 20); + rcol=0; + + roomname = "Square Root"; + result = contents; + break; + } + + + case rn(51,51): + { + + static const short contents[] = { + 292,292,293,453,453,453,453,453,453,453,453,453,453,453,453,453,453,294,292,292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292, + 292,293,454,72,72,72,72,72,72,72,72,72,72,72,72,72,72,452,294,292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292, + 292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292, + 292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292, + 292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292, + 292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,452,319,454,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292, + 292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,72,467,72,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292, + 292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,72,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292, + 292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292, + 292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292, + 292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292, + 292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292, + 292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292, + 292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292, + 292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292, + 292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292, + 292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292, + 292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292, + 292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292, + 292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292, + 292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,71,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292, + 292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,71,387,71,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292, + 292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,372,347,374,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292, + 292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292, + 292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292, + 292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292, + 292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,333,374,71,71,71,71,71,71,71,71,71,71,71,71,71,71,372,334,292,292, + 292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292,333,373,373,373,373,373,373,373,373,373,373,373,373,373,373,334,292,292,292, + 292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, + 292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, + }; + + obj.createentity(24, 44, 11, 112); // (horizontal gravity line) + obj.createentity(176, 180, 11, 112); // (horizontal gravity line) + rcol = 4; + roomname = "Thorny Exchange"; + result = contents; + break; + } + + case rn(51,50): + { + + static const short contents[] = { + 283,283,283,284,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444, + 283,283,284,445,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66, + 283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 283,283,405,53,0,0,0,0,0,363,364,364,364,364,365,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,363,364,364, + 283,283,405,53,0,0,0,0,54,403,283,283,283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,283, + 283,283,405,53,0,0,0,0,0,443,444,444,444,444,445,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,283, + 283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,283, + 283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,283, + 283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,283, + 283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,283, + 283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,283, + 283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,283, + 283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,283, + 283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,65,65,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,283, + 283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,363,365,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,283, + 283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,283, + 283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,283, + 283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,283, + 283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,283, + 283,283,324,365,65,65,65,65,65,65,65,65,65,65,65,65,65,65,363,325,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,283, + 283,283,283,324,364,364,364,364,364,364,364,364,364,364,364,364,364,364,325,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,283, + 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,283, + }; + + obj.createentity(32, 28, 11, 296); // (horizontal gravity line) + obj.createentity(32, 196, 11, 112); // (horizontal gravity line) + obj.createentity(128, 100, 11, 160); // (horizontal gravity line) + obj.createentity(88, 112, 10, 0, 250510); // (savepoint) + roomname = "Brought to you by the letter G"; + rcol = 1; + result = contents; + break; + } + + case rn(52,50): + { + + static const short contents[] = { + 447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447, + 68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 367,367,367,367,367,367,367,367,368,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 286,286,286,286,286,286,286,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 286,286,286,286,286,286,286,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 286,286,286,286,286,286,286,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 286,286,286,286,286,286,286,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 286,286,286,286,286,286,286,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 286,286,286,286,286,286,286,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 286,286,286,286,286,286,286,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 286,286,286,286,286,286,286,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 286,286,286,286,286,286,286,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 286,286,286,286,286,286,286,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 286,286,286,286,286,286,286,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 286,286,286,286,286,286,286,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 286,286,286,286,286,286,286,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 286,286,286,286,286,286,286,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 286,286,286,286,286,286,286,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 286,286,286,286,286,286,286,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 286,286,286,286,286,286,286,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 286,286,286,286,286,286,286,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + obj.createentity(-8, 28, 11, 336); // (horizontal gravity line) + obj.createentity(32, 72, 10, 1, 250520); // (savepoint) + rcol=2; + + roomname = "Free Your Mind"; + result = contents; + break; + } + + case rn(52,51): + { + + static const short contents[] = { + 280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 280,280,280,280,280,280,280,280,321,362,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63, + 280,280,280,280,280,280,280,280,280,321,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361, + 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280, + 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280, + 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280, + }; + + obj.createentity(80, 180, 11, 248); // (horizontal gravity line) + rcol=0; + roomname = "I Changed My Mind, Thelma..."; + result = contents; + break; + } + + case rn(53,51): + { + + static const short contents[] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,414,59,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,414,59,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,414,59,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,414,59,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,414,59,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,414,59,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,414,59,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,414,59,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,414,59,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,414,59,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,414,59,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,414,59,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,414,59,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,414,59,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,414,59,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,414,59,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,414,59,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,414,59,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,414,59,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,414,59,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,414,59,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,414,59,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,414,59,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,414,59,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,414,59,0,0,0,0,0,0,0,0,0,0, + 71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,372,334,292,333,374,71,71,71,71,71,71,71,71,71,71, + 373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,334,292,292,292,333,373,373,373,373,373,373,373,373,373,373, + 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, + 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, + 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, + }; + + obj.createentity(-8, 180, 11, 208); // (horizontal gravity line) + obj.createentity(240, 180, 11, 88); // (horizontal gravity line) + rcol=4; + + roomname = "Indirect Jump Vector"; + result = contents; + break; + } + + case rn(53,50): + { + + static const short contents[] = { + 456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456, + 74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,73,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,73,396,73,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,375,356,377,61,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295,417,61,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295,417,61,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295,417,61,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295,417,61,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295,417,61,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295,417,61,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295,417,61,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295,417,61,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295,417,61,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295,417,61,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295,417,61,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295,417,61,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295,417,61,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295,417,61,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295,417,61,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295,417,61,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295,417,61,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295,417,61,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295,417,61,0,0,0,0,0,0,0,0,0,0, + }; + + obj.createentity(-8, 28, 11, 336); // (horizontal gravity line) + rcol=5; + + roomname = "In a Single Bound"; + result = contents; + break; + } + + case rn(54,50): + { + + static const short contents[] = { + 444,444,444,444,444,444,444,444,444,285,283,283,283,284,444,444,444,444,444,444,444,444,444,444,444,444,285,283,283,283,284,444,444,444,444,444,444,444,444,444, + 66,66,66,66,66,66,66,66,66,443,285,283,284,445,66,66,66,66,66,66,66,66,66,66,66,66,443,285,283,284,445,66,66,66,66,66,66,66,66,66, + 0,0,0,0,0,0,0,0,0,54,403,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,53,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,54,403,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,53,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,54,403,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,53,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,54,443,359,445,53,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,53,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,66,473,66,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,53,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,66,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,53,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,53,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,53,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,53,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,53,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,53,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,53,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,53,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,53,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,53,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,53,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,53,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,53,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,53,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,53,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,53,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,53,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,65,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,53,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,65,393,65,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,53,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,54,363,353,365,53,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,53,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,54,403,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,53,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,54,403,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,53,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,54,403,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,53,0,0,0,0,0,0,0,0,0, + }; + + obj.createentity(-8, 28, 11, 80); // (horizontal gravity line) + obj.createentity(112, 28, 11, 96); // (horizontal gravity line) + obj.createentity(248, 28, 11, 80); // (horizontal gravity line) + rcol=1; + + roomname = "Barani, Barani"; + result = contents; + break; + } + + + case rn(54,51): + { + + static const short contents[] = { + 0,0,0,0,0,0,0,0,0,56,406,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,56,406,286,408,55,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,56,406,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,56,406,286,408,55,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,56,406,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,56,446,399,448,55,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,56,406,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,68,470,68,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,56,406,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,68,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,56,406,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,56,406,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,56,406,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,56,406,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,56,406,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,56,406,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,56,406,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,56,406,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,56,406,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,56,406,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,56,406,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,56,406,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,56,406,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,56,406,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,67,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,56,406,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,67,390,67,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,56,406,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,56,366,350,368,55,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,56,406,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,56,406,286,408,55,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,56,406,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,56,406,286,408,55,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,56,406,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,56,406,286,408,55,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,56,406,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,56,406,286,408,55,0,0,0,0,0,0,0,0,0, + 67,67,67,67,67,67,67,67,67,366,328,286,327,368,67,67,67,67,67,67,67,67,67,67,67,67,366,328,286,327,368,67,67,67,67,67,67,67,67,67, + 367,367,367,367,367,367,367,367,367,328,286,286,286,327,367,367,367,367,367,367,367,367,367,367,367,367,328,286,286,286,327,367,367,367,367,367,367,367,367,367, + 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, + 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, + 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, + }; + + obj.createentity(-8, 180, 11, 80); // (horizontal gravity line) + obj.createentity(112, 180, 11, 96); // (horizontal gravity line) + obj.createentity(248, 180, 11, 80); // (horizontal gravity line) + rcol=2; + + roomname = "Safety Dance"; + result = contents; + break; + } + + case rn(55,50): + { + + static const short contents[] = { + 450,450,450,450,291,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58,409,289, + 70,70,70,70,409,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58,409,289, + 0,0,0,0,409,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58,409,289, + 0,0,0,0,409,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58,409,289, + 0,0,0,0,449,450,451,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58,409,289, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58,409,289, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58,409,289, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58,409,289, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58,409,289, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58,409,289, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58,409,289, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58,409,289, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58,409,289, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58,409,289, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58,409,289, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58,409,289, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,69,69,0,0,0,0,0,0,69,369,331,289, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58,369,371,0,0,0,0,0,0,369,331,289,289, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58,409,411,0,0,0,0,0,0,409,289,289,289, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58,409,411,0,0,0,0,0,0,409,289,289,289, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58,409,411,0,0,0,0,0,0,409,289,289,289, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58,409,411,0,0,0,0,0,0,409,289,289,289, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58,409,411,0,0,0,0,0,0,409,289,289,289, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58,409,411,0,0,0,0,0,0,409,289,289,289, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58,409,411,0,0,0,0,0,0,409,289,289,289, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58,409,411,0,0,0,0,0,0,409,289,289,289, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58,409,411,0,0,0,0,0,0,409,289,289,289, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58,409,411,0,0,0,0,0,0,409,289,289,289, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58,409,411,0,0,0,0,0,0,409,289,289,289, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58,409,411,0,0,0,0,0,0,409,289,289,289, + }; + + obj.createentity(-8, 28, 11, 40); // (horizontal gravity line) + + rcol=3; + roomname = "Heady Heights"; + result = contents; + break; + } + + case rn(55,49): + { + + static const short contents[] = { + 295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, + 295,296,456,456,456,456,456,456,456,456,456,456,297,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, + 295,417,0,0,0,0,0,0,0,0,0,62,415,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, + 295,417,0,0,0,0,0,0,0,0,0,62,415,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, + 456,457,0,0,0,0,0,0,0,0,0,62,455,456,456,456,456,456,456,456,456,456,456,456,456,297,296,456,456,456,456,456,456,456,456,456,456,456,297,295, + 0,0,0,0,375,376,377,61,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,417,61,0,0,0,0,0,0,0,0,0,62,415,295, + 0,0,0,0,415,295,417,61,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,417,61,0,0,0,0,0,0,0,0,0,62,415,295, + 0,0,0,0,415,295,417,61,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,417,61,0,0,0,0,0,0,0,0,0,62,415,295, + 0,0,0,0,415,295,417,61,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,417,61,0,0,0,0,0,0,0,0,0,62,415,295, + 376,376,376,376,337,295,417,61,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,417,61,0,0,0,0,0,0,0,0,0,62,415,295, + 295,295,295,295,295,295,417,61,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,417,61,0,0,0,0,0,0,0,0,0,62,415,295, + 295,295,295,295,295,295,417,61,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,417,61,0,0,0,0,0,0,0,0,0,62,415,295, + 295,295,295,295,295,295,417,61,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,455,457,61,0,0,0,0,0,0,0,0,0,62,415,295, + 295,295,295,295,295,295,417,61,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295, + 295,295,295,295,295,295,417,61,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295, + 295,295,295,295,295,295,417,61,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295, + 295,295,295,295,295,295,417,61,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295, + 295,295,295,295,295,295,417,61,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295, + 295,295,295,295,295,295,417,61,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295, + 295,295,295,295,295,295,417,61,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295, + 295,295,295,295,295,295,336,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,377,0,0,0,0,0,0,0,62,415,295, + 295,295,295,295,295,295,296,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,457,0,0,0,0,0,0,0,62,415,295, + 295,295,295,295,295,295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295, + 295,295,295,295,295,295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295, + 295,295,295,295,295,295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295, + 295,295,295,295,295,295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295, + 295,295,295,295,295,295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295, + 295,295,295,295,295,295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295, + 295,295,295,295,295,295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295, + 295,295,295,295,295,295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295, + }; + + + obj.createentity(160, 176, 10, 0, 249550); // (savepoint) + obj.createentity(224, 68, 11, 72); // (horizontal gravity line) + + + //obj.createentity(224, 192, 10, 0, 249550); // (savepoint) + + if(!game.intimetrial) obj.createentity((12 * 8)-4, (6 * 8) + 4, 14); //Teleporter! + rcol = 5; + + roomname = "Entanglement Generator"; + result = contents; + break; + } + + + case rn(55,51): + { + + static const short contents[] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,402,0,0,0,0,0,0,400,280,280,280, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,402,0,0,0,0,0,0,400,280,280,280, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,402,0,0,0,0,0,0,400,280,280,280, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,402,0,0,0,0,0,0,400,280,280,280, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,402,0,0,0,0,0,0,400,280,280,280, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,402,0,0,0,0,0,0,400,280,280,280, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,402,0,0,0,0,0,0,400,280,280,280, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,402,0,0,0,0,0,0,400,280,280,280, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,402,0,0,0,0,0,0,400,280,280,280, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,402,0,0,0,0,0,0,400,280,280,280, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,402,0,0,0,0,0,0,400,280,280,280, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,402,0,0,0,0,0,0,400,280,280,280, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,402,0,0,0,0,0,0,400,280,280,280, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,402,0,0,0,0,0,0,400,280,280,280, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,402,0,0,0,0,0,0,400,280,280,280, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,402,0,0,0,0,0,0,400,280,280,280, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,402,0,0,0,0,0,0,400,280,280,280, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,402,0,0,0,0,0,0,400,280,280,280, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,402,0,0,0,0,0,0,400,280,280,280, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,402,0,0,0,0,0,0,400,280,280,280, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,402,0,0,0,0,0,0,400,280,280,280, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,402,0,0,0,0,0,0,400,280,280,280, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,402,0,0,0,0,0,0,400,280,280,280, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,402,0,0,0,0,0,0,400,280,280,280, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,402,0,0,0,0,0,0,400,280,280,280, + 63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,360,322,402,0,0,0,0,0,0,400,280,280,280, + 361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,322,280,402,0,0,0,0,0,0,400,280,280,280, + 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,402,0,0,0,0,0,0,400,280,280,280, + 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,402,0,0,0,0,0,0,400,280,280,280, + 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,402,0,0,0,0,0,0,400,280,280,280, + }; + + obj.createentity(-8, 180, 11, 224); // (horizontal gravity line) + + rcol = 0; + roomname = "Exhausted?"; + result = contents; + break; + } + + + case rn(55,52): + { + + static const short contents[] = { + 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,0,0,0,0,0,0,412,292,292,292, + 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,0,0,0,0,0,0,412,292,292,292, + 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,0,0,0,0,0,0,412,292,292,292, + 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,0,0,0,0,0,0,412,292,292,292, + 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,0,0,0,0,0,0,412,292,292,292, + 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,0,0,0,0,0,0,412,292,292,292, + 292,292,293,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,294,292,414,0,0,0,0,0,0,412,292,292,292, + 292,292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,414,0,0,0,0,0,0,412,292,292,292, + 292,292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,414,0,0,0,0,0,0,412,292,292,292, + 292,292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,414,0,0,0,0,0,0,412,292,292,292, + 292,292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,414,0,0,0,0,0,0,412,292,292,292, + 292,292,333,373,373,373,373,373,373,373,373,373,373,373,373,373,373,374,0,0,0,0,0,0,0,0,0,412,292,414,0,0,0,0,0,0,412,292,292,292, + 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,0,0,0,0,0,0,0,0,0,412,292,414,0,0,0,0,0,0,412,292,292,292, + 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,0,0,0,0,0,0,0,0,0,412,292,414,0,0,0,0,0,0,412,292,292,292, + 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,0,0,0,0,0,0,0,0,0,412,292,414,0,0,0,0,0,0,412,292,292,292, + 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,59,0,0,0,0,0,0,0,60,412,292,414,0,0,0,0,0,0,412,292,292,292, + 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,59,0,0,0,0,0,0,0,60,412,292,414,0,0,0,0,0,0,412,292,292,292, + 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,59,0,0,0,0,0,0,0,60,412,292,414,0,0,0,0,0,0,412,292,292,292, + 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,59,0,0,0,0,0,0,0,60,412,292,414,0,0,0,0,0,0,412,292,292,292, + 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,59,0,0,0,0,0,0,0,60,412,292,414,0,0,0,0,0,0,412,292,292,292, + 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,59,0,0,0,0,0,0,0,60,412,292,414,0,0,0,0,0,0,412,292,292,292, + 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,59,0,0,0,0,0,0,0,60,412,292,414,0,0,0,0,0,0,412,292,292,292, + 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,59,0,0,0,0,0,0,0,60,412,292,414,0,0,0,0,0,0,412,292,292,292, + 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,59,0,0,0,0,0,0,0,60,412,292,414,0,0,0,0,0,0,412,292,292,292, + 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,59,0,0,0,0,0,0,0,60,412,292,414,0,0,0,0,0,0,412,292,292,292, + 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,59,0,0,0,0,0,0,0,60,412,292,414,0,0,0,0,0,0,412,292,292,292, + 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,59,0,0,0,0,0,0,0,60,412,292,414,0,0,0,0,0,0,412,292,292,292, + 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,59,0,0,0,0,0,0,0,60,412,292,414,0,0,0,0,0,0,412,292,292,292, + 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,59,0,0,0,0,0,0,0,60,412,292,414,0,0,0,0,0,0,412,292,292,292, + 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,59,0,0,0,0,0,0,0,60,412,292,414,0,0,0,0,0,0,412,292,292,292, + }; + + obj.createentity(32, 64, 9, 10); // (shiny trinket) + obj.createentity(120, 72, 10, 1, 252550); // (savepoint) + rcol = 4; + + roomname = "The Tantalizing Trinket"; + result = contents; + break; + } + + case rn(55,53): + { + + static const short contents[] = { + 283,283,283,283,283,283,283,283,283,284,444,444,444,444,444,444,444,445,53,0,0,0,0,0,0,0,54,403,283,405,0,0,0,0,0,0,403,283,283,283, + 283,283,283,283,283,283,283,283,284,445,66,66,66,66,66,66,66,66,0,0,0,0,0,0,0,0,54,403,283,405,0,0,0,0,0,0,403,283,283,283, + 283,283,283,283,283,283,283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,0,0,0,0,0,0,403,283,283,283, + 283,283,283,283,283,283,283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,0,0,0,0,0,0,403,283,283,283, + 283,283,283,283,283,283,283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,0,0,0,0,0,0,403,283,283,283, + 283,283,283,283,283,283,283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,0,0,0,0,0,0,403,283,283,283, + 283,283,283,283,283,283,283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,0,0,0,0,0,0,403,283,283,283, + 283,283,283,283,283,283,283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,0,0,0,363,364,364,325,283,283,283, + 283,283,283,283,283,283,283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,0,0,0,443,444,444,444,444,285,283, + 283,283,283,283,283,283,283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,0,0,0,0,0,0,0,0,403,283, + 283,283,283,283,283,283,283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,0,0,0,0,0,0,0,0,403,283, + 283,283,283,283,283,283,283,283,405,53,0,0,0,0,0,0,0,65,0,0,0,0,0,0,0,0,54,403,283,405,0,0,0,0,0,0,0,0,403,283, + 283,283,283,283,283,283,283,283,405,53,0,0,0,0,0,0,54,393,53,0,0,0,0,0,0,0,54,403,283,405,0,0,0,0,0,0,0,0,403,283, + 283,283,283,283,283,283,283,283,405,53,0,0,0,0,0,0,54,433,53,0,0,0,0,0,0,0,54,403,283,405,0,0,0,0,0,0,0,0,403,283, + 283,283,283,283,283,283,283,283,405,53,0,0,0,0,0,0,54,433,53,0,0,0,0,0,0,0,54,403,283,439,314,314,314,314,315,0,0,0,403,283, + 283,283,283,283,283,283,283,283,405,53,0,0,0,0,0,0,54,433,53,0,0,0,0,0,0,0,54,403,283,405,0,0,0,0,0,0,0,0,403,283, + 283,283,283,283,283,283,283,283,405,53,0,0,0,0,0,0,54,473,53,0,0,0,0,0,0,0,54,403,283,405,0,0,0,0,0,0,0,0,403,283, + 283,283,283,283,283,283,283,283,405,53,0,0,0,0,0,0,0,66,0,0,0,0,0,0,0,0,54,403,283,405,0,0,0,0,0,0,0,0,403,283, + 283,283,283,283,283,283,283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,0,0,0,0,0,0,0,0,403,283, + 283,283,283,283,283,283,283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,0,0,0,0,0,0,0,0,403,283, + 283,283,283,283,283,283,283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,0,0,0,363,364,364,364,364,325,283, + 283,283,283,283,283,283,283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,0,0,0,443,444,444,285,283,283,283, + 283,283,283,283,283,283,283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,0,0,0,0,0,0,403,283,283,283, + 283,283,283,283,283,283,283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,0,0,0,0,0,0,403,283,283,283, + 283,283,283,283,283,283,283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,0,0,0,0,0,0,403,283,283,283, + 283,283,283,283,283,283,283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,0,0,0,0,0,0,403,283,283,283, + 283,283,283,283,283,283,283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,0,0,0,0,0,0,403,283,283,283, + 283,283,283,283,283,283,283,283,324,365,65,65,65,65,65,65,65,65,0,0,0,0,0,0,0,0,54,403,283,405,0,0,0,0,0,0,403,283,283,283, + 283,283,283,283,283,283,283,283,283,324,364,364,364,364,364,364,364,365,53,0,0,0,0,0,0,0,54,403,283,405,0,0,0,0,0,0,403,283,283,283, + 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,405,53,0,0,0,0,0,0,0,54,403,283,405,0,0,0,0,0,0,403,283,283,283, + }; + + obj.createentity(272, 144, 10, 1, 253550); // (savepoint) + obj.createentity(152, 116, 11, 56); // (horizontal gravity line) + obj.createentity(139, 16, 12, 72); // (vertical gravity line) + obj.createentity(139, 144, 12, 72); // (vertical gravity line) + rcol=1; + + roomname = "The Bernoulli Principle"; + result = contents; + break; + } + + case rn(55,54): + { + + static const short contents[] = { + 295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,417,61,0,0,0,0,0,0,0,62,415,295,417,0,0,0,0,0,0,415,295,295,295, + 295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,417,61,0,0,0,0,0,0,0,62,415,295,417,0,0,0,0,0,0,415,295,295,295, + 295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,417,61,0,0,0,0,0,0,0,62,415,295,417,0,0,0,0,0,0,415,295,295,295, + 456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,297,417,61,0,0,0,0,0,0,0,62,415,295,417,0,0,0,0,0,0,415,295,295,295, + 74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,415,417,61,0,0,0,0,0,0,0,62,415,295,417,0,0,0,0,0,0,415,295,295,295, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,417,61,0,0,0,0,0,0,0,62,415,295,417,0,0,0,0,0,0,415,295,295,295, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,417,61,0,0,0,0,0,0,0,62,415,295,417,0,0,0,0,0,0,415,295,295,295, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,417,61,0,0,0,0,0,0,0,62,415,295,417,0,0,0,0,0,0,415,295,295,295, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,455,457,0,0,0,0,0,0,0,0,0,455,456,457,0,0,0,0,0,0,415,295,295,295, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,375,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,337,295,295,295, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, + 73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,415,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, + 376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,337,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, + 295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, + 295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, + 295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, + 295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, + }; + + obj.createentity(216, 144, 10, 1, 254550); // (savepoint) + obj.createentity(-8, 60, 11, 136); // (horizontal gravity line) + obj.createentity(-8, 172, 11, 136); // (horizontal gravity line) + rcol = 5; + + roomname = "Standing Wave"; + result = contents; + break; + } + + case rn(54,54): + { + + static const short contents[] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286,286,286,286,286,286,286, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286,286,286,286,286,286,286, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,446,288,286,286,286,286,286,286,286,286,286,286, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,68,446,447,447,447,447,447,447,447,447,447,447, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,68,68,68,68,68,68,68,68,68,68,68, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,67,67,67,67,67,67,67,67,67,67,67, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,67,366,367,367,367,367,367,367,367,367,367,367, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,366,328,286,286,286,286,286,286,286,286,286,286, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286,286,286,286,286,286,286, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286,286,286,286,286,286,286, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286,286,286,286,286,286,286, + }; + + obj.createentity(-8, 60, 11, 336); // (horizontal gravity line) + obj.createentity(-8, 172, 11, 336); // (horizontal gravity line) + rcol=2; + + obj.fatal_top(); + roomname = "Topsy Turvyism"; + result = contents; + break; + } + + case rn(53,54): + { + + static const short contents[] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,369,370,370,370,370,371,0,0,0,0,0,0,369,370,370,370,370,370,370,370,370,371,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,449,450,450,450,450,451,0,0,0,0,0,0,449,450,450,450,450,450,291,289,289,411,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,70,70,70,70,70,70,0,0,0,0,0,0,70,70,70,70,70,70,449,450,450,451,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,369,370,370,371,69,69,69,69,69,69,0,0,0,0,0,0,69,69,69,69,69,69,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,409,289,289,330,370,370,370,370,370,371,0,0,0,0,0,0,369,370,370,370,370,371,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,449,450,450,450,450,450,450,450,450,451,0,0,0,0,0,0,449,450,450,450,450,451,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + obj.createentity(-8, 60, 11, 120); // (horizontal gravity line) + obj.createentity(-8, 172, 11, 40); // (horizontal gravity line) + obj.createentity(264, 72, 10, 0, 254530); // (savepoint) + obj.createentity(40, 144, 10, 1, 254531); // (savepoint) + obj.createentity(160, 60, 11, 48); // (horizontal gravity line) + obj.createentity(288, 60, 11, 40); // (horizontal gravity line) + obj.createentity(112, 172, 11, 48); // (horizontal gravity line) + obj.createentity(208, 172, 11, 120); // (horizontal gravity line) + rcol=3; + + obj.fatal_top(); + roomname = "Spike Strip Deployed"; + result = contents; + break; + } + + case rn(52,54): + { + + static const short contents[] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + obj.createentity(-8, 60, 11, 336); // (horizontal gravity line) + obj.createentity(-8, 172, 11, 336); // (horizontal gravity line) + obj.createentity(72, 64, 1, 0, 8, 72, 64, 248, 168); // Enemy, bounded + obj.createentity(232, 64, 1, 0, 8, 72, 64, 248, 168); // Enemy, bounded + obj.createentity(152, 152, 1, 1, 8, 72, 64, 248, 168); // Enemy, bounded + + obj.fatal_top(); + roomname = "Vibrating String Problem"; + rcol = 5; + result = contents; + break; + } + + case rn(51,54): + { + + static const short contents[] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,363,364,365,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,443,444,445,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,363,364,365,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,443,444,445,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + obj.createentity(176, 60, 11, 152); // (horizontal gravity line) + obj.createentity(176, 172, 11, 152); // (horizontal gravity line) + obj.createentity(-8, 84, 11, 160); // (horizontal gravity line) + obj.createentity(-8, 148, 11, 160); // (horizontal gravity line) + obj.createentity(160-4, 120, 10, 1, 254510); // (savepoint) + rcol=1; + + obj.fatal_top(); + roomname = "Merge"; + result = contents; + break; + } + + case rn(50,54): + { + + static const short contents[] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + obj.createentity(-8, 84, 11, 336); // (horizontal gravity line) + obj.createentity(-8, 148, 11, 336); // (horizontal gravity line) + obj.createentity(88, 96, 1, 3, 3); // Enemy + obj.createentity(40, 120, 1, 3, 3); // Enemy + obj.createentity(136, 120, 1, 3, 3); // Enemy + rcol = 0; + + obj.fatal_top(); + + roomname = "Kids His Age Bounce"; + result = contents; + break; + } + + case rn(49,54): + { + + static const short contents[] = { + 286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 286,286,286,286,287,448,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,310,352,368,0,0,0,0,0,0,0, + 286,286,286,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,56,406,408,0,0,0,0,0,0,0, + 286,286,286,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,56,406,408,0,0,0,0,0,0,0, + 286,286,286,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,56,406,408,0,0,0,0,0,0,0, + 286,286,286,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,56,406,408,0,0,0,0,0,0,0, + 286,286,286,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,56,406,408,0,0,0,0,0,0,0, + 286,286,286,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,56,406,408,0,0,0,0,0,0,0, + 286,286,286,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,67,0,0,0,0,0,0,0,56,406,408,0,0,0,0,0,0,0, + 286,286,286,286,408,55,0,0,0,0,0,0,0,67,0,0,0,0,0,0,0,56,390,55,0,0,0,0,0,0,56,406,408,0,0,0,0,0,0,0, + 286,286,286,286,408,55,0,0,0,0,0,0,56,390,55,0,0,0,0,0,0,56,430,55,0,0,0,0,0,0,56,406,408,0,0,0,0,0,0,0, + 286,286,286,286,408,55,0,0,0,0,0,0,56,430,55,0,0,0,0,0,0,56,430,55,0,0,0,0,0,0,310,392,448,0,0,0,0,0,0,0, + 286,286,286,286,408,55,0,0,0,0,0,0,56,430,55,0,0,0,0,0,0,56,430,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 286,286,286,286,408,55,0,0,0,0,0,0,56,430,55,0,0,0,0,0,0,56,430,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 286,286,286,286,408,55,0,0,0,0,0,0,56,430,55,0,0,0,0,0,0,56,470,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 286,286,286,286,408,55,0,0,0,0,0,0,56,430,55,0,0,0,0,0,0,0,68,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 286,286,286,286,408,55,0,0,0,0,0,0,56,430,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 286,286,286,286,408,55,0,0,0,0,0,0,56,430,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 286,286,286,286,408,55,0,0,0,0,0,0,56,430,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 286,286,286,286,408,55,0,0,0,0,0,0,56,430,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 286,286,286,286,408,55,0,0,0,0,0,0,56,430,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 286,286,286,286,408,55,0,0,0,0,0,0,56,430,55,0,0,0,0,0,0,0,67,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 286,286,286,286,408,55,0,0,0,0,0,0,56,430,55,0,0,0,0,0,0,56,390,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 286,286,286,286,408,55,0,0,0,0,0,0,56,430,55,0,0,0,0,0,0,56,430,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 286,286,286,286,408,55,0,0,0,0,0,0,56,430,55,0,0,0,0,0,0,56,430,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 286,286,286,286,408,55,0,0,0,0,0,0,56,430,55,0,0,0,0,0,0,56,430,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 286,286,286,286,408,55,0,0,0,0,0,0,56,430,55,0,0,0,0,0,0,56,430,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 286,286,286,286,408,55,0,0,0,0,0,0,56,430,55,0,0,0,0,0,0,56,430,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 286,286,286,286,408,55,0,0,0,0,0,0,56,430,55,0,0,0,0,0,0,56,430,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 286,286,286,286,408,55,0,0,0,0,0,0,56,430,55,0,0,0,0,0,0,56,430,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + obj.createentity(264, 84, 11, 64); // (horizontal gravity line) + obj.createentity(240+4, 96, 10, 0, 254490); // (savepoint) + obj.createentity(48, 28, 11, 192); // (horizontal gravity line) + obj.createentity(120, 148, 11, 208); // (horizontal gravity line) + rcol=2; + + roomname = "I'm Sorry"; + result = contents; + break; + } + + + case rn(49,55): + { + + static const short contents[] = { + 292,292,292,292,414,59,0,0,0,0,0,0,60,427,59,0,0,0,0,0,0,60,427,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 292,292,292,292,414,59,0,0,0,0,0,0,60,427,59,0,0,0,0,0,0,60,427,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 292,292,292,292,414,59,0,0,0,0,0,0,60,427,59,0,0,0,0,0,0,60,427,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 292,292,292,292,414,59,0,0,0,0,0,0,60,427,59,0,0,0,0,0,0,60,427,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 292,292,292,292,414,59,0,0,0,0,0,0,60,427,59,0,0,0,0,0,0,60,468,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373, + 292,292,292,292,414,59,0,0,0,0,0,0,60,427,59,0,0,0,0,0,0,60,412,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, + 292,292,292,292,414,59,0,0,0,0,0,0,60,427,59,0,0,0,0,0,0,60,428,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453, + 292,292,292,292,414,59,0,0,0,0,0,0,60,427,59,0,0,0,0,0,0,60,427,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 292,292,292,292,414,59,0,0,0,0,0,0,60,427,59,0,0,0,0,0,0,60,427,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 292,292,292,292,414,59,0,0,0,0,0,0,60,427,59,0,0,0,0,0,0,60,427,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 292,292,292,292,414,59,0,0,0,0,0,0,60,427,59,0,0,0,0,0,0,60,427,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 292,292,292,292,414,59,0,0,0,0,0,0,60,427,59,0,0,0,0,0,0,60,427,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 292,292,292,292,414,59,0,0,0,0,0,0,60,467,59,0,0,0,0,0,0,60,467,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 292,292,292,292,414,59,0,0,0,0,0,0,0,72,0,0,0,0,0,0,0,0,72,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 292,292,292,292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,372,373,373,373,373,373,373,373, + 292,292,292,292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,292,292,292,292,292, + 292,292,292,292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292,292,292,292,292,292, + 292,292,292,292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292,292,292,292,292,292, + 292,292,292,292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292,292,292,292,292,292, + 292,292,292,292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292,292,292,292,292,292, + 292,292,292,292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292,292,292,292,292,292, + 292,292,292,292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292,292,292,292,292,292, + 292,292,292,292,333,374,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,372,334,292,292,292,292,292,292,292, + 292,292,292,292,292,333,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,334,292,292,292,292,292,292,292,292, + 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, + 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, + 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, + 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, + 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, + 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, + }; + + obj.createentity(48, 156, 11, 200); // (horizontal gravity line) + obj.createentity(216, 56, 10, 0, 255490); // (savepoint) + rcol=4; + + roomname = "Please Forgive Me!"; + result = contents; + break; + } + + case rn(50,55): + { + + static const short contents[] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 364,364,364,364,364,364,364,364,364,354,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,355,364,364, + 283,283,283,283,283,283,283,283,283,405,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,443,444,444, + 444,444,444,444,444,444,444,444,444,445,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 364,364,364,364,364,364,364,364,364,365,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 283,283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 283,283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 283,283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 283,283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 283,283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 283,283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 283,283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 283,283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 283,283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 283,283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 283,283,283,283,283,283,283,283,283,405,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,363,364,364, + 283,283,283,283,283,283,283,283,283,324,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,325,283,283, + 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, + 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, + 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, + }; + + obj.createentity(131, 48, 12, 152); // (vertical gravity line) + obj.createentity(179, 48, 12, 152); // (vertical gravity line) + obj.createentity(227, 48, 12, 152); // (vertical gravity line) + obj.createentity(275, 48, 12, 152); // (vertical gravity line) + rcol=1; + + roomname = "Playing Foosball"; + result = contents; + break; + } + + case rn(51,55): + { + + static const short contents[] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 376,376,376,376,376,357,317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,358,376,376,376,376, + 456,456,456,456,456,457,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,455,456,456,456,456, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,416,61,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,416,61,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,416,61,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,62,416,61,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 376,376,376,376,376,377,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,375,376,376,376,376, + 295,295,295,295,295,336,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,337,295,295,295,295, + 295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, + 295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, + 295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, + }; + + obj.createentity(91, 168, 12, 32); // (vertical gravity line) + obj.createentity(139, 80, 12, 120); // (vertical gravity line) + obj.createentity(235, 104, 12, 96); // (vertical gravity line) + obj.createentity(187, 144, 12, 56); // (vertical gravity line) + obj.createentity(43, 48, 12, 152); // (vertical gravity line) + obj.createentity(91, 48, 12, 112); // (vertical gravity line) + obj.createentity(139, 48, 12, 24); // (vertical gravity line) + obj.createentity(187, 48, 12, 88); // (vertical gravity line) + obj.createentity(235, 48, 12, 48); // (vertical gravity line) + obj.createentity(283, 48, 12, 152); // (vertical gravity line) + obj.createentity(8, 48, 10, 0, 255510); // (savepoint) + rcol=5; + + roomname = "A Difficult Chord"; + result = contents; + break; + } + + case rn(52,55): + { + + static const short contents[] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 361,361,345,305,305,305,305,346,361,345,305,305,305,305,305,346,361,345,305,305,305,305,305,346,361,345,305,305,305,305,305,346,361,361,361,361,361,361,361,361, + 441,441,442,64,64,64,64,440,344,442,64,64,64,64,64,440,344,442,64,64,64,64,64,440,344,442,64,64,64,64,64,440,282,280,280,280,280,280,280,280, + 0,0,0,0,0,0,0,0,464,0,0,0,0,0,0,52,424,51,0,0,0,0,0,64,464,64,0,0,0,0,0,52,400,280,280,280,280,280,280,280, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,424,51,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,280,280,280,280,280,280, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,424,51,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,280,280,280,280,280,280, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,424,51,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,280,280,280,280,280,280, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,464,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,280,280,280,280,280,280, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,280,280,280,280,280,280, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,280,280,280,280,280,280, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,280,280,280,280,280,280, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,280,280,280,280,280,280, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,280,280,280,280,280,280, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,280,280,280,280,280,280, + 0,0,0,0,0,0,0,0,384,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,384,0,0,0,0,0,0,52,400,280,280,280,280,280,280,280, + 0,0,0,0,0,0,0,0,424,51,0,0,0,0,0,0,0,0,0,0,0,0,0,52,424,51,0,0,0,0,0,52,400,280,280,280,280,280,280,280, + 0,0,0,0,0,0,0,0,424,51,0,0,0,0,0,0,0,0,0,0,0,0,0,52,424,51,0,0,0,0,0,52,400,280,280,280,280,280,280,280, + 0,0,0,0,0,0,0,0,424,51,0,0,0,0,0,0,0,0,0,0,0,0,0,52,424,51,0,0,0,0,0,52,400,280,280,280,280,280,280,280, + 0,0,0,0,0,0,0,0,424,51,0,0,0,0,0,0,0,0,0,0,0,0,0,52,424,51,0,0,0,0,0,52,400,280,280,280,280,280,280,280, + 0,0,0,0,0,0,0,0,424,51,0,0,0,0,0,0,0,0,0,0,0,0,0,52,424,51,0,0,0,0,0,52,400,280,280,280,280,280,280,280, + 0,0,0,0,0,0,0,0,424,51,0,0,0,0,0,0,384,0,0,0,0,0,0,52,424,51,0,0,0,0,0,52,400,280,280,280,280,280,280,280, + 0,0,0,0,0,0,0,0,424,51,0,0,0,0,0,52,424,51,0,0,0,0,0,52,424,51,0,0,0,0,0,52,400,280,280,280,280,280,280,280, + 361,361,361,361,361,361,361,361,479,362,63,63,63,63,63,360,466,51,0,0,0,0,0,52,465,362,63,63,63,63,63,360,322,280,280,280,280,280,280,280, + 280,280,280,280,280,280,280,280,280,321,361,361,361,361,361,322,402,51,0,0,0,0,0,52,400,321,361,361,361,361,361,322,280,280,280,280,280,280,280,280, + 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,52,400,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280, + 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,52,400,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280, + 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,52,400,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280, + }; + + obj.createentity(16, 184, 10, 1, 255520); // (savepoint) + obj.createentity(131, 88, 12, 96); // (vertical gravity line) + obj.createentity(208, 180, 11, 40); // (horizontal gravity line) + obj.createentity(67, 56, 12, 80); // (vertical gravity line) + obj.createentity(195, 56, 12, 80); // (vertical gravity line) + rcol = 0; + + roomname = "The Living Dead End"; + result = contents; + break; + } + + case rn(52,56): + { + + static const short contents[] = { + 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,57,0,0,0,0,0,58,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, + 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,57,0,0,0,0,0,58,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, + 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,57,0,0,0,0,0,58,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, + 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,57,0,0,0,0,0,58,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, + 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,57,0,0,0,0,0,58,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, + 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,57,0,0,0,0,0,58,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, + 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,57,0,0,0,0,0,58,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, + 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,57,0,0,0,0,0,58,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, + 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,57,0,0,0,0,0,58,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, + 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,57,0,0,0,0,0,58,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, + 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,57,0,0,0,0,0,58,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, + 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,57,0,0,0,0,0,58,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, + 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,57,0,0,0,0,0,58,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, + 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,57,0,0,0,0,0,58,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, + 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,57,0,0,0,0,0,58,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, + 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,57,0,0,0,0,0,58,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, + 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,57,0,0,0,0,0,58,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, + 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,57,0,0,0,0,0,58,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, + 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,57,0,0,0,0,0,58,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, + 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,57,0,0,0,0,0,58,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, + 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,57,0,0,0,0,0,58,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, + 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,57,0,0,0,0,0,58,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, + 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,57,0,0,0,0,0,58,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, + 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,57,0,0,0,0,0,58,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, + 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,57,0,0,0,0,0,58,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, + 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,57,0,0,0,0,0,58,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, + 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,57,0,0,0,0,0,58,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, + 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,57,0,0,0,0,0,58,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, + 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,57,0,0,0,0,0,58,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, + 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,57,0,0,0,0,0,58,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, + }; + rcol=3; + + roomname = "AAAAAA"; + result = contents; + break; + } + + case rn(52,57): + { + + static const short contents[] = { + 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,408,55,0,0,0,0,0,56,406,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, + 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,408,55,0,0,0,0,0,56,406,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, + 286,286,286,286,286,286,287,447,447,447,288,286,286,286,286,286,408,55,0,0,0,0,0,56,406,286,286,286,286,286,287,447,447,447,288,286,286,286,286,286, + 286,286,286,286,286,286,408,68,68,68,406,286,286,286,286,286,408,55,0,0,0,0,0,56,406,286,286,286,286,286,408,68,68,68,406,286,286,286,286,286, + 286,286,286,286,286,286,408,0,0,0,446,288,286,286,286,286,408,55,0,0,0,0,0,56,406,286,286,286,286,287,448,0,0,0,406,286,286,286,286,286, + 286,286,286,286,286,286,408,0,0,0,68,406,286,286,286,286,408,55,0,0,0,0,0,56,406,286,286,286,286,408,68,0,0,0,406,286,286,286,286,286, + 286,286,286,286,286,286,408,0,0,0,0,446,447,447,447,447,448,55,0,0,0,0,0,56,446,447,447,447,447,448,0,0,0,0,406,286,286,286,286,286, + 286,286,286,286,286,286,408,0,0,0,0,68,68,68,68,68,68,0,0,0,0,0,0,0,68,68,68,68,68,68,0,0,0,0,406,286,286,286,286,286, + 286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286, + 286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286, + 286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286, + 286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,366,367,367,367,368,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286, + 286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,366,367,328,286,286,286,327,367,368,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286, + 286,286,286,286,286,286,408,0,0,0,0,0,0,366,367,367,328,286,286,286,286,286,286,286,327,367,367,368,0,0,0,0,0,0,406,286,286,286,286,286, + 286,286,286,286,286,286,408,0,0,0,0,0,0,406,286,286,286,286,286,286,286,286,286,286,286,286,286,408,0,0,0,0,0,0,406,286,286,286,286,286, + 286,286,286,286,286,286,408,0,0,0,0,0,0,446,447,288,286,286,286,286,286,286,286,286,286,287,447,448,0,0,0,0,0,0,406,286,286,286,286,286, + 286,286,286,286,286,286,408,0,0,0,0,0,0,68,68,446,447,288,286,286,286,286,286,287,447,448,68,68,0,0,0,0,0,0,406,286,286,286,286,286, + 286,286,286,286,286,286,327,368,0,0,0,0,0,0,0,68,68,446,447,288,286,287,447,448,68,68,0,0,0,0,0,0,0,366,328,286,286,286,286,286, + 286,286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,68,68,446,447,448,68,68,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286,286, + 286,286,286,286,286,286,286,327,368,0,0,0,0,0,0,0,0,0,0,68,68,68,0,0,0,0,0,0,0,0,0,0,366,328,286,286,286,286,286,286, + 286,286,286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286,286,286, + 286,286,286,286,286,286,286,286,327,368,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,366,328,286,286,286,286,286,286,286, + 286,286,286,286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286,286,286,286, + 286,286,286,286,286,286,286,286,286,327,367,368,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,366,367,328,286,286,286,286,286,286,286,286, + 286,286,286,286,286,286,286,286,286,286,286,327,367,368,0,0,0,0,0,0,0,0,0,0,0,0,0,366,367,328,286,286,286,286,286,286,286,286,286,286, + 286,286,286,286,286,286,286,286,286,286,286,286,286,327,367,368,0,0,0,0,0,0,0,0,0,366,367,328,286,286,286,286,286,286,286,286,286,286,286,286, + 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,327,367,368,0,0,0,0,0,366,367,328,286,286,286,286,286,286,286,286,286,286,286,286,286,286, + 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,408,0,0,0,0,0,406,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, + 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,408,0,0,0,0,0,406,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, + 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,408,0,0,0,0,0,406,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, + }; + rcol = 2; + + roomname = "Diode"; + result = contents; + break; + } + + + case rn(50,52): + { + + static const short contents[] = { + 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280, + 281,441,441,441,441,282,281,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,282,280,280, + 402,0,0,0,0,400,402,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,440,282,280, + 402,0,0,0,0,400,402,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280, + 402,0,0,0,0,400,402,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280, + 402,0,0,0,0,440,442,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280, + 402,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280, + 402,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280, + 402,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280, + 402,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280, + 402,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280, + 321,361,361,361,361,361,361,361,361,362,0,0,0,0,0,0,0,0,0,0,0,0,0,63,0,0,360,361,361,361,345,306,0,0,0,0,0,52,400,280, + 280,280,280,280,280,280,280,280,280,402,0,0,0,0,0,0,0,0,0,0,0,0,0,384,0,0,400,280,280,280,402,51,0,0,0,0,0,52,400,280, + 280,280,280,280,280,280,280,280,280,402,0,0,63,0,0,0,0,0,0,0,0,0,0,424,0,0,400,280,280,280,402,51,0,0,0,0,0,52,400,280, + 280,280,280,280,280,280,280,280,280,402,0,0,384,0,0,0,0,0,0,0,0,0,0,424,0,0,400,280,280,280,402,51,0,0,0,0,0,52,400,280, + 280,280,280,280,280,280,280,280,280,402,0,0,424,0,0,0,0,0,0,0,0,0,0,424,0,0,400,280,280,280,402,51,0,0,0,0,0,52,400,280, + 280,280,280,280,280,280,280,280,280,402,0,0,424,0,0,0,0,0,0,0,0,0,0,424,0,0,400,280,280,280,402,51,0,0,0,0,0,52,400,280, + 280,280,280,280,280,280,280,280,280,402,0,0,424,0,0,0,0,0,0,0,0,0,0,424,0,0,400,280,280,280,402,51,0,0,0,0,0,52,400,280, + 280,280,280,280,280,280,280,280,280,402,63,63,424,63,63,63,63,63,63,63,63,63,63,424,63,63,400,280,280,280,402,51,0,0,0,0,0,52,400,280, + 280,280,280,280,280,280,280,280,280,321,361,361,479,361,361,361,361,361,361,361,361,361,361,479,361,361,322,280,280,280,402,51,0,0,0,0,0,52,400,280, + 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,52,400,280, + 280,280,280,280,280,280,280,280,281,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,385,306,0,0,0,0,0,52,400,280, + 280,280,280,280,280,280,280,280,402,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280, + 280,280,280,280,280,280,280,280,402,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280, + 280,280,280,280,280,280,280,280,402,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280, + 280,280,280,280,280,280,280,280,402,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280, + 280,280,280,280,280,280,280,280,402,0,0,0,0,0,360,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,322,280, + 280,280,280,280,280,280,280,280,402,0,0,0,0,0,400,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280, + 280,280,280,280,280,280,280,280,402,0,0,0,0,0,400,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280, + 280,280,280,280,280,280,280,280,402,0,0,0,0,0,400,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280, + }; + + obj.createentity(267, 24, 12, 184); // (vertical gravity line) + obj.createentity(16, 24, 9, 9); // (shiny trinket) + obj.createentity(187, 24, 12, 64); // (vertical gravity line) + obj.createentity(104, 124, 11, 80); // (horizontal gravity line) + obj.createentity(48, 72, 10, 1, 252500); // (savepoint) + obj.createentity(224, 72, 10, 1, 252501); // (savepoint) + obj.createentity(99, 24, 12, 80); // (vertical gravity line) + rcol=0; + + roomname = "Young Man, It's Worth the Challenge"; + result = contents; + break; + } + + case rn(53,55): + { + + static const short contents[] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 367,367,367,367,367,367,368,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,360,361,362,372,373,374,0,0,0,0,0,0,0,0,0,0, + 286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,400,280,402,412,292,414,0,0,0,0,0,0,0,0,0,0, + 447,447,447,447,288,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,400,280,402,412,292,414,0,0,0,0,0,0,0,0,0,0, + 364,364,364,365,406,286,408,0,0,0,0,0,0,0,0,0,0,360,361,362,0,0,0,0,400,280,402,452,453,454,0,0,0,0,366,367,367,368,0,0, + 283,283,283,405,406,286,408,0,0,0,0,0,0,0,0,0,0,400,280,402,0,0,0,0,400,280,321,361,361,362,0,0,0,0,406,286,286,408,0,0, + 283,283,283,405,406,286,408,0,0,0,0,0,0,0,0,0,0,400,280,402,0,0,0,0,440,441,441,282,280,402,0,0,0,0,406,286,286,408,0,0, + 283,283,283,405,406,286,408,0,0,0,0,369,370,371,360,361,361,322,280,402,0,0,0,0,0,0,0,400,280,402,0,0,0,0,406,286,286,408,0,0, + 283,283,283,405,406,286,408,0,0,0,0,409,289,411,400,280,280,280,280,402,0,0,0,0,0,0,0,400,280,402,0,0,0,0,406,286,286,408,0,0, + 283,283,283,405,446,447,448,0,0,0,0,409,289,411,440,441,441,441,441,442,0,0,0,0,0,0,0,440,441,442,0,0,0,0,406,286,286,408,0,0, + 283,283,283,324,364,364,365,0,0,0,0,409,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,408,0,0, + 283,283,283,283,283,283,405,0,0,0,0,409,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,408,0,0, + 283,283,283,283,283,283,405,0,0,0,0,409,289,411,0,0,0,0,0,0,0,0,0,0,363,364,364,364,364,365,0,0,0,0,406,287,447,448,0,0, + 283,283,283,283,283,283,405,0,0,0,0,409,289,411,0,0,0,0,0,0,0,0,0,0,443,444,285,283,283,405,0,0,0,0,406,408,375,377,0,0, + 444,444,444,444,444,444,445,0,0,0,0,409,289,411,0,0,0,369,370,370,370,370,370,370,370,371,403,284,444,445,0,0,0,0,406,408,415,417,0,0, + 373,373,373,373,373,373,374,0,0,0,0,409,289,411,0,0,0,409,289,290,450,450,450,450,450,451,403,405,0,0,0,0,0,0,406,408,415,417,0,0, + 292,292,292,292,292,292,414,375,376,376,377,409,289,411,0,0,0,409,289,411,363,364,364,364,364,364,325,405,0,0,0,0,0,0,406,408,415,417,0,0, + 292,292,292,293,453,453,454,415,295,295,417,409,289,411,0,0,0,449,450,451,443,444,444,444,444,444,444,445,0,0,0,0,0,0,446,448,415,336,376,376, + 292,292,292,414,360,361,362,415,295,295,417,409,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,375,376,376,376,376,337,295,295,295, + 292,292,292,414,400,280,402,415,295,295,417,409,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295,295,295,295,295,295, + 292,292,292,414,400,280,402,455,456,456,457,409,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295,295,295,295,295,295, + 292,292,292,414,400,280,321,361,361,361,362,409,289,330,370,370,370,370,370,370,370,370,370,370,371,375,376,376,376,376,376,337,295,295,295,295,295,295,295,295, + 292,292,292,414,400,280,280,280,280,280,402,409,289,289,289,289,289,289,289,290,450,450,450,450,451,415,295,295,295,295,295,295,295,295,295,295,295,295,295,295, + 292,292,292,414,400,280,280,280,280,280,402,409,289,289,289,289,289,289,289,411,375,376,376,376,376,337,295,295,295,295,295,295,295,295,295,295,295,295,295,295, + 292,292,292,414,400,280,280,280,280,280,402,409,289,289,289,289,289,289,289,411,415,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, + 292,292,292,414,400,280,280,280,280,280,402,409,289,289,289,289,289,289,289,411,415,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, + }; + + rcol = 6; + + roomname = "Anomaly"; + result = contents; + break; + } + + case rn(54,55): + { + + static const short contents[] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295,295,295,295,295,295,417,412,292, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295,295,295,295,295,295,417,412,292, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295,295,295,295,296,456,457,412,292, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295,295,295,295,417,372,373,334,292, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295,295,296,456,457,412,292,292,292, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295,295,417,372,373,334,292,292,292, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,296,456,457,412,292,292,292,292,292, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,417,372,373,334,292,292,292,292,292, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,296,456,457,412,292,292,292,292,292,292,292, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,417,372,373,334,292,292,292,292,292,292,292, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,455,457,412,292,292,292,292,292,292,292,292,292, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,372,373,334,292,292,292,292,292,292,292,292,292, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,372,373,334,292,292,292,292,292,292,292,292,292,292,292, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292,292,292, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,372,373,334,292,292,292,292,292,292,292,292,292,292,292,292,292, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, + 0,0,0,0,0,0,0,0,0,0,0,360,361,361,361,361,362,0,0,0,0,0,366,368,412,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, + 0,0,0,0,0,0,0,0,0,0,0,400,280,280,280,280,402,0,0,0,0,0,406,408,452,453,453,453,294,292,292,292,292,292,292,292,292,292,292,292, + 370,370,370,371,366,367,367,368,363,364,365,440,282,280,280,281,442,363,364,365,366,367,328,408,369,370,370,371,452,453,294,292,292,292,292,292,292,292,292,292, + 289,289,289,411,406,286,286,408,403,283,324,365,440,282,281,442,363,325,283,405,406,286,286,408,409,289,289,330,370,371,452,453,294,292,292,292,292,292,292,292, + 289,289,289,411,446,288,286,408,443,285,283,324,365,440,442,363,325,283,284,445,406,286,287,448,409,289,289,289,289,330,370,371,452,453,294,292,292,292,292,292, + 289,289,289,330,371,446,288,327,368,443,285,283,324,364,364,325,283,284,445,366,328,287,448,369,331,289,289,289,289,289,289,330,370,371,452,453,294,292,292,292, + 289,289,289,289,330,371,406,286,327,368,443,444,285,283,283,284,444,445,366,328,286,408,369,331,289,289,289,289,289,289,289,289,289,330,370,371,452,453,294,292, + 289,289,289,289,289,411,446,288,286,327,367,368,443,444,444,445,366,367,328,286,287,448,409,289,289,289,289,289,289,289,289,289,289,289,289,330,370,371,452,453, + 289,289,289,289,289,330,371,446,447,288,286,327,367,367,367,367,328,286,287,447,448,369,331,289,289,289,289,289,289,289,289,289,289,289,289,289,289,330,370,370, + 289,289,289,289,289,289,330,370,371,406,286,286,286,286,286,286,286,286,408,369,370,331,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, + 289,289,289,289,289,289,289,289,411,406,286,286,286,286,286,286,286,286,408,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, + }; + + obj.createentity(104, 128, 9, 11); // (shiny trinket) + rcol = 6; + + roomname = "Purest Unobtainium"; + result = contents; + break; + } + + + case rn(52,58): + { + + static const short contents[] = { + 295,295,295,295,295,417,0,415,295,295,295,295,295,295,295,295,295,417,0,0,0,0,0,415,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, + 295,295,295,295,295,417,0,415,295,295,295,295,295,295,295,295,295,417,0,0,0,0,0,415,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, + 295,295,295,295,295,417,0,415,295,295,295,295,295,295,295,295,295,417,0,0,0,0,0,415,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, + 295,295,295,295,295,417,0,415,295,295,296,456,456,456,456,456,456,457,0,0,0,0,0,455,456,456,456,456,456,456,456,456,456,456,456,297,295,295,295,295, + 295,295,295,295,295,417,0,415,295,295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295,295, + 295,295,295,295,295,417,0,415,295,295,417,0,375,376,376,376,376,377,0,0,0,0,0,375,376,376,376,376,376,376,376,376,376,377,0,415,295,295,295,295, + 295,295,295,295,295,417,0,415,295,295,417,0,415,295,295,295,295,417,0,0,0,0,0,415,295,295,295,295,295,295,295,295,295,417,0,415,295,295,295,295, + 295,295,295,295,295,417,0,415,295,295,417,0,415,295,296,456,456,457,0,0,0,0,0,455,456,456,456,456,456,456,456,297,295,417,0,415,295,295,295,295, + 295,295,295,295,295,417,0,415,295,295,417,0,415,295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,417,0,415,295,295,295,295, + 295,295,295,295,295,417,0,415,295,295,417,0,415,295,417,0,375,377,0,0,0,0,0,375,376,376,376,376,376,377,0,415,295,417,0,415,295,295,295,295, + 295,295,295,295,295,417,0,415,295,295,417,0,415,295,417,0,415,417,0,0,0,0,0,455,456,456,456,456,297,417,0,415,295,417,0,415,295,295,295,295, + 295,295,295,295,295,417,0,415,295,295,417,0,415,295,417,0,415,417,0,0,0,0,0,0,0,0,0,0,415,417,0,415,295,417,0,415,295,295,295,295, + 295,295,295,295,295,417,0,415,295,295,417,0,415,295,417,0,415,417,0,0,0,0,0,375,376,376,377,0,415,417,0,415,295,417,0,415,295,295,295,295, + 295,295,295,295,295,417,0,415,295,295,417,0,415,295,417,0,415,417,0,0,0,0,0,455,456,297,417,0,415,417,0,415,295,417,0,415,295,295,295,295, + 295,295,295,295,295,417,0,415,295,295,417,0,415,295,417,0,415,417,0,0,0,0,0,0,0,415,417,0,415,417,0,415,295,417,0,415,295,295,295,295, + 295,295,295,295,295,417,0,415,295,295,417,0,415,295,417,0,415,417,0,0,0,0,0,396,0,415,417,0,415,417,0,415,295,417,0,415,295,295,295,295, + 295,295,295,295,295,417,0,415,295,295,417,0,415,295,417,0,415,417,0,0,0,0,0,476,0,415,417,0,415,417,0,415,295,417,0,415,295,295,295,295, + 295,295,295,295,295,417,0,415,295,295,417,0,415,295,417,0,415,417,0,0,0,0,0,0,0,415,417,0,415,417,0,415,295,417,0,415,295,295,295,295, + 295,295,295,295,295,417,0,415,295,295,417,0,415,295,417,0,415,417,0,0,0,0,0,375,376,337,417,0,415,417,0,415,295,417,0,415,295,295,295,295, + 456,456,456,456,456,457,0,455,456,456,457,0,455,456,457,0,455,457,0,0,0,0,0,455,456,456,457,0,415,417,0,415,295,417,0,415,295,295,295,295, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,417,0,415,295,417,0,415,295,295,295,295, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,375,376,376,376,376,337,417,0,415,295,417,0,415,295,295,295,295, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,455,456,456,456,456,456,457,0,415,295,417,0,415,295,295,295,295, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,417,0,415,295,295,295,295, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,375,376,376,376,376,376,376,376,337,295,417,0,415,295,295,295,295, + 376,376,376,376,376,377,0,375,376,376,377,0,375,376,376,376,376,376,376,376,376,376,376,337,295,295,295,295,295,295,295,295,295,417,0,415,295,295,295,295, + 295,295,295,295,295,417,0,415,295,295,417,0,455,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,457,0,415,295,295,295,295, + 295,295,295,295,295,417,0,415,295,295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295,295, + 295,295,295,295,295,417,0,415,295,295,336,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,337,295,295,295,295, + 295,295,295,295,295,417,0,415,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, + }; + + obj.createentity(112, 184, 10, 1, 258520); // (savepoint) + rcol = 5; + + roomname = "I Smell Ozone"; + result = contents; + break; + } + + case rn(51,58): + { + + static const short contents[] = { + 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280, + 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280, + 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280, + 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280, + 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280, + 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280, + 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280, + 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280, + 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280, + 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280, + 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280, + 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280, + 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280, + 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280, + 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280, + 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280, + 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280, + 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280, + 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280, + 441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361, + 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280, + 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280, + 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280, + 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280, + }; + rcol=0; + + if(!game.intimetrial) + { + if(game.companion==0 && !obj.flags[9] && !game.crewstats[5]) //also need to check if he's rescued in a previous game + { + obj.createentity(32, 177, 18, 16, 1, 17, 1); + obj.createblock(1, 24*8, 0, 32, 240, 33); + } + } + + roomname = "Why So Blue?"; + + result = contents; + break; + } + + case rn(50,58): + { + + static const short contents[] = { + 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, + 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, + 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, + 289,289,289,290,450,450,450,450,450,450,450,450,450,291,289,289,289,290,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,291,289,289,289,289,289,289, + 289,289,289,411,0,0,0,0,0,0,0,0,0,409,289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289,289,289,289, + 289,289,289,411,0,0,0,0,0,0,0,0,0,409,289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289,289,289,289, + 289,289,289,411,0,0,0,0,0,0,0,0,369,331,289,289,289,330,371,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289,289,289,289, + 289,289,289,411,0,0,0,0,0,0,0,0,449,450,450,450,450,450,451,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289,289,289,289, + 289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289,289,289,289, + 289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289,289,289,289, + 289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289,289,289,289, + 289,289,289,411,0,0,0,369,371,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289,289,289,289, + 289,289,289,330,370,370,370,331,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289,289,289,289, + 289,289,289,289,289,289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289,289,289,289, + 289,289,289,289,289,289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289,289,289,289, + 289,289,289,289,289,289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289,289,289,289, + 289,289,289,290,450,450,450,291,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289,289,289,289, + 289,289,289,411,0,0,0,449,451,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289,289,289,289, + 289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289,289,289,289, + 289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,449,450,450,450,450,450,450, + 289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 289,289,289,411,0,0,0,0,0,0,0,0,369,370,370,370,370,370,371,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 289,289,289,411,0,0,0,0,0,0,0,0,449,291,289,289,289,290,451,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 289,289,289,411,0,0,0,0,0,0,0,0,0,409,289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 289,289,289,411,0,0,0,0,0,0,0,0,0,409,289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 289,289,289,330,370,370,370,370,370,370,370,370,370,331,289,289,289,330,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370, + 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, + 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, + 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, + 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, + }; + rcol=3; + + + obj.createentity((10 * 8)-4, (8 * 8) + 4, 14); //Teleporter! + + if(game.intimetrial) + { + obj.createblock(1, 280, 0, 32, 240, 82); + } + + roomname = "Philadelphia Experiment"; + result = contents; + break; + } #endif - default: - { - static const short contents[1200] = {0}; - result = contents; - break; - } - } + default: + { + static const short contents[1200] = {0}; + result = contents; + break; + } + } - return result; + return result; } diff --git a/desktop_version/src/Labclass.h b/desktop_version/src/Labclass.h index c8acd48f..6c9e72de 100644 --- a/desktop_version/src/Labclass.h +++ b/desktop_version/src/Labclass.h @@ -1,13 +1,14 @@ #ifndef LABCLASS_H #define LABCLASS_H +#include + class labclass { public: const short* loadlevel(int rx, int ry); - const char* roomname; - bool roomname_special; + std::string roomname; int rcol; }; #endif /* LABCLASS_H */ diff --git a/desktop_version/src/LevelDebugger.cpp b/desktop_version/src/LevelDebugger.cpp deleted file mode 100644 index ff16badb..00000000 --- a/desktop_version/src/LevelDebugger.cpp +++ /dev/null @@ -1,469 +0,0 @@ -#include "LevelDebugger.h" - -#include "Constants.h" -#include "CustomLevels.h" -#include "Entity.h" -#include "Font.h" -#include "Graphics.h" -#include "KeyPoll.h" -#include "Localization.h" -#include "Map.h" -#include "Script.h" -#include "UtilityClass.h" -#include "VFormat.h" - -namespace level_debugger -{ - bool active = false; - bool should_pause = true; - bool tab_held = false; - bool debug_held = false; - bool forced = false; - - // Moving entities/blocks - bool mouse_held = false; - int held_entity = -1; - int held_block = -1; - int grabber_offset_x = 0; - int grabber_offset_y = 0; - - bool right_mouse_held = false; - - bool is_pausing(void) - { - return active && should_pause; - } - - bool is_active(void) - { - return active; - } - - void toggle_active(void) - { - active = !active; - } - - bool mouse_within(SDL_Rect* rect) - { - SDL_Point mouse = { key.mousex, key.mousey }; - return SDL_PointInRect(&mouse, rect); - } - - void set_forced(void) - { - forced = true; - } - - void input(void) - { - if (!forced && (!map.custommode || map.custommodeforreal)) - { - active = false; - return; - } - - if (key.isDown(SDLK_y)) - { - if (!debug_held) - { - debug_held = true; - active = !active; - } - } - else - { - debug_held = false; - } - - if (!active) - { - return; - } - - if (key.isDown(SDLK_TAB)) - { - if (!tab_held) - { - tab_held = true; - should_pause = !should_pause; - } - } - else - { - tab_held = false; - } - - for (int i = 0; i < (int) obj.entities.size(); i++) - { - SDL_Rect bounding_box = { - obj.entities[i].xp + obj.entities[i].cx, - obj.entities[i].yp + obj.entities[i].cy - map.ypos, - obj.entities[i].w, - obj.entities[i].h - }; - - if (key.leftbutton) - { - if (mouse_within(&bounding_box)) - { - if (!mouse_held) - { - mouse_held = true; - held_entity = i; - grabber_offset_x = key.mousex - obj.entities[i].xp; - grabber_offset_y = key.mousey - obj.entities[i].yp; - - if (!key.keymap[SDLK_LSHIFT] && !key.keymap[SDLK_RSHIFT]) - { - for (int j = 0; j < (int) obj.blocks.size(); j++) - { - if (obj.entities[i].xp == obj.blocks[j].rect.x && obj.entities[i].yp == obj.blocks[j].rect.y) - { - held_block = j; - } - } - } - } - break; - } - } - else - { - mouse_held = false; - held_entity = -1; - held_block = -1; - } - - if (key.rightbutton) - { - if (mouse_within(&bounding_box)) - { - if (!right_mouse_held) - { - right_mouse_held = true; - obj.entities[i].state = obj.entities[i].onentity; - obj.entities[i].statedelay = -1; - } - break; - } - } - else - { - right_mouse_held = false; - } - } - - if (held_entity == -1) - { - for (int i = 0; i < (int) obj.blocks.size(); i++) - { - SDL_Rect bounding_box = { - obj.blocks[i].rect.x, - obj.blocks[i].rect.y - map.ypos, - obj.blocks[i].rect.w, - obj.blocks[i].rect.h - }; - - if (key.leftbutton) - { - if (mouse_within(&bounding_box)) - { - if (!mouse_held) - { - mouse_held = true; - held_block = i; - grabber_offset_x = key.mousex - obj.blocks[i].rect.x; - grabber_offset_y = key.mousey - obj.blocks[i].rect.y; - } - break; - } - } - else - { - held_entity = -1; - mouse_held = false; - held_block = -1; - } - } - } - } - - void logic(void) - { - if (!active) - { - return; - } - - if (INBOUNDS_VEC(held_entity, obj.entities)) - { - int new_xp = key.mousex - grabber_offset_x; - int new_yp = key.mousey - grabber_offset_y; - - if (key.isDown(SDLK_LSHIFT) || key.isDown(SDLK_RSHIFT)) - { - new_xp -= new_xp % 8; - new_yp -= new_yp % 8; - } - - obj.entities[held_entity].xp = new_xp; - obj.entities[held_entity].yp = new_yp; - obj.entities[held_entity].lerpoldxp = new_xp; - obj.entities[held_entity].lerpoldyp = new_yp; - obj.entities[held_entity].oldxp = new_xp; - obj.entities[held_entity].oldyp = new_yp; - } - - if (INBOUNDS_VEC(held_block, obj.blocks)) - { - int new_xp = key.mousex - grabber_offset_x; - int new_yp = key.mousey - grabber_offset_y; - - if (key.isDown(SDLK_LSHIFT) || key.isDown(SDLK_RSHIFT)) - { - new_xp -= new_xp % 8; - new_yp -= new_yp % 8; - } - - obj.blocks[held_block].xp = new_xp; - obj.blocks[held_block].yp = new_yp; - obj.blocks[held_block].rect.x = new_xp; - obj.blocks[held_block].rect.y = new_yp; - } - } - - void render_info(int y, const char* text) - { - font::print(PR_BOR | PR_FONT_8X8, 5, 32 + (10 * y), text, 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2)); - } - - void render_coords(int y, const char* text, int first, int second) - { - char buffer[SCREEN_WIDTH_CHARS + 1]; - vformat_buf(buffer, sizeof(buffer), "{text}: ({first},{second})", "text:str, first:int, second:int", text, first, second); - render_info(y, buffer); - } - - void render_info(int y, const char* text, std::string value) - { - char buffer[SCREEN_WIDTH_CHARS + 1]; - vformat_buf(buffer, sizeof(buffer), "{text}: {value}", "text:str, value:str", text, value.c_str()); - render_info(y, buffer); - } - - void render(void) - { - if (!active) - { - return; - } - - int hovered = -1; - bool hovered_entity = true; - SDL_Rect hover_box; - - for (int i = 0; i < (int) obj.entities.size(); i++) - { - SDL_Rect bounding_box = { - obj.entities[i].xp + obj.entities[i].cx, - obj.entities[i].yp + obj.entities[i].cy - map.ypos, - obj.entities[i].w, - obj.entities[i].h - }; - - if (hovered == -1 && mouse_within(&bounding_box)) - { - hovered = i; - hovered_entity = true; - hover_box = bounding_box; - } - - graphics.draw_rect(bounding_box.x, bounding_box.y, bounding_box.w, bounding_box.h, graphics.getRGB(15, 90, 90)); - - // For gravity lines, show the true hitbox. - if (obj.entities[i].type == EntityType_HORIZONTAL_GRAVITY_LINE) - { - graphics.draw_rect(bounding_box.x - 1, bounding_box.y + 1, bounding_box.w + 2, bounding_box.h, graphics.getRGB(90, 90, 15)); - } - else if (obj.entities[i].type == EntityType_VERTICAL_GRAVITY_LINE) - { - graphics.fill_rect(bounding_box.x - 2, bounding_box.y - 1, bounding_box.w + 1, bounding_box.h + 2, graphics.getRGB(90, 90, 15)); - } - - } - - for (int i = 0; i < (int) obj.blocks.size(); i++) - { - SDL_Rect bounding_box = { - obj.blocks[i].rect.x, - obj.blocks[i].rect.y - map.ypos, - obj.blocks[i].rect.w, - obj.blocks[i].rect.h - }; - - if (hovered == -1 && mouse_within(&bounding_box)) - { - hovered = i; - hovered_entity = false; - hover_box = bounding_box; - } - - graphics.draw_rect(bounding_box.x, bounding_box.y, bounding_box.w, bounding_box.h, graphics.getRGB(90, 15, 15)); - } - - int line = 0; - - if (key.isDown(SDLK_u)) - { - SDL_Color on = graphics.getRGB(220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2)); - SDL_Color off = graphics.getRGB(220 / 1.5 - (help.glow), 220 / 1.5 - (help.glow), 255 / 1.5 - (help.glow / 2)); - - graphics.set_blendmode(SDL_BLENDMODE_BLEND); - graphics.fill_rect(NULL, 0, 0, 0, 127); - graphics.set_blendmode(SDL_BLENDMODE_NONE); - - int x = 0; - int y = 0; - - for (int i = 0; i < (int) SDL_arraysize(obj.flags); i++) - { - SDL_Color color = obj.flags[i] ? on : off; - font::print(PR_BOR | PR_FONT_8X8, 48 + x * 24, 48 + y * 16, help.String(i), color.r, color.g, color.b); - - x++; - if (x >= 10) - { - x = 0; - y++; - } - } - } - else if (hovered == -1) - { - render_coords(line++, "Room", game.roomx % 100, game.roomy % 100); - render_coords(line++, "Cursor", key.mousex, key.mousey); - render_info(line++, "Entities", help.String(obj.entities.size())); - line++; - - render_info(line++, "State", help.String(game.state)); - render_info(line++, "State Delay", help.String(game.statedelay)); - line++; - - render_info(line++, "AEM Target", help.String(script.i)); - render_info(line++, "Warp Background", help.String(cl.getroomprop(game.roomx % 100, game.roomy % 100)->warpdir)); - - line++; - - if (script.running) - { - render_info(line++, "Script", script.scriptname); - render_info(line++, "Delay", help.String(script.scriptdelay)); - render_info(line++, "Position", help.String(script.position)); - line++; - render_info(line++, "Loop Line", help.String(script.looppoint)); - render_info(line++, "Loop Count", help.String(script.loopcount)); - } - } - else - { - if (hovered_entity) - { - entclass* entity = &obj.entities[hovered]; - render_info(line++, "Index", help.String(hovered)); - render_coords(line++, "Position", entity->xp, entity->yp); - render_coords(line++, "Size", entity->w, entity->h); - line++; - render_info(line++, "Rule", help.String(entity->rule)); - render_info(line++, "Type", help.String(entity->type)); - render_info(line++, "Behave", help.String(entity->behave)); - render_info(line++, "Para", help.String(entity->para)); - render_info(line++, "State", help.String(entity->state)); - line++; - render_info(line++, "Tile", help.String(entity->tile)); - render_info(line++, "Draw Frame", help.String(entity->drawframe)); - render_info(line++, "Size", help.String(entity->size)); - render_info(line++, "Direction", help.String(entity->dir)); - - line++; - - // Mostly contains duplicates, but for ease of use - switch (entity->type) - { - case EntityType_PLAYER: - // Player - render_info(line++, "Gravity", help.String(game.gravitycontrol)); - render_info(line++, "Checkpoint", help.String(game.savepoint)); - break; - case EntityType_MOVING: - // Moving platforms and enemies - render_info(line++, "Speed", help.String(entity->para)); - render_info(line++, "Movement type", help.String(entity->behave)); - break; - case EntityType_TRINKET: - // Trinkets - render_info(line++, "ID", help.String(entity->para)); - break; - case EntityType_CHECKPOINT: - // Checkpoints - render_info(line++, "ID", help.String(entity->para)); - render_info(line++, "Active", game.savepoint == entity->para ? "True" : "False"); - break; - case EntityType_HORIZONTAL_GRAVITY_LINE: - // Horizontal gravity lines - render_info(line++, "Horizontal"); - break; - case EntityType_VERTICAL_GRAVITY_LINE: - // Vertical gravity lines - render_info(line++, "Vertical"); - break; - default: - break; - } - - - graphics.draw_rect(hover_box.x, hover_box.y, hover_box.w, hover_box.h, graphics.getRGB(32, 255 - help.glow, 255 - help.glow)); - } - else - { - blockclass* block = &obj.blocks[hovered]; - render_info(line++, "Index", help.String(hovered)); - render_coords(line++, "Position", block->rect.x, block->rect.y); - render_coords(line++, "Size", block->rect.w, block->rect.h); - - line++; - - if (block->type == TRIGGER || block->type == ACTIVITY) - { - render_info(line++, "Script", block->script); - render_info(line++, "State", help.String(block->trigger)); - } - else if (block->type == DIRECTIONAL) - { - render_info(line++, "Direction", help.String(block->trigger)); - } - - graphics.draw_rect(hover_box.x, hover_box.y, hover_box.w, hover_box.h, graphics.getRGB(255 - help.glow, 32, 32)); - } - } - - const char* text; - if (should_pause) - { - text = loc::gettext("[Press {button} to unfreeze gameplay]"); - } - else - { - text = loc::gettext("[Press {button} to freeze gameplay]"); - } - char buffer[SCREEN_WIDTH_CHARS + 1]; - vformat_buf( - buffer, sizeof(buffer), - text, - "button:str", - loc::gettext("TAB") - ); - - font::print(PR_BOR, 5, 14, buffer, 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2)); - } -} diff --git a/desktop_version/src/LevelDebugger.h b/desktop_version/src/LevelDebugger.h deleted file mode 100644 index 4d800eb7..00000000 --- a/desktop_version/src/LevelDebugger.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef LEVELDEBUGGER_H -#define LEVELDEBUGGER_H - -#include - -namespace level_debugger -{ - bool is_pausing(void); - bool is_active(void); - void input(void); - void logic(void); - void render(void); - void set_forced(void); -} - -#endif /* LEVELDEBUGGER_H */ diff --git a/desktop_version/src/Localization.cpp b/desktop_version/src/Localization.cpp deleted file mode 100644 index 0aa11a69..00000000 --- a/desktop_version/src/Localization.cpp +++ /dev/null @@ -1,428 +0,0 @@ -#define LOCALIZATION_CPP -#include "Localization.h" -#include "LocalizationStorage.h" - -#include "Alloc.h" -#include "Game.h" -#include "UTF8.h" -#include "UtilityClass.h" -#include "VFormat.h" - -namespace loc -{ - -int lang_set = 0; -bool pre_title_lang_menu = false; - -std::string lang = "en"; -std::string lang_custom = ""; -bool english_sprites = false; -std::string new_level_font = ""; -LangMeta langmeta; - -// language screen list -std::vector languagelist; -int languagelist_curlang; -bool show_translator_menu = false; -size_t limitscheck_current_overflow; -std::vector testable_script_ids; - -int n_untranslated_roomnames = 0; -int n_unexplained_roomnames = 0; -int n_untranslated_roomnames_custom = 0; -int n_unexplained_roomnames_custom = 0; -int n_untranslated_roomnames_area[9]; - -int n_untranslated[COUNT_UNTRANSLATED_INDEX] = {0}; - -const LangMeta* get_langmeta(void) -{ - if (game.currentmenuname == Menu::language && (unsigned)game.currentmenuoption < languagelist.size()) - { - return &languagelist[game.currentmenuoption]; - } - - return &langmeta; -} - -const char* gettext(const char* eng) -{ - if (lang == "en") - { - return eng; - } - - return map_lookup_text(map_translation, eng, eng); -} - -const char* gettext_case(const char* eng, char textcase) -{ - if (lang == "en") - { - return eng; - } - if (textcase == 0) - { - return gettext(eng); - } - - char* eng_prefixed = add_disambiguator(textcase, eng, NULL); - if (eng_prefixed == NULL) - { - return eng; - } - - const char* tra = map_lookup_text(map_translation, eng_prefixed, eng); - VVV_free(eng_prefixed); - return tra; -} - -static const char* gettext_plural_english(const char* eng_plural, const char* eng_singular, int n) -{ - /* Do be consistent with negative number handling for other languages... */ - if (n == 1 || n == -1) - { - return eng_singular; - } - return eng_plural; -} - -const char* gettext_plural(const char* eng_plural, const char* eng_singular, int n) -{ - if (lang != "en") - { - unsigned char form = form_for_count(n); - char* key = add_disambiguator(form+1, eng_plural, NULL); - if (key != NULL) - { - const char* tra = map_lookup_text(map_translation_plural, key, NULL); - - VVV_free(key); - - if (tra != NULL) - { - return tra; - } - } - } - return gettext_plural_english(eng_plural, eng_singular, n); -} - -void gettext_plural_fill(char* buf, size_t buf_len, const char* eng_plural, const char* eng_singular, const char* args_index, ...) -{ - /* Choose the right plural string based on a number, and then vformat that string. - * The first vararg determines the specific plural form. */ - - va_list args; - va_start(args, args_index); - int count = va_arg(args, int); - va_end(args); - - const char* tra = gettext_plural(eng_plural, eng_singular, count); - - va_start(args, args_index); - vformat_buf_valist(buf, buf_len, tra, args_index, args); - va_end(args); -} - -std::string getnumber(int n, const char* number_class) -{ - if (n < 0 || n > 100) - { - return help.String(n); - } - - // FIXME: implement a more flexible system later, where translators define the classes - std::string (*number_ptr)[101]; - if (SDL_strcmp(number_class, "wordy2") == 0) - { - number_ptr = &number2; - } - else - { - number_ptr = &number; - } - if ((*number_ptr)[n].empty()) - { - return help.String(n); - } - return (*number_ptr)[n]; -} - -static bool is_script_custom(const char* script_id) -{ - return SDL_strncmp(script_id, "custom_", 7) == 0; -} - -const TextboxFormat* gettext_cutscene(const std::string& script_id, const std::string& eng, char textcase) -{ - hashmap* map; - const char* map_script_key; - if (is_script_custom(script_id.c_str())) - { - map = map_translation_cutscene_custom; - map_script_key = &script_id.c_str()[7]; - } - else - { - if (lang == "en") - { - return NULL; - } - - map = map_translation_cutscene; - map_script_key = script_id.c_str(); - } - - uintptr_t ptr_cutscene_map; - bool found = hashmap_get(map, map_script_key, SDL_strlen(map_script_key), &ptr_cutscene_map); - hashmap* cutscene_map = (hashmap*) ptr_cutscene_map; - - if (!found || cutscene_map == NULL) - { - return NULL; - } - - size_t alloc_len; - char* key = add_disambiguator(textcase, eng.c_str(), &alloc_len); - if (key == NULL) - { - return NULL; - } - - uintptr_t ptr_format; - found = hashmap_get(cutscene_map, key, alloc_len-1, &ptr_format); - const TextboxFormat* format = (TextboxFormat*) ptr_format; - - VVV_free(key); - - if (!found) - { - return NULL; - } - return format; -} - -const char* get_roomname_explanation(bool custom_level, int roomx, int roomy) -{ - /* Never returns NULL. */ - - if (!fix_room_coords(custom_level, &roomx, &roomy)) - { - return ""; - } - - const char* explanation; - if (custom_level) - { - explanation = explanation_roomnames_custom[roomy][roomx]; - } - else - { - explanation = explanation_roomnames[roomy][roomx]; - } - if (explanation == NULL) - { - return ""; - } - return explanation; -} - -const char* get_roomname_translation(bool custom_level, int roomx, int roomy) -{ - /* Only looks for the translation, doesn't return English fallback. - * Never returns NULL. - * Also used for room name translation mode. */ - - if (!fix_room_coords(custom_level, &roomx, &roomy)) - { - return ""; - } - - const char* tra; - if (custom_level) - { - tra = translation_roomnames_custom[roomy][roomx]; - } - else - { - tra = translation_roomnames[roomy][roomx]; - } - - if (tra == NULL) - { - return ""; - } - return tra; -} - -const char* gettext_roomname(bool custom_level, int roomx, int roomy, const char* eng, bool special) -{ - if (!custom_level && lang == "en") - { - return eng; - } - - if (special) - { - return gettext_roomname_special(eng); - } - - const char* tra = get_roomname_translation(custom_level, roomx, roomy); - if (tra[0] == '\0') - { - return eng; - } - return tra; -} - -const char* gettext_roomname_special(const char* eng) -{ - if (lang == "en") - { - return eng; - } - - return map_lookup_text(map_translation_roomnames_special, eng, eng); -} - -bool is_cutscene_translated(const std::string& script_id) -{ - hashmap* map; - const char* map_script_key; - if (is_script_custom(script_id.c_str())) - { - map = map_translation_cutscene_custom; - map_script_key = &script_id.c_str()[7]; - } - else - { - if (lang == "en") - { - return false; - } - - map = map_translation_cutscene; - map_script_key = script_id.c_str(); - } - - uintptr_t ptr_unused; - return hashmap_get(map, map_script_key, SDL_strlen(map_script_key), &ptr_unused); -} - -uint32_t toupper_ch(uint32_t ch) -{ - // Convert a single Unicode codepoint to its uppercase variant - // Supports important Latin (1 and A), Cyrillic and Greek - - // Turkish i? - if (get_langmeta()->toupper_i_dot && ch == 'i') return 0x130; - - // a-z? - if ('a' <= ch && ch <= 'z') return ch - 0x20; - - // Latin-1 Supplement? But not the division sign - if (0xE0 <= ch && ch <= 0xFE && ch != 0xF7) return ch - 0x20; - - // ß? Yes, we do have this! And otherwise we could only replace it with SS later on. - if (ch == 0xDF) return 0x1E9E; - - // ÿ? - if (ch == 0xFF) return 0x178; - - // Let's get some exceptions for Latin Extended-A out of the way, starting with ı - if (ch == 0x131) return 'I'; - - // This range between two obscure exceptions... - if (0x139 <= ch && ch <= 0x148 && ch % 2 == 0) return ch - 1; - - // The rest of Latin Extended-A? - if (0x100 <= ch && ch <= 0x177 && ch % 2 == 1) return ch - 1; - - // Okay, Ÿ also pushed some aside... - if (0x179 <= ch && ch <= 0x17E && ch % 2 == 0) return ch - 1; - - // Can't hurt to support Romanian properly... - if (ch == 0x219 || ch == 0x21B) return ch - 1; - - // Cyrillic а-я? - if (0x430 <= ch && ch <= 0x44F) return ch - 0x20; - - // There's probably a good reason Cyrillic upper and lower accents are wrapped around the alphabet... - if (0x450 <= ch && ch <= 0x45F) return ch - 0x50; - - // Apparently a Ukrainian letter is all the way over there, why not. - if (ch == 0x491) return ch - 1; - - // Time for Greek, thankfully we're not making a lowercasing function with that double sigma! - if (ch == 0x3C2) return 0x3A3; - - // The entire Greek alphabet then, along with two accented letters - if (0x3B1 <= ch && ch <= 0x3CB) return ch - 0x20; - - // Unfortunately Greek accented letters are all over the place. - if (ch == 0x3AC) return 0x386; - if (0x3AD <= ch && ch <= 0x3AF) return ch - 0x25; - if (ch == 0x3CC) return 0x38C; - if (ch == 0x3CD || ch == 0x3CE) return ch - 0x3F; - - // Nothing matched! Just leave it as is - return ch; -} - -std::string toupper(const std::string& lower) -{ - // Convert a UTF-8 string to uppercase - if (!get_langmeta()->toupper) - { - return lower; - } - - std::string upper; - /* Capacity is not final, but some uppercase is more bytes than the - * lowercase equivalent, so some extra breathing room couldn't hurt... */ - upper.reserve(lower.length() + 6); - const char* lower_c = lower.c_str(); - uint32_t ch; - bool ignorenext = false; - while ((ch = UTF8_next(&lower_c))) - { - if (get_langmeta()->toupper_lower_escape_char && ch == '~') - { - ignorenext = true; - continue; - } - - if (!ignorenext) - { - ch = toupper_ch(ch); - } - upper.append(UTF8_encode(ch).bytes); - - ignorenext = false; - } - - return upper; -} - -std::string remove_toupper_escape_chars(const std::string& _s) -{ - // No-op, except if langmeta.toupper_lower_escape_char, to remove the ~ escape character - - if (!get_langmeta()->toupper_lower_escape_char) - { - return _s; - } - - std::string s = std::string(_s); - for (signed int i = s.size()-1; i >= 0; i--) - { - if (s[i] == '~') - { - s.erase(i, 1); - } - } - return s; -} - -} /* namespace loc */ diff --git a/desktop_version/src/Localization.h b/desktop_version/src/Localization.h deleted file mode 100644 index 2ec6c94e..00000000 --- a/desktop_version/src/Localization.h +++ /dev/null @@ -1,102 +0,0 @@ -#ifndef LOCALIZATION_H -#define LOCALIZATION_H - -#include -#include -#include - -/* The translator menu will appear in any of the following circumstances: - * - The "lang" folder is NOT next to data.zip, but it is found in "desktop_version" within which the game is running - * - The command line argument "-translator" is passed - * - ALWAYS_SHOW_TRANSLATOR_MENU is defined - */ -// #define ALWAYS_SHOW_TRANSLATOR_MENU - -namespace loc -{ - -struct LangMeta -{ - bool active; // = true, language is shown in the list - std::string code; - std::string nativename; - std::string credit; - std::string action_hint; - std::string gamepad_hint; - bool autowordwrap; // = true; enable automatic wordwrapping - bool toupper; // = true; enable automatic full-caps for menu options - bool toupper_i_dot; // = false; enable Turkish i mapping when uppercasing - bool toupper_lower_escape_char; // = false; enable ~ to mark lowercase letters for uppercasing - bool rtl; // = false; enable for RTL languages like Arabic or Hebrew - std::string menu_select; - std::string menu_select_tight; - uint8_t font_idx; -}; - -struct TextboxFormat -{ - const char* text; - unsigned short wraplimit; // = 36*8-pad_left-pad_right; no effect if tt or !langmeta.autowordwrap - unsigned short wraplimit_raw; // original value of wraplimit, only used for language file sync - bool tt; // teletype, don't auto-wordwrap - bool centertext; // whether the text should be centered inside the box - unsigned char pad_left; // pad with X characters - unsigned char pad_right; - unsigned short padtowidth; // pad to X pixels (0 to disable) -}; - -extern int lang_set; -static const int lang_set_current = 2; -extern bool pre_title_lang_menu; - -extern std::string lang; -extern std::string lang_custom; -extern bool english_sprites; -extern std::string new_level_font; -extern LangMeta langmeta; -extern std::vector languagelist; -extern int languagelist_curlang; -extern bool show_translator_menu; -extern size_t limitscheck_current_overflow; -extern std::vector testable_script_ids; - -extern int n_untranslated_roomnames; -extern int n_unexplained_roomnames; -extern int n_untranslated_roomnames_custom; -extern int n_unexplained_roomnames_custom; -extern int n_untranslated_roomnames_area[9]; - -enum n_untranslated_index -{ - UNTRANSLATED_STRINGS = 0, - UNTRANSLATED_NUMBERS, - UNTRANSLATED_STRINGS_PLURAL, - UNTRANSLATED_CUTSCENES, - UNTRANSLATED_ROOMNAMES_SPECIAL, - COUNT_UNTRANSLATED_INDEX -}; -extern int n_untranslated[COUNT_UNTRANSLATED_INDEX]; - - -const LangMeta* get_langmeta(void); - -const char* gettext(const char* eng); -const char* gettext_case(const char* eng, char textcase); -const char* gettext_plural(const char* eng_plural, const char* eng_singular, int count); -void gettext_plural_fill(char* buf, size_t buf_len, const char* eng_plural, const char* eng_singular, const char* args_index, ...); -std::string getnumber(int n, const char* number_class); -const TextboxFormat* gettext_cutscene(const std::string& script_id, const std::string& eng, char textcase); -const char* get_roomname_explanation(bool custom_level, int roomx, int roomy); -const char* get_roomname_translation(bool custom_level, int roomx, int roomy); -const char* gettext_roomname(bool custom_level, int roomx, int roomy, const char* eng, bool special); -const char* gettext_roomname_special(const char* eng); - -bool is_cutscene_translated(const std::string& script_id); - -uint32_t toupper_ch(uint32_t ch); -std::string toupper(const std::string& lower); -std::string remove_toupper_escape_chars(const std::string& _s); - -} /* namespace loc */ - -#endif /* LOCALIZATION_H */ diff --git a/desktop_version/src/LocalizationMaint.cpp b/desktop_version/src/LocalizationMaint.cpp deleted file mode 100644 index 88c8a872..00000000 --- a/desktop_version/src/LocalizationMaint.cpp +++ /dev/null @@ -1,581 +0,0 @@ -#define LOCALIZATIONMAINT_CPP -#include "Localization.h" -#include "LocalizationStorage.h" - -#include - -#include "Alloc.h" -#include "FileSystemUtils.h" -#include "Font.h" -#include "Graphics.h" -#include "Script.h" -#include "Vlogging.h" -#include "XMLUtils.h" - - -namespace loc -{ - -static void write_max_local(tinyxml2::XMLElement* pElem, uint8_t glyph_w, uint8_t glyph_h) -{ - const char* max; - if ((max = pElem->Attribute("max")) != NULL) - { - unsigned short max_w, max_h, max_local_w, max_local_h; - if (parse_max(max, &max_w, &max_h)) - { - max_local_w = (max_w*8) / glyph_w; - max_local_h = (max_h*10) / SDL_max(10, glyph_h); - - if (max_local_h == 0) - { - max_local_h = 1; - } - - char buf[16]; - if (max_h == 1) - { - SDL_snprintf(buf, sizeof(buf), "%d", max_local_w); - } - else - { - SDL_snprintf(buf, sizeof(buf), "%d*%d", max_local_w, max_local_h); - } - pElem->SetAttribute("max_local", buf); - } - } -} - -static void write_max_local_decl(tinyxml2::XMLDocument* doc, uint8_t glyph_w, uint8_t glyph_h) -{ - char buf[16]; - SDL_snprintf(buf, sizeof(buf), "%dx%d", glyph_w, glyph_h); - doc->FirstChildElement()->SetAttribute("max_local_for", buf); -} - -static void sync_lang_file(const std::string& langcode) -{ - /* Update translation files for the given language with new strings from templates. - * This basically takes the (English) templates, fills in existing translations, and saves. - * Any FILESYSTEM_saveTiXml2Document() writes to main lang dir */ - vlog_info("Syncing %s with templates...", langcode.c_str()); - - lang = langcode; - loadtext(false); - - uint8_t glyph_w = 8, glyph_h = 8; - font::glyph_dimensions(PR_FONT_IDX(langmeta.font_idx, langmeta.rtl), &glyph_w, &glyph_h); - bool max_local_needed = glyph_w != 8 || glyph_h != 8; - - tinyxml2::XMLDocument doc; - tinyxml2::XMLHandle hDoc(&doc); - tinyxml2::XMLElement* pElem; - tinyxml2::XMLElement* subElem; - - if (load_lang_doc("meta", doc, "en")) - { - FOR_EACH_XML_ELEMENT(hDoc, pElem) - { - const char* pKey = pElem->Value(); - - if (SDL_strcmp(pKey, "active") == 0) - pElem->SetText((int) langmeta.active); - else if (SDL_strcmp(pKey, "nativename") == 0) - pElem->SetText(langmeta.nativename.c_str()); - else if (SDL_strcmp(pKey, "credit") == 0) - pElem->SetText(langmeta.credit.c_str()); - else if (SDL_strcmp(pKey, "action_hint") == 0) - pElem->SetText(langmeta.action_hint.c_str()); - else if (SDL_strcmp(pKey, "gamepad_hint") == 0) - pElem->SetText(langmeta.gamepad_hint.c_str()); - else if (SDL_strcmp(pKey, "autowordwrap") == 0) - pElem->SetText((int) langmeta.autowordwrap); - else if (SDL_strcmp(pKey, "toupper") == 0) - pElem->SetText((int) langmeta.toupper); - else if (SDL_strcmp(pKey, "toupper_i_dot") == 0) - pElem->SetText((int) langmeta.toupper_i_dot); - else if (SDL_strcmp(pKey, "toupper_lower_escape_char") == 0) - pElem->SetText((int) langmeta.toupper_lower_escape_char); - else if (SDL_strcmp(pKey, "rtl") == 0) - pElem->SetText((int) langmeta.rtl); - else if (SDL_strcmp(pKey, "menu_select") == 0) - pElem->SetText(langmeta.menu_select.c_str()); - else if (SDL_strcmp(pKey, "menu_select_tight") == 0) - pElem->SetText(langmeta.menu_select_tight.c_str()); - else if (SDL_strcmp(pKey, "font") == 0) - pElem->SetText(font::get_main_font_name(langmeta.font_idx)); - } - - /* This part exists because we want to preserve blank lines between the commented - * options for clarity, so we have to take matters into our own hands. */ - for ( - tinyxml2::XMLNode* pNode = hDoc.FirstChildElement().FirstChild().ToNode(); - pNode != NULL; - pNode = pNode->NextSibling() - ) - { - tinyxml2::XMLComment* pCom = pNode->ToComment(); - if (pCom != NULL) - { - tinyxml2::XMLNode* pPrevNode = pCom->PreviousSibling(); - if (pPrevNode != NULL) - { - doc.FirstChildElement()->InsertAfterChild(pPrevNode, doc.NewText("\n\n ")); - } - doc.FirstChildElement()->InsertAfterChild(pCom, doc.NewText("\n ")); - } - } - - FILESYSTEM_saveTiXml2Document((langcode + "/meta.xml").c_str(), doc); - } - - if (load_lang_doc("strings", doc, "en")) - { - if (max_local_needed) - { - write_max_local_decl(&doc, glyph_w, glyph_h); - } - - FOR_EACH_XML_ELEMENT(hDoc, pElem) - { - EXPECT_ELEM(pElem, "string"); - - const char* eng = pElem->Attribute("english"); - if (eng != NULL) - { - char textcase = pElem->UnsignedAttribute("case", 0); - const char* tra; - if (textcase == 0) - { - tra = map_lookup_text(map_translation, eng, ""); - } - else - { - char* eng_prefixed = add_disambiguator(textcase, eng, NULL); - if (eng_prefixed == NULL) - { - /* Are we out of memory? Stop, don't blank our language files... */ - return; - } - /* Note the fallback: if this string used to not be cased and now it is, - * simply fill in the old single variant we already had. */ - tra = map_lookup_text( - map_translation, - eng_prefixed, - map_lookup_text(map_translation, eng, "") - ); - VVV_free(eng_prefixed); - } - - pElem->SetAttribute("translation", tra); - } - - if (max_local_needed) - { - write_max_local(pElem, glyph_w, glyph_h); - } - } - - FILESYSTEM_saveTiXml2Document((langcode + "/strings.xml").c_str(), doc); - } - - if (!load_lang_doc("numbers", doc, langcode)) - { - /* If numbers.xml doesn't exist _at all_, then simply copy it from English, - * so that you can make a new translation simply by making a folder and syncing. */ - - if (load_lang_doc("numbers", doc, "en")) - { - FILESYSTEM_saveTiXml2Document((langcode + "/numbers.xml").c_str(), doc); - } - } - - if (load_lang_doc("strings_plural", doc, "en")) - { - /* Form 255 is technically invalid, but we have to account for it */ - bool form_id_used[256]; - SDL_zeroa(form_id_used); - for (int num = 0; num < 200; num++) - { - form_id_used[number_plural_form[num]] = true; - } - - if (max_local_needed) - { - write_max_local_decl(&doc, glyph_w, glyph_h); - } - - FOR_EACH_XML_ELEMENT(hDoc, pElem) - { - EXPECT_ELEM(pElem, "string"); - - if (max_local_needed) - { - write_max_local(pElem, glyph_w, glyph_h); - } - - pElem->DeleteChildren(); - - const char* eng_plural = pElem->Attribute("english_plural"); - - for (int form_id = 0; form_id < 255; form_id++) - { - if (form_id_used[form_id] && eng_plural != NULL) - { - subElem = doc.NewElement("translation"); - pElem->LinkEndChild(subElem); - - subElem->SetAttribute("form", form_id); - - char* key = add_disambiguator(form_id+1, eng_plural, NULL); - if (key == NULL) - { - /* Out of memory or something, stop */ - return; - } - - subElem->SetAttribute("translation", map_lookup_text(map_translation_plural, key, "")); - - VVV_free(key); - } - } - } - - FILESYSTEM_saveTiXml2Document((langcode + "/strings_plural.xml").c_str(), doc); - } - - if (load_lang_doc("cutscenes", doc, "en")) - { - FOR_EACH_XML_ELEMENT(hDoc, pElem) - { - EXPECT_ELEM(pElem, "cutscene"); - - const char* cutscene_id = pElem->Attribute("id"); - if (cutscene_id == NULL) - { - continue; - } - - hashmap* map = map_translation_cutscene; - - uintptr_t ptr_cutscene_map; - bool found = hashmap_get(map, cutscene_id, SDL_strlen(cutscene_id), &ptr_cutscene_map); - hashmap* cutscene_map = (hashmap*) ptr_cutscene_map; - if (!found || cutscene_map == NULL) - { - continue; - } - - FOR_EACH_XML_SUB_ELEMENT(pElem, subElem) - { - EXPECT_ELEM(subElem, "dialogue"); - - const char* eng = subElem->Attribute("english"); - if (eng == NULL) - { - continue; - } - - size_t alloc_len; - const std::string eng_unwrapped = font::string_unwordwrap(eng); - char* eng_prefixed = add_disambiguator(subElem->UnsignedAttribute("case", 1), eng_unwrapped.c_str(), &alloc_len); - if (eng_prefixed == NULL) - { - /* Out of memory or something, stop */ - return; - } - - uintptr_t ptr_format; - found = hashmap_get(cutscene_map, eng_prefixed, alloc_len-1, &ptr_format); - const TextboxFormat* format = (TextboxFormat*) ptr_format; - - VVV_free(eng_prefixed); - - if (!found || format == NULL) - { - continue; - } - - subElem->DeleteAttribute("tt"); - subElem->DeleteAttribute("wraplimit"); - subElem->DeleteAttribute("centertext"); - subElem->DeleteAttribute("pad"); - subElem->DeleteAttribute("pad_left"); - subElem->DeleteAttribute("pad_right"); - subElem->DeleteAttribute("padtowidth"); - - bool buttons = subElem->BoolAttribute("buttons", false); - subElem->DeleteAttribute("buttons"); // we want this at the end... - - if (format->text != NULL) - subElem->SetAttribute("translation", format->text); - if (format->tt) - subElem->SetAttribute("tt", 1); - if (format->wraplimit_raw != 0) - subElem->SetAttribute("wraplimit", format->wraplimit_raw); - if (format->centertext) - subElem->SetAttribute("centertext", 1); - if (format->pad_left == format->pad_right && format->pad_left != 0) - { - subElem->SetAttribute("pad", format->pad_left); - } - else - { - if (format->pad_left != 0) - subElem->SetAttribute("pad_left", format->pad_left); - if (format->pad_right != 0) - subElem->SetAttribute("pad_right", format->pad_right); - } - if (format->padtowidth != 0) - subElem->SetAttribute("padtowidth", format->padtowidth); - if (buttons) - subElem->SetAttribute("buttons", 1); - } - } - - FILESYSTEM_saveTiXml2Document((langcode + "/cutscenes.xml").c_str(), doc); - } - - if (load_lang_doc("roomnames", doc, "en")) - { - FOR_EACH_XML_ELEMENT(hDoc, pElem) - { - EXPECT_ELEM(pElem, "roomname"); - - pElem->SetAttribute("translation", - get_roomname_translation(false, pElem->UnsignedAttribute("x"), pElem->UnsignedAttribute("y")) - ); - } - - FILESYSTEM_saveTiXml2Document((langcode + "/roomnames.xml").c_str(), doc); - } - - if (load_lang_doc("roomnames_special", doc, "en")) - { - FOR_EACH_XML_ELEMENT(hDoc, pElem) - { - EXPECT_ELEM(pElem, "roomname"); - - const char* eng = pElem->Attribute("english"); - if (eng != NULL) - { - pElem->SetAttribute("translation", map_lookup_text(map_translation_roomnames_special, eng, "")); - } - } - - FILESYSTEM_saveTiXml2Document((langcode + "/roomnames_special.xml").c_str(), doc); - } -} - -bool sync_lang_files(void) -{ - /* Returns false if we can't set the lang write dir, true otherwise. - * This could maybe be extended with better error reporting, - * problem is getting across which files failed in which languages. */ - std::string oldlang = lang; - if (!FILESYSTEM_setLangWriteDir()) - { - vlog_error("Cannot set write dir to lang dir, not syncing language files"); - return false; - } - - for (size_t i = 0; i < languagelist.size(); i++) - { - if (languagelist[i].code != "en") - sync_lang_file(languagelist[i].code); - } - - FILESYSTEM_restoreWriteDir(); - lang = oldlang; - loadtext(false); - - return true; -} - -bool save_roomname_to_file(const std::string& langcode, bool custom_level, int roomx, int roomy, const char* tra, const char* explanation) -{ - if (custom_level) - { - vlog_error("Saving custom level room names not implemented"); - return false; - } - - if (!fix_room_coords(custom_level, &roomx, &roomy)) - { - return false; - } - - tinyxml2::XMLDocument doc; - tinyxml2::XMLHandle hDoc(&doc); - tinyxml2::XMLElement* pElem; - - if (!load_lang_doc("roomnames", doc, langcode)) - { - return false; - } - - bool found = false; - FOR_EACH_XML_ELEMENT(hDoc, pElem) - { - EXPECT_ELEM(pElem, "roomname"); - - int x = pElem->IntAttribute("x", -1); - int y = pElem->IntAttribute("y", -1); - - if (x == roomx && y == roomy) - { - if (explanation != NULL) - { - pElem->SetAttribute("explanation", explanation); - } - if (tra != NULL) - { - pElem->SetAttribute("translation", tra); - } - found = true; - } - } - - if (!found) - { - vlog_error("Could not find room %d,%d in language file to replace!", roomx, roomy); - return false; - } - - if (!FILESYSTEM_setLangWriteDir()) - { - vlog_error("Cannot set write dir to lang dir, so room name can't be saved"); - return false; - } - bool save_success = FILESYSTEM_saveTiXml2Document((langcode + "/roomnames.xml").c_str(), doc); - FILESYSTEM_restoreWriteDir(); - if (!save_success) - { - vlog_error("Could not write roomnames document!"); - return false; - } - return store_roomname_translation(custom_level, roomx, roomy, tra, explanation); -} - -bool save_roomname_explanation_to_files(bool custom_level, int roomx, int roomy, const char* explanation) -{ - bool success = true; - for (size_t i = 0; i < languagelist.size(); i++) - { - if (!save_roomname_to_file(languagelist[i].code, custom_level, roomx, roomy, NULL, explanation)) - { - success = false; - vlog_warn("Could not save room name explanation to language %s", languagelist[i].code.c_str()); - } - } - - return !languagelist.empty() && success; -} - -void local_limits_check(void) -{ - text_overflows.clear(); - loadtext(true); - limitscheck_current_overflow = 0; -} - -void global_limits_check(void) -{ - text_overflows.clear(); - - std::string oldlang = lang; - - textbook_clear(&textbook_main); - textbook_set_protected(&textbook_main, true); - - for (size_t i = 0; i < languagelist.size(); i++) - { - if (languagelist[i].code != "en") - { - lang = languagelist[i].code; - loadtext(true); - } - } - - lang = oldlang; - loadtext(false); - - textbook_set_protected(&textbook_main, false); - - limitscheck_current_overflow = 0; -} - -void populate_testable_script_ids(void) -{ - testable_script_ids.clear(); - - tinyxml2::XMLDocument doc; - tinyxml2::XMLHandle hDoc(&doc); - tinyxml2::XMLElement* pElem; - - if (!load_lang_doc("cutscenes", doc)) - { - return; - } - - FOR_EACH_XML_ELEMENT(hDoc, pElem) - { - EXPECT_ELEM(pElem, "cutscene"); - - const char* id = pElem->Attribute("id"); - if (id != NULL) - { - testable_script_ids.push_back(id); - } - } -} - -bool populate_cutscene_test(const char* script_id) -{ - tinyxml2::XMLDocument doc; - tinyxml2::XMLHandle hDoc(&doc); - tinyxml2::XMLElement* pElem; - - if (!load_lang_doc("cutscenes", doc)) - { - return false; - } - - const char* original = get_level_original_lang(hDoc); - - FOR_EACH_XML_ELEMENT(hDoc, pElem) - { - EXPECT_ELEM(pElem, "cutscene"); - - if (SDL_strcmp(pElem->Attribute("id"), script_id) != 0) - { - /* Not the correct cutscene */ - continue; - } - - tinyxml2::XMLElement* subElem; - FOR_EACH_XML_SUB_ELEMENT(pElem, subElem) - { - EXPECT_ELEM(subElem, "dialogue"); - - const char* tra = subElem->Attribute("translation"); - const char* speaker = subElem->Attribute("speaker"); - const char* eng = subElem->Attribute(original); - if (tra != NULL && tra[0] != '\0' && speaker != NULL && eng != NULL) - { - script.add_test_line( - speaker, - eng, - subElem->UnsignedAttribute("case", 1), - subElem->BoolAttribute("buttons", false) - ); - } - } - - return true; - } - - return false; -} - -} /* namespace loc */ diff --git a/desktop_version/src/LocalizationMaint.h b/desktop_version/src/LocalizationMaint.h deleted file mode 100644 index b8c93a0a..00000000 --- a/desktop_version/src/LocalizationMaint.h +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef LOCALIZATIONMAINT_H -#define LOCALIZATIONMAINT_H - -namespace loc -{ - -bool sync_lang_files(void); - -bool save_roomname_to_file(const std::string& langcode, bool custom_level, int roomx, int roomy, const char* tra, const char* explanation); -bool save_roomname_explanation_to_files(bool custom_level, int roomx, int roomy, const char* explanation); - -void local_limits_check(void); -void global_limits_check(void); - -void populate_testable_script_ids(void); -bool populate_cutscene_test(const char* script_id); - -} /* namespace loc */ - -#endif /* LOCALIZATIONMAINT_H */ diff --git a/desktop_version/src/LocalizationStorage.cpp b/desktop_version/src/LocalizationStorage.cpp deleted file mode 100644 index 9632f46d..00000000 --- a/desktop_version/src/LocalizationStorage.cpp +++ /dev/null @@ -1,1139 +0,0 @@ -#define LOCALIZATIONSTORAGE_CPP -#include "Localization.h" -#include "LocalizationStorage.h" - -#include "Alloc.h" -#include "Constants.h" -#include "CustomLevels.h" -#include "FileSystemUtils.h" -#include "Font.h" -#include "Graphics.h" -#include "Unused.h" -#include "UtilityClass.h" -#include "VFormat.h" -#include "Vlogging.h" - - -namespace loc -{ - -bool inited = false; -bool inited_custom = false; - -char* custom_level_path = NULL; - -std::vector text_overflows; - -bool load_lang_doc( - const std::string& cat, - tinyxml2::XMLDocument& doc, - const std::string& langcode /*= lang*/, - const std::string& asset_cat /*= ""*/ -) -{ - /* Load a language-related XML file. - * cat is the "category", so "strings", "numbers", etc. - * - * asset_cat is only used when loading - * from custom level assets is possible. */ - - bool asset_loaded = false; - if (!asset_cat.empty()) - { - asset_loaded = FILESYSTEM_loadAssetTiXml2Document(("lang/" + langcode + "/" + asset_cat + ".xml").c_str(), doc); - } - if (!asset_loaded && !FILESYSTEM_loadTiXml2Document(("lang/" + langcode + "/" + cat + ".xml").c_str(), doc)) - { - vlog_debug("Could not load language file %s/%s.", langcode.c_str(), cat.c_str()); - return false; - } - if (doc.Error()) - { - vlog_error("Error parsing language file %s/%s: %s", langcode.c_str(), cat.c_str(), doc.ErrorStr()); - return false; - } - return true; -} - -static void loadmeta(LangMeta& meta, const std::string& langcode = lang) -{ - meta.active = true; - meta.code = langcode; - meta.nativename = langcode; - meta.credit = ""; - meta.action_hint = "Press Space, Z, or V to select"; - meta.gamepad_hint = "Press {button} to select"; - meta.autowordwrap = true; - meta.toupper = true; - meta.toupper_i_dot = false; - meta.toupper_lower_escape_char = false; - meta.rtl = false; - meta.menu_select = "[ {label} ]"; - meta.menu_select_tight = "[{label}]"; - meta.font_idx = font::get_font_idx_8x8(); - - tinyxml2::XMLDocument doc; - tinyxml2::XMLHandle hDoc(&doc); - tinyxml2::XMLElement* pElem; - - if (!load_lang_doc("meta", doc, langcode)) - { - return; - } - - FOR_EACH_XML_ELEMENT(hDoc, pElem) - { - const char* pKey = pElem->Value(); - const char* pText = pElem->GetText(); - if (pText == NULL) - { - pText = ""; - } - - if (SDL_strcmp(pKey, "active") == 0) - meta.active = help.Int(pText); - else if (SDL_strcmp(pKey, "nativename") == 0) - meta.nativename = std::string(pText); - else if (SDL_strcmp(pKey, "credit") == 0) - meta.credit = std::string(pText); - else if (SDL_strcmp(pKey, "action_hint") == 0) - meta.action_hint = std::string(pText); - else if (SDL_strcmp(pKey, "gamepad_hint") == 0) - meta.gamepad_hint = std::string(pText); - else if (SDL_strcmp(pKey, "autowordwrap") == 0) - meta.autowordwrap = help.Int(pText); - else if (SDL_strcmp(pKey, "toupper") == 0) - meta.toupper = help.Int(pText); - else if (SDL_strcmp(pKey, "toupper_i_dot") == 0) - meta.toupper_i_dot = help.Int(pText); - else if (SDL_strcmp(pKey, "toupper_lower_escape_char") == 0) - meta.toupper_lower_escape_char = help.Int(pText); - else if (SDL_strcmp(pKey, "rtl") == 0) - meta.rtl = help.Int(pText); - else if (SDL_strcmp(pKey, "menu_select") == 0) - meta.menu_select = std::string(pText); - else if (SDL_strcmp(pKey, "menu_select_tight") == 0) - meta.menu_select_tight = std::string(pText); - else if (SDL_strcmp(pKey, "font") == 0) - font::find_main_font_by_name(pText, &meta.font_idx); - } -} - -static void map_store_translation(Textbook* textbook, hashmap* map, const char* eng, const char* tra) -{ - /* Add the texts to the given textbook and set the translation in the given hashmap. */ - if (eng == NULL) - { - return; - } - if (tra == NULL) - { - tra = ""; - } - const char* tb_eng = textbook_store(textbook, eng); - const char* tb_tra = textbook_store(textbook, tra); - - if (tb_eng == NULL || tb_tra == NULL) - { - return; - } - - hashmap_set(map, tb_eng, SDL_strlen(tb_eng), (uintptr_t) tb_tra); -} - -unsigned char form_for_count(int n) -{ - int n_ix; - if (n > -100 && n < 100) - { - /* Plural forms for negative numbers are debatable in any language I'd imagine... - * But they shouldn't appear anyway unless there's a bug or you're asking for it. - * Or do YOU ever get -10 deaths while collecting -1 trinket? */ - n_ix = SDL_abs(n); - } - else - { - /* Plural forms for 100 and above always just keep repeating. Thank goodness. */ - n_ix = SDL_abs(n % 100) + 100; - } - - return number_plural_form[n_ix]; -} - -static void callback_free_map_value(void* key, size_t ksize, uintptr_t value, void* usr) -{ - UNUSED(key); - UNUSED(ksize); - UNUSED(usr); - - hashmap_free((hashmap*) value); -} - -static void resettext_custom(bool final_shutdown) -{ - /* Reset/initialize custom level strings only. - * If final_shutdown, this just does a last cleanup of any allocations, - * otherwise it makes storage ready for first use (or reuse by a new language). */ - - if (inited_custom) - { - hashmap_iterate(map_translation_cutscene_custom, callback_free_map_value, NULL); - hashmap_free(map_translation_cutscene_custom); - - textbook_clear(&textbook_custom); - } - else if (!final_shutdown) - { - inited_custom = true; - - textbook_init(&textbook_custom); - } - - if (!final_shutdown) - { - map_translation_cutscene_custom = hashmap_create(); - - SDL_zeroa(translation_roomnames_custom); - SDL_zeroa(explanation_roomnames_custom); - - n_untranslated_roomnames_custom = 0; - n_unexplained_roomnames_custom = 0; - } -} - -void unloadtext_custom(void) -{ - resettext_custom(false); - - loc::lang_custom = ""; - - VVV_free(custom_level_path); - custom_level_path = NULL; -} - -void resettext(bool final_shutdown) -{ - /* Reset/initialize strings. - * If final_shutdown, this just does a last cleanup of any allocations, - * otherwise it makes storage ready for first use (or reuse by a new language). */ - - if (inited) - { - hashmap_free(map_translation); - hashmap_iterate(map_translation_cutscene, callback_free_map_value, NULL); - hashmap_free(map_translation_cutscene); - hashmap_free(map_translation_plural); - hashmap_free(map_translation_roomnames_special); - - textbook_clear(&textbook_main); - } - else if (!final_shutdown) - { - inited = true; - - textbook_init(&textbook_main); - } - - if (!final_shutdown) - { - map_translation = hashmap_create(); - map_translation_cutscene = hashmap_create(); - map_translation_plural = hashmap_create(); - - for (size_t i = 0; i <= 100; i++) - { - number[i] = ""; - number2[i] = ""; - } - SDL_zeroa(number_plural_form); - number_plural_form[1] = 1; - - SDL_zeroa(translation_roomnames); - SDL_zeroa(explanation_roomnames); - - n_untranslated_roomnames = 0; - n_unexplained_roomnames = 0; - SDL_zeroa(n_untranslated_roomnames_area); - - SDL_zeroa(n_untranslated); - - map_translation_roomnames_special = hashmap_create(); - } - - resettext_custom(final_shutdown); -} - -bool parse_max(const char* max, unsigned short* max_w, unsigned short* max_h) -{ - /* Parse a max string, like "33" or "33*3", into two shorts. - * Returns true if successful and max_w/max_h have gotten valid values, false otherwise. */ - if (max == NULL) - { - return false; - } - - char* max_mut = SDL_strdup(max); - if (max_mut == NULL) - { - return false; - } - - char* asterisk = SDL_strchr(max_mut, '*'); - if (asterisk != NULL) - { - asterisk[0] = '\0'; - *max_h = (unsigned short) help.Int(&asterisk[1], 0); - } - else - { - *max_h = 1; - } - *max_w = (unsigned short) help.Int(max_mut, 0); - - VVV_free(max_mut); - - return *max_w != 0 && *max_h != 0; -} - -static bool max_check_string(const char* str, const char* max) -{ - /* Stores a detected overflow in the overflows vector, returns true if this happened */ - unsigned short max_w, max_h; - if (str == NULL || !parse_max(max, &max_w, &max_h)) - { - return false; - } - - /* Special case that must ALWAYS be 2 lines even when the font is bigger */ - if (SDL_strcmp(str, "You have rescued a crew member!") == 0 && max_h == 1) - { - max_h = 2; - } - - uint8_t font_idx = get_langmeta()->font_idx; - uint32_t print_flags = PR_FONT_IDX(font_idx, get_langmeta()->rtl) | PR_CJK_LOW; - uint8_t font_w = 8; - uint8_t font_h = 8; - font::glyph_dimensions(print_flags, &font_w, &font_h); - - unsigned short max_w_px = max_w * 8; - unsigned short max_h_px = max_h * 10; - - bool does_overflow = false; - - if (max_h == 1) - { - max_h_px = font_h; - does_overflow = font::len(print_flags, str) > (int) max_w_px; - } - else - { - short lines; - font::string_wordwrap(print_flags, str, max_w_px, &lines); - does_overflow = lines*SDL_max(10, font_h) > (short) max_h_px; - } - - // Convert max_w and max_h from 8x8 into local - max_w = max_w_px / font_w; - max_h = max_h_px / SDL_max(10, font_h); - - if (does_overflow) - { - TextOverflow overflow; - overflow.lang = lang; - overflow.text = textbook_store(&textbook_main, str); - overflow.max_w = max_w; - overflow.max_h = max_h; - overflow.max_w_px = max_w_px; - overflow.max_h_px = max_h_px; - overflow.multiline = max_h > 1; - overflow.flags = print_flags; - - text_overflows.push_back(overflow); - - vlog_warn("\"%s\" DOESN'T FIT into %s which is %dx%d or %dx%dpx", - str, max, max_w, max_h, max_w_px, max_h_px - ); - } - else - { - vlog_debug("\"%s\" fits into %s which is %dx%d or %dx%dpx", - str, max, max_w, max_h, max_w_px, max_h_px - ); - } - - return does_overflow; -} - -static void max_check_string_plural(unsigned char form, const char* str, const char* max, const char* var, unsigned int expect) -{ - if (str == NULL || var == NULL) - { - return; - } - - /* Create an args index from just the name of the variable. - * Also get rid of all other placeholders.*/ - char args_index[60]; - vformat_buf(args_index, sizeof(args_index), "{var}:int, _:int", "var:str", var); - - char buf[20*SCREEN_WIDTH_CHARS + 1]; - - if (expect > 100) - { - /* Treat `expect` as a single example, it's the number of digits that's most important */ - if (form_for_count(expect) == form) - { - vformat_buf(buf, sizeof(buf), str, args_index, expect, 0); - - max_check_string(buf, max); - } - } - else - { - /* Test all numbers from 0 to `expect`, since if we have wordy numbers, they have differing lengths */ - for (unsigned int test = 0; test <= expect; test++) - { - if (form_for_count(test) == form) - { - vformat_buf(buf, sizeof(buf), str, args_index, test, 0); - - if (max_check_string(buf, max)) - { - /* One is enough */ - break; - } - } - } - } -} - -static void tally_untranslated(const char* tra, int* counter) -{ - /* Count this translation in the untranslated count if it's untranslated. */ - if (!show_translator_menu) - { - return; - } - - if (tra == NULL || tra[0] == '\0') - { - (*counter)++; - } -} - -static void loadtext_strings(bool check_max) -{ - tinyxml2::XMLDocument doc; - tinyxml2::XMLHandle hDoc(&doc); - tinyxml2::XMLElement* pElem; - - if (!load_lang_doc("strings", doc)) - { - return; - } - - FOR_EACH_XML_ELEMENT(hDoc, pElem) - { - EXPECT_ELEM(pElem, "string"); - - const char* eng = pElem->Attribute("english"); - const char* tra = pElem->Attribute("translation"); - - char textcase = pElem->UnsignedAttribute("case", 0); - - if (textcase == 0) - { - map_store_translation( - &textbook_main, - map_translation, - eng, - tra - ); - } - else - { - /* Only prefix with a disambiguator if a specific case number is set */ - char* eng_prefixed = add_disambiguator(textcase, eng, NULL); - if (eng_prefixed == NULL) - { - continue; - } - map_store_translation( - &textbook_main, - map_translation, - eng_prefixed, - tra - ); - VVV_free(eng_prefixed); - } - - /* Only tally an untranslated string if English isn't blank */ - if (eng != NULL && eng[0] != '\0') - { - tally_untranslated(tra, &n_untranslated[UNTRANSLATED_STRINGS]); - } - if (check_max) - { - /* VFormat placeholders distort the limits check. - * (max_check_string ignores NULL strings.) */ - char* filled = vformat_alloc(tra, "_:int", 0); - max_check_string(filled, pElem->Attribute("max")); - VVV_free(filled); - } - } -} - -static void loadtext_strings_plural(bool check_max) -{ - tinyxml2::XMLDocument doc; - tinyxml2::XMLHandle hDoc(&doc); - tinyxml2::XMLElement* pElem; - - if (!load_lang_doc("strings_plural", doc)) - { - return; - } - - FOR_EACH_XML_ELEMENT(hDoc, pElem) - { - EXPECT_ELEM(pElem, "string"); - - const char* eng_plural = pElem->Attribute("english_plural"); - if (eng_plural == NULL) - { - continue; - } - - tinyxml2::XMLElement* subElem; - FOR_EACH_XML_SUB_ELEMENT(pElem, subElem) - { - EXPECT_ELEM(subElem, "translation"); - - unsigned char form = subElem->IntAttribute("form", 0); - char* key = add_disambiguator(form+1, eng_plural, NULL); - if (key == NULL) - { - continue; - } - - map_store_translation( - &textbook_main, - map_translation_plural, - key, - subElem->Attribute("translation") - ); - - VVV_free(key); - - tally_untranslated(subElem->Attribute("translation"), &n_untranslated[UNTRANSLATED_STRINGS_PLURAL]); - if (check_max) - { - max_check_string_plural( - form, subElem->Attribute("translation"), - pElem->Attribute("max"), - pElem->Attribute("var"), pElem->UnsignedAttribute("expect", 101) - ); - } - } - } -} - -static bool get_level_lang_path(bool custom_level, const char* cat, std::string& doc_path, std::string& doc_path_asset) -{ - /* Calculate the path to a translation file for either the MAIN GAME or - * a CUSTOM LEVEL. cat can be "roomnames", "cutscenes", etc. - * - * doc_path and doc_path_asset are "out" parameters, and will be set to - * the appropriate filenames to use for language files outside of or - * inside level assets respectively (translations for custom levels can - * live in the main language folders too) - * - * Returns whether this is a (valid) custom level path. */ - - if (custom_level - && custom_level_path != NULL - && SDL_strncmp(custom_level_path, "levels/", 7) == 0 - && SDL_strlen(custom_level_path) > (sizeof(".vvvvvv")-1) - ) - { - /* Get rid of .vvvvvv */ - size_t len = SDL_strlen(custom_level_path)-7; - doc_path = std::string(custom_level_path, len); - doc_path.append("/custom_"); - doc_path.append(cat); - - /* For the asset path, also get rid of the levels/LEVELNAME/ */ - doc_path_asset = "custom_"; - doc_path_asset.append(cat); - - return true; - } - else - { - doc_path = cat; - doc_path_asset = ""; - - return false; - } -} - -const char* get_level_original_lang(tinyxml2::XMLHandle& hDoc) -{ - /* cutscenes and roomnames files can specify the original language as - * an attribute of the root tag to change the attribute names of the - * original text (normally "english"). This makes level translations - * less confusing if the original language isn't English. */ - - const char* original = NULL; - tinyxml2::XMLElement* pRoot = hDoc.FirstChildElement().ToElement(); - if (pRoot != NULL) - { - original = pRoot->Attribute("original"); - } - if (original == NULL) - { - original = "english"; - } - return original; -} - -static std::string& get_level_lang_code(bool custom_level) -{ - if (!custom_level || lang_custom == "") - { - return lang; - } - - return lang_custom; -} - -static void loadtext_cutscenes(bool custom_level) -{ - tinyxml2::XMLDocument doc; - tinyxml2::XMLHandle hDoc(&doc); - tinyxml2::XMLElement* pElem; - - std::string doc_path; - std::string doc_path_asset; - bool valid_custom_level = get_level_lang_path(custom_level, "cutscenes", doc_path, doc_path_asset); - if (custom_level && !valid_custom_level) - { - return; - } - if (!load_lang_doc(doc_path, doc, get_level_lang_code(custom_level), doc_path_asset)) - { - return; - } - - Textbook* textbook; - hashmap* map; - if (custom_level) - { - textbook = &textbook_custom; - map = map_translation_cutscene_custom; - } - else - { - textbook = &textbook_main; - map = map_translation_cutscene; - } - - const char* original = get_level_original_lang(hDoc); - - FOR_EACH_XML_ELEMENT(hDoc, pElem) - { - EXPECT_ELEM(pElem, "cutscene"); - - const char* script_id = textbook_store(textbook, pElem->Attribute("id")); - if (script_id == NULL) - { - continue; - } - - hashmap* cutscene_map = hashmap_create(); - hashmap_set_free( - map, - script_id, - SDL_strlen(script_id), - (uintptr_t) cutscene_map, - callback_free_map_value, - NULL - ); - - tinyxml2::XMLElement* subElem; - FOR_EACH_XML_SUB_ELEMENT(pElem, subElem) - { - EXPECT_ELEM(subElem, "dialogue"); - - const char* eng = subElem->Attribute(original); - const char* tra = subElem->Attribute("translation"); - if (!custom_level) - { - tally_untranslated(tra, &n_untranslated[UNTRANSLATED_CUTSCENES]); - } - if (eng == NULL || tra == NULL) - { - continue; - } - const std::string eng_unwrapped = font::string_unwordwrap(eng); - char* eng_prefixed = add_disambiguator(subElem->UnsignedAttribute("case", 1), eng_unwrapped.c_str(), NULL); - if (eng_prefixed == NULL) - { - continue; - } - const char* tb_eng = textbook_store(textbook, eng_prefixed); - const char* tb_tra = textbook_store(textbook, tra); - VVV_free(eng_prefixed); - if (tb_eng == NULL || tb_tra == NULL) - { - continue; - } - TextboxFormat format; - format.text = tb_tra; - format.tt = subElem->BoolAttribute("tt", false); - format.centertext = subElem->BoolAttribute("centertext", false); - format.pad_left = subElem->UnsignedAttribute("pad_left", 0); - format.pad_right = subElem->UnsignedAttribute("pad_right", 0); - unsigned short pad = subElem->UnsignedAttribute("pad", 0); - format.pad_left += pad; - format.pad_right += pad; - format.wraplimit_raw = subElem->UnsignedAttribute("wraplimit", 0); - format.wraplimit = format.wraplimit_raw; - if (format.wraplimit == 0) - { - format.wraplimit = 36*8 - (format.pad_left+format.pad_right)*8; - } - format.padtowidth = subElem->UnsignedAttribute("padtowidth", 0); - - const TextboxFormat* tb_format = (TextboxFormat*) textbook_store_raw( - textbook, - &format, - sizeof(TextboxFormat) - ); - if (tb_format == NULL) - { - continue; - } - hashmap_set(cutscene_map, tb_eng, SDL_strlen(tb_eng), (uintptr_t) tb_format); - } - } -} - -static void loadtext_numbers(void) -{ - tinyxml2::XMLDocument doc; - tinyxml2::XMLHandle hDoc(&doc); - tinyxml2::XMLElement* pElem; - - if (!load_lang_doc("numbers", doc)) - { - return; - } - - FOR_EACH_XML_ELEMENT(hDoc, pElem) - { - EXPECT_ELEM(pElem, "number"); - - const char* value_str = pElem->Attribute("value"); - int value = help.Int(value_str); - if (value >= 0 && value <= 100) - { - const char* tra = pElem->Attribute("translation"); - if (tra == NULL) - { - tra = ""; - } - number[value] = std::string(tra); - - tally_untranslated(tra, &n_untranslated[UNTRANSLATED_NUMBERS]); - - // FIXME: implement a more flexible system later, where translators define the classes - tra = pElem->Attribute("translation2"); - if (tra == NULL) - { - tra = ""; - } - number2[value] = std::string(tra); - } - if (value >= 0 && value <= 199) - { - int form = pElem->IntAttribute("form", 0); - number_plural_form[value] = form; - if (value < 100) - { - number_plural_form[value+100] = form; - } - } - } -} - -bool fix_room_coords(bool custom_level, int* roomx, int* roomy) -{ - *roomx %= 100; - *roomy %= 100; - - if (!custom_level && *roomx == 9 && *roomy == 4) - { - // The Tower has two rooms, unify them - *roomy = 9; - } - - int max_x = MAP_MAX_X; - int max_y = MAP_MAX_Y; - if (custom_level) - { - max_x = CUSTOM_MAP_MAX_X; - max_y = CUSTOM_MAP_MAX_Y; - } - - return !(*roomx < 0 || *roomy < 0 || *roomx > max_x || *roomy > max_y); -} - -static unsigned coords_to_area(int roomx, int roomy) -{ - if (!fix_room_coords(false, &roomx, &roomy)) - { - return false; - } - - /* We want to know per-area how many room names are untranslated... */ - enum area_letter { - _, /* None */ - S, /* SS1 */ - L, /* Lab */ - T, /* Tower */ - Y, /* SS2 */ - W, /* Warp */ - I, /* Intermission */ - G, /* Gravitron */ - F /* Final */ - }; - static enum area_letter area_map[MAP_MAX_Y+1][MAP_MAX_Y+1] = { - {_,L,L,L,L,L,L,L,_,T,_,_,_,W,W,W,W,W,W,W}, - {_,L,L,L,L,L,L,_,_,T,_,_,_,_,W,W,W,W,W,W}, - {_,_,_,_,L,_,_,_,_,T,_,_,_,_,W,W,W,W,W,W}, - {_,_,_,_,L,_,_,_,_,T,_,_,S,S,S,S,W,W,W,W}, - {_,_,L,L,L,_,_,_,_,T,T,T,S,S,S,S,_,_,_,_}, - {_,_,_,_,_,_,_,_,_,T,Y,Y,S,S,S,S,_,_,_,_}, - {_,_,_,_,_,_,_,_,_,T,Y,Y,S,S,S,S,S,_,_,_}, - {_,_,_,_,_,_,_,_,_,T,Y,Y,S,S,S,S,S,S,S,_}, - {_,_,_,_,_,_,_,_,_,T,_,_,_,Y,Y,S,Y,Y,Y,_}, - {_,_,_,_,_,_,_,_,T,T,_,_,_,Y,Y,Y,Y,Y,Y,_}, - {_,_,_,_,_,_,_,_,_,T,_,_,_,Y,Y,Y,Y,Y,Y,_}, - {_,_,_,_,_,_,_,_,_,T,_,Y,Y,Y,Y,Y,Y,Y,Y,_}, - {_,_,_,_,_,_,_,_,_,T,_,Y,Y,Y,Y,Y,Y,_,Y,_}, - {_,_,_,_,_,_,_,_,_,T,_,Y,Y,Y,Y,Y,Y,_,Y,_}, - {_,_,_,_,_,_,_,_,_,T,_,Y,Y,_,_,_,_,_,Y,_}, - {_,_,_,_,_,_,_,L,_,T,_,_,_,_,_,_,_,_,_,_}, - {_,_,L,L,L,L,L,L,_,T,_,_,_,_,_,_,_,_,_,_}, - {_,L,L,L,L,L,L,L,_,T,_,_,_,_,_,_,_,_,_,_}, - {L,L,L,L,L,_,_,L,_,T,_,_,_,_,_,_,_,_,_,_}, - {L,L,L,L,L,_,_,L,_,T,_,_,_,_,_,_,_,_,_,_} - }; - static bool area_map_has_final = false; - - if (!area_map_has_final) - { - static const enum area_letter final_map[9][14] = { - {_,_,_,_,_,_,_,_,_,_,_,_,G,F}, - {_,_,_,_,_,_,_,_,_,_,_,_,G,F}, - {_,_,_,_,_,_,_,_,_,_,_,_,G,F}, - {F,F,F,F,F,F,F,F,F,F,_,_,G,F}, - {F,F,F,F,F,_,F,F,F,F,_,_,G,F}, - {_,_,_,_,_,_,_,_,F,F,F,F,F,F}, - {_,_,_,_,_,F,F,F,F,F,F,_,_,_}, - {_,_,_,_,_,_,_,_,_,_,_,_,_,_}, - {I,I,I,I,I,I,I,I,I,I,I,I,I,I} - }; - - for (int y = 0; y < 9; y++) - { - for (int x = 0; x < 14; x++) - { - area_map[MAP_MAX_Y+1 - 9 + y][MAP_MAX_X+1 - 14 + x] = final_map[y][x]; - } - } - area_map_has_final = true; - } - - if (area_map[roomy][roomx] == 0) - { - vlog_error("LocalizationStorage: Room %d,%d has no area associated with it", roomx, roomy); - } - - return area_map[roomy][roomx]; -} - -static void update_left_counter(const char* old_text, const char* new_text, int* counter, int* counter_area) -{ - bool now_filled = new_text[0] != '\0'; - if ((old_text == NULL || old_text[0] == '\0') && now_filled) - { - (*counter)--; - if (counter_area != NULL) - { - (*counter_area)--; - } - } - else if (old_text != NULL && old_text[0] != '\0' && !now_filled) - { - (*counter)++; - if (counter_area != NULL) - { - (*counter_area)++; - } - } -} - -bool store_roomname_translation(bool custom_level, int roomx, int roomy, const char* tra, const char* explanation) -{ - if (!fix_room_coords(custom_level, &roomx, &roomy)) - { - return false; - } - - /* We have some arrays filled with pointers, and we need to change those pointers */ - const char** ptr_translation; - const char** ptr_explanation; - int* ptr_n_untranslated; - int* ptr_n_untranslated_area = NULL; - int* ptr_n_unexplained; - if (custom_level) - { - ptr_translation = &translation_roomnames_custom[roomy][roomx]; - ptr_explanation = &explanation_roomnames_custom[roomy][roomx]; - ptr_n_untranslated = &n_untranslated_roomnames_custom; - ptr_n_unexplained = &n_unexplained_roomnames_custom; - } - else - { - ptr_translation = &translation_roomnames[roomy][roomx]; - ptr_explanation = &explanation_roomnames[roomy][roomx]; - ptr_n_untranslated = &n_untranslated_roomnames; - ptr_n_untranslated_area = &n_untranslated_roomnames_area[coords_to_area(roomx, roomy)]; - ptr_n_unexplained = &n_unexplained_roomnames; - } - - if (tra != NULL) - { - update_left_counter(*ptr_translation, tra, ptr_n_untranslated, ptr_n_untranslated_area); - *ptr_translation = textbook_store(&textbook_main, tra); - } - if (explanation != NULL) - { - update_left_counter(*ptr_explanation, explanation, ptr_n_unexplained, NULL); - *ptr_explanation = textbook_store(&textbook_main, explanation); - } - - return true; -} - -static void loadtext_roomnames(bool custom_level, bool check_max) -{ - tinyxml2::XMLDocument doc; - tinyxml2::XMLHandle hDoc(&doc); - tinyxml2::XMLElement* pElem; - - std::string doc_path; - std::string doc_path_asset; - bool valid_custom_level = get_level_lang_path(custom_level, "roomnames", doc_path, doc_path_asset); - if (custom_level && !valid_custom_level) - { - return; - } - if (!load_lang_doc(doc_path, doc, get_level_lang_code(custom_level), doc_path_asset)) - { - return; - } - - const char* original = get_level_original_lang(hDoc); - - FOR_EACH_XML_ELEMENT(hDoc, pElem) - { - EXPECT_ELEM(pElem, "roomname"); - - int x = pElem->IntAttribute("x", -1); - int y = pElem->IntAttribute("y", -1); - - if (custom_level) - { - /* Extra safeguard: make sure the original room name matches! */ - const char* original_roomname = pElem->Attribute(original); - if (original_roomname == NULL) - { - continue; - } - - const RoomProperty* const room = cl.getroomprop(x, y); - if (SDL_strcmp(original_roomname, room->roomname.c_str()) != 0) - { - continue; - } - - n_untranslated_roomnames_custom++; - n_unexplained_roomnames_custom++; - } - else - { - n_untranslated_roomnames++; - n_unexplained_roomnames++; - n_untranslated_roomnames_area[coords_to_area(x, y)]++; - - if (check_max) - { - max_check_string(pElem->Attribute("translation"), "40"); - } - } - - store_roomname_translation( - custom_level, - x, - y, - pElem->Attribute("translation"), - show_translator_menu ? pElem->Attribute("explanation") : NULL - ); - } -} - -static void loadtext_roomnames_special(bool check_max) -{ - tinyxml2::XMLDocument doc; - tinyxml2::XMLHandle hDoc(&doc); - tinyxml2::XMLElement* pElem; - - if (!load_lang_doc("roomnames_special", doc)) - { - return; - } - - FOR_EACH_XML_ELEMENT(hDoc, pElem) - { - EXPECT_ELEM(pElem, "roomname"); - - map_store_translation( - &textbook_main, - map_translation_roomnames_special, - pElem->Attribute("english"), - pElem->Attribute("translation") - ); - - if (check_max) - { - max_check_string(pElem->Attribute("translation"), "40"); - } - - tally_untranslated(pElem->Attribute("translation"), &n_untranslated[UNTRANSLATED_ROOMNAMES_SPECIAL]); - } -} - -void loadtext_custom(const char* custom_path) -{ - resettext_custom(false); - if (custom_level_path == NULL && custom_path != NULL) - { - custom_level_path = SDL_strdup(custom_path); - } - loadtext_cutscenes(true); - loadtext_roomnames(true, false); -} - -void loadtext(bool check_max) -{ - resettext(false); - loadmeta(langmeta); - - if (lang == "en") - { - if (show_translator_menu) - { - // We may still need the room name explanations - loadtext_roomnames(false, false); - n_untranslated_roomnames = 0; - SDL_zeroa(n_untranslated_roomnames_area); - } - } - else - { - loadtext_numbers(); - loadtext_strings(check_max); - loadtext_strings_plural(check_max); - loadtext_cutscenes(false); - loadtext_roomnames(false, check_max); - loadtext_roomnames_special(check_max); - } - - if (custom_level_path != NULL) - { - loadtext_custom(NULL); - } -} - -void loadlanguagelist(void) -{ - // Load the list of languages for the language screen - languagelist.clear(); - - size_t opt = 0; - languagelist_curlang = 0; - EnumHandle handle = {}; - const char* code; - while ((code = FILESYSTEM_enumerateLanguageCodes(&handle)) != NULL) - { - LangMeta meta; - loadmeta(meta, code); - if (meta.active) - { - languagelist.push_back(meta); - - if (SDL_strcmp(lang.c_str(), code) == 0) - { - languagelist_curlang = opt; - } - opt++; - } - } - FILESYSTEM_freeEnumerate(&handle); -} - - -const char* map_lookup_text(hashmap* map, const char* eng, const char* fallback) -{ - uintptr_t ptr_tra; - bool found = hashmap_get(map, eng, SDL_strlen(eng), &ptr_tra); - const char* tra = (const char*) ptr_tra; - - if (found && tra != NULL && tra[0] != '\0') - { - return tra; - } - - return fallback; -} - -char* add_disambiguator(char disambiguator, const char* original_string, size_t* ext_alloc_len) -{ - /* Create a version of the string prefixed with the given byte. - * This byte is used when the English string is just not enough to identify the correct translation. - * It's needed to store plural forms, and when the same text appears multiple times in a cutscene. - * Caller must VVV_free. */ - - size_t alloc_len = 1+SDL_strlen(original_string)+1; - - char* alloc = (char*) SDL_malloc(alloc_len); - if (alloc == NULL) - { - return NULL; - } - alloc[0] = disambiguator; - SDL_memcpy(&alloc[1], original_string, alloc_len-1); - - if (ext_alloc_len != NULL) - { - *ext_alloc_len = alloc_len; - } - - return alloc; -} - -} /* namespace loc */ diff --git a/desktop_version/src/LocalizationStorage.h b/desktop_version/src/LocalizationStorage.h deleted file mode 100644 index e7b42391..00000000 --- a/desktop_version/src/LocalizationStorage.h +++ /dev/null @@ -1,92 +0,0 @@ -#ifndef LOCALIZATIONSTORAGE_H -#define LOCALIZATIONSTORAGE_H - -#include - -#include "Textbook.h" -#include "XMLUtils.h" - -extern "C" -{ -#include -} - -#if defined(LOCALIZATIONSTORAGE_CPP) - #define LS_INTERN -#else - #define LS_INTERN extern -#endif - -namespace loc -{ - -#if defined(LOCALIZATION_CPP) || defined(LOCALIZATIONSTORAGE_CPP) || defined(LOCALIZATIONMAINT_CPP) - LS_INTERN Textbook textbook_main; - LS_INTERN Textbook textbook_custom; - - LS_INTERN hashmap* map_translation; - LS_INTERN hashmap* map_translation_plural; - LS_INTERN std::string number[101]; /* 0..100 */ - LS_INTERN std::string number2[101]; /* 0..100 */ - LS_INTERN unsigned char number_plural_form[200]; /* [0..99] for 0..99, [100..199] for *00..*99 */ - LS_INTERN hashmap* map_translation_cutscene; - LS_INTERN hashmap* map_translation_cutscene_custom; - LS_INTERN hashmap* map_translation_roomnames_special; - - #define MAP_MAX_X 54 - #define MAP_MAX_Y 56 - #define CUSTOM_MAP_MAX_X 19 - #define CUSTOM_MAP_MAX_Y 19 - LS_INTERN const char* translation_roomnames[MAP_MAX_Y+1][MAP_MAX_X+1]; - LS_INTERN const char* explanation_roomnames[MAP_MAX_Y+1][MAP_MAX_X+1]; - LS_INTERN const char* translation_roomnames_custom[CUSTOM_MAP_MAX_Y+1][CUSTOM_MAP_MAX_X+1]; - LS_INTERN const char* explanation_roomnames_custom[CUSTOM_MAP_MAX_Y+1][CUSTOM_MAP_MAX_X+1]; -#endif - - -struct TextOverflow -{ - std::string lang; - const char* text; - unsigned short max_w, max_h; - unsigned short max_w_px, max_h_px; - bool multiline; - uint32_t flags; -}; - -extern std::vector text_overflows; - - -bool load_lang_doc( - const std::string& cat, - tinyxml2::XMLDocument& doc, - const std::string& langcode = lang, - const std::string& asset_cat = "" -); - -unsigned char form_for_count(int n); - -void unloadtext_custom(void); -void resettext(bool final_shutdown); - -bool parse_max(const char* max, unsigned short* max_w, unsigned short* max_h); - -const char* get_level_original_lang(tinyxml2::XMLHandle& hDoc); - -bool store_roomname_translation(bool custom_level, int roomx, int roomy, const char* tra, const char* explanation); - -bool fix_room_coords(bool custom_level, int* roomx, int* roomy); - -void loadtext(bool check_max); -void loadtext_custom(const char* custom_path); -void loadlanguagelist(void); - -const char* map_lookup_text(hashmap* map, const char* eng, const char* fallback); - -char* add_disambiguator(char disambiguator, const char* original_string, size_t* ext_alloc_len); - -} /* namespace loc */ - -#undef LS_INTERN - -#endif /* LOCALIZATIONSTORAGE_H */ diff --git a/desktop_version/src/Logic.cpp b/desktop_version/src/Logic.cpp index 958bc8b2..4b1fe3cb 100644 --- a/desktop_version/src/Logic.cpp +++ b/desktop_version/src/Logic.cpp @@ -5,7 +5,6 @@ #include "Game.h" #include "GlitchrunnerMode.h" #include "Graphics.h" -#include "LevelDebugger.h" #include "Map.h" #include "Music.h" #include "Network.h" @@ -28,15 +27,15 @@ void titlelogic(void) { if (game.menudest == Menu::mainmenu) { - music.play(Music_PRESENTINGVVVVVV); + music.play(6); } else if (game.menudest == Menu::gameover2) { - music.playef(Sound_VIRIDIAN); + music.playef(11); } else if (game.menudest == Menu::timetrialcomplete3) { - music.playef(Sound_TRINKET); + music.playef(3); } game.createmenu(game.menudest, true); } @@ -69,7 +68,7 @@ void gamecompletelogic(void) graphics.titlebg.bscroll = +1; } - if (graphics.fademode == FADE_FULLY_BLACK) + if (graphics.fademode == 1) { //Fix some graphical things graphics.showcutscenebars = false; @@ -78,9 +77,7 @@ void gamecompletelogic(void) graphics.titlebg.bypos = 0; //Return to game game.gamestate = GAMECOMPLETE2; - graphics.fademode = FADE_START_FADEIN; - game.skip_message_timer = 1000; - game.old_skip_message_timer = 1000; + graphics.fademode = 4; } } @@ -103,7 +100,7 @@ void gamecompletelogic2(void) } } - if (graphics.fademode == FADE_FULLY_BLACK) + if (graphics.fademode == 1) { //Fix some graphical things graphics.showcutscenebars = false; @@ -111,7 +108,7 @@ void gamecompletelogic2(void) //Fix the save thingy game.deletequick(); int tmp=music.currentsong; - music.currentsong = Music_PASSIONFOREXPLORING; + music.currentsong=4; obj.flags[67] = true; game.savetele(); music.currentsong=tmp; @@ -123,25 +120,9 @@ void gamecompletelogic2(void) } } -static void gotoroom_wrapper(const int rx, const int ry) -{ - map.gotoroom(rx, ry); -} void gamelogic(void) { - if (game.physics_frozen()) - { - level_debugger::logic(); - return; - } - - bool roomchange = false; -#define GOTOROOM(rx, ry) \ - gotoroom_wrapper(rx, ry); \ - roomchange = true -#define gotoroom Do not use map.gotoroom directly. - /* Update old lerp positions of entities */ {size_t i; for (i = 0; i < obj.entities.size(); ++i) { @@ -189,7 +170,7 @@ void gamelogic(void) game.alarmdelay--; if (game.alarmdelay <= 0) { - music.playef(Sound_ALARM); + music.playef(19); game.alarmdelay = 20; } } @@ -206,7 +187,7 @@ void gamelogic(void) { obj.entities[i].tile = 144; } - music.playef(Sound_CRY); + music.playef(2); } if (obj.upset > 301) obj.upset = 301; } @@ -373,7 +354,7 @@ void gamelogic(void) { if (game.roomx == 111 && game.roomy == 107 && !map.custommode) { - if (obj.entities[i].type == EntityType_MOVING) + if (obj.entities[i].type == 1) { if (obj.entities[i].xp < 152) { @@ -391,7 +372,7 @@ void gamelogic(void) } } } - if (obj.entities[i].type == EntityType_DISAPPEARING_PLATFORM && obj.entities[i].state == 3) + if (obj.entities[i].type == 2 && obj.entities[i].state == 3) { //Ok! super magical exception for the room with the intention death for the shiny trinket //fix this when the maps are finalised @@ -405,7 +386,7 @@ void gamelogic(void) map.settile(18, 9, 59); } } - else if (obj.entities[i].type == EntityType_DISAPPEARING_PLATFORM && obj.entities[i].state == 2) + else if (obj.entities[i].type == 2 && obj.entities[i].state == 2) { //ok, unfortunate case where the disappearing platform hasn't fully disappeared. Accept a little //graphical uglyness to avoid breaking the room! @@ -421,7 +402,7 @@ void gamelogic(void) } if (!entitygone) obj.entities[i].state = 4; } - else if (obj.entities[i].type == EntityType_GRAVITRON_ENEMY && game.swnmode && game.deathseq<15) + else if (obj.entities[i].type == 23 && game.swnmode && game.deathseq<15) { //if playing SWN, get the enemies offscreen. obj.entities[i].xp += obj.entities[i].vx*5; @@ -431,11 +412,11 @@ void gamelogic(void) if (game.swnmode) { //if playing SWN game a, push the clock back to the nearest 10 second interval - if (game.swngame == SWN_GRAVITRON) + if (game.swngame == 0) { game.swnpenalty(); } - else if (game.swngame == SWN_SUPERGRAVITRON) + else if (game.swngame == 1) { game.swnstate = 0; game.swnstate2 = 0; @@ -448,7 +429,7 @@ void gamelogic(void) game.swnrecord = game.swntimer; if (game.swnmessage == 0) { - music.playef(Sound_NEWRECORD); + music.playef(25); game.savestatsandsettings(); } game.swnmessage = 1; @@ -461,23 +442,16 @@ void gamelogic(void) game.deathseq--; if (game.deathseq <= 0) { - game.invalidate_ndm_trophy(); - if (game.nodeathmode) { game.deathseq = 1; game.gethardestroom(); //start depressing sequence here... - if (game.gameoverdelay <= -10 && graphics.fademode == FADE_NONE) - { - graphics.fademode = FADE_START_FADEOUT; - } - if (graphics.fademode == FADE_FULLY_BLACK) + if (game.gameoverdelay <= -10 && graphics.fademode==0) graphics.fademode = 2; + if (graphics.fademode == 1) { game.copyndmresults(); - obj.entities.clear(); - game.quittomenu(); - game.createmenu(Menu::gameover); + script.resetgametomenu(); } } else @@ -485,7 +459,7 @@ void gamelogic(void) if (game.swnmode) { //if playing SWN game b, reset the clock - if (game.swngame == SWN_SUPERGRAVITRON) + if (game.swngame == 1) { game.swntimer = 0; game.swnmessage = 0; @@ -518,7 +492,7 @@ void gamelogic(void) if (map.final_colorframe == 1) { map.final_colorframedelay = 40; - int temp = 1+int(fRandom() * 5); + int temp = 1+int(fRandom() * 6); if (temp == map.final_mapcol) temp = (temp + 1) % 6; if (temp == 0) temp = 6; map.changefinalcol(temp); @@ -526,7 +500,7 @@ void gamelogic(void) else if (map.final_colorframe == 2) { map.final_colorframedelay = 15; - int temp = 1+int(fRandom() * 5); + int temp = 1+int(fRandom() * 6); if (temp == map.final_mapcol) temp = (temp + 1) % 6; if (temp == 0) temp = 6; map.changefinalcol(temp); @@ -559,23 +533,23 @@ void gamelogic(void) } //SWN Minigame Logic - if (game.swnmode) //which game? + if (game.swnmode) //which game? { - switch (game.swngame) + if(game.swngame==0) //intermission, survive 60 seconds game { - case SWN_GRAVITRON: // intermission, survive 60 seconds game game.swntimer -= 1; if (game.swntimer <= 0) { - music.niceplay(Music_PREDESTINEDFATE); - game.swngame = SWN_FINISH_GRAVITRON_STEP_1; + music.niceplay(8); + game.swngame = 5; } else { obj.generateswnwave(0); } - break; - case SWN_SUPERGRAVITRON: + } + else if(game.swngame==1) //super gravitron game + { game.swntimer += 1; #ifndef MAKEANDPLAY if (!map.custommode) @@ -593,7 +567,7 @@ void gamelogic(void) game.unlockAchievement("vvvvvvsupgrav5"); game.swnbestrank = 1; game.swnmessage = 2+30; - music.playef(Sound_TROPHY); + music.playef(26); } } else if (game.swntimer >= 300 && game.swnrank == 1) @@ -604,7 +578,7 @@ void gamelogic(void) game.unlockAchievement("vvvvvvsupgrav10"); game.swnbestrank = 2; game.swnmessage = 2+30; - music.playef(Sound_TROPHY); + music.playef(26); } } else if (game.swntimer >= 450 && game.swnrank == 2) @@ -615,7 +589,7 @@ void gamelogic(void) game.unlockAchievement("vvvvvvsupgrav15"); game.swnbestrank = 3; game.swnmessage = 2+30; - music.playef(Sound_TROPHY); + music.playef(26); } } else if (game.swntimer >= 600 && game.swnrank == 3) @@ -626,7 +600,7 @@ void gamelogic(void) game.unlockAchievement("vvvvvvsupgrav20"); game.swnbestrank = 4; game.swnmessage = 2+30; - music.playef(Sound_TROPHY); + music.playef(26); } } else if (game.swntimer >= 900 && game.swnrank == 4) @@ -637,7 +611,7 @@ void gamelogic(void) game.unlockAchievement("vvvvvvsupgrav30"); game.swnbestrank = 5; game.swnmessage = 2+30; - music.playef(Sound_TROPHY); + music.playef(26); } } else if (game.swntimer >= 1800 && game.swnrank == 5) @@ -648,7 +622,7 @@ void gamelogic(void) game.unlockAchievement("vvvvvvsupgrav60"); game.swnbestrank = 6; game.swnmessage = 2+30; - music.playef(Sound_TROPHY); + music.playef(26); } } } @@ -664,18 +638,19 @@ void gamelogic(void) graphics.rcol = game.swncolstate; obj.swnenemiescol(game.swncolstate); } - break; - case SWN_START_GRAVITRON_STEP_3: //introduce game a + } + else if (game.swngame == 2) //introduce game a + { game.swndelay--; if (game.swndelay <= 0) { - game.swngame = SWN_GRAVITRON; + game.swngame = 0; game.swndelay = 0; game.swntimer = (60 * 30) - 1; //game.swntimer = 15; } - break; - case SWN_START_GRAVITRON_STEP_2: //extend line + } + else if (game.swngame == 3) //extend line { int line = obj.getlineat(84 - 32); if (INBOUNDS_VEC(line, obj.entities)) @@ -684,19 +659,19 @@ void gamelogic(void) if (obj.entities[line].w > 332) { obj.entities[line].w = 332; - game.swngame = SWN_START_GRAVITRON_STEP_3; + game.swngame = 2; graphics.kludgeswnlinewidth = true; } } - break; } - case SWN_START_GRAVITRON_STEP_1: //create top line - game.swngame = SWN_START_GRAVITRON_STEP_2; + else if (game.swngame == 4) //create top line + { + game.swngame = 3; obj.createentity(-8, 84 - 32, 11, 8); // (horizontal gravity line) - music.niceplay(Music_POSITIVEFORCE); + music.niceplay(2); game.swndeaths = game.deathcounts; - break; - case SWN_FINISH_GRAVITRON_STEP_1: //remove line + } + else if (game.swngame == 5) //remove line { int line = obj.getlineat(148 + 32); if (INBOUNDS_VEC(line, obj.entities)) @@ -705,32 +680,33 @@ void gamelogic(void) if (obj.entities[line].xp > 320) { obj.disableentity(line); - game.swngame = SWN_FINISH_GRAVITRON_STEP_2; + game.swngame = 8; } } - break; } - case SWN_START_SUPERGRAVITRON_STEP_1: //Init the super gravitron - game.swngame = SWN_START_SUPERGRAVITRON_STEP_2; - music.niceplay(Music_POTENTIALFORANYTHING); - break; - case SWN_START_SUPERGRAVITRON_STEP_2: //introduce game b + else if (game.swngame == 6) //Init the super gravitron + { + game.swngame = 7; + music.niceplay(3); + } + else if (game.swngame == 7) //introduce game b + { game.swndelay--; if (game.swndelay <= 0) { - game.swngame = SWN_SUPERGRAVITRON; + game.swngame = 1; game.swndelay = 0; game.swntimer = 0; game.swncolstate = 3; game.swncoldelay = 30; } - break; - case SWN_FINISH_GRAVITRON_STEP_2: //extra kludge if player dies after game a ends + } + else if (game.swngame == 8) //extra kludge if player dies after game a ends { bool square_onscreen = false; for (size_t i = 0; i < obj.entities.size(); i++) { - if (obj.entities[i].type == EntityType_GRAVITRON_ENEMY) + if (obj.entities[i].type == 23) { square_onscreen = true; break; @@ -740,10 +716,6 @@ void gamelogic(void) { game.swnmode = false; } - break; - } - case SWN_NONE: - break; } } @@ -759,33 +731,33 @@ void gamelogic(void) { game.hascontrol = false; } - if(game.timetrialcountdown == 120) music.playef(Sound_COUNTDOWN); - if(game.timetrialcountdown == 90) music.playef(Sound_COUNTDOWN); - if(game.timetrialcountdown == 60) music.playef(Sound_COUNTDOWN); + if(game.timetrialcountdown == 120) music.playef(21); + if(game.timetrialcountdown == 90) music.playef(21); + if(game.timetrialcountdown == 60) music.playef(21); if (game.timetrialcountdown == 30) { switch(game.timetriallevel) { - case TimeTrial_SPACESTATION1: - music.play(Music_PUSHINGONWARDS); + case 0: + music.play(1); break; - case TimeTrial_LABORATORY: - music.play(Music_POTENTIALFORANYTHING); + case 1: + music.play(3); break; - case TimeTrial_TOWER: - music.play(Music_POSITIVEFORCE); + case 2: + music.play(2); break; - case TimeTrial_SPACESTATION2: - music.play(Music_PUSHINGONWARDS); + case 3: + music.play(1); break; - case TimeTrial_WARPZONE: - music.play(Music_PRESSURECOOKER); + case 4: + music.play(12); break; - case TimeTrial_FINALLEVEL: - music.play(Music_PREDESTINEDFATEREMIX); + case 5: + music.play(15); break; } - music.playef(Sound_GO); + music.playef(22); } } @@ -800,7 +772,7 @@ void gamelogic(void) { obj.entities[i].tile = 144; } - music.playef(Sound_CRY); + music.playef(2); } } } @@ -837,7 +809,7 @@ void gamelogic(void) } } - if (obj.horplatforms) + if(obj.horplatforms) { for (int ie = obj.entities.size() - 1; ie >= 0; ie--) { @@ -861,10 +833,7 @@ void gamelogic(void) //is the player standing on a moving platform? int i = obj.getplayer(); float j = obj.entitycollideplatformfloor(i); - // To match 2.2, we need to give a bit of leeway in the lifeseq - // before we start pushing the player. - const bool horz_active = game.lifeseq < 8; - if (horz_active && INBOUNDS_VEC(i, obj.entities) && j > -1000) + if (INBOUNDS_VEC(i, obj.entities) && j > -1000) { obj.entities[i].newxp = obj.entities[i].xp + j; obj.entitymapcollision(i); @@ -872,7 +841,7 @@ void gamelogic(void) else { j = obj.entitycollideplatformroof(i); - if (horz_active && INBOUNDS_VEC(i, obj.entities) && j > -1000) + if (INBOUNDS_VEC(i, obj.entities) && j > -1000) { obj.entities[i].newxp = obj.entities[i].xp + j; obj.entitymapcollision(i); @@ -899,10 +868,7 @@ void gamelogic(void) { //special for tower: is the player touching any spike blocks? int player = obj.getplayer(); - if (INBOUNDS_VEC(player, obj.entities) - && obj.checktowerspikes(player) - /* not really needed, but is slight improvement when exiting to menu near spikes */ - && graphics.fademode == FADE_NONE) + if(INBOUNDS_VEC(player, obj.entities) && obj.checktowerspikes(player) && graphics.fademode==0) { game.deathseq = 30; } @@ -1018,7 +984,7 @@ void gamelogic(void) obj.customwarpmodevon = false; int i = obj.getplayer(); - if (INBOUNDS_VEC(i, obj.entities) && (obj.entities[i].yp >= 226-16 || obj.entities[i].yp < -2+16 || obj.entities[i].xp < -14+16 || obj.entities[i].xp >= 308-16)){ + if (INBOUNDS_VEC(i, obj.entities) && ((game.door_down > -2 && obj.entities[i].yp >= 226-16) || (game.door_up > -2 && obj.entities[i].yp < -2+16) || (game.door_left > -2 && obj.entities[i].xp < -14+16) || (game.door_right > -2 && obj.entities[i].xp >= 308-16))){ //Player is leaving room obj.customwarplinecheck(i); } @@ -1036,11 +1002,9 @@ void gamelogic(void) size_t i; for (i = 0; i < obj.entities.size(); ++i) { - if (obj.entities[i].type == EntityType_WARP_LINE_LEFT - || obj.entities[i].type == EntityType_WARP_LINE_RIGHT - || obj.entities[i].type == EntityType_WARP_LINE_TOP - || obj.entities[i].type == EntityType_WARP_LINE_BOTTOM /* Don't warp warp lines */ - || obj.entities[i].size == 12) /* Don't warp gravitron squares */ + if ((obj.entities[i].type >= 51 + && obj.entities[i].type <= 54) /* Don't warp warp lines */ + || obj.entities[i].size == 12) /* Don't warp gravitron squares */ { continue; } @@ -1096,10 +1060,8 @@ void gamelogic(void) size_t i; for (i = 0; i < obj.entities.size(); ++i) { - if (obj.entities[i].type == EntityType_WARP_LINE_LEFT - || obj.entities[i].type == EntityType_WARP_LINE_RIGHT - || obj.entities[i].type == EntityType_WARP_LINE_TOP - || obj.entities[i].type == EntityType_WARP_LINE_BOTTOM) /* Don't warp warp lines */ + if (obj.entities[i].type >= 51 + && obj.entities[i].type <= 54) /* Don't warp warp lines */ { continue; } @@ -1130,11 +1092,9 @@ void gamelogic(void) size_t i; for (i = 0; i < obj.entities.size(); ++i) { - if ((obj.entities[i].type == EntityType_WARP_LINE_LEFT - || obj.entities[i].type == EntityType_WARP_LINE_RIGHT - || obj.entities[i].type == EntityType_WARP_LINE_TOP - || obj.entities[i].type == EntityType_WARP_LINE_BOTTOM) /* Don't warp warp lines */ - || obj.entities[i].rule == 0) /* Don't warp the player */ + if ((obj.entities[i].type >= 51 + && obj.entities[i].type <= 54) /* Don't warp warp lines */ + || obj.entities[i].rule == 0) /* Don't warp the player */ { continue; } @@ -1160,19 +1120,23 @@ void gamelogic(void) } } + bool screen_transition = false; + if (!map.warpy && !map.towermode) { //Normal! Just change room int player = obj.getplayer(); - if (INBOUNDS_VEC(player, obj.entities) && obj.entities[player].yp >= 238) + if (INBOUNDS_VEC(player, obj.entities) && game.door_down > -2 && obj.entities[player].yp >= 238) { obj.entities[player].yp -= 240; - GOTOROOM(game.roomx, game.roomy + 1); + map.gotoroom(game.roomx, game.roomy + 1); + screen_transition = true; } - if (INBOUNDS_VEC(player, obj.entities) && obj.entities[player].yp < -2) + if (INBOUNDS_VEC(player, obj.entities) && game.door_up > -2 && obj.entities[player].yp < -2) { obj.entities[player].yp += 240; - GOTOROOM(game.roomx, game.roomy - 1); + map.gotoroom(game.roomx, game.roomy - 1); + screen_transition = true; } } @@ -1180,15 +1144,17 @@ void gamelogic(void) { //Normal! Just change room int player = obj.getplayer(); - if (INBOUNDS_VEC(player, obj.entities) && obj.entities[player].xp < -14) + if (INBOUNDS_VEC(player, obj.entities) && game.door_left > -2 && obj.entities[player].xp < -14) { obj.entities[player].xp += 320; - GOTOROOM(game.roomx - 1, game.roomy); + map.gotoroom(game.roomx - 1, game.roomy); + screen_transition = true; } - if (INBOUNDS_VEC(player, obj.entities) && obj.entities[player].xp >= 308) + if (INBOUNDS_VEC(player, obj.entities) && game.door_right > -2 && obj.entities[player].xp >= 308) { obj.entities[player].xp -= 320; - GOTOROOM(game.roomx + 1, game.roomy); + map.gotoroom(game.roomx + 1, game.roomy); + screen_transition = true; } } @@ -1199,40 +1165,40 @@ void gamelogic(void) { //This is minitower 1! int player = obj.getplayer(); - if (INBOUNDS_VEC(player, obj.entities) && obj.entities[player].xp < -14) + if (INBOUNDS_VEC(player, obj.entities) && game.door_left > -2 && obj.entities[player].xp < -14) { obj.entities[player].xp += 320; - GOTOROOM(48, 52); + map.gotoroom(48, 52); } - if (INBOUNDS_VEC(player, obj.entities) && obj.entities[player].xp >= 308) + if (INBOUNDS_VEC(player, obj.entities) && game.door_right > -2 && obj.entities[player].xp >= 308) { obj.entities[player].xp -= 320; obj.entities[player].yp -= (71*8); - GOTOROOM(game.roomx + 1, game.roomy+1); + map.gotoroom(game.roomx + 1, game.roomy+1); } } else { //This is minitower 2! int player = obj.getplayer(); - if (INBOUNDS_VEC(player, obj.entities) && obj.entities[player].xp < -14) + if (INBOUNDS_VEC(player, obj.entities) && game.door_left > -2 && obj.entities[player].xp < -14) { if (obj.entities[player].yp > 300) { obj.entities[player].xp += 320; obj.entities[player].yp -= (71 * 8); - GOTOROOM(50, 54); + map.gotoroom(50, 54); } else { obj.entities[player].xp += 320; - GOTOROOM(50, 53); + map.gotoroom(50, 53); } } - if (INBOUNDS_VEC(player, obj.entities) && obj.entities[player].xp >= 308) + if (INBOUNDS_VEC(player, obj.entities) && game.door_right > -2 && obj.entities[player].xp >= 308) { obj.entities[player].xp -= 320; - GOTOROOM(52, 53); + map.gotoroom(52, 53); } } } @@ -1259,16 +1225,16 @@ void gamelogic(void) { //Do not wrap! Instead, go to the correct room int player = obj.getplayer(); - if (INBOUNDS_VEC(player, obj.entities) && obj.entities[player].xp < -14) + if (INBOUNDS_VEC(player, obj.entities) && game.door_left > -2 && obj.entities[player].xp < -14) { obj.entities[player].xp += 320; obj.entities[player].yp -= (671 * 8); - GOTOROOM(108, 109); + map.gotoroom(108, 109); } - if (INBOUNDS_VEC(player, obj.entities) && obj.entities[player].xp >= 308) + if (INBOUNDS_VEC(player, obj.entities) && game.door_right > -2 && obj.entities[player].xp >= 308) { obj.entities[player].xp -= 320; - GOTOROOM(110, 104); + map.gotoroom(110, 104); } } } @@ -1280,8 +1246,8 @@ void gamelogic(void) int edi=obj.entities[game.edteleportent].behave; int edj=obj.entities[game.edteleportent].para; int edi2, edj2; - edi2 = edi/40; - edj2 = edj/30; + edi2 = (edi-(edi%40))/40; + edj2 = (edj-(edj%30))/30; map.warpto(100+edi2, 100+edj2, obj.getplayer(), edi%40, (edj%30)+2); game.teleport = false; @@ -1302,7 +1268,7 @@ void gamelogic(void) { obj.entities[i].yp = 225; } - GOTOROOM(119, 100); + map.gotoroom(119, 100); game.teleport = false; } else if (game.roomx == 119 && game.roomy == 100) @@ -1312,7 +1278,7 @@ void gamelogic(void) { obj.entities[i].yp = 225; } - GOTOROOM(119, 103); + map.gotoroom(119, 103); game.teleport = false; } else if (game.roomx == 119 && game.roomy == 103) @@ -1322,7 +1288,7 @@ void gamelogic(void) { obj.entities[i].xp = 0; } - GOTOROOM(116, 103); + map.gotoroom(116, 103); game.teleport = false; } else if (game.roomx == 116 && game.roomy == 103) @@ -1332,7 +1298,7 @@ void gamelogic(void) { obj.entities[i].yp = 225; } - GOTOROOM(116, 100); + map.gotoroom(116, 100); game.teleport = false; } else if (game.roomx == 116 && game.roomy == 100) @@ -1342,7 +1308,7 @@ void gamelogic(void) { obj.entities[i].xp = 0; } - GOTOROOM(114, 102); + map.gotoroom(114, 102); game.teleport = false; } else if (game.roomx == 114 && game.roomy == 102) @@ -1352,7 +1318,7 @@ void gamelogic(void) { obj.entities[i].yp = 225; } - GOTOROOM(113, 100); + map.gotoroom(113, 100); game.teleport = false; } else if (game.roomx == 116 && game.roomy == 104) @@ -1408,7 +1374,7 @@ void gamelogic(void) } } - if (roomchange) + if (screen_transition) { map.twoframedelayfix(); } @@ -1423,17 +1389,212 @@ void gamelogic(void) if (map.finalmode && map.final_colormode) { map.final_aniframedelay--; - if (map.final_aniframedelay == 0) + if(map.final_aniframedelay==0) { - graphics.foregrounddrawn = false; + graphics.foregrounddrawn=false; } - if (map.final_aniframedelay <= 0) - { + if (map.final_aniframedelay <= 0) { map.final_aniframedelay = 2; map.final_aniframe++; if (map.final_aniframe >= 4) - { map.final_aniframe = 0; + } + } + + if (game.roomchange) + { + //We've changed room? Let's bring our companion along! + game.roomchange = false; + int i = obj.getplayer(); + if (game.companion > 0 && INBOUNDS_VEC(i, obj.entities)) + { + //ok, we'll presume our companion has been destroyed in the room change. So: + switch(game.companion) + { + case 6: + { + obj.createentity(obj.entities[i].xp, 121.0f, 15.0f,1); //Y=121, the floor in that particular place! + int j = obj.getcompanion(); + if (INBOUNDS_VEC(j, obj.entities)) + { + obj.entities[j].vx = obj.entities[i].vx; + obj.entities[j].dir = obj.entities[i].dir; + } + break; + } + case 7: + if (game.roomy <= 105) //don't jump after him! + { + if (game.roomx == 110) + { + obj.createentity(320, 86, 16, 1); //Y=86, the ROOF in that particular place! + } + else + { + obj.createentity(obj.entities[i].xp, 86.0f, 16.0f, 1); //Y=86, the ROOF in that particular place! + } + int j = obj.getcompanion(); + if (INBOUNDS_VEC(j, obj.entities)) + { + obj.entities[j].vx = obj.entities[i].vx; + obj.entities[j].dir = obj.entities[i].dir; + } + } + break; + case 8: + if (game.roomy >= 104) //don't jump after him! + { + if (game.roomx == 102) + { + obj.createentity(310, 177, 17, 1); + int j = obj.getcompanion(); + if (INBOUNDS_VEC(j, obj.entities)) + { + obj.entities[j].vx = obj.entities[i].vx; + obj.entities[j].dir = obj.entities[i].dir; + } + } + else + { + obj.createentity(obj.entities[i].xp, 177.0f, 17.0f, 1); + int j = obj.getcompanion(); + if (INBOUNDS_VEC(j, obj.entities)) + { + obj.entities[j].vx = obj.entities[i].vx; + obj.entities[j].dir = obj.entities[i].dir; + } + } + } + break; + case 9: + if (!map.towermode) //don't go back into the tower! + { + if (game.roomx == 110 && obj.entities[i].xp<20) + { + obj.createentity(100, 185, 18, 15, 0, 1); + } + else + { + obj.createentity(obj.entities[i].xp, 185.0f, 18.0f, 15, 0, 1); + } + int j = obj.getcompanion(); + if (INBOUNDS_VEC(j, obj.entities)) + { + obj.entities[j].vx = obj.entities[i].vx; + obj.entities[j].dir = obj.entities[i].dir; + } + } + break; + case 10: + //intermission 2, choose colour based on lastsaved + if (game.roomy == 51) + { + if (!obj.flags[59]) + { + obj.createentity(225.0f, 169.0f, 18, graphics.crewcolour(game.lastsaved), 0, 10); + int j = obj.getcompanion(); + if (INBOUNDS_VEC(j, obj.entities)) + { + obj.entities[j].vx = obj.entities[i].vx; + obj.entities[j].dir = obj.entities[i].dir; + } + } + } + else if (game.roomy >= 52) + { + if (obj.flags[59]) + { + obj.createentity(160.0f, 177.0f, 18, graphics.crewcolour(game.lastsaved), 0, 18, 1); + int j = obj.getcompanion(); + if (INBOUNDS_VEC(j, obj.entities)) + { + obj.entities[j].vx = obj.entities[i].vx; + obj.entities[j].dir = obj.entities[i].dir; + } + } + else + { + obj.flags[59] = true; + obj.createentity(obj.entities[i].xp, -20.0f, 18.0f, graphics.crewcolour(game.lastsaved), 0, 10, 0); + int j = obj.getcompanion(); + if (INBOUNDS_VEC(j, obj.entities)) + { + obj.entities[j].vx = obj.entities[i].vx; + obj.entities[j].dir = obj.entities[i].dir; + } + } + } + break; + case 11: + //Intermission 1: We're using the SuperCrewMate instead! + if(game.roomx-41==game.scmprogress) + { + switch(game.scmprogress) + { + case 0: + obj.createentity(76, 161, 24, graphics.crewcolour(game.lastsaved), 2); + break; + case 1: + obj.createentity(10, 169, 24, graphics.crewcolour(game.lastsaved), 2); + break; + case 2: + obj.createentity(10, 177, 24, graphics.crewcolour(game.lastsaved), 2); + break; + case 3: + if (game.scmmoveme) + { + obj.createentity(obj.entities[obj.getplayer()].xp, 185, 24, graphics.crewcolour(game.lastsaved), 2); + game.scmmoveme = false; + } + else + { + obj.createentity(10, 177, 24, graphics.crewcolour(game.lastsaved), 2); + } + break; + case 4: + obj.createentity(10, 185, 24, graphics.crewcolour(game.lastsaved), 2); + break; + case 5: + obj.createentity(10, 185, 24, graphics.crewcolour(game.lastsaved), 2); + break; + case 6: + obj.createentity(10, 185, 24, graphics.crewcolour(game.lastsaved), 2); + break; + case 7: + obj.createentity(10, 41, 24, graphics.crewcolour(game.lastsaved), 2); + break; + case 8: + obj.createentity(10, 169, 24, graphics.crewcolour(game.lastsaved), 2); + break; + case 9: + obj.createentity(10, 169, 24, graphics.crewcolour(game.lastsaved), 2); + break; + case 10: + obj.createentity(10, 129, 24, graphics.crewcolour(game.lastsaved), 2); + break; + case 11: + obj.createentity(10, 129, 24, graphics.crewcolour(game.lastsaved), 2); + break; + case 12: + obj.createentity(10, 65, 24, graphics.crewcolour(game.lastsaved), 2); + break; + case 13: + obj.createentity(10, 177, 24, graphics.crewcolour(game.lastsaved)); + break; + } + } + + if (game.scmmoveme) + { + int scm = obj.getscm(); + int player = obj.getplayer(); + if (INBOUNDS_VEC(scm, obj.entities) && INBOUNDS_VEC(player, obj.entities)) + { + obj.entities[scm].xp = obj.entities[player].xp; + } + game.scmmoveme = false; + } + break; } } } @@ -1444,15 +1605,13 @@ void gamelogic(void) && INBOUNDS_VEC(game.activeactivity, obj.blocks)) { game.activity_lastprompt = obj.blocks[game.activeactivity].prompt; - game.activity_gettext = obj.blocks[game.activeactivity].gettext; game.activity_r = obj.blocks[game.activeactivity].r; game.activity_g = obj.blocks[game.activeactivity].g; game.activity_b = obj.blocks[game.activeactivity].b; - game.activity_y = obj.blocks[game.activeactivity].activity_y; } game.oldreadytotele = game.readytotele; - if (game.activetele && game.hascontrol && !script.running && (!game.intimetrial || game.translator_exploring_allowtele)) + if (game.activetele && game.hascontrol && !script.running && !game.intimetrial) { int i = obj.getplayer(); SDL_Rect temprect = SDL_Rect(); @@ -1485,9 +1644,4 @@ void gamelogic(void) if (game.teleport_to_new_area) script.teleport(); - -#undef gotoroom -#undef GOTOROOM - - level_debugger::logic(); } diff --git a/desktop_version/src/Map.cpp b/desktop_version/src/Map.cpp index e60d6200..385cbc64 100644 --- a/desktop_version/src/Map.cpp +++ b/desktop_version/src/Map.cpp @@ -1,2356 +1,2049 @@ #define MAP_DEFINITION #include "Map.h" -#include "Alloc.h" -#include "Constants.h" -#include "CustomLevels.h" +#include "editor.h" #include "Entity.h" #include "Game.h" #include "GlitchrunnerMode.h" #include "Graphics.h" -#include "Localization.h" #include "MakeAndPlay.h" -#include "Maths.h" #include "Music.h" #include "Script.h" -#include "Unused.h" #include "UtilityClass.h" mapclass::mapclass(void) { - //Start here! - colstatedelay = 0; - colsuperstate = 0; - spikeleveltop = 0; - spikelevelbottom = 0; - oldspikeleveltop = 0; - oldspikelevelbottom = 0; - warpx = false; - warpy = false; - extrarow = 0; + //Start here! + colstatedelay = 0; + colsuperstate = 0; + spikeleveltop = 0; + spikelevelbottom = 0; + oldspikeleveltop = 0; + oldspikelevelbottom = 0; + warpx = false; + warpy = false; + extrarow = 0; - showteleporters = false; - showtargets = false; - showtrinkets = false; + showteleporters = false; + showtargets = false; + showtrinkets = false; - finalmode = false; - finalstretch = false; + finalmode = false; + finalstretch = false; - cursorstate = 0; - cursordelay = 0; + cursorstate = 0; + cursordelay = 0; - towermode = false; - cameraseekframe = 0; - resumedelay = 0; + towermode = false; + cameraseekframe = 0; + resumedelay = 0; - final_colormode = false; - final_colorframe = 0; - final_colorframedelay = 0; - final_mapcol = 0; - final_aniframe = 0; - final_aniframedelay = 0; + final_colormode = false; + final_colorframe = 0; + final_colorframedelay = 0; + final_mapcol = 0; + final_aniframe = 0; + final_aniframedelay = 0; - custommode=false; - custommodeforreal=false; - customshowmm=true; - revealmap = true; + custommode=false; + custommodeforreal=false; + customwidth=20; customheight=20; + custommmxoff=0; custommmyoff=0; custommmxsize=0; custommmysize=0; + customzoom=0; + customshowmm=true; - rcol = 0; + rcol = 0; - //This needs to be in map instead! - invincibility = false; + //This needs to be in map instead! + invincibility = false; - //We create a blank map - SDL_memset(contents, 0, sizeof(contents)); + //We init the lookup table: + for (size_t i = 0; i < SDL_arraysize(vmult); i++) + { + vmult[i] = i * 40; + } + //We create a blank map + SDL_memset(contents, 0, sizeof(contents)); - SDL_memset(roomdeaths, 0, sizeof(roomdeaths)); - SDL_memset(roomdeathsfinal, 0, sizeof(roomdeathsfinal)); - resetmap(); + SDL_memset(roomdeaths, 0, sizeof(roomdeaths)); + SDL_memset(roomdeathsfinal, 0, sizeof(roomdeathsfinal)); + resetmap(); - setroomname(""); - hiddenname = ""; + tileset = 0; + initmapdata(); - roomname_special = false; - specialroomnames.clear(); - roomnameset = false; + resetnames(); - tileset = 0; - initmapdata(); + ypos = 0; + oldypos = 0; - ypos = 0; - oldypos = 0; + background = 0; + cameramode = 0; + cameraseek = 0; + minitowermode = false; + roomtexton = false; - background = 0; - cameramode = 0; - cameraseek = 0; - minitowermode = false; - roomtexton = false; - - nexttowercolour_set = false; - - currentregion = 0; - SDL_zeroa(region); -} - -static char roomname_static[SCREEN_WIDTH_CHARS]; -static char* roomname_heap; - -void mapclass::destroy(void) -{ - VVV_free(roomname_heap); + nexttowercolour_set = false; } //Areamap starts at 100,100 and extends 20x20 const int mapclass::areamap[] = { - 1,2,2,2,2,2,2,2,0,3,0,0,0,4,4,4,4,4,4,4, - 1,2,2,2,2,2,2,0,0,3,0,0,0,0,4,4,4,4,4,4, - 0,1,0,0,2,0,0,0,0,3,0,0,0,0,4,4,4,4,4,4, - 0,0,0,0,2,0,0,0,0,3,0,0,5,5,5,5,4,4,4,4, - 0,0,2,2,2,0,0,0,0,3,11,11,5,5,5,5,0,0,0,0, - 0,0,0,0,0,0,0,0,0,3,5,5,5,5,5,5,0,0,0,0, - 0,0,0,0,0,0,0,0,0,3,5,5,5,5,5,5,5,0,0,0, - 0,0,0,0,0,0,0,0,0,3,5,5,5,5,5,5,5,5,5,0, - 0,0,0,0,0,0,0,0,0,3,0,0,0,5,5,5,5,5,5,0, - 0,0,0,0,0,0,0,0,11,3,0,0,0,5,5,5,5,5,5,0, - 0,0,0,0,0,0,0,0,0,3,0,0,0,5,5,5,5,5,5,0, - 0,0,0,0,0,0,0,0,0,3,0,5,5,5,5,5,5,5,5,0, - 0,0,0,0,0,0,0,0,0,3,0,5,5,5,5,5,5,0,5,0, - 0,0,0,0,0,0,0,0,0,3,0,5,5,5,5,5,5,0,5,0, - 0,0,0,0,0,0,0,0,0,3,0,5,5,0,0,0,0,0,5,0, - 0,0,0,0,0,0,0,2,0,3,0,0,0,0,0,0,0,0,0,0, - 0,0,2,2,2,2,2,2,0,3,0,0,0,0,0,0,0,0,0,0, - 0,2,2,2,2,2,2,2,0,3,0,0,0,0,0,0,0,0,0,0, - 2,2,2,2,2,0,0,2,0,3,0,0,0,0,0,0,0,0,0,0, - 2,2,2,2,2,0,0,2,0,3,0,0,0,0,0,0,0,0,0,0, + 1,2,2,2,2,2,2,2,0,3,0,0,0,4,4,4,4,4,4,4, + 1,2,2,2,2,2,2,0,0,3,0,0,0,0,4,4,4,4,4,4, + 0,1,0,0,2,0,0,0,0,3,0,0,0,0,4,4,4,4,4,4, + 0,0,0,0,2,0,0,0,0,3,0,0,5,5,5,5,4,4,4,4, + 0,0,2,2,2,0,0,0,0,3,11,11,5,5,5,5,0,0,0,0, + 0,0,0,0,0,0,0,0,0,3,5,5,5,5,5,5,0,0,0,0, + 0,0,0,0,0,0,0,0,0,3,5,5,5,5,5,5,5,0,0,0, + 0,0,0,0,0,0,0,0,0,3,5,5,5,5,5,5,5,5,5,0, + 0,0,0,0,0,0,0,0,0,3,0,0,0,5,5,5,5,5,5,0, + 0,0,0,0,0,0,0,0,11,3,0,0,0,5,5,5,5,5,5,0, + 0,0,0,0,0,0,0,0,0,3,0,0,0,5,5,5,5,5,5,0, + 0,0,0,0,0,0,0,0,0,3,0,5,5,5,5,5,5,5,5,0, + 0,0,0,0,0,0,0,0,0,3,0,5,5,5,5,5,5,0,5,0, + 0,0,0,0,0,0,0,0,0,3,0,5,5,5,5,5,5,0,5,0, + 0,0,0,0,0,0,0,0,0,3,0,5,5,0,0,0,0,0,5,0, + 0,0,0,0,0,0,0,2,0,3,0,0,0,0,0,0,0,0,0,0, + 0,0,2,2,2,2,2,2,0,3,0,0,0,0,0,0,0,0,0,0, + 0,2,2,2,2,2,2,2,0,3,0,0,0,0,0,0,0,0,0,0, + 2,2,2,2,2,0,0,2,0,3,0,0,0,0,0,0,0,0,0,0, + 2,2,2,2,2,0,0,2,0,3,0,0,0,0,0,0,0,0,0,0, }; -int mapclass::getwidth(void) -{ - if (custommode) - { - return cl.mapwidth; - } - - return 20; -} - -int mapclass::getheight(void) -{ - if (custommode) - { - return cl.mapheight; - } - - return 20; -} - int mapclass::intpol(int a, int b, float c) { - return static_cast(a + ((b - a) * c)); + return static_cast(a + ((b - a) * c)); } void mapclass::setteleporter(int x, int y) { - if (x < 0 || x >= getwidth() || y < 0 || y >= getheight()) - { - return; - } - - SDL_Point temp; - temp.x = x; - temp.y = y; - teleporters.push_back(temp); + point temp; + temp.x = x; + temp.y = y; + teleporters.push_back(temp); } void mapclass::settrinket(int x, int y) { - if (x < 0 || x >= getwidth() || y < 0 || y >= getheight()) - { - return; - } - - SDL_Point temp; - temp.x = x; - temp.y = y; - shinytrinkets.push_back(temp); -} - -void mapclass::setroomname(const char* name) -{ - VVV_free(roomname_heap); - - const size_t size = SDL_strlcpy( - roomname_static, name, sizeof(roomname_static) - ) + 1; - roomname = roomname_static; - - if (size > sizeof(roomname_static)) - { - roomname_heap = SDL_strdup(name); - if (roomname_heap != NULL) - { - roomname = roomname_heap; - } - } + point temp; + temp.x = x; + temp.y = y; + shinytrinkets.push_back(temp); } void mapclass::resetmap(void) { - //clear the explored area of the map - SDL_memset(explored, 0, sizeof(explored)); + //clear the explored area of the map + SDL_memset(explored, 0, sizeof(explored)); } -void mapclass::fullmap(void) +void mapclass::resetnames(void) { - //mark the whole map as explored - SDL_memset(explored, 1, sizeof(explored)); + //Reset all the special names + specialnames[0] = "Rear Window"; + specialnames[1] = "On the Waterfront"; + specialnames[2] = "The Untouchables"; + specialnames[3] = "Television Newsveel"; + specialnames[4] = "Vwitched"; + specialnames[5] = "Gvnsmoke"; + specialnames[6] = "Please enjoy these repeats"; + specialnames[7] = "Try Jiggling the Antenna"; + + glitchmode = 0; + glitchdelay = 0; } -void mapclass::updateroomnames(void) +void mapclass::transformname(int t) { - if (roomnameset) - { - return; - } + //transform special names into new ones, one step at a time - const int rx = game.roomx; - const int ry = game.roomy; + glitchdelay--; + if(glitchdelay<=0) + { + switch(t) + { + case 3: + //Television Newsveel -> The 9 O'Clock News + if (specialnames[3] == "Television Newsveel") + { + specialnames[3] = "Television Newsvel"; + } + else if (specialnames[3] == "Television Newsvel") + { + specialnames[3] = "TelevisvonvNewsvel"; + } + else if (specialnames[3] == "TelevisvonvNewsvel") + { + specialnames[3] = "TvlvvvsvonvNevsvel"; + } + else if (specialnames[3] == "TvlvvvsvonvNevsvel") + { + specialnames[3] = "vvvvvvsvovvNe svel"; + } + else if (specialnames[3] == "vvvvvvsvovvNe svel") + { + specialnames[3] = "vhv vvv'vvovv vevl"; + } + else if (specialnames[3] == "vhv vvv'vvovv vevl") + { + specialnames[3] = "vhv V v'Cvovv vewv"; + } + else if (specialnames[3] == "vhv V v'Cvovv vewv") + { + specialnames[3] = "vhe 9 v'Cvovv vewv"; + } + else if (specialnames[3] == "vhe 9 v'Cvovv vewv") + { + specialnames[3] = "vhe 9 v'Cvovv Newv"; + } + else if (specialnames[3] == "vhe 9 v'Cvovv Newv") + { + specialnames[3] = "The 9 O'Cvovk Newv"; + } + else if (specialnames[3] == "The 9 O'Cvovk Newv") + { + specialnames[3] = "The 9 O'Clock News"; + } + break; + case 4: + //Vwitched -> Dial M for Murder + if (specialnames[4] == "Vwitched") + { + specialnames[4] = "Vwitvhed"; + } + else if (specialnames[4] == "Vwitvhed") + { + specialnames[4] = "vVwivcvedv"; + } + else if (specialnames[4] == "vVwivcvedv") + { + specialnames[4] = "vvvwMvcvMdvv"; + } + else if (specialnames[4] == "vvvwMvcvMdvv") + { + specialnames[4] = "DvvvwMvfvvMdvvv"; + } + else if (specialnames[4] == "DvvvwMvfvvMdvvv") + { + specialnames[4] = "Dvav Mvfvr Mdvvvv"; + } + else if (specialnames[4] == "Dvav Mvfvr Mdvvvv") + { + specialnames[4] = "Diav M for Mdrver"; + } + else if (specialnames[4] == "Diav M for Mdrver") + { + specialnames[4] = "Dial M for Murder"; + } + break; + case 5: + //Gvnsmoke -> Gunsmoke 1966 + if (specialnames[5] == "Gvnsmoke") + { + specialnames[5] = "Gvnsmove"; + } + else if (specialnames[5] == "Gvnsmove") + { + specialnames[5] = "Gvnvmovevv"; + } + else if (specialnames[5] == "Gvnvmovevv") + { + specialnames[5] = "Gunvmove1vv6"; + } + else if (specialnames[5] == "Gunvmove1vv6") + { + specialnames[5] = "Vunsmoke 19v6"; + } + else if (specialnames[5] == "Vunsmoke 19v6") + { + specialnames[5] = "Gunsmoke 1966"; + } + break; + case 6: + //Please enjoy these repeats -> In the Margins + if (specialnames[6] == "Please enjoy these repeats") + { + specialnames[6] = "Please envoy theve repeats"; + } + else if (specialnames[6] == "Please envoy theve repeats") + { + specialnames[6] = "Plse envoy tse rvpvas"; + } + else if (specialnames[6] == "Plase envoy these rvpeas") + { + specialnames[6] = "Plse envoy tse rvpvas"; + } + else if (specialnames[6] == "Plse envoy tse rvpvas") + { + specialnames[6] = "Vl envoy te rvevs"; + } + else if (specialnames[6] == "Vl envoy te rvevs") + { + specialnames[6] = "Vv evo tv vevs"; + } + else if (specialnames[6] == "Vv evo tv vevs") + { + specialnames[6] = "Iv vhv Mvrvivs"; + } + else if (specialnames[6] == "Iv vhv Mvrvivs") + { + specialnames[6] = "In the Margins"; + } + break; + case 7: + //Try Jiggling the Antenna -> Heaven's Gate + if (specialnames[7] == "Try Jiggling the Antenna") + { + specialnames[7] = "Try Viggling the Antenna"; + } + else if (specialnames[7] == "Try Viggling the Antenna") + { + specialnames[7] = "TryJivglvng theAvtevna"; + } + else if (specialnames[7] == "TryJivglvng theAvtevna") + { + specialnames[7] = "Tvvivglvng thAvtvvv"; + } + else if (specialnames[7] == "Tvvivglvng thAvtvvv") + { + specialnames[7] = "Vvvgglvnv tvnvva"; + } + else if (specialnames[7] == "Vvvgglvnv tvnvva") + { + specialnames[7] = "Vvavvnvs vvtv"; + } + else if (specialnames[7] == "Vvavvnvs vvtv") + { + specialnames[7] = "Veavvn's Gvte"; + } + else if (specialnames[7] == "Veavvn's Gvte") + { + specialnames[7] = "Heaven's Gate"; + } + break; - for (int i = specialroomnames.size() - 1; i >= 0; i--) - { - Roomname* roomname = &specialroomnames[i]; - if (rx == roomname->x && ry == roomname->y && (roomname->flag == -1 || (INBOUNDS_ARR(roomname->flag, obj.flags) && obj.flags[roomname->flag]))) - { - roomname_special = true; - if (roomname->type == RoomnameType_STATIC) - { - setroomname(roomname->text[0].c_str()); - } - if (roomname->type == RoomnameType_GLITCH) - { - roomname->delay--; - if (roomname->delay <= 0) - { - roomname->progress = (roomname->progress + 1) % 2; - roomname->delay = 5; - if (roomname->progress == 0) - { - roomname->delay = 25 + (int) (fRandom() * 10); - } - } - setroomname(roomname->text[roomname->progress].c_str()); - } - if (roomname->type == RoomnameType_TRANSFORM) - { - roomname->delay--; - if (roomname->delay <= 0) - { - roomname->progress++; - roomname->delay = 2; - if ((size_t) roomname->progress >= roomname->text.size()) - { - roomname->progress = roomname->loop ? 0 : roomname->text.size() - 1; - } - } - setroomname(roomname->text[roomname->progress].c_str()); - } - break; - } - } + } + glitchdelay = 5; + } + else + { + glitchdelay--; + } +} + +std::string mapclass::getglitchname(int x, int y) +{ + //Returns the name in the final area. + if (roomname == "glitch") + { + //8 Cases! + //First, the three "glitches" + glitchdelay--; + if (glitchdelay <= -5) + { + glitchmode = (glitchmode + 1) % 2; + glitchdelay = 0; + if (glitchmode == 0) glitchdelay = 20 +int(fRandom() * 10); + } + + if (x == 42 && y == 51) + { + if (glitchmode == 0) + { + return specialnames[0]; + } + else return "Rear Vindow"; + } + else if (x == 48 && y == 51) + { + if (glitchmode == 0) + { + return specialnames[1]; + } + else return "On the Vaterfront"; + } + else if (x == 49 && y == 51) + { + if (glitchmode == 0) + { + return specialnames[2]; + } + else return "The Untouchavles"; + } + } + else if (roomname == "change") + { + if (finalstretch) + { + if (x == 45 && y == 51) transformname(3); + if (x == 46 && y == 51) transformname(4); + if (x == 47 && y == 51) transformname(5); + if (x == 50 && y == 53) transformname(6); + if (x == 50 && y == 54) transformname(7); + } + + if (x == 45 && y == 51) return specialnames[3]; + if (x == 46 && y == 51) return specialnames[4]; + if (x == 47 && y == 51) return specialnames[5]; + if (x == 50 && y == 53) return specialnames[6]; + if (x == 50 && y == 54) return specialnames[7]; + return roomname; + } + else + { + return roomname; + } + return roomname; } void mapclass::initmapdata(void) { - if (custommode) - { - initcustommapdata(); - return; - } + if (custommode) + { + initcustommapdata(); + return; + } - teleporters.clear(); - shinytrinkets.clear(); + teleporters.clear(); + shinytrinkets.clear(); - //Set up static map information like teleporters and shiny trinkets. - setteleporter(0, 0); - setteleporter(0, 16); - setteleporter(2, 4); - setteleporter(2, 11); - setteleporter(7, 9); - setteleporter(7, 15); - setteleporter(8, 11); - setteleporter(10, 5); - setteleporter(11, 4); - setteleporter(13, 2); - setteleporter(13, 8); - setteleporter(14, 19); - setteleporter(15, 0); - setteleporter(17, 12); - setteleporter(17, 17); - setteleporter(18, 1); - setteleporter(18, 7); + //Set up static map information like teleporters and shiny trinkets. + setteleporter(0, 0); + setteleporter(0, 16); + setteleporter(2, 4); + setteleporter(2, 11); + setteleporter(7, 9); + setteleporter(7, 15); + setteleporter(8, 11); + setteleporter(10, 5); + setteleporter(11, 4); + setteleporter(13, 2); + setteleporter(13, 8); + setteleporter(14, 19); + setteleporter(15, 0); + setteleporter(17, 12); + setteleporter(17, 17); + setteleporter(18, 1); + setteleporter(18, 7); - settrinket(14, 4); - settrinket(13, 6); - settrinket(11, 12); - settrinket(15, 12); - settrinket(14, 11); - settrinket(18, 14); - settrinket(11, 7); - settrinket(9, 2); - settrinket(9, 16); - settrinket(2, 18); - settrinket(7, 18); - settrinket(6, 1); - settrinket(17, 3); - settrinket(10, 19); - settrinket(5, 15); - settrinket(1, 10); - settrinket(3, 2); - settrinket(10, 8); - - //Special room names - specialroomnames.clear(); - - { - static const char* lines[] = { - "Television Newsvel", - "TelevisvonvNewsvel", - "TvlvvvsvonvNevsvel", - "vvvvvvsvovvNe svel", - "vhv vvv'vvovv vevl", - "vhv V v'Cvovv vewv", - "vhe 9 v'Cvovv vewv", - "vhe 9 v'Cvovv Newv", - "The 9 O'Cvovk Newv", - "The 9 O'Clock News" - }; - - roomnamechange(45, 51, lines, SDL_arraysize(lines)); - } - - { - static const char* lines[] = { - "Vwitvhed", - "vVwivcvedv", - "vvvwMvcvMdvv", - "DvvvwMvfvvMdvvv", - "Dvav Mvfvr Mdvvvv", - "Diav M for Mdrver", - "Dial M for Murder" - }; - - roomnamechange(46, 51, lines, SDL_arraysize(lines)); - } - - { - static const char* lines[] = { - "Gvnsmove", - "Gvnvmovevv", - "Gunvmove1vv6", - "Vunsmoke 19v6", - "Gunsmoke 1966" - }; - - roomnamechange(47, 51, lines, SDL_arraysize(lines)); - } - - { - static const char* lines[] = { - "Please envoy theve repeats", - "Plse envoy tse rvpvas", - "Plse envoy tse rvpvas", - "Vl envoy te rvevs", - "Vv evo tv vevs", - "Iv vhv Mvrvivs", - "In the Margins" - }; - - roomnamechange(50, 53, lines, SDL_arraysize(lines)); - } - - { - static const char* lines[] = { - "Try Viggling the Antenna", - "TryJivglvng theAvtevna", - "Tvvivglvng thAvtvvv", - "Vvvgglvnv tvnvva", - "Vvavvnvs vvtv", - "Veavvn's Gvte", - "Heaven's Gate" - }; - - roomnamechange(50, 54, lines, SDL_arraysize(lines)); - } - - roomnameglitch(42, 51, "Rear Window", "Rear Vindow"); - roomnameglitch(48, 51, "On the Waterfront", "On the Vaterfront"); - roomnameglitch(49, 51, "The Untouchables", "The Untouchavles"); -} - -void mapclass::roomnameglitch(int x, int y, const char* name, const char* text) -{ - Roomname roomname; - roomname.x = x; - roomname.y = y; - roomname.type = RoomnameType_GLITCH; - roomname.flag = -1; - roomname.loop = false; - roomname.progress = 1; - roomname.delay = -1; - - roomname.text.push_back(name); - roomname.text.push_back(text); - - specialroomnames.push_back(roomname); -} - -void mapclass::roomnamechange(const int x, const int y, const char** lines, const size_t size) -{ - Roomname roomname; - roomname.x = x; - roomname.y = y; - roomname.type = RoomnameType_TRANSFORM; - roomname.flag = 72; // Flag 72 is synced with finalstretch - roomname.loop = false; - roomname.progress = 0; - roomname.delay = 2; - - roomname.text.insert(roomname.text.end(), lines, lines + size); - - specialroomnames.push_back(roomname); + settrinket(14, 4); + settrinket(13, 6); + settrinket(11, 12); + settrinket(15, 12); + settrinket(14, 11); + settrinket(18, 14); + settrinket(11, 7); + settrinket(9, 2); + settrinket(9, 16); + settrinket(2, 18); + settrinket(7, 18); + settrinket(6, 1); + settrinket(17, 3); + settrinket(10, 19); + settrinket(5, 15); + settrinket(1, 10); + settrinket(3, 2); + settrinket(10, 8); } void mapclass::initcustommapdata(void) { - shinytrinkets.clear(); + shinytrinkets.clear(); - for (size_t i = 0; i < customentities.size(); i++) - { - const CustomEntity& ent = customentities[i]; - if (ent.t != 9) - { - continue; - } +#if !defined(NO_CUSTOM_LEVELS) + for (size_t i = 0; i < edentity.size(); i++) + { + const edentities& ent = edentity[i]; + if (ent.t != 9) + { + continue; + } - settrinket(ent.rx, ent.ry); - } + const int rx = ent.x / 40; + const int ry = ent.y / 30; + + settrinket(rx, ry); + } +#endif } int mapclass::finalat(int x, int y) { - //return the tile index of the final stretch tiles offset by the colour difference - const int tile = contents[TILE_IDX(x, y)]; - if (tile == 740) - { - //Special case: animated tiles - if (final_mapcol == 1) - { - int offset; - if (game.noflashingmode) - { - offset = 0; - } - else - { - offset = int(fRandom() * 11) * 40; - } - return 737 + offset; - } - else - { - int offset; - if (game.noflashingmode) - { - offset = 0; - } - else - { - offset = final_aniframe * 40; - } - return tile - (final_mapcol * 3) + offset; - } - } - else if (tile >= 80) - { - return tile - (final_mapcol * 3); - } - else - { - return tile; - } + //return the tile index of the final stretch tiles offset by the colour difference + if (contents[x + vmult[y]] == 740) + { + //Special case: animated tiles + if (final_mapcol == 1) + { + int offset; + if (game.noflashingmode) + { + offset = 0; + } + else + { + offset = int(fRandom() * 11) * 40; + } + return 737 + offset; + } + else + { + int offset; + if (game.noflashingmode) + { + offset = 0; + } + else + { + offset = final_aniframe * 40; + } + return contents[x + vmult[y]] - (final_mapcol * 3) + offset; + } + } + else if (contents[x + vmult[y]] >= 80) + { + return contents[x + vmult[y]] - (final_mapcol * 3); + } + else + { + return contents[x + vmult[y]]; + } } int mapclass::maptiletoenemycol(int t) { - //returns the colour index for enemies that matches the map colour t - switch(t) - { - case 0: - return EntityColour_ENEMY_CYAN; - break; - case 1: - return EntityColour_ENEMY_RED; - break; - case 2: - return EntityColour_ENEMY_PINK; - break; - case 3: - return EntityColour_ENEMY_BLUE; - break; - case 4: - return EntityColour_ENEMY_YELLOW; - break; - case 5: - return EntityColour_ENEMY_GREEN; - break; - case 6: - return EntityColour_ENEMY_GRAY; - break; - } - return EntityColour_ENEMY_CYAN; + //returns the colour index for enemies that matches the map colour t + switch(t) + { + case 0: + return 11; + break; + case 1: + return 6; + break; + case 2: + return 8; + break; + case 3: + return 12; + break; + case 4: + return 9; + break; + case 5: + return 7; + break; + case 6: + return 18; + break; + } + return 11; } void mapclass::changefinalcol(int t) { - //change the map to colour t - for the game's final stretch. - //First up, the tiles. This is just a setting: - final_mapcol = t; - const int temp = 6 - t; - //Next, entities - for (size_t i = 0; i < obj.entities.size(); i++) - { - if (obj.entities[i].type == EntityType_MOVING) - { - if (obj.entities[i].animate == 10 || obj.entities[i].animate == 11) //treadmill - { - if(temp<3) - { - obj.entities[i].tile = 907 + (temp * 80); - } - else - { - obj.entities[i].tile = 911 + ((temp-3) * 80); - } - if(obj.entities[i].animate == 10) obj.entities[i].tile += 40; - } - else if (obj.entities[i].isplatform) - { - obj.entities[i].tile = 915+(temp*40); - } - else //just an enemy - { - obj.entities[i].colour = maptiletoenemycol(temp); - } - } - else if (obj.entities[i].type == EntityType_DISAPPEARING_PLATFORM) - { - obj.entities[i].tile = 915+(temp*40); - } - } + //change the map to colour t - for the game's final stretch. + //First up, the tiles. This is just a setting: + final_mapcol = t; + int temp = 6 - t; + //Next, entities + for (size_t i = 0; i < obj.entities.size(); i++) + { + if (obj.entities[i].type == 1) //something with a movement behavior + { + if (obj.entities[i].animate == 10 || obj.entities[i].animate == 11) //treadmill + { + if(temp<3) + { + obj.entities[i].tile = 907 + (temp * 80); + } + else + { + obj.entities[i].tile = 911 + ((temp-3) * 80); + } + if(obj.entities[i].animate == 10) obj.entities[i].tile += 40; + } + else if (obj.entities[i].isplatform) + { + obj.entities[i].tile = 915+(temp*40); + } + else //just an enemy + { + obj.entities[i].colour = maptiletoenemycol(temp); + } + } + else if (obj.entities[i].type == 2) //disappearing platforms + { + obj.entities[i].tile = 915+(temp*40); + } + } } void mapclass::setcol(TowerBG& bg_obj, const int r1, const int g1, const int b1 , const int r2, const int g2, const int b2, const int c) { - bg_obj.r = intpol(r1, r2, c / 5); - bg_obj.g = intpol(g1, g2, c / 5); - bg_obj.b = intpol(b1, b2, c / 5); + bg_obj.r = intpol(r1, r2, c / 5); + bg_obj.g = intpol(g1, g2, c / 5); + bg_obj.b = intpol(b1, b2, c / 5); } void mapclass::updatebgobj(TowerBG& bg_obj) { - const int check = bg_obj.colstate % 5; //current state of phase - const int cmode = (bg_obj.colstate - check) / 5; // current colour transition; + const int check = bg_obj.colstate % 5; //current state of phase + const int cmode = (bg_obj.colstate - check) / 5; // current colour transition; - switch(cmode) - { - case 0: - setcol(bg_obj, 255, 93, 107, 255, 255, 93, check); - break; - case 1: - setcol(bg_obj, 255, 255, 93, 159, 255, 93, check); - break; - case 2: - setcol(bg_obj, 159, 255, 93, 93, 245, 255, check); - break; - case 3: - setcol(bg_obj, 93, 245, 255, 177, 93, 255, check); - break; - case 4: - setcol(bg_obj, 177, 93, 255, 255, 93, 255, check); - break; - case 5: - setcol(bg_obj, 255, 93, 255, 255, 93, 107, check); - break; - } + switch(cmode) + { + case 0: + setcol(bg_obj, 255, 93, 107, 255, 255, 93, check); + break; + case 1: + setcol(bg_obj, 255, 255, 93, 159, 255, 93, check); + break; + case 2: + setcol(bg_obj, 159, 255, 93, 93, 245, 255, check); + break; + case 3: + setcol(bg_obj, 93, 245, 255, 177, 93, 255, check); + break; + case 4: + setcol(bg_obj, 177, 93, 255, 255, 93, 255, check); + break; + case 5: + setcol(bg_obj, 255, 93, 255, 255, 93, 107, check); + break; + } - bg_obj.tdrawback = true; + bg_obj.tdrawback = true; } void mapclass::setbgobjlerp(TowerBG& bg_obj) { - bg_obj.bypos = ypos / 2; - bg_obj.bscroll = (ypos - oldypos) / 2; + bg_obj.bypos = ypos / 2; + bg_obj.bscroll = (ypos - oldypos) / 2; } void mapclass::updatetowerglow(TowerBG& bg_obj) { - if (colstatedelay <= 0 || colsuperstate > 0) - { - if (colsuperstate > 0) bg_obj.colstate--; - bg_obj.colstate++; - if (bg_obj.colstate >= 30) bg_obj.colstate = 0; + if (colstatedelay <= 0 || colsuperstate > 0) + { + if (colsuperstate > 0) bg_obj.colstate--; + bg_obj.colstate++; + if (bg_obj.colstate >= 30) bg_obj.colstate = 0; - const int check = bg_obj.colstate % 5; - updatebgobj(bg_obj); + const int check = bg_obj.colstate % 5; + updatebgobj(bg_obj); - if (check == 0) - { - colstatedelay = 45; - } - else - { - colstatedelay = 0; - } - if (colsuperstate > 0) colstatedelay = 0; - } - else - { - colstatedelay--; - } + if (check == 0) + { + colstatedelay = 45; + } + else + { + colstatedelay = 0; + } + if (colsuperstate > 0) colstatedelay = 0; + } + else + { + colstatedelay--; + } } void mapclass::nexttowercolour(void) { - /* Prevent cycling title BG more than once per frame. */ - if (nexttowercolour_set) - { - return; - } - nexttowercolour_set = true; + /* Prevent cycling title BG more than once per frame. */ + if (nexttowercolour_set) + { + return; + } + nexttowercolour_set = true; - graphics.titlebg.colstate+=5; - if (graphics.titlebg.colstate >= 30) graphics.titlebg.colstate = 0; + graphics.titlebg.colstate+=5; + if (graphics.titlebg.colstate >= 30) graphics.titlebg.colstate = 0; - updatebgobj(graphics.titlebg); + updatebgobj(graphics.titlebg); } void mapclass::settowercolour(int t) { - graphics.titlebg.colstate=t*5; - if (graphics.titlebg.colstate >= 30) graphics.titlebg.colstate = 0; + graphics.titlebg.colstate=t*5; + if (graphics.titlebg.colstate >= 30) graphics.titlebg.colstate = 0; - updatebgobj(graphics.titlebg); + updatebgobj(graphics.titlebg); } -bool mapclass::towerspikecollide(int x, int y) +bool mapclass::spikecollide(int x, int y) { - if (tower.at(x,y,0)>= 6 && tower.at(x,y,0) <= 11) return true; - return false; + if (invincibility) return false; + if (tower.at(x,y,0)>= 6 && tower.at(x,y,0) <= 11) return true; + return false; } -bool mapclass::collide(int x, int y, const bool invincible) +bool mapclass::collide(int x, int y) { - if (towermode) - { - if (tower.at(x, y, 0) >= 12 && tower.at(x, y, 0) <= 27) return true; - if (invincible) - { - if (tower.at(x, y, 0) >= 6 && tower.at(x, y, 0) <= 11) return true; - } - } - else if (tileset == 2) - { - int tile; - if (y == -1) return collide(x, y + 1, invincible); - if (y == 29+extrarow) return collide(x, y - 1, invincible); - if (x == -1) return collide(x + 1, y, invincible); - if (x == 40) return collide(x - 1, y, invincible); - if (x < 0 || y < 0 || x >= 40 || y >= 29 + extrarow) return false; - tile = contents[TILE_IDX(x, y)]; - if (tile >= 12 && tile <= 27) return true; - if (invincible) - { - if (tile >= 6 && tile <= 11) return true; - } - } - else - { - int tile; - if (y == -1) return collide(x, y + 1, invincible); - if (y == 29+extrarow) return collide(x, y - 1, invincible); - if (x == -1) return collide(x + 1, y, invincible); - if (x == 40) return collide(x - 1, y, invincible); - if (x < 0 || y < 0 || x >= 40 || y >= 29+extrarow) return false; - tile = contents[TILE_IDX(x, y)]; - if (tile == 1) return true; - if (tileset==0 && tile == 59) return true; - if (tile>= 80 && tile < 680) return true; - if (tile == 740 && tileset==1) return true; - if (invincible) - { - if (tile>= 6 && tile <= 9) return true; - if (tile>= 49 && tile <= 50) return true; - if (tileset == 1) - { - if (tile>= 49 && tile < 80) return true; - } - } - } - return false; + if (towermode) + { + if (tower.at(x, y, 0) >= 12 && tower.at(x, y, 0) <= 27) return true; + if (invincibility) + { + if (tower.at(x, y, 0) >= 6 && tower.at(x, y, 0) <= 11) return true; + } + } + else if (tileset == 2) + { + if (y == -1) return collide(x, y + 1); + if (y == 29+extrarow) return collide(x, y - 1); + if (x == -1) return collide(x + 1, y); + if (x == 40) return collide(x - 1, y); + if (x < 0 || y < 0 || x >= 40 || y >= 29 + extrarow) return false; + if (contents[x + vmult[y]] >= 12 && contents[x + vmult[y]] <= 27) return true; + if (invincibility) + { + if (contents[x + vmult[y]] >= 6 && contents[x + vmult[y]] <= 11) return true; + } + } + else + { + if (y == -1) return collide(x, y + 1); + if (y == 29+extrarow) return collide(x, y - 1); + if (x == -1) return collide(x + 1, y); + if (x == 40) return collide(x - 1, y); + if (x < 0 || y < 0 || x >= 40 || y >= 29+extrarow) return false; + if (contents[x + vmult[y]] == 1) return true; + if (tileset==0 && contents[x + vmult[y]] == 59) return true; + if (contents[x + vmult[y]]>= 80 && contents[x + vmult[y]] < 680) return true; + if (contents[x + vmult[y]] == 740 && tileset==1) return true; + if (invincibility) + { + if (contents[x + vmult[y]]>= 6 && contents[x + vmult[y]] <= 9) return true; + if (contents[x + vmult[y]]>= 49 && contents[x + vmult[y]] <= 50) return true; + if (tileset == 1) + { + if (contents[x + vmult[y]]>= 49 && contents[x + vmult[y]] < 80) return true; + } + } + } + return false; } void mapclass::settile(int xp, int yp, int t) { - if (xp >= 0 && xp < 40 && yp >= 0 && yp < 29+extrarow) - { - contents[TILE_IDX(xp, yp)] = t; - } + if (xp >= 0 && xp < 40 && yp >= 0 && yp < 29+extrarow) + { + contents[xp + vmult[yp]] = t; + } } int mapclass::area(int _rx, int _ry) { - //THIS IS THE BUG - if (finalmode) - { - return 6; - } - else - { - int lookup = (_rx - 100) + ((_ry - 100) * 20); - if(_rx-100>=0 && _rx-100<20 && _ry-100>=0 && _ry-100<20){ - return areamap[lookup]; - } - else - { - return 6; - } - } + //THIS IS THE BUG + if (finalmode) + { + return 6; + } + else + { + int lookup = (_rx - 100) + ((_ry - 100) * 20); + if(_rx-100>=0 && _rx-100<20 && _ry-100>=0 && _ry-100<20){ + return areamap[lookup]; + } + else + { + return 6; + } + } } bool mapclass::isexplored(const int rx, const int ry) { - const int roomnum = rx + ry*20; - if (INBOUNDS_ARR(roomnum, explored)) - { - return explored[roomnum]; - } - return false; + const int roomnum = rx + ry*20; + if (INBOUNDS_ARR(roomnum, explored)) + { + return explored[roomnum]; + } + return false; } void mapclass::setexplored(const int rx, const int ry, const bool status) { - const int roomnum = rx + ry*20; - if (INBOUNDS_ARR(roomnum, explored)) - { - explored[roomnum] = status; - } + const int roomnum = rx + ry*20; + if (INBOUNDS_ARR(roomnum, explored)) + { + explored[roomnum] = status; + } } void mapclass::exploretower(void) { - for (int i = 0; i < 20; i++) - { - setexplored(9, i, true); - } + for (int i = 0; i < 20; i++) + { + setexplored(9, i, true); + } } void mapclass::hideship(void) { - //remove the ship from the explored areas - setexplored(2, 10, false); - setexplored(3, 10, false); - setexplored(4, 10, false); - setexplored(2, 11, false); - setexplored(3, 11, false); - setexplored(4, 11, false); + //remove the ship from the explored areas + setexplored(2, 10, false); + setexplored(3, 10, false); + setexplored(4, 10, false); + setexplored(2, 11, false); + setexplored(3, 11, false); + setexplored(4, 11, false); } void mapclass::showship(void) { - //show the ship in the explored areas - setexplored(2, 10, true); - setexplored(3, 10, true); - setexplored(4, 10, true); - setexplored(2, 11, true); - setexplored(3, 11, true); - setexplored(4, 11, true); + //show the ship in the explored areas + setexplored(2, 10, true); + setexplored(3, 10, true); + setexplored(4, 10, true); + setexplored(2, 11, true); + setexplored(3, 11, true); + setexplored(4, 11, true); } void mapclass::resetplayer(void) { - resetplayer(false); + resetplayer(false); } void mapclass::resetplayer(const bool player_died) { - bool was_in_tower = towermode; - if (game.roomx != game.saverx || game.roomy != game.savery) - { - gotoroom(game.saverx, game.savery); - } + bool was_in_tower = towermode; + if (game.roomx != game.saverx || game.roomy != game.savery) + { + gotoroom(game.saverx, game.savery); + } - game.deathseq = -1; - int i = obj.getplayer(); - if(INBOUNDS_VEC(i, obj.entities)) - { - obj.entities[i].vx = 0; - obj.entities[i].vy = 0; - obj.entities[i].ax = 0; - obj.entities[i].ay = 0; - obj.entities[i].xp = game.savex; - obj.entities[i].yp = game.savey; + game.deathseq = -1; + int i = obj.getplayer(); + if(INBOUNDS_VEC(i, obj.entities)) + { + obj.entities[i].vx = 0; + obj.entities[i].vy = 0; + obj.entities[i].ax = 0; + obj.entities[i].ay = 0; + obj.entities[i].xp = game.savex; + obj.entities[i].yp = game.savey; - //Fix conveyor death loop glitch - obj.entities[i].newxp = obj.entities[i].xp; - obj.entities[i].newyp = obj.entities[i].yp; + //Fix conveyor death loop glitch + obj.entities[i].newxp = obj.entities[i].xp; + obj.entities[i].newyp = obj.entities[i].yp; - obj.entities[i].dir = game.savedir; - obj.entities[i].colour = game.savecolour; - if (player_died) - { - game.lifeseq = 10; - obj.entities[i].invis = true; - } - else - { - obj.entities[i].invis = false; - } - if (!GlitchrunnerMode_less_than_or_equal(Glitchrunner2_2)) - { - obj.entities[i].size = 0; - obj.entities[i].cx = 6; - obj.entities[i].cy = 2; - obj.entities[i].w = 12; - obj.entities[i].h = 21; - } + obj.entities[i].dir = game.savedir; + obj.entities[i].colour = 0; + if (player_died) + { + game.lifeseq = 10; + obj.entities[i].invis = true; + } + else + { + obj.entities[i].invis = false; + } + if (!GlitchrunnerMode_less_than_or_equal(Glitchrunner2_2)) + { + obj.entities[i].size = 0; + obj.entities[i].cx = 6; + obj.entities[i].cy = 2; + obj.entities[i].w = 12; + obj.entities[i].h = 21; + } - // If we entered a tower as part of respawn, reposition camera - if (!was_in_tower && towermode) - { - ypos = obj.entities[i].yp - 120; - if (ypos < 0) - { - ypos = 0; - } - oldypos = ypos; - setbgobjlerp(graphics.towerbg); - } - } + // If we entered a tower as part of respawn, reposition camera + if (!was_in_tower && towermode) + { + ypos = obj.entities[i].yp - 120; + if (ypos < 0) + { + ypos = 0; + } + oldypos = ypos; + setbgobjlerp(graphics.towerbg); + } + } - if (game.state == 0 && !script.running && game.completestop) - { - /* Looks like a collection dialogue was interrupted. - * Undo its effects! */ - game.advancetext = false; - graphics.showcutscenebars = false; - if (music.currentsong > -1) - { - music.fadeMusicVolumeIn(3000); - } - } - - game.scmhurt = false; //Just in case the supercrewmate is fucking this up! - if (game.supercrewmate) - { - if (game.roomx == game.scmprogress + 41) - { - game.scmprogress = game.roomx - 41; - } - else - { - game.scmprogress = game.roomx - 40; - } - } + game.scmhurt = false; //Just in case the supercrewmate is fucking this up! + if (game.supercrewmate) + { + if (game.roomx == game.scmprogress + 41) + { + game.scmprogress = game.roomx - 41; + } + else + { + game.scmprogress = game.roomx - 40; + } + if (game.scmprogress != 0) + { + game.scmmoveme = true; + } + else + { + game.scmmoveme = false; + } + } } void mapclass::warpto(int rx, int ry , int t, int tx, int ty) { - gotoroom(rx, ry); - game.teleport = false; - if (INBOUNDS_VEC(t, obj.entities)) - { - obj.entities[t].xp = tx * 8; - obj.entities[t].yp = (ty * 8) - obj.entities[t].h; - obj.entities[t].lerpoldxp = obj.entities[t].xp; - obj.entities[t].lerpoldyp = obj.entities[t].yp; - } - game.gravitycontrol = 0; + gotoroom(rx, ry); + game.teleport = false; + if (INBOUNDS_VEC(t, obj.entities)) + { + obj.entities[t].xp = tx * 8; + obj.entities[t].yp = (ty * 8) - obj.entities[t].h; + obj.entities[t].lerpoldxp = obj.entities[t].xp; + obj.entities[t].lerpoldyp = obj.entities[t].yp; + } + game.gravitycontrol = 0; } void mapclass::gotoroom(int rx, int ry) { - int roomchangedir; - std::vector linecrosskludge; + //First, destroy the current room + obj.removeallblocks(); + game.activetele = false; + game.readytotele = 0; + game.oldreadytotele = 0; - //First, destroy the current room - obj.removeallblocks(); - game.activetele = false; - game.readytotele = 0; - game.oldreadytotele = 0; + //Ok, let's save the position of all lines on the screen + obj.linecrosskludge.clear(); + for (size_t i = 0; i < obj.entities.size(); i++) + { + if (obj.entities[i].type == 9) + { + //It's a horizontal line + if (obj.entities[i].xp <= 0 || (obj.entities[i].xp + obj.entities[i].w) >= 312) + { + //it's on a screen edge + obj.copylinecross(i); + } + } + } - //Ok, let's save the position of all lines on the screen - for (size_t i = 0; i < obj.entities.size(); i++) - { - if (obj.entities[i].type == EntityType_HORIZONTAL_GRAVITY_LINE) - { - //It's a horizontal line - if (obj.entities[i].xp <= 0 || (obj.entities[i].xp + obj.entities[i].w) >= 312) - { - //it's on a screen edge - obj.copylinecross(linecrosskludge, i); - } - } - } + /* Disable all entities in the room, and deallocate any unnecessary entity slots. */ + /* However don't disable player entities, but do preserve holes between them (if any). */ + bool player_found = false; + for (int i = obj.entities.size() - 1; i >= 0; --i) + { + /* Iterate in reverse order to prevent unnecessary indice shifting */ + if (obj.entities[i].rule == 0) + { + player_found = true; + continue; + } - /* Disable all entities in the room, and deallocate any unnecessary entity slots. */ - /* However don't disable player entities, but do preserve holes between them (if any). */ - bool player_found = false; - for (int i = obj.entities.size() - 1; i >= 0; --i) - { - /* Iterate in reverse order to prevent unnecessary indice shifting */ - if (obj.entities[i].rule == 0) - { - player_found = true; - continue; - } + if (!player_found) + { + obj.entities.erase(obj.entities.begin() + i); + } + else + { + obj.disableentity(i); + } + } - if (!player_found) - { - obj.entities.erase(obj.entities.begin() + i); - } - else - { - obj.disableentity(i); - } - } + game.door_up = rx + ((ry - 1) * 100); + game.door_down = rx + ((ry + 1) * 100); + game.door_right = rx + 1 + (ry * 100); + game.door_left = rx -1 + (ry * 100); - if (rx < game.roomx) - { - roomchangedir = 0; - } - else - { - roomchangedir = 1; - } + if (rx < game.roomx) + { + game.roomchangedir = 0; + } + else + { + game.roomchangedir = 1; + } - if (finalmode) - { - //Ok, what way are we moving? - game.roomx = rx; - game.roomy = ry; + if (finalmode) + { + //Ok, what way are we moving? + game.roomx = rx; + game.roomy = ry; + game.roomchange = true; - if (game.roomy < 10) - { - game.roomy = 11; - } + if (game.roomy < 10) + { + game.roomy = 11; + } - if(game.roomx>=41 && game.roomy>=48 && game.roomx<61 && game.roomy<68 ) - { - game.currentroomdeaths = roomdeathsfinal[game.roomx - 41 + (20 * (game.roomy - 48))]; - } - else - { - game.currentroomdeaths = 0; - } + if(game.roomx>=41 && game.roomy>=48 && game.roomx<61 && game.roomy<68 ) + { + game.currentroomdeaths = roomdeathsfinal[game.roomx - 41 + (20 * (game.roomy - 48))]; + } + else + { + game.currentroomdeaths = 0; + } - //Final level for time trial - if (game.intimetrial && game.roomx == 46 && game.roomy == 54) - { - music.niceplay(Music_PREDESTINEDFATEREMIX); - } - } - else if (custommode) - { - game.roomx = rx; - game.roomy = ry; - if (game.roomx < 100) game.roomx = 100 + cl.mapwidth-1; - if (game.roomy < 100) game.roomy = 100 + cl.mapheight-1; - if (game.roomx > 100 + cl.mapwidth-1) game.roomx = 100; - if (game.roomy > 100 + cl.mapheight-1) game.roomy = 100; - } - else - { - game.roomx = rx; - game.roomy = ry; - if (game.roomx < 100) game.roomx = 119; - if (game.roomy < 100) game.roomy = 119; - if (game.roomx > 119) game.roomx = 100; - if (game.roomy > 119) game.roomy = 100; + //Final level for time trial + if (game.intimetrial) + { + if (game.roomx == 46 && game.roomy == 54) music.niceplay(15); //Final level remix + } + } +#if !defined(NO_CUSTOM_LEVELS) + else if (custommode) + { + game.roomx = rx; + game.roomy = ry; + game.roomchange = true; + if (game.roomx < 100) game.roomx = 100 + ed.mapwidth-1; + if (game.roomy < 100) game.roomy = 100 + ed.mapheight-1; + if (game.roomx > 100 + ed.mapwidth-1) game.roomx = 100; + if (game.roomy > 100 + ed.mapheight-1) game.roomy = 100; + } +#endif + else + { + game.roomx = rx; + game.roomy = ry; + game.roomchange = true; + if (game.roomx < 100) game.roomx = 119; + if (game.roomy < 100) game.roomy = 119; + if (game.roomx > 119) game.roomx = 100; + if (game.roomy > 119) game.roomy = 100; - game.currentroomdeaths = roomdeaths[game.roomx - 100 + (20 * (game.roomy - 100))]; + game.currentroomdeaths = roomdeaths[game.roomx - 100 + (20 * (game.roomy - 100))]; - //Alright, change music depending on where we are: - music.changemusicarea(game.roomx - 100, game.roomy - 100); - } - loadlevel(game.roomx, game.roomy); + //Alright, change music depending on where we are: + music.changemusicarea(game.roomx - 100, game.roomy - 100); + } + int temp = rx + (ry * 100); + loadlevel(game.roomx, game.roomy); - //Do we need to reload the background? - bool redrawbg = game.roomx != game.prevroomx || game.roomy != game.prevroomy; + //Do we need to reload the background? + bool redrawbg = game.roomx != game.prevroomx || game.roomy != game.prevroomy; - if (redrawbg) - { - graphics.backgrounddrawn = false; //Used for background caching speedup - } - graphics.foregrounddrawn = false; //Used for background caching speedup + if(redrawbg) + { + graphics.backgrounddrawn = false; //Used for background caching speedup + } + graphics.foregrounddrawn = false; //Used for background caching speedup - game.prevroomx = game.roomx; - game.prevroomy = game.roomy; + game.prevroomx = game.roomx; + game.prevroomy = game.roomy; - //a very special case: if entering the communication room, room 13,4 before tag 5 is set, set the game state to a background - //textbox thingy. if tag five is not set when changing room, reset the game state. (tag 5 is set when you get back to the ship) - if(!game.intimetrial && !custommode) - { - if (!obj.flags[5] && !finalmode) - { - game.setstate(0); - if (game.roomx == 113 && game.roomy == 104) - { - game.setstate(50); - } - } - } + //a very special case: if entering the communication room, room 13,4 before tag 5 is set, set the game state to a background + //textbox thingy. if tag five is not set when changing room, reset the game state. (tag 5 is set when you get back to the ship) + if(!game.intimetrial && !custommode) + { + if (!obj.flags[5] && !finalmode) + { + game.state = 0; + if (game.roomx == 113 && game.roomy == 104) + { + game.state = 50; + } + } + } - //Ok, kludge to fix lines in crossing rooms - if we're intersecting a gravity line right now, let's - //set it to an inactive state. + //Ok, kludge to fix lines in crossing rooms - if we're intersecting a gravity line right now, let's + //set it to an inactive state. - //Alright! So, let's look at our lines from the previous rooms, and determine if any of them are actually - //continuations! + //Alright! So, let's look at our lines from the previous rooms, and determine if any of them are actually + //continuations! - const int player_idx = obj.getplayer(); - if (INBOUNDS_VEC(player_idx, obj.entities)) - { - entclass* player = &obj.entities[player_idx]; - player->oldxp = player->xp; - player->oldyp = player->yp; - player->lerpoldxp = player->xp - int(player->vx); - player->lerpoldyp = player->yp - int(player->vy); - } + temp = obj.getplayer(); + if(INBOUNDS_VEC(temp, obj.entities)) + { + obj.entities[temp].oldxp = obj.entities[temp].xp; + obj.entities[temp].oldyp = obj.entities[temp].yp; + obj.entities[temp].lerpoldxp = obj.entities[temp].xp - int(obj.entities[temp].vx); + obj.entities[temp].lerpoldyp = obj.entities[temp].yp - int(obj.entities[temp].vy); + } - for (size_t i = 0; i < obj.entities.size(); i++) - { - if (obj.entities[i].type == EntityType_HORIZONTAL_GRAVITY_LINE) - { - //It's a horizontal line - if (obj.entities[i].xp <= 0 || obj.entities[i].xp + obj.entities[i].w >= 312) - { - //it's on a screen edge - for (size_t j = 0; j < linecrosskludge.size(); j++) - { - if (obj.entities[i].yp == linecrosskludge[j].yp) - { - //y's match, how about x's? - //we're moving left: - if (roomchangedir == 0) - { - if (obj.entities[i].xp + obj.entities[i].w >= 312 && linecrosskludge[j].xp <= 0) - { - obj.revertlinecross(linecrosskludge, i, j); - } - } - else - { - if (obj.entities[i].xp <= 0 && linecrosskludge[j].xp + linecrosskludge[j].w >= 312) - { - obj.revertlinecross(linecrosskludge, i, j); - } - } - } - } - } - } - } - - if (game.companion > 0) - { - //We've changed room? Let's bring our companion along! - spawncompanion(); - } + for (size_t i = 0; i < obj.entities.size(); i++) + { + if (obj.entities[i].type == 9) + { + //It's a horizontal line + if (obj.entities[i].xp <= 0 || obj.entities[i].xp + obj.entities[i].w >= 312) + { + //it's on a screen edge + for (size_t j = 0; j < obj.linecrosskludge.size(); j++) + { + if (obj.entities[i].yp == obj.linecrosskludge[j].yp) + { + //y's match, how about x's? + //we're moving left: + if (game.roomchangedir == 0) + { + if (obj.entities[i].xp + obj.entities[i].w >= 312 && obj.linecrosskludge[j].xp <= 0) + { + obj.revertlinecross(i, j); + } + } + else + { + if (obj.entities[i].xp <= 0 && obj.linecrosskludge[j].xp + obj.linecrosskludge[j].w >= 312) + { + obj.revertlinecross(i, j); + } + } + } + } + } + } + } } -void mapclass::spawncompanion(void) +std::string mapclass::currentarea(int t) { - int i = obj.getplayer(); - if (!INBOUNDS_VEC(i, obj.entities)) - { - return; - } - - //ok, we'll presume our companion has been destroyed in the room change. So: - switch(game.companion) - { - case 6: - { - obj.createentity(obj.entities[i].xp, 121.0f, 15.0f,1); //Y=121, the floor in that particular place! - int j = obj.getcompanion(); - if (INBOUNDS_VEC(j, obj.entities)) - { - obj.entities[j].vx = obj.entities[i].vx; - obj.entities[j].dir = obj.entities[i].dir; - } - break; - } - case 7: - if (game.roomy <= 105) //don't jump after him! - { - if (game.roomx == 110) - { - obj.createentity(320, 86, 16, 1); //Y=86, the ROOF in that particular place! - } - else - { - obj.createentity(obj.entities[i].xp, 86.0f, 16.0f, 1); //Y=86, the ROOF in that particular place! - } - int j = obj.getcompanion(); - if (INBOUNDS_VEC(j, obj.entities)) - { - obj.entities[j].vx = obj.entities[i].vx; - obj.entities[j].dir = obj.entities[i].dir; - } - } - break; - case 8: - if (game.roomy >= 104) //don't jump after him! - { - if (game.roomx == 102) - { - obj.createentity(310, 177, 17, 1); - int j = obj.getcompanion(); - if (INBOUNDS_VEC(j, obj.entities)) - { - obj.entities[j].vx = obj.entities[i].vx; - obj.entities[j].dir = obj.entities[i].dir; - } - } - else - { - obj.createentity(obj.entities[i].xp, 177.0f, 17.0f, 1); - int j = obj.getcompanion(); - if (INBOUNDS_VEC(j, obj.entities)) - { - obj.entities[j].vx = obj.entities[i].vx; - obj.entities[j].dir = obj.entities[i].dir; - } - } - } - break; - case 9: - if (!towermode) //don't go back into the tower! - { - if (game.roomx == 110 && obj.entities[i].xp<20) - { - obj.createentity(100, 185, 18, 15, 0, 1); - } - else - { - obj.createentity(obj.entities[i].xp, 185.0f, 18.0f, 15, 0, 1); - } - int j = obj.getcompanion(); - if (INBOUNDS_VEC(j, obj.entities)) - { - obj.entities[j].vx = obj.entities[i].vx; - obj.entities[j].dir = obj.entities[i].dir; - } - } - break; - case 10: - //intermission 2, choose colour based on lastsaved - if (game.roomy == 51) - { - if (!obj.flags[59]) - { - obj.createentity(225.0f, 169.0f, 18, graphics.crewcolour(game.lastsaved), 0, 10); - int j = obj.getcompanion(); - if (INBOUNDS_VEC(j, obj.entities)) - { - obj.entities[j].vx = obj.entities[i].vx; - obj.entities[j].dir = obj.entities[i].dir; - } - } - } - else if (game.roomy >= 52) - { - if (obj.flags[59]) - { - obj.createentity(160.0f, 177.0f, 18, graphics.crewcolour(game.lastsaved), 0, 18, 1); - int j = obj.getcompanion(); - if (INBOUNDS_VEC(j, obj.entities)) - { - obj.entities[j].vx = obj.entities[i].vx; - obj.entities[j].dir = obj.entities[i].dir; - } - } - else - { - obj.flags[59] = true; - obj.createentity(obj.entities[i].xp, -20.0f, 18.0f, graphics.crewcolour(game.lastsaved), 0, 10, 0); - int j = obj.getcompanion(); - if (INBOUNDS_VEC(j, obj.entities)) - { - obj.entities[j].vx = obj.entities[i].vx; - obj.entities[j].dir = obj.entities[i].dir; - } - } - } - break; - case 11: - //Intermission 1: We're using the SuperCrewMate instead! - if(game.roomx-41==game.scmprogress) - { - switch(game.scmprogress) - { - case 0: - obj.createentity(76, 161, 24, graphics.crewcolour(game.lastsaved), 2); - break; - case 1: - obj.createentity(10, 169, 24, graphics.crewcolour(game.lastsaved), 2); - break; - case 2: - obj.createentity(10, 177, 24, graphics.crewcolour(game.lastsaved), 2); - break; - case 3: - obj.createentity(10, 177, 24, graphics.crewcolour(game.lastsaved), 2); - break; - case 4: - obj.createentity(10, 185, 24, graphics.crewcolour(game.lastsaved), 2); - break; - case 5: - obj.createentity(10, 185, 24, graphics.crewcolour(game.lastsaved), 2); - break; - case 6: - obj.createentity(10, 185, 24, graphics.crewcolour(game.lastsaved), 2); - break; - case 7: - obj.createentity(10, 41, 24, graphics.crewcolour(game.lastsaved), 2); - break; - case 8: - obj.createentity(10, 169, 24, graphics.crewcolour(game.lastsaved), 2); - break; - case 9: - obj.createentity(10, 169, 24, graphics.crewcolour(game.lastsaved), 2); - break; - case 10: - obj.createentity(10, 129, 24, graphics.crewcolour(game.lastsaved), 2); - break; - case 11: - obj.createentity(10, 129, 24, graphics.crewcolour(game.lastsaved), 2); - break; - case 12: - obj.createentity(10, 65, 24, graphics.crewcolour(game.lastsaved), 2); - break; - case 13: - obj.createentity(10, 177, 24, graphics.crewcolour(game.lastsaved)); - break; - } - } - break; - } -} - -const char* mapclass::currentarea(const int roomx, const int roomy) -{ - /* For translation, the returned value is passed to loc::gettext_roomname_special(). - * Returned strings must therefore be found in roomnames_special.xml! */ - - if (roomx >= 102 && roomx <= 104 && roomy >= 110 && roomy <= 111) - { - return "The Ship"; - } - - switch (area(roomx, roomy)) - { - case 0: - return "Dimension VVVVVV"; - break; - case 1: - return "Dimension VVVVVV"; - break; - case 2: - return "Laboratory"; - break; - case 3: - return "The Tower"; - break; - case 4: - return "Warp Zone"; - break; - case 5: - return "Space Station"; - break; - case 6: - return "Outside Dimension VVVVVV"; - break; - case 7: - return "Outside Dimension VVVVVV"; - break; - case 8: - return "Outside Dimension VVVVVV"; - break; - case 9: - return "Outside Dimension VVVVVV"; - break; - case 10: - return "Outside Dimension VVVVVV"; - break; - case 11: - return "The Tower"; - break; - } - return "???"; + switch(t) + { + case 0: + return "Dimension VVVVVV"; + break; + case 1: + return "Dimension VVVVVV"; + break; + case 2: + return "Laboratory"; + break; + case 3: + return "The Tower"; + break; + case 4: + return "Warp Zone"; + break; + case 5: + return "Space Station"; + break; + case 6: + return "Outside Dimension VVVVVV"; + break; + case 7: + return "Outside Dimension VVVVVV"; + break; + case 8: + return "Outside Dimension VVVVVV"; + break; + case 9: + return "Outside Dimension VVVVVV"; + break; + case 10: + return "Outside Dimension VVVVVV"; + break; + case 11: + return "The Tower"; + break; + } + return "???"; } static void copy_short_to_int(int* dest, const short* src, const size_t size) { - size_t i; - for (i = 0; i < size; ++i) - { - dest[i] = src[i]; - } + size_t i; + for (i = 0; i < size; ++i) + { + dest[i] = src[i]; + } } void mapclass::loadlevel(int rx, int ry) { - int t; - if (revealmap) - { - if (!finalmode) - { - setexplored(rx - 100, ry - 100, true); - if (rx == 109 && !custommode) - { - exploretower(); - } - } - } + int t; + if (!finalmode) + { + setexplored(rx - 100, ry - 100, true); + if (rx == 109 && !custommode) + { + exploretower(); + } + } - roomtexton = false; - roomtext.clear(); - roomnameset = false; + roomtexton = false; + roomtext.clear(); - obj.platformtile = 0; - obj.customplatformtile=0; - obj.vertplatforms = false; - obj.horplatforms = false; - setroomname(""); - hiddenname = ""; - background = 1; - warpx = false; - warpy = false; + obj.platformtile = 0; + obj.customplatformtile=0; + obj.vertplatforms = false; + obj.horplatforms = false; + roomname = ""; + hiddenname = ""; + background = 1; + warpx = false; + warpy = false; - towermode = false; - ypos = 0; - oldypos = 0; - extrarow = 0; - spikeleveltop = 0; - spikelevelbottom = 0; - oldspikeleveltop = 0; - oldspikelevelbottom = 0; + towermode = false; + ypos = 0; + oldypos = 0; + extrarow = 0; + spikeleveltop = 0; + spikelevelbottom = 0; + oldspikeleveltop = 0; + oldspikelevelbottom = 0; - //Custom stuff for warplines - obj.customwarpmode=false; - obj.customwarpmodevon=false; - obj.customwarpmodehon=false; + //Custom stuff for warplines + obj.customwarpmode=false; + obj.customwarpmodevon=false; + obj.customwarpmodehon=false; - if (finalmode) - { - t = 6; - //check if we're in the towers - if (rx == 49 && ry == 52) - { - //entered tower 1 - t = 7; - } - else if (rx == 49 && ry == 53) - { - //re entered tower 1 - t = 8; - } - else if (rx == 51 && ry == 54) - { - //entered tower 2 - t = 9; - } - else if (rx == 51 && ry == 53) - { - //re entered tower 2 - t = 10; - } - } - else if (custommode) - { - t= 12; - } - else - { - t = area(rx, ry); + if (finalmode) + { + t = 6; + //check if we're in the towers + if (rx == 49 && ry == 52) + { + //entered tower 1 + t = 7; + } + else if (rx == 49 && ry == 53) + { + //re entered tower 1 + t = 8; + } + else if (rx == 51 && ry == 54) + { + //entered tower 2 + t = 9; + } + else if (rx == 51 && ry == 53) + { + //re entered tower 2 + t = 10; + } + } + else if (custommode) + { + t= 12; + } + else + { + t = area(rx, ry); - if (t == 3) - { - //correct position for tower - if (ry == 109) - { - //entered from ground floor - int player = obj.getplayer(); - if (INBOUNDS_VEC(player, obj.entities)) - { - obj.entities[player].yp += (671 * 8); - } + if (t == 3) + { + //correct position for tower + if (ry == 109) + { + //entered from ground floor + int player = obj.getplayer(); + if (INBOUNDS_VEC(player, obj.entities)) + { + obj.entities[player].yp += (671 * 8); + } - ypos = (700-29) * 8; - oldypos = ypos; - setbgobjlerp(graphics.towerbg); - cameramode = 0; - graphics.towerbg.colstate = 0; - colsuperstate = 0; - } - else if (ry == 104) - { - //you've entered from the top floor - ypos = 0; - oldypos = ypos; - setbgobjlerp(graphics.towerbg); - cameramode = 0; - graphics.towerbg.colstate = 0; - colsuperstate = 0; - } - } + ypos = (700-29) * 8; + oldypos = ypos; + setbgobjlerp(graphics.towerbg); + cameramode = 0; + graphics.towerbg.colstate = 0; + colsuperstate = 0; + } + else if (ry == 104) + { + //you've entered from the top floor + ypos = 0; + oldypos = ypos; + setbgobjlerp(graphics.towerbg); + cameramode = 0; + graphics.towerbg.colstate = 0; + colsuperstate = 0; + } + } - if (t < 2) //on the world map, want to test if we're in the secret lab - { - if (rx >= 116) - { - if (ry >= 105) - { - if (ry <= 107) - { - if (rx == 119 && ry == 105) - { - //Ah, this is just a normal area - } - else - { - //in the secret lab! Crazy background! - background = 2; - if (rx == 116 && ry == 105) graphics.rcol = 1; - if (rx == 117 && ry == 105) graphics.rcol = 5; - if (rx == 118 && ry == 105) graphics.rcol = 4; - if (rx == 117 && ry == 106) graphics.rcol = 2; - if (rx == 118 && ry == 106) graphics.rcol = 0; - if (rx == 119 && ry == 106) graphics.rcol = 3; - if (rx == 119 && ry == 107) graphics.rcol = 1; - } - } - } - } - } - } + if (t < 2) //on the world map, want to test if we're in the secret lab + { + if (rx >= 116) + { + if (ry >= 105) + { + if (ry <= 107) + { + if (rx == 119 && ry == 105) + { + //Ah, this is just a normal area + } + else + { + //in the secret lab! Crazy background! + background = 2; + if (rx == 116 && ry == 105) graphics.rcol = 1; + if (rx == 117 && ry == 105) graphics.rcol = 5; + if (rx == 118 && ry == 105) graphics.rcol = 4; + if (rx == 117 && ry == 106) graphics.rcol = 2; + if (rx == 118 && ry == 106) graphics.rcol = 0; + if (rx == 119 && ry == 106) graphics.rcol = 3; + if (rx == 119 && ry == 107) graphics.rcol = 1; + } + } + } + } + } + } - if (rx == 119 && ry == 108 && !custommode) - { - background = 5; - graphics.rcol = 3; - warpx = true; - warpy = true; - } + if (rx == 119 && ry == 108 && !custommode) + { + background = 5; + graphics.rcol = 3; + warpx = true; + warpy = true; + } - roomname_special = false; + switch(t) + { +#if !defined(MAKEANDPLAY) + case 0: + case 1: //World Map + { + tileset = 1; + extrarow = 1; + const short* tmap = otherlevel.loadlevel(rx, ry); + copy_short_to_int(contents, tmap, SDL_arraysize(contents)); + roomname = otherlevel.roomname; + hiddenname = otherlevel.hiddenname; + tileset = otherlevel.roomtileset; + break; + } + case 2: //The Lab + { + const short* tmap = lablevel.loadlevel(rx, ry); + copy_short_to_int(contents, tmap, SDL_arraysize(contents)); + roomname = lablevel.roomname; + tileset = 1; + background = 2; + graphics.rcol = lablevel.rcol; + break; + } + case 3: //The Tower + graphics.towerbg.tdrawback = true; + minitowermode = false; + tower.minitowermode = false; + graphics.towerbg.scrolldir = 0; + setbgobjlerp(graphics.towerbg); - switch(t) - { -#ifdef MAKEANDPLAY - UNUSED(copy_short_to_int); -#else - case 0: - case 1: //World Map - { - tileset = 1; - extrarow = 1; - const short* tmap = otherlevel.loadlevel(rx, ry); - copy_short_to_int(contents, tmap, SDL_arraysize(contents)); - setroomname(otherlevel.roomname); - roomname_special = otherlevel.roomname_special; - hiddenname = otherlevel.hiddenname; - tileset = otherlevel.roomtileset; - break; - } - case 2: //The Lab - { - const short* tmap = lablevel.loadlevel(rx, ry); - copy_short_to_int(contents, tmap, SDL_arraysize(contents)); - setroomname(lablevel.roomname); - roomname_special = lablevel.roomname_special; - tileset = 1; - background = 2; - graphics.rcol = lablevel.rcol; - break; - } - case 3: //The Tower - graphics.towerbg.tdrawback = true; - minitowermode = false; - tower.minitowermode = false; - graphics.towerbg.scrolldir = 0; - setbgobjlerp(graphics.towerbg); + roomname = "The Tower"; + tileset = 1; + background = 3; + towermode = true; - setroomname("The Tower"); - tileset = 1; - background = 3; - towermode = true; - - //All the entities for here are just loaded here; it's essentially one room after all + //All the entities for here are just loaded here; it's essentially one room after all - obj.createentity(48, 5456, 10, 1, 505007); // (savepoint) - obj.createentity(224, 4528, 10, 1, 505017); // (savepoint) - obj.createentity(232, 4168, 10, 0, 505027); // (savepoint) - obj.createentity(280, 3816, 10, 1, 505037); // (savepoint) - obj.createentity(152, 3552, 10, 1, 505047); // (savepoint) - obj.createentity(216, 3280, 10, 0, 505057); // (savepoint) - obj.createentity(216, 4808, 10, 1, 505067); // (savepoint) - obj.createentity(72, 3096, 10, 0, 505077); // (savepoint) - obj.createentity(176, 2600, 10, 0, 505087); // (savepoint) - obj.createentity(216, 2392, 10, 0, 505097); // (savepoint) - obj.createentity(152, 1184, 10, 1, 505107); // (savepoint) - obj.createentity(152, 912, 10, 1, 505117); // (savepoint) - obj.createentity(152, 536, 10, 1, 505127); // (savepoint) - obj.createentity(120, 5136, 10, 0, 505137); // (savepoint) - obj.createentity(144, 1824, 10, 0, 505147); // (savepoint) - obj.createentity(72, 2904, 10, 0, 505157); // (savepoint) - obj.createentity(224, 1648, 10, 1, 505167); // (savepoint) - obj.createentity(112, 5280, 10, 1, 50517); // (savepoint) + obj.createentity(48, 5456, 10, 1, 505007); // (savepoint) + obj.createentity(224, 4528, 10, 1, 505017); // (savepoint) + obj.createentity(232, 4168, 10, 0, 505027); // (savepoint) + obj.createentity(280, 3816, 10, 1, 505037); // (savepoint) + obj.createentity(152, 3552, 10, 1, 505047); // (savepoint) + obj.createentity(216, 3280, 10, 0, 505057); // (savepoint) + obj.createentity(216, 4808, 10, 1, 505067); // (savepoint) + obj.createentity(72, 3096, 10, 0, 505077); // (savepoint) + obj.createentity(176, 2600, 10, 0, 505087); // (savepoint) + obj.createentity(216, 2392, 10, 0, 505097); // (savepoint) + obj.createentity(152, 1184, 10, 1, 505107); // (savepoint) + obj.createentity(152, 912, 10, 1, 505117); // (savepoint) + obj.createentity(152, 536, 10, 1, 505127); // (savepoint) + obj.createentity(120, 5136, 10, 0, 505137); // (savepoint) + obj.createentity(144, 1824, 10, 0, 505147); // (savepoint) + obj.createentity(72, 2904, 10, 0, 505157); // (savepoint) + obj.createentity(224, 1648, 10, 1, 505167); // (savepoint) + obj.createentity(112, 5280, 10, 1, 50517); // (savepoint) - obj.createentity(24, 4216, 9, 7); // (shiny trinket) - obj.createentity(280, 3216, 9, 8); // (shiny trinket) - break; - case 4: //The Warpzone - { - const short* tmap = warplevel.loadlevel(rx, ry); - copy_short_to_int(contents, tmap, SDL_arraysize(contents)); - setroomname(warplevel.roomname); - roomname_special = warplevel.roomname_special; - tileset = 1; - background = 3; - graphics.rcol = warplevel.rcol; - graphics.backgrounddrawn = false; + obj.createentity(24, 4216, 9, 7); // (shiny trinket) + obj.createentity(280, 3216, 9, 8); // (shiny trinket) + break; + case 4: //The Warpzone + { + const short* tmap = warplevel.loadlevel(rx, ry); + copy_short_to_int(contents, tmap, SDL_arraysize(contents)); + roomname = warplevel.roomname; + tileset = 1; + background = 3; + graphics.rcol = warplevel.rcol; + graphics.backgrounddrawn = false; - warpx = warplevel.warpx; - warpy = warplevel.warpy; - background = 5; - if (warpy) background = 4; - if (warpx) background = 3; - if (warpx && warpy) background = 5; - break; - } - case 5: //Space station - { - const short* tmap = spacestation2.loadlevel(rx, ry); - copy_short_to_int(contents, tmap, SDL_arraysize(contents)); - setroomname(spacestation2.roomname); - roomname_special = spacestation2.roomname_special; - tileset = 0; - break; - } - case 6: //final level - { - const short* tmap = finallevel.loadlevel(rx, ry); - copy_short_to_int(contents, tmap, SDL_arraysize(contents)); - setroomname(finallevel.roomname); - roomname_special = finallevel.roomname_special; - tileset = 1; - background = 3; - graphics.backgrounddrawn = false; + warpx = warplevel.warpx; + warpy = warplevel.warpy; + background = 5; + if (warpy) background = 4; + if (warpx) background = 3; + if (warpx && warpy) background = 5; + break; + } + case 5: //Space station + { + const short* tmap = spacestation2.loadlevel(rx, ry); + copy_short_to_int(contents, tmap, SDL_arraysize(contents)); + roomname = spacestation2.roomname; + tileset = 0; + break; + } + case 6: //final level + { + const short* tmap = finallevel.loadlevel(rx, ry); + copy_short_to_int(contents, tmap, SDL_arraysize(contents)); + roomname = finallevel.roomname; + tileset = 1; + background = 3; + graphics.backgrounddrawn = false; - if (finalstretch) - { - background = 6; - } - else - { - warpx = finallevel.warpx; - warpy = finallevel.warpy; - background = 5; - if (warpy) background = 4; - if (warpx) background = 3; - if (warpx && warpy) background = 5; - } + if (finalstretch) + { + background = 6; + } + else + { + warpx = finallevel.warpx; + warpy = finallevel.warpy; + background = 5; + if (warpy) background = 4; + if (warpx) background = 3; + if (warpx && warpy) background = 5; + } - graphics.rcol = 6; - changefinalcol(final_mapcol); - break; - } - case 7: //Final Level, Tower 1 - graphics.towerbg.tdrawback = true; - minitowermode = true; - tower.minitowermode = true; - graphics.towerbg.scrolldir = 1; - setbgobjlerp(graphics.towerbg); + graphics.rcol = 6; + changefinalcol(final_mapcol); + break; + } + case 7: //Final Level, Tower 1 + graphics.towerbg.tdrawback = true; + minitowermode = true; + tower.minitowermode = true; + graphics.towerbg.scrolldir = 1; + setbgobjlerp(graphics.towerbg); - setroomname("Panic Room"); - tileset = 1; - background = 3; - towermode = true; + roomname = "Panic Room"; + tileset = 1; + background = 3; + towermode = true; - tower.loadminitower1(); + tower.loadminitower1(); - ypos = 0; - oldypos = 0; - setbgobjlerp(graphics.towerbg); - cameramode = 0; - graphics.towerbg.colstate = 0; - colsuperstate = 0; - break; - case 8: //Final Level, Tower 1 (reentered from below) - { - graphics.towerbg.tdrawback = true; - minitowermode = true; - tower.minitowermode = true; - graphics.towerbg.scrolldir = 1; - setbgobjlerp(graphics.towerbg); + ypos = 0; + oldypos = 0; + setbgobjlerp(graphics.towerbg); + cameramode = 0; + graphics.towerbg.colstate = 0; + colsuperstate = 0; + break; + case 8: //Final Level, Tower 1 (reentered from below) + { + graphics.towerbg.tdrawback = true; + minitowermode = true; + tower.minitowermode = true; + graphics.towerbg.scrolldir = 1; + setbgobjlerp(graphics.towerbg); - setroomname("Panic Room"); - tileset = 1; - background = 3; - towermode = true; + roomname = "Panic Room"; + tileset = 1; + background = 3; + towermode = true; - tower.loadminitower1(); + tower.loadminitower1(); - int i = obj.getplayer(); - if (INBOUNDS_VEC(i, obj.entities)) - { - obj.entities[i].yp += (71 * 8); - } - game.roomy--; + int i = obj.getplayer(); + if (INBOUNDS_VEC(i, obj.entities)) + { + obj.entities[i].yp += (71 * 8); + } + game.roomy--; - ypos = (100-29) * 8; - oldypos = ypos; - setbgobjlerp(graphics.towerbg); - cameramode = 0; - graphics.towerbg.colstate = 0; - colsuperstate = 0;} - break; - case 9: //Final Level, Tower 2 - { - graphics.towerbg.tdrawback = true; - minitowermode = true; - tower.minitowermode = true; - graphics.towerbg.scrolldir = 0; - setbgobjlerp(graphics.towerbg); + ypos = (100-29) * 8; + oldypos = ypos; + setbgobjlerp(graphics.towerbg); + cameramode = 0; + graphics.towerbg.colstate = 0; + colsuperstate = 0;} + break; + case 9: //Final Level, Tower 2 + { + graphics.towerbg.tdrawback = true; + minitowermode = true; + tower.minitowermode = true; + graphics.towerbg.scrolldir = 0; + setbgobjlerp(graphics.towerbg); - setroomname("The Final Challenge"); - tileset = 1; - background = 3; - towermode = true; + roomname = "The Final Challenge"; + tileset = 1; + background = 3; + towermode = true; - tower.loadminitower2(); + tower.loadminitower2(); - obj.createentity(56, 556, 11, 136); // (horizontal gravity line) - obj.createentity(184, 592, 10, 0, 50500); // (savepoint) - obj.createentity(184, 644, 11, 88); // (horizontal gravity line) - obj.createentity(56, 460, 11, 136); // (horizontal gravity line) - obj.createentity(216, 440, 10, 0, 50501); // (savepoint) - obj.createentity(104, 508, 11, 168); // (horizontal gravity line) - obj.createentity(219, 264, 12, 56); // (vertical gravity line) - obj.createentity(120, 332, 11, 96); // (horizontal gravity line) - obj.createentity(219, 344, 12, 56); // (vertical gravity line) - obj.createentity(224, 332, 11, 48); // (horizontal gravity line) - obj.createentity(56, 212, 11, 144); // (horizontal gravity line) - obj.createentity(32, 20, 11, 96); // (horizontal gravity line) - obj.createentity(72, 156, 11, 200); // (horizontal gravity line) + obj.createentity(56, 556, 11, 136); // (horizontal gravity line) + obj.createentity(184, 592, 10, 0, 50500); // (savepoint) + obj.createentity(184, 644, 11, 88); // (horizontal gravity line) + obj.createentity(56, 460, 11, 136); // (horizontal gravity line) + obj.createentity(216, 440, 10, 0, 50501); // (savepoint) + obj.createentity(104, 508, 11, 168); // (horizontal gravity line) + obj.createentity(219, 264, 12, 56); // (vertical gravity line) + obj.createentity(120, 332, 11, 96); // (horizontal gravity line) + obj.createentity(219, 344, 12, 56); // (vertical gravity line) + obj.createentity(224, 332, 11, 48); // (horizontal gravity line) + obj.createentity(56, 212, 11, 144); // (horizontal gravity line) + obj.createentity(32, 20, 11, 96); // (horizontal gravity line) + obj.createentity(72, 156, 11, 200); // (horizontal gravity line) - int i = obj.getplayer(); - if (INBOUNDS_VEC(i, obj.entities)) - { - obj.entities[i].yp += (71 * 8); - } - game.roomy--; + int i = obj.getplayer(); + if (INBOUNDS_VEC(i, obj.entities)) + { + obj.entities[i].yp += (71 * 8); + } + game.roomy--; - ypos = (100-29) * 8; - oldypos = ypos; - setbgobjlerp(graphics.towerbg); - cameramode = 0; - graphics.towerbg.colstate = 0; - colsuperstate = 0; - break; - } - case 10: //Final Level, Tower 2 - { + ypos = (100-29) * 8; + oldypos = ypos; + setbgobjlerp(graphics.towerbg); + cameramode = 0; + graphics.towerbg.colstate = 0; + colsuperstate = 0; + break; + } + case 10: //Final Level, Tower 2 + { - graphics.towerbg.tdrawback = true; - minitowermode = true; - tower.minitowermode = true; - graphics.towerbg.scrolldir = 0; - setbgobjlerp(graphics.towerbg); + graphics.towerbg.tdrawback = true; + minitowermode = true; + tower.minitowermode = true; + graphics.towerbg.scrolldir = 0; + setbgobjlerp(graphics.towerbg); - setroomname("The Final Challenge"); - tileset = 1; - background = 3; - towermode = true; + roomname = "The Final Challenge"; + tileset = 1; + background = 3; + towermode = true; - tower.loadminitower2(); + tower.loadminitower2(); - obj.createentity(56, 556, 11, 136); // (horizontal gravity line) - obj.createentity(184, 592, 10, 0, 50500); // (savepoint) - obj.createentity(184, 644, 11, 88); // (horizontal gravity line) - obj.createentity(56, 460, 11, 136); // (horizontal gravity line) - obj.createentity(216, 440, 10, 0, 50501); // (savepoint) - obj.createentity(104, 508, 11, 168); // (horizontal gravity line) - obj.createentity(219, 264, 12, 56); // (vertical gravity line) - obj.createentity(120, 332, 11, 96); // (horizontal gravity line) - obj.createentity(219, 344, 12, 56); // (vertical gravity line) - obj.createentity(224, 332, 11, 48); // (horizontal gravity line) - obj.createentity(56, 212, 11, 144); // (horizontal gravity line) - obj.createentity(32, 20, 11, 96); // (horizontal gravity line) - obj.createentity(72, 156, 11, 200); // (horizontal gravity line) + obj.createentity(56, 556, 11, 136); // (horizontal gravity line) + obj.createentity(184, 592, 10, 0, 50500); // (savepoint) + obj.createentity(184, 644, 11, 88); // (horizontal gravity line) + obj.createentity(56, 460, 11, 136); // (horizontal gravity line) + obj.createentity(216, 440, 10, 0, 50501); // (savepoint) + obj.createentity(104, 508, 11, 168); // (horizontal gravity line) + obj.createentity(219, 264, 12, 56); // (vertical gravity line) + obj.createentity(120, 332, 11, 96); // (horizontal gravity line) + obj.createentity(219, 344, 12, 56); // (vertical gravity line) + obj.createentity(224, 332, 11, 48); // (horizontal gravity line) + obj.createentity(56, 212, 11, 144); // (horizontal gravity line) + obj.createentity(32, 20, 11, 96); // (horizontal gravity line) + obj.createentity(72, 156, 11, 200); // (horizontal gravity line) - ypos = 0; - oldypos = 0; - setbgobjlerp(graphics.towerbg); - cameramode = 0; - graphics.towerbg.colstate = 0; - colsuperstate = 0; - break; - } - case 11: //Tower Hallways //Content is held in final level routine - { - const short* tmap = finallevel.loadlevel(rx, ry); - copy_short_to_int(contents, tmap, SDL_arraysize(contents)); - setroomname(finallevel.roomname); - roomname_special = finallevel.roomname_special; - tileset = 2; - if (rx == 108) - { - background = 7; - rcol = 15; - } - if (rx == 110) - { - background = 8; - rcol = 10; - } - if (rx == 111) - { - background = 9; - rcol = 0; - } - break; - } + ypos = 0; + oldypos = 0; + setbgobjlerp(graphics.towerbg); + cameramode = 0; + graphics.towerbg.colstate = 0; + colsuperstate = 0; + break; + } + case 11: //Tower Hallways //Content is held in final level routine + { + const short* tmap = finallevel.loadlevel(rx, ry); + copy_short_to_int(contents, tmap, SDL_arraysize(contents)); + roomname = finallevel.roomname; + tileset = 2; + if (rx == 108) + { + background = 7; + rcol = 15; + } + if (rx == 110) + { + background = 8; + rcol = 10; + } + if (rx == 111) + { + background = 9; + rcol = 0; + } + break; + } #endif - case 12: //Custom level - { - const RoomProperty* const room = cl.getroomprop(rx - 100, ry - 100); - game.customcol = cl.getlevelcol(room->tileset, room->tilecol) + 1; - obj.customplatformtile = game.customcol * 12; +#if !defined(NO_CUSTOM_LEVELS) + case 12: //Custom level + { + const edlevelclass* const room = ed.getroomprop(rx - 100, ry - 100); + game.customcol = ed.getlevelcol(room->tileset, room->tilecol) + 1; + obj.customplatformtile = game.customcol * 12; - switch (room->tileset) - { - case 0: // Space Station - tileset = 0; - background = 1; - break; - case 1: // Outside - tileset = 1; - background = 1; - break; - case 2: // Lab - tileset = 1; - background = 2; - graphics.rcol = room->tilecol; - break; - case 3: // Warp Zone/intermission - tileset = 1; - background = 6; - break; - case 4: // Ship - tileset = 1; - background = 1; - break; - default: - tileset = 1; - background = 1; - break; - } + switch (room->tileset) + { + case 0: // Space Station + tileset = 0; + background = 1; + break; + case 1: // Outside + tileset = 1; + background = 1; + break; + case 2: // Lab + tileset = 1; + background = 2; + graphics.rcol = room->tilecol; + break; + case 3: // Warp Zone/intermission + tileset = 1; + background = 6; + break; + case 4: // Ship + tileset = 1; + background = 1; + break; + default: + tileset = 1; + background = 1; + break; + } - // If screen warping, then override all that: - bool redrawbg = game.roomx != game.prevroomx || game.roomy != game.prevroomy; - if (redrawbg) - { - graphics.backgrounddrawn = false; - } + // If screen warping, then override all that: + bool redrawbg = game.roomx != game.prevroomx || game.roomy != game.prevroomy; + if (redrawbg) + { + graphics.backgrounddrawn = false; + } - switch (room->warpdir) - { - case 1: - warpx = true; - background = 3; - graphics.rcol = cl.getwarpbackground(rx - 100, ry - 100); - break; - case 2: - warpy = true; - background = 4; - graphics.rcol = cl.getwarpbackground(rx - 100, ry - 100); - break; - case 3: - warpx = true; - warpy = true; - background = 5; - graphics.rcol = cl.getwarpbackground(rx - 100, ry - 100); - break; - } + switch (room->warpdir) + { + case 1: + warpx = true; + background = 3; + graphics.rcol = ed.getwarpbackground(rx - 100, ry - 100); + break; + case 2: + warpy = true; + background = 4; + graphics.rcol = ed.getwarpbackground(rx - 100, ry - 100); + break; + case 3: + warpx = true; + warpy = true; + background = 5; + graphics.rcol = ed.getwarpbackground(rx - 100, ry - 100); + break; + } - setroomname(room->roomname.c_str()); - extrarow = 1; - const int* tmap = cl.loadlevel(rx, ry); - SDL_memcpy(contents, tmap, sizeof(contents)); + roomname = room->roomname; + extrarow = 1; + const int* tmap = ed.loadlevel(rx, ry); + SDL_memcpy(contents, tmap, sizeof(contents)); - roomtexton = false; - roomtext.clear(); + roomtexton = false; + roomtext.clear(); - // Entities have to be created HERE, akwardly - int tempcheckpoints = 0; - int tempscriptbox = 0; - for (size_t edi = 0; edi < customentities.size(); edi++) - { - // If entity is in this room, create it - const CustomEntity& ent = customentities[edi]; - if (ent.rx != rx - 100 || ent.ry != ry - 100) - { - continue; - } + // Entities have to be created HERE, akwardly + int tempcheckpoints = 0; + int tempscriptbox = 0; + for (size_t edi = 0; edi < edentity.size(); edi++) + { + // If entity is in this room, create it + const edentities& ent = edentity[edi]; + const int tsx = ent.x / 40; + const int tsy = ent.y / 30; - const int ex = ent.x * 8; - const int ey = ent.y * 8; + if (tsx != rx-100 || tsy != ry-100) + { + continue; + } - // Platform and enemy bounding boxes - int bx1 = 0, by1 = 0, bx2 = 0, by2 = 0; + const int ex = (ent.x % 40) * 8; + const int ey = (ent.y % 30) * 8; - bool enemy = ent.t == 1; - bool moving_plat = ent.t == 2 && ent.p1 <= 4; - if (enemy || moving_plat) - { - if (enemy) - { - bx1 = room->enemyx1; - by1 = room->enemyy1; - bx2 = room->enemyx2; - by2 = room->enemyy2; - } - else if (moving_plat) - { - bx1 = room->platx1; - by1 = room->platy1; - bx2 = room->platx2; - by2 = room->platy2; - } + // Platform and enemy bounding boxes + int bx1 = 0, by1 = 0, bx2 = 0, by2 = 0; - // Enlarge bounding boxes to fix warping entities - if (warpx && bx1 == 0 && bx2 == 320) - { - bx1 -= 100; - bx2 += 100; - } - if (warpy && by1 == 0 && by2 == 240) - { - by1 -= 100; - by2 += 100; - } - } + bool enemy = ent.t == 1; + bool moving_plat = ent.t == 2 && ent.p1 <= 4; + if (enemy || moving_plat) + { + if (enemy) + { + bx1 = room->enemyx1; + by1 = room->enemyy1; + bx2 = room->enemyx2; + by2 = room->enemyy2; + } + else if (moving_plat) + { + bx1 = room->platx1; + by1 = room->platy1; + bx2 = room->platx2; + by2 = room->platy2; + } - switch (ent.t) - { - case 1: // Enemies - obj.customenemy = room->enemytype; - obj.createentity(ex, ey, 56, ent.p1, 4 + room->enemyv, bx1, by1, bx2, by2); - break; - case 2: // Platforms and conveyors - if (ent.p1 <= 4) - { - obj.createentity(ex, ey, 2, ent.p1, room->platv, bx1, by1, bx2, by2); - } - else if (ent.p1 >= 5 && ent.p1 <= 8) // Conveyor - { - obj.createentity(ex, ey, 2, ent.p1 + 3, 4); - } - break; - case 3: // Disappearing platforms - obj.createentity(ex, ey, 3); - break; - case 9: // Trinkets - obj.createentity(ex, ey, 9, cl.findtrinket(edi)); - break; - case 10: // Checkpoints - obj.createentity(ex, ey, 10, ent.p1, (rx + ry*100) * 20 + tempcheckpoints); - tempcheckpoints++; - break; - case 11: // Gravity Lines - if (ent.p1 == 0) //Horizontal - { - obj.createentity(ent.p2 * 8, ey + 4, 11, ent.p3); - } - else //Vertical - { - obj.createentity(ex + 3, ent.p2 * 8, 12, ent.p3); - } - break; - case 13: // Warp Tokens - obj.createentity(ex, ey, 13, ent.p1, ent.p2); - break; - case 15: // Collectable crewmate - obj.createentity(ex - 4, ey + 1, 55, cl.findcrewmate(edi), ent.p1, ent.p2); - break; - case 17: // Roomtext! - { - roomtexton = true; - Roomtext text; - text.x = ex / 8; - text.y = ey / 8; - text.text = ent.scriptname.c_str(); - text.rtl = ent.p1; - roomtext.push_back(text); - break; - } - case 18: // Terminals - { - obj.customscript = ent.scriptname; + // Enlarge bounding boxes to fix warping entities + if (warpx && bx1 == 0 && bx2 == 320) + { + bx1 -= 100; + bx2 += 100; + } + if (warpy && by1 == 0 && by2 == 240) + { + by1 -= 100; + by2 += 100; + } + } - int usethistile = ent.p1; - int usethisy = ey; + switch (ent.t) + { + case 1: // Enemies + obj.customenemy = room->enemytype; + obj.createentity(ex, ey, 56, ent.p1, 4, bx1, by1, bx2, by2); + break; + case 2: // Platforms and conveyors + if (ent.p1 <= 4) + { + obj.createentity(ex, ey, 2, ent.p1, room->platv, bx1, by1, bx2, by2); + } + else if (ent.p1 >= 5 && ent.p1 <= 8) // Conveyor + { + obj.createentity(ex, ey, 2, ent.p1 + 3, 4); + } + break; + case 3: // Disappearing platforms + obj.createentity(ex, ey, 3); + break; + case 9: // Trinkets + obj.createentity(ex, ey, 9, ed.findtrinket(edi)); + break; + case 10: // Checkpoints + obj.createentity(ex, ey, 10, ent.p1, (rx + ry*100) * 20 + tempcheckpoints); + tempcheckpoints++; + break; + case 11: // Gravity Lines + if (ent.p1 == 0) //Horizontal + { + obj.createentity(ent.p2 * 8, ey + 4, 11, ent.p3); + } + else //Vertical + { + obj.createentity(ex + 3, ent.p2 * 8, 12, ent.p3); + } + break; + case 13: // Warp Tokens + obj.createentity(ex, ey, 13, ent.p1, ent.p2); + break; + case 15: // Collectable crewmate + obj.createentity(ex - 4, ey + 1, 55, ed.findcrewmate(edi), ent.p1, ent.p2); + break; + case 17: // Roomtext! + { + roomtexton = true; + Roomtext text; + text.x = ex / 8; + text.y = ey / 8; + text.text = ent.scriptname; + roomtext.push_back(text); + break; + } + case 18: // Terminals + { + obj.customscript = ent.scriptname; - // This isn't a boolean: we just swap 0 and 1 around and leave the rest alone - if (usethistile == 0) - { - usethistile = 1; // Unflipped - } - else if (usethistile == 1) - { - usethistile = 0; // Flipped; - usethisy -= 8; - } + int usethistile = ent.p1; + int usethisy = ey; - obj.createentity(ex, usethisy + 8, 20 + SDL_clamp(ent.p2, 0, 1), usethistile); + // This isn't a boolean: we just swap 0 and 1 around and leave the rest alone + if (usethistile == 0) + { + usethistile = 1; // Unflipped + } + else if (usethistile == 1) + { + usethistile = 0; // Flipped; + usethisy -= 8; + } - for (size_t i = 0; i < script.customscripts.size(); i++) - { - if (script.customscripts[i].name == obj.customscript) - { - obj.createblock(ACTIVITY, ex - 8, usethisy + 8, 20, 16, 35); - break; - } - } - break; - } - case 19: //Script Box - if (INBOUNDS_ARR(tempscriptbox, game.customscript)) - { - game.customscript[tempscriptbox] = ent.scriptname; - } - obj.createblock(TRIGGER, ex, ey, ent.p1 * 8, ent.p2 * 8, 300 + tempscriptbox, "custom_" + ent.scriptname); - tempscriptbox++; - break; - case 50: // Warp Lines - obj.customwarpmode=true; - switch (ent.p1) - { - case 0: // Vertical, left - obj.createentity(ex + 4, ent.p2 * 8, 51, ent.p3); - break; - case 1: //Horizontal, right - obj.createentity(ex + 4, ent.p2 * 8, 52, ent.p3); - break; - case 2: //Vertical, top - obj.createentity(ent.p2 * 8, ey + 7, 53, ent.p3); - break; - case 3: // Horizontal, bottom - obj.createentity(ent.p2 * 8, ey, 54, ent.p3); - break; - } - break; - } - } + obj.createentity(ex, usethisy + 8, 20, usethistile); + obj.createblock(ACTIVITY, ex - 8, usethisy + 8, 20, 16, 35); + break; + } + case 19: //Script Box + if (INBOUNDS_ARR(tempscriptbox, game.customscript)) + { + game.customscript[tempscriptbox] = ent.scriptname; + } + obj.createblock(TRIGGER, ex, ey, ent.p1 * 8, ent.p2 * 8, 300 + tempscriptbox, "custom_" + ent.scriptname); + tempscriptbox++; + break; + case 50: // Warp Lines + obj.customwarpmode=true; + switch (ent.p1) + { + case 0: // Vertical, left + obj.createentity(ex + 4, ent.p2 * 8, 51, ent.p3); + break; + case 1: //Horizontal, right + obj.createentity(ex + 4, ent.p2 * 8, 52, ent.p3); + break; + case 2: //Vertical, top + obj.createentity(ent.p2 * 8, ey + 7, 53, ent.p3); + break; + case 3: // Horizontal, bottom + obj.createentity(ent.p2 * 8, ey, 54, ent.p3); + break; + } + break; + } + } - //do the appear/remove roomname here - break; - } - } - //The room's loaded: now we fill out damage blocks based on the tiles. - if (towermode) - { + //do the appear/remove roomname here + break; + } +#endif + } + //The room's loaded: now we fill out damage blocks based on the tiles. + if (towermode) + { - } - else - { - for (int j = 0; j < 29 + extrarow; j++) - { - for (int i = 0; i < 40; i++) - { - int tile = contents[TILE_IDX(i, j)]; - //Damage blocks - if(tileset==0) - { - if (tile == 6 || tile == 8) - { - //sticking up - obj.createblock(2, (i * 8), (j * 8)+4, 8, 4); - } - if (tile == 7 || tile == 9) - { - //Sticking down - obj.createblock(2, (i * 8), (j * 8), 8, 4); - } - if (tile == 49 || tile == 50) - { - //left or right - obj.createblock(2, (i * 8), (j * 8)+3, 8, 2); - } - } - else if(tileset==1) - { - if ((tile >= 63 && tile <= 74) || - (tile >= 6 && tile <= 9)) - { - //sticking up) { - if (tile < 10) tile++; - //sticking up - if(tile%2==0) - { - obj.createblock(2, (i * 8), (j * 8), 8, 4); - } - else - { - //Sticking down - obj.createblock(2, (i * 8), (j * 8) + 4, 8, 4); - } - if (tile < 11) tile--; - } - if (tile >= 49 && tile <= 62) - { - //left or right - obj.createblock(2, (i * 8), (j * 8)+3, 8, 2); - } - } - else if(tileset==2) - { - if (tile == 6 || tile == 8) - { - //sticking up - obj.createblock(2, (i * 8), (j * 8)+4, 8, 4); - } - if (tile == 7 || tile == 9) - { - //Sticking down - obj.createblock(2, (i * 8), (j * 8), 8, 4); - } - } - //Breakable blocks - if (tile == 10) - { - settile(i, j, 0); - obj.createentity(i * 8, j * 8, 4); - } - //Directional blocks - if (tile >= 14 && tile <= 17) - { - obj.createblock(3, i * 8, j * 8, 8, 8, tile-14); - } - } - } + } + else + { + for (int j = 0; j < 29 + extrarow; j++) + { + for (int i = 0; i < 40; i++) + { + //Damage blocks + if(tileset==0) + { + if (contents[i + vmult[j]] == 6 || contents[i + vmult[j]] == 8) + { + //sticking up + obj.createblock(2, (i * 8), (j * 8)+4, 8, 4); + } + if (contents[i + vmult[j]] == 7 || contents[i + vmult[j]] == 9) + { + //Sticking down + obj.createblock(2, (i * 8), (j * 8), 8, 4); + } + if (contents[i + vmult[j]] == 49 || contents[i + vmult[j]] == 50) + { + //left or right + obj.createblock(2, (i * 8), (j * 8)+3, 8, 2); + } + } + else if(tileset==1) + { + //if (contents[i + vmult[j]] >= 6 && contents[i + vmult[j]] <= 9) obj.createblock(2, (i * 8), (j * 8)+1, 8, 6); + //if (contents[i + vmult[j]] >= 49 && contents[i + vmult[j]] <= 79) obj.createblock(2, (i * 8) + 1, (j * 8) + 1, 6, 6); + if ((contents[i + vmult[j]] >= 63 && contents[i + vmult[j]] <= 74) || + (contents[i + vmult[j]] >= 6 && contents[i + vmult[j]] <= 9)) + { + //sticking up) { + if (contents[i + vmult[j]] < 10) contents[i + vmult[j]]++; + //sticking up + if(contents[i + vmult[j]]%2==0) + { + obj.createblock(2, (i * 8), (j * 8), 8, 4); + } + else + { + //Sticking down + obj.createblock(2, (i * 8), (j * 8) + 4, 8, 4); + } + if (contents[i + vmult[j]] < 11) contents[i + vmult[j]]--; + } + if (contents[i + vmult[j]] >= 49 && contents[i + vmult[j]] <= 62) + { + //left or right + obj.createblock(2, (i * 8), (j * 8)+3, 8, 2); + } + } + else if(tileset==2) + { + if (contents[i + vmult[j]] == 6 || contents[i + vmult[j]] == 8) + { + //sticking up + obj.createblock(2, (i * 8), (j * 8)+4, 8, 4); + } + if (contents[i + vmult[j]] == 7 || contents[i + vmult[j]] == 9) + { + //Sticking down + obj.createblock(2, (i * 8), (j * 8), 8, 4); + } + } + //Breakable blocks + if (contents[i + vmult[j]] == 10) + { + contents[i + vmult[j]] = 0; + obj.createentity(i * 8, j * 8, 4); + } + //Directional blocks + if (contents[i + vmult[j]] >= 14 && contents[i + vmult[j]] <= 17) + { + obj.createblock(3, i * 8, j * 8, 8, 8, contents[i + vmult[j]]-14); + } + } + } - for (size_t i = 0; i < obj.entities.size(); i++) - { - if (obj.entities[i].type == EntityType_MOVING && obj.entities[i].behave >= 8 && obj.entities[i].behave < 10) - { - //put a block underneath - int temp = obj.entities[i].xp / 8.0f; - int temp2 = obj.entities[i].yp / 8.0f; - settile(temp, temp2, 1); - settile(temp+1, temp2, 1); - settile(temp+2, temp2, 1); - settile(temp+3, temp2, 1); - if (obj.entities[i].w == 64) - { - settile(temp+4, temp2, 1); - settile(temp+5, temp2, 1); - settile(temp+6, temp2, 1); - settile(temp+7, temp2, 1); - } - } - } - } + for (size_t i = 0; i < obj.entities.size(); i++) + { + if (obj.entities[i].type == 1 && obj.entities[i].behave >= 8 && obj.entities[i].behave < 10) + { + //put a block underneath + int temp = obj.entities[i].xp / 8.0f; + int temp2 = obj.entities[i].yp / 8.0f; + settile(temp, temp2, 1); + settile(temp+1, temp2, 1); + settile(temp+2, temp2, 1); + settile(temp+3, temp2, 1); + if (obj.entities[i].w == 64) + { + settile(temp+4, temp2, 1); + settile(temp+5, temp2, 1); + settile(temp+6, temp2, 1); + settile(temp+7, temp2, 1); + } + } + } + } - //Special scripting: Create objects and triggers based on what crewmembers are rescued. - if (!finalmode && !custommode) - { - //First up: the extra bits: - //Vermilion's quest: - if (rx == 100 && ry == 105) //On path to verdigris - { - if (game.crewstats[3] && !game.crewstats[4]) - { - obj.createentity(87, 105, 18, 15, 0, 18); - obj.createblock(5, 87-32, 0, 32+32+32, 240, 3); - } - } - else if (rx == 107 && ry == 100) //victoria - { - if (game.crewstats[3] && !game.crewstats[5]) - { - obj.createentity(140, 137, 18, 15, 0, 18); - obj.createblock(5, 140-32, 0, 32+32+32, 240, 3); - } - } - else if (rx == 114 && ry == 109) - { - if (game.crewstats[3] && !game.crewstats[2]) - { - obj.createentity(235, 81, 18, 15, 0, 18); - obj.createblock(5, 235-32, 0, 32+32+32, 240, 3); - } - } + //Special scripting: Create objects and triggers based on what crewmembers are rescued. + if (!finalmode && !custommode) + { + //First up: the extra bits: + //Vermilion's quest: + if (rx == 100 && ry == 105) //On path to verdigris + { + if (game.crewstats[3] && !game.crewstats[4]) + { + obj.createentity(87, 105, 18, 15, 0, 18); + obj.createblock(5, 87-32, 0, 32+32+32, 240, 3); + } + } + else if (rx == 107 && ry == 100) //victoria + { + if (game.crewstats[3] && !game.crewstats[5]) + { + obj.createentity(140, 137, 18, 15, 0, 18); + obj.createblock(5, 140-32, 0, 32+32+32, 240, 3); + } + } + else if (rx == 114 && ry == 109) + { + if (game.crewstats[3] && !game.crewstats[2]) + { + obj.createentity(235, 81, 18, 15, 0, 18); + obj.createblock(5, 235-32, 0, 32+32+32, 240, 3); + } + } - //Verdigris fixing the ship - if (rx == 101 && ry == 109) - { - if (game.crewstats[4]) - { - if(game.crewrescued()>4 && game.crewrescued()!=6) - { - obj.createentity(175, 121, 18, 13, 0, 18); - obj.createblock(5, 175-32, 0, 32+32+32, 240, 4); - } - } - } - else if (rx == 103 && ry == 109) - { - if (game.crewstats[4]) - { - if(game.crewrescued()<=4 && game.crewrescued()!=6) - { - obj.createentity(53, 161, 18, 13, 1, 18); - obj.createblock(5, 53-32, 0, 32+32+32, 240, 4); - } - } - } + //Verdigris fixing the ship + if (rx == 101 && ry == 109) + { + if (game.crewstats[4]) + { + if(game.crewrescued()>4 && game.crewrescued()!=6) + { + obj.createentity(175, 121, 18, 13, 0, 18); + obj.createblock(5, 175-32, 0, 32+32+32, 240, 4); + } + } + } + else if (rx == 103 && ry == 109) + { + if (game.crewstats[4]) + { + if(game.crewrescued()<=4 && game.crewrescued()!=6) + { + obj.createentity(53, 161, 18, 13, 1, 18); + obj.createblock(5, 53-32, 0, 32+32+32, 240, 4); + } + } + } - if (rx == 104 && ry == 111) - { - //Red - //First: is he rescued? - if (game.crewstats[3]) - { - //If so, red will always be at his post - obj.createentity(107, 121, 18, 15, 0, 18); - //What script do we use? - obj.createblock(5, 107-32, 0, 32+32+32, 240, 3); - } - } - else if (rx == 103 && ry == 111) - { - //Yellow - //First: is he rescued? - if (game.crewstats[2]) - { - obj.createentity(198, 105, 18, 14, 0, 18); - //What script do we use? - obj.createblock(5, 198-32, 0, 32+32+32, 240, 2); - } - } - else if (rx == 103 && ry == 110) - { - //Green - //First: is he rescued? - if (game.crewstats[4]) - { - obj.createentity(242, 177, 18, 13, 0, 18); - //What script do we use? - obj.createblock(5, 242-32, 177-20, 32+32+32, 40, 4); - } - } - else if (rx == 104 && ry == 110) - { - //Purple - //First: is she rescued? - if (game.crewstats[1]) - { - obj.createentity(140, 177, 18, 20, 0, 18); - //What script do we use? - obj.createblock(5, 140-32, 0, 32+32+32, 240, 1); - } - } - else if (rx == 102 && ry == 110) - { - //Blue - //First: is she rescued? - if (game.crewstats[5]) - { - //A slight varation - she's upside down - obj.createentity(249, 62, 18, 16, 0, 18); - int j = obj.getcrewman(EntityColour_CREW_BLUE); - if (INBOUNDS_VEC(j, obj.entities)) - { - obj.entities[j].rule = 7; - obj.entities[j].tile +=6; - } - //What script do we use? - obj.createblock(5, 249-32, 0, 32+32+32, 240, 5); - } - } - } + if (rx == 104 && ry == 111) + { + //Red + //First: is he rescued? + if (game.crewstats[3]) + { + //If so, red will always be at his post + obj.createentity(107, 121, 18, 15, 0, 18); + //What script do we use? + obj.createblock(5, 107-32, 0, 32+32+32, 240, 3); + } + } + else if (rx == 103 && ry == 111) + { + //Yellow + //First: is he rescued? + if (game.crewstats[2]) + { + obj.createentity(198, 105, 18, 14, 0, 18); + //What script do we use? + obj.createblock(5, 198-32, 0, 32+32+32, 240, 2); + } + } + else if (rx == 103 && ry == 110) + { + //Green + //First: is he rescued? + if (game.crewstats[4]) + { + obj.createentity(242, 177, 18, 13, 0, 18); + //What script do we use? + obj.createblock(5, 242-32, 177-20, 32+32+32, 40, 4); + } + } + else if (rx == 104 && ry == 110) + { + //Purple + //First: is she rescued? + if (game.crewstats[1]) + { + obj.createentity(140, 177, 18, 20, 0, 18); + //What script do we use? + obj.createblock(5, 140-32, 0, 32+32+32, 240, 1); + } + } + else if (rx == 102 && ry == 110) + { + //Blue + //First: is she rescued? + if (game.crewstats[5]) + { + //A slight varation - she's upside down + obj.createentity(249, 62, 18, 16, 0, 18); + int j = obj.getcrewman(5); + if (INBOUNDS_VEC(j, obj.entities)) + { + obj.entities[j].rule = 7; + obj.entities[j].tile +=6; + } + //What script do we use? + obj.createblock(5, 249-32, 0, 32+32+32, 240, 5); + } + } + } } void mapclass::twoframedelayfix(void) { - // Fixes the two-frame delay in custom levels that use scripts to spawn an entity upon room load. - // Because when the room loads and newscript is set to run, newscript has already ran for that frame, - // and when the script gets loaded script.run() has already ran for that frame, too. - // A bit kludge-y, but it's the least we can do without changing the frame ordering. + // Fixes the two-frame delay in custom levels that use scripts to spawn an entity upon room load. + // Because when the room loads and newscript is set to run, newscript has already ran for that frame, + // and when the script gets loaded script.run() has already ran for that frame, too. + // A bit kludge-y, but it's the least we can do without changing the frame ordering. - if (GlitchrunnerMode_less_than_or_equal(Glitchrunner2_2) - || !custommode - || game.deathseq != -1) - return; + if (GlitchrunnerMode_less_than_or_equal(Glitchrunner2_2) + || !custommode + || game.deathseq != -1) + return; - int block_idx = -1; - // obj.checktrigger() sets block_idx - int activetrigger = obj.checktrigger(&block_idx); - if (activetrigger <= -1 - || !INBOUNDS_VEC(block_idx, obj.blocks) - || activetrigger < 300) - { - return; - } + int block_idx = -1; + // obj.checktrigger() sets block_idx + int activetrigger = obj.checktrigger(&block_idx); + if (activetrigger <= -1 + || !INBOUNDS_VEC(block_idx, obj.blocks) + || activetrigger < 300) + { + return; + } - game.newscript = obj.blocks[block_idx].script; - obj.removetrigger(activetrigger); - game.setstate(0); - game.setstatedelay(0); - script.load(game.newscript); -} - -MapRenderData mapclass::get_render_data(void) -{ - MapRenderData data; - data.width = getwidth(); - data.height = getheight(); - - data.startx = 0; - data.starty = 0; - - // Region handling - if (region[currentregion].isvalid) - { - data.startx = region[currentregion].rx; - data.starty = region[currentregion].ry; - data.width = ((region[currentregion].rx2 - data.startx) + 1); - data.height = ((region[currentregion].ry2 - data.starty) + 1); - } - - data.zoom = 1; - - if (data.width <= 10 && data.height <= 10) - { - data.zoom = 2; - } - if (data.width <= 5 && data.height <= 5) - { - data.zoom = 4; - } - - data.xoff = 0; - data.yoff = 0; - - // Set minimap offsets - switch (data.zoom) - { - case 4: - data.xoff = 24 * (5 - data.width); - data.yoff = 18 * (5 - data.height); - break; - case 2: - data.xoff = 12 * (10 - data.width); - data.yoff = 9 * (10 - data.height); - break; - default: - data.xoff = 6 * (20 - data.width); - data.yoff = (int)(4.5 * (20 - data.height)); - break; - } - - data.pixelsx = 240 - (data.xoff * 2); - data.pixelsy = 180 - (data.yoff * 2); - - data.legendxoff = 40 + data.xoff; - data.legendyoff = 21 + data.yoff; - - // Magic numbers for centering legend tiles. - switch (data.zoom) - { - case 4: - data.legendxoff += 21; - data.legendyoff += 16; - break; - case 2: - data.legendxoff += 9; - data.legendyoff += 5; - break; - default: - data.legendxoff += 3; - data.legendyoff += 1; - break; - } - - return data; -} - -void mapclass::setregion(int id, int rx, int ry, int rx2, int ry2) -{ - if (INBOUNDS_ARR(id, region) && id > 0) - { - // swap the variables if they're entered in the wrong order - if (rx2 < rx) - { - int temp = rx; - rx = rx2; - rx2 = temp; - } - if (ry2 < ry) - { - int temp = ry; - ry = ry2; - ry2 = temp; - } - - region[id].isvalid = true; - region[id].rx = SDL_clamp(rx, 0, cl.mapwidth - 1); - region[id].ry = SDL_clamp(ry, 0, cl.mapheight - 1); - region[id].rx2 = SDL_clamp(rx2, 0, cl.mapwidth - 1); - region[id].ry2 = SDL_clamp(ry2, 0, cl.mapheight - 1); - - if (id == currentregion) - { - cl.generatecustomminimap(); - } - } -} - -void mapclass::removeregion(int id) -{ - if (INBOUNDS_ARR(id, region) && id > 0) - { - SDL_zero(region[id]); - - if (id == currentregion) - { - cl.generatecustomminimap(); - } - } -} - -void mapclass::changeregion(int id) -{ - if (INBOUNDS_ARR(id, region)) - { - currentregion = id; - cl.generatecustomminimap(); - } + game.newscript = obj.blocks[block_idx].script; + obj.removetrigger(activetrigger); + game.state = 0; + game.statedelay = 0; + script.load(game.newscript); } diff --git a/desktop_version/src/Map.h b/desktop_version/src/Map.h index b025916e..cdc9ecdd 100644 --- a/desktop_version/src/Map.h +++ b/desktop_version/src/Map.h @@ -2,66 +2,26 @@ #define MAPGAME_H #include -#include #include "Finalclass.h" #include "Labclass.h" +#include "Maths.h" #include "Otherlevel.h" #include "Spacestation2.h" #include "Tower.h" #include "TowerBG.h" #include "WarpClass.h" -struct MapRenderData -{ - int zoom; - int xoff; - int yoff; - int legendxoff; - int legendyoff; - int startx; - int starty; - int width; - int height; - int pixelsx; - int pixelsy; -}; - struct Roomtext { int x, y; - const char* text; - bool rtl; -}; - -enum RoomnameType -{ - RoomnameType_STATIC, - RoomnameType_GLITCH, - RoomnameType_TRANSFORM -}; - -struct Roomname -{ - int x; - int y; - bool loop; - int flag; - RoomnameType type; - std::vector text; - int progress; - int delay; + std::string text; }; class mapclass { public: mapclass(void); - void destroy(void); - - int getwidth(void); - - int getheight(void); int intpol(int a, int b, float c); @@ -69,20 +29,17 @@ public: void settrinket(int x, int y); - void setroomname(const char* name); - void resetmap(void); - void fullmap(void); + void resetnames(void); - void updateroomnames(void); + void transformname(int t); + + std::string getglitchname(int x, int y); void initmapdata(void); void initcustommapdata(void); - void roomnamechange(int x, int y, const char** lines, size_t size); - void roomnameglitch(int x, int y, const char* name, const char* glitch); - int finalat(int x, int y); int maptiletoenemycol(int t); @@ -102,9 +59,9 @@ public: void settowercolour(int t); - bool towerspikecollide(int x, int y); + bool spikecollide(int x, int y); - bool collide(int x, int y, bool invincible); + bool collide(int x, int y); void settile(int xp, int yp, int t); @@ -124,9 +81,7 @@ public: void gotoroom(int rx, int ry); - void spawncompanion(void); - - const char* currentarea(int roomx, int roomy); + std::string currentarea(int t); void loadlevel(int rx, int ry); @@ -138,12 +93,11 @@ public: static const int areamap[20 * 20]; int contents[40 * 30]; bool explored[20 * 20]; + int vmult[30]; bool isexplored(const int rx, const int ry); void setexplored(const int rx, const int ry, const bool status); - bool revealmap; - int background; int rcol; int tileset; @@ -151,12 +105,8 @@ public: bool warpy; - const char* roomname; - bool roomname_special; - bool roomnameset; - const char* hiddenname; - - std::vector specialroomnames; + std::string roomname; + std::string hiddenname; //Special tower stuff bool towermode; @@ -178,8 +128,16 @@ public: //Variables for playing custom levels bool custommode; bool custommodeforreal; + int customwidth, customheight; + int custommmxoff, custommmyoff, custommmxsize, custommmysize; + int customzoom; bool customshowmm; + std::string specialnames[8]; + int glitchmode; + int glitchdelay; + std::string glitchname; + //final level colour cycling stuff bool final_colormode; int final_mapcol; @@ -188,8 +146,8 @@ public: int final_colorframe, final_colorframedelay; //Teleporters and Trinkets on the map - std::vector teleporters; - std::vector shinytrinkets; + std::vector teleporters; + std::vector shinytrinkets; bool showteleporters, showtargets, showtrinkets; @@ -211,25 +169,6 @@ public: //Map cursor int cursorstate, cursordelay; - - //Region system - struct Region - { - bool isvalid; - int rx; - int ry; - int rx2; - int ry2; - }; - struct Region region[401]; - void setregion(int id, int rx, int ry, int rx2, int ry2); - void removeregion(int id); - void changeregion(int id); - int currentregion; - int regionx, regiony; - int regionwidth, regionheight; - - MapRenderData get_render_data(void); }; #ifndef MAP_DEFINITION diff --git a/desktop_version/src/Maths.h b/desktop_version/src/Maths.h index c17e31e5..572f50bb 100644 --- a/desktop_version/src/Maths.h +++ b/desktop_version/src/Maths.h @@ -1,6 +1,7 @@ #ifndef MATHGAME_H #define MATHGAME_H +#include #include //// This header holds Maths functions that emulate the functionality of flash's @@ -13,4 +14,39 @@ float inline fRandom(void) return ( float(rand()) / float(RAND_MAX)) ; } +inline int clamp(int x, int a, int b) +{ + return x < a ? a : (x > b ? b : x); +} + +struct point +{ + int x; + int y; +}; + +inline int VVV_min(const int a, const int b) +{ + if (a < b) + { + return a; + } + else + { + return b; + } +} + +inline int VVV_max(const int a, const int b) +{ + if (a > b) + { + return a; + } + else + { + return b; + } +} + #endif /* MATHGAME_H */ diff --git a/desktop_version/src/Music.cpp b/desktop_version/src/Music.cpp index 2e2ba84e..7fdcbadd 100644 --- a/desktop_version/src/Music.cpp +++ b/desktop_version/src/Music.cpp @@ -2,1327 +2,523 @@ #include "Music.h" #include -#include -#include +#include -#include "Alloc.h" #include "BinaryBlob.h" -#include "FileSystemUtils.h" #include "Game.h" #include "Graphics.h" #include "Map.h" #include "Script.h" -#include "Unused.h" #include "UtilityClass.h" -#include "Vlogging.h" - -#include - -/* stb_vorbis */ - -#define malloc SDL_malloc -#define realloc SDL_realloc -#define free VVV_free -#ifdef memset /* Thanks, Apple! */ -#undef memset -#endif -#define memset SDL_memset -#ifdef memcpy /* Thanks, Apple! */ -#undef memcpy -#endif -#define memcpy SDL_memcpy -#define memcmp SDL_memcmp - -#define pow SDL_pow -#define log(x) SDL_log(x) -#define sin(x) SDL_sin(x) -#define cos(x) SDL_cos(x) -#define floor SDL_floor -#define abs(x) SDL_abs(x) -#define ldexp(v, e) SDL_scalbn((v), (e)) -#define exp(x) SDL_exp(x) - -#define qsort SDL_qsort - -#define assert SDL_assert - -#define FILE SDL_RWops -#ifdef SEEK_SET -#undef SEEK_SET -#endif -#ifdef SEEK_CUR -#undef SEEK_CUR -#endif -#ifdef SEEK_END -#undef SEEK_END -#endif -#ifdef EOF -#undef EOF -#endif -#define SEEK_SET 0 -#define SEEK_CUR 1 -#define SEEK_END 2 -#define EOF -1 -#define fopen(path, mode) SDL_RWFromFile(path, mode) -#define fopen_s(io, path, mode) (!(*io = fopen(path, mode))) -#define fclose(io) SDL_RWclose(io) -#define fread(dst, size, count, io) SDL_RWread(io, dst, size, count) -#define fseek(io, offset, whence) SDL_RWseek(io, offset, whence) -#define ftell(io) SDL_RWtell(io) - -#define FAudio_alloca(x) SDL_stack_alloc(uint8_t, x) -#define FAudio_dealloca(x) SDL_stack_free(x) - -#define STB_VORBIS_NO_PUSHDATA_API 1 -#define STB_VORBIS_NO_INTEGER_CONVERSION 1 -#include - -/* End stb_vorbis include */ - -#define VVV_MAX_VOLUME 128 -#define VVV_MAX_CHANNELS 8 - -class SoundTrack; -class MusicTrack; -static std::vector soundTracks; -static std::vector musicTracks; - -static FAudio* faudioctx = NULL; -static FAudioMasteringVoice* masteringvoice = NULL; - -class SoundTrack -{ -public: - SoundTrack(const char* fileName) - { - unsigned char* mem; - size_t length; - voice_index = -1; - - FILESYSTEM_loadAssetToMemory(fileName, &mem, &length); - if (mem == NULL) - { - vlog_error("Unable to load sound file %s", fileName); - SDL_assert(0 && "Sound file missing!"); - return; - } - - SDL_zerop(this); - if (length >= 4 && SDL_memcmp(mem, "OggS", 4) == 0) - { - LoadOGG(fileName, mem, length); - callbacks.OnBufferStart = &SoundTrack::refillReserve; - callbacks.OnBufferEnd = &SoundTrack::swapBuffers; - } - else - { - LoadWAV(fileName, mem, length); - } - } - - void LoadWAV(const char* fileName, unsigned char* mem, const size_t length) - { - SDL_AudioSpec spec; - SDL_RWops *fileIn; - fileIn = SDL_RWFromConstMem(mem, length); - if (SDL_LoadWAV_RW(fileIn, 1, &spec, &wav_buffer, &wav_length) == NULL) - { - vlog_error("Unable to load WAV file %s", fileName); - goto end; - } - format.nChannels = spec.channels; - format.nSamplesPerSec = spec.freq; - format.wFormatTag = FAUDIO_FORMAT_PCM; - format.wBitsPerSample = SDL_AUDIO_BITSIZE(spec.format); - format.nBlockAlign = format.nChannels * format.wBitsPerSample; - format.nAvgBytesPerSec = format.nSamplesPerSec * format.nBlockAlign; - format.cbSize = 0; - valid = true; -end: - VVV_free(mem); - } - - void LoadOGG(const char* fileName, unsigned char* mem, const size_t length) - { - int err; - stb_vorbis_info vorbis_info; - vorbis = stb_vorbis_open_memory(mem, length, &err, NULL); - if (vorbis == NULL) - { - vlog_error("Unable to create Vorbis handle for %s, error %d", fileName, err); - VVV_free(mem); - return; - } - vorbis_info = stb_vorbis_get_info(vorbis); - format.wFormatTag = FAUDIO_FORMAT_IEEE_FLOAT; - format.wBitsPerSample = sizeof(float) * 8; - format.nChannels = vorbis_info.channels; - format.nSamplesPerSec = vorbis_info.sample_rate; - format.nBlockAlign = format.nChannels * format.wBitsPerSample; - format.nAvgBytesPerSec = format.nSamplesPerSec * format.nBlockAlign; - format.cbSize = 0; - - channels = format.nChannels; - size = format.nAvgBytesPerSec / 20; - - decoded_buf_playing = (Uint8*) SDL_malloc(size); - decoded_buf_reserve = (Uint8*) SDL_malloc(size); - - ogg_file = mem; - valid = true; - } - - void Dispose(void) - { - VVV_free(wav_buffer); - - VVV_free(decoded_buf_playing); - VVV_free(decoded_buf_reserve); - VVV_freefunc(stb_vorbis_close, vorbis); - VVV_free(ogg_file); - } - - void Play(void) - { - if (!valid) - { - return; - } - - for (int i = 0; i < VVV_MAX_CHANNELS; i++) - { - FAudioVoiceState voicestate; - FAudioSourceVoice_GetState(voices[i], &voicestate, 0); - if (voicestate.BuffersQueued == 0) - { - if (SDL_memcmp(&voice_formats[i], &format, sizeof(format)) != 0) - { - VVV_freefunc(FAudioVoice_DestroyVoice, voices[i]); - if (vorbis != NULL) - { - FAudio_CreateSourceVoice(faudioctx, &voices[i], &format, 0, 2.0f, &callbacks, NULL, NULL); - } - else - { - FAudio_CreateSourceVoice(faudioctx, &voices[i], &format, 0, 2.0f, NULL, NULL, NULL); - } - voice_formats[i] = format; - } - FAudioBuffer faudio_buffer = { - FAUDIO_END_OF_STREAM, /* Flags */ - wav_length * 8, /* AudioBytes */ - wav_buffer, /* AudioData */ - 0, /* playbegin */ - 0, /* playlength */ - 0, /* LoopBegin */ - 0, /* LoopLength */ - 0, /* LoopCount */ - NULL - }; - if (vorbis != NULL) - { - stb_vorbis_seek_start(vorbis); - faudio_buffer.PlayLength = stb_vorbis_get_samples_float_interleaved( - vorbis, - channels, - (float*) decoded_buf_playing, - size / sizeof(float) - ); - faudio_buffer.AudioBytes = size; - faudio_buffer.pAudioData = decoded_buf_playing; - faudio_buffer.pContext = this; - } - if (FAudioSourceVoice_SubmitSourceBuffer(voices[i], &faudio_buffer, NULL)) - { - vlog_error("Unable to queue sound buffer"); - voice_index = -1; - return; - } - FAudioVoice_SetVolume(voices[i], volume, FAUDIO_COMMIT_NOW); - if (FAudioSourceVoice_Start(voices[i], 0, FAUDIO_COMMIT_NOW)) - { - vlog_error("Unable to start voice processing"); - voice_index = -1; - } - voice_index = i; - return; - } - } - } - - static void Init(int audio_rate) - { - if (voices == NULL) - { - voices = (FAudioSourceVoice**) SDL_malloc(sizeof(FAudioSourceVoice*) * VVV_MAX_CHANNELS); - for (int i = 0; i < VVV_MAX_CHANNELS; i++) - { - FAudioWaveFormatEx format; - format.nChannels = 1; /* Assume 1 for SoundTracks. Will be recreated if mismatched during play */ - format.nSamplesPerSec = audio_rate; - format.wFormatTag = FAUDIO_FORMAT_PCM; - format.wBitsPerSample = 16; - format.nBlockAlign = format.nChannels * format.wBitsPerSample; - format.nAvgBytesPerSec = format.nSamplesPerSec * format.nBlockAlign; - format.cbSize = 0; - voice_formats[i] = format; - if (FAudio_CreateSourceVoice(faudioctx, &voices[i], &format, 0, 2.0f, NULL, NULL, NULL)) - { - vlog_error("Unable to create source voice no. %i", i); - return; - } - } - } - } - - static void Pause(void) - { - for (size_t i = 0; i < VVV_MAX_CHANNELS; i++) - { - FAudioSourceVoice_Stop(voices[i], 0, FAUDIO_COMMIT_NOW); - } - } - - static void Resume(void) - { - for (size_t i = 0; i < VVV_MAX_CHANNELS; i++) - { - FAudioSourceVoice_Start(voices[i], 0, FAUDIO_COMMIT_NOW); - } - } - - static void Destroy(void) - { - if (voices != NULL) - { - for (int i = 0; i < VVV_MAX_CHANNELS; i++) - { - VVV_freefunc(FAudioVoice_DestroyVoice, voices[i]); - } - VVV_free(voices); - } - } - - static void SetVolume(int soundVolume) - { - volume = (float) soundVolume / VVV_MAX_VOLUME; - for (size_t i = 0; i < VVV_MAX_CHANNELS; i++) - { - FAudioVoice_SetVolume(voices[i], volume, FAUDIO_COMMIT_NOW); - } - } - - static void refillReserve(FAudioVoiceCallback* callback, void* ctx) - { - bool inbounds; - SoundTrack* t = (SoundTrack*) ctx; - FAudioBuffer faudio_buffer; - SDL_zero(faudio_buffer); - UNUSED(callback); - faudio_buffer.PlayLength = stb_vorbis_get_samples_float_interleaved(t->vorbis, t->channels, (float*) t->decoded_buf_reserve, t->size / sizeof(float)); - faudio_buffer.AudioBytes = t->size; - faudio_buffer.pAudioData = t->decoded_buf_reserve; - faudio_buffer.pContext = t; - if (faudio_buffer.PlayLength == 0) - { - return; - } - - inbounds = t->voice_index >= 0 && t->voice_index < VVV_MAX_CHANNELS; - if (!inbounds) - { - return; - } - - FAudioSourceVoice_SubmitSourceBuffer(voices[t->voice_index], &faudio_buffer, NULL); - } - - static void swapBuffers(FAudioVoiceCallback* callback, void* ctx) - { - SoundTrack* t = (SoundTrack*) ctx; - Uint8* tmp = t->decoded_buf_playing; - UNUSED(callback); - t->decoded_buf_playing = t->decoded_buf_reserve; - t->decoded_buf_reserve = tmp; - } - - Uint8 *wav_buffer; - Uint32 wav_length; - FAudioWaveFormatEx format; - int voice_index; - - unsigned char* ogg_file; - stb_vorbis* vorbis; - int channels; - Uint32 size; - Uint8* decoded_buf_playing; - Uint8* decoded_buf_reserve; - FAudioVoiceCallback callbacks; - - bool valid; - - static FAudioSourceVoice** voices; - static FAudioWaveFormatEx voice_formats[VVV_MAX_CHANNELS]; - static float volume; -}; -FAudioSourceVoice** SoundTrack::voices = NULL; -FAudioWaveFormatEx SoundTrack::voice_formats[VVV_MAX_CHANNELS]; -float SoundTrack::volume = 0.0f; - -class MusicTrack -{ -public: - MusicTrack(SDL_RWops *rw) - { - SDL_zerop(this); - read_buf = (Uint8*) SDL_malloc(rw->size(rw)); - SDL_RWread(rw, read_buf, rw->size(rw), 1); - int err; - stb_vorbis_info vorbis_info; - stb_vorbis_comment vorbis_comment; - vorbis = stb_vorbis_open_memory(read_buf, rw->size(rw), &err, NULL); - if (vorbis == NULL) - { - vlog_error("Unable to create Vorbis handle, error %d", err); - VVV_free(read_buf); - goto end; - } - vorbis_info = stb_vorbis_get_info(vorbis); - format.wFormatTag = FAUDIO_FORMAT_IEEE_FLOAT; - format.wBitsPerSample = sizeof(float) * 8; - format.nChannels = vorbis_info.channels; - format.nSamplesPerSec = vorbis_info.sample_rate; - format.nBlockAlign = format.nChannels * format.wBitsPerSample; - format.nAvgBytesPerSec = format.nSamplesPerSec * format.nBlockAlign; - format.cbSize = 0; - - channels = format.nChannels; - size = format.nAvgBytesPerSec / 20; - - decoded_buf_playing = (Uint8*) SDL_malloc(size); - decoded_buf_reserve = (Uint8*) SDL_malloc(size); - - loopbegin = 0; - looplength = 0; - vorbis_comment = stb_vorbis_get_comment(vorbis); - parseComments(this, vorbis_comment.comment_list, vorbis_comment.comment_list_length); - valid = true; - -end: - SDL_RWclose(rw); - } - - void Dispose(void) - { - VVV_freefunc(stb_vorbis_close, vorbis); - VVV_free(read_buf); - VVV_free(decoded_buf_playing); - VVV_free(decoded_buf_reserve); - if (!IsHalted()) - { - VVV_freefunc(FAudioVoice_DestroyVoice, musicVoice); - } - } - - bool Play(bool loop) - { - if (!valid) - { - return false; - } - - shouldloop = loop; - sample_pos = 0; - stb_vorbis_seek_start(vorbis); - - Halt(); - - SDL_zero(callbacks); - callbacks.OnBufferStart = &MusicTrack::refillReserve; - callbacks.OnBufferEnd = &MusicTrack::swapBuffers; - FAudio_CreateSourceVoice(faudioctx, &musicVoice, &format, 0, 2.0f, &callbacks, NULL, NULL); - - FAudioBuffer faudio_buffer; - SDL_zero(faudio_buffer); - if (looplength == 0) - { - faudio_buffer.PlayLength = stb_vorbis_get_samples_float_interleaved(vorbis, channels, (float*) decoded_buf_playing, size / sizeof(float)); - } - else - { - int samples_read = stb_vorbis_get_samples_float_interleaved(vorbis, channels, (float*) decoded_buf_playing, size / sizeof(float)); - faudio_buffer.PlayLength = SDL_min(samples_read, (loopbegin + looplength) - sample_pos); - } - faudio_buffer.AudioBytes = size; - faudio_buffer.pAudioData = decoded_buf_playing; - faudio_buffer.pContext = this; - sample_pos += faudio_buffer.PlayLength; - if (FAudioSourceVoice_SubmitSourceBuffer(musicVoice, &faudio_buffer, NULL)) - { - vlog_error("Unable to queue sound buffer"); - return false; - } - Resume(); - return true; - } - - static void Halt(void) - { - if (!IsHalted()) - { - FAudioSourceVoice_FlushSourceBuffers(musicVoice); - VVV_freefunc(FAudioVoice_DestroyVoice, musicVoice); - paused = true; - } - } - - static bool IsHalted(void) - { - return musicVoice == NULL; - } - - static void Pause(void) - { - if (!IsHalted()) - { - FAudioSourceVoice_Stop(musicVoice, 0, FAUDIO_COMMIT_NOW); - paused = true; - } - } - - static bool IsPaused(void) - { - return paused || IsHalted(); - } - - static void Resume(void) - { - if (!IsHalted()) - { - FAudioSourceVoice_Start(musicVoice, 0, FAUDIO_COMMIT_NOW); - paused = false; - } - } - - static void SetVolume(int controlVolume) - { - float adj_vol = (float)controlVolume / VVV_MAX_VOLUME; - if (!IsHalted()) - { - FAudioVoice_SetVolume(musicVoice, adj_vol, FAUDIO_COMMIT_NOW); - } - } - - stb_vorbis* vorbis; - int channels; - Uint32 size; - int loopbegin; - int looplength; - int sample_pos; //stb_vorbis offset not yet functional on pulldata API. TODO Replace when fixed - - FAudioVoiceCallback callbacks; - FAudioWaveFormatEx format; - - Uint8* decoded_buf_playing; - Uint8* decoded_buf_reserve; - Uint8* read_buf; - bool shouldloop; - bool valid; - - static bool paused; - static FAudioSourceVoice* musicVoice; - - static void refillReserve(FAudioVoiceCallback* callback, void* ctx) - { - MusicTrack* t = (MusicTrack*) ctx; - FAudioBuffer faudio_buffer; - SDL_zero(faudio_buffer); - UNUSED(callback); - if (t->looplength == 0) - { - faudio_buffer.PlayLength = stb_vorbis_get_samples_float_interleaved(t->vorbis, t->channels, (float*) t->decoded_buf_reserve, t->size / sizeof(float)); - } - else - { - int samples_read = stb_vorbis_get_samples_float_interleaved(t->vorbis, t->channels, (float*) t->decoded_buf_reserve, t->size / sizeof(float)); - faudio_buffer.PlayLength = SDL_min(samples_read, (t->loopbegin + t->looplength) - t->sample_pos); - } - faudio_buffer.AudioBytes = t->size; - faudio_buffer.pAudioData = t->decoded_buf_reserve; - faudio_buffer.pContext = t; - if (faudio_buffer.PlayLength == 0) - { - if (t->shouldloop) - { - stb_vorbis_seek(t->vorbis, t->loopbegin); - t->sample_pos = t->loopbegin; - if (t->looplength != 0) - { - int samples_read = stb_vorbis_get_samples_float_interleaved(t->vorbis, t->channels, (float*) t->decoded_buf_reserve, t->size / sizeof(float)); - faudio_buffer.PlayLength = SDL_min(samples_read, (t->loopbegin + t->looplength) - t->sample_pos); - } - else - { - faudio_buffer.PlayLength = stb_vorbis_get_samples_float_interleaved(t->vorbis, t->channels, (float*) t->decoded_buf_reserve, t->size / sizeof(float)); - } - if (faudio_buffer.PlayLength == 0) - { - return; - } - } - else - { - return; - } - } - t->sample_pos += faudio_buffer.PlayLength; - FAudioSourceVoice_SubmitSourceBuffer(musicVoice, &faudio_buffer, NULL); - } - - static void swapBuffers(FAudioVoiceCallback* callback, void* ctx) - { - MusicTrack* t = (MusicTrack*) ctx; - Uint8* tmp = t->decoded_buf_playing; - UNUSED(callback); - t->decoded_buf_playing = t->decoded_buf_reserve; - t->decoded_buf_reserve = tmp; - } - - /* Lifted from SDL_mixer, we used it in 2.3 and previous */ - static void parseComments( - MusicTrack* t, char** comments, const int comment_list_length - ) { - int loopend = 0; - for (int i = 0; i < comment_list_length; i++) - { - char* param = SDL_strdup(comments[i]); - if (param == NULL) - { - vlog_error( - "Could not allocate memory to parse '%s'. Ignoring comments.", - comments[i] - ); - break; - } - char* argument = param; - char* value = SDL_strchr(param, '='); - if (value == NULL) - { - value = param + SDL_strlen(param); - } - else - { - *(value++) = '\0'; - } - - /* Want to match LOOP-START, LOOP_START, etc. Remove - or _ from - * string if it is present at position 4. */ - char buf[5]; - SDL_strlcpy(buf, argument, sizeof(buf)); - if (SDL_strcasecmp(buf, "LOOP") == 0 - && ((argument[4] == '_') || (argument[4] == '-'))) - { - SDL_memmove(argument + 4, argument + 5, SDL_strlen(argument) - 4); - } - - if (SDL_strcasecmp(argument, "LOOPSTART") == 0) - { - t->loopbegin = _Mix_ParseTime(value, t->format.nSamplesPerSec); - } - else if (SDL_strcasecmp(argument, "LOOPLENGTH") == 0) - { - t->looplength = SDL_strtoll(value, NULL, 10); - } - else if (SDL_strcasecmp(argument, "LOOPEND") == 0) - { - loopend = _Mix_ParseTime(value, t->format.nSamplesPerSec); - } - - if (t->loopbegin < 0 || t->looplength < 0 || loopend < 0) - { - vlog_warn( - "A track loop comment had a negative value. " - "Ignoring all comments for the track." - ); - t->loopbegin = 0; - t->looplength = 0; - loopend = 0; - VVV_free(param); - break; - } - - VVV_free(param); - } - if (loopend != 0) - { - t->looplength = loopend - t->loopbegin; - } - } - - static int _Mix_ParseTime(char* time, const long samplerate_hz) - { - char* num_start = time; - char* p; - Sint64 result = 0; - int val; - - /* Time is directly expressed as a sample position */ - if (SDL_strchr(time, ':') == NULL) - { - return SDL_strtoll(time, NULL, 10); - } - - for (p = time; *p != '\0'; ++p) - { - if (*p == '.' || *p == ':') - { - const char c = *p; - *p = '\0'; - val = SDL_atoi(num_start); - if (val < 0) - { - return -1; - } - result = result * 60 + val; - num_start = p + 1; - *p = c; - } - - if (*p == '.') - { - const double val_f = SDL_atof(p); - if (val_f < 0) - { - return -1; - } - return result * samplerate_hz + (Sint64) (val_f * samplerate_hz); - } - } - - val = SDL_atoi(num_start); - if (val < 0) - { - return -1; - } - return (result * 60 + val) * samplerate_hz; - } -}; -bool MusicTrack::paused = false; -FAudioSourceVoice* MusicTrack::musicVoice = NULL; musicclass::musicclass(void) { - safeToProcessMusic= false; - m_doFadeInVol = false; - m_doFadeOutVol = false; - controlVolume = 0; + safeToProcessMusic= false; + m_doFadeInVol = false; + m_doFadeOutVol = false; + musicVolume = 0; - user_music_volume = USER_VOLUME_MAX; - user_sound_volume = USER_VOLUME_MAX; + user_music_volume = USER_VOLUME_MAX; + user_sound_volume = USER_VOLUME_MAX; - currentsong = -1; - haltedsong = -1; - nicechange = -1; - nicefade = false; - quick_fade = true; + currentsong = 0; + nicechange = -1; + nicefade = false; + quick_fade = true; - usingmmmmmm = false; + usingmmmmmm = false; } void musicclass::init(void) { - if (FAudioCreate(&faudioctx, 0, FAUDIO_DEFAULT_PROCESSOR)) - { - vlog_error("Unable to initialize FAudio"); - return; - } - if (FAudio_CreateMasteringVoice(faudioctx, &masteringvoice, 2, 44100, 0, 0, NULL)) - { - vlog_error("Unable to create mastering voice"); - return; - } - - SoundTrack::Init(44100); - - soundTracks.push_back(SoundTrack( "sounds/jump.wav" )); - soundTracks.push_back(SoundTrack( "sounds/jump2.wav" )); - soundTracks.push_back(SoundTrack( "sounds/hurt.wav" )); - soundTracks.push_back(SoundTrack( "sounds/souleyeminijingle.wav" )); - soundTracks.push_back(SoundTrack( "sounds/coin.wav" )); - soundTracks.push_back(SoundTrack( "sounds/save.wav" )); - soundTracks.push_back(SoundTrack( "sounds/crumble.wav" )); - soundTracks.push_back(SoundTrack( "sounds/vanish.wav" )); - soundTracks.push_back(SoundTrack( "sounds/blip.wav" )); - soundTracks.push_back(SoundTrack( "sounds/preteleport.wav" )); - soundTracks.push_back(SoundTrack( "sounds/teleport.wav" )); - soundTracks.push_back(SoundTrack( "sounds/crew1.wav" )); - soundTracks.push_back(SoundTrack( "sounds/crew2.wav" )); - soundTracks.push_back(SoundTrack( "sounds/crew3.wav" )); - soundTracks.push_back(SoundTrack( "sounds/crew4.wav" )); - soundTracks.push_back(SoundTrack( "sounds/crew5.wav" )); - soundTracks.push_back(SoundTrack( "sounds/crew6.wav" )); - soundTracks.push_back(SoundTrack( "sounds/terminal.wav" )); - soundTracks.push_back(SoundTrack( "sounds/gamesaved.wav" )); - soundTracks.push_back(SoundTrack( "sounds/crashing.wav" )); - soundTracks.push_back(SoundTrack( "sounds/blip2.wav" )); - soundTracks.push_back(SoundTrack( "sounds/countdown.wav" )); - soundTracks.push_back(SoundTrack( "sounds/go.wav" )); - soundTracks.push_back(SoundTrack( "sounds/crash.wav" )); - soundTracks.push_back(SoundTrack( "sounds/combine.wav" )); - soundTracks.push_back(SoundTrack( "sounds/newrecord.wav" )); - soundTracks.push_back(SoundTrack( "sounds/trophy.wav" )); - soundTracks.push_back(SoundTrack( "sounds/rescue.wav" )); + soundTracks.push_back(SoundTrack( "sounds/jump.wav" )); + soundTracks.push_back(SoundTrack( "sounds/jump2.wav" )); + soundTracks.push_back(SoundTrack( "sounds/hurt.wav" )); + soundTracks.push_back(SoundTrack( "sounds/souleyeminijingle.wav" )); + soundTracks.push_back(SoundTrack( "sounds/coin.wav" )); + soundTracks.push_back(SoundTrack( "sounds/save.wav" )); + soundTracks.push_back(SoundTrack( "sounds/crumble.wav" )); + soundTracks.push_back(SoundTrack( "sounds/vanish.wav" )); + soundTracks.push_back(SoundTrack( "sounds/blip.wav" )); + soundTracks.push_back(SoundTrack( "sounds/preteleport.wav" )); + soundTracks.push_back(SoundTrack( "sounds/teleport.wav" )); + soundTracks.push_back(SoundTrack( "sounds/crew1.wav" )); + soundTracks.push_back(SoundTrack( "sounds/crew2.wav" )); + soundTracks.push_back(SoundTrack( "sounds/crew3.wav" )); + soundTracks.push_back(SoundTrack( "sounds/crew4.wav" )); + soundTracks.push_back(SoundTrack( "sounds/crew5.wav" )); + soundTracks.push_back(SoundTrack( "sounds/crew6.wav" )); + soundTracks.push_back(SoundTrack( "sounds/terminal.wav" )); + soundTracks.push_back(SoundTrack( "sounds/gamesaved.wav" )); + soundTracks.push_back(SoundTrack( "sounds/crashing.wav" )); + soundTracks.push_back(SoundTrack( "sounds/blip2.wav" )); + soundTracks.push_back(SoundTrack( "sounds/countdown.wav" )); + soundTracks.push_back(SoundTrack( "sounds/go.wav" )); + soundTracks.push_back(SoundTrack( "sounds/crash.wav" )); + soundTracks.push_back(SoundTrack( "sounds/combine.wav" )); + soundTracks.push_back(SoundTrack( "sounds/newrecord.wav" )); + soundTracks.push_back(SoundTrack( "sounds/trophy.wav" )); + soundTracks.push_back(SoundTrack( "sounds/rescue.wav" )); #ifdef VVV_COMPILEMUSIC - binaryBlob musicWriteBlob; -#define FOREACH_TRACK(blob, track_name) blob.AddFileToBinaryBlob("data/" track_name); - TRACK_NAMES(musicWriteBlob) + binaryBlob musicWriteBlob; +#define FOREACH_TRACK(blob, track_name) blob.AddFileToBinaryBlob(track_name); + TRACK_NAMES(musicWriteBlob) #undef FOREACH_TRACK - musicWriteBlob.writeBinaryBlob("data/BinaryMusic.vvv"); - musicWriteBlob.clear(); + musicWriteBlob.writeBinaryBlob("data/BinaryMusic.vvv"); + musicWriteBlob.clear(); #endif - num_mmmmmm_tracks = 0; - num_pppppp_tracks = 0; + num_mmmmmm_tracks = 0; + num_pppppp_tracks = 0; - if (!mmmmmm_blob.unPackBinary("mmmmmm.vvv")) - { - if (pppppp_blob.unPackBinary("vvvvvvmusic.vvv")) - { - vlog_info("Loading music from PPPPPP blob..."); + if (!mmmmmm_blob.unPackBinary("mmmmmm.vvv")) + { + mmmmmm = false; + usingmmmmmm=false; + bool ohCrap = pppppp_blob.unPackBinary("vvvvvvmusic.vvv"); + SDL_assert(ohCrap && "Music not found!"); + } + else + { + mmmmmm = true; + int index; + SDL_RWops *rw; - mmmmmm = false; - usingmmmmmm=false; +#define FOREACH_TRACK(blob, track_name) \ + index = blob.getIndex(track_name); \ + if (index >= 0 && index < blob.max_headers) \ + { \ + rw = SDL_RWFromConstMem(blob.getAddress(index), blob.getSize(index)); \ + if (rw == NULL) \ + { \ + printf("Unable to read music file header: %s\n", SDL_GetError()); \ + } \ + else \ + { \ + musicTracks.push_back(MusicTrack( rw )); \ + } \ + } - int index; - SDL_RWops* rw; + TRACK_NAMES(mmmmmm_blob) -#define TRACK_LOAD_BLOB(blob, track_name) \ - index = blob.getIndex("data/" track_name); \ - if (index >= 0 && index < blob.max_headers) \ - { \ - rw = SDL_RWFromConstMem(blob.getAddress(index), blob.getSize(index)); \ - if (rw == NULL) \ - { \ - vlog_error("Unable to read music file header: %s", SDL_GetError()); \ - } \ - else \ - { \ - musicTracks.push_back(MusicTrack(rw)); \ - } \ - } + num_mmmmmm_tracks += musicTracks.size(); -#define FOREACH_TRACK(blob, track_name) TRACK_LOAD_BLOB(blob, track_name) + size_t index_ = 0; + while (mmmmmm_blob.nextExtra(&index_)) + { + rw = SDL_RWFromConstMem(mmmmmm_blob.getAddress(index_), mmmmmm_blob.getSize(index_)); + musicTracks.push_back(MusicTrack( rw )); - TRACK_NAMES(pppppp_blob) + num_mmmmmm_tracks++; + index_++; + } + + bool ohCrap = pppppp_blob.unPackBinary("vvvvvvmusic.vvv"); + SDL_assert(ohCrap && "Music not found!"); + } + + int index; + SDL_RWops *rw; + + TRACK_NAMES(pppppp_blob) #undef FOREACH_TRACK - } - else - { - vlog_info("Loading music from loose files..."); - SDL_RWops* rw; + num_pppppp_tracks += musicTracks.size() - num_mmmmmm_tracks; -#define FOREACH_TRACK(_, track_name) \ - rw = PHYSFSRWOPS_openRead(track_name); \ - if (rw == NULL) \ - { \ - vlog_error("Unable to read loose music file: %s", SDL_GetError()); \ - } \ - else \ - { \ - musicTracks.push_back(MusicTrack(rw)); \ - } + size_t index_ = 0; + while (pppppp_blob.nextExtra(&index_)) + { + rw = SDL_RWFromConstMem(pppppp_blob.getAddress(index_), pppppp_blob.getSize(index_)); + musicTracks.push_back(MusicTrack( rw )); - TRACK_NAMES(_) - -#undef FOREACH_TRACK - } - } - else - { - vlog_info("Loading PPPPPP and MMMMMM blobs..."); - - mmmmmm = true; - int index; - SDL_RWops* rw; - -#define FOREACH_TRACK(blob, track_name) TRACK_LOAD_BLOB(blob, track_name) - - TRACK_NAMES(mmmmmm_blob) - - num_mmmmmm_tracks += musicTracks.size(); - - size_t index_ = 0; - while (mmmmmm_blob.nextExtra(&index_)) - { - rw = SDL_RWFromConstMem(mmmmmm_blob.getAddress(index_), mmmmmm_blob.getSize(index_)); - musicTracks.push_back(MusicTrack( rw )); - - num_mmmmmm_tracks++; - index_++; - } - - bool ohCrap = pppppp_blob.unPackBinary("vvvvvvmusic.vvv"); - SDL_assert(ohCrap && "Music not found!"); - - TRACK_NAMES(pppppp_blob) - -#undef FOREACH_TRACK -#undef TRACK_LOAD_BLOB - } - - num_pppppp_tracks += musicTracks.size() - num_mmmmmm_tracks; - - SDL_RWops* rw; - size_t index_ = 0; - while (pppppp_blob.nextExtra(&index_)) - { - rw = SDL_RWFromConstMem(pppppp_blob.getAddress(index_), pppppp_blob.getSize(index_)); - musicTracks.push_back(MusicTrack( rw )); - - num_pppppp_tracks++; - index_++; - } + num_pppppp_tracks++; + index_++; + } } void musicclass::destroy(void) { - for (size_t i = 0; i < soundTracks.size(); ++i) - { - soundTracks[i].Dispose(); - } - soundTracks.clear(); - SoundTrack::Destroy(); + for (size_t i = 0; i < soundTracks.size(); ++i) + { + Mix_FreeChunk(soundTracks[i].sound); + } + soundTracks.clear(); - for (size_t i = 0; i < musicTracks.size(); ++i) - { - musicTracks[i].Dispose(); - } - musicTracks.clear(); + // Before we free all the music: stop playing music, else SDL2_mixer + // will call SDL_Delay() if we are fading, resulting in no-draw frames + Mix_HaltMusic(); - pppppp_blob.clear(); - mmmmmm_blob.clear(); - VVV_freefunc(FAudioVoice_DestroyVoice, masteringvoice); - VVV_freefunc(FAudio_Release, faudioctx); -} + for (size_t i = 0; i < musicTracks.size(); ++i) + { + Mix_FreeMusic(musicTracks[i].m_music); + } + musicTracks.clear(); -void musicclass::set_music_volume(int volume) -{ - MusicTrack::SetVolume(volume * user_music_volume / USER_VOLUME_MAX); -} - -void musicclass::set_sound_volume(int volume) -{ - SoundTrack::SetVolume(volume * user_sound_volume / USER_VOLUME_MAX); + pppppp_blob.clear(); + mmmmmm_blob.clear(); } void musicclass::play(int t) { - if (mmmmmm && usingmmmmmm) - { - // Don't conjoin this if-statement with the above one... - if (num_mmmmmm_tracks > 0) - { - t %= num_mmmmmm_tracks; - } - } - else if (num_pppppp_tracks > 0) - { - t %= num_pppppp_tracks; - } + if (mmmmmm && usingmmmmmm) + { + // Don't conjoin this if-statement with the above one... + if (num_mmmmmm_tracks > 0) + { + t %= num_mmmmmm_tracks; + } + } + else if (num_pppppp_tracks > 0) + { + t %= num_pppppp_tracks; + } - if (mmmmmm && !usingmmmmmm) - { - t += num_mmmmmm_tracks; - } + if (mmmmmm && !usingmmmmmm) + { + t += num_mmmmmm_tracks; + } - safeToProcessMusic = true; + safeToProcessMusic = true; - if (currentsong == t && !m_doFadeOutVol) - { - return; - } + if (currentsong == t && !m_doFadeOutVol) + { + return; + } - currentsong = t; - haltedsong = -1; + currentsong = t; - if (t == -1) - { - return; - } + if (t == -1) + { + return; + } - if (!INBOUNDS_VEC(t, musicTracks)) - { - vlog_error("play() out-of-bounds!"); - currentsong = -1; - return; - } + if (!INBOUNDS_VEC(t, musicTracks)) + { + puts("play() out-of-bounds!"); + currentsong = -1; + return; + } - if (currentsong == Music_PATHCOMPLETE || - currentsong == Music_PLENARY || - (!map.custommode && (currentsong == Music_PATHCOMPLETE + num_mmmmmm_tracks - || currentsong == Music_PLENARY + num_mmmmmm_tracks))) - { - // No fade in or repeat - if (musicTracks[t].Play(false)) - { - m_doFadeInVol = false; - m_doFadeOutVol = false; - controlVolume = VVV_MAX_VOLUME; - set_music_volume(controlVolume); - } - } - else - { - if (m_doFadeOutVol) - { - // We're already fading out - nicechange = t; - nicefade = true; - currentsong = -1; + m_doFadeInVol = false; + m_doFadeOutVol = false; - if (quick_fade) - { - fadeMusicVolumeOut(500); // fade out quicker - } - else - { - quick_fade = true; - } - } - else if (musicTracks[t].Play(true)) - { - m_doFadeInVol = false; - m_doFadeOutVol = false; - fadeMusicVolumeIn(3000); - } - } + if (currentsong == 0 || currentsong == 7 || (!map.custommode && (currentsong == 0+num_mmmmmm_tracks || currentsong == 7+num_mmmmmm_tracks))) + { + // Level Complete theme, no fade in or repeat + if (Mix_PlayMusic(musicTracks[t].m_music, 0) == -1) + { + printf("Mix_PlayMusic: %s\n", Mix_GetError()); + } + else + { + musicVolume = MIX_MAX_VOLUME; + Mix_VolumeMusic(musicVolume); + } + } + else + { + if (m_doFadeOutVol) + { + // We're already fading out + nicechange = t; + nicefade = true; + currentsong = -1; + + if (quick_fade) + { + fadeMusicVolumeOut(500); // fade out quicker + } + else + { + quick_fade = true; + } + } + else if (Mix_PlayMusic(musicTracks[t].m_music, -1) == -1) + { + printf("Mix_PlayMusic: %s\n", Mix_GetError()); + } + else + { + fadeMusicVolumeIn(3000); + } + } } -void musicclass::resume(void) +void musicclass::resume() { - if (currentsong == -1) - { - currentsong = haltedsong; - haltedsong = -1; - } - MusicTrack::Resume(); + Mix_ResumeMusic(); } void musicclass::resumefade(const int fadein_ms) { - resume(); - fadeMusicVolumeIn(fadein_ms); + resume(); + fadeMusicVolumeIn(fadein_ms); } void musicclass::fadein(void) { - resumefade(3000); // 3000 ms fadein + resumefade(3000); // 3000 ms fadein } void musicclass::pause(void) { - MusicTrack::Pause(); + Mix_PauseMusic(); } void musicclass::haltdasmusik(void) { - haltdasmusik(false); -} - -void musicclass::haltdasmusik(const bool from_fade) -{ - /* Just pauses music. This is intended. */ - pause(); - haltedsong = currentsong; - currentsong = -1; - m_doFadeInVol = false; - m_doFadeOutVol = false; - if (!from_fade) - { - nicefade = false; - nicechange = -1; - } + /* Just pauses music. This is intended. */ + pause(); + currentsong = -1; + m_doFadeInVol = false; + m_doFadeOutVol = false; } void musicclass::silencedasmusik(void) { - controlVolume = 0; - m_doFadeInVol = false; - m_doFadeOutVol = false; + musicVolume = 0; } struct FadeState { - int start_volume; - int end_volume; - int duration_ms; - int step_ms; + int start_volume; + int end_volume; + int duration_ms; + int step_ms; }; static struct FadeState fade; enum FadeCode { - Fade_continue, - Fade_finished + Fade_continue, + Fade_finished }; static enum FadeCode processmusicfade(struct FadeState* state, int* volume) { - int range; - int new_volume; + int range; + int new_volume; - if (state->duration_ms == 0 /* Fast path. */ - || state->start_volume == state->end_volume /* Fast path. */ - || state->step_ms >= state->duration_ms /* We're finished. */) - { - *volume = state->end_volume; - state->step_ms = 0; - return Fade_finished; - } + if (state->duration_ms == 0 /* Fast path. */ + || state->start_volume == state->end_volume /* Fast path. */ + || state->step_ms >= state->duration_ms /* We're finished. */) + { + *volume = state->end_volume; + state->step_ms = 0; + return Fade_finished; + } - range = state->end_volume - state->start_volume; - new_volume = range * state->step_ms / state->duration_ms; - new_volume += state->start_volume; + range = state->end_volume - state->start_volume; + new_volume = range * state->step_ms / state->duration_ms; + new_volume += state->start_volume; - *volume = new_volume; + *volume = new_volume; - state->step_ms += game.get_timestep(); + state->step_ms += game.get_timestep(); - return Fade_continue; + return Fade_continue; } void musicclass::fadeMusicVolumeIn(int ms) { - if (halted()) - { - return; - } + m_doFadeInVol = true; + m_doFadeOutVol = false; - m_doFadeInVol = true; - m_doFadeOutVol = false; + /* Ensure it starts at 0 */ + musicVolume = 0; - /* Ensure it starts at 0 */ - controlVolume = 0; + /* Fix 1-frame glitch */ + Mix_VolumeMusic(0); - /* Fix 1-frame glitch */ - set_music_volume(0); - - fade.step_ms = 0; - fade.duration_ms = ms; - fade.start_volume = 0; - fade.end_volume = VVV_MAX_VOLUME; + fade.step_ms = 0; + fade.duration_ms = ms; + fade.start_volume = 0; + fade.end_volume = MIX_MAX_VOLUME; } void musicclass::fadeMusicVolumeOut(const int fadeout_ms) { - if (halted()) - { - return; - } + m_doFadeInVol = false; + m_doFadeOutVol = true; - m_doFadeInVol = false; - m_doFadeOutVol = true; - - fade.step_ms = 0; - /* Duration is proportional to current volume. */ - fade.duration_ms = fadeout_ms * controlVolume / VVV_MAX_VOLUME; - fade.start_volume = controlVolume; - fade.end_volume = 0; + fade.step_ms = 0; + /* Duration is proportional to current volume. */ + fade.duration_ms = fadeout_ms * musicVolume / MIX_MAX_VOLUME; + fade.start_volume = musicVolume; + fade.end_volume = 0; } void musicclass::fadeout(const bool quick_fade_ /*= true*/) { - fadeMusicVolumeOut(quick_fade_ ? 500 : 2000); - quick_fade = quick_fade_; + fadeMusicVolumeOut(quick_fade_ ? 500 : 2000); + quick_fade = quick_fade_; } void musicclass::processmusicfadein(void) { - enum FadeCode fade_code = processmusicfade(&fade, &controlVolume); - if (fade_code == Fade_finished) - { - m_doFadeInVol = false; - } + enum FadeCode fade_code = processmusicfade(&fade, &musicVolume); + if (fade_code == Fade_finished) + { + m_doFadeInVol = false; + } } void musicclass::processmusicfadeout(void) { - enum FadeCode fade_code = processmusicfade(&fade, &controlVolume); - if (fade_code == Fade_finished) - { - controlVolume = 0; - m_doFadeOutVol = false; - haltdasmusik(true); - } + enum FadeCode fade_code = processmusicfade(&fade, &musicVolume); + if (fade_code == Fade_finished) + { + musicVolume = 0; + m_doFadeOutVol = false; + haltdasmusik(); + } } void musicclass::processmusic(void) { - if(!safeToProcessMusic) - { - return; - } + if(!safeToProcessMusic) + { + return; + } - if(m_doFadeInVol) - { - processmusicfadein(); - } + if(m_doFadeInVol) + { + processmusicfadein(); + } - if (m_doFadeOutVol) - { - processmusicfadeout(); - } + if (m_doFadeOutVol) + { + processmusicfadeout(); + } - /* This needs to come after processing fades */ - if (nicefade && halted()) - { - play(nicechange); - nicechange = -1; - nicefade = false; - } + /* This needs to come after processing fades */ + if (nicefade && Mix_PausedMusic() == 1) + { + play(nicechange); + nicechange = -1; + nicefade = false; + } } void musicclass::niceplay(int t) { - /* important: do nothing if the correct song is playing! */ - if ((!mmmmmm && currentsong != t) - || (mmmmmm && usingmmmmmm && currentsong != t) - || (mmmmmm && !usingmmmmmm && currentsong != t + num_mmmmmm_tracks)) - { - if (currentsong != -1) - { - fadeout(false); - } - nicefade = true; - } - nicechange = t; + /* important: do nothing if the correct song is playing! */ + if ((!mmmmmm && currentsong != t) + || (mmmmmm && usingmmmmmm && currentsong != t) + || (mmmmmm && !usingmmmmmm && currentsong != t + num_mmmmmm_tracks)) + { + if (currentsong != -1) + { + fadeout(false); + } + nicefade = true; + } + nicechange = t; } static const int areamap[] = { - 4, 3, 3, 3, 3, 3, 3, 3, 4,-2, 4, 4, 4,12,12,12,12,12,12,12, - 4, 3, 3, 3, 3, 3, 3, 4, 4,-2, 4, 4, 4, 4,12,12,12,12,12,12, - 4, 4, 4, 4, 3, 4, 4, 4, 4,-2, 4, 4, 4, 4,12,12,12,12,12,12, - 4, 4, 4, 4, 3, 4, 4, 4, 4,-2, 4, 4, 1, 1, 1, 1,12,12,12,12, - 4, 4, 3, 3, 3, 4, 4, 4, 4,-2,-2,-2, 1, 1, 1, 1, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4,-2, 1, 1, 1, 1, 1, 1,11,11,-1, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4,-2, 1, 1, 1, 1, 1, 1, 1,11,11,11, - 4, 4, 4, 4, 4, 4, 4, 4, 4,-2, 1, 1, 1, 1, 1, 1, 1, 1, 1,11, - 4, 4, 4, 4, 4, 4, 4, 4, 4,-2, 4, 4, 4, 1, 1, 1, 1, 1, 1, 3, - 4, 4, 4, 4, 4, 4, 4, 4,-2,-2, 4, 4, 4, 1, 1, 1, 1, 1, 1, 4, - 4, 4,-1,-1,-1, 4, 4, 4, 4,-2, 4, 4, 4, 1, 1, 1, 1, 1, 1, 4, - 4, 4,-1,-1,-1, 4, 4, 4, 4,-2, 4, 1, 1, 1, 1, 1, 1, 1, 1, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4,-2, 4, 1, 1, 1, 1, 1, 1, 4, 1, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4,-2, 4, 1, 1, 1, 1, 1, 1, 4, 1, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4,-2, 4,-1,-3, 4, 4, 4, 4, 4, 1, 4, - 4, 4, 4, 4, 4, 3, 3, 3, 4,-2, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 3, 3, 3, 3, 3, 3, 4,-2, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 3, 3, 3, 3, 3, 3, 3, 4,-2, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 3, 3, 3, 3, 3, 4, 4, 3, 4,-2, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 3, 3, 3, 3, 3, 4, 4, 3, 4,-2, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 + 4, 3, 3, 3, 3, 3, 3, 3, 4,-2, 4, 4, 4,12,12,12,12,12,12,12, + 4, 3, 3, 3, 3, 3, 3, 4, 4,-2, 4, 4, 4, 4,12,12,12,12,12,12, + 4, 4, 4, 4, 3, 4, 4, 4, 4,-2, 4, 4, 4, 4,12,12,12,12,12,12, + 4, 4, 4, 4, 3, 4, 4, 4, 4,-2, 4, 4, 1, 1, 1, 1,12,12,12,12, + 4, 4, 3, 3, 3, 4, 4, 4, 4,-2,-2,-2, 1, 1, 1, 1, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4,-2, 1, 1, 1, 1, 1, 1,11,11,-1, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4,-2, 1, 1, 1, 1, 1, 1, 1,11,11,11, + 4, 4, 4, 4, 4, 4, 4, 4, 4,-2, 1, 1, 1, 1, 1, 1, 1, 1, 1,11, + 4, 4, 4, 4, 4, 4, 4, 4, 4,-2, 4, 4, 4, 1, 1, 1, 1, 1, 1, 3, + 4, 4, 4, 4, 4, 4, 4, 4,-2,-2, 4, 4, 4, 1, 1, 1, 1, 1, 1, 4, + 4, 4,-1,-1,-1, 4, 4, 4, 4,-2, 4, 4, 4, 1, 1, 1, 1, 1, 1, 4, + 4, 4,-1,-1,-1, 4, 4, 4, 4,-2, 4, 1, 1, 1, 1, 1, 1, 1, 1, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4,-2, 4, 1, 1, 1, 1, 1, 1, 4, 1, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4,-2, 4, 1, 1, 1, 1, 1, 1, 4, 1, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4,-2, 4,-1,-3, 4, 4, 4, 4, 4, 1, 4, + 4, 4, 4, 4, 4, 3, 3, 3, 4,-2, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 3, 3, 3, 3, 3, 3, 4,-2, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 3, 3, 3, 3, 3, 3, 3, 4,-2, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 3, 3, 3, 3, 3, 4, 4, 3, 4,-2, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 3, 3, 3, 3, 3, 4, 4, 3, 4,-2, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 }; SDL_COMPILE_TIME_ASSERT(areamap, SDL_arraysize(areamap) == 20 * 20); void musicclass::changemusicarea(int x, int y) { - int room; - int track; + int room; + int track; - if (script.running) - { - return; - } + if (script.running) + { + return; + } - room = musicroom(x, y); + room = musicroom(x, y); - if (!INBOUNDS_ARR(room, areamap)) - { - SDL_assert(0 && "Music map index out-of-bounds!"); - return; - } + if (!INBOUNDS_ARR(room, areamap)) + { + SDL_assert(0 && "Music map index out-of-bounds!"); + return; + } - track = areamap[room]; + track = areamap[room]; - switch (track) - { - case -1: - /* Don't change music. */ - return; - case -2: - /* Special case: Tower music, changes with Flip Mode. */ - if (graphics.setflipmode) - { - track = 9; /* ecroF evitisoP */ - } - else - { - track = 2; /* Positive Force */ - } - break; - case -3: - /* Special case: start of Space Station 2. */ - if (game.intimetrial) - { - track = 1; /* Pushing Onwards */ - } - else - { - track = 4; /* Passion for Exploring */ - } - break; - } + switch (track) + { + case -1: + /* Don't change music. */ + return; + case -2: + /* Special case: Tower music, changes with Flip Mode. */ + if (graphics.setflipmode) + { + track = 9; /* ecroF evitisoP */ + } + else + { + track = 2; /* Positive Force */ + } + break; + case -3: + /* Special case: start of Space Station 2. */ + if (game.intimetrial) + { + track = 1; /* Pushing Onwards */ + } + else + { + track = 4; /* Passion for Exploring */ + } + break; + } - niceplay(track); + niceplay(track); } void musicclass::playef(int t) { - if (!INBOUNDS_VEC(t, soundTracks)) - { - return; - } - soundTracks[t].Play(); + if (!INBOUNDS_VEC(t, soundTracks)) + { + return; + } + int channel; + + channel = Mix_PlayChannel(-1, soundTracks[t].sound, 0); + if(channel == -1) + { + fprintf(stderr, "Unable to play WAV file: %s\n", Mix_GetError()); + } } void musicclass::pauseef(void) { - SoundTrack::Pause(); + Mix_Pause(-1); } void musicclass::resumeef(void) { - SoundTrack::Resume(); -} - -bool musicclass::halted(void) -{ - return MusicTrack::IsPaused(); -} - -void musicclass::updatemutestate(void) -{ - if (game.muted) - { - set_music_volume(0); - set_sound_volume(0); - } - else - { - set_sound_volume(VVV_MAX_VOLUME); - - if (game.musicmuted) - { - set_music_volume(0); - } - else - { - set_music_volume(controlVolume); - } - } + Mix_Resume(-1); } diff --git a/desktop_version/src/Music.h b/desktop_version/src/Music.h index 5e994977..e987656c 100644 --- a/desktop_version/src/Music.h +++ b/desktop_version/src/Music.h @@ -1,7 +1,10 @@ #ifndef MUSIC_H #define MUSIC_H +#include + #include "BinaryBlob.h" +#include "SoundSystem.h" #define musicroom(rx, ry) ((rx) + ((ry) * 20)) @@ -11,119 +14,62 @@ /* It is advised that USER_VOLUME_MAX be divisible by this. */ #define USER_VOLUME_STEP 32 -enum -{ - Music_PATHCOMPLETE = 0, - Music_PUSHINGONWARDS = 1, - Music_POSITIVEFORCE = 2, - Music_POTENTIALFORANYTHING = 3, - Music_PASSIONFOREXPLORING = 4, - Music_PAUSE = 5, - Music_PRESENTINGVVVVVV = 6, - Music_PLENARY = 7, - Music_PREDESTINEDFATE = 8, - Music_POSITIVEFORCEREVERSED = 9, - Music_POPULARPOTPOURRI = 10, - Music_PIPEDREAM = 11, - Music_PRESSURECOOKER = 12, - Music_PACEDENERGY = 13, - Music_PIERCINGTHESKY = 14, - Music_PREDESTINEDFATEREMIX = 15 -}; - -enum -{ - Sound_FLIP = 0, - Sound_UNFLIP = 1, - Sound_CRY = 2, - Sound_TRINKET = 3, - Sound_COIN = 4, - Sound_CHECKPOINT = 5, - Sound_CRUMBLE = 6, - Sound_DISAPPEAR = 7, - Sound_GRAVITYLINE = 8, - Sound_FLASH = 9, - Sound_TELEPORT = 10, - Sound_VIRIDIAN = 11, - Sound_VERDIGRIS = 12, - Sound_VICTORIA = 13, - Sound_VITELLARY = 14, - Sound_VIOLET = 15, - Sound_VERMILION = 16, - Sound_TERMINALTOUCH = 17, - Sound_GAMESAVED = 18, - Sound_ALARM = 19, - Sound_TERMINALTEXT = 20, - Sound_COUNTDOWN = 21, - Sound_GO = 22, - Sound_DESTROY = 23, - Sound_COMBINE = 24, - Sound_NEWRECORD = 25, - Sound_TROPHY = 26, - Sound_RESCUE = 27 -}; - class musicclass { public: - musicclass(void); - void init(void); - void destroy(void); + musicclass(void); + void init(void); + void destroy(void); - void set_music_volume(int volume); - void set_sound_volume(int volume); + void play(int t); + void resume(); + void resumefade(const int fadein_ms); + void pause(void); + void haltdasmusik(void); + void silencedasmusik(void); + void fadeMusicVolumeIn(int ms); + void fadeMusicVolumeOut(const int fadeout_ms); + void fadeout(const bool quick_fade_ = true); + void fadein(void); + void processmusicfadein(void); + void processmusicfadeout(void); + void processmusic(void); + void niceplay(int t); - void play(int t); - void resume(void); - void resumefade(const int fadein_ms); - void pause(void); - void haltdasmusik(void); - void haltdasmusik(bool from_fade); - void silencedasmusik(void); - void fadeMusicVolumeIn(int ms); - void fadeMusicVolumeOut(const int fadeout_ms); - void fadeout(const bool quick_fade_ = true); - void fadein(void); - void processmusicfadein(void); - void processmusicfadeout(void); - void processmusic(void); - void niceplay(int t); + void changemusicarea(int x, int y); - void changemusicarea(int x, int y); + int currentsong; - int currentsong; - int haltedsong; + void playef(int t); + void pauseef(void); + void resumeef(void); - void playef(int t); - void pauseef(void); - void resumeef(void); + std::vector soundTracks; + std::vector musicTracks; + SoundSystem soundSystem; + bool safeToProcessMusic; - bool halted(void); - void updatemutestate(void); + int nicechange; // -1 if no song queued + bool nicefade; - bool safeToProcessMusic; + bool m_doFadeInVol; + bool m_doFadeOutVol; + int musicVolume; - int nicechange; // -1 if no song queued - bool nicefade; + /* 0..USER_VOLUME_MAX */ + int user_music_volume; + int user_sound_volume; - bool m_doFadeInVol; - bool m_doFadeOutVol; - int controlVolume; + bool quick_fade; - /* 0..USER_VOLUME_MAX */ - int user_music_volume; - int user_sound_volume; + // MMMMMM mod settings + bool mmmmmm; + bool usingmmmmmm; - bool quick_fade; - - // MMMMMM mod settings - bool mmmmmm; - bool usingmmmmmm; - - binaryBlob pppppp_blob; - binaryBlob mmmmmm_blob; - int num_pppppp_tracks; - int num_mmmmmm_tracks; + binaryBlob pppppp_blob; + binaryBlob mmmmmm_blob; + int num_pppppp_tracks; + int num_mmmmmm_tracks; }; #ifndef MUSIC_DEFINITION diff --git a/desktop_version/src/Network.c b/desktop_version/src/Network.c index e0cfdf2b..dc8a0112 100644 --- a/desktop_version/src/Network.c +++ b/desktop_version/src/Network.c @@ -4,12 +4,12 @@ #include "Unused.h" #ifdef MAKEANDPLAY - #ifdef STEAM_NETWORK - #undef STEAM_NETWORK - #endif - #ifdef GOG_NETWORK - #undef GOG_NETWORK - #endif + #ifdef STEAM_NETWORK + #undef STEAM_NETWORK + #endif + #ifdef GOG_NETWORK + #undef GOG_NETWORK + #endif #endif #ifdef STEAM_NETWORK @@ -25,10 +25,12 @@ #define NUM_BACKENDS (STEAM_NUM+GOG_NUM) #define DECLARE_BACKEND(name) \ - int32_t name##_init(void); \ - void name##_shutdown(void); \ - void name##_update(void); \ - void name##_unlockAchievement(const char *name); + int32_t name##_init(void); \ + void name##_shutdown(void); \ + void name##_update(void); \ + void name##_unlockAchievement(const char *name); \ + int32_t name##_getAchievementProgress(const char *name); \ + void name##_setAchievementProgress(const char *name, int32_t stat); #ifdef STEAM_NETWORK DECLARE_BACKEND(STEAM) #endif @@ -39,11 +41,13 @@ DECLARE_BACKEND(GOG) typedef struct NetworkBackend { - int32_t IsInit; - int32_t (*Init)(void); - void (*Shutdown)(void); - void (*Update)(void); - void (*UnlockAchievement)(const char*); + int32_t IsInit; + int32_t (*Init)(void); + void (*Shutdown)(void); + void (*Update)(void); + void (*UnlockAchievement)(const char*); + int32_t (*GetAchievementProgress)(const char*); + void (*SetAchievementProgress)(const char*, int32_t); } NetworkBackend; #if NUM_BACKENDS > 0 @@ -52,65 +56,101 @@ static NetworkBackend backends[NUM_BACKENDS]; int NETWORK_init(void) { - int32_t i, any = 0; - #define ASSIGN_BACKEND(name, index) \ - backends[index].Init = name##_init; \ - backends[index].Shutdown = name##_shutdown; \ - backends[index].Update = name##_update; \ - backends[index].UnlockAchievement = name##_unlockAchievement; - #ifdef STEAM_NETWORK - ASSIGN_BACKEND(STEAM, 0) - #endif - #ifdef GOG_NETWORK - ASSIGN_BACKEND(GOG, STEAM_NUM) - #endif - #undef ASSIGN_BACKEND - #if NUM_BACKENDS > 0 - for (i = 0; i < NUM_BACKENDS; i += 1) - { - backends[i].IsInit = backends[i].Init(); - any |= backends[i].IsInit; - } - #else - UNUSED(i); - #endif - return any; + int32_t i, any = 0; + #define ASSIGN_BACKEND(name, index) \ + backends[index].Init = name##_init; \ + backends[index].Shutdown = name##_shutdown; \ + backends[index].Update = name##_update; \ + backends[index].UnlockAchievement = name##_unlockAchievement; \ + backends[index].GetAchievementProgress = name##_getAchievementProgress; \ + backends[index].SetAchievementProgress = name##_setAchievementProgress; + #ifdef STEAM_NETWORK + ASSIGN_BACKEND(STEAM, 0) + #endif + #ifdef GOG_NETWORK + ASSIGN_BACKEND(GOG, STEAM_NUM) + #endif + #undef ASSIGN_BACKEND + #if NUM_BACKENDS > 0 + for (i = 0; i < NUM_BACKENDS; i += 1) + { + backends[i].IsInit = backends[i].Init(); + any |= backends[i].IsInit; + } + #endif + return any; } void NETWORK_shutdown(void) { - #if NUM_BACKENDS > 0 - int32_t i; - for (i = 0; i < NUM_BACKENDS; i += 1) - if (backends[i].IsInit) - { - backends[i].Shutdown(); - } - #endif + #if NUM_BACKENDS > 0 + int32_t i; + for (i = 0; i < NUM_BACKENDS; i += 1) + if (backends[i].IsInit) + { + backends[i].Shutdown(); + } + #endif } void NETWORK_update(void) { - #if NUM_BACKENDS > 0 - int32_t i; - for (i = 0; i < NUM_BACKENDS; i += 1) - if (backends[i].IsInit) - { - backends[i].Update(); - } - #endif + #if NUM_BACKENDS > 0 + int32_t i; + for (i = 0; i < NUM_BACKENDS; i += 1) + if (backends[i].IsInit) + { + backends[i].Update(); + } + #endif } void NETWORK_unlockAchievement(const char *name) { - #if NUM_BACKENDS > 0 - int32_t i; - for (i = 0; i < NUM_BACKENDS; i += 1) - if (backends[i].IsInit) - { - backends[i].UnlockAchievement(name); - } - #else - UNUSED(name); - #endif + #if NUM_BACKENDS > 0 + int32_t i; + for (i = 0; i < NUM_BACKENDS; i += 1) + if (backends[i].IsInit) + { + backends[i].UnlockAchievement(name); + } + #else + UNUSED(name); + #endif +} + +int32_t NETWORK_getAchievementProgress(const char *name) +{ + /* The highest stat gets priority, will eventually pass to the others */ + int32_t max = 0; + #if NUM_BACKENDS > 0 + int32_t i, stat; + for (i = 0; i < NUM_BACKENDS; i += 1) + if (backends[i].IsInit) + { + stat = backends[i].GetAchievementProgress(name); + if (stat > max) + { + max = stat; + } + } + #else + UNUSED(name); + #endif + return max; +} + +void NETWORK_setAchievementProgress(const char *name, int32_t stat) +{ + #if NUM_BACKENDS > 0 + int32_t i; + for (i = 0; i < NUM_BACKENDS; i += 1) + if (backends[i].IsInit) + { + backends[i].SetAchievementProgress(name, stat); + } + #else + UNUSED(name); + UNUSED(stat); + #endif } diff --git a/desktop_version/src/Otherlevel.cpp b/desktop_version/src/Otherlevel.cpp index c3528cce..97ce61c8 100644 --- a/desktop_version/src/Otherlevel.cpp +++ b/desktop_version/src/Otherlevel.cpp @@ -1,9193 +1,9191 @@ #include "Otherlevel.h" #include "Game.h" -#include "Graphics.h" #include "Entity.h" #include "MakeAndPlay.h" #include "UtilityClass.h" const short* otherlevelclass::loadlevel(int rx, int ry) { - int t; - roomtileset = 1; + int t; + roomtileset = 1; - rx -= 100; - ry -= 100; - t = rx + (ry * 100); - const short* result; - roomname = ""; - roomname_special = false; - hiddenname = "Dimension VVVVVV"; + rx -= 100; + ry -= 100; + t = rx + (ry * 100); + const short* result; + roomname = ""; + hiddenname = "Dimension VVVVVV"; - switch(t) - { + switch(t) + { #if !defined(MAKEANDPLAY) - case rn(0,0): - { - - static const short contents[] = { - 201,201,201,201,200,80,80,202,200,80,80,80,80,80,80,80,80,80,80,80,80,80,202,200,80,202,201,201,201,201,200,80,202,606,486,486,486,486,486,486, - 201,201,201,201,200,80,80,202,200,80,80,80,80,80,80,80,80,80,80,80,80,80,202,200,80,202,201,201,201,201,200,80,202,606,486,486,486,486,486,486, - 201,201,201,201,200,80,80,202,240,241,241,241,241,241,241,241,241,241,241,241,241,241,242,200,80,202,201,201,201,201,200,80,202,606,486,486,486,486,486,486, - 201,201,201,201,200,80,80,202,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,80,202,201,201,201,201,200,80,202,606,486,486,486,486,486,486, - 201,201,201,201,200,80,80,202,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,80,202,201,201,201,201,200,80,202,606,486,486,486,486,486,486, - 201,201,201,201,240,241,241,242,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,80,202,201,201,201,201,200,80,202,606,486,486,486,486,486,486, - 201,201,201,201,160,161,162,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,80,121,161,161,161,161,122,80,202,606,486,486,486,486,486,486, - 201,201,201,201,200,80,202,687,687,687,687,687,687,687,687,687,687,687,687,687,687,687,687,200,80,80,80,80,80,80,80,80,202,606,486,486,486,486,486,486, - 201,201,201,201,200,80,202,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,240,241,241,241,241,241,241,241,241,242,606,486,486,486,486,486,486, - 201,201,201,201,200,80,202,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,686,0,0,160,162,606,486,486,486,486,486,486, - 201,201,201,201,200,80,202,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,686,0,0,240,242,606,486,486,486,486,486,486, - 201,201,201,201,200,80,202,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,686,0,0,0,0,606,486,486,486,486,486,486, - 201,201,201,201,200,80,202,687,687,687,687,687,687,687,687,687,687,687,687,687,687,687,687,687,688,687,687,687,688,687,687,687,687,606,486,486,486,486,486,486, - 201,201,201,201,240,241,242,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,686,0,0,0,0,606,486,486,486,486,486,486, - 201,201,201,201,160,161,161,162,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,686,0,0,0,0,606,486,486,486,486,486,486, - 201,201,201,201,200,80,80,202,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,686,0,0,0,0,606,486,486,486,486,486,486, - 201,201,201,201,200,80,80,202,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,686,0,0,0,0,606,486,486,486,486,486,486, - 201,201,201,201,200,80,80,202,160,161,161,161,161,161,161,161,161,161,161,161,161,161,162,0,686,0,0,0,686,0,0,0,0,606,486,486,486,486,486,486, - 201,201,201,201,200,80,80,202,200,80,80,80,80,80,80,80,80,80,80,80,80,80,202,0,686,0,0,0,686,0,0,0,0,606,486,486,486,486,486,486, - 201,201,201,201,200,80,80,202,200,80,80,80,80,80,80,80,80,80,80,80,80,80,202,160,161,162,0,0,686,0,0,0,0,606,486,486,486,486,486,486, - 161,161,161,162,200,80,80,202,200,80,80,80,80,80,80,80,80,80,80,80,80,80,202,200,80,202,160,161,161,162,0,0,0,606,486,486,486,486,486,486, - 80,80,80,202,200,80,80,202,200,80,80,80,80,80,80,80,80,80,80,80,80,80,202,200,80,202,240,241,241,242,0,0,0,606,486,486,486,486,486,486, - 241,241,241,242,240,241,241,242,240,241,241,241,241,241,241,241,241,241,241,241,241,241,242,240,241,242,0,0,0,0,0,0,0,606,486,486,486,486,486,486, - 567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,568,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,487,647,647,647,647,647,647,648,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486, - }; - - obj.createentity(72, 32, 14); //Teleporter! - obj.createentity(216, 144, 20, 1); - - obj.createblock(5, 216-4, 144, 20, 16, 8); - result = contents; - break; - } - - case rn(0,1): - { - - static const short contents[] = { - 495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,536,577,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,575,537,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,575,537,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,617,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,615,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,536,577,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,536,577,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,617,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,615,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,496,657,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,655,497,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,496,657,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,496,657,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,655,497,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495, - }; - result = contents; - break; - } - - case rn(0,2): - { - - static const short contents[] = { - 492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,572,534,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,533,574,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,572,534,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,572,534,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,533,574,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,572,534,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,572,573,573,573,573,534,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,572,573,573,573,534,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,533,574,0,0,0,0,0,572,573,534,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,533,574,693,693,693,693,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,652,653,653,653,494,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,692,0,0,652,653,653,494,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,533,574,0,0,0,0,692,0,0,0,0,0,652,494,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,692,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,692,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,533,573,573,574,0,692,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,533,573,573,574,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,533,574,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,693,693,693,693,612,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,572,534,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - }; - result = contents; - break; - } - - case rn(0,3): - { - - static const short contents[] = { - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,681,681,681,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,681,681,681,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,481,641,641,642,0,0,0,640,482,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,481,641,641,641,642,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,481,641,641,641,641,642,0,0,0,0,0,0,0,0,0,0,0,640,641,641,482,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,640,641,641,482,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,481,642,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,640,641,641,641,641,641,641,641, - 480,480,480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 480,480,480,480,480,480,480,481,642,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 480,480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 480,480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 480,480,480,480,480,480,481,642,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 480,480,480,480,480,481,642,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - }; - result = contents; - break; - } - - case rn(0,4): - { - - static const short contents[] = { - 495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,495,617,0,0,0,0,0,575,576,576,576,576,576,576,576,576,576,576,577,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,495,617,696,696,696,696,696,615,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,496,657,0,0,0,0,0,655,656,656,656,656,656,656,656,656,656,656,657,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,496,656,657,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 656,656,657,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - }; - result = contents; - break; - } - - case rn(0,5): - { - - static const short contents[] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,569,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570, - 0,0,0,0,0,0,0,0,0,0,0,569,570,570,570,570,570,570,570,570,531,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 0,0,0,0,0,0,0,0,0,6,6,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 0,0,0,0,0,0,0,0,0,569,570,531,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 6,6,6,6,6,6,6,6,6,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 570,570,570,570,570,570,570,570,570,531,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - }; - result = contents; - break; - } - - case rn(0,6): - { - - static const short contents[] = { - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,481,641,641,641,641,641,641,641,641,641,641,641,641,641,641,482,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,680,0,0,680,0,0,0,0,0,600,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,680,0,0,680,0,0,0,0,0,600,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,680,0,0,680,0,0,0,0,0,600,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,680,0,0,680,0,0,0,0,0,600,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,560,561,561,561,561,562,0,0,0,0,600,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,681,681,681,681,600,480,480,480,480,602,681,681,681,681,640,641, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,600,480,480,480,480,602,0,0,0,0,0,0, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,600,480,480,480,480,602,0,0,0,0,0,0, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,681,681,681,681,600,480,480,480,480,602,0,0,0,0,0,0, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,640,641,641,641,641,642,0,0,0,0,0,0, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,680,0,0,680,0,0,0,0,0,0,0, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,680,0,0,680,0,0,0,0,0,0,0, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,680,0,0,680,0,0,0,0,0,0,0, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,680,0,0,680,0,0,0,0,0,0,0, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,521,561,561,561,561,561,561,561,561,561,562,0,0,0,0,0,0, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0, - }; - result = contents; - break; - } - - case rn(0,7): - { - - static const short contents[] = { - 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,0, - 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,0, - 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,0, - 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,0, - 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,0, - 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,0, - 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,0, - 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,0, - 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,0, - 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,0, - 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,0, - 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,0, - 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,502,662,663,0,0,0,0,0,0, - 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,502,662,662,663,0,0,0,0,0,0,0,0, - 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,502,662,662,663,0,0,0,0,0,0,0,0,0,0,0, - 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - }; - result = contents; - break; - } - - case rn(0,8): - { - - static const short contents[] = { - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,539,580,0,0,0,0,0,0,0,0,0,0,0,0,0, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,539,580,0,0,0,0,0,0,0,0,0,0,0,0, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,539,580,699,699,699,699,699,699,699,699,699,699,699, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,539,580,0,0,0,0,0,0,0,0,0,0, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,539,580,0,0,0,0,0,0,0,0,0, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,539,580,0,0,0,0,0,0,0,0, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,539,580,0,0,0,0,0,0,0, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0, - }; - result = contents; - break; - } - - case rn(0,9): - { - - static const short contents[] = { - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0,0, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0,0, - 641,641,641,641,482,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0,0, - 0,0,0,0,640,641,641,641,641,641,641,641,641,641,641,641,641,641,641,482,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,640,641,641,482,480,480,480,480,480,480,480,480,480,521,562,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,640,482,480,480,480,480,480,480,480,480,480,521,562,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,640,482,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,640,641,482,480,480,480,480,480,480,480,602,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,640,641,641,482,480,480,480,480,602,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,640,641,641,482,480,602,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,600,480,602,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,640,641,642,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,680,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,680,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,680,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,680,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,680,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,680,0,0,0,0,0,0, - 561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - }; - - obj.createentity(152, 144, 10, 1, 9000); // (savepoint) - result = contents; - break; - } - - case rn(0,10): - { - - static const short contents[] = { - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,484,644,644,644,644,644,644,644,485,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,484,644,644,644,644,645,7,7,7,7,7,7,7,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,605,7,7,7,7,7,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,643,644,485,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,484,644,644,644, - 644,644,644,644,644,645,0,0,0,0,0,0,0,0,0,0,0,0,7,7,603,483,483,483,483,483,483,483,483,483,483,483,483,483,484,644,645,7,7,7, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,643,644,644,644,644,485,483,483,483,483,483,483,484,644,645,7,7,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,563,565,0,0,0,7,7,7,7,7,603,483,483,483,483,483,483,605,7,7,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,643,645,0,0,0,0,0,0,0,0,643,644,644,644,644,644,644,645,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,563,565,0,0,0,0,0,0,0,0,0,563,565,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,603,605,6,6,6,6,6,6,6,6,6,603,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,603,524,564,564,564,564,564,564,564,564,564,525,605,6,6,0,0,0,0,0,0,0,0,0,0,0,0,563,564,564, - 6,6,6,6,6,6,6,6,6,6,603,483,483,483,483,483,483,483,483,483,483,483,524,564,565,6,6,6,6,6,6,6,6,6,6,6,6,603,483,483, - 564,564,564,564,564,564,564,564,564,564,525,483,483,483,483,483,483,483,483,483,483,483,483,483,524,564,564,564,564,564,564,564,564,564,564,564,564,525,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - }; - - obj.createentity(224, 96, 10, 0, 10000); // (savepoint) - result = contents; - break; - } - - case rn(0,11): - { - - static const short contents[] = { - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 641,641,641,641,641,641,641,641,641,641,482,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,481,641,641,641,641,641,641,641,641,641,641,641,482,480,480,480,480,480,480, - 0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,602,0,680,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480, - 0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,481,641,641,642,0,680,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480, - 0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,602,0,0,0,0,680,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480, - 561,561,561,561,561,561,561,561,561,561,522,480,480,480,480,481,641,641,642,0,0,0,0,680,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,481,641,641,642,0,0,0,0,0,0,0,680,0,560,561,561,562,0,0,0,0,600,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,602,0,680,0,0,0,0,0,0,0,0,680,0,600,480,480,602,681,681,681,681,600,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,481,641,641,642,0,680,0,0,0,0,0,0,0,560,561,561,522,480,480,602,0,0,0,0,600,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,602,0,0,0,0,680,0,0,0,0,0,0,0,600,480,480,480,480,480,602,0,0,0,0,600,480,480,480,480,480,480, - 480,480,480,480,480,480,481,641,641,642,0,0,0,0,680,0,0,0,0,560,561,561,522,480,480,480,480,480,602,0,0,0,0,600,480,480,480,480,480,480, - 480,480,480,480,480,480,602,0,0,0,0,0,0,0,680,0,0,0,0,600,480,480,480,480,480,480,480,480,602,0,0,0,0,600,480,480,480,480,480,480, - 480,480,480,481,641,641,642,0,0,0,0,0,0,0,680,0,560,561,561,522,480,480,480,480,480,480,480,480,602,681,681,681,681,600,480,480,480,480,480,480, - 480,480,480,602,0,680,0,0,0,0,0,0,0,0,680,0,600,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,600,480,480,480,480,480,480, - 641,641,641,642,0,680,0,0,0,0,0,0,0,560,561,561,522,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,600,480,480,480,480,480,480, - 0,0,0,0,0,680,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,600,480,480,480,480,480,480, - 0,0,0,0,0,680,0,0,0,0,560,561,561,522,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,600,480,480,480,480,480,480, - 0,0,0,0,0,680,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,681,681,681,681,600,480,480,480,480,480,480, - 0,0,0,0,0,680,0,560,561,561,522,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,600,480,480,480,480,480,480, - 0,0,0,0,0,680,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,640,641,641,641,641,641,641, - 0,0,0,0,560,561,561,522,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0, - 561,561,561,561,522,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,521,561,561,561,561,561,561,561,561,561,561,561, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - }; - - obj.createentity(56, 32, 13); //Warp Token - - result = contents; - break; - } - - case rn(0,12): - { - - static const short contents[] = { - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 653,653,653,653,653,653,494,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 0,692,0,0,0,0,652,653,653,494,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 0,692,0,0,0,0,0,692,0,652,494,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 0,692,0,0,0,0,0,692,0,0,652,494,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 573,573,573,574,0,0,0,692,0,0,0,652,494,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,533,573,574,0,692,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,533,574,692,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,533,574,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,533,574,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,614,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,614,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,493,653,653,653,653,653,653,653,653,653,653,653, - 492,492,492,492,492,492,492,492,614,0,0,0,612,492,492,492,492,492,492,492,492,492,492,493,653,653,653,653,654,0,0,0,0,0,0,0,0,0,0,0, - 492,492,492,492,492,492,492,492,614,0,0,0,612,492,492,492,492,492,492,492,493,653,653,654,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0, - 492,492,492,492,492,492,492,492,614,0,0,0,652,653,494,492,492,493,653,653,654,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0, - 492,492,492,492,492,492,492,492,614,0,0,0,692,0,652,653,653,654,0,692,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0, - 492,492,492,492,492,492,492,492,614,0,0,0,692,0,0,0,0,0,0,692,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0, - 492,492,492,492,492,492,492,492,614,693,693,693,694,693,693,693,693,693,693,694,693,693,693,693,693,693,693,694,693,693,0,0,0,0,0,0,0,0,0,0, - 492,492,492,492,492,492,492,492,614,0,0,0,692,0,0,0,0,0,0,692,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0, - 492,492,492,492,492,492,493,653,654,0,0,0,692,0,0,0,0,0,0,692,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0, - 492,493,653,653,653,653,654,0,0,0,0,0,692,0,0,0,0,0,0,692,0,0,0,0,0,0,572,573,574,0,0,0,0,0,0,0,0,0,0,0, - 653,654,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,692,0,0,0,0,0,0,652,653,654,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,572,573,574,0,0,0,0,572,573,574,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,652,653,654,0,0,0,0,652,653,654,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - }; - result = contents; - break; - } - - case rn(0,13): - { - - static const short contents[] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,563,564,565,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,643,644,645,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,563,564,565,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,643,644,645,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,563,564,565,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,643,644,645,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,563,564,565,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,643,644,645,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,563,564,565,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,605,0,0,0,0,563,564,564,564,564,564,564,564,564,564,564,564,564,564, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,563,564,564,525,483,524,564,564,564,564,525,483,483,483,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,563,564,564,564,564,564,564,564,564,564,525,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 564,564,564,564,564,564,525,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - }; - result = contents; - break; - } - - case rn(0,14): - { - - static const short contents[] = { - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,496,656,656,656, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,496,657,0,0,0, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,496,657,0,0,0,0, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0, - }; - result = contents; - break; - } - - case rn(0,15): - { - - static const short contents[] = { - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,499,660,0,0,0,0,0, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,499,660,0,0,0,0,0,0, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,499,660,0,0,0,0,0,0,0, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,499,660,0,0,0,0,0,0,0,0, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,499,660,0,0,0,0,0,0,0,0,0, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,499,659,659,659,659,660,0,0,0,0,0,0,0,0,0,0, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,499,659,659,659,659,659,660,0,0,698,0,0,0,0,0,0,0,0,0,0,0,0, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,499,659,659,660,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,0,0, - 498,498,498,498,498,498,498,498,498,498,498,499,659,659,659,660,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,0,0, - 498,498,498,498,498,498,498,498,498,499,659,660,0,0,698,0,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,0,0, - 498,498,498,498,498,498,498,498,498,620,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,0,0, - 498,498,498,498,498,498,498,498,499,660,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,0,0, - 498,498,498,498,498,498,498,498,620,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,0,0, - 498,498,498,498,498,498,498,498,620,699,699,699,699,699,700,699,699,699,699,699,699,699,699,699,699,699,699,700,699,699,699,699,699,699,699,699,699,699,699,699, - 498,498,498,498,498,498,498,498,620,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,0,0, - 498,498,498,498,498,498,498,498,620,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,0,0, - }; - result = contents; - break; - } - - case rn(0,16): - { - - static const short contents[] = { - 480,480,480,480,480,480,480,480,602,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0, - 480,480,480,480,480,480,480,481,642,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0, - 480,480,480,480,480,480,480,602,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0, - 480,480,480,480,480,480,480,602,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0, - 480,480,480,480,480,480,481,642,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0, - 480,480,480,480,480,480,602,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0, - 480,480,480,480,480,480,602,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0, - 480,480,480,480,480,480,602,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0, - 480,480,480,480,480,480,602,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0, - 480,480,480,480,480,481,642,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0, - 480,480,480,480,480,602,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0, - 480,480,480,480,481,642,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0, - 480,480,480,480,602,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0, - 480,480,480,480,602,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0, - 480,480,480,480,602,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0, - 480,480,480,480,602,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0, - 480,480,480,480,602,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,560,561,561,561,561, - 480,480,480,480,602,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,560,561,561,561,561,522,480,480,480,480, - 480,480,480,480,602,0,0,0,0,0,0,0,560,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,522,480,480,480,480,480,480,480,480,480, - 480,480,480,480,602,0,0,0,0,0,0,0,640,641,641,641,482,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,640,641,641,482,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,640,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641, - 480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,680,0,0,0,680,0,0,0,680,0,0,0,680, - 480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,680,0,0,0,680,0,0,0,680,0,0,0,680, - 480,480,480,480,521,562,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,680,0,0,0,680,0,0,0,680,0,0,0,680, - 480,480,480,480,480,521,561,561,561,562,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,680,0,0,0,680,0,0,0,680,0,0,0,680, - 480,480,480,480,480,480,480,480,480,521,561,561,561,561,562,0,0,0,0,0,0,0,0,680,0,0,0,680,0,0,0,680,0,0,0,680,0,0,0,680, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,521,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - }; - - obj.createentity(120, 40, 14); //Teleporter! - result = contents; - break; - } - - case rn(0,17): - { - - static const short contents[] = { - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 650,650,650,650,650,650,650,650,650,650,491,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 0,0,0,0,689,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 0,0,0,0,689,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 0,0,0,0,689,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 0,0,0,0,689,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 0,0,0,0,689,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 570,570,570,570,570,571,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,611,690,690,690,690,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 650,650,650,650,650,651,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 0,0,0,0,689,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 0,0,0,0,689,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 0,0,0,0,689,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 0,0,0,0,689,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 0,0,0,0,689,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 570,570,570,570,570,570,570,570,570,570,531,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - }; - result = contents; - break; - } - - case rn(1,2): - { - - static const short contents[] = { - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,496,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656, - 495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,495,495,495,617,0,0,0,0,575,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576, - 495,495,495,495,495,495,495,617,696,696,696,696,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,617,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,496,656,656,656,656,497,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,496,656,657,0,0,0,0,615,495,495,495,495,495,495,495,495,496,656,657,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,617,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,496,657,0,0,0,0,0,0,655,656,656,656,656,656,656,656,656,657,0,0,0,0,0,0,655,656,656,497,495,495,495,495,495,495,495,495, - 495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495, - 495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495, - 495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495, - 495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495, - 495,495,495,495,536,576,576,577,0,0,0,0,0,0,575,576,576,576,576,576,576,576,576,577,0,0,0,0,0,0,575,537,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,617,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,617,0,0,0,0,575,576,537,495,495,495,495,495,495,495,495,617,0,0,0,0,575,576,537,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,536,576,576,576,576,537,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,696,696,696,696,615,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,496,657,0,0,0,0,655,497,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495, - }; - result = contents; - break; - } - - case rn(1,3): - { - - static const short contents[] = { - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,490,651,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,490,651,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,490,650,651,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,490,650,651,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,490,651,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,490,650,651,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,490,650,650,651,0,0,0,0,0,0,0,0,0,0,0,0,0,0,569,531,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,490,650,651,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,490,650,650,650,651,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489, - 650,650,650,650,651,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,569,531,489,489,489,489,489,489,489,489,489,489,489, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,569,531,489,489,489,489,489,489,489,489,489,489,489,489, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,569,531,489,489,489,489,489,489,489,489,489,489,489,489,489, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,569,570,531,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,569,570,570,531,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,569,570,531,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,569,570,531,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 0,0,0,0,0,0,0,0,0,569,570,570,570,570,570,570,531,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 0,0,0,0,0,0,569,570,570,531,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - }; - result = contents; - break; - } - - case rn(1,4): - { - - static const short contents[] = { - 0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,643,485,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,643,485,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,643,485,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,643,485,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,643,644,485,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,643,644,485,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,643,644,485,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,643,644,485,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,643,644,485,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,643,485,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,563,564,564,564,525,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,563,564,525,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - }; - - obj.createentity(144, 136, 10, 1, 4010); // (savepoint) - result = contents; - break; - } - - case rn(1,5): - { - - static const short contents[] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,640,482,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,640,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,482,480,480,480, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,640,641,641,641, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0, - 561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,562,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,521,561,561,561,562,0,0,0,0,0,680,0,0,0,0,0,0,0,0, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,521,561,561,561,562,0,680,0,0,0,0,0,0,0,0, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,521,561,561,561,562,0,0,0,0,0,0, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,521,561,561,561,561,561,561, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - }; - - obj.createentity(88, 104, 10, 1, 106010); // (savepoint) - result = contents; - break; - } - - case rn(1,6): - { - - static const short contents[] = { - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,490,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,491,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,490,650,651,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,689,0,0,0,649,650,650,491,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,611,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,649,650,491,489,489,489,489,489,489,489,489,489, - 489,489,489,611,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,649,650,650,491,489,489,489,489,489,489, - 489,489,489,611,0,0,0,0,0,569,570,570,570,570,570,570,570,571,0,0,0,689,0,0,0,0,0,0,0,0,0,689,0,649,650,650,491,489,489,489, - 489,489,489,611,0,0,0,569,570,531,489,489,489,489,489,489,489,530,570,571,0,689,0,0,0,0,0,0,0,0,0,689,0,0,0,0,649,650,650,650, - 489,489,489,611,690,690,690,609,489,489,489,489,489,489,489,489,489,489,489,530,570,570,571,0,0,0,0,0,0,0,0,689,0,0,0,0,0,689,0,0, - 650,650,650,651,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,530,571,0,0,0,0,0,0,0,689,0,0,0,0,0,689,0,0, - 0,0,0,0,0,0,0,649,650,650,650,491,489,489,489,489,489,489,489,489,489,489,489,530,570,571,0,0,0,0,0,689,0,0,0,0,0,689,0,0, - 0,0,0,0,0,0,0,0,689,0,0,649,650,491,489,489,489,489,489,489,489,489,489,489,489,530,570,570,571,0,0,689,0,0,0,0,0,689,0,0, - 0,0,0,0,0,0,0,0,689,0,0,0,0,649,650,650,491,489,489,489,489,489,489,489,489,489,489,489,530,570,570,570,570,570,570,570,570,570,570,570, - 0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,649,650,491,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,649,650,650,491,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,649,650,650,491,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,649,650,650,491,489,489,489,489,489,489,489,489,489,489,489,489, - 0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,649,650,650,491,489,489,489,489,489,489,489,489,489, - 0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,649,650,491,489,489,489,489,489,489,489, - 0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,649,650,650,650,650,650,650,650, - 0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,569,570,570,570,571,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,649,650,650,650,651,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - }; - result = contents; - break; - } - - case rn(1,8): - { - - static const short contents[] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,572,573,573,573,573,574,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 693,693,693,693,693,693,693,693,693,693,693,693,693,693,693,693,693,693,612,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,652,653,653,653,653,654,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - }; - result = contents; - break; - } - - case rn(1,9): - { - - static const short contents[] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,563,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,565,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,643,644,644,644,644,644,644,644,644,644,485,483,483,484,644,644,644,644,645,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,643,644,644,645,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,684,685,684,684,684,684,684,684,684,684,684,684,684,684,684,684,684, - 0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,196,197,197,197,197,198,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,236,116,116,116,116,238,0,0,0,0,0,0,0,0,0,0,0,0,0, - 564,564,564,564,564,564,564,564,564,564,564,564,565,0,0,0,0,0,0,563,565,236,116,116,116,116,238,0,0,0,0,0,0,0,0,0,0,0,0,0, - 483,483,483,483,483,483,483,483,483,483,483,483,524,564,565,0,0,563,564,525,605,236,116,116,116,116,238,0,0,0,0,0,0,0,0,0,0,0,0,0, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,524,564,564,525,483,483,605,236,116,116,116,116,157,197,198,0,0,0,0,0,0,0,0,0,0,0, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,236,116,116,116,116,116,116,238,0,0,0,0,0,0,0,0,0,0,0, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,236,116,116,116,116,116,116,157,197,198,0,0,0,0,0,0,0,0,0, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,236,116,116,116,116,116,116,116,116,238,0,0,0,0,0,0,0,0,0, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,276,277,118,116,116,116,116,116,116,157,197,197,197,197,197,197,197,197,197, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,524,564,565,236,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,236,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,236,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, - }; - - obj.createentity(152, 64, 10, 0, 9010); // (savepoint) - result = contents; - break; - } - - case rn(1,10): - { - - static const short contents[] = { - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 653,653,653,653,653,653,653,494,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 7,7,7,7,7,7,7,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 0,0,0,0,0,0,0,652,653,653,653,653,653,494,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 0,0,0,0,0,0,0,0,692,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 0,0,0,0,0,0,0,0,692,0,0,0,0,652,653,653,653,494,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 0,0,0,0,0,0,0,0,692,0,0,0,0,0,692,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 0,0,0,0,0,0,0,0,692,0,0,0,0,0,692,0,0,652,653,653,653,653,653,653,653,653,653,653,653,653,494,492,492,492,492,492,492,492,492,492, - 0,0,0,0,0,0,0,0,692,0,0,0,0,0,692,0,0,0,0,0,692,0,0,0,692,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492, - 0,0,0,0,0,0,0,0,692,0,0,0,0,0,692,0,0,0,0,0,692,0,0,0,692,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492, - 0,0,0,0,0,0,0,0,692,0,0,0,0,0,692,0,0,0,0,0,692,0,0,0,692,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492, - 0,0,0,0,0,0,0,0,692,0,0,0,0,0,692,0,0,0,0,0,692,0,0,0,692,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492, - 0,0,0,0,0,0,0,0,692,0,0,0,0,0,692,0,0,0,0,0,692,0,0,0,572,573,573,573,573,573,534,492,492,492,492,492,492,492,492,492, - 0,0,0,0,0,0,0,0,692,0,0,0,0,0,692,0,0,0,0,0,692,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 0,0,0,0,0,0,0,0,692,0,0,0,0,0,692,0,572,573,573,573,573,573,573,573,534,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 0,0,0,0,0,0,0,0,692,0,0,0,0,0,692,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 0,0,0,0,0,0,0,0,692,0,0,0,0,0,572,573,534,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 0,0,0,0,0,0,0,0,692,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 573,573,573,573,573,573,573,573,573,573,573,573,573,573,534,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - }; - - obj.createentity(208, 120, 9, 15); // (shiny trinket) - result = contents; - break; - } - - case rn(1,11): - { - - static const short contents[] = { - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,493,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,494,492,493,653,653,653,653,494,492,492, - 492,492,614,0,0,0,0,0,0,0,0,692,0,0,0,0,692,0,0,0,0,692,0,0,0,0,692,0,0,0,612,492,614,0,0,0,0,612,492,492, - 492,492,614,0,0,0,0,0,0,0,0,692,0,0,0,0,692,0,0,0,0,692,0,0,0,0,692,0,0,0,612,492,614,0,0,0,0,612,492,492, - 492,492,614,0,0,0,0,0,0,0,0,692,0,0,0,0,692,0,0,0,0,692,0,0,0,0,692,0,0,0,612,492,614,0,0,0,0,612,492,492, - 492,492,614,0,0,0,0,0,0,0,0,692,0,0,0,0,692,0,0,0,0,692,0,0,0,0,692,0,0,0,612,492,614,0,0,0,0,612,492,492, - 492,492,614,0,0,0,0,572,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,534,492,614,0,0,0,0,612,492,492, - 492,492,614,693,693,693,693,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,693,693,693,693,612,492,492, - 492,492,614,0,0,0,0,612,492,492,493,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,654,0,0,0,0,612,492,492, - 492,492,614,0,0,0,0,612,492,492,614,0,0,0,0,692,0,0,0,0,692,0,0,0,0,692,0,0,0,0,692,0,0,0,0,0,0,612,492,492, - 492,492,614,0,0,0,0,612,492,492,614,0,0,0,0,692,0,0,0,0,692,0,0,0,0,692,0,0,0,0,692,0,0,0,0,0,0,612,492,492, - 492,492,614,0,0,0,0,612,492,492,614,0,0,0,0,692,0,0,0,0,692,0,0,0,0,692,0,0,0,0,692,0,0,0,0,0,0,612,492,492, - 492,492,614,0,0,0,0,612,492,492,614,0,0,0,0,692,0,0,0,0,692,0,0,0,0,692,0,0,0,0,692,0,0,0,0,0,0,612,492,492, - 492,492,614,0,0,0,0,612,492,492,533,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,534,492,492, - 492,492,614,693,693,693,693,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,614,0,0,0,0,652,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,494,492,493,653,653,653,653,653,653,653,653,653,653,494,492,492, - 492,492,614,0,0,0,0,0,0,692,0,0,0,0,692,0,0,0,0,692,0,0,0,0,612,492,614,0,0,0,0,692,0,0,0,0,0,612,492,492, - 492,492,614,0,0,0,0,0,0,692,0,0,0,0,692,0,0,0,0,692,0,0,0,0,612,492,614,0,0,0,0,692,0,0,0,0,0,612,492,492, - 492,492,614,0,0,0,0,0,0,692,0,0,0,0,692,0,0,0,0,692,0,0,0,0,612,492,614,0,0,0,0,692,0,0,0,0,0,612,492,492, - 492,492,614,0,0,0,0,0,0,692,0,0,0,0,692,0,0,0,0,692,0,0,0,0,612,492,614,0,0,0,0,692,0,0,0,0,0,612,492,492, - 492,492,533,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,534,492,533,573,573,573,573,573,574,0,0,0,0,612,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,693,693,693,693,612,492,492, - 653,653,653,653,653,653,653,653,494,492,493,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,654,0,0,0,0,612,492,492, - 0,0,0,692,0,0,0,0,612,492,614,0,0,0,0,0,0,692,0,0,0,0,0,692,0,0,0,0,0,692,0,0,0,0,0,0,0,612,492,492, - 0,0,0,692,0,0,0,0,612,492,614,0,0,0,0,0,0,692,0,0,0,0,0,692,0,0,0,0,0,692,0,0,0,0,0,0,0,612,492,492, - 0,0,0,692,0,0,0,0,612,492,614,0,0,0,0,0,0,692,0,0,0,0,0,692,0,0,0,0,0,692,0,0,0,0,0,0,0,612,492,492, - 0,0,0,692,0,0,0,0,612,492,614,0,0,0,0,0,0,692,0,0,0,0,0,692,0,0,0,0,0,692,0,0,0,0,0,0,0,612,492,492, - 573,573,573,573,573,573,573,573,534,492,533,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,534,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - }; - - obj.createentity(40, 192, 13); //Warp Token - obj.createentity(168, 136, 13); //Warp Token - obj.createentity(224, 136, 13); //Warp Token - - - - obj.createentity(96, 80, 13); //Warp Token - - result = contents; - break; - } - - case rn(1,12): - { - - static const short contents[] = { - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,230,110,110,110,110,110,110, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,270,271,271,271,271,271,271, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,530,570,570,570,570,570,570,570, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,491,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,649,650,650,650,650,650,491,489,489,489,489,489,489,489,489,489,489,489, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,649,650,650,650,650,650,491,489,489,489,489,489, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,649,650,650,650,650,650, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,569,570,570,570,570,570,570,570,570,570,570,570,570,571,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,649,650,650,650,650,650,650,650,650,650,650,650,650,651,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0, - }; - result = contents; - break; - } - - case rn(1,13): - { - - static const short contents[] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,560,561,562,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,560,522,480,521,562,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,640,482,480,481,642,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,640,641,642,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,560,561,561,561,561,561,561,561,561,561,561,561,561,561,562,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 561,561,561,561,561,561,561,561,522,480,480,480,480,480,480,480,480,480,480,480,480,480,521,561,561,561,561,561,561,562,0,0,0,0,0,0,0,0,0,0, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,521,561,561,561,561,561,561,561,561,561,561, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - }; - - obj.createentity(112, 152, 10, 1, 13010); // (savepoint) - result = contents; - break; - } - - case rn(1,14): - { - - static const short contents[] = { - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 644,644,644,644,644,644,644,485,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,643,644,644,644,644,644,644,644,644,485,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,643,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644, - 0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,563,564,564,564,564, - 0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,563,564,525,483,483,483,483, - 0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,563,525,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,563,525,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483, - }; - result = contents; - break; - } - - case rn(1,15): - { - - static const short contents[] = { - 0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492, - 0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492, - 0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492, - 0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492, - 0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492, - 0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492, - 0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492, - 0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492, - 0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492, - 0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,572,534,492,492,492,492,492,492,492,492, - 0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492, - 0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492, - 0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492, - 0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492, - 0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,572,534,492,492,492,492,492,492,492,492,492, - 0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492, - 0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492, - 0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,572,534,492,492,492,492,492,492,492,492,492,492, - 0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492, - 0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492, - 0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492, - 0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492, - 0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,572,534,492,492,492,492,492,492,492,492,492,492,492, - 0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492, - 0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492, - 0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492, - 0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,572,534,492,492,492,492,492,492,492,492,492,492,492,492, - 693,693,693,693,693,693,693,693,693,694,693,693,693,693,693,693,693,693,693,693,693,693,693,693,693,693,612,492,492,492,492,492,492,492,492,492,492,492,492,492, - 0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492, - 0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492, - }; - result = contents; - break; - } - - case rn(1,16): - { - - static const short contents[] = { - 0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495, - 0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495, - 0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495, - 0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,496,656,656,656,656,656,656,656,656,656,656,656, - 0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,617,375,376,376,376,376,376,376,376,376,376,376, - 0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,617,415,295,295,295,295,295,295,295,295,295,295, - 0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,575,576,576,537,495,617,415,295,295,295,295,295,295,295,295,295,295, - 0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,617,415,295,295,295,295,295,295,295,295,295,295, - 0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,617,415,295,295,295,295,295,295,295,295,295,295, - 0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,575,576,537,495,495,495,495,617,415,295,295,295,295,295,295,295,295,295,295, - 0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,617,455,456,456,456,456,456,456,456,456,456,456, - 0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,575,576,576,537,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,695,0,0,0,575,576,576,576,576,537,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,575,576,576,576,576,576,537,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0, - 0,0,575,576,576,576,576,537,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0, - 576,576,537,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,375,376,376,376,376,376, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,415,295,295,295,295,295, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,496,656,656,657,0,0,0,0,0,415,295,295,295,295,295, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,496,656,656,656,656,657,0,695,0,0,0,0,0,0,415,295,295,295,295,295, - 656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,657,0,0,695,0,0,0,695,0,0,0,0,0,0,415,295,295,295,295,295, - 0,0,0,695,0,0,0,695,0,0,0,695,0,0,0,695,0,0,0,695,0,0,0,695,0,0,0,695,0,0,0,0,0,0,415,295,295,295,295,295, - 0,0,0,695,0,0,0,695,0,0,0,695,0,0,0,695,0,0,0,695,0,0,0,695,0,0,0,695,0,0,0,0,0,0,415,295,295,295,295,295, - 0,0,0,695,0,0,0,695,0,0,0,695,0,0,0,695,0,0,0,695,0,0,0,695,0,0,0,695,0,0,0,0,0,0,415,295,295,295,295,295, - 0,0,0,695,0,0,0,695,0,0,0,695,0,0,0,695,0,0,0,695,0,0,0,695,0,0,0,695,0,0,0,0,0,0,415,295,295,295,295,295, - 0,0,0,695,0,0,0,695,0,0,0,695,0,0,0,695,0,0,0,695,0,0,0,695,0,0,0,695,0,0,0,0,0,0,415,295,295,295,295,295, - 576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,577,415,295,295,295,295,295, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,415,295,295,295,295,295, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,415,295,295,295,295,295, - }; - - obj.createentity(280, 120, 10, 1, 16010); // (savepoint) - result = contents; - break; - } - - case rn(2,2): - { - - static const short contents[] = { - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,485,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,683,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,50,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,683,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,50,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,683,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,50,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,683,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,50,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,565,0,0,0,0,0,0,50,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,50,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,484,644,645,0,0,0,0,0,0,50,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,49,0,0,0,0,0,0,50,563,525,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,49,0,0,0,0,0,0,50,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,484,645,49,0,0,0,0,0,0,50,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,605,49,0,0,0,0,0,0,50,563,525,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,605,49,0,0,0,0,0,0,50,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,484,645,49,0,0,0,0,0,0,50,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,605,49,0,0,0,0,0,0,50,563,525,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,605,49,0,0,0,0,0,0,50,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,484,645,49,0,0,0,0,0,0,50,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,605,49,0,0,0,0,0,0,50,563,525,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,605,49,0,0,0,0,0,0,50,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,484,645,49,0,0,0,0,0,0,50,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,605,49,0,0,0,0,0,0,50,563,525,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,605,49,0,0,0,0,0,0,50,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,484,645,49,0,0,0,0,0,0,50,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,605,49,0,0,0,0,0,0,50,563,525,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,605,49,0,0,0,0,0,0,50,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,605,49,0,0,0,0,0,0,50,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,605,49,0,0,0,0,0,0,50,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,605,49,0,0,0,0,0,0,50,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,605,49,0,0,0,0,0,0,50,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - }; - - obj.createentity(56, 32, 10, 1, 2020); // (savepoint) - result = contents; - break; - } - - case rn(2,3): - { - - static const short contents[] = { - 489,489,489,489,489,489,489,489,489,611,49,0,0,0,0,0,0,50,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,611,49,0,0,0,0,0,0,50,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,611,49,0,0,0,0,0,0,50,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,611,49,0,0,0,0,0,0,50,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,611,49,0,0,0,0,0,0,50,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,611,49,0,0,0,0,0,0,50,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,611,49,0,0,0,0,0,0,50,649,491,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,530,571,49,0,0,0,0,0,0,50,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,611,49,0,0,0,0,0,0,50,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,611,49,0,0,0,0,0,0,50,649,491,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,530,571,49,0,0,0,0,0,0,50,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,611,49,0,0,0,0,0,0,50,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,611,49,0,0,0,0,0,0,50,649,491,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,530,571,49,0,0,0,0,0,0,50,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,611,49,0,0,0,0,0,0,50,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,611,49,0,0,0,0,0,0,50,649,491,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,530,571,49,0,0,0,0,0,0,50,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,611,49,0,0,0,0,0,0,50,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,611,49,0,0,0,0,0,0,50,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,530,571,49,0,0,0,0,0,569,531,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,49,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,49,0,0,0,0,0,649,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,530,571,49,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,689,0,0,0,0,0, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,49,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,689,0,0,0,0,0, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,49,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,689,0,0,0,0,0, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,49,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,689,0,0,0,0,0, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,530,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - }; - result = contents; - break; - } - - case rn(2,5): - { - - static const short contents[] = { - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 644,644,644,644,644,644,644,644,644,644,485,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,643,644,644,485,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,484,644,644,644,644,644,644,644,644,644,644, - 0,0,0,0,0,0,0,0,0,0,0,0,0,643,644,485,483,483,483,483,483,483,483,483,484,644,644,644,644,645,0,683,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,643,644,644,644,644,644,644,644,644,645,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,683,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,683,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,683,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,683,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,683,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,683,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0, - 564,564,564,564,565,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,683,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0, - 483,483,483,483,524,564,564,565,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,683,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0, - 483,483,483,483,483,483,483,524,564,565,0,0,0,0,0,0,683,0,0,0,0,0,0,0,683,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0, - 483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,563,564,565,0,0,0,0,0,0,683,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0, - 483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,643,644,645,0,0,0,0,0,563,564,564,564,564,564,564,564,564,565,0,0,0,0,0,0,0, - 483,483,483,483,483,483,483,483,483,524,565,0,0,0,0,0,0,0,0,0,0,0,0,643,644,644,644,644,644,644,644,644,645,0,0,0,0,0,0,0, - 483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - }; - result = contents; - break; - } - - case rn(2,6): - { - - static const short contents[] = { - 486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 647,647,647,647,647,647,647,647,647,647,648,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,686,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,686,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,686,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,686,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 567,567,567,567,567,567,567,567,567,568,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 486,486,486,486,486,486,486,486,486,608,687,687,687,687,687,687,687,687,687,687,687,687,687,687,687,687,687,687,687,687,687,687,687,687,687,687,687,687,687,687, - 486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 486,486,486,486,486,486,486,486,487,648,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 486,486,486,486,486,486,487,647,648,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 486,486,486,487,647,647,648,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 647,647,647,648,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - }; - - obj.createentity(40, 88, 10, 1, 6020); // (savepoint) - result = contents; - break; - } - - case rn(2,8): - { - - static const short contents[] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,575,576,577,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,655,656,657,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0, - }; - result = contents; - break; - } - - case rn(2,9): - { - - static const short contents[] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,560,561,561,561,561,561,561,561,562,0,0,0,680,0,0,0,0,0,0,0,0, - 681,681,681,681,681,681,681,681,681,681,681,681,681,681,681,681,681,681,681,600,480,480,480,480,480,480,480,521,561,561,561,561,562,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,640,641,641,641,641,641,641,641,641,641,641,641,641,642,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,193,194,195,0,0,0,193,194,195,0,0,0,193,194,195,0,0,0,193,194,194, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,233,113,235,0,0,0,233,113,235,0,0,0,233,113,154,194,194,194,155,113,113, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,233,113,235,0,0,0,233,113,154,194,194,194,155,113,113,113,113,113,113,113,113, - 194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,155,113,154,194,194,194,155,113,113,113,113,113,113,113,113,113,113,113,113,113,113, - 113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113, - 113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113, - 113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113, - }; - result = contents; - break; - } - - case rn(2, 10): - if(obj.altstates==0) - { - - static const short contents[] = { - 113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113, - 113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113, - 113,113,113,114,274,274,274,274,274,274,274,274,274,274,274,274,274,274,274,274,274,274,274,274,274,274,274,274,274,274,115,113,113,113,113,113,113,113,113,113, - 113,113,113,235,778,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,233,113,113,113,113,113,113,113,113,113, - 113,113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,233,113,113,113,114,274,274,274,274,274, - 113,113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,233,113,113,113,235,753,753,753,753,753, - 113,113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,233,113,113,113,235,753,753,753,753,753, - 113,113,113,154,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,195,0,0,0,0,0,0,0,0,0,273,274,274,274,275,753,753,753,753,753, - 113,113,113,114,274,274,274,274,274,274,274,274,274,274,274,274,274,274,274,274,275,0,0,0,0,0,0,0,0,0,0,0,873,753,753,753,753,753,753,753, - 113,113,113,235,778,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,873,753,753,753,753,753,753,753, - 113,113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,873,753,753,753,753,753,753,753, - 113,113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,873,753,753,753,753,753,753,753, - 113,113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,873,753,753,753,753,753,753,753, - 113,113,113,154,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,195,0,0,0,0,0,0,0,0,873,753,753,753,753,753,753,753, - 113,113,113,114,274,274,274,274,274,274,274,274,274,274,274,274,274,274,274,274,274,274,274,275,0,0,0,0,0,0,0,0,873,753,753,753,753,753,753,753, - 113,113,113,235,778,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,873,753,753,753,753,753,753,753, - 113,113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,873,753,753,753,753,753,753,753, - 113,113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,873,753,753,753,753,753,753,753, - 113,113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,873,753,753,753,753,753,753,753, - 113,113,113,154,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,195,0,0,0,0,0,873,753,753,753,753,753,753,753, - 113,113,113,114,274,274,274,274,274,274,274,274,274,274,274,274,274,274,274,274,274,274,274,274,274,274,275,0,0,0,0,0,873,753,753,753,753,753,753,753, - 113,113,113,235,778,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,873,753,753,753,753,753,753,753, - 113,113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,873,753,753,753,753,753,753,753, - 113,113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,873,753,753,753,753,753,753,753, - 113,113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,873,753,753,753,753,753,753,753, - 113,113,113,154,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194, - 113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113, - 113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113, - 113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113, - 113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113, - }; - - obj.createentity(40, 32, 22, 0); // (shiny trinket) - obj.createentity(64, 32, 22, 1); // (shiny trinket) - obj.createentity(88, 32, 22, 2); // (shiny trinket) - obj.createentity(40, 80, 22, 3); // (shiny trinket) - obj.createentity(64, 80, 22, 4); // (shiny trinket) - obj.createentity(88, 80, 22, 5); // (shiny trinket) - obj.createentity(112, 80, 22, 6); // (shiny trinket) - obj.createentity(40, 128, 22, 7); // (shiny trinket) - obj.createentity(64, 128, 22, 8); // (shiny trinket) - obj.createentity(88, 128, 22, 9); // (shiny trinket) - obj.createentity(112, 128, 22, 10); // (shiny trinket) - obj.createentity(136, 128, 22, 11); // (shiny trinket) - obj.createentity(40, 176, 22, 12); // (shiny trinket) - obj.createentity(64, 176, 22, 13); // (shiny trinket) - obj.createentity(88, 176, 22, 14); // (shiny trinket) - obj.createentity(112, 176, 22, 15); // (shiny trinket) - obj.createentity(136, 176, 22, 16); // (shiny trinket) - obj.createentity(112, 32, 22, 17); // (shiny trinket) - obj.createentity(136, 80, 22, 18); // (shiny trinket) - obj.createentity(136, 32, 22, 19); // (shiny trinket) - - if(!game.nocutscenes && !obj.flags[70]) - { - obj.createblock(1, 304, 0, 16, 240, 48); - } - result = contents; - } - else - { - - static const short contents[] = { - 113,113,113,113,113,113,113,114,274,274,274,274,274,274,274,274,274,274,115,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113, - 113,113,113,113,113,114,274,275,0,0,0,0,0,0,0,0,0,0,273,274,274,274,274,274,274,274,115,113,113,113,113,113,113,113,113,113,113,113,113,113, - 113,113,113,114,274,275,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,273,274,274,274,115,113,113,113,113,113,113,113,113,113, - 113,113,113,235,778,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,233,113,113,113,113,113,113,113,113,113, - 113,113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,233,113,113,113,114,274,274,274,274,274, - 113,113,114,275,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,273,274,115,113,235,753,753,753,753,753, - 113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,233,113,235,753,753,753,753,753, - 113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,273,274,275,753,753,753,753,753, - 113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,873,753,753,753,753,753,753,753, - 113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,873,753,753,753,753,753,753,753, - 113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,873,753,753,753,753,753,753,753, - 113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,873,753,753,753,753,753,753,753, - 113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,873,753,753,753,753,753,753,753, - 113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,873,753,753,753,753,753,753,753, - 113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,873,753,753,753,753,753,753,753, - 113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,873,753,753,753,753,753,753,753, - 113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,873,753,753,753,753,753,753,753, - 113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,873,753,753,753,753,753,753,753, - 113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,873,753,753,753,753,753,753,753, - 113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,873,753,753,753,753,753,753,753, - 113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,873,753,753,753,753,753,753,753, - 113,113,154,195,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,873,753,753,753,753,753,753,753, - 113,113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,873,753,753,753,753,753,753,753, - 113,113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,873,753,753,753,753,753,753,753, - 113,113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,873,753,753,753,753,753,753,753, - 113,113,113,154,194,194,195,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,193,194,194,194,194,194,194,194,194,194,194,194,194, - 113,113,113,113,113,113,154,194,194,194,194,194,194,194,194,195,0,0,0,0,0,0,0,193,194,194,194,155,113,113,113,113,113,113,113,113,113,113,113,113, - 113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,154,194,194,194,194,194,194,194,155,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113, - 113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113, - 113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113, - }; - - obj.createentity(90, 52, 26, 0); // (super warp) - result = contents; - } - hiddenname = "The Ship"; - - break; - - case rn(2,11): - { - - static const short contents[] = { - 104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104, - 104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104, - 104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104, - 104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104, - 104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104, - 104,104,104,104,105,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265, - 104,104,104,104,226,744,866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,864,744,744,744,744,744,744,744,744,744,744,744,744,744,744,744,744,744,744, - 104,104,104,104,226,744,866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,864,744,744,745,905,746,744,745,905,746,744,745,905,746,744,745,905,746,744, - 104,104,104,104,226,744,866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,864,744,744,866,0,864,744,866,0,864,744,866,0,864,744,866,0,864,744, - 104,104,104,104,226,744,866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,864,744,744,866,0,864,744,866,0,864,744,866,0,864,744,866,0,864,744, - 104,104,104,104,226,744,866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,864,744,744,785,825,786,744,785,825,786,744,785,825,786,744,785,825,786,744, - 104,104,104,104,226,744,866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,864,744,744,744,744,744,744,744,744,744,744,744,744,744,744,744,744,744,744, - 104,104,104,104,226,744,866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,864,744,744,745,905,905,905,905,905,905,905,905,905,905,905,905,905,746,744, - 104,104,104,104,226,744,866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,864,744,744,866,0,0,0,0,0,0,0,0,0,0,0,0,0,864,744, - 104,104,104,104,226,744,866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,864,744,744,866,0,0,0,0,0,0,0,0,0,0,0,0,0,864,744, - 104,104,104,104,226,744,866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,864,744,744,785,825,825,825,825,825,825,825,825,825,825,825,825,825,786,744, - 104,104,104,104,226,744,866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,864,744,744,744,744,744,744,744,744,744,744,744,744,744,744,744,744,744,744, - 104,104,104,104,226,744,866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,864,744,744,745,905,746,744,745,905,746,744,745,905,746,744,745,905,746,744, - 104,104,104,104,226,744,866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,864,744,744,866,0,864,744,866,0,864,744,866,0,864,744,866,0,864,744, - 104,104,104,104,226,744,866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,864,744,744,866,0,864,744,866,0,864,744,866,0,864,744,866,0,864,744, - 104,104,104,104,226,744,866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,864,744,744,785,825,786,744,785,825,786,744,785,825,786,744,785,825,786,744, - 104,104,104,104,226,744,866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,864,744,744,744,744,744,744,744,744,744,744,744,744,744,744,744,744,744,744, - 104,104,104,104,145,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,186,744,744,744,744, - 104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,226,744,744,744,744, - 104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,226,744,744,744,744, - 104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,145,185,185,185,185, - 104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104, - 104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104, - 104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104, - 104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104, - }; - - obj.createentity(64, 64, 14); //Teleporter! - hiddenname = "The Ship"; - result = contents; - break; - } - - case rn(2,12): - { - - static const short contents[] = { - 104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104, - 265,265,265,265,106,105,265,265,265,265,265,265,265,106,104,105,265,265,265,265,265,265,265,106,105,265,265,265,265,265,265,265,106,104,105,265,265,265,265,265, - 567,567,567,568,224,226,566,567,567,567,567,567,568,224,105,266,566,567,567,567,567,567,568,224,226,566,567,567,567,567,567,568,264,106,226,566,567,567,567,567, - 486,486,608,184,146,266,606,486,486,486,487,647,648,224,226,566,528,486,486,486,487,647,648,224,226,606,486,486,486,486,486,527,568,224,226,606,486,486,486,486, - 486,486,608,264,266,566,528,486,486,486,608,184,185,146,266,606,486,486,486,487,648,184,185,146,266,606,486,486,486,486,487,647,648,224,226,606,486,486,486,486, - 486,486,527,567,567,528,486,486,486,486,608,264,265,266,566,528,486,486,486,608,184,146,105,266,566,528,486,486,486,486,608,184,185,146,266,606,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,527,567,567,567,528,486,486,486,486,608,264,265,266,566,528,486,486,486,486,486,608,264,265,266,566,528,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,527,567,567,567,528,486,486,486,486,486,486,527,567,567,567,528,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,487,647,647, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,487,647,648,0,0, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,487,647,647,647,647,647,647,648,0,0,0,0, - 486,486,486,486,486,486,486,486,486,486,486,487,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,648,0,0,0,0,0,686,0,0,0,0,0, - 486,486,486,486,486,486,486,486,487,647,647,648,0,0,0,0,0,0,0,0,0,686,0,0,0,0,686,0,0,0,0,0,0,0,686,0,0,0,0,0, - 486,487,647,647,647,647,647,647,648,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,686,0,0,0,0,0,0,0,686,0,0,0,0,0, - 647,648,0,0,686,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,686,0,0,0,0,0,0,0,686,0,0,0,0,0, - 0,0,0,0,686,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,686,0,0,0,0,0,0,0,686,0,0,0,0,0, - 0,0,0,0,686,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,686,0,0,0,0,0,0,0,686,0,0,0,0,0, - 0,0,0,0,686,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,686,0,0,0,0,0,0,0,686,0,0,0,0,0, - 0,0,0,0,686,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,686,0,0,0,0,0,0,0,686,0,0,0,0,0, - 0,0,0,0,686,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,686,0,0,0,0,0,0,0,686,0,0,0,0,0, - 0,0,0,0,686,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,686,0,0,0,0,0,0,0,686,0,0,0,0,0, - 0,0,0,0,686,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,566,567,567,567,567,567,567,568,0,0,0,0,0,0,686,0,0,0,0,0, - 0,0,0,566,567,567,567,567,567,568,0,0,0,0,0,0,0,0,0,0,646,647,647,647,647,647,647,648,0,0,0,0,0,566,567,568,0,0,0,0, - 0,0,0,646,647,647,647,647,647,648,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,646,647,648,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - }; - hiddenname = "The Ship"; - result = contents; - break; - } - - case rn(2,13): - { - - static const short contents[] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,575,576,577,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,615,495,617,696,696,696,696,696,696,696,696,696,696,696,697,696,696,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,655,656,657,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,575,576,577,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,696,696,697,696,696,696,696,615,495,617,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,655,656,657,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,575,576,577,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,617,696,696,696,697,696,696,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,655,656,657,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,575,576,576,576,576,576,576,576, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495, - 0,0,0,0,0,0,0,0,0,0,0,0,575,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,537,495,495,495,495,495,495,495, - 0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 576,576,576,576,576,576,576,576,576,576,576,576,537,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - }; - result = contents; - break; - } - - case rn(2,14): - { - - static const short contents[] = { - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,488,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,646,488,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,646,488,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,568,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,527,568,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,487,648,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,566,528,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,566,528,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - }; - result = contents; - break; - } - - case rn(2,15): - { - - static const short contents[] = { - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,649,491,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,649,491,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,649,650,491,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,649,650,491,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,530,571,0,0,0,0,0,0,0,0,649,650,491,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,649,650,650,650,650,650,650,650,650,650,650,650, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,530,570,571,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,530,571,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,530,570,571,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,530,570,571,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,530,570,571,0,0,0,0,0,0,0,0,0,0,0,0,0, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,530,570,570,570,570,570,570,571,6,6,6,6,6,6, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,530,570,570,570,570,570,570, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - }; - - obj.createentity(240, 96, 10, 0, 15020); // (savepoint) - result = contents; - break; - } - - case rn(3,2): - { - - static const short contents[] = { - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,499,659,659,659,659,500,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,499,659,659,659,659,500,498,498, - 498,498,498,620,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,618,498,498, - 498,499,659,660,0,0,0,0,658,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,660,0,0,0,0,658,659,500, - 498,620,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,618, - 498,620,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,618, - 498,620,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,618, - 498,620,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,618, - 498,539,579,580,0,0,0,0,578,579,579,579,579,579,579,579,579,580,0,0,0,0,578,579,579,579,579,579,579,579,579,579,580,0,0,0,0,578,579,540, - 498,498,498,620,0,0,0,0,618,498,498,498,498,498,498,498,498,620,699,699,699,699,618,498,498,498,498,498,498,498,498,498,620,0,0,0,0,618,498,498, - 498,498,498,620,699,699,699,699,618,498,498,498,498,498,498,498,499,660,0,0,0,0,658,500,498,498,498,498,498,498,498,498,620,699,699,699,699,618,498,498, - 498,498,498,620,0,0,0,0,618,498,498,498,498,498,498,498,620,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,620,0,0,0,0,618,498,498, - 498,498,498,620,0,0,0,0,618,498,498,498,498,498,498,498,620,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,620,0,0,0,0,618,498,498, - 498,498,498,620,0,0,0,0,618,498,498,498,498,498,498,498,620,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,620,0,0,0,0,618,498,498, - 498,498,498,620,0,0,0,0,618,498,498,498,498,498,498,498,620,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,620,0,0,0,0,618,498,498, - 498,498,498,620,699,699,699,699,618,498,498,498,498,498,498,498,539,580,0,0,0,0,578,540,498,498,498,498,498,498,498,498,620,699,699,699,699,618,498,498, - 498,498,498,620,0,0,0,0,618,498,498,498,498,498,498,498,498,539,579,579,579,579,540,498,498,498,498,498,498,498,498,498,620,0,0,0,0,618,498,498, - 498,499,659,660,0,0,0,0,658,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,660,0,0,0,0,658,659,500, - 498,620,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,618, - 498,620,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,618, - 498,620,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,618, - 498,620,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,618, - 498,539,579,580,0,0,0,0,578,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,580,0,0,0,0,578,579,540, - 498,498,498,620,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,618,498,498, - 498,498,498,539,579,579,579,579,540,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,618,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,618,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,618,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,618,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,618,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,618,498,498, - }; - - obj.createentity(152, 96, 9, 16); // (shiny trinket) - result = contents; - break; - } - - case rn(3,3): - { - - static const short contents[] = { - 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,621,501,501, - 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,621,501,501, - 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,621,501,501, - 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,621,501,501, - 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,621,501,501, - 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,621,501,501, - 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,621,501,501, - 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,621,501,501, - 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,621,501,501, - 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,502,662,662,662,662,662,662,662,662,663,0,0,0,0,621,501,501, - 501,501,501,501,501,501,501,501,501,501,501,501,501,502,662,662,662,662,662,662,662,662,662,663,0,0,0,0,0,0,701,0,0,0,0,0,0,621,501,501, - 501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,701,0,0,0,0,0,0,621,501,501, - 501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,701,0,0,0,0,0,0,621,501,501, - 501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,701,0,0,0,0,0,0,621,501,501, - 501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,701,0,0,0,0,0,0,621,501,501, - 501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,701,0,0,0,0,0,0,621,501,501, - 501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,701,0,0,0,0,0,0,621,501,501, - 501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,701,0,0,0,0,0,0,621,501,501, - 501,501,501,501,501,501,501,501,501,501,501,501,502,663,0,0,0,0,0,0,0,0,0,581,582,582,582,582,582,582,582,582,582,582,582,582,582,543,501,501, - 501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,0,0,0,0,0,621,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501, - 501,501,501,501,501,501,502,662,662,662,662,662,663,702,702,702,702,702,702,702,702,702,581,543,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501, - 662,662,662,662,662,662,663,0,0,701,0,0,0,0,0,0,0,0,0,0,0,0,621,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501, - 0,0,0,0,0,0,0,0,0,701,0,0,0,0,0,0,0,0,0,0,0,0,621,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501, - 0,0,0,0,0,0,0,0,0,701,0,0,0,0,0,0,0,0,0,0,0,0,621,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501, - 0,0,0,0,0,0,0,0,0,701,0,0,0,0,0,0,0,0,0,0,0,0,621,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501, - 0,0,0,0,0,0,0,0,0,701,0,0,0,0,0,0,0,0,0,0,0,0,621,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501, - 582,582,582,582,582,582,582,582,582,582,582,582,582,582,582,582,582,582,582,582,582,582,543,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501, - 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501, - 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501, - 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501, - }; - - obj.createentity(24, 192, 10, 1, 3030); // (savepoint) - result = contents; - break; - } - - case rn(3,5): - { - - static const short contents[] = { - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,481,641,641,641,641,641,641,641,482,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,481,641,641,642,0,0,0,0,0,0,0,640,641,641,641,641,641,641,482,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,481,641,642,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,640,641,482,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,640,482,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480, - 641,641,641,641,641,641,642,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,640,641,641,641,641,641,641,641,641,641,641, - 0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,560,561,561,561,561,561,561,561,561,561,561,561,561,561,562,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,602,681,681,681,681,681,681,681,681,681,682,681,681,681,681,0,0,0,0,0, - 0,0,0,0,0,0,640,641,641,641,641,641,641,641,641,641,641,641,641,641,642,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,560,561,561,561,561,561,562,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,600,480,480,480,480,480,602,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,640,641,641,641,641,641,642,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - }; - result = contents; - break; - } - - case rn(3,6): - { - - static const short contents[] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 693,693,693,693,693,693,693,693,693,693,693,693,693,693,693,693,693,693,693,694,693,693,693,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - }; - result = contents; - break; - } - - case rn(3,7): - { - - static const short contents[] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,690,690,690,691,690,690,690,690,690,690,690,690,690,690,690,690,690,690,690,690,690,690,690,690, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - }; - result = contents; - break; - } - - case rn(3,8): - { - - static const short contents[] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,566,567,568,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,566,528,486,527,568,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,566,528,486,486,486,527,568,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,566,528,486,486,486,486,486,527,568,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,646,488,486,486,486,486,486,487,648,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,646,488,486,486,486,487,648,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,646,647,647,647,648,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - }; - result = contents; - break; - } - - case rn(3,9): - { - - static const short contents[] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,181,183,0,0,181,183,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,221,223,0,0,221,223,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,181,182,143,142,182,182,143,142,182,183,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,261,262,103,102,262,262,103,102,262,263,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,221,223,0,0,221,223,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,221,223,0,0,221,223,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,181,182,143,223,0,0,221,142,182,183,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,261,262,103,223,0,0,221,102,262,263,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,221,223,0,0,221,223,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,221,223,0,0,221,223,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,143,142,182,182,143,142,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182, - 101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101, - 101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101, - 101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101, - 101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101, - 101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101, - 101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101, - }; - - obj.createentity(248, 168, 10, 1, 9030); // (savepoint) - result = contents; - break; - } - - case rn(3,10): - { - - static const short contents[] = { - 101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101, - 101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101, - 101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101, - 101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101, - 262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262, - 741,741,741,741,741,741,741,863,0,0,0,0,0,0,0,861,741,741,741,741,741,741,741,741,863,0,0,0,0,0,0,0,861,741,741,741,741,741,741,741, - 741,741,741,741,741,741,741,863,0,0,0,0,0,0,0,861,741,742,902,902,902,902,743,741,863,0,0,0,0,0,0,0,861,741,741,741,741,741,741,741, - 741,741,741,741,741,741,741,863,0,0,0,0,0,0,0,861,741,863,0,0,0,0,861,741,863,0,0,0,0,0,0,0,861,741,741,741,741,741,741,741, - 741,741,741,741,741,741,741,863,0,0,0,0,0,0,0,861,741,863,0,0,0,0,861,741,863,0,0,0,0,0,0,0,861,741,741,741,741,741,741,741, - 741,741,741,741,741,741,741,863,0,0,0,0,0,0,0,861,741,863,0,0,0,0,861,741,863,0,0,0,0,0,0,0,861,741,741,741,741,741,741,741, - 741,741,741,741,741,741,741,863,0,0,0,0,0,0,0,861,741,782,822,822,822,822,783,741,863,0,0,0,0,0,0,0,861,741,741,741,741,741,741,741, - 741,741,741,741,741,741,741,863,0,0,0,0,0,0,0,861,741,741,741,741,741,741,741,741,863,0,0,0,0,0,0,0,861,741,741,741,741,741,741,741, - 741,741,741,741,741,741,741,181,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,183,741,741,741,741,741,741,741, - 741,741,741,741,741,741,741,221,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,223,741,741,741,741,741,741,741, - 741,741,741,741,741,741,741,221,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,223,741,741,741,741,741,741,741, - 741,741,741,741,741,741,741,261,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,263,741,741,741,741,741,741,741, - 741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741, - 741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,742,902,902,902,902,902,902,743,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741, - 741,741,741,742,902,902,902,902,902,902,902,902,902,743,741,741,863,0,0,0,0,0,0,861,741,741,742,902,902,902,902,902,902,902,902,902,743,741,741,741, - 741,741,741,863,0,0,0,0,0,0,0,0,0,861,741,741,863,0,0,0,0,0,0,861,741,741,863,0,0,0,0,0,0,0,0,0,861,741,741,741, - 741,741,741,863,0,0,0,0,0,0,0,0,0,861,741,741,863,0,0,0,0,0,0,861,741,741,863,0,0,0,0,0,0,0,0,0,861,741,741,741, - 741,741,741,863,0,0,0,0,0,0,0,0,0,861,741,741,863,0,0,0,0,0,0,861,741,741,863,0,0,0,0,0,0,0,0,0,861,741,741,741, - 741,741,741,782,822,822,822,822,822,822,822,822,822,783,741,741,863,0,0,0,0,0,0,861,741,741,782,822,822,822,822,822,822,822,822,822,783,741,741,741, - 741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,782,822,822,822,822,822,822,783,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741, - 741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741, - 182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,183,741,741,741,741,741,741,181,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182, - 101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,223,741,741,741,741,741,741,221,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101, - 101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,223,741,741,741,741,741,741,221,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101, - 101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,223,741,741,741,741,741,741,221,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101, - 101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,223,741,741,741,741,741,741,221,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101, - }; - - obj.createentity(88, 80, 21, 1); //Terminal // UU Brothers - obj.createblock(5, 88 - 4, 80, 20, 16, 25); - - if(game.stat_trinkets>=5) - { - obj.createentity(128, 80, 21, 1); //Terminal - obj.createblock(5, 128 - 4, 80, 20, 16, 26); - } - - if(game.stat_trinkets>=8) - { - obj.createentity(176, 80, 21, 1); //Terminal - obj.createblock(5, 176 - 4, 80, 20, 16, 27); - } - - if(game.stat_trinkets>=10) - { - obj.createentity(216, 80, 21, 1); //Terminal - obj.createblock(5, 216 - 4, 80, 20, 16, 28); - } - - if(game.stat_trinkets>=12) - { - obj.createentity(88, 128, 21, 0); //Terminal - obj.createblock(5, 88 - 4, 128, 20, 16, 29); - } - - if(game.stat_trinkets>=14) - { - obj.createentity(128, 128, 21, 0); //Terminal - obj.createblock(5, 128 - 4, 128, 20, 16, 33); - } - - if(game.stat_trinkets>=16) - { - obj.createentity(176, 128, 21, 0); //Terminal - obj.createblock(5, 176 - 4, 128, 20, 16, 30); - } - - if(game.stat_trinkets>=18) - { - obj.createentity(216, 128, 21, 0); //Terminal - obj.createblock(5, 216 - 4, 128, 20, 16, 32); - } - - //Special cases - if(game.stat_trinkets>=20) - { - obj.createentity(40, 40, 21, 0); //Terminal - obj.createblock(5, 40 - 4, 40, 20, 16, 31); - } - - if(game.stat_trinkets>=20) - { - obj.createentity(264, 40, 21, 0); //Terminal - obj.createblock(5, 264 - 4, 40, 20, 16, 34); - } - - obj.createentity(152, 40, 21, 0); //Terminal (jukebox instructions) - obj.createblock(5, 152 - 4, 40, 20, 16, 24); - hiddenname = "The Ship"; - result = contents; - break; - } - - case rn(3,11): - { - - static const short contents[] = { - 107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,229,747,748,908,908,749,747,227,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107, - 107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,229,747,869,0,0,867,747,227,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107, - 107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,229,747,869,0,0,867,747,227,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107, - 107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,229,747,788,828,828,789,747,227,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107, - 107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,229,747,747,747,747,747,747,227,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107, - 268,268,268,268,268,268,268,268,268,268,268,109,107,107,107,107,229,747,748,908,908,749,747,227,107,107,107,107,108,268,268,268,268,268,268,268,268,268,268,268, - 747,747,747,747,747,747,747,747,747,747,747,227,107,107,107,107,229,747,869,0,0,867,747,227,107,107,107,107,229,747,747,747,747,747,747,747,747,747,747,747, - 747,747,747,747,747,747,747,747,747,747,747,227,107,107,107,107,229,747,869,0,0,867,747,227,107,107,107,107,229,747,747,747,747,747,747,747,747,747,747,747, - 747,747,747,747,747,747,747,747,747,747,747,227,107,107,107,107,229,747,788,828,828,789,747,227,107,107,107,107,229,747,747,747,747,747,747,747,747,747,747,747, - 747,747,747,747,747,747,747,747,747,747,747,267,268,268,268,268,269,747,747,747,747,747,747,267,268,268,268,268,269,747,747,747,747,747,747,747,747,747,747,747, - 747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,748,908,908,749,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747, - 747,747,747,747,747,747,747,747,747,747,747,747,747,747,748,908,908,749,869,0,0,867,748,908,908,749,747,747,747,747,747,747,747,747,747,747,747,747,747,747, - 747,747,747,747,747,747,747,747,747,747,748,908,908,749,869,0,0,867,869,0,0,867,869,0,0,867,748,908,908,749,747,747,747,747,747,747,747,747,747,747, - 747,747,747,747,747,747,747,747,747,747,869,0,0,867,869,0,0,867,788,828,828,789,869,0,0,867,869,0,0,867,747,747,747,747,747,747,747,747,747,747, - 747,747,747,747,747,747,747,747,747,747,869,0,0,867,788,828,828,789,747,747,747,747,788,828,828,789,869,0,0,867,747,747,747,747,747,747,747,747,747,747, - 747,747,747,747,747,747,747,747,747,747,788,828,828,789,747,747,747,747,747,747,747,747,747,747,747,747,788,828,828,789,747,747,747,747,747,747,747,747,747,747, - 747,747,747,747,747,747,187,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,189,747,747,747,747,747,747, - 747,747,747,747,747,747,227,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,229,747,747,747,747,747,747, - 747,747,747,747,747,747,267,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,269,747,747,747,747,747,747, - 747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747, - 747,747,747,747,747,747,747,747,747,747,748,908,908,908,908,908,908,908,908,908,908,908,908,908,908,908,908,908,908,749,747,747,747,747,747,747,747,747,747,747, - 747,747,747,747,747,747,747,747,747,747,869,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,867,747,747,747,747,747,747,747,747,747,747, - 747,747,747,747,747,747,747,747,747,747,869,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,867,747,747,747,747,747,747,747,747,747,747, - 747,747,747,747,747,747,747,747,747,747,788,828,828,828,828,828,828,828,828,828,828,828,828,828,828,828,828,828,828,789,747,747,747,747,747,747,747,747,747,747, - 747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747, - 188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188, - 107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107, - 107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107, - 107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107, - 107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107, - }; - hiddenname = "The Ship"; - result = contents; - break; - } - - case rn(3,12): - { - - static const short contents[] = { - 107,107,107,107,107,107,107,107,108,268,268,109,108,268,268,109,108,268,268,109,108,268,268,268,109,108,268,268,268,268,109,107,108,268,268,268,109,107,107,107, - 268,268,268,268,268,268,268,268,269,572,574,227,229,572,574,267,269,572,574,267,269,572,573,574,227,229,572,573,573,574,267,268,269,572,573,574,267,268,268,268, - 573,573,573,573,573,573,573,573,573,534,614,227,229,612,533,573,573,534,533,573,573,534,492,614,227,229,612,492,492,533,573,573,573,534,492,614,0,0,0,0, - 492,492,492,492,492,492,492,492,492,492,614,227,229,612,492,492,492,492,492,492,492,493,653,654,227,229,612,492,492,492,492,492,492,492,492,614,0,0,0,0, - 492,492,492,492,492,492,492,492,492,492,614,227,229,612,492,492,492,492,492,492,492,614,187,188,149,269,612,492,492,492,492,492,492,492,493,654,0,0,0,0, - 492,492,492,492,492,492,492,492,492,492,614,267,269,612,492,492,492,492,492,492,492,614,267,268,269,572,534,492,492,492,492,492,493,653,654,0,0,0,0,0, - 492,492,492,492,492,492,492,492,492,492,533,573,573,534,492,492,492,492,492,492,492,533,573,573,573,534,492,492,492,492,492,493,654,0,0,0,0,0,0,0, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,493,653,653,653,653,654,0,0,0,0,0,0,0,0, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,493,653,654,0,0,692,0,0,0,0,0,0,0,0,0,0, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,493,653,653,654,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0, - 653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,654,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,572,573,573,573,573,573,573,573,573,573,573,573,573,574,0,0,0,0, - 0,0,0,0,0,572,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,534,492,492,492,492,492,492,492,492,492,492,492,492,533,573,573,573,573, - 0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 0,0,0,0,0,652,653,653,653,653,494,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 0,0,0,0,0,0,692,0,0,0,652,653,494,492,492,492,492,492,492,492,492,492,492,492,492,492,492,493,653,653,653,653,653,653,653,653,653,653,653,653, - 0,0,0,0,0,0,692,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,692,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,692,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,692,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0, - }; - - obj.createentity(128, 160, 10, 1, 113030); // (savepoint) - result = contents; - break; - } - - - case rn(3,13): - { - - static const short contents[] = { - 0,0,0,0,0,0,0,683,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,683,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,683,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,683,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,683,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,683,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,683,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,683,0,0,0,563,525,483,483,483,483,483,483,483,483,483,483,483,483,484,644,645,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,683,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,683,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,563,564,564,564,564,564,525,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,484,644,645,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,563,525,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,563,525,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 564,564,564,525,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - }; - - obj.createentity(192, 96, 10, 0, 114030); // (savepoint) - result = contents; - break; - } - - case rn(3,14): - { - - static const short contents[] = { - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,499,659,659,659,659,659,659,660,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,539,579,579,580,0,698,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,539,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - }; - result = contents; - break; - } - - case rn(3,15): - { - - static const short contents[] = { - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,484,644,644,644,644,644, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,484,644,644,645,0,0,0,0,0, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,484,644,645,0,0,0,0,0,0,0,0, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,484,645,0,0,0,0,0,0,0,0,563,564, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,603,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,563,564,525,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,603,483,483,483, - 644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,485,483,483,483,483,483,483,483,483,483,483,484,645,0,0,0,0,0,0,563,525,483,483,483, - 0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,643,485,483,483,483,483,483,483,483,483,483,605,683,0,0,0,0,0,0,603,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,643,644,485,483,483,483,483,483,483,483,605,683,0,0,0,0,0,0,603,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,683,0,643,485,483,483,483,483,483,484,645,683,0,0,0,0,0,563,525,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,683,0,0,603,483,483,483,483,483,605,0,683,0,0,0,0,0,603,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,683,0,0,643,485,483,483,483,483,605,0,683,0,0,0,0,563,525,483,483,483,483,483, - 6,6,6,6,6,6,6,6,6,563,564,564,565,0,0,0,0,683,0,0,0,643,644,644,644,644,645,0,683,0,0,0,0,603,483,483,483,483,483,483, - 564,564,564,564,564,564,564,564,564,525,483,483,524,565,0,0,0,683,0,0,0,0,0,0,0,0,0,0,683,0,0,0,563,525,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,524,565,0,0,683,0,0,0,0,0,0,0,0,0,0,683,0,0,0,603,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,683,0,0,0,0,0,0,0,0,0,0,683,0,0,0,603,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,524,565,0,683,0,0,0,0,0,0,0,0,0,0,683,0,0,0,603,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,683,0,0,0,0,0,0,0,0,0,0,683,0,0,0,603,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,524,564,565,0,0,0,0,0,0,0,0,0,0,683,0,0,0,603,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,683,0,0,0,603,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,524,564,565,0,0,0,0,0,0,0,0,563,564,564,564,525,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,6,6,6,6,6,6,6,6,603,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,524,564,564,564,564,564,564,564,564,525,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - }; - result = contents; - break; - } - - case rn(4,5): - { - - static const short contents[] = { - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,499,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,500,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,499,659,659,659,660,0,0,0,698,0,0,0,0,0,0,0,0,0,0,698,0,0,658,659,659,659,659,500,498,498,498,498,498, - 498,498,498,498,498,499,659,660,0,0,698,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,698,0,0,698,0,0,0,0,658,500,498,498,498,498, - 498,498,498,498,498,620,0,0,0,0,698,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,698,0,0,698,0,0,0,0,0,618,498,498,498,498, - 498,498,498,498,498,620,0,0,0,0,698,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,698,0,0,698,0,0,0,0,0,618,498,498,498,498, - 498,498,498,498,498,620,0,0,0,0,698,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,698,0,0,698,0,0,0,0,0,658,659,659,659,659, - 659,659,659,659,659,660,0,0,0,0,698,0,0,0,0,698,0,0,0,0,0,0,0,0,0,578,579,579,579,579,580,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,578,579,579,579,579,579,579,580,0,0,0,0,0,0,0,0,618,498,498,498,498,620,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,620,0,0,0,0,0,0,578,579,540,498,498,498,498,620,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,620,0,0,0,0,0,0,618,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,620,0,0,0,0,0,0,618,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,620,0,0,0,0,0,0,618,498,498,498,498,498,498,539,579,579,580,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,499,660,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0, - 0,0,0,0,0,0,578,579,579,540,498,498,498,498,498,620,0,0,0,0,0,0,0,658,500,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0, - 0,0,0,0,0,0,618,498,498,498,498,498,498,498,499,660,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,499,660,0,0,0,0,0,0, - 0,0,0,0,0,0,618,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0, - 0,0,0,0,0,0,618,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,658,500,498,498,498,498,498,498,620,0,0,0,0,0,0,0, - 0,0,0,0,0,0,658,500,498,498,498,498,498,499,660,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,499,659,660,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,658,500,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,499,660,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,618,498,498,498,499,660,0,0,0,0,0,0,0,0,0,0,0,658,500,498,498,620,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,658,659,500,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,620,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,658,659,660,0,0,0,0,0,0,0,0,0,0,0,0,0,658,659,659,660,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - }; - result = contents; - break; - } - - case rn(4,7): - { - - static const short contents[] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,572,573,574,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,612,492,614,0,0,0,0,0,0,693,694,693,693,693,693,693,693,693,694,693,0,0,0,0,0,572,573,574,0,0,0,0,0,0,0,0, - 0,0,0,0,652,653,654,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,692,0,0,0,0,0,0,612,492,614,0,0,0,0,0,0,0,0, - 0,0,0,0,0,692,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,692,0,0,0,0,0,0,652,653,654,0,0,0,0,0,0,0,0, - 0,0,0,0,0,692,0,0,0,0,0,0,0,572,573,574,0,0,0,0,0,0,692,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,692,0,0,0,0,0,0,0,612,492,614,0,0,0,0,0,0,692,0,0,0,0,0,0,0,692,0,0,692,0,0,0,0,0,0, - 0,0,0,0,0,692,0,0,0,0,0,0,0,652,653,654,0,0,0,0,0,0,692,0,0,0,0,0,0,0,692,0,0,692,0,0,0,0,0,0, - 0,0,0,0,0,692,0,0,0,0,0,0,0,0,692,0,0,0,0,0,693,693,694,693,693,693,693,693,693,693,694,693,693,694,693,693,0,0,0,0, - 0,0,0,0,0,692,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,692,0,0,692,0,0,0,0,0,0, - 693,693,693,693,693,694,693,693,693,693,693,693,693,693,694,693,693,0,0,0,0,0,692,0,0,0,0,0,0,0,692,0,0,692,0,0,0,0,0,0, - 0,0,0,0,0,692,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,572,573,574,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0, - 0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,614,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0, - 0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,652,653,654,0,0,0,0,0,0,0,0,572,573,574,0,0,0,0,0, - 0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,612,492,614,0,0,0,0,0, - 0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,652,653,654,0,0,0,0,0, - 0,0,0,0,572,573,574,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,612,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,652,653,654,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,572,573,574,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,614,693,693,693,693,693,694,693,693,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,652,653,654,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - }; - result = contents; - break; - } - - case rn(4,9): - { - - static const short contents[] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,190,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,270,272,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,190,191,192,0,0,0,0,0,0,0,0, - 0,0,0,0,0,190,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,230,110,232,0,0,0,0,0,0,0,0, - 0,0,0,0,0,270,272,0,0,0,0,0,0,0,0,0,0,190,191,192,0,0,0,0,0,0,0,0,0,270,271,272,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,230,110,232,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,270,271,272,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,190,191,192,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,230,110,232,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,270,271,272,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,190,191,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,230,110,232,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,270,271,272,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,192,0,0,0,190,191,191,191,191,191,191,192,0,0,190,191,191,191,191,191,191,191,191,191,191, - 110,110,110,110,110,110,110,111,271,271,271,112,110,110,110,232,0,0,0,230,110,110,110,110,110,110,232,0,0,230,110,110,110,110,110,110,110,110,110,110, - 110,110,110,110,110,110,110,232,0,0,0,230,110,110,110,232,0,0,0,230,110,110,110,110,110,110,151,191,191,152,110,111,271,271,271,112,110,110,110,110, - 110,110,110,110,110,110,110,232,0,0,0,230,110,110,110,151,191,191,191,152,110,110,110,110,110,110,110,110,110,110,110,232,0,0,0,230,110,110,110,110, - 110,110,110,110,110,110,110,232,0,0,0,230,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,232,0,0,0,230,110,110,110,110, - 110,110,110,110,110,110,110,151,191,191,191,152,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,232,0,0,0,230,110,110,110,110, - 110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,151,191,191,191,152,110,110,110,110, - }; - result = contents; - break; - } - - case rn(4,10): - { - - static const short contents[] = { - 110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, - 110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, - 110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, - 110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, - 271,271,271,271,271,271,271,271,112,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, - 750,750,750,750,750,750,750,750,270,271,271,112,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, - 750,750,750,750,750,750,750,750,750,750,750,270,271,271,112,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, - 750,751,911,911,911,911,911,911,752,750,750,750,750,750,270,271,271,271,271,271,271,271,271,271,271,271,271,271,112,110,110,110,110,110,110,110,110,110,110,110, - 750,872,0,0,0,0,0,0,870,750,750,750,750,750,750,750,750,750,750,750,750,750,750,750,750,750,750,750,270,271,271,271,271,112,110,110,110,110,110,110, - 750,872,0,0,0,0,0,0,870,750,750,750,750,750,750,750,750,750,750,750,750,751,911,911,752,750,750,750,750,872,0,0,0,270,271,112,110,110,110,110, - 750,872,0,0,0,0,0,0,870,750,750,750,750,750,750,750,750,751,911,911,752,872,0,0,870,750,750,750,750,872,0,0,0,0,0,230,110,110,110,110, - 750,791,831,831,831,831,831,831,792,750,750,750,750,751,911,911,752,872,0,0,870,872,0,0,870,750,750,750,750,872,0,0,0,0,0,230,110,110,110,110, - 750,750,750,750,750,750,750,750,750,751,911,911,752,872,0,0,870,872,0,0,870,872,0,0,870,750,750,750,750,872,0,0,0,0,0,230,110,110,110,110, - 750,750,750,750,750,751,911,911,752,872,0,0,870,872,0,0,870,872,0,0,870,872,0,0,870,750,750,750,750,872,0,0,0,0,0,230,110,110,110,110, - 750,751,911,911,752,872,0,0,870,872,0,0,870,872,0,0,870,872,0,0,870,872,0,0,870,750,750,750,750,872,0,0,0,0,0,230,110,110,110,110, - 750,872,0,0,870,872,0,0,870,872,0,0,870,872,0,0,870,872,0,0,870,872,0,0,870,750,750,750,750,872,0,0,0,0,0,230,110,110,110,110, - 750,872,0,0,870,872,0,0,870,872,0,0,870,872,0,0,870,872,0,0,870,872,0,0,870,750,750,750,750,872,0,0,0,0,0,230,110,110,110,110, - 750,872,0,0,870,872,0,0,870,872,0,0,870,872,0,0,870,872,0,0,870,872,0,0,870,750,750,750,190,191,191,191,191,191,191,152,110,110,110,110, - 750,872,0,0,870,872,0,0,870,872,0,0,870,872,0,0,870,872,0,0,870,872,0,0,870,750,750,190,152,110,110,110,110,110,110,110,110,110,110,110, - 750,872,0,0,870,872,0,0,870,872,0,0,870,872,0,0,870,872,0,0,870,872,0,0,870,750,190,152,110,110,110,110,110,110,110,110,110,110,110,110, - 750,872,0,0,870,872,0,0,870,872,0,0,870,872,0,0,870,872,0,0,870,872,0,0,870,750,270,271,271,271,271,271,271,271,271,112,110,110,110,110, - 750,872,0,0,870,872,0,0,870,872,0,0,870,872,0,0,870,872,0,0,870,872,0,0,870,750,750,750,750,872,0,0,0,0,0,230,110,110,110,110, - 750,872,0,0,870,872,0,0,870,872,0,0,870,872,0,0,870,872,0,0,870,872,0,0,870,750,750,750,750,872,0,0,0,0,0,230,110,110,110,110, - 750,791,831,831,792,791,831,831,792,791,831,831,792,791,831,831,792,791,831,831,792,791,831,831,792,750,750,750,750,872,0,0,0,0,0,230,110,110,110,110, - 750,750,750,750,750,750,750,750,750,750,750,750,750,750,750,750,750,750,750,750,750,750,750,750,750,750,750,750,750,872,0,0,0,0,0,230,110,110,110,110, - 191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,152,110,110,110,110, - 110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, - 110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, - 110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, - 110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, - }; - - obj.createentity(256, 120, 20, 1); //Terminal Ship computer - obj.createblock(5, 256 - 4, 120, 20, 16, 22); - - obj.createentity(256, 184, 20, 1); //Terminal - obj.createentity(232, 184, 20, 1); //Terminal - obj.createentity(208, 184, 20, 1); //Terminal - obj.createblock(5, 208 + 4, 184, 56, 16, 23); - hiddenname = "The Ship"; - result = contents; - break; - } - - case rn(4,11): - { - - static const short contents[] = { - 116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, - 116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, - 116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, - 116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, - 116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, - 277,277,277,277,277,277,277,277,277,277,277,277,277,277,277,277,277,277,277,277,277,277,277,277,277,277,277,277,118,116,116,116,116,116,116,116,116,116,116,116, - 756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,236,116,116,116,116,116,116,116,116,116,116,116, - 756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,236,116,116,116,116,116,116,116,116,116,116,116, - 756,756,756,756,757,917,917,917,917,758,756,756,757,917,917,917,917,758,756,756,757,917,917,917,917,758,756,756,236,116,116,116,116,116,116,116,116,116,116,116, - 756,756,756,756,878,0,0,0,0,876,756,756,878,0,0,0,0,876,756,756,878,0,0,0,0,876,756,756,236,116,116,116,116,116,116,116,116,116,116,116, - 756,756,756,756,878,0,0,0,0,876,756,756,878,0,0,0,0,876,756,756,878,0,0,0,0,876,756,756,236,116,116,116,116,116,116,116,116,116,116,116, - 756,756,756,756,878,0,0,0,0,876,756,756,878,0,0,0,0,876,756,756,878,0,0,0,0,876,756,756,236,116,116,116,116,116,116,116,116,116,116,116, - 756,756,756,756,878,0,0,0,0,876,756,756,878,0,0,0,0,876,756,756,878,0,0,0,0,876,756,756,236,116,116,116,116,116,116,116,116,116,116,116, - 756,756,756,756,878,0,0,0,0,876,756,756,878,0,0,0,0,876,756,756,878,0,0,0,0,876,756,756,236,116,116,116,116,116,116,116,116,116,116,116, - 756,756,756,756,878,0,0,0,0,876,756,756,878,0,0,0,0,876,756,756,878,0,0,0,0,876,756,756,236,116,116,116,116,116,116,116,116,116,116,116, - 756,756,756,756,878,0,0,0,0,876,756,756,797,837,837,837,837,798,756,756,878,0,0,0,0,876,756,756,236,116,116,116,116,116,116,116,116,116,116,116, - 756,756,756,756,878,0,0,0,0,876,756,756,756,756,756,756,756,756,756,756,878,0,0,0,0,876,756,756,236,116,116,116,116,116,116,116,116,116,116,116, - 756,756,756,756,878,0,0,0,0,876,756,756,756,756,756,756,756,756,756,756,878,0,0,0,0,876,756,756,236,116,116,116,116,116,116,116,116,116,116,116, - 756,756,756,756,878,0,0,0,0,876,756,756,196,197,197,197,197,198,756,756,878,0,0,0,0,876,756,756,236,116,116,116,116,116,116,116,116,116,116,116, - 756,756,756,756,878,0,0,0,0,876,756,756,236,116,116,116,116,238,756,756,878,0,0,0,0,876,756,756,236,116,116,116,116,116,116,116,116,116,116,116, - 756,756,756,756,878,0,0,0,0,876,756,756,236,116,116,116,116,238,756,756,878,0,0,0,0,876,756,756,236,116,116,116,116,116,116,116,116,116,116,116, - 756,756,756,756,878,0,0,0,0,876,756,756,236,116,116,116,116,238,756,756,878,0,0,0,0,876,756,756,236,116,116,116,116,116,116,116,116,116,116,116, - 756,756,756,756,797,837,837,837,837,798,756,756,236,116,116,116,116,238,756,756,797,837,837,837,837,798,756,756,236,116,116,116,116,116,116,116,116,116,116,116, - 756,756,756,756,756,756,756,756,756,756,756,756,236,116,116,116,116,238,756,756,756,756,756,756,756,756,756,756,236,116,116,116,116,116,116,116,116,116,116,116, - 756,756,756,756,756,756,756,756,756,756,756,756,236,116,116,116,116,238,917,917,758,756,756,756,756,757,917,917,236,116,116,116,116,116,116,116,116,116,116,116, - 197,197,197,197,197,197,197,197,197,197,197,197,158,116,116,116,116,238,0,0,876,756,756,756,756,878,0,0,236,116,116,116,116,116,116,116,116,116,116,116, - 116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,238,0,0,916,917,917,917,917,918,0,0,236,116,116,116,116,116,116,116,116,116,116,116, - 116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,238,0,0,0,0,0,0,0,0,0,0,236,116,116,116,116,116,116,116,116,116,116,116, - 116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,238,0,0,0,0,0,0,0,0,0,0,236,116,116,116,116,116,116,116,116,116,116,116, - 116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,238,0,0,0,0,0,0,0,0,0,0,236,116,116,116,116,116,116,116,116,116,116,116, - }; - hiddenname = "The Ship"; - result = contents; - break; - } - - case rn(4,12): - { - - static const short contents[] = { - 116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,238,0,0,0,0,0,0,0,0,0,0,236,116,116,116,116,116,116,116,116,116,116,116, - 277,277,277,277,277,277,277,277,277,277,277,277,277,277,277,118,116,238,0,0,0,0,0,0,0,0,0,0,236,116,117,277,277,277,277,277,277,277,277,277, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,236,116,238,0,0,0,0,0,0,0,0,0,0,236,116,238,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,236,116,238,0,0,0,0,0,0,0,0,0,0,236,116,238,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,276,277,278,0,0,0,0,0,0,0,0,0,0,276,277,278,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,563,564,564,564,565,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,563,564,564,564,525,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 564,564,564,564,564,525,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 483,483,483,483,483,483,483,484,644,644,644,644,644,645,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 644,644,644,644,644,644,644,645,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - }; - result = contents; - break; - } - - case rn(4,13): - { - - static const short contents[] = { - 0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,569,570,570,570,570,571,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,649,650,650,650,650,651,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,689,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,689,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,689,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,690,690,690,691,690,690,690,690,690,690,690,690,690,690,690,690,690,690,690,690,690,690,691,690,690,691,690,690,690,690,690,690, - 0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,689,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,569,570,570,571,0,689,0,0,689,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,530,570,570,571,0,689,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,649,650,650,491,489,489,530,570,570,571,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,530,570,570,570,570,570, - 0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489, - 0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489, - 0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489, - }; - - obj.createentity(248, 112, 10, 1, 114040); // (savepoint) - result = contents; - break; - } - - case rn(4,14): - { - - static const short contents[] = { - 0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492, - 0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492, - 0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492, - 0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492, - 0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492, - 0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492, - 0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,652,653,653,653,494,492,492,492,492,492,492,492, - 0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,652,653,653,653,653,653,653,653, - 0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,572,573,573,573,573,573,573,573,573,574,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,533,573,574,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,533,573,574,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,533,573,574,0,0,0,692,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,533,573,574,0,692,0,0,0,0,0,0,0,0,0,0, - 573,573,573,573,573,574,0,0,0,0,652,653,653,494,492,492,492,492,492,492,492,492,492,492,492,492,492,533,573,574,0,0,0,0,0,0,0,0,0,0, - 492,492,492,492,492,614,0,0,0,0,0,692,0,652,653,494,492,492,492,492,492,492,492,492,492,492,492,492,492,533,573,573,573,573,573,574,0,0,0,0, - 492,492,492,492,492,614,0,0,0,0,0,692,0,0,0,652,653,653,653,653,653,494,492,492,492,492,492,492,492,492,492,492,492,492,492,533,573,573,573,573, - 492,492,492,492,492,533,574,0,0,0,0,692,0,0,0,0,692,0,0,0,0,652,494,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,614,0,0,0,0,692,0,0,0,0,692,0,0,0,0,0,652,494,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,533,574,0,0,0,692,0,0,0,0,692,0,0,0,0,0,0,652,494,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,533,573,574,0,692,0,0,0,0,692,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,533,573,573,573,573,573,573,573,574,0,0,0,0,0,0,652,494,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,533,574,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,533,574,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - }; - - obj.createentity(104, 176, 10, 1, 115040); // (savepoint) - result = contents; - break; - } - - case rn(4,15): - { - - static const short contents[] = { - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 641,641,641,641,641,641,482,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 0,0,0,0,0,0,640,641,482,480,480,480,480,480,480,480,480,480,481,642,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 0,0,0,0,0,0,0,0,640,641,482,480,480,480,480,480,480,480,602,0,0,0,0,0,560,522,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 0,0,0,0,0,0,0,0,0,680,640,641,482,480,480,480,481,641,642,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 0,0,0,0,0,0,0,0,0,680,0,0,640,641,641,641,642,680,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 561,561,561,561,562,0,0,0,0,680,0,0,0,680,0,0,0,680,0,0,0,0,0,560,522,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,521,561,562,0,0,680,0,0,0,680,0,0,0,680,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,521,562,0,680,0,0,0,680,0,0,0,680,0,0,0,560,561,522,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,521,561,562,0,0,0,680,0,0,0,680,0,560,561,522,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,521,561,561,561,561,561,561,561,561,561,522,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - }; - - obj.createentity(16, 40, 10, 1, 15040); // (savepoint) - result = contents; - break; - } - - case rn(5,2): - { - - static const short contents[] = { - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,484,644,644,644,644,644,644,644,644, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,484,645,0,0,0,0,0,0,0,0, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,524,564,564,565,0,0,0,0,0,0, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,484,644,644,644,644,644,644,645,0,0,0,0,0,0, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,484,644,644,644,645,0,0,0,0,0,0,0,0,0,0,0,0,0, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,484,644,644,644,645,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - }; - result = contents; - break; - } - - case rn(5,3): - { - - static const short contents[] = { - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,572,573,574,0,0,0,0,0,0,0,0,0,0, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,693,693,693,693,693,693,693,693,612,492,614,0,0,0,0,0,0,0,0,0,0, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,652,653,654,0,0,0,0,0,0,0,0,0,0, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,692,0,0,0,692,0,0,692,0,572,573,573,574,0,0,0, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,693,694,693,693,693,694,693,693,694,693,612,492,492,614,0,0,0, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,692,0,0,0,692,0,0,692,0,652,653,653,654,0,0,0, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,692,0,0,0,692,0,0,692,0,0,0,0,0,0,0,0, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,692,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,572,573,574,0,0,0,0,0,692,0,0,0,0,0,0,0,0, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,612,492,614,0,0,0,0,0,692,0,0,0,0,0,0,0,0, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,652,653,654,0,0,0,0,0,692,0,0,0,0,0,0,0,0, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,572,573,574,0,0,0,0,0,0,0, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,693,693,693,693,693,693,693,693,693,693,693,612,492,614,0,0,0,0,0,0,0, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,652,653,654,0,0,0,0,0,0,0, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - }; - - obj.createentity(272, 128, 10, 0, 3050); // (savepoint) - result = contents; - break; - } - - case rn(5,4): - { - - static const short contents[] = { - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,530,570,570,571,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,530,570,570,571,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,530,570,570,571,0,0,0,0,0,0,0,0,0,0,0,0, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0, - 489,489,489,489,489,489,489,490,650,650,650,650,650,650,650,650,650,650,491,489,489,489,489,489,490,650,650,651,0,0,0,0,0,0,0,0,0,0,0,0, - 489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,649,650,650,650,650,650,651,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 489,489,489,489,489,489,489,530,570,570,570,570,570,570,570,570,570,570,570,570,571,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,490,651,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,490,651,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - }; - result = contents; - break; - } - - case rn(5,5): - { - - static const short contents[] = { - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,487,648,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 647,647,647,647,488,486,486,486,486,486,486,486,486,486,486,486,487,648,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,646,647,488,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,646,647,488,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,646,647,488,486,486,486,486,487,648,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,646,488,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,606,486,486,487,648,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,606,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,606,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,606,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,606,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,646,488,487,648,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,646,648,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - }; - result = contents; - break; - } - - case rn(5,6): - { - - static const short contents[] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,575,576,576,576,576,576,576,576,576,576,576,576,576,577,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,617,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696, - 0,0,0,0,0,0,0,0,0,0,0,655,656,656,656,656,656,656,656,656,656,656,656,656,657,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - }; - result = contents; - break; - } - - case rn(5,7): - { - - static const short contents[] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,563,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - }; - result = contents; - break; - } - - case rn(5,8): - { - - static const short contents[] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,646,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - }; - result = contents; - break; - } - - case rn(5,9): - { - - static const short contents[] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,184,186,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,264,266,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,184,185,186,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,224,104,226,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,264,265,266,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 185,185,185,185,185,185,185,186,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 104,104,104,104,104,104,104,226,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 104,104,104,104,104,104,104,145,185,186,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 104,104,104,104,104,104,104,104,104,226,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 104,104,104,104,104,104,104,104,104,226,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 104,104,104,104,104,104,104,104,104,226,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 104,104,104,104,104,104,104,104,104,226,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - }; - result = contents; - break; - } - - case rn(5,10): - { - - static const short contents[] = { - 104,104,104,104,104,104,104,104,104,226,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 104,104,104,104,104,104,104,104,104,226,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 104,104,104,104,104,104,104,104,104,226,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 104,104,104,104,104,104,104,104,104,226,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 104,104,104,104,104,104,104,104,104,226,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 104,104,104,104,104,104,104,104,104,226,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 104,104,104,104,104,104,104,104,104,226,0,0,0,0,566,567,567,567,567,567,567,567,568,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 104,104,104,104,104,104,104,104,104,226,0,0,0,0,646,647,647,647,647,647,647,647,648,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 104,104,104,104,104,104,104,104,104,226,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 104,104,104,104,104,104,104,104,104,226,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 104,104,104,104,104,104,104,104,104,226,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 104,104,104,104,104,104,104,104,104,226,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 104,104,104,104,104,104,104,104,104,226,0,0,0,0,0,0,0,0,0,0,566,567,567,567,567,567,568,0,0,0,0,0,0,0,0,0,0,0,0,0, - 104,104,104,104,104,104,104,104,104,226,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,608,687,687,687,687,687,687,687,687,687,687,687,687,687, - 104,104,104,104,104,104,104,104,104,226,0,0,0,0,0,0,0,0,0,0,646,647,647,647,647,647,648,0,0,0,0,0,0,0,0,0,0,0,0,0, - 104,104,104,104,104,104,104,104,104,226,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 104,104,104,104,104,104,104,104,104,226,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 104,104,104,104,104,104,104,104,104,226,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 104,104,104,104,104,104,104,104,104,226,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 104,104,104,104,104,104,104,104,104,226,0,0,0,0,0,0,0,0,0,0,0,0,0,0,566,567,567,567,567,567,567,567,568,0,0,0,0,0,0,0, - 104,104,104,104,104,104,104,104,104,226,0,0,0,0,0,0,0,0,0,0,0,0,0,0,646,647,647,647,647,647,647,647,648,0,0,0,0,0,0,0, - 104,104,104,104,104,104,104,104,104,226,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 104,104,104,104,104,104,104,104,104,226,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 104,104,104,104,104,104,104,104,104,226,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 104,104,104,104,104,104,104,104,104,226,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 104,104,104,104,104,104,104,104,104,226,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 104,104,104,104,104,104,104,104,104,226,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 104,104,104,104,104,104,104,104,104,226,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 104,104,104,104,104,104,104,104,104,226,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 104,104,104,104,104,104,104,104,104,226,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - }; - result = contents; - break; - } - - case rn(5,11): - { - - static const short contents[] = { - 113,113,113,113,113,113,113,113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 113,113,113,113,113,113,113,113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 113,113,113,113,113,113,113,113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 113,113,113,113,113,113,113,113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 113,113,113,113,113,113,113,113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 113,113,113,113,113,113,113,113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 113,113,113,113,113,113,113,113,113,154,194,195,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 113,113,113,113,113,113,113,113,113,113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 113,113,113,113,113,113,113,113,113,113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 113,113,113,113,113,113,113,113,113,113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 113,113,113,113,113,113,113,113,113,113,113,154,195,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 113,113,113,113,113,113,113,113,113,113,113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 113,113,113,113,113,113,113,113,113,113,113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 113,113,113,113,113,113,113,113,113,113,113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 113,113,113,113,113,113,113,113,113,113,113,113,154,195,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 113,113,113,113,113,113,113,113,113,113,113,113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 113,113,113,113,113,113,113,113,113,113,113,113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 113,113,113,113,113,113,113,113,113,113,113,113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 113,113,113,113,113,113,113,113,113,113,113,113,113,154,195,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 113,113,113,113,113,113,113,113,113,113,113,113,113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 113,113,113,113,113,113,113,113,113,113,113,113,113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 113,113,113,113,113,113,113,113,113,113,113,113,113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 113,113,113,113,113,113,113,113,113,113,113,113,113,113,154,195,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,154,195,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - }; - result = contents; - break; - } - - case rn(5,12): - { - - static const short contents[] = { - 113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 274,274,274,274,274,274,274,274,274,274,274,274,274,274,274,274,275,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,560,561,561,561,561,561,562,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,640,482,480,480,480,481,642,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,640,641,641,641,642,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - }; - result = contents; - break; - } - - case rn(5,13): - { - - static const short contents[] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,572,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,574,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,693,693,693,693,693,693,693,693,693,693,693,693,693,693,693, - 0,0,0,0,0,0,612,492,492,492,493,653,653,653,653,653,653,653,653,653,653,653,653,653,654,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,652,653,653,653,654,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 693,693,693,693,693,693,693,693,694,693,693,693,693,693,693,693,693,693,693,693,694,693,693,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,572,573,573,573,573,573,573,574,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,572,573,573,573,573,573,573,573,573,573,573,573,534,492,492,492,492,492,492,533,573,573,573,573,573,573,573,573,574,0,0,0,0, - 573,573,573,573,573,573,573,534,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,533,573,573,573,573, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - }; - - obj.createentity(184, 176, 10, 1, 13050); // (savepoint) - result = contents; - break; - } - - case rn(5,14): - { - - static const short contents[] = { - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,496,656,656,656,656,656,656,656,656,656,656,656, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,496,656,656,656,656,656,656,656,657,0,0,695,0,0,0,0,0,0,0,0, - 495,495,495,495,495,495,495,495,495,495,495,496,656,656,656,656,656,656,656,656,657,0,0,695,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0, - 656,656,656,656,656,656,656,656,656,656,656,657,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0, - 576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,577,0,0,695,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,536,576,576,576,577,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,536,576,576,576,577,0,0,695,0,0,0,0,0,0,0,0, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,536,576,576,576,577,0,0,0,0,0,0,0, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,536,576,576,576,576,576,576,576, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - }; - result = contents; - break; - } - - - case rn(5,15): - { - - static const short contents[] = { - 486,486,486,486,486,486,486,487,647,647,647,647,488,486,486,486,486,487,647,647,647,647,647,647,647,647,647,647,647,488,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,608,0,0,0,0,606,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,646,488,486,486,486,486,486,486,486,486,486, - 486,486,486,486,487,647,647,648,0,0,0,0,606,486,486,487,647,648,0,0,0,0,0,0,0,0,0,0,0,0,646,647,647,647,488,486,486,486,486,486, - 486,487,647,647,648,686,0,0,0,0,0,0,606,486,487,648,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486, - 486,608,0,0,0,686,0,0,0,0,0,0,606,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,566,567,568,0,566,528,487,647,647,647,647, - 486,608,0,0,0,686,0,0,0,0,0,0,606,486,608,687,687,687,687,687,566,567,567,567,567,567,568,687,687,606,486,608,0,606,486,608,0,0,686,0, - 486,608,0,0,0,686,0,0,0,0,0,0,646,488,608,0,0,0,0,0,606,486,486,486,487,647,648,0,0,646,647,648,0,606,486,608,0,0,566,567, - 486,608,0,0,0,686,0,0,0,566,568,0,0,646,648,0,0,0,0,566,528,486,486,486,608,0,0,0,0,0,686,0,0,606,486,608,0,0,606,486, - 486,608,0,0,0,566,568,0,0,606,527,568,0,0,686,0,0,0,0,646,647,647,488,486,527,568,0,0,0,0,686,0,0,606,486,608,0,0,646,647, - 486,608,687,687,687,606,527,567,567,528,486,608,0,0,686,0,0,0,0,0,0,0,646,647,488,527,568,0,0,0,686,0,0,606,486,608,0,0,0,0, - 486,608,0,0,0,646,488,486,486,486,487,648,0,0,686,0,0,0,0,0,0,0,686,0,606,487,648,0,0,0,686,0,566,528,486,608,0,0,0,0, - 486,608,0,0,0,0,646,488,486,486,608,0,0,0,686,0,0,0,0,0,0,0,686,0,646,648,0,0,0,0,686,0,606,486,487,648,0,0,0,0, - 486,608,0,0,0,0,0,646,647,647,648,0,566,567,567,567,568,0,0,0,566,567,568,0,0,0,0,0,0,566,567,567,528,486,608,0,0,0,0,0, - 486,608,0,0,0,0,0,686,0,0,0,566,528,486,486,486,608,0,0,566,528,486,608,687,687,687,687,687,687,606,486,487,647,647,648,0,0,0,0,0, - 486,608,0,0,0,0,0,686,0,0,566,528,486,486,487,647,648,0,0,606,486,487,648,0,0,0,0,0,0,606,486,608,0,0,686,0,0,0,0,0, - 486,608,0,0,0,0,0,686,0,0,606,486,486,487,648,0,0,0,0,646,647,648,0,0,0,0,0,0,566,528,486,608,0,0,686,0,0,0,0,0, - 486,608,0,0,0,0,0,686,0,0,646,488,486,608,0,0,0,0,0,0,686,0,0,0,0,566,567,567,528,487,647,648,0,0,686,0,0,0,0,0, - 486,608,0,0,0,566,567,568,0,0,0,646,488,608,0,0,0,0,0,0,686,0,0,0,0,606,486,487,647,648,0,0,0,0,686,0,0,0,0,0, - 486,527,567,568,0,606,486,608,0,0,0,0,606,527,568,0,0,0,0,566,568,0,0,0,0,646,488,608,0,0,0,0,0,0,566,567,568,0,0,0, - 486,486,486,608,0,646,647,648,0,0,0,0,606,486,608,0,0,566,567,528,608,0,0,0,0,0,646,648,0,0,0,0,0,0,606,486,608,0,0,0, - 486,486,486,527,568,0,0,686,0,0,0,0,606,487,648,687,687,606,486,486,608,0,0,0,0,0,0,686,0,0,0,0,0,0,606,487,648,0,0,0, - 486,486,486,486,608,0,0,686,0,0,0,0,606,608,0,0,0,606,486,486,608,0,0,0,0,0,0,566,567,567,568,0,0,566,528,608,0,0,0,0, - 486,486,486,486,608,0,0,566,567,568,0,0,606,608,0,0,0,606,486,486,527,567,567,568,687,687,687,606,486,486,608,0,0,606,486,608,0,0,0,0, - 486,486,486,486,608,0,566,528,486,608,0,0,606,608,0,0,0,606,486,486,486,486,486,608,0,0,0,646,647,647,648,0,0,646,647,648,0,0,0,0, - 486,486,486,486,608,0,606,486,487,648,0,0,646,648,0,0,0,606,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0, - 486,486,486,486,608,0,606,486,608,0,0,0,0,686,0,0,566,528,486,486,486,486,486,527,568,0,0,0,0,0,0,0,0,566,567,568,0,0,0,0, - 486,486,486,486,527,567,528,486,608,0,0,0,0,686,0,0,606,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,608,0,0,0,0, - 486,486,486,486,486,486,486,486,608,0,0,0,0,686,0,0,606,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,527,567,567,567,567, - 486,486,486,486,486,486,486,486,527,567,568,0,0,686,0,0,606,486,486,486,486,486,486,486,527,568,0,0,0,0,0,566,567,528,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,527,567,567,567,567,567,528,486,486,486,486,486,486,486,486,527,567,567,567,567,567,528,486,486,486,486,486,486,486,486, - }; - - obj.createentity(72, 16, 9, 14); // (shiny trinket) - result = contents; - break; - } - - case rn(5,18): - { - - static const short contents[] = { - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,490,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650, - 489,489,611,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0, - 489,489,611,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0, - 489,489,611,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0, - 489,489,611,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0, - 489,489,611,0,0,0,0,569,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570, - 489,489,611,690,690,690,690,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,611,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,611,0,0,0,0,609,489,489,490,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650, - 489,489,611,0,0,0,0,609,489,489,611,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0, - 489,489,611,0,0,0,0,609,489,489,611,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0, - 489,489,611,0,0,0,0,609,489,489,611,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0, - 489,489,611,0,0,0,0,609,489,489,611,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0, - 489,489,611,0,0,0,0,609,489,489,611,0,0,0,0,569,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570, - 489,489,611,0,0,0,0,609,489,489,611,690,690,690,690,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,611,0,0,0,0,609,489,489,611,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,611,0,0,0,0,609,489,489,611,0,0,0,0,609,489,489,490,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650, - 489,489,611,0,0,0,0,609,489,489,611,0,0,0,0,609,489,489,611,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 489,489,611,0,0,0,0,609,489,489,611,0,0,0,0,609,489,489,611,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 489,489,611,0,0,0,0,609,489,489,611,0,0,0,0,609,489,489,611,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 489,489,611,690,690,690,690,609,489,489,611,0,0,0,0,609,489,489,611,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 489,489,611,0,0,0,0,609,489,489,611,0,0,0,0,609,489,489,611,0,0,0,0,569,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570, - 489,489,611,0,0,0,0,609,489,489,611,0,0,0,0,609,489,489,611,690,690,690,690,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,611,0,0,0,0,609,489,489,611,0,0,0,0,609,489,489,611,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,611,0,0,0,0,609,489,489,611,0,0,0,0,609,489,489,611,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,611,0,0,0,0,609,489,489,611,0,0,0,0,609,489,489,611,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,611,0,0,0,0,609,489,489,611,0,0,0,0,609,489,489,611,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,611,0,0,0,0,609,489,489,611,0,0,0,0,609,489,489,611,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - }; - - obj.createentity(224, 160, 13); //Warp Token - - result = contents; - break; - } - - case rn(5,19): - { - - static const short contents[] = { - 492,492,614,0,0,0,0,612,492,492,614,0,0,0,0,612,492,492,614,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,614,0,0,0,0,612,492,492,614,0,0,0,0,612,492,492,614,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,614,0,0,0,0,612,492,492,614,0,0,0,0,612,492,492,614,693,693,693,693,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,614,0,0,0,0,612,492,492,614,0,0,0,0,612,492,492,614,0,0,0,0,652,653,653,494,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,614,0,0,0,0,612,492,492,614,0,0,0,0,612,492,492,614,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,614,693,693,693,693,612,492,492,614,0,0,0,0,612,492,492,614,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,614,0,0,0,0,612,492,492,614,0,0,0,0,612,492,492,614,0,0,0,0,0,0,0,652,653,653,653,653,653,653,653,653,653,653,653,653,653, - 492,492,614,0,0,0,0,612,492,492,614,0,0,0,0,612,492,492,614,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,692,0,0,0, - 492,492,614,0,0,0,0,612,492,492,614,0,0,0,0,612,492,492,533,573,573,574,0,0,0,0,0,692,0,0,0,0,0,0,0,0,692,0,0,0, - 492,492,614,0,0,0,0,612,492,492,614,0,0,0,0,612,492,492,492,492,492,614,0,0,0,0,0,692,0,0,0,0,0,0,0,0,692,0,0,0, - 492,492,614,0,0,0,0,612,492,492,614,693,693,693,693,612,492,492,492,492,492,614,0,0,0,0,0,692,0,0,0,0,0,0,0,0,692,0,0,0, - 492,492,614,0,0,0,0,612,492,492,614,0,0,0,0,652,653,653,494,492,492,533,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573, - 492,492,614,0,0,0,0,612,492,492,614,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,614,0,0,0,0,612,492,492,614,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,614,0,0,0,0,612,492,492,614,0,0,0,0,0,0,0,652,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653, - 492,492,614,0,0,0,0,612,492,492,614,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 492,492,614,0,0,0,0,612,492,492,533,573,573,574,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 492,492,614,0,0,0,0,612,492,492,492,492,492,614,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 492,492,614,693,693,693,693,612,492,492,492,492,492,614,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 492,492,614,0,0,0,0,652,653,653,494,492,492,533,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573, - 492,492,614,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,614,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,614,0,0,0,0,0,0,0,652,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653, - 492,492,614,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0, - 492,492,614,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0, - 492,492,614,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0, - 492,492,614,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0, - 492,492,533,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - }; - result = contents; - break; - } - - case rn(6,2): - { - - static const short contents[] = { - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,481,641,641,641,641,641,641,641,641,482,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,481,641,642,0,0,0,0,0,0,0,0,640,641,482,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,481,641,641,642,0,0,0,0,0,0,0,0,0,0,0,0,640,641,641,482,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,602,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,600,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,481,641,641,642,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,640,641,641,482,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,602,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,600,480,480,480,480,480,480,480, - 480,480,480,480,481,641,641,642,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,640,641,641,482,480,480,480,480, - 480,480,480,480,602,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,600,480,480,480,480, - 641,641,641,641,642,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,640,641,641,641,641, - 0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,560,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,562,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,640,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,642,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - }; - - obj.createentity(152, 152, 10, 0, 103060); // (savepoint) - result = contents; - break; - } - - case rn(6,4): - { - - static const short contents[] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,563,564,564,564,564,564,564,564,564,565,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,643,644,644,644,644,644,644,644,644,645,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,683,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,683,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,683,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,683,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,683,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,683,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,683,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,683,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,683,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,563,564,564,564,564,564,565,0,0,0,0,0,683,0,0,0,0,683,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,524,564,565,0,0,0,683,0,0,0,0,683,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,643,485,483,483,483,483,483,483,524,564,565,0,683,0,0,0,0,683,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,524,564,565,0,0,0,0,683,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,643,485,483,483,483,483,483,483,483,483,483,524,564,565,0,0,683,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,524,564,564,565,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,643,485,483,483,483,483,483,483,483,483,483,483,483,483,483,524,564,564,565,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,524,564,564,564,564, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,643,485,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - }; - - obj.createentity(128, 120, 10, 1, 4060); // (savepoint) - result = contents; - break; - } - - case rn(6,5): - { - - static const short contents[] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,658,500,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,658,500,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,658,500,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,658,500,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,658,500,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,658,500,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,658,500,498,498,498,498,498,498,498,498,498,498,498,498,498, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498, - }; - result = contents; - break; - } - - case rn(6,6): - { - - static const short contents[] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,566,528,486,486,486,486,486,486,486,486,486,486,486,486,486, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,566,528,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,646,488,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,646,488,486,486,486,486,486,486,486,486,486,486,486,486,486, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486, - 0,0,0,0,0,566,567,567,567,567,567,567,567,567,567,567,567,567,567,568,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486, - 687,687,687,687,687,606,486,486,486,486,486,486,486,486,486,486,486,486,486,608,687,687,687,687,687,687,646,488,486,486,486,486,486,486,486,486,486,486,486,486, - 0,0,0,0,0,646,647,488,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486, - 0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,608,687,687,687,687,687,687,687,646,488,486,486,486,486,486,486,486,486,486,486,486, - 0,0,0,0,0,0,0,646,647,647,647,647,647,647,647,647,647,647,647,648,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486, - 0,0,0,0,0,0,0,0,0,0,0,0,687,687,688,687,687,687,687,687,687,687,687,687,687,687,687,687,606,486,486,486,486,486,486,486,486,486,486,486, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486, - 0,0,0,0,0,0,0,0,0,0,0,0,566,567,567,567,568,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486, - 0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,608,0,0,0,0,0,0,0,0,0,0,566,528,486,486,486,486,486,486,486,486,486,486,486, - 0,0,0,0,0,0,0,0,0,0,0,0,646,647,647,647,648,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,566,528,486,486,486,486,486,486,486,486,486,486,486,486, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486, - }; - result = contents; - break; - } - - case rn(6,7): - { - - static const short contents[] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489, - 0,0,0,0,0,0,0,569,570,570,571,0,0,0,0,0,0,0,0,0,0,0,0,0,0,569,531,489,489,489,489,489,489,489,489,489,489,489,489,489, - 0,0,0,0,0,0,0,609,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 0,0,0,0,0,0,569,531,489,489,530,571,0,0,0,0,0,0,0,0,0,0,0,569,570,531,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 0,0,0,0,0,0,609,489,489,489,489,530,571,0,0,0,0,0,0,569,570,570,570,531,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 570,570,570,570,570,570,531,489,489,489,489,489,530,570,570,570,570,570,570,531,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - }; - - obj.createentity(64, 88, 10, 1, 7060); // (savepoint) - result = contents; - break; - } - - case rn(6,8): - { - - static const short contents[] = { - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 653,653,653,653,653,653,653,653,653,653,653,653,494,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 0,0,0,0,0,0,0,0,0,0,0,0,652,653,494,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,652,653,494,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,652,653,494,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,652,494,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,652,494,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,652,494,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,652,494,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - }; - result = contents; - break; - } - - case rn(6,9): - { - - static const short contents[] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,563,525,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,563,525,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,563,525,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,563,525,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,563,525,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - }; - result = contents; - break; - } - - case rn(6,10): - { - - static const short contents[] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,658,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,698,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,698,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,698,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,698,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,578,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,578,540,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 0,0,0,0,0,0,0,0,0,0,0,0,0,578,540,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 699,699,699,699,699,699,699,699,699,699,699,699,699,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 0,0,0,0,0,0,0,0,0,0,0,0,0,658,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,698,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,698,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,698,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,698,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,578,579,579,579,579,579,579,579,579,579, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498, - }; - - obj.createentity(152, 128, 10, 0, 10060); // (savepoint) - result = contents; - break; - } - - case rn(6,11): - { - - static const short contents[] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,575,576,577,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,617,696,696,696,696,696,696,696,615,495,495,495,495,495,495,495,495,495, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,617,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,617,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,617,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,617,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,617,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,617,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495, - 0,0,0,0,0,0,0,0,0,0,0,0,0,575,576,577,0,0,0,0,615,495,617,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495, - 0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,617,0,0,0,0,615,495,617,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495, - 0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,617,696,696,696,696,615,495,617,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495, - 0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,617,0,0,0,0,615,495,617,696,696,696,696,696,696,696,615,495,495,495,495,495,495,495,495,495, - 0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,617,0,0,0,0,655,656,657,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495, - 0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,617,0,0,0,0,0,695,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495, - 0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,617,0,0,0,0,0,695,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495, - 0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,617,696,696,696,696,696,697,696,696,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495, - 0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,617,0,0,0,0,0,695,0,0,0,0,0,0,0,0,655,656,497,495,495,495,495,495,495,495, - 0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,617,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,655,656,497,495,495,495,495,495, - 0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,655,497,495,495,495,495, - 0,0,0,0,0,0,0,0,0,0,0,0,0,655,656,657,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,655,656,656,656,656, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - }; - result = contents; - break; - } - - case rn(6,12): - { - - static const short contents[] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,569,570,570,570,570,570,571,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,649,491,489,489,489,490,651,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,649,650,650,650,651,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - }; - result = contents; - break; - } - - case rn(6,13): - { - - static const short contents[] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 687,687,687,687,687,687,687,687,687,687,687,687,687,687,687,687,688,687,687,687,687,687,687,687,687,687,687,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 567,567,567,567,567,567,567,567,567,567,567,567,568,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 486,486,486,486,486,486,486,486,486,486,486,486,527,567,567,567,567,567,568,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,527,567,568,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - }; - result = contents; - break; - } - - case rn(6,14): - { - - static const short contents[] = { - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 480,480,480,480,480,480,480,480,480,480,480,480,480,481,641,641,641,641,641,641,642,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 480,480,480,480,480,480,480,480,480,481,641,641,641,642,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 480,480,480,480,481,641,641,641,641,642,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 641,641,641,641,642,0,0,680,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 561,561,561,561,561,561,561,561,561,561,561,561,561,562,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 480,480,480,480,480,480,480,480,480,480,480,480,480,521,561,561,561,561,561,561,561,562,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,521,561,561,561,561,561,561,561,561,562,0,0,0,0,0,0,0,0,0, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,521,561,561,561,561,561,561,561,561,561, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - }; - result = contents; - break; - } - - - case rn(6,15): - { - - static const short contents[] = { - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,490,650,650,650,650,650,491,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 650,650,650,650,650,650,491,489,611,0,0,0,0,0,609,489,490,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650, - 0,689,0,0,0,0,609,489,611,0,0,0,0,0,649,650,651,0,0,0,0,0,689,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,689,0, - 570,570,571,690,690,690,609,489,611,0,0,0,0,0,0,689,0,0,0,0,569,570,570,571,0,0,0,0,689,0,0,0,0,0,0,0,0,0,689,0, - 489,489,611,0,0,0,649,650,651,0,0,0,0,0,569,570,570,570,571,690,609,489,489,611,0,0,0,0,689,0,0,0,0,0,0,0,0,0,689,0, - 650,650,651,0,0,0,0,0,0,0,0,569,570,570,531,489,489,489,611,0,649,650,650,651,0,0,0,0,689,0,0,0,0,0,0,0,0,0,689,0, - 0,0,0,0,0,0,0,0,0,0,0,609,489,489,490,650,650,650,651,0,0,0,0,0,0,0,0,569,570,571,0,0,0,0,0,0,0,569,570,570, - 0,0,0,0,0,0,0,0,0,0,0,649,650,650,651,0,0,689,0,0,0,0,0,0,0,0,569,531,489,611,0,0,0,0,0,0,569,531,489,489, - 0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,569,570,571,0,0,0,0,0,0,0,609,489,490,651,0,0,0,0,0,0,609,489,489,489, - 0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,609,489,611,0,0,0,0,0,0,0,649,650,651,0,0,0,0,0,0,569,531,489,489,489, - 0,0,0,0,0,0,0,0,0,0,0,0,569,570,571,0,649,491,530,570,571,0,0,0,0,0,0,0,0,0,0,0,0,0,569,531,489,489,489,489, - 0,0,0,0,0,569,570,571,0,0,0,0,609,489,611,0,0,609,489,489,611,0,0,0,0,0,0,0,569,570,571,0,0,569,531,489,489,489,489,489, - 0,0,0,0,569,531,489,530,571,0,0,0,649,650,651,0,0,609,489,490,651,0,0,0,0,0,0,0,609,489,611,0,0,609,489,489,489,489,489,489, - 0,0,0,0,609,489,489,489,611,0,0,0,0,0,0,0,0,649,650,651,0,0,0,0,569,570,570,570,531,490,651,0,0,609,489,489,489,489,489,489, - 0,0,0,0,609,489,489,489,611,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,609,489,489,489,489,611,0,0,0,609,489,489,489,489,489,489, - 0,0,0,0,609,489,489,489,611,0,0,0,0,0,0,0,0,0,0,569,570,571,690,690,649,650,650,491,489,611,0,0,0,649,650,491,489,489,489,489, - 0,0,0,0,649,650,491,489,611,0,0,0,0,0,0,0,0,0,0,609,489,611,0,0,0,0,0,609,490,651,0,0,0,0,0,609,489,489,489,489, - 0,0,0,0,0,0,609,489,611,0,0,0,0,569,570,570,571,0,0,609,489,611,0,0,0,0,569,531,611,0,0,0,0,0,0,609,489,489,489,489, - 0,0,0,0,0,0,609,489,530,570,571,0,0,609,489,489,530,570,570,531,489,611,0,0,0,0,609,489,611,0,0,0,0,0,0,609,489,489,489,489, - 0,0,0,0,0,0,609,489,489,489,611,690,690,649,650,491,489,490,650,650,650,651,0,0,0,0,609,489,611,0,0,0,0,569,570,531,489,489,489,489, - 0,0,0,0,0,0,609,489,490,650,651,0,0,0,0,609,489,611,0,0,0,0,0,0,0,0,609,489,530,571,0,0,0,609,489,489,489,489,489,489, - 0,0,0,0,569,570,531,489,611,0,0,0,0,0,0,649,650,651,0,0,0,0,0,0,0,0,609,489,489,611,690,690,690,609,489,489,489,489,489,489, - 0,0,0,0,609,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,611,0,0,0,609,489,489,489,489,489,489, - 0,0,0,0,609,489,490,650,651,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,649,491,489,611,0,0,0,649,650,491,489,489,489,489, - 570,570,570,570,531,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,569,570,571,0,0,0,0,609,489,611,0,0,0,0,0,609,489,489,489,489, - 489,489,489,489,489,489,530,570,570,570,570,570,570,571,0,0,0,0,0,0,609,489,530,570,570,570,570,531,489,530,570,570,570,570,570,531,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,530,570,570,570,570,570,570,531,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - }; - - if(!game.intimetrial) - { - obj.createentity(96, 48, 20, 1);//Terminal - obj.createblock(5, 96 - 4, 48, 20, 16, 12); - } - - obj.createentity(128, 216, 10, 1, 116061); // (savepoint) - result = contents; - break; - } - - case rn(6,18): - { - - static const short contents[] = { - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,485,483,483, - 0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,603,483,483, - 0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,603,483,483, - 0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,603,483,483, - 0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,603,483,483, - 564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,565,0,0,0,0,603,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,684,684,684,684,603,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,603,483,483, - 644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,485,483,483,605,0,0,0,0,603,483,483, - 0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,603,483,483,605,0,0,0,0,603,483,483, - 0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,603,483,483,605,0,0,0,0,603,483,483, - 0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,603,483,483,605,0,0,0,0,603,483,483, - 0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,603,483,483,605,0,0,0,0,603,483,483, - 564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,565,0,0,0,0,563,564,564,565,0,0,0,0,603,483,483,605,0,0,0,0,603,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,603,483,483,605,684,684,684,684,603,483,483,605,0,0,0,0,603,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,603,483,483,605,0,0,0,0,603,483,483,605,0,0,0,0,603,483,483, - 644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,645,0,0,0,0,603,483,483,605,0,0,0,0,603,483,483,605,0,0,0,0,603,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,603,483,483,605,0,0,0,0,603,483,483,605,0,0,0,0,603,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,603,483,483,605,0,0,0,0,603,483,483,605,0,0,0,0,603,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,603,483,483,605,0,0,0,0,603,483,483,605,684,684,684,684,603,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,603,483,483,605,0,0,0,0,603,483,483,605,0,0,0,0,603,483,483, - 564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,565,0,0,0,0,603,483,483,605,0,0,0,0,603,483,483,605,0,0,0,0,603,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,684,684,684,684,603,483,483,605,0,0,0,0,603,483,483,605,0,0,0,0,603,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,603,483,483,605,0,0,0,0,603,483,483,605,0,0,0,0,603,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,603,483,483,605,0,0,0,0,603,483,483,605,0,0,0,0,603,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,603,483,483,605,684,684,684,684,603,483,483,605,0,0,0,0,603,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,603,483,483,605,0,0,0,0,603,483,483,605,0,0,0,0,603,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,603,483,483,605,0,0,0,0,603,483,483,605,0,0,0,0,603,483,483, - }; - result = contents; - break; - } - - case rn(6,19): - { - - static const short contents[] = { - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,606,486,486,608,0,0,0,0,606,486,486,608,0,0,0,0,606,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,606,486,486,608,0,0,0,0,606,486,486,608,0,0,0,0,606,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,606,486,486,608,0,0,0,0,606,486,486,608,0,0,0,0,606,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,606,486,486,608,0,0,0,0,606,486,486,608,0,0,0,0,606,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,606,486,486,608,0,0,0,0,606,486,486,608,0,0,0,0,606,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,687,687,687,687,606,486,486,608,687,687,687,687,606,486,486,608,687,687,687,687,606,486,486, - 647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,648,0,0,0,0,606,486,486,608,0,0,0,0,606,486,486,608,0,0,0,0,606,486,486, - 0,0,0,686,0,0,0,0,0,686,0,0,0,0,0,686,0,0,0,0,0,606,486,486,608,0,0,0,0,606,486,486,608,0,0,0,0,606,486,486, - 0,0,0,686,0,0,0,0,0,686,0,0,0,0,0,686,0,0,0,0,0,606,486,486,608,0,0,0,0,606,486,486,608,0,0,0,0,606,486,486, - 0,0,0,686,0,0,0,0,0,686,0,0,0,0,0,686,0,0,0,0,0,606,486,486,608,0,0,0,0,606,486,486,608,0,0,0,0,606,486,486, - 0,0,0,686,0,0,0,0,0,686,0,0,0,0,0,686,0,0,0,0,0,606,486,486,608,0,0,0,0,606,486,486,608,0,0,0,0,606,486,486, - 567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,528,486,486,608,0,0,0,0,606,486,486,608,0,0,0,0,606,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,606,486,486,608,0,0,0,0,606,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,687,687,687,687,606,486,486,608,687,687,687,687,606,486,486, - 647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,648,0,0,0,0,606,486,486,608,0,0,0,0,606,486,486, - 0,0,0,686,0,0,0,0,0,686,0,0,0,0,0,686,0,0,0,0,0,0,0,686,0,0,0,0,0,606,486,486,608,0,0,0,0,606,486,486, - 0,0,0,686,0,0,0,0,0,686,0,0,0,0,0,686,0,0,0,0,0,0,0,686,0,0,0,0,0,606,486,486,608,0,0,0,0,606,486,486, - 0,0,0,686,0,0,0,0,0,686,0,0,0,0,0,686,0,0,0,0,0,0,0,686,0,0,0,0,0,606,486,486,608,0,0,0,0,606,486,486, - 0,0,0,686,0,0,0,0,0,686,0,0,0,0,0,686,0,0,0,0,0,0,0,686,0,0,0,0,0,606,486,486,608,0,0,0,0,606,486,486, - 567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,568,0,0,0,0,606,486,486,608,0,0,0,0,606,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,606,486,486,608,0,0,0,0,606,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,606,486,486,608,687,687,687,687,606,486,486, - 647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,648,0,0,0,0,646,647,647,648,0,0,0,0,606,486,486, - 0,0,0,686,0,0,0,0,0,686,0,0,0,0,0,686,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,686,0,0,0,0,0,606,486,486, - 0,0,0,686,0,0,0,0,0,686,0,0,0,0,0,686,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,686,0,0,0,0,0,606,486,486, - 0,0,0,686,0,0,0,0,0,686,0,0,0,0,0,686,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,686,0,0,0,0,0,606,486,486, - 0,0,0,686,0,0,0,0,0,686,0,0,0,0,0,686,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,686,0,0,0,0,0,606,486,486, - 567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,528,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - }; - result = contents; - break; - } - - case rn(7,1): - { - - static const short contents[] = { - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,487,647,647,647,647,647,647,647,647,647,647,647,647,647,647,488,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,686,0,0,686,0,0,686,0,0,686,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,686,0,0,686,0,0,686,0,0,686,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,686,0,0,686,0,0,686,0,0,686,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,686,0,0,686,0,0,686,0,0,686,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,527,567,567,567,567,567,567,567,567,567,567,567,567,567,567,528,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - }; - - obj.createentity(192, 104, 13); //Warp Token - - result = contents; - break; - } - - case rn(7,2): - { - - static const short contents[] = { - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 653,653,653,653,653,653,653,653,653,653,494,492,492,492,493,653,653,653,653,653,653,653,653,653,653,653,494,492,492,492,492,492,492,492,493,653,653,653,653,653, - 0,0,0,0,0,0,0,0,0,0,612,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,493,654,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,612,492,492,493,654,0,0,0,0,0,0,0,0,0,0,0,652,494,492,492,492,492,492,614,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,612,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,493,654,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,652,653,653,654,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,493,654,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,652,494,492,493,654,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,614,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,652,653,654,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - }; - - obj.createentity(88, 136, 10, 0, 103070); // (savepoint) - result = contents; - break; - } - - case rn(7,3): - { - - static const short contents[] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,575,576,576,576,576,577,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,575,576,537,495,495,495,495,536,576,577,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,575,537,495,495,495,495,495,495,495,495,536,577,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,575,537,495,495,496,656,656,656,656,497,495,495,536,577,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,496,657,0,0,0,0,655,497,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,575,537,495,496,657,0,0,0,0,0,0,655,497,495,536,577,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,617,0,0,0,575,577,0,0,0,615,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,617,0,0,575,537,536,577,0,0,615,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,617,0,0,615,495,495,617,0,0,615,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,617,0,0,655,497,496,657,0,0,615,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,617,0,0,0,655,657,0,0,0,615,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,655,497,495,536,577,0,0,0,0,0,0,575,537,495,496,657,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,536,577,0,0,0,0,575,537,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,655,497,495,495,536,576,576,576,576,537,495,495,496,657,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,655,497,495,495,495,495,495,495,495,495,496,657,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,655,656,497,495,495,495,495,496,656,657,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,655,656,656,656,656,657,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - }; - result = contents; - break; - } - - case rn(7,4): - { - - static const short contents[] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,566,567,567,567,567,567,567, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,566,567,567,567,567,567,568,0,0,0,606,486,486,486,486,486,486, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,608,0,0,0,606,486,486,486,486,486,486, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,608,0,0,0,606,486,486,486,486,486,486, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,566,567,567,567,567,568,0,0,0,606,486,486,486,486,486,608,0,0,0,606,486,486,486,486,486,486, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,608,0,0,0,606,486,486,486,486,486,527,567,567,567,528,486,486,486,486,486,486, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,608,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 567,567,567,567,567,567,567,567,567,567,568,0,0,0,606,486,486,486,486,608,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,608,0,0,0,606,486,486,486,486,527,567,567,567,528,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,608,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,608,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,527,567,567,567,528,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - }; - - obj.createentity(208, 128, 10, 1, 4070); // (savepoint) - result = contents; - break; - } - - case rn(7,5): - { - - static const short contents[] = { - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,481,641,641,641,641,482,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,481,641,642,0,0,680,0,640,641,482,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,680,0,0,0,640,641,482,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,481,642,0,0,0,0,680,0,0,0,0,680,600,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,680,0,0,0,0,680,640,482,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,680,0,0,0,0,680,0,600,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,560,561,562,0,0,0,680,0,640,482,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,600,480,602,0,0,0,680,0,0,600,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,600,480,521,562,0,0,680,0,0,640,482,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,600,480,480,602,0,0,680,0,0,0,600,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,681,681,681,681,600,480,480,521,562,0,680,0,0,0,640,641,482,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,600,480,480,480,602,0,680,0,0,0,680,0,640,641,641, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,600,480,480,480,521,561,562,0,0,0,680,0,0,0,0, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,600,480,480,480,480,480,602,0,0,0,680,0,0,0,0, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,481,642,0,0,0,0,600,480,480,480,480,480,602,0,0,0,680,0,0,0,0, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,600,480,480,480,480,480,521,561,562,0,680,0,0,0,0, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,681,681,681,681,681,600,480,480,480,480,480,480,480,521,561,561,561,561,561,561, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - }; - result = contents; - break; - } - - case rn(7,6): - { - - static const short contents[] = { - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,693,693,693,693,693,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,493,653,654,0,0,0,0,572,534,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,692,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,692,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,493,654,0,692,0,0,0,572,534,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,692,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,692,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,493,654,0,0,692,0,572,573,534,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,692,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,692,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,692,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,572,573,534,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,693,693,693,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,693,693,693,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - }; - result = contents; - break; - } - - case rn(7,7): - { - - static const short contents[] = { - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,690,690,690,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,490,651,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,649,491,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,490,651,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,611,690,690,690,690,690,690,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,649,491,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,490,651,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,611,690,690,690,690,690,690,690,690,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,649,491,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,490,651,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,649,491,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,611,690,690,690,690,690,690,690,690,690,690,690,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,490,651,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,649,491,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - }; - result = contents; - break; - } - - case rn(7,8): - { - - static const short contents[] = { - 480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,640,482,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,481,642,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,640,482,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,481,642,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,602,681,681,681,681,681,681,681,681,681,681,681,681,681,681,681,681,681,600,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,640,482,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,481,642,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,481,642,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,640,482,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,602,681,681,681,681,681,681,681,681,681,681,681,681,681,681,681,681,681,681,681,681,681,600,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,481,642,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,640,482,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,640,482,480,480,480,480,480,480,480,480,480, - 480,480,480,480,481,642,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480, - 480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480, - 480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480, - 480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480, - 480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480, - }; - result = contents; - break; - } - - case rn(7,9): - { - - static const short contents[] = { - 483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483, - 483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483, - 483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483, - 483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483, - 483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,563,564,564,564,564,564,564,564,564,525,483,483,483,483,483,483,483,483,483, - 483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,563,564,525,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,643,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644, - 483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,683,0,0,683,0,0,0,0,0,0,0,0, - 483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,683,0,0,683,0,0,0,0,0,0,0,0, - 483,483,483,483,605,684,684,684,684,684,684,684,684,684,684,684,684,684,684,684,684,684,684,684,684,685,684,684,685,684,684,685,684,684,0,0,0,0,0,0, - 483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,683,0,0,683,0,0,0,0,0,0,0,0, - 483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,683,0,0,683,0,0,0,0,0,0,0,0, - 483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,683,0,0,683,0,0,0,0,0,0,0,0, - 483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,683,0,0,683,0,0,0,0,0,0,0,0, - 483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,683,0,0,683,0,0,0,0,0,0,0,0, - 483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,683,0,0,683,0,0,0,0,0,0,0,0, - 483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,683,0,0,683,0,0,0,0,0,0,0,0, - 483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,683,0,0,683,0,0,0,0,0,0,0,0, - 483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,683,0,0,683,0,0,0,0,0,0,0,0, - 483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,683,0,0,683,0,0,0,0,0,0,0,0, - 483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,563,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564, - 483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,524,565,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,563,525,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,524,565,0,0,0,0,0,0,0,0,0,0,0,0,0,0,563,525,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,524,564,564,564,564,564,564,564,564,564,564,564,564,564,564,525,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - }; - - obj.createentity(64, 112, 14); //Teleporter! - result = contents; - break; - } - - case rn(7,10): - { - - static const short contents[] = { - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,497,495,495,495, - 0,0,695,0,0,0,0,0,695,0,0,0,0,695,0,0,0,0,695,0,0,0,0,695,0,0,0,0,695,0,0,0,695,0,0,0,615,495,495,495, - 0,0,695,0,0,0,0,0,695,0,0,0,0,695,0,0,0,0,695,0,0,0,0,695,0,0,0,0,695,0,0,0,695,0,0,0,615,495,495,495, - 0,0,695,0,0,0,0,0,695,0,0,0,0,695,0,0,0,0,695,0,0,0,0,695,0,0,0,0,695,0,0,0,695,0,0,0,615,495,495,495, - 0,0,695,0,0,0,0,0,695,0,0,0,0,695,0,0,0,0,695,0,0,0,0,695,0,0,0,0,695,0,0,0,695,0,0,0,615,495,495,495, - 576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,577,0,0,575,576,576,576,576,576,577,0,0,615,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,696,696,615,495,495,495,495,495,617,696,696,615,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,496,656,656,656,656,656,656,656,497,495,617,0,0,615,495,495,495,495,495,617,0,0,615,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,695,0,0,0,615,495,617,0,0,615,495,495,495,495,495,617,0,0,615,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,695,0,0,0,615,495,617,0,0,615,495,495,495,495,495,617,0,0,615,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,695,0,0,0,615,495,617,0,0,615,495,495,495,495,495,617,0,0,615,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,695,0,0,0,615,495,617,0,0,615,495,495,495,495,495,617,0,0,615,495,495,495, - 656,656,656,656,656,656,656,656,656,656,656,656,497,495,617,0,0,575,576,577,0,0,615,495,617,0,0,615,495,495,495,495,495,617,696,696,615,495,495,495, - 0,0,695,0,0,0,0,0,695,0,0,0,615,495,617,696,696,615,495,617,696,696,615,495,617,0,0,615,495,495,495,495,495,617,0,0,615,495,495,495, - 0,0,695,0,0,0,0,0,695,0,0,0,615,495,617,0,0,615,495,617,0,0,615,495,617,0,0,615,495,495,495,495,495,617,0,0,615,495,495,495, - 0,0,695,0,0,0,0,0,695,0,0,0,615,495,617,0,0,615,495,617,0,0,615,495,617,0,0,615,495,495,495,495,495,617,0,0,615,495,495,495, - 0,0,695,0,0,0,0,0,695,0,0,0,615,495,617,0,0,615,495,617,0,0,615,495,617,0,0,615,495,495,495,495,495,617,0,0,615,495,495,495, - 576,576,576,576,576,576,576,576,576,577,0,0,615,495,617,0,0,615,495,617,0,0,615,495,617,0,0,615,495,495,495,495,495,617,0,0,615,495,495,495, - 495,495,495,495,495,495,495,495,495,617,696,696,615,495,617,696,696,615,495,617,696,696,615,495,617,696,696,615,495,495,495,495,495,617,696,696,615,495,495,495, - 495,495,495,495,495,495,495,495,495,617,0,0,655,656,657,0,0,615,495,617,0,0,655,656,657,0,0,615,495,495,495,495,495,617,0,0,615,495,495,495, - 495,495,495,495,495,495,495,495,495,617,0,0,0,695,0,0,0,615,495,617,0,0,0,695,0,0,0,615,495,495,495,495,495,617,0,0,615,495,495,495, - 495,495,495,495,495,495,495,495,495,617,0,0,0,695,0,0,0,615,495,617,0,0,0,695,0,0,0,615,495,495,495,495,495,617,0,0,615,495,495,495, - 495,495,495,495,495,495,495,495,495,617,0,0,0,695,0,0,0,615,495,617,0,0,0,695,0,0,0,615,495,495,495,495,495,617,0,0,615,495,495,495, - 495,495,495,495,495,495,495,495,495,617,0,0,0,695,0,0,0,615,495,617,0,0,0,695,0,0,0,615,495,495,495,495,495,617,0,0,615,495,495,495, - 495,495,495,495,495,495,495,495,495,536,576,576,576,576,576,576,576,537,495,536,576,576,576,576,576,576,576,537,495,495,495,495,495,617,696,696,615,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,615,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,615,495,495,495, - }; - result = contents; - break; - } - - case rn(7,11): - { - - static const short contents[] = { - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,606,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,687,687,606,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,606,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,606,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,687,687,606,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,606,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,606,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,687,687,606,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,487,647,647,647,647,647,647,647,647,648,0,0,606,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,686,0,0,0,686,0,0,0,606,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,686,0,0,0,686,0,0,0,606,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,686,0,0,0,686,0,0,0,606,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,686,0,0,0,686,0,0,0,606,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,566,567,567,567,567,567,567,567,567,528,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,687,687,606,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,687,687,606,486,486,486,486,486,486,486,487,647,647,647,647, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,646,647,647,647,647,647,647,647,648,0,0,0,0, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,487,647,647,647,648,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,487,647,647,647,648,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 486,486,486,486,486,486,486,486,486,486,486,487,647,647,647,647,648,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 486,486,486,486,486,487,647,647,647,647,647,648,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 647,647,647,647,647,648,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - }; - result = contents; - break; - } - - case rn(7,14): - { - - static const short contents[] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,563,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,565,0,0,0,0,0,0, - 0,0,0,0,0,0,0,563,564,525,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,484,644,645,0,0,0,0,0,0, - 0,0,0,0,0,0,0,643,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,645,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,563,564,564,564,564,564,564,564,564,564,564,564, - 0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483, - 564,564,564,564,564,564,564,564,564,564,564,564,565,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,605,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,603,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,524,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,525,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - }; - - obj.createentity(48, 192, 10, 1, 14070); // (savepoint) - result = contents; - break; - } - - case rn(8,0): - { - - static const short contents[] = { - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,655,497,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,6,0,0,0,0,0,0,0,7,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,536,577,0,0,0,0,0,0,0,0,655,497,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,7,615,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,655,497,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,6,0,0,0,0,0,0,0,0,7,615,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,536,577,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,655,497,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,7,615,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,655,497,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,7,615,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,655,497,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,7,615,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,655,497,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,7,615,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495, - }; - result = contents; - break; - } - - case rn(8,1): - { - - static const short contents[] = { - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,530,571,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,569,531,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,569,531,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,530,571,0,0,0,0,0,0,0,0,569,531,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,690,690,690,690,690,690,690,690,609,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,569,531,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,690,690,690,690,690,690,690,609,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,569,531,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,530,571,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,690,690,690,690,690,609,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,569,531,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,530,571,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,690,690,690,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - }; - result = contents; - break; - } - - case rn(8,2): - { - - static const short contents[] = { - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,687,687,687,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,646,488,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,687,687,687,687,646,488,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,646,647,488,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,646,647,647,647,488,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,487,647,647,648,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,487,647,647,647,648,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,487,647,647,647,647,648,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486, - 486,486,486,486,486,487,647,647,647,648,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486, - 647,647,647,647,647,648,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,646,488,486,486,486,486,486, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486, - }; - result = contents; - break; - } - - case rn(8,3): - { - - static const short contents[] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,643,485,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,563,564,564,564,564,564,564,564,564,564,564,565,0,0,0,0,0,0,0,0,0,603,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,605,684,684,684,684,684,684,684,684,684,603,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,643,644,644,644,644,644,644,644,644,644,644,645,0,0,0,0,0,0,0,0,0,603,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,643,485,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483, - 0,0,0,0,0,0,563,564,564,564,564,564,564,564,564,564,564,564,564,565,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483, - 0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,605,684,684,684,684,684,684,684,684,684,684,684,684,684,684,684,684,603,483,483,483, - 0,0,0,0,0,0,643,644,644,644,644,644,644,644,644,644,644,644,644,645,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483, - }; - result = contents; - break; - } - - case rn(8,4): - { - - static const short contents[] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,621,501,501,501, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,621,501,501,501, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,621,501,501,501, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,621,501,501,501, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,621,501,501,501, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,621,501,501,501, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,581,582,543,501,501,501, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,581,582,582,582,543,501,501,501,501,501, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,621,501,501,501,501,501,501,501,501,501, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,621,501,501,501,501,501,501,501,501,501, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,621,501,501,501,501,501,501,501,501,501, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,621,501,501,501,501,501,501,501,501,501, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,581,582,582,582,583,0,0,0,0,0,0,0,0,0,0,621,501,501,501,501,501,501,501,501,501, - 0,0,0,0,0,0,0,0,0,581,582,582,582,582,582,543,501,501,501,542,582,583,0,0,0,0,0,0,0,0,621,501,501,501,501,501,501,501,501,501, - 0,0,0,0,581,582,582,582,582,543,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,0,0,581,543,501,501,501,501,501,501,501,501,501, - 582,582,582,582,543,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,0,0,621,501,501,501,501,501,501,501,501,501,501, - 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,702,702,702,702,702,702,702,621,501,501,501,501,501,501,501,501,501,501, - 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,0,0,621,501,501,501,501,501,501,501,501,501,501, - 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,0,0,621,501,501,501,501,501,501,501,501,501,501, - 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,0,0,621,501,501,501,501,501,501,501,501,501,501, - 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,542,583,0,0,0,0,0,0,621,501,501,501,501,501,501,501,501,501,501, - 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,581,543,501,501,501,501,501,501,501,501,501,501, - 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,621,501,501,501,501,501,501,501,501,501,501,501, - 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,621,501,501,501,501,501,501,501,501,501,501,501, - 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,621,501,501,501,501,501,501,501,501,501,501,501, - 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,621,501,501,501,501,501,501,501,501,501,501,501, - 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,702,702,702,702,702,621,501,501,501,501,501,501,501,501,501,501,501, - 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,621,501,501,501,501,501,501,501,501,501,501,501, - 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,621,501,501,501,501,501,501,501,501,501,501,501, - 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,621,501,501,501,501,501,501,501,501,501,501,501, - }; - result = contents; - break; - } - - case rn(8,5): - { - - static const short contents[] = { - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,496,656,656,656,656,656,656,656,656,656,497,495,495,495,495,617,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,496,656,657,0,0,0,695,0,0,0,0,0,655,497,495,495,495,617,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,617,0,0,0,0,0,695,0,0,0,0,0,0,655,497,495,495,536,577,0,0,0,0,655,497,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,496,657,0,0,0,0,0,695,0,0,0,0,0,0,0,655,497,495,495,617,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,617,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,615,495,495,536,577,0,0,0,0,655,497,495,495,495,495,495,495,495,495,495, - 495,495,495,495,617,0,0,0,0,575,576,576,577,0,0,0,0,0,0,0,615,495,495,495,617,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495, - 495,495,495,495,617,0,0,0,575,537,495,495,536,577,0,0,0,0,0,0,655,497,495,495,617,0,0,0,0,0,655,497,495,495,495,495,495,495,495,495, - 495,495,495,495,617,696,696,696,655,497,495,495,495,536,577,0,0,0,0,0,0,615,495,495,617,0,0,0,0,0,0,655,497,495,495,495,495,495,495,495, - 495,495,495,495,617,0,0,0,0,615,495,495,495,495,536,577,0,0,0,0,0,655,497,495,536,577,0,0,0,0,0,0,615,495,495,495,495,495,495,495, - 495,495,495,495,617,0,0,0,0,655,497,495,495,495,495,617,0,0,0,0,0,0,615,495,495,617,0,0,0,0,0,0,655,497,495,495,495,495,495,495, - 495,495,495,495,617,0,0,0,0,0,655,656,497,495,495,617,696,696,696,696,696,696,615,495,495,536,577,0,0,0,0,0,0,615,495,495,495,495,495,495, - 495,495,495,495,617,0,0,0,0,0,0,0,615,495,495,617,0,0,0,0,0,0,615,495,495,495,617,0,0,0,0,0,0,655,497,495,495,495,495,495, - 495,495,495,495,536,576,577,0,0,0,0,0,655,497,495,536,577,0,0,0,0,0,615,495,495,495,536,577,0,0,0,0,0,0,615,495,495,495,495,495, - 495,495,495,495,495,495,617,0,0,0,0,0,0,615,495,495,536,577,0,0,0,0,655,497,495,495,495,536,577,0,0,0,0,0,615,495,495,495,495,495, - 495,495,495,495,495,495,536,577,0,0,0,0,0,615,495,495,495,617,0,0,0,0,0,615,495,495,495,495,617,0,0,0,0,0,615,495,495,495,495,495, - 495,495,495,495,495,495,495,617,0,0,0,0,0,655,497,495,495,617,696,696,696,696,696,615,495,495,495,495,536,577,0,0,0,0,655,497,495,495,495,495, - 495,495,495,495,495,495,495,536,577,0,0,0,0,0,615,495,495,617,0,0,0,0,0,615,495,495,495,495,495,617,0,0,0,0,0,615,495,495,495,495, - 495,495,495,495,495,495,495,495,617,0,0,0,0,0,615,495,495,617,0,0,0,0,0,655,497,495,495,495,495,617,0,0,0,0,0,615,495,495,495,495, - 495,495,495,495,495,495,495,495,617,0,0,0,0,0,615,495,495,617,0,0,0,0,0,0,615,495,495,495,495,617,696,696,696,696,696,615,495,495,495,495, - 495,495,495,495,495,495,496,656,657,0,0,0,0,0,615,495,495,536,577,0,0,0,0,0,655,497,495,495,496,657,0,0,0,0,0,615,495,495,495,495, - 656,656,656,656,656,656,657,0,0,0,0,0,0,0,615,495,495,495,617,0,0,0,0,0,0,655,656,656,657,0,0,0,0,0,0,615,495,495,495,495, - 0,0,0,695,0,0,0,0,0,0,0,0,0,0,615,495,495,495,617,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,575,537,495,495,495,495, - 0,0,0,695,0,0,0,0,0,0,0,0,0,575,537,495,495,495,536,577,0,0,0,0,0,0,0,695,0,0,0,0,0,0,615,495,495,495,495,495, - 0,0,0,695,0,0,0,0,0,0,0,0,575,537,495,495,495,495,495,617,0,0,0,0,0,0,0,695,0,0,0,0,0,0,615,495,495,495,495,495, - 0,0,0,695,0,0,0,0,0,0,0,575,537,495,495,495,495,495,495,536,577,0,0,0,0,0,0,695,0,0,0,0,575,576,537,495,495,495,495,495, - 576,576,576,576,576,576,576,576,576,576,576,537,495,495,495,495,495,495,495,495,536,576,576,576,576,576,576,576,576,576,576,576,537,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - }; - - obj.createentity(80, 40, 10, 1, 5080); // (savepoint) - result = contents; - break; - } - - case rn(8,6): - { - - static const short contents[] = { - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,490,650,650,650,650,650,650,650,650,491,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,490,650,651,0,0,0,0,689,0,0,0,649,650,650,491,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,611,0,0,0,0,0,0,689,0,0,0,0,0,0,649,491,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,611,0,0,0,0,0,0,689,0,0,0,0,0,0,0,649,650,491,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,611,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,649,491,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,611,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,611,0,0,0,0,569,570,570,571,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,611,0,0,0,0,609,489,489,611,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,611,690,690,690,690,609,489,489,611,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,611,0,0,0,0,609,489,489,530,571,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,611,0,0,0,0,609,489,489,489,611,690,690,690,690,690,690,690,690,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,611,0,0,0,0,609,489,489,489,611,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,611,0,0,0,0,609,489,489,489,611,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,611,690,690,690,690,609,489,489,489,611,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,611,0,0,0,0,609,489,489,489,611,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,611,0,0,0,0,609,489,489,489,611,690,690,690,690,690,690,690,690,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,611,0,0,0,0,609,489,489,489,611,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,611,0,0,0,0,609,489,489,489,611,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,611,0,0,0,0,609,489,489,489,611,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,611,690,690,690,690,609,489,489,489,530,571,0,0,0,0,0,0,569,531,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,611,0,0,0,0,609,489,489,489,489,611,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,611,0,0,0,0,609,489,489,489,489,611,690,690,690,690,690,690,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,611,0,0,0,0,609,489,489,489,489,611,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,611,0,0,0,0,609,489,489,489,489,611,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - }; - - obj.createentity(96, 72, 13); //Warp Token - - result = contents; - break; - } - - case rn(8,7): - { - - static const short contents[] = { - 492,492,492,492,492,492,614,0,0,0,0,612,492,492,492,492,614,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,614,0,0,0,0,612,492,492,492,492,614,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,614,0,0,0,0,612,492,492,492,492,614,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,614,0,0,0,0,612,492,492,492,492,614,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,614,0,0,0,0,612,492,492,492,492,614,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,614,0,0,0,0,612,492,492,492,492,614,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,614,0,0,0,0,612,492,492,492,492,614,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,614,0,0,0,0,612,492,492,492,492,614,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,614,0,0,0,0,612,492,492,492,492,614,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,614,693,693,693,693,612,492,492,492,492,614,693,693,693,693,693,693,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,614,0,0,0,0,612,492,492,492,492,614,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,614,0,0,0,0,652,653,653,653,653,654,0,0,0,0,0,0,652,653,653,653,653,653,653,653,653,653,494,492,492,492,492,492,492, - 492,492,492,492,492,492,614,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492, - 492,492,492,492,492,492,614,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492, - 492,492,492,492,492,492,614,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492, - 492,492,492,492,492,492,614,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492, - 492,492,492,492,492,492,614,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492, - 492,492,492,492,492,492,614,0,0,0,0,572,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,574,0,0,0,0,612,492,492,492,492,492,492, - 492,492,492,492,492,492,614,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,612,492,492,492,492,492,492, - 492,492,492,492,492,492,614,693,693,693,693,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,693,693,693,693,612,492,492,492,492,492,492, - 492,492,492,492,492,492,614,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,612,492,492,492,492,492,492, - 492,492,492,492,492,492,614,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,612,492,492,492,492,492,492, - 492,492,492,492,492,492,614,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,612,492,492,492,492,492,492, - 492,492,492,492,492,492,614,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,612,492,492,492,492,492,492, - 492,492,492,492,492,492,614,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,612,492,492,492,492,492,492, - 492,492,492,492,492,492,614,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,612,492,492,492,492,492,492, - 492,492,492,492,492,492,614,693,693,693,693,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,693,693,693,693,612,492,492,492,492,492,492, - 492,492,492,492,492,492,614,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,612,492,492,492,492,492,492, - 492,492,492,492,492,492,614,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,612,492,492,492,492,492,492, - 492,492,492,492,492,492,614,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,612,492,492,492,492,492,492, - }; - result = contents; - break; - } - - case rn(8,8): - { - - static const short contents[] = { - 483,483,483,483,483,483,605,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,603,483,483,483,483,483,483, - 483,483,483,483,483,483,605,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,603,483,483,483,483,483,483, - 483,483,483,483,483,483,605,684,684,684,684,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,684,684,684,684,603,483,483,483,483,483,483, - 483,483,483,483,483,483,605,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,603,483,483,483,483,483,483, - 483,483,483,484,644,644,645,0,0,0,0,643,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,645,0,0,0,0,643,644,644,644,485,483,483, - 483,483,483,605,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,603,483,483, - 483,483,483,605,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,603,483,483, - 483,483,483,605,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,603,483,483, - 483,483,483,605,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,603,483,483, - 483,483,483,605,0,0,0,0,563,564,564,564,564,564,564,564,564,564,564,564,564,564,565,0,0,0,0,563,564,564,564,564,565,0,0,0,0,603,483,483, - 483,483,483,605,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,603,483,483,483,483,605,684,684,684,684,603,483,483, - 483,483,483,605,684,684,684,684,603,483,483,483,483,483,483,483,483,483,483,483,483,483,605,684,684,684,684,603,483,483,483,483,605,0,0,0,0,603,483,483, - 483,483,483,605,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,603,483,483,483,483,605,0,0,0,0,603,483,483, - 483,483,483,605,0,0,0,0,643,644,644,644,644,644,644,644,644,644,644,644,644,644,645,0,0,0,0,603,483,483,483,483,605,0,0,0,0,603,483,483, - 483,483,483,605,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,683,0,0,0,0,0,0,603,483,483,483,483,605,0,0,0,0,603,483,483, - 483,483,483,605,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,683,0,0,0,0,0,0,603,483,483,483,483,605,0,0,0,0,603,483,483, - 483,483,483,605,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,683,0,0,0,0,0,0,603,483,483,483,483,605,0,0,0,0,603,483,483, - 483,483,483,605,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,683,0,0,0,0,0,0,603,483,483,483,483,605,0,0,0,0,603,483,483, - 483,483,483,524,564,564,564,564,564,564,564,564,564,564,565,0,0,0,0,563,564,564,564,564,564,564,564,525,483,483,483,483,605,0,0,0,0,603,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,603,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,684,684,684,684,603,483,483,483,483,483,483,483,483,483,483,483,483,605,684,684,684,684,603,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,603,483,483, - 483,483,484,644,644,644,644,644,644,644,644,644,644,644,645,0,0,0,0,643,644,644,644,644,644,644,644,644,644,644,644,644,645,0,0,0,0,603,483,483, - 483,483,605,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,603,483,483, - 483,483,605,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,603,483,483, - 483,483,605,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,603,483,483, - 483,483,605,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,603,483,483, - 483,483,524,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,525,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - }; - result = contents; - break; - } - - case rn(8,10): - { - - static const short contents[] = { - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,493,653,653,494,493,653,653,494,493,653,653,494,493,653,653,494,493,653,653,494,493,653,653,494,493,653,653,494,492,492,492,492,492, - 492,492,492,492,492,492,492,614,0,0,612,614,0,0,612,614,0,0,612,614,0,0,612,614,0,0,612,614,0,0,612,614,0,0,612,492,492,492,492,492, - 492,492,492,492,492,492,493,654,0,0,652,654,0,0,652,654,0,0,652,654,0,0,652,654,0,0,652,654,0,0,652,654,0,0,652,494,492,492,492,492, - 492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492, - 492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492, - 492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492, - 492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492, - 492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492, - 492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492, - 492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492, - 492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492, - 492,492,492,492,492,492,614,0,0,0,0,572,573,573,573,573,573,573,573,573,574,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492, - 492,492,492,492,492,492,614,0,0,0,0,612,492,492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492, - 492,492,492,492,492,492,614,693,693,693,693,612,492,492,492,492,492,492,492,492,614,693,693,693,693,693,693,693,693,693,693,693,693,693,693,612,492,492,492,492, - 492,492,492,492,492,492,614,0,0,0,0,612,492,492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492, - 492,492,492,492,492,492,614,0,0,0,0,612,492,492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492, - 492,492,492,492,492,492,614,0,0,0,0,612,492,492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492, - 492,492,492,492,492,492,614,0,0,0,0,612,492,492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492, - 492,492,492,492,492,492,614,0,0,0,0,612,492,492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492, - 492,492,492,492,492,492,614,0,0,0,0,612,492,492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492, - 492,492,492,492,492,492,614,693,693,693,693,612,492,492,492,492,492,492,492,492,614,693,693,693,693,693,693,693,693,693,693,693,693,693,693,612,492,492,492,492, - 492,492,492,492,492,492,614,0,0,0,0,612,492,492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492, - 492,492,492,492,492,492,614,0,0,0,0,612,492,492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492, - 492,492,492,492,492,492,614,0,0,0,0,612,492,492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492, - }; - result = contents; - break; - } - - case rn(8,11): - { - - static const short contents[] = { - 483,483,483,483,483,483,605,0,0,0,0,603,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483, - 483,483,483,483,483,483,605,0,0,0,0,603,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483, - 483,483,483,483,483,483,605,684,684,684,684,603,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483, - 483,483,483,483,483,483,605,0,0,0,0,643,644,644,644,644,644,644,485,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483, - 483,483,483,483,483,483,605,0,0,0,0,0,683,0,0,0,0,0,603,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483, - 483,483,483,483,483,483,605,0,0,0,0,0,683,0,0,0,0,0,603,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483, - 483,483,483,483,483,483,605,0,0,0,0,0,683,0,0,0,0,0,603,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483, - 483,483,483,483,483,483,605,0,0,0,0,0,683,0,0,0,0,0,603,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483, - 483,483,483,483,483,483,524,564,564,564,564,564,564,565,0,0,0,0,603,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,605,684,684,684,684,603,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,603,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,603,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,605,684,684,684,684,603,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483, - 483,483,483,483,483,483,483,483,483,484,644,644,644,645,0,0,0,0,603,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483, - 483,483,483,483,483,483,483,484,644,645,0,0,0,0,0,0,0,0,603,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483, - 483,483,483,483,483,484,644,645,0,0,0,0,0,0,0,0,0,0,603,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483, - 483,483,483,484,644,645,0,0,0,0,0,0,0,0,0,0,0,0,603,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483, - 644,644,644,645,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,563,564,564,564,564,525,483,524,564,564,564,564,564,564,564,564,564,564,564,564,564,564,525,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,643,644,644,644,644,485,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,643,644,485,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,643,644,485,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,643,644,644,644,644,644,644,644,644,644,644,644,644,485,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483, - }; - - obj.createentity(176, 40, 14); //Teleporter! - obj.createentity(120, 128, 20, 1); // (terminal) - - obj.createblock(5, 120-4, 128, 20, 16, 7); - result = contents; - break; - } - - case rn(8,12): - { - - static const short contents[] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,575,576,537,495,495,495,495, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,575,576,537,495,495,495,495,495,495, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,655,497,495,495,495,495,495,495,495, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,655,497,495,495,495,495,495,495, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,655,497,495,495,495,495,495, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,655,497,495,495,495,495, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495, - }; - result = contents; - break; - } - - case rn(8,13): - { - - static const short contents[] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480, - 0,0,0,0,0,0,0,560,561,561,561,562,0,0,0,0,0,0,560,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,522,480,480,480,480, - 0,0,0,0,0,0,0,600,480,480,480,602,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 0,0,0,0,0,0,0,600,480,480,480,602,0,0,0,0,0,0,600,480,480,480,481,641,641,641,641,641,641,641,641,641,641,641,641,641,641,482,480,480, - 0,0,0,0,0,0,0,600,480,480,481,642,0,0,0,0,0,560,522,480,480,480,602,0,0,0,0,0,0,680,0,0,0,0,0,0,0,600,480,480, - 0,0,0,0,0,0,0,600,480,480,602,0,0,0,0,0,0,600,480,480,480,480,602,0,0,0,0,0,0,680,0,0,0,0,0,0,0,600,480,480, - 0,0,0,0,0,0,0,600,480,480,602,0,0,0,0,0,0,600,480,480,480,481,642,0,0,0,0,0,0,680,0,0,0,0,0,0,0,600,480,480, - 0,0,0,0,0,0,0,600,480,480,602,0,0,0,0,0,560,522,480,480,480,602,0,0,0,0,0,560,561,561,561,562,0,0,0,0,0,600,480,480, - 0,0,0,0,0,0,560,522,480,480,602,681,681,681,681,681,600,480,480,480,480,602,681,681,681,681,681,600,480,480,480,602,0,0,0,0,0,600,480,480, - 0,0,0,0,0,0,600,480,480,481,642,0,0,0,0,0,600,480,480,480,481,642,0,0,0,0,0,600,480,480,480,602,0,0,0,0,0,600,480,480, - 0,0,0,0,0,0,600,480,480,602,0,0,0,0,0,0,600,480,480,480,602,0,0,0,0,0,560,522,480,480,480,602,0,0,0,0,0,600,480,480, - 0,0,0,0,0,0,600,480,480,602,0,0,0,0,0,0,640,641,641,641,642,0,0,0,0,0,600,480,480,480,481,642,0,0,0,0,0,600,480,480, - 0,0,0,0,0,560,522,480,480,602,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,600,480,480,480,602,0,0,0,0,0,0,600,480,480, - 0,0,0,0,0,600,480,480,480,602,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,600,480,480,480,602,0,0,0,0,0,0,600,480,480, - 0,0,0,0,0,600,480,480,480,602,0,0,0,0,0,0,0,0,680,0,0,0,0,0,560,561,522,480,480,480,602,681,681,681,681,681,681,600,480,480, - 0,0,0,0,560,522,480,480,480,521,561,561,561,561,561,561,561,561,561,561,561,561,561,561,522,480,480,480,480,480,602,0,0,0,0,0,0,600,480,480, - 0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,481,642,0,0,0,0,0,0,600,480,480, - 0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0,0,600,480,480, - 0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0,0,600,480,480, - 0,0,0,0,640,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,642,0,0,0,0,0,560,561,522,480,480, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480, - }; - result = contents; - break; - } - - case rn(8,14): - { - - static const short contents[] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,652,653,494,492,492, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492, - 573,573,573,573,573,573,573,574,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492, - 492,492,492,492,492,493,653,654,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492, - 492,492,493,653,653,654,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492, - 492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492, - 492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492, - 492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492, - 492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492, - 492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492, - 492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492, - }; - - obj.createentity(40, 152, 10, 1, 14080); // (savepoint) - result = contents; - break; - } - - case rn(8,15): - { - - static const short contents[] = { - 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495, - 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495, - 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495, - 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,575,576,537,495,495, - 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495, - 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495, - 495,495,536,576,577,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495, - 495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495, - 495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495, - 495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495, - 495,495,495,495,617,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,615,495,495,495,495, - 495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495, - 495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495, - 495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495, - 495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495, - 495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,575,576,537,495,495,495,495, - 495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495, - 495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495, - 495,495,495,495,536,576,577,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495, - 495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495, - 495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495, - 495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495, - 495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495, - 495,495,495,495,495,495,617,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,615,495,495,495,495,495,495, - 495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495, - 495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495, - 495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495, - 495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495, - 495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495, - 495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495, - }; - result = contents; - break; - } - - case rn(8,16): - { - - static const short contents[] = { - 489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489, - 489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489, - 489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489, - 489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489, - 489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489, - 489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489, - 489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489, - 489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489, - 489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489, - 489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489, - 489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,649,650,491,489,489,489,489, - 489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,7,609,489,489,489,489, - 489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,569,570,570,570,570,570,570,571,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489, - 489,489,489,489,489,489,611,690,690,690,690,690,690,690,690,690,609,489,489,489,489,489,489,611,690,690,690,690,690,690,690,690,690,690,690,609,489,489,489,489, - 489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,649,650,491,489,489,490,650,651,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489, - 489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,7,7,649,650,650,651,7,7,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489, - 489,489,489,489,490,650,651,0,0,0,0,0,0,0,0,0,0,0,7,7,7,7,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489, - 489,489,489,489,611,7,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489, - 489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489, - 489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489, - 489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489, - 489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489, - 489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489, - 489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489, - 489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489, - 489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489, - 489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489, - 489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489, - 489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489, - 489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489, - }; - - obj.createentity(152, 80, 10, 1, 16080); // (savepoint) - result = contents; - break; - } - - case rn(8,17): - { - - static const short contents[] = { - 498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498, - 498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498, - 498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498, - 498,498,498,498,539,579,580,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498, - 498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498, - 498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498, - 498,498,498,498,498,498,620,699,699,699,699,699,699,699,699,699,699,699,699,699,699,699,699,699,699,699,699,699,699,699,699,699,699,699,699,618,498,498,498,498, - 498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498, - 498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498, - 498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498, - 498,498,498,498,498,498,539,579,580,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498, - 498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,578,579,540,498,498,498,498, - 498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,578,579,540,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,578,579,540,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,539,579,580,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,499,659,659,500,498,498, - 498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,578,579,540,498,498,499,659,660,0,0,618,498,498, - 498,498,498,498,498,498,498,498,498,498,620,699,699,699,699,699,699,699,699,699,699,699,699,699,699,699,699,618,498,498,499,659,660,0,0,0,0,618,498,498, - 498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,499,659,660,0,0,0,0,0,0,618,498,498, - 498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,658,660,0,0,0,0,0,0,0,0,618,498,498, - 498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498, - 498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498, - 498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498, - 498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498, - 498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498, - 498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498, - }; - result = contents; - break; - } - - case rn(8,18): - { - - static const short contents[] = { - 486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486, - 486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486, - 486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486, - 486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486, - 486,486,486,486,486,486,486,486,486,486,608,687,687,687,687,687,687,687,687,687,687,687,687,687,687,687,687,687,687,687,687,687,687,687,687,687,687,606,486,486, - 486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486, - 486,486,486,486,486,486,486,486,486,486,608,6,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486, - 486,486,486,486,486,486,486,486,486,486,527,567,568,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,608,6,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,606,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,527,567,568,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,566,528,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,606,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,566,528,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,606,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,566,528,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,527,568,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,527,568,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,6,606,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,527,568,0,0,0,0,0,0,0,0,0,0,0,0,0,0,566,567,528,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,6,606,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,566,528,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,687,687,687,687,687,687,687,687,687,687,687,687,687,606,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486, - }; - result = contents; - break; - } - - case rn(8,19): - { - - static const short contents[] = { - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,6,603,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,563,525,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,6,603,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,563,525,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,6,603,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,563,525,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,6,603,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,563,525,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,484,645,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,7,0,0,0,0,0,0,0,0,6,603,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,563,525,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,6,603,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,484,645,0,0,0,0,0,0,0,0,563,525,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,7,0,0,0,0,0,0,0,6,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,563,525,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - }; - result = contents; - break; - } - - case rn(10,0): - { - - static const short contents[] = { - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,658,659,659,659,500,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,539,579,579,579,579,580,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,699,699,699,699,618,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,499,659,659,659,659,659,659,659,659,659,660,0,0,0,0,658,659,659,659,659,659,659,659,659,659,659,659, - 498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0, - 498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0, - 498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0, - 498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0, - 498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0, - 498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0, - 498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,578,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579, - 498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,620,699,699,699,699,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,658,659,659,659,659,659,500,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,539,579,579,579,579,580,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - }; - result = contents; - break; - } - - case rn(10,1): - { - - static const short contents[] = { - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,658,659,659,659,500,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,539,579,579,579,579,580,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,699,699,699,699,618,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,499,659,659,659,659,659,659,659,659,659,660,0,0,0,0,658,659,659,659,659,659,659,659,659,659,659,659, - 498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0, - 498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0, - 498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0, - 498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0, - 498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0, - 498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0, - 498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,578,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579, - 498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,620,699,699,699,699,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,658,659,659,659,659,659,500,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,539,579,579,579,579,580,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - }; - result = contents; - break; - } - - case rn(10,2): - { - - static const short contents[] = { - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,658,659,659,659,500,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,539,579,579,579,579,580,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,699,699,699,699,618,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,499,659,659,659,659,659,659,659,659,659,660,0,0,0,0,658,659,659,659,659,659,659,659,659,659,659,659, - 498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0, - 498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0, - 498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0, - 498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0, - 498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0, - 498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0, - 498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,578,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579, - 498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,620,699,699,699,699,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,658,659,659,659,659,659,500,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,539,579,579,579,579,580,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - }; - result = contents; - break; - } - - case rn(10,3): - { - - static const short contents[] = { - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,646,647,647,647,488,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,527,567,567,567,567,568,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,687,687,687,687,606,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,646,647,647,647,647,647,647,647,647,647,647,647, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,527,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - }; - result = contents; - break; - } - - case rn(10,8): - { - - static const short contents[] = { - 295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, - 295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, - 295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, - 295,295,296,456,456,456,456,456,456,456,456,456,456,297,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, - 295,295,417,698,698,698,698,698,698,698,698,698,698,415,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, - 295,295,417,698,698,698,698,698,698,698,698,698,698,415,295,295,296,456,456,456,456,456,456,456,456,456,456,456,297,295,295,295,295,295,295,295,295,295,295,295, - 295,295,417,698,698,698,698,698,698,698,698,698,698,415,295,295,417,698,698,698,698,698,698,698,698,698,698,698,415,295,295,295,295,295,295,295,295,295,295,295, - 295,295,417,698,698,698,698,698,698,698,698,698,698,415,295,295,417,698,698,698,698,698,698,698,698,698,698,698,415,295,295,295,295,295,295,295,295,295,295,295, - 295,295,417,698,698,698,698,375,376,376,376,376,376,337,295,295,417,698,698,698,698,698,698,698,698,698,698,698,415,295,295,295,295,295,295,295,295,295,295,295, - 295,295,417,698,698,698,698,415,295,295,295,295,295,295,295,295,417,698,698,698,698,698,698,698,698,698,698,698,415,295,295,295,295,295,295,295,295,295,295,295, - 295,295,417,698,698,698,698,415,295,295,295,295,295,295,295,295,417,698,698,698,698,375,376,377,698,698,698,698,415,295,295,295,295,295,295,295,295,295,295,295, - 295,295,417,698,698,698,698,455,456,456,456,456,456,456,456,456,457,698,698,698,698,415,295,417,698,698,698,698,415,295,295,295,295,295,295,295,295,295,295,295, - 295,295,417,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,415,295,417,698,698,698,698,415,295,295,295,295,295,295,295,295,295,295,295, - 295,295,417,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,415,295,417,698,698,698,698,415,295,295,295,295,295,295,295,295,295,295,295, - 295,295,417,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,415,295,417,698,698,698,698,415,295,295,295,295,295,295,295,295,295,295,295, - 295,295,417,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,415,295,417,698,698,698,698,415,295,295,295,295,295,295,295,295,295,295,295, - 295,295,336,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,337,295,417,698,698,698,698,415,295,295,295,295,295,295,295,295,295,295,295, - 295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,417,698,698,698,698,415,295,295,295,295,295,295,295,295,295,295,295, - 295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,417,698,698,698,698,415,295,295,295,295,295,295,295,295,295,295,295, - 295,295,295,295,295,295,295,295,295,295,295,296,456,456,456,456,456,456,456,456,456,456,456,457,698,698,698,698,415,295,295,295,295,295,295,295,295,295,295,295, - 295,295,295,295,295,295,295,295,295,295,295,417,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,415,295,295,295,295,295,295,295,295,295,295,295, - 295,295,295,295,295,295,295,295,295,295,295,417,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,415,295,295,295,295,295,295,295,295,295,295,295, - 295,295,295,295,295,295,295,295,295,295,295,417,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,415,295,295,295,295,295,295,295,295,295,295,295, - 295,295,295,295,295,295,295,295,295,295,295,417,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,415,295,295,295,295,295,295,295,295,295,295,295, - 295,295,295,295,295,295,295,295,295,295,295,417,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,415,295,295,295,295,295,295,295,295,295,295,295, - 295,295,295,295,295,295,295,295,295,295,295,417,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,415,295,295,295,295,295,295,295,295,295,295,295, - 295,295,295,295,295,295,295,295,295,295,295,417,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,415,295,295,295,295,295,295,295,295,295,295,295, - 295,295,295,295,295,295,295,295,295,295,295,417,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,415,295,295,295,295,295,295,295,295,295,295,295, - 295,295,295,295,295,295,295,295,295,295,295,417,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,415,295,295,295,295,295,295,295,295,295,295,295, - 295,295,295,295,295,295,295,295,295,295,295,417,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,415,295,295,295,295,295,295,295,295,295,295,295, - }; - - obj.createentity(80, 40, 9, 17); // (shiny trinket) - roomtileset = 0; // (Use space station tileset) - result = contents; - break; - } - - case rn(10,9): - { - - static const short contents[] = { - 283,283,283,283,283,283,283,283,283,283,283,405,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,403,283,283,283,283,283,283,283,283,283,283,283, - 283,283,283,283,283,283,283,283,283,283,283,405,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,403,283,283,283,283,283,283,283,283,283,283,283, - 283,283,283,283,283,283,283,283,283,283,283,405,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,403,283,283,283,283,283,283,283,283,283,283,283, - 283,283,283,283,283,283,283,283,283,283,283,405,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,403,283,283,283,283,283,283,283,283,283,283,283, - 283,283,283,283,283,283,283,283,283,283,283,405,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,403,283,283,283,283,283,283,283,283,283,283,283, - 283,283,283,283,283,283,283,283,283,283,283,405,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,403,283,283,283,283,283,283,283,283,283,283,283, - 283,283,283,283,283,283,283,283,283,283,283,405,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,403,283,283,283,283,283,283,283,283,283,283,283, - 283,283,283,283,283,283,283,283,283,283,283,405,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,403,283,283,283,283,283,283,283,283,283,283,283, - 283,283,283,283,283,283,283,283,283,283,283,405,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,403,283,283,283,283,283,283,283,283,283,283,283, - 283,283,283,283,283,283,283,283,283,283,283,405,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,403,283,283,283,283,283,283,283,283,283,283,283, - 283,283,283,283,283,283,283,283,283,283,283,405,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,403,283,283,283,283,283,283,283,283,283,283,283, - 283,283,283,283,283,283,283,283,283,283,283,405,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,403,283,283,283,283,283,283,283,283,283,283,283, - 283,283,283,283,283,283,283,283,283,283,283,405,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,403,283,283,283,283,283,283,283,283,283,283,283, - 283,283,283,283,283,283,283,283,283,283,283,405,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,403,283,283,283,283,283,283,283,283,283,283,283, - 283,283,283,283,283,283,283,283,283,283,283,405,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,403,283,283,283,283,283,283,283,283,283,283,283, - 283,283,283,283,283,283,283,283,283,283,283,405,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,403,283,283,283,283,283,283,283,283,283,283,283, - 283,283,283,283,283,283,283,283,283,283,283,405,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,403,283,283,283,283,283,283,283,283,283,283,283, - 283,283,283,283,283,283,283,283,283,283,283,405,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,403,283,283,283,283,283,283,283,283,283,283,283, - 283,283,283,283,283,283,283,283,283,283,283,405,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,403,283,283,283,283,283,283,283,283,283,283,283, - 283,283,283,283,283,283,283,283,283,283,283,405,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,403,283,283,283,283,283,283,283,283,283,283,283, - 283,283,283,283,283,283,283,283,283,283,283,405,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,403,283,283,283,283,283,283,283,283,283,283,283, - 283,283,283,283,283,283,283,283,283,283,283,405,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,403,283,283,283,283,283,283,283,283,283,283,283, - 283,283,283,283,283,283,283,283,283,283,283,405,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,443,444,444,444,444,444,444,444,444,444,444,444, - 283,283,283,283,283,283,283,283,283,283,283,405,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,817,0,0,0,0,0,0,0, - 283,283,283,283,283,283,283,283,283,283,283,405,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,817,0,0,0,0,0,0,0, - 283,283,283,283,283,283,283,283,283,283,283,405,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,817,0,0,0,0,0,0,0, - 283,283,283,283,283,283,283,283,283,283,283,405,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,817,0,0,0,0,0,0,0, - 283,283,283,283,283,283,283,283,283,283,283,324,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364, - 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, - 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, - }; - - obj.nearelephant = false; - roomtileset = 0; // (Use space station tileset) - result = contents; - break; - } - - case rn(10,10): - { - - static const short contents[] = { - 316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,438,403,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, - 316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,438,403,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, - 316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,438,443,285,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, - 316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,357,398,403,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, - 316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,438,403,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, - 316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,438,403,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, - 316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,438,443,285,283,283,283,283,283,283,283,283,283,283,283,283,283,283, - 316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,357,398,403,283,283,283,283,283,283,283,283,283,283,283,283,283,283, - 316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,438,403,283,283,283,283,283,283,283,283,283,283,283,283,283,283, - 316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,438,443,285,283,283,283,283,283,283,283,283,283,283,283,283,283, - 316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,357,398,403,283,283,283,283,283,283,283,283,283,283,283,283,283, - 316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,438,403,283,283,283,283,283,283,283,283,283,283,283,283,283, - 316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,438,443,285,283,283,283,283,283,283,283,283,283,283,283,283, - 316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,357,398,403,283,283,283,283,283,283,283,283,283,283,283,283, - 316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,438,403,283,283,283,283,283,283,283,283,283,283,283,283, - 316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,438,403,283,283,283,283,283,283,283,283,283,283,283,283, - 316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,438,403,283,283,283,283,283,283,283,283,283,283,283,283, - 316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,438,443,444,444,444,444,444,444,444,444,444,444,444,444, - 316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,357,398,0,0,0,0,815,695,695,695,695,695,695,695, - 316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,438,0,0,0,0,815,695,695,695,695,695,695,695, - 316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,317,477,478,0,0,0,0,815,695,695,695,695,695,695,695, - 316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,438,0,0,0,0,0,0,815,695,695,695,695,695,695,695, - 316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,317,477,478,0,0,0,0,0,0,815,695,695,695,695,695,695,695, - 316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,438,0,0,0,0,0,0,0,0,815,363,364,364,364,364,364,364, - 316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,438,0,0,0,0,0,0,0,0,815,403,283,283,283,283,283,283, - 316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,438,0,0,0,0,0,0,0,363,364,325,283,283,283,283,283,283, - 316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,438,0,0,0,0,0,0,0,403,283,283,283,283,283,283,283,283, - 316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,438,0,0,0,0,0,363,364,325,283,283,283,283,283,283,283,283, - 316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,438,0,0,0,0,0,403,283,283,283,283,283,283,283,283,283,283, - 316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,438,0,0,0,0,0,403,283,283,283,283,283,283,283,283,283,283, - }; - - roomtileset = 0; // (Use space station tileset) - result = contents; - break; - } - - case rn(10,11): - { - - static const short contents[] = { - 116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,238,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492, - 116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,238,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492, - 116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,238,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492, - 116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,238,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492, - 116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,117,278,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492, - 116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,238,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492, - 116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,238,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492, - 116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,117,278,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492, - 116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,238,0,0,0,0,0,0,0,652,653,494,492,492,492,492,492,492,492,492, - 116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,238,0,0,0,0,0,0,0,0,0,652,494,492,492,492,492,492,492,492, - 116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,238,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492, - 116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,117,278,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492, - 116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,238,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492, - 116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,117,278,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492, - 116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,238,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492, - 116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,117,278,0,0,0,0,0,0,0,0,0,0,572,573,534,492,492,492,492,492,492,492, - 116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,238,0,0,0,0,0,0,0,0,0,0,572,534,492,492,492,492,492,492,492,492,492, - 116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,238,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492, - 116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,157,198,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492, - 116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,157,198,0,0,0,0,0,0,0,0,652,653,494,492,492,492,492,492,492,492,492, - 116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,238,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492, - 116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,238,0,0,0,0,0,0,0,0,0,0,652,494,492,492,492,492,492,492,492, - 116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,157,197,197,198,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492, - 116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,157,197,198,0,0,0,0,0,0,612,492,492,492,492,492,492,492, - 116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,238,0,0,0,572,573,573,534,492,492,492,492,492,492,492, - 116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,238,0,0,0,612,492,492,492,492,492,492,492,492,492,492, - 116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,238,0,0,0,612,492,492,492,492,492,492,492,492,492,492, - 116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,238,0,0,0,612,492,492,492,492,492,492,492,492,492,492, - 116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,238,0,0,0,612,492,492,492,492,492,492,492,492,492,492, - 116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,238,0,0,0,612,492,492,492,492,492,492,492,492,492,492, - }; - - roomtileset = 0; // (Use space station tileset) - result = contents; - break; - } - - case rn(10,12): - { - - static const short contents[] = { - 516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,638,0,0,0,630,510,510,510,510,510,510,510,510,510,510, - 516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,638,0,0,0,630,510,510,510,510,510,510,510,510,510,510, - 516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,638,0,0,0,630,510,510,510,510,510,510,510,510,510,510, - 516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,638,0,0,0,630,510,510,510,510,510,510,510,510,510,510, - 516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,638,0,0,0,630,510,510,510,510,510,510,510,510,510,510, - 516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,638,0,0,0,630,510,510,510,510,510,510,510,510,510,510, - 516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,638,0,0,0,630,510,510,510,510,510,510,510,510,510,510, - 516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,638,0,0,0,630,510,510,510,510,510,510,510,510,510,510, - 516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,638,0,0,0,630,510,510,510,510,510,510,510,510,510,510, - 516,516,517,677,677,677,677,677,677,677,677,677,677,677,677,677,677,677,677,677,677,677,518,516,516,638,0,0,0,630,510,510,510,510,510,510,510,510,510,510, - 516,516,638,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,636,516,516,638,0,0,0,630,510,510,510,510,510,510,510,510,510,510, - 516,516,638,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,636,516,516,638,0,0,0,630,510,510,510,510,510,510,510,510,510,510, - 516,516,638,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,636,516,516,638,0,0,0,630,510,510,510,510,510,510,510,510,510,510, - 516,516,638,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,636,516,516,638,0,0,0,630,510,510,510,510,510,510,510,510,510,510, - 516,516,638,0,0,0,590,591,591,591,591,591,591,591,591,591,591,591,592,0,0,0,636,516,516,638,0,0,0,630,510,510,510,510,510,510,510,510,510,510, - 516,516,638,0,0,0,670,671,671,671,671,671,671,671,671,671,512,510,632,0,0,0,636,516,516,638,0,0,0,630,510,510,510,510,510,510,510,510,510,510, - 516,516,638,0,0,0,0,0,0,0,0,0,0,0,0,0,630,510,632,0,0,0,636,516,516,638,0,0,0,630,510,510,510,510,510,510,510,510,510,510, - 516,516,638,0,0,0,0,0,0,0,0,0,0,0,0,0,630,510,632,0,0,0,636,516,516,638,0,0,0,630,510,510,510,510,510,510,510,510,510,510, - 516,516,638,0,0,0,0,0,0,0,0,0,0,0,0,0,630,510,632,0,0,0,636,516,516,638,0,0,0,630,510,510,510,510,510,510,510,510,510,510, - 516,516,638,0,0,0,0,0,0,0,0,0,0,0,0,0,630,510,632,0,0,0,676,677,677,678,0,0,0,630,510,510,510,510,510,510,510,510,510,510, - 516,516,557,597,597,597,597,597,597,597,597,598,0,0,0,0,630,510,632,0,0,0,0,0,0,0,0,0,0,630,510,510,510,510,510,510,510,510,510,510, - 516,516,516,516,516,516,516,516,516,516,516,638,0,0,0,0,630,510,632,0,0,0,0,0,0,0,0,0,0,630,510,510,510,510,510,510,510,510,510,510, - 516,516,517,677,677,677,677,677,677,677,677,678,0,0,0,0,630,510,632,0,0,0,0,0,0,0,0,0,0,630,510,510,510,510,510,510,510,510,510,510, - 516,516,638,0,0,0,0,0,0,0,0,0,0,0,0,0,630,510,632,0,0,0,0,0,0,0,0,0,0,630,510,510,510,510,510,510,510,510,510,510, - 516,516,638,0,0,0,0,0,0,0,0,0,0,0,0,0,630,510,551,591,591,591,591,591,591,591,591,591,591,552,510,510,510,510,510,510,510,510,510,510, - 516,516,638,0,0,0,0,0,0,0,0,0,0,0,0,0,630,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510, - 516,516,638,0,0,0,0,0,0,0,0,0,0,0,0,0,630,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510, - 516,516,638,0,0,0,590,591,591,591,591,591,591,591,591,591,552,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510, - 516,516,638,0,0,0,630,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510, - 516,516,638,0,0,0,630,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510, - }; - - obj.createentity(184, 176, 10, 1, 12100); // (savepoint) - roomtileset = 0; // (Use space station tileset) - result = contents; - break; - } - - case rn(10,13): - { - - static const short contents[] = { - 513,513,635,0,0,0,224,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104, - 513,513,635,0,0,0,224,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104, - 513,514,675,0,0,0,224,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104, - 513,635,0,0,0,0,224,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104, - 513,635,0,0,0,0,224,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104, - 513,635,0,0,0,184,146,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104, - 513,635,0,0,0,224,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104, - 513,635,0,0,0,224,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104, - 513,554,595,0,0,264,106,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104, - 513,513,635,0,0,0,224,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104, - 513,513,635,0,0,0,224,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104, - 513,513,635,0,0,0,224,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104, - 513,513,635,0,0,0,224,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104, - 513,513,635,0,0,0,224,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104, - 513,513,635,0,0,0,224,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104, - 513,514,675,0,0,184,146,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104, - 513,635,0,0,0,224,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104, - 513,635,0,0,0,224,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104, - 513,635,0,0,0,224,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104, - 513,635,0,0,0,224,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104, - 513,635,0,0,0,224,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104, - 513,554,595,0,0,224,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104, - 513,513,635,0,0,264,106,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104, - 513,513,635,0,0,0,224,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104, - 513,513,635,0,0,0,224,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104, - 513,513,635,0,0,0,224,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104, - 513,513,635,0,0,0,224,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104, - 513,513,635,0,0,0,224,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104, - 513,513,635,0,0,184,146,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104, - 513,513,635,0,0,224,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104, - }; - - roomtileset = 0; // (Use space station tileset) - result = contents; - break; - } - - case rn(10,14): - { - - static const short contents[] = { - 316,316,438,0,0,403,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, - 316,316,438,0,0,403,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, - 316,316,438,0,0,403,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, - 316,316,438,0,0,403,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, - 316,316,438,0,0,403,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, - 316,316,438,0,0,403,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, - 316,316,438,0,0,403,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, - 316,316,438,0,0,403,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, - 316,316,438,0,0,403,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, - 316,316,438,0,0,403,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, - 316,316,438,0,0,443,444,444,444,285,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, - 316,316,438,0,0,0,0,0,0,403,283,284,444,444,444,444,285,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, - 316,316,438,0,0,0,0,0,0,403,283,405,0,0,0,0,403,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, - 316,316,438,0,0,0,0,0,0,403,283,405,0,0,0,0,403,283,284,444,444,444,444,285,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, - 316,316,438,0,0,0,0,0,0,443,444,445,0,0,0,0,403,283,405,0,0,0,0,403,283,284,444,444,444,444,444,444,444,444,444,444,444,444,444,444, - 316,316,438,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,403,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 316,316,438,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,403,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 316,316,438,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,403,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 316,316,357,398,0,0,0,0,0,0,0,0,0,0,0,0,443,444,445,0,0,0,0,403,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 316,316,316,357,398,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 316,316,316,316,438,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 316,316,316,316,438,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 316,316,316,316,438,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,443,444,445,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 316,316,316,316,438,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 316,316,316,316,438,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 316,316,316,316,438,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 316,316,316,316,438,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 316,316,316,316,438,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 316,316,316,316,438,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 316,316,316,316,438,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - }; - - roomtileset = 0; // (Use space station tileset) - result = contents; - break; - } - - case rn(10,15): - { - - static const short contents[] = { - 495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,536,577,0,0,0,0,575,576,576,576,577,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,495,617,696,696,696,696,615,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,495,617,0,0,0,0,655,656,656,656,657,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,495,536,577,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,495,495,536,577,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,575,576,576,576,577,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,495,495,495,617,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,615,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,655,656,656,656,657,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,495,495,495,536,577,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,495,495,495,495,536,577,0,0,0,0,0,575,576,576,576,577,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,495,495,495,495,495,617,696,696,696,696,696,615,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,655,656,656,656,657,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,575,576,576,576,577,0,0,0,0, - 495,495,495,495,495,495,495,495,495,617,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,615,495,495,495,617,0,0,0,0, - 495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,655,656,656,656,657,0,0,0,0, - 495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - }; - result = contents; - break; - } - - case rn(10,16): - { - - static const short contents[] = { - 486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 486,486,486,486,486,486,486,486,486,527,568,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 486,486,486,486,486,486,486,486,486,486,527,568,0,0,0,0,0,0,0,0,0,0,0,0,566,567,567,567,567,567,567,567,568,0,0,0,0,0,0,0, - 486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0, - 486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,566,528,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0, - 486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,527,568,0,0,0,0,0,0, - 486,486,486,486,486,486,486,486,486,486,486,527,567,567,567,567,567,567,567,567,567,567,567,528,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,527,568,0,0,0,0,0, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,527,568,0,0,0,0, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,527,567,567,567,567, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - }; - - obj.createentity(216, 72, 10, 1, 16100); // (savepoint) - result = contents; - break; - } - - case rn(10,17): - { - - static const short contents[] = { - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,493,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653, - 492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 492,492,492,492,492,492,492,533,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - }; - result = contents; - break; - } - - case rn(10,18): - { - - static const short contents[] = { - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,484,644,644,644,644,644,644,644,644,644,644,644,644,644, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,524,564,564,564,564,564,564,564,564,564,564,564,564,564, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - }; - result = contents; - break; - } - - case rn(10,19): - { - - static const short contents[] = { - 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501, - 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501, - 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501, - 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501, - 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501, - 501,501,501,501,501,501,501,501,501,501,501,501,501,501,502,662,662,662,503,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501, - 501,501,501,501,501,501,501,501,501,501,501,501,502,662,663,0,0,0,661,662,662,503,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501, - 501,501,501,501,501,501,501,501,501,501,502,662,663,0,0,0,0,0,701,0,0,661,662,662,503,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501, - 501,501,501,501,501,501,501,501,502,662,663,0,701,0,0,0,0,0,701,0,0,0,0,0,661,662,662,503,501,501,501,501,501,501,501,501,501,501,501,501, - 501,501,501,501,501,501,502,662,663,0,0,0,701,0,0,0,0,0,701,0,0,0,0,0,701,0,0,661,662,662,503,501,501,501,501,501,501,501,501,501, - 501,501,501,501,502,662,663,0,701,0,0,0,701,0,0,0,0,0,701,0,0,0,0,0,701,0,0,0,0,0,661,662,662,503,501,501,501,501,501,501, - 501,501,501,502,663,0,0,0,701,0,0,0,701,0,0,0,0,0,701,0,0,0,0,0,701,0,0,0,0,0,701,0,0,661,662,662,662,662,662,662, - 501,501,501,623,0,0,0,0,701,0,0,0,701,0,0,0,0,0,701,0,0,0,0,0,701,0,0,0,0,0,701,0,0,0,0,701,0,0,0,0, - 501,501,501,623,702,702,702,702,703,702,702,702,703,702,702,702,702,702,703,702,702,0,0,0,701,0,0,0,0,0,701,0,0,0,0,701,0,0,0,0, - 501,501,501,623,0,0,0,0,701,0,0,0,701,0,0,0,0,0,701,0,0,0,0,0,701,0,0,0,0,0,701,0,0,0,0,701,0,0,0,0, - 501,501,501,623,0,0,0,0,701,0,0,0,701,0,0,0,0,0,701,0,0,0,0,0,701,0,0,0,0,0,701,0,0,0,0,701,0,0,0,0, - 501,501,501,623,702,702,702,702,703,702,702,702,703,702,702,702,702,702,703,702,702,0,0,0,701,0,0,0,0,0,701,0,0,0,0,701,0,0,0,0, - 501,501,501,623,0,0,0,0,701,0,0,0,701,0,0,0,0,0,701,0,0,0,0,0,701,0,0,0,0,0,701,0,0,0,0,701,0,0,0,0, - 501,501,501,542,583,0,0,0,701,0,0,0,701,0,0,0,0,0,701,0,0,0,0,0,701,0,0,0,0,0,701,0,0,581,582,582,582,582,582,582, - 501,501,501,501,542,582,583,0,701,0,0,0,701,0,0,0,0,0,701,0,0,0,0,0,701,0,0,0,0,0,581,582,582,543,501,501,501,501,501,501, - 501,501,501,501,501,501,542,582,583,0,0,0,701,0,0,0,0,0,701,0,0,0,0,0,701,0,0,581,582,582,543,501,501,501,501,501,501,501,501,501, - 501,501,501,501,501,501,501,501,542,582,583,0,701,0,0,0,0,0,701,0,0,0,0,0,581,582,582,543,501,501,501,501,501,501,501,501,501,501,501,501, - 501,501,501,501,501,501,501,501,501,501,542,582,583,0,0,0,0,0,701,0,0,0,0,0,621,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501, - 501,501,501,501,501,501,501,501,501,501,501,501,542,582,583,0,0,0,701,0,0,0,0,0,621,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501, - 501,501,501,501,501,501,501,501,501,501,501,501,501,501,542,582,582,582,583,0,0,0,0,0,621,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501, - 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,621,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501, - 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,702,702,702,702,702,621,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501, - 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,621,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501, - 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,621,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501, - 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,621,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501, - }; - - obj.createentity(40, 112, 9, 13); // (shiny trinket) - result = contents; - break; - } - - case rn(11,0): - { - - static const short contents[] = { - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,687,687,687,687,687,687,687,687,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,527,567,568,0,0,0,0,566,567,528,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,687,687,687,687,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,646,647,647,647,647,647,647,647,488,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,686,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,686,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486, - 647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,648,0,0,0,0,0,0,686,0,0,0,0,0,646,647,647,647,647,647,647,647,647,647, - 0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0, - 0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0, - 0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0, - 0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0, - 0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0, - 0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0, - 567,567,567,567,567,567,567,567,567,568,0,0,0,0,0,686,0,0,0,0,0,0,566,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567, - 486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,686,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,686,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,527,567,567,567,567,567,567,567,568,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,687,687,687,687,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,487,647,648,0,0,0,0,646,647,488,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,687,687,687,687,687,687,687,687,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - }; - result = contents; - break; - } - - case rn(11,1): - { - - static const short contents[] = { - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,687,687,687,687,687,687,687,687,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,527,567,568,0,0,0,0,566,567,528,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,687,687,687,687,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,646,647,647,647,647,647,647,647,488,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,686,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,686,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486, - 647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,648,0,0,0,0,0,0,686,0,0,0,0,0,646,647,647,647,647,647,647,647,647,647, - 0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0, - 0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0, - 0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0, - 0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0, - 0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0, - 0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0, - 567,567,567,567,567,567,567,567,567,568,0,0,0,0,0,686,0,0,0,0,0,0,566,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567, - 486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,686,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,686,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,527,567,567,567,567,567,567,567,568,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,687,687,687,687,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,487,647,648,0,0,0,0,646,647,488,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,687,687,687,687,687,687,687,687,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - }; - result = contents; - break; - } - - case rn(11,2): - { - - static const short contents[] = { - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,696,696,696,696,696,696,696,696,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,536,576,577,0,0,0,0,575,576,537,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,696,696,696,696,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,657,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 576,576,576,576,576,576,576,576,576,577,0,0,0,0,0,695,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,695,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,695,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,536,576,576,576,576,576,576,576,577,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,696,696,696,696,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,496,656,657,0,0,0,0,655,656,497,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,696,696,696,696,696,696,696,696,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - }; - result = contents; - break; - } - - case rn(11,3): - { - - static const short contents[] = { - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,569,570,570,570,531,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,690,690,690,690,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,651,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,531,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - }; - result = contents; - break; - } - - case rn(11,8): - { - - static const short contents[] = { - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,496,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656, - 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - }; - - - obj.createentity((8 * 8), (11 * 8), 1, 0, 0, -10000, -10000, 10000, 100000); // Enemy - obj.nearelephant = true; - - roomtileset = 0; // (Use space station tileset) - result = contents; - break; - } - - case rn(11,9): - { - - static const short contents[] = { - 310,310,432,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 310,310,432,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 310,310,432,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 310,310,432,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 310,310,432,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 310,310,432,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 310,310,432,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 310,310,432,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 310,310,432,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 310,310,432,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 310,310,432,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 310,310,432,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 310,310,432,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 310,310,432,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 310,310,432,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 310,310,432,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 310,310,432,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 310,310,432,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 310,310,432,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 310,310,432,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 310,310,432,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 310,310,432,0,0,0,0,390,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391, - 471,471,472,0,0,0,0,470,471,471,471,471,471,471,471,471,471,471,471,471,471,471,471,471,471,471,471,471,471,471,471,471,471,471,471,471,471,471,471,471, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391, - 310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310, - 310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310, - }; - - - obj.createentity(8 * 8, -240 + (11 * 8), 1, 0, 0, -10000, -10000, 10000, 100000); // Enemy - obj.nearelephant = true; - - roomtileset = 0; // (Use space station tileset) - result = contents; - break; - } - - case rn(11,10): - { - - static const short contents[] = { - 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92, - 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92, - 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92, - 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92, - 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92, - 92,92,92,92,92,92,92,92,92,92,92,92,92,92,93,253,253,253,253,253,253,253,253,253,253,253,253,253,253,94,92,92,92,92,92,92,92,92,92,92, - 92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,683,683,683,683,683,683,683,683,683,683,683,683,683,683,212,92,92,92,92,92,92,92,92,92,92, - 92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,683,683,683,683,683,683,683,683,683,683,683,683,683,683,212,92,92,92,92,92,92,92,92,92,92, - 92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,683,683,683,683,683,683,683,683,683,683,683,683,683,683,212,92,92,92,92,92,92,92,92,92,92, - 92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,683,683,683,683,683,683,683,683,683,683,683,683,683,683,212,92,92,92,92,92,92,92,92,92,92, - 92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,683,683,683,172,173,173,173,173,173,173,174,683,683,683,212,92,92,92,92,92,92,92,92,92,92, - 92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,683,683,683,212,92,92,92,92,92,92,214,683,683,683,212,92,92,92,92,92,92,92,92,92,92, - 92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,683,683,683,212,92,92,92,92,92,92,214,683,683,683,212,92,92,92,92,92,92,92,92,92,92, - 92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,683,683,683,212,92,92,92,92,92,92,214,683,683,683,212,92,92,92,92,92,92,92,92,92,92, - 92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,683,683,683,212,92,92,92,92,92,92,214,683,683,683,212,92,92,92,92,92,92,92,92,92,92, - 92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,683,683,683,212,92,92,92,92,92,92,214,683,683,683,212,92,92,92,92,92,92,92,92,92,92, - 92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,683,683,683,212,92,92,92,92,92,92,214,683,683,683,212,92,92,92,92,92,92,92,92,92,92, - 253,253,253,253,253,253,253,253,253,253,253,253,253,253,254,683,683,683,212,92,92,92,92,92,92,214,683,683,683,212,92,92,92,92,92,92,92,92,92,92, - 683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,212,92,92,92,92,92,92,214,683,683,683,212,92,92,92,92,92,92,92,92,92,92, - 683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,212,92,92,92,92,92,92,214,683,683,683,212,92,92,92,92,92,92,92,92,92,92, - 683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,212,92,92,92,92,92,92,214,683,683,683,212,92,92,92,92,92,92,92,92,92,92, - 683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,212,92,92,92,92,92,92,214,683,683,683,212,92,92,92,92,92,92,92,92,92,92, - 683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,212,92,92,92,92,92,92,214,683,683,683,212,92,92,92,92,92,92,92,92,92,92, - 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,134,92,92,92,92,92,92,214,683,683,683,252,253,253,253,253,253,253,253,253,253,253, - 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,683,683,683,683,683,683,683,683,683,683,683,683,683,683, - 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,683,683,683,683,683,683,683,683,683,683,683,683,683,683, - 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,683,683,683,683,683,683,683,683,683,683,683,683,683,683, - 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,683,683,683,683,683,683,683,683,683,683,683,683,683,683, - 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,133,173,173,173,173,173,173,173,173,173,173,173,173,173,173, - 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92, - }; - - roomtileset = 0; // (Use space station tileset) - result = contents; - break; - } - - case rn(11,16): - { - - static const short contents[] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,569,570,570,571,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,569,570,570,570,531,489,489,611,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,569,531,489,489,489,489,489,489,530,571,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,569,570,570,570,570,570,570,570,570,570,570,531,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,569,531,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,530,571,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,569,570,531,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0, - 0,0,0,0,0,569,570,570,570,531,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0, - 570,570,570,570,570,531,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,530,570,570,570,570,570,570, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - }; - result = contents; - break; - } - - case rn(11,17): - { - - static const short contents[] = { - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641, - 0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0, - 0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0, - 0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0, - 0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0, - 0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0, - 0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0, - 561,561,561,561,561,561,561,561,561,562,0,0,0,0,0,680,0,0,0,0,0,0,560,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561, - 480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,680,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,680,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,521,561,561,561,561,561,561,561,562,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,681,681,681,681,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,481,641,642,0,0,0,0,640,641,482,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,681,681,681,681,681,681,681,681,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - }; - result = contents; - break; - } - - case rn(11,18): - { - - static const short contents[] = { - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,687,687,687,687,687,687,687,687,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,527,567,568,0,0,0,0,566,567,528,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,687,687,687,687,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,646,647,647,647,647,647,647,647,488,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,686,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,686,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486, - 647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,648,0,0,0,0,0,0,686,0,0,0,0,0,646,647,647,647,647,647,647,647,647,647, - 0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0, - 0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0, - 0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0, - 0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0, - 0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0, - 0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0, - 567,567,567,567,567,567,567,567,567,568,0,0,0,0,0,686,0,0,0,0,0,0,566,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567, - 486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,686,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,686,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,527,567,567,567,567,567,567,567,568,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,687,687,687,687,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,487,647,648,0,0,0,0,646,647,488,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,687,687,687,687,687,687,687,687,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - }; - result = contents; - break; - } - - case rn(11,19): - { - - static const short contents[] = { - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,687,687,687,687,687,687,687,687,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,527,567,568,0,0,0,0,566,567,528,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,687,687,687,687,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,646,647,647,647,647,647,647,647,488,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,686,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,686,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486, - 647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,648,0,0,0,0,0,0,686,0,0,0,0,0,646,647,647,647,647,647,647,647,647,647, - 0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0, - 0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0, - 0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0, - 0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0, - 0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0, - 0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0, - 567,567,567,567,567,567,567,567,567,568,0,0,0,0,0,686,0,0,0,0,0,0,566,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567, - 486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,686,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,686,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,527,567,567,567,567,567,567,567,568,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,687,687,687,687,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,487,647,648,0,0,0,0,646,647,488,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,687,687,687,687,687,687,687,687,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - }; - result = contents; - break; - } - - case rn(12,0): - { - - static const short contents[] = { - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,490,650,650,650,650,650,491,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,611,166,167,167,167,168,609,489,489,489,489,489,489,489,489,489,490,650,650,650,491,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,611,206,86,86,86,208,609,489,489,489,489,489,489,489,489,489,611,166,167,168,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,611,206,86,86,86,208,609,489,489,489,489,489,489,489,489,489,611,206,86,208,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,611,206,86,86,86,208,609,489,489,489,489,489,489,489,489,489,611,246,247,248,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,611,246,247,247,247,248,609,489,489,489,489,489,489,489,489,489,530,570,570,570,531,489,489,489,489,490,650,650,650,650,650,650,650,650,650,650,650,650, - 489,489,530,570,570,570,570,570,531,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,166,167,167,167,168,166,167,167,167,167,167,167, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,206,86,86,86,208,206,86,86,86,86,86,86, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,206,86,86,86,208,206,86,87,247,247,247,247, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,206,86,86,86,208,206,86,208,207,207,207,207, - 650,650,650,650,650,650,650,650,650,650,650,650,650,650,491,489,489,489,489,489,489,489,489,489,489,489,489,611,206,86,86,86,208,206,86,208,207,207,207,207, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,611,206,86,86,86,208,206,86,208,207,207,207,207, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,611,206,86,86,86,208,206,86,208,207,207,207,207, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,611,206,86,86,86,208,206,86,208,207,207,207,207, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,611,206,86,86,86,208,206,86,208,207,207,207,207, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,611,206,86,86,86,208,206,86,208,207,207,207,207, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,611,206,86,86,86,208,206,86,208,207,207,207,207, - 570,570,570,570,570,570,570,570,570,570,570,570,570,570,531,489,489,489,489,489,489,489,489,489,489,489,489,611,246,247,247,247,248,206,86,208,207,207,207,207, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,530,570,570,570,570,571,206,86,208,207,207,207,207, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,206,86,208,207,207,207,207, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,206,86,127,167,167,167,167, - 489,489,489,489,489,489,489,489,489,489,490,650,650,650,491,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,206,86,86,86,86,86,86, - 489,489,489,489,489,489,489,489,489,489,611,166,167,168,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,246,247,247,247,247,247,247, - 489,489,489,489,489,489,489,489,489,489,611,206,86,208,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,530,570,570,570,570,570,570,570, - 489,489,489,489,489,489,489,489,489,489,611,246,247,248,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,530,570,570,570,531,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - }; - result = contents; - break; - } - - case rn(12,1): - { - - static const short contents[] = { - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659, - 0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0, - 0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0, - 0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0, - 0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0, - 0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0, - 0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0, - 579,579,579,579,579,579,579,579,579,580,0,0,0,0,0,698,0,0,0,0,0,0,578,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579, - 498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,698,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,698,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,539,579,579,579,579,579,579,579,580,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,699,699,699,699,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,499,659,660,0,0,0,0,658,659,500,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,699,699,699,699,699,699,699,699,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - }; - result = contents; - break; - } - - case rn(12,2): - { - - static const short contents[] = { - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,684,684,684,684,684,684,684,684,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,684,684,684,684,684,684,684,684,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,684,684,684,684,684,684,684,684,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,524,564,564,564,564,564,564,564,564,525,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - }; - result = contents; - break; - } - - case rn(12,8): - { - - static const short contents[] = { - 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, - 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, - 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, - 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, - 453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,294,292,292,292, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,818,698,698,698,698,698,412,292,292,292, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,818,698,698,698,698,698,412,292,292,292, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,818,698,698,698,698,698,412,292,292,292, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,818,698,698,698,698,698,412,292,292,292, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,818,698,698,698,698,698,412,292,292,292, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,818,698,698,698,698,698,412,292,292,292, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,372,373,373,374,698,698,698,412,292,292,292, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,414,698,698,698,412,292,292,292, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,414,698,698,698,412,292,292,292, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,414,698,698,698,412,292,292,292, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,414,698,698,698,412,292,292,292, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,414,698,698,698,412,292,292,292, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,414,698,698,698,412,292,292,292, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,414,698,698,698,412,292,292,292, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,414,698,698,698,412,292,292,292, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,414,698,698,698,412,292,292,292, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,414,698,698,698,412,292,292,292, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,414,698,698,698,412,292,292,292, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,414,698,698,698,412,292,292,292, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,414,698,698,698,412,292,292,292, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,414,698,698,698,412,292,292,292, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,414,698,698,698,412,292,292,292, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,414,698,698,698,412,292,292,292, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,414,698,698,698,412,292,292,292, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,414,698,698,698,412,292,292,292, - }; - - - obj.createentity(-320 + (8 * 8), (11 * 8), 1, 0, 0, -10000, -10000, 10000, 100000); // Enemy - obj.nearelephant = true; - - obj.createentity(240, 72, 10, 1, 8120); // (savepoint) - roomtileset = 0; // (Use space station tileset) - result = contents; - break; - } - - case rn(12,9): - { - - static const short contents[] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,95,217,689,689,689,215,95,95,95, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,95,217,689,689,689,215,95,95,95, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,95,217,689,689,689,215,95,95,95, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,95,217,689,689,689,215,95,95,95, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,95,217,689,689,689,215,95,95,95, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,95,217,689,689,689,215,95,95,95, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,95,217,689,689,689,215,95,95,95, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,95,217,689,689,689,215,95,95,95, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,95,217,689,689,689,215,95,95,95, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,95,217,689,689,689,215,95,95,95, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,95,217,689,689,689,215,95,95,95, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,95,217,689,689,689,215,95,95,95, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,95,217,689,689,689,215,95,95,95, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,95,217,689,689,689,215,95,95,95, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,95,217,689,689,689,215,95,95,95, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,95,217,689,689,689,215,95,95,95, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,95,217,689,689,689,215,95,95,95, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,95,217,689,689,689,215,95,95,95, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,95,217,689,689,689,215,95,95,95, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,95,217,689,689,689,215,95,95,95, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,95,217,689,689,689,215,95,95,95, - 176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,177,0,0,0,0,215,95,95,217,689,689,689,215,95,95,95, - 256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,257,0,0,0,0,215,95,95,217,689,689,689,215,95,95,95, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,95,217,689,689,689,215,95,95,95, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,95,217,689,689,689,215,95,95,95, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,95,217,689,689,689,215,95,95,95, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,95,217,689,689,689,215,95,95,95, - 176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,137,95,95,217,689,689,689,215,95,95,95, - 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,217,689,689,689,215,95,95,95, - 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,217,689,689,689,215,95,95,95, - }; - - - obj.createentity(-320 + (8 * 8), -240 + (11 * 8), 1, 0, 0, -10000, -10000, 10000, 100000); // Enemy - obj.nearelephant = true; - - roomtileset = 0; // (Use space station tileset) - result = contents; - break; - } - - case rn(12,10): - { - - static const short contents[] = { - 104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,226,704,704,704,224,104,104,104, - 104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,226,704,704,704,224,104,104,104, - 104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,226,704,704,704,224,104,104,104, - 104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,226,704,704,704,224,104,104,104, - 104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,226,704,704,704,224,104,104,104, - 104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,226,704,704,704,224,104,104,104, - 104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,226,704,704,704,224,104,104,104, - 104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,226,704,704,704,224,104,104,104, - 104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,226,704,704,704,224,104,104,104, - 104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,226,704,704,704,224,104,104,104, - 104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,226,704,704,704,224,104,104,104, - 104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,226,704,704,704,224,104,104,104, - 104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,226,704,704,704,224,104,104,104, - 104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,226,704,704,704,224,104,104,104, - 104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,226,704,704,704,224,104,104,104, - 104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,226,704,704,704,224,104,104,104, - 104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,226,704,704,704,224,104,104,104, - 104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,226,704,704,704,224,104,104,104, - 104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,226,704,704,704,224,104,104,104, - 104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,226,704,704,704,224,104,104,104, - 104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,226,704,704,704,224,104,104,104, - 104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,226,704,704,704,224,104,104,104, - 104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,226,704,704,704,224,104,104,104, - 265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,266,704,704,704,224,104,104,104, - 704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,224,104,104,104, - 704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,224,104,104,104, - 704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,224,104,104,104, - 704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,224,104,104,104, - 185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,146,104,104,104, - 104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104, - }; - - obj.nearelephant = false; - roomtileset = 0; // (Use space station tileset) - result = contents; - break; - } - - case rn(12,16): - { - - static const short contents[] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,578,579,579,579,579,580,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,578,540,498,498,498,498,539,580,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,578,540,498,498,498,498,498,498,539,580,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,540,498,498,498,498,498,498,498,498,539,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - }; - result = contents; - break; - } - - case rn(12,17): - { - - static const short contents[] = { - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650, - 0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0, - 0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0, - 0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0, - 0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0, - 0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0, - 0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0, - 570,570,570,570,570,570,570,570,570,571,0,0,0,0,0,689,0,0,0,0,0,0,569,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570, - 489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,689,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,689,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,530,570,570,570,570,570,570,570,571,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,690,690,690,690,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,490,650,651,0,0,0,0,649,650,491,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,690,690,690,690,690,690,690,690,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - }; - result = contents; - break; - } - - case rn(12,18): - { - - static const short contents[] = { - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,687,687,687,687,687,687,687,687,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,527,567,568,0,0,0,0,566,567,528,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,687,687,687,687,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,646,647,647,647,647,647,647,647,488,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,686,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,686,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486, - 647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,648,0,0,0,0,0,0,686,0,0,0,0,0,646,647,647,647,647,647,647,647,647,647, - 0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0, - 0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0, - 0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0, - 0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0, - 0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0, - 0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0, - 567,567,567,567,567,567,567,567,567,568,0,0,0,0,0,686,0,0,0,0,0,0,566,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567, - 486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,686,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,686,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,527,567,567,567,567,567,567,567,568,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,687,687,687,687,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,487,647,648,0,0,0,0,646,647,488,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,687,687,687,687,687,687,687,687,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - }; - result = contents; - break; - } - - case rn(12,19): - { - - static const short contents[] = { - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,690,690,690,690,690,690,690,690,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,530,570,571,0,0,0,0,569,570,531,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,690,690,690,690,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,649,650,650,650,650,650,650,650,491,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,689,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,689,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489, - 650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,651,0,0,0,0,0,0,689,0,0,0,0,0,649,650,650,650,650,650,650,650,650,650, - 0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0, - 0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0, - 0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0, - 0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0, - 0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0, - 0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0, - 570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - }; - result = contents; - break; - } - - case rn(13,1): - { - - static const short contents[] = { - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,215,95,95,95,217,215,95,217,216,216,216,216,216,216,216,216,216,216,216, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,215,95,95,95,217,215,95,217,216,216,216,216,216,216,216,216,216,216,216, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,215,95,95,95,217,215,95,217,216,216,216,216,216,216,216,216,216,216,216, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,215,95,95,95,217,215,95,136,176,176,176,176,176,176,176,176,176,176,176, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,215,95,95,95,217,215,95,95,95,95,95,95,95,95,95,95,95,95,95, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,215,95,95,95,217,255,256,256,256,256,256,256,256,256,256,256,256,256,256, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,215,95,95,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,215,95,95,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,215,95,95,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,215,95,95,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,215,95,95,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,657,215,95,95,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,215,95,95,95,217,0,0,0,0,0,175,176,176,176,176,176,176,176,176, - 0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,215,95,95,95,217,0,0,0,0,0,215,95,95,95,95,95,95,95,95, - 0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,215,95,95,95,217,0,0,0,0,0,215,95,96,256,256,256,256,256,256, - 0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,215,95,95,95,217,0,0,0,0,0,215,95,217,216,216,216,216,216,216, - 0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,215,95,95,95,217,0,0,0,0,0,215,95,217,216,216,216,216,216,216, - 0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,215,95,95,95,217,0,0,0,0,0,215,95,217,216,216,216,216,216,216, - 576,576,576,576,576,576,576,576,576,577,175,176,176,176,177,0,0,0,0,0,0,215,95,95,95,217,0,0,0,0,0,215,95,217,216,216,216,216,216,216, - 495,495,495,495,495,495,495,495,495,617,215,95,95,95,217,696,696,696,696,696,696,215,95,95,95,217,0,0,0,0,0,215,95,217,216,216,216,216,216,216, - 495,495,495,495,495,495,495,495,495,617,215,95,95,95,217,0,0,0,0,0,0,215,95,95,95,217,0,0,0,0,0,215,95,217,216,216,216,216,216,216, - 495,495,495,495,495,495,495,495,495,617,215,95,95,95,217,0,0,0,0,0,0,255,256,256,256,257,0,0,0,0,0,215,95,217,216,216,216,216,216,216, - 495,495,495,495,495,495,495,495,495,617,255,256,256,256,257,0,0,0,0,0,0,575,576,576,576,577,0,0,0,0,0,215,95,217,216,216,216,216,216,216, - 495,495,495,495,495,495,495,495,495,536,576,576,576,576,577,0,0,0,0,0,0,615,495,495,495,617,0,0,0,0,0,215,95,217,216,216,216,216,216,216, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,615,495,495,495,617,0,0,0,0,0,215,95,217,216,216,216,216,216,216, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,615,495,495,495,617,0,0,0,0,0,215,95,217,216,216,216,216,216,216, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,696,696,696,696,696,696,615,495,495,495,617,696,696,696,696,696,215,95,217,216,216,216,216,216,216, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,615,495,495,495,617,0,0,0,0,0,215,95,217,216,216,216,216,216,216, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,615,495,495,495,617,0,0,0,0,0,215,95,217,216,216,216,216,216,216, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,615,495,495,495,617,0,0,0,0,0,215,95,217,216,216,216,216,216,216, - }; - result = contents; - break; - } - - case rn(13,2): - { - - static const short contents[] = { - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0,600,480,480,480,602,0,0,0,0,0,209,89,211,210,210,210,210,210,210, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0,600,480,480,480,602,0,0,0,0,0,209,89,211,210,210,210,210,210,210, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0,600,480,480,480,602,0,0,0,0,0,209,89,211,210,210,210,210,210,210, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0,600,480,480,480,602,0,0,0,0,0,209,89,211,210,210,210,210,210,210, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0,600,480,480,480,602,0,0,0,0,0,209,89,211,210,210,210,210,210,210, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0,600,480,480,480,602,0,0,0,0,0,209,89,211,210,210,210,210,210,210, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0,600,480,480,480,602,0,0,0,0,0,209,89,211,210,210,210,210,210,210, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,681,681,681,681,681,681,600,480,480,480,602,681,681,681,681,681,209,89,211,210,210,210,210,210,210, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0,600,480,480,480,602,0,0,0,0,0,209,89,211,210,210,210,210,210,210, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0,600,480,480,480,602,0,0,0,0,0,209,89,211,210,210,210,210,210,210, - 480,480,480,480,481,641,641,641,641,641,641,641,641,641,642,0,0,0,0,0,0,600,480,480,480,602,0,0,0,0,0,209,89,211,210,210,210,210,210,210, - 480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,602,0,0,0,0,0,209,89,211,210,210,210,210,210,210, - 480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,602,681,681,681,681,681,209,89,211,210,210,210,210,210,210, - 480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,602,0,0,0,0,0,209,89,211,210,210,210,210,210,210, - 480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,640,641,641,641,642,0,0,0,0,0,209,89,211,210,210,210,210,210,210, - 480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,209,89,211,210,210,210,210,210,210, - 480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,209,89,211,210,210,210,210,210,210, - 480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,209,89,211,210,210,210,210,210,210, - 480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,209,89,211,210,210,210,210,210,210, - 480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,209,89,211,210,210,210,210,210,210, - 480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,209,89,211,210,210,210,210,210,210, - 480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,209,89,211,210,210,210,210,210,210, - 480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,209,89,130,170,170,170,170,170,170, - 480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,209,89,89,89,89,89,89,89,89, - 480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,249,250,250,250,250,250,250,250,250, - 480,480,480,480,521,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - }; - - obj.createentity(48, 96, 14); //Teleporter! - result = contents; - break; - } - - case rn(13,14): - { - - static const short contents[] = { - 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89, - 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,90,250,250,250,250,250,250,250,250,250,250,250,250,250,91,89, - 89,89,89,89,89,89,89,89,89,89,89,89,90,250,250,250,250,250,250,250,250,250,250,250,251,0,0,0,0,0,0,0,0,0,815,695,695,695,209,89, - 89,89,89,89,89,89,89,89,89,89,89,89,211,9,9,9,9,9,9,9,9,9,9,9,9,0,0,0,0,0,0,0,0,0,815,695,695,695,209,89, - 89,89,89,89,89,89,89,89,89,89,89,89,211,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,815,695,695,695,209,89, - 89,89,89,89,89,89,89,89,89,89,89,89,211,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,815,695,695,695,209,89, - 89,89,89,89,89,89,89,89,89,89,89,89,211,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,169,170,170,170,170,131,89, - 89,89,89,89,89,89,89,89,89,89,89,89,211,0,775,776,776,776,776,776,776,776,776,776,776,776,776,776,776,777,0,0,0,209,89,89,89,89,89,89, - 89,89,89,89,89,89,89,89,89,89,89,89,211,0,815,695,695,695,695,695,695,695,695,695,695,695,695,695,695,817,0,0,0,249,250,250,250,250,250,250, - 89,89,89,89,89,89,89,89,89,89,89,89,211,0,815,695,695,695,695,169,170,170,170,170,170,170,171,695,695,817,0,0,0,0,815,695,695,695,695,695, - 89,89,89,89,89,89,89,89,89,89,89,89,211,0,815,695,695,695,695,209,89,89,89,89,89,89,211,695,695,817,0,0,0,0,815,695,695,695,695,695, - 89,89,89,89,89,89,89,89,90,250,250,250,251,0,815,695,695,695,695,209,89,89,89,89,89,89,211,695,695,817,0,0,0,0,815,695,695,695,695,695, - 89,89,89,89,89,89,89,89,211,0,0,756,0,0,815,695,695,695,695,209,89,89,89,89,89,89,211,695,695,817,0,0,0,0,815,695,695,695,695,695, - 89,89,89,89,89,89,89,89,211,0,0,756,0,0,815,695,695,695,695,209,89,89,89,89,89,89,211,695,695,817,0,0,0,0,815,695,695,695,695,695, - 250,250,250,250,250,250,250,250,251,0,0,756,0,0,815,695,695,695,695,209,89,89,89,89,89,89,130,170,170,170,170,170,170,170,170,170,170,170,170,170, - 0,0,0,0,0,756,0,0,0,0,0,756,0,0,815,695,695,695,695,209,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89, - 0,0,0,0,0,756,0,0,0,0,0,756,0,0,815,695,695,695,695,249,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250, - 0,0,0,0,0,756,0,0,0,0,0,756,0,0,815,695,695,695,695,695,695,695,695,695,695,695,695,695,695,817,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,756,0,0,0,0,0,756,0,0,815,695,695,695,695,695,695,695,695,695,695,695,695,695,695,817,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,756,0,0,0,0,0,756,0,0,815,695,695,695,695,695,695,695,695,695,695,695,695,695,695,817,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,756,0,0,0,0,0,756,0,0,815,695,695,695,695,695,695,695,695,695,695,695,695,695,695,817,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,756,0,0,0,0,0,756,0,0,815,695,695,695,695,695,695,695,695,695,695,695,695,695,695,817,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,756,0,0,0,0,0,756,0,0,815,695,695,695,695,695,695,695,695,695,695,695,695,695,695,817,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,396,397,397,397,397,397,397,397,397,397,397,397,398,856,856,856,856,856,856,856,856,856,856,856,856,857,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,476,477,477,477,477,477,477,477,477,477,477,477,478,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - }; - - obj.createentity(280, 32, 20, 1); //terminal - obj.createblock(5, 280-4, 32, 20, 16, 9); - - roomtileset = 0; // (Use space station tileset) - result = contents; - break; - } - - case rn(13,15): - { - - static const short contents[] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,581,582,583,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,621,501,623,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,661,662,663,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,701,0,0,0,0,0,0,0,0,0,701,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,581,582,583,0,0,0,701,0,0,0,0,0,0,0,0,0,701,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,621,501,623,702,702,702,703,702,702,702,702,702,702,702,702,702,703,702,702,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,661,662,663,0,0,0,701,0,0,0,0,0,0,0,0,0,701,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,701,0,0,0,0,701,0,0,0,0,0,0,0,0,0,701,0,0,0,0,0,0,0, - 0,0,0,0,0,0,581,582,583,0,0,581,582,583,0,0,0,701,0,0,0,0,701,0,0,0,581,582,583,0,0,581,582,583,0,0,0,0,0,0, - 0,0,0,0,0,0,621,501,623,702,702,621,501,623,702,702,702,703,702,702,702,702,703,702,702,702,621,501,623,702,702,621,501,623,0,0,0,0,0,0, - 0,0,0,0,0,0,661,662,663,0,0,661,662,663,0,0,0,701,0,0,0,0,701,0,0,0,661,662,663,0,0,661,662,663,0,0,0,0,0,0, - 0,0,0,0,0,0,0,701,0,0,0,0,0,0,0,0,0,701,0,0,0,0,701,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,701,0,0,0,0,0,0,0,0,0,701,0,0,0,581,582,583,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,702,702,703,702,702,702,702,702,702,702,702,702,703,702,702,702,621,501,623,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,701,0,0,0,0,0,0,0,0,0,701,0,0,0,661,662,663,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,701,0,0,0,0,0,0,0,0,0,701,0,0,0,0,701,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,581,582,583,0,0,0,0,0,0,0,0,0,0,0,0,0,701,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,621,501,623,0,0,0,0,0,0,0,0,0,0,0,0,0,701,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,661,662,663,0,0,0,0,0,0,0,0,0,0,0,0,0,701,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,701,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,701,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,701,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,701,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,701,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,701,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - }; - result = contents; - break; - } - - case rn(13,16): - { - - static const short contents[] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,575,576,576,576, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,575,576,576,537,495,495,495, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,575,576,576,537,495,495,495,495,495,495, - 0,0,0,0,0,0,0,0,0,575,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,537,495,495,495,495,495,495,495,495,495, - 0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 0,0,0,0,0,0,0,0,0,655,656,497,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 0,0,0,0,0,0,0,0,0,0,0,655,656,497,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 0,0,0,0,0,0,0,0,0,0,0,695,0,655,656,497,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,655,656,656,497,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,655,656,656,497,495,495,495,495,496,656,656,656,656,497,495,495,495,495,495,495,495,495, - 0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,695,0,0,655,656,656,656,656,657,0,0,0,0,615,495,495,495,495,495,495,495,495, - 0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,695,0,0,0,0,0,0,695,0,0,0,0,0,615,495,495,495,495,495,495,495,495, - 0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,695,0,0,0,0,0,0,695,0,0,0,0,0,615,495,495,495,495,495,495,495,495, - 576,576,576,576,576,576,576,576,576,576,576,577,0,0,0,0,0,0,695,0,0,0,0,0,0,695,0,0,0,0,0,615,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,536,576,576,577,0,0,0,695,0,0,0,0,0,0,695,0,0,0,0,0,615,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,536,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,537,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - }; - - obj.createentity(80, 104, 10, 1, 16130); // (savepoint) - result = contents; - break; - } - - case rn(13,17): - { - - static const short contents[] = { - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656, - 0,0,0,0,695,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,695,0,0,0,0, - 0,0,0,0,695,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,695,0,0,0,0, - 0,0,0,0,695,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,695,0,0,0,0, - 0,0,0,0,695,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,695,0,0,0,0, - 0,0,0,0,695,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,695,0,0,0,0, - 0,0,0,0,695,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,695,0,0,0,0, - 576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,577,0,0,0,0,0,0,0,0,575,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,696,696,696,696,696,696,696,696,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,696,696,696,696,696,696,696,696,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - }; - - obj.createentity(240, 128, 10, 1, 17130); // (savepoint) - result = contents; - break; - } - - case rn(13,18): - { - - static const short contents[] = { - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,651,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,531,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - }; - result = contents; - break; - } - - case rn(13,19): - { - - static const short contents[] = { - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,484,644,644,644,485,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,605,163,164,165,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,605,203,83,205,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,605,243,244,245,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,484,644,644,644,485,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,524,564,564,564,525,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,163,164,165,603,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,203,83,205,603,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,243,244,245,603,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,524,564,564,564,525,483,483,483,483,483,483,483, - 644,644,644,644,485,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,484,644,644,644,644,644,485,483,483,483,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,163,164,164,164,165,603,483,483,483,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,203,83,83,83,205,603,483,483,483,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,203,83,83,83,205,603,483,483,483,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,203,83,83,83,205,603,483,483,483,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,243,244,244,244,245,603,483,483,483,483,483,483,483,483,483,483,483,483,483, - 564,564,564,564,525,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,524,564,564,564,564,564,525,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,484,644,644,644,485,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,163,164,165,603,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,203,83,205,603,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,484,644,644,644,485,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,243,244,245,603,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,605,163,164,165,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,524,564,564,564,525,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,605,203,83,205,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,605,243,244,245,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,524,564,564,564,525,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - }; - result = contents; - break; - } - - case rn(14,14): - { - - static const short contents[] = { - 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, - 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, - 292,292,292,292,292,292,292,292,292,292,292,293,453,453,453,294,292,292,292,292,292,292,292,292,293,453,453,453,294,292,292,292,292,292,292,292,292,292,292,292, - 292,292,292,292,292,292,292,292,292,292,292,414,9,9,9,412,292,292,292,292,292,292,292,292,414,9,9,9,412,292,292,292,292,292,292,292,292,292,292,292, - 292,292,292,292,292,292,292,292,292,292,292,414,0,0,0,412,292,292,292,292,292,292,292,292,414,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292, - 292,292,292,292,292,292,292,292,292,292,292,414,0,0,0,412,292,292,292,292,292,292,292,292,414,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292, - 292,292,292,292,292,292,292,292,292,292,292,414,0,0,0,412,292,292,292,292,292,292,292,292,414,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292, - 292,292,292,292,292,292,292,292,292,292,292,414,782,782,782,412,292,292,292,292,292,292,292,292,414,782,782,782,412,292,292,292,292,292,292,292,292,292,292,292, - 453,453,453,453,453,453,453,453,453,453,453,454,701,701,701,452,453,453,453,453,453,453,453,453,454,701,701,701,452,453,453,453,453,453,453,453,453,453,453,453, - 701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701, - 701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701, - 701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701, - 701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701, - 701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701, - 373,373,373,373,373,373,374,701,701,701,372,373,373,373,373,373,373,374,701,701,701,701,372,373,373,373,373,373,373,374,701,701,701,372,373,373,373,373,373,373, - 292,292,292,292,292,292,414,701,701,701,412,292,292,292,292,292,292,414,701,701,701,701,412,292,292,292,292,292,292,414,701,701,701,412,292,292,292,292,292,292, - 453,453,453,453,453,294,414,862,862,862,412,292,292,292,292,292,292,414,862,862,862,862,412,292,292,292,292,292,292,414,862,862,862,412,293,453,453,453,453,453, - 0,0,0,0,0,412,414,0,0,0,412,292,292,292,292,292,292,414,0,0,0,0,412,292,292,292,292,292,292,414,0,0,0,412,414,0,0,0,0,0, - 0,0,0,0,0,412,414,0,0,0,412,292,292,292,292,292,292,414,0,0,0,0,412,292,292,292,292,292,292,414,0,0,0,412,414,0,0,0,0,0, - 0,0,0,0,0,412,414,8,8,8,412,292,292,292,292,292,292,414,0,0,0,0,412,292,292,292,292,292,292,414,8,8,8,412,414,0,0,0,0,0, - 0,0,0,0,0,412,333,373,373,373,334,292,292,292,292,292,292,414,0,0,0,0,412,292,292,292,292,292,292,333,373,373,373,334,414,0,0,0,0,0, - 0,0,0,0,0,452,453,453,453,453,453,453,453,453,453,294,292,414,8,8,8,8,412,292,293,453,453,453,453,453,453,453,453,453,454,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,333,373,373,373,373,334,292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,452,453,453,453,453,453,453,453,453,454,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - }; - - roomtileset = 0; // (Use space station tileset) - result = contents; - break; - } - - case rn(14,16): - { - - static const short contents[] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,572,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,574,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,652,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,654,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,693,694,693,693,693,693,693,693,693,693,693,693,693,693,693,693,693,693,693,693,693,693,694,693,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,693,694,693,693,693,693,693,693,693,693,693,693,693,693,693,693,693,693,693,693,693,693,694,693,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0, - 573,573,573,573,573,573,573,573,573,573,573,573,574,693,693,693,693,693,693,693,693,693,693,693,693,693,693,694,693,0,0,0,0,0,0,0,0,0,0,0, - 492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0, - 492,492,492,492,492,492,492,492,492,492,492,492,533,573,573,574,693,693,693,693,693,693,693,693,693,693,693,694,693,0,0,0,0,0,0,0,0,0,0,0, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,533,574,693,693,693,693,693,693,693,693,693,693,694,693,0,0,0,0,0,0,0,0,0,0,0, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,533,574,693,693,693,693,693,693,693,693,693,694,693,0,0,0,0,0,0,0,0,0,0,0, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,533,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - }; - result = contents; - break; - } - - case rn(14,17): - { - - static const short contents[] = { - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,499,659,659,659,659,659,659,659,659,500,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,499,659,660,0,0,0,0,0,0,0,0,658,659,500,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,698,0,0,0,0,0,0,0,0,698,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498, - 659,659,659,659,659,659,659,659,659,659,659,659,659,660,699,700,699,699,699,699,699,699,699,699,700,699,658,500,498,498,498,498,498,498,498,498,498,498,498,498, - 0,0,0,698,0,0,0,0,0,698,0,0,0,0,0,698,0,0,0,0,0,0,0,0,698,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498, - 0,0,0,698,0,0,0,0,0,698,0,0,0,0,0,698,0,0,0,0,0,0,0,0,698,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498, - 0,0,0,698,0,0,0,0,0,698,0,0,0,0,0,698,0,0,0,0,0,0,0,0,698,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498, - 0,0,0,698,0,0,0,0,0,698,0,0,0,0,0,698,0,0,0,0,0,0,0,0,698,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498, - 0,0,0,698,0,0,0,0,0,698,0,0,0,0,0,698,0,0,0,0,0,0,0,0,698,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498, - 0,0,0,698,0,0,0,0,0,698,0,0,0,0,0,698,0,0,0,0,0,0,0,0,698,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498, - 579,579,579,579,579,579,579,579,579,579,579,579,579,580,699,700,699,699,699,699,699,699,699,699,700,699,578,540,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,698,0,0,0,0,0,0,0,0,698,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,539,579,580,0,0,0,0,0,0,0,0,578,579,540,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,539,579,579,579,579,579,579,579,579,540,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - }; - result = contents; - break; - } - - case rn(14,18): - { - - static const short contents[] = { - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,499,659,659,659,659,659,500,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,499,659,659,660,0,698,0,0,0,658,659,659,500,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,499,659,659,660,0,0,0,0,698,0,0,0,0,0,0,658,659,659,659,659,659,659,659,659,500,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,499,660,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,658,659,659,659,659,659,659,659,659, - 498,498,498,498,498,499,660,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,698,0,0,0, - 498,498,498,498,499,660,0,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,698,0,0,0, - 498,498,498,499,660,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,698,0,0,0, - 498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,698,0,0,0, - 498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,698,0,0,0, - 498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,578,579,579,579,579, - 498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,578,579,579,579,579,579,579,579,579,579,579,579,540,498,498,498,498, - 498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,698,0,0,578,579,579,579,579,540,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,620,0,0,0,0,0,0,0,0,0,578,579,579,579,579,540,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,620,0,0,0,0,0,0,0,0,578,540,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,620,0,0,0,0,0,0,0,578,540,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,620,699,699,699,699,699,699,699,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,620,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,620,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,620,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,620,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,620,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - }; - result = contents; - break; - } - - case rn(14,19): - { - - static const short contents[] = { - 495,495,495,617,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,617,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,617,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,617,696,696,696,696,696,696,696,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,617,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,617,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,617,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,617,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,496,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,497,495,495,495, - 495,495,495,617,696,696,696,696,696,696,696,615,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495, - 495,495,495,617,0,0,0,0,0,0,0,655,497,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495, - 495,495,495,617,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495, - 495,495,495,617,0,0,0,0,0,0,0,0,655,497,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495, - 495,495,495,536,577,0,0,0,0,0,0,0,0,655,656,656,656,656,656,657,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495, - 495,495,495,495,617,0,0,0,0,0,0,0,0,0,695,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495, - 495,495,495,495,617,0,0,0,0,0,0,0,0,0,695,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495, - 495,495,495,495,617,0,0,0,0,0,0,0,0,0,695,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495, - 495,495,495,495,536,576,576,577,0,0,0,0,0,0,695,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495, - 495,495,495,495,495,495,495,617,0,0,0,0,0,0,695,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495, - 495,495,495,495,495,495,495,617,0,0,0,0,0,0,695,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495, - 495,495,495,495,495,495,495,617,0,0,0,0,0,0,695,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495, - 495,495,495,495,495,495,495,617,0,0,0,0,0,0,695,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495, - 495,495,495,495,495,495,495,617,0,0,0,0,0,0,695,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495, - 495,495,495,495,495,495,495,536,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,537,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - }; - - obj.createentity(176, 72, 14); //Teleporter! - obj.createentity(88, 160, 20, 1);//terminal - - obj.createblock(5, 88-4, 160, 20, 16, 11); - result = contents; - break; - } - - case rn(15,14): - { - - static const short contents[] = { - 104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104, - 104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104, - 104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104, - 104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104, - 104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104, - 104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104, - 104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104, - 104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104, - 265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265, - 704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704, - 704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,705,865,865,706,704,705,865,865,706,704,705,865,865,706,704,704,704, - 704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,826,0,0,824,704,826,0,0,824,704,826,0,0,824,704,704,704, - 704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,826,0,0,824,704,826,0,0,824,704,826,0,0,824,704,704,704, - 704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,826,0,0,824,704,826,0,0,824,704,826,0,0,824,704,704,704, - 185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,186,704,704,704,704,826,0,0,824,704,826,0,0,824,704,826,0,0,824,704,704,704, - 104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,226,704,704,704,704,826,0,0,824,704,826,0,0,824,704,826,0,0,824,704,704,704, - 265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,106,104,104,226,704,704,704,704,826,0,0,824,704,826,0,0,824,704,826,0,0,824,704,704,704, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,224,104,104,226,704,704,704,704,826,0,0,824,704,826,0,0,824,704,826,0,0,824,704,704,704, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,224,104,104,226,704,704,704,704,826,0,0,824,704,826,0,0,824,704,826,0,0,824,704,704,704, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,224,104,104,226,704,704,704,704,745,785,785,746,704,745,785,785,746,704,745,785,785,746,704,704,704, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,224,104,104,226,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,224,104,104,145,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,224,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,264,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - }; - - roomtileset = 0; // (Use space station tileset) - result = contents; - break; - } - - case rn(15,16): - { - - static const short contents[] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,562,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,481,641,642,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,481,641,642,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,481,641,642,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 480,480,480,480,480,480,480,480,480,480,480,480,480,481,641,642,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - }; - result = contents; - break; - } - - case rn(15,17): - { - - static const short contents[] = { - 495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,495,495,495,495,495,495,495,495,496,657,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,495,495,495,495,495,495,495,496,657,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,495,495,495,495,495,495,496,657,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - }; - result = contents; - break; - } - - case rn(15,18): - { - - static const short contents[] = { - 486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 486,486,486,486,486,486,486,486,486,486,527,568,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 486,486,486,486,486,486,486,486,486,486,486,527,568,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 486,486,486,486,486,486,486,486,486,486,486,486,527,568,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 486,486,486,486,486,486,486,486,486,487,647,647,647,648,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 647,647,647,647,647,647,647,647,647,648,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,686,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,686,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,686,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,686,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,686,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 567,567,567,568,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 486,486,486,527,567,567,567,567,567,567,567,567,568,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 486,486,486,486,486,486,486,486,486,486,486,487,648,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 486,486,486,486,486,486,486,486,486,486,487,648,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - }; - - obj.createentity(88, 96, 10, 0, 18150); // (savepoint) - result = contents; - break; - } - - case rn(15,19): - { - - static const short contents[] = { - 489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 489,489,489,489,489,489,489,489,489,489,530,571,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 489,489,489,489,489,489,489,489,489,489,489,530,571,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 489,489,489,489,489,489,489,489,489,489,489,489,530,570,571,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,530,570,571,0,0,0,0,0,0,0,0,0,0,0,0,0,0,569,570,570,570,570,570,570,570,570, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,530,570,570,570,570,570,570,570,570,570,570,570,570,570,570,531,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - }; - result = contents; - break; - } - - case rn(16,4): - { - - static const short contents[] = { - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,484,644,644,644,485,483,483,483,483,483,483,483,483,484,644,644,644,485,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,605,163,164,165,643,644,644,644,644,644,644,644,644,645,163,164,165,603,483,483,483,484,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644, - 483,605,203,83,205,163,164,164,164,164,164,164,164,164,165,203,83,205,603,483,484,644,645,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 483,605,243,244,245,243,244,244,244,244,244,244,244,244,245,243,244,245,603,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 483,524,565,163,165,0,0,0,0,0,0,0,0,0,0,163,165,563,525,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 483,483,605,203,205,0,0,0,0,0,0,0,0,0,0,243,245,643,644,644,645,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 483,483,605,203,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 483,483,605,203,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 483,483,605,203,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 483,483,605,203,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 483,483,605,203,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 483,483,605,203,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 483,483,605,203,205,0,0,0,0,0,0,0,0,0,0,163,165,563,564,564,564,564,564,564,564,564,564,565,0,0,0,0,0,0,0,0,0,0,0,0, - 483,484,645,243,245,0,0,0,0,0,0,0,0,0,0,243,245,643,485,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0, - 483,605,163,164,165,163,164,164,164,164,164,164,164,164,165,163,164,165,603,483,483,483,483,483,483,483,483,524,564,565,0,0,0,0,0,0,0,0,0,0, - 483,605,203,83,205,243,244,244,244,244,244,244,244,244,245,203,83,205,603,483,483,483,483,483,483,483,483,483,483,524,565,0,0,0,0,0,0,0,0,0, - 483,605,243,244,245,563,564,564,564,564,564,564,564,564,565,243,244,245,603,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0, - 483,524,564,564,564,525,483,483,483,483,483,483,483,483,524,564,564,564,525,483,483,483,483,483,483,483,483,483,483,483,524,564,564,564,564,564,564,564,564,564, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - }; - - obj.createentity(72, 120, 13); //Warp Token - - result = contents; - break; - } - - case rn(16,14): - { - - static const short contents[] = { - 107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107, - 107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107, - 107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107, - 107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107, - 107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107, - 107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107, - 107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107, - 107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107, - 268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,109,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107, - 689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,267,268,268,109,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107, - 689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,267,268,268,109,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107, - 689,690,850,850,691,689,690,850,850,691,689,690,850,850,691,689,689,689,689,689,689,267,268,268,109,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107, - 689,811,0,0,809,689,811,0,0,809,689,811,0,0,809,689,689,689,689,689,689,689,689,689,267,268,268,109,107,107,107,107,107,107,107,107,107,107,107,107, - 689,811,0,0,809,689,811,0,0,809,689,811,0,0,809,689,689,689,689,689,689,689,689,689,689,689,689,267,268,268,109,107,107,107,107,107,107,107,107,107, - 689,811,0,0,809,689,811,0,0,809,689,811,0,0,809,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,267,268,268,268,268,268,268,268,268,268, - 689,811,0,0,809,689,811,0,0,809,689,811,0,0,809,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,811,0,0,0, - 689,811,0,0,809,689,811,0,0,809,689,811,0,0,809,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,811,0,0,0, - 689,811,0,0,809,689,811,0,0,809,689,811,0,0,809,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,811,0,0,0, - 689,730,770,770,731,689,730,770,770,731,689,730,770,770,731,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,811,0,0,0, - 689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,187,188,189,689,811,0,0,0, - 689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,227,107,229,689,811,0,0,0, - 188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,149,107,229,850,851,0,0,0, - 107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,229,0,0,0,0,0, - 268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,269,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - }; - - roomtileset = 0; // (Use space station tileset) - obj.createentity(176, 152, 10, 1, 14160); // (savepoint) - result = contents; - break; - } - - case rn(16,17): - { - - static const short contents[] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,575,576,577,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,536,576,577,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,536,576,577,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,496,656,657,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,496,656,657,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,655,656,657,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - }; - result = contents; - break; - } - - case rn(16,19): - { - - static const short contents[] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,565,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,524,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - }; - result = contents; - break; - } - - case rn(17,4): - { - - static const short contents[] = { - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,499,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 498,498,498,498,498,498,498,498,498,499,659,659,659,659,660,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 498,498,498,499,659,659,659,659,659,660,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 659,659,659,660,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 579,579,579,579,579,579,579,580,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 498,498,498,498,498,498,498,539,579,579,579,579,579,579,579,579,579,579,579,579,579,579,580,6,6,6,6,6,6,6,6,0,0,0,0,0,0,0,0,0, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,539,579,579,579,579,579,579,579,580,6,6,6,6,0,0,0,0,0, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,539,579,579,579,580,6,6,6,6,6, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,539,579,579,579,579,579, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - }; - result = contents; - break; - } - - case rn(17,12): - { - - static const short contents[] = { - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,496,656,656,656,656,656,656,656,656,656,656,656,656,656,656,497,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,496,657,0,0,0,0,0,0,0,0,0,0,0,0,0,0,655,497,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,655,656,656,656,656,656,656,656,656,656,656,656,656,656,656,497,495,495,495,495,495, - 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495, - 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495, - 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495, - 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495, - 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495, - 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495, - 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,760,761,761,761,761,761,761,761,761,761,761,761,615,495,495,495,495,495, - 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,615,495,495,495,495,495, - 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,615,495,495,495,495,495, - 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,615,495,495,495,495,495, - 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,615,495,495,495,495,495, - 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,615,495,495,495,495,495, - 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,575,576,576,576,576,576,576,576,577,680,680,680,680,680,680,615,495,495,495,495,495, - 495,495,536,576,577,0,0,0,0,0,0,0,0,0,0,0,0,0,575,537,495,495,495,495,495,495,495,617,680,680,680,680,680,680,615,495,495,495,495,495, - 495,495,495,495,536,576,576,576,576,576,576,576,576,576,576,576,576,576,537,495,495,495,495,495,495,495,495,617,680,680,680,680,680,680,615,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,680,680,680,680,680,680,615,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,680,680,680,680,680,680,615,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,680,680,680,680,680,680,615,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,680,680,680,680,680,680,615,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,680,680,680,680,680,680,615,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,680,680,680,680,680,680,615,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,680,680,680,680,680,680,615,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,680,680,680,680,680,680,615,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,680,680,680,680,680,680,615,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,680,680,680,680,680,680,615,495,495,495,495,495, - }; - - obj.createentity(40, 40, 14); //Teleporter! - obj.createentity(192, 120, 20, 1);//terminal - - obj.createblock(5, 192-4, 120, 20, 16, 10); - roomtileset = 0; // (Use space station tileset) - result = contents; - break; - } - - case rn(17,13): - { - - static const short contents[] = { - 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,683,683,683,683,683,683,212,92,92,92,92,92, - 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,683,683,683,683,683,683,212,92,92,92,92,92, - 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,684,844,844,844,844,685,212,92,92,92,92,92, - 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,805,0,0,0,0,803,212,92,92,92,92,92, - 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,805,0,0,0,0,803,212,92,92,92,92,92, - 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,805,0,0,0,0,803,212,92,92,92,92,92, - 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,724,764,764,764,764,725,212,92,92,92,92,92, - 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,683,683,683,683,683,683,212,92,92,92,92,92, - 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,683,683,683,683,683,683,212,92,92,92,92,92, - 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,684,844,844,844,844,685,212,92,92,92,92,92, - 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,805,0,0,0,0,803,212,92,92,92,92,92, - 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,805,0,0,0,0,803,212,92,92,92,92,92, - 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,805,0,0,0,0,803,212,92,92,92,92,92, - 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,724,764,764,764,764,725,212,92,92,92,92,92, - 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,683,683,683,683,683,683,212,92,92,92,92,92, - 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,683,683,683,683,683,683,212,92,92,92,92,92, - 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,684,844,844,844,844,685,212,92,92,92,92,92, - 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,805,0,0,0,0,803,212,92,92,92,92,92, - 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,805,0,0,0,0,803,212,92,92,92,92,92, - 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,805,0,0,0,0,803,212,92,92,92,92,92, - 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,724,764,764,764,764,725,212,92,92,92,92,92, - 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,683,683,683,683,683,683,212,92,92,92,92,92, - 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,683,683,683,683,683,683,212,92,92,92,92,92, - 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,684,844,844,844,844,685,212,92,92,92,92,92, - 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,805,0,0,0,0,803,212,92,92,92,92,92, - 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,805,0,0,0,0,803,212,92,92,92,92,92, - 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,805,0,0,0,0,803,212,92,92,92,92,92, - 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,724,764,764,764,764,725,212,92,92,92,92,92, - 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,683,683,683,683,683,683,212,92,92,92,92,92, - 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,683,683,683,683,683,683,212,92,92,92,92,92, - }; - - roomtileset = 0; // (Use space station tileset) - result = contents; - break; - } - - case rn(17,14): - { - - static const short contents[] = { - 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,211,695,695,695,695,695,695,209,89,89,89,89,89, - 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,211,695,695,695,695,695,695,209,89,89,89,89,89, - 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,211,695,695,695,695,695,695,209,89,89,89,89,89, - 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,211,695,695,695,695,695,695,209,89,89,89,89,89, - 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,211,695,695,695,695,695,695,209,89,89,89,89,89, - 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,211,695,695,695,695,695,695,209,89,89,89,89,89, - 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,211,695,695,695,695,695,695,209,89,89,89,89,89, - 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,211,695,695,695,695,695,695,209,89,89,89,89,89, - 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,211,695,695,695,695,695,695,209,89,89,89,89,89, - 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,211,695,695,695,695,695,695,209,89,89,89,89,89, - 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,211,695,695,695,695,695,695,209,89,89,89,89,89, - 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,211,695,695,695,695,695,695,209,89,89,89,89,89, - 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,211,695,695,695,695,695,695,209,89,89,89,89,89, - 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,211,695,695,695,695,695,695,209,89,89,89,89,89, - 250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,251,695,695,695,695,695,695,209,89,89,89,89,89, - 0,0,0,0,0,0,0,0,0,815,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,209,89,89,89,89,89, - 0,0,0,0,0,0,0,0,0,815,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,209,89,89,89,89,89, - 0,0,0,0,0,0,0,0,0,815,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,209,89,89,89,89,89, - 0,0,0,0,0,0,0,0,0,815,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,209,89,89,89,89,89, - 0,0,0,0,0,0,0,0,0,815,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,209,89,89,89,89,89, - 0,0,0,0,0,0,0,0,0,815,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,209,89,89,89,89,89, - 0,0,0,0,0,0,0,0,0,815,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,209,89,89,89,89,89, - 0,0,0,0,0,0,0,0,0,815,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,209,89,89,89,89,89, - 0,0,0,0,0,0,0,0,0,815,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,209,89,89,89,89,89, - 0,0,0,0,0,0,0,0,0,815,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,209,89,89,89,89,89, - 0,0,0,0,0,0,0,0,0,815,695,695,695,695,695,695,695,695,695,695,169,170,170,170,170,170,170,170,170,170,170,170,170,170,131,89,89,89,89,89, - 0,0,0,0,0,0,0,0,0,855,856,856,856,856,856,856,856,856,856,856,209,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,209,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,209,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,209,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89, - }; - - roomtileset = 0; // (Use space station tileset) - result = contents; - break; - } - - case rn(17,15): - { - - static const short contents[] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86, - 0,0,0,0,0,0,0,0,0,0,0,0,0,166,168,0,0,0,0,0,206,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86, - 0,0,0,0,0,0,0,0,0,0,0,0,0,206,208,837,837,837,837,837,206,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86, - 0,0,0,0,0,0,0,0,0,0,0,0,0,246,248,0,0,0,0,0,206,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,246,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,836,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,836,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,836,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,836,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,836,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,166,167,168,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,246,247,248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - }; - - roomtileset = 0; // (Use space station tileset) - result = contents; - break; - } - - case rn(17,16): - { - - static const short contents[] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,566,567,567,567,567,567,567,568,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,646,488,486,486,486,486,487,648,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,646,488,486,486,487,648,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,646,488,487,648,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,646,648,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - }; - result = contents; - break; - } - - case rn(17,17): - { - - static const short contents[] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,569,570,570,570,570,570,571,0,0,0,0,0,0,0,0,569,570,570,570,570,570,571,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,611,0,0,0,0,0,0,0,0,609,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,609,489,490,650,650,650,651,0,0,0,0,0,0,0,0,649,650,650,650,491,489,611,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,609,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,611,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,609,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,611,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,609,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,611,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,649,650,651,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,649,650,651,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,569,570,571,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,569,570,571,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,609,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,611,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,609,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,611,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,609,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,611,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,609,489,530,570,570,570,571,0,0,0,0,0,0,0,0,569,570,570,570,531,489,611,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,611,0,0,0,0,0,0,0,0,609,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,649,650,650,650,650,650,651,0,0,0,0,0,0,0,0,649,650,650,650,650,650,651,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - }; - - obj.createentity(112, 72, 14); //Teleporter! - result = contents; - break; - } - - case rn(17,18): - { - - static const short contents[] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,563,565,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,563,525,524,565,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,563,525,483,483,524,565,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,563,525,483,483,483,483,524,565,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,643,644,644,644,644,644,644,645,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - }; - result = contents; - break; - } - - case rn(17,19): - { - - static const short contents[] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,566,567,568,0,0,0,0,0,0,0,0,0,0,566,567,568,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,606,486,608,0,0,0,0,0,0,0,0,0,0,606,486,608,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,646,488,527,568,0,0,0,0,0,0,0,0,566,528,487,648,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,608,0,0,0,0,0,0,0,0,606,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,646,488,527,568,0,0,0,0,0,0,566,528,487,648,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,608,0,0,0,0,0,0,606,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,646,488,527,568,0,0,0,0,566,528,487,648,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,608,0,0,0,0,606,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,646,488,527,568,0,0,566,528,487,648,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,608,0,0,606,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,646,488,527,567,567,528,487,648,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,646,488,486,486,487,648,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 567,567,567,567,567,567,567,567,567,568,687,687,687,687,687,687,687,687,606,486,486,608,687,687,687,687,687,687,687,687,566,567,567,567,567,567,567,567,567,567, - 486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,646,647,647,648,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,527,568,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,566,528,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,527,568,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,566,528,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,527,567,568,0,0,0,0,0,0,0,0,0,0,0,0,566,567,528,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,527,567,567,567,567,567,567,567,567,567,567,567,567,528,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, - }; - - obj.createentity(152, 152, 10, 0, 19170); // (savepoint) - result = contents; - break; - } - - case rn(18,4): - { - - static const short contents[] = { - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,496,656,656,656,497,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,7,7,7,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,615,495,495,495,496,656,656,656,497,495,495,495,495,495,495,495,495,495,495,495,495, - 656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,657,0,0,0,615,495,495,495,617,7,7,7,615,495,495,495,495,495,495,495,495,495,495,495,495, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,617,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,617,0,0,0,615,495,495,495,496,656,656,656,497,495,495,495,495, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,655,656,656,656,657,0,0,0,615,495,495,495,617,7,7,7,615,495,495,495,495, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,617,0,0,0,615,495,495,495,495, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,617,0,0,0,615,495,495,495,495, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,655,656,656,656,657,0,0,0,615,495,495,495,495, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,655,656,656,656,656, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6, - 576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - }; - result = contents; - break; - } - - case rn(18,15): - { - - static const short contents[] = { - 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,633,513,513,513,513,513,513,513,513,513,513,513,513,513,513,513,513,513, - 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,633,513,513,513,513,513,513,513,513,513,513,513,513,513,513,513,513,513, - 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,633,513,513,514,674,674,674,515,513,513,513,513,513,513,513,513,513,513, - 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,633,513,513,635,369,370,371,633,513,513,513,513,513,513,513,513,513,513, - 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,633,513,513,635,409,289,411,633,513,514,674,674,515,513,513,513,513,513, - 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,290,450,450,450,451,633,513,513,635,449,450,451,633,513,635,369,371,633,513,513,513,513,513, - 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,593,594,594,594,555,513,513,554,594,594,594,555,513,635,449,451,633,513,513,513,513,513, - 289,289,289,289,289,289,289,289,289,289,289,289,289,289,290,450,450,451,633,513,513,513,513,513,513,513,513,513,513,513,513,554,594,594,555,513,513,513,513,513, - 289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,593,594,594,555,513,513,513,513,513,513,513,513,513,513,513,513,513,513,513,513,513,513,513,513,513, - 450,450,450,450,450,450,450,450,450,450,450,450,450,450,451,633,513,513,514,674,674,515,513,513,513,513,513,513,513,513,513,513,513,513,513,513,513,513,513,513, - 0,0,0,0,0,0,0,0,0,0,0,796,0,0,0,633,513,513,635,369,371,633,513,514,674,674,674,674,674,674,674,674,674,674,674,674,674,674,674,674, - 0,0,0,0,0,0,0,0,0,0,0,796,0,0,0,633,513,513,635,449,451,633,513,635,0,796,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,796,0,0,0,633,513,513,554,594,594,555,513,635,0,796,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,796,0,0,0,673,674,674,674,674,674,674,674,675,0,796,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,796,0,0,0,0,796,0,0,0,0,0,0,0,0,796,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,796,0,0,0,0,796,0,0,0,0,0,0,0,0,796,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,796,0,0,0,0,796,0,0,0,0,0,0,0,0,796,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,796,0,0,0,0,796,0,0,0,0,0,0,0,0,796,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,796,0,0,0,0,796,0,0,0,0,0,0,0,0,796,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,796,0,0,0,0,796,0,0,0,0,0,0,0,0,796,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,796,0,0,0,0,796,0,0,0,0,0,0,0,0,796,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,593,594,594,594,594,594,594,595,0,0,0,0,0,0,0,796,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,673,674,674,674,674,674,674,675,0,0,0,0,0,0,0,796,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,593,594,595,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,633,513,635,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,673,674,675,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - }; - - roomtileset = 0; // (Use space station tileset) - obj.createentity(104, 152, 10, 1, 15180); // (savepoint) - result = contents; - break; - } - - case rn(18,17): - { - - static const short contents[] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,560,561,562,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,560,561,522,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,560,561,522,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,640,641,482,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,640,641,482,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,640,641,642,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - }; - result = contents; - break; - } - - case rn(18,19): - { - - static const short contents[] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,563,564,564,564,564,564, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,563,564,564,525,483,483,483,483,483, - 564,564,564,564,564,564,564,565,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,563,564,525,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,524,564,565,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,563,525,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,524,565,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,563,525,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,524,565,0,0,0,0,0,0,0,0,0,0,0,0,0,0,563,525,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,524,564,564,565,0,0,0,0,0,0,0,0,0,563,564,525,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,524,564,564,564,564,564,564,564,564,564,525,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - }; - result = contents; - break; - } - - case rn(19,4): - { - - static const short contents[] = { - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,484,644,644,644,644,644,485,483,483,483,483,483,483,484,644,644,644,644,644,485,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,605,7,7,7,7,7,603,483,483,483,483,483,483,605,7,7,7,7,7,603,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,605,0,0,0,0,0,603,483,483,483,483,483,483,605,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,605,0,0,0,0,0,603,483,483,483,483,483,483,605,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,605,0,0,0,0,0,603,483,483,483,483,483,483,605,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,605,0,0,0,0,0,603,483,483,483,483,483,483,605,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,605,0,0,0,0,0,603,483,483,483,483,483,483,605,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483, - 644,644,644,644,644,644,644,645,0,0,0,0,0,643,644,644,644,644,644,644,645,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,643,644,644,644,644,644,644,644,644,644,644,644,644,644, - 0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,684,684,685,684,684,684,684,684,684,684,684,684,684,684,684,684,684,684,684,684,684,685,684,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,563,564,564,564,565,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,643,644,644,644,645,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,563,564,564,564,564,565,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,643,644,644,644,644,645,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 6,6,6,6,6,6,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 564,564,564,564,564,564,565,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - }; - - obj.createentity(192, 176, 10, 1, 105190); // (savepoint) - result = contents; - break; - } - - case rn(19,5): - { - - static const short contents[] = { - 495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,495,495,617,0,0,0,0,0,6,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,495,495,617,0,0,0,0,0,575,577,0,0,0,0,0,0,0,6,6,0,0,0,0,0,0,0,0,6,6,0,0,0,0,0,0,0, - 495,495,495,495,495,495,617,0,0,0,0,0,615,617,0,0,0,0,0,0,0,575,577,0,0,0,0,0,0,0,0,575,577,0,0,0,0,0,0,0, - 495,495,495,495,495,495,617,0,0,0,0,0,615,617,0,0,0,0,0,0,0,615,617,0,0,0,0,0,0,0,0,615,617,0,0,0,0,0,0,0, - 495,495,495,495,495,495,617,0,0,0,0,0,615,617,0,0,0,0,0,0,0,615,617,0,0,0,0,0,0,0,0,615,617,0,0,0,0,0,0,0, - 495,495,495,495,495,495,617,0,0,0,0,0,615,617,0,0,0,0,0,0,0,615,617,0,0,0,0,0,0,0,0,615,617,0,0,0,0,0,0,0, - 495,495,495,495,495,495,617,0,0,6,6,6,615,617,6,6,6,6,6,0,0,615,617,0,0,0,0,0,0,0,0,615,617,0,0,0,0,0,0,0, - 495,495,495,495,495,495,617,0,0,575,576,576,537,536,576,576,576,576,577,6,6,615,617,6,6,6,6,6,6,0,0,615,617,0,0,0,0,0,0,0, - 495,495,495,495,495,495,617,0,0,615,495,495,495,495,495,495,495,495,536,576,576,537,536,576,576,576,576,576,577,6,6,615,617,6,6,6,6,6,6,6, - 656,656,656,656,656,656,657,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,536,576,576,537,536,576,576,576,576,576,576,576, - 0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 576,576,576,576,576,576,576,576,576,537,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - }; - - obj.createentity(40, 192, 10, 1, 106190); // (savepoint) - result = contents; - break; - } - - - case rn(19,9): - { - - static const short contents[] = { - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,496,656,656,656,656,656,656,656,497,495,496,656,656,656,656,656,656,656,656,656,656,656,656,497,495,496,656,656,656,656, - 495,495,495,495,495,495,495,495,495,495,617,7,7,7,7,7,7,7,615,495,617,7,7,7,7,7,7,7,7,7,7,7,7,615,495,617,0,0,0,0, - 495,495,495,496,656,656,656,656,656,656,657,0,0,0,0,0,0,0,655,656,657,0,0,0,0,0,0,0,0,0,0,0,0,655,656,657,0,0,0,0, - 495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,496,657,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,575,576,577,0,0,0,0,0,0,0,0,0,0, - 495,495,617,0,0,0,0,0,0,0,575,576,576,577,0,0,0,0,0,0,6,6,6,6,6,6,6,615,495,617,0,0,0,0,0,0,0,0,0,0, - 495,495,617,0,0,0,0,0,0,0,615,495,495,617,6,6,6,6,6,6,575,576,576,576,576,576,576,537,495,536,576,576,576,576,576,576,576,576,576,576, - 495,495,617,0,0,0,0,0,0,0,615,495,495,536,576,576,576,576,576,576,537,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,617,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,617,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,617,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,617,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,617,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,617,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,617,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,617,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - }; - result = contents; - break; - } - - case rn(19,10): - { - - static const short contents[] = { - 498,498,620,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,620,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,620,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,620,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,620,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,499,659,659,500,498,498,498,498,498,498, - 498,498,620,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,499,659,660,7,7,618,498,498,498,498,498,498, - 498,498,620,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,499,659,659,660,7,7,0,0,618,498,498,498,498,498,498, - 498,498,620,699,699,699,699,699,699,699,618,498,498,498,498,498,498,498,498,498,498,498,499,659,659,660,7,7,7,0,0,0,0,618,498,498,498,498,498,498, - 498,498,620,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,620,7,7,7,0,0,0,0,0,0,0,658,659,659,659,659,659,659, - 498,498,620,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 498,498,620,0,0,0,0,0,0,0,658,500,498,498,498,498,498,498,499,659,659,500,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 498,498,620,0,0,0,0,0,0,0,0,658,500,498,498,498,499,659,660,7,7,618,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 498,498,620,0,0,0,0,0,0,0,0,0,658,659,659,659,660,0,0,0,0,618,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 498,498,620,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,658,660,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 498,498,620,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 498,498,620,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 498,498,620,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 498,498,620,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 498,498,620,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 498,498,620,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 498,498,620,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 498,498,539,579,579,579,580,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 498,498,498,498,498,498,539,580,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 498,498,498,498,498,498,498,539,579,579,579,579,580,0,698,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 498,498,498,498,498,498,498,498,498,498,498,498,539,579,579,580,0,0,0,0,0,0,0,0,0,578,580,0,0,0,0,0,0,0,0,0,0,0,0,0, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,539,579,579,580,6,6,6,6,6,6,618,620,6,6,6,6,6,6,6,6,6,6,6,6,6, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,539,579,579,579,579,579,579,540,539,579,579,579,579,579,579,579,579,579,579,579,579,579, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - }; - - obj.createentity(72, 168, 10, 1, 111190); // (savepoint) - result = contents; - break; - } - - case rn(19,11): - { - - static const short contents[] = { - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,496,656,656,656,656,656,656,656,656,656,656,656,656,497,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,617,0,0,0,0,0,695,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,496,656,656,656,656,656,656,656,656,656,656, - 495,495,617,0,0,0,0,0,695,0,0,0,0,0,0,655,656,656,497,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0, - 495,495,617,0,0,0,0,0,695,0,0,0,0,0,0,0,695,0,615,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0, - 495,495,617,0,0,0,0,0,695,0,0,0,0,0,0,0,695,0,655,656,656,497,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0, - 495,495,617,0,0,0,0,0,695,0,0,0,0,0,0,0,695,0,0,0,0,615,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0, - 495,495,617,0,0,0,0,575,576,576,576,577,0,0,0,0,695,0,0,0,0,655,656,656,497,495,495,495,495,536,576,576,576,576,576,576,576,576,576,576, - 495,495,617,0,0,0,0,615,495,495,495,617,0,0,0,0,695,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,617,696,696,696,696,615,495,495,495,536,576,576,577,0,695,0,0,0,0,0,0,0,655,656,656,497,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,617,0,0,0,0,615,495,495,495,495,495,495,617,0,695,0,0,0,0,0,0,0,0,695,0,615,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,617,0,0,0,0,615,495,495,495,495,495,495,536,576,576,577,0,0,0,0,0,0,0,695,0,655,656,656,497,495,495,495,495,495,495,495,495,495, - 495,495,617,0,0,0,0,615,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,695,0,0,0,0,615,495,495,495,495,495,495,495,495,495, - 495,495,617,0,0,0,0,615,495,495,495,495,495,495,495,495,495,536,576,576,577,0,0,0,0,695,0,0,0,0,655,656,656,497,495,495,495,495,495,495, - 495,495,617,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,695,0,0,0,0,0,0,0,615,495,495,495,495,495,495, - 495,495,617,696,696,696,696,615,495,495,495,495,495,495,495,495,495,495,495,495,536,576,576,577,0,695,0,0,0,0,0,0,0,655,656,656,497,495,495,495, - 495,495,617,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,695,0,0,0,0,0,0,0,0,695,0,615,495,495,495, - 495,495,617,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,536,576,576,577,0,0,0,0,0,0,0,695,0,655,656,656,656, - 495,495,617,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,695,0,0,0,0,0, - 495,495,617,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,536,576,576,577,0,0,0,0,695,0,0,0,0,0, - 495,495,617,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,695,0,0,0,0,0, - 495,495,617,696,696,696,696,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,536,576,576,577,0,695,0,0,0,0,0, - 495,495,617,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,695,0,0,0,0,0, - 495,495,617,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,536,576,576,577,0,0,0,0, - 495,495,617,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0, - 495,495,617,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,536,576,576,576,576, - 495,495,617,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,536,576,576,576,576,537,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - }; - result = contents; - break; - } - - case rn(19,12): - { - - static const short contents[] = { - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,499,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,499,659,660,0,0,0,0,698,0,0,0,0,0,0,698,0,0,0,0,0,0,0,698,0,0, - 498,498,498,498,498,498,498,498,498,498,498,498,498,499,659,660,0,0,0,0,0,0,698,0,0,0,0,0,0,698,0,0,0,0,0,0,0,698,0,0, - 498,498,498,498,498,498,498,498,498,498,498,499,659,660,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,698,0,0,0,0,0,0,0,698,0,0, - 498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,698,0,0,578,579,579,579,579,579,579,579, - 498,498,498,498,498,498,498,498,498,498,499,660,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,578,579,579,579,579,540,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,698,0,578,579,579,540,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,499,660,0,0,0,0,0,0,0,0,0,0,0,698,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,578,579,540,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,578,579,540,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,578,579,540,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,499,660,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,620,699,699,699,699,699,699,699,699,699,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,658,659,500,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,658,659,500,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,658,659,500,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,658,659,500,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,499,660,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,658,659,659,659,659,659,659,659,659,659,659,659,659,659, - 498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 498,498,498,498,498,498,499,660,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - }; - result = contents; - break; - } - - case rn(19,13): - { - - static const short contents[] = { - 480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 480,480,480,480,480,481,642,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 480,480,480,480,481,642,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 480,480,480,480,521,562,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 480,480,480,480,480,521,562,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,560,561,561, - 480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,560,561,561,561,522,480,480, - 480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480, - 480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480, - }; - result = contents; - break; - } - - case rn(19,14): - { - - static const short contents[] = { - 489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489, - 489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489, - 489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489, - 489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489, - 489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,569,570,571,0,0,0,0,609,489,489,489,489,489,489, - 489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,649,650,651,0,0,0,0,609,489,489,489,489,489,489, - 489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,609,489,489,489,489,489,489, - 489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,569,570,571,0,689,0,0,689,0,0,0,0,0,609,489,489,489,489,489,489, - 489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,611,690,691,690,690,691,690,690,690,690,690,609,489,489,489,489,489,489, - 489,489,489,489,489,489,611,0,689,0,569,570,571,0,0,0,0,0,0,0,649,650,651,0,689,0,0,689,0,0,0,0,0,609,489,489,489,489,489,489, - 489,489,489,489,489,489,611,690,691,690,609,489,611,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,569,570,570,531,489,489,489,489,489,489, - 489,489,489,489,489,489,611,0,689,0,649,650,651,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,611,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,611,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,569,570,571,0,0,0,0,609,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,611,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,649,650,651,0,0,0,0,609,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,611,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,611,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,611,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,569,570,570,531,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,611,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,611,0,689,0,0,0,0,0,0,0,0,569,570,571,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,611,0,689,0,569,571,0,0,0,0,0,609,489,611,690,690,690,690,690,690,690,609,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,611,690,691,690,609,611,0,0,0,0,0,649,650,651,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,611,0,689,0,649,651,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,569,570,570,531,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - }; - - obj.createentity(80, 144, 10, 1, 14190); // (savepoint) - result = contents; - break; - } - - case rn(19,15): - { - - static const short contents[] = { - 492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,493,654,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,652,653,653,653,653,653,653,653,653,653,653,653,494,492,492,492, - 492,492,492,492,493,654,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492, - 492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492, - 492,492,492,493,654,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,572,573,573,573,573,573,573,573,534,492,492,492, - 653,653,653,654,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,652,653,653,653,653,653,653,494,492,492,492,492, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,572,573,573,573,534,492,492,492,492, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,652,653,653,653,494,492,492,492,492, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,572,573,573,573,573,534,492,492,492,492, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,652,653,653,653,653,653,494,492,492,492, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,572,573,573,573,534,492,492,492, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,652,653,653,653,653,494,492,492, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,572,573,573,573,573,573,573,573,534,492,492, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492, - }; - result = contents; - break; - } - - case rn(19,16): - { - - static const short contents[] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,563,564,565,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,605,684,684,684,684,684,684,684,684,684,684,603,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,605,0,0,0,0,0,0,0,0,0,0,643,644,644,644,644,485,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,603,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,603,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,603,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,603,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,603,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,643,644,645,0,683,0,0,0,0,0,0,0,0,563,564,564,564,564,525,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,683,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,684,685,684,684,685,684,684,684,684,684,684,684,684,603,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,683,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,563,564,565,0,0,0,0,0,0,0,643,644,644,644,644,485,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,603,483,605,0,0,0,0,0,0,0,0,0,0,0,50,603,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,605,0,0,0,0,0,0,0,0,0,0,0,50,603,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,605,0,0,0,0,0,0,0,0,0,0,0,50,603,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,605,0,0,0,0,0,0,0,0,0,0,0,50,603,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,605,0,0,0,0,0,0,0,0,0,0,0,50,603,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,605,0,0,0,0,0,0,0,563,564,564,564,564,525,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,605,684,684,684,684,684,684,684,603,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,643,644,645,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483, - }; - result = contents; - break; - } - - case rn(19,17): - { - - static const short contents[] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,655,656,497,495,495,495,495,495,495,495,495, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,655,656,656,497,495,495,495,495,495, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,655,656,497,495,495,495, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,655,656,656,656, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,575,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,655,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,695,0,0,0,695,0,0,0,695,0,0,0,695,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,695,0,0,0,695,0,0,0,695,0,0,0,695,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,695,0,0,0,695,0,0,0,695,0,0,0,695,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,695,0,0,0,695,0,0,0,695,0,0,0,695,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,695,0,0,0,695,0,0,0,695,0,0,0,695,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,575,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - }; - - obj.createentity(168, 88, 10, 1, 17190); // (savepoint) - result = contents; - break; - } - - case rn(19,18): - { - - static const short contents[] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,658,659,659,659,659,659,659,659,659,659,659,659,500,498,498,498,498,498,498,498,498, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,698,0,0,0,0,0,618,498,498,498,498,498,498,498,498, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,698,0,0,0,0,0,618,498,498,498,498,498,498,498,498, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,698,0,0,0,0,0,618,498,498,498,498,498,498,498,498, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,698,0,0,0,0,0,618,498,498,498,498,498,498,498,498, - 0,0,0,0,0,0,0,0,578,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,580,0,0,0,0,618,498,498,498,498,498,498,498,498, - 0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,699,699,699,699,618,498,498,498,498,498,498,498,498, - 0,0,0,0,0,0,0,0,658,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,660,0,0,0,0,618,498,498,498,498,498,498,498,498, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,698,0,0,0,0,0,618,498,498,498,498,498,498,498,498, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,698,0,0,0,0,0,618,498,498,498,498,498,498,498,498, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,698,0,0,0,0,0,618,498,498,498,498,498,498,498,498, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,698,0,0,0,0,0,618,498,498,498,498,498,498,498,498, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,578,579,579,579,579,579,579,579,579,579,579,579,540,498,498,498,498,498,498,498,498, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - }; - result = contents; - break; - } - - case rn(19,19): - { - - static const short contents[] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,640,482,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,640,482,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 561,561,561,561,561,562,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,521,561,561,562,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,521,561,561,561,561,562,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,521,561,561,561,561,561,561,561,522,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, - }; - result = contents; - break; - } - - ///Secret lab! - - case rn(17, 6): - //Phase 1 - if(obj.altstates==1) - { - - static const short contents[] = { - 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, - 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, - 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, - 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, - 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, - 286,286,286,287,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,288,286,286,286,287,447,447,447,288,286,286,286,287,447,447,447, - 286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,408,0,0,0,406,286,286,286,408,0,0,0, - 286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,408,0,0,0,406,286,286,286,408,0,0,0, - 286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,408,0,0,0,406,286,286,286,408,0,0,0, - 286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,408,0,0,0,406,286,286,286,408,0,0,0, - 286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,366,367,367,367,367,328,286,286,286,408,0,0,0,406,286,286,286,408,0,0,0, - 286,286,286,327,367,368,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286,286,286,287,448,0,0,0,406,286,286,287,448,0,0,0, - 286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286,286,287,448,0,0,0,0,406,286,287,448,0,0,0,0, - 286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,446,447,447,447,288,286,286,408,0,0,0,0,0,406,286,408,0,0,0,0,0, - 286,286,286,287,447,448,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,287,448,0,0,0,0,366,328,286,408,0,0,0,0,0, - 286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,408,0,0,0,0,0,406,286,286,408,0,0,0,0,0, - 286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,408,0,0,0,0,0,406,286,286,408,0,0,0,0,0, - 286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,408,0,0,0,0,0,406,286,286,408,0,0,0,0,0, - 286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,408,0,0,0,0,0,406,286,286,408,0,0,0,0,0, - 286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,408,0,0,0,0,0,406,286,286,408,0,0,0,0,0, - 286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,408,0,0,0,0,366,328,286,286,408,0,0,0,0,0, - 286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,327,368,0,0,0,406,286,286,286,327,368,0,0,0,0, - 286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,366,328,286,286,408,0,0,0,406,286,286,286,286,408,0,0,0,0, - 286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,408,0,0,0,406,286,286,286,286,408,0,0,0,0, - 286,286,286,327,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,328,286,286,286,327,367,367,367,328,286,286,286,286,327,367,367,367,367, - 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, - 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, - 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, - 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, - 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, - }; - result = contents; - } - else if(obj.altstates==2) - { - //Phase 2 - - static const short contents[] = { - 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, - 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, - 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, - 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, - 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, - 286,286,286,287,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,288,286,286,286,287,447,447,447,288,286,286,286,287,447,447,447, - 286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,446,288,287,447,448,0,0,0,406,286,286,286,408,0,0,0, - 286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,446,448,0,0,0,0,0,406,286,286,286,408,0,0,0, - 286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,408,0,0,0, - 286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,408,0,0,0, - 286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,408,0,0,0, - 286,286,286,327,367,368,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,287,448,0,0,0, - 286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,287,448,0,0,0,0, - 286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,408,0,0,0,0,0, - 286,286,286,287,447,448,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,366,328,286,408,0,0,0,0,0, - 286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,408,0,0,0,0,0, - 286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,408,0,0,0,0,0, - 286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,408,0,0,0,0,0, - 286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,408,0,0,0,0,0, - 286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,408,0,0,0,0,0, - 286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,366,328,286,286,408,0,0,0,0,0, - 286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,327,368,0,0,0,0, - 286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,408,0,0,0,0, - 286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,408,0,0,0,0, - 286,286,286,327,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,328,286,286,286,286,327,367,367,367,367, - 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, - 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, - 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, - 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, - 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, - }; - result = contents; - } - else - { - //Phase 3 - static const short contents[] = { - 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, - 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, - 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, - 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, - 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, - 286,286,286,287,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,288,286,286,286,287,447,447,447,288,286,286,286,287,447,447,447, - 286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,446,288,287,447,448,0,0,0,406,286,286,286,408,0,0,0, - 286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,446,448,0,0,0,0,0,446,447,288,286,408,0,0,0, - 286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,446,447,448,0,0,0, - 286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 286,286,286,327,367,368,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 286,286,286,287,447,448,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 286,286,286,327,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367, - 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, - 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, - 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, - 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, - 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, - }; - result = contents; - } - hiddenname = "Secret Lab"; - break; - - case rn(18,6): - { - - static const short contents[] = { - 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,402,0,0,0,0,0,0,0,400,280,280,280,280,280,280,280,280,280,280,280, - 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,402,0,0,0,0,0,0,0,400,280,280,280,280,280,280,280,280,280,280,280, - 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,402,0,0,0,0,0,0,0,400,280,280,280,280,280,280,280,280,280,280,280, - 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,402,0,0,0,0,0,0,0,400,280,280,280,280,280,280,280,280,280,280,280, - 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,402,0,0,0,0,0,0,0,400,280,280,280,280,280,280,280,280,280,280,280, - 441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,442,0,0,0,0,0,0,0,400,280,280,280,280,280,280,280,280,280,280,280, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,400,280,280,280,280,280,280,280,280,280,280,280, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,400,280,280,280,280,280,280,280,280,280,280,280, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,400,280,280,280,280,280,280,280,280,280,280,280, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,400,280,280,280,280,280,280,280,280,280,280,280, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,400,280,280,280,280,280,280,280,280,280,280,280, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,400,280,280,280,280,280,280,280,280,280,280,280, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,400,280,280,280,280,280,280,280,280,280,280,280, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,400,280,280,280,280,280,280,280,280,280,280,280, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,400,280,280,280,280,280,280,280,280,280,280,280, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,400,280,280,280,280,280,280,280,280,280,280,280, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,440,441,441,441,441,441,441,441,441,441,441,441, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361, - 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280, - 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280, - 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280, - 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280, - 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280, - }; - hiddenname = "Secret Lab"; - result = contents; - break; - } - - case rn(18,5): - { - - static const short contents[] = { - 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, - 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, - 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, - 292,292,292,293,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,294,292,292,292,292, - 292,292,292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,292,292, - 292,292,292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,292,292, - 292,292,292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,292,292, - 292,292,292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,292,292, - 292,292,292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,292,292, - 292,292,292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,292,292, - 292,292,292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,292,292, - 292,292,292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,292,292, - 292,292,292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,292,292, - 292,292,292,414,0,0,0,0,0,372,373,373,373,373,373,373,373,373,373,373,374,0,0,0,0,0,0,0,372,373,373,373,373,373,373,334,292,292,292,292, - 292,292,292,414,0,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,414,0,0,0,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292, - 292,292,292,414,0,0,0,0,0,452,453,453,453,453,453,453,453,453,453,294,414,0,0,0,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292, - 292,292,292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,414,0,0,0,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292, - 292,292,292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,414,0,0,0,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292, - 292,292,292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,414,0,0,0,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292, - 292,292,292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,414,0,0,0,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292, - 453,453,453,454,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,414,0,0,0,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,414,0,0,0,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,414,0,0,0,0,0,0,0,412,292,292,292,292,292,293,453,453,453,453,453, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,414,0,0,0,0,0,0,0,412,292,292,292,292,292,414,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,414,0,0,0,0,0,0,0,412,292,292,292,292,292,414,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,414,0,0,0,0,0,0,0,412,292,292,292,292,292,414,0,0,0,0,0, - 373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,334,414,0,0,0,0,0,0,0,412,292,292,292,292,292,333,373,373,373,373,373, - 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,0,0,0,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292, - 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,0,0,0,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292, - 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,0,0,0,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292, - }; - - obj.createentity(256, 88, 21, 1); //Terminal - obj.createentity(128, 88, 21, 1); //Terminal - obj.createentity(104, 88, 21, 1); //Terminal - obj.createentity(80, 88, 21, 1); //Terminal - obj.createentity(128, 128, 21, 0); //Terminal - obj.createentity(128, 192, 21, 1); //Terminal - obj.createentity(104, 192, 21, 1); //Terminal - obj.createentity(80, 192, 21, 1); //Terminal - - if(game.insecretlab) - { - //vitellary - obj.createentity(231, 81, 18, 14, 0, 18); - obj.createblock(5, 231- 32, 0, 32 + 32 + 32, 240, 2); - - //violet - obj.createentity(83, 126, 18, 20, 0, 18); - int crewman = obj.getcrewman(EntityColour_CREW_PURPLE); - if (INBOUNDS_VEC(crewman, obj.entities)) - { - obj.entities[crewman].rule = 7; - obj.entities[crewman].tile +=6; - } - obj.createblock(5, 83 - 32, 0, 32 + 32 + 32, 240, 1); - } - hiddenname = "Secret Lab"; - result = contents; - break; - } - - case rn(17,5): - { - - static const short contents[] = { - 295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, - 295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, - 295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, - 456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,297,295,295,295,295, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295,295, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295,295, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295,295, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295,295, - 376,376,376,376,377,0,0,0,0,0,0,375,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,337,295,295,295,295, - 295,295,295,295,417,0,0,0,0,0,0,415,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, - 295,295,295,295,417,0,0,0,0,0,0,455,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,297,295,295,295,295, - 295,295,295,295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295,295, - 295,295,295,295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295,295, - 295,295,295,295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295,295, - 295,295,295,295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295,295, - 295,295,295,295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295,295, - 295,295,295,295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295,295, - 295,295,295,295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295,295, - 295,295,295,295,417,0,0,0,0,0,0,375,376,376,377,0,0,0,0,375,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,337,295,295,295,295, - 295,295,295,295,417,0,0,0,0,0,0,415,295,295,417,0,0,0,0,415,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, - 295,295,295,295,417,0,0,0,0,0,0,455,456,456,457,0,0,0,0,455,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456, - 295,295,295,295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 295,295,295,295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 295,295,295,295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 295,295,295,295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 295,295,295,295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 295,295,295,295,336,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376, - 295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, - 295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, - 295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, - }; - - obj.createentity(96, 48, 25, 0, 1); // Trophy - obj.createentity(128, 48, 25, 0, 2); // Trophy - obj.createentity(160, 48, 25, 0, 3); // Trophy - obj.createentity(192, 48, 25, 0, 4); // Trophy - obj.createentity(224, 48, 25, 0, 5); // Trophy - obj.createentity(256, 48, 25, 0, 6); // Trophy - - obj.createentity(96, 88, 25, 1, 13); // Trophy - obj.createentity(128, 88, 25, 1, 14); // Trophy - obj.createentity(160, 88, 25, 1, 15); // Trophy - obj.createentity(192, 88, 25, 1, 16); // Trophy - obj.createentity(224, 88, 25, 1, 17); // Trophy - obj.createentity(256, 88, 25, 1, 18); // Trophy - - obj.createentity(96, 128, 25, 0, 7); // Trophy - obj.createentity(96, 168, 25, 1, 8); // Trophy - - obj.createentity(160, 128, 25, 0, 12); // Trophy - obj.createentity(192, 128, 25, 0, 11); // Trophy - obj.createentity(224, 128, 25, 0, 10); // Trophy - obj.createentity(256, 128, 25, 0, 9); // Trophy - hiddenname = "Secret Lab"; - result = contents; - break; - } - - case rn(16,5): - { - - static const short contents[] = { - 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, - 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, - 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, - 283,283,283,284,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444, - 283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,363,364,364,364, - 283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,283,283, - 283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,283,283, - 283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,283,283, - 283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,283,283, - 283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,283,283, - 283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,283,283, - 283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,283,283, - 283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,283,283, - 283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,283,283, - 283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,283,283, - 283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,283,283, - 283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,283,283, - 283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,283,283, - 283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,283,283, - 283,283,283,405,0,0,0,0,0,0,0,0,0,0,363,364,364,364,364,364,364,364,364,364,364,365,0,0,0,0,0,0,0,0,0,0,403,283,283,283, - 283,283,283,405,0,0,0,0,0,0,0,0,0,0,403,283,283,283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,0,0,0,0,403,283,283,283, - 283,283,283,405,0,0,0,0,0,0,0,0,0,0,403,283,283,283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,0,0,0,0,403,283,283,283, - 283,283,283,324,364,364,364,364,364,364,364,364,364,364,325,283,283,283,283,283,283,283,283,283,283,324,364,364,364,364,364,364,364,364,364,364,325,283,283,283, - 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, - 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, - 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, - }; - - obj.createentity(152, 168, 25, 0, 20); // Trophy placeholder - obj.createentity(152, 168, 25, 0, 19); // Trophy - hiddenname = "Secret Lab"; - result = contents; - break; - } - - case rn(19,6): - { - - static const short contents[] = { - 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, - 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, - 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, - 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, - 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, - 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, - 289,289,289,290,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,291,289,289,289, - 289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289, - 289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289, - 289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289, - 289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289, - 289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289, - 289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289, - 289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289, - 289,289,289,411,0,0,0,0,0,0,369,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,371,0,0,0,0,0,0,409,289,289,289, - 289,289,289,411,0,0,0,0,0,0,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,0,0,0,0,0,0,409,289,289,289, - 450,450,450,451,0,0,0,0,0,0,449,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,451,0,0,0,0,0,0,409,289,289,289, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289, - 370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,371,0,0,0,0,0,0,409,289,289,289, - 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,0,0,0,0,0,0,409,289,289,289, - 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,0,0,0,0,0,0,409,289,289,289, - 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,0,0,0,0,0,0,409,289,289,289, - 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,0,0,0,0,0,0,409,289,289,289, - 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,0,0,0,0,0,0,409,289,289,289, - }; - - obj.createentity(216, 176, 21, 1); //Terminal - obj.createentity(192, 176, 21, 1); //Terminal - obj.createentity(168, 176, 21, 1); //Terminal - obj.createentity(144, 176, 21, 1); //Terminal - obj.createentity(88, 96, 21, 1); //Terminal - obj.createentity(112, 96, 21, 1); //Terminal - obj.createentity(136, 96, 21, 1); //Terminal - obj.createentity(160, 96, 21, 1); //Terminal - - //vertigris: - obj.createentity(100, 169, 18, 13, 0, 18); - obj.createblock(5, 100 - 16, 0, 32 + 32, 240, 4); - - //victoria: - obj.createentity(193, 89, 18, 16, 0, 18); - obj.createblock(5, 193-16, 0, 32+32, 240, 5); - hiddenname = "Secret Lab"; - result = contents; - break; - } - - - case rn(19,7): - { - - static const short contents[] = { - 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,403,283,283,283, - 283,284,444,444,444,444,444,444,444,444,444,444,444,444,444,285,283,283,283,283,283,283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,403,283,283,283, - 283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,283,283,283,283,283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,403,283,283,283, - 283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,283,283,283,283,283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,403,283,283,283, - 283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,283,283,283,283,283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,403,283,283,283, - 283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,283,283,283,283,283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,403,283,283,283, - 283,405,0,0,0,363,364,364,364,364,364,364,364,364,364,325,283,283,283,283,283,283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,403,283,283,283, - 283,405,0,0,0,403,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,403,283,283,283, - 283,405,0,0,0,403,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,403,283,283,283, - 283,405,0,0,0,403,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,403,283,283,283, - 283,405,0,0,0,403,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,403,283,283,283, - 283,405,0,0,0,403,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,403,283,283,283, - 283,405,0,0,0,403,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,403,283,283,283, - 283,405,0,0,0,403,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,403,283,283,283, - 283,405,0,0,0,443,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,445,0,0,0,0,0,0,403,283,283,283, - 283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,283,283, - 283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,283,283, - 283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,283,283, - 283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,283,283, - 283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,283,283, - 283,324,364,364,364,364,364,365,0,0,0,0,363,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,325,283,283,283, - 283,283,283,283,283,283,283,405,0,0,0,0,403,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, - 283,283,283,283,283,283,283,405,0,0,0,0,403,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, - 283,283,283,283,283,283,283,405,0,0,0,0,403,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, - 283,283,283,283,283,283,283,405,0,0,0,0,403,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, - 283,283,283,283,283,283,283,405,0,0,0,0,403,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, - 283,283,283,283,283,283,283,405,0,0,0,0,403,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, - 283,283,283,283,283,283,283,324,364,364,364,364,325,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, - 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, - 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, - }; - - obj.createentity(72, 192, 13); // (shiny trinket) - obj.createentity(112, 144, 20, 1); // (terminal) - obj.createblock(5, 112 - 4, 144, 20, 16, 21); - - //vermilion - obj.createentity(186, 137, 18, 15, 0, 18); - obj.createblock(5, 186 - 32, 0, 32 + 32 + 32, 240, 3); - - //naughty corner! - obj.createblock(1, 30, 0, 20, 50, 15); - obj.createblock(1, 90, 0, 20, 50, 16); - hiddenname = "Secret Lab"; - result = contents; - break; - } - - - case rn(19, 8): - { - //The SUPER GRAVITRON - - static const short contents[] = { - 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, - 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, - 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, - 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, - 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, - 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, - 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, - 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, - 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, - 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, - 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, - 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, - }; - - obj.createentity(-8, 84-32, 11, 328+8); // (horizontal gravity line) - obj.createentity(-8, 148 + 32, 11, 328+8); // (horizontal gravity line) - obj.createblock(1, -10, 84 - 16, 340, 32, 9); //start the game - hiddenname = "The Super Gravitron"; - result = contents; - break; - } + case rn(0,0): + { + + static const short contents[] = { + 201,201,201,201,200,80,80,202,200,80,80,80,80,80,80,80,80,80,80,80,80,80,202,200,80,202,201,201,201,201,200,80,202,606,486,486,486,486,486,486, + 201,201,201,201,200,80,80,202,200,80,80,80,80,80,80,80,80,80,80,80,80,80,202,200,80,202,201,201,201,201,200,80,202,606,486,486,486,486,486,486, + 201,201,201,201,200,80,80,202,240,241,241,241,241,241,241,241,241,241,241,241,241,241,242,200,80,202,201,201,201,201,200,80,202,606,486,486,486,486,486,486, + 201,201,201,201,200,80,80,202,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,80,202,201,201,201,201,200,80,202,606,486,486,486,486,486,486, + 201,201,201,201,200,80,80,202,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,80,202,201,201,201,201,200,80,202,606,486,486,486,486,486,486, + 201,201,201,201,240,241,241,242,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,80,202,201,201,201,201,200,80,202,606,486,486,486,486,486,486, + 201,201,201,201,160,161,162,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,80,121,161,161,161,161,122,80,202,606,486,486,486,486,486,486, + 201,201,201,201,200,80,202,687,687,687,687,687,687,687,687,687,687,687,687,687,687,687,687,200,80,80,80,80,80,80,80,80,202,606,486,486,486,486,486,486, + 201,201,201,201,200,80,202,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,240,241,241,241,241,241,241,241,241,242,606,486,486,486,486,486,486, + 201,201,201,201,200,80,202,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,686,0,0,160,162,606,486,486,486,486,486,486, + 201,201,201,201,200,80,202,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,686,0,0,240,242,606,486,486,486,486,486,486, + 201,201,201,201,200,80,202,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,686,0,0,0,0,606,486,486,486,486,486,486, + 201,201,201,201,200,80,202,687,687,687,687,687,687,687,687,687,687,687,687,687,687,687,687,687,688,687,687,687,688,687,687,687,687,606,486,486,486,486,486,486, + 201,201,201,201,240,241,242,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,686,0,0,0,0,606,486,486,486,486,486,486, + 201,201,201,201,160,161,161,162,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,686,0,0,0,0,606,486,486,486,486,486,486, + 201,201,201,201,200,80,80,202,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,686,0,0,0,0,606,486,486,486,486,486,486, + 201,201,201,201,200,80,80,202,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,686,0,0,0,0,606,486,486,486,486,486,486, + 201,201,201,201,200,80,80,202,160,161,161,161,161,161,161,161,161,161,161,161,161,161,162,0,686,0,0,0,686,0,0,0,0,606,486,486,486,486,486,486, + 201,201,201,201,200,80,80,202,200,80,80,80,80,80,80,80,80,80,80,80,80,80,202,0,686,0,0,0,686,0,0,0,0,606,486,486,486,486,486,486, + 201,201,201,201,200,80,80,202,200,80,80,80,80,80,80,80,80,80,80,80,80,80,202,160,161,162,0,0,686,0,0,0,0,606,486,486,486,486,486,486, + 161,161,161,162,200,80,80,202,200,80,80,80,80,80,80,80,80,80,80,80,80,80,202,200,80,202,160,161,161,162,0,0,0,606,486,486,486,486,486,486, + 80,80,80,202,200,80,80,202,200,80,80,80,80,80,80,80,80,80,80,80,80,80,202,200,80,202,240,241,241,242,0,0,0,606,486,486,486,486,486,486, + 241,241,241,242,240,241,241,242,240,241,241,241,241,241,241,241,241,241,241,241,241,241,242,240,241,242,0,0,0,0,0,0,0,606,486,486,486,486,486,486, + 567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,568,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,487,647,647,647,647,647,647,648,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486, + }; + + obj.createentity(72, 32, 14); //Teleporter! + obj.createentity(216, 144, 20, 1); + + obj.createblock(5, 216-4, 144, 20, 16, 8); + result = contents; + break; + } + + case rn(0,1): + { + + static const short contents[] = { + 495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,536,577,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,575,537,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,575,537,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,617,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,615,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,536,577,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,536,577,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,617,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,615,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,496,657,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,655,497,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,496,657,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,496,657,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,655,497,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495, + }; + result = contents; + break; + } + + case rn(0,2): + { + + static const short contents[] = { + 492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,572,534,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,533,574,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,572,534,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,572,534,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,533,574,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,572,534,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,572,573,573,573,573,534,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,572,573,573,573,534,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,533,574,0,0,0,0,0,572,573,534,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,533,574,693,693,693,693,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,652,653,653,653,494,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,692,0,0,652,653,653,494,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,533,574,0,0,0,0,692,0,0,0,0,0,652,494,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,692,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,692,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,533,573,573,574,0,692,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,533,573,573,574,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,533,574,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,693,693,693,693,612,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,572,534,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + }; + result = contents; + break; + } + + case rn(0,3): + { + + static const short contents[] = { + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,681,681,681,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,681,681,681,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,481,641,641,642,0,0,0,640,482,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,481,641,641,641,642,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,481,641,641,641,641,642,0,0,0,0,0,0,0,0,0,0,0,640,641,641,482,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,640,641,641,482,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,481,642,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,640,641,641,641,641,641,641,641, + 480,480,480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 480,480,480,480,480,480,480,481,642,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 480,480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 480,480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 480,480,480,480,480,480,481,642,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 480,480,480,480,480,481,642,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + result = contents; + break; + } + + case rn(0,4): + { + + static const short contents[] = { + 495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,495,617,0,0,0,0,0,575,576,576,576,576,576,576,576,576,576,576,577,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,495,617,696,696,696,696,696,615,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,496,657,0,0,0,0,0,655,656,656,656,656,656,656,656,656,656,656,657,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,496,656,657,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 656,656,657,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + result = contents; + break; + } + + case rn(0,5): + { + + static const short contents[] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,569,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570, + 0,0,0,0,0,0,0,0,0,0,0,569,570,570,570,570,570,570,570,570,531,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 0,0,0,0,0,0,0,0,0,6,6,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 0,0,0,0,0,0,0,0,0,569,570,531,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 6,6,6,6,6,6,6,6,6,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 570,570,570,570,570,570,570,570,570,531,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + }; + result = contents; + break; + } + + case rn(0,6): + { + + static const short contents[] = { + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,481,641,641,641,641,641,641,641,641,641,641,641,641,641,641,482,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,680,0,0,680,0,0,0,0,0,600,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,680,0,0,680,0,0,0,0,0,600,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,680,0,0,680,0,0,0,0,0,600,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,680,0,0,680,0,0,0,0,0,600,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,560,561,561,561,561,562,0,0,0,0,600,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,681,681,681,681,600,480,480,480,480,602,681,681,681,681,640,641, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,600,480,480,480,480,602,0,0,0,0,0,0, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,600,480,480,480,480,602,0,0,0,0,0,0, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,681,681,681,681,600,480,480,480,480,602,0,0,0,0,0,0, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,640,641,641,641,641,642,0,0,0,0,0,0, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,680,0,0,680,0,0,0,0,0,0,0, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,680,0,0,680,0,0,0,0,0,0,0, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,680,0,0,680,0,0,0,0,0,0,0, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,680,0,0,680,0,0,0,0,0,0,0, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,521,561,561,561,561,561,561,561,561,561,562,0,0,0,0,0,0, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0, + }; + result = contents; + break; + } + + case rn(0,7): + { + + static const short contents[] = { + 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,0, + 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,0, + 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,0, + 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,0, + 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,0, + 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,0, + 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,0, + 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,0, + 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,0, + 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,0, + 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,0, + 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,0, + 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,502,662,663,0,0,0,0,0,0, + 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,502,662,662,663,0,0,0,0,0,0,0,0, + 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,502,662,662,663,0,0,0,0,0,0,0,0,0,0,0, + 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + result = contents; + break; + } + + case rn(0,8): + { + + static const short contents[] = { + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,539,580,0,0,0,0,0,0,0,0,0,0,0,0,0, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,539,580,0,0,0,0,0,0,0,0,0,0,0,0, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,539,580,699,699,699,699,699,699,699,699,699,699,699, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,539,580,0,0,0,0,0,0,0,0,0,0, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,539,580,0,0,0,0,0,0,0,0,0, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,539,580,0,0,0,0,0,0,0,0, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,539,580,0,0,0,0,0,0,0, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0, + }; + result = contents; + break; + } + + case rn(0,9): + { + + static const short contents[] = { + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0,0, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0,0, + 641,641,641,641,482,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0,0, + 0,0,0,0,640,641,641,641,641,641,641,641,641,641,641,641,641,641,641,482,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,640,641,641,482,480,480,480,480,480,480,480,480,480,521,562,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,640,482,480,480,480,480,480,480,480,480,480,521,562,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,640,482,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,640,641,482,480,480,480,480,480,480,480,602,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,640,641,641,482,480,480,480,480,602,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,640,641,641,482,480,602,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,600,480,602,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,640,641,642,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,680,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,680,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,680,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,680,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,680,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,680,0,0,0,0,0,0, + 561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + }; + + obj.createentity(152, 144, 10, 1, 9000); // (savepoint) + result = contents; + break; + } + + case rn(0,10): + { + + static const short contents[] = { + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,484,644,644,644,644,644,644,644,485,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,484,644,644,644,644,645,7,7,7,7,7,7,7,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,605,7,7,7,7,7,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,643,644,485,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,484,644,644,644, + 644,644,644,644,644,645,0,0,0,0,0,0,0,0,0,0,0,0,7,7,603,483,483,483,483,483,483,483,483,483,483,483,483,483,484,644,645,7,7,7, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,643,644,644,644,644,485,483,483,483,483,483,483,484,644,645,7,7,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,563,565,0,0,0,7,7,7,7,7,603,483,483,483,483,483,483,605,7,7,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,643,645,0,0,0,0,0,0,0,0,643,644,644,644,644,644,644,645,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,563,565,0,0,0,0,0,0,0,0,0,563,565,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,603,605,6,6,6,6,6,6,6,6,6,603,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,603,524,564,564,564,564,564,564,564,564,564,525,605,6,6,0,0,0,0,0,0,0,0,0,0,0,0,563,564,564, + 6,6,6,6,6,6,6,6,6,6,603,483,483,483,483,483,483,483,483,483,483,483,524,564,565,6,6,6,6,6,6,6,6,6,6,6,6,603,483,483, + 564,564,564,564,564,564,564,564,564,564,525,483,483,483,483,483,483,483,483,483,483,483,483,483,524,564,564,564,564,564,564,564,564,564,564,564,564,525,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + }; + + obj.createentity(224, 96, 10, 0, 10000); // (savepoint) + result = contents; + break; + } + + case rn(0,11): + { + + static const short contents[] = { + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 641,641,641,641,641,641,641,641,641,641,482,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,481,641,641,641,641,641,641,641,641,641,641,641,482,480,480,480,480,480,480, + 0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,602,0,680,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480, + 0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,481,641,641,642,0,680,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480, + 0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,602,0,0,0,0,680,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480, + 561,561,561,561,561,561,561,561,561,561,522,480,480,480,480,481,641,641,642,0,0,0,0,680,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,481,641,641,642,0,0,0,0,0,0,0,680,0,560,561,561,562,0,0,0,0,600,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,602,0,680,0,0,0,0,0,0,0,0,680,0,600,480,480,602,681,681,681,681,600,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,481,641,641,642,0,680,0,0,0,0,0,0,0,560,561,561,522,480,480,602,0,0,0,0,600,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,602,0,0,0,0,680,0,0,0,0,0,0,0,600,480,480,480,480,480,602,0,0,0,0,600,480,480,480,480,480,480, + 480,480,480,480,480,480,481,641,641,642,0,0,0,0,680,0,0,0,0,560,561,561,522,480,480,480,480,480,602,0,0,0,0,600,480,480,480,480,480,480, + 480,480,480,480,480,480,602,0,0,0,0,0,0,0,680,0,0,0,0,600,480,480,480,480,480,480,480,480,602,0,0,0,0,600,480,480,480,480,480,480, + 480,480,480,481,641,641,642,0,0,0,0,0,0,0,680,0,560,561,561,522,480,480,480,480,480,480,480,480,602,681,681,681,681,600,480,480,480,480,480,480, + 480,480,480,602,0,680,0,0,0,0,0,0,0,0,680,0,600,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,600,480,480,480,480,480,480, + 641,641,641,642,0,680,0,0,0,0,0,0,0,560,561,561,522,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,600,480,480,480,480,480,480, + 0,0,0,0,0,680,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,600,480,480,480,480,480,480, + 0,0,0,0,0,680,0,0,0,0,560,561,561,522,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,600,480,480,480,480,480,480, + 0,0,0,0,0,680,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,681,681,681,681,600,480,480,480,480,480,480, + 0,0,0,0,0,680,0,560,561,561,522,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,600,480,480,480,480,480,480, + 0,0,0,0,0,680,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,640,641,641,641,641,641,641, + 0,0,0,0,560,561,561,522,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0, + 561,561,561,561,522,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,521,561,561,561,561,561,561,561,561,561,561,561, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + }; + + obj.createentity(56, 32, 13); //Warp Token + + result = contents; + break; + } + + case rn(0,12): + { + + static const short contents[] = { + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 653,653,653,653,653,653,494,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 0,692,0,0,0,0,652,653,653,494,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 0,692,0,0,0,0,0,692,0,652,494,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 0,692,0,0,0,0,0,692,0,0,652,494,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 573,573,573,574,0,0,0,692,0,0,0,652,494,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,533,573,574,0,692,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,533,574,692,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,533,574,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,533,574,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,614,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,614,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,493,653,653,653,653,653,653,653,653,653,653,653, + 492,492,492,492,492,492,492,492,614,0,0,0,612,492,492,492,492,492,492,492,492,492,492,493,653,653,653,653,654,0,0,0,0,0,0,0,0,0,0,0, + 492,492,492,492,492,492,492,492,614,0,0,0,612,492,492,492,492,492,492,492,493,653,653,654,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0, + 492,492,492,492,492,492,492,492,614,0,0,0,652,653,494,492,492,493,653,653,654,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0, + 492,492,492,492,492,492,492,492,614,0,0,0,692,0,652,653,653,654,0,692,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0, + 492,492,492,492,492,492,492,492,614,0,0,0,692,0,0,0,0,0,0,692,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0, + 492,492,492,492,492,492,492,492,614,693,693,693,694,693,693,693,693,693,693,694,693,693,693,693,693,693,693,694,693,693,0,0,0,0,0,0,0,0,0,0, + 492,492,492,492,492,492,492,492,614,0,0,0,692,0,0,0,0,0,0,692,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0, + 492,492,492,492,492,492,493,653,654,0,0,0,692,0,0,0,0,0,0,692,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0, + 492,493,653,653,653,653,654,0,0,0,0,0,692,0,0,0,0,0,0,692,0,0,0,0,0,0,572,573,574,0,0,0,0,0,0,0,0,0,0,0, + 653,654,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,692,0,0,0,0,0,0,652,653,654,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,572,573,574,0,0,0,0,572,573,574,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,652,653,654,0,0,0,0,652,653,654,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + result = contents; + break; + } + + case rn(0,13): + { + + static const short contents[] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,563,564,565,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,643,644,645,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,563,564,565,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,643,644,645,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,563,564,565,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,643,644,645,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,563,564,565,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,643,644,645,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,563,564,565,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,605,0,0,0,0,563,564,564,564,564,564,564,564,564,564,564,564,564,564, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,563,564,564,525,483,524,564,564,564,564,525,483,483,483,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,563,564,564,564,564,564,564,564,564,564,525,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 564,564,564,564,564,564,525,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + }; + result = contents; + break; + } + + case rn(0,14): + { + + static const short contents[] = { + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,496,656,656,656, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,496,657,0,0,0, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,496,657,0,0,0,0, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0, + }; + result = contents; + break; + } + + case rn(0,15): + { + + static const short contents[] = { + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,499,660,0,0,0,0,0, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,499,660,0,0,0,0,0,0, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,499,660,0,0,0,0,0,0,0, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,499,660,0,0,0,0,0,0,0,0, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,499,660,0,0,0,0,0,0,0,0,0, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,499,659,659,659,659,660,0,0,0,0,0,0,0,0,0,0, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,499,659,659,659,659,659,660,0,0,698,0,0,0,0,0,0,0,0,0,0,0,0, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,499,659,659,660,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,0,0, + 498,498,498,498,498,498,498,498,498,498,498,499,659,659,659,660,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,0,0, + 498,498,498,498,498,498,498,498,498,499,659,660,0,0,698,0,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,0,0, + 498,498,498,498,498,498,498,498,498,620,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,0,0, + 498,498,498,498,498,498,498,498,499,660,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,0,0, + 498,498,498,498,498,498,498,498,620,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,0,0, + 498,498,498,498,498,498,498,498,620,699,699,699,699,699,700,699,699,699,699,699,699,699,699,699,699,699,699,700,699,699,699,699,699,699,699,699,699,699,699,699, + 498,498,498,498,498,498,498,498,620,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,0,0, + 498,498,498,498,498,498,498,498,620,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,0,0, + }; + result = contents; + break; + } + + case rn(0,16): + { + + static const short contents[] = { + 480,480,480,480,480,480,480,480,602,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0, + 480,480,480,480,480,480,480,481,642,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0, + 480,480,480,480,480,480,480,602,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0, + 480,480,480,480,480,480,480,602,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0, + 480,480,480,480,480,480,481,642,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0, + 480,480,480,480,480,480,602,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0, + 480,480,480,480,480,480,602,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0, + 480,480,480,480,480,480,602,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0, + 480,480,480,480,480,480,602,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0, + 480,480,480,480,480,481,642,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0, + 480,480,480,480,480,602,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0, + 480,480,480,480,481,642,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0, + 480,480,480,480,602,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0, + 480,480,480,480,602,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0, + 480,480,480,480,602,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0, + 480,480,480,480,602,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0, + 480,480,480,480,602,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,560,561,561,561,561, + 480,480,480,480,602,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,560,561,561,561,561,522,480,480,480,480, + 480,480,480,480,602,0,0,0,0,0,0,0,560,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,522,480,480,480,480,480,480,480,480,480, + 480,480,480,480,602,0,0,0,0,0,0,0,640,641,641,641,482,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,640,641,641,482,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,640,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641, + 480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,680,0,0,0,680,0,0,0,680,0,0,0,680, + 480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,680,0,0,0,680,0,0,0,680,0,0,0,680, + 480,480,480,480,521,562,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,680,0,0,0,680,0,0,0,680,0,0,0,680, + 480,480,480,480,480,521,561,561,561,562,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,680,0,0,0,680,0,0,0,680,0,0,0,680, + 480,480,480,480,480,480,480,480,480,521,561,561,561,561,562,0,0,0,0,0,0,0,0,680,0,0,0,680,0,0,0,680,0,0,0,680,0,0,0,680, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,521,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + }; + + obj.createentity(120, 40, 14); //Teleporter! + result = contents; + break; + } + + case rn(0,17): + { + + static const short contents[] = { + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 650,650,650,650,650,650,650,650,650,650,491,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 0,0,0,0,689,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 0,0,0,0,689,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 0,0,0,0,689,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 0,0,0,0,689,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 0,0,0,0,689,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 570,570,570,570,570,571,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,611,690,690,690,690,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 650,650,650,650,650,651,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 0,0,0,0,689,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 0,0,0,0,689,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 0,0,0,0,689,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 0,0,0,0,689,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 0,0,0,0,689,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 570,570,570,570,570,570,570,570,570,570,531,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + }; + result = contents; + break; + } + + case rn(1,2): + { + + static const short contents[] = { + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,496,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656, + 495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,495,495,495,617,0,0,0,0,575,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576, + 495,495,495,495,495,495,495,617,696,696,696,696,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,617,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,496,656,656,656,656,497,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,496,656,657,0,0,0,0,615,495,495,495,495,495,495,495,495,496,656,657,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,617,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,496,657,0,0,0,0,0,0,655,656,656,656,656,656,656,656,656,657,0,0,0,0,0,0,655,656,656,497,495,495,495,495,495,495,495,495, + 495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495, + 495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495, + 495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495, + 495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495, + 495,495,495,495,536,576,576,577,0,0,0,0,0,0,575,576,576,576,576,576,576,576,576,577,0,0,0,0,0,0,575,537,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,617,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,617,0,0,0,0,575,576,537,495,495,495,495,495,495,495,495,617,0,0,0,0,575,576,537,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,536,576,576,576,576,537,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,696,696,696,696,615,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,496,657,0,0,0,0,655,497,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495, + }; + result = contents; + break; + } + + case rn(1,3): + { + + static const short contents[] = { + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,490,651,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,490,651,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,490,650,651,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,490,650,651,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,490,651,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,490,650,651,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,490,650,650,651,0,0,0,0,0,0,0,0,0,0,0,0,0,0,569,531,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,490,650,651,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,490,650,650,650,651,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489, + 650,650,650,650,651,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,569,531,489,489,489,489,489,489,489,489,489,489,489, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,569,531,489,489,489,489,489,489,489,489,489,489,489,489, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,569,531,489,489,489,489,489,489,489,489,489,489,489,489,489, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,569,570,531,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,569,570,570,531,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,569,570,531,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,569,570,531,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 0,0,0,0,0,0,0,0,0,569,570,570,570,570,570,570,531,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 0,0,0,0,0,0,569,570,570,531,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + }; + result = contents; + break; + } + + case rn(1,4): + { + + static const short contents[] = { + 0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,643,485,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,643,485,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,643,485,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,643,485,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,643,644,485,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,643,644,485,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,643,644,485,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,643,644,485,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,643,644,485,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,643,485,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,563,564,564,564,525,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,563,564,525,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + }; + + obj.createentity(144, 136, 10, 1, 4010); // (savepoint) + result = contents; + break; + } + + case rn(1,5): + { + + static const short contents[] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,640,482,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,640,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,482,480,480,480, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,640,641,641,641, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0, + 561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,562,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,521,561,561,561,562,0,0,0,0,0,680,0,0,0,0,0,0,0,0, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,521,561,561,561,562,0,680,0,0,0,0,0,0,0,0, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,521,561,561,561,562,0,0,0,0,0,0, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,521,561,561,561,561,561,561, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + }; + + obj.createentity(88, 104, 10, 1, 106010); // (savepoint) + result = contents; + break; + } + + case rn(1,6): + { + + static const short contents[] = { + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,490,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,491,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,490,650,651,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,689,0,0,0,649,650,650,491,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,611,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,649,650,491,489,489,489,489,489,489,489,489,489, + 489,489,489,611,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,649,650,650,491,489,489,489,489,489,489, + 489,489,489,611,0,0,0,0,0,569,570,570,570,570,570,570,570,571,0,0,0,689,0,0,0,0,0,0,0,0,0,689,0,649,650,650,491,489,489,489, + 489,489,489,611,0,0,0,569,570,531,489,489,489,489,489,489,489,530,570,571,0,689,0,0,0,0,0,0,0,0,0,689,0,0,0,0,649,650,650,650, + 489,489,489,611,690,690,690,609,489,489,489,489,489,489,489,489,489,489,489,530,570,570,571,0,0,0,0,0,0,0,0,689,0,0,0,0,0,689,0,0, + 650,650,650,651,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,530,571,0,0,0,0,0,0,0,689,0,0,0,0,0,689,0,0, + 0,0,0,0,0,0,0,649,650,650,650,491,489,489,489,489,489,489,489,489,489,489,489,530,570,571,0,0,0,0,0,689,0,0,0,0,0,689,0,0, + 0,0,0,0,0,0,0,0,689,0,0,649,650,491,489,489,489,489,489,489,489,489,489,489,489,530,570,570,571,0,0,689,0,0,0,0,0,689,0,0, + 0,0,0,0,0,0,0,0,689,0,0,0,0,649,650,650,491,489,489,489,489,489,489,489,489,489,489,489,530,570,570,570,570,570,570,570,570,570,570,570, + 0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,649,650,491,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,649,650,650,491,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,649,650,650,491,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,649,650,650,491,489,489,489,489,489,489,489,489,489,489,489,489, + 0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,649,650,650,491,489,489,489,489,489,489,489,489,489, + 0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,649,650,491,489,489,489,489,489,489,489, + 0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,649,650,650,650,650,650,650,650, + 0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,569,570,570,570,571,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,649,650,650,650,651,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + result = contents; + break; + } + + case rn(1,8): + { + + static const short contents[] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,572,573,573,573,573,574,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 693,693,693,693,693,693,693,693,693,693,693,693,693,693,693,693,693,693,612,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,652,653,653,653,653,654,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + result = contents; + break; + } + + case rn(1,9): + { + + static const short contents[] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,563,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,565,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,643,644,644,644,644,644,644,644,644,644,485,483,483,484,644,644,644,644,645,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,643,644,644,645,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,684,685,684,684,684,684,684,684,684,684,684,684,684,684,684,684,684, + 0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,196,197,197,197,197,198,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,236,116,116,116,116,238,0,0,0,0,0,0,0,0,0,0,0,0,0, + 564,564,564,564,564,564,564,564,564,564,564,564,565,0,0,0,0,0,0,563,565,236,116,116,116,116,238,0,0,0,0,0,0,0,0,0,0,0,0,0, + 483,483,483,483,483,483,483,483,483,483,483,483,524,564,565,0,0,563,564,525,605,236,116,116,116,116,238,0,0,0,0,0,0,0,0,0,0,0,0,0, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,524,564,564,525,483,483,605,236,116,116,116,116,157,197,198,0,0,0,0,0,0,0,0,0,0,0, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,236,116,116,116,116,116,116,238,0,0,0,0,0,0,0,0,0,0,0, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,236,116,116,116,116,116,116,157,197,198,0,0,0,0,0,0,0,0,0, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,236,116,116,116,116,116,116,116,116,238,0,0,0,0,0,0,0,0,0, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,276,277,118,116,116,116,116,116,116,157,197,197,197,197,197,197,197,197,197, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,524,564,565,236,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,236,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,236,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, + }; + + obj.createentity(152, 64, 10, 0, 9010); // (savepoint) + result = contents; + break; + } + + case rn(1,10): + { + + static const short contents[] = { + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 653,653,653,653,653,653,653,494,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 7,7,7,7,7,7,7,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 0,0,0,0,0,0,0,652,653,653,653,653,653,494,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 0,0,0,0,0,0,0,0,692,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 0,0,0,0,0,0,0,0,692,0,0,0,0,652,653,653,653,494,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 0,0,0,0,0,0,0,0,692,0,0,0,0,0,692,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 0,0,0,0,0,0,0,0,692,0,0,0,0,0,692,0,0,652,653,653,653,653,653,653,653,653,653,653,653,653,494,492,492,492,492,492,492,492,492,492, + 0,0,0,0,0,0,0,0,692,0,0,0,0,0,692,0,0,0,0,0,692,0,0,0,692,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492, + 0,0,0,0,0,0,0,0,692,0,0,0,0,0,692,0,0,0,0,0,692,0,0,0,692,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492, + 0,0,0,0,0,0,0,0,692,0,0,0,0,0,692,0,0,0,0,0,692,0,0,0,692,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492, + 0,0,0,0,0,0,0,0,692,0,0,0,0,0,692,0,0,0,0,0,692,0,0,0,692,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492, + 0,0,0,0,0,0,0,0,692,0,0,0,0,0,692,0,0,0,0,0,692,0,0,0,572,573,573,573,573,573,534,492,492,492,492,492,492,492,492,492, + 0,0,0,0,0,0,0,0,692,0,0,0,0,0,692,0,0,0,0,0,692,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 0,0,0,0,0,0,0,0,692,0,0,0,0,0,692,0,572,573,573,573,573,573,573,573,534,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 0,0,0,0,0,0,0,0,692,0,0,0,0,0,692,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 0,0,0,0,0,0,0,0,692,0,0,0,0,0,572,573,534,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 0,0,0,0,0,0,0,0,692,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 573,573,573,573,573,573,573,573,573,573,573,573,573,573,534,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + }; + + obj.createentity(208, 120, 9, 15); // (shiny trinket) + result = contents; + break; + } + + case rn(1,11): + { + + static const short contents[] = { + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,493,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,494,492,493,653,653,653,653,494,492,492, + 492,492,614,0,0,0,0,0,0,0,0,692,0,0,0,0,692,0,0,0,0,692,0,0,0,0,692,0,0,0,612,492,614,0,0,0,0,612,492,492, + 492,492,614,0,0,0,0,0,0,0,0,692,0,0,0,0,692,0,0,0,0,692,0,0,0,0,692,0,0,0,612,492,614,0,0,0,0,612,492,492, + 492,492,614,0,0,0,0,0,0,0,0,692,0,0,0,0,692,0,0,0,0,692,0,0,0,0,692,0,0,0,612,492,614,0,0,0,0,612,492,492, + 492,492,614,0,0,0,0,0,0,0,0,692,0,0,0,0,692,0,0,0,0,692,0,0,0,0,692,0,0,0,612,492,614,0,0,0,0,612,492,492, + 492,492,614,0,0,0,0,572,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,534,492,614,0,0,0,0,612,492,492, + 492,492,614,693,693,693,693,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,693,693,693,693,612,492,492, + 492,492,614,0,0,0,0,612,492,492,493,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,654,0,0,0,0,612,492,492, + 492,492,614,0,0,0,0,612,492,492,614,0,0,0,0,692,0,0,0,0,692,0,0,0,0,692,0,0,0,0,692,0,0,0,0,0,0,612,492,492, + 492,492,614,0,0,0,0,612,492,492,614,0,0,0,0,692,0,0,0,0,692,0,0,0,0,692,0,0,0,0,692,0,0,0,0,0,0,612,492,492, + 492,492,614,0,0,0,0,612,492,492,614,0,0,0,0,692,0,0,0,0,692,0,0,0,0,692,0,0,0,0,692,0,0,0,0,0,0,612,492,492, + 492,492,614,0,0,0,0,612,492,492,614,0,0,0,0,692,0,0,0,0,692,0,0,0,0,692,0,0,0,0,692,0,0,0,0,0,0,612,492,492, + 492,492,614,0,0,0,0,612,492,492,533,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,534,492,492, + 492,492,614,693,693,693,693,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,614,0,0,0,0,652,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,494,492,493,653,653,653,653,653,653,653,653,653,653,494,492,492, + 492,492,614,0,0,0,0,0,0,692,0,0,0,0,692,0,0,0,0,692,0,0,0,0,612,492,614,0,0,0,0,692,0,0,0,0,0,612,492,492, + 492,492,614,0,0,0,0,0,0,692,0,0,0,0,692,0,0,0,0,692,0,0,0,0,612,492,614,0,0,0,0,692,0,0,0,0,0,612,492,492, + 492,492,614,0,0,0,0,0,0,692,0,0,0,0,692,0,0,0,0,692,0,0,0,0,612,492,614,0,0,0,0,692,0,0,0,0,0,612,492,492, + 492,492,614,0,0,0,0,0,0,692,0,0,0,0,692,0,0,0,0,692,0,0,0,0,612,492,614,0,0,0,0,692,0,0,0,0,0,612,492,492, + 492,492,533,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,534,492,533,573,573,573,573,573,574,0,0,0,0,612,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,693,693,693,693,612,492,492, + 653,653,653,653,653,653,653,653,494,492,493,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,654,0,0,0,0,612,492,492, + 0,0,0,692,0,0,0,0,612,492,614,0,0,0,0,0,0,692,0,0,0,0,0,692,0,0,0,0,0,692,0,0,0,0,0,0,0,612,492,492, + 0,0,0,692,0,0,0,0,612,492,614,0,0,0,0,0,0,692,0,0,0,0,0,692,0,0,0,0,0,692,0,0,0,0,0,0,0,612,492,492, + 0,0,0,692,0,0,0,0,612,492,614,0,0,0,0,0,0,692,0,0,0,0,0,692,0,0,0,0,0,692,0,0,0,0,0,0,0,612,492,492, + 0,0,0,692,0,0,0,0,612,492,614,0,0,0,0,0,0,692,0,0,0,0,0,692,0,0,0,0,0,692,0,0,0,0,0,0,0,612,492,492, + 573,573,573,573,573,573,573,573,534,492,533,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,534,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + }; + + obj.createentity(40, 192, 13); //Warp Token + obj.createentity(168, 136, 13); //Warp Token + obj.createentity(224, 136, 13); //Warp Token + + + + obj.createentity(96, 80, 13); //Warp Token + + result = contents; + break; + } + + case rn(1,12): + { + + static const short contents[] = { + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,230,110,110,110,110,110,110, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,270,271,271,271,271,271,271, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,530,570,570,570,570,570,570,570, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,491,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,649,650,650,650,650,650,491,489,489,489,489,489,489,489,489,489,489,489, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,649,650,650,650,650,650,491,489,489,489,489,489, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,649,650,650,650,650,650, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,569,570,570,570,570,570,570,570,570,570,570,570,570,571,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,649,650,650,650,650,650,650,650,650,650,650,650,650,651,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + result = contents; + break; + } + + case rn(1,13): + { + + static const short contents[] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,560,561,562,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,560,522,480,521,562,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,640,482,480,481,642,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,640,641,642,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,560,561,561,561,561,561,561,561,561,561,561,561,561,561,562,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 561,561,561,561,561,561,561,561,522,480,480,480,480,480,480,480,480,480,480,480,480,480,521,561,561,561,561,561,561,562,0,0,0,0,0,0,0,0,0,0, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,521,561,561,561,561,561,561,561,561,561,561, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + }; + + obj.createentity(112, 152, 10, 1, 13010); // (savepoint) + result = contents; + break; + } + + case rn(1,14): + { + + static const short contents[] = { + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 644,644,644,644,644,644,644,485,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,643,644,644,644,644,644,644,644,644,485,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,643,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644, + 0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,563,564,564,564,564, + 0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,563,564,525,483,483,483,483, + 0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,563,525,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,563,525,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483, + }; + result = contents; + break; + } + + case rn(1,15): + { + + static const short contents[] = { + 0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492, + 0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492, + 0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492, + 0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492, + 0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492, + 0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492, + 0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492, + 0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492, + 0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492, + 0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,572,534,492,492,492,492,492,492,492,492, + 0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492, + 0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492, + 0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492, + 0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492, + 0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,572,534,492,492,492,492,492,492,492,492,492, + 0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492, + 0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492, + 0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,572,534,492,492,492,492,492,492,492,492,492,492, + 0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492, + 0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492, + 0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492, + 0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492, + 0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,572,534,492,492,492,492,492,492,492,492,492,492,492, + 0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492, + 0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492, + 0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492, + 0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,572,534,492,492,492,492,492,492,492,492,492,492,492,492, + 693,693,693,693,693,693,693,693,693,694,693,693,693,693,693,693,693,693,693,693,693,693,693,693,693,693,612,492,492,492,492,492,492,492,492,492,492,492,492,492, + 0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492, + 0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492, + }; + result = contents; + break; + } + + case rn(1,16): + { + + static const short contents[] = { + 0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495, + 0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495, + 0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495, + 0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,496,656,656,656,656,656,656,656,656,656,656,656, + 0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,617,375,376,376,376,376,376,376,376,376,376,376, + 0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,617,415,295,295,295,295,295,295,295,295,295,295, + 0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,575,576,576,537,495,617,415,295,295,295,295,295,295,295,295,295,295, + 0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,617,415,295,295,295,295,295,295,295,295,295,295, + 0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,617,415,295,295,295,295,295,295,295,295,295,295, + 0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,575,576,537,495,495,495,495,617,415,295,295,295,295,295,295,295,295,295,295, + 0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,617,455,456,456,456,456,456,456,456,456,456,456, + 0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,575,576,576,537,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,695,0,0,0,575,576,576,576,576,537,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,575,576,576,576,576,576,537,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0, + 0,0,575,576,576,576,576,537,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0, + 576,576,537,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,375,376,376,376,376,376, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,415,295,295,295,295,295, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,496,656,656,657,0,0,0,0,0,415,295,295,295,295,295, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,496,656,656,656,656,657,0,695,0,0,0,0,0,0,415,295,295,295,295,295, + 656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,657,0,0,695,0,0,0,695,0,0,0,0,0,0,415,295,295,295,295,295, + 0,0,0,695,0,0,0,695,0,0,0,695,0,0,0,695,0,0,0,695,0,0,0,695,0,0,0,695,0,0,0,0,0,0,415,295,295,295,295,295, + 0,0,0,695,0,0,0,695,0,0,0,695,0,0,0,695,0,0,0,695,0,0,0,695,0,0,0,695,0,0,0,0,0,0,415,295,295,295,295,295, + 0,0,0,695,0,0,0,695,0,0,0,695,0,0,0,695,0,0,0,695,0,0,0,695,0,0,0,695,0,0,0,0,0,0,415,295,295,295,295,295, + 0,0,0,695,0,0,0,695,0,0,0,695,0,0,0,695,0,0,0,695,0,0,0,695,0,0,0,695,0,0,0,0,0,0,415,295,295,295,295,295, + 0,0,0,695,0,0,0,695,0,0,0,695,0,0,0,695,0,0,0,695,0,0,0,695,0,0,0,695,0,0,0,0,0,0,415,295,295,295,295,295, + 576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,577,415,295,295,295,295,295, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,415,295,295,295,295,295, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,415,295,295,295,295,295, + }; + + obj.createentity(280, 120, 10, 1, 16010); // (savepoint) + result = contents; + break; + } + + case rn(2,2): + { + + static const short contents[] = { + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,485,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,683,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,50,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,683,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,50,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,683,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,50,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,683,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,50,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,565,0,0,0,0,0,0,50,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,50,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,484,644,645,0,0,0,0,0,0,50,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,49,0,0,0,0,0,0,50,563,525,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,49,0,0,0,0,0,0,50,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,484,645,49,0,0,0,0,0,0,50,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,605,49,0,0,0,0,0,0,50,563,525,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,605,49,0,0,0,0,0,0,50,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,484,645,49,0,0,0,0,0,0,50,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,605,49,0,0,0,0,0,0,50,563,525,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,605,49,0,0,0,0,0,0,50,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,484,645,49,0,0,0,0,0,0,50,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,605,49,0,0,0,0,0,0,50,563,525,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,605,49,0,0,0,0,0,0,50,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,484,645,49,0,0,0,0,0,0,50,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,605,49,0,0,0,0,0,0,50,563,525,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,605,49,0,0,0,0,0,0,50,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,484,645,49,0,0,0,0,0,0,50,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,605,49,0,0,0,0,0,0,50,563,525,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,605,49,0,0,0,0,0,0,50,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,605,49,0,0,0,0,0,0,50,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,605,49,0,0,0,0,0,0,50,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,605,49,0,0,0,0,0,0,50,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,605,49,0,0,0,0,0,0,50,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + }; + + obj.createentity(56, 32, 10, 1, 2020); // (savepoint) + result = contents; + break; + } + + case rn(2,3): + { + + static const short contents[] = { + 489,489,489,489,489,489,489,489,489,611,49,0,0,0,0,0,0,50,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,611,49,0,0,0,0,0,0,50,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,611,49,0,0,0,0,0,0,50,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,611,49,0,0,0,0,0,0,50,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,611,49,0,0,0,0,0,0,50,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,611,49,0,0,0,0,0,0,50,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,611,49,0,0,0,0,0,0,50,649,491,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,530,571,49,0,0,0,0,0,0,50,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,611,49,0,0,0,0,0,0,50,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,611,49,0,0,0,0,0,0,50,649,491,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,530,571,49,0,0,0,0,0,0,50,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,611,49,0,0,0,0,0,0,50,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,611,49,0,0,0,0,0,0,50,649,491,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,530,571,49,0,0,0,0,0,0,50,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,611,49,0,0,0,0,0,0,50,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,611,49,0,0,0,0,0,0,50,649,491,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,530,571,49,0,0,0,0,0,0,50,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,611,49,0,0,0,0,0,0,50,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,611,49,0,0,0,0,0,0,50,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,530,571,49,0,0,0,0,0,569,531,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,49,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,49,0,0,0,0,0,649,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,530,571,49,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,689,0,0,0,0,0, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,49,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,689,0,0,0,0,0, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,49,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,689,0,0,0,0,0, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,49,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,689,0,0,0,0,0, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,530,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + }; + result = contents; + break; + } + + case rn(2,5): + { + + static const short contents[] = { + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 644,644,644,644,644,644,644,644,644,644,485,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,643,644,644,485,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,484,644,644,644,644,644,644,644,644,644,644, + 0,0,0,0,0,0,0,0,0,0,0,0,0,643,644,485,483,483,483,483,483,483,483,483,484,644,644,644,644,645,0,683,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,643,644,644,644,644,644,644,644,644,645,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,683,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,683,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,683,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,683,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,683,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,683,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0, + 564,564,564,564,565,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,683,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0, + 483,483,483,483,524,564,564,565,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,683,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0, + 483,483,483,483,483,483,483,524,564,565,0,0,0,0,0,0,683,0,0,0,0,0,0,0,683,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0, + 483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,563,564,565,0,0,0,0,0,0,683,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0, + 483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,643,644,645,0,0,0,0,0,563,564,564,564,564,564,564,564,564,565,0,0,0,0,0,0,0, + 483,483,483,483,483,483,483,483,483,524,565,0,0,0,0,0,0,0,0,0,0,0,0,643,644,644,644,644,644,644,644,644,645,0,0,0,0,0,0,0, + 483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + result = contents; + break; + } + + case rn(2,6): + { + + static const short contents[] = { + 486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 647,647,647,647,647,647,647,647,647,647,648,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,686,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,686,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,686,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,686,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 567,567,567,567,567,567,567,567,567,568,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 486,486,486,486,486,486,486,486,486,608,687,687,687,687,687,687,687,687,687,687,687,687,687,687,687,687,687,687,687,687,687,687,687,687,687,687,687,687,687,687, + 486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 486,486,486,486,486,486,486,486,487,648,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 486,486,486,486,486,486,487,647,648,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 486,486,486,487,647,647,648,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 647,647,647,648,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + obj.createentity(40, 88, 10, 1, 6020); // (savepoint) + result = contents; + break; + } + + case rn(2,8): + { + + static const short contents[] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,575,576,577,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,655,656,657,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0, + }; + result = contents; + break; + } + + case rn(2,9): + { + + static const short contents[] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,560,561,561,561,561,561,561,561,562,0,0,0,680,0,0,0,0,0,0,0,0, + 681,681,681,681,681,681,681,681,681,681,681,681,681,681,681,681,681,681,681,600,480,480,480,480,480,480,480,521,561,561,561,561,562,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,640,641,641,641,641,641,641,641,641,641,641,641,641,642,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,193,194,195,0,0,0,193,194,195,0,0,0,193,194,195,0,0,0,193,194,194, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,233,113,235,0,0,0,233,113,235,0,0,0,233,113,154,194,194,194,155,113,113, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,233,113,235,0,0,0,233,113,154,194,194,194,155,113,113,113,113,113,113,113,113, + 194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,155,113,154,194,194,194,155,113,113,113,113,113,113,113,113,113,113,113,113,113,113, + 113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113, + 113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113, + 113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113, + }; + result = contents; + break; + } + + case rn(2, 10): + if(obj.altstates==0) + { + + static const short contents[] = { + 113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113, + 113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113, + 113,113,113,114,274,274,274,274,274,274,274,274,274,274,274,274,274,274,274,274,274,274,274,274,274,274,274,274,274,274,115,113,113,113,113,113,113,113,113,113, + 113,113,113,235,778,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,233,113,113,113,113,113,113,113,113,113, + 113,113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,233,113,113,113,114,274,274,274,274,274, + 113,113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,233,113,113,113,235,753,753,753,753,753, + 113,113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,233,113,113,113,235,753,753,753,753,753, + 113,113,113,154,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,195,0,0,0,0,0,0,0,0,0,273,274,274,274,275,753,753,753,753,753, + 113,113,113,114,274,274,274,274,274,274,274,274,274,274,274,274,274,274,274,274,275,0,0,0,0,0,0,0,0,0,0,0,873,753,753,753,753,753,753,753, + 113,113,113,235,778,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,873,753,753,753,753,753,753,753, + 113,113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,873,753,753,753,753,753,753,753, + 113,113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,873,753,753,753,753,753,753,753, + 113,113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,873,753,753,753,753,753,753,753, + 113,113,113,154,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,195,0,0,0,0,0,0,0,0,873,753,753,753,753,753,753,753, + 113,113,113,114,274,274,274,274,274,274,274,274,274,274,274,274,274,274,274,274,274,274,274,275,0,0,0,0,0,0,0,0,873,753,753,753,753,753,753,753, + 113,113,113,235,778,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,873,753,753,753,753,753,753,753, + 113,113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,873,753,753,753,753,753,753,753, + 113,113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,873,753,753,753,753,753,753,753, + 113,113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,873,753,753,753,753,753,753,753, + 113,113,113,154,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,195,0,0,0,0,0,873,753,753,753,753,753,753,753, + 113,113,113,114,274,274,274,274,274,274,274,274,274,274,274,274,274,274,274,274,274,274,274,274,274,274,275,0,0,0,0,0,873,753,753,753,753,753,753,753, + 113,113,113,235,778,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,873,753,753,753,753,753,753,753, + 113,113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,873,753,753,753,753,753,753,753, + 113,113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,873,753,753,753,753,753,753,753, + 113,113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,873,753,753,753,753,753,753,753, + 113,113,113,154,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194, + 113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113, + 113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113, + 113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113, + 113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113, + }; + + obj.createentity(40, 32, 22, 0); // (shiny trinket) + obj.createentity(64, 32, 22, 1); // (shiny trinket) + obj.createentity(88, 32, 22, 2); // (shiny trinket) + obj.createentity(40, 80, 22, 3); // (shiny trinket) + obj.createentity(64, 80, 22, 4); // (shiny trinket) + obj.createentity(88, 80, 22, 5); // (shiny trinket) + obj.createentity(112, 80, 22, 6); // (shiny trinket) + obj.createentity(40, 128, 22, 7); // (shiny trinket) + obj.createentity(64, 128, 22, 8); // (shiny trinket) + obj.createentity(88, 128, 22, 9); // (shiny trinket) + obj.createentity(112, 128, 22, 10); // (shiny trinket) + obj.createentity(136, 128, 22, 11); // (shiny trinket) + obj.createentity(40, 176, 22, 12); // (shiny trinket) + obj.createentity(64, 176, 22, 13); // (shiny trinket) + obj.createentity(88, 176, 22, 14); // (shiny trinket) + obj.createentity(112, 176, 22, 15); // (shiny trinket) + obj.createentity(136, 176, 22, 16); // (shiny trinket) + obj.createentity(112, 32, 22, 17); // (shiny trinket) + obj.createentity(136, 80, 22, 18); // (shiny trinket) + obj.createentity(136, 32, 22, 19); // (shiny trinket) + + if(!game.nocutscenes && !obj.flags[70]) + { + obj.createblock(1, 304, 0, 16, 240, 48); + } + result = contents; + } + else + { + + static const short contents[] = { + 113,113,113,113,113,113,113,114,274,274,274,274,274,274,274,274,274,274,115,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113, + 113,113,113,113,113,114,274,275,0,0,0,0,0,0,0,0,0,0,273,274,274,274,274,274,274,274,115,113,113,113,113,113,113,113,113,113,113,113,113,113, + 113,113,113,114,274,275,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,273,274,274,274,115,113,113,113,113,113,113,113,113,113, + 113,113,113,235,778,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,233,113,113,113,113,113,113,113,113,113, + 113,113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,233,113,113,113,114,274,274,274,274,274, + 113,113,114,275,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,273,274,115,113,235,753,753,753,753,753, + 113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,233,113,235,753,753,753,753,753, + 113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,273,274,275,753,753,753,753,753, + 113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,873,753,753,753,753,753,753,753, + 113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,873,753,753,753,753,753,753,753, + 113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,873,753,753,753,753,753,753,753, + 113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,873,753,753,753,753,753,753,753, + 113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,873,753,753,753,753,753,753,753, + 113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,873,753,753,753,753,753,753,753, + 113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,873,753,753,753,753,753,753,753, + 113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,873,753,753,753,753,753,753,753, + 113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,873,753,753,753,753,753,753,753, + 113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,873,753,753,753,753,753,753,753, + 113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,873,753,753,753,753,753,753,753, + 113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,873,753,753,753,753,753,753,753, + 113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,873,753,753,753,753,753,753,753, + 113,113,154,195,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,873,753,753,753,753,753,753,753, + 113,113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,873,753,753,753,753,753,753,753, + 113,113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,873,753,753,753,753,753,753,753, + 113,113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,873,753,753,753,753,753,753,753, + 113,113,113,154,194,194,195,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,193,194,194,194,194,194,194,194,194,194,194,194,194, + 113,113,113,113,113,113,154,194,194,194,194,194,194,194,194,195,0,0,0,0,0,0,0,193,194,194,194,155,113,113,113,113,113,113,113,113,113,113,113,113, + 113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,154,194,194,194,194,194,194,194,155,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113, + 113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113, + 113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113, + }; + + obj.createentity(90, 52, 26, 0); // (super warp) + result = contents; + } + hiddenname = "The Ship"; + + break; + + case rn(2,11): + { + + static const short contents[] = { + 104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104, + 104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104, + 104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104, + 104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104, + 104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104, + 104,104,104,104,105,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265, + 104,104,104,104,226,744,866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,864,744,744,744,744,744,744,744,744,744,744,744,744,744,744,744,744,744,744, + 104,104,104,104,226,744,866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,864,744,744,745,905,746,744,745,905,746,744,745,905,746,744,745,905,746,744, + 104,104,104,104,226,744,866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,864,744,744,866,0,864,744,866,0,864,744,866,0,864,744,866,0,864,744, + 104,104,104,104,226,744,866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,864,744,744,866,0,864,744,866,0,864,744,866,0,864,744,866,0,864,744, + 104,104,104,104,226,744,866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,864,744,744,785,825,786,744,785,825,786,744,785,825,786,744,785,825,786,744, + 104,104,104,104,226,744,866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,864,744,744,744,744,744,744,744,744,744,744,744,744,744,744,744,744,744,744, + 104,104,104,104,226,744,866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,864,744,744,745,905,905,905,905,905,905,905,905,905,905,905,905,905,746,744, + 104,104,104,104,226,744,866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,864,744,744,866,0,0,0,0,0,0,0,0,0,0,0,0,0,864,744, + 104,104,104,104,226,744,866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,864,744,744,866,0,0,0,0,0,0,0,0,0,0,0,0,0,864,744, + 104,104,104,104,226,744,866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,864,744,744,785,825,825,825,825,825,825,825,825,825,825,825,825,825,786,744, + 104,104,104,104,226,744,866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,864,744,744,744,744,744,744,744,744,744,744,744,744,744,744,744,744,744,744, + 104,104,104,104,226,744,866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,864,744,744,745,905,746,744,745,905,746,744,745,905,746,744,745,905,746,744, + 104,104,104,104,226,744,866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,864,744,744,866,0,864,744,866,0,864,744,866,0,864,744,866,0,864,744, + 104,104,104,104,226,744,866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,864,744,744,866,0,864,744,866,0,864,744,866,0,864,744,866,0,864,744, + 104,104,104,104,226,744,866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,864,744,744,785,825,786,744,785,825,786,744,785,825,786,744,785,825,786,744, + 104,104,104,104,226,744,866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,864,744,744,744,744,744,744,744,744,744,744,744,744,744,744,744,744,744,744, + 104,104,104,104,145,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,186,744,744,744,744, + 104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,226,744,744,744,744, + 104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,226,744,744,744,744, + 104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,145,185,185,185,185, + 104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104, + 104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104, + 104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104, + 104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104, + }; + + obj.createentity(64, 64, 14); //Teleporter! + hiddenname = "The Ship"; + result = contents; + break; + } + + case rn(2,12): + { + + static const short contents[] = { + 104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104, + 265,265,265,265,106,105,265,265,265,265,265,265,265,106,104,105,265,265,265,265,265,265,265,106,105,265,265,265,265,265,265,265,106,104,105,265,265,265,265,265, + 567,567,567,568,224,226,566,567,567,567,567,567,568,224,105,266,566,567,567,567,567,567,568,224,226,566,567,567,567,567,567,568,264,106,226,566,567,567,567,567, + 486,486,608,184,146,266,606,486,486,486,487,647,648,224,226,566,528,486,486,486,487,647,648,224,226,606,486,486,486,486,486,527,568,224,226,606,486,486,486,486, + 486,486,608,264,266,566,528,486,486,486,608,184,185,146,266,606,486,486,486,487,648,184,185,146,266,606,486,486,486,486,487,647,648,224,226,606,486,486,486,486, + 486,486,527,567,567,528,486,486,486,486,608,264,265,266,566,528,486,486,486,608,184,146,105,266,566,528,486,486,486,486,608,184,185,146,266,606,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,527,567,567,567,528,486,486,486,486,608,264,265,266,566,528,486,486,486,486,486,608,264,265,266,566,528,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,527,567,567,567,528,486,486,486,486,486,486,527,567,567,567,528,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,487,647,647, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,487,647,648,0,0, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,487,647,647,647,647,647,647,648,0,0,0,0, + 486,486,486,486,486,486,486,486,486,486,486,487,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,648,0,0,0,0,0,686,0,0,0,0,0, + 486,486,486,486,486,486,486,486,487,647,647,648,0,0,0,0,0,0,0,0,0,686,0,0,0,0,686,0,0,0,0,0,0,0,686,0,0,0,0,0, + 486,487,647,647,647,647,647,647,648,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,686,0,0,0,0,0,0,0,686,0,0,0,0,0, + 647,648,0,0,686,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,686,0,0,0,0,0,0,0,686,0,0,0,0,0, + 0,0,0,0,686,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,686,0,0,0,0,0,0,0,686,0,0,0,0,0, + 0,0,0,0,686,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,686,0,0,0,0,0,0,0,686,0,0,0,0,0, + 0,0,0,0,686,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,686,0,0,0,0,0,0,0,686,0,0,0,0,0, + 0,0,0,0,686,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,686,0,0,0,0,0,0,0,686,0,0,0,0,0, + 0,0,0,0,686,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,686,0,0,0,0,0,0,0,686,0,0,0,0,0, + 0,0,0,0,686,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,686,0,0,0,0,0,0,0,686,0,0,0,0,0, + 0,0,0,0,686,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,566,567,567,567,567,567,567,568,0,0,0,0,0,0,686,0,0,0,0,0, + 0,0,0,566,567,567,567,567,567,568,0,0,0,0,0,0,0,0,0,0,646,647,647,647,647,647,647,648,0,0,0,0,0,566,567,568,0,0,0,0, + 0,0,0,646,647,647,647,647,647,648,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,646,647,648,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + hiddenname = "The Ship"; + result = contents; + break; + } + + case rn(2,13): + { + + static const short contents[] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,575,576,577,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,615,495,617,696,696,696,696,696,696,696,696,696,696,696,697,696,696,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,655,656,657,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,575,576,577,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,696,696,697,696,696,696,696,615,495,617,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,655,656,657,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,575,576,577,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,617,696,696,696,697,696,696,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,655,656,657,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,575,576,576,576,576,576,576,576, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495, + 0,0,0,0,0,0,0,0,0,0,0,0,575,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,537,495,495,495,495,495,495,495, + 0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 576,576,576,576,576,576,576,576,576,576,576,576,537,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + }; + result = contents; + break; + } + + case rn(2,14): + { + + static const short contents[] = { + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,488,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,646,488,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,646,488,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,568,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,527,568,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,487,648,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,566,528,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,566,528,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + }; + result = contents; + break; + } + + case rn(2,15): + { + + static const short contents[] = { + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,649,491,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,649,491,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,649,650,491,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,649,650,491,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,530,571,0,0,0,0,0,0,0,0,649,650,491,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,649,650,650,650,650,650,650,650,650,650,650,650, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,530,570,571,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,530,571,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,530,570,571,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,530,570,571,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,530,570,571,0,0,0,0,0,0,0,0,0,0,0,0,0, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,530,570,570,570,570,570,570,571,6,6,6,6,6,6, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,530,570,570,570,570,570,570, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + }; + + obj.createentity(240, 96, 10, 0, 15020); // (savepoint) + result = contents; + break; + } + + case rn(3,2): + { + + static const short contents[] = { + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,499,659,659,659,659,500,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,499,659,659,659,659,500,498,498, + 498,498,498,620,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,618,498,498, + 498,499,659,660,0,0,0,0,658,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,660,0,0,0,0,658,659,500, + 498,620,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,618, + 498,620,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,618, + 498,620,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,618, + 498,620,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,618, + 498,539,579,580,0,0,0,0,578,579,579,579,579,579,579,579,579,580,0,0,0,0,578,579,579,579,579,579,579,579,579,579,580,0,0,0,0,578,579,540, + 498,498,498,620,0,0,0,0,618,498,498,498,498,498,498,498,498,620,699,699,699,699,618,498,498,498,498,498,498,498,498,498,620,0,0,0,0,618,498,498, + 498,498,498,620,699,699,699,699,618,498,498,498,498,498,498,498,499,660,0,0,0,0,658,500,498,498,498,498,498,498,498,498,620,699,699,699,699,618,498,498, + 498,498,498,620,0,0,0,0,618,498,498,498,498,498,498,498,620,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,620,0,0,0,0,618,498,498, + 498,498,498,620,0,0,0,0,618,498,498,498,498,498,498,498,620,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,620,0,0,0,0,618,498,498, + 498,498,498,620,0,0,0,0,618,498,498,498,498,498,498,498,620,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,620,0,0,0,0,618,498,498, + 498,498,498,620,0,0,0,0,618,498,498,498,498,498,498,498,620,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,620,0,0,0,0,618,498,498, + 498,498,498,620,699,699,699,699,618,498,498,498,498,498,498,498,539,580,0,0,0,0,578,540,498,498,498,498,498,498,498,498,620,699,699,699,699,618,498,498, + 498,498,498,620,0,0,0,0,618,498,498,498,498,498,498,498,498,539,579,579,579,579,540,498,498,498,498,498,498,498,498,498,620,0,0,0,0,618,498,498, + 498,499,659,660,0,0,0,0,658,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,660,0,0,0,0,658,659,500, + 498,620,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,618, + 498,620,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,618, + 498,620,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,618, + 498,620,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,618, + 498,539,579,580,0,0,0,0,578,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,580,0,0,0,0,578,579,540, + 498,498,498,620,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,618,498,498, + 498,498,498,539,579,579,579,579,540,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,618,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,618,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,618,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,618,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,618,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,618,498,498, + }; + + obj.createentity(152, 96, 9, 16); // (shiny trinket) + result = contents; + break; + } + + case rn(3,3): + { + + static const short contents[] = { + 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,621,501,501, + 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,621,501,501, + 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,621,501,501, + 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,621,501,501, + 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,621,501,501, + 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,621,501,501, + 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,621,501,501, + 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,621,501,501, + 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,621,501,501, + 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,502,662,662,662,662,662,662,662,662,663,0,0,0,0,621,501,501, + 501,501,501,501,501,501,501,501,501,501,501,501,501,502,662,662,662,662,662,662,662,662,662,663,0,0,0,0,0,0,701,0,0,0,0,0,0,621,501,501, + 501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,701,0,0,0,0,0,0,621,501,501, + 501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,701,0,0,0,0,0,0,621,501,501, + 501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,701,0,0,0,0,0,0,621,501,501, + 501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,701,0,0,0,0,0,0,621,501,501, + 501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,701,0,0,0,0,0,0,621,501,501, + 501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,701,0,0,0,0,0,0,621,501,501, + 501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,701,0,0,0,0,0,0,621,501,501, + 501,501,501,501,501,501,501,501,501,501,501,501,502,663,0,0,0,0,0,0,0,0,0,581,582,582,582,582,582,582,582,582,582,582,582,582,582,543,501,501, + 501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,0,0,0,0,0,621,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501, + 501,501,501,501,501,501,502,662,662,662,662,662,663,702,702,702,702,702,702,702,702,702,581,543,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501, + 662,662,662,662,662,662,663,0,0,701,0,0,0,0,0,0,0,0,0,0,0,0,621,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501, + 0,0,0,0,0,0,0,0,0,701,0,0,0,0,0,0,0,0,0,0,0,0,621,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501, + 0,0,0,0,0,0,0,0,0,701,0,0,0,0,0,0,0,0,0,0,0,0,621,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501, + 0,0,0,0,0,0,0,0,0,701,0,0,0,0,0,0,0,0,0,0,0,0,621,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501, + 0,0,0,0,0,0,0,0,0,701,0,0,0,0,0,0,0,0,0,0,0,0,621,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501, + 582,582,582,582,582,582,582,582,582,582,582,582,582,582,582,582,582,582,582,582,582,582,543,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501, + 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501, + 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501, + 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501, + }; + + obj.createentity(24, 192, 10, 1, 3030); // (savepoint) + result = contents; + break; + } + + case rn(3,5): + { + + static const short contents[] = { + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,481,641,641,641,641,641,641,641,482,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,481,641,641,642,0,0,0,0,0,0,0,640,641,641,641,641,641,641,482,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,481,641,642,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,640,641,482,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,640,482,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480, + 641,641,641,641,641,641,642,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,640,641,641,641,641,641,641,641,641,641,641, + 0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,560,561,561,561,561,561,561,561,561,561,561,561,561,561,562,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,602,681,681,681,681,681,681,681,681,681,682,681,681,681,681,0,0,0,0,0, + 0,0,0,0,0,0,640,641,641,641,641,641,641,641,641,641,641,641,641,641,642,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,560,561,561,561,561,561,562,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,600,480,480,480,480,480,602,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,640,641,641,641,641,641,642,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + result = contents; + break; + } + + case rn(3,6): + { + + static const short contents[] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 693,693,693,693,693,693,693,693,693,693,693,693,693,693,693,693,693,693,693,694,693,693,693,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + result = contents; + break; + } + + case rn(3,7): + { + + static const short contents[] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,690,690,690,691,690,690,690,690,690,690,690,690,690,690,690,690,690,690,690,690,690,690,690,690, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + result = contents; + break; + } + + case rn(3,8): + { + + static const short contents[] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,566,567,568,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,566,528,486,527,568,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,566,528,486,486,486,527,568,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,566,528,486,486,486,486,486,527,568,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,646,488,486,486,486,486,486,487,648,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,646,488,486,486,486,487,648,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,646,647,647,647,648,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + result = contents; + break; + } + + case rn(3,9): + { + + static const short contents[] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,181,183,0,0,181,183,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,221,223,0,0,221,223,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,181,182,143,142,182,182,143,142,182,183,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,261,262,103,102,262,262,103,102,262,263,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,221,223,0,0,221,223,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,221,223,0,0,221,223,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,181,182,143,223,0,0,221,142,182,183,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,261,262,103,223,0,0,221,102,262,263,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,221,223,0,0,221,223,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,221,223,0,0,221,223,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,143,142,182,182,143,142,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182, + 101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101, + 101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101, + 101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101, + 101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101, + 101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101, + 101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101, + }; + + obj.createentity(248, 168, 10, 1, 9030); // (savepoint) + result = contents; + break; + } + + case rn(3,10): + { + + static const short contents[] = { + 101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101, + 101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101, + 101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101, + 101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101, + 262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262, + 741,741,741,741,741,741,741,863,0,0,0,0,0,0,0,861,741,741,741,741,741,741,741,741,863,0,0,0,0,0,0,0,861,741,741,741,741,741,741,741, + 741,741,741,741,741,741,741,863,0,0,0,0,0,0,0,861,741,742,902,902,902,902,743,741,863,0,0,0,0,0,0,0,861,741,741,741,741,741,741,741, + 741,741,741,741,741,741,741,863,0,0,0,0,0,0,0,861,741,863,0,0,0,0,861,741,863,0,0,0,0,0,0,0,861,741,741,741,741,741,741,741, + 741,741,741,741,741,741,741,863,0,0,0,0,0,0,0,861,741,863,0,0,0,0,861,741,863,0,0,0,0,0,0,0,861,741,741,741,741,741,741,741, + 741,741,741,741,741,741,741,863,0,0,0,0,0,0,0,861,741,863,0,0,0,0,861,741,863,0,0,0,0,0,0,0,861,741,741,741,741,741,741,741, + 741,741,741,741,741,741,741,863,0,0,0,0,0,0,0,861,741,782,822,822,822,822,783,741,863,0,0,0,0,0,0,0,861,741,741,741,741,741,741,741, + 741,741,741,741,741,741,741,863,0,0,0,0,0,0,0,861,741,741,741,741,741,741,741,741,863,0,0,0,0,0,0,0,861,741,741,741,741,741,741,741, + 741,741,741,741,741,741,741,181,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,183,741,741,741,741,741,741,741, + 741,741,741,741,741,741,741,221,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,223,741,741,741,741,741,741,741, + 741,741,741,741,741,741,741,221,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,223,741,741,741,741,741,741,741, + 741,741,741,741,741,741,741,261,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,263,741,741,741,741,741,741,741, + 741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741, + 741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,742,902,902,902,902,902,902,743,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741, + 741,741,741,742,902,902,902,902,902,902,902,902,902,743,741,741,863,0,0,0,0,0,0,861,741,741,742,902,902,902,902,902,902,902,902,902,743,741,741,741, + 741,741,741,863,0,0,0,0,0,0,0,0,0,861,741,741,863,0,0,0,0,0,0,861,741,741,863,0,0,0,0,0,0,0,0,0,861,741,741,741, + 741,741,741,863,0,0,0,0,0,0,0,0,0,861,741,741,863,0,0,0,0,0,0,861,741,741,863,0,0,0,0,0,0,0,0,0,861,741,741,741, + 741,741,741,863,0,0,0,0,0,0,0,0,0,861,741,741,863,0,0,0,0,0,0,861,741,741,863,0,0,0,0,0,0,0,0,0,861,741,741,741, + 741,741,741,782,822,822,822,822,822,822,822,822,822,783,741,741,863,0,0,0,0,0,0,861,741,741,782,822,822,822,822,822,822,822,822,822,783,741,741,741, + 741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,782,822,822,822,822,822,822,783,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741, + 741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741, + 182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,183,741,741,741,741,741,741,181,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182, + 101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,223,741,741,741,741,741,741,221,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101, + 101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,223,741,741,741,741,741,741,221,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101, + 101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,223,741,741,741,741,741,741,221,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101, + 101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,223,741,741,741,741,741,741,221,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101, + }; + + obj.createentity(88, 80, 21, 1); //Terminal // UU Brothers + obj.createblock(5, 88 - 4, 80, 20, 16, 25); + + if(game.stat_trinkets>=5) + { + obj.createentity(128, 80, 21, 1); //Terminal + obj.createblock(5, 128 - 4, 80, 20, 16, 26); + } + + if(game.stat_trinkets>=8) + { + obj.createentity(176, 80, 21, 1); //Terminal + obj.createblock(5, 176 - 4, 80, 20, 16, 27); + } + + if(game.stat_trinkets>=10) + { + obj.createentity(216, 80, 21, 1); //Terminal + obj.createblock(5, 216 - 4, 80, 20, 16, 28); + } + + if(game.stat_trinkets>=12) + { + obj.createentity(88, 128, 21, 0); //Terminal + obj.createblock(5, 88 - 4, 128, 20, 16, 29); + } + + if(game.stat_trinkets>=14) + { + obj.createentity(128, 128, 21, 0); //Terminal + obj.createblock(5, 128 - 4, 128, 20, 16, 33); + } + + if(game.stat_trinkets>=16) + { + obj.createentity(176, 128, 21, 0); //Terminal + obj.createblock(5, 176 - 4, 128, 20, 16, 30); + } + + if(game.stat_trinkets>=18) + { + obj.createentity(216, 128, 21, 0); //Terminal + obj.createblock(5, 216 - 4, 128, 20, 16, 32); + } + + //Special cases + if(game.stat_trinkets>=20) + { + obj.createentity(40, 40, 21, 0); //Terminal + obj.createblock(5, 40 - 4, 40, 20, 16, 31); + } + + if(game.stat_trinkets>=20) + { + obj.createentity(264, 40, 21, 0); //Terminal + obj.createblock(5, 264 - 4, 40, 20, 16, 34); + } + + obj.createentity(152, 40, 21, 0); //Terminal (jukebox instructions) + obj.createblock(5, 152 - 4, 40, 20, 16, 24); + hiddenname = "The Ship"; + result = contents; + break; + } + + case rn(3,11): + { + + static const short contents[] = { + 107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,229,747,748,908,908,749,747,227,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107, + 107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,229,747,869,0,0,867,747,227,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107, + 107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,229,747,869,0,0,867,747,227,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107, + 107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,229,747,788,828,828,789,747,227,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107, + 107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,229,747,747,747,747,747,747,227,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107, + 268,268,268,268,268,268,268,268,268,268,268,109,107,107,107,107,229,747,748,908,908,749,747,227,107,107,107,107,108,268,268,268,268,268,268,268,268,268,268,268, + 747,747,747,747,747,747,747,747,747,747,747,227,107,107,107,107,229,747,869,0,0,867,747,227,107,107,107,107,229,747,747,747,747,747,747,747,747,747,747,747, + 747,747,747,747,747,747,747,747,747,747,747,227,107,107,107,107,229,747,869,0,0,867,747,227,107,107,107,107,229,747,747,747,747,747,747,747,747,747,747,747, + 747,747,747,747,747,747,747,747,747,747,747,227,107,107,107,107,229,747,788,828,828,789,747,227,107,107,107,107,229,747,747,747,747,747,747,747,747,747,747,747, + 747,747,747,747,747,747,747,747,747,747,747,267,268,268,268,268,269,747,747,747,747,747,747,267,268,268,268,268,269,747,747,747,747,747,747,747,747,747,747,747, + 747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,748,908,908,749,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747, + 747,747,747,747,747,747,747,747,747,747,747,747,747,747,748,908,908,749,869,0,0,867,748,908,908,749,747,747,747,747,747,747,747,747,747,747,747,747,747,747, + 747,747,747,747,747,747,747,747,747,747,748,908,908,749,869,0,0,867,869,0,0,867,869,0,0,867,748,908,908,749,747,747,747,747,747,747,747,747,747,747, + 747,747,747,747,747,747,747,747,747,747,869,0,0,867,869,0,0,867,788,828,828,789,869,0,0,867,869,0,0,867,747,747,747,747,747,747,747,747,747,747, + 747,747,747,747,747,747,747,747,747,747,869,0,0,867,788,828,828,789,747,747,747,747,788,828,828,789,869,0,0,867,747,747,747,747,747,747,747,747,747,747, + 747,747,747,747,747,747,747,747,747,747,788,828,828,789,747,747,747,747,747,747,747,747,747,747,747,747,788,828,828,789,747,747,747,747,747,747,747,747,747,747, + 747,747,747,747,747,747,187,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,189,747,747,747,747,747,747, + 747,747,747,747,747,747,227,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,229,747,747,747,747,747,747, + 747,747,747,747,747,747,267,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,269,747,747,747,747,747,747, + 747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747, + 747,747,747,747,747,747,747,747,747,747,748,908,908,908,908,908,908,908,908,908,908,908,908,908,908,908,908,908,908,749,747,747,747,747,747,747,747,747,747,747, + 747,747,747,747,747,747,747,747,747,747,869,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,867,747,747,747,747,747,747,747,747,747,747, + 747,747,747,747,747,747,747,747,747,747,869,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,867,747,747,747,747,747,747,747,747,747,747, + 747,747,747,747,747,747,747,747,747,747,788,828,828,828,828,828,828,828,828,828,828,828,828,828,828,828,828,828,828,789,747,747,747,747,747,747,747,747,747,747, + 747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747, + 188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188, + 107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107, + 107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107, + 107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107, + 107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107, + }; + hiddenname = "The Ship"; + result = contents; + break; + } + + case rn(3,12): + { + + static const short contents[] = { + 107,107,107,107,107,107,107,107,108,268,268,109,108,268,268,109,108,268,268,109,108,268,268,268,109,108,268,268,268,268,109,107,108,268,268,268,109,107,107,107, + 268,268,268,268,268,268,268,268,269,572,574,227,229,572,574,267,269,572,574,267,269,572,573,574,227,229,572,573,573,574,267,268,269,572,573,574,267,268,268,268, + 573,573,573,573,573,573,573,573,573,534,614,227,229,612,533,573,573,534,533,573,573,534,492,614,227,229,612,492,492,533,573,573,573,534,492,614,0,0,0,0, + 492,492,492,492,492,492,492,492,492,492,614,227,229,612,492,492,492,492,492,492,492,493,653,654,227,229,612,492,492,492,492,492,492,492,492,614,0,0,0,0, + 492,492,492,492,492,492,492,492,492,492,614,227,229,612,492,492,492,492,492,492,492,614,187,188,149,269,612,492,492,492,492,492,492,492,493,654,0,0,0,0, + 492,492,492,492,492,492,492,492,492,492,614,267,269,612,492,492,492,492,492,492,492,614,267,268,269,572,534,492,492,492,492,492,493,653,654,0,0,0,0,0, + 492,492,492,492,492,492,492,492,492,492,533,573,573,534,492,492,492,492,492,492,492,533,573,573,573,534,492,492,492,492,492,493,654,0,0,0,0,0,0,0, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,493,653,653,653,653,654,0,0,0,0,0,0,0,0, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,493,653,654,0,0,692,0,0,0,0,0,0,0,0,0,0, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,493,653,653,654,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0, + 653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,654,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,572,573,573,573,573,573,573,573,573,573,573,573,573,574,0,0,0,0, + 0,0,0,0,0,572,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,534,492,492,492,492,492,492,492,492,492,492,492,492,533,573,573,573,573, + 0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 0,0,0,0,0,652,653,653,653,653,494,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 0,0,0,0,0,0,692,0,0,0,652,653,494,492,492,492,492,492,492,492,492,492,492,492,492,492,492,493,653,653,653,653,653,653,653,653,653,653,653,653, + 0,0,0,0,0,0,692,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,692,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,692,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,692,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + obj.createentity(128, 160, 10, 1, 113030); // (savepoint) + result = contents; + break; + } + + + case rn(3,13): + { + + static const short contents[] = { + 0,0,0,0,0,0,0,683,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,683,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,683,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,683,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,683,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,683,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,683,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,683,0,0,0,563,525,483,483,483,483,483,483,483,483,483,483,483,483,484,644,645,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,683,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,683,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,563,564,564,564,564,564,525,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,484,644,645,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,563,525,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,563,525,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 564,564,564,525,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + obj.createentity(192, 96, 10, 0, 114030); // (savepoint) + result = contents; + break; + } + + case rn(3,14): + { + + static const short contents[] = { + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,499,659,659,659,659,659,659,660,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,539,579,579,580,0,698,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,539,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + }; + result = contents; + break; + } + + case rn(3,15): + { + + static const short contents[] = { + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,484,644,644,644,644,644, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,484,644,644,645,0,0,0,0,0, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,484,644,645,0,0,0,0,0,0,0,0, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,484,645,0,0,0,0,0,0,0,0,563,564, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,603,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,563,564,525,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,603,483,483,483, + 644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,485,483,483,483,483,483,483,483,483,483,483,484,645,0,0,0,0,0,0,563,525,483,483,483, + 0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,643,485,483,483,483,483,483,483,483,483,483,605,683,0,0,0,0,0,0,603,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,643,644,485,483,483,483,483,483,483,483,605,683,0,0,0,0,0,0,603,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,683,0,643,485,483,483,483,483,483,484,645,683,0,0,0,0,0,563,525,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,683,0,0,603,483,483,483,483,483,605,0,683,0,0,0,0,0,603,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,683,0,0,643,485,483,483,483,483,605,0,683,0,0,0,0,563,525,483,483,483,483,483, + 6,6,6,6,6,6,6,6,6,563,564,564,565,0,0,0,0,683,0,0,0,643,644,644,644,644,645,0,683,0,0,0,0,603,483,483,483,483,483,483, + 564,564,564,564,564,564,564,564,564,525,483,483,524,565,0,0,0,683,0,0,0,0,0,0,0,0,0,0,683,0,0,0,563,525,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,524,565,0,0,683,0,0,0,0,0,0,0,0,0,0,683,0,0,0,603,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,683,0,0,0,0,0,0,0,0,0,0,683,0,0,0,603,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,524,565,0,683,0,0,0,0,0,0,0,0,0,0,683,0,0,0,603,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,683,0,0,0,0,0,0,0,0,0,0,683,0,0,0,603,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,524,564,565,0,0,0,0,0,0,0,0,0,0,683,0,0,0,603,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,683,0,0,0,603,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,524,564,565,0,0,0,0,0,0,0,0,563,564,564,564,525,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,6,6,6,6,6,6,6,6,603,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,524,564,564,564,564,564,564,564,564,525,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + }; + result = contents; + break; + } + + case rn(4,5): + { + + static const short contents[] = { + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,499,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,500,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,499,659,659,659,660,0,0,0,698,0,0,0,0,0,0,0,0,0,0,698,0,0,658,659,659,659,659,500,498,498,498,498,498, + 498,498,498,498,498,499,659,660,0,0,698,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,698,0,0,698,0,0,0,0,658,500,498,498,498,498, + 498,498,498,498,498,620,0,0,0,0,698,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,698,0,0,698,0,0,0,0,0,618,498,498,498,498, + 498,498,498,498,498,620,0,0,0,0,698,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,698,0,0,698,0,0,0,0,0,618,498,498,498,498, + 498,498,498,498,498,620,0,0,0,0,698,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,698,0,0,698,0,0,0,0,0,658,659,659,659,659, + 659,659,659,659,659,660,0,0,0,0,698,0,0,0,0,698,0,0,0,0,0,0,0,0,0,578,579,579,579,579,580,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,578,579,579,579,579,579,579,580,0,0,0,0,0,0,0,0,618,498,498,498,498,620,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,620,0,0,0,0,0,0,578,579,540,498,498,498,498,620,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,620,0,0,0,0,0,0,618,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,620,0,0,0,0,0,0,618,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,620,0,0,0,0,0,0,618,498,498,498,498,498,498,539,579,579,580,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,499,660,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0, + 0,0,0,0,0,0,578,579,579,540,498,498,498,498,498,620,0,0,0,0,0,0,0,658,500,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0, + 0,0,0,0,0,0,618,498,498,498,498,498,498,498,499,660,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,499,660,0,0,0,0,0,0, + 0,0,0,0,0,0,618,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0, + 0,0,0,0,0,0,618,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,658,500,498,498,498,498,498,498,620,0,0,0,0,0,0,0, + 0,0,0,0,0,0,658,500,498,498,498,498,498,499,660,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,499,659,660,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,658,500,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,499,660,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,618,498,498,498,499,660,0,0,0,0,0,0,0,0,0,0,0,658,500,498,498,620,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,658,659,500,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,620,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,658,659,660,0,0,0,0,0,0,0,0,0,0,0,0,0,658,659,659,660,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + result = contents; + break; + } + + case rn(4,7): + { + + static const short contents[] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,572,573,574,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,612,492,614,0,0,0,0,0,0,693,694,693,693,693,693,693,693,693,694,693,0,0,0,0,0,572,573,574,0,0,0,0,0,0,0,0, + 0,0,0,0,652,653,654,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,692,0,0,0,0,0,0,612,492,614,0,0,0,0,0,0,0,0, + 0,0,0,0,0,692,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,692,0,0,0,0,0,0,652,653,654,0,0,0,0,0,0,0,0, + 0,0,0,0,0,692,0,0,0,0,0,0,0,572,573,574,0,0,0,0,0,0,692,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,692,0,0,0,0,0,0,0,612,492,614,0,0,0,0,0,0,692,0,0,0,0,0,0,0,692,0,0,692,0,0,0,0,0,0, + 0,0,0,0,0,692,0,0,0,0,0,0,0,652,653,654,0,0,0,0,0,0,692,0,0,0,0,0,0,0,692,0,0,692,0,0,0,0,0,0, + 0,0,0,0,0,692,0,0,0,0,0,0,0,0,692,0,0,0,0,0,693,693,694,693,693,693,693,693,693,693,694,693,693,694,693,693,0,0,0,0, + 0,0,0,0,0,692,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,692,0,0,692,0,0,0,0,0,0, + 693,693,693,693,693,694,693,693,693,693,693,693,693,693,694,693,693,0,0,0,0,0,692,0,0,0,0,0,0,0,692,0,0,692,0,0,0,0,0,0, + 0,0,0,0,0,692,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,572,573,574,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0, + 0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,614,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0, + 0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,652,653,654,0,0,0,0,0,0,0,0,572,573,574,0,0,0,0,0, + 0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,612,492,614,0,0,0,0,0, + 0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,652,653,654,0,0,0,0,0, + 0,0,0,0,572,573,574,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,612,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,652,653,654,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,572,573,574,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,614,693,693,693,693,693,694,693,693,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,652,653,654,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + result = contents; + break; + } + + case rn(4,9): + { + + static const short contents[] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,190,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,270,272,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,190,191,192,0,0,0,0,0,0,0,0, + 0,0,0,0,0,190,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,230,110,232,0,0,0,0,0,0,0,0, + 0,0,0,0,0,270,272,0,0,0,0,0,0,0,0,0,0,190,191,192,0,0,0,0,0,0,0,0,0,270,271,272,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,230,110,232,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,270,271,272,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,190,191,192,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,230,110,232,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,270,271,272,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,190,191,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,230,110,232,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,270,271,272,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,192,0,0,0,190,191,191,191,191,191,191,192,0,0,190,191,191,191,191,191,191,191,191,191,191, + 110,110,110,110,110,110,110,111,271,271,271,112,110,110,110,232,0,0,0,230,110,110,110,110,110,110,232,0,0,230,110,110,110,110,110,110,110,110,110,110, + 110,110,110,110,110,110,110,232,0,0,0,230,110,110,110,232,0,0,0,230,110,110,110,110,110,110,151,191,191,152,110,111,271,271,271,112,110,110,110,110, + 110,110,110,110,110,110,110,232,0,0,0,230,110,110,110,151,191,191,191,152,110,110,110,110,110,110,110,110,110,110,110,232,0,0,0,230,110,110,110,110, + 110,110,110,110,110,110,110,232,0,0,0,230,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,232,0,0,0,230,110,110,110,110, + 110,110,110,110,110,110,110,151,191,191,191,152,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,232,0,0,0,230,110,110,110,110, + 110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,151,191,191,191,152,110,110,110,110, + }; + result = contents; + break; + } + + case rn(4,10): + { + + static const short contents[] = { + 110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, + 110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, + 110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, + 110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, + 271,271,271,271,271,271,271,271,112,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, + 750,750,750,750,750,750,750,750,270,271,271,112,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, + 750,750,750,750,750,750,750,750,750,750,750,270,271,271,112,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, + 750,751,911,911,911,911,911,911,752,750,750,750,750,750,270,271,271,271,271,271,271,271,271,271,271,271,271,271,112,110,110,110,110,110,110,110,110,110,110,110, + 750,872,0,0,0,0,0,0,870,750,750,750,750,750,750,750,750,750,750,750,750,750,750,750,750,750,750,750,270,271,271,271,271,112,110,110,110,110,110,110, + 750,872,0,0,0,0,0,0,870,750,750,750,750,750,750,750,750,750,750,750,750,751,911,911,752,750,750,750,750,872,0,0,0,270,271,112,110,110,110,110, + 750,872,0,0,0,0,0,0,870,750,750,750,750,750,750,750,750,751,911,911,752,872,0,0,870,750,750,750,750,872,0,0,0,0,0,230,110,110,110,110, + 750,791,831,831,831,831,831,831,792,750,750,750,750,751,911,911,752,872,0,0,870,872,0,0,870,750,750,750,750,872,0,0,0,0,0,230,110,110,110,110, + 750,750,750,750,750,750,750,750,750,751,911,911,752,872,0,0,870,872,0,0,870,872,0,0,870,750,750,750,750,872,0,0,0,0,0,230,110,110,110,110, + 750,750,750,750,750,751,911,911,752,872,0,0,870,872,0,0,870,872,0,0,870,872,0,0,870,750,750,750,750,872,0,0,0,0,0,230,110,110,110,110, + 750,751,911,911,752,872,0,0,870,872,0,0,870,872,0,0,870,872,0,0,870,872,0,0,870,750,750,750,750,872,0,0,0,0,0,230,110,110,110,110, + 750,872,0,0,870,872,0,0,870,872,0,0,870,872,0,0,870,872,0,0,870,872,0,0,870,750,750,750,750,872,0,0,0,0,0,230,110,110,110,110, + 750,872,0,0,870,872,0,0,870,872,0,0,870,872,0,0,870,872,0,0,870,872,0,0,870,750,750,750,750,872,0,0,0,0,0,230,110,110,110,110, + 750,872,0,0,870,872,0,0,870,872,0,0,870,872,0,0,870,872,0,0,870,872,0,0,870,750,750,750,190,191,191,191,191,191,191,152,110,110,110,110, + 750,872,0,0,870,872,0,0,870,872,0,0,870,872,0,0,870,872,0,0,870,872,0,0,870,750,750,190,152,110,110,110,110,110,110,110,110,110,110,110, + 750,872,0,0,870,872,0,0,870,872,0,0,870,872,0,0,870,872,0,0,870,872,0,0,870,750,190,152,110,110,110,110,110,110,110,110,110,110,110,110, + 750,872,0,0,870,872,0,0,870,872,0,0,870,872,0,0,870,872,0,0,870,872,0,0,870,750,270,271,271,271,271,271,271,271,271,112,110,110,110,110, + 750,872,0,0,870,872,0,0,870,872,0,0,870,872,0,0,870,872,0,0,870,872,0,0,870,750,750,750,750,872,0,0,0,0,0,230,110,110,110,110, + 750,872,0,0,870,872,0,0,870,872,0,0,870,872,0,0,870,872,0,0,870,872,0,0,870,750,750,750,750,872,0,0,0,0,0,230,110,110,110,110, + 750,791,831,831,792,791,831,831,792,791,831,831,792,791,831,831,792,791,831,831,792,791,831,831,792,750,750,750,750,872,0,0,0,0,0,230,110,110,110,110, + 750,750,750,750,750,750,750,750,750,750,750,750,750,750,750,750,750,750,750,750,750,750,750,750,750,750,750,750,750,872,0,0,0,0,0,230,110,110,110,110, + 191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,152,110,110,110,110, + 110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, + 110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, + 110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, + 110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, + }; + + obj.createentity(256, 120, 20, 1); //Terminal Ship computer + obj.createblock(5, 256 - 4, 120, 20, 16, 22); + + obj.createentity(256, 184, 20, 1); //Terminal + obj.createentity(232, 184, 20, 1); //Terminal + obj.createentity(208, 184, 20, 1); //Terminal + obj.createblock(5, 208 + 4, 184, 56, 16, 23); + hiddenname = "The Ship"; + result = contents; + break; + } + + case rn(4,11): + { + + static const short contents[] = { + 116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, + 116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, + 116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, + 116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, + 116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, + 277,277,277,277,277,277,277,277,277,277,277,277,277,277,277,277,277,277,277,277,277,277,277,277,277,277,277,277,118,116,116,116,116,116,116,116,116,116,116,116, + 756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,236,116,116,116,116,116,116,116,116,116,116,116, + 756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,236,116,116,116,116,116,116,116,116,116,116,116, + 756,756,756,756,757,917,917,917,917,758,756,756,757,917,917,917,917,758,756,756,757,917,917,917,917,758,756,756,236,116,116,116,116,116,116,116,116,116,116,116, + 756,756,756,756,878,0,0,0,0,876,756,756,878,0,0,0,0,876,756,756,878,0,0,0,0,876,756,756,236,116,116,116,116,116,116,116,116,116,116,116, + 756,756,756,756,878,0,0,0,0,876,756,756,878,0,0,0,0,876,756,756,878,0,0,0,0,876,756,756,236,116,116,116,116,116,116,116,116,116,116,116, + 756,756,756,756,878,0,0,0,0,876,756,756,878,0,0,0,0,876,756,756,878,0,0,0,0,876,756,756,236,116,116,116,116,116,116,116,116,116,116,116, + 756,756,756,756,878,0,0,0,0,876,756,756,878,0,0,0,0,876,756,756,878,0,0,0,0,876,756,756,236,116,116,116,116,116,116,116,116,116,116,116, + 756,756,756,756,878,0,0,0,0,876,756,756,878,0,0,0,0,876,756,756,878,0,0,0,0,876,756,756,236,116,116,116,116,116,116,116,116,116,116,116, + 756,756,756,756,878,0,0,0,0,876,756,756,878,0,0,0,0,876,756,756,878,0,0,0,0,876,756,756,236,116,116,116,116,116,116,116,116,116,116,116, + 756,756,756,756,878,0,0,0,0,876,756,756,797,837,837,837,837,798,756,756,878,0,0,0,0,876,756,756,236,116,116,116,116,116,116,116,116,116,116,116, + 756,756,756,756,878,0,0,0,0,876,756,756,756,756,756,756,756,756,756,756,878,0,0,0,0,876,756,756,236,116,116,116,116,116,116,116,116,116,116,116, + 756,756,756,756,878,0,0,0,0,876,756,756,756,756,756,756,756,756,756,756,878,0,0,0,0,876,756,756,236,116,116,116,116,116,116,116,116,116,116,116, + 756,756,756,756,878,0,0,0,0,876,756,756,196,197,197,197,197,198,756,756,878,0,0,0,0,876,756,756,236,116,116,116,116,116,116,116,116,116,116,116, + 756,756,756,756,878,0,0,0,0,876,756,756,236,116,116,116,116,238,756,756,878,0,0,0,0,876,756,756,236,116,116,116,116,116,116,116,116,116,116,116, + 756,756,756,756,878,0,0,0,0,876,756,756,236,116,116,116,116,238,756,756,878,0,0,0,0,876,756,756,236,116,116,116,116,116,116,116,116,116,116,116, + 756,756,756,756,878,0,0,0,0,876,756,756,236,116,116,116,116,238,756,756,878,0,0,0,0,876,756,756,236,116,116,116,116,116,116,116,116,116,116,116, + 756,756,756,756,797,837,837,837,837,798,756,756,236,116,116,116,116,238,756,756,797,837,837,837,837,798,756,756,236,116,116,116,116,116,116,116,116,116,116,116, + 756,756,756,756,756,756,756,756,756,756,756,756,236,116,116,116,116,238,756,756,756,756,756,756,756,756,756,756,236,116,116,116,116,116,116,116,116,116,116,116, + 756,756,756,756,756,756,756,756,756,756,756,756,236,116,116,116,116,238,917,917,758,756,756,756,756,757,917,917,236,116,116,116,116,116,116,116,116,116,116,116, + 197,197,197,197,197,197,197,197,197,197,197,197,158,116,116,116,116,238,0,0,876,756,756,756,756,878,0,0,236,116,116,116,116,116,116,116,116,116,116,116, + 116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,238,0,0,916,917,917,917,917,918,0,0,236,116,116,116,116,116,116,116,116,116,116,116, + 116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,238,0,0,0,0,0,0,0,0,0,0,236,116,116,116,116,116,116,116,116,116,116,116, + 116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,238,0,0,0,0,0,0,0,0,0,0,236,116,116,116,116,116,116,116,116,116,116,116, + 116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,238,0,0,0,0,0,0,0,0,0,0,236,116,116,116,116,116,116,116,116,116,116,116, + }; + hiddenname = "The Ship"; + result = contents; + break; + } + + case rn(4,12): + { + + static const short contents[] = { + 116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,238,0,0,0,0,0,0,0,0,0,0,236,116,116,116,116,116,116,116,116,116,116,116, + 277,277,277,277,277,277,277,277,277,277,277,277,277,277,277,118,116,238,0,0,0,0,0,0,0,0,0,0,236,116,117,277,277,277,277,277,277,277,277,277, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,236,116,238,0,0,0,0,0,0,0,0,0,0,236,116,238,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,236,116,238,0,0,0,0,0,0,0,0,0,0,236,116,238,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,276,277,278,0,0,0,0,0,0,0,0,0,0,276,277,278,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,563,564,564,564,565,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,563,564,564,564,525,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 564,564,564,564,564,525,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 483,483,483,483,483,483,483,484,644,644,644,644,644,645,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 644,644,644,644,644,644,644,645,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + result = contents; + break; + } + + case rn(4,13): + { + + static const short contents[] = { + 0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,569,570,570,570,570,571,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,649,650,650,650,650,651,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,689,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,689,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,689,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,690,690,690,691,690,690,690,690,690,690,690,690,690,690,690,690,690,690,690,690,690,690,691,690,690,691,690,690,690,690,690,690, + 0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,689,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,569,570,570,571,0,689,0,0,689,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,530,570,570,571,0,689,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,649,650,650,491,489,489,530,570,570,571,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,530,570,570,570,570,570, + 0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489, + 0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489, + 0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489, + }; + + obj.createentity(248, 112, 10, 1, 114040); // (savepoint) + result = contents; + break; + } + + case rn(4,14): + { + + static const short contents[] = { + 0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492, + 0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492, + 0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492, + 0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492, + 0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492, + 0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492, + 0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,652,653,653,653,494,492,492,492,492,492,492,492, + 0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,652,653,653,653,653,653,653,653, + 0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,572,573,573,573,573,573,573,573,573,574,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,533,573,574,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,533,573,574,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,533,573,574,0,0,0,692,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,533,573,574,0,692,0,0,0,0,0,0,0,0,0,0, + 573,573,573,573,573,574,0,0,0,0,652,653,653,494,492,492,492,492,492,492,492,492,492,492,492,492,492,533,573,574,0,0,0,0,0,0,0,0,0,0, + 492,492,492,492,492,614,0,0,0,0,0,692,0,652,653,494,492,492,492,492,492,492,492,492,492,492,492,492,492,533,573,573,573,573,573,574,0,0,0,0, + 492,492,492,492,492,614,0,0,0,0,0,692,0,0,0,652,653,653,653,653,653,494,492,492,492,492,492,492,492,492,492,492,492,492,492,533,573,573,573,573, + 492,492,492,492,492,533,574,0,0,0,0,692,0,0,0,0,692,0,0,0,0,652,494,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,614,0,0,0,0,692,0,0,0,0,692,0,0,0,0,0,652,494,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,533,574,0,0,0,692,0,0,0,0,692,0,0,0,0,0,0,652,494,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,533,573,574,0,692,0,0,0,0,692,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,533,573,573,573,573,573,573,573,574,0,0,0,0,0,0,652,494,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,533,574,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,533,574,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + }; + + obj.createentity(104, 176, 10, 1, 115040); // (savepoint) + result = contents; + break; + } + + case rn(4,15): + { + + static const short contents[] = { + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 641,641,641,641,641,641,482,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 0,0,0,0,0,0,640,641,482,480,480,480,480,480,480,480,480,480,481,642,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 0,0,0,0,0,0,0,0,640,641,482,480,480,480,480,480,480,480,602,0,0,0,0,0,560,522,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 0,0,0,0,0,0,0,0,0,680,640,641,482,480,480,480,481,641,642,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 0,0,0,0,0,0,0,0,0,680,0,0,640,641,641,641,642,680,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 561,561,561,561,562,0,0,0,0,680,0,0,0,680,0,0,0,680,0,0,0,0,0,560,522,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,521,561,562,0,0,680,0,0,0,680,0,0,0,680,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,521,562,0,680,0,0,0,680,0,0,0,680,0,0,0,560,561,522,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,521,561,562,0,0,0,680,0,0,0,680,0,560,561,522,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,521,561,561,561,561,561,561,561,561,561,522,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + }; + + obj.createentity(16, 40, 10, 1, 15040); // (savepoint) + result = contents; + break; + } + + case rn(5,2): + { + + static const short contents[] = { + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,484,644,644,644,644,644,644,644,644, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,484,645,0,0,0,0,0,0,0,0, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,524,564,564,565,0,0,0,0,0,0, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,484,644,644,644,644,644,644,645,0,0,0,0,0,0, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,484,644,644,644,645,0,0,0,0,0,0,0,0,0,0,0,0,0, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,484,644,644,644,645,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + result = contents; + break; + } + + case rn(5,3): + { + + static const short contents[] = { + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,572,573,574,0,0,0,0,0,0,0,0,0,0, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,693,693,693,693,693,693,693,693,612,492,614,0,0,0,0,0,0,0,0,0,0, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,652,653,654,0,0,0,0,0,0,0,0,0,0, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,692,0,0,0,692,0,0,692,0,572,573,573,574,0,0,0, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,693,694,693,693,693,694,693,693,694,693,612,492,492,614,0,0,0, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,692,0,0,0,692,0,0,692,0,652,653,653,654,0,0,0, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,692,0,0,0,692,0,0,692,0,0,0,0,0,0,0,0, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,692,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,572,573,574,0,0,0,0,0,692,0,0,0,0,0,0,0,0, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,612,492,614,0,0,0,0,0,692,0,0,0,0,0,0,0,0, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,652,653,654,0,0,0,0,0,692,0,0,0,0,0,0,0,0, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,572,573,574,0,0,0,0,0,0,0, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,693,693,693,693,693,693,693,693,693,693,693,612,492,614,0,0,0,0,0,0,0, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,652,653,654,0,0,0,0,0,0,0, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + obj.createentity(272, 128, 10, 0, 3050); // (savepoint) + result = contents; + break; + } + + case rn(5,4): + { + + static const short contents[] = { + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,530,570,570,571,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,530,570,570,571,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,530,570,570,571,0,0,0,0,0,0,0,0,0,0,0,0, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0, + 489,489,489,489,489,489,489,490,650,650,650,650,650,650,650,650,650,650,491,489,489,489,489,489,490,650,650,651,0,0,0,0,0,0,0,0,0,0,0,0, + 489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,649,650,650,650,650,650,651,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 489,489,489,489,489,489,489,530,570,570,570,570,570,570,570,570,570,570,570,570,571,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,490,651,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,490,651,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + result = contents; + break; + } + + case rn(5,5): + { + + static const short contents[] = { + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,487,648,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 647,647,647,647,488,486,486,486,486,486,486,486,486,486,486,486,487,648,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,646,647,488,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,646,647,488,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,646,647,488,486,486,486,486,487,648,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,646,488,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,606,486,486,487,648,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,606,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,606,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,606,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,606,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,646,488,487,648,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,646,648,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + result = contents; + break; + } + + case rn(5,6): + { + + static const short contents[] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,575,576,576,576,576,576,576,576,576,576,576,576,576,577,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,617,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696, + 0,0,0,0,0,0,0,0,0,0,0,655,656,656,656,656,656,656,656,656,656,656,656,656,657,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + result = contents; + break; + } + + case rn(5,7): + { + + static const short contents[] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,563,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + }; + result = contents; + break; + } + + case rn(5,8): + { + + static const short contents[] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,646,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + result = contents; + break; + } + + case rn(5,9): + { + + static const short contents[] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,184,186,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,264,266,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,184,185,186,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,224,104,226,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,264,265,266,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 185,185,185,185,185,185,185,186,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 104,104,104,104,104,104,104,226,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 104,104,104,104,104,104,104,145,185,186,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 104,104,104,104,104,104,104,104,104,226,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 104,104,104,104,104,104,104,104,104,226,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 104,104,104,104,104,104,104,104,104,226,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 104,104,104,104,104,104,104,104,104,226,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + result = contents; + break; + } + + case rn(5,10): + { + + static const short contents[] = { + 104,104,104,104,104,104,104,104,104,226,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 104,104,104,104,104,104,104,104,104,226,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 104,104,104,104,104,104,104,104,104,226,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 104,104,104,104,104,104,104,104,104,226,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 104,104,104,104,104,104,104,104,104,226,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 104,104,104,104,104,104,104,104,104,226,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 104,104,104,104,104,104,104,104,104,226,0,0,0,0,566,567,567,567,567,567,567,567,568,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 104,104,104,104,104,104,104,104,104,226,0,0,0,0,646,647,647,647,647,647,647,647,648,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 104,104,104,104,104,104,104,104,104,226,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 104,104,104,104,104,104,104,104,104,226,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 104,104,104,104,104,104,104,104,104,226,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 104,104,104,104,104,104,104,104,104,226,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 104,104,104,104,104,104,104,104,104,226,0,0,0,0,0,0,0,0,0,0,566,567,567,567,567,567,568,0,0,0,0,0,0,0,0,0,0,0,0,0, + 104,104,104,104,104,104,104,104,104,226,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,608,687,687,687,687,687,687,687,687,687,687,687,687,687, + 104,104,104,104,104,104,104,104,104,226,0,0,0,0,0,0,0,0,0,0,646,647,647,647,647,647,648,0,0,0,0,0,0,0,0,0,0,0,0,0, + 104,104,104,104,104,104,104,104,104,226,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 104,104,104,104,104,104,104,104,104,226,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 104,104,104,104,104,104,104,104,104,226,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 104,104,104,104,104,104,104,104,104,226,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 104,104,104,104,104,104,104,104,104,226,0,0,0,0,0,0,0,0,0,0,0,0,0,0,566,567,567,567,567,567,567,567,568,0,0,0,0,0,0,0, + 104,104,104,104,104,104,104,104,104,226,0,0,0,0,0,0,0,0,0,0,0,0,0,0,646,647,647,647,647,647,647,647,648,0,0,0,0,0,0,0, + 104,104,104,104,104,104,104,104,104,226,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 104,104,104,104,104,104,104,104,104,226,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 104,104,104,104,104,104,104,104,104,226,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 104,104,104,104,104,104,104,104,104,226,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 104,104,104,104,104,104,104,104,104,226,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 104,104,104,104,104,104,104,104,104,226,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 104,104,104,104,104,104,104,104,104,226,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 104,104,104,104,104,104,104,104,104,226,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 104,104,104,104,104,104,104,104,104,226,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + result = contents; + break; + } + + case rn(5,11): + { + + static const short contents[] = { + 113,113,113,113,113,113,113,113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 113,113,113,113,113,113,113,113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 113,113,113,113,113,113,113,113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 113,113,113,113,113,113,113,113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 113,113,113,113,113,113,113,113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 113,113,113,113,113,113,113,113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 113,113,113,113,113,113,113,113,113,154,194,195,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 113,113,113,113,113,113,113,113,113,113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 113,113,113,113,113,113,113,113,113,113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 113,113,113,113,113,113,113,113,113,113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 113,113,113,113,113,113,113,113,113,113,113,154,195,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 113,113,113,113,113,113,113,113,113,113,113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 113,113,113,113,113,113,113,113,113,113,113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 113,113,113,113,113,113,113,113,113,113,113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 113,113,113,113,113,113,113,113,113,113,113,113,154,195,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 113,113,113,113,113,113,113,113,113,113,113,113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 113,113,113,113,113,113,113,113,113,113,113,113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 113,113,113,113,113,113,113,113,113,113,113,113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 113,113,113,113,113,113,113,113,113,113,113,113,113,154,195,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 113,113,113,113,113,113,113,113,113,113,113,113,113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 113,113,113,113,113,113,113,113,113,113,113,113,113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 113,113,113,113,113,113,113,113,113,113,113,113,113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 113,113,113,113,113,113,113,113,113,113,113,113,113,113,154,195,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,154,195,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + result = contents; + break; + } + + case rn(5,12): + { + + static const short contents[] = { + 113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 274,274,274,274,274,274,274,274,274,274,274,274,274,274,274,274,275,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,560,561,561,561,561,561,562,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,640,482,480,480,480,481,642,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,640,641,641,641,642,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + result = contents; + break; + } + + case rn(5,13): + { + + static const short contents[] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,572,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,574,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,693,693,693,693,693,693,693,693,693,693,693,693,693,693,693, + 0,0,0,0,0,0,612,492,492,492,493,653,653,653,653,653,653,653,653,653,653,653,653,653,654,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,652,653,653,653,654,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 693,693,693,693,693,693,693,693,694,693,693,693,693,693,693,693,693,693,693,693,694,693,693,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,572,573,573,573,573,573,573,574,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,572,573,573,573,573,573,573,573,573,573,573,573,534,492,492,492,492,492,492,533,573,573,573,573,573,573,573,573,574,0,0,0,0, + 573,573,573,573,573,573,573,534,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,533,573,573,573,573, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + }; + + obj.createentity(184, 176, 10, 1, 13050); // (savepoint) + result = contents; + break; + } + + case rn(5,14): + { + + static const short contents[] = { + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,496,656,656,656,656,656,656,656,656,656,656,656, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,496,656,656,656,656,656,656,656,657,0,0,695,0,0,0,0,0,0,0,0, + 495,495,495,495,495,495,495,495,495,495,495,496,656,656,656,656,656,656,656,656,657,0,0,695,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0, + 656,656,656,656,656,656,656,656,656,656,656,657,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0, + 576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,577,0,0,695,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,536,576,576,576,577,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,536,576,576,576,577,0,0,695,0,0,0,0,0,0,0,0, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,536,576,576,576,577,0,0,0,0,0,0,0, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,536,576,576,576,576,576,576,576, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + }; + result = contents; + break; + } + + + case rn(5,15): + { + + static const short contents[] = { + 486,486,486,486,486,486,486,487,647,647,647,647,488,486,486,486,486,487,647,647,647,647,647,647,647,647,647,647,647,488,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,608,0,0,0,0,606,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,646,488,486,486,486,486,486,486,486,486,486, + 486,486,486,486,487,647,647,648,0,0,0,0,606,486,486,487,647,648,0,0,0,0,0,0,0,0,0,0,0,0,646,647,647,647,488,486,486,486,486,486, + 486,487,647,647,648,686,0,0,0,0,0,0,606,486,487,648,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486, + 486,608,0,0,0,686,0,0,0,0,0,0,606,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,566,567,568,0,566,528,487,647,647,647,647, + 486,608,0,0,0,686,0,0,0,0,0,0,606,486,608,687,687,687,687,687,566,567,567,567,567,567,568,687,687,606,486,608,0,606,486,608,0,0,686,0, + 486,608,0,0,0,686,0,0,0,0,0,0,646,488,608,0,0,0,0,0,606,486,486,486,487,647,648,0,0,646,647,648,0,606,486,608,0,0,566,567, + 486,608,0,0,0,686,0,0,0,566,568,0,0,646,648,0,0,0,0,566,528,486,486,486,608,0,0,0,0,0,686,0,0,606,486,608,0,0,606,486, + 486,608,0,0,0,566,568,0,0,606,527,568,0,0,686,0,0,0,0,646,647,647,488,486,527,568,0,0,0,0,686,0,0,606,486,608,0,0,646,647, + 486,608,687,687,687,606,527,567,567,528,486,608,0,0,686,0,0,0,0,0,0,0,646,647,488,527,568,0,0,0,686,0,0,606,486,608,0,0,0,0, + 486,608,0,0,0,646,488,486,486,486,487,648,0,0,686,0,0,0,0,0,0,0,686,0,606,487,648,0,0,0,686,0,566,528,486,608,0,0,0,0, + 486,608,0,0,0,0,646,488,486,486,608,0,0,0,686,0,0,0,0,0,0,0,686,0,646,648,0,0,0,0,686,0,606,486,487,648,0,0,0,0, + 486,608,0,0,0,0,0,646,647,647,648,0,566,567,567,567,568,0,0,0,566,567,568,0,0,0,0,0,0,566,567,567,528,486,608,0,0,0,0,0, + 486,608,0,0,0,0,0,686,0,0,0,566,528,486,486,486,608,0,0,566,528,486,608,687,687,687,687,687,687,606,486,487,647,647,648,0,0,0,0,0, + 486,608,0,0,0,0,0,686,0,0,566,528,486,486,487,647,648,0,0,606,486,487,648,0,0,0,0,0,0,606,486,608,0,0,686,0,0,0,0,0, + 486,608,0,0,0,0,0,686,0,0,606,486,486,487,648,0,0,0,0,646,647,648,0,0,0,0,0,0,566,528,486,608,0,0,686,0,0,0,0,0, + 486,608,0,0,0,0,0,686,0,0,646,488,486,608,0,0,0,0,0,0,686,0,0,0,0,566,567,567,528,487,647,648,0,0,686,0,0,0,0,0, + 486,608,0,0,0,566,567,568,0,0,0,646,488,608,0,0,0,0,0,0,686,0,0,0,0,606,486,487,647,648,0,0,0,0,686,0,0,0,0,0, + 486,527,567,568,0,606,486,608,0,0,0,0,606,527,568,0,0,0,0,566,568,0,0,0,0,646,488,608,0,0,0,0,0,0,566,567,568,0,0,0, + 486,486,486,608,0,646,647,648,0,0,0,0,606,486,608,0,0,566,567,528,608,0,0,0,0,0,646,648,0,0,0,0,0,0,606,486,608,0,0,0, + 486,486,486,527,568,0,0,686,0,0,0,0,606,487,648,687,687,606,486,486,608,0,0,0,0,0,0,686,0,0,0,0,0,0,606,487,648,0,0,0, + 486,486,486,486,608,0,0,686,0,0,0,0,606,608,0,0,0,606,486,486,608,0,0,0,0,0,0,566,567,567,568,0,0,566,528,608,0,0,0,0, + 486,486,486,486,608,0,0,566,567,568,0,0,606,608,0,0,0,606,486,486,527,567,567,568,687,687,687,606,486,486,608,0,0,606,486,608,0,0,0,0, + 486,486,486,486,608,0,566,528,486,608,0,0,606,608,0,0,0,606,486,486,486,486,486,608,0,0,0,646,647,647,648,0,0,646,647,648,0,0,0,0, + 486,486,486,486,608,0,606,486,487,648,0,0,646,648,0,0,0,606,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0, + 486,486,486,486,608,0,606,486,608,0,0,0,0,686,0,0,566,528,486,486,486,486,486,527,568,0,0,0,0,0,0,0,0,566,567,568,0,0,0,0, + 486,486,486,486,527,567,528,486,608,0,0,0,0,686,0,0,606,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,608,0,0,0,0, + 486,486,486,486,486,486,486,486,608,0,0,0,0,686,0,0,606,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,527,567,567,567,567, + 486,486,486,486,486,486,486,486,527,567,568,0,0,686,0,0,606,486,486,486,486,486,486,486,527,568,0,0,0,0,0,566,567,528,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,527,567,567,567,567,567,528,486,486,486,486,486,486,486,486,527,567,567,567,567,567,528,486,486,486,486,486,486,486,486, + }; + + obj.createentity(72, 16, 9, 14); // (shiny trinket) + result = contents; + break; + } + + case rn(5,18): + { + + static const short contents[] = { + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,490,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650, + 489,489,611,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0, + 489,489,611,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0, + 489,489,611,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0, + 489,489,611,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0, + 489,489,611,0,0,0,0,569,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570, + 489,489,611,690,690,690,690,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,611,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,611,0,0,0,0,609,489,489,490,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650, + 489,489,611,0,0,0,0,609,489,489,611,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0, + 489,489,611,0,0,0,0,609,489,489,611,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0, + 489,489,611,0,0,0,0,609,489,489,611,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0, + 489,489,611,0,0,0,0,609,489,489,611,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0, + 489,489,611,0,0,0,0,609,489,489,611,0,0,0,0,569,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570, + 489,489,611,0,0,0,0,609,489,489,611,690,690,690,690,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,611,0,0,0,0,609,489,489,611,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,611,0,0,0,0,609,489,489,611,0,0,0,0,609,489,489,490,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650, + 489,489,611,0,0,0,0,609,489,489,611,0,0,0,0,609,489,489,611,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 489,489,611,0,0,0,0,609,489,489,611,0,0,0,0,609,489,489,611,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 489,489,611,0,0,0,0,609,489,489,611,0,0,0,0,609,489,489,611,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 489,489,611,690,690,690,690,609,489,489,611,0,0,0,0,609,489,489,611,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 489,489,611,0,0,0,0,609,489,489,611,0,0,0,0,609,489,489,611,0,0,0,0,569,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570, + 489,489,611,0,0,0,0,609,489,489,611,0,0,0,0,609,489,489,611,690,690,690,690,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,611,0,0,0,0,609,489,489,611,0,0,0,0,609,489,489,611,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,611,0,0,0,0,609,489,489,611,0,0,0,0,609,489,489,611,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,611,0,0,0,0,609,489,489,611,0,0,0,0,609,489,489,611,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,611,0,0,0,0,609,489,489,611,0,0,0,0,609,489,489,611,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,611,0,0,0,0,609,489,489,611,0,0,0,0,609,489,489,611,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + }; + + obj.createentity(224, 160, 13); //Warp Token + + result = contents; + break; + } + + case rn(5,19): + { + + static const short contents[] = { + 492,492,614,0,0,0,0,612,492,492,614,0,0,0,0,612,492,492,614,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,614,0,0,0,0,612,492,492,614,0,0,0,0,612,492,492,614,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,614,0,0,0,0,612,492,492,614,0,0,0,0,612,492,492,614,693,693,693,693,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,614,0,0,0,0,612,492,492,614,0,0,0,0,612,492,492,614,0,0,0,0,652,653,653,494,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,614,0,0,0,0,612,492,492,614,0,0,0,0,612,492,492,614,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,614,693,693,693,693,612,492,492,614,0,0,0,0,612,492,492,614,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,614,0,0,0,0,612,492,492,614,0,0,0,0,612,492,492,614,0,0,0,0,0,0,0,652,653,653,653,653,653,653,653,653,653,653,653,653,653, + 492,492,614,0,0,0,0,612,492,492,614,0,0,0,0,612,492,492,614,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,692,0,0,0, + 492,492,614,0,0,0,0,612,492,492,614,0,0,0,0,612,492,492,533,573,573,574,0,0,0,0,0,692,0,0,0,0,0,0,0,0,692,0,0,0, + 492,492,614,0,0,0,0,612,492,492,614,0,0,0,0,612,492,492,492,492,492,614,0,0,0,0,0,692,0,0,0,0,0,0,0,0,692,0,0,0, + 492,492,614,0,0,0,0,612,492,492,614,693,693,693,693,612,492,492,492,492,492,614,0,0,0,0,0,692,0,0,0,0,0,0,0,0,692,0,0,0, + 492,492,614,0,0,0,0,612,492,492,614,0,0,0,0,652,653,653,494,492,492,533,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573, + 492,492,614,0,0,0,0,612,492,492,614,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,614,0,0,0,0,612,492,492,614,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,614,0,0,0,0,612,492,492,614,0,0,0,0,0,0,0,652,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653, + 492,492,614,0,0,0,0,612,492,492,614,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 492,492,614,0,0,0,0,612,492,492,533,573,573,574,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 492,492,614,0,0,0,0,612,492,492,492,492,492,614,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 492,492,614,693,693,693,693,612,492,492,492,492,492,614,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 492,492,614,0,0,0,0,652,653,653,494,492,492,533,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573, + 492,492,614,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,614,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,614,0,0,0,0,0,0,0,652,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653, + 492,492,614,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0, + 492,492,614,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0, + 492,492,614,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0, + 492,492,614,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0, + 492,492,533,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + }; + result = contents; + break; + } + + case rn(6,2): + { + + static const short contents[] = { + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,481,641,641,641,641,641,641,641,641,482,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,481,641,642,0,0,0,0,0,0,0,0,640,641,482,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,481,641,641,642,0,0,0,0,0,0,0,0,0,0,0,0,640,641,641,482,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,602,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,600,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,481,641,641,642,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,640,641,641,482,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,602,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,600,480,480,480,480,480,480,480, + 480,480,480,480,481,641,641,642,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,640,641,641,482,480,480,480,480, + 480,480,480,480,602,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,600,480,480,480,480, + 641,641,641,641,642,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,640,641,641,641,641, + 0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,560,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,562,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,640,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,642,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + obj.createentity(152, 152, 10, 0, 103060); // (savepoint) + result = contents; + break; + } + + case rn(6,4): + { + + static const short contents[] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,563,564,564,564,564,564,564,564,564,565,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,643,644,644,644,644,644,644,644,644,645,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,683,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,683,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,683,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,683,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,683,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,683,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,683,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,683,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,683,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,563,564,564,564,564,564,565,0,0,0,0,0,683,0,0,0,0,683,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,524,564,565,0,0,0,683,0,0,0,0,683,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,643,485,483,483,483,483,483,483,524,564,565,0,683,0,0,0,0,683,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,524,564,565,0,0,0,0,683,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,643,485,483,483,483,483,483,483,483,483,483,524,564,565,0,0,683,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,524,564,564,565,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,643,485,483,483,483,483,483,483,483,483,483,483,483,483,483,524,564,564,565,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,524,564,564,564,564, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,643,485,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + }; + + obj.createentity(128, 120, 10, 1, 4060); // (savepoint) + result = contents; + break; + } + + case rn(6,5): + { + + static const short contents[] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,658,500,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,658,500,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,658,500,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,658,500,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,658,500,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,658,500,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,658,500,498,498,498,498,498,498,498,498,498,498,498,498,498, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498, + }; + result = contents; + break; + } + + case rn(6,6): + { + + static const short contents[] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,566,528,486,486,486,486,486,486,486,486,486,486,486,486,486, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,566,528,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,646,488,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,646,488,486,486,486,486,486,486,486,486,486,486,486,486,486, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486, + 0,0,0,0,0,566,567,567,567,567,567,567,567,567,567,567,567,567,567,568,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486, + 687,687,687,687,687,606,486,486,486,486,486,486,486,486,486,486,486,486,486,608,687,687,687,687,687,687,646,488,486,486,486,486,486,486,486,486,486,486,486,486, + 0,0,0,0,0,646,647,488,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486, + 0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,608,687,687,687,687,687,687,687,646,488,486,486,486,486,486,486,486,486,486,486,486, + 0,0,0,0,0,0,0,646,647,647,647,647,647,647,647,647,647,647,647,648,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486, + 0,0,0,0,0,0,0,0,0,0,0,0,687,687,688,687,687,687,687,687,687,687,687,687,687,687,687,687,606,486,486,486,486,486,486,486,486,486,486,486, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486, + 0,0,0,0,0,0,0,0,0,0,0,0,566,567,567,567,568,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486, + 0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,608,0,0,0,0,0,0,0,0,0,0,566,528,486,486,486,486,486,486,486,486,486,486,486, + 0,0,0,0,0,0,0,0,0,0,0,0,646,647,647,647,648,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,566,528,486,486,486,486,486,486,486,486,486,486,486,486, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486, + }; + result = contents; + break; + } + + case rn(6,7): + { + + static const short contents[] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489, + 0,0,0,0,0,0,0,569,570,570,571,0,0,0,0,0,0,0,0,0,0,0,0,0,0,569,531,489,489,489,489,489,489,489,489,489,489,489,489,489, + 0,0,0,0,0,0,0,609,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 0,0,0,0,0,0,569,531,489,489,530,571,0,0,0,0,0,0,0,0,0,0,0,569,570,531,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 0,0,0,0,0,0,609,489,489,489,489,530,571,0,0,0,0,0,0,569,570,570,570,531,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 570,570,570,570,570,570,531,489,489,489,489,489,530,570,570,570,570,570,570,531,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + }; + + obj.createentity(64, 88, 10, 1, 7060); // (savepoint) + result = contents; + break; + } + + case rn(6,8): + { + + static const short contents[] = { + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 653,653,653,653,653,653,653,653,653,653,653,653,494,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 0,0,0,0,0,0,0,0,0,0,0,0,652,653,494,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,652,653,494,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,652,653,494,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,652,494,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,652,494,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,652,494,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,652,494,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + }; + result = contents; + break; + } + + case rn(6,9): + { + + static const short contents[] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,563,525,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,563,525,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,563,525,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,563,525,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,563,525,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + }; + result = contents; + break; + } + + case rn(6,10): + { + + static const short contents[] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,658,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,698,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,698,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,698,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,698,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,578,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,578,540,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 0,0,0,0,0,0,0,0,0,0,0,0,0,578,540,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 699,699,699,699,699,699,699,699,699,699,699,699,699,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 0,0,0,0,0,0,0,0,0,0,0,0,0,658,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,698,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,698,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,698,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,698,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,578,579,579,579,579,579,579,579,579,579, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498, + }; + + obj.createentity(152, 128, 10, 0, 10060); // (savepoint) + result = contents; + break; + } + + case rn(6,11): + { + + static const short contents[] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,575,576,577,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,617,696,696,696,696,696,696,696,615,495,495,495,495,495,495,495,495,495, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,617,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,617,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,617,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,617,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,617,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,617,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495, + 0,0,0,0,0,0,0,0,0,0,0,0,0,575,576,577,0,0,0,0,615,495,617,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495, + 0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,617,0,0,0,0,615,495,617,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495, + 0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,617,696,696,696,696,615,495,617,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495, + 0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,617,0,0,0,0,615,495,617,696,696,696,696,696,696,696,615,495,495,495,495,495,495,495,495,495, + 0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,617,0,0,0,0,655,656,657,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495, + 0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,617,0,0,0,0,0,695,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495, + 0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,617,0,0,0,0,0,695,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495, + 0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,617,696,696,696,696,696,697,696,696,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495, + 0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,617,0,0,0,0,0,695,0,0,0,0,0,0,0,0,655,656,497,495,495,495,495,495,495,495, + 0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,617,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,655,656,497,495,495,495,495,495, + 0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,655,497,495,495,495,495, + 0,0,0,0,0,0,0,0,0,0,0,0,0,655,656,657,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,655,656,656,656,656, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + result = contents; + break; + } + + case rn(6,12): + { + + static const short contents[] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,569,570,570,570,570,570,571,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,649,491,489,489,489,490,651,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,649,650,650,650,651,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + result = contents; + break; + } + + case rn(6,13): + { + + static const short contents[] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 687,687,687,687,687,687,687,687,687,687,687,687,687,687,687,687,688,687,687,687,687,687,687,687,687,687,687,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 567,567,567,567,567,567,567,567,567,567,567,567,568,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 486,486,486,486,486,486,486,486,486,486,486,486,527,567,567,567,567,567,568,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,527,567,568,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + result = contents; + break; + } + + case rn(6,14): + { + + static const short contents[] = { + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 480,480,480,480,480,480,480,480,480,480,480,480,480,481,641,641,641,641,641,641,642,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 480,480,480,480,480,480,480,480,480,481,641,641,641,642,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 480,480,480,480,481,641,641,641,641,642,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 641,641,641,641,642,0,0,680,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 561,561,561,561,561,561,561,561,561,561,561,561,561,562,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 480,480,480,480,480,480,480,480,480,480,480,480,480,521,561,561,561,561,561,561,561,562,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,521,561,561,561,561,561,561,561,561,562,0,0,0,0,0,0,0,0,0, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,521,561,561,561,561,561,561,561,561,561, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + }; + result = contents; + break; + } + + + case rn(6,15): + { + + static const short contents[] = { + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,490,650,650,650,650,650,491,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 650,650,650,650,650,650,491,489,611,0,0,0,0,0,609,489,490,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650, + 0,689,0,0,0,0,609,489,611,0,0,0,0,0,649,650,651,0,0,0,0,0,689,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,689,0, + 570,570,571,690,690,690,609,489,611,0,0,0,0,0,0,689,0,0,0,0,569,570,570,571,0,0,0,0,689,0,0,0,0,0,0,0,0,0,689,0, + 489,489,611,0,0,0,649,650,651,0,0,0,0,0,569,570,570,570,571,690,609,489,489,611,0,0,0,0,689,0,0,0,0,0,0,0,0,0,689,0, + 650,650,651,0,0,0,0,0,0,0,0,569,570,570,531,489,489,489,611,0,649,650,650,651,0,0,0,0,689,0,0,0,0,0,0,0,0,0,689,0, + 0,0,0,0,0,0,0,0,0,0,0,609,489,489,490,650,650,650,651,0,0,0,0,0,0,0,0,569,570,571,0,0,0,0,0,0,0,569,570,570, + 0,0,0,0,0,0,0,0,0,0,0,649,650,650,651,0,0,689,0,0,0,0,0,0,0,0,569,531,489,611,0,0,0,0,0,0,569,531,489,489, + 0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,569,570,571,0,0,0,0,0,0,0,609,489,490,651,0,0,0,0,0,0,609,489,489,489, + 0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,609,489,611,0,0,0,0,0,0,0,649,650,651,0,0,0,0,0,0,569,531,489,489,489, + 0,0,0,0,0,0,0,0,0,0,0,0,569,570,571,0,649,491,530,570,571,0,0,0,0,0,0,0,0,0,0,0,0,0,569,531,489,489,489,489, + 0,0,0,0,0,569,570,571,0,0,0,0,609,489,611,0,0,609,489,489,611,0,0,0,0,0,0,0,569,570,571,0,0,569,531,489,489,489,489,489, + 0,0,0,0,569,531,489,530,571,0,0,0,649,650,651,0,0,609,489,490,651,0,0,0,0,0,0,0,609,489,611,0,0,609,489,489,489,489,489,489, + 0,0,0,0,609,489,489,489,611,0,0,0,0,0,0,0,0,649,650,651,0,0,0,0,569,570,570,570,531,490,651,0,0,609,489,489,489,489,489,489, + 0,0,0,0,609,489,489,489,611,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,609,489,489,489,489,611,0,0,0,609,489,489,489,489,489,489, + 0,0,0,0,609,489,489,489,611,0,0,0,0,0,0,0,0,0,0,569,570,571,690,690,649,650,650,491,489,611,0,0,0,649,650,491,489,489,489,489, + 0,0,0,0,649,650,491,489,611,0,0,0,0,0,0,0,0,0,0,609,489,611,0,0,0,0,0,609,490,651,0,0,0,0,0,609,489,489,489,489, + 0,0,0,0,0,0,609,489,611,0,0,0,0,569,570,570,571,0,0,609,489,611,0,0,0,0,569,531,611,0,0,0,0,0,0,609,489,489,489,489, + 0,0,0,0,0,0,609,489,530,570,571,0,0,609,489,489,530,570,570,531,489,611,0,0,0,0,609,489,611,0,0,0,0,0,0,609,489,489,489,489, + 0,0,0,0,0,0,609,489,489,489,611,690,690,649,650,491,489,490,650,650,650,651,0,0,0,0,609,489,611,0,0,0,0,569,570,531,489,489,489,489, + 0,0,0,0,0,0,609,489,490,650,651,0,0,0,0,609,489,611,0,0,0,0,0,0,0,0,609,489,530,571,0,0,0,609,489,489,489,489,489,489, + 0,0,0,0,569,570,531,489,611,0,0,0,0,0,0,649,650,651,0,0,0,0,0,0,0,0,609,489,489,611,690,690,690,609,489,489,489,489,489,489, + 0,0,0,0,609,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,611,0,0,0,609,489,489,489,489,489,489, + 0,0,0,0,609,489,490,650,651,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,649,491,489,611,0,0,0,649,650,491,489,489,489,489, + 570,570,570,570,531,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,569,570,571,0,0,0,0,609,489,611,0,0,0,0,0,609,489,489,489,489, + 489,489,489,489,489,489,530,570,570,570,570,570,570,571,0,0,0,0,0,0,609,489,530,570,570,570,570,531,489,530,570,570,570,570,570,531,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,530,570,570,570,570,570,570,531,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + }; + + if(!game.intimetrial) + { + obj.createentity(96, 48, 20, 1);//Terminal + obj.createblock(5, 96 - 4, 48, 20, 16, 12); + } + + obj.createentity(128, 216, 10, 1, 116061); // (savepoint) + result = contents; + break; + } + + case rn(6,18): + { + + static const short contents[] = { + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,485,483,483, + 0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,603,483,483, + 0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,603,483,483, + 0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,603,483,483, + 0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,603,483,483, + 564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,565,0,0,0,0,603,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,684,684,684,684,603,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,603,483,483, + 644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,485,483,483,605,0,0,0,0,603,483,483, + 0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,603,483,483,605,0,0,0,0,603,483,483, + 0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,603,483,483,605,0,0,0,0,603,483,483, + 0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,603,483,483,605,0,0,0,0,603,483,483, + 0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,603,483,483,605,0,0,0,0,603,483,483, + 564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,565,0,0,0,0,563,564,564,565,0,0,0,0,603,483,483,605,0,0,0,0,603,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,603,483,483,605,684,684,684,684,603,483,483,605,0,0,0,0,603,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,603,483,483,605,0,0,0,0,603,483,483,605,0,0,0,0,603,483,483, + 644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,645,0,0,0,0,603,483,483,605,0,0,0,0,603,483,483,605,0,0,0,0,603,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,603,483,483,605,0,0,0,0,603,483,483,605,0,0,0,0,603,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,603,483,483,605,0,0,0,0,603,483,483,605,0,0,0,0,603,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,603,483,483,605,0,0,0,0,603,483,483,605,684,684,684,684,603,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,603,483,483,605,0,0,0,0,603,483,483,605,0,0,0,0,603,483,483, + 564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,565,0,0,0,0,603,483,483,605,0,0,0,0,603,483,483,605,0,0,0,0,603,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,684,684,684,684,603,483,483,605,0,0,0,0,603,483,483,605,0,0,0,0,603,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,603,483,483,605,0,0,0,0,603,483,483,605,0,0,0,0,603,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,603,483,483,605,0,0,0,0,603,483,483,605,0,0,0,0,603,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,603,483,483,605,684,684,684,684,603,483,483,605,0,0,0,0,603,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,603,483,483,605,0,0,0,0,603,483,483,605,0,0,0,0,603,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,603,483,483,605,0,0,0,0,603,483,483,605,0,0,0,0,603,483,483, + }; + result = contents; + break; + } + + case rn(6,19): + { + + static const short contents[] = { + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,606,486,486,608,0,0,0,0,606,486,486,608,0,0,0,0,606,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,606,486,486,608,0,0,0,0,606,486,486,608,0,0,0,0,606,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,606,486,486,608,0,0,0,0,606,486,486,608,0,0,0,0,606,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,606,486,486,608,0,0,0,0,606,486,486,608,0,0,0,0,606,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,606,486,486,608,0,0,0,0,606,486,486,608,0,0,0,0,606,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,687,687,687,687,606,486,486,608,687,687,687,687,606,486,486,608,687,687,687,687,606,486,486, + 647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,648,0,0,0,0,606,486,486,608,0,0,0,0,606,486,486,608,0,0,0,0,606,486,486, + 0,0,0,686,0,0,0,0,0,686,0,0,0,0,0,686,0,0,0,0,0,606,486,486,608,0,0,0,0,606,486,486,608,0,0,0,0,606,486,486, + 0,0,0,686,0,0,0,0,0,686,0,0,0,0,0,686,0,0,0,0,0,606,486,486,608,0,0,0,0,606,486,486,608,0,0,0,0,606,486,486, + 0,0,0,686,0,0,0,0,0,686,0,0,0,0,0,686,0,0,0,0,0,606,486,486,608,0,0,0,0,606,486,486,608,0,0,0,0,606,486,486, + 0,0,0,686,0,0,0,0,0,686,0,0,0,0,0,686,0,0,0,0,0,606,486,486,608,0,0,0,0,606,486,486,608,0,0,0,0,606,486,486, + 567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,528,486,486,608,0,0,0,0,606,486,486,608,0,0,0,0,606,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,606,486,486,608,0,0,0,0,606,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,687,687,687,687,606,486,486,608,687,687,687,687,606,486,486, + 647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,648,0,0,0,0,606,486,486,608,0,0,0,0,606,486,486, + 0,0,0,686,0,0,0,0,0,686,0,0,0,0,0,686,0,0,0,0,0,0,0,686,0,0,0,0,0,606,486,486,608,0,0,0,0,606,486,486, + 0,0,0,686,0,0,0,0,0,686,0,0,0,0,0,686,0,0,0,0,0,0,0,686,0,0,0,0,0,606,486,486,608,0,0,0,0,606,486,486, + 0,0,0,686,0,0,0,0,0,686,0,0,0,0,0,686,0,0,0,0,0,0,0,686,0,0,0,0,0,606,486,486,608,0,0,0,0,606,486,486, + 0,0,0,686,0,0,0,0,0,686,0,0,0,0,0,686,0,0,0,0,0,0,0,686,0,0,0,0,0,606,486,486,608,0,0,0,0,606,486,486, + 567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,568,0,0,0,0,606,486,486,608,0,0,0,0,606,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,606,486,486,608,0,0,0,0,606,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,606,486,486,608,687,687,687,687,606,486,486, + 647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,648,0,0,0,0,646,647,647,648,0,0,0,0,606,486,486, + 0,0,0,686,0,0,0,0,0,686,0,0,0,0,0,686,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,686,0,0,0,0,0,606,486,486, + 0,0,0,686,0,0,0,0,0,686,0,0,0,0,0,686,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,686,0,0,0,0,0,606,486,486, + 0,0,0,686,0,0,0,0,0,686,0,0,0,0,0,686,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,686,0,0,0,0,0,606,486,486, + 0,0,0,686,0,0,0,0,0,686,0,0,0,0,0,686,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,686,0,0,0,0,0,606,486,486, + 567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,528,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + }; + result = contents; + break; + } + + case rn(7,1): + { + + static const short contents[] = { + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,487,647,647,647,647,647,647,647,647,647,647,647,647,647,647,488,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,686,0,0,686,0,0,686,0,0,686,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,686,0,0,686,0,0,686,0,0,686,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,686,0,0,686,0,0,686,0,0,686,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,686,0,0,686,0,0,686,0,0,686,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,527,567,567,567,567,567,567,567,567,567,567,567,567,567,567,528,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + }; + + obj.createentity(192, 104, 13); //Warp Token + + result = contents; + break; + } + + case rn(7,2): + { + + static const short contents[] = { + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 653,653,653,653,653,653,653,653,653,653,494,492,492,492,493,653,653,653,653,653,653,653,653,653,653,653,494,492,492,492,492,492,492,492,493,653,653,653,653,653, + 0,0,0,0,0,0,0,0,0,0,612,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,493,654,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,612,492,492,493,654,0,0,0,0,0,0,0,0,0,0,0,652,494,492,492,492,492,492,614,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,612,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,493,654,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,652,653,653,654,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,493,654,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,652,494,492,493,654,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,614,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,652,653,654,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + obj.createentity(88, 136, 10, 0, 103070); // (savepoint) + result = contents; + break; + } + + case rn(7,3): + { + + static const short contents[] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,575,576,576,576,576,577,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,575,576,537,495,495,495,495,536,576,577,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,575,537,495,495,495,495,495,495,495,495,536,577,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,575,537,495,495,496,656,656,656,656,497,495,495,536,577,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,496,657,0,0,0,0,655,497,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,575,537,495,496,657,0,0,0,0,0,0,655,497,495,536,577,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,617,0,0,0,575,577,0,0,0,615,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,617,0,0,575,537,536,577,0,0,615,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,617,0,0,615,495,495,617,0,0,615,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,617,0,0,655,497,496,657,0,0,615,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,617,0,0,0,655,657,0,0,0,615,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,655,497,495,536,577,0,0,0,0,0,0,575,537,495,496,657,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,536,577,0,0,0,0,575,537,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,655,497,495,495,536,576,576,576,576,537,495,495,496,657,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,655,497,495,495,495,495,495,495,495,495,496,657,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,655,656,497,495,495,495,495,496,656,657,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,655,656,656,656,656,657,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + result = contents; + break; + } + + case rn(7,4): + { + + static const short contents[] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,566,567,567,567,567,567,567, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,566,567,567,567,567,567,568,0,0,0,606,486,486,486,486,486,486, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,608,0,0,0,606,486,486,486,486,486,486, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,608,0,0,0,606,486,486,486,486,486,486, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,566,567,567,567,567,568,0,0,0,606,486,486,486,486,486,608,0,0,0,606,486,486,486,486,486,486, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,608,0,0,0,606,486,486,486,486,486,527,567,567,567,528,486,486,486,486,486,486, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,608,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 567,567,567,567,567,567,567,567,567,567,568,0,0,0,606,486,486,486,486,608,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,608,0,0,0,606,486,486,486,486,527,567,567,567,528,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,608,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,608,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,527,567,567,567,528,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + }; + + obj.createentity(208, 128, 10, 1, 4070); // (savepoint) + result = contents; + break; + } + + case rn(7,5): + { + + static const short contents[] = { + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,481,641,641,641,641,482,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,481,641,642,0,0,680,0,640,641,482,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,680,0,0,0,640,641,482,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,481,642,0,0,0,0,680,0,0,0,0,680,600,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,680,0,0,0,0,680,640,482,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,680,0,0,0,0,680,0,600,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,560,561,562,0,0,0,680,0,640,482,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,600,480,602,0,0,0,680,0,0,600,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,600,480,521,562,0,0,680,0,0,640,482,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,600,480,480,602,0,0,680,0,0,0,600,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,681,681,681,681,600,480,480,521,562,0,680,0,0,0,640,641,482,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,600,480,480,480,602,0,680,0,0,0,680,0,640,641,641, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,600,480,480,480,521,561,562,0,0,0,680,0,0,0,0, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,600,480,480,480,480,480,602,0,0,0,680,0,0,0,0, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,481,642,0,0,0,0,600,480,480,480,480,480,602,0,0,0,680,0,0,0,0, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,600,480,480,480,480,480,521,561,562,0,680,0,0,0,0, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,681,681,681,681,681,600,480,480,480,480,480,480,480,521,561,561,561,561,561,561, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + }; + result = contents; + break; + } + + case rn(7,6): + { + + static const short contents[] = { + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,693,693,693,693,693,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,493,653,654,0,0,0,0,572,534,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,692,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,692,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,493,654,0,692,0,0,0,572,534,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,692,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,692,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,493,654,0,0,692,0,572,573,534,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,692,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,692,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,692,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,572,573,534,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,693,693,693,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,693,693,693,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + }; + result = contents; + break; + } + + case rn(7,7): + { + + static const short contents[] = { + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,690,690,690,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,490,651,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,649,491,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,490,651,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,611,690,690,690,690,690,690,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,649,491,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,490,651,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,611,690,690,690,690,690,690,690,690,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,649,491,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,490,651,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,649,491,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,611,690,690,690,690,690,690,690,690,690,690,690,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,490,651,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,649,491,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + }; + result = contents; + break; + } + + case rn(7,8): + { + + static const short contents[] = { + 480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,640,482,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,481,642,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,640,482,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,481,642,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,602,681,681,681,681,681,681,681,681,681,681,681,681,681,681,681,681,681,600,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,640,482,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,481,642,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,481,642,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,640,482,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,602,681,681,681,681,681,681,681,681,681,681,681,681,681,681,681,681,681,681,681,681,681,600,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,481,642,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,640,482,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,640,482,480,480,480,480,480,480,480,480,480, + 480,480,480,480,481,642,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480, + 480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480, + 480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480, + 480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480, + 480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480, + }; + result = contents; + break; + } + + case rn(7,9): + { + + static const short contents[] = { + 483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483, + 483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483, + 483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483, + 483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483, + 483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,563,564,564,564,564,564,564,564,564,525,483,483,483,483,483,483,483,483,483, + 483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,563,564,525,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,643,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644, + 483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,683,0,0,683,0,0,0,0,0,0,0,0, + 483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,683,0,0,683,0,0,0,0,0,0,0,0, + 483,483,483,483,605,684,684,684,684,684,684,684,684,684,684,684,684,684,684,684,684,684,684,684,684,685,684,684,685,684,684,685,684,684,0,0,0,0,0,0, + 483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,683,0,0,683,0,0,0,0,0,0,0,0, + 483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,683,0,0,683,0,0,0,0,0,0,0,0, + 483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,683,0,0,683,0,0,0,0,0,0,0,0, + 483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,683,0,0,683,0,0,0,0,0,0,0,0, + 483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,683,0,0,683,0,0,0,0,0,0,0,0, + 483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,683,0,0,683,0,0,0,0,0,0,0,0, + 483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,683,0,0,683,0,0,0,0,0,0,0,0, + 483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,683,0,0,683,0,0,0,0,0,0,0,0, + 483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,683,0,0,683,0,0,0,0,0,0,0,0, + 483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,683,0,0,683,0,0,0,0,0,0,0,0, + 483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,563,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564, + 483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,524,565,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,563,525,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,524,565,0,0,0,0,0,0,0,0,0,0,0,0,0,0,563,525,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,524,564,564,564,564,564,564,564,564,564,564,564,564,564,564,525,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + }; + + obj.createentity(64, 112, 14); //Teleporter! + result = contents; + break; + } + + case rn(7,10): + { + + static const short contents[] = { + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,497,495,495,495, + 0,0,695,0,0,0,0,0,695,0,0,0,0,695,0,0,0,0,695,0,0,0,0,695,0,0,0,0,695,0,0,0,695,0,0,0,615,495,495,495, + 0,0,695,0,0,0,0,0,695,0,0,0,0,695,0,0,0,0,695,0,0,0,0,695,0,0,0,0,695,0,0,0,695,0,0,0,615,495,495,495, + 0,0,695,0,0,0,0,0,695,0,0,0,0,695,0,0,0,0,695,0,0,0,0,695,0,0,0,0,695,0,0,0,695,0,0,0,615,495,495,495, + 0,0,695,0,0,0,0,0,695,0,0,0,0,695,0,0,0,0,695,0,0,0,0,695,0,0,0,0,695,0,0,0,695,0,0,0,615,495,495,495, + 576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,577,0,0,575,576,576,576,576,576,577,0,0,615,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,696,696,615,495,495,495,495,495,617,696,696,615,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,496,656,656,656,656,656,656,656,497,495,617,0,0,615,495,495,495,495,495,617,0,0,615,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,695,0,0,0,615,495,617,0,0,615,495,495,495,495,495,617,0,0,615,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,695,0,0,0,615,495,617,0,0,615,495,495,495,495,495,617,0,0,615,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,695,0,0,0,615,495,617,0,0,615,495,495,495,495,495,617,0,0,615,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,695,0,0,0,615,495,617,0,0,615,495,495,495,495,495,617,0,0,615,495,495,495, + 656,656,656,656,656,656,656,656,656,656,656,656,497,495,617,0,0,575,576,577,0,0,615,495,617,0,0,615,495,495,495,495,495,617,696,696,615,495,495,495, + 0,0,695,0,0,0,0,0,695,0,0,0,615,495,617,696,696,615,495,617,696,696,615,495,617,0,0,615,495,495,495,495,495,617,0,0,615,495,495,495, + 0,0,695,0,0,0,0,0,695,0,0,0,615,495,617,0,0,615,495,617,0,0,615,495,617,0,0,615,495,495,495,495,495,617,0,0,615,495,495,495, + 0,0,695,0,0,0,0,0,695,0,0,0,615,495,617,0,0,615,495,617,0,0,615,495,617,0,0,615,495,495,495,495,495,617,0,0,615,495,495,495, + 0,0,695,0,0,0,0,0,695,0,0,0,615,495,617,0,0,615,495,617,0,0,615,495,617,0,0,615,495,495,495,495,495,617,0,0,615,495,495,495, + 576,576,576,576,576,576,576,576,576,577,0,0,615,495,617,0,0,615,495,617,0,0,615,495,617,0,0,615,495,495,495,495,495,617,0,0,615,495,495,495, + 495,495,495,495,495,495,495,495,495,617,696,696,615,495,617,696,696,615,495,617,696,696,615,495,617,696,696,615,495,495,495,495,495,617,696,696,615,495,495,495, + 495,495,495,495,495,495,495,495,495,617,0,0,655,656,657,0,0,615,495,617,0,0,655,656,657,0,0,615,495,495,495,495,495,617,0,0,615,495,495,495, + 495,495,495,495,495,495,495,495,495,617,0,0,0,695,0,0,0,615,495,617,0,0,0,695,0,0,0,615,495,495,495,495,495,617,0,0,615,495,495,495, + 495,495,495,495,495,495,495,495,495,617,0,0,0,695,0,0,0,615,495,617,0,0,0,695,0,0,0,615,495,495,495,495,495,617,0,0,615,495,495,495, + 495,495,495,495,495,495,495,495,495,617,0,0,0,695,0,0,0,615,495,617,0,0,0,695,0,0,0,615,495,495,495,495,495,617,0,0,615,495,495,495, + 495,495,495,495,495,495,495,495,495,617,0,0,0,695,0,0,0,615,495,617,0,0,0,695,0,0,0,615,495,495,495,495,495,617,0,0,615,495,495,495, + 495,495,495,495,495,495,495,495,495,536,576,576,576,576,576,576,576,537,495,536,576,576,576,576,576,576,576,537,495,495,495,495,495,617,696,696,615,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,615,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,615,495,495,495, + }; + result = contents; + break; + } + + case rn(7,11): + { + + static const short contents[] = { + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,606,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,687,687,606,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,606,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,606,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,687,687,606,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,606,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,606,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,687,687,606,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,487,647,647,647,647,647,647,647,647,648,0,0,606,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,686,0,0,0,686,0,0,0,606,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,686,0,0,0,686,0,0,0,606,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,686,0,0,0,686,0,0,0,606,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,686,0,0,0,686,0,0,0,606,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,566,567,567,567,567,567,567,567,567,528,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,687,687,606,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,687,687,606,486,486,486,486,486,486,486,487,647,647,647,647, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,646,647,647,647,647,647,647,647,648,0,0,0,0, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,487,647,647,647,648,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,487,647,647,647,648,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 486,486,486,486,486,486,486,486,486,486,486,487,647,647,647,647,648,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 486,486,486,486,486,487,647,647,647,647,647,648,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 647,647,647,647,647,648,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + result = contents; + break; + } + + case rn(7,14): + { + + static const short contents[] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,563,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,565,0,0,0,0,0,0, + 0,0,0,0,0,0,0,563,564,525,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,484,644,645,0,0,0,0,0,0, + 0,0,0,0,0,0,0,643,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,645,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,563,564,564,564,564,564,564,564,564,564,564,564, + 0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483, + 564,564,564,564,564,564,564,564,564,564,564,564,565,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,605,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,603,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,524,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,525,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + }; + + obj.createentity(48, 192, 10, 1, 14070); // (savepoint) + result = contents; + break; + } + + case rn(8,0): + { + + static const short contents[] = { + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,655,497,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,6,0,0,0,0,0,0,0,7,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,536,577,0,0,0,0,0,0,0,0,655,497,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,7,615,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,655,497,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,6,0,0,0,0,0,0,0,0,7,615,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,536,577,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,655,497,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,7,615,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,655,497,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,7,615,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,655,497,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,7,615,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,655,497,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,7,615,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495, + }; + result = contents; + break; + } + + case rn(8,1): + { + + static const short contents[] = { + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,530,571,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,569,531,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,569,531,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,530,571,0,0,0,0,0,0,0,0,569,531,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,690,690,690,690,690,690,690,690,609,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,569,531,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,690,690,690,690,690,690,690,609,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,569,531,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,530,571,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,690,690,690,690,690,609,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,569,531,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,530,571,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,690,690,690,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + }; + result = contents; + break; + } + + case rn(8,2): + { + + static const short contents[] = { + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,687,687,687,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,646,488,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,687,687,687,687,646,488,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,646,647,488,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,646,647,647,647,488,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,487,647,647,648,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,487,647,647,647,648,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,487,647,647,647,647,648,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486, + 486,486,486,486,486,487,647,647,647,648,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486, + 647,647,647,647,647,648,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,646,488,486,486,486,486,486, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486, + }; + result = contents; + break; + } + + case rn(8,3): + { + + static const short contents[] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,643,485,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,563,564,564,564,564,564,564,564,564,564,564,565,0,0,0,0,0,0,0,0,0,603,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,605,684,684,684,684,684,684,684,684,684,603,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,643,644,644,644,644,644,644,644,644,644,644,645,0,0,0,0,0,0,0,0,0,603,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,643,485,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483, + 0,0,0,0,0,0,563,564,564,564,564,564,564,564,564,564,564,564,564,565,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483, + 0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,605,684,684,684,684,684,684,684,684,684,684,684,684,684,684,684,684,603,483,483,483, + 0,0,0,0,0,0,643,644,644,644,644,644,644,644,644,644,644,644,644,645,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483, + }; + result = contents; + break; + } + + case rn(8,4): + { + + static const short contents[] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,621,501,501,501, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,621,501,501,501, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,621,501,501,501, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,621,501,501,501, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,621,501,501,501, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,621,501,501,501, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,581,582,543,501,501,501, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,581,582,582,582,543,501,501,501,501,501, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,621,501,501,501,501,501,501,501,501,501, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,621,501,501,501,501,501,501,501,501,501, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,621,501,501,501,501,501,501,501,501,501, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,621,501,501,501,501,501,501,501,501,501, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,581,582,582,582,583,0,0,0,0,0,0,0,0,0,0,621,501,501,501,501,501,501,501,501,501, + 0,0,0,0,0,0,0,0,0,581,582,582,582,582,582,543,501,501,501,542,582,583,0,0,0,0,0,0,0,0,621,501,501,501,501,501,501,501,501,501, + 0,0,0,0,581,582,582,582,582,543,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,0,0,581,543,501,501,501,501,501,501,501,501,501, + 582,582,582,582,543,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,0,0,621,501,501,501,501,501,501,501,501,501,501, + 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,702,702,702,702,702,702,702,621,501,501,501,501,501,501,501,501,501,501, + 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,0,0,621,501,501,501,501,501,501,501,501,501,501, + 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,0,0,621,501,501,501,501,501,501,501,501,501,501, + 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,0,0,621,501,501,501,501,501,501,501,501,501,501, + 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,542,583,0,0,0,0,0,0,621,501,501,501,501,501,501,501,501,501,501, + 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,581,543,501,501,501,501,501,501,501,501,501,501, + 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,621,501,501,501,501,501,501,501,501,501,501,501, + 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,621,501,501,501,501,501,501,501,501,501,501,501, + 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,621,501,501,501,501,501,501,501,501,501,501,501, + 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,621,501,501,501,501,501,501,501,501,501,501,501, + 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,702,702,702,702,702,621,501,501,501,501,501,501,501,501,501,501,501, + 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,621,501,501,501,501,501,501,501,501,501,501,501, + 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,621,501,501,501,501,501,501,501,501,501,501,501, + 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,621,501,501,501,501,501,501,501,501,501,501,501, + }; + result = contents; + break; + } + + case rn(8,5): + { + + static const short contents[] = { + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,496,656,656,656,656,656,656,656,656,656,497,495,495,495,495,617,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,496,656,657,0,0,0,695,0,0,0,0,0,655,497,495,495,495,617,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,617,0,0,0,0,0,695,0,0,0,0,0,0,655,497,495,495,536,577,0,0,0,0,655,497,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,496,657,0,0,0,0,0,695,0,0,0,0,0,0,0,655,497,495,495,617,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,617,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,615,495,495,536,577,0,0,0,0,655,497,495,495,495,495,495,495,495,495,495, + 495,495,495,495,617,0,0,0,0,575,576,576,577,0,0,0,0,0,0,0,615,495,495,495,617,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495, + 495,495,495,495,617,0,0,0,575,537,495,495,536,577,0,0,0,0,0,0,655,497,495,495,617,0,0,0,0,0,655,497,495,495,495,495,495,495,495,495, + 495,495,495,495,617,696,696,696,655,497,495,495,495,536,577,0,0,0,0,0,0,615,495,495,617,0,0,0,0,0,0,655,497,495,495,495,495,495,495,495, + 495,495,495,495,617,0,0,0,0,615,495,495,495,495,536,577,0,0,0,0,0,655,497,495,536,577,0,0,0,0,0,0,615,495,495,495,495,495,495,495, + 495,495,495,495,617,0,0,0,0,655,497,495,495,495,495,617,0,0,0,0,0,0,615,495,495,617,0,0,0,0,0,0,655,497,495,495,495,495,495,495, + 495,495,495,495,617,0,0,0,0,0,655,656,497,495,495,617,696,696,696,696,696,696,615,495,495,536,577,0,0,0,0,0,0,615,495,495,495,495,495,495, + 495,495,495,495,617,0,0,0,0,0,0,0,615,495,495,617,0,0,0,0,0,0,615,495,495,495,617,0,0,0,0,0,0,655,497,495,495,495,495,495, + 495,495,495,495,536,576,577,0,0,0,0,0,655,497,495,536,577,0,0,0,0,0,615,495,495,495,536,577,0,0,0,0,0,0,615,495,495,495,495,495, + 495,495,495,495,495,495,617,0,0,0,0,0,0,615,495,495,536,577,0,0,0,0,655,497,495,495,495,536,577,0,0,0,0,0,615,495,495,495,495,495, + 495,495,495,495,495,495,536,577,0,0,0,0,0,615,495,495,495,617,0,0,0,0,0,615,495,495,495,495,617,0,0,0,0,0,615,495,495,495,495,495, + 495,495,495,495,495,495,495,617,0,0,0,0,0,655,497,495,495,617,696,696,696,696,696,615,495,495,495,495,536,577,0,0,0,0,655,497,495,495,495,495, + 495,495,495,495,495,495,495,536,577,0,0,0,0,0,615,495,495,617,0,0,0,0,0,615,495,495,495,495,495,617,0,0,0,0,0,615,495,495,495,495, + 495,495,495,495,495,495,495,495,617,0,0,0,0,0,615,495,495,617,0,0,0,0,0,655,497,495,495,495,495,617,0,0,0,0,0,615,495,495,495,495, + 495,495,495,495,495,495,495,495,617,0,0,0,0,0,615,495,495,617,0,0,0,0,0,0,615,495,495,495,495,617,696,696,696,696,696,615,495,495,495,495, + 495,495,495,495,495,495,496,656,657,0,0,0,0,0,615,495,495,536,577,0,0,0,0,0,655,497,495,495,496,657,0,0,0,0,0,615,495,495,495,495, + 656,656,656,656,656,656,657,0,0,0,0,0,0,0,615,495,495,495,617,0,0,0,0,0,0,655,656,656,657,0,0,0,0,0,0,615,495,495,495,495, + 0,0,0,695,0,0,0,0,0,0,0,0,0,0,615,495,495,495,617,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,575,537,495,495,495,495, + 0,0,0,695,0,0,0,0,0,0,0,0,0,575,537,495,495,495,536,577,0,0,0,0,0,0,0,695,0,0,0,0,0,0,615,495,495,495,495,495, + 0,0,0,695,0,0,0,0,0,0,0,0,575,537,495,495,495,495,495,617,0,0,0,0,0,0,0,695,0,0,0,0,0,0,615,495,495,495,495,495, + 0,0,0,695,0,0,0,0,0,0,0,575,537,495,495,495,495,495,495,536,577,0,0,0,0,0,0,695,0,0,0,0,575,576,537,495,495,495,495,495, + 576,576,576,576,576,576,576,576,576,576,576,537,495,495,495,495,495,495,495,495,536,576,576,576,576,576,576,576,576,576,576,576,537,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + }; + + obj.createentity(80, 40, 10, 1, 5080); // (savepoint) + result = contents; + break; + } + + case rn(8,6): + { + + static const short contents[] = { + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,490,650,650,650,650,650,650,650,650,491,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,490,650,651,0,0,0,0,689,0,0,0,649,650,650,491,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,611,0,0,0,0,0,0,689,0,0,0,0,0,0,649,491,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,611,0,0,0,0,0,0,689,0,0,0,0,0,0,0,649,650,491,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,611,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,649,491,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,611,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,611,0,0,0,0,569,570,570,571,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,611,0,0,0,0,609,489,489,611,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,611,690,690,690,690,609,489,489,611,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,611,0,0,0,0,609,489,489,530,571,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,611,0,0,0,0,609,489,489,489,611,690,690,690,690,690,690,690,690,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,611,0,0,0,0,609,489,489,489,611,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,611,0,0,0,0,609,489,489,489,611,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,611,690,690,690,690,609,489,489,489,611,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,611,0,0,0,0,609,489,489,489,611,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,611,0,0,0,0,609,489,489,489,611,690,690,690,690,690,690,690,690,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,611,0,0,0,0,609,489,489,489,611,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,611,0,0,0,0,609,489,489,489,611,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,611,0,0,0,0,609,489,489,489,611,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,611,690,690,690,690,609,489,489,489,530,571,0,0,0,0,0,0,569,531,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,611,0,0,0,0,609,489,489,489,489,611,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,611,0,0,0,0,609,489,489,489,489,611,690,690,690,690,690,690,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,611,0,0,0,0,609,489,489,489,489,611,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,611,0,0,0,0,609,489,489,489,489,611,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + }; + + obj.createentity(96, 72, 13); //Warp Token + + result = contents; + break; + } + + case rn(8,7): + { + + static const short contents[] = { + 492,492,492,492,492,492,614,0,0,0,0,612,492,492,492,492,614,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,614,0,0,0,0,612,492,492,492,492,614,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,614,0,0,0,0,612,492,492,492,492,614,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,614,0,0,0,0,612,492,492,492,492,614,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,614,0,0,0,0,612,492,492,492,492,614,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,614,0,0,0,0,612,492,492,492,492,614,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,614,0,0,0,0,612,492,492,492,492,614,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,614,0,0,0,0,612,492,492,492,492,614,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,614,0,0,0,0,612,492,492,492,492,614,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,614,693,693,693,693,612,492,492,492,492,614,693,693,693,693,693,693,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,614,0,0,0,0,612,492,492,492,492,614,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,614,0,0,0,0,652,653,653,653,653,654,0,0,0,0,0,0,652,653,653,653,653,653,653,653,653,653,494,492,492,492,492,492,492, + 492,492,492,492,492,492,614,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492, + 492,492,492,492,492,492,614,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492, + 492,492,492,492,492,492,614,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492, + 492,492,492,492,492,492,614,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492, + 492,492,492,492,492,492,614,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492, + 492,492,492,492,492,492,614,0,0,0,0,572,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,574,0,0,0,0,612,492,492,492,492,492,492, + 492,492,492,492,492,492,614,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,612,492,492,492,492,492,492, + 492,492,492,492,492,492,614,693,693,693,693,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,693,693,693,693,612,492,492,492,492,492,492, + 492,492,492,492,492,492,614,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,612,492,492,492,492,492,492, + 492,492,492,492,492,492,614,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,612,492,492,492,492,492,492, + 492,492,492,492,492,492,614,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,612,492,492,492,492,492,492, + 492,492,492,492,492,492,614,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,612,492,492,492,492,492,492, + 492,492,492,492,492,492,614,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,612,492,492,492,492,492,492, + 492,492,492,492,492,492,614,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,612,492,492,492,492,492,492, + 492,492,492,492,492,492,614,693,693,693,693,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,693,693,693,693,612,492,492,492,492,492,492, + 492,492,492,492,492,492,614,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,612,492,492,492,492,492,492, + 492,492,492,492,492,492,614,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,612,492,492,492,492,492,492, + 492,492,492,492,492,492,614,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,612,492,492,492,492,492,492, + }; + result = contents; + break; + } + + case rn(8,8): + { + + static const short contents[] = { + 483,483,483,483,483,483,605,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,603,483,483,483,483,483,483, + 483,483,483,483,483,483,605,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,603,483,483,483,483,483,483, + 483,483,483,483,483,483,605,684,684,684,684,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,684,684,684,684,603,483,483,483,483,483,483, + 483,483,483,483,483,483,605,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,603,483,483,483,483,483,483, + 483,483,483,484,644,644,645,0,0,0,0,643,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,645,0,0,0,0,643,644,644,644,485,483,483, + 483,483,483,605,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,603,483,483, + 483,483,483,605,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,603,483,483, + 483,483,483,605,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,603,483,483, + 483,483,483,605,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,603,483,483, + 483,483,483,605,0,0,0,0,563,564,564,564,564,564,564,564,564,564,564,564,564,564,565,0,0,0,0,563,564,564,564,564,565,0,0,0,0,603,483,483, + 483,483,483,605,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,603,483,483,483,483,605,684,684,684,684,603,483,483, + 483,483,483,605,684,684,684,684,603,483,483,483,483,483,483,483,483,483,483,483,483,483,605,684,684,684,684,603,483,483,483,483,605,0,0,0,0,603,483,483, + 483,483,483,605,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,603,483,483,483,483,605,0,0,0,0,603,483,483, + 483,483,483,605,0,0,0,0,643,644,644,644,644,644,644,644,644,644,644,644,644,644,645,0,0,0,0,603,483,483,483,483,605,0,0,0,0,603,483,483, + 483,483,483,605,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,683,0,0,0,0,0,0,603,483,483,483,483,605,0,0,0,0,603,483,483, + 483,483,483,605,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,683,0,0,0,0,0,0,603,483,483,483,483,605,0,0,0,0,603,483,483, + 483,483,483,605,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,683,0,0,0,0,0,0,603,483,483,483,483,605,0,0,0,0,603,483,483, + 483,483,483,605,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,683,0,0,0,0,0,0,603,483,483,483,483,605,0,0,0,0,603,483,483, + 483,483,483,524,564,564,564,564,564,564,564,564,564,564,565,0,0,0,0,563,564,564,564,564,564,564,564,525,483,483,483,483,605,0,0,0,0,603,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,603,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,684,684,684,684,603,483,483,483,483,483,483,483,483,483,483,483,483,605,684,684,684,684,603,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,603,483,483, + 483,483,484,644,644,644,644,644,644,644,644,644,644,644,645,0,0,0,0,643,644,644,644,644,644,644,644,644,644,644,644,644,645,0,0,0,0,603,483,483, + 483,483,605,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,603,483,483, + 483,483,605,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,603,483,483, + 483,483,605,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,603,483,483, + 483,483,605,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,603,483,483, + 483,483,524,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,525,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + }; + result = contents; + break; + } + + case rn(8,10): + { + + static const short contents[] = { + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,493,653,653,494,493,653,653,494,493,653,653,494,493,653,653,494,493,653,653,494,493,653,653,494,493,653,653,494,492,492,492,492,492, + 492,492,492,492,492,492,492,614,0,0,612,614,0,0,612,614,0,0,612,614,0,0,612,614,0,0,612,614,0,0,612,614,0,0,612,492,492,492,492,492, + 492,492,492,492,492,492,493,654,0,0,652,654,0,0,652,654,0,0,652,654,0,0,652,654,0,0,652,654,0,0,652,654,0,0,652,494,492,492,492,492, + 492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492, + 492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492, + 492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492, + 492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492, + 492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492, + 492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492, + 492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492, + 492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492, + 492,492,492,492,492,492,614,0,0,0,0,572,573,573,573,573,573,573,573,573,574,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492, + 492,492,492,492,492,492,614,0,0,0,0,612,492,492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492, + 492,492,492,492,492,492,614,693,693,693,693,612,492,492,492,492,492,492,492,492,614,693,693,693,693,693,693,693,693,693,693,693,693,693,693,612,492,492,492,492, + 492,492,492,492,492,492,614,0,0,0,0,612,492,492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492, + 492,492,492,492,492,492,614,0,0,0,0,612,492,492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492, + 492,492,492,492,492,492,614,0,0,0,0,612,492,492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492, + 492,492,492,492,492,492,614,0,0,0,0,612,492,492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492, + 492,492,492,492,492,492,614,0,0,0,0,612,492,492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492, + 492,492,492,492,492,492,614,0,0,0,0,612,492,492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492, + 492,492,492,492,492,492,614,693,693,693,693,612,492,492,492,492,492,492,492,492,614,693,693,693,693,693,693,693,693,693,693,693,693,693,693,612,492,492,492,492, + 492,492,492,492,492,492,614,0,0,0,0,612,492,492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492, + 492,492,492,492,492,492,614,0,0,0,0,612,492,492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492, + 492,492,492,492,492,492,614,0,0,0,0,612,492,492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492, + }; + result = contents; + break; + } + + case rn(8,11): + { + + static const short contents[] = { + 483,483,483,483,483,483,605,0,0,0,0,603,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483, + 483,483,483,483,483,483,605,0,0,0,0,603,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483, + 483,483,483,483,483,483,605,684,684,684,684,603,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483, + 483,483,483,483,483,483,605,0,0,0,0,643,644,644,644,644,644,644,485,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483, + 483,483,483,483,483,483,605,0,0,0,0,0,683,0,0,0,0,0,603,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483, + 483,483,483,483,483,483,605,0,0,0,0,0,683,0,0,0,0,0,603,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483, + 483,483,483,483,483,483,605,0,0,0,0,0,683,0,0,0,0,0,603,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483, + 483,483,483,483,483,483,605,0,0,0,0,0,683,0,0,0,0,0,603,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483, + 483,483,483,483,483,483,524,564,564,564,564,564,564,565,0,0,0,0,603,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,605,684,684,684,684,603,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,603,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,603,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,605,684,684,684,684,603,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483, + 483,483,483,483,483,483,483,483,483,484,644,644,644,645,0,0,0,0,603,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483, + 483,483,483,483,483,483,483,484,644,645,0,0,0,0,0,0,0,0,603,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483, + 483,483,483,483,483,484,644,645,0,0,0,0,0,0,0,0,0,0,603,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483, + 483,483,483,484,644,645,0,0,0,0,0,0,0,0,0,0,0,0,603,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483, + 644,644,644,645,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,563,564,564,564,564,525,483,524,564,564,564,564,564,564,564,564,564,564,564,564,564,564,525,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,643,644,644,644,644,485,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,643,644,485,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,643,644,485,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,643,644,644,644,644,644,644,644,644,644,644,644,644,485,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483, + }; + + obj.createentity(176, 40, 14); //Teleporter! + obj.createentity(120, 128, 20, 1); // (terminal) + + obj.createblock(5, 120-4, 128, 20, 16, 7); + result = contents; + break; + } + + case rn(8,12): + { + + static const short contents[] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,575,576,537,495,495,495,495, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,575,576,537,495,495,495,495,495,495, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,655,497,495,495,495,495,495,495,495, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,655,497,495,495,495,495,495,495, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,655,497,495,495,495,495,495, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,655,497,495,495,495,495, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495, + }; + result = contents; + break; + } + + case rn(8,13): + { + + static const short contents[] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480, + 0,0,0,0,0,0,0,560,561,561,561,562,0,0,0,0,0,0,560,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,522,480,480,480,480, + 0,0,0,0,0,0,0,600,480,480,480,602,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 0,0,0,0,0,0,0,600,480,480,480,602,0,0,0,0,0,0,600,480,480,480,481,641,641,641,641,641,641,641,641,641,641,641,641,641,641,482,480,480, + 0,0,0,0,0,0,0,600,480,480,481,642,0,0,0,0,0,560,522,480,480,480,602,0,0,0,0,0,0,680,0,0,0,0,0,0,0,600,480,480, + 0,0,0,0,0,0,0,600,480,480,602,0,0,0,0,0,0,600,480,480,480,480,602,0,0,0,0,0,0,680,0,0,0,0,0,0,0,600,480,480, + 0,0,0,0,0,0,0,600,480,480,602,0,0,0,0,0,0,600,480,480,480,481,642,0,0,0,0,0,0,680,0,0,0,0,0,0,0,600,480,480, + 0,0,0,0,0,0,0,600,480,480,602,0,0,0,0,0,560,522,480,480,480,602,0,0,0,0,0,560,561,561,561,562,0,0,0,0,0,600,480,480, + 0,0,0,0,0,0,560,522,480,480,602,681,681,681,681,681,600,480,480,480,480,602,681,681,681,681,681,600,480,480,480,602,0,0,0,0,0,600,480,480, + 0,0,0,0,0,0,600,480,480,481,642,0,0,0,0,0,600,480,480,480,481,642,0,0,0,0,0,600,480,480,480,602,0,0,0,0,0,600,480,480, + 0,0,0,0,0,0,600,480,480,602,0,0,0,0,0,0,600,480,480,480,602,0,0,0,0,0,560,522,480,480,480,602,0,0,0,0,0,600,480,480, + 0,0,0,0,0,0,600,480,480,602,0,0,0,0,0,0,640,641,641,641,642,0,0,0,0,0,600,480,480,480,481,642,0,0,0,0,0,600,480,480, + 0,0,0,0,0,560,522,480,480,602,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,600,480,480,480,602,0,0,0,0,0,0,600,480,480, + 0,0,0,0,0,600,480,480,480,602,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,600,480,480,480,602,0,0,0,0,0,0,600,480,480, + 0,0,0,0,0,600,480,480,480,602,0,0,0,0,0,0,0,0,680,0,0,0,0,0,560,561,522,480,480,480,602,681,681,681,681,681,681,600,480,480, + 0,0,0,0,560,522,480,480,480,521,561,561,561,561,561,561,561,561,561,561,561,561,561,561,522,480,480,480,480,480,602,0,0,0,0,0,0,600,480,480, + 0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,481,642,0,0,0,0,0,0,600,480,480, + 0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0,0,600,480,480, + 0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0,0,600,480,480, + 0,0,0,0,640,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,642,0,0,0,0,0,560,561,522,480,480, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480, + }; + result = contents; + break; + } + + case rn(8,14): + { + + static const short contents[] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,652,653,494,492,492, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492, + 573,573,573,573,573,573,573,574,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492, + 492,492,492,492,492,493,653,654,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492, + 492,492,493,653,653,654,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492, + 492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492, + 492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492, + 492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492, + 492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492, + 492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492, + 492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492, + }; + + obj.createentity(40, 152, 10, 1, 14080); // (savepoint) + result = contents; + break; + } + + case rn(8,15): + { + + static const short contents[] = { + 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495, + 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495, + 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495, + 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,575,576,537,495,495, + 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495, + 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495, + 495,495,536,576,577,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495, + 495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495, + 495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495, + 495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495, + 495,495,495,495,617,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,615,495,495,495,495, + 495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495, + 495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495, + 495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495, + 495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495, + 495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,575,576,537,495,495,495,495, + 495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495, + 495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495, + 495,495,495,495,536,576,577,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495, + 495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495, + 495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495, + 495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495, + 495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495, + 495,495,495,495,495,495,617,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,615,495,495,495,495,495,495, + 495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495, + 495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495, + 495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495, + 495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495, + 495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495, + 495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495, + }; + result = contents; + break; + } + + case rn(8,16): + { + + static const short contents[] = { + 489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489, + 489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489, + 489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489, + 489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489, + 489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489, + 489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489, + 489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489, + 489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489, + 489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489, + 489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489, + 489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,649,650,491,489,489,489,489, + 489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,7,609,489,489,489,489, + 489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,569,570,570,570,570,570,570,571,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489, + 489,489,489,489,489,489,611,690,690,690,690,690,690,690,690,690,609,489,489,489,489,489,489,611,690,690,690,690,690,690,690,690,690,690,690,609,489,489,489,489, + 489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,649,650,491,489,489,490,650,651,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489, + 489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,7,7,649,650,650,651,7,7,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489, + 489,489,489,489,490,650,651,0,0,0,0,0,0,0,0,0,0,0,7,7,7,7,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489, + 489,489,489,489,611,7,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489, + 489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489, + 489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489, + 489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489, + 489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489, + 489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489, + 489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489, + 489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489, + 489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489, + 489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489, + 489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489, + 489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489, + 489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489, + }; + + obj.createentity(152, 80, 10, 1, 16080); // (savepoint) + result = contents; + break; + } + + case rn(8,17): + { + + static const short contents[] = { + 498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498, + 498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498, + 498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498, + 498,498,498,498,539,579,580,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498, + 498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498, + 498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498, + 498,498,498,498,498,498,620,699,699,699,699,699,699,699,699,699,699,699,699,699,699,699,699,699,699,699,699,699,699,699,699,699,699,699,699,618,498,498,498,498, + 498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498, + 498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498, + 498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498, + 498,498,498,498,498,498,539,579,580,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498, + 498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,578,579,540,498,498,498,498, + 498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,578,579,540,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,578,579,540,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,539,579,580,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,499,659,659,500,498,498, + 498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,578,579,540,498,498,499,659,660,0,0,618,498,498, + 498,498,498,498,498,498,498,498,498,498,620,699,699,699,699,699,699,699,699,699,699,699,699,699,699,699,699,618,498,498,499,659,660,0,0,0,0,618,498,498, + 498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,499,659,660,0,0,0,0,0,0,618,498,498, + 498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,658,660,0,0,0,0,0,0,0,0,618,498,498, + 498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498, + 498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498, + 498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498, + 498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498, + 498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498, + 498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498, + }; + result = contents; + break; + } + + case rn(8,18): + { + + static const short contents[] = { + 486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486, + 486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486, + 486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486, + 486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486, + 486,486,486,486,486,486,486,486,486,486,608,687,687,687,687,687,687,687,687,687,687,687,687,687,687,687,687,687,687,687,687,687,687,687,687,687,687,606,486,486, + 486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486, + 486,486,486,486,486,486,486,486,486,486,608,6,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486, + 486,486,486,486,486,486,486,486,486,486,527,567,568,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,608,6,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,606,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,527,567,568,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,566,528,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,606,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,566,528,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,606,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,566,528,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,527,568,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,527,568,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,6,606,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,527,568,0,0,0,0,0,0,0,0,0,0,0,0,0,0,566,567,528,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,6,606,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,566,528,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,687,687,687,687,687,687,687,687,687,687,687,687,687,606,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486, + }; + result = contents; + break; + } + + case rn(8,19): + { + + static const short contents[] = { + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,6,603,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,563,525,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,6,603,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,563,525,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,6,603,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,563,525,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,6,603,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,563,525,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,484,645,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,7,0,0,0,0,0,0,0,0,6,603,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,563,525,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,6,603,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,484,645,0,0,0,0,0,0,0,0,563,525,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,7,0,0,0,0,0,0,0,6,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,563,525,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + }; + result = contents; + break; + } + + case rn(10,0): + { + + static const short contents[] = { + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,658,659,659,659,500,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,539,579,579,579,579,580,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,699,699,699,699,618,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,499,659,659,659,659,659,659,659,659,659,660,0,0,0,0,658,659,659,659,659,659,659,659,659,659,659,659, + 498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0, + 498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0, + 498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0, + 498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0, + 498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0, + 498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0, + 498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,578,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579, + 498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,620,699,699,699,699,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,658,659,659,659,659,659,500,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,539,579,579,579,579,580,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + }; + result = contents; + break; + } + + case rn(10,1): + { + + static const short contents[] = { + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,658,659,659,659,500,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,539,579,579,579,579,580,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,699,699,699,699,618,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,499,659,659,659,659,659,659,659,659,659,660,0,0,0,0,658,659,659,659,659,659,659,659,659,659,659,659, + 498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0, + 498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0, + 498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0, + 498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0, + 498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0, + 498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0, + 498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,578,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579, + 498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,620,699,699,699,699,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,658,659,659,659,659,659,500,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,539,579,579,579,579,580,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + }; + result = contents; + break; + } + + case rn(10,2): + { + + static const short contents[] = { + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,658,659,659,659,500,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,539,579,579,579,579,580,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,699,699,699,699,618,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,499,659,659,659,659,659,659,659,659,659,660,0,0,0,0,658,659,659,659,659,659,659,659,659,659,659,659, + 498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0, + 498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0, + 498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0, + 498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0, + 498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0, + 498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0, + 498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,578,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579, + 498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,620,699,699,699,699,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,658,659,659,659,659,659,500,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,539,579,579,579,579,580,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + }; + result = contents; + break; + } + + case rn(10,3): + { + + static const short contents[] = { + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,646,647,647,647,488,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,527,567,567,567,567,568,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,687,687,687,687,606,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,646,647,647,647,647,647,647,647,647,647,647,647, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,527,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + }; + result = contents; + break; + } + + case rn(10,8): + { + + static const short contents[] = { + 295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, + 295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, + 295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, + 295,295,296,456,456,456,456,456,456,456,456,456,456,297,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, + 295,295,417,698,698,698,698,698,698,698,698,698,698,415,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, + 295,295,417,698,698,698,698,698,698,698,698,698,698,415,295,295,296,456,456,456,456,456,456,456,456,456,456,456,297,295,295,295,295,295,295,295,295,295,295,295, + 295,295,417,698,698,698,698,698,698,698,698,698,698,415,295,295,417,698,698,698,698,698,698,698,698,698,698,698,415,295,295,295,295,295,295,295,295,295,295,295, + 295,295,417,698,698,698,698,698,698,698,698,698,698,415,295,295,417,698,698,698,698,698,698,698,698,698,698,698,415,295,295,295,295,295,295,295,295,295,295,295, + 295,295,417,698,698,698,698,375,376,376,376,376,376,337,295,295,417,698,698,698,698,698,698,698,698,698,698,698,415,295,295,295,295,295,295,295,295,295,295,295, + 295,295,417,698,698,698,698,415,295,295,295,295,295,295,295,295,417,698,698,698,698,698,698,698,698,698,698,698,415,295,295,295,295,295,295,295,295,295,295,295, + 295,295,417,698,698,698,698,415,295,295,295,295,295,295,295,295,417,698,698,698,698,375,376,377,698,698,698,698,415,295,295,295,295,295,295,295,295,295,295,295, + 295,295,417,698,698,698,698,455,456,456,456,456,456,456,456,456,457,698,698,698,698,415,295,417,698,698,698,698,415,295,295,295,295,295,295,295,295,295,295,295, + 295,295,417,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,415,295,417,698,698,698,698,415,295,295,295,295,295,295,295,295,295,295,295, + 295,295,417,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,415,295,417,698,698,698,698,415,295,295,295,295,295,295,295,295,295,295,295, + 295,295,417,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,415,295,417,698,698,698,698,415,295,295,295,295,295,295,295,295,295,295,295, + 295,295,417,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,415,295,417,698,698,698,698,415,295,295,295,295,295,295,295,295,295,295,295, + 295,295,336,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,337,295,417,698,698,698,698,415,295,295,295,295,295,295,295,295,295,295,295, + 295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,417,698,698,698,698,415,295,295,295,295,295,295,295,295,295,295,295, + 295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,417,698,698,698,698,415,295,295,295,295,295,295,295,295,295,295,295, + 295,295,295,295,295,295,295,295,295,295,295,296,456,456,456,456,456,456,456,456,456,456,456,457,698,698,698,698,415,295,295,295,295,295,295,295,295,295,295,295, + 295,295,295,295,295,295,295,295,295,295,295,417,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,415,295,295,295,295,295,295,295,295,295,295,295, + 295,295,295,295,295,295,295,295,295,295,295,417,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,415,295,295,295,295,295,295,295,295,295,295,295, + 295,295,295,295,295,295,295,295,295,295,295,417,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,415,295,295,295,295,295,295,295,295,295,295,295, + 295,295,295,295,295,295,295,295,295,295,295,417,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,415,295,295,295,295,295,295,295,295,295,295,295, + 295,295,295,295,295,295,295,295,295,295,295,417,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,415,295,295,295,295,295,295,295,295,295,295,295, + 295,295,295,295,295,295,295,295,295,295,295,417,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,415,295,295,295,295,295,295,295,295,295,295,295, + 295,295,295,295,295,295,295,295,295,295,295,417,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,415,295,295,295,295,295,295,295,295,295,295,295, + 295,295,295,295,295,295,295,295,295,295,295,417,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,415,295,295,295,295,295,295,295,295,295,295,295, + 295,295,295,295,295,295,295,295,295,295,295,417,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,415,295,295,295,295,295,295,295,295,295,295,295, + 295,295,295,295,295,295,295,295,295,295,295,417,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,415,295,295,295,295,295,295,295,295,295,295,295, + }; + + obj.createentity(80, 40, 9, 17); // (shiny trinket) + roomtileset = 0; // (Use space station tileset) + result = contents; + break; + } + + case rn(10,9): + { + + static const short contents[] = { + 283,283,283,283,283,283,283,283,283,283,283,405,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,403,283,283,283,283,283,283,283,283,283,283,283, + 283,283,283,283,283,283,283,283,283,283,283,405,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,403,283,283,283,283,283,283,283,283,283,283,283, + 283,283,283,283,283,283,283,283,283,283,283,405,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,403,283,283,283,283,283,283,283,283,283,283,283, + 283,283,283,283,283,283,283,283,283,283,283,405,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,403,283,283,283,283,283,283,283,283,283,283,283, + 283,283,283,283,283,283,283,283,283,283,283,405,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,403,283,283,283,283,283,283,283,283,283,283,283, + 283,283,283,283,283,283,283,283,283,283,283,405,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,403,283,283,283,283,283,283,283,283,283,283,283, + 283,283,283,283,283,283,283,283,283,283,283,405,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,403,283,283,283,283,283,283,283,283,283,283,283, + 283,283,283,283,283,283,283,283,283,283,283,405,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,403,283,283,283,283,283,283,283,283,283,283,283, + 283,283,283,283,283,283,283,283,283,283,283,405,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,403,283,283,283,283,283,283,283,283,283,283,283, + 283,283,283,283,283,283,283,283,283,283,283,405,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,403,283,283,283,283,283,283,283,283,283,283,283, + 283,283,283,283,283,283,283,283,283,283,283,405,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,403,283,283,283,283,283,283,283,283,283,283,283, + 283,283,283,283,283,283,283,283,283,283,283,405,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,403,283,283,283,283,283,283,283,283,283,283,283, + 283,283,283,283,283,283,283,283,283,283,283,405,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,403,283,283,283,283,283,283,283,283,283,283,283, + 283,283,283,283,283,283,283,283,283,283,283,405,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,403,283,283,283,283,283,283,283,283,283,283,283, + 283,283,283,283,283,283,283,283,283,283,283,405,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,403,283,283,283,283,283,283,283,283,283,283,283, + 283,283,283,283,283,283,283,283,283,283,283,405,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,403,283,283,283,283,283,283,283,283,283,283,283, + 283,283,283,283,283,283,283,283,283,283,283,405,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,403,283,283,283,283,283,283,283,283,283,283,283, + 283,283,283,283,283,283,283,283,283,283,283,405,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,403,283,283,283,283,283,283,283,283,283,283,283, + 283,283,283,283,283,283,283,283,283,283,283,405,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,403,283,283,283,283,283,283,283,283,283,283,283, + 283,283,283,283,283,283,283,283,283,283,283,405,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,403,283,283,283,283,283,283,283,283,283,283,283, + 283,283,283,283,283,283,283,283,283,283,283,405,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,403,283,283,283,283,283,283,283,283,283,283,283, + 283,283,283,283,283,283,283,283,283,283,283,405,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,403,283,283,283,283,283,283,283,283,283,283,283, + 283,283,283,283,283,283,283,283,283,283,283,405,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,443,444,444,444,444,444,444,444,444,444,444,444, + 283,283,283,283,283,283,283,283,283,283,283,405,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,817,0,0,0,0,0,0,0, + 283,283,283,283,283,283,283,283,283,283,283,405,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,817,0,0,0,0,0,0,0, + 283,283,283,283,283,283,283,283,283,283,283,405,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,817,0,0,0,0,0,0,0, + 283,283,283,283,283,283,283,283,283,283,283,405,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,817,0,0,0,0,0,0,0, + 283,283,283,283,283,283,283,283,283,283,283,324,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364, + 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, + 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, + }; + + obj.nearelephant = false; + roomtileset = 0; // (Use space station tileset) + result = contents; + break; + } + + case rn(10,10): + { + + static const short contents[] = { + 316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,438,403,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, + 316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,438,403,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, + 316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,438,443,285,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, + 316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,357,398,403,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, + 316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,438,403,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, + 316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,438,403,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, + 316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,438,443,285,283,283,283,283,283,283,283,283,283,283,283,283,283,283, + 316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,357,398,403,283,283,283,283,283,283,283,283,283,283,283,283,283,283, + 316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,438,403,283,283,283,283,283,283,283,283,283,283,283,283,283,283, + 316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,438,443,285,283,283,283,283,283,283,283,283,283,283,283,283,283, + 316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,357,398,403,283,283,283,283,283,283,283,283,283,283,283,283,283, + 316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,438,403,283,283,283,283,283,283,283,283,283,283,283,283,283, + 316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,438,443,285,283,283,283,283,283,283,283,283,283,283,283,283, + 316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,357,398,403,283,283,283,283,283,283,283,283,283,283,283,283, + 316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,438,403,283,283,283,283,283,283,283,283,283,283,283,283, + 316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,438,403,283,283,283,283,283,283,283,283,283,283,283,283, + 316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,438,403,283,283,283,283,283,283,283,283,283,283,283,283, + 316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,438,443,444,444,444,444,444,444,444,444,444,444,444,444, + 316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,357,398,0,0,0,0,815,695,695,695,695,695,695,695, + 316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,438,0,0,0,0,815,695,695,695,695,695,695,695, + 316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,317,477,478,0,0,0,0,815,695,695,695,695,695,695,695, + 316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,438,0,0,0,0,0,0,815,695,695,695,695,695,695,695, + 316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,317,477,478,0,0,0,0,0,0,815,695,695,695,695,695,695,695, + 316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,438,0,0,0,0,0,0,0,0,815,363,364,364,364,364,364,364, + 316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,438,0,0,0,0,0,0,0,0,815,403,283,283,283,283,283,283, + 316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,438,0,0,0,0,0,0,0,363,364,325,283,283,283,283,283,283, + 316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,438,0,0,0,0,0,0,0,403,283,283,283,283,283,283,283,283, + 316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,438,0,0,0,0,0,363,364,325,283,283,283,283,283,283,283,283, + 316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,438,0,0,0,0,0,403,283,283,283,283,283,283,283,283,283,283, + 316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,438,0,0,0,0,0,403,283,283,283,283,283,283,283,283,283,283, + }; + + roomtileset = 0; // (Use space station tileset) + result = contents; + break; + } + + case rn(10,11): + { + + static const short contents[] = { + 116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,238,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492, + 116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,238,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492, + 116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,238,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492, + 116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,238,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492, + 116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,117,278,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492, + 116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,238,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492, + 116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,238,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492, + 116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,117,278,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492, + 116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,238,0,0,0,0,0,0,0,652,653,494,492,492,492,492,492,492,492,492, + 116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,238,0,0,0,0,0,0,0,0,0,652,494,492,492,492,492,492,492,492, + 116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,238,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492, + 116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,117,278,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492, + 116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,238,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492, + 116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,117,278,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492, + 116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,238,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492, + 116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,117,278,0,0,0,0,0,0,0,0,0,0,572,573,534,492,492,492,492,492,492,492, + 116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,238,0,0,0,0,0,0,0,0,0,0,572,534,492,492,492,492,492,492,492,492,492, + 116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,238,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492, + 116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,157,198,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492, + 116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,157,198,0,0,0,0,0,0,0,0,652,653,494,492,492,492,492,492,492,492,492, + 116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,238,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492, + 116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,238,0,0,0,0,0,0,0,0,0,0,652,494,492,492,492,492,492,492,492, + 116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,157,197,197,198,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492, + 116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,157,197,198,0,0,0,0,0,0,612,492,492,492,492,492,492,492, + 116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,238,0,0,0,572,573,573,534,492,492,492,492,492,492,492, + 116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,238,0,0,0,612,492,492,492,492,492,492,492,492,492,492, + 116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,238,0,0,0,612,492,492,492,492,492,492,492,492,492,492, + 116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,238,0,0,0,612,492,492,492,492,492,492,492,492,492,492, + 116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,238,0,0,0,612,492,492,492,492,492,492,492,492,492,492, + 116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,238,0,0,0,612,492,492,492,492,492,492,492,492,492,492, + }; + + roomtileset = 0; // (Use space station tileset) + result = contents; + break; + } + + case rn(10,12): + { + + static const short contents[] = { + 516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,638,0,0,0,630,510,510,510,510,510,510,510,510,510,510, + 516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,638,0,0,0,630,510,510,510,510,510,510,510,510,510,510, + 516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,638,0,0,0,630,510,510,510,510,510,510,510,510,510,510, + 516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,638,0,0,0,630,510,510,510,510,510,510,510,510,510,510, + 516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,638,0,0,0,630,510,510,510,510,510,510,510,510,510,510, + 516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,638,0,0,0,630,510,510,510,510,510,510,510,510,510,510, + 516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,638,0,0,0,630,510,510,510,510,510,510,510,510,510,510, + 516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,638,0,0,0,630,510,510,510,510,510,510,510,510,510,510, + 516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,638,0,0,0,630,510,510,510,510,510,510,510,510,510,510, + 516,516,517,677,677,677,677,677,677,677,677,677,677,677,677,677,677,677,677,677,677,677,518,516,516,638,0,0,0,630,510,510,510,510,510,510,510,510,510,510, + 516,516,638,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,636,516,516,638,0,0,0,630,510,510,510,510,510,510,510,510,510,510, + 516,516,638,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,636,516,516,638,0,0,0,630,510,510,510,510,510,510,510,510,510,510, + 516,516,638,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,636,516,516,638,0,0,0,630,510,510,510,510,510,510,510,510,510,510, + 516,516,638,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,636,516,516,638,0,0,0,630,510,510,510,510,510,510,510,510,510,510, + 516,516,638,0,0,0,590,591,591,591,591,591,591,591,591,591,591,591,592,0,0,0,636,516,516,638,0,0,0,630,510,510,510,510,510,510,510,510,510,510, + 516,516,638,0,0,0,670,671,671,671,671,671,671,671,671,671,512,510,632,0,0,0,636,516,516,638,0,0,0,630,510,510,510,510,510,510,510,510,510,510, + 516,516,638,0,0,0,0,0,0,0,0,0,0,0,0,0,630,510,632,0,0,0,636,516,516,638,0,0,0,630,510,510,510,510,510,510,510,510,510,510, + 516,516,638,0,0,0,0,0,0,0,0,0,0,0,0,0,630,510,632,0,0,0,636,516,516,638,0,0,0,630,510,510,510,510,510,510,510,510,510,510, + 516,516,638,0,0,0,0,0,0,0,0,0,0,0,0,0,630,510,632,0,0,0,636,516,516,638,0,0,0,630,510,510,510,510,510,510,510,510,510,510, + 516,516,638,0,0,0,0,0,0,0,0,0,0,0,0,0,630,510,632,0,0,0,676,677,677,678,0,0,0,630,510,510,510,510,510,510,510,510,510,510, + 516,516,557,597,597,597,597,597,597,597,597,598,0,0,0,0,630,510,632,0,0,0,0,0,0,0,0,0,0,630,510,510,510,510,510,510,510,510,510,510, + 516,516,516,516,516,516,516,516,516,516,516,638,0,0,0,0,630,510,632,0,0,0,0,0,0,0,0,0,0,630,510,510,510,510,510,510,510,510,510,510, + 516,516,517,677,677,677,677,677,677,677,677,678,0,0,0,0,630,510,632,0,0,0,0,0,0,0,0,0,0,630,510,510,510,510,510,510,510,510,510,510, + 516,516,638,0,0,0,0,0,0,0,0,0,0,0,0,0,630,510,632,0,0,0,0,0,0,0,0,0,0,630,510,510,510,510,510,510,510,510,510,510, + 516,516,638,0,0,0,0,0,0,0,0,0,0,0,0,0,630,510,551,591,591,591,591,591,591,591,591,591,591,552,510,510,510,510,510,510,510,510,510,510, + 516,516,638,0,0,0,0,0,0,0,0,0,0,0,0,0,630,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510, + 516,516,638,0,0,0,0,0,0,0,0,0,0,0,0,0,630,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510, + 516,516,638,0,0,0,590,591,591,591,591,591,591,591,591,591,552,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510, + 516,516,638,0,0,0,630,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510, + 516,516,638,0,0,0,630,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510, + }; + + obj.createentity(184, 176, 10, 1, 12100); // (savepoint) + roomtileset = 0; // (Use space station tileset) + result = contents; + break; + } + + case rn(10,13): + { + + static const short contents[] = { + 513,513,635,0,0,0,224,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104, + 513,513,635,0,0,0,224,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104, + 513,514,675,0,0,0,224,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104, + 513,635,0,0,0,0,224,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104, + 513,635,0,0,0,0,224,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104, + 513,635,0,0,0,184,146,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104, + 513,635,0,0,0,224,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104, + 513,635,0,0,0,224,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104, + 513,554,595,0,0,264,106,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104, + 513,513,635,0,0,0,224,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104, + 513,513,635,0,0,0,224,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104, + 513,513,635,0,0,0,224,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104, + 513,513,635,0,0,0,224,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104, + 513,513,635,0,0,0,224,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104, + 513,513,635,0,0,0,224,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104, + 513,514,675,0,0,184,146,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104, + 513,635,0,0,0,224,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104, + 513,635,0,0,0,224,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104, + 513,635,0,0,0,224,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104, + 513,635,0,0,0,224,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104, + 513,635,0,0,0,224,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104, + 513,554,595,0,0,224,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104, + 513,513,635,0,0,264,106,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104, + 513,513,635,0,0,0,224,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104, + 513,513,635,0,0,0,224,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104, + 513,513,635,0,0,0,224,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104, + 513,513,635,0,0,0,224,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104, + 513,513,635,0,0,0,224,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104, + 513,513,635,0,0,184,146,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104, + 513,513,635,0,0,224,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104, + }; + + roomtileset = 0; // (Use space station tileset) + result = contents; + break; + } + + case rn(10,14): + { + + static const short contents[] = { + 316,316,438,0,0,403,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, + 316,316,438,0,0,403,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, + 316,316,438,0,0,403,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, + 316,316,438,0,0,403,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, + 316,316,438,0,0,403,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, + 316,316,438,0,0,403,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, + 316,316,438,0,0,403,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, + 316,316,438,0,0,403,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, + 316,316,438,0,0,403,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, + 316,316,438,0,0,403,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, + 316,316,438,0,0,443,444,444,444,285,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, + 316,316,438,0,0,0,0,0,0,403,283,284,444,444,444,444,285,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, + 316,316,438,0,0,0,0,0,0,403,283,405,0,0,0,0,403,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, + 316,316,438,0,0,0,0,0,0,403,283,405,0,0,0,0,403,283,284,444,444,444,444,285,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, + 316,316,438,0,0,0,0,0,0,443,444,445,0,0,0,0,403,283,405,0,0,0,0,403,283,284,444,444,444,444,444,444,444,444,444,444,444,444,444,444, + 316,316,438,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,403,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 316,316,438,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,403,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 316,316,438,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,403,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 316,316,357,398,0,0,0,0,0,0,0,0,0,0,0,0,443,444,445,0,0,0,0,403,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 316,316,316,357,398,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 316,316,316,316,438,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 316,316,316,316,438,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 316,316,316,316,438,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,443,444,445,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 316,316,316,316,438,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 316,316,316,316,438,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 316,316,316,316,438,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 316,316,316,316,438,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 316,316,316,316,438,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 316,316,316,316,438,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 316,316,316,316,438,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + roomtileset = 0; // (Use space station tileset) + result = contents; + break; + } + + case rn(10,15): + { + + static const short contents[] = { + 495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,536,577,0,0,0,0,575,576,576,576,577,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,495,617,696,696,696,696,615,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,495,617,0,0,0,0,655,656,656,656,657,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,495,536,577,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,495,495,536,577,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,575,576,576,576,577,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,495,495,495,617,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,615,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,655,656,656,656,657,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,495,495,495,536,577,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,495,495,495,495,536,577,0,0,0,0,0,575,576,576,576,577,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,495,495,495,495,495,617,696,696,696,696,696,615,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,655,656,656,656,657,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,575,576,576,576,577,0,0,0,0, + 495,495,495,495,495,495,495,495,495,617,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,615,495,495,495,617,0,0,0,0, + 495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,655,656,656,656,657,0,0,0,0, + 495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + result = contents; + break; + } + + case rn(10,16): + { + + static const short contents[] = { + 486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 486,486,486,486,486,486,486,486,486,527,568,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 486,486,486,486,486,486,486,486,486,486,527,568,0,0,0,0,0,0,0,0,0,0,0,0,566,567,567,567,567,567,567,567,568,0,0,0,0,0,0,0, + 486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0, + 486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,566,528,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0, + 486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,527,568,0,0,0,0,0,0, + 486,486,486,486,486,486,486,486,486,486,486,527,567,567,567,567,567,567,567,567,567,567,567,528,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,527,568,0,0,0,0,0, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,527,568,0,0,0,0, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,527,567,567,567,567, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + }; + + obj.createentity(216, 72, 10, 1, 16100); // (savepoint) + result = contents; + break; + } + + case rn(10,17): + { + + static const short contents[] = { + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,493,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653, + 492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 492,492,492,492,492,492,492,533,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + }; + result = contents; + break; + } + + case rn(10,18): + { + + static const short contents[] = { + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,484,644,644,644,644,644,644,644,644,644,644,644,644,644, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,524,564,564,564,564,564,564,564,564,564,564,564,564,564, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + }; + result = contents; + break; + } + + case rn(10,19): + { + + static const short contents[] = { + 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501, + 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501, + 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501, + 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501, + 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501, + 501,501,501,501,501,501,501,501,501,501,501,501,501,501,502,662,662,662,503,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501, + 501,501,501,501,501,501,501,501,501,501,501,501,502,662,663,0,0,0,661,662,662,503,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501, + 501,501,501,501,501,501,501,501,501,501,502,662,663,0,0,0,0,0,701,0,0,661,662,662,503,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501, + 501,501,501,501,501,501,501,501,502,662,663,0,701,0,0,0,0,0,701,0,0,0,0,0,661,662,662,503,501,501,501,501,501,501,501,501,501,501,501,501, + 501,501,501,501,501,501,502,662,663,0,0,0,701,0,0,0,0,0,701,0,0,0,0,0,701,0,0,661,662,662,503,501,501,501,501,501,501,501,501,501, + 501,501,501,501,502,662,663,0,701,0,0,0,701,0,0,0,0,0,701,0,0,0,0,0,701,0,0,0,0,0,661,662,662,503,501,501,501,501,501,501, + 501,501,501,502,663,0,0,0,701,0,0,0,701,0,0,0,0,0,701,0,0,0,0,0,701,0,0,0,0,0,701,0,0,661,662,662,662,662,662,662, + 501,501,501,623,0,0,0,0,701,0,0,0,701,0,0,0,0,0,701,0,0,0,0,0,701,0,0,0,0,0,701,0,0,0,0,701,0,0,0,0, + 501,501,501,623,702,702,702,702,703,702,702,702,703,702,702,702,702,702,703,702,702,0,0,0,701,0,0,0,0,0,701,0,0,0,0,701,0,0,0,0, + 501,501,501,623,0,0,0,0,701,0,0,0,701,0,0,0,0,0,701,0,0,0,0,0,701,0,0,0,0,0,701,0,0,0,0,701,0,0,0,0, + 501,501,501,623,0,0,0,0,701,0,0,0,701,0,0,0,0,0,701,0,0,0,0,0,701,0,0,0,0,0,701,0,0,0,0,701,0,0,0,0, + 501,501,501,623,702,702,702,702,703,702,702,702,703,702,702,702,702,702,703,702,702,0,0,0,701,0,0,0,0,0,701,0,0,0,0,701,0,0,0,0, + 501,501,501,623,0,0,0,0,701,0,0,0,701,0,0,0,0,0,701,0,0,0,0,0,701,0,0,0,0,0,701,0,0,0,0,701,0,0,0,0, + 501,501,501,542,583,0,0,0,701,0,0,0,701,0,0,0,0,0,701,0,0,0,0,0,701,0,0,0,0,0,701,0,0,581,582,582,582,582,582,582, + 501,501,501,501,542,582,583,0,701,0,0,0,701,0,0,0,0,0,701,0,0,0,0,0,701,0,0,0,0,0,581,582,582,543,501,501,501,501,501,501, + 501,501,501,501,501,501,542,582,583,0,0,0,701,0,0,0,0,0,701,0,0,0,0,0,701,0,0,581,582,582,543,501,501,501,501,501,501,501,501,501, + 501,501,501,501,501,501,501,501,542,582,583,0,701,0,0,0,0,0,701,0,0,0,0,0,581,582,582,543,501,501,501,501,501,501,501,501,501,501,501,501, + 501,501,501,501,501,501,501,501,501,501,542,582,583,0,0,0,0,0,701,0,0,0,0,0,621,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501, + 501,501,501,501,501,501,501,501,501,501,501,501,542,582,583,0,0,0,701,0,0,0,0,0,621,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501, + 501,501,501,501,501,501,501,501,501,501,501,501,501,501,542,582,582,582,583,0,0,0,0,0,621,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501, + 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,621,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501, + 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,702,702,702,702,702,621,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501, + 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,621,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501, + 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,621,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501, + 501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,623,0,0,0,0,0,621,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501, + }; + + obj.createentity(40, 112, 9, 13); // (shiny trinket) + result = contents; + break; + } + + case rn(11,0): + { + + static const short contents[] = { + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,687,687,687,687,687,687,687,687,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,527,567,568,0,0,0,0,566,567,528,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,687,687,687,687,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,646,647,647,647,647,647,647,647,488,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,686,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,686,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486, + 647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,648,0,0,0,0,0,0,686,0,0,0,0,0,646,647,647,647,647,647,647,647,647,647, + 0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0, + 0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0, + 0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0, + 0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0, + 0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0, + 0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0, + 567,567,567,567,567,567,567,567,567,568,0,0,0,0,0,686,0,0,0,0,0,0,566,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567, + 486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,686,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,686,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,527,567,567,567,567,567,567,567,568,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,687,687,687,687,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,487,647,648,0,0,0,0,646,647,488,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,687,687,687,687,687,687,687,687,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + }; + result = contents; + break; + } + + case rn(11,1): + { + + static const short contents[] = { + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,687,687,687,687,687,687,687,687,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,527,567,568,0,0,0,0,566,567,528,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,687,687,687,687,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,646,647,647,647,647,647,647,647,488,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,686,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,686,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486, + 647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,648,0,0,0,0,0,0,686,0,0,0,0,0,646,647,647,647,647,647,647,647,647,647, + 0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0, + 0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0, + 0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0, + 0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0, + 0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0, + 0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0, + 567,567,567,567,567,567,567,567,567,568,0,0,0,0,0,686,0,0,0,0,0,0,566,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567, + 486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,686,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,686,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,527,567,567,567,567,567,567,567,568,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,687,687,687,687,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,487,647,648,0,0,0,0,646,647,488,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,687,687,687,687,687,687,687,687,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + }; + result = contents; + break; + } + + case rn(11,2): + { + + static const short contents[] = { + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,696,696,696,696,696,696,696,696,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,536,576,577,0,0,0,0,575,576,537,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,696,696,696,696,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,657,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 576,576,576,576,576,576,576,576,576,577,0,0,0,0,0,695,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,695,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,695,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,536,576,576,576,576,576,576,576,577,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,696,696,696,696,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,496,656,657,0,0,0,0,655,656,497,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,696,696,696,696,696,696,696,696,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + }; + result = contents; + break; + } + + case rn(11,3): + { + + static const short contents[] = { + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,569,570,570,570,531,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,690,690,690,690,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,651,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,531,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + }; + result = contents; + break; + } + + case rn(11,8): + { + + static const short contents[] = { + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,496,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656, + 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + + obj.createentity((8 * 8), (12 * 8), 1, 0, 0, -10000, -10000, 10000, 100000); // Enemy + obj.nearelephant = true; + + roomtileset = 0; // (Use space station tileset) + result = contents; + break; + } + + case rn(11,9): + { + + static const short contents[] = { + 310,310,432,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 310,310,432,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 310,310,432,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 310,310,432,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 310,310,432,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 310,310,432,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 310,310,432,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 310,310,432,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 310,310,432,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 310,310,432,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 310,310,432,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 310,310,432,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 310,310,432,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 310,310,432,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 310,310,432,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 310,310,432,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 310,310,432,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 310,310,432,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 310,310,432,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 310,310,432,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 310,310,432,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 310,310,432,0,0,0,0,390,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391, + 471,471,472,0,0,0,0,470,471,471,471,471,471,471,471,471,471,471,471,471,471,471,471,471,471,471,471,471,471,471,471,471,471,471,471,471,471,471,471,471, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391, + 310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310, + 310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310, + }; + + + obj.createentity(8 * 8, -248 + (12 * 8), 1, 0, 0, -10000, -10000, 10000, 100000); // Enemy + obj.nearelephant = true; + + roomtileset = 0; // (Use space station tileset) + result = contents; + break; + } + + case rn(11,10): + { + + static const short contents[] = { + 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92, + 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92, + 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92, + 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92, + 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92, + 92,92,92,92,92,92,92,92,92,92,92,92,92,92,93,253,253,253,253,253,253,253,253,253,253,253,253,253,253,94,92,92,92,92,92,92,92,92,92,92, + 92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,683,683,683,683,683,683,683,683,683,683,683,683,683,683,212,92,92,92,92,92,92,92,92,92,92, + 92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,683,683,683,683,683,683,683,683,683,683,683,683,683,683,212,92,92,92,92,92,92,92,92,92,92, + 92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,683,683,683,683,683,683,683,683,683,683,683,683,683,683,212,92,92,92,92,92,92,92,92,92,92, + 92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,683,683,683,683,683,683,683,683,683,683,683,683,683,683,212,92,92,92,92,92,92,92,92,92,92, + 92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,683,683,683,172,173,173,173,173,173,173,174,683,683,683,212,92,92,92,92,92,92,92,92,92,92, + 92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,683,683,683,212,92,92,92,92,92,92,214,683,683,683,212,92,92,92,92,92,92,92,92,92,92, + 92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,683,683,683,212,92,92,92,92,92,92,214,683,683,683,212,92,92,92,92,92,92,92,92,92,92, + 92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,683,683,683,212,92,92,92,92,92,92,214,683,683,683,212,92,92,92,92,92,92,92,92,92,92, + 92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,683,683,683,212,92,92,92,92,92,92,214,683,683,683,212,92,92,92,92,92,92,92,92,92,92, + 92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,683,683,683,212,92,92,92,92,92,92,214,683,683,683,212,92,92,92,92,92,92,92,92,92,92, + 92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,683,683,683,212,92,92,92,92,92,92,214,683,683,683,212,92,92,92,92,92,92,92,92,92,92, + 253,253,253,253,253,253,253,253,253,253,253,253,253,253,254,683,683,683,212,92,92,92,92,92,92,214,683,683,683,212,92,92,92,92,92,92,92,92,92,92, + 683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,212,92,92,92,92,92,92,214,683,683,683,212,92,92,92,92,92,92,92,92,92,92, + 683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,212,92,92,92,92,92,92,214,683,683,683,212,92,92,92,92,92,92,92,92,92,92, + 683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,212,92,92,92,92,92,92,214,683,683,683,212,92,92,92,92,92,92,92,92,92,92, + 683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,212,92,92,92,92,92,92,214,683,683,683,212,92,92,92,92,92,92,92,92,92,92, + 683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,212,92,92,92,92,92,92,214,683,683,683,212,92,92,92,92,92,92,92,92,92,92, + 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,134,92,92,92,92,92,92,214,683,683,683,252,253,253,253,253,253,253,253,253,253,253, + 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,683,683,683,683,683,683,683,683,683,683,683,683,683,683, + 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,683,683,683,683,683,683,683,683,683,683,683,683,683,683, + 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,683,683,683,683,683,683,683,683,683,683,683,683,683,683, + 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,683,683,683,683,683,683,683,683,683,683,683,683,683,683, + 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,133,173,173,173,173,173,173,173,173,173,173,173,173,173,173, + 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92, + }; + + roomtileset = 0; // (Use space station tileset) + result = contents; + break; + } + + case rn(11,16): + { + + static const short contents[] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,569,570,570,571,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,569,570,570,570,531,489,489,611,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,569,531,489,489,489,489,489,489,530,571,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,569,570,570,570,570,570,570,570,570,570,570,531,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,569,531,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,530,571,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,569,570,531,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0, + 0,0,0,0,0,569,570,570,570,531,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0, + 570,570,570,570,570,531,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,530,570,570,570,570,570,570, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + }; + result = contents; + break; + } + + case rn(11,17): + { + + static const short contents[] = { + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641, + 0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0, + 0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0, + 0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0, + 0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0, + 0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0, + 0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0, + 561,561,561,561,561,561,561,561,561,562,0,0,0,0,0,680,0,0,0,0,0,0,560,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561, + 480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,680,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,680,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,521,561,561,561,561,561,561,561,562,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,681,681,681,681,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,481,641,642,0,0,0,0,640,641,482,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,681,681,681,681,681,681,681,681,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + }; + result = contents; + break; + } + + case rn(11,18): + { + + static const short contents[] = { + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,687,687,687,687,687,687,687,687,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,527,567,568,0,0,0,0,566,567,528,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,687,687,687,687,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,646,647,647,647,647,647,647,647,488,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,686,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,686,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486, + 647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,648,0,0,0,0,0,0,686,0,0,0,0,0,646,647,647,647,647,647,647,647,647,647, + 0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0, + 0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0, + 0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0, + 0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0, + 0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0, + 0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0, + 567,567,567,567,567,567,567,567,567,568,0,0,0,0,0,686,0,0,0,0,0,0,566,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567, + 486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,686,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,686,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,527,567,567,567,567,567,567,567,568,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,687,687,687,687,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,487,647,648,0,0,0,0,646,647,488,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,687,687,687,687,687,687,687,687,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + }; + result = contents; + break; + } + + case rn(11,19): + { + + static const short contents[] = { + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,687,687,687,687,687,687,687,687,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,527,567,568,0,0,0,0,566,567,528,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,687,687,687,687,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,646,647,647,647,647,647,647,647,488,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,686,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,686,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486, + 647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,648,0,0,0,0,0,0,686,0,0,0,0,0,646,647,647,647,647,647,647,647,647,647, + 0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0, + 0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0, + 0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0, + 0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0, + 0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0, + 0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0, + 567,567,567,567,567,567,567,567,567,568,0,0,0,0,0,686,0,0,0,0,0,0,566,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567, + 486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,686,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,686,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,527,567,567,567,567,567,567,567,568,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,687,687,687,687,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,487,647,648,0,0,0,0,646,647,488,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,687,687,687,687,687,687,687,687,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + }; + result = contents; + break; + } + + case rn(12,0): + { + + static const short contents[] = { + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,490,650,650,650,650,650,491,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,611,166,167,167,167,168,609,489,489,489,489,489,489,489,489,489,490,650,650,650,491,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,611,206,86,86,86,208,609,489,489,489,489,489,489,489,489,489,611,166,167,168,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,611,206,86,86,86,208,609,489,489,489,489,489,489,489,489,489,611,206,86,208,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,611,206,86,86,86,208,609,489,489,489,489,489,489,489,489,489,611,246,247,248,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,611,246,247,247,247,248,609,489,489,489,489,489,489,489,489,489,530,570,570,570,531,489,489,489,489,490,650,650,650,650,650,650,650,650,650,650,650,650, + 489,489,530,570,570,570,570,570,531,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,166,167,167,167,168,166,167,167,167,167,167,167, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,206,86,86,86,208,206,86,86,86,86,86,86, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,206,86,86,86,208,206,86,87,247,247,247,247, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,206,86,86,86,208,206,86,208,207,207,207,207, + 650,650,650,650,650,650,650,650,650,650,650,650,650,650,491,489,489,489,489,489,489,489,489,489,489,489,489,611,206,86,86,86,208,206,86,208,207,207,207,207, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,611,206,86,86,86,208,206,86,208,207,207,207,207, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,611,206,86,86,86,208,206,86,208,207,207,207,207, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,611,206,86,86,86,208,206,86,208,207,207,207,207, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,611,206,86,86,86,208,206,86,208,207,207,207,207, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,611,206,86,86,86,208,206,86,208,207,207,207,207, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,611,206,86,86,86,208,206,86,208,207,207,207,207, + 570,570,570,570,570,570,570,570,570,570,570,570,570,570,531,489,489,489,489,489,489,489,489,489,489,489,489,611,246,247,247,247,248,206,86,208,207,207,207,207, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,530,570,570,570,570,571,206,86,208,207,207,207,207, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,206,86,208,207,207,207,207, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,206,86,127,167,167,167,167, + 489,489,489,489,489,489,489,489,489,489,490,650,650,650,491,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,206,86,86,86,86,86,86, + 489,489,489,489,489,489,489,489,489,489,611,166,167,168,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,246,247,247,247,247,247,247, + 489,489,489,489,489,489,489,489,489,489,611,206,86,208,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,530,570,570,570,570,570,570,570, + 489,489,489,489,489,489,489,489,489,489,611,246,247,248,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,530,570,570,570,531,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + }; + result = contents; + break; + } + + case rn(12,1): + { + + static const short contents[] = { + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659, + 0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0, + 0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0, + 0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0, + 0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0, + 0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0, + 0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0, + 579,579,579,579,579,579,579,579,579,580,0,0,0,0,0,698,0,0,0,0,0,0,578,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579, + 498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,698,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,698,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,539,579,579,579,579,579,579,579,580,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,699,699,699,699,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,499,659,660,0,0,0,0,658,659,500,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,699,699,699,699,699,699,699,699,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + }; + result = contents; + break; + } + + case rn(12,2): + { + + static const short contents[] = { + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,684,684,684,684,684,684,684,684,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,684,684,684,684,684,684,684,684,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,684,684,684,684,684,684,684,684,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,524,564,564,564,564,564,564,564,564,525,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + }; + result = contents; + break; + } + + case rn(12,8): + { + + static const short contents[] = { + 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, + 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, + 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, + 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, + 453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,294,292,292,292, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,818,698,698,698,698,698,412,292,292,292, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,818,698,698,698,698,698,412,292,292,292, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,818,698,698,698,698,698,412,292,292,292, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,818,698,698,698,698,698,412,292,292,292, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,818,698,698,698,698,698,412,292,292,292, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,818,698,698,698,698,698,412,292,292,292, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,372,373,373,374,698,698,698,412,292,292,292, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,414,698,698,698,412,292,292,292, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,414,698,698,698,412,292,292,292, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,414,698,698,698,412,292,292,292, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,414,698,698,698,412,292,292,292, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,414,698,698,698,412,292,292,292, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,414,698,698,698,412,292,292,292, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,414,698,698,698,412,292,292,292, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,414,698,698,698,412,292,292,292, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,414,698,698,698,412,292,292,292, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,414,698,698,698,412,292,292,292, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,414,698,698,698,412,292,292,292, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,414,698,698,698,412,292,292,292, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,414,698,698,698,412,292,292,292, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,414,698,698,698,412,292,292,292, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,414,698,698,698,412,292,292,292, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,414,698,698,698,412,292,292,292, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,414,698,698,698,412,292,292,292, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,414,698,698,698,412,292,292,292, + }; + + + obj.createentity(-328 + (8 * 8), (12 * 8), 1, 0, 0, -10000, -10000, 10000, 100000); // Enemy + obj.nearelephant = true; + + obj.createentity(240, 72, 10, 1, 8120); // (savepoint) + roomtileset = 0; // (Use space station tileset) + result = contents; + break; + } + + case rn(12,9): + { + + static const short contents[] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,95,217,689,689,689,215,95,95,95, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,95,217,689,689,689,215,95,95,95, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,95,217,689,689,689,215,95,95,95, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,95,217,689,689,689,215,95,95,95, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,95,217,689,689,689,215,95,95,95, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,95,217,689,689,689,215,95,95,95, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,95,217,689,689,689,215,95,95,95, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,95,217,689,689,689,215,95,95,95, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,95,217,689,689,689,215,95,95,95, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,95,217,689,689,689,215,95,95,95, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,95,217,689,689,689,215,95,95,95, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,95,217,689,689,689,215,95,95,95, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,95,217,689,689,689,215,95,95,95, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,95,217,689,689,689,215,95,95,95, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,95,217,689,689,689,215,95,95,95, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,95,217,689,689,689,215,95,95,95, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,95,217,689,689,689,215,95,95,95, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,95,217,689,689,689,215,95,95,95, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,95,217,689,689,689,215,95,95,95, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,95,217,689,689,689,215,95,95,95, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,95,217,689,689,689,215,95,95,95, + 176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,177,0,0,0,0,215,95,95,217,689,689,689,215,95,95,95, + 256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,257,0,0,0,0,215,95,95,217,689,689,689,215,95,95,95, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,95,217,689,689,689,215,95,95,95, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,95,217,689,689,689,215,95,95,95, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,95,217,689,689,689,215,95,95,95, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,95,217,689,689,689,215,95,95,95, + 176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,137,95,95,217,689,689,689,215,95,95,95, + 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,217,689,689,689,215,95,95,95, + 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,217,689,689,689,215,95,95,95, + }; + + + obj.createentity(-328 + (8 * 8), -248 + (12 * 8), 1, 0, 0, -10000, -10000, 10000, 100000); // Enemy + obj.nearelephant = true; + + roomtileset = 0; // (Use space station tileset) + result = contents; + break; + } + + case rn(12,10): + { + + static const short contents[] = { + 104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,226,704,704,704,224,104,104,104, + 104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,226,704,704,704,224,104,104,104, + 104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,226,704,704,704,224,104,104,104, + 104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,226,704,704,704,224,104,104,104, + 104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,226,704,704,704,224,104,104,104, + 104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,226,704,704,704,224,104,104,104, + 104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,226,704,704,704,224,104,104,104, + 104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,226,704,704,704,224,104,104,104, + 104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,226,704,704,704,224,104,104,104, + 104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,226,704,704,704,224,104,104,104, + 104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,226,704,704,704,224,104,104,104, + 104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,226,704,704,704,224,104,104,104, + 104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,226,704,704,704,224,104,104,104, + 104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,226,704,704,704,224,104,104,104, + 104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,226,704,704,704,224,104,104,104, + 104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,226,704,704,704,224,104,104,104, + 104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,226,704,704,704,224,104,104,104, + 104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,226,704,704,704,224,104,104,104, + 104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,226,704,704,704,224,104,104,104, + 104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,226,704,704,704,224,104,104,104, + 104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,226,704,704,704,224,104,104,104, + 104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,226,704,704,704,224,104,104,104, + 104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,226,704,704,704,224,104,104,104, + 265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,266,704,704,704,224,104,104,104, + 704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,224,104,104,104, + 704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,224,104,104,104, + 704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,224,104,104,104, + 704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,224,104,104,104, + 185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,146,104,104,104, + 104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104, + }; + + obj.nearelephant = false; + roomtileset = 0; // (Use space station tileset) + result = contents; + break; + } + + case rn(12,16): + { + + static const short contents[] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,578,579,579,579,579,580,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,578,540,498,498,498,498,539,580,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,578,540,498,498,498,498,498,498,539,580,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,540,498,498,498,498,498,498,498,498,539,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + }; + result = contents; + break; + } + + case rn(12,17): + { + + static const short contents[] = { + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650, + 0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0, + 0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0, + 0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0, + 0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0, + 0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0, + 0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0, + 570,570,570,570,570,570,570,570,570,571,0,0,0,0,0,689,0,0,0,0,0,0,569,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570, + 489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,689,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,689,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,530,570,570,570,570,570,570,570,571,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,690,690,690,690,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,490,650,651,0,0,0,0,649,650,491,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,690,690,690,690,690,690,690,690,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + }; + result = contents; + break; + } + + case rn(12,18): + { + + static const short contents[] = { + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,687,687,687,687,687,687,687,687,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,527,567,568,0,0,0,0,566,567,528,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,687,687,687,687,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,646,647,647,647,647,647,647,647,488,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,686,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,686,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486, + 647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,648,0,0,0,0,0,0,686,0,0,0,0,0,646,647,647,647,647,647,647,647,647,647, + 0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0, + 0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0, + 0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0, + 0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0, + 0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0, + 0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0, + 567,567,567,567,567,567,567,567,567,568,0,0,0,0,0,686,0,0,0,0,0,0,566,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567, + 486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,686,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,686,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,527,567,567,567,567,567,567,567,568,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,687,687,687,687,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,487,647,648,0,0,0,0,646,647,488,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,687,687,687,687,687,687,687,687,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + }; + result = contents; + break; + } + + case rn(12,19): + { + + static const short contents[] = { + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,690,690,690,690,690,690,690,690,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,530,570,571,0,0,0,0,569,570,531,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,690,690,690,690,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,649,650,650,650,650,650,650,650,491,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,689,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,689,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489, + 650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,651,0,0,0,0,0,0,689,0,0,0,0,0,649,650,650,650,650,650,650,650,650,650, + 0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0, + 0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0, + 0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0, + 0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0, + 0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0, + 0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,689,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0, + 570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + }; + result = contents; + break; + } + + case rn(13,1): + { + + static const short contents[] = { + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,215,95,95,95,217,215,95,217,216,216,216,216,216,216,216,216,216,216,216, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,215,95,95,95,217,215,95,217,216,216,216,216,216,216,216,216,216,216,216, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,215,95,95,95,217,215,95,217,216,216,216,216,216,216,216,216,216,216,216, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,215,95,95,95,217,215,95,136,176,176,176,176,176,176,176,176,176,176,176, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,215,95,95,95,217,215,95,95,95,95,95,95,95,95,95,95,95,95,95, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,215,95,95,95,217,255,256,256,256,256,256,256,256,256,256,256,256,256,256, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,215,95,95,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,215,95,95,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,215,95,95,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,215,95,95,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,215,95,95,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,657,215,95,95,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,215,95,95,95,217,0,0,0,0,0,175,176,176,176,176,176,176,176,176, + 0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,215,95,95,95,217,0,0,0,0,0,215,95,95,95,95,95,95,95,95, + 0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,215,95,95,95,217,0,0,0,0,0,215,95,96,256,256,256,256,256,256, + 0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,215,95,95,95,217,0,0,0,0,0,215,95,217,216,216,216,216,216,216, + 0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,215,95,95,95,217,0,0,0,0,0,215,95,217,216,216,216,216,216,216, + 0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,215,95,95,95,217,0,0,0,0,0,215,95,217,216,216,216,216,216,216, + 576,576,576,576,576,576,576,576,576,577,175,176,176,176,177,0,0,0,0,0,0,215,95,95,95,217,0,0,0,0,0,215,95,217,216,216,216,216,216,216, + 495,495,495,495,495,495,495,495,495,617,215,95,95,95,217,696,696,696,696,696,696,215,95,95,95,217,0,0,0,0,0,215,95,217,216,216,216,216,216,216, + 495,495,495,495,495,495,495,495,495,617,215,95,95,95,217,0,0,0,0,0,0,215,95,95,95,217,0,0,0,0,0,215,95,217,216,216,216,216,216,216, + 495,495,495,495,495,495,495,495,495,617,215,95,95,95,217,0,0,0,0,0,0,255,256,256,256,257,0,0,0,0,0,215,95,217,216,216,216,216,216,216, + 495,495,495,495,495,495,495,495,495,617,255,256,256,256,257,0,0,0,0,0,0,575,576,576,576,577,0,0,0,0,0,215,95,217,216,216,216,216,216,216, + 495,495,495,495,495,495,495,495,495,536,576,576,576,576,577,0,0,0,0,0,0,615,495,495,495,617,0,0,0,0,0,215,95,217,216,216,216,216,216,216, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,615,495,495,495,617,0,0,0,0,0,215,95,217,216,216,216,216,216,216, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,615,495,495,495,617,0,0,0,0,0,215,95,217,216,216,216,216,216,216, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,696,696,696,696,696,696,615,495,495,495,617,696,696,696,696,696,215,95,217,216,216,216,216,216,216, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,615,495,495,495,617,0,0,0,0,0,215,95,217,216,216,216,216,216,216, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,615,495,495,495,617,0,0,0,0,0,215,95,217,216,216,216,216,216,216, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,615,495,495,495,617,0,0,0,0,0,215,95,217,216,216,216,216,216,216, + }; + result = contents; + break; + } + + case rn(13,2): + { + + static const short contents[] = { + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0,600,480,480,480,602,0,0,0,0,0,209,89,211,210,210,210,210,210,210, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0,600,480,480,480,602,0,0,0,0,0,209,89,211,210,210,210,210,210,210, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0,600,480,480,480,602,0,0,0,0,0,209,89,211,210,210,210,210,210,210, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0,600,480,480,480,602,0,0,0,0,0,209,89,211,210,210,210,210,210,210, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0,600,480,480,480,602,0,0,0,0,0,209,89,211,210,210,210,210,210,210, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0,600,480,480,480,602,0,0,0,0,0,209,89,211,210,210,210,210,210,210, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0,600,480,480,480,602,0,0,0,0,0,209,89,211,210,210,210,210,210,210, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,681,681,681,681,681,681,600,480,480,480,602,681,681,681,681,681,209,89,211,210,210,210,210,210,210, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0,600,480,480,480,602,0,0,0,0,0,209,89,211,210,210,210,210,210,210, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0,600,480,480,480,602,0,0,0,0,0,209,89,211,210,210,210,210,210,210, + 480,480,480,480,481,641,641,641,641,641,641,641,641,641,642,0,0,0,0,0,0,600,480,480,480,602,0,0,0,0,0,209,89,211,210,210,210,210,210,210, + 480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,602,0,0,0,0,0,209,89,211,210,210,210,210,210,210, + 480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,602,681,681,681,681,681,209,89,211,210,210,210,210,210,210, + 480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,602,0,0,0,0,0,209,89,211,210,210,210,210,210,210, + 480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,640,641,641,641,642,0,0,0,0,0,209,89,211,210,210,210,210,210,210, + 480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,209,89,211,210,210,210,210,210,210, + 480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,209,89,211,210,210,210,210,210,210, + 480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,209,89,211,210,210,210,210,210,210, + 480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,209,89,211,210,210,210,210,210,210, + 480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,209,89,211,210,210,210,210,210,210, + 480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,209,89,211,210,210,210,210,210,210, + 480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,209,89,211,210,210,210,210,210,210, + 480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,209,89,130,170,170,170,170,170,170, + 480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,209,89,89,89,89,89,89,89,89, + 480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,0,0,0,0,0,0,249,250,250,250,250,250,250,250,250, + 480,480,480,480,521,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + }; + + obj.createentity(48, 96, 14); //Teleporter! + result = contents; + break; + } + + case rn(13,14): + { + + static const short contents[] = { + 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89, + 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,90,250,250,250,250,250,250,250,250,250,250,250,250,250,91,89, + 89,89,89,89,89,89,89,89,89,89,89,89,90,250,250,250,250,250,250,250,250,250,250,250,251,0,0,0,0,0,0,0,0,0,815,695,695,695,209,89, + 89,89,89,89,89,89,89,89,89,89,89,89,211,9,9,9,9,9,9,9,9,9,9,9,9,0,0,0,0,0,0,0,0,0,815,695,695,695,209,89, + 89,89,89,89,89,89,89,89,89,89,89,89,211,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,815,695,695,695,209,89, + 89,89,89,89,89,89,89,89,89,89,89,89,211,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,815,695,695,695,209,89, + 89,89,89,89,89,89,89,89,89,89,89,89,211,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,169,170,170,170,170,131,89, + 89,89,89,89,89,89,89,89,89,89,89,89,211,0,775,776,776,776,776,776,776,776,776,776,776,776,776,776,776,777,0,0,0,209,89,89,89,89,89,89, + 89,89,89,89,89,89,89,89,89,89,89,89,211,0,815,695,695,695,695,695,695,695,695,695,695,695,695,695,695,817,0,0,0,249,250,250,250,250,250,250, + 89,89,89,89,89,89,89,89,89,89,89,89,211,0,815,695,695,695,695,169,170,170,170,170,170,170,171,695,695,817,0,0,0,0,815,695,695,695,695,695, + 89,89,89,89,89,89,89,89,89,89,89,89,211,0,815,695,695,695,695,209,89,89,89,89,89,89,211,695,695,817,0,0,0,0,815,695,695,695,695,695, + 89,89,89,89,89,89,89,89,90,250,250,250,251,0,815,695,695,695,695,209,89,89,89,89,89,89,211,695,695,817,0,0,0,0,815,695,695,695,695,695, + 89,89,89,89,89,89,89,89,211,0,0,756,0,0,815,695,695,695,695,209,89,89,89,89,89,89,211,695,695,817,0,0,0,0,815,695,695,695,695,695, + 89,89,89,89,89,89,89,89,211,0,0,756,0,0,815,695,695,695,695,209,89,89,89,89,89,89,211,695,695,817,0,0,0,0,815,695,695,695,695,695, + 250,250,250,250,250,250,250,250,251,0,0,756,0,0,815,695,695,695,695,209,89,89,89,89,89,89,130,170,170,170,170,170,170,170,170,170,170,170,170,170, + 0,0,0,0,0,756,0,0,0,0,0,756,0,0,815,695,695,695,695,209,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89, + 0,0,0,0,0,756,0,0,0,0,0,756,0,0,815,695,695,695,695,249,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250, + 0,0,0,0,0,756,0,0,0,0,0,756,0,0,815,695,695,695,695,695,695,695,695,695,695,695,695,695,695,817,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,756,0,0,0,0,0,756,0,0,815,695,695,695,695,695,695,695,695,695,695,695,695,695,695,817,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,756,0,0,0,0,0,756,0,0,815,695,695,695,695,695,695,695,695,695,695,695,695,695,695,817,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,756,0,0,0,0,0,756,0,0,815,695,695,695,695,695,695,695,695,695,695,695,695,695,695,817,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,756,0,0,0,0,0,756,0,0,815,695,695,695,695,695,695,695,695,695,695,695,695,695,695,817,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,756,0,0,0,0,0,756,0,0,815,695,695,695,695,695,695,695,695,695,695,695,695,695,695,817,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,396,397,397,397,397,397,397,397,397,397,397,397,398,856,856,856,856,856,856,856,856,856,856,856,856,857,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,476,477,477,477,477,477,477,477,477,477,477,477,478,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + obj.createentity(280, 32, 20, 1); //terminal + obj.createblock(5, 280-4, 32, 20, 16, 9); + + roomtileset = 0; // (Use space station tileset) + result = contents; + break; + } + + case rn(13,15): + { + + static const short contents[] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,581,582,583,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,621,501,623,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,661,662,663,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,701,0,0,0,0,0,0,0,0,0,701,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,581,582,583,0,0,0,701,0,0,0,0,0,0,0,0,0,701,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,621,501,623,702,702,702,703,702,702,702,702,702,702,702,702,702,703,702,702,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,661,662,663,0,0,0,701,0,0,0,0,0,0,0,0,0,701,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,701,0,0,0,0,701,0,0,0,0,0,0,0,0,0,701,0,0,0,0,0,0,0, + 0,0,0,0,0,0,581,582,583,0,0,581,582,583,0,0,0,701,0,0,0,0,701,0,0,0,581,582,583,0,0,581,582,583,0,0,0,0,0,0, + 0,0,0,0,0,0,621,501,623,702,702,621,501,623,702,702,702,703,702,702,702,702,703,702,702,702,621,501,623,702,702,621,501,623,0,0,0,0,0,0, + 0,0,0,0,0,0,661,662,663,0,0,661,662,663,0,0,0,701,0,0,0,0,701,0,0,0,661,662,663,0,0,661,662,663,0,0,0,0,0,0, + 0,0,0,0,0,0,0,701,0,0,0,0,0,0,0,0,0,701,0,0,0,0,701,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,701,0,0,0,0,0,0,0,0,0,701,0,0,0,581,582,583,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,702,702,703,702,702,702,702,702,702,702,702,702,703,702,702,702,621,501,623,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,701,0,0,0,0,0,0,0,0,0,701,0,0,0,661,662,663,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,701,0,0,0,0,0,0,0,0,0,701,0,0,0,0,701,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,581,582,583,0,0,0,0,0,0,0,0,0,0,0,0,0,701,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,621,501,623,0,0,0,0,0,0,0,0,0,0,0,0,0,701,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,661,662,663,0,0,0,0,0,0,0,0,0,0,0,0,0,701,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,701,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,701,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,701,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,701,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,701,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,701,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + result = contents; + break; + } + + case rn(13,16): + { + + static const short contents[] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,575,576,576,576, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,575,576,576,537,495,495,495, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,575,576,576,537,495,495,495,495,495,495, + 0,0,0,0,0,0,0,0,0,575,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,537,495,495,495,495,495,495,495,495,495, + 0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 0,0,0,0,0,0,0,0,0,655,656,497,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 0,0,0,0,0,0,0,0,0,0,0,655,656,497,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 0,0,0,0,0,0,0,0,0,0,0,695,0,655,656,497,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,655,656,656,497,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,655,656,656,497,495,495,495,495,496,656,656,656,656,497,495,495,495,495,495,495,495,495, + 0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,695,0,0,655,656,656,656,656,657,0,0,0,0,615,495,495,495,495,495,495,495,495, + 0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,695,0,0,0,0,0,0,695,0,0,0,0,0,615,495,495,495,495,495,495,495,495, + 0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,695,0,0,0,0,0,0,695,0,0,0,0,0,615,495,495,495,495,495,495,495,495, + 576,576,576,576,576,576,576,576,576,576,576,577,0,0,0,0,0,0,695,0,0,0,0,0,0,695,0,0,0,0,0,615,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,536,576,576,577,0,0,0,695,0,0,0,0,0,0,695,0,0,0,0,0,615,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,536,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,537,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + }; + + obj.createentity(80, 104, 10, 1, 16130); // (savepoint) + result = contents; + break; + } + + case rn(13,17): + { + + static const short contents[] = { + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656, + 0,0,0,0,695,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,695,0,0,0,0, + 0,0,0,0,695,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,695,0,0,0,0, + 0,0,0,0,695,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,695,0,0,0,0, + 0,0,0,0,695,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,695,0,0,0,0, + 0,0,0,0,695,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,695,0,0,0,0, + 0,0,0,0,695,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,0,0,0,0,695,0,0,0,0, + 576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,577,0,0,0,0,0,0,0,0,575,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,696,696,696,696,696,696,696,696,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,696,696,696,696,696,696,696,696,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + }; + + obj.createentity(240, 128, 10, 1, 17130); // (savepoint) + result = contents; + break; + } + + case rn(13,18): + { + + static const short contents[] = { + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,651,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,531,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + }; + result = contents; + break; + } + + case rn(13,19): + { + + static const short contents[] = { + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,484,644,644,644,485,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,605,163,164,165,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,605,203,83,205,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,605,243,244,245,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,484,644,644,644,485,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,524,564,564,564,525,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,163,164,165,603,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,203,83,205,603,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,243,244,245,603,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,524,564,564,564,525,483,483,483,483,483,483,483, + 644,644,644,644,485,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,484,644,644,644,644,644,485,483,483,483,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,163,164,164,164,165,603,483,483,483,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,203,83,83,83,205,603,483,483,483,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,203,83,83,83,205,603,483,483,483,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,203,83,83,83,205,603,483,483,483,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,243,244,244,244,245,603,483,483,483,483,483,483,483,483,483,483,483,483,483, + 564,564,564,564,525,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,524,564,564,564,564,564,525,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,484,644,644,644,485,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,163,164,165,603,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,203,83,205,603,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,484,644,644,644,485,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,243,244,245,603,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,605,163,164,165,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,524,564,564,564,525,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,605,203,83,205,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,605,243,244,245,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,524,564,564,564,525,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + }; + result = contents; + break; + } + + case rn(14,14): + { + + static const short contents[] = { + 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, + 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, + 292,292,292,292,292,292,292,292,292,292,292,293,453,453,453,294,292,292,292,292,292,292,292,292,293,453,453,453,294,292,292,292,292,292,292,292,292,292,292,292, + 292,292,292,292,292,292,292,292,292,292,292,414,9,9,9,412,292,292,292,292,292,292,292,292,414,9,9,9,412,292,292,292,292,292,292,292,292,292,292,292, + 292,292,292,292,292,292,292,292,292,292,292,414,0,0,0,412,292,292,292,292,292,292,292,292,414,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292, + 292,292,292,292,292,292,292,292,292,292,292,414,0,0,0,412,292,292,292,292,292,292,292,292,414,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292, + 292,292,292,292,292,292,292,292,292,292,292,414,0,0,0,412,292,292,292,292,292,292,292,292,414,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292, + 292,292,292,292,292,292,292,292,292,292,292,414,782,782,782,412,292,292,292,292,292,292,292,292,414,782,782,782,412,292,292,292,292,292,292,292,292,292,292,292, + 453,453,453,453,453,453,453,453,453,453,453,454,701,701,701,452,453,453,453,453,453,453,453,453,454,701,701,701,452,453,453,453,453,453,453,453,453,453,453,453, + 701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701, + 701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701, + 701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701, + 701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701, + 701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701, + 373,373,373,373,373,373,374,701,701,701,372,373,373,373,373,373,373,374,701,701,701,701,372,373,373,373,373,373,373,374,701,701,701,372,373,373,373,373,373,373, + 292,292,292,292,292,292,414,701,701,701,412,292,292,292,292,292,292,414,701,701,701,701,412,292,292,292,292,292,292,414,701,701,701,412,292,292,292,292,292,292, + 453,453,453,453,453,294,414,862,862,862,412,292,292,292,292,292,292,414,862,862,862,862,412,292,292,292,292,292,292,414,862,862,862,412,293,453,453,453,453,453, + 0,0,0,0,0,412,414,0,0,0,412,292,292,292,292,292,292,414,0,0,0,0,412,292,292,292,292,292,292,414,0,0,0,412,414,0,0,0,0,0, + 0,0,0,0,0,412,414,0,0,0,412,292,292,292,292,292,292,414,0,0,0,0,412,292,292,292,292,292,292,414,0,0,0,412,414,0,0,0,0,0, + 0,0,0,0,0,412,414,8,8,8,412,292,292,292,292,292,292,414,0,0,0,0,412,292,292,292,292,292,292,414,8,8,8,412,414,0,0,0,0,0, + 0,0,0,0,0,412,333,373,373,373,334,292,292,292,292,292,292,414,0,0,0,0,412,292,292,292,292,292,292,333,373,373,373,334,414,0,0,0,0,0, + 0,0,0,0,0,452,453,453,453,453,453,453,453,453,453,294,292,414,8,8,8,8,412,292,293,453,453,453,453,453,453,453,453,453,454,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,333,373,373,373,373,334,292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,452,453,453,453,453,453,453,453,453,454,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + roomtileset = 0; // (Use space station tileset) + result = contents; + break; + } + + case rn(14,16): + { + + static const short contents[] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,572,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,574,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,652,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,654,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,693,694,693,693,693,693,693,693,693,693,693,693,693,693,693,693,693,693,693,693,693,693,694,693,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,693,694,693,693,693,693,693,693,693,693,693,693,693,693,693,693,693,693,693,693,693,693,694,693,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0, + 573,573,573,573,573,573,573,573,573,573,573,573,574,693,693,693,693,693,693,693,693,693,693,693,693,693,693,694,693,0,0,0,0,0,0,0,0,0,0,0, + 492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0, + 492,492,492,492,492,492,492,492,492,492,492,492,533,573,573,574,693,693,693,693,693,693,693,693,693,693,693,694,693,0,0,0,0,0,0,0,0,0,0,0, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,533,574,693,693,693,693,693,693,693,693,693,693,694,693,0,0,0,0,0,0,0,0,0,0,0, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,533,574,693,693,693,693,693,693,693,693,693,694,693,0,0,0,0,0,0,0,0,0,0,0, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,533,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + }; + result = contents; + break; + } + + case rn(14,17): + { + + static const short contents[] = { + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,499,659,659,659,659,659,659,659,659,500,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,499,659,660,0,0,0,0,0,0,0,0,658,659,500,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,698,0,0,0,0,0,0,0,0,698,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498, + 659,659,659,659,659,659,659,659,659,659,659,659,659,660,699,700,699,699,699,699,699,699,699,699,700,699,658,500,498,498,498,498,498,498,498,498,498,498,498,498, + 0,0,0,698,0,0,0,0,0,698,0,0,0,0,0,698,0,0,0,0,0,0,0,0,698,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498, + 0,0,0,698,0,0,0,0,0,698,0,0,0,0,0,698,0,0,0,0,0,0,0,0,698,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498, + 0,0,0,698,0,0,0,0,0,698,0,0,0,0,0,698,0,0,0,0,0,0,0,0,698,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498, + 0,0,0,698,0,0,0,0,0,698,0,0,0,0,0,698,0,0,0,0,0,0,0,0,698,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498, + 0,0,0,698,0,0,0,0,0,698,0,0,0,0,0,698,0,0,0,0,0,0,0,0,698,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498, + 0,0,0,698,0,0,0,0,0,698,0,0,0,0,0,698,0,0,0,0,0,0,0,0,698,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498, + 579,579,579,579,579,579,579,579,579,579,579,579,579,580,699,700,699,699,699,699,699,699,699,699,700,699,578,540,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,698,0,0,0,0,0,0,0,0,698,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,539,579,580,0,0,0,0,0,0,0,0,578,579,540,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,539,579,579,579,579,579,579,579,579,540,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + }; + result = contents; + break; + } + + case rn(14,18): + { + + static const short contents[] = { + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,499,659,659,659,659,659,500,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,499,659,659,660,0,698,0,0,0,658,659,659,500,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,499,659,659,660,0,0,0,0,698,0,0,0,0,0,0,658,659,659,659,659,659,659,659,659,500,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,499,660,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,658,659,659,659,659,659,659,659,659, + 498,498,498,498,498,499,660,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,698,0,0,0, + 498,498,498,498,499,660,0,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,698,0,0,0, + 498,498,498,499,660,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,698,0,0,0, + 498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,698,0,0,0, + 498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,698,0,0,0, + 498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,578,579,579,579,579, + 498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,578,579,579,579,579,579,579,579,579,579,579,579,540,498,498,498,498, + 498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,698,0,0,578,579,579,579,579,540,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,620,0,0,0,0,0,0,0,0,0,578,579,579,579,579,540,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,620,0,0,0,0,0,0,0,0,578,540,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,620,0,0,0,0,0,0,0,578,540,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,620,699,699,699,699,699,699,699,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,620,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,620,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,620,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,620,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,620,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + }; + result = contents; + break; + } + + case rn(14,19): + { + + static const short contents[] = { + 495,495,495,617,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,617,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,617,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,617,696,696,696,696,696,696,696,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,617,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,617,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,617,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,617,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,496,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,497,495,495,495, + 495,495,495,617,696,696,696,696,696,696,696,615,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495, + 495,495,495,617,0,0,0,0,0,0,0,655,497,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495, + 495,495,495,617,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495, + 495,495,495,617,0,0,0,0,0,0,0,0,655,497,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495, + 495,495,495,536,577,0,0,0,0,0,0,0,0,655,656,656,656,656,656,657,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495, + 495,495,495,495,617,0,0,0,0,0,0,0,0,0,695,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495, + 495,495,495,495,617,0,0,0,0,0,0,0,0,0,695,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495, + 495,495,495,495,617,0,0,0,0,0,0,0,0,0,695,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495, + 495,495,495,495,536,576,576,577,0,0,0,0,0,0,695,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495, + 495,495,495,495,495,495,495,617,0,0,0,0,0,0,695,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495, + 495,495,495,495,495,495,495,617,0,0,0,0,0,0,695,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495, + 495,495,495,495,495,495,495,617,0,0,0,0,0,0,695,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495, + 495,495,495,495,495,495,495,617,0,0,0,0,0,0,695,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495, + 495,495,495,495,495,495,495,617,0,0,0,0,0,0,695,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495, + 495,495,495,495,495,495,495,536,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,537,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + }; + + obj.createentity(176, 72, 14); //Teleporter! + obj.createentity(88, 160, 20, 1);//terminal + + obj.createblock(5, 88-4, 160, 20, 16, 11); + result = contents; + break; + } + + case rn(15,14): + { + + static const short contents[] = { + 104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104, + 104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104, + 104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104, + 104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104, + 104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104, + 104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104, + 104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104, + 104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104, + 265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265, + 704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704, + 704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,705,865,865,706,704,705,865,865,706,704,705,865,865,706,704,704,704, + 704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,826,0,0,824,704,826,0,0,824,704,826,0,0,824,704,704,704, + 704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,826,0,0,824,704,826,0,0,824,704,826,0,0,824,704,704,704, + 704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,826,0,0,824,704,826,0,0,824,704,826,0,0,824,704,704,704, + 185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,186,704,704,704,704,826,0,0,824,704,826,0,0,824,704,826,0,0,824,704,704,704, + 104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,226,704,704,704,704,826,0,0,824,704,826,0,0,824,704,826,0,0,824,704,704,704, + 265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,106,104,104,226,704,704,704,704,826,0,0,824,704,826,0,0,824,704,826,0,0,824,704,704,704, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,224,104,104,226,704,704,704,704,826,0,0,824,704,826,0,0,824,704,826,0,0,824,704,704,704, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,224,104,104,226,704,704,704,704,826,0,0,824,704,826,0,0,824,704,826,0,0,824,704,704,704, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,224,104,104,226,704,704,704,704,745,785,785,746,704,745,785,785,746,704,745,785,785,746,704,704,704, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,224,104,104,226,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,224,104,104,145,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,224,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,264,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + roomtileset = 0; // (Use space station tileset) + result = contents; + break; + } + + case rn(15,16): + { + + static const short contents[] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,562,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,481,641,642,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,481,641,642,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,481,641,642,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 480,480,480,480,480,480,480,480,480,480,480,480,480,481,641,642,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 480,480,480,480,480,480,480,480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + result = contents; + break; + } + + case rn(15,17): + { + + static const short contents[] = { + 495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,495,495,495,495,495,495,495,495,496,657,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,495,495,495,495,495,495,495,496,657,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,495,495,495,495,495,495,496,657,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + result = contents; + break; + } + + case rn(15,18): + { + + static const short contents[] = { + 486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 486,486,486,486,486,486,486,486,486,486,527,568,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 486,486,486,486,486,486,486,486,486,486,486,527,568,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 486,486,486,486,486,486,486,486,486,486,486,486,527,568,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 486,486,486,486,486,486,486,486,486,487,647,647,647,648,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 647,647,647,647,647,647,647,647,647,648,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,686,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,686,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,686,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,686,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,686,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 567,567,567,568,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 486,486,486,527,567,567,567,567,567,567,567,567,568,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 486,486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 486,486,486,486,486,486,486,486,486,486,486,487,648,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 486,486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 486,486,486,486,486,486,486,486,486,486,487,648,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + obj.createentity(88, 96, 10, 0, 18150); // (savepoint) + result = contents; + break; + } + + case rn(15,19): + { + + static const short contents[] = { + 489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 489,489,489,489,489,489,489,489,489,489,530,571,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 489,489,489,489,489,489,489,489,489,489,489,530,571,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 489,489,489,489,489,489,489,489,489,489,489,489,530,570,571,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,530,570,571,0,0,0,0,0,0,0,0,0,0,0,0,0,0,569,570,570,570,570,570,570,570,570, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,530,570,570,570,570,570,570,570,570,570,570,570,570,570,570,531,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + }; + result = contents; + break; + } + + case rn(16,4): + { + + static const short contents[] = { + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,484,644,644,644,485,483,483,483,483,483,483,483,483,484,644,644,644,485,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,605,163,164,165,643,644,644,644,644,644,644,644,644,645,163,164,165,603,483,483,483,484,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644, + 483,605,203,83,205,163,164,164,164,164,164,164,164,164,165,203,83,205,603,483,484,644,645,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 483,605,243,244,245,243,244,244,244,244,244,244,244,244,245,243,244,245,603,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 483,524,565,163,165,0,0,0,0,0,0,0,0,0,0,163,165,563,525,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 483,483,605,203,205,0,0,0,0,0,0,0,0,0,0,243,245,643,644,644,645,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 483,483,605,203,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 483,483,605,203,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 483,483,605,203,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 483,483,605,203,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 483,483,605,203,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 483,483,605,203,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 483,483,605,203,205,0,0,0,0,0,0,0,0,0,0,163,165,563,564,564,564,564,564,564,564,564,564,565,0,0,0,0,0,0,0,0,0,0,0,0, + 483,484,645,243,245,0,0,0,0,0,0,0,0,0,0,243,245,643,485,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0, + 483,605,163,164,165,163,164,164,164,164,164,164,164,164,165,163,164,165,603,483,483,483,483,483,483,483,483,524,564,565,0,0,0,0,0,0,0,0,0,0, + 483,605,203,83,205,243,244,244,244,244,244,244,244,244,245,203,83,205,603,483,483,483,483,483,483,483,483,483,483,524,565,0,0,0,0,0,0,0,0,0, + 483,605,243,244,245,563,564,564,564,564,564,564,564,564,565,243,244,245,603,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0, + 483,524,564,564,564,525,483,483,483,483,483,483,483,483,524,564,564,564,525,483,483,483,483,483,483,483,483,483,483,483,524,564,564,564,564,564,564,564,564,564, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + }; + + obj.createentity(72, 120, 13); //Warp Token + + result = contents; + break; + } + + case rn(16,14): + { + + static const short contents[] = { + 107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107, + 107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107, + 107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107, + 107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107, + 107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107, + 107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107, + 107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107, + 107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107, + 268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,109,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107, + 689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,267,268,268,109,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107, + 689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,267,268,268,109,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107, + 689,690,850,850,691,689,690,850,850,691,689,690,850,850,691,689,689,689,689,689,689,267,268,268,109,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107, + 689,811,0,0,809,689,811,0,0,809,689,811,0,0,809,689,689,689,689,689,689,689,689,689,267,268,268,109,107,107,107,107,107,107,107,107,107,107,107,107, + 689,811,0,0,809,689,811,0,0,809,689,811,0,0,809,689,689,689,689,689,689,689,689,689,689,689,689,267,268,268,109,107,107,107,107,107,107,107,107,107, + 689,811,0,0,809,689,811,0,0,809,689,811,0,0,809,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,267,268,268,268,268,268,268,268,268,268, + 689,811,0,0,809,689,811,0,0,809,689,811,0,0,809,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,811,0,0,0, + 689,811,0,0,809,689,811,0,0,809,689,811,0,0,809,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,811,0,0,0, + 689,811,0,0,809,689,811,0,0,809,689,811,0,0,809,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,811,0,0,0, + 689,730,770,770,731,689,730,770,770,731,689,730,770,770,731,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,811,0,0,0, + 689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,187,188,189,689,811,0,0,0, + 689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,227,107,229,689,811,0,0,0, + 188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,149,107,229,850,851,0,0,0, + 107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,229,0,0,0,0,0, + 268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,269,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + roomtileset = 0; // (Use space station tileset) + obj.createentity(176, 152, 10, 1, 14160); // (savepoint) + result = contents; + break; + } + + case rn(16,17): + { + + static const short contents[] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,575,576,577,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,536,576,577,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,536,576,577,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,496,656,657,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,496,656,657,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,655,656,657,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + result = contents; + break; + } + + case rn(16,19): + { + + static const short contents[] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,565,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,524,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + }; + result = contents; + break; + } + + case rn(17,4): + { + + static const short contents[] = { + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,499,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 498,498,498,498,498,498,498,498,498,499,659,659,659,659,660,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 498,498,498,499,659,659,659,659,659,660,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 659,659,659,660,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 579,579,579,579,579,579,579,580,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 498,498,498,498,498,498,498,539,579,579,579,579,579,579,579,579,579,579,579,579,579,579,580,6,6,6,6,6,6,6,6,0,0,0,0,0,0,0,0,0, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,539,579,579,579,579,579,579,579,580,6,6,6,6,0,0,0,0,0, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,539,579,579,579,580,6,6,6,6,6, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,539,579,579,579,579,579, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + }; + result = contents; + break; + } + + case rn(17,12): + { + + static const short contents[] = { + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,496,656,656,656,656,656,656,656,656,656,656,656,656,656,656,497,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,496,657,0,0,0,0,0,0,0,0,0,0,0,0,0,0,655,497,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,655,656,656,656,656,656,656,656,656,656,656,656,656,656,656,497,495,495,495,495,495, + 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495, + 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495, + 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495, + 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495, + 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495, + 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495, + 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,760,761,761,761,761,761,761,761,761,761,761,761,615,495,495,495,495,495, + 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,615,495,495,495,495,495, + 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,615,495,495,495,495,495, + 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,615,495,495,495,495,495, + 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,615,495,495,495,495,495, + 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,615,495,495,495,495,495, + 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,575,576,576,576,576,576,576,576,577,680,680,680,680,680,680,615,495,495,495,495,495, + 495,495,536,576,577,0,0,0,0,0,0,0,0,0,0,0,0,0,575,537,495,495,495,495,495,495,495,617,680,680,680,680,680,680,615,495,495,495,495,495, + 495,495,495,495,536,576,576,576,576,576,576,576,576,576,576,576,576,576,537,495,495,495,495,495,495,495,495,617,680,680,680,680,680,680,615,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,680,680,680,680,680,680,615,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,680,680,680,680,680,680,615,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,680,680,680,680,680,680,615,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,680,680,680,680,680,680,615,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,680,680,680,680,680,680,615,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,680,680,680,680,680,680,615,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,680,680,680,680,680,680,615,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,680,680,680,680,680,680,615,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,680,680,680,680,680,680,615,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,680,680,680,680,680,680,615,495,495,495,495,495, + }; + + obj.createentity(40, 40, 14); //Teleporter! + obj.createentity(192, 120, 20, 1);//terminal + + obj.createblock(5, 192-4, 120, 20, 16, 10); + roomtileset = 0; // (Use space station tileset) + result = contents; + break; + } + + case rn(17,13): + { + + static const short contents[] = { + 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,683,683,683,683,683,683,212,92,92,92,92,92, + 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,683,683,683,683,683,683,212,92,92,92,92,92, + 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,684,844,844,844,844,685,212,92,92,92,92,92, + 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,805,0,0,0,0,803,212,92,92,92,92,92, + 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,805,0,0,0,0,803,212,92,92,92,92,92, + 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,805,0,0,0,0,803,212,92,92,92,92,92, + 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,724,764,764,764,764,725,212,92,92,92,92,92, + 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,683,683,683,683,683,683,212,92,92,92,92,92, + 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,683,683,683,683,683,683,212,92,92,92,92,92, + 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,684,844,844,844,844,685,212,92,92,92,92,92, + 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,805,0,0,0,0,803,212,92,92,92,92,92, + 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,805,0,0,0,0,803,212,92,92,92,92,92, + 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,805,0,0,0,0,803,212,92,92,92,92,92, + 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,724,764,764,764,764,725,212,92,92,92,92,92, + 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,683,683,683,683,683,683,212,92,92,92,92,92, + 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,683,683,683,683,683,683,212,92,92,92,92,92, + 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,684,844,844,844,844,685,212,92,92,92,92,92, + 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,805,0,0,0,0,803,212,92,92,92,92,92, + 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,805,0,0,0,0,803,212,92,92,92,92,92, + 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,805,0,0,0,0,803,212,92,92,92,92,92, + 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,724,764,764,764,764,725,212,92,92,92,92,92, + 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,683,683,683,683,683,683,212,92,92,92,92,92, + 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,683,683,683,683,683,683,212,92,92,92,92,92, + 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,684,844,844,844,844,685,212,92,92,92,92,92, + 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,805,0,0,0,0,803,212,92,92,92,92,92, + 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,805,0,0,0,0,803,212,92,92,92,92,92, + 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,805,0,0,0,0,803,212,92,92,92,92,92, + 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,724,764,764,764,764,725,212,92,92,92,92,92, + 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,683,683,683,683,683,683,212,92,92,92,92,92, + 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,683,683,683,683,683,683,212,92,92,92,92,92, + }; + + roomtileset = 0; // (Use space station tileset) + result = contents; + break; + } + + case rn(17,14): + { + + static const short contents[] = { + 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,211,695,695,695,695,695,695,209,89,89,89,89,89, + 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,211,695,695,695,695,695,695,209,89,89,89,89,89, + 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,211,695,695,695,695,695,695,209,89,89,89,89,89, + 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,211,695,695,695,695,695,695,209,89,89,89,89,89, + 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,211,695,695,695,695,695,695,209,89,89,89,89,89, + 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,211,695,695,695,695,695,695,209,89,89,89,89,89, + 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,211,695,695,695,695,695,695,209,89,89,89,89,89, + 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,211,695,695,695,695,695,695,209,89,89,89,89,89, + 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,211,695,695,695,695,695,695,209,89,89,89,89,89, + 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,211,695,695,695,695,695,695,209,89,89,89,89,89, + 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,211,695,695,695,695,695,695,209,89,89,89,89,89, + 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,211,695,695,695,695,695,695,209,89,89,89,89,89, + 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,211,695,695,695,695,695,695,209,89,89,89,89,89, + 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,211,695,695,695,695,695,695,209,89,89,89,89,89, + 250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,251,695,695,695,695,695,695,209,89,89,89,89,89, + 0,0,0,0,0,0,0,0,0,815,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,209,89,89,89,89,89, + 0,0,0,0,0,0,0,0,0,815,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,209,89,89,89,89,89, + 0,0,0,0,0,0,0,0,0,815,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,209,89,89,89,89,89, + 0,0,0,0,0,0,0,0,0,815,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,209,89,89,89,89,89, + 0,0,0,0,0,0,0,0,0,815,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,209,89,89,89,89,89, + 0,0,0,0,0,0,0,0,0,815,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,209,89,89,89,89,89, + 0,0,0,0,0,0,0,0,0,815,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,209,89,89,89,89,89, + 0,0,0,0,0,0,0,0,0,815,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,209,89,89,89,89,89, + 0,0,0,0,0,0,0,0,0,815,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,209,89,89,89,89,89, + 0,0,0,0,0,0,0,0,0,815,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,209,89,89,89,89,89, + 0,0,0,0,0,0,0,0,0,815,695,695,695,695,695,695,695,695,695,695,169,170,170,170,170,170,170,170,170,170,170,170,170,170,131,89,89,89,89,89, + 0,0,0,0,0,0,0,0,0,855,856,856,856,856,856,856,856,856,856,856,209,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,209,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,209,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,209,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89, + }; + + roomtileset = 0; // (Use space station tileset) + result = contents; + break; + } + + case rn(17,15): + { + + static const short contents[] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86, + 0,0,0,0,0,0,0,0,0,0,0,0,0,166,168,0,0,0,0,0,206,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86, + 0,0,0,0,0,0,0,0,0,0,0,0,0,206,208,837,837,837,837,837,206,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86, + 0,0,0,0,0,0,0,0,0,0,0,0,0,246,248,0,0,0,0,0,206,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,246,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,836,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,836,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,836,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,836,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,836,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,166,167,168,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,246,247,248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + roomtileset = 0; // (Use space station tileset) + result = contents; + break; + } + + case rn(17,16): + { + + static const short contents[] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,566,567,567,567,567,567,567,568,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,646,488,486,486,486,486,487,648,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,646,488,486,486,487,648,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,646,488,487,648,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,646,648,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + result = contents; + break; + } + + case rn(17,17): + { + + static const short contents[] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,569,570,570,570,570,570,571,0,0,0,0,0,0,0,0,569,570,570,570,570,570,571,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,611,0,0,0,0,0,0,0,0,609,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,609,489,490,650,650,650,651,0,0,0,0,0,0,0,0,649,650,650,650,491,489,611,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,609,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,611,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,609,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,611,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,609,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,611,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,649,650,651,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,649,650,651,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,569,570,571,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,569,570,571,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,609,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,611,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,609,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,611,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,609,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,611,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,609,489,530,570,570,570,571,0,0,0,0,0,0,0,0,569,570,570,570,531,489,611,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,611,0,0,0,0,0,0,0,0,609,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,649,650,650,650,650,650,651,0,0,0,0,0,0,0,0,649,650,650,650,650,650,651,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + obj.createentity(112, 72, 14); //Teleporter! + result = contents; + break; + } + + case rn(17,18): + { + + static const short contents[] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,563,565,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,563,525,524,565,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,563,525,483,483,524,565,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,563,525,483,483,483,483,524,565,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,643,644,644,644,644,644,644,645,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + result = contents; + break; + } + + case rn(17,19): + { + + static const short contents[] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,566,567,568,0,0,0,0,0,0,0,0,0,0,566,567,568,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,606,486,608,0,0,0,0,0,0,0,0,0,0,606,486,608,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,646,488,527,568,0,0,0,0,0,0,0,0,566,528,487,648,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,608,0,0,0,0,0,0,0,0,606,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,646,488,527,568,0,0,0,0,0,0,566,528,487,648,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,608,0,0,0,0,0,0,606,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,646,488,527,568,0,0,0,0,566,528,487,648,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,608,0,0,0,0,606,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,646,488,527,568,0,0,566,528,487,648,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,608,0,0,606,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,646,488,527,567,567,528,487,648,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,646,488,486,486,487,648,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 567,567,567,567,567,567,567,567,567,568,687,687,687,687,687,687,687,687,606,486,486,608,687,687,687,687,687,687,687,687,566,567,567,567,567,567,567,567,567,567, + 486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,646,647,647,648,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,527,568,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,566,528,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,527,568,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,566,528,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,527,567,568,0,0,0,0,0,0,0,0,0,0,0,0,566,567,528,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,527,567,567,567,567,567,567,567,567,567,567,567,567,528,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + 486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, + }; + + obj.createentity(152, 152, 10, 0, 19170); // (savepoint) + result = contents; + break; + } + + case rn(18,4): + { + + static const short contents[] = { + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,496,656,656,656,497,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,7,7,7,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,615,495,495,495,496,656,656,656,497,495,495,495,495,495,495,495,495,495,495,495,495, + 656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,657,0,0,0,615,495,495,495,617,7,7,7,615,495,495,495,495,495,495,495,495,495,495,495,495, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,617,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,617,0,0,0,615,495,495,495,496,656,656,656,497,495,495,495,495, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,655,656,656,656,657,0,0,0,615,495,495,495,617,7,7,7,615,495,495,495,495, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,617,0,0,0,615,495,495,495,495, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,617,0,0,0,615,495,495,495,495, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,655,656,656,656,657,0,0,0,615,495,495,495,495, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,655,656,656,656,656, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6, + 576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + }; + result = contents; + break; + } + + case rn(18,15): + { + + static const short contents[] = { + 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,633,513,513,513,513,513,513,513,513,513,513,513,513,513,513,513,513,513, + 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,633,513,513,513,513,513,513,513,513,513,513,513,513,513,513,513,513,513, + 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,633,513,513,514,674,674,674,515,513,513,513,513,513,513,513,513,513,513, + 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,633,513,513,635,369,370,371,633,513,513,513,513,513,513,513,513,513,513, + 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,633,513,513,635,409,289,411,633,513,514,674,674,515,513,513,513,513,513, + 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,290,450,450,450,451,633,513,513,635,449,450,451,633,513,635,369,371,633,513,513,513,513,513, + 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,593,594,594,594,555,513,513,554,594,594,594,555,513,635,449,451,633,513,513,513,513,513, + 289,289,289,289,289,289,289,289,289,289,289,289,289,289,290,450,450,451,633,513,513,513,513,513,513,513,513,513,513,513,513,554,594,594,555,513,513,513,513,513, + 289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,593,594,594,555,513,513,513,513,513,513,513,513,513,513,513,513,513,513,513,513,513,513,513,513,513, + 450,450,450,450,450,450,450,450,450,450,450,450,450,450,451,633,513,513,514,674,674,515,513,513,513,513,513,513,513,513,513,513,513,513,513,513,513,513,513,513, + 0,0,0,0,0,0,0,0,0,0,0,796,0,0,0,633,513,513,635,369,371,633,513,514,674,674,674,674,674,674,674,674,674,674,674,674,674,674,674,674, + 0,0,0,0,0,0,0,0,0,0,0,796,0,0,0,633,513,513,635,449,451,633,513,635,0,796,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,796,0,0,0,633,513,513,554,594,594,555,513,635,0,796,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,796,0,0,0,673,674,674,674,674,674,674,674,675,0,796,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,796,0,0,0,0,796,0,0,0,0,0,0,0,0,796,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,796,0,0,0,0,796,0,0,0,0,0,0,0,0,796,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,796,0,0,0,0,796,0,0,0,0,0,0,0,0,796,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,796,0,0,0,0,796,0,0,0,0,0,0,0,0,796,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,796,0,0,0,0,796,0,0,0,0,0,0,0,0,796,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,796,0,0,0,0,796,0,0,0,0,0,0,0,0,796,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,796,0,0,0,0,796,0,0,0,0,0,0,0,0,796,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,593,594,594,594,594,594,594,595,0,0,0,0,0,0,0,796,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,673,674,674,674,674,674,674,675,0,0,0,0,0,0,0,796,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,593,594,595,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,633,513,635,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,673,674,675,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + roomtileset = 0; // (Use space station tileset) + obj.createentity(104, 152, 10, 1, 15180); // (savepoint) + result = contents; + break; + } + + case rn(18,17): + { + + static const short contents[] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,560,561,562,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,560,561,522,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,560,561,522,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,640,641,482,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,640,641,482,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,640,641,642,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + result = contents; + break; + } + + case rn(18,19): + { + + static const short contents[] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,563,564,564,564,564,564, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,563,564,564,525,483,483,483,483,483, + 564,564,564,564,564,564,564,565,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,563,564,525,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,524,564,565,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,563,525,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,524,565,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,563,525,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,524,565,0,0,0,0,0,0,0,0,0,0,0,0,0,0,563,525,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,524,564,564,565,0,0,0,0,0,0,0,0,0,563,564,525,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,524,564,564,564,564,564,564,564,564,564,525,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + }; + result = contents; + break; + } + + case rn(19,4): + { + + static const short contents[] = { + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,484,644,644,644,644,644,485,483,483,483,483,483,483,484,644,644,644,644,644,485,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,605,7,7,7,7,7,603,483,483,483,483,483,483,605,7,7,7,7,7,603,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,605,0,0,0,0,0,603,483,483,483,483,483,483,605,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,605,0,0,0,0,0,603,483,483,483,483,483,483,605,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,605,0,0,0,0,0,603,483,483,483,483,483,483,605,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,605,0,0,0,0,0,603,483,483,483,483,483,483,605,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,605,0,0,0,0,0,603,483,483,483,483,483,483,605,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483, + 644,644,644,644,644,644,644,645,0,0,0,0,0,643,644,644,644,644,644,644,645,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,643,644,644,644,644,644,644,644,644,644,644,644,644,644, + 0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,684,684,685,684,684,684,684,684,684,684,684,684,684,684,684,684,684,684,684,684,684,685,684,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,563,564,564,564,565,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,643,644,644,644,645,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,563,564,564,564,564,565,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,643,644,644,644,644,645,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 6,6,6,6,6,6,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 564,564,564,564,564,564,565,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + obj.createentity(192, 176, 10, 1, 105190); // (savepoint) + result = contents; + break; + } + + case rn(19,5): + { + + static const short contents[] = { + 495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,495,495,617,0,0,0,0,0,6,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,495,495,617,0,0,0,0,0,575,577,0,0,0,0,0,0,0,6,6,0,0,0,0,0,0,0,0,6,6,0,0,0,0,0,0,0, + 495,495,495,495,495,495,617,0,0,0,0,0,615,617,0,0,0,0,0,0,0,575,577,0,0,0,0,0,0,0,0,575,577,0,0,0,0,0,0,0, + 495,495,495,495,495,495,617,0,0,0,0,0,615,617,0,0,0,0,0,0,0,615,617,0,0,0,0,0,0,0,0,615,617,0,0,0,0,0,0,0, + 495,495,495,495,495,495,617,0,0,0,0,0,615,617,0,0,0,0,0,0,0,615,617,0,0,0,0,0,0,0,0,615,617,0,0,0,0,0,0,0, + 495,495,495,495,495,495,617,0,0,0,0,0,615,617,0,0,0,0,0,0,0,615,617,0,0,0,0,0,0,0,0,615,617,0,0,0,0,0,0,0, + 495,495,495,495,495,495,617,0,0,6,6,6,615,617,6,6,6,6,6,0,0,615,617,0,0,0,0,0,0,0,0,615,617,0,0,0,0,0,0,0, + 495,495,495,495,495,495,617,0,0,575,576,576,537,536,576,576,576,576,577,6,6,615,617,6,6,6,6,6,6,0,0,615,617,0,0,0,0,0,0,0, + 495,495,495,495,495,495,617,0,0,615,495,495,495,495,495,495,495,495,536,576,576,537,536,576,576,576,576,576,577,6,6,615,617,6,6,6,6,6,6,6, + 656,656,656,656,656,656,657,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,536,576,576,537,536,576,576,576,576,576,576,576, + 0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 576,576,576,576,576,576,576,576,576,537,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + }; + + obj.createentity(40, 192, 10, 1, 106190); // (savepoint) + result = contents; + break; + } + + + case rn(19,9): + { + + static const short contents[] = { + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,496,656,656,656,656,656,656,656,497,495,496,656,656,656,656,656,656,656,656,656,656,656,656,497,495,496,656,656,656,656, + 495,495,495,495,495,495,495,495,495,495,617,7,7,7,7,7,7,7,615,495,617,7,7,7,7,7,7,7,7,7,7,7,7,615,495,617,0,0,0,0, + 495,495,495,496,656,656,656,656,656,656,657,0,0,0,0,0,0,0,655,656,657,0,0,0,0,0,0,0,0,0,0,0,0,655,656,657,0,0,0,0, + 495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,496,657,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,575,576,577,0,0,0,0,0,0,0,0,0,0, + 495,495,617,0,0,0,0,0,0,0,575,576,576,577,0,0,0,0,0,0,6,6,6,6,6,6,6,615,495,617,0,0,0,0,0,0,0,0,0,0, + 495,495,617,0,0,0,0,0,0,0,615,495,495,617,6,6,6,6,6,6,575,576,576,576,576,576,576,537,495,536,576,576,576,576,576,576,576,576,576,576, + 495,495,617,0,0,0,0,0,0,0,615,495,495,536,576,576,576,576,576,576,537,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,617,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,617,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,617,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,617,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,617,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,617,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,617,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,617,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + }; + result = contents; + break; + } + + case rn(19,10): + { + + static const short contents[] = { + 498,498,620,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,620,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,620,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,620,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,620,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,499,659,659,500,498,498,498,498,498,498, + 498,498,620,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,499,659,660,7,7,618,498,498,498,498,498,498, + 498,498,620,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,499,659,659,660,7,7,0,0,618,498,498,498,498,498,498, + 498,498,620,699,699,699,699,699,699,699,618,498,498,498,498,498,498,498,498,498,498,498,499,659,659,660,7,7,7,0,0,0,0,618,498,498,498,498,498,498, + 498,498,620,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,620,7,7,7,0,0,0,0,0,0,0,658,659,659,659,659,659,659, + 498,498,620,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 498,498,620,0,0,0,0,0,0,0,658,500,498,498,498,498,498,498,499,659,659,500,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 498,498,620,0,0,0,0,0,0,0,0,658,500,498,498,498,499,659,660,7,7,618,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 498,498,620,0,0,0,0,0,0,0,0,0,658,659,659,659,660,0,0,0,0,618,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 498,498,620,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,658,660,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 498,498,620,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 498,498,620,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 498,498,620,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 498,498,620,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 498,498,620,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 498,498,620,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 498,498,620,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 498,498,539,579,579,579,580,0,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 498,498,498,498,498,498,539,580,0,0,0,0,0,0,698,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 498,498,498,498,498,498,498,539,579,579,579,579,580,0,698,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 498,498,498,498,498,498,498,498,498,498,498,498,539,579,579,580,0,0,0,0,0,0,0,0,0,578,580,0,0,0,0,0,0,0,0,0,0,0,0,0, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,539,579,579,580,6,6,6,6,6,6,618,620,6,6,6,6,6,6,6,6,6,6,6,6,6, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,539,579,579,579,579,579,579,540,539,579,579,579,579,579,579,579,579,579,579,579,579,579, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + }; + + obj.createentity(72, 168, 10, 1, 111190); // (savepoint) + result = contents; + break; + } + + case rn(19,11): + { + + static const short contents[] = { + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,496,656,656,656,656,656,656,656,656,656,656,656,656,497,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,617,0,0,0,0,0,695,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,496,656,656,656,656,656,656,656,656,656,656, + 495,495,617,0,0,0,0,0,695,0,0,0,0,0,0,655,656,656,497,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0, + 495,495,617,0,0,0,0,0,695,0,0,0,0,0,0,0,695,0,615,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0, + 495,495,617,0,0,0,0,0,695,0,0,0,0,0,0,0,695,0,655,656,656,497,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0, + 495,495,617,0,0,0,0,0,695,0,0,0,0,0,0,0,695,0,0,0,0,615,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0, + 495,495,617,0,0,0,0,575,576,576,576,577,0,0,0,0,695,0,0,0,0,655,656,656,497,495,495,495,495,536,576,576,576,576,576,576,576,576,576,576, + 495,495,617,0,0,0,0,615,495,495,495,617,0,0,0,0,695,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,617,696,696,696,696,615,495,495,495,536,576,576,577,0,695,0,0,0,0,0,0,0,655,656,656,497,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,617,0,0,0,0,615,495,495,495,495,495,495,617,0,695,0,0,0,0,0,0,0,0,695,0,615,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,617,0,0,0,0,615,495,495,495,495,495,495,536,576,576,577,0,0,0,0,0,0,0,695,0,655,656,656,497,495,495,495,495,495,495,495,495,495, + 495,495,617,0,0,0,0,615,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,695,0,0,0,0,615,495,495,495,495,495,495,495,495,495, + 495,495,617,0,0,0,0,615,495,495,495,495,495,495,495,495,495,536,576,576,577,0,0,0,0,695,0,0,0,0,655,656,656,497,495,495,495,495,495,495, + 495,495,617,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,695,0,0,0,0,0,0,0,615,495,495,495,495,495,495, + 495,495,617,696,696,696,696,615,495,495,495,495,495,495,495,495,495,495,495,495,536,576,576,577,0,695,0,0,0,0,0,0,0,655,656,656,497,495,495,495, + 495,495,617,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,695,0,0,0,0,0,0,0,0,695,0,615,495,495,495, + 495,495,617,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,536,576,576,577,0,0,0,0,0,0,0,695,0,655,656,656,656, + 495,495,617,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,695,0,0,0,0,0, + 495,495,617,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,536,576,576,577,0,0,0,0,695,0,0,0,0,0, + 495,495,617,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,695,0,0,0,0,0, + 495,495,617,696,696,696,696,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,536,576,576,577,0,695,0,0,0,0,0, + 495,495,617,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,695,0,0,0,0,0, + 495,495,617,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,536,576,576,577,0,0,0,0, + 495,495,617,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0, + 495,495,617,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,536,576,576,576,576, + 495,495,617,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,536,576,576,576,576,537,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + }; + result = contents; + break; + } + + case rn(19,12): + { + + static const short contents[] = { + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,499,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,499,659,660,0,0,0,0,698,0,0,0,0,0,0,698,0,0,0,0,0,0,0,698,0,0, + 498,498,498,498,498,498,498,498,498,498,498,498,498,499,659,660,0,0,0,0,0,0,698,0,0,0,0,0,0,698,0,0,0,0,0,0,0,698,0,0, + 498,498,498,498,498,498,498,498,498,498,498,499,659,660,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,698,0,0,0,0,0,0,0,698,0,0, + 498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,0,0,698,0,0,578,579,579,579,579,579,579,579, + 498,498,498,498,498,498,498,498,498,498,499,660,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,578,579,579,579,579,540,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,698,0,578,579,579,540,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,499,660,0,0,0,0,0,0,0,0,0,0,0,698,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,578,579,540,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,578,579,540,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,578,579,540,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,499,660,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,620,699,699,699,699,699,699,699,699,699,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,658,659,500,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,658,659,500,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,658,659,500,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,658,659,500,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,499,660,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,658,659,659,659,659,659,659,659,659,659,659,659,659,659, + 498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 498,498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 498,498,498,498,498,498,499,660,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 498,498,498,498,498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + result = contents; + break; + } + + case rn(19,13): + { + + static const short contents[] = { + 480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 480,480,480,480,480,481,642,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 480,480,480,480,481,642,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 480,480,480,480,521,562,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 480,480,480,480,480,521,562,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,560,561,561, + 480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,560,561,561,561,522,480,480, + 480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480, + 480,480,480,480,480,480,602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480, + }; + result = contents; + break; + } + + case rn(19,14): + { + + static const short contents[] = { + 489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489, + 489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489, + 489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489, + 489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489, + 489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,569,570,571,0,0,0,0,609,489,489,489,489,489,489, + 489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,649,650,651,0,0,0,0,609,489,489,489,489,489,489, + 489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,609,489,489,489,489,489,489, + 489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,569,570,571,0,689,0,0,689,0,0,0,0,0,609,489,489,489,489,489,489, + 489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,611,690,691,690,690,691,690,690,690,690,690,609,489,489,489,489,489,489, + 489,489,489,489,489,489,611,0,689,0,569,570,571,0,0,0,0,0,0,0,649,650,651,0,689,0,0,689,0,0,0,0,0,609,489,489,489,489,489,489, + 489,489,489,489,489,489,611,690,691,690,609,489,611,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,569,570,570,531,489,489,489,489,489,489, + 489,489,489,489,489,489,611,0,689,0,649,650,651,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,611,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,611,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,569,570,571,0,0,0,0,609,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,611,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,649,650,651,0,0,0,0,609,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,611,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,611,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,611,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,569,570,570,531,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,611,0,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,611,0,689,0,0,0,0,0,0,0,0,569,570,571,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,611,0,689,0,569,571,0,0,0,0,0,609,489,611,690,690,690,690,690,690,690,609,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,611,690,691,690,609,611,0,0,0,0,0,649,650,651,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,611,0,689,0,649,651,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,569,570,570,531,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,611,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + }; + + obj.createentity(80, 144, 10, 1, 14190); // (savepoint) + result = contents; + break; + } + + case rn(19,15): + { + + static const short contents[] = { + 492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,493,654,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,652,653,653,653,653,653,653,653,653,653,653,653,494,492,492,492, + 492,492,492,492,493,654,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492, + 492,492,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492, + 492,492,492,493,654,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,572,573,573,573,573,573,573,573,534,492,492,492, + 653,653,653,654,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,652,653,653,653,653,653,653,494,492,492,492,492, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,572,573,573,573,534,492,492,492,492, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,652,653,653,653,494,492,492,492,492, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,572,573,573,573,573,534,492,492,492,492, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,652,653,653,653,653,653,494,492,492,492, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,572,573,573,573,534,492,492,492, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,652,653,653,653,653,494,492,492, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,572,573,573,573,573,573,573,573,534,492,492, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492,492,492,492,492,492,492,492,492, + }; + result = contents; + break; + } + + case rn(19,16): + { + + static const short contents[] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,563,564,565,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,605,684,684,684,684,684,684,684,684,684,684,603,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,605,0,0,0,0,0,0,0,0,0,0,643,644,644,644,644,485,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,603,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,603,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,603,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,603,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,603,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,643,644,645,0,683,0,0,0,0,0,0,0,0,563,564,564,564,564,525,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,683,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,684,685,684,684,685,684,684,684,684,684,684,684,684,603,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,683,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,563,564,565,0,0,0,0,0,0,0,643,644,644,644,644,485,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,603,483,605,0,0,0,0,0,0,0,0,0,0,0,50,603,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,605,0,0,0,0,0,0,0,0,0,0,0,50,603,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,605,0,0,0,0,0,0,0,0,0,0,0,50,603,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,605,0,0,0,0,0,0,0,0,0,0,0,50,603,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,605,0,0,0,0,0,0,0,0,0,0,0,50,603,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,605,0,0,0,0,0,0,0,563,564,564,564,564,525,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,605,684,684,684,684,684,684,684,603,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,643,644,645,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483,483,483,483,483,483,483,483, + }; + result = contents; + break; + } + + case rn(19,17): + { + + static const short contents[] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,655,656,497,495,495,495,495,495,495,495,495, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,655,656,656,497,495,495,495,495,495, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,655,656,497,495,495,495, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,655,656,656,656, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,575,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,655,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,695,0,0,0,695,0,0,0,695,0,0,0,695,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,695,0,0,0,695,0,0,0,695,0,0,0,695,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,695,0,0,0,695,0,0,0,695,0,0,0,695,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,695,0,0,0,695,0,0,0,695,0,0,0,695,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,0,695,0,0,0,695,0,0,0,695,0,0,0,695,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,575,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + }; + + obj.createentity(168, 88, 10, 1, 17190); // (savepoint) + result = contents; + break; + } + + case rn(19,18): + { + + static const short contents[] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,658,659,659,659,659,659,659,659,659,659,659,659,500,498,498,498,498,498,498,498,498, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,698,0,0,0,0,0,618,498,498,498,498,498,498,498,498, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,698,0,0,0,0,0,618,498,498,498,498,498,498,498,498, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,698,0,0,0,0,0,618,498,498,498,498,498,498,498,498, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,698,0,0,0,0,0,618,498,498,498,498,498,498,498,498, + 0,0,0,0,0,0,0,0,578,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,580,0,0,0,0,618,498,498,498,498,498,498,498,498, + 0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,699,699,699,699,618,498,498,498,498,498,498,498,498, + 0,0,0,0,0,0,0,0,658,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,660,0,0,0,0,618,498,498,498,498,498,498,498,498, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,698,0,0,0,0,0,618,498,498,498,498,498,498,498,498, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,698,0,0,0,0,0,618,498,498,498,498,498,498,498,498, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,698,0,0,0,0,0,618,498,498,498,498,498,498,498,498, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,698,0,0,0,0,0,618,498,498,498,498,498,498,498,498, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,578,579,579,579,579,579,579,579,579,579,579,579,540,498,498,498,498,498,498,498,498, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + }; + result = contents; + break; + } + + case rn(19,19): + { + + static const short contents[] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,640,482,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,640,482,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 561,561,561,561,561,562,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,521,561,561,562,0,0,0,0,0,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,521,561,561,561,561,562,0,0,0,0,0,0,0,600,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,521,561,561,561,561,561,561,561,522,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + 480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, + }; + result = contents; + break; + } + + ///Secret lab! + + case rn(17, 6): + //Phase 1 + if(obj.altstates==1) + { + + static const short contents[] = { + 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, + 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, + 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, + 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, + 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, + 286,286,286,287,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,288,286,286,286,287,447,447,447,288,286,286,286,287,447,447,447, + 286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,408,0,0,0,406,286,286,286,408,0,0,0, + 286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,408,0,0,0,406,286,286,286,408,0,0,0, + 286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,408,0,0,0,406,286,286,286,408,0,0,0, + 286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,408,0,0,0,406,286,286,286,408,0,0,0, + 286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,366,367,367,367,367,328,286,286,286,408,0,0,0,406,286,286,286,408,0,0,0, + 286,286,286,327,367,368,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286,286,286,287,448,0,0,0,406,286,286,287,448,0,0,0, + 286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286,286,287,448,0,0,0,0,406,286,287,448,0,0,0,0, + 286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,446,447,447,447,288,286,286,408,0,0,0,0,0,406,286,408,0,0,0,0,0, + 286,286,286,287,447,448,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,287,448,0,0,0,0,366,328,286,408,0,0,0,0,0, + 286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,408,0,0,0,0,0,406,286,286,408,0,0,0,0,0, + 286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,408,0,0,0,0,0,406,286,286,408,0,0,0,0,0, + 286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,408,0,0,0,0,0,406,286,286,408,0,0,0,0,0, + 286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,408,0,0,0,0,0,406,286,286,408,0,0,0,0,0, + 286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,408,0,0,0,0,0,406,286,286,408,0,0,0,0,0, + 286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,408,0,0,0,0,366,328,286,286,408,0,0,0,0,0, + 286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,327,368,0,0,0,406,286,286,286,327,368,0,0,0,0, + 286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,366,328,286,286,408,0,0,0,406,286,286,286,286,408,0,0,0,0, + 286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,408,0,0,0,406,286,286,286,286,408,0,0,0,0, + 286,286,286,327,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,328,286,286,286,327,367,367,367,328,286,286,286,286,327,367,367,367,367, + 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, + 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, + 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, + 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, + 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, + }; + result = contents; + } + else if(obj.altstates==2) + { + //Phase 2 + + static const short contents[] = { + 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, + 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, + 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, + 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, + 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, + 286,286,286,287,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,288,286,286,286,287,447,447,447,288,286,286,286,287,447,447,447, + 286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,446,288,287,447,448,0,0,0,406,286,286,286,408,0,0,0, + 286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,446,448,0,0,0,0,0,406,286,286,286,408,0,0,0, + 286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,408,0,0,0, + 286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,408,0,0,0, + 286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,408,0,0,0, + 286,286,286,327,367,368,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,287,448,0,0,0, + 286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,287,448,0,0,0,0, + 286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,408,0,0,0,0,0, + 286,286,286,287,447,448,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,366,328,286,408,0,0,0,0,0, + 286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,408,0,0,0,0,0, + 286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,408,0,0,0,0,0, + 286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,408,0,0,0,0,0, + 286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,408,0,0,0,0,0, + 286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,408,0,0,0,0,0, + 286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,366,328,286,286,408,0,0,0,0,0, + 286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,327,368,0,0,0,0, + 286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,408,0,0,0,0, + 286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,408,0,0,0,0, + 286,286,286,327,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,328,286,286,286,286,327,367,367,367,367, + 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, + 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, + 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, + 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, + 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, + }; + result = contents; + } + else + { + //Phase 3 + static const short contents[] = { + 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, + 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, + 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, + 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, + 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, + 286,286,286,287,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,288,286,286,286,287,447,447,447,288,286,286,286,287,447,447,447, + 286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,446,288,287,447,448,0,0,0,406,286,286,286,408,0,0,0, + 286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,446,448,0,0,0,0,0,446,447,288,286,408,0,0,0, + 286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,446,447,448,0,0,0, + 286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 286,286,286,327,367,368,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 286,286,286,287,447,448,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 286,286,286,327,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367, + 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, + 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, + 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, + 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, + 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, + }; + result = contents; + } + hiddenname = "Secret Lab"; + break; + + case rn(18,6): + { + + static const short contents[] = { + 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,402,0,0,0,0,0,0,0,400,280,280,280,280,280,280,280,280,280,280,280, + 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,402,0,0,0,0,0,0,0,400,280,280,280,280,280,280,280,280,280,280,280, + 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,402,0,0,0,0,0,0,0,400,280,280,280,280,280,280,280,280,280,280,280, + 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,402,0,0,0,0,0,0,0,400,280,280,280,280,280,280,280,280,280,280,280, + 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,402,0,0,0,0,0,0,0,400,280,280,280,280,280,280,280,280,280,280,280, + 441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,442,0,0,0,0,0,0,0,400,280,280,280,280,280,280,280,280,280,280,280, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,400,280,280,280,280,280,280,280,280,280,280,280, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,400,280,280,280,280,280,280,280,280,280,280,280, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,400,280,280,280,280,280,280,280,280,280,280,280, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,400,280,280,280,280,280,280,280,280,280,280,280, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,400,280,280,280,280,280,280,280,280,280,280,280, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,400,280,280,280,280,280,280,280,280,280,280,280, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,400,280,280,280,280,280,280,280,280,280,280,280, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,400,280,280,280,280,280,280,280,280,280,280,280, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,400,280,280,280,280,280,280,280,280,280,280,280, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,400,280,280,280,280,280,280,280,280,280,280,280, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,440,441,441,441,441,441,441,441,441,441,441,441, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361, + 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280, + 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280, + 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280, + 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280, + 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280, + }; + hiddenname = "Secret Lab"; + result = contents; + break; + } + + case rn(18,5): + { + + static const short contents[] = { + 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, + 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, + 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, + 292,292,292,293,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,294,292,292,292,292, + 292,292,292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,292,292, + 292,292,292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,292,292, + 292,292,292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,292,292, + 292,292,292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,292,292, + 292,292,292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,292,292, + 292,292,292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,292,292, + 292,292,292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,292,292, + 292,292,292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,292,292, + 292,292,292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,292,292, + 292,292,292,414,0,0,0,0,0,372,373,373,373,373,373,373,373,373,373,373,374,0,0,0,0,0,0,0,372,373,373,373,373,373,373,334,292,292,292,292, + 292,292,292,414,0,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,414,0,0,0,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292, + 292,292,292,414,0,0,0,0,0,452,453,453,453,453,453,453,453,453,453,294,414,0,0,0,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292, + 292,292,292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,414,0,0,0,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292, + 292,292,292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,414,0,0,0,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292, + 292,292,292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,414,0,0,0,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292, + 292,292,292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,414,0,0,0,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292, + 453,453,453,454,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,414,0,0,0,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,414,0,0,0,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,414,0,0,0,0,0,0,0,412,292,292,292,292,292,293,453,453,453,453,453, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,414,0,0,0,0,0,0,0,412,292,292,292,292,292,414,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,414,0,0,0,0,0,0,0,412,292,292,292,292,292,414,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,414,0,0,0,0,0,0,0,412,292,292,292,292,292,414,0,0,0,0,0, + 373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,334,414,0,0,0,0,0,0,0,412,292,292,292,292,292,333,373,373,373,373,373, + 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,0,0,0,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292, + 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,0,0,0,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292, + 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,0,0,0,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292, + }; + + obj.createentity(256, 88, 21, 1); //Terminal + obj.createentity(128, 88, 21, 1); //Terminal + obj.createentity(104, 88, 21, 1); //Terminal + obj.createentity(80, 88, 21, 1); //Terminal + obj.createentity(128, 128, 21, 0); //Terminal + obj.createentity(128, 192, 21, 1); //Terminal + obj.createentity(104, 192, 21, 1); //Terminal + obj.createentity(80, 192, 21, 1); //Terminal + + if(game.insecretlab) + { + //vitellary + obj.createentity(231, 81, 18, 14, 0, 18); + obj.createblock(5, 231- 32, 0, 32 + 32 + 32, 240, 2); + + //violet + obj.createentity(83, 126, 18, 20, 0, 18); + int crewman = obj.getcrewman(1); + if (INBOUNDS_VEC(crewman, obj.entities)) + { + obj.entities[crewman].rule = 7; + obj.entities[crewman].tile +=6; + } + obj.createblock(5, 83 - 32, 0, 32 + 32 + 32, 240, 1); + } + hiddenname = "Secret Lab"; + result = contents; + break; + } + + case rn(17,5): + { + + static const short contents[] = { + 295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, + 295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, + 295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, + 456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,297,295,295,295,295, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295,295, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295,295, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295,295, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295,295, + 376,376,376,376,377,0,0,0,0,0,0,375,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,337,295,295,295,295, + 295,295,295,295,417,0,0,0,0,0,0,415,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, + 295,295,295,295,417,0,0,0,0,0,0,455,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,297,295,295,295,295, + 295,295,295,295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295,295, + 295,295,295,295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295,295, + 295,295,295,295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295,295, + 295,295,295,295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295,295, + 295,295,295,295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295,295, + 295,295,295,295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295,295, + 295,295,295,295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295,295, + 295,295,295,295,417,0,0,0,0,0,0,375,376,376,377,0,0,0,0,375,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,337,295,295,295,295, + 295,295,295,295,417,0,0,0,0,0,0,415,295,295,417,0,0,0,0,415,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, + 295,295,295,295,417,0,0,0,0,0,0,455,456,456,457,0,0,0,0,455,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456, + 295,295,295,295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 295,295,295,295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 295,295,295,295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 295,295,295,295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 295,295,295,295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 295,295,295,295,336,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376, + 295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, + 295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, + 295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, + }; + + obj.createentity(96, 48, 25, 0, 1); // Trophy + obj.createentity(128, 48, 25, 0, 2); // Trophy + obj.createentity(160, 48, 25, 0, 3); // Trophy + obj.createentity(192, 48, 25, 0, 4); // Trophy + obj.createentity(224, 48, 25, 0, 5); // Trophy + obj.createentity(256, 48, 25, 0, 6); // Trophy + + obj.createentity(96, 88, 25, 1, 13); // Trophy + obj.createentity(128, 88, 25, 1, 14); // Trophy + obj.createentity(160, 88, 25, 1, 15); // Trophy + obj.createentity(192, 88, 25, 1, 16); // Trophy + obj.createentity(224, 88, 25, 1, 17); // Trophy + obj.createentity(256, 88, 25, 1, 18); // Trophy + + obj.createentity(96, 128, 25, 0, 7); // Trophy + obj.createentity(96, 168, 25, 1, 8); // Trophy + + obj.createentity(160, 128, 25, 0, 12); // Trophy + obj.createentity(192, 128, 25, 0, 11); // Trophy + obj.createentity(224, 128, 25, 0, 10); // Trophy + obj.createentity(256, 128, 25, 0, 9); // Trophy + hiddenname = "Secret Lab"; + result = contents; + break; + } + + case rn(16,5): + { + + static const short contents[] = { + 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, + 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, + 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, + 283,283,283,284,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444, + 283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,363,364,364,364, + 283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,283,283, + 283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,283,283, + 283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,283,283, + 283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,283,283, + 283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,283,283, + 283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,283,283, + 283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,283,283, + 283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,283,283, + 283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,283,283, + 283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,283,283, + 283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,283,283, + 283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,283,283, + 283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,283,283, + 283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,283,283, + 283,283,283,405,0,0,0,0,0,0,0,0,0,0,363,364,364,364,364,364,364,364,364,364,364,365,0,0,0,0,0,0,0,0,0,0,403,283,283,283, + 283,283,283,405,0,0,0,0,0,0,0,0,0,0,403,283,283,283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,0,0,0,0,403,283,283,283, + 283,283,283,405,0,0,0,0,0,0,0,0,0,0,403,283,283,283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,0,0,0,0,403,283,283,283, + 283,283,283,324,364,364,364,364,364,364,364,364,364,364,325,283,283,283,283,283,283,283,283,283,283,324,364,364,364,364,364,364,364,364,364,364,325,283,283,283, + 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, + 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, + 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, + }; + + obj.createentity(152, 168, 25, 0, 20); // Trophy placeholder + obj.createentity(152, 168, 25, 0, 19); // Trophy + hiddenname = "Secret Lab"; + result = contents; + break; + } + + case rn(19,6): + { + + static const short contents[] = { + 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, + 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, + 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, + 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, + 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, + 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, + 289,289,289,290,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,291,289,289,289, + 289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289, + 289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289, + 289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289, + 289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289, + 289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289, + 289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289, + 289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289, + 289,289,289,411,0,0,0,0,0,0,369,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,371,0,0,0,0,0,0,409,289,289,289, + 289,289,289,411,0,0,0,0,0,0,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,0,0,0,0,0,0,409,289,289,289, + 450,450,450,451,0,0,0,0,0,0,449,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,451,0,0,0,0,0,0,409,289,289,289, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289, + 370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,371,0,0,0,0,0,0,409,289,289,289, + 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,0,0,0,0,0,0,409,289,289,289, + 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,0,0,0,0,0,0,409,289,289,289, + 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,0,0,0,0,0,0,409,289,289,289, + 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,0,0,0,0,0,0,409,289,289,289, + 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,0,0,0,0,0,0,409,289,289,289, + }; + + obj.createentity(216, 176, 21, 1); //Terminal + obj.createentity(192, 176, 21, 1); //Terminal + obj.createentity(168, 176, 21, 1); //Terminal + obj.createentity(144, 176, 21, 1); //Terminal + obj.createentity(88, 96, 21, 1); //Terminal + obj.createentity(112, 96, 21, 1); //Terminal + obj.createentity(136, 96, 21, 1); //Terminal + obj.createentity(160, 96, 21, 1); //Terminal + + //vertigris: + obj.createentity(100, 169, 18, 13, 0, 18); + obj.createblock(5, 100 - 16, 0, 32 + 32, 240, 4); + + //victoria: + obj.createentity(193, 89, 18, 16, 0, 18); + obj.createblock(5, 193-16, 0, 32+32, 240, 5); + hiddenname = "Secret Lab"; + result = contents; + break; + } + + + case rn(19,7): + { + + static const short contents[] = { + 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,403,283,283,283, + 283,284,444,444,444,444,444,444,444,444,444,444,444,444,444,285,283,283,283,283,283,283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,403,283,283,283, + 283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,283,283,283,283,283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,403,283,283,283, + 283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,283,283,283,283,283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,403,283,283,283, + 283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,283,283,283,283,283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,403,283,283,283, + 283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,283,283,283,283,283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,403,283,283,283, + 283,405,0,0,0,363,364,364,364,364,364,364,364,364,364,325,283,283,283,283,283,283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,403,283,283,283, + 283,405,0,0,0,403,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,403,283,283,283, + 283,405,0,0,0,403,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,403,283,283,283, + 283,405,0,0,0,403,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,403,283,283,283, + 283,405,0,0,0,403,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,403,283,283,283, + 283,405,0,0,0,403,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,403,283,283,283, + 283,405,0,0,0,403,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,403,283,283,283, + 283,405,0,0,0,403,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,403,283,283,283, + 283,405,0,0,0,443,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,445,0,0,0,0,0,0,403,283,283,283, + 283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,283,283, + 283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,283,283, + 283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,283,283, + 283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,283,283, + 283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,283,283, + 283,324,364,364,364,364,364,365,0,0,0,0,363,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,325,283,283,283, + 283,283,283,283,283,283,283,405,0,0,0,0,403,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, + 283,283,283,283,283,283,283,405,0,0,0,0,403,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, + 283,283,283,283,283,283,283,405,0,0,0,0,403,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, + 283,283,283,283,283,283,283,405,0,0,0,0,403,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, + 283,283,283,283,283,283,283,405,0,0,0,0,403,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, + 283,283,283,283,283,283,283,405,0,0,0,0,403,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, + 283,283,283,283,283,283,283,324,364,364,364,364,325,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, + 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, + 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, + }; + + obj.createentity(72, 192, 13); // (shiny trinket) + obj.createentity(112, 144, 20, 1); // (terminal) + obj.createblock(5, 112 - 4, 144, 20, 16, 21); + + //vermilion + obj.createentity(186, 137, 18, 15, 0, 18); + obj.createblock(5, 186 - 32, 0, 32 + 32 + 32, 240, 3); + + //naughty corner! + obj.createblock(1, 30, 0, 20, 50, 15); + obj.createblock(1, 90, 0, 20, 50, 16); + hiddenname = "Secret Lab"; + result = contents; + break; + } + + + case rn(19, 8): + { + //The SUPER GRAVITRON + + static const short contents[] = { + 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, + 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, + 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, + 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, + 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, + 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, + 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, + 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, + 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, + 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, + 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, + 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, + }; + + obj.createentity(-8, 84-32, 11, 328+8); // (horizontal gravity line) + obj.createentity(-8, 148 + 32, 11, 328+8); // (horizontal gravity line) + obj.createblock(1, -10, 84 - 16, 340, 32, 9); //start the game + hiddenname = "The Super Gravitron"; + result = contents; + break; + } #endif - default: - { - static const short contents[1200] = {0}; - //obj.fatal_bottom(); - result = contents; - break; - } - } + default: + { + static const short contents[1200] = {0}; + //obj.fatal_bottom(); + result = contents; + break; + } + } - return result; + return result; } diff --git a/desktop_version/src/Otherlevel.h b/desktop_version/src/Otherlevel.h index 8b5e4ac8..770d7956 100644 --- a/desktop_version/src/Otherlevel.h +++ b/desktop_version/src/Otherlevel.h @@ -1,14 +1,15 @@ #ifndef OTHERLEVEL_H #define OTHERLEVEL_H +#include + class otherlevelclass { public: const short* loadlevel(int rx, int ry); - const char* roomname; - bool roomname_special; - const char* hiddenname; + std::string roomname; + std::string hiddenname; int roomtileset; }; diff --git a/desktop_version/src/ReleaseVersion.h b/desktop_version/src/ReleaseVersion.h deleted file mode 100644 index 288946dd..00000000 --- a/desktop_version/src/ReleaseVersion.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef RELEASEVERSION_H -#define RELEASEVERSION_H - -#define RELEASE_VERSION "v2.5" - -#endif /* RELEASEVERSION_H */ diff --git a/desktop_version/src/Render.cpp b/desktop_version/src/Render.cpp index 771927bf..b1b05369 100644 --- a/desktop_version/src/Render.cpp +++ b/desktop_version/src/Render.cpp @@ -1,113 +1,97 @@ #include -#include "ActionSets.h" -#include "ButtonGlyphs.h" -#include "Constants.h" #include "Credits.h" -#include "CustomLevels.h" -#include "Editor.h" +#include "editor.h" #include "Entity.h" #include "FileSystemUtils.h" -#include "Font.h" #include "GlitchrunnerMode.h" #include "Graphics.h" #include "GraphicsUtil.h" -#include "InterimVersion.h" #include "KeyPoll.h" -#include "LevelDebugger.h" -#include "Localization.h" -#include "LocalizationStorage.h" #include "MakeAndPlay.h" #include "Map.h" #include "Maths.h" #include "Music.h" -#include "ReleaseVersion.h" -#include "RoomnameTranslator.h" -#include "Screen.h" #include "Script.h" #include "UtilityClass.h" -#include "VFormat.h" +#include "Version.h" static int tr; static int tg; static int tb; -static inline void drawslowdowntext(const int y) +// Macro-like inline function used in maprender() +// Used to keep some text positions the same in Flip Mode +static int inline FLIP(int ypos) +{ + if (graphics.flipmode) + { + return 220 - ypos; + } + return ypos; +} + +static inline void drawslowdowntext(void) { switch (game.slowdown) { case 30: - font::print_wrap(PR_CEN, -1, y, loc::gettext("Game speed is normal."), tr/2, tg/2, tb/2); + graphics.Print( -1, 85, "Game speed is normal.", tr/2, tg/2, tb/2, true); break; case 24: - font::print_wrap(PR_CEN, -1, y, loc::gettext("Game speed is at 80%"), tr, tg, tb); + graphics.Print( -1, 85, "Game speed is at 80%", tr, tg, tb, true); break; case 18: - font::print_wrap(PR_CEN, -1, y, loc::gettext("Game speed is at 60%"), tr, tg, tb); + graphics.Print( -1, 85, "Game speed is at 60%", tr, tg, tb, true); break; case 12: - font::print_wrap(PR_CEN, -1, y, loc::gettext("Game speed is at 40%"), tr, tg, tb); + graphics.Print( -1, 85, "Game speed is at 40%", tr, tg, tb, true); break; } } -static void slider_get(char* buffer, size_t buffer_len, int position, int n_positions, int target_width) -{ - /* Print a slider to the buffer for target_width in pixels. - * - * <--target w--> - * []............ - * ......[]...... - * ............[] - * ^^^^^^ dots_per_position=6 - * ^^^^^^^^^^^^^^ max_chars=14 - */ - - if (n_positions < 2 || position < 0 || position >= n_positions) - { - buffer[0] = '\0'; - return; - } - - int max_chars = ((target_width - font::len(0, "[]")) / font::len(0, ".")) + 2; - max_chars = SDL_min(max_chars, buffer_len-1); - - int dots_per_position = (max_chars-2) / (n_positions-1); - max_chars = dots_per_position * (n_positions-1) + 2; - - VVV_fillstring(buffer, max_chars+1, '.'); - if (dots_per_position<1) - { - return; - } - - int handle_idx = position*dots_per_position; - buffer[handle_idx] = '['; - buffer[handle_idx+1] = ']'; -} - static void volumesliderrender(void) { - int volume_max_position = USER_VOLUME_MAX / USER_VOLUME_STEP; + char buffer[40 + 1]; + + char slider[20 + 1]; + int slider_length; + + const char symbol[] = "[]"; + int symbol_length; + + int offset; + int num_positions; + + const int* volume_ptr; - int volume; switch (game.currentmenuoption) { case 0: - volume = music.user_music_volume; + volume_ptr = &music.user_music_volume; break; case 1: - volume = music.user_sound_volume; + volume_ptr = &music.user_sound_volume; break; default: SDL_assert(0 && "Unhandled volume slider menu option!"); return; } - char slider[40 + 1]; - slider_get(slider, sizeof(slider), volume_max_position * volume / USER_VOLUME_MAX, volume_max_position + 1, 240); + VVV_fillstring(slider, sizeof(slider), '.'); + slider_length = sizeof(slider) - 1; - char buffer[SCREEN_WIDTH_CHARS + 1]; + symbol_length = sizeof(symbol) - 1; + + num_positions = slider_length - symbol_length + 1; + + offset = num_positions * (*volume_ptr) / USER_VOLUME_MAX; + offset = clamp(offset, 0, slider_length - symbol_length); + + /* SDL_strlcpy null-terminates, which would end the string in the middle of + * it, which we don't want! + */ + SDL_memcpy(&slider[offset], symbol, symbol_length); if (game.slidermode == SLIDER_NONE) { @@ -116,19 +100,22 @@ static void volumesliderrender(void) else { /* Draw selection brackets. */ - vformat_buf(buffer, sizeof(buffer), loc::get_langmeta()->menu_select.c_str(), "label:str", slider); + SDL_snprintf(buffer, sizeof(buffer), "[ %s ]", slider); } - font::print(PR_CEN, -1, 95, buffer, tr, tg, tb); + graphics.Print(-1, 85, buffer, tr, tg, tb, true); } -static void inline drawglitchrunnertext(const int y) +static void inline drawglitchrunnertext(void) { int tempr = tr; int tempg = tg; int tempb = tb; - char buffer[SCREEN_WIDTH_CHARS + 1]; + /* Screen width 40 chars, 4 per char */ + char buffer[160 + 1]; + + const char* mode_string; const enum GlitchrunnerMode mode = GlitchrunnerMode_get(); @@ -138,177 +125,92 @@ static void inline drawglitchrunnertext(const int y) tempg /= 2; tempb /= 2; - SDL_strlcpy(buffer, loc::gettext("Glitchrunner mode is OFF"), sizeof(buffer)); + mode_string = "OFF"; } else { - const char* mode_string = loc::gettext(GlitchrunnerMode_enum_to_string(mode)); - vformat_buf(buffer, sizeof(buffer), loc::gettext("Glitchrunner mode is {version}"), "version:str", mode_string); + mode_string = GlitchrunnerMode_enum_to_string(mode); } - font::print_wrap(PR_CEN, -1, y, buffer, tempr, tempg, tempb); -} + SDL_snprintf(buffer, sizeof(buffer), "Glitchrunner mode is %s", mode_string); -static inline void draw_skip_message() -{ - /* Unlock 18 is Flip Mode. - * If this is the first playthrough, 5 (game completed) will be unlocked - * but not Flip Mode until the player hits "play" on the title screen */ - bool draw = -#ifndef MAKEANDPLAY - game.unlock[Unlock_FLIPMODE] && -#endif - graphics.fademode == FADE_NONE; - if (!draw) - { - return; - } - - const int alpha = graphics.lerp( - game.old_skip_message_timer, game.skip_message_timer - ); - - draw = alpha > 100; - if (!draw) - { - return; - } - - char buffer[SCREEN_WIDTH_CHARS + 1]; - vformat_buf( - buffer, sizeof(buffer), - loc::gettext("- Press {button} to skip -"), - "button:but", - vformat_button(ActionSet_InGame, Action_InGame_Map) - ); - font::print( - PR_BRIGHTNESS(alpha) | PR_BOR | PR_CEN, - -1, graphics.flipmode ? 20 : 210, buffer, - 220 - help.glow, 220 - help.glow, 255 - help.glow / 2 - ); + graphics.Print(-1, 95, buffer, tempr, tempg, tempb, true); } static void menurender(void) { + int temp = 50; switch (game.currentmenuname) { case Menu::mainmenu: - { - const int temp = 50; - graphics.draw_sprite((160 - 96) + 0 * 32, temp, 23, tr, tg, tb); - graphics.draw_sprite((160 - 96) + 1 * 32, temp, 23, tr, tg, tb); - graphics.draw_sprite((160 - 96) + 2 * 32, temp, 23, tr, tg, tb); - graphics.draw_sprite((160 - 96) + 3 * 32, temp, 23, tr, tg, tb); - graphics.draw_sprite((160 - 96) + 4 * 32, temp, 23, tr, tg, tb); - graphics.draw_sprite((160 - 96) + 5 * 32, temp, 23, tr, tg, tb); + graphics.drawsprite((160 - 96) + 0 * 32, temp, 23, tr, tg, tb); + graphics.drawsprite((160 - 96) + 1 * 32, temp, 23, tr, tg, tb); + graphics.drawsprite((160 - 96) + 2 * 32, temp, 23, tr, tg, tb); + graphics.drawsprite((160 - 96) + 3 * 32, temp, 23, tr, tg, tb); + graphics.drawsprite((160 - 96) + 4 * 32, temp, 23, tr, tg, tb); + graphics.drawsprite((160 - 96) + 5 * 32, temp, 23, tr, tg, tb); #if defined(MAKEANDPLAY) - font::print(PR_RIGHT, 264, temp+35, loc::gettext("MAKE AND PLAY EDITION"), tr, tg, tb); + graphics.Print(-1,temp+35," MAKE AND PLAY EDITION",tr, tg, tb, true); #endif -#ifdef INTERIM_VERSION_EXISTS - font::print(PR_RIGHT | PR_FONT_8X8, 310, 200, COMMIT_DATE, tr/2, tg/2, tb/2); - font::print(PR_RIGHT | PR_FONT_8X8, 310, 210, INTERIM_COMMIT, tr/2, tg/2, tb/2); - font::print(PR_RIGHT | PR_FONT_8X8, 310, 220, BRANCH_NAME, tr/2, tg/2, tb/2); +#ifdef COMMIT_DATE + graphics.Print( 310 - (10*8), 210, COMMIT_DATE, tr/2, tg/2, tb/2); #endif - font::print(PR_RIGHT, 310, 230, RELEASE_VERSION, tr/2, tg/2, tb/2); +#ifdef INTERIM_COMMIT + graphics.Print( 310 - (SDL_arraysize(INTERIM_COMMIT) - 1) * 8, 220, INTERIM_COMMIT, tr/2, tg/2, tb/2); +#endif + graphics.Print( 310 - (6*8), 230, "v2.3.1", tr/2, tg/2, tb/2); - const char* left_msg = NULL; - - const bool fonts_error = !FILESYSTEM_doesFontsDirExist(); - const bool lang_error = !FILESYSTEM_doesLangDirExist(); - - if (fonts_error && lang_error) - { - left_msg = "[No fonts&lang folders]"; - } - else if (fonts_error) - { - left_msg = "[No fonts folder]"; - } - else if (lang_error) - { - left_msg = "[No lang folder]"; - } - else if (music.mmmmmm) - { - left_msg = loc::gettext("[MMMMMM Mod Installed]"); - } - - if (left_msg != NULL) - { - font::print(0, 10, 230, left_msg, tr/2, tg/2, tb/2); + if(music.mmmmmm){ + graphics.Print( 10, 230, "[MMMMMM Mod Installed]", tr/2, tg/2, tb/2); } break; - } +#if !defined(NO_CUSTOM_LEVELS) case Menu::levellist: { - if (cl.ListOfMetaData.size()==0) - { - font::print_wrap(PR_CEN, -1, 90, loc::gettext("ERROR: No levels found."), tr, tg, tb); - } - int tmp=game.currentmenuoption+(game.levelpage*8); - if (INBOUNDS_VEC(tmp, cl.ListOfMetaData)) - { - const bool nextlastoptions = cl.ListOfMetaData.size() > 8; - //Don't show next/previous page or return to menu options here! - if (nextlastoptions && game.menuoptions.size() - game.currentmenuoption<=3) - { + if(ed.ListOfMetaData.size()==0){ + graphics.Print( -1, 100, "ERROR: No levels found.", tr, tg, tb, true); + } + int tmp=game.currentmenuoption+(game.levelpage*8); + if(INBOUNDS_VEC(tmp, ed.ListOfMetaData)){ + const bool nextlastoptions = ed.ListOfMetaData.size() > 8; + //Don't show next/previous page or return to menu options here! + if(nextlastoptions && game.menuoptions.size() - game.currentmenuoption<=3){ - } - else - { - uint32_t level_flags = PR_FONT_IDX( - cl.ListOfMetaData[tmp].level_main_font_idx, - cl.ListOfMetaData[tmp].rtl - ); - uint32_t title_flags = cl.ListOfMetaData[tmp].title_is_gettext ? PR_FONT_INTERFACE : level_flags; - uint32_t creator_flags = cl.ListOfMetaData[tmp].creator_is_gettext ? PR_FONT_INTERFACE : level_flags; - const char* title = cl.ListOfMetaData[tmp].title.c_str(); - if (cl.ListOfMetaData[tmp].title_is_gettext) - { - title = loc::gettext(title); - } - const char* creator = cl.ListOfMetaData[tmp].creator.c_str(); - if (cl.ListOfMetaData[tmp].creator_is_gettext) - { - creator = loc::gettext(creator); - } - - font::print(title_flags | PR_2X | PR_CEN, -1, 15, title, tr, tg, tb); - int sp = SDL_max(10, font::height(level_flags)); - graphics.print_level_creator(creator_flags, 40, creator, tr, tg, tb); - font::print(level_flags | PR_CEN, -1, 40+sp, cl.ListOfMetaData[tmp].website, tr, tg, tb); - font::print(level_flags | PR_CEN, -1, 40+sp*3, cl.ListOfMetaData[tmp].Desc1, tr, tg, tb); - font::print(level_flags | PR_CEN, -1, 40+sp*4, cl.ListOfMetaData[tmp].Desc2, tr, tg, tb); - if (sp <= 10) - { - font::print(level_flags | PR_CEN, -1, 40+sp*5, cl.ListOfMetaData[tmp].Desc3, tr, tg, tb); - } - } + }else{ + graphics.bigprint( -1, 15, ed.ListOfMetaData[tmp].title, tr, tg, tb, true); + graphics.Print( -1, 40, "by " + ed.ListOfMetaData[tmp].creator, tr, tg, tb, true); + graphics.Print( -1, 50, ed.ListOfMetaData[tmp].website, tr, tg, tb, true); + graphics.Print( -1, 70, ed.ListOfMetaData[tmp].Desc1, tr, tg, tb, true); + graphics.Print( -1, 80, ed.ListOfMetaData[tmp].Desc2, tr, tg, tb, true); + graphics.Print( -1, 90, ed.ListOfMetaData[tmp].Desc3, tr, tg, tb, true); } - break; + } + break; } +#endif case Menu::errornostart: - font::print_wrap(PR_CEN, -1, 65, loc::gettext("ERROR: This level has no start point!"), tr, tg, tb); + graphics.Print( -1, 65, "ERROR: This level has", tr, tg, tb, true); + graphics.Print( -1, 75, "no start point!", tr, tg, tb, true); break; case Menu::gameplayoptions: { int gameplayoptionsoffset = 0; #if !defined(MAKEANDPLAY) - if (game.ingame_titlemode && game.unlock[Unlock_FLIPMODE]) + if (game.ingame_titlemode && game.unlock[18]) #endif { gameplayoptionsoffset = 1; if (game.currentmenuoption == 0) { - font::print(PR_2X | PR_CEN, -1, 30, loc::gettext("Flip Mode"), tr, tg, tb); - int next_y = font::print_wrap(PR_CEN, -1, 65, loc::gettext("Flip the entire game vertically."), tr, tg, tb); + graphics.bigprint(-1, 30, "Flip Mode", tr, tg, tb, true); + graphics.Print(-1, 65, "Flip the entire game vertically.", tr, tg, tb, true); if (graphics.setflipmode) { - font::print_wrap(PR_CEN, -1, next_y, loc::gettext("Currently ENABLED!"), tr, tg, tb); + graphics.Print(-1, 85, "Currently ENABLED!", tr, tg, tb, true); } else { - font::print_wrap(PR_CEN, -1, next_y, loc::gettext("Currently Disabled."), tr/2, tg/2, tb/2); + graphics.Print(-1, 85, "Currently Disabled.", tr / 2, tg / 2, tb / 2, true); } } } @@ -316,41 +218,45 @@ static void menurender(void) if (game.currentmenuoption == gameplayoptionsoffset + 0) { //Toggle FPS - font::print(PR_2X | PR_CEN, -1, 30, loc::gettext("Toggle 30+ FPS"), tr, tg, tb); - int next_y = font::print_wrap(PR_CEN, -1, 65, loc::gettext("Change whether the game runs at 30 or over 30 FPS."), tr, tg, tb); + graphics.bigprint(-1, 30, "Toggle 30+ FPS", tr, tg, tb, true); + graphics.Print(-1, 65, "Change whether the game", tr, tg, tb, true); + graphics.Print(-1, 75, "runs at 30 or over 30 FPS.", tr, tg, tb, true); if (!game.over30mode) { - font::print_wrap(PR_CEN, -1, next_y, loc::gettext("Current mode: 30 FPS"), tr/2, tg/2, tb/2); + graphics.Print(-1, 95, "Current mode: 30 FPS", tr / 2, tg / 2, tb / 2, true); } else { - font::print_wrap(PR_CEN, -1, next_y, loc::gettext("Current mode: Over 30 FPS"), tr, tg, tb); + graphics.Print(-1, 95, "Current mode: Over 30 FPS", tr, tg, tb, true); } break; } else if (game.currentmenuoption == gameplayoptionsoffset + 1) { //Speedrunner options - font::print(PR_2X | PR_CEN, -1, 30, loc::gettext("Speedrunner Options"), tr, tg, tb); - font::print_wrap(PR_CEN, -1, 65, loc::gettext("Access some advanced settings that might be of interest to speedrunners."), tr, tg, tb); + graphics.bigprint(-1, 30, "Speedrunner Options", tr, tg, tb, true); + graphics.Print(-1, 65, "Access some advanced settings that", tr, tg, tb, true); + graphics.Print(-1, 75, "might be of interest to speedrunners.", tr, tg, tb, true); } else if (game.currentmenuoption == gameplayoptionsoffset + 2) { //Advanced options - font::print(PR_2X | PR_CEN, -1, 30, loc::gettext("Advanced Options"), tr, tg, tb); - font::print_wrap(PR_CEN, -1, 65, loc::gettext("All other gameplay settings."), tr, tg, tb); + graphics.bigprint(-1, 30, "Advanced Options", tr, tg, tb, true); + graphics.Print(-1, 65, "All other gameplay settings.", tr, tg, tb, true); } else if (game.currentmenuoption == gameplayoptionsoffset + 3) { //Clear Data - font::print(PR_2X | PR_CEN, -1, 30, loc::gettext("Clear Data"), tr, tg, tb); - font::print_wrap(PR_CEN, -1, 65, loc::gettext("Delete your main game save data and unlocked play modes."), tr, tg, tb); + graphics.bigprint(-1, 30, "Clear Data", tr, tg, tb, true); + graphics.Print(-1, 65, "Delete your main game save data", tr, tg, tb, true); + graphics.Print(-1, 75, "and unlocked play modes.", tr, tg, tb, true); } else if (game.currentmenuoption == gameplayoptionsoffset + 4) { - font::print(PR_2X | PR_CEN, -1, 30, loc::gettext("Clear Data"), tr, tg, tb); - font::print_wrap(PR_CEN, -1, 65, loc::gettext("Delete your custom level save data and completion stars."), tr, tg, tb); + graphics.bigprint(-1, 30, "Clear Data", tr, tg, tb, true); + graphics.Print(-1, 65, "Delete your custom level save data", tr, tg, tb, true); + graphics.Print(-1, 75, "and completion stars.", tr, tg, tb, true); } break; @@ -359,250 +265,208 @@ static void menurender(void) switch (game.currentmenuoption) { case 0: - font::print(PR_2X | PR_CEN, -1, 30, loc::gettext("Gameplay Options"), tr, tg, tb); - font::print_wrap(PR_CEN, -1, 65, loc::gettext("Adjust various gameplay settings."), tr, tg, tb); + graphics.bigprint(-1, 30, "Gameplay Options", tr, tg, tb, true); + graphics.Print(-1, 65, "Adjust various gameplay settings.", tr, tg, tb, true); break; case 1: - font::print(PR_2X | PR_CEN, -1, 30, loc::gettext("Graphics Options"), tr, tg, tb); - font::print_wrap(PR_CEN, -1, 65, loc::gettext("Adjust screen settings."), tr, tg, tb); + graphics.bigprint(-1, 30, "Graphics Options", tr, tg, tb, true); + graphics.Print(-1, 65, "Adjust screen settings.", tr, tg, tb, true); break; case 2: - font::print(PR_2X | PR_CEN, -1, 30, loc::gettext("Audio Options"), tr, tg, tb); + const char* str; + graphics.bigprint(-1, 30, "Audio Options", tr, tg, tb, true); if (music.mmmmmm) { - font::print_wrap(PR_CEN, -1, 65, loc::gettext("Adjust volume settings and soundtrack."), tr, tg, tb); + str = "Adjust volume settings and soundtrack."; } else { - font::print_wrap(PR_CEN, -1, 65, loc::gettext("Adjust volume settings."), tr, tg, tb); + str = "Adjust volume settings."; } + graphics.PrintWrap(-1, 65, str, tr, tg, tb, true, 10, 304); break; case 3: - font::print(PR_2X | PR_CEN, -1, 30, loc::gettext("Game Pad Options"), tr, tg, tb); - font::print_wrap(PR_CEN, -1, 65, loc::gettext("Rebind your controller's buttons and adjust sensitivity."), tr, tg, tb); + graphics.bigprint(-1, 30, "Game Pad Options", tr, tg, tb, true); + graphics.Print(-1, 65, "Rebind your controller's buttons", tr, tg, tb, true); + graphics.Print(-1, 75, "and adjust sensitivity.", tr, tg, tb, true); break; case 4: - font::print(PR_2X | PR_CEN, -1, 30, loc::gettext("Accessibility"), tr, tg, tb); - font::print_wrap(PR_CEN, -1, 65, loc::gettext("Disable screen effects, enable slowdown modes or invincibility."), tr, tg, tb); + graphics.bigprint(-1, 30, "Accessibility", tr, tg, tb, true); + graphics.Print(-1, 65, "Disable screen effects, enable", tr, tg, tb, true); + graphics.Print(-1, 75, "slowdown modes or invincibility.", tr, tg, tb, true); break; - case 5: - font::print(PR_2X | PR_CEN, -1, 30, loc::gettext("Language"), tr, tg, tb); - font::print_wrap(PR_CEN, -1, 65, loc::gettext("Change the language."), tr, tg, tb); } break; case Menu::graphicoptions: - { - int offset = 0; - if (game.currentmenuoption == offset + 0 && !gameScreen.isForcedFullscreen()) + if (graphics.screenbuffer == NULL) { - font::print(PR_2X | PR_CEN, -1, 30, loc::gettext("Toggle Fullscreen"), tr, tg, tb); - int next_y = font::print_wrap(PR_CEN, -1, 65, loc::gettext("Change to fullscreen/windowed mode."), tr, tg, tb); + SDL_assert(0 && "Screenbuffer is NULL!"); + break; + } - if (gameScreen.isWindowed) + switch (game.currentmenuoption) + { + case 0: + graphics.bigprint( -1, 30, "Toggle Fullscreen", tr, tg, tb, true); + graphics.Print( -1, 65, "Change to fullscreen/windowed mode.", tr, tg, tb, true); + + if (graphics.screenbuffer->isWindowed) { - font::print_wrap(PR_CEN, -1, next_y, loc::gettext("Current mode: WINDOWED"), tr, tg, tb); + graphics.Print( -1, 85, "Current mode: WINDOWED", tr, tg, tb, true); } else { - font::print_wrap(PR_CEN, -1, next_y, loc::gettext("Current mode: FULLSCREEN"), tr, tg, tb); + graphics.Print( -1, 85, "Current mode: FULLSCREEN", tr, tg, tb, true); } - } + break; - if (gameScreen.isForcedFullscreen()) - { - --offset; - } + case 1: + graphics.bigprint( -1, 30, "Scaling Mode", tr, tg, tb, true); + graphics.Print( -1, 65, "Choose letterbox/stretch/integer mode.", tr, tg, tb, true); - if (game.currentmenuoption == offset + 1) - { - font::print(PR_2X | PR_CEN, -1, 30, loc::gettext("Scaling Mode"), tr, tg, tb); - int next_y = font::print_wrap(PR_CEN, -1, 65, loc::gettext("Choose letterbox/stretch/integer mode."), tr, tg, tb); - - switch (gameScreen.scalingMode) + switch (graphics.screenbuffer->stretchMode) { - case SCALING_INTEGER: - font::print_wrap(PR_CEN, -1, next_y, loc::gettext("Current mode: INTEGER"), tr, tg, tb); + case 2: + graphics.Print( -1, 85, "Current mode: INTEGER", tr, tg, tb, true); break; - case SCALING_STRETCH: - font::print_wrap(PR_CEN, -1, next_y, loc::gettext("Current mode: STRETCH"), tr, tg, tb); + case 1: + graphics.Print( -1, 85, "Current mode: STRETCH", tr, tg, tb, true); break; - case SCALING_LETTERBOX: default: - font::print_wrap(PR_CEN, -1, next_y, loc::gettext("Current mode: LETTERBOX"), tr, tg, tb); + graphics.Print( -1, 85, "Current mode: LETTERBOX", tr, tg, tb, true); break; } - } - if (game.currentmenuoption == offset + 2 && !gameScreen.isForcedFullscreen()) - { - font::print(PR_2X | PR_CEN, -1, 30, loc::gettext("Resize to Nearest"), tr, tg, tb); - int next_y = font::print_wrap(PR_CEN, -1, 65, loc::gettext("Resize to the nearest window size that is of an integer multiple."), tr, tg, tb); - if (!gameScreen.isWindowed) + break; + case 2: + graphics.bigprint(-1, 30, "Resize to Nearest", tr, tg, tb, true); + graphics.Print(-1, 65, "Resize to the nearest window size", tr, tg, tb, true); + graphics.Print(-1, 75, "that is of an integer multiple.", tr, tg, tb, true); + if (!graphics.screenbuffer->isWindowed) { - font::print_wrap(PR_CEN, -1, next_y, loc::gettext("You must be in windowed mode to use this option."), tr, tg, tb); + graphics.Print(-1, 95, "You must be in windowed mode", tr, tg, tb, true); + graphics.Print(-1, 105, "to use this option.", tr, tg, tb, true); } - } - if (gameScreen.isForcedFullscreen()) - { - --offset; - } - if (game.currentmenuoption == offset + 3) - { - font::print(PR_2X | PR_CEN, -1, 30, loc::gettext("Toggle Filter"), tr, tg, tb); - int next_y = font::print_wrap(PR_CEN, -1, 65, loc::gettext("Change to nearest/linear filter."), tr, tg, tb); + break; + case 3: + graphics.bigprint( -1, 30, "Toggle Filter", tr, tg, tb, true); + graphics.Print( -1, 65, "Change to nearest/linear filter.", tr, tg, tb, true); - if (gameScreen.isFiltered) + if (graphics.screenbuffer->isFiltered) { - font::print_wrap(PR_CEN, -1, next_y, loc::gettext("Current mode: LINEAR"), tr, tg, tb); + graphics.Print( -1, 85, "Current mode: LINEAR", tr, tg, tb, true); } else { - font::print_wrap(PR_CEN, -1, next_y, loc::gettext("Current mode: NEAREST"), tr, tg, tb); + graphics.Print( -1, 85, "Current mode: NEAREST", tr, tg, tb, true); } - } + break; - if (game.currentmenuoption == offset + 4) - { - font::print(PR_2X | PR_CEN, -1, 30, loc::gettext("Analogue Mode"), tr, tg, tb); - font::print_wrap(PR_CEN, -1, 65, loc::gettext("There is nothing wrong with your television set. Do not attempt to adjust the picture."), tr, tg, tb); - } - if (game.currentmenuoption == offset + 5) - { - font::print(PR_2X | PR_CEN, -1, 30, loc::gettext("Toggle VSync"), tr, tg, tb); - int next_y = font::print_wrap(PR_CEN, -1, 65, loc::gettext("Turn VSync on or off."), tr, tg, tb); + case 4: + graphics.bigprint( -1, 30, "Analogue Mode", tr, tg, tb, true); + graphics.Print( -1, 65, "There is nothing wrong with your", tr, tg, tb, true); + graphics.Print( -1, 75, "television set. Do not attempt to", tr, tg, tb, true); + graphics.Print( -1, 85, "adjust the picture.", tr, tg, tb, true); + break; + case 5: + graphics.bigprint(-1, 30, "Toggle VSync", tr, tg, tb, true); +#ifdef __HAIKU__ // FIXME: Remove after SDL VSync bug is fixed! -flibit + graphics.Print(-1, 65, "Edit the config file on Haiku!", tr, tg, tb, true); +#else + graphics.Print(-1, 65, "Turn VSync on or off.", tr, tg, tb, true); +#endif - if (!gameScreen.vsync) + if (!graphics.screenbuffer->vsync) { - font::print_wrap(PR_CEN, -1, next_y, loc::gettext("Current mode: VSYNC OFF"), tr/2, tg/2, tb/2); + graphics.Print(-1, 85, "Current mode: VSYNC OFF", tr/2, tg/2, tb/2, true); } else { - font::print_wrap(PR_CEN, -1, next_y, loc::gettext("Current mode: VSYNC ON"), tr, tg, tb); + graphics.Print(-1, 85, "Current mode: VSYNC ON", tr, tg, tb, true); } + break; } break; - } case Menu::audiooptions: switch (game.currentmenuoption) { case 0: - font::print(PR_2X | PR_CEN, -1, 30, loc::gettext("Music Volume"), tr, tg, tb); - font::print_wrap(PR_CEN, -1, 65, loc::gettext("Change the volume of the music."), tr, tg, tb); + graphics.bigprint(-1, 30, "Music Volume", tr, tg, tb, true); + graphics.Print(-1, 65, "Change the volume of the music.", tr, tg, tb, true); volumesliderrender(); break; case 1: - font::print(PR_2X | PR_CEN, -1, 30, loc::gettext("Sound Volume"), tr, tg, tb); - font::print_wrap(PR_CEN, -1, 65, loc::gettext("Change the volume of sound effects."), tr, tg, tb); + graphics.bigprint(-1, 30, "Sound Volume", tr, tg, tb, true); + graphics.Print(-1, 65, "Change the volume of sound effects.", tr, tg, tb, true); volumesliderrender(); break; case 2: - { if (!music.mmmmmm) { break; } - - font::print(PR_2X | PR_CEN, -1, 30, loc::gettext("Soundtrack"), tr, tg, tb); - int next_y = font::print_wrap(PR_CEN, -1, 65, loc::gettext("Toggle between MMMMMM and PPPPPP."), tr, tg, tb); - - const char* soundtrack; + { + /* Screen width 40 chars, 4 per char */ + char buffer[160 + 1]; + char soundtrack[6 + 1]; + char letter; if (music.usingmmmmmm) { - soundtrack = loc::gettext("Current soundtrack: MMMMMM"); + letter = 'M'; } else { - soundtrack = loc::gettext("Current soundtrack: PPPPPP"); + letter = 'P'; } - font::print_wrap(PR_CEN, -1, next_y, soundtrack, tr, tg, tb); + VVV_fillstring(soundtrack, sizeof(soundtrack), letter); + SDL_snprintf(buffer, sizeof(buffer), "Current soundtrack: %s", soundtrack); + + graphics.bigprint(-1, 30, "Soundtrack", tr, tg, tb, true); + graphics.Print(-1, 65, "Toggle between MMMMMM and PPPPPP.", tr, tg, tb, true); + graphics.Print(-1, 85, buffer, tr, tg, tb, true); break; } } break; case Menu::credits: - font::print(PR_CEN, -1, 50, loc::gettext("VVVVVV is a game by"), tr, tg, tb); - font::print(PR_2X | PR_CEN | PR_FONT_8X8, -1, 65, "Terry Cavanagh", tr, tg, tb); + graphics.Print( -1, 50, "VVVVVV is a game by", tr, tg, tb, true); + graphics.bigprint( 40, 65, "Terry Cavanagh", tr, tg, tb, true, 2); - graphics.drawimagecol(IMAGE_SITE, -1, 86, graphics.getRGB(tr, tg, tb), true); + graphics.drawimagecol(7, -1, 86, tr *0.75, tg *0.75, tb *0.75, true); - font::print(PR_CEN, -1, 120, loc::gettext("and features music by"), tr, tg, tb); - font::print(PR_2X | PR_CEN | PR_FONT_8X8, -1, 135, "Magnus Pålsson", tr, tg, tb); - graphics.drawimagecol(IMAGE_SITE2, -1, 156, graphics.getRGB(tr, tg, tb), true); + graphics.Print( -1, 120, "and features music by", tr, tg, tb, true); + graphics.bigprint( 40, 135, "Magnus P~lsson", tr, tg, tb, true, 2); + graphics.drawimagecol(8, -1, 156, tr *0.75, tg *0.75, tb *0.75, true); break; case Menu::credits2: - font::print(PR_CEN, -1, 40, loc::gettext("Roomnames are by"), tr, tg, tb); - font::print(PR_2X | PR_CEN | PR_FONT_8X8, -1, 55, "Bennett Foddy", tr, tg, tb); - graphics.drawimagecol(IMAGE_SITE3, -1, 76, graphics.getRGB(tr, tg, tb), true); - font::print(PR_CEN, -1, 100, loc::gettext("C++ version by"), tr, tg, tb); - font::print(PR_2X | PR_CEN | PR_FONT_8X8, -1, 115, "Simon Roth", tr, tg, tb); - font::print(PR_2X | PR_CEN | PR_FONT_8X8, -1, 135, "Ethan Lee", tr, tg, tb); - font::print(PR_2X | PR_CEN | PR_FONT_8X8, -1, 155, "Misa Kai", tr, tg, tb); + graphics.Print( -1, 50, "Roomnames are by", tr, tg, tb, true); + graphics.bigprint( 40, 65, "Bennett Foddy", tr, tg, tb, true); + graphics.drawimagecol(9, -1, 86, tr*0.75, tg *0.75, tb *0.75, true); + graphics.Print( -1, 110, "C++ version by", tr, tg, tb, true); + graphics.bigprint( 40, 125, "Simon Roth", tr, tg, tb, true); + graphics.bigprint( 40, 145, "Ethan Lee", tr, tg, tb, true); break; case Menu::credits25: - font::print(PR_CEN, -1, 40, loc::gettext("Beta Testing by"), tr, tg, tb); - font::print(PR_2X | PR_CEN | PR_FONT_8X8, -1, 55, "Sam Kaplan", tr, tg, tb); - font::print(PR_2X | PR_CEN | PR_FONT_8X8, -1, 75, "Pauli Kohberger", tr, tg, tb); - font::print(PR_CEN, -1, 130, loc::gettext("Ending Picture by"), tr, tg, tb); - font::print(PR_2X | PR_CEN | PR_FONT_8X8, -1, 145, "Pauli Kohberger", tr, tg, tb); + graphics.Print( -1, 40, "Beta Testing by", tr, tg, tb, true); + graphics.bigprint( 40, 55, "Sam Kaplan", tr, tg, tb, true); + graphics.bigprint( 40, 75, "Pauli Kohberger", tr, tg, tb, true); + graphics.Print( -1, 130, "Ending Picture by", tr, tg, tb, true); + graphics.bigprint( 40, 145, "Pauli Kohberger", tr, tg, tb, true); break; - case Menu::credits_localisations_implementation: - font::print(PR_CEN, -1, 30, loc::gettext("Localisation Project Led by"), tr, tg, tb); - font::print(PR_2X | PR_CEN | PR_FONT_8X8, -1, 45, "Dav999", tr, tg, tb); - font::print(PR_CEN, -1, 75, loc::gettext("Pan-European Font Design by"), tr, tg, tb); - font::print(PR_2X | PR_CEN | PR_FONT_8X8, -1, 90, "Reese Rivers", tr, tg, tb); - font::print_wrap(PR_CEN, -1, 125, loc::gettext("With contributions on GitHub from"), tr, tg, tb); - font::print(PR_2X | PR_CEN | PR_FONT_8X8, -1, 140, "Alexandra Fox", tr, tg, tb); - font::print(PR_2X | PR_CEN | PR_FONT_8X8, -1, 160, "mothbeanie", tr, tg, tb); - break; - case Menu::credits_localisations_translations: - { - font::print_wrap(PR_2X | PR_CEN, -1, 15, loc::gettext("Translators"), tr, tg, tb); - - int startidx = game.current_credits_list_index; - int endidx = game.current_credits_list_index; - endidx += Credits::translator_pagesize[game.translator_credits_pagenum]; - endidx = SDL_min(endidx, (int)SDL_arraysize(Credits::translators)); - - int maxheight = 110; - - int totalheight = (endidx - startidx) * 10; - int emptyspace = maxheight - totalheight; - - int yofs = 50 + (emptyspace / 2); - - for (int i = startidx; i < endidx; ++i) - { - if (Credits::translators[i][0] == '>') - { - yofs += 2; - font::print(PR_CJK_HIGH, 88, yofs, loc::gettext(&Credits::translators[i][1]), tr, tg, tb); - } - else if (Credits::translators[i][0] != ' ') - { - yofs += 5; - font::print(PR_CJK_HIGH, 80, yofs, loc::gettext(Credits::translators[i]), tr, tg, tb); - } - else - { - font::print(PR_FONT_8X8, 80, yofs, Credits::translators[i], tr, tg, tb); - } - yofs += 10; - } - break; - } case Menu::credits3: { - font::print_wrap(PR_CEN, -1, 20, loc::gettext("VVVVVV is supported by the following patrons"), tr, tg, tb); + graphics.Print( -1, 20, "VVVVVV is supported by", tr, tg, tb, true); + graphics.Print( 40, 30, "the following patrons", tr, tg, tb, true); int startidx = game.current_credits_list_index; - int endidx = SDL_min(startidx + 9, (int)SDL_arraysize(Credits::superpatrons)); + int endidx = VVV_min(startidx + 9, (int)SDL_arraysize(Credits::superpatrons)); int xofs = 80 - 16; int yofs = 40 + 20; for (int i = startidx; i < endidx; ++i) { - font::print(PR_FONT_8X8, xofs, yofs, Credits::superpatrons[i], tr, tg, tb); + graphics.Print(xofs, yofs, Credits::superpatrons[i], tr, tg, tb); xofs += 4; yofs += 14; } @@ -610,10 +474,10 @@ static void menurender(void) } case Menu::credits4: { - font::print_wrap(PR_CEN, -1, 20, loc::gettext("and also by"), tr, tg, tb); + graphics.Print( -1, 20, "and also by", tr, tg, tb, true); int startidx = game.current_credits_list_index; - int endidx = SDL_min(startidx + 14, (int)SDL_arraysize(Credits::patrons)); + int endidx = VVV_min(startidx + 14, (int)SDL_arraysize(Credits::patrons)); int maxheight = 10 * 14; int totalheight = (endidx - startidx) * 10; @@ -623,17 +487,18 @@ static void menurender(void) for (int i = startidx; i < endidx; ++i) { - font::print(PR_FONT_8X8, 80, yofs, Credits::patrons[i], tr, tg, tb); + graphics.Print(80, yofs, Credits::patrons[i], tr, tg, tb); yofs += 10; } break; } case Menu::credits5: { - font::print_wrap(PR_CEN, -1, 20, loc::gettext("With contributions on GitHub from"), tr, tg, tb); + graphics.Print( -1, 20, "With contributions on", tr, tg, tb, true); + graphics.Print( 40, 30, "GitHub from", tr, tg, tb, true); int startidx = game.current_credits_list_index; - int endidx = SDL_min(startidx + 9, (int)SDL_arraysize(Credits::githubfriends)); + int endidx = VVV_min(startidx + 9, (int)SDL_arraysize(Credits::githubfriends)); int maxheight = 14 * 9; int totalheight = (endidx - startidx) * 14; @@ -641,598 +506,227 @@ static void menurender(void) int xofs, yofs; - xofs = 80 - 16; - yofs = 40 + 20 + (emptyspace / 2); + if (startidx == 0) + { + graphics.Print(-1, 60, Credits::githubfriends[0], tr, tg, tb, true); + graphics.Print(-1, 80, Credits::githubfriends[2], tr, tg, tb, true); + startidx += 4; // Skip the superfriends now that we've drawn them... + xofs = 80 - 28; + yofs = 80 + 20 + (emptyspace / 2); + } + else + { + xofs = 80 - 16; + yofs = 40 + 20 + (emptyspace / 2); + } for (int i = startidx; i < endidx; ++i) { - font::print(PR_FONT_8X8, xofs, yofs, Credits::githubfriends[i], tr, tg, tb); + graphics.Print(xofs, yofs, Credits::githubfriends[i], tr, tg, tb); xofs += 4; yofs += 14; } break; } case Menu::credits6: - font::print_wrap(PR_CEN, -1, 20, loc::gettext("and thanks also to:"), tr, tg, tb); + graphics.Print( -1, 20, "and thanks also to:", tr, tg, tb, true); - font::print(PR_2X | PR_CEN, -1, 60, loc::gettext("You!"), tr, tg, tb); + graphics.bigprint(80, 60, "You!", tr, tg, tb, true); - font::print_wrap(PR_CEN, -1, 100, loc::gettext("Your support makes it possible for me to continue making the games I want to make, now and into the future."), tr, tg, tb); + graphics.Print( 80, 100, "Your support makes it possible", tr, tg, tb,true); + graphics.Print( 80, 110,"for me to continue making the", tr, tg, tb,true); + graphics.Print( 80, 120,"games I want to make, now", tr, tg, tb,true); + graphics.Print( 80, 130, "and into the future.", tr, tg, tb, true); - font::print_wrap(PR_CEN, -1, 150,loc::gettext("Thank you!"), tr, tg, tb); + graphics.Print( 80, 150,"Thank you!", tr, tg, tb,true); break; case Menu::setinvincibility: - font::print_wrap(PR_CEN, -1, 100, loc::gettext("Are you sure you want to enable invincibility?"), tr, tg, tb); + graphics.Print( -1, 100, "Are you sure you want to ", tr, tg, tb, true); + graphics.Print( -1, 110, "enable invincibility?", tr, tg, tb, true); break; case Menu::setslowdown: - { - font::print(PR_2X | PR_CEN, -1, 30, loc::gettext("Game Speed"), tr, tg, tb); - int next_y = font::print_wrap(PR_CEN, -1, 65, loc::gettext("Select a new game speed below."), tr, tg, tb); - drawslowdowntext(next_y); + graphics.bigprint( -1, 30, "Game Speed", tr, tg, tb, true); + graphics.Print( -1, 65, "Select a new game speed below.", tr, tg, tb, true); + drawslowdowntext(); break; - } case Menu::newgamewarning: - font::print_wrap(PR_CEN, -1, 100, loc::gettext("Are you sure? This will delete your current saves..."), tr, tg, tb); + graphics.Print( -1, 100, "Are you sure? This will", tr, tg, tb, true); + graphics.Print( -1, 110, "delete your current saves...", tr, tg, tb, true); break; case Menu::cleardatamenu: case Menu::clearcustomdatamenu: - font::print_wrap(PR_CEN, -1, 100, loc::gettext("Are you sure you want to delete all your saved data?"), tr, tg, tb); + graphics.Print( -1, 100, "Are you sure you want to", tr, tg, tb, true); + graphics.Print( -1, 110, "delete all your saved data?", tr, tg, tb, true); break; case Menu::deletequicklevel: - font::print_wrap(PR_CEN, -1, 100, loc::gettext("Are you sure you want to delete your quicksave?"), tr, tg, tb); + graphics.Print(-1, 100, "Are you sure you want to", tr, tg, tb, true); + graphics.Print(-1, 110, "delete your quicksave?", tr, tg, tb, true); break; case Menu::startnodeathmode: - { - int next_y; - next_y = font::print_wrap(PR_CEN, -1, 45, loc::gettext("Good luck!"), tr, tg, tb); - next_y = font::print_wrap(PR_CEN, -1, next_y+15, loc::gettext("You cannot save in this mode."), tr, tg, tb); - font::print_wrap(PR_CEN, -1, next_y+5, loc::gettext("Would you like to disable the cutscenes during the game?"), tr, tg, tb); + graphics.Print( -1, 45, "Good luck!", tr, tg, tb, true); + graphics.Print( -1, 80, "You cannot save in this mode.", tr, tg, tb, true); + graphics.Print( -1, 100, "Would you like to disable the", tr, tg, tb, true); + graphics.Print( -1, 112, "cutscenes during the game?", tr, tg, tb, true); break; - } case Menu::controller: - { - int spacing = font::height(0); - spacing = SDL_max(spacing, 10); - + graphics.bigprint( -1, 30, "Game Pad", tr, tg, tb, true); + graphics.Print( -1, 55, "Change controller options.", tr, tg, tb, true); switch (game.currentmenuoption) { case 0: - { - font::print(PR_2X | PR_CEN, -1, 30, loc::gettext("Stick Sensitivity"), tr, tg, tb); - font::print_wrap(PR_CEN, -1, 55, loc::gettext("Change the sensitivity of the analog stick."), tr, tg, tb); - - font::print(PR_RTL_XFLIP, 32, 95, loc::gettext("Low"), tr, tg, tb); - font::print(PR_CEN, -1, 95, loc::gettext("Medium"), tr, tg, tb); - font::print(PR_RIGHT | PR_RTL_XFLIP, 288, 95, loc::gettext("High"), tr, tg, tb); - char slider[SCREEN_WIDTH_CHARS + 1]; - slider_get(slider, sizeof(slider), key.sensitivity, 5, 240); - font::print(PR_CEN, -1, 95+spacing, slider, tr, tg, tb); + switch(key.sensitivity) + { + case 0: + graphics.Print( -1, 75, " Low Medium High", tr, tg, tb, true); + graphics.Print( -1, 85, "[]..................", tr, tg, tb, true); + break; + case 1: + graphics.Print( -1, 75, " Low Medium High", tr, tg, tb, true); + graphics.Print( -1, 85, ".....[].............", tr, tg, tb, true); + break; + case 2: + graphics.Print( -1, 75, " Low Medium High", tr, tg, tb, true); + graphics.Print( -1, 85, ".........[].........", tr, tg, tb, true); + break; + case 3: + graphics.Print( -1, 75, " Low Medium High", tr, tg, tb, true); + graphics.Print( -1, 85, ".............[].....", tr, tg, tb, true); + break; + case 4: + graphics.Print( -1, 75, " Low Medium High", tr, tg, tb, true); + graphics.Print( -1, 85, "..................[]", tr, tg, tb, true); + break; + } break; - } case 1: case 2: case 3: case 4: case 5: - { - const char* title = ""; - switch (game.currentmenuoption) - { - case 1: title = loc::gettext("Bind Flip"); break; - case 2: title = loc::gettext("Bind Enter"); break; - case 3: title = loc::gettext("Bind Menu"); break; - case 4: title = loc::gettext("Bind Restart"); break; - case 5: title = loc::gettext("Bind Interact"); break; - } - font::print(PR_2X | PR_CEN, -1, 30, title, tr, tg, tb); - - if (game.currentmenuoption == 5 && !game.separate_interact) - { - font::print_wrap( - PR_CEN, -1, 55, - loc::gettext("Interact is currently Enter!|See speedrunner options."), - tr, tg, tb - ); - } - else if (!game.gpmenu_confirming) - { - font::print_wrap( - PR_CEN | PR_BRIGHTNESS(255 - help.glow*2), -1, 55, - loc::gettext("Press a button...|(or press ↑↓)"), - tr, tg, tb - ); - } - else - { - char expl[SCREEN_WIDTH_CHARS*3 + 1]; - const char* expl_template; - - if (game.gpmenu_showremove) - { - expl_template = loc::gettext("Remove {button}?|Press again to confirm"); - } - else - { - expl_template = loc::gettext("Add {button}?|Press again to confirm"); - } - - vformat_buf( - expl, sizeof(expl), - expl_template, - "button:str", - BUTTONGLYPHS_sdlbutton_to_glyph(game.gpmenu_lastbutton) - ); - - font::print_wrap(PR_CEN, -1, 55, expl, tr, tg, tb); - } - - for (int bind = 1; bind <= 5; bind++) - { - char buffer_a[SCREEN_WIDTH_CHARS + 1]; - char buffer_b[SCREEN_WIDTH_CHARS + 1]; - - const char* lbl; - ActionSet actionset; - int action; - - switch (bind) - { - case 1: - lbl = loc::gettext("Flip is bound to: "); - actionset = ActionSet_InGame; - action = Action_InGame_ACTION; - break; - case 2: - lbl = loc::gettext("Enter is bound to: "); - actionset = ActionSet_InGame; - action = Action_InGame_Map; - break; - case 3: - lbl = loc::gettext("Menu is bound to: "); - actionset = ActionSet_InGame; - action = Action_InGame_Esc; - break; - case 4: - lbl = loc::gettext("Restart is bound to: "); - actionset = ActionSet_InGame; - action = Action_InGame_Restart; - break; - default: - lbl = loc::gettext("Interact is bound to: "); - actionset = ActionSet_InGame; - action = Action_InGame_Interact; - } - - SDL_snprintf( - buffer_a, sizeof(buffer_a), "%s%s", lbl, - BUTTONGLYPHS_get_all_gamepad_buttons(buffer_b, sizeof(buffer_b), actionset, action) - ); - - int brightness = 255; - if (bind == 5 && !game.separate_interact) - { - brightness = 128; - } - else if (game.gpmenu_confirming && game.currentmenuoption == bind) - { - brightness = 255 - help.glow*2; - } - - font::print( - PR_CEN | PR_BRIGHTNESS(brightness), - -1, 85 + (spacing * (bind-1)), - buffer_a, - tr, tg, tb - ); - } - + graphics.Print( -1, 75, "Flip is bound to: " + std::string(help.GCString(game.controllerButton_flip)) , tr, tg, tb, true); + graphics.Print( -1, 85, "Enter is bound to: " + std::string(help.GCString(game.controllerButton_map)), tr, tg, tb, true); + graphics.Print( -1, 95, "Menu is bound to: " + std::string(help.GCString(game.controllerButton_esc)) , tr, tg, tb, true); + graphics.Print( -1, 105, "Restart is bound to: " + std::string(help.GCString(game.controllerButton_restart)) , tr, tg, tb, true); + graphics.Print( -1, 115, "Interact is bound to: " + std::string(help.GCString(game.controllerButton_interact)) , tr, tg, tb, true); break; } - } - break; - } - case Menu::language: - if (loc::languagelist.empty()) - { - font::print_wrap(PR_CEN, -1, 90, loc::gettext("ERROR: No language files found."), tr, tg, tb); - } - else if ((unsigned)game.currentmenuoption < loc::languagelist.size()) - { - font::print_wrap(PR_CEN, -1, 8, loc::languagelist[game.currentmenuoption].credit.c_str(), tr/2, tg/2, tb/2); - const char* select_hint; - char buffer[SCREEN_WIDTH_CHARS + 1]; - if (BUTTONGLYPHS_keyboard_is_active()) - { - select_hint = loc::languagelist[game.currentmenuoption].action_hint.c_str(); - } - else - { - vformat_buf(buffer, sizeof(buffer), - loc::languagelist[game.currentmenuoption].gamepad_hint.c_str(), - "button:but", - vformat_button(ActionSet_Menu, Action_Menu_Accept) - ); - select_hint = buffer; - } - font::print(PR_CEN, -1, 230, select_hint, tr/2, tg/2, tb/2); - } - break; - case Menu::translator_main: - switch (game.currentmenuoption) - { - case 0: - font::print(PR_2X | PR_CEN, -1, 30, loc::gettext("Translator options"), tr, tg, tb); - font::print_wrap(PR_CEN, -1, 65, loc::gettext("Some options that are useful for translators and developers."), tr, tg, tb); - break; - case 1: - font::print(PR_2X | PR_CEN, -1, 30, loc::gettext("Maintenance"), tr, tg, tb); - font::print_wrap(PR_CEN, -1, 65, loc::gettext("Sync all language files after adding new strings."), tr, tg, tb); - break; - } - { - if (FILESYSTEM_isMainLangDirFromRepo()) - { - // Just giving people who manually compiled the game some hint as to why this menu is here! - font::print(0, 8, 208, loc::gettext("Repository language folder:"), tr/2, tg/2, tb/2); - } - else - { - font::print(0, 8, 208, loc::gettext("Language folder:"), tr/2, tg/2, tb/2); - } - - font::print(PR_RIGHT, 316, 224, FILESYSTEM_getUserMainLangDirectory(), tr/2, tg/2, tb/2); - } - break; - case Menu::translator_options: - switch (game.currentmenuoption) - { - case 0: - font::print(PR_2X | PR_CEN, -1, 30, loc::gettext("Statistics"), tr, tg, tb); - font::print_wrap(PR_CEN, -1, 65, loc::gettext("Count the amount of untranslated strings for this language."), tr, tg, tb); - break; - case 1: - { - font::print(PR_2X | PR_CEN, -1, 30, loc::gettext("Translate rooms"), tr, tg, tb); - int next_y = font::print_wrap(PR_CEN, -1, 65, loc::gettext("Enable room name translation mode, so you can translate room names in context. Press I for invincibility."), tr, tg, tb); - - if (roomname_translator::enabled) - { - font::print_wrap(PR_CEN, -1, next_y, loc::gettext("Currently ENABLED!"), tr, tg, tb); - } - else - { - font::print_wrap(PR_CEN, -1, next_y, loc::gettext("Currently Disabled."), tr/2, tg/2, tb/2); - } - break; - } - case 2: - font::print(PR_2X | PR_CEN, -1, 30, loc::gettext("Explore game"), tr, tg, tb); - font::print_wrap(PR_CEN, -1, 65, loc::gettext("Explore the rooms of any level in the game, to find all room names to translate."), tr, tg, tb); - break; - case 3: - font::print(PR_2X | PR_CEN, -1, 30, loc::gettext("Menu test"), tr, tg, tb); - font::print_wrap(PR_CEN, -1, 65, loc::gettext("Cycle through most menus in the game. The menus will not actually work, all options take you to the next menu instead. Press Escape to stop."), tr, tg, tb); - break; - case 4: - font::print(PR_2X | PR_CEN, -1, 30, loc::gettext("Cutscene test"), tr, tg, tb); - font::print_wrap(PR_CEN, -1, 65, loc::gettext("Display all text boxes from cutscenes.xml. Only tests the basic appearance of each individual text box."), tr, tg, tb); - break; - case 5: - font::print(PR_2X | PR_CEN, -1, 30, loc::gettext("Limits check"), tr, tg, tb); - font::print_wrap(PR_CEN, -1, 65, loc::gettext("Find translations that don't fit within their defined bounds."), tr, tg, tb); - break; - } - break; - case Menu::translator_options_limitscheck: - { - size_t of = loc::limitscheck_current_overflow; - if (of >= loc::text_overflows.size()) - { - int next_y; - if (loc::text_overflows.empty()) - { - next_y = font::print_wrap(PR_CEN, -1, 20, loc::gettext("No text overflows found!"), tr, tg, tb); - } - else - { - next_y = font::print_wrap(PR_CEN, -1, 20, loc::gettext("No text overflows left!"), tr, tg, tb); - } - - font::print_wrap(PR_CEN, -1, next_y, loc::gettext("Note that this detection isn't perfect."), tr, tg, tb); - } - else - { - loc::TextOverflow& overflow = loc::text_overflows[of]; - - char buffer[SCREEN_WIDTH_CHARS + 1]; - vformat_buf(buffer, sizeof(buffer), - "{page}/{total} {max_w}*{max_h} ({max_w_px}x{max_h_px}) [{lang}]", - "page:int, total:int, max_w:int, max_h:int, max_w_px:int, max_h_px:int, lang:str", - (int) of+1, (int) loc::text_overflows.size(), - overflow.max_w, overflow.max_h, - overflow.max_w_px, overflow.max_h_px, - overflow.lang.c_str() - ); - font::print(PR_FONT_8X8, 10, 10, buffer, tr/2, tg/2, tb/2); - - int box_x = SDL_min(10, (320-overflow.max_w_px)/2); - graphics.fill_rect(box_x-1, 30-1, overflow.max_w_px+2, overflow.max_h_px+2, tr/3, tg/3, tb/3); - - int wraplimit; - if (overflow.multiline) - { - wraplimit = overflow.max_w_px; - } - else - { - wraplimit = 320-box_x; - } - - if (overflow.text != NULL) - { - font::print_wrap(overflow.flags, box_x, 30, overflow.text, tr, tg, tb, -1, wraplimit); - } - } - break; - } - case Menu::translator_options_stats: - { - font::print(0, 16, 16, loc::get_langmeta()->nativename, tr, tg, tb); - - const char* line_template = "%4d"; - char buffer[5]; - int coldiv; - - #define stat_line(y, filename, untranslated_counter) \ - SDL_snprintf(buffer, sizeof(buffer), line_template, \ - untranslated_counter \ - ); \ - coldiv = untranslated_counter > 0 ? 1 : 2; \ - font::print(PR_FONT_8X8, 16, y, filename, tr/coldiv, tg/coldiv, tb/coldiv); \ - font::print(PR_FONT_8X8, 272, y, buffer, tr/coldiv, tg/coldiv, tb/coldiv) - - stat_line(48, "strings.xml", loc::n_untranslated[loc::UNTRANSLATED_STRINGS]); - stat_line(64, "numbers.xml", loc::n_untranslated[loc::UNTRANSLATED_NUMBERS]); - stat_line(80, "strings_plural.xml", loc::n_untranslated[loc::UNTRANSLATED_STRINGS_PLURAL]); - stat_line(96, "cutscenes.xml", loc::n_untranslated[loc::UNTRANSLATED_CUTSCENES]); - stat_line(112, "roomnames.xml", loc::n_untranslated_roomnames); - stat_line(128, "roomnames_special.xml", loc::n_untranslated[loc::UNTRANSLATED_ROOMNAMES_SPECIAL]); - - #undef stat_line - - break; - } - case Menu::translator_options_exploregame: - switch (game.currentmenuoption) - { - case 0: - font::print(PR_2X | PR_CEN, -1, 30, loc::gettext("Space Station 1"), tr, tg, tb); - break; - case 1: - font::print(PR_2X | PR_CEN, -1, 30, loc::gettext("The Laboratory"), tr, tg, tb); - break; - case 2: - font::print(PR_2X | PR_CEN, -1, 30, loc::gettext("The Tower"), tr, tg, tb); - break; - case 3: - font::print(PR_2X | PR_CEN, -1, 30, loc::gettext("Space Station 2"), tr, tg, tb); - break; - case 4: - font::print(PR_2X | PR_CEN, -1, 30, loc::gettext("The Warp Zone"), tr, tg, tb); - break; - case 5: - font::print(PR_2X | PR_CEN, -1, 30, loc::gettext("Intermission 1"), tr, tg, tb); - break; - case 6: - font::print(PR_2X | PR_CEN, -1, 30, loc::gettext("Intermission 2"), tr, tg, tb); - break; - case 7: - font::print(PR_2X | PR_CEN, -1, 30, loc::gettext("The Final Level"), tr, tg, tb); - break; - } - if (roomname_translator::enabled) - { - if (game.currentmenuoption >= 0 && game.currentmenuoption < 8) - { - int names_left = loc::n_untranslated_roomnames_area[game.currentmenuoption + 1]; - int coldiv = names_left > 0 ? 1 : 2; - - char buffer[4*SCREEN_WIDTH_CHARS + 1]; - loc::gettext_plural_fill( - buffer, sizeof(buffer), - "{n} normal room names untranslated", - "{n} normal room name untranslated", - "n:int", - names_left - ); - font::print_wrap(PR_CEN, -1, 65, buffer, tr/coldiv, tg/coldiv, tb/coldiv); - } - } - else - { - font::print_wrap(PR_CEN, -1, 65, loc::gettext("You have not enabled room name translation mode!"), tr, tg, tb); - } - break; - case Menu::translator_maintenance: - switch (game.currentmenuoption) - { - case 0: - font::print(PR_2X | PR_CEN, -1, 30, loc::gettext("Sync language files"), tr, tg, tb); - font::print_wrap(PR_CEN, -1, 65, loc::gettext("Merge all new strings from the template files into the translation files, keeping existing translations."), tr, tg, tb); - break; - case 1: - font::print(PR_2X | PR_CEN, -1, 30, loc::gettext("Statistics"), tr, tg, tb); - font::print_wrap(PR_CEN, -1, 65, loc::gettext("Count the amount of untranslated strings for each language."), tr, tg, tb); - break; - case 2: - font::print(PR_2X | PR_CEN, -1, 30, loc::gettext("Limits check"), tr, tg, tb); - font::print_wrap(PR_CEN, -1, 65, loc::gettext("Find translations that don't fit within their defined bounds."), tr, tg, tb); - } - break; - case Menu::translator_maintenance_sync: - { - int next_y = font::print_wrap(PR_CEN, -1, 20, loc::gettext("If new strings were added to the English template language files, this feature will insert them in the translation files for all languages. Make a backup, just in case."), tr, tg, tb); - - font::print(PR_CEN, -1, next_y, loc::gettext("Full syncing EN→All:"), tr, tg, tb); - next_y = font::print_wrap(PR_CEN | PR_FONT_8X8, -1, next_y+10, "meta.xml\nstrings.xml\nstrings_plural.xml\ncutscenes.xml\nroomnames.xml\nroomnames_special.xml", tr/2, tg/2, tb/2); - - font::print(PR_CEN, -1, next_y, loc::gettext("Syncing not supported:"), tr, tg, tb); - font::print_wrap(PR_CEN | PR_FONT_8X8, -1, next_y+10, "numbers.xml", tr/2, tg/2, tb/2); - break; - } - case Menu::translator_error_setlangwritedir: - font::print_wrap(PR_CEN, -1, 95, loc::gettext("ERROR: Could not write to language folder! Make sure there is no \"lang\" folder next to the regular saves."), tr, tg, tb); break; case Menu::speedrunneroptions: switch (game.currentmenuoption) { case 0: - { - font::print(PR_2X | PR_CEN, -1, 30, loc::gettext("Glitchrunner Mode"), tr, tg, tb); - int next_y = font::print_wrap(PR_CEN, -1, 65, loc::gettext("Re-enable glitches that existed in previous versions of the game."), tr, tg, tb); - drawglitchrunnertext(next_y); + graphics.bigprint(-1, 30, "Glitchrunner Mode", tr, tg, tb, true); + graphics.Print(-1, 65, "Re-enable glitches that existed", tr, tg, tb, true); + graphics.Print(-1, 75, "in previous versions of the game.", tr, tg, tb, true); + drawglitchrunnertext(); break; - } case 1: - { - font::print(PR_2X | PR_CEN, -1, 30, loc::gettext("Input Delay"), tr, tg, tb); - int next_y = font::print_wrap(PR_CEN, -1, 65, loc::gettext("Re-enable the 1-frame input delay from previous versions of the game."), tr, tg, tb); + graphics.bigprint(-1, 30, "Input Delay", tr, tg, tb, true); + graphics.Print(-1, 65, "Re-enable the 1-frame input delay", tr, tg, tb, true); + graphics.Print(-1, 75, "from previous versions of the game.", tr, tg, tb, true); if (game.inputdelay) { - font::print_wrap(PR_CEN, -1, next_y, loc::gettext("Input delay is ON"), tr, tg, tb); + graphics.Print(-1, 95, "Input delay is ON", tr, tg, tb, true); } else { - font::print_wrap(PR_CEN, -1, next_y, loc::gettext("Input delay is OFF"), tr / 2, tg / 2, tb / 2); + graphics.Print(-1, 95, "Input delay is OFF", tr / 2, tg / 2, tb / 2, true); } break; - } case 2: { - char buffer[SCREEN_WIDTH_CHARS + 1]; + /* Screen width 40 chars, 4 per char */ + char buffer[160 + 1]; const char* button; - font::print(PR_2X | PR_CEN, -1, 30, loc::gettext("Interact Button"), tr, tg, tb); - int next_y = font::print_wrap(PR_CEN, -1, 65, loc::gettext("Toggle whether you interact with prompts using ENTER or E."), tr, tg, tb); + graphics.bigprint(-1, 30, "Interact Button", tr, tg, tb, true); + graphics.Print(-1, 65, "Toggle whether you interact", tr, tg, tb, true); + graphics.Print(-1, 75, "with prompts using ENTER or E.", tr, tg, tb, true); if (game.separate_interact) { - button = loc::gettext("E"); + button = "E"; } else { - button = loc::gettext("ENTER"); + button = "ENTER"; } - vformat_buf(buffer, sizeof(buffer), loc::gettext("Interact button: {button}"), "button:str", button); - font::print_wrap(PR_CEN, -1, next_y, buffer, tr, tg, tb); + SDL_snprintf(buffer, sizeof(buffer), "Interact button: %s", button); + graphics.Print(-1, 95, buffer, tr, tg, tb, true); break; } case 3: - { - font::print(PR_2X | PR_CEN, -1, 30, loc::gettext("Fake Load Screen"), tr, tg, tb); - int next_y = font::print_wrap(PR_CEN, -1, 65, loc::gettext("Disable the fake loading screen which appears on game launch."), tr, tg, tb); + graphics.bigprint(-1, 30, "Fake Load Screen", tr, tg, tb, true); + graphics.Print(-1, 65, "Disable the fake loading screen", tr, tg, tb, true); + graphics.Print(-1, 75, "which appears on game launch.", tr, tg, tb, true); if (game.skipfakeload) - font::print_wrap(PR_CEN, -1, next_y, loc::gettext("Fake loading screen is OFF"), tr / 2, tg / 2, tb / 2); + graphics.Print(-1, 95, "Fake loading screen is OFF", tr / 2, tg / 2, tb / 2, true); else - font::print_wrap(PR_CEN, -1, next_y, loc::gettext("Fake loading screen is ON"), tr, tg, tb); + graphics.Print(-1, 95, "Fake loading screen is ON", tr, tg, tb, true); break; - } case 4: - { - font::print(PR_2X | PR_CEN, -1, 30, loc::gettext("In-Game Timer"), tr, tg, tb); - int next_y = font::print_wrap(PR_CEN, -1, 65, loc::gettext("Toggle the in-game timer outside of time trials."), tr, tg, tb); + graphics.bigprint(-1, 30, "In-Game Timer", tr, tg, tb, true); + graphics.Print(-1, 65, "Toggle the in-game timer", tr, tg, tb, true); + graphics.Print(-1, 75, " outside of time trials.", tr, tg, tb, true); if (game.showingametimer) { - font::print_wrap(PR_CEN, -1, next_y, loc::gettext("In-Game Timer is ON"), tr, tg, tb); + graphics.Print(-1, 95, "In-Game Timer is ON", tr, tg, tb, true); } else { - font::print_wrap(PR_CEN, -1, next_y, loc::gettext("In-Game Timer is OFF"), tr / 2, tg / 2, tb / 2); + graphics.Print(-1, 95, "In-Game Timer is OFF", tr / 2, tg / 2, tb / 2, true); } break; } - case 5: - { - font::print(PR_2X | PR_CEN, -1, 30, loc::gettext("English Sprites"), tr, tg, tb); - int next_y = font::print_wrap(PR_CEN, -1, 65, loc::gettext("Show the original English word enemies regardless of your language setting."), tr, tg, tb); - if (loc::english_sprites) - { - font::print_wrap(PR_CEN, -1, next_y, loc::gettext("Sprites are currently ALWAYS ENGLISH"), tr, tg, tb); - } - else - { - font::print_wrap(PR_CEN, -1, next_y, loc::gettext("Sprites are currently translated"), tr / 2, tg / 2, tb / 2); - } - break; - } - } break; case Menu::setglitchrunner: - { - font::print(PR_2X | PR_CEN, -1, 30, loc::gettext("Glitchrunner Mode"), tr, tg, tb); - int next_y = font::print_wrap(PR_CEN, -1, 65, loc::gettext("Select a new glitchrunner version below."), tr, tg, tb); - drawglitchrunnertext(next_y); + graphics.bigprint(-1, 30, "Glitchrunner Mode", tr, tg, tb, true); + graphics.Print(-1, 65, "Select a new glitchrunner", tr, tg, tb, true); + graphics.Print(-1, 75, "version below.", tr, tg, tb, true); + drawglitchrunnertext(); break; - } case Menu::advancedoptions: switch (game.currentmenuoption) { case 0: - { - font::print(PR_2X | PR_CEN, -1, 30, loc::gettext("Unfocus Pause"), tr, tg, tb); - int next_y = font::print_wrap(PR_CEN, -1, 65, loc::gettext("Toggle if the game will pause when the window is unfocused."), tr, tg, tb); + graphics.bigprint( -1, 30, "Unfocus Pause", tr, tg, tb, true); + graphics.Print( -1, 65, "Toggle if the game will pause", tr, tg, tb, true); + graphics.Print( -1, 75, "when the window is unfocused.", tr, tg, tb, true); if (game.disablepause) { - font::print_wrap(PR_CEN, -1, next_y, loc::gettext("Unfocus pause is OFF"), tr/2, tg/2, tb/2); + graphics.Print(-1, 95, "Unfocus pause is OFF", tr/2, tg/2, tb/2, true); } else { - font::print_wrap(PR_CEN, -1, next_y, loc::gettext("Unfocus pause is ON"), tr, tg, tb); + graphics.Print(-1, 95, "Unfocus pause is ON", tr, tg, tb, true); } break; - } case 1: - { - font::print(PR_2X | PR_CEN, -1, 30, loc::gettext("Unfocus Audio"), tr, tg, tb); - int next_y = font::print_wrap(PR_CEN, -1, 65, loc::gettext("Toggle if the audio will pause when the window is unfocused."), tr, tg, tb); + graphics.bigprint(-1, 30, "Unfocus Audio", tr, tg, tb, true); + graphics.Print(-1, 65, "Toggle if the audio will pause", tr, tg, tb, true); + graphics.Print(-1, 75, "when the window is unfocused.", tr, tg, tb, true); if (game.disableaudiopause) { - font::print_wrap(PR_CEN, -1, next_y, loc::gettext("Unfocus audio pause is OFF"), tr/2, tg/2, tb/2); + graphics.Print(-1, 95, "Unfocus audio pause is OFF", tr/2, tg/2, tb/2, true); } else { - font::print_wrap(PR_CEN, -1, next_y, loc::gettext("Unfocus audio pause is ON"), tr, tg, tb); + graphics.Print(-1, 95, "Unfocus audio pause is ON", tr, tg, tb, true); } break; - } case 2: - { - font::print(PR_2X | PR_CEN, -1, 30, loc::gettext("Room Name BG"), tr, tg, tb); - int next_y = font::print_wrap(PR_CEN, -1, 65, loc::gettext("Lets you see through what is behind the name at the bottom of the screen."), tr, tg, tb); + graphics.bigprint(-1, 30, "Room Name BG", tr, tg, tb, true); + graphics.Print( -1, 65, "Lets you see through what is behind", tr, tg, tb, true); + graphics.Print( -1, 75, "the name at the bottom of the screen.", tr, tg, tb, true); if (graphics.translucentroomname) - font::print_wrap(PR_CEN, -1, next_y, loc::gettext("Room name background is TRANSLUCENT"), tr/2, tg/2, tb/2); + graphics.Print(-1, 95, "Room name background is TRANSLUCENT", tr/2, tg/2, tb/2, true); else - font::print_wrap(PR_CEN, -1, next_y, loc::gettext("Room name background is OPAQUE"), tr, tg, tb); + graphics.Print(-1, 95, "Room name background is OPAQUE", tr, tg, tb, true); break; } - case 3: - { - font::print(PR_2X | PR_CEN, -1, 30, loc::gettext("Checkpoint Saving"), tr, tg, tb); - int next_y = font::print_wrap(PR_CEN, -1, 65, loc::gettext("Toggle if checkpoints should save the game."), tr, tg, tb); - if (!game.checkpoint_saving) - { - font::print_wrap(PR_CEN, -1, next_y, loc::gettext("Checkpoint saving is OFF"), tr / 2, tg / 2, tb / 2); - } - else - { - font::print_wrap(PR_CEN, -1, next_y, loc::gettext("Checkpoint saving is ON"), tr, tg, tb); - } - break; - } - } break; case Menu::accessibility: { @@ -1246,78 +740,73 @@ static void menurender(void) { #if !defined(MAKEANDPLAY) case 0: - font::print(PR_2X | PR_CEN, -1, 30, loc::gettext("Unlock Play Modes"), tr, tg, tb); - font::print_wrap(PR_CEN, -1, 65, loc::gettext("Unlock parts of the game normally unlocked as you progress."), tr, tg, tb); + graphics.bigprint(-1, 30, "Unlock Play Modes", tr, tg, tb, true); + graphics.Print(-1, 65, "Unlock parts of the game normally", tr, tg, tb, true); + graphics.Print(-1, 75, "unlocked as you progress.", tr, tg, tb, true); break; #endif case OFFSET+0: - { - font::print(PR_2X | PR_CEN, -1, 30, loc::gettext("Invincibility"), tr, tg, tb); - int next_y = font::print_wrap(PR_CEN, -1, 65, loc::gettext("Explore the game freely without dying. (Can cause glitches.)"), tr, tg, tb); + graphics.bigprint(-1, 30, "Invincibility", tr, tg, tb, true); + graphics.Print(-1, 65, "Explore the game freely without", tr, tg, tb, true); + graphics.Print(-1, 75, "dying. (Can cause glitches.)", tr, tg, tb, true); if (map.invincibility) { - font::print_wrap(PR_CEN, -1, next_y, loc::gettext("Invincibility is ON."), tr, tg, tb); + graphics.Print(-1, 95, "Invincibility is ON.", tr, tg, tb, true); } else { - font::print_wrap(PR_CEN, -1, next_y, loc::gettext("Invincibility is OFF."), tr / 2, tg / 2, tb / 2); + graphics.Print(-1, 95, "Invincibility is OFF.", tr / 2, tg / 2, tb / 2, true); } break; - } case OFFSET+1: - { - font::print(PR_2X | PR_CEN, -1, 30, loc::gettext("Slowdown"), tr, tg, tb); - int next_y = font::print_wrap(PR_CEN, -1, 65, loc::gettext("Reduce the game speed."), tr, tg, tb); - drawslowdowntext(next_y); + graphics.bigprint(-1, 30, "Slowdown", tr, tg, tb, true); + graphics.Print(-1, 65, "Reduce the game speed.", tr, tg, tb, true); + drawslowdowntext(); break; - } case OFFSET+2: - { - font::print(PR_2X | PR_CEN, -1, 30, loc::gettext("Backgrounds"), tr, tg, tb); - int next_y = font::print_wrap(PR_CEN, -1, 65, loc::gettext("Disable animated backgrounds in menus and during gameplay."), tr, tg, tb); + graphics.bigprint(-1, 30, "Backgrounds", tr, tg, tb, true); + graphics.Print(-1, 65, "Disable animated backgrounds in menus", tr, tg, tb, true); + graphics.Print(-1, 75, "and during gameplay.", tr, tg, tb, true); if (!game.colourblindmode) { - font::print_wrap(PR_CEN, -1, next_y, loc::gettext("Backgrounds are ON."), tr, tg, tb); + graphics.Print(-1, 95, "Backgrounds are ON.", tr, tg, tb, true); } else { - font::print_wrap(PR_CEN, -1, next_y, loc::gettext("Backgrounds are OFF."), tr / 2, tg / 2, tb / 2); + graphics.Print(-1, 95, "Backgrounds are OFF.", tr / 2, tg / 2, tb / 2, true); } break; - } case OFFSET+3: - { - font::print(PR_2X | PR_CEN, -1, 30, loc::gettext("Screen Effects"), tr, tg, tb); - int next_y = font::print_wrap(PR_CEN, -1, 65, loc::gettext("Disables screen shakes and flashes."), tr, tg, tb); + graphics.bigprint(-1, 30, "Screen Effects", tr, tg, tb, true); + graphics.Print(-1, 65, "Disables screen shakes and flashes.", tr, tg, tb, true); if (!game.noflashingmode) { - font::print_wrap(PR_CEN, -1, next_y, loc::gettext("Screen Effects are ON."), tr, tg, tb); + graphics.Print(-1, 85, "Screen Effects are ON.", tr, tg, tb, true); } else { - font::print_wrap(PR_CEN, -1, next_y, loc::gettext("Screen Effects are OFF."), tr / 2, tg / 2, tb / 2); + graphics.Print(-1, 85, "Screen Effects are OFF.", tr / 2, tg / 2, tb / 2, true); } break; - } case OFFSET+4: { const char* text; - font::print(PR_2X | PR_CEN, -1, 30, loc::gettext("Text Outline"), tr, tg, tb); - int next_y = font::print_wrap(PR_CEN, -1, 65, loc::gettext("Disables outline on game text."), tr, tg, tb); + graphics.bigprint(-1, 30, "Text Outline", tr, tg, tb, true); + graphics.Print(-1, 65, "Disables outline on game text.", tr, tg, tb, true); - graphics.fill_rect(0, next_y-4, 320, 16, tr, tg, tb); + FillRect(graphics.backBuffer, 0, 84, 320, 10, tr, tg, tb); if (!graphics.notextoutline) { - text = loc::gettext("Text outlines are ON."); + text = "Text outlines are ON."; } else { - text = loc::gettext("Text outlines are OFF."); + text = "Text outlines are OFF."; } - font::print(PR_BOR | PR_CEN, -1, next_y, text, 255, 255, 255); + graphics.bprint(-1, 85, text, 255, 255, 255, true); break; } @@ -1328,608 +817,618 @@ static void menurender(void) } case Menu::playint1: case Menu::playint2: - font::print_wrap(PR_CEN, -1, 65, loc::gettext("Who do you want to play the level with?"), tr, tg, tb); + graphics.Print( -1, 65, "Who do you want to play", tr, tg, tb, true); + graphics.Print( -1, 75, "the level with?", tr, tg, tb, true); break; case Menu::playmodes: switch (game.currentmenuoption) { case 0: - { - font::print(PR_2X | PR_CEN, -1, 30, loc::gettext("Time Trials"), tr, tg, tb); - int next_y = font::print_wrap(PR_CEN, -1, 65, loc::gettext("Replay any level in the game in a competitive time trial mode."), tr, tg, tb); + graphics.bigprint( -1, 30, "Time Trials", tr, tg, tb, true); + graphics.Print( -1, 65, "Replay any level in the game in", tr, tg, tb, true); + graphics.Print( -1, 75, "a competitive time trial mode.", tr, tg, tb, true); if (game.nocompetitive()) { - font::print_wrap(PR_CEN, -1, next_y, loc::gettext("Time Trials are not available with slowdown or invincibility."), tr, tg, tb); + graphics.Print( -1, 105, "Time Trials are not available", tr, tg, tb, true); + graphics.Print( -1, 115, "with slowdown or invincibility.", tr, tg, tb, true); } break; - } case 1: - { - font::print(PR_2X | PR_CEN, -1, 30, loc::gettext("Intermissions"), tr, tg, tb); - int next_y = font::print_wrap(PR_CEN, -1, 65, loc::gettext("Replay the intermission levels."), tr, tg, tb); + graphics.bigprint( -1, 30, "Intermissions", tr, tg, tb, true); + graphics.Print( -1, 65, "Replay the intermission levels.", tr, tg, tb, true); - if (!game.unlock[Unlock_INTERMISSION_REPLAYS]) + if (!game.unlock[15] && !game.unlock[16]) { - font::print_wrap(PR_CEN, -1, next_y, loc::gettext("TO UNLOCK: Complete the intermission levels in-game."), tr, tg, tb); + graphics.Print( -1, 95, "TO UNLOCK: Complete the", tr, tg, tb, true); + graphics.Print( -1, 105, "intermission levels in-game.", tr, tg, tb, true); } break; - } case 2: - { - font::print(PR_2X | PR_CEN, -1, 30, loc::gettext("No Death Mode"), tr, tg, tb); - int next_y = font::print_wrap(PR_CEN, -1, 65, loc::gettext("Play the entire game without dying once."), tr, tg, tb); + graphics.bigprint( -1, 30, "No Death Mode", tr, tg, tb, true); + graphics.Print( -1, 65, "Play the entire game", tr, tg, tb, true); + graphics.Print( -1, 75, "without dying once.", tr, tg, tb, true); if (game.nocompetitive()) { - font::print_wrap(PR_CEN, -1, next_y, loc::gettext("No Death Mode is not available with slowdown or invincibility."), tr, tg, tb); + graphics.Print( -1, 105, "No Death Mode is not available", tr, tg, tb, true); + graphics.Print( -1, 115, "with slowdown or invincibility.", tr, tg, tb, true); } - else if (!game.unlock[Unlock_NODEATHMODE]) + else if (!game.unlock[17]) { - font::print_wrap(PR_CEN, -1, next_y, loc::gettext("TO UNLOCK: Achieve an S-rank or above in at least 4 time trials."), tr, tg, tb); + graphics.Print( -1, 105, "TO UNLOCK: Achieve an S-rank or", tr, tg, tb, true); + graphics.Print( -1, 115, "above in at least 4 time trials.", tr, tg, tb, true); } break; - } case 3: // WARNING: Partially duplicated in Menu::options - font::print(PR_2X | PR_CEN, -1, 30, loc::gettext("Flip Mode"), tr, tg, tb); - int next_y = font::print_wrap(PR_CEN, -1, 65, loc::gettext("Flip the entire game vertically. Compatible with other game modes."), tr, tg, tb); + graphics.bigprint( -1, 30, "Flip Mode", tr, tg, tb, true); + graphics.Print( -1, 65, "Flip the entire game vertically.", tr, tg, tb, true); + graphics.Print( -1, 75, "Compatible with other game modes.", tr, tg, tb, true); - if (game.unlock[Unlock_FLIPMODE]) + if (game.unlock[18]) { if (graphics.setflipmode) { - font::print_wrap(PR_CEN, -1, next_y, loc::gettext("Currently ENABLED!"), tr, tg, tb); + graphics.Print( -1, 105, "Currently ENABLED!", tr, tg, tb, true); } else { - font::print_wrap(PR_CEN, -1, next_y, loc::gettext("Currently Disabled."), tr/2, tg/2, tb/2); + graphics.Print( -1, 105, "Currently Disabled.", tr/2, tg/2, tb/2, true); } } else { - font::print_wrap(PR_CEN, -1, next_y, loc::gettext("TO UNLOCK: Complete the game."), tr, tg, tb); + graphics.Print( -1, 105, "TO UNLOCK: Complete the game.", tr, tg, tb, true); } break; } break; case Menu::youwannaquit: - font::print_wrap(PR_CEN, -1, 75, loc::gettext("Are you sure you want to quit?"), tr, tg, tb); + graphics.Print( -1, 75, "Are you sure you want to quit?", tr, tg, tb, true); break; case Menu::continuemenu: - { - const char* title = NULL; - struct Game::Summary* summary = NULL; - switch (game.currentmenuoption) { case 0: - title = loc::gettext("Tele Save"); - summary = &game.last_telesave; - break; - case 1: - title = loc::gettext("Quick Save"); - summary = &game.last_quicksave; - break; - } - - if (summary != NULL) { - graphics.drawpixeltextbox(17, 65-20, 286, 90, 65, 185, 207); + //Show teleporter save info + graphics.drawpixeltextbox(17, 65-20, 286, 90, 36,12, 65, 185, 207,0,4); - font::print(PR_2X | PR_CEN, -1, 20, title, tr, tg, tb); - font::print( - PR_CEN, -1, 80-20, - loc::gettext_roomname_special(map.currentarea(summary->saverx, summary->savery)), - 25, 255 - (help.glow / 2), 255 - (help.glow / 2) - ); + graphics.bigprint(-1, 20, "Tele Save", tr, tg, tb, true); + graphics.Print(0, 80-20, game.tele_currentarea, 25, 255 - (help.glow / 2), 255 - (help.glow / 2), true); for (int i = 0; i < 6; i++) { - graphics.drawcrewman(169-(3*42)+(i*42), 95-20, i, summary->crewstats[i], true); + graphics.drawcrewman(169-(3*42)+(i*42), 95-20, i, game.tele_crewstats[i], true); } - font::print( - 0, 59, 132-20, - game.giventimestring( - summary->hours, - summary->minutes, - summary->seconds - ), - 255 - (help.glow / 2), 255 - (help.glow / 2), 255 - (help.glow / 2) - ); - char buffer[SCREEN_WIDTH_CHARS + 1]; - vformat_buf(buffer, sizeof(buffer), - loc::gettext("{savebox_n_trinkets|wordy}"), - "savebox_n_trinkets:int", - summary->trinkets - ); - font::print(PR_RIGHT, 262, 132-20, buffer, 255 - (help.glow / 2), 255 - (help.glow / 2), 255 - (help.glow / 2)); + graphics.Print(59, 132-20, game.tele_gametime, 255 - (help.glow / 2), 255 - (help.glow / 2), 255 - (help.glow / 2)); + const std::string& trinketcount = help.number(game.tele_trinkets); + graphics.Print(262-graphics.len(trinketcount), 132-20, trinketcount, 255 - (help.glow / 2), 255 - (help.glow / 2), 255 - (help.glow / 2)); - graphics.draw_sprite(34, 126-20, 50, graphics.col_clock); - graphics.draw_sprite(270, 126-20, 22, graphics.col_trinket); + graphics.drawsprite(34, 126-20, 50, graphics.col_clock); + graphics.drawsprite(270, 126-20, 22, graphics.col_trinket); + break; + } + case 1: + { + //Show quick save info + graphics.drawpixeltextbox(17, 65-20, 286, 90, 36,12, 65, 185, 207,0,4); + + graphics.bigprint(-1, 20, "Quick Save", tr, tg, tb, true); + graphics.Print(0, 80-20, game.quick_currentarea, 25, 255 - (help.glow / 2), 255 - (help.glow / 2), true); + for (int i = 0; i < 6; i++) + { + graphics.drawcrewman(169-(3*42)+(i*42), 95-20, i, game.quick_crewstats[i], true); + } + graphics.Print(59, 132-20, game.quick_gametime, 255 - (help.glow / 2), 255 - (help.glow / 2), 255 - (help.glow / 2)); + const std::string& trinketcount = help.number(game.quick_trinkets); + graphics.Print(262-graphics.len(trinketcount), 132-20, trinketcount, 255 - (help.glow / 2), 255 - (help.glow / 2), 255 - (help.glow / 2)); + + graphics.drawsprite(34, 126-20, 50, graphics.col_clock); + graphics.drawsprite(270, 126-20, 22, graphics.col_trinket); + break; + } } break; - } case Menu::gameover: case Menu::gameover2: { - font::print(PR_3X | PR_CEN, -1, 25, loc::gettext("GAME OVER"), tr, tg, tb); + graphics.bigprint( -1, 25, "GAME OVER", tr, tg, tb, true, 3); for (size_t i = 0; i < SDL_arraysize(game.ndmresultcrewstats); i++) { graphics.drawcrewman(169-(3*42)+(i*42), 68, i, game.ndmresultcrewstats[i], true); } - char buffer[2*SCREEN_WIDTH_CHARS + 1]; - loc::gettext_plural_fill( - buffer, sizeof(buffer), - "You rescued {n_crew|wordy} crewmates", - "You rescued {n_crew|wordy} crewmate", - "n_crew:int", - game.ndmresultcrewrescued - ); - font::print(PR_CEN, -1, 100, buffer, tr, tg, tb); + std::string tempstring; + tempstring = "You rescued " + help.number(game.ndmresultcrewrescued) + (game.ndmresultcrewrescued == 1 ? " crewmate" : " crewmates"); + graphics.Print(0, 100, tempstring, tr, tg, tb, true); - loc::gettext_plural_fill( - buffer, sizeof(buffer), - "and found {n_trinkets|wordy} trinkets.", - "and found {n_trinkets|wordy} trinket.", - "n_trinkets:int", - game.ndmresulttrinkets - ); - font::print_wrap(PR_CEN | PR_CJK_LOW, -1, 110, buffer, tr, tg, tb); + tempstring = "and found " + help.number(game.ndmresulttrinkets) + (game.ndmresulttrinkets == 1 ? " trinket." : " trinkets."); + graphics.Print(0, 110, tempstring, tr, tg, tb, true); - font::print(PR_CEN, -1, 145, loc::gettext("You managed to reach:"), tr, tg, tb); - font::print( - PR_CEN | PR_CJK_LOW, -1, 155, - loc::gettext_roomname( - false, - game.ndmresulthardestroom_x, game.ndmresulthardestroom_y, - game.ndmresulthardestroom.c_str(), game.ndmresulthardestroom_specialname - ), - tr, tg, tb - ); + tempstring = "You managed to reach:"; + graphics.Print(0, 145, tempstring, tr, tg, tb, true); + graphics.Print(0, 155, game.ndmresulthardestroom, tr, tg, tb, true); - const char* encouragement; switch (game.ndmresultcrewrescued) { case 1: - encouragement = loc::gettext("Keep trying! You'll get there!"); + tempstring = "Keep trying! You'll get there!"; break; case 2: - encouragement = loc::gettext("Nice one!"); + tempstring = "Nice one!"; break; case 3: - encouragement = loc::gettext("Wow! Congratulations!"); + tempstring = "Wow! Congratulations!"; break; case 4: - encouragement = loc::gettext("Incredible!"); + tempstring = "Incredible!"; break; case 5: - encouragement = loc::gettext("Unbelievable! Well done!"); + tempstring = "Unbelievable! Well done!"; break; - default: - encouragement = loc::gettext("Er, how did you do that?"); + case 6: + tempstring = "Er, how did you do that?"; break; } - font::print_wrap(PR_CEN, -1, 190, encouragement, tr, tg, tb); + graphics.Print(0, 190, tempstring, tr, tg, tb, true); break; } case Menu::nodeathmodecomplete: case Menu::nodeathmodecomplete2: { - font::print(PR_4X | PR_CEN | PR_CJK_LOW, -1, 8, loc::gettext("WOW"), tr, tg, tb); + graphics.bigprint( -1, 8, "WOW", tr, tg, tb, true, 4); for (size_t i = 0; i < SDL_arraysize(game.ndmresultcrewstats); i++) { graphics.drawcrewman(169-(3*42)+(i*42), 68, i, game.ndmresultcrewstats[i], true); } - font::print(PR_CEN, -1, 100, loc::gettext("You rescued all the crewmates!"), tr, tg, tb); + std::string tempstring = "You rescued all the crewmates!"; + graphics.Print(0, 100, tempstring, tr, tg, tb, true); - char buffer[3*SCREEN_WIDTH_CHARS + 1]; - loc::gettext_plural_fill( - buffer, sizeof(buffer), - "And you found {n_trinkets|wordy} trinkets.", - "And you found {n_trinkets|wordy} trinket.", - "n_trinkets:int", - game.ndmresulttrinkets - ); - font::print_wrap(PR_CEN | PR_CJK_LOW, -1, 110, buffer, tr, tg, tb); + tempstring = "And you found " + help.number(game.ndmresulttrinkets) + " trinkets."; + graphics.Print(0, 110, tempstring, tr, tg, tb, true); - font::print_wrap(PR_CEN, -1, 160, loc::gettext("A new trophy has been awarded and placed in the secret lab to acknowledge your achievement!"), tr, tg, tb); + graphics.Print(0, 160, "A new trophy has been awarded and", tr, tg, tb, true); + graphics.Print(0, 170, "placed in the secret lab to", tr, tg, tb, true); + graphics.Print(0, 180, "acknowledge your achievement!", tr, tg, tb, true); break; } case Menu::timetrialcomplete: case Menu::timetrialcomplete2: case Menu::timetrialcomplete3: { - font::print(PR_3X | PR_CEN, -1, 20, loc::gettext("Results"), tr, tg, tb); + graphics.bigprint( -1, 20, "Results", tr, tg, tb, true, 3); - std::string tempstring = game.resulttimestring() + loc::gettext(" / ") + game.timetstring(game.timetrialresultpar) + loc::gettext(".99"); + std::string tempstring = game.resulttimestring() + " / " + game.timetstring(game.timetrialresultpar) + ".99"; - uint32_t plus1_flags = PR_RIGHT | PR_CJK_LOW | PR_RTL_XFLIP; - int plus1_offset = 0; - if (font::len(0, tempstring.c_str()) + font::len(0, loc::gettext("+1 Rank!")) > (292-49)) - { - // Time and "+1 Rank!" don't fit together, so put it next to titles instead - plus1_flags = PR_RIGHT | PR_CJK_HIGH; - plus1_offset = -10; - } - - /* sprite_x_1 is used for the clock and trinket, - * sprite_x_2 is used for the player. */ - int sprite_x_1, sprite_x_2; - if (!font::is_rtl(PR_FONT_INTERFACE)) - { - sprite_x_1 = 22; - sprite_x_2 = 22 - 4; - } - else - { - sprite_x_1 = SCREEN_WIDTH_PIXELS - 22 - 16; - sprite_x_2 = SCREEN_WIDTH_PIXELS - 22 - 16 - 4; - } - - graphics.drawspritesetcol(sprite_x_1, 80-15, 50, 22); - font::print(PR_CJK_HIGH | PR_RTL_XFLIP, 49, 80-15, loc::gettext("TIME TAKEN:"), 255, 255, 255); - font::print(PR_CJK_LOW | PR_RTL_XFLIP, 49, 90-15, tempstring, tr, tg, tb); + graphics.drawspritesetcol(30, 80-15, 50, 22); + graphics.Print(65, 80-15, "TIME TAKEN:", 255, 255, 255); + graphics.Print(65, 90-15, tempstring, tr, tg, tb); if (game.timetrialresulttime <= game.timetrialresultpar) { - font::print(plus1_flags, 292, 90-15+plus1_offset, loc::gettext("+1 Rank!"), 255, 255, 255); + graphics.Print(220, 85-15, "+1 Rank!", 255, 255, 255); } tempstring = help.String(game.timetrialresultdeaths); - graphics.drawspritesetcol(sprite_x_2, 80+20-4, 12, 22); - font::print(PR_CJK_HIGH | PR_RTL_XFLIP, 49, 80+20, loc::gettext("NUMBER OF DEATHS:"), 255, 255, 255); - font::print(PR_CJK_LOW | PR_RTL_XFLIP, 49, 90+20, tempstring, tr, tg, tb); + graphics.drawspritesetcol(30-4, 80+20-4, 12, 22); + graphics.Print(65, 80+20, "NUMBER OF DEATHS:", 255, 255, 255); + graphics.Print(65, 90+20, tempstring, tr, tg, tb); if (game.timetrialresultdeaths == 0) { - font::print(plus1_flags, 292, 90+20+plus1_offset, loc::gettext("+1 Rank!"), 255, 255, 255); + graphics.Print(220, 85+20, "+1 Rank!", 255, 255, 255); } - char buffer[SCREEN_WIDTH_CHARS + 1]; - vformat_buf( - buffer, sizeof(buffer), - loc::gettext("{n_trinkets} of {max_trinkets}"), - "n_trinkets:int, max_trinkets:int", - game.timetrialresulttrinkets, game.timetrialresultshinytarget - ); - graphics.drawspritesetcol(sprite_x_1, 80+55, 22, 22); - font::print(PR_CJK_HIGH | PR_RTL_XFLIP, 49, 80+55, loc::gettext("SHINY TRINKETS:"), 255, 255, 255); - font::print(PR_CJK_LOW | PR_RTL_XFLIP, 49, 90+55, buffer, tr, tg, tb); + tempstring = help.String(game.timetrialresulttrinkets) + " of " + help.String(game.timetrialresultshinytarget); + graphics.drawspritesetcol(30, 80+55, 22, 22); + graphics.Print(65, 80+55, "SHINY TRINKETS:", 255, 255, 255); + graphics.Print(65, 90+55, tempstring, tr, tg, tb); if (game.timetrialresulttrinkets >= game.timetrialresultshinytarget) { - font::print(plus1_flags, 292, 90+55+plus1_offset, loc::gettext("+1 Rank!"), 255, 255, 255); + graphics.Print(220, 85+55, "+1 Rank!", 255, 255, 255); } - const char* rank = ""; - switch(game.timetrialrank) - { - case 0: - rank = loc::gettext("B"); - break; - case 1: - rank = loc::gettext("A"); - break; - case 2: - rank = loc::gettext("S"); - break; - case 3: - rank = loc::gettext("V"); - break; - } - int rankw = font::len(PR_4X, rank); - int ranktextw = font::len(PR_2X, loc::gettext("Rank:")) + 16 + rankw; - int ranktextx = (320-ranktextw)/2; - int rankx = ranktextx + ranktextw - rankw; if (game.currentmenuname == Menu::timetrialcomplete2 || game.currentmenuname == Menu::timetrialcomplete3) { - font::print(PR_2X | PR_RTL_XFLIP, ranktextx, 175, loc::gettext("Rank:"), tr, tg, tb); + graphics.bigprint( 100, 175, "Rank:", tr, tg, tb, false, 2); } if (game.currentmenuname == Menu::timetrialcomplete3) { - font::print(PR_4X | PR_RTL_XFLIP, rankx, 165, rank, 255, 255, 255); + switch(game.timetrialrank) + { + case 0: + graphics.bigprint( 195, 165, "B", 255, 255, 255, false, 4); + break; + case 1: + graphics.bigprint( 195, 165, "A", 255, 255, 255, false, 4); + break; + case 2: + graphics.bigprint( 195, 165, "S", 255, 255, 255, false, 4); + break; + case 3: + graphics.bigprint( 195, 165, "V", 255, 255, 255, false, 4); + break; + } } break; } case Menu::unlockmenutrials: - font::print(PR_2X | PR_CEN, -1, 30, loc::gettext("Unlock Time Trials"), tr, tg, tb); - font::print_wrap(PR_CEN, -1, 65, loc::gettext("You can unlock each time trial separately."), tr, tg, tb); + graphics.bigprint( -1, 30, "Unlock Time Trials", tr, tg, tb, true); + graphics.Print( -1, 65, "You can unlock each time", tr, tg, tb, true); + graphics.Print( -1, 75, "trial separately.", tr, tg, tb, true); break; case Menu::timetrials: - { - bool unlocked = false; - int id_trial = game.currentmenuoption; - int par; - int max_trinkets; - switch (game.currentmenuoption) { case 0: - if (game.unlock[Unlock_TIMETRIAL_SPACESTATION1]) + if(game.unlock[9]) { - font::print(PR_2X | PR_CEN, -1, 30, loc::gettext("Space Station 1"), tr, tg, tb); - unlocked = true; - par = 75; - max_trinkets = 2; - } - else - { - font::print(PR_2X | PR_CEN, -1, 30, loc::gettext("???"), tr, tg, tb); - font::print(PR_CEN, -1, 60, loc::gettext("TO UNLOCK:"), tr, tg, tb); - font::print(PR_CEN, -1, 75, loc::gettext("Rescue Violet"), tr, tg, tb); - font::print(PR_CEN, -1, 87, loc::gettext("Find three trinkets"), tr, tg, tb); - } - break; - case 1: - if (game.unlock[Unlock_TIMETRIAL_LABORATORY]) - { - font::print(PR_2X | PR_CEN, -1, 30, loc::gettext("The Laboratory"), tr, tg, tb); - unlocked = true; - par = 165; - max_trinkets = 4; - } - else - { - font::print(PR_2X | PR_CEN, -1, 30, loc::gettext("???"), tr, tg, tb); - font::print(PR_CEN, -1, 60, loc::gettext("TO UNLOCK:"), tr, tg, tb); - font::print(PR_CEN, -1, 75, loc::gettext("Rescue Victoria"), tr, tg, tb); - font::print(PR_CEN, -1, 87, loc::gettext("Find six trinkets"), tr, tg, tb); - } - break; - case 2: - if (game.unlock[Unlock_TIMETRIAL_TOWER]) - { - font::print(PR_2X | PR_CEN, -1, 30, loc::gettext("The Tower"), tr, tg, tb); - unlocked = true; - par = 105; - max_trinkets = 2; - } - else - { - font::print(PR_2X | PR_CEN, -1, 30, loc::gettext("???"), tr, tg, tb); - font::print(PR_CEN, -1, 60, loc::gettext("TO UNLOCK:"), tr, tg, tb); - font::print(PR_CEN, -1, 75, loc::gettext("Rescue Vermilion"), tr, tg, tb); - font::print(PR_CEN, -1, 87, loc::gettext("Find nine trinkets"), tr, tg, tb); - } - break; - case 3: - if (game.unlock[Unlock_TIMETRIAL_SPACESTATION2]) - { - font::print(PR_2X | PR_CEN, -1, 30, loc::gettext("Space Station 2"), tr, tg, tb); - unlocked = true; - par = 200; - max_trinkets = 5; - } - else - { - font::print(PR_2X | PR_CEN, -1, 30, loc::gettext("???"), tr, tg, tb); - font::print(PR_CEN, -1, 60, loc::gettext("TO UNLOCK:"), tr, tg, tb); - font::print(PR_CEN, -1, 75, loc::gettext("Rescue Vitellary"), tr, tg, tb); - font::print(PR_CEN, -1, 87, loc::gettext("Find twelve trinkets"), tr, tg, tb); - } - break; - case 4: - if (game.unlock[Unlock_TIMETRIAL_WARPZONE]) - { - font::print(PR_2X | PR_CEN, -1, 30, loc::gettext("The Warp Zone"), tr, tg, tb); - unlocked = true; - par = 120; - max_trinkets = 1; - } - else - { - font::print(PR_2X | PR_CEN, -1, 30, loc::gettext("???"), tr, tg, tb); - font::print(PR_CEN, -1, 60, loc::gettext("TO UNLOCK:"), tr, tg, tb); - font::print(PR_CEN, -1, 75, loc::gettext("Rescue Verdigris"), tr, tg, tb); - font::print(PR_CEN, -1, 87, loc::gettext("Find fifteen trinkets"), tr, tg, tb); - } - break; - case 5: - if (game.unlock[Unlock_TIMETRIAL_FINALLEVEL]) - { - font::print(PR_2X | PR_CEN, -1, 30, loc::gettext("The Final Level"), tr, tg, tb); - unlocked = true; - par = 135; - max_trinkets = 1; - } - else - { - font::print(PR_2X | PR_CEN, -1, 30, loc::gettext("???"), tr, tg, tb); - font::print(PR_CEN, -1, 60, loc::gettext("TO UNLOCK:"), tr, tg, tb); - font::print(PR_CEN, -1, 75, loc::gettext("Complete the game"), tr, tg, tb); - font::print(PR_CEN, -1, 87, loc::gettext("Find eighteen trinkets"), tr, tg, tb); - } - break; - } - - if (unlocked) - { - if (game.besttimes[id_trial] == -1) - { - font::print_wrap(PR_CEN, -1, 75, loc::gettext("Not yet attempted"), tr, tg, tb); - } - else - { - int sp = SDL_max(10, font::height(0)); - - font::print(PR_RTL_XFLIP, 32, 65, loc::gettext("RECORDS"), tr, tg, tb); - const char* label = loc::gettext("TIME"); - int label_len = font::len(0, label); - font::print(PR_RTL_XFLIP, 32, 65+sp, label, tr, tg, tb); - label = loc::gettext("SHINY"); - label_len = SDL_max(label_len, font::len(0, label)); - font::print(PR_RTL_XFLIP, 32, 65+sp*2, label, tr, tg, tb); - label = loc::gettext("LIVES"); - label_len = SDL_max(label_len, font::len(0, label)); - font::print(PR_RTL_XFLIP, 32, 65+sp*3, label, tr, tg, tb); - - char buffer[SCREEN_WIDTH_CHARS + 1]; - help.format_time(buffer, sizeof(buffer), game.besttimes[id_trial], game.bestframes[id_trial], true); - font::print(PR_RTL_XFLIP, label_len+48, 65+sp, buffer, tr, tg, tb); - - vformat_buf( - buffer, sizeof(buffer), - loc::gettext("{n_trinkets}/{max_trinkets}"), - "n_trinkets:int, max_trinkets:int", - game.besttrinkets[id_trial], max_trinkets - ); - font::print(PR_RTL_XFLIP, label_len+48, 65+sp*2, buffer, tr, tg, tb); - font::print(PR_RTL_XFLIP, label_len+48, 65+sp*3, help.String(game.bestlives[id_trial]), tr, tg, tb); - - - const char* str_par_time = loc::gettext("PAR TIME"); - const std::string par_time = game.timetstring(par); - const char* str_best_rank = loc::gettext("BEST RANK"); - const char* rank; - switch(game.bestrank[id_trial]) + graphics.bigprint( -1, 30, "Space Station 1", tr, tg, tb, true); + if (game.besttimes[0] == -1) { - case 0: - rank = loc::gettext("B"); - break; - case 1: - rank = loc::gettext("A"); - break; - case 2: - rank = loc::gettext("S"); - break; - case 3: - rank = loc::gettext("V"); - break; - default: - rank = "?"; - } - - int w[4] = { - font::len(0, str_par_time), - font::len(0, par_time.c_str()), - font::len(0, str_best_rank), - font::len(PR_2X, rank) - }; - int longest_w = 0; - for (size_t i = 0; i < 4; i++) - { - if (w[i] > longest_w) - { - longest_w = w[i]; - } - } - int center_x = 288 - longest_w/2; - - font::print(PR_CEN | PR_RTL_XFLIP, center_x, 65, str_par_time, tr, tg, tb); - font::print(PR_CEN | PR_RTL_XFLIP, center_x, 65+sp, par_time, tr, tg, tb); - font::print(PR_CEN | PR_RTL_XFLIP, center_x, 65+sp*3, str_best_rank, tr, tg, tb); - font::print( - PR_2X | PR_CEN | PR_RTL_XFLIP, - center_x, - 66+sp*4, - rank, - 225, 225, 225 - ); - } - } - - break; - } - case Menu::gamecompletecontinue: - font::print(PR_2X | PR_CEN | PR_CJK_HIGH, -1, 25, loc::gettext("Congratulations!"), tr, tg, tb); - - font::print_wrap(PR_CEN, -1, 45, loc::gettext("Your save files have been updated."), tr, tg, tb); - - font::print_wrap(PR_CEN, -1, 110, loc::gettext("If you want to keep exploring the game, select CONTINUE from the play menu."), tr, tg, tb); - break; - case Menu::unlockmenu: - font::print(PR_2X | PR_CEN, -1, 30, loc::gettext("Unlock Play Modes"), tr, tg, tb); - - font::print_wrap(PR_CEN, -1, 65, loc::gettext("From here, you may unlock parts of the game that are normally unlocked as you play."), tr, tg, tb); - break; - case Menu::unlocktimetrial: - font::print(PR_2X | PR_CEN, -1, 45, loc::gettext("Congratulations!"), tr, tg, tb); - - font::print_wrap(PR_CEN, -1, 125, loc::gettext("You have unlocked a new Time Trial."), tr, tg, tb); - break; - case Menu::unlocktimetrials: - font::print(PR_2X | PR_CEN, -1, 45, loc::gettext("Congratulations!"), tr, tg, tb); - - font::print_wrap(PR_CEN, -1, 125, loc::gettext("You have unlocked some new Time Trials."), tr, tg, tb); - break; - case Menu::unlocknodeathmode: - font::print(PR_2X | PR_CEN, -1, 45, loc::gettext("Congratulations!"), tr, tg, tb); - - font::print_wrap(PR_CEN, -1, 125, loc::gettext("You have unlocked No Death Mode."), tr, tg, tb); - break; - case Menu::unlockflipmode: - font::print(PR_2X | PR_CEN, -1, 45, loc::gettext("Congratulations!"), tr, tg, tb); - - font::print_wrap(PR_CEN, -1, 125, loc::gettext("You have unlocked Flip Mode."), tr, tg, tb); - break; - case Menu::unlockintermission: - font::print(PR_2X | PR_CEN, -1, 45, loc::gettext("Congratulations!"), tr, tg, tb); - - font::print_wrap(PR_CEN, -1, 125, loc::gettext("You have unlocked the intermission levels."), tr, tg, tb); - break; - case Menu::playerworlds: - if (game.editor_disabled) - { - if (game.currentmenuoption == 1) - { - if (SDL_GetHintBoolean("SteamDeck", SDL_FALSE)) - { - font::print_wrap(PR_CEN, -1, 180, loc::gettext("The level editor is not currently supported on Steam Deck, as it requires a keyboard and mouse to use."), tr, tg, tb); + graphics.Print( -1, 75, "Not yet attempted", tr, tg, tb, true); } else { - font::print_wrap(PR_CEN, -1, 180, loc::gettext("The level editor is not currently supported on this device, as it requires a keyboard and mouse to use."), tr, tg, tb); + graphics.Print( 16, 65, "BEST TIME ", tr, tg, tb); + graphics.Print( 16, 75, "BEST SHINY ", tr, tg, tb); + graphics.Print( 16, 85, "BEST LIVES ", tr, tg, tb); + graphics.Print( 110, 65, game.timetstring(game.besttimes[0]), tr, tg, tb); + graphics.Print( 110, 75, help.String(game.besttrinkets[0])+"/2", tr, tg, tb); + graphics.Print( 110, 85,help.String(game.bestlives[0]), tr, tg, tb); + + + graphics.Print( 170, 65, "PAR TIME 1:15", tr, tg, tb); + graphics.Print( 170, 85, "Best Rank", tr, tg, tb); + switch(game.bestrank[0]) + { + case 0: + graphics.bigprint( 275, 82, "B", 225, 225, 225); + break; + case 1: + graphics.bigprint( 275, 82, "A", 225, 225, 225); + break; + case 2: + graphics.bigprint( 275, 82, "S", 225, 225, 225); + break; + case 3: + graphics.bigprint( 275, 82, "V", 225, 225, 225); + break; + } } + } - } - else - { - font::print_wrap(PR_CEN, -1, 180, loc::gettext("To install new player levels, copy the .vvvvvv files to the levels folder."), tr, tg, tb); + else + { + graphics.bigprint( -1, 30, "???", tr, tg, tb, true); + graphics.Print( -1, 60, "TO UNLOCK:", tr, tg, tb, true); + graphics.Print( -1, 75, "Rescue Violet", tr, tg, tb, true); + graphics.Print( -1, 85, "Find three trinkets", tr, tg, tb, true); + } + break; + case 1: + if(game.unlock[10]) + { + graphics.bigprint( -1, 30, "The Laboratory", tr, tg, tb, true); + if (game.besttimes[1] == -1) + { + graphics.Print( -1, 75, "Not yet attempted", tr, tg, tb, true); + } + else + { + graphics.Print( 16, 65, "BEST TIME ", tr, tg, tb); + graphics.Print( 16, 75, "BEST SHINY ", tr, tg, tb); + graphics.Print( 16, 85, "BEST LIVES ", tr, tg, tb); + graphics.Print( 110, 65, game.timetstring(game.besttimes[1]), tr, tg, tb); + graphics.Print( 110, 75, help.String(game.besttrinkets[1])+"/4", tr, tg, tb); + graphics.Print( 110, 85, help.String(game.bestlives[1]), tr, tg, tb); + + + graphics.Print( 170, 65, "PAR TIME 2:45", tr, tg, tb); + graphics.Print( 170, 85, "Best Rank", tr, tg, tb); + switch(game.bestrank[1]) + { + case 0: + graphics.bigprint( 275, 82, "B", 225, 225, 225); + break; + case 1: + graphics.bigprint( 275, 82, "A", 225, 225, 225); + break; + case 2: + graphics.bigprint( 275, 82, "S", 225, 225, 225); + break; + case 3: + graphics.bigprint( 275, 82, "V", 225, 225, 225); + break; + } + } + + } + else + { + graphics.bigprint( -1, 30, "???", tr, tg, tb, true); + graphics.Print( -1, 60, "TO UNLOCK:", tr, tg, tb, true); + graphics.Print( -1, 75, "Rescue Victoria", tr, tg, tb, true); + graphics.Print( -1, 85, "Find six trinkets", tr, tg, tb, true); + } + break; + case 2: + if(game.unlock[11]) + { + graphics.bigprint( -1, 30, "The Tower", tr, tg, tb, true); + if (game.besttimes[2] == -1) + { + graphics.Print( -1, 75, "Not yet attempted", tr, tg, tb, true); + } + else + { + graphics.Print( 16, 65, "BEST TIME ", tr, tg, tb); + graphics.Print( 16, 75, "BEST SHINY ", tr, tg, tb); + graphics.Print( 16, 85, "BEST LIVES ", tr, tg, tb); + graphics.Print( 110, 65, game.timetstring(game.besttimes[2]), tr, tg, tb); + graphics.Print( 110, 75, help.String(game.besttrinkets[2])+"/2", tr, tg, tb); + graphics.Print( 110, 85, help.String(game.bestlives[2]), tr, tg, tb); + + + graphics.Print( 170, 65, "PAR TIME 1:45", tr, tg, tb); + graphics.Print( 170, 85, "Best Rank", tr, tg, tb); + switch(game.bestrank[2]) + { + case 0: + graphics.bigprint( 275, 82, "B", 225, 225, 225); + break; + case 1: + graphics.bigprint( 275, 82, "A", 225, 225, 225); + break; + case 2: + graphics.bigprint( 275, 82, "S", 225, 225, 225); + break; + case 3: + graphics.bigprint( 275, 82, "V", 225, 225, 225); + break; + } + } + + } + else + { + graphics.bigprint( -1, 30, "???", tr, tg, tb, true); + graphics.Print( -1, 60, "TO UNLOCK:", tr, tg, tb, true); + graphics.Print( -1, 75, "Rescue Vermilion", tr, tg, tb, true); + graphics.Print( -1, 85, "Find nine trinkets", tr, tg, tb, true); + } + break; + case 3: + if(game.unlock[12]) + { + graphics.bigprint( -1, 30, "Space Station 2", tr, tg, tb, true); + if (game.besttimes[3] == -1) + { + graphics.Print( -1, 75, "Not yet attempted", tr, tg, tb, true); + } + else + { + graphics.Print( 16, 65, "BEST TIME ", tr, tg, tb); + graphics.Print( 16, 75, "BEST SHINY ", tr, tg, tb); + graphics.Print( 16, 85, "BEST LIVES ", tr, tg, tb); + graphics.Print( 110, 65, game.timetstring(game.besttimes[3]), tr, tg, tb); + graphics.Print( 110, 75, help.String(game.besttrinkets[3])+"/5", tr, tg, tb); + graphics.Print( 110, 85, help.String(game.bestlives[3]), tr, tg, tb); + + + graphics.Print( 170, 65, "PAR TIME 3:20", tr, tg, tb); + graphics.Print( 170, 85, "Best Rank", tr, tg, tb); + switch(game.bestrank[3]) + { + case 0: + graphics.bigprint( 275, 82, "B", 225, 225, 225); + break; + case 1: + graphics.bigprint( 275, 82, "A", 225, 225, 225); + break; + case 2: + graphics.bigprint( 275, 82, "S", 225, 225, 225); + break; + case 3: + graphics.bigprint( 275, 82, "V", 225, 225, 225); + break; + } + } + + } + else + { + graphics.bigprint( -1, 30, "???", tr, tg, tb, true); + graphics.Print( -1, 60, "TO UNLOCK:", tr, tg, tb, true); + graphics.Print( -1, 75, "Rescue Vitellary", tr, tg, tb, true); + graphics.Print( -1, 85, "Find twelve trinkets", tr, tg, tb, true); + } + break; + case 4: + if(game.unlock[13]) + { + graphics.bigprint( -1, 30, "The Warp Zone", tr, tg, tb, true); + if (game.besttimes[4] == -1) + { + graphics.Print( -1, 75, "Not yet attempted", tr, tg, tb, true); + } + else + { + graphics.Print( 16, 65, "BEST TIME ", tr, tg, tb); + graphics.Print( 16, 75, "BEST SHINY ", tr, tg, tb); + graphics.Print( 16, 85, "BEST LIVES ", tr, tg, tb); + graphics.Print( 110, 65, game.timetstring(game.besttimes[4]), tr, tg, tb); + graphics.Print( 110, 75, help.String(game.besttrinkets[4])+"/1", tr, tg, tb); + graphics.Print( 110, 85, help.String(game.bestlives[4]), tr, tg, tb); + + + graphics.Print( 170, 65, "PAR TIME 2:00", tr, tg, tb); + graphics.Print( 170, 85, "Best Rank", tr, tg, tb); + switch(game.bestrank[4]) + { + case 0: + graphics.bigprint( 275, 82, "B", 225, 225, 225); + break; + case 1: + graphics.bigprint( 275, 82, "A", 225, 225, 225); + break; + case 2: + graphics.bigprint( 275, 82, "S", 225, 225, 225); + break; + case 3: + graphics.bigprint( 275, 82, "V", 225, 225, 225); + break; + } + } + + } + else + { + graphics.bigprint( -1, 30, "???", tr, tg, tb, true); + graphics.Print( -1, 60, "TO UNLOCK:", tr, tg, tb, true); + graphics.Print( -1, 75, "Rescue Verdigris", tr, tg, tb, true); + graphics.Print( -1, 85, "Find fifteen trinkets", tr, tg, tb, true); + } + break; + case 5: + if(game.unlock[14]) + { + graphics.bigprint( -1, 30, "The Final Level", tr, tg, tb, true); + if (game.besttimes[5] == -1) + { + graphics.Print( -1, 75, "Not yet attempted", tr, tg, tb, true); + } + else + { + graphics.Print( 16, 65, "BEST TIME ", tr, tg, tb); + graphics.Print( 16, 75, "BEST SHINY ", tr, tg, tb); + graphics.Print( 16, 85, "BEST LIVES ", tr, tg, tb); + graphics.Print( 110, 65, game.timetstring(game.besttimes[5]), tr, tg, tb); + graphics.Print( 110, 75, help.String(game.besttrinkets[5])+"/1", tr, tg, tb); + graphics.Print( 110, 85, help.String(game.bestlives[5]), tr, tg, tb); + + + graphics.Print( 170, 65, "PAR TIME 2:15", tr, tg, tb); + graphics.Print( 170, 85, "Best Rank", tr, tg, tb); + switch(game.bestrank[5]) + { + case 0: + graphics.bigprint( 275, 82, "B", 225, 225, 225); + break; + case 1: + graphics.bigprint( 275, 82, "A", 225, 225, 225); + break; + case 2: + graphics.bigprint( 275, 82, "S", 225, 225, 225); + break; + case 3: + graphics.bigprint( 275, 82, "V", 225, 225, 225); + break; + } + } + + } + else + { + graphics.bigprint( -1, 30, "???", tr, tg, tb, true); + graphics.Print( -1, 60, "TO UNLOCK:", tr, tg, tb, true); + graphics.Print( -1, 75, "Complete the game", tr, tg, tb, true); + graphics.Print( -1, 85, "Find eighteen trinkets", tr, tg, tb, true); + } + break; } break; - case Menu::confirmshowlevelspath: - font::print_wrap(PR_CEN, -1, 80, loc::gettext("Are you sure you want to show the levels path? This may reveal sensitive information if you are streaming."), tr, tg, tb); + case Menu::gamecompletecontinue: + graphics.bigprint( -1, 25, "Congratulations!", tr, tg, tb, true, 2); + + graphics.Print( -1, 45, "Your save files have been updated.", tr, tg, tb, true); + + graphics.Print( -1, 110, "If you want to keep exploring", tr, tg, tb, true); + graphics.Print( -1, 120, "the game, select CONTINUE", tr, tg, tb, true); + graphics.Print( -1, 130, "from the play menu.", tr, tg, tb, true); break; - case Menu::showlevelspath: + case Menu::unlockmenu: + graphics.bigprint( -1, 30, "Unlock Play Modes", tr, tg, tb, true, 2); + + graphics.Print( -1, 65, "From here, you may unlock parts", tr, tg, tb, true); + graphics.Print( -1, 75, "of the game that are normally", tr, tg, tb, true); + graphics.Print( -1, 85, "unlocked as you play.", tr, tg, tb, true); + break; + case Menu::unlocktimetrial: + graphics.bigprint( -1, 45, "Congratulations!", tr, tg, tb, true, 2); + + graphics.Print( -1, 125, "You have unlocked", tr, tg, tb, true); + graphics.Print( -1, 135, "a new Time Trial.", tr, tg, tb, true); + break; + case Menu::unlocktimetrials: + graphics.bigprint( -1, 45, "Congratulations!", tr, tg, tb, true, 2); + + graphics.Print( -1, 125, "You have unlocked some", tr, tg, tb, true); + graphics.Print( -1, 135, "new Time Trials.", tr, tg, tb, true); + break; + case Menu::unlocknodeathmode: + graphics.bigprint( -1, 45, "Congratulations!", tr, tg, tb, true, 2); + + graphics.Print( -1, 125, "You have unlocked", tr, tg, tb, true); + graphics.Print( -1, 135, "No Death Mode.", tr, tg, tb, true); + break; + case Menu::unlockflipmode: + graphics.bigprint( -1, 45, "Congratulations!", tr, tg, tb, true, 2); + + graphics.Print( -1, 125, "You have unlocked", tr, tg, tb, true); + graphics.Print( -1, 135, "Flip Mode.", tr, tg, tb, true); + break; + case Menu::unlockintermission: + graphics.bigprint( -1, 45, "Congratulations!", tr, tg, tb, true, 2); + + graphics.Print( -1, 125, "You have unlocked", tr, tg, tb, true); + graphics.Print( -1, 135, "the intermission levels.", tr, tg, tb, true); + break; + case Menu::playerworlds: { - int next_y = font::print_wrap(PR_CEN, -1, 40, loc::gettext("The levels path is:"), tr, tg, tb); - font::print_wrap(0, 0, next_y, FILESYSTEM_getUserLevelDirectory(), tr, tg, tb, 10, 320); + std::string tempstring = FILESYSTEM_getUserLevelDirectory(); + if(tempstring.length()>80){ + graphics.Print( -1, 160, "To install new player levels, copy", tr, tg, tb, true); + graphics.Print( -1, 170, "the .vvvvvv files to this folder:", tr, tg, tb, true); + graphics.Print( 320-((tempstring.length()-80)*8), 190, tempstring.substr(0,tempstring.length()-80), tr, tg, tb); + graphics.Print( 0, 200, tempstring.substr(tempstring.length()-80,40), tr, tg, tb); + graphics.Print( 0, 210, tempstring.substr(tempstring.length()-40,40), tr, tg, tb); + }else if(tempstring.length()>40){ + graphics.Print( -1, 170, "To install new player levels, copy", tr, tg, tb, true); + graphics.Print( -1, 180, "the .vvvvvv files to this folder:", tr, tg, tb, true); + graphics.Print( 320-((tempstring.length()-40)*8), 200, tempstring.substr(0,tempstring.length()-40), tr, tg, tb); + graphics.Print( 0, 210, tempstring.substr(tempstring.length()-40,40), tr, tg, tb); + }else{ + graphics.Print( -1, 180, "To install new player levels, copy", tr, tg, tb, true); + graphics.Print( -1, 190, "the .vvvvvv files to this folder:", tr, tg, tb, true); + graphics.Print( 320-(tempstring.length()*8), 210, tempstring, tr, tg, tb); + } break; } case Menu::errorsavingsettings: - font::print_wrap(PR_CEN, -1, 95, loc::gettext("ERROR: Could not save settings file!"), tr, tg, tb); + graphics.Print( -1, 95, "ERROR: Could not save settings file!", tr, tg, tb, true); break; case Menu::errorloadinglevel: { - const char* message; + const char* str; if (FILESYSTEM_levelDirHasError()) { - message = FILESYSTEM_getLevelDirError(); + str = FILESYSTEM_getLevelDirError(); } else { - message = loc::gettext("Something went wrong, but we forgot the error message."); + str = graphics.error; } - font::print(PR_2X | PR_CEN | PR_CJK_HIGH, -1, 45, loc::gettext("ERROR"), tr, tg, tb); - font::print_wrap(PR_CEN, -1, 65, message, tr, tg, tb); + graphics.bigprint(-1, 45, "ERROR", tr, tg, tb, true); + graphics.PrintWrap(-1, 65, str, tr, tg, tb, true, 10, 304); break; } case Menu::warninglevellist: - { - const char* message; - if (FILESYSTEM_levelDirHasError()) - { - message = FILESYSTEM_getLevelDirError(); - } - else - { - message = loc::gettext("Something went wrong, but we forgot the error message."); - } - font::print(PR_2X | PR_CEN | PR_CJK_HIGH, -1, 45, loc::gettext("WARNING"), tr, tg, tb); - font::print_wrap(PR_CEN, -1, 65, message, tr, tg, tb); + graphics.bigprint(-1, 45, "WARNING", tr, tg, tb, true); + graphics.PrintWrap(-1, 65, FILESYSTEM_getLevelDirError(), tr, tg, tb, true, 10, 304); break; - } default: break; } @@ -1937,7 +1436,9 @@ static void menurender(void) void titlerender(void) { - graphics.clear(); + + ClearSurface(graphics.backBuffer); + if (!game.menustart) { tr = graphics.col_tr; @@ -1945,28 +1446,18 @@ void titlerender(void) tb = graphics.col_tb; int temp = 50; - graphics.draw_sprite((160 - 96) + 0 * 32, temp, 23, tr, tg, tb); - graphics.draw_sprite((160 - 96) + 1 * 32, temp, 23, tr, tg, tb); - graphics.draw_sprite((160 - 96) + 2 * 32, temp, 23, tr, tg, tb); - graphics.draw_sprite((160 - 96) + 3 * 32, temp, 23, tr, tg, tb); - graphics.draw_sprite((160 - 96) + 4 * 32, temp, 23, tr, tg, tb); - graphics.draw_sprite((160 - 96) + 5 * 32, temp, 23, tr, tg, tb); + graphics.drawsprite((160 - 96) + 0 * 32, temp, 23, tr, tg, tb); + graphics.drawsprite((160 - 96) + 1 * 32, temp, 23, tr, tg, tb); + graphics.drawsprite((160 - 96) + 2 * 32, temp, 23, tr, tg, tb); + graphics.drawsprite((160 - 96) + 3 * 32, temp, 23, tr, tg, tb); + graphics.drawsprite((160 - 96) + 4 * 32, temp, 23, tr, tg, tb); + graphics.drawsprite((160 - 96) + 5 * 32, temp, 23, tr, tg, tb); #if defined(MAKEANDPLAY) - font::print(PR_RIGHT, 264, temp+35, loc::gettext("MAKE AND PLAY EDITION"), tr, tg, tb); + graphics.Print(-1,temp+35," MAKE AND PLAY EDITION",tr, tg, tb, true); #endif - char buffer[SCREEN_WIDTH_CHARS*2 + 1]; - vformat_buf( - buffer, sizeof(buffer), - loc::gettext("[ Press {button} to Start ]"), - "button:but", - vformat_button(ActionSet_Menu, Action_Menu_Accept) - ); - font::print_wrap(PR_CEN, -1, 175, buffer, tr, tg, tb); - if (BUTTONGLYPHS_keyboard_is_active()) - { - font::print_wrap(PR_CEN, -1, 195, loc::gettext("ACTION = Space, Z, or V"), int(tr*0.5f), int(tg*0.5f), int(tb*0.5f)); - } + graphics.Print(5, 175, "[ Press ACTION to Start ]", tr, tg, tb, true); + graphics.Print(5, 195, "ACTION = Space, Z, or V", int(tr*0.5f), int(tg*0.5f), int(tb*0.5f), true); } else { @@ -1987,7 +1478,7 @@ void titlerender(void) if(tg>255) tg=255; if (tb < 0) tb = 0; if(tb>255) tb=255; - graphics.drawmenu(tr, tg, tb, game.currentmenuname); + graphics.drawmenu(tr, tg, tb, game.currentmenuname == Menu::levellist); } graphics.drawfade(); @@ -1997,7 +1488,7 @@ void titlerender(void) void gamecompleterender(void) { - graphics.clear(); + ClearSurface(graphics.backBuffer); if(!game.colourblindmode) graphics.drawtowerbackground(graphics.titlebg); @@ -2012,233 +1503,129 @@ void gamecompleterender(void) if (graphics.onscreen(220 + position)) { int temp = 220 + position; - graphics.draw_sprite((160 - 96) + 0 * 32, temp, 23, tr, tg, tb); - graphics.draw_sprite((160 - 96) + 1 * 32, temp, 23, tr, tg, tb); - graphics.draw_sprite((160 - 96) + 2 * 32, temp, 23, tr, tg, tb); - graphics.draw_sprite((160 - 96) + 3 * 32, temp, 23, tr, tg, tb); - graphics.draw_sprite((160 - 96) + 4 * 32, temp, 23, tr, tg, tb); - graphics.draw_sprite((160 - 96) + 5 * 32, temp, 23, tr, tg, tb); + graphics.drawsprite((160 - 96) + 0 * 32, temp, 23, tr, tg, tb); + graphics.drawsprite((160 - 96) + 1 * 32, temp, 23, tr, tg, tb); + graphics.drawsprite((160 - 96) + 2 * 32, temp, 23, tr, tg, tb); + graphics.drawsprite((160 - 96) + 3 * 32, temp, 23, tr, tg, tb); + graphics.drawsprite((160 - 96) + 4 * 32, temp, 23, tr, tg, tb); + graphics.drawsprite((160 - 96) + 5 * 32, temp, 23, tr, tg, tb); } - if (graphics.onscreen(290 + position)) font::print(PR_2X | PR_CEN, -1, 290 + position, loc::gettext("Starring"), tr, tg, tb); + if (graphics.onscreen(290 + position)) graphics.bigprint( -1, 290 + position, "Starring", tr, tg, tb, true, 2); if (graphics.onscreen(320 + position)) { graphics.drawcrewman(70, 320 + position, 0, true); - font::print(0, 100, 330 + position, loc::gettext("Captain Viridian"), tr, tg, tb); + graphics.Print(100, 330 + position, "Captain Viridian", tr, tg, tb); } if (graphics.onscreen(350 + position)) { graphics.drawcrewman(70, 350 + position, 1, true); - font::print(0, 100, 360 + position, loc::gettext("Doctor Violet"), tr, tg, tb); + graphics.Print(100, 360 + position, "Doctor Violet", tr, tg, tb); } if (graphics.onscreen(380 + position)) { graphics.drawcrewman(70, 380 + position, 2, true); - font::print(0, 100, 390 + position, loc::gettext("Professor Vitellary"), tr, tg, tb); + graphics.Print(100, 390 + position, "Professor Vitellary", tr, tg, tb); } if (graphics.onscreen(410 + position)) { graphics.drawcrewman(70, 410 + position, 3, true); - font::print(0, 100, 420 + position, loc::gettext("Officer Vermilion"), tr, tg, tb); + graphics.Print(100, 420 + position, "Officer Vermilion", tr, tg, tb); } if (graphics.onscreen(440 + position)) { graphics.drawcrewman(70, 440 + position, 4, true); - font::print(0, 100, 450 + position, loc::gettext("Chief Verdigris"), tr, tg, tb); + graphics.Print(100, 450 + position, "Chief Verdigris", tr, tg, tb); } if (graphics.onscreen(470 + position)) { graphics.drawcrewman(70, 470 + position, 5, true); - font::print(0, 100, 480 + position, loc::gettext("Doctor Victoria"), tr, tg, tb); + graphics.Print(100, 480 + position, "Doctor Victoria", tr, tg, tb); } - if (graphics.onscreen(520 + position)) - { - uint32_t flag = PR_3X; - const char* text = loc::gettext("Credits"); - if (font::len(flag, text) > SCREEN_WIDTH_PIXELS) - { - flag = PR_2X; - } - font::print(flag | PR_CEN, -1, 520 + position, text, tr, tg, tb); - } + if (graphics.onscreen(520 + position)) graphics.bigprint( -1, 520 + position, "Credits", tr, tg, tb, true, 3); if (graphics.onscreen(560 + position)) { - font::print(PR_CJK_HIGH, 40, 560 + position, loc::gettext("Created by"), tr, tg, tb); - font::print(PR_2X | PR_FONT_8X8, 60, 570 + position, "Terry Cavanagh", tr, tg, tb); + graphics.Print(40, 560 + position, "Created by", tr, tg, tb); + graphics.bigprint(60, 570 + position, "Terry Cavanagh", tr, tg, tb); } if (graphics.onscreen(600 + position)) { - font::print(PR_CJK_HIGH, 40, 600 + position, loc::gettext("With Music by"), tr, tg, tb); - font::print(PR_2X | PR_FONT_8X8, 60, 610 + position, "Magnus Pålsson", tr, tg, tb); + graphics.Print(40, 600 + position, "With Music by", tr, tg, tb); + graphics.bigprint(60, 610 + position, "Magnus P~lsson", tr, tg, tb); } if (graphics.onscreen(640 + position)) { - font::print(PR_CJK_HIGH, 40, 640 + position, loc::gettext("Rooms Named by"), tr, tg, tb); - font::print(PR_2X | PR_FONT_8X8, 60, 650 + position, "Bennett Foddy", tr, tg, tb); + graphics.Print(40, 640 + position, "Rooms Named by", tr, tg, tb); + graphics.bigprint(60, 650 + position, "Bennett Foddy", tr, tg, tb); } - if (graphics.onscreen(710 + position)) + if (graphics.onscreen(680 + position)) { - font::print(PR_CJK_HIGH, 40, 680 + position, loc::gettext("C++ Port by"), tr, tg, tb); - font::print(PR_2X | PR_FONT_8X8, 60, 690 + position, "Simon Roth", tr, tg, tb); - font::print(PR_2X | PR_FONT_8X8, 60, 710 + position, "Ethan Lee", tr, tg, tb); - font::print(PR_2X | PR_FONT_8X8, 60, 730 + position, "Misa Kai", tr, tg, tb); + graphics.Print(40, 680 + position, "C++ Port by", tr, tg, tb); + graphics.bigprint(60, 690 + position, "Simon Roth", tr, tg, tb); + graphics.bigprint(60, 710 + position, "Ethan Lee", tr, tg, tb); } - if (graphics.onscreen(770 + position)) + if (graphics.onscreen(740 + position)) { - font::print(PR_CJK_HIGH, 40, 760 + position, loc::gettext("Beta Testing by"), tr, tg, tb); - font::print(PR_2X | PR_FONT_8X8, 60, 770 + position, "Sam Kaplan", tr, tg, tb); - font::print(PR_2X | PR_FONT_8X8, 60, 790 + position, "Pauli Kohberger", tr, tg, tb); + graphics.Print(40, 740 + position, "Beta Testing by", tr, tg, tb); + graphics.bigprint(60, 750 + position, "Sam Kaplan", tr, tg, tb); + graphics.bigprint(60, 770 + position, "Pauli Kohberger", tr, tg, tb); } - if (graphics.onscreen(820 + position)) + if (graphics.onscreen(800 + position)) { - font::print(PR_CJK_HIGH, 40, 820 + position, loc::gettext("Ending Picture by"), tr, tg, tb); - font::print(PR_2X | PR_FONT_8X8, 60, 830 + position, "Pauli Kohberger", tr, tg, tb); + graphics.Print(40, 800 + position, "Ending Picture by", tr, tg, tb); + graphics.bigprint(60, 810 + position, "Pauli Kohberger", tr, tg, tb); } - int creditOffset = 890; + if (graphics.onscreen(890 + position)) graphics.bigprint( -1, 870 + position, "Patrons", tr, tg, tb, true, 3); - if (graphics.onscreen(creditOffset + position)) - { - font::print(PR_2X | PR_CJK_HIGH | PR_CEN, -1, creditOffset + position, loc::gettext("Localisation"), tr, tg, tb); - } - creditOffset += 30; - - if (graphics.onscreen(creditOffset + position)) - { - const char* text = loc::gettext("Localisation Project Led by"); - int x = SCREEN_WIDTH_PIXELS - font::len(0, text); - x = SDL_min(x, 40); - font::print(PR_CJK_HIGH, x, creditOffset + position, text, tr, tg, tb); - font::print(PR_2X | PR_FONT_8X8, 60, creditOffset + position + 10, "Dav999", tr, tg, tb); - } - creditOffset += 40; - if (graphics.onscreen(creditOffset + position)) - { - const char* text = loc::gettext("Pan-European Font Design by"); - int x = SCREEN_WIDTH_PIXELS - font::len(0, text); - x = SDL_min(x, 40); - font::print(PR_CJK_HIGH, x, creditOffset + position, text, tr, tg, tb); - font::print(PR_2X | PR_FONT_8X8, 60, creditOffset + position + 10, "Reese Rivers", tr, tg, tb); - } - creditOffset += 40; - if (graphics.onscreen(creditOffset + position)) - { - const char* text = loc::gettext("With contributions on GitHub from"); - int x = SCREEN_WIDTH_PIXELS - font::len(0, text); - x = SDL_min(x, 40); - font::print(PR_CJK_HIGH, x, creditOffset + position, text, tr, tg, tb); - font::print(PR_2X | PR_FONT_8X8, 60, creditOffset + position + 10, "Alexandra Fox", tr, tg, tb); - font::print(PR_2X | PR_FONT_8X8, 60, creditOffset + position + 30, "mothbeanie", tr, tg, tb); - } - creditOffset += 100; - if (graphics.onscreen(creditOffset + position)) - { - font::print(PR_2X | PR_CJK_HIGH | PR_CEN, -1, creditOffset + position, loc::gettext("Translators"), tr, tg, tb); - } - creditOffset += 40; - for (size_t i = 0; i < SDL_arraysize(Credits::translators); i += 1) - { - if (graphics.onscreen(creditOffset + position)) - { - if (Credits::translators[i][0] == '>') - { - // Category heading, remove the > character and translate the rest - font::print(0, 76, creditOffset + position, loc::gettext(&Credits::translators[i][1]), tr, tg, tb); - } - else if (Credits::translators[i][0] != ' ') - { - // Not prefixed with a space, so this line is the name of a language, display its localised string - font::print(0, 60, creditOffset + position, loc::gettext(Credits::translators[i]), tr, tg, tb); - } - else - { - // Otherwise, this line is the name of a translator, indent it and display with the original 8x8 font always - font::print(PR_FONT_8X8, 72, creditOffset + position, Credits::translators[i], tr, tg, tb); - } - } - creditOffset += 12; - } - - creditOffset += 40; - - if (graphics.onscreen(creditOffset + position)) - { - font::print(PR_3X | PR_CEN, -1, creditOffset + position, loc::gettext("Patrons"), tr, tg, tb); - } - - creditOffset += 50; + int creditOffset = 930; for (size_t i = 0; i < SDL_arraysize(Credits::superpatrons); i += 1) { if (graphics.onscreen(creditOffset + position)) { - font::print(PR_CEN | PR_FONT_8X8, -1, creditOffset + position, Credits::superpatrons[i], tr, tg, tb); + graphics.Print(-1, creditOffset + position, Credits::superpatrons[i], tr, tg, tb, true); } creditOffset += 10; } creditOffset += 10; - if (graphics.onscreen(creditOffset + position)) - { - font::print(PR_CEN, -1, creditOffset + position, loc::gettext("and"), tr, tg, tb); - } + if (graphics.onscreen(creditOffset + position)) graphics.Print( -1, creditOffset + position, "and", tr, tg, tb, true); creditOffset += 20; for (size_t i = 0; i < SDL_arraysize(Credits::patrons); i += 1) { if (graphics.onscreen(creditOffset + position)) { - font::print(PR_CEN | PR_FONT_8X8, -1, creditOffset + position, Credits::patrons[i], tr, tg, tb); + graphics.Print(-1, creditOffset + position, Credits::patrons[i], tr, tg, tb, true); } creditOffset += 10; } creditOffset += 20; - if (graphics.onscreen(creditOffset + position)) - { - font::print(PR_2X | PR_CEN, -1, creditOffset + position, loc::gettext("GitHub Contributors"), tr, tg, tb); - } + if (graphics.onscreen(creditOffset + position)) graphics.bigprint(40, creditOffset + position, "GitHub Contributors", tr, tg, tb, true); creditOffset += 30; for (size_t i = 0; i < SDL_arraysize(Credits::githubfriends); i += 1) { if (graphics.onscreen(creditOffset + position)) { - font::print(PR_CEN | PR_FONT_8X8, -1, creditOffset + position, Credits::githubfriends[i], tr, tg, tb); + graphics.Print(-1, creditOffset + position, Credits::githubfriends[i], tr, tg, tb, true); } creditOffset += 10; } creditOffset += 140; - if (graphics.onscreen(creditOffset + position)) - { - const char* line1; - const char* line2; - if (graphics.flipmode) - { - line1 = loc::gettext("playing!"); - line2 = loc::gettext("Thanks for"); - } - else - { - line1 = loc::gettext("Thanks for"); - line2 = loc::gettext("playing!"); - } - font::print(PR_2X | PR_CEN | PR_CJK_HIGH, -1, creditOffset + position, line1, tr, tg, tb); - creditOffset += 20; - font::print(PR_2X | PR_CEN | PR_CJK_LOW, -1, creditOffset + position, line2, tr, tg, tb); - } - - draw_skip_message(); + if (graphics.onscreen(creditOffset + position)) graphics.bigprint( -1, creditOffset + position, "Thanks for playing!", tr, tg, tb, true, 2); graphics.drawfade(); @@ -2247,9 +1634,9 @@ void gamecompleterender(void) void gamecompleterender2(void) { - graphics.clear(); + ClearSurface(graphics.backBuffer); - graphics.drawimage(IMAGE_ENDING, 0, 0); + graphics.drawimage(10, 0, 0); for (int j = 0; j < 30; j++) { @@ -2259,20 +1646,18 @@ void gamecompleterender2(void) { if (i > game.creditposx) { - graphics.fill_rect(i * 8, j * 8, 8, 8, 0, 0, 0); + FillRect(graphics.backBuffer, i * 8, j * 8, 8, 8, 0, 0, 0); } } if (j > game.creditposy) { - graphics.fill_rect(i * 8, j * 8, 8, 8, 0, 0, 0); + FillRect(graphics.backBuffer, i * 8, j * 8, 8, 8, 0, 0, 0); } } } - graphics.fill_rect(graphics.lerp(game.oldcreditposx * 8, game.creditposx * 8) + 8, game.creditposy * 8, 8, 8, 0, 0, 0); - - draw_skip_message(); + FillRect(graphics.backBuffer, graphics.lerp(game.oldcreditposx * 8, game.creditposx * 8) + 8, game.creditposy * 8, 8, 8, 0, 0, 0); graphics.drawfade(); @@ -2284,109 +1669,38 @@ static const char* interact_prompt( const size_t buffer_size, const char* raw ) { - vformat_buf( - buffer, buffer_size, - raw, - "button:but", - vformat_button(ActionSet_InGame, Action_InGame_Interact) - ); + const char* string_fmt_loc = SDL_strstr(raw, "%s"); + const char* button; + + if (string_fmt_loc == NULL /* No "%s". */ + || string_fmt_loc != SDL_strchr(raw, '%') /* First "%" found is not "%s". */ + || SDL_strchr(&string_fmt_loc[1], '%') != NULL) /* Other "%" after "%s". */ + { + return raw; + } + + if (game.separate_interact) + { + button = "E"; + } + else + { + button = "ENTER"; + } + + SDL_snprintf(buffer, buffer_size, raw, button); return buffer; } -static void mode_indicator_text(const int alpha) -{ - const uint32_t flags = PR_BRIGHTNESS(alpha) | PR_BOR | PR_RTL_XFLIP; - const int r = 220 - help.glow; - const int g = 220 - help.glow; - const int b = 255 - help.glow/2; - const int x = 5; - const int spacing = font::height(flags) + 2; - int y = 5; - if (game.advancetext) - { - /* Prevent clashing */ - y = 20; - } - if ((game.act_fade > 5 || game.prev_act_fade > 5) && game.activity_y < 60) - { - /* Prevent clashing */ - y = game.activity_y + 37; - } - - /* FIXME: Some strings have not yet been translated. In order to not have - * English text in other languages, they are substituted with existing - * ones. Remove all substitute text when they're fully translated. */ - - if (map.invincibility) - { - const char* english = "Invincibility mode enabled"; - const char* text = loc::gettext(english); - if (loc::lang != "en" && SDL_strcmp(english, text) == 0) - { - /* Substitute text */ - text = loc::gettext("Invincibility"); - } - font::print(flags, x, y, text, r, g, b); - y += spacing; - } - - enum GlitchrunnerMode mode = GlitchrunnerMode_get(); - if (mode != GlitchrunnerNone) - { - char buffer[SCREEN_WIDTH_CHARS + 1]; - const char* english = "Glitchrunner mode enabled ({version})"; - const char* text = loc::gettext(english); - if (loc::lang != "en" && SDL_strcmp(english, text) == 0) - { - /* Substitute text */ - SDL_strlcpy(buffer, loc::gettext("Glitchrunner Mode"), sizeof(buffer)); - } - else - { - const char* mode_string = loc::gettext(GlitchrunnerMode_enum_to_string(mode)); - vformat_buf(buffer, sizeof(buffer), text, "version:str", mode_string); - } - font::print(flags, x, y, buffer, r, g, b); - y += spacing; - } - - if (graphics.flipmode) - { - const char* english = "Flip Mode enabled"; - const char* text = loc::gettext(english); - if (loc::lang != "en" && SDL_strcmp(english, text) == 0) - { - /* Substitute text */ - text = loc::gettext("Flip Mode"); - } - font::print(flags, x, y, text, r, g, b); - y += spacing; - } - - switch (game.slowdown) - { - case 24: - font::print(flags, x, y, loc::gettext("Game speed is at 80%"), r, g, b); - y += spacing; - break; - case 18: - font::print(flags, x, y, loc::gettext("Game speed is at 60%"), r, g, b); - y += spacing; - break; - case 12: - font::print(flags, x, y, loc::gettext("Game speed is at 40%"), r, g, b); - y += spacing; - } -} - void gamerender(void) { - graphics.set_render_target(graphics.gameplayTexture); - graphics.set_color(0, 0, 0, 255); + + if(!game.blackout) { + if (map.towermode) { if (!game.colourblindmode) @@ -2395,7 +1709,7 @@ void gamerender(void) } else { - graphics.clear(); + ClearSurface(graphics.backBuffer); } graphics.drawtowermap(); } @@ -2407,7 +1721,7 @@ void gamerender(void) } else { - graphics.clear(); + ClearSurface(graphics.backBuffer); } if ((map.finalmode || map.custommode) && map.final_colormode) { @@ -2427,65 +1741,30 @@ void gamerender(void) } } - int return_editor_alpha = 0; - bool draw_return_editor_text = false; - if (map.custommode && !map.custommodeforreal && !game.advancetext) + if (graphics.fademode==0 && !game.intimetrial && !game.isingamecompletescreen() && game.swngame != 1 && game.showingametimer) { - return_editor_alpha = graphics.lerp( - ed.old_return_message_timer, ed.return_message_timer - ); - draw_return_editor_text = return_editor_alpha > 100; + graphics.bprint(6, 6, "TIME:", 255,255,255); + graphics.bprint(46, 6, game.timestring(), 196, 196, 196); } - int mode_indicator_alpha = graphics.lerp( - game.old_mode_indicator_timer, game.mode_indicator_timer - ); - bool any_mode_active = map.invincibility - || GlitchrunnerMode_get() != GlitchrunnerNone - || graphics.flipmode - || game.slowdown < 30; - bool draw_mode_indicator_text = mode_indicator_alpha > 100 && any_mode_active; - - if (graphics.fademode == FADE_NONE - && !game.intimetrial - && !game.isingamecompletescreen() - && (!game.swnmode || game.swngame != SWN_SUPERGRAVITRON) - && game.showingametimer - && !roomname_translator::enabled - && (!game.swnmode || game.swngame != SWN_START_GRAVITRON_STEP_3) - && obj.trophytext <= 0 && obj.oldtrophytext <= 0 - && !draw_return_editor_text - && !draw_mode_indicator_text) + if(map.extrarow==0 || (map.custommode && map.roomname!="")) { - const char* tempstring = loc::gettext("TIME:"); - int label_len = font::len(0, tempstring); - font::print(PR_BOR | PR_RTL_XFLIP, 6, 6, tempstring, 255,255,255); - char buffer[SCREEN_WIDTH_CHARS + 1]; - game.timestringcenti(buffer, sizeof(buffer)); - font::print(PR_BOR | PR_RTL_XFLIP, 6+label_len, 6, buffer, 196,196,196); - } + graphics.footerrect.y = 230; + if (graphics.translucentroomname) + { + SDL_BlitSurface(graphics.footerbuffer, NULL, graphics.backBuffer, &graphics.footerrect); + } + else + { + FillRect(graphics.backBuffer, graphics.footerrect, 0); + } - bool force_roomname_hidden = false; - bool roomname_untranslated = false; - int roomname_r = 196, roomname_g = 196, roomname_b = 255 - help.glow; - if (roomname_translator::enabled) - { - roomname_translator::overlay_render( - &force_roomname_hidden, - &roomname_untranslated, - &roomname_r, &roomname_g, &roomname_b - ); - } - - if ((map.extrarow==0 || (map.custommode && map.roomname[0] != '\0')) && !force_roomname_hidden) - { - const char* roomname = loc::gettext_roomname(map.custommode, game.roomx, game.roomy, map.roomname, map.roomname_special); - - graphics.render_roomname( - roomname_untranslated ? PR_FONT_8X8 : PR_FONT_LEVEL, - roomname, - roomname_r, roomname_g, roomname_b - ); + if (map.finalmode) + { + graphics.bprint(5, 231, map.glitchname, 196, 196, 255 - help.glow, true); + }else{ + graphics.bprint(5, 231, map.roomname, 196, 196, 255 - help.glow, true); + } } if (map.roomtexton) @@ -2493,129 +1772,103 @@ void gamerender(void) //Draw room text! for (size_t i = 0; i < map.roomtext.size(); i++) { - graphics.print_roomtext(map.roomtext[i].x*8, map.roomtext[i].y*8, map.roomtext[i].text, map.roomtext[i].rtl); + graphics.Print(map.roomtext[i].x*8, (map.roomtext[i].y*8), map.roomtext[i].text, 196, 196, 255 - help.glow); } } - if (draw_return_editor_text) - { - char buffer[SCREEN_WIDTH_CHARS + 1]; - vformat_buf( - buffer, sizeof(buffer), - loc::gettext("[Press {button} to return to editor]"), - "button:but", - vformat_button(ActionSet_InGame, Action_InGame_Map) - ); - font::print( - PR_BRIGHTNESS(return_editor_alpha) | PR_BOR, - 5, 5, buffer, - 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2) - ); - } +#if !defined(NO_CUSTOM_LEVELS) + if(map.custommode && !map.custommodeforreal && !game.advancetext){ + //Return to level editor + int alpha = graphics.lerp(ed.oldreturneditoralpha, ed.returneditoralpha); + graphics.bprintalpha(5, 5, "[Press ENTER to return to editor]", 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2), alpha, false); + } +#endif + graphics.cutscenebars(); graphics.drawfade(); + BlitSurfaceStandard(graphics.backBuffer, NULL, graphics.tempBuffer, NULL); graphics.drawgui(); - - if (draw_mode_indicator_text && !draw_return_editor_text) + if (graphics.flipmode) { - mode_indicator_text(mode_indicator_alpha); + if (game.advancetext) graphics.bprint(5, 228, "- Press ACTION to advance text -", 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2), true); } - - graphics.set_render_target(graphics.gameTexture); - - graphics.copy_texture(graphics.gameplayTexture, NULL, NULL); - - if (game.advancetext) + else { - char buffer_adv[SCREEN_WIDTH_CHARS + 1]; - vformat_buf( - buffer_adv, sizeof(buffer_adv), - loc::gettext("- Press {button} to advance text -"), - "button:but", - vformat_button(ActionSet_InGame, Action_InGame_ACTION) - ); - - font::print(PR_CEN | PR_BOR, -1, graphics.flipmode ? 228 : 5, buffer_adv, 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2)); + if (game.advancetext) graphics.bprint(5, 5, "- Press ACTION to advance text -", 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2), true); } if (game.readytotele > 100 || game.oldreadytotele > 100) { - char buffer[SCREEN_WIDTH_CHARS + 1]; + /* Screen width 40 chars, 4 per char */ + char buffer[160 + 1]; + static const char raw[] = "- Press %s to Teleport - "; const char* final_string = interact_prompt( buffer, sizeof(buffer), - loc::gettext("- Press {button} to Teleport -") + raw ); int alpha = graphics.lerp(game.oldreadytotele, game.readytotele); - font::print( - PR_BRIGHTNESS(alpha) | PR_CEN | PR_BOR, - -1, - graphics.flipmode ? 20 : 210, - final_string, - 235 - (help.glow / 2), - 235 - (help.glow / 2), - 255 - ); + graphics.bprint(5, graphics.flipmode ? 20 : 210, final_string, alpha - 20 - (help.glow / 2), alpha - 20 - (help.glow / 2), alpha, true); } if (game.swnmode) { - if (game.swngame == SWN_GRAVITRON) + if (game.swngame == 0) { std::string tempstring = help.timestring(game.swntimer); - font::print(PR_2X | PR_CEN | PR_BOR, -1, 20, tempstring, 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2)); + graphics.bigbprint( -1, 20, tempstring, 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2), true, 2); } - else if (game.swngame == SWN_SUPERGRAVITRON) + else if (game.swngame == 1) { if (game.swnmessage == 0) { std::string tempstring = help.timestring(game.swntimer); - font::print(PR_BOR, 10, 10, loc::gettext("Current Time"), 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2)); - font::print(PR_2X | PR_BOR | PR_FONT_8X8, 25, 24, tempstring, 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2)); + graphics.bprint( 10, 10, "Current Time", 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2), false); + graphics.bigbprint( 25, 24, tempstring, 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2), false, 2); tempstring = help.timestring(game.swnrecord); - font::print(PR_BOR | PR_RIGHT, 320-8, 10, loc::gettext("Best Time"), 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2)); - font::print(PR_2X | PR_BOR | PR_FONT_8X8 | PR_RIGHT, 300, 24, tempstring, 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2)); + graphics.bprint( 240, 10, "Best Time", 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2), false); + graphics.bigbrprint( 300, 24, tempstring, 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2), false, 2); switch(game.swnbestrank) { case 0: - font::print_wrap(PR_CEN, -1, 204, loc::gettext("Next Trophy at 5 seconds"), 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2)); + graphics.bprint( -1, 204, "Next Trophy at 5 seconds", 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2), true); break; case 1: - font::print_wrap(PR_CEN, -1, 204, loc::gettext("Next Trophy at 10 seconds"), 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2)); + graphics.bprint( -1, 204, "Next Trophy at 10 seconds", 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2), true); break; case 2: - font::print_wrap(PR_CEN, -1, 204, loc::gettext("Next Trophy at 15 seconds"), 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2)); + graphics.bprint( -1, 204, "Next Trophy at 15 seconds", 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2), true); break; case 3: - font::print_wrap(PR_CEN, -1, 204, loc::gettext("Next Trophy at 20 seconds"), 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2)); + graphics.bprint( -1, 204, "Next Trophy at 20 seconds", 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2), true); break; case 4: - font::print_wrap(PR_CEN, -1, 204, loc::gettext("Next Trophy at 30 seconds"), 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2)); + graphics.bprint( -1, 204, "Next Trophy at 30 seconds", 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2), true); break; case 5: - font::print_wrap(PR_CEN, -1, 204, loc::gettext("Next Trophy at 1 minute"), 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2)); + graphics.bprint( -1, 204, "Next Trophy at 1 minute", 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2), true); break; case 6: - font::print_wrap(PR_CEN, -1, 204, loc::gettext("All Trophies collected!"), 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2)); + graphics.bprint( -1, 204, "All Trophies collected!", 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2), true); break; } } else if (game.swnmessage == 1) { std::string tempstring = help.timestring(game.swntimer); - font::print(PR_BOR, 10, 10, loc::gettext("Current Time"), 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2)); - font::print(PR_2X | PR_BOR | PR_FONT_8X8, 25, 24, tempstring, 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2)); + graphics.bprint( 10, 10, "Current Time", 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2), false); + graphics.bigbprint( 25, 24, tempstring, 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2), false, 2); tempstring = help.timestring(game.swnrecord); if (int(game.deathseq / 5) % 2 == 1) { - font::print(PR_BOR | PR_RIGHT, 320-8, 10, loc::gettext("Best Time"), 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2)); - font::print(PR_2X | PR_BOR | PR_FONT_8X8 | PR_RIGHT, 300, 24, tempstring, 128 - (help.glow), 220 - (help.glow), 128 - (help.glow / 2)); + graphics.bprint( 240, 10, "Best Time", 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2), false); + graphics.bigbrprint( 300, 24, tempstring, 128 - (help.glow), 220 - (help.glow), 128 - (help.glow / 2), false, 2); - font::print(PR_2X | PR_BOR | PR_CEN, -1, 200, loc::gettext("New Record!"), 128 - (help.glow), 220 - (help.glow), 128 - (help.glow / 2)); + graphics.bigbprint( -1, 200, "New Record!", 128 - (help.glow), 220 - (help.glow), 128 - (help.glow / 2), true, 2); } } else if (game.swnmessage >= 2) @@ -2623,28 +1876,21 @@ void gamerender(void) game.swnmessage--; if (game.swnmessage == 2) game.swnmessage = 0; std::string tempstring = help.timestring(game.swntimer); - font::print(PR_BOR, 10, 10, loc::gettext("Current Time"), 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2)); - font::print(PR_2X | PR_BOR | PR_FONT_8X8, 25, 24, tempstring, 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2)); + graphics.bprint( 10, 10, "Current Time", 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2), false); + graphics.bigbprint( 25, 24, tempstring, 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2), false, 2); tempstring = help.timestring(game.swnrecord); - font::print(PR_BOR | PR_RIGHT, 320-8, 10, loc::gettext("Best Time"), 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2)); - font::print(PR_2X | PR_BOR | PR_FONT_8X8 | PR_RIGHT, 300, 24, tempstring, 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2)); + graphics.bprint( 240, 10, "Best Time", 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2), false); + graphics.bigbrprint( 300, 24, tempstring, 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2), false, 2); if (int(game.swnmessage / 5) % 2 == 1) { - font::print(PR_2X | PR_BOR | PR_CEN, -1, 200, loc::gettext("New Trophy!"), 220 - (help.glow), 128 - (help.glow), 128 - (help.glow / 2)); + graphics.bigbprint( -1, 200, "New Trophy!", 220 - (help.glow), 128 - (help.glow), 128 - (help.glow / 2), true, 2); } } - char buffer[SCREEN_WIDTH_CHARS + 1]; - vformat_buf( - buffer, sizeof(buffer), - loc::gettext("[Press {button} to stop]"), - "button:but", - vformat_button(ActionSet_InGame, Action_InGame_Map) - ); - font::print(PR_BOR | PR_CEN, -1, 228, buffer, 160 - (help.glow/2), 160 - (help.glow/2), 160 - (help.glow/2)); + graphics.bprint( 20, 228, "[Press ENTER to stop]", 160 - (help.glow/2), 160 - (help.glow/2), 160 - (help.glow/2), true); } - else if (game.swngame == SWN_START_GRAVITRON_STEP_3) + else if(game.swngame==2) { if (int(game.swndelay / 15) % 2 == 1 || game.swndelay >= 120) { @@ -2660,111 +1906,91 @@ void gamerender(void) y1 = 10; y2 = 30; } - font::print(PR_2X | PR_CEN | PR_BOR | PR_CJK_HIGH, -1, y1, loc::gettext("Survive for"), 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2)); - font::print(PR_2X | PR_CEN | PR_BOR, -1, y2, loc::gettext("60 seconds!"), 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2)); + graphics.bigbprint( -1, y1, "Survive for", 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2), true, 2); + graphics.bigbprint( -1, y2, "60 seconds!", 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2), true, 2); } } - else if (game.swngame == SWN_START_SUPERGRAVITRON_STEP_2) + else if(game.swngame==7) { if (game.swndelay >= 60) { - font::print(PR_2X | PR_BOR | PR_CEN, -1, 20, loc::gettext("SUPER GRAVITRON"), 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2)); + graphics.bigbprint( -1, 20, "SUPER GRAVITRON", 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2), true, 2); std::string tempstring = help.timestring(game.swnrecord); - font::print(PR_BOR | PR_CEN, -1, 190, loc::gettext("Best Time"), 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2)); - font::print(PR_2X | PR_BOR | PR_CEN | PR_CJK_LOW, -1, 205, tempstring, 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2)); + graphics.bprint( 240, 190, "Best Time", 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2), true); + graphics.bigbrprint( 300, 205, tempstring, 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2), true, 2); } - else if (int(game.swndelay / 10) % 2 == 1) + else if (int(game.swndelay / 10) % 2 == 1) { - font::print(PR_2X | PR_BOR | PR_CEN, -1, 20, loc::gettext("SUPER GRAVITRON"), 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2)); - font::print(PR_3X | PR_BOR | PR_CEN, -1, 200, loc::gettext("GO!"), 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2)); + graphics.bigbprint( -1, 20, "SUPER GRAVITRON", 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2), true, 2); + graphics.bigbprint( -1, 200, "GO!", 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2), true, 3); } } } - if (game.intimetrial && graphics.fademode == FADE_NONE) + if (game.intimetrial && graphics.fademode==0) { //Draw countdown! if (game.timetrialcountdown > 0) { if (game.timetrialcountdown < 30) { - if (int(game.timetrialcountdown / 4) % 2 == 0) - { - font::print(PR_4X | PR_CEN | PR_BOR, -1, 100, loc::gettext("Go!"), 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2)); - } + if (int(game.timetrialcountdown / 4) % 2 == 0) graphics.bigbprint( -1, 100, "Go!", 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2), true, 4); } else if (game.timetrialcountdown < 60) { - font::print(PR_4X | PR_CEN | PR_BOR, -1, 100, "1", 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2)); + graphics.bigbprint( -1, 100, "1", 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2), true, 4); } else if (game.timetrialcountdown < 90) { - font::print(PR_4X | PR_CEN | PR_BOR, -1, 100, "2", 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2)); + graphics.bigbprint( -1, 100, "2", 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2), true, 4); } else if (game.timetrialcountdown < 120) { - font::print(PR_4X | PR_CEN | PR_BOR, -1, 100, "3", 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2)); + graphics.bigbprint( -1, 100, "3", 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2), true, 4); } } - else if (!roomname_translator::is_pausing() && !game.translator_exploring) + else { - char buffer[SCREEN_WIDTH_CHARS + 1]; - game.timestringcenti(buffer, sizeof(buffer)); - //Draw OSD stuff - const char* tempstring = loc::gettext("TIME:"); - int label_len = font::len(0, tempstring); - font::print(PR_BOR | PR_RTL_XFLIP, 6, 18, tempstring, 255,255,255); - tempstring = loc::gettext("DEATH:"); - label_len = SDL_max(label_len, font::len(0, tempstring)); - font::print(PR_BOR | PR_RTL_XFLIP, 6, 30, tempstring, 255,255,255); - tempstring = loc::gettext("SHINY:"); - label_len = SDL_max(label_len, font::len(0, tempstring)); - font::print(PR_BOR | PR_RTL_XFLIP, 6, 42, tempstring, 255,255,255); + graphics.bprint(6, 18, "TIME :", 255,255,255); + graphics.bprint(6, 30, "DEATH:", 255, 255, 255); + graphics.bprint(6, 42, "SHINY:", 255,255,255); if(game.timetrialparlost) { - font::print(PR_BOR | PR_RTL_XFLIP, 8+label_len, 18, buffer, 196, 80, 80); + graphics.bprint(56, 18, game.timestring(), 196, 80, 80); } else { - font::print(PR_BOR | PR_RTL_XFLIP, 8+label_len, 18, buffer, 196, 196, 196); + graphics.bprint(56, 18, game.timestring(), 196, 196, 196); } if(game.deathcounts>0) { - font::print(PR_BOR | PR_RTL_XFLIP, 8+label_len, 30,help.String(game.deathcounts), 196, 80, 80); + graphics.bprint(56, 30,help.String(game.deathcounts), 196, 80, 80); } else { - font::print(PR_BOR | PR_RTL_XFLIP, 8+label_len, 30,help.String(game.deathcounts), 196, 196, 196); + graphics.bprint(56, 30,help.String(game.deathcounts), 196, 196, 196); } - vformat_buf( - buffer, sizeof(buffer), - loc::gettext("{n_trinkets} of {max_trinkets}"), - "n_trinkets:int, max_trinkets:int", - game.trinkets(), game.timetrialshinytarget - ); if(game.trinkets()5 || game.prev_act_fade>5) { - const char* prompt = game.activity_lastprompt.c_str(); - if (game.activity_gettext) - { - prompt = loc::gettext(prompt); - } - char buffer[SCREEN_WIDTH_CHARS + 1]; + /* Screen width 40 chars, 4 per char */ + char buffer[160 + 1]; const char* final_string = interact_prompt( buffer, sizeof(buffer), - prompt + game.activity_lastprompt.c_str() ); - uint8_t text_r, text_g, text_b; - uint32_t text_flags = (game.activity_gettext ? PR_FONT_INTERFACE : PR_FONT_LEVEL) - | PR_BRIGHTNESS(act_alpha*255) | PR_CJK_LOW | PR_CEN; - - if (game.activity_r == 0 && game.activity_g == 0 && game.activity_b == 0) - { - text_r = 196; - text_g = 196; - text_b = 255 - help.glow; - } - else - { - short lines; - font::string_wordwrap(text_flags, final_string, 37*8, &lines); - - graphics.drawpixeltextbox( - 4, - game.activity_y + 4, - 39*8, - 16 + font::height(text_flags)*lines, - game.activity_r*act_alpha, - game.activity_g*act_alpha, - game.activity_b*act_alpha - ); - - text_r = game.activity_r; - text_g = game.activity_g; - text_b = game.activity_b; - } - - font::print_wrap( - text_flags, - -1, - game.activity_y + 12, - final_string, - text_r, - text_g, - text_b, - 8, - 37*8 - ); + graphics.drawtextbox(16, 4, 36, 3, game.activity_r*act_alpha, game.activity_g*act_alpha, game.activity_b*act_alpha); + graphics.Print(5, 12, final_string, game.activity_r*act_alpha, game.activity_g*act_alpha, game.activity_b*act_alpha, true); } if (obj.trophytext > 0 || obj.oldtrophytext > 0) @@ -2832,209 +2015,64 @@ void gamerender(void) graphics.drawtrophytext(); } - level_debugger::render(); graphics.renderwithscreeneffects(); } -static void draw_roomname_menu(void) +void maprender(void) { - const char* name; + ClearSurface(graphics.backBuffer); - if (map.hiddenname[0] != '\0') + //draw screen alliteration + //Roomname: + if (map.hiddenname != "") { - name = loc::gettext_roomname_special(map.hiddenname); + graphics.Print(5, 2, map.hiddenname, 196, 196, 255 - help.glow, true); } else { - name = loc::gettext_roomname(map.custommode, game.roomx, game.roomy, map.roomname, map.roomname_special); + if (map.finalmode){ + graphics.Print(5, 2, map.glitchname, 196, 196, 255 - help.glow, true); + }else{ + graphics.Print(5, 2, map.roomname, 196, 196, 255 - help.glow, true); + } } - font::print(PR_FONT_LEVEL | PR_CEN, -1, 2, name, 196, 196, 255 - help.glow); -} - -/* Used to keep some graphics positions on the map screen - * the same in Flip Mode. */ -#define FLIP(y, h) (graphics.flipmode ? 220 - (y) - (h) : (y)) -#define FLIP_PR_CJK_LOW (graphics.flipmode ? PR_CJK_HIGH : PR_CJK_LOW) -#define FLIP_PR_CJK_HIGH (graphics.flipmode ? PR_CJK_LOW : PR_CJK_HIGH) - -static void rendermap(void) -{ - if (map.custommode && map.customshowmm) - { - const MapRenderData data = map.get_render_data(); - - graphics.drawpixeltextbox(35 + data.xoff, 16 + data.yoff, data.pixelsx + 10, data.pixelsy + 10, 65, 185, 207); - - if (graphics.customminimaps[map.currentregion] != NULL) - { - graphics.draw_region_image(map.currentregion, 40 + data.xoff, 21 + data.yoff, data.pixelsx, data.pixelsy); - } - else if (map.currentregion == 0 && graphics.minimap_mounted) - { - graphics.drawpartimage(IMAGE_MINIMAP, 40 + data.xoff, 21 + data.yoff, data.pixelsx, data.pixelsy); - } - else - { - graphics.drawpartimage(IMAGE_CUSTOMMINIMAP, 40 + data.xoff, 21 + data.yoff, data.pixelsx, data.pixelsy); - } - return; - } - - graphics.drawpixeltextbox(35, 16, 250, 190, 65, 185, 207); - graphics.drawimage(IMAGE_MINIMAP, 40, 21, false); -} - -static void rendermapfog(void) -{ - const MapRenderData data = map.get_render_data(); - - for (int j = data.starty; j < data.starty + data.height; j++) - { - for (int i = data.startx; i < data.startx + data.width; i++) - { - if (!map.isexplored(i, j)) - { - // Draw the fog, depending on the custom zoom size - for (int x = 0; x < data.zoom; x++) - { - for (int y = 0; y < data.zoom; y++) - { - graphics.drawimage(IMAGE_COVERED, data.xoff + 40 + (x * 12) + ((i - data.startx) * (12 * data.zoom)), data.yoff + 21 + (y * 9) + ((j - data.starty) * (9 * data.zoom)), false); - } - } - } - } - } -} - -static void rendermaplegend(void) -{ - // Draw the map legend, aka teleports/targets/trinkets - - const MapRenderData data = map.get_render_data(); - - for (size_t i = 0; i < map.teleporters.size(); i++) - { - int x = map.teleporters[i].x - data.startx; - int y = map.teleporters[i].y - data.starty; - if (x >= 0 && y >= 0 && x < data.width && y < data.height) - { - if (map.showteleporters && map.isexplored(x + data.startx, y + data.starty)) - { - font::print(PR_FONT_8X8 | PR_FULLBOR, data.legendxoff + (x * 12 * data.zoom), data.legendyoff + (y * 9 * data.zoom), "💿", 171, 255, 252); - } - else if (map.showtargets && !map.isexplored(x + data.startx, y + data.starty)) - { - font::print(PR_FONT_8X8 | PR_FULLBOR, data.legendxoff + (x * 12 * data.zoom), data.legendyoff + (y * 9 * data.zoom), "❓", 64, 64, 64); - } - } - } - - if (map.showtrinkets) - { - for (size_t i = 0; i < map.shinytrinkets.size(); i++) - { - if (!obj.collect[i]) - { - int x = map.shinytrinkets[i].x - data.startx; - int y = map.shinytrinkets[i].y - data.starty; - if (x >= 0 && y >= 0 && x < data.width && y < data.height) - { - font::print(PR_FONT_8X8 | PR_FULLBOR, data.legendxoff + (x * 12 * data.zoom), data.legendyoff + (y * 9 * data.zoom), "🪙", 254, 252, 58); - } - } - } - } -} - -static void rendermapcursor(const bool flashing) -{ - const MapRenderData data = map.get_render_data(); - int room_x = game.roomx - data.startx - 100; - int room_y = game.roomy - data.starty - 100; - int pixels_x = room_x * 12; - int pixels_y = room_y * 9; - - if (!map.custommode && game.roomx == 109) - { - // Draw the tower specially - if (!flashing || game.noflashingmode) - { - graphics.draw_rect(40 + pixels_x + 2, 21 + 2, 12 - 4, 180 - 4, 16, 245 - (help.glow * 2), 245 - (help.glow * 2)); - } - else if (map.cursorstate == 1) - { - if (int(map.cursordelay / 4) % 2 == 0) - { - graphics.draw_rect(40 + pixels_x, 21, 12, 180, 255, 255, 255); - graphics.draw_rect(40 + pixels_x + 2, 21 + 2, 12 - 4, 180 - 4, 255, 255, 255); - } - } - else if (map.cursorstate == 2 && (int(map.cursordelay / 15) % 2 == 0)) - { - graphics.draw_rect(40 + pixels_x + 2, 21 + 2, 12 - 4, 180 - 4, 16, 245 - (help.glow), 245 - (help.glow)); - } - return; - } - - if (room_x >= 0 && room_y >= 0 && room_x < data.width && room_y < data.height) - { - if (!flashing || ((map.cursorstate == 2 && int(map.cursordelay / 15) % 2 == 0) || game.noflashingmode)) - { - graphics.draw_rect(40 + (pixels_x * data.zoom) + 2 + data.xoff, 21 + (pixels_y * data.zoom) + 2 + data.yoff, (12 * data.zoom) - 4, (9 * data.zoom) - 4, 16, 245 - (help.glow), 245 - (help.glow)); - } - else if (map.cursorstate == 1 && int(map.cursordelay / 4) % 2 == 0) - { - graphics.draw_rect(40 + (pixels_x * data.zoom) + data.xoff, 21 + (pixels_y * data.zoom) + data.yoff, 12 * data.zoom, 9 * data.zoom, 255, 255, 255); - graphics.draw_rect(40 + (pixels_x * data.zoom) + 2 + data.xoff, 21 + (pixels_y * data.zoom) + 2 + data.yoff, (12 * data.zoom) - 4, (9 * data.zoom) - 4, 255, 255, 255); - } - } -} - -void maprender(void) -{ - graphics.set_render_target(graphics.menuTexture); - graphics.clear(); - - draw_roomname_menu(); - //Background color - graphics.fill_rect(0, 12, 320, 240, 10, 24, 26 ); + FillRect(graphics.backBuffer,0, 12, 320, 240, 10, 24, 26 ); + + //Menubar: - graphics.drawpixeltextbox( -10, 212, 43*8, 16 + font::height(PR_FONT_INTERFACE), 65, 185, 207); + graphics.drawtextbox( -10, 212, 43, 3, 65, 185, 207); // Draw the selected page name at the bottom // menupage 0 - 3 is the pause screen if (script.running && game.menupage == 3) { // While in a cutscene, you can only save - char buffer[SCREEN_WIDTH_CHARS + 1]; - vformat_buf(buffer, sizeof(buffer), loc::get_langmeta()->menu_select_tight.c_str(), "label:str", loc::gettext("SAVE")); - font::print(PR_CEN | PR_CJK_LOW, -1, 220, buffer, 196, 196, 255 - help.glow); + graphics.Print(-1, 220, "[SAVE]", 196, 196, 255 - help.glow, true); } else if (game.menupage <= 3) { - const char* tab1; + std::string tab1; if (game.insecretlab) { - tab1 = loc::gettext("GRAV"); + tab1 = "GRAV"; } else if (obj.flags[67] && !map.custommode) { - tab1 = loc::gettext("SHIP"); + tab1 = "SHIP"; } else { - tab1 = loc::gettext("CREW"); + tab1 = "CREW"; } #define TAB(opt, text) graphics.map_tab(opt, text, game.menupage == opt) - TAB(0, loc::gettext("MAP")); + TAB(0, "MAP"); TAB(1, tab1); - TAB(2, loc::gettext("STATS")); - TAB(3, loc::gettext("SAVE")); + TAB(2, "STATS"); + TAB(3, "SAVE"); #undef TAB } @@ -3045,51 +2083,242 @@ void maprender(void) case 31: case 32: case 33: - font::print(PR_CEN | PR_CJK_LOW, -1, 220, loc::gettext("[ PAUSE ]"), 196, 196, 255 - help.glow); + graphics.Print(-1, 220, "[ PAUSE ]", 196, 196, 255 - help.glow, true); } // Draw menu options if (game.menupage >= 30 && game.menupage <= 33) { #define OPTION(opt, text) graphics.map_option(opt, 4, text, game.menupage - 30 == opt) - OPTION(0, loc::gettext("return to game")); - OPTION(1, loc::gettext("options")); - OPTION(2, loc::gettext("quit to menu")); + OPTION(0, "return to game"); + OPTION(1, "options"); + OPTION(2, "quit to menu"); #undef OPTION } - /* FIXME: about the code below where this is used (case 10/11/20/21)... I've seen better code. - * We should rewrite it to use graphics::map_option, but until then... */ - int selection_offset; - { - char buffer[SCREEN_WIDTH_CHARS + 1]; - vformat_buf(buffer, sizeof(buffer), loc::get_langmeta()->menu_select.c_str(), "label:str", ""); - selection_offset = font::len(0, buffer) / 2; - } - // Draw the actual menu switch(game.menupage) { case 0: - rendermap(); - if (map.finalmode || (map.custommode&&!map.customshowmm)) { - // Cover the whole map + //draw the map image + graphics.drawpixeltextbox(35, 16, 250, 190, 32,24, 65, 185, 207,4,0); + graphics.drawimage(1, 40, 21, false); for (int j = 0; j < 20; j++) { for (int i = 0; i < 20; i++) { - graphics.drawimage(IMAGE_COVERED, 40 + (i * 12), 21 + (j * 9), false); + graphics.drawimage(2, 40 + (i * 12), 21 + (j * 9), false); } } - font::print(PR_CEN | PR_BOR, -1, 105, loc::gettext("NO SIGNAL"), 245, 245, 245); + graphics.Print(-1, 105, "NO SIGNAL", 245, 245, 245, true); } +#ifndef NO_CUSTOM_LEVELS + else if(map.custommode) + { + //draw the map image + graphics.drawcustompixeltextbox(35+map.custommmxoff, 16+map.custommmyoff, map.custommmxsize+10, map.custommmysize+10, (map.custommmxsize+10)/8, (map.custommmysize+10)/8, 65, 185, 207,4,0); + if (graphics.minimap_mounted) + { + graphics.drawpartimage(1, 40+map.custommmxoff, 21+map.custommmyoff, map.custommmxsize, map.custommmysize); + } + else + { + graphics.drawpartimage(12, 40+map.custommmxoff, 21+map.custommmyoff, map.custommmxsize,map.custommmysize); + } + + //Black out here + if(map.customzoom==4){ + for (int j = 0; j < map.customheight; j++){ + for (int i = 0; i < map.customwidth; i++){ + if(!map.isexplored(i, j)){ + //Draw the fog of war on the map + graphics.drawimage(2, map.custommmxoff+40 + (i * 48), map.custommmyoff+21 + (j * 36), false); + graphics.drawimage(2, map.custommmxoff+40 + 12 + (i * 48), map.custommmyoff+21 + (j * 36), false); + graphics.drawimage(2, map.custommmxoff+40 + (i * 48), map.custommmyoff+21 + 9 + (j * 36), false); + graphics.drawimage(2, map.custommmxoff+40 + 12 + (i * 48), map.custommmyoff+21 + 9+ (j * 36), false); + + graphics.drawimage(2, map.custommmxoff+40 + (i * 48) + 24, map.custommmyoff+21 + (j * 36), false); + graphics.drawimage(2, map.custommmxoff+40 + 12 + (i * 48) + 24, map.custommmyoff+21 + (j * 36), false); + graphics.drawimage(2, map.custommmxoff+40 + (i * 48) + 24, map.custommmyoff+ 21 + 9 + (j * 36), false); + graphics.drawimage(2, map.custommmxoff+40 + 12 + (i * 48) + 24, map.custommmyoff+21 + 9+ (j * 36), false); + + graphics.drawimage(2, map.custommmxoff+40 + (i * 48), map.custommmyoff+21 + (j * 36)+18, false); + graphics.drawimage(2, map.custommmxoff+40 + 12 + (i * 48), map.custommmyoff+21 + (j * 36)+18, false); + graphics.drawimage(2, map.custommmxoff+40 + (i * 48), map.custommmyoff+21 + 9 + (j * 36)+18, false); + graphics.drawimage(2, map.custommmxoff+40 + 12 + (i * 48), map.custommmyoff+21 + 9+ (j * 36)+18, false); + + graphics.drawimage(2, map.custommmxoff+40 + (i * 48) + 24, map.custommmyoff+21 + (j * 36)+18, false); + graphics.drawimage(2, map.custommmxoff+40 + 12 + (i * 48) + 24, map.custommmyoff+21 + (j * 36)+18, false); + graphics.drawimage(2, map.custommmxoff+40 + (i * 48) + 24, map.custommmyoff+21 + 9 + (j * 36)+18, false); + graphics.drawimage(2, map.custommmxoff+40 + 12 + (i * 48) + 24, map.custommmyoff+21 + 9+ (j * 36)+18, false); + } + } + } + }else if(map.customzoom==2){ + for (int j = 0; j < map.customheight; j++){ + for (int i = 0; i < map.customwidth; i++){ + if(!map.isexplored(i, j)){ + //Draw the fog of war on the map + graphics.drawimage(2, map.custommmxoff+40 + (i * 24), map.custommmyoff+21 + (j * 18), false); + graphics.drawimage(2, map.custommmxoff+40 + 12 + (i * 24), map.custommmyoff+21 + (j * 18), false); + graphics.drawimage(2, map.custommmxoff+40 + (i * 24), map.custommmyoff+21 + 9 + (j * 18), false); + graphics.drawimage(2, map.custommmxoff+40 + 12 + (i * 24), map.custommmyoff+21 + 9+ (j * 18), false); + } + } + } + }else{ + for (int j = 0; j < map.customheight; j++){ + for (int i = 0; i < map.customwidth; i++){ + if(!map.isexplored(i, j)){ + //Draw the fog of war on the map + graphics.drawimage(2, map.custommmxoff+40 + (i * 12), map.custommmyoff+21 + (j * 9), false); + } + } + } + } + + //normal size maps + if(map.customzoom==4){ + if(map.cursorstate==1){ + if (int(map.cursordelay / 4) % 2 == 0){ + graphics.drawrect(40 + ((game.roomx - 100) * 48) +map.custommmxoff, 21 + ((game.roomy - 100) * 36)+map.custommmyoff , 48 , 36 , 255,255,255); + graphics.drawrect(40 + ((game.roomx - 100) * 48) + 2+map.custommmxoff, 21 + ((game.roomy - 100) * 36) + 2+map.custommmyoff, 48 - 4, 36 - 4, 255,255,255); + } + }else if (map.cursorstate == 2){ + if (int(map.cursordelay / 15) % 2 == 0){ + graphics.drawrect(40 + ((game.roomx - 100) * 48) + 2+map.custommmxoff, 21 + ((game.roomy - 100) * 36) + 2+map.custommmyoff, 48 - 4, 36 - 4, 16, 245 - (help.glow), 245 - (help.glow)); + } + } + }else if(map.customzoom==2){ + if(map.cursorstate==1){ + if (int(map.cursordelay / 4) % 2 == 0){ + graphics.drawrect(40 + ((game.roomx - 100) * 24)+map.custommmxoff , 21 + ((game.roomy - 100) * 18)+map.custommmyoff , 24 , 18 , 255,255,255); + graphics.drawrect(40 + ((game.roomx - 100) * 24) + 2+map.custommmxoff, 21 + ((game.roomy - 100) * 18) + 2+map.custommmyoff, 24 - 4, 18 - 4, 255,255,255); + } + }else if (map.cursorstate == 2){ + if (int(map.cursordelay / 15) % 2 == 0){ + graphics.drawrect(40 + ((game.roomx - 100) * 24) + 2+map.custommmxoff, 21 + ((game.roomy - 100) * 18) + 2+map.custommmyoff, 24 - 4, 18 - 4, 16, 245 - (help.glow), 245 - (help.glow)); + } + } + }else{ + if(map.cursorstate==1){ + if (int(map.cursordelay / 4) % 2 == 0){ + graphics.drawrect(40 + ((game.roomx - 100) * 12)+map.custommmxoff , 21 + ((game.roomy - 100) * 9)+map.custommmyoff , 12 , 9 , 255,255,255); + graphics.drawrect(40 + ((game.roomx - 100) * 12) + 2+map.custommmxoff, 21 + ((game.roomy - 100) * 9) + 2+map.custommmyoff, 12 - 4, 9 - 4, 255,255,255); + } + }else if (map.cursorstate == 2){ + if (int(map.cursordelay / 15) % 2 == 0){ + graphics.drawrect(40 + ((game.roomx - 100) * 12) + 2+map.custommmxoff, 21 + ((game.roomy - 100) * 9) + 2+map.custommmyoff, 12 - 4, 9 - 4, 16, 245 - (help.glow), 245 - (help.glow)); + } + } + } + + if(map.showtrinkets){ + for(size_t i=0; i 30) map.cursorstate = 2; + } + else if (map.cursorstate == 2) + { + if (int(map.cursordelay / 15) % 2 == 0) + { + graphics.drawrect(40 + ((game.roomx - 100) * 12) + 2 , 21 + 2, 12 - 4, 180 - 4,16, 245 - (help.glow), 245 - (help.glow)); + } + } + } + else + { + if (map.cursorstate == 1) + { + if (int(map.cursordelay / 4) % 2 == 0) + { + graphics.drawrect(40 + ((game.roomx - 100) * 12) , 21 + ((game.roomy - 100) * 9) , 12 , 9 , 255,255,255); + graphics.drawrect(40 + ((game.roomx - 100) * 12) + 2, 21 + ((game.roomy - 100) * 9) + 2, 12 - 4, 9 - 4, 255,255,255); + } + } + else if (map.cursorstate == 2) + { + if (int(map.cursordelay / 15) % 2 == 0) + { + graphics.drawrect(40 + ((game.roomx - 100) * 12) + 2, 21 + ((game.roomy - 100) * 9) + 2, 12 - 4, 9 - 4, 16, 245 - (help.glow), 245 - (help.glow)); + } + } + } + + //draw legend details + for (size_t i = 0; i < map.teleporters.size(); i++) + { + if (map.showteleporters && map.isexplored(map.teleporters[i].x, map.teleporters[i].y)) + { + int temp = 1126 + (int) map.isexplored(map.teleporters[i].x, map.teleporters[i].y); + if (graphics.flipmode) temp += 3; + graphics.drawtile(40 + 3 + (map.teleporters[i].x * 12), 22 + (map.teleporters[i].y * 9), temp); + } + else if(map.showtargets && !map.isexplored(map.teleporters[i].x, map.teleporters[i].y)) + { + int temp = 1126 + (int) map.isexplored(map.teleporters[i].x, map.teleporters[i].y); + if (graphics.flipmode) temp += 3; + graphics.drawtile(40 + 3 + (map.teleporters[i].x * 12), 22 + (map.teleporters[i].y * 9), temp); + } + } + + if (map.showtrinkets) + { + for (size_t i = 0; i < map.shinytrinkets.size(); i++) + { + if (!obj.collect[i]) + { + int temp = 1086; + if (graphics.flipmode) temp += 3; + graphics.drawtile(40 + 3 + (map.shinytrinkets[i].x * 12), 22 + (map.shinytrinkets[i].y * 9), temp); + } + } + } } break; case 1: @@ -3097,115 +2326,95 @@ void maprender(void) { if (graphics.flipmode) { - font::print_wrap(PR_CEN, -1, 174, loc::gettext("SUPER GRAVITRON HIGHSCORE"), 196, 196, 255 - help.glow); + graphics.Print(0, 174, "SUPER GRAVITRON HIGHSCORE", 196, 196, 255 - help.glow, true); std::string tempstring = help.timestring(game.swnrecord); - font::print(PR_CEN, -1, 124, loc::gettext("Best Time"), 196, 196, 255 - help.glow); - font::print(PR_2X | PR_CEN | PR_CJK_HIGH, -1, 102, tempstring, 196, 196, 255 - help.glow); + graphics.Print( 240, 124, "Best Time", 196, 196, 255 - help.glow, true); + graphics.bigrprint( 300, 94, tempstring, 196, 196, 255 - help.glow, true, 2); switch(game.swnbestrank) { case 0: - font::print_wrap(PR_CEN, -1, 40, loc::gettext("Next Trophy at 5 seconds"), 196, 196, 255 - help.glow); + graphics.Print( -1, 40, "Next Trophy at 5 seconds", 196, 196, 255 - help.glow, true); break; case 1: - font::print_wrap(PR_CEN, -1, 40, loc::gettext("Next Trophy at 10 seconds"), 196, 196, 255 - help.glow); + graphics.Print( -1, 40, "Next Trophy at 10 seconds", 196, 196, 255 - help.glow, true); break; case 2: - font::print_wrap(PR_CEN, -1, 40, loc::gettext("Next Trophy at 15 seconds"), 196, 196, 255 - help.glow); + graphics.Print( -1, 40, "Next Trophy at 15 seconds", 196, 196, 255 - help.glow, true); break; case 3: - font::print_wrap(PR_CEN, -1, 40, loc::gettext("Next Trophy at 20 seconds"), 196, 196, 255 - help.glow); + graphics.Print( -1, 40, "Next Trophy at 20 seconds", 196, 196, 255 - help.glow, true); break; case 4: - font::print_wrap(PR_CEN, -1, 40, loc::gettext("Next Trophy at 30 seconds"), 196, 196, 255 - help.glow); + graphics.Print( -1, 40, "Next Trophy at 30 seconds", 196, 196, 255 - help.glow, true); break; case 5: - font::print_wrap(PR_CEN, -1, 40, loc::gettext("Next Trophy at 1 minute"), 196, 196, 255 - help.glow); + graphics.Print( -1, 40, "Next Trophy at 1 minute", 196, 196, 255 - help.glow, true); break; case 6: - font::print_wrap(PR_CEN, -1, 40, loc::gettext("All Trophies collected!"), 196, 196, 255 - help.glow); + graphics.Print( -1, 40, "All Trophies collected!", 196, 196, 255 - help.glow, true); break; } } else { - font::print_wrap(PR_CEN, -1, 40, loc::gettext("SUPER GRAVITRON HIGHSCORE"), 196, 196, 255 - help.glow); + graphics.Print(0, 40, "SUPER GRAVITRON HIGHSCORE", 196, 196, 255 - help.glow, true); std::string tempstring = help.timestring(game.swnrecord); - font::print(PR_CEN, -1, 90, loc::gettext("Best Time"), 196, 196, 255 - help.glow); - font::print(PR_2X | PR_CEN | PR_CJK_LOW, -1, 104, tempstring, 196, 196, 255 - help.glow); + graphics.Print( 240, 90, "Best Time", 196, 196, 255 - help.glow, true); + graphics.bigrprint( 300, 104, tempstring, 196, 196, 255 - help.glow, true, 2); switch(game.swnbestrank) { case 0: - font::print_wrap(PR_CEN, -1, 174, loc::gettext("Next Trophy at 5 seconds"), 196, 196, 255 - help.glow); + graphics.Print( -1, 174, "Next Trophy at 5 seconds", 196, 196, 255 - help.glow, true); break; case 1: - font::print_wrap(PR_CEN, -1, 174, loc::gettext("Next Trophy at 10 seconds"), 196, 196, 255 - help.glow); + graphics.Print( -1, 174, "Next Trophy at 10 seconds", 196, 196, 255 - help.glow, true); break; case 2: - font::print_wrap(PR_CEN, -1, 174, loc::gettext("Next Trophy at 15 seconds"), 196, 196, 255 - help.glow); + graphics.Print( -1, 174, "Next Trophy at 15 seconds", 196, 196, 255 - help.glow, true); break; case 3: - font::print_wrap(PR_CEN, -1, 174, loc::gettext("Next Trophy at 20 seconds"), 196, 196, 255 - help.glow); + graphics.Print( -1, 174, "Next Trophy at 20 seconds", 196, 196, 255 - help.glow, true); break; case 4: - font::print_wrap(PR_CEN, -1, 174, loc::gettext("Next Trophy at 30 seconds"), 196, 196, 255 - help.glow); + graphics.Print( -1, 174, "Next Trophy at 30 seconds", 196, 196, 255 - help.glow, true); break; case 5: - font::print_wrap(PR_CEN, -1, 174, loc::gettext("Next Trophy at 1 minute"), 196, 196, 255 - help.glow); + graphics.Print( -1, 174, "Next Trophy at 1 minute", 196, 196, 255 - help.glow, true); break; case 6: - font::print_wrap(PR_CEN, -1, 174, loc::gettext("All Trophies collected!"), 196, 196, 255 - help.glow); + graphics.Print( -1, 174, "All Trophies collected!", 196, 196, 255 - help.glow, true); break; } } } else if (obj.flags[67] && !map.custommode) { - char buffer[SCREEN_WIDTH_CHARS + 1]; - vformat_buf( - buffer, sizeof(buffer), - loc::gettext("Press {button} to warp to the ship."), - "button:but", - vformat_button(ActionSet_InGame, Action_InGame_ACTION) - ); - font::print_wrap(PR_CEN, -1, 105, buffer, 196, 196, 255 - help.glow); + graphics.Print(0, 105, "Press ACTION to warp to the ship.", 196, 196, 255 - help.glow, true); } +#if !defined(NO_CUSTOM_LEVELS) else if(map.custommode){ - LevelMetaData& meta = cl.ListOfMetaData[game.playcustomlevel]; + LevelMetaData& meta = ed.ListOfMetaData[game.playcustomlevel]; - uint32_t title_flags = meta.title_is_gettext ? PR_FONT_INTERFACE : PR_FONT_LEVEL; - uint32_t creator_flags = meta.creator_is_gettext ? PR_FONT_INTERFACE : PR_FONT_LEVEL; + graphics.bigprint( -1, FLIP(45), meta.title, 196, 196, 255 - help.glow, true); + graphics.Print( -1, FLIP(70), "by " + meta.creator, 196, 196, 255 - help.glow, true); + graphics.Print( -1, FLIP(80), meta.website, 196, 196, 255 - help.glow, true); + graphics.Print( -1, FLIP(100), meta.Desc1, 196, 196, 255 - help.glow, true); + graphics.Print( -1, FLIP(110), meta.Desc2, 196, 196, 255 - help.glow, true); + graphics.Print( -1, FLIP(120), meta.Desc3, 196, 196, 255 - help.glow, true); - font::print(title_flags | PR_2X | PR_CEN, -1, FLIP(45, 8), meta.title, 196, 196, 255 - help.glow); - int sp = SDL_max(10, font::height(PR_FONT_LEVEL)); - int desc_pos = (cl.numcrewmates() > 0) ? 70 : 70 + (sp*2); - graphics.print_level_creator(creator_flags, FLIP(70, 8), meta.creator, 196, 196, 255 - help.glow); - font::print(PR_FONT_LEVEL | PR_CEN, -1, FLIP(70 + sp, 8), meta.website, 196, 196, 255 - help.glow); - font::print(PR_FONT_LEVEL | PR_CEN, -1, FLIP(desc_pos + sp*3, 8), meta.Desc1, 196, 196, 255 - help.glow); - font::print(PR_FONT_LEVEL | PR_CEN, -1, FLIP(desc_pos + sp*4, 8), meta.Desc2, 196, 196, 255 - help.glow); - if (sp <= 10) - { - font::print(PR_FONT_LEVEL | PR_CEN, -1, FLIP(desc_pos + sp*5, 8), meta.Desc3, 196, 196, 255 - help.glow); - } + int remaining = ed.numcrewmates() - game.crewmates(); - if (cl.numcrewmates() > 0) - { - int remaining = cl.numcrewmates() - game.crewmates(); - - char buffer[SCREEN_WIDTH_CHARS + 1]; - loc::gettext_plural_fill( - buffer, sizeof(buffer), - "{n_crew|wordy} crewmates remain", - "{n_crew|wordy} crewmate remains", - "n_crew:int", - remaining - ); - font::print_wrap(PR_CEN, -1, FLIP(165, 8), buffer, 196, 196, 255 - help.glow); + if(remaining==1){ + graphics.Print(1,FLIP(165), help.number(remaining)+ " crewmate remains", 196, 196, 255 - help.glow, true); + }else if(remaining>0){ + graphics.Print(1,FLIP(165), help.number(remaining)+ " crewmates remain", 196, 196, 255 - help.glow, true); } } +#endif else { if (graphics.flipmode) @@ -3216,23 +2425,25 @@ void maprender(void) if (game.crewstats[(2-i)]) { graphics.printcrewname(44, 32 + (i * 64)+4+10, 2-i); + graphics.printcrewnamestatus(44, 32 + (i * 64)+4, 2-i); } else { graphics.printcrewnamedark(44, 32 + (i * 64)+4+10, 2-i); + graphics.Print(44, 32 + (i * 64) + 4, "Missing...", 64,64,64); } - graphics.printcrewnamestatus(44, 32 + (i * 64)+4, 2-i, game.crewstats[(2-i)]); graphics.drawcrewman(16+160, 32 + (i * 64), (2-i)+3, game.crewstats[(2-i)+3]); if (game.crewstats[(2-i)+3]) { graphics.printcrewname(44+160, 32 + (i * 64)+4+10, (2-i)+3); + graphics.printcrewnamestatus(44+160, 32 + (i * 64)+4, (2-i)+3); } else { graphics.printcrewnamedark(44+160, 32 + (i * 64)+4+10, (2-i)+3); + graphics.Print(44+160, 32 + (i * 64) + 4, "Missing...", 64,64,64); } - graphics.printcrewnamestatus(44+160, 32 + (i * 64)+4, (2-i)+3, game.crewstats[(2-i)+3]); } } else @@ -3243,283 +2454,329 @@ void maprender(void) if (game.crewstats[i]) { graphics.printcrewname(44, 32 + (i * 64)+4, i); + graphics.printcrewnamestatus(44, 32 + (i * 64)+4+10, i); } else { graphics.printcrewnamedark(44, 32 + (i * 64)+4, i); + graphics.Print(44, 32 + (i * 64) + 4 + 10, "Missing...", 64,64,64); } - graphics.printcrewnamestatus(44, 32 + (i * 64)+4+10, i, game.crewstats[i]); graphics.drawcrewman(16+160, 32 + (i * 64), i+3, game.crewstats[i+3]); if (game.crewstats[i+3]) { graphics.printcrewname(44+160, 32 + (i * 64)+4, i+3); + graphics.printcrewnamestatus(44+160, 32 + (i * 64)+4+10, i+3); } else { graphics.printcrewnamedark(44+160, 32 + (i * 64)+4, i+3); + graphics.Print(44+160, 32 + (i * 64) + 4 + 10, "Missing...", 64,64,64); } - graphics.printcrewnamestatus(44+160, 32 + (i * 64)+4+10, i+3, game.crewstats[i+3]); } } } break; case 2: - { - int max_trinkets; - if (map.custommode) +#if !defined(NO_CUSTOM_LEVELS) + if(map.custommode) { - max_trinkets = cl.numtrinkets(); + if (graphics.flipmode) + { + graphics.Print(0, 164, "[Trinkets found]", 196, 196, 255 - help.glow, true); + graphics.Print(0, 152, help.number(game.trinkets()) + " out of " + help.number(ed.numtrinkets()), 96,96,96, true); + + graphics.Print(0, 114, "[Number of Deaths]", 196, 196, 255 - help.glow, true); + graphics.Print(0, 102,help.String(game.deathcounts), 96,96,96, true); + + graphics.Print(0, 64, "[Time Taken]", 196, 196, 255 - help.glow, true); + graphics.Print(0, 52, game.timestring(), 96, 96, 96, true); + } + else + { + graphics.Print(0, 52, "[Trinkets found]", 196, 196, 255 - help.glow, true); + graphics.Print(0, 64, help.number(game.trinkets()) + " out of "+help.number(ed.numtrinkets()), 96,96,96, true); + + graphics.Print(0, 102, "[Number of Deaths]", 196, 196, 255 - help.glow, true); + graphics.Print(0, 114,help.String(game.deathcounts), 96,96,96, true); + + graphics.Print(0, 152, "[Time Taken]", 196, 196, 255 - help.glow, true); + graphics.Print(0, 164, game.timestring(), 96, 96, 96, true); + } } else +#endif { - max_trinkets = 20; + if (graphics.flipmode) + { + graphics.Print(0, 164, "[Trinkets found]", 196, 196, 255 - help.glow, true); + graphics.Print(0, 152, help.number(game.trinkets()) + " out of Twenty", 96,96,96, true); + + graphics.Print(0, 114, "[Number of Deaths]", 196, 196, 255 - help.glow, true); + graphics.Print(0, 102,help.String(game.deathcounts), 96,96,96, true); + + graphics.Print(0, 64, "[Time Taken]", 196, 196, 255 - help.glow, true); + graphics.Print(0, 52, game.timestring(), 96, 96, 96, true); + } + else + { + graphics.Print(0, 52, "[Trinkets found]", 196, 196, 255 - help.glow, true); + graphics.Print(0, 64, help.number(game.trinkets()) + " out of Twenty", 96,96,96, true); + + graphics.Print(0, 102, "[Number of Deaths]", 196, 196, 255 - help.glow, true); + graphics.Print(0, 114,help.String(game.deathcounts), 96,96,96, true); + + graphics.Print(0, 152, "[Time Taken]", 196, 196, 255 - help.glow, true); + graphics.Print(0, 164, game.timestring(), 96, 96, 96, true); + } } - - /* Stats. */ - - // Always show trinkets if you're in the main game, otherwise only show them if any exist in the level - bool show_trinkets = map.custommode ? (cl.numtrinkets() > 0) : true; - int deaths_pos = show_trinkets ? 102 : 72; - int time_pos = show_trinkets ? 152 : 132; - if (show_trinkets) - { - font::print(PR_CEN | FLIP_PR_CJK_HIGH, -1, FLIP(52, 8), loc::gettext("[Trinkets found]"), 196, 196, 255 - help.glow); - char buffer[SCREEN_WIDTH_CHARS + 1]; - vformat_buf( - buffer, sizeof(buffer), - loc::gettext("{n_trinkets|wordy} out of {max_trinkets|wordy}"), - "n_trinkets:int, max_trinkets:int", - game.trinkets(), max_trinkets - ); - font::print(PR_CEN | FLIP_PR_CJK_LOW, -1, FLIP(64, 8), buffer, 96, 96, 96); - } - - font::print(PR_CEN | FLIP_PR_CJK_HIGH, -1, FLIP(deaths_pos, 8), loc::gettext("[Number of Deaths]"), 196, 196, 255 - help.glow); - font::print(PR_CEN | FLIP_PR_CJK_LOW, -1, FLIP(deaths_pos + 12, 8), help.String(game.deathcounts), 96, 96, 96); - - font::print(PR_CEN | FLIP_PR_CJK_HIGH, -1, FLIP(time_pos, 8), loc::gettext("[Time Taken]"), 196, 196, 255 - help.glow); - font::print(PR_CEN | FLIP_PR_CJK_LOW, -1, FLIP(time_pos + 12, 8), game.timestring(), 96, 96, 96); break; - } case 3: - { - if (game.inintermission || game.translator_exploring) + if (game.inintermission) { - font::print_wrap(PR_CEN, -1, 115, loc::gettext("Cannot Save in Level Replay"), 146, 146, 180); - break; + graphics.Print(0, 115, "Cannot Save in Level Replay", 146, 146, 180, true); } - if (game.nodeathmode) + else if (game.nodeathmode) { - font::print_wrap(PR_CEN, -1, 115, loc::gettext("Cannot Save in No Death Mode"), 146, 146, 180); - break; + graphics.Print(0, 115, "Cannot Save in No Death Mode", 146, 146, 180, true); } - if (game.intimetrial) + else if (game.intimetrial) { - font::print_wrap(PR_CEN, -1, 115, loc::gettext("How'd you get here?"), 146, 146, 180); - break; + graphics.Print(0, 115, "Cannot Save in Time Trial", 146, 146, 180, true); } - if (game.insecretlab) + else if (game.insecretlab) { - font::print_wrap(PR_CEN, -1, 115, loc::gettext("Cannot Save in Secret Lab"), 146, 146, 180); - break; + graphics.Print(0, 115, "Cannot Save in Secret Lab", 146, 146, 180, true); } - if (game.gamesavefailed) + else if (game.gamesavefailed) { - font::print_wrap(PR_CEN, -1, 115, loc::gettext("ERROR: Could not save game!"), 146, 146, 180); - break; + graphics.Print(0, 115, "ERROR: Could not save game!", 146, 146, 180, true); } - - /* We are not in a special case, so draw the save screen now... */ - - if (!map.custommode) + else if (map.custommode) { - /* FIXME: The text here should be automatically "balance-wrapped" instead of hardcoding the width. - * In fact, maybe print_wrap should balance-wrap by default. */ - font::print_wrap(PR_CEN, -1, 174, loc::gettext("(Note: The game is autosaved at every teleporter.)"), 146, 146, 180, 12); - } - - if (!game.gamesaved) - { - char buffer[SCREEN_WIDTH_CHARS + 1]; - vformat_buf( - buffer, sizeof(buffer), - loc::gettext("[Press {button} to save your game]"), - "button:but", - vformat_button(ActionSet_InGame, Action_InGame_ACTION) - ); - - font::print(PR_CEN, -1, 80, buffer, 255 - help.glow*2, 255 - help.glow*2, 255 - help.glow); - - if (map.custommode || !game.last_quicksave.exists) + if (game.gamesaved) { - break; + graphics.Print(0, 36, "Game saved ok!", 255 - (help.glow / 2), 255 - (help.glow / 2), 255 - (help.glow / 2), true); + + graphics.drawpixeltextbox(17, 65, 286, 90, 36,12, 65, 185, 207,0,4); + + if (graphics.flipmode) + { + graphics.Print(0, 122, game.customleveltitle, 25, 255 - (help.glow / 2), 255 - (help.glow / 2), true); + graphics.Print(59, 78, game.savetime, 255 - (help.glow / 2), 255 - (help.glow / 2), 255 - (help.glow / 2)); + const std::string& trinketcount = help.number(game.savetrinkets); + graphics.Print(262-graphics.len(trinketcount), 78, trinketcount, 255 - (help.glow / 2), 255 - (help.glow / 2), 255 - (help.glow / 2)); + + graphics.drawsprite(34, 74, 50, graphics.col_clock); + graphics.drawsprite(270, 74, 22, graphics.col_trinket); + } + else + { + graphics.Print(0, 90, game.customleveltitle, 25, 255 - (help.glow / 2), 255 - (help.glow / 2), true); + graphics.Print(59, 132, game.savetime, 255 - (help.glow / 2), 255 - (help.glow / 2), 255 - (help.glow / 2)); + const std::string& trinketcount = help.number(game.savetrinkets); + graphics.Print(262-graphics.len(trinketcount), 132, trinketcount, 255 - (help.glow / 2), 255 - (help.glow / 2), 255 - (help.glow / 2)); + + graphics.drawsprite(34, 126, 50, graphics.col_clock); + graphics.drawsprite(270, 126, 22, graphics.col_trinket); + } + } + else + { + graphics.Print(0, 80, "[Press ACTION to save your game]", 255 - (help.glow * 2), 255 - (help.glow * 2), 255 - help.glow, true); } - - font::print(PR_CEN, -1, FLIP(100, 8), loc::gettext("Last Save:"), 164 - help.glow/4, 164 - help.glow/4, 164); - - struct Game::Summary* last = &game.last_quicksave; - vformat_buf( - buffer, sizeof(buffer), - loc::gettext("{area}, {time}"), - "area:str, time:str", - loc::gettext_roomname_special(map.currentarea(last->saverx, last->savery)), - game.giventimestring(last->hours, last->minutes, last->seconds).c_str() - ); - - font::print(PR_CEN, -1, FLIP(112, 8), buffer, 164 - help.glow/4, 164 - help.glow/4, 164); - break; - } - - /* We are only still here if the game has been quicksaved... */ - - font::print_wrap(PR_CEN, -1, 36, loc::gettext("Game saved ok!"), 255 - help.glow/2, 255 - help.glow/2, 255 - help.glow/2); - - graphics.drawpixeltextbox(17, 65, 286, 90, 65, 185, 207); - - if (map.custommode) - { - font::print(PR_CEN | PR_FONT_LEVEL, -1, FLIP(90, 8), game.customleveltitle, 25, 255 - help.glow/2, 255 - help.glow/2); } else { - size_t i; - font::print( - PR_CEN, -1, FLIP(80, 8), - loc::gettext_roomname_special(map.currentarea(game.last_quicksave.saverx, game.last_quicksave.savery)), - 25, 255 - help.glow/2, 255 - help.glow/2 - ); - for (i = 0; i < SDL_arraysize(game.crewstats); ++i) + if (graphics.flipmode) { - /* Crewmates are annoying. Their height is 21 pixels, but to flip them, - * we also have to account for their 2-pixel y-offset (and multiply it by 2). */ - graphics.drawcrewman(169 - 3*42 + i*42, FLIP(95, 21 + 2*2), i, game.crewstats[i], true); + graphics.Print(0, 186, "(Note: The game is autosaved", 146, 146, 180, true); + graphics.Print(0, 174, "at every teleporter.)", 146, 146, 180, true); + } + else + { + graphics.Print(0, 174, "(Note: The game is autosaved", 146, 146, 180, true); + graphics.Print(0, 186, "at every teleporter.)", 146, 146, 180, true); } - } - font::print(0, 59, FLIP(132, 8), game.savetime, 255 - help.glow/2, 255 - help.glow/2, 255 - help.glow/2); - char buffer[SCREEN_WIDTH_CHARS + 1]; - vformat_buf(buffer, sizeof(buffer), - loc::gettext("{savebox_n_trinkets|wordy}"), - "savebox_n_trinkets:int", - game.savetrinkets - ); - font::print(PR_RIGHT, 262, FLIP(132, 8), buffer, 255 - help.glow/2, 255 - help.glow/2, 255 - help.glow/2); + if (game.gamesaved) + { + graphics.Print(0, 36, "Game saved ok!", 255 - (help.glow / 2), 255 - (help.glow / 2), 255 - (help.glow / 2), true); - if (graphics.flipmode) - { - graphics.draw_flipsprite(34, FLIP(126, 17), 50, graphics.col_clock); - graphics.draw_flipsprite(270, FLIP(126, 17), 22, graphics.col_trinket); - } - else - { - graphics.draw_sprite(34, FLIP(126, 17), 50, graphics.col_clock); - graphics.draw_sprite(270, FLIP(126, 17), 22, graphics.col_trinket); + graphics.drawpixeltextbox(17, 65, 286, 90, 36,12, 65, 185, 207,0,4); + + if (graphics.flipmode) + { + graphics.Print(0, 132, game.savearea, 25, 255 - (help.glow / 2), 255 - (help.glow / 2), true); + for (int i = 0; i < 6; i++) + { + graphics.drawcrewman(169-(3*42)+(i*42), 98, i, game.crewstats[i], true); + } + graphics.Print(59, 78, game.savetime, 255 - (help.glow / 2), 255 - (help.glow / 2), 255 - (help.glow / 2)); + const std::string& trinketcount = help.number(game.savetrinkets); + graphics.Print(262-graphics.len(trinketcount), 78, trinketcount, 255 - (help.glow / 2), 255 - (help.glow / 2), 255 - (help.glow / 2)); + + graphics.drawsprite(34, 74, 50, graphics.col_clock); + graphics.drawsprite(270, 74, 22, graphics.col_trinket); + } + else + { + graphics.Print(0, 80, game.savearea, 25, 255 - (help.glow / 2), 255 - (help.glow / 2), true); + for (int i = 0; i < 6; i++) + { + graphics.drawcrewman(169-(3*42)+(i*42), 95, i, game.crewstats[i], true); + } + graphics.Print(59, 132, game.savetime, 255 - (help.glow / 2), 255 - (help.glow / 2), 255 - (help.glow / 2)); + const std::string& trinketcount = help.number(game.savetrinkets); + graphics.Print(262-graphics.len(trinketcount), 132, trinketcount, 255 - (help.glow / 2), 255 - (help.glow / 2), 255 - (help.glow / 2)); + + graphics.drawsprite(34, 126, 50, graphics.col_clock); + graphics.drawsprite(270, 126, 22, graphics.col_trinket); + } + } + else + { + graphics.Print(0, 80, "[Press ACTION to save your game]", 255 - (help.glow * 2), 255 - (help.glow * 2), 255 - help.glow, true); + + if (game.quicksummary != "") + { + if (graphics.flipmode) + { + graphics.Print(0, 110, "Last Save:", 164 - (help.glow / 4), 164 - (help.glow / 4), 164, true); + graphics.Print(0, 100, game.quicksummary, 164 - (help.glow / 4), 164 - (help.glow / 4), 164, true); + } + else + { + graphics.Print(0, 100, "Last Save:", 164 - (help.glow / 4), 164 - (help.glow / 4), 164, true); + graphics.Print(0, 110, game.quicksummary, 164 - (help.glow / 4), 164 - (help.glow / 4), 164, true); + } + } + } } break; - } case 10: - font::print(PR_CEN | PR_CJK_LOW, -1, 220, loc::gettext("[ QUIT ]"), 196, 196, 255 - help.glow); + graphics.Print(128, 220, "[ QUIT ]", 196, 196, 255 - help.glow); if (graphics.flipmode) { if (game.inspecial()) { - font::print_wrap(PR_CEN, -1, 135, loc::gettext("Return to main menu?"), 196, 196, 255 - help.glow, 12); + graphics.Print(0, 135, "Return to main menu?", 196, 196, 255 - help.glow, true); } else { - font::print_wrap(PR_CEN, -1, 142, loc::gettext("Do you want to quit? You will lose any unsaved progress."), 196, 196, 255 - help.glow, 12); + graphics.Print(0, 142, "Do you want to quit? You will", 196, 196, 255 - help.glow, true); + graphics.Print(0, 130, "lose any unsaved progress.", 196, 196, 255 - help.glow, true); } - font::print(PR_RTL_XFLIP, 80-selection_offset, 88, loc::gettext("[ NO, KEEP PLAYING ]"), 196, 196, 255 - help.glow); - font::print(PR_RTL_XFLIP, 80 + 32, 76, loc::gettext("yes, quit to menu"), 96, 96, 96); + graphics.Print(80-16, 88, "[ NO, KEEP PLAYING ]", 196, 196, 255 - help.glow); + graphics.Print(80 + 32, 76, "yes, quit to menu", 96, 96, 96); } else { if (game.inspecial()) { - font::print_wrap(PR_CEN, -1, 80, loc::gettext("Return to main menu?"), 196, 196, 255 - help.glow, 12); + graphics.Print(0, 80, "Return to main menu?", 196, 196, 255 - help.glow, true); } else { - font::print_wrap(PR_CEN, -1, 76, loc::gettext("Do you want to quit? You will lose any unsaved progress."), 196, 196, 255 - help.glow, 12); + graphics.Print(0, 76, "Do you want to quit? You will", 196, 196, 255 - help.glow, true); + graphics.Print(0, 88, "lose any unsaved progress.", 196, 196, 255 - help.glow, true); } - font::print(PR_RTL_XFLIP, 80-selection_offset, 130, loc::gettext("[ NO, KEEP PLAYING ]"), 196, 196, 255 - help.glow); - font::print(PR_RTL_XFLIP, 80 + 32, 142, loc::gettext("yes, quit to menu"), 96, 96, 96); + graphics.Print(80-16, 130, "[ NO, KEEP PLAYING ]", 196, 196, 255 - help.glow); + graphics.Print(80 + 32, 142, "yes, quit to menu", 96, 96, 96); } break; case 11: - font::print(PR_CEN | PR_CJK_LOW, -1, 220, loc::gettext("[ QUIT ]"), 196, 196, 255 - help.glow); + graphics.Print(128, 220, "[ QUIT ]", 196, 196, 255 - help.glow); if (graphics.flipmode) { if (game.inspecial()) { - font::print_wrap(PR_CEN, -1, 135, loc::gettext("Return to main menu?"), 196, 196, 255 - help.glow, 12); + graphics.Print(0, 135, "Return to main menu?", 196, 196, 255 - help.glow, true); } else { - font::print_wrap(PR_CEN, -1, 142, loc::gettext("Do you want to quit? You will lose any unsaved progress."), 196, 196, 255 - help.glow, 12); + graphics.Print(0, 142, "Do you want to quit? You will", 196, 196, 255 - help.glow, true); + graphics.Print(0, 130, "lose any unsaved progress.", 196, 196, 255 - help.glow, true); } - font::print(PR_RTL_XFLIP, 80, 88, loc::gettext("no, keep playing"), 96,96,96); - font::print(PR_RTL_XFLIP, 80+32-selection_offset, 76, loc::gettext("[ YES, QUIT TO MENU ]"), 196, 196, 255 - help.glow); + graphics.Print(80, 88, "no, keep playing", 96,96,96); + graphics.Print(80+32-16, 76, "[ YES, QUIT TO MENU ]", 196, 196, 255 - help.glow); } else { if (game.inspecial()) { - font::print_wrap(PR_CEN, -1, 80, loc::gettext("Return to main menu?"), 196, 196, 255 - help.glow, 12); + graphics.Print(0, 80, "Return to main menu?", 196, 196, 255 - help.glow, true); } else { - font::print_wrap(PR_CEN, -1, 76, loc::gettext("Do you want to quit? You will lose any unsaved progress."), 196, 196, 255 - help.glow, 12); + graphics.Print(0, 76, "Do you want to quit? You will", 196, 196, 255 - help.glow, true); + graphics.Print(0, 88, "lose any unsaved progress.", 196, 196, 255 - help.glow, true); } - font::print(PR_RTL_XFLIP, 80, 130, loc::gettext("no, keep playing"), 96,96,96); - font::print(PR_RTL_XFLIP, 80+32-selection_offset, 142, loc::gettext("[ YES, QUIT TO MENU ]"), 196, 196, 255 - help.glow); + graphics.Print(80, 130, "no, keep playing", 96,96,96); + graphics.Print(80+32-16, 142, "[ YES, QUIT TO MENU ]", 196, 196, 255 - help.glow); } break; case 20: - font::print(PR_CEN | PR_CJK_LOW, -1, 220, loc::gettext("[ GRAVITRON ]"), 196, 196, 255 - help.glow); + graphics.Print(128, 220, "[ GRAVITRON ]", 196, 196, 255 - help.glow, true); if (graphics.flipmode) { - font::print_wrap(PR_CEN, -1, 88, loc::gettext("Do you want to return to the secret laboratory?"), 196, 196, 255 - help.glow, 12); - font::print(PR_RTL_XFLIP, 80-selection_offset, 142, loc::gettext("[ NO, KEEP PLAYING ]"), 196, 196, 255 - help.glow); - font::print(PR_RTL_XFLIP, 80 + 32, 130, loc::gettext("yes, return"), 96, 96, 96); + graphics.Print(0, 76, "the secret laboratory?", 196, 196, 255 - help.glow, true); + graphics.Print(0, 88, "Do you want to return to", 196, 196, 255 - help.glow, true); + graphics.Print(80-16, 142, "[ NO, KEEP PLAYING ]", 196, 196, 255 - help.glow); + graphics.Print(80 + 32, 130, "yes, return", 96, 96, 96); } else { - font::print_wrap(PR_CEN, -1, 76, loc::gettext("Do you want to return to the secret laboratory?"), 196, 196, 255 - help.glow, 12); - font::print(PR_RTL_XFLIP, 80-selection_offset, 130, loc::gettext("[ NO, KEEP PLAYING ]"), 196, 196, 255 - help.glow); - font::print(PR_RTL_XFLIP, 80 + 32, 142, loc::gettext("yes, return"), 96, 96, 96); + graphics.Print(0, 76, "Do you want to return to", 196, 196, 255 - help.glow, true); + graphics.Print(0, 88, "the secret laboratory?", 196, 196, 255 - help.glow, true); + graphics.Print(80-16, 130, "[ NO, KEEP PLAYING ]", 196, 196, 255 - help.glow); + graphics.Print(80 + 32, 142, "yes, return", 96, 96, 96); } break; case 21: - font::print(PR_CEN | PR_CJK_LOW, -1, 220, loc::gettext("[ GRAVITRON ]"), 196, 196, 255 - help.glow); + graphics.Print(128, 220, "[ GRAVITRON ]", 196, 196, 255 - help.glow, true); if (graphics.flipmode) { - font::print_wrap(PR_CEN, -1, 88, loc::gettext("Do you want to return to the secret laboratory?"), 196, 196, 255 - help.glow, 12); - font::print(PR_RTL_XFLIP, 80, 142, loc::gettext("no, keep playing"), 96, 96, 96); - font::print(PR_RTL_XFLIP, 80 + 32-selection_offset, 130, loc::gettext("[ YES, RETURN ]"), 196, 196, 255 - help.glow); + graphics.Print(0, 76, "the secret laboratory?", 196, 196, 255 - help.glow, true); + graphics.Print(0, 88, "Do you want to return to", 196, 196, 255 - help.glow, true); + graphics.Print(80, 142, "no, keep playing", 96, 96, 96); + graphics.Print(80 + 32-16, 130, "[ YES, RETURN ]", 196, 196, 255 - help.glow); } else { - font::print_wrap(PR_CEN, -1, 76, loc::gettext("Do you want to return to the secret laboratory?"), 196, 196, 255 - help.glow, 12); - font::print(PR_RTL_XFLIP, 80, 130, loc::gettext("no, keep playing"), 96, 96, 96); - font::print(PR_RTL_XFLIP, 80 + 32-selection_offset, 142, loc::gettext("[ YES, RETURN ]"), 196, 196, 255 - help.glow); + graphics.Print(0, 76, "Do you want to return to", 196, 196, 255 - help.glow, true); + graphics.Print(0, 88, "the secret laboratory?", 196, 196, 255 - help.glow, true); + graphics.Print(80, 130, "no, keep playing", 96, 96, 96); + graphics.Print(80 + 32-16, 142, "[ YES, RETURN ]", 196, 196, 255 - help.glow); } } - graphics.set_render_target(graphics.gameTexture); + + + + // We need to draw the black screen above the menu in order to disguise it + // being jankily brought down in glitchrunner mode when exiting to the title + // Otherwise, there's no reason to obscure the menu + if (GlitchrunnerMode_less_than_or_equal(Glitchrunner2_2) + || graphics.fademode == 3 + || graphics.fademode == 5 + || game.fadetomenu + || game.fadetolab) + { + graphics.drawfade(); + } if (graphics.resumegamemode || graphics.menuoffset > 0 || graphics.oldmenuoffset > 0) { @@ -3527,67 +2784,105 @@ void maprender(void) } else { - graphics.copy_texture(graphics.menuTexture, NULL, NULL); + graphics.renderwithscreeneffects(); } - - // We need to draw the black screen above the menu in order to disguise it - // being jankily brought down in glitchrunner mode when exiting to the title - // Otherwise, there's no reason to obscure the menu - if (GlitchrunnerMode_less_than_or_equal(Glitchrunner2_2) - || FADEMODE_IS_FADING(graphics.fademode) - || game.fadetomenu - || game.fadetolab) - { - graphics.drawfade(); - } - - - graphics.renderwithscreeneffects(); } -#undef FLIP_PR_CJK_HIGH -#undef FLIP_PR_CJK_LOW -#undef FLIP - void teleporterrender(void) { - graphics.set_render_target(graphics.menuTexture); - graphics.clear(); - - const int telex = map.teleporters[game.teleport_to_teleporter].x; - const int teley = map.teleporters[game.teleport_to_teleporter].y; - - draw_roomname_menu(); + ClearSurface(graphics.backBuffer); + int tempx; + int tempy; + //draw screen alliteration + //Roomname: + int temp = map.area(game.roomx, game.roomy); + if (temp < 2 && !map.custommode && graphics.fademode==0) + { + graphics.Print(5, 2, map.hiddenname, 196, 196, 255 - help.glow, true); + } + else + { + graphics.Print(5, 2, map.roomname, 196, 196, 255 - help.glow, true); + } //Background color - graphics.fill_rect(0, 12, 320, 240, 10, 24, 26); + FillRect(graphics.backBuffer, 0, 12, 320, 240, 10, 24, 26); - rendermap(); - rendermapfog(); - rendermapcursor(false); + //draw the map image + graphics.drawpixeltextbox(35, 16, 250, 190, 32,24, 65, 185, 207,4,0); + graphics.drawimage(1, 40, 21, false); + //black out areas we can't see yet + for (int j = 0; j < 20; j++) + { + for (int i = 0; i < 20; i++) + { + if(!map.isexplored(i, j)) + { + graphics.drawimage(2, 40 + (i * 12), 21 + (j * 9), false); + } + } + } - // Draw a box around the currently selected teleporter - - const MapRenderData data = map.get_render_data(); + //draw the coordinates //current + if (game.roomx == 109) + { + //tower!instead of room y, scale map.ypos + graphics.drawrect(40 + ((game.roomx - 100) * 12) + 2, 21 + 2, 12 - 4, 180 - 4, 16, 245 - (help.glow * 2), 245 - (help.glow * 2)); + } + else + { + graphics.drawrect(40 + ((game.roomx - 100) * 12) + 2, 21 + ((game.roomy - 100) * 9) + 2, 12 - 4, 9 - 4, 16, 245 - (help.glow * 2), 245 - (help.glow * 2)); + } if (game.useteleporter) { //Draw the chosen destination coordinate! //TODO //draw the coordinates //destination - graphics.draw_rect(40 + data.xoff + (telex * 12 * data.zoom) + 1, 21 + data.yoff + (teley * 9 * data.zoom) + 1, 12 * data.zoom - 2, 9 * data.zoom - 2, 245 - (help.glow * 2), 16, 16); - graphics.draw_rect(40 + data.xoff + (telex * 12 * data.zoom) + 3, 21 + data.yoff + (teley * 9 * data.zoom) + 3, 12 * data.zoom - 6, 9 * data.zoom - 6, 245 - (help.glow * 2), 16, 16); + int tempx_ = map.teleporters[game.teleport_to_teleporter].x; + int tempy_ = map.teleporters[game.teleport_to_teleporter].y; + graphics.drawrect(40 + (tempx_ * 12) + 1, 21 + (tempy_ * 9) + 1, 12 - 2, 9 - 2, 245 - (help.glow * 2), 16, 16); + graphics.drawrect(40 + (tempx_ * 12) + 3, 21 + (tempy_ * 9) + 3, 12 - 6, 9 - 6, 245 - (help.glow * 2), 16, 16); } - // Draw the legend itself - - rendermaplegend(); - - // Highlight the currently selected teleporter - - if (game.useteleporter && (help.slowsine % 16 > 8 || game.noflashingmode)) + //draw legend details + for (size_t i = 0; i < map.teleporters.size(); i++) { - font::print(PR_FONT_8X8 | PR_FULLBOR, data.legendxoff + data.xoff + (telex * 12 * data.zoom), data.legendyoff + data.yoff + (teley * 9 * data.zoom), "💿", 255, 0, 0); + if (map.showteleporters && map.isexplored(map.teleporters[i].x, map.teleporters[i].y)) + { + temp = 1126 + (int) map.isexplored(map.teleporters[i].x, map.teleporters[i].y); + if (graphics.flipmode) temp += 3; + graphics.drawtile(40 + 3 + (map.teleporters[i].x * 12), 22 + (map.teleporters[i].y * 9), temp); + } + else if(map.showtargets && !map.isexplored(map.teleporters[i].x, map.teleporters[i].y)) + { + temp = 1126 + (int) map.isexplored(map.teleporters[i].x, map.teleporters[i].y); + if (graphics.flipmode) temp += 3; + graphics.drawtile(40 + 3 + (map.teleporters[i].x * 12), 22 + (map.teleporters[i].y * 9), temp); + } + } + + if (map.showtrinkets) + { + for (size_t i = 0; i < map.shinytrinkets.size(); i++) + { + if (!obj.collect[i]) + { + temp = 1086; + if (graphics.flipmode) temp += 3; + graphics.drawtile(40 + 3 + (map.shinytrinkets[i].x * 12), 22 + (map.shinytrinkets[i].y * 9), temp); + } + } + } + + tempx = map.teleporters[game.teleport_to_teleporter].x; + tempy = map.teleporters[game.teleport_to_teleporter].y; + if (game.useteleporter && ((help.slowsine%16)>8)) + { + //colour in the legend + temp = 1128; + if (graphics.flipmode) temp += 3; + graphics.drawtile(40 + 3 + (tempx * 12), 22 + (tempy * 9), temp); } graphics.cutscenebars(); @@ -3595,34 +2890,31 @@ void teleporterrender(void) if (game.useteleporter) { - char buffer[SCREEN_WIDTH_CHARS + 1]; + /* Screen width 40 chars, 4 per char */ + char buffer[160 + 1]; + static const char raw[] = "Press %s to Teleport"; const char* final_string = interact_prompt( buffer, sizeof(buffer), - loc::gettext("Press {button} to Teleport") + raw ); //Instructions! - font::print(PR_CEN, -1, 210, loc::gettext("Press Left/Right to choose a Teleporter"), 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2)); - font::print(PR_CEN, -1, 225, final_string, 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2)); + graphics.Print(5, 210, "Press Left/Right to choose a Teleporter", 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2), true); + graphics.Print(5, 225, final_string, 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2), true); } graphics.drawgui(); - if (game.advancetext) + if (graphics.flipmode) { - char buffer_adv[SCREEN_WIDTH_CHARS + 1]; - vformat_buf( - buffer_adv, sizeof(buffer_adv), - loc::gettext("- Press {button} to advance text -"), - "button:but", - vformat_button(ActionSet_InGame, Action_InGame_ACTION) - ); - - font::print(PR_CEN | PR_BOR, -1, graphics.flipmode ? 228 : 5, buffer_adv, 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2)); + if (game.advancetext) graphics.bprint(5, 228, "- Press ACTION to advance text -", 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2), true); + } + else + { + if (game.advancetext) graphics.bprint(5, 5, "- Press ACTION to advance text -", 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2), true); } - graphics.set_render_target(graphics.gameTexture); if (graphics.resumegamemode || graphics.menuoffset > 0 || graphics.oldmenuoffset > 0) { @@ -3630,8 +2922,6 @@ void teleporterrender(void) } else { - graphics.copy_texture(graphics.menuTexture, NULL, NULL); + graphics.render(); } - - graphics.render(); } diff --git a/desktop_version/src/RenderFixed.cpp b/desktop_version/src/RenderFixed.cpp index c68f484d..9c23c203 100644 --- a/desktop_version/src/RenderFixed.cpp +++ b/desktop_version/src/RenderFixed.cpp @@ -1,7 +1,6 @@ -#include "CustomLevels.h" +#include "editor.h" #include "Game.h" #include "Graphics.h" -#include "Editor.h" #include "Entity.h" #include "Enums.h" #include "Map.h" @@ -21,21 +20,6 @@ static inline void titleupdatetextcol(void) if(graphics.col_tb>255) graphics.col_tb=255; } -static inline void tick_skip_message_timer(void) -{ - const bool tick = graphics.fademode == FADE_NONE; - if (!tick) - { - return; - } - - game.old_skip_message_timer = game.skip_message_timer; - if (game.skip_message_timer > 0) - { - game.skip_message_timer -= 15; - } -} - void gamerenderfixed(void) { if (!game.blackout && !game.completestop) @@ -129,18 +113,16 @@ void gamerenderfixed(void) obj.entities[i].updatecolour(); } - map.updateroomnames(); - - ed.old_return_message_timer = ed.return_message_timer; - if (map.custommode && !map.custommodeforreal && ed.return_message_timer > 0) + if (map.finalmode) { - ed.return_message_timer -= 15; + map.glitchname = map.getglitchname(game.roomx, game.roomy); } - game.old_mode_indicator_timer = game.mode_indicator_timer; - if (game.mode_indicator_timer > 0) +#ifndef NO_CUSTOM_LEVELS + ed.oldreturneditoralpha = ed.returneditoralpha; + if (map.custommode && !map.custommodeforreal && ed.returneditoralpha > 0) { - game.mode_indicator_timer -= 15; + ed.returneditoralpha -= 15; } // Editor ghosts! @@ -170,6 +152,7 @@ void gamerenderfixed(void) } } } +#endif } void titlerenderfixed(void) @@ -222,14 +205,13 @@ void maprenderfixed(void) || !script.running) { graphics.menuoffset += 25; - int threshold = 240; + int threshold = map.extrarow ? 230 : 240; if (graphics.menuoffset >= threshold) { graphics.menuoffset = threshold; //go back to gamemode! game.mapheld = true; game.gamestate = GAMEMODE; - graphics.resumegamemode = false; } } else @@ -261,7 +243,10 @@ void maprenderfixed(void) map.cursordelay++; } - map.updateroomnames(); + if (map.finalmode) + { + map.glitchname = map.getglitchname(game.roomx, game.roomy); + } } void teleporterrenderfixed(void) @@ -276,11 +261,4 @@ void gamecompleterenderfixed(void) graphics.updatetitlecolours(); titleupdatetextcol(); - - tick_skip_message_timer(); -} - -void gamecompleterenderfixed2(void) -{ - tick_skip_message_timer(); } diff --git a/desktop_version/src/RenderFixed.h b/desktop_version/src/RenderFixed.h index 2e8c3f5e..4953d91b 100644 --- a/desktop_version/src/RenderFixed.h +++ b/desktop_version/src/RenderFixed.h @@ -11,6 +11,4 @@ void teleporterrenderfixed(void); void gamecompleterenderfixed(void); -void gamecompleterenderfixed2(void); - #endif /* RENDERFIXED_H */ diff --git a/desktop_version/src/RoomnameTranslator.cpp b/desktop_version/src/RoomnameTranslator.cpp deleted file mode 100644 index f3931d20..00000000 --- a/desktop_version/src/RoomnameTranslator.cpp +++ /dev/null @@ -1,464 +0,0 @@ -#include "RoomnameTranslator.h" - -#include "Constants.h" -#include "Font.h" -#include "Game.h" -#include "Graphics.h" -#include "GraphicsUtil.h" -#include "KeyPoll.h" -#include "LevelDebugger.h" -#include "Localization.h" -#include "LocalizationMaint.h" -#include "Map.h" -#include "Script.h" -#include "UtilityClass.h" -#include "VFormat.h" - - -namespace roomname_translator -{ - bool enabled = false; - bool edit_mode = false; - bool expl_mode = false; - bool help_screen = false; - - SDL_Surface* dimbuffer; - SDL_Rect fullscreen_rect; - - void set_enabled(bool value) - { - enabled = value; - edit_mode = false; - } - - bool is_pausing(void) - { - return enabled && edit_mode; - } - - static void print_explanation(const char* explanation) - { - const char* use_explanation = explanation; - if (explanation == NULL || explanation[0] == '\0') - { - use_explanation = "[explanation not yet set]"; - } - else if (SDL_strcmp(explanation, ".") == 0) - { - use_explanation = "[no explanation]"; - } - font::print_wrap(PR_BOR | PR_FONT_8X8, 0, 10, use_explanation, 0,192,255, 8, 320); - } - - void overlay_render(bool* force_roomname_hidden, bool* roomname_untranslated, int* roomname_r, int* roomname_g, int* roomname_b) - { - if (level_debugger::is_active()) - { - return; - } - - if (edit_mode || help_screen) - { - fullscreen_rect.x = 0; - fullscreen_rect.y = 0; - fullscreen_rect.w = 320; - fullscreen_rect.h = 240; - graphics.set_blendmode(SDL_BLENDMODE_BLEND); - graphics.fill_rect(graphics.getRGBA(0, 0, 0, 96)); - graphics.set_blendmode(SDL_BLENDMODE_NONE); - if (help_screen) - { - font::print(PR_BOR | PR_FONT_8X8, 0, 0, "=== Room name translation mode help ===", 255,255,255); - if (expl_mode) - { - font::print_wrap( - PR_BOR | PR_FONT_8X8, - 0, 20, - "You can currently access EXPL mode to\n" - "set explanations for room names.\n" - "(Use Ctrl+E to switch to NAME mode.)", - 255,255,255 - ); - - const char* first_part = "Unexplained room names are "; - font::print(PR_BOR | PR_FONT_8X8, 0, 60, first_part, 255,255,255); - font::print(PR_BOR | PR_FONT_8X8, font::len(PR_FONT_8X8, first_part), 60, "cyan.", 64, 255, 255-help.glow); - } - else - { - font::print_wrap( - PR_BOR | PR_FONT_8X8, - 0, 20, - "You can currently access NAME mode to\n" - "translate room names.\n" - "(Use Ctrl+E to switch to EXPL mode.)", - 255,255,255 - ); - - const char* first_part = "English room names are "; - font::print(PR_BOR | PR_FONT_8X8, 0, 60, first_part, 255,255,255); - font::print(PR_BOR | PR_FONT_8X8, font::len(PR_FONT_8X8, first_part), 60, "cyan.", 0, 192, 255-help.glow); - } - font::print(PR_BOR | PR_FONT_8X8, 0, 80, "KEYS:", 255,255,255); - if (expl_mode) - { - font::print(PR_BOR | PR_FONT_8X8, 0, 90, "Tab - switch between play/expl modes", 255,255,255); - font::print(PR_BOR | PR_FONT_8X8, 0, 100, "E/Enter - set room name explanation", 255,255,255); - } - else - { - font::print(PR_BOR | PR_FONT_8X8, 0, 90, "Tab - switch between play/name modes", 255,255,255); - font::print(PR_BOR | PR_FONT_8X8, 0, 100, "E/Enter - set room name translation", 255,255,255); - } - font::print(PR_BOR | PR_FONT_8X8, 0, 110, "I - toggle invincibility", 255,255,255); - if (expl_mode) - { - font::print(PR_BOR | PR_FONT_8X8, 0, 120, ". - set blank explanation", 255,255,255); - } - *force_roomname_hidden = true; - return; - } - else if (expl_mode) - { - font::print(PR_BOR | PR_FONT_8X8, 0, 0, "Expl mode [TAB]", 255,255,255); - } - else - { - font::print(PR_BOR | PR_FONT_8X8, 0, 0, "Name mode [TAB]", 255,255,255); - } - } - else - { - font::print(PR_BOR | PR_FONT_8X8, 0, 0, "Play mode [TAB]", 255,255,255); - font::print(PR_BOR | PR_FONT_8X8, 320-64, 10, "F1: Help", 192,192,192); - } - - char buffer[SCREEN_WIDTH_CHARS + 1]; - - int n_left; - if (expl_mode) - { - n_left = map.custommode ? loc::n_unexplained_roomnames_custom : loc::n_unexplained_roomnames; - } - else - { - n_left = map.custommode ? loc::n_untranslated_roomnames_custom : loc::n_untranslated_roomnames; - } - - vformat_buf(buffer, sizeof(buffer), "{n|digits=3|spaces} left", "n:int", n_left); - font::print(PR_BOR | PR_FONT_8X8, 144, 0, buffer, 255,255,255); - - if (map.invincibility) - { - font::print(PR_BOR | PR_FONT_8X8, 224, 0, "INV", 255,255,128); - } - - vformat_buf(buffer, sizeof(buffer), - "({x|digits=2|spaces},{y|digits=2|spaces})", - "x:int, y:int", - game.roomx % 100, game.roomy % 100 - ); - font::print(PR_BOR | PR_FONT_8X8, 320-56, 0, buffer, 255,255,255); - - if (map.roomname_special) - { - if (edit_mode) - { - print_explanation("This is a special room name, which cannot be translated in-game. Please see roomnames_special"); - } - } - else if (map.roomname[0] == '\0') - { - // No room name at all, so no translation/explanation interface - if (edit_mode) - { - font::print(PR_CEN | PR_BOR | PR_FONT_8X8, -1, 229-font::height(PR_FONT_LEVEL), "[no roomname]", 0,192,255); - } - } - else if (!expl_mode) - { - // Name mode affects play mode a bit as well... - bool roomname_is_translated = loc::get_roomname_translation(map.custommode, game.roomx, game.roomy)[0] != '\0'; - *roomname_untranslated = !roomname_is_translated; - - if (edit_mode) - { - const char* english_roomname = map.roomname; - - font::print(PR_CEN | PR_BOR | PR_FONT_8X8, -1, 229-font::height(PR_FONT_LEVEL), english_roomname, 0,192,255); - - print_explanation(loc::get_roomname_explanation(map.custommode, game.roomx, game.roomy)); - - if (key.textentry()) - { - *force_roomname_hidden = true; - graphics.render_roomname(PR_FONT_LEVEL, key.keybuffer.c_str(), 255,255,255); - int name_w = font::len(PR_FONT_LEVEL, key.keybuffer.c_str()); - font::print(PR_BOR | PR_FONT_LEVEL | PR_RTL_XFLIP, (320-name_w)/2+name_w, 231, "_", 255,255,255); - } - else if (!roomname_is_translated) - { - *force_roomname_hidden = true; - graphics.render_roomname(PR_FONT_8X8, "[no translation]", 255,255,128); - } - } - else if (!roomname_is_translated) - { - *roomname_r = 0; - *roomname_g = 192; - *roomname_b = 255 - help.glow; - } - } - else - { - // Explanation mode! - const char* explanation = loc::get_roomname_explanation(map.custommode, game.roomx, game.roomy); - if (explanation[0] == '\0') - { - *roomname_r = 64; - *roomname_g = 255; - *roomname_b = 255 - help.glow; - } - - if (edit_mode) - { - if (key.textentry()) - { - print_explanation((key.keybuffer + "_").c_str()); - - font::print_wrap(PR_BOR | PR_FONT_8X8, 0, 90, "Use \".\" to set no explanation", 255,255,255, 8, 320); - } - else - { - print_explanation(explanation); - } - } - } - } - - - static bool key_pressed_once(SDL_Keycode keyc, bool* held) - { - if (key.isDown(keyc)) - { - if (!*held) - { - *held = true; - return true; - } - } - else - { - *held = false; - } - - return false; - } - - static void save_explanation(const char* explanation, const char* success_message) - { - if (loc::save_roomname_explanation_to_files(map.custommode, game.roomx, game.roomy, explanation)) - { - graphics.createtextboxflipme(success_message, -1, 176, TEXT_COLOUR("gray")); - graphics.textboxprintflags(PR_FONT_8X8); - graphics.textboxcenterx(); - graphics.textboxtimer(25); - } - else - { - graphics.createtextboxflipme("ERROR: Could not save to all langs!", -1, 176, TEXT_COLOUR("red")); - graphics.textboxprintflags(PR_FONT_8X8); - graphics.textboxcenterx(); - graphics.textboxtimer(50); - } - graphics.textboxoriginalcontextauto(); - graphics.textboxapplyposition(); - } - - static void save_translation(const char* translation) - { - if (loc::save_roomname_to_file(loc::lang, map.custommode, game.roomx, game.roomy, translation, NULL)) - { - graphics.createtextboxflipme("Translation saved!", -1, 176, TEXT_COLOUR("gray")); - graphics.textboxprintflags(PR_FONT_8X8); - graphics.textboxcenterx(); - graphics.textboxtimer(25); - } - else - { - graphics.createtextboxflipme("ERROR: Could not save!", -1, 144, TEXT_COLOUR("red")); - graphics.addline(""); - graphics.addline("1) Do the language files exist?"); - graphics.addline("2) Make sure there is no \"lang\""); - graphics.addline(" folder next to the regular saves."); - graphics.textboxprintflags(PR_FONT_8X8); - graphics.textboxcenterx(); - graphics.textboxtimer(180); - } - graphics.textboxoriginalcontextauto(); - graphics.textboxapplyposition(); - } - - bool held_tab = false; - bool held_i = false; - bool held_escape = false; - bool held_return = false; - bool held_e = false; - bool held_period = false; - bool held_f1 = false; - - bool overlay_input(void) - { - // Returns true if input "caught" and should not go to gameinput - - if (key.isDown(SDLK_ESCAPE) && held_escape) - { - // Avoid opening the pause menu - return true; - } - else - { - held_escape = false; - } - - if (help_screen) - { - if ((key.isDown(SDLK_LCTRL) || key.isDown(SDLK_RCTRL)) && key_pressed_once(SDLK_e, &held_e)) - { - expl_mode = !expl_mode; - } - - if (key_pressed_once(SDLK_ESCAPE, &held_escape) || key_pressed_once(SDLK_F1, &held_f1)) - { - help_screen = false; - } - - return true; - } - - if (key.textentry()) - { - if (key_pressed_once(SDLK_ESCAPE, &held_escape)) - { - // Without saving - key.disabletextentry(); - } - - if (key_pressed_once(SDLK_RETURN, &held_return)) - { - key.disabletextentry(); - - if (!expl_mode) - { - if (loc::lang == "en") - { - graphics.createtextboxflipme("ERROR: Can't add EN-EN translation", -1, 176, TEXT_COLOUR("red")); - graphics.textboxoriginalcontextauto(); - graphics.textboxprintflags(PR_FONT_8X8); - graphics.textboxcenterx(); - graphics.textboxtimer(50); - graphics.textboxapplyposition(); - } - else - { - save_translation(key.keybuffer.c_str()); - } - } - else - { - save_explanation(key.keybuffer.c_str(), "Explanation saved!"); - } - - edit_mode = false; - game.mapheld = true; - } - - return true; - } - - if (key_pressed_once(SDLK_F1, &held_f1)) - { - help_screen = true; - } - - if (key_pressed_once(SDLK_TAB, &held_tab) && !level_debugger::is_active()) - { - edit_mode = !edit_mode; - } - - if (key_pressed_once(SDLK_i, &held_i)) - { - if (game.intimetrial) - { - // We'll let you enable it in a time trial, but with a twist. - if (!game.timetrialcheater) - { - game.sabotage_time_trial(); - } - } - else if (game.incompetitive()) - { - return edit_mode; - } - - map.invincibility = !map.invincibility; - } - - if (edit_mode) - { - if (key_pressed_once(SDLK_ESCAPE, &held_escape)) - { - edit_mode = false; - return true; - } - - if ((key.isDown(SDLK_LCTRL) || key.isDown(SDLK_RCTRL)) && key_pressed_once(SDLK_e, &held_e)) - { - expl_mode = !expl_mode; - return true; - } - - if (key_pressed_once(SDLK_RETURN, &held_return) || key_pressed_once(SDLK_e, &held_e)) - { - if (map.roomname_special || map.roomname[0] == '\0') - { - return true; - } - - key.enabletextentry(); - if (!expl_mode) - { - key.keybuffer = loc::get_roomname_translation(map.custommode, game.roomx, game.roomy); - } - else - { - key.keybuffer = loc::get_roomname_explanation(map.custommode, game.roomx, game.roomy); - } - } - - if (expl_mode && key_pressed_once(SDLK_PERIOD, &held_period)) - { - const char* old_explanation = loc::get_roomname_explanation(map.custommode, game.roomx, game.roomy); - const char* new_explanation = NULL; - const char* success_message; - if (old_explanation[0] == '\0') - { - new_explanation = "."; - success_message = "Blank explanation set!"; - } - else if (SDL_strcmp(old_explanation, ".") == 0) - { - new_explanation = ""; - success_message = "Blank explanation deleted!"; - } - - if (new_explanation != NULL) - { - save_explanation(new_explanation, success_message); - } - } - } - - return edit_mode; - } -} diff --git a/desktop_version/src/RoomnameTranslator.h b/desktop_version/src/RoomnameTranslator.h deleted file mode 100644 index 0a0cbac8..00000000 --- a/desktop_version/src/RoomnameTranslator.h +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef ROOMNAMETRANSLATOR_H -#define ROOMNAMETRANSLATOR_H - -#include - -namespace roomname_translator -{ - extern bool enabled; - extern bool edit_mode; - - extern SDL_Surface* dimbuffer; - extern SDL_Rect fullscreen_rect; - - void set_enabled(bool value); - bool is_pausing(void); - void overlay_render(bool* force_roomname_hidden, bool* roomname_untranslated, int* roomname_r, int* roomname_g, int* roomname_b); - bool overlay_input(void); -} - -#endif /* ROOMNAMETRANSLATOR_H */ diff --git a/desktop_version/src/SDL_uikit_main.c b/desktop_version/src/SDL_uikit_main.c deleted file mode 100644 index 6ce34929..00000000 --- a/desktop_version/src/SDL_uikit_main.c +++ /dev/null @@ -1,23 +0,0 @@ -/* - SDL_uikit_main.c, placed in the public domain by Sam Lantinga 3/18/2019 -*/ - -/* Include the SDL main definition header */ -#include "SDL_main.h" - -#if defined(__IPHONEOS__) || defined(__TVOS__) - -#ifndef SDL_MAIN_HANDLED -#ifdef main -#undef main -#endif - -int main(int argc, char *argv[]) -{ - return SDL_UIKitRunApp(argc, argv, SDL_main); -} -#endif /* !SDL_MAIN_HANDLED */ - -#endif /* __IPHONEOS__ || __TVOS__ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/desktop_version/src/Screen.cpp b/desktop_version/src/Screen.cpp index 1bc4c29a..acf8dc33 100644 --- a/desktop_version/src/Screen.cpp +++ b/desktop_version/src/Screen.cpp @@ -1,391 +1,408 @@ -#define GAMESCREEN_DEFINITION #include "Screen.h" #include +#include -#include "Alloc.h" -#include "Constants.h" -#include "Exit.h" #include "FileSystemUtils.h" #include "Game.h" -#include "Graphics.h" #include "GraphicsUtil.h" -#ifndef __APPLE__ -#include "GraphicsResources.h" -#endif -#include "InterimVersion.h" -#include "Render.h" -#include "Vlogging.h" -void ScreenSettings_default(struct ScreenSettings* _this) +// Used to create the window icon +extern "C" { - _this->windowDisplay = 0; - _this->windowWidth = SCREEN_WIDTH_PIXELS * 2; - _this->windowHeight = SCREEN_HEIGHT_PIXELS * 2; - _this->fullscreen = false; - _this->useVsync = true; // Now that uncapped is the default... - _this->scalingMode = SCALING_INTEGER; - _this->linearFilter = false; - _this->badSignal = false; + extern unsigned lodepng_decode24( + unsigned char** out, + unsigned* w, + unsigned* h, + const unsigned char* in, + size_t insize + ); } -void Screen::init(const struct ScreenSettings* settings) +ScreenSettings::ScreenSettings(void) { - m_window = NULL; - m_renderer = NULL; - windowDisplay = settings->windowDisplay; - windowWidth = settings->windowWidth; - windowHeight = settings->windowHeight; - isWindowed = !settings->fullscreen; - scalingMode = settings->scalingMode; - isFiltered = settings->linearFilter; - badSignalEffect = settings->badSignal; - vsync = settings->useVsync; + windowWidth = 320; + windowHeight = 240; + fullscreen = false; + useVsync = true; // Now that uncapped is the default... + stretch = 0; + linearFilter = false; + badSignal = false; +} - // Uncomment this next line when you need to debug -flibit - // SDL_SetHintWithPriority(SDL_HINT_RENDER_DRIVER, "software", SDL_HINT_OVERRIDE); +void Screen::init(const ScreenSettings& settings) +{ + m_window = NULL; + m_renderer = NULL; + m_screenTexture = NULL; + m_screen = NULL; + isWindowed = !settings.fullscreen; + stretchMode = settings.stretch; + isFiltered = settings.linearFilter; + vsync = settings.useVsync; + filterSubrect.x = 1; + filterSubrect.y = 1; + filterSubrect.w = 318; + filterSubrect.h = 238; - m_window = SDL_CreateWindow( - "VVVVVV", - SDL_WINDOWPOS_CENTERED_DISPLAY(windowDisplay), - SDL_WINDOWPOS_CENTERED_DISPLAY(windowDisplay), - SCREEN_WIDTH_PIXELS * 2, - SCREEN_HEIGHT_PIXELS * 2, - SDL_WINDOW_HIDDEN | SDL_WINDOW_RESIZABLE | SDL_WINDOW_ALLOW_HIGHDPI - ); + SDL_SetHintWithPriority( + SDL_HINT_RENDER_SCALE_QUALITY, + isFiltered ? "linear" : "nearest", + SDL_HINT_OVERRIDE + ); + SDL_SetHintWithPriority( + SDL_HINT_RENDER_VSYNC, + vsync ? "1" : "0", + SDL_HINT_OVERRIDE + ); - if (m_window == NULL) - { - vlog_error("Could not create window: %s", SDL_GetError()); - VVV_exit(1); - } + // Uncomment this next line when you need to debug -flibit + // SDL_SetHintWithPriority(SDL_HINT_RENDER_DRIVER, "software", SDL_HINT_OVERRIDE); + // FIXME: m_renderer is also created in resetRendererWorkaround()! + SDL_CreateWindowAndRenderer( + 640, + 480, + SDL_WINDOW_HIDDEN | SDL_WINDOW_RESIZABLE | SDL_WINDOW_ALLOW_HIGHDPI, + &m_window, + &m_renderer + ); + SDL_SetWindowTitle(m_window, "VVVVVV"); - m_renderer = SDL_CreateRenderer(m_window, -1, SDL_RENDERER_ACCELERATED | SDL_RENDERER_TARGETTEXTURE); + LoadIcon(); - if (m_renderer == NULL) - { - vlog_error("Could not create renderer: %s", SDL_GetError()); - VVV_exit(1); - } + // FIXME: This surface should be the actual backbuffer! -flibit + m_screen = SDL_CreateRGBSurface( + 0, + 320, + 240, + 32, + 0x00FF0000, + 0x0000FF00, + 0x000000FF, + 0xFF000000 + ); + // ALSO FIXME: This SDL_CreateTexture() is duplicated twice in this file! + m_screenTexture = SDL_CreateTexture( + m_renderer, + SDL_PIXELFORMAT_ARGB8888, + SDL_TEXTUREACCESS_STREAMING, + 320, + 240 + ); - SDL_RenderSetVSync(m_renderer, (int) vsync); + badSignalEffect = settings.badSignal; -#ifdef INTERIM_VERSION_EXISTS - /* Branch name limits are ill-defined but on GitHub it's ~256 chars - * ( https://stackoverflow.com/a/24014513/ ). - * Really though, just don't use super long branch names. */ - char title[256]; - SDL_snprintf(title, sizeof(title), "VVVVVV [%s]", BRANCH_NAME); - SDL_SetWindowTitle(m_window, title); -#else - SDL_SetWindowTitle(m_window, "VVVVVV"); -#endif - - SDL_SetWindowMinimumSize(m_window, SCREEN_WIDTH_PIXELS, SCREEN_HEIGHT_PIXELS); - - LoadIcon(); - - ResizeScreen(windowWidth, windowHeight); + ResizeScreen(settings.windowWidth, settings.windowHeight); } void Screen::destroy(void) { - /* Order matters! */ - VVV_freefunc(SDL_DestroyRenderer, m_renderer); - VVV_freefunc(SDL_DestroyWindow, m_window); +#define X(CLEANUP, POINTER) \ + CLEANUP(POINTER); \ + POINTER = NULL; + + /* Order matters! */ + X(SDL_DestroyTexture, m_screenTexture); + X(SDL_FreeSurface, m_screen); + X(SDL_DestroyRenderer, m_renderer); + X(SDL_DestroyWindow, m_window); + +#undef X } -void Screen::GetSettings(struct ScreenSettings* settings) +void Screen::GetSettings(ScreenSettings* settings) { - windowDisplay = SDL_GetWindowDisplayIndex(m_window); - if (windowDisplay < 0) - { - vlog_error("Error: could not get display index: %s", SDL_GetError()); - windowDisplay = 0; - } - settings->windowDisplay = windowDisplay; - settings->windowWidth = windowWidth; - settings->windowHeight = windowHeight; + int width, height; + GetWindowSize(&width, &height); - settings->fullscreen = !isWindowed; - settings->useVsync = vsync; - settings->scalingMode = scalingMode; - settings->linearFilter = isFiltered; - settings->badSignal = badSignalEffect; + settings->windowWidth = width; + settings->windowHeight = height; + + settings->fullscreen = !isWindowed; + settings->useVsync = vsync; + settings->stretch = stretchMode; + settings->linearFilter = isFiltered; + settings->badSignal = badSignalEffect; } -#ifdef __APPLE__ -/* Apple doesn't like icons anymore... */ void Screen::LoadIcon(void) { - -} -#else -void Screen::LoadIcon(void) -{ - SDL_Surface* icon = LoadImageSurface("VVVVVV.png"); - if (icon == NULL) - { - return; - } - SDL_SetWindowIcon(m_window, icon); - VVV_freefunc(SDL_FreeSurface, icon); -} +#ifndef __APPLE__ + unsigned char *fileIn; + size_t length; + unsigned char *data; + unsigned int width, height; + FILESYSTEM_loadAssetToMemory("VVVVVV.png", &fileIn, &length, false); + lodepng_decode24(&data, &width, &height, fileIn, length); + FILESYSTEM_freeMemory(&fileIn); + SDL_Surface *icon = SDL_CreateRGBSurfaceFrom( + data, + width, + height, + 24, + width * 3, + 0x000000FF, + 0x0000FF00, + 0x00FF0000, + 0x00000000 + ); + SDL_SetWindowIcon(m_window, icon); + SDL_FreeSurface(icon); + SDL_free(data); #endif /* __APPLE__ */ +} void Screen::ResizeScreen(int x, int y) { - windowDisplay = SDL_GetWindowDisplayIndex(m_window); - if (windowDisplay < 0) - { - vlog_error("Error: could not get display index: %s", SDL_GetError()); - windowDisplay = 0; - } + static int resX = 320; + static int resY = 240; + if (x != -1 && y != -1) + { + // This is a user resize! + resX = x; + resY = y; + } - if (x != -1 && y != -1) - { - // This is a user resize! - windowWidth = x; - windowHeight = y; - } - - if (!isWindowed || isForcedFullscreen()) - { - int result = SDL_SetWindowFullscreen(m_window, SDL_WINDOW_FULLSCREEN_DESKTOP); - recacheTextures(); - if (result != 0) - { - vlog_error("Error: could not set the game to fullscreen mode: %s", SDL_GetError()); - return; - } - } - else - { - int result = SDL_SetWindowFullscreen(m_window, 0); - if (result != 0) - { - vlog_error("Error: could not set the game to windowed mode: %s", SDL_GetError()); - } - else if (x != -1 && y != -1) - { - SDL_SetWindowSize(m_window, windowWidth, windowHeight); - SDL_SetWindowPosition( - m_window, - SDL_WINDOWPOS_CENTERED_DISPLAY(windowDisplay), - SDL_WINDOWPOS_CENTERED_DISPLAY(windowDisplay) - ); - } - recacheTextures(); - } -} - -static void constrain_to_desktop(int display_index, int* width, int* height) -{ - SDL_DisplayMode display_mode = {}; - int success = SDL_GetDesktopDisplayMode(display_index, &display_mode); - if (success != 0) - { - vlog_error("Could not get desktop display mode: %s", SDL_GetError()); - return; - } - - while ((*width > display_mode.w || *height > display_mode.h) - && *width > SCREEN_WIDTH_PIXELS && *height > SCREEN_HEIGHT_PIXELS) - { - // We are too big, take away one multiple - *width -= SCREEN_WIDTH_PIXELS; - *height -= SCREEN_HEIGHT_PIXELS; - } + if(!isWindowed) + { + int result = SDL_SetWindowFullscreen(m_window, SDL_WINDOW_FULLSCREEN_DESKTOP); + if (result != 0) + { + printf("Error: could not set the game to fullscreen mode: %s\n", SDL_GetError()); + return; + } + } + else + { + int result = SDL_SetWindowFullscreen(m_window, 0); + if (result != 0) + { + printf("Error: could not set the game to windowed mode: %s\n", SDL_GetError()); + return; + } + if (x != -1 && y != -1) + { + SDL_SetWindowSize(m_window, resX, resY); + SDL_SetWindowPosition(m_window, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED); + } + } + if (stretchMode == 1) + { + int winX, winY; + GetWindowSize(&winX, &winY); + int result = SDL_RenderSetLogicalSize(m_renderer, winX, winY); + if (result != 0) + { + printf("Error: could not set logical size: %s\n", SDL_GetError()); + return; + } + result = SDL_RenderSetIntegerScale(m_renderer, SDL_FALSE); + if (result != 0) + { + printf("Error: could not set scale: %s\n", SDL_GetError()); + return; + } + } + else + { + SDL_RenderSetLogicalSize(m_renderer, 320, 240); + int result = SDL_RenderSetIntegerScale(m_renderer, (SDL_bool) (stretchMode == 2)); + if (result != 0) + { + printf("Error: could not set scale: %s\n", SDL_GetError()); + return; + } + } + SDL_ShowWindow(m_window); } void Screen::ResizeToNearestMultiple(void) { - int w, h; - GetScreenSize(&w, &h); + int w, h; + GetWindowSize(&w, &h); - // Check aspect ratio first - bool using_width; - int usethisdimension, usethisratio; + // Check aspect ratio first + bool using_width; + int usethisdimension, usethisratio; - if ((float) w / (float) h > 4.0 / 3.0) - { - // Width is bigger, so it's limited by height - usethisdimension = h; - usethisratio = SCREEN_HEIGHT_PIXELS; - using_width = false; - } - else - { - // Height is bigger, so it's limited by width. Or we're exactly 4:3 already - usethisdimension = w; - usethisratio = SCREEN_WIDTH_PIXELS; - using_width = true; - } + if ((float) w / (float) h > 4.0 / 3.0) + { + // Width is bigger, so it's limited by height + usethisdimension = h; + usethisratio = 240; + using_width = false; + } + else + { + // Height is bigger, so it's limited by width. Or we're exactly 4:3 already + usethisdimension = w; + usethisratio = 320; + using_width = true; + } - int floor = (usethisdimension / usethisratio) * usethisratio; - int ceiling = floor + usethisratio; + int floor = (usethisdimension / usethisratio) * usethisratio; + int ceiling = floor + usethisratio; - int final_dimension; + int final_dimension; - if (usethisdimension - floor < ceiling - usethisdimension) - { - // Floor is nearest - final_dimension = floor; - } - else - { - // Ceiling is nearest. Or we're exactly on a multiple already - final_dimension = ceiling; - } + if (usethisdimension - floor < ceiling - usethisdimension) + { + // Floor is nearest + final_dimension = floor; + } + else + { + // Ceiling is nearest. Or we're exactly on a multiple already + final_dimension = ceiling; + } - if (final_dimension == 0) - { - // We're way too small! - ResizeScreen(SCREEN_WIDTH_PIXELS, SCREEN_HEIGHT_PIXELS); - return; - } + if (final_dimension == 0) + { + // We're way too small! + ResizeScreen(320, 240); + return; + } - if (using_width) - { - w = final_dimension; - h = final_dimension / 4 * 3; - } - else - { - w = final_dimension * 4 / 3; - h = final_dimension; - } - - windowDisplay = SDL_GetWindowDisplayIndex(m_window); - if (windowDisplay < 0) - { - vlog_error("Could not get display index: %s", SDL_GetError()); - windowDisplay = 0; - } - - constrain_to_desktop(windowDisplay, &w, &h); - - ResizeScreen(w, h); + if (using_width) + { + ResizeScreen(final_dimension, final_dimension / 4 * 3); + } + else + { + ResizeScreen(final_dimension * 4 / 3, final_dimension); + } } -void Screen::GetScreenSize(int* x, int* y) +void Screen::GetWindowSize(int* x, int* y) { - if (SDL_GetRendererOutputSize(m_renderer, x, y) != 0) - { - vlog_error("Could not get window size: %s", SDL_GetError()); - /* Initialize to safe defaults */ - *x = SCREEN_WIDTH_PIXELS; - *y = SCREEN_HEIGHT_PIXELS; - } + SDL_GetRendererOutputSize(m_renderer, x, y); } -void Screen::RenderPresent(void) +void Screen::UpdateScreen(SDL_Surface* buffer, SDL_Rect* rect ) { - SDL_RenderPresent(m_renderer); - graphics.clear(); + if((buffer == NULL) && (m_screen == NULL) ) + { + return; + } + + if(badSignalEffect) + { + buffer = ApplyFilter(buffer); + } + + + ClearSurface(m_screen); + BlitSurfaceStandard(buffer,NULL,m_screen,rect); + + if(badSignalEffect) + { + SDL_FreeSurface(buffer); + } + +} + +const SDL_PixelFormat* Screen::GetFormat(void) +{ + return m_screen->format; +} + +void Screen::FlipScreen(void) +{ + SDL_UpdateTexture( + m_screenTexture, + NULL, + m_screen->pixels, + m_screen->pitch + ); + SDL_RenderCopy( + m_renderer, + m_screenTexture, + isFiltered ? &filterSubrect : NULL, + NULL + ); + SDL_RenderPresent(m_renderer); + SDL_RenderClear(m_renderer); + ClearSurface(m_screen); } void Screen::toggleFullScreen(void) { - isWindowed = !isWindowed; - ResizeScreen(windowWidth, windowHeight); + isWindowed = !isWindowed; + ResizeScreen(-1, -1); - if (game.currentmenuname == Menu::graphicoptions) - { - /* Recreate menu to update "resize to nearest" */ - game.createmenu(game.currentmenuname, true); - } + if (game.currentmenuname == Menu::graphicoptions) + { + /* Recreate menu to update "resize to nearest" */ + game.createmenu(game.currentmenuname, true); + } } -void Screen::toggleScalingMode(void) +void Screen::toggleStretchMode(void) { - scalingMode = (scalingMode + 1) % NUM_SCALING_MODES; + stretchMode = (stretchMode + 1) % 3; + ResizeScreen(-1, -1); } void Screen::toggleLinearFilter(void) { - isFiltered = !isFiltered; - - SDL_DestroyTexture(graphics.gameTexture); - SDL_DestroyTexture(graphics.tempShakeTexture); - - graphics.gameTexture = SDL_CreateTexture( - m_renderer, - SDL_PIXELFORMAT_ARGB8888, - SDL_TEXTUREACCESS_TARGET, - SCREEN_WIDTH_PIXELS, - SCREEN_HEIGHT_PIXELS - ); - - graphics.tempShakeTexture = SDL_CreateTexture( - m_renderer, - SDL_PIXELFORMAT_ARGB8888, - SDL_TEXTUREACCESS_TARGET, - SCREEN_WIDTH_PIXELS, - SCREEN_HEIGHT_PIXELS - ); - - if (graphics.gameTexture == NULL) - { - vlog_error("Could not create game texture: %s", SDL_GetError()); - return; - } - - if (graphics.tempShakeTexture == NULL) - { - vlog_error("Could not create temp shake texture: %s", SDL_GetError()); - return; - } - - SDL_SetTextureScaleMode( - graphics.gameTexture, - isFiltered ? SDL_ScaleModeLinear : SDL_ScaleModeNearest - ); - - SDL_SetTextureScaleMode( - graphics.tempShakeTexture, - isFiltered ? SDL_ScaleModeLinear : SDL_ScaleModeNearest - ); + isFiltered = !isFiltered; + SDL_SetHintWithPriority( + SDL_HINT_RENDER_SCALE_QUALITY, + isFiltered ? "linear" : "nearest", + SDL_HINT_OVERRIDE + ); + SDL_DestroyTexture(m_screenTexture); + m_screenTexture = SDL_CreateTexture( + m_renderer, + SDL_PIXELFORMAT_ARGB8888, + SDL_TEXTUREACCESS_STREAMING, + 320, + 240 + ); } -void Screen::toggleVSync(void) +void Screen::resetRendererWorkaround(void) { - vsync = !vsync; - SDL_RenderSetVSync(m_renderer, (int) vsync); + SDL_SetHintWithPriority( + SDL_HINT_RENDER_VSYNC, + vsync ? "1" : "0", + SDL_HINT_OVERRIDE + ); - recacheTextures(); -} - -void Screen::recacheTextures(void) -{ - // Fix for d3d9, which clears target textures sometimes (ex. toggling vsync, switching fullscreen, etc...) - - // Signal cached textures to be redrawn fully - graphics.backgrounddrawn = false; - graphics.foregrounddrawn = false; - graphics.towerbg.tdrawback = true; - graphics.titlebg.tdrawback = true; - - if (game.ingame_titlemode) - { - // Redraw the cached gameplay texture if we're in the in-game menu. - // Additionally, reset alpha so things don't jitter when re-entering gameplay. - float oldAlpha = graphics.alpha; - graphics.alpha = 0; - gamerender(); - graphics.alpha = oldAlpha; - } -} - -bool Screen::isForcedFullscreen(void) -{ - /* This is just a check to see if we're on a desktop or tenfoot setup. - * If you're working on a tenfoot-only build, add a def that always - * returns true! - */ -#if defined(__ANDROID__) || TARGET_OS_IPHONE - return true; -#else - return SDL_GetHintBoolean("SteamTenfoot", SDL_FALSE); -#endif + /* FIXME: This exists because SDL_HINT_RENDER_VSYNC is not dynamic! + * As a result, our only workaround is to tear down the renderer + * and recreate everything so that it can process the variable. + * -flibit + */ + + if (m_renderer == NULL) + { + /* We haven't made it to init yet, don't worry about it */ + return; + } + + SDL_RendererInfo renderInfo; + SDL_GetRendererInfo(m_renderer, &renderInfo); + bool curVsync = (renderInfo.flags & SDL_RENDERER_PRESENTVSYNC) != 0; + if (vsync == curVsync) + { + return; + } + + SDL_DestroyTexture(m_screenTexture); + SDL_DestroyRenderer(m_renderer); + + m_renderer = SDL_CreateRenderer(m_window, -1, 0); + m_screenTexture = SDL_CreateTexture( + m_renderer, + SDL_PIXELFORMAT_ARGB8888, + SDL_TEXTUREACCESS_STREAMING, + 320, + 240 + ); + + /* Ugh, have to make sure to re-apply graphics options after doing the + * above, otherwise letterbox/integer won't be applied... + */ + ResizeScreen(-1, -1); } diff --git a/desktop_version/src/Screen.h b/desktop_version/src/Screen.h index 579417a8..360fd3ce 100644 --- a/desktop_version/src/Screen.h +++ b/desktop_version/src/Screen.h @@ -8,43 +8,39 @@ class Screen { public: - void init(const struct ScreenSettings* settings); - void destroy(void); + void init(const ScreenSettings& settings); + void destroy(void); - void GetSettings(struct ScreenSettings* settings); + void GetSettings(ScreenSettings* settings); - void LoadIcon(void); + void LoadIcon(void); - void ResizeScreen(int x, int y); - void ResizeToNearestMultiple(void); - void GetScreenSize(int* x, int* y); + void ResizeScreen(int x, int y); + void ResizeToNearestMultiple(void); + void GetWindowSize(int* x, int* y); - void RenderPresent(void); + void UpdateScreen(SDL_Surface* buffer, SDL_Rect* rect); + void FlipScreen(void); - void toggleFullScreen(void); - void toggleScalingMode(void); - void toggleLinearFilter(void); - void toggleVSync(void); + const SDL_PixelFormat* GetFormat(void); - void recacheTextures(void); + void toggleFullScreen(void); + void toggleStretchMode(void); + void toggleLinearFilter(void); + void resetRendererWorkaround(void); - bool isForcedFullscreen(void); + bool isWindowed; + bool isFiltered; + bool badSignalEffect; + int stretchMode; + bool vsync; - int windowDisplay; - int windowWidth; - int windowHeight; - bool isWindowed; - bool isFiltered; - bool badSignalEffect; - int scalingMode; - bool vsync; + SDL_Window *m_window; + SDL_Renderer *m_renderer; + SDL_Texture *m_screenTexture; + SDL_Surface* m_screen; - SDL_Window *m_window; - SDL_Renderer *m_renderer; + SDL_Rect filterSubrect; }; -#ifndef GAMESCREEN_DEFINITION -extern Screen gameScreen; -#endif - #endif /* SCREEN_H */ diff --git a/desktop_version/src/ScreenSettings.h b/desktop_version/src/ScreenSettings.h index 8c0bc04e..75f43294 100644 --- a/desktop_version/src/ScreenSettings.h +++ b/desktop_version/src/ScreenSettings.h @@ -1,26 +1,17 @@ #ifndef SCREENSETTINGS_H #define SCREENSETTINGS_H -enum -{ - SCALING_LETTERBOX = 0, - SCALING_STRETCH = 1, - SCALING_INTEGER = 2, - NUM_SCALING_MODES -}; - struct ScreenSettings { - int windowDisplay; - int windowWidth; - int windowHeight; - bool fullscreen; - bool useVsync; - int scalingMode; - bool linearFilter; - bool badSignal; + ScreenSettings(void); + + int windowWidth; + int windowHeight; + bool fullscreen; + bool useVsync; + int stretch; + bool linearFilter; + bool badSignal; }; -void ScreenSettings_default(struct ScreenSettings* _this); - #endif /* SCREENSETTINGS_H */ diff --git a/desktop_version/src/Script.cpp b/desktop_version/src/Script.cpp index 2d5487ce..678e39f1 100644 --- a/desktop_version/src/Script.cpp +++ b/desktop_version/src/Script.cpp @@ -4,3718 +4,3862 @@ #include #include -#include "Alloc.h" -#include "Constants.h" -#include "CustomLevels.h" -#include "Editor.h" +#include "editor.h" #include "Entity.h" #include "Enums.h" #include "Exit.h" -#include "Font.h" #include "GlitchrunnerMode.h" #include "Graphics.h" #include "KeyPoll.h" -#include "Localization.h" -#include "LocalizationMaint.h" -#include "LocalizationStorage.h" #include "Map.h" #include "Music.h" -#include "Unreachable.h" #include "UtilityClass.h" -#include "VFormat.h" -#include "Vlogging.h" #include "Xoshiro.h" scriptclass::scriptclass(void) { - position = 0; - scriptdelay = 0; - running = false; + position = 0; + scriptdelay = 0; + running = false; - b = 0; - g = 0; - i = 0; - j = 0; - k = 0; - loopcount = 0; - looppoint = 0; - r = 0; - textx = 0; - texty = 0; - textcrewmateposition = TextboxCrewmatePosition(); - textoriginalcontext = TextboxOriginalContext(); - textbox_colours.clear(); - add_default_colours(); - textflipme = false; - textboxtimer = 0; - textcase = 1; - textbuttons = false; - textlarge = false; - textbox_sprites.clear(); - textbox_image = TEXTIMAGE_NONE; - textbox_absolutepos = false; -} - -void scriptclass::add_default_colours(void) -{ - textbox_colours["player"] = graphics.getRGB(164, 164, 255); - textbox_colours["cyan"] = graphics.getRGB(164, 164, 255); - textbox_colours["red"] = graphics.getRGB(255, 60, 60); - textbox_colours["green"] = graphics.getRGB(144, 255, 144); - textbox_colours["yellow"] = graphics.getRGB(255, 255, 134); - textbox_colours["blue"] = graphics.getRGB(95, 95, 255); - textbox_colours["purple"] = graphics.getRGB(255, 134, 255); - textbox_colours["white"] = graphics.getRGB(244, 244, 244); - textbox_colours["gray"] = graphics.getRGB(174, 174, 174); - textbox_colours["orange"] = graphics.getRGB(255, 130, 20); - textbox_colours["transparent"] = graphics.getRGB(0, 0, 0); + b = 0; + g = 0; + i = 0; + j = 0; + k = 0; + loopcount = 0; + looppoint = 0; + r = 0; + textx = 0; + texty = 0; + textflipme = false; } void scriptclass::clearcustom(void) { - customscripts.clear(); + customscripts.clear(); } static bool argexists[NUM_SCRIPT_ARGS]; -static std::string raw_words[NUM_SCRIPT_ARGS]; void scriptclass::tokenize( const std::string& t ) { - j = 0; - std::string tempword; - std::string temprawword; - char currentletter; + j = 0; + std::string tempword; + char currentletter; - SDL_zeroa(argexists); + SDL_zeroa(argexists); - for (size_t i = 0; i < t.length(); i++) - { - currentletter = t[i]; - if (currentletter == '(' || currentletter == ')' || currentletter == ',') - { - words[j] = tempword; - raw_words[j] = temprawword; - argexists[j] = words[j] != ""; - for (size_t ii = 0; ii < words[j].length(); ii++) - { - words[j][ii] = SDL_tolower(words[j][ii]); - } - j++; - tempword = ""; - temprawword = ""; - } - else if (currentletter == ' ') - { - /* Ignore spaces unless it's part of a script name. */ - temprawword += currentletter; - } - else - { - tempword += currentletter; - temprawword += currentletter; - } - if (j >= (int) SDL_arraysize(words)) - { - break; - } - } + for (size_t i = 0; i < t.length(); i++) + { + currentletter = t[i]; + if (currentletter == '(' || currentletter == ')' || currentletter == ',') + { + words[j] = tempword; + argexists[j] = words[j] != ""; + for (size_t ii = 0; ii < words[j].length(); ii++) + { + words[j][ii] = SDL_tolower(words[j][ii]); + } + j++; + tempword = ""; + } + else if (currentletter == ' ') + { + //don't do anything - i.e. strip out spaces. + } + else + { + tempword += currentletter; + } + if (j >= (int) SDL_arraysize(words)) + { + break; + } + } - if (j < (int) SDL_arraysize(words)) - { - const bool lastargexists = tempword != ""; - if (lastargexists) - { - words[j] = tempword; - raw_words[j] = tempword; - } - argexists[j] = lastargexists; - } -} - -static int getcolorfromname(std::string name) -{ - if (name == "player") return EntityColour_CREW_CYAN; - else if (name == "cyan") return EntityColour_CREW_CYAN; - else if (name == "red") return EntityColour_CREW_RED; - else if (name == "green") return EntityColour_CREW_GREEN; - else if (name == "yellow") return EntityColour_CREW_YELLOW; - else if (name == "blue") return EntityColour_CREW_BLUE; - else if (name == "purple") return EntityColour_CREW_PURPLE; - else if (name == "customcyan") return EntityColour_CREW_CYAN; - else if (name == "gray") return EntityColour_CREW_GRAY; - else if (name == "teleporter") return EntityColour_TELEPORTER_FLASHING; - - int color = help.Int(name.c_str(), -1); - if (color < 0) return -1; // Not a number (or it's negative), so we give up - return color; // Last effort to give a valid color, maybe they just input the color? -} - -static int getcrewmanfromname(std::string name) -{ - if (name == "player") return obj.getplayer(); // Return the player - int color = getcolorfromname(name); // Maybe they passed in a crewmate name, or an id? - if (color == -1) return -1; // ...Nope, return -1 - return obj.getcrewman(color); -} - -/* Also used in gamestate 1001. */ -void foundtrinket_textbox1(textboxclass* THIS); -void foundtrinket_textbox2(textboxclass* THIS); - -static void foundlab_textbox1(textboxclass* THIS) -{ - THIS->lines.clear(); - - THIS->lines.push_back(loc::gettext("Congratulations!\n\nYou have found the secret lab!")); - THIS->wrap(2); - THIS->centertext(); - THIS->pad(1, 1); -} - -static void foundlab_textbox2(textboxclass* THIS) -{ - THIS->lines.clear(); - - THIS->lines.push_back(loc::gettext("The secret lab is separate from the rest of the game. You can now come back here at any time by selecting the new SECRET LAB option in the play menu.")); - THIS->wrap(0); + if (j < (int) SDL_arraysize(words)) + { + const bool lastargexists = tempword != ""; + if (lastargexists) + { + words[j] = tempword; + } + argexists[j] = lastargexists; + } } void scriptclass::run(void) { - if (!running) - { - return; - } - - // This counter here will stop the function when it gets too high - short execution_counter = 0; - while(running && scriptdelay<=0 && !game.pausescript) - { - if (INBOUNDS_VEC(position, commands)) - { - //Let's split or command in an array of words - tokenize(commands[position]); - - //For script assisted input - game.press_left = false; - game.press_right = false; - game.press_action = false; - game.press_map = false; - - //Ok, now we run a command based on that string - if (words[0] == "moveplayer") - { - //USAGE: moveplayer(x offset, y offset) - int player = obj.getplayer(); - if (INBOUNDS_VEC(player, obj.entities)) - { - obj.entities[player].xp += ss_toi(words[1]); - obj.entities[player].yp += ss_toi(words[2]); - obj.entities[player].lerpoldxp = obj.entities[player].xp; - obj.entities[player].lerpoldyp = obj.entities[player].yp; - } - scriptdelay = 1; - } - if (words[0] == "setroomname") - { - ++position; - if (INBOUNDS_VEC(position, commands)) - { - map.roomname_special = true; - map.roomnameset = true; - map.setroomname(commands[position].c_str()); - } - } - if (words[0] == "warpdir") - { - int temprx = ss_toi(words[1]) - 1; - int tempry = ss_toi(words[2]) - 1; - const RoomProperty* room; - cl.setroomwarpdir(temprx, tempry, ss_toi(words[3])); - - room = cl.getroomprop(temprx, tempry); - - //Do we update our own room? - if (game.roomx - 100 == temprx && game.roomy - 100 == tempry) - { - //If screen warping, then override all that: - graphics.backgrounddrawn = false; - map.warpx = false; - map.warpy = false; - if (room->warpdir == 0) - { - map.background = 1; - //Be careful, we could be in a Lab or Warp Zone room... - if (room->tileset == 2) - { - //Lab - map.background = 2; - graphics.rcol = room->tilecol; - } - else if (room->tileset == 3) - { - //Warp Zone - map.background = 6; - } - } - else if (room->warpdir == 1) - { - map.warpx = true; - map.background = 3; - graphics.rcol = cl.getwarpbackground(temprx, tempry); - } - else if (room->warpdir == 2) - { - map.warpy = true; - map.background = 4; - graphics.rcol = cl.getwarpbackground(temprx, tempry); - } - else if (room->warpdir == 3) - { - map.warpx = true; - map.warpy = true; - map.background = 5; - graphics.rcol = cl.getwarpbackground(temprx, tempry); - } - } - } - if (words[0] == "ifwarp") - { - const RoomProperty* const room = cl.getroomprop(ss_toi(words[1])-1, ss_toi(words[2])-1); - if (room->warpdir == ss_toi(words[3])) - { - loadalts("custom_" + words[4], "custom_" + raw_words[4]); - position--; - } - } - if (words[0] == "destroy") - { - if (words[1] == "gravitylines") - { - for (size_t edi = 0; edi < obj.entities.size(); edi++) - { - if (obj.entities[edi].type == EntityType_HORIZONTAL_GRAVITY_LINE || obj.entities[edi].type == EntityType_VERTICAL_GRAVITY_LINE) - { - obj.disableentity(edi); - } - } - } - else if (words[1] == "warptokens") - { - for (size_t edi = 0; edi < obj.entities.size(); edi++) - { - if (obj.entities[edi].type == EntityType_WARP_TOKEN) - { - obj.disableentity(edi); - } - } - } - else if (words[1] == "platforms" || words[1] == "moving") - { - const bool fixed = words[1] == "moving"; - - for (size_t edi = 0; edi < obj.entities.size(); edi++) - { - if (obj.entities[edi].rule == 2 && obj.entities[edi].animate == 100) - { - if (fixed) - { - obj.disableblockat(obj.entities[edi].xp, obj.entities[edi].yp); - } - obj.disableentity(edi); - } - } - } - else if (words[1] == "disappear") - { - for (size_t edi = 0; edi < obj.entities.size(); edi++) - { - obj.disableblockat(obj.entities[edi].xp, obj.entities[edi].yp); - if (obj.entities[edi].type == EntityType_DISAPPEARING_PLATFORM && obj.entities[edi].rule == 3) - { - obj.disableentity(edi); - } - } - } - } - if (words[0] == "customiftrinkets") - { - if (game.trinkets() >= ss_toi(words[1])) - { - loadalts("custom_" + words[2], "custom_" + raw_words[2]); - position--; - } - } - if (words[0] == "customiftrinketsless") - { - if (game.trinkets() < ss_toi(words[1])) - { - loadalts("custom_" + words[2], "custom_" + raw_words[2]); - position--; - } - } - else if (words[0] == "customifflag") - { - int flag = ss_toi(words[1]); - if (INBOUNDS_ARR(flag, obj.flags) && obj.flags[flag]) - { - loadalts("custom_" + words[2], "custom_" + raw_words[2]); - position--; - } - } - if (words[0] == "custommap") - { - if(words[1]=="on"){ - map.customshowmm=true; - }else if(words[1]=="off"){ - map.customshowmm=false; - } - } - else if (words[0] == "setregion") - { - map.setregion( - ss_toi(words[1]), - ss_toi(words[2]), - ss_toi(words[3]), - ss_toi(words[4]), - ss_toi(words[5])); - } - else if (words[0] == "removeregion") - { - map.removeregion(ss_toi(words[1])); - } - else if (words[0] == "changeregion") - { - map.changeregion(ss_toi(words[1])); - } - if (words[0] == "delay") - { - //USAGE: delay(frames) - scriptdelay = ss_toi(words[1]); - } - if (words[0] == "flag") - { - int flag = ss_toi(words[1]); - if (INBOUNDS_ARR(flag, obj.flags)) - { - if (words[2] == "on") - { - obj.flags[flag] = true; - } - else if (words[2] == "off") - { - obj.flags[flag] = false; - } - } - } - if (words[0] == "flash") - { - //USAGE: flash(frames) - game.flashlight = ss_toi(words[1]); - } - if (words[0] == "shake") - { - //USAGE: shake(frames) - game.screenshake = ss_toi(words[1]); - } - if (words[0] == "walk") - { - //USAGE: walk(dir,frames) - if (words[1] == "left") - { - game.press_left = true; - } - else if (words[1] == "right") - { - game.press_right = true; - } - scriptdelay = ss_toi(words[2]); - } - if (words[0] == "flip") - { - game.press_action = true; - scriptdelay = 1; - } - if (words[0] == "tofloor") - { - int player = obj.getplayer(); - if(INBOUNDS_VEC(player, obj.entities) && obj.entities[player].onroof>0) - { - game.press_action = true; - scriptdelay = 1; - } - } - if (words[0] == "playef") - { - music.playef(ss_toi(words[1])); - } - if (words[0] == "play") - { - music.play(ss_toi(words[1])); - } - if (words[0] == "stopmusic") - { - music.haltdasmusik(); - } - if (words[0] == "resumemusic") - { - music.resumefade(0); - } - if (words[0] == "musicfadeout") - { - music.fadeout(false); - } - if (words[0] == "musicfadein") - { - music.fadein(); - } - if (words[0] == "trinketscriptmusic") - { - music.play(Music_PASSIONFOREXPLORING); - } - if (words[0] == "gotoposition") - { - //USAGE: gotoposition(x position, y position, gravity position) - int player = obj.getplayer(); - if (INBOUNDS_VEC(player, obj.entities)) - { - obj.entities[player].xp = ss_toi(words[1]); - obj.entities[player].yp = ss_toi(words[2]); - obj.entities[player].lerpoldxp = obj.entities[player].xp; - obj.entities[player].lerpoldyp = obj.entities[player].yp; - } - game.gravitycontrol = ss_toi(words[3]); - - } - if (words[0] == "gotoroom") - { - //USAGE: gotoroom(x,y) (manually add 100) - map.gotoroom(ss_toi(words[1])+100, ss_toi(words[2])+100); - } - if (words[0] == "cutscene") - { - graphics.showcutscenebars = true; - } - if (words[0] == "endcutscene") - { - graphics.showcutscenebars = false; - } - if (words[0] == "audiopause") - { - if (words[1] == "on") - { - game.disabletemporaryaudiopause = false; - } - else if (words[1] == "off") - { - game.disabletemporaryaudiopause = true; - } - } - if (words[0] == "untilbars") - { - if (graphics.showcutscenebars) - { - if (graphics.cutscenebarspos < 360) - { - scriptdelay = 1; - position--; - } - } - else - { - if (graphics.cutscenebarspos > 0) - { - scriptdelay = 1; - position--; - } - } - } - else if (words[0] == "text") - { - // oh boy - // first word is the colour. - if (textbox_colours.count(words[1]) == 0) - { - // No colour named this, use gray - words[1] = "gray"; - } - - r = textbox_colours[words[1]].r; - g = textbox_colours[words[1]].g; - b = textbox_colours[words[1]].b; - - //next are the x,y coordinates - textx = ss_toi(words[2]); - texty = ss_toi(words[3]); - - textlarge = endsWith(words[4].c_str(), "l") || endsWith(words[4].c_str(), "L"); - int lines = ss_toi(words[4]); - - //Number of lines for the textbox! - txt.clear(); - for (int i = 0; i < lines; i++) - { - position++; - if (INBOUNDS_VEC(position, commands)) - { - txt.push_back(commands[position]); - } - } - - textboxtimer = 0; - textcrewmateposition = TextboxCrewmatePosition(); - textbox_sprites.clear(); - textbox_image = TEXTIMAGE_NONE; - textbox_absolutepos = false; - textbox_force_outline = false; - textbox_outline = false; - } - else if (words[0] == "position") - { - //are we facing left or right? for some objects we don't care, default at 0. - j = 0; - textbox_absolutepos = false; - - //the first word is the object to position relative to - if (words[1] == "centerx") - { - words[2] = "donothing"; - j = -1; - textx = -500; - } - else if (words[1] == "centery") - { - words[2] = "donothing"; - j = -1; - texty = -500; - } - else if (words[1] == "center") - { - words[2] = "donothing"; - j = -1; - textx = -500; - texty = -500; - } - else if (words[1] == "absolute") - { - words[2] = "donothing"; - j = -1; - textbox_absolutepos = true; - - } - else // Well, are they asking for a crewmate...? - { - i = getcrewmanfromname(words[1]); - if (INBOUNDS_VEC(i, obj.entities)) - { - j = obj.entities[i].dir; - } - } - - if (INBOUNDS_VEC(i, obj.entities) && (j == 0 || j == 1)) - { - if (words[2] == "above") - { - textcrewmateposition.text_above = true; - } - - textx = 0; - texty = 0; - textcrewmateposition.x = obj.entities[i].xp; - textcrewmateposition.override_x = true; - textcrewmateposition.y = obj.entities[i].yp; - textcrewmateposition.override_y = true; - - textcrewmateposition.dir = j; - } - } - else if (words[0] == "customposition") - { - //are we facing left or right? for some objects we don't care, default at 0. - j = 0; - - //the first word is the object to position relative to - if (words[1] == "player") - { - i = obj.getcustomcrewman(EntityColour_CREW_CYAN); - j = obj.entities[i].dir; - } - else if (words[1] == "cyan") - { - i = obj.getcustomcrewman(EntityColour_CREW_CYAN); - j = obj.entities[i].dir; - } - else if (words[1] == "purple") - { - i = obj.getcustomcrewman(EntityColour_CREW_PURPLE); - j = obj.entities[i].dir; - } - else if (words[1] == "yellow") - { - i = obj.getcustomcrewman(EntityColour_CREW_YELLOW); - j = obj.entities[i].dir; - } - else if (words[1] == "red") - { - i = obj.getcustomcrewman(EntityColour_CREW_RED); - j = obj.entities[i].dir; - } - else if (words[1] == "green") - { - i = obj.getcustomcrewman(EntityColour_CREW_GREEN); - j = obj.entities[i].dir; - } - else if (words[1] == "blue") - { - i = obj.getcustomcrewman(EntityColour_CREW_BLUE); - j = obj.entities[i].dir; - } - else if (words[1] == "centerx") - { - words[2] = "donothing"; - j = -1; - textx = -500; - } - else if (words[1] == "centery") - { - words[2] = "donothing"; - j = -1; - texty = -500; - } - else if (words[1] == "center") - { - words[2] = "donothing"; - j = -1; - textx = -500; - texty = -500; - } - - if(i==0 && words[1]!="player" && words[1]!="cyan"){ - //Requested crewmate is not actually on screen - words[2] = "donothing"; - j = -1; - textx = -500; - texty = -500; - } - - if (INBOUNDS_VEC(i, obj.entities) && (j == 0 || j == 1)) - { - if (words[2] == "above") - { - textcrewmateposition.text_above = true; - } - - textx = 0; - texty = 0; - textcrewmateposition.x = obj.entities[i].xp; - textcrewmateposition.override_x = true; - textcrewmateposition.y = obj.entities[i].yp; - textcrewmateposition.override_y = true; - - textcrewmateposition.dir = j; - } - } - else if (words[0] == "backgroundtext") - { - game.backgroundtext = true; - } - else if (words[0] == "textboxtimer") - { - textboxtimer = ss_toi(words[1]); - } - else if (words[0] == "textsprite") - { - TextboxSprite sprite; - sprite.x = ss_toi(words[1]); - sprite.y = ss_toi(words[2]); - sprite.tile = ss_toi(words[3]); - sprite.col = ss_toi(words[4]); - textbox_sprites.push_back(sprite); - } - else if (words[0] == "textimage") - { - if (words[1] == "levelcomplete") - { - textbox_image = TEXTIMAGE_LEVELCOMPLETE; - } - else if (words[1] == "gamecomplete") - { - textbox_image = TEXTIMAGE_GAMECOMPLETE; - } - else - { - textbox_image = TEXTIMAGE_NONE; - } - } - else if (words[0] == "textoutline") - { - if (words[1] == "default") - { - textbox_force_outline = false; - } - else if (words[1] == "on") - { - textbox_force_outline = true; - textbox_outline = true; - } - else if (words[1] == "off") - { - textbox_force_outline = true; - textbox_outline = false; - } - } - else if (words[0] == "flipme") - { - textflipme = !textflipme; - } - else if (words[0] == "speak_active" || words[0] == "speak") - { - //Ok, actually display the textbox we've initilised now! - //If using "speak", don't make the textbox active (so we can use multiple textboxes) - if (txt.empty()) - { - txt.resize(1); - } - graphics.createtextboxreal(txt[0], textx, texty, r, g, b, textflipme); - textflipme = false; - - graphics.setlarge(textlarge); - textlarge = false; - - if ((int) txt.size() > 1) - { - for (i = 1; i < (int) txt.size(); i++) - { - graphics.addline(txt[i]); - } - } - - if (textboxtimer > 0) - { - graphics.textboxtimer(textboxtimer); - } - - for (size_t i = 0; i < textbox_sprites.size(); i++) - { - graphics.addsprite(textbox_sprites[i].x, textbox_sprites[i].y, textbox_sprites[i].tile, textbox_sprites[i].col); - } - - graphics.setimage(textbox_image); - - if (textbox_absolutepos) - { - graphics.textboxabsolutepos(textx, texty); - } - else - { - if (textx == -500 || textx == -1) - { - graphics.textboxcenterx(); - textcrewmateposition.override_x = false; - } - - if (texty == -500) - { - graphics.textboxcentery(); - textcrewmateposition.override_y = false; - } - } - - if (textbox_force_outline) - { - graphics.textboxoutline(textbox_outline); - } - - TextboxOriginalContext context = TextboxOriginalContext(); - context.text_case = textcase; - context.lines = std::vector(txt); - context.script_name = scriptname; - context.x = textx; - context.y = texty; - - graphics.textboxcrewmateposition(&textcrewmateposition); - graphics.textboxoriginalcontext(&context); - graphics.textboxcase(textcase); - if (map.custommode) - { - uint32_t flags = PR_FONT_IDX(font::font_idx_level, cl.rtl); - if (font::font_idx_level_is_custom) - { - flags |= PR_FONT_IDX_IS_CUSTOM; - } - graphics.textboxprintflags(flags); - } - graphics.textboxtranslate(TEXTTRANSLATE_CUTSCENE, NULL); - - graphics.textboxapplyposition(); - if (words[0] == "speak_active") - { - graphics.textboxactive(); - } - - if (!game.backgroundtext) - { - game.advancetext = true; - game.hascontrol = false; - game.pausescript = true; - if (key.isDown(90) || key.isDown(32) || key.isDown(86) - || key.isDown(KEYBOARD_UP) || key.isDown(KEYBOARD_DOWN)) game.jumpheld = true; - } - game.backgroundtext = false; - - if (textbuttons) - { - graphics.textboxbuttons(); - } - textbuttons = false; - - textcase = 1; - } - else if (words[0] == "endtext") - { - graphics.textboxremove(); - game.hascontrol = true; - game.advancetext = false; - } - else if (words[0] == "endtextfast") - { - graphics.textboxremovefast(); - game.hascontrol = true; - game.advancetext = false; - } - else if (words[0] == "do") - { - //right, loop from this point - looppoint = position; - loopcount = ss_toi(words[1]); - } - else if (words[0] == "loop") - { - //right, loop from this point - loopcount--; - if (loopcount > 0) - { - position = looppoint; - } - } - else if (words[0] == "vvvvvvman") - { - //Create the super VVVVVV combo! - i = obj.getplayer(); - if (INBOUNDS_VEC(i, obj.entities)) - { - obj.entities[i].xp = 30; - obj.entities[i].yp = 46; - obj.entities[i].lerpoldxp = obj.entities[i].xp; - obj.entities[i].lerpoldyp = obj.entities[i].yp; - obj.entities[i].size = 13; - obj.entities[i].colour = EntityColour_GRAVITRON_INDICATOR; - obj.entities[i].cx = 36;// 6; - obj.entities[i].cy = 12+80;// 2; - obj.entities[i].h = 126-80;// 21; - } - } - else if (words[0] == "undovvvvvvman") - { - //Create the super VVVVVV combo! - i = obj.getplayer(); - if (INBOUNDS_VEC(i, obj.entities)) - { - obj.entities[i].xp = 100; - obj.entities[i].lerpoldxp = obj.entities[i].xp; - obj.entities[i].size = 0; - obj.entities[i].colour = EntityColour_CREW_CYAN; - obj.entities[i].cx = 6; - obj.entities[i].cy = 2; - obj.entities[i].h = 21; - } - } - else if (words[0] == "createentity") - { - std::string word6 = words[6]; - std::string word7 = words[7]; - std::string word8 = words[8]; - std::string word9 = words[9]; - if (!argexists[6]) words[6] = "0"; - if (!argexists[7]) words[7] = "0"; - if (!argexists[8]) words[8] = "320"; - if (!argexists[9]) words[9] = "240"; - obj.createentity( - ss_toi(words[1]), - ss_toi(words[2]), - ss_toi(words[3]), - ss_toi(words[4]), - ss_toi(words[5]), - ss_toi(words[6]), - ss_toi(words[7]), - ss_toi(words[8]), - ss_toi(words[9]) - ); - words[6] = word6; - words[7] = word7; - words[8] = word8; - words[9] = word9; - } - else if (words[0] == "createcrewman") - { - // Note: Do not change the "r" variable, it's used in custom levels - // to have glitchy textbox colors, where the game treats the value - // we set here as the red channel for the color. - r = getcolorfromname(words[3]); - if (r == -1) r = 19; - - //convert the command to the right index - if (words[5] == "followplayer") words[5] = "10"; - if (words[5] == "followpurple") words[5] = "11"; - if (words[5] == "followyellow") words[5] = "12"; - if (words[5] == "followred") words[5] = "13"; - if (words[5] == "followgreen") words[5] = "14"; - if (words[5] == "followblue") words[5] = "15"; - - if (words[5] == "followposition") words[5] = "16"; - if (words[5] == "faceleft") - { - words[5] = "17"; - words[6] = "0"; - } - if (words[5] == "faceright") - { - words[5] = "17"; - words[6] = "1"; - } - if (words[5] == "faceplayer") - { - words[5] = "18"; - words[6] = "0"; - } - if (words[5] == "panic") - { - words[5] = "20"; - words[6] = "0"; - } - - if (ss_toi(words[5]) >= 16) - { - obj.createentity(ss_toi(words[1]), ss_toi(words[2]), 18, r, ss_toi(words[4]), ss_toi(words[5]), ss_toi(words[6])); - } - else - { - obj.createentity(ss_toi(words[1]), ss_toi(words[2]), 18, r, ss_toi(words[4]), ss_toi(words[5])); - } - } - else if (words[0] == "changemood") - { - int crewmate = getcrewmanfromname(words[1]); - if (crewmate != -1) i = crewmate; // Ensure AEM is kept - - if (INBOUNDS_VEC(i, obj.entities) && ss_toi(words[2]) == 0) - { - obj.entities[i].tile = 0; - } - else if (INBOUNDS_VEC(i, obj.entities)) - { - obj.entities[i].tile = 144; - } - } - else if (words[0] == "changecustommood") - { - if (words[1] == "player") - { - i=obj.getcustomcrewman(EntityColour_CREW_CYAN); - obj.customcrewmoods[0]=ss_toi(words[2]); - } - else if (words[1] == "cyan") - { - i=obj.getcustomcrewman(EntityColour_CREW_CYAN); - obj.customcrewmoods[0]=ss_toi(words[2]); - } - else if (words[1] == "customcyan") - { - i=obj.getcustomcrewman(EntityColour_CREW_CYAN); - obj.customcrewmoods[0]=ss_toi(words[2]); - } - else if (words[1] == "red") - { - i=obj.getcustomcrewman(EntityColour_CREW_RED); - obj.customcrewmoods[3]=ss_toi(words[2]); - } - else if (words[1] == "green") - { - i=obj.getcustomcrewman(EntityColour_CREW_GREEN); - obj.customcrewmoods[4]=ss_toi(words[2]); - } - else if (words[1] == "yellow") - { - i=obj.getcustomcrewman(EntityColour_CREW_YELLOW); - obj.customcrewmoods[2]=ss_toi(words[2]); - } - else if (words[1] == "blue") - { - i=obj.getcustomcrewman(EntityColour_CREW_BLUE); - obj.customcrewmoods[5]=ss_toi(words[2]); - } - else if (words[1] == "purple") - { - i=obj.getcustomcrewman(EntityColour_CREW_PURPLE); - obj.customcrewmoods[1]=ss_toi(words[2]); - } - else if (words[1] == "pink") - { - i=obj.getcustomcrewman(EntityColour_CREW_PURPLE); - obj.customcrewmoods[1]=ss_toi(words[2]); - } - - if (INBOUNDS_VEC(i, obj.entities) && ss_toi(words[2]) == 0) - { - obj.entities[i].tile = 0; - } - else if (INBOUNDS_VEC(i, obj.entities)) - { - obj.entities[i].tile = 144; - } - } - else if (words[0] == "changetile") - { - int crewmate = getcrewmanfromname(words[1]); - if (crewmate != -1) i = crewmate; // Ensure AEM is kept - - if (INBOUNDS_VEC(i, obj.entities)) - { - obj.entities[i].tile = ss_toi(words[2]); - } - } - else if (words[0] == "flipgravity") - { - //not something I'll use a lot, I think. Doesn't need to be very robust! - if (words[1] == "player") - { - game.gravitycontrol = !game.gravitycontrol; - ++game.totalflips; - } - else - { - int crewmate = getcrewmanfromname(words[1]); - if (crewmate != -1) i = crewmate; // Ensure AEM is kept - - if (INBOUNDS_VEC(i, obj.entities) && obj.entities[i].rule == 7) - { - obj.entities[i].rule = 6; - obj.entities[i].tile = 0; - } - else if (INBOUNDS_VEC(i, obj.entities) && obj.getplayer() != i) // Don't destroy player entity - { - obj.entities[i].rule = 7; - obj.entities[i].tile = 6; - } - } - } - else if (words[0] == "changegravity") - { - //not something I'll use a lot, I think. Doesn't need to be very robust! - int crewmate = getcrewmanfromname(words[1]); - if (crewmate != -1) i = crewmate; // Ensure AEM is kept - - if (INBOUNDS_VEC(i, obj.entities)) - { - obj.entities[i].tile +=12; - } - } - else if (words[0] == "changedir") - { - int crewmate = getcrewmanfromname(words[1]); - if (crewmate != -1) i = crewmate; // Ensure AEM is kept - - if (INBOUNDS_VEC(i, obj.entities) && ss_toi(words[2]) == 0) - { - obj.entities[i].dir = 0; - } - else if (INBOUNDS_VEC(i, obj.entities)) - { - obj.entities[i].dir = 1; - } - } - else if (words[0] == "alarmon") - { - game.alarmon = true; - game.alarmdelay = 0; - } - else if (words[0] == "alarmoff") - { - game.alarmon = false; - } - else if (words[0] == "changeai") - { - int crewmate = getcrewmanfromname(words[1]); - if (crewmate != -1) i = crewmate; // Ensure AEM is kept - - if (words[2] == "followplayer") words[2] = "10"; - if (words[2] == "followpurple") words[2] = "11"; - if (words[2] == "followyellow") words[2] = "12"; - if (words[2] == "followred") words[2] = "13"; - if (words[2] == "followgreen") words[2] = "14"; - if (words[2] == "followblue") words[2] = "15"; - - if (words[2] == "followposition") words[2] = "16"; - if (words[2] == "faceleft") - { - words[2] = "17"; - words[3] = "0"; - } - if (words[2] == "faceright") - { - words[2] = "17"; - words[3] = "1"; - } - - - if (INBOUNDS_VEC(i, obj.entities)) - { - obj.entities[i].state = ss_toi(words[2]); - if (obj.entities[i].state == 16) - { - obj.entities[i].para=ss_toi(words[3]); - } - else if (obj.entities[i].state == 17) - { - obj.entities[i].dir=ss_toi(words[3]); - } - } - } - else if (words[0] == "activateteleporter") - { - i = obj.getteleporter(); - if (INBOUNDS_VEC(i, obj.entities)) - { - obj.entities[i].tile = 6; - obj.entities[i].colour = EntityColour_TELEPORTER_FLASHING; - } - } - else if (words[0] == "changecolour") - { - int crewmate = getcrewmanfromname(words[1]); - if (crewmate != -1) i = crewmate; // Ensure AEM is kept - - if (INBOUNDS_VEC(i, obj.entities)) - { - obj.entities[i].colour = getcolorfromname(words[2]); - } - } - else if (words[0] == "squeak") - { - if (words[1] == "player") - { - music.playef(Sound_VIRIDIAN); - } - else if (words[1] == "cyan") - { - music.playef(Sound_VIRIDIAN); - } - else if (words[1] == "red") - { - music.playef(Sound_VERMILION); - } - else if (words[1] == "green") - { - music.playef(Sound_VERDIGRIS); - } - else if (words[1] == "yellow") - { - music.playef(Sound_VITELLARY); - } - else if (words[1] == "blue") - { - music.playef(Sound_VICTORIA); - } - else if (words[1] == "purple") - { - music.playef(Sound_VIOLET); - } - else if (words[1] == "cry") - { - music.playef(Sound_CRY); - } - else if (words[1] == "terminal") - { - music.playef(Sound_TERMINALTEXT); - } - } - else if (words[0] == "blackout") - { - game.blackout = true; - } - else if (words[0] == "blackon") - { - game.blackout = false; - } - else if (words[0] == "setcheckpoint") - { - i = obj.getplayer(); - game.savepoint = 0; - if (INBOUNDS_VEC(i, obj.entities)) - { - game.savex = obj.entities[i].xp ; - game.savey = obj.entities[i].yp; - } - game.savegc = game.gravitycontrol; - game.saverx = game.roomx; - game.savery = game.roomy; - if (INBOUNDS_VEC(i, obj.entities)) - { - game.savedir = obj.entities[i].dir; - } - - game.checkpoint_save(); - } - else if (words[0] == "gamestate") - { - // Allow the gamestate command to bypass statelock, at least for now - game.state = ss_toi(words[1]); - game.statedelay = 0; - } - else if (words[0] == "textboxactive") - { - graphics.textboxactive(); - } - else if (words[0] == "gamemode") - { - if (words[1] == "teleporter") - { - game.gamestate = GAMEMODE; /* to set prevgamestate */ - game.mapmenuchange(TELEPORTERMODE, false); - - game.useteleporter = false; //good heavens don't actually use it - } - else if (words[1] == "game") - { - graphics.resumegamemode = true; - game.prevgamestate = GAMEMODE; - } - } - else if (words[0] == "ifexplored") - { - if (map.isexplored(ss_toi(words[1]), ss_toi(words[2]))) - { - loadalts(words[3], raw_words[3]); - position--; - } - } - else if (words[0] == "iflast") - { - if (game.lastsaved==ss_toi(words[1])) - { - loadalts(words[2], raw_words[2]); - position--; - } - } - else if (words[0] == "ifskip") - { - if (game.nocutscenes) - { - loadalts(words[1], raw_words[1]); - position--; - } - } - else if (words[0] == "ifflag") - { - int flag = ss_toi(words[1]); - if (INBOUNDS_ARR(flag, obj.flags) && obj.flags[flag]) - { - loadalts(words[2], raw_words[2]); - position--; - } - } - else if (words[0] == "ifcrewlost") - { - int crewmate = ss_toi(words[1]); - if (INBOUNDS_ARR(crewmate, game.crewstats) && !game.crewstats[crewmate]) - { - loadalts(words[2], raw_words[2]); - position--; - } - } - else if (words[0] == "iftrinkets") - { - if (game.trinkets() >= ss_toi(words[1])) - { - loadalts(words[2], raw_words[2]); - position--; - } - } - else if (words[0] == "iftrinketsless") - { - if (game.stat_trinkets < ss_toi(words[1])) - { - loadalts(words[2], raw_words[2]); - position--; - } - } - else if (words[0] == "hidecoordinates") - { - map.setexplored(ss_toi(words[1]), ss_toi(words[2]), false); - } - else if (words[0] == "showcoordinates") - { - map.setexplored(ss_toi(words[1]), ss_toi(words[2]), true); - } - else if (words[0] == "hideship") - { - map.hideship(); - } - else if (words[0] == "showship") - { - map.showship(); - } - else if (words[0] == "showsecretlab") - { - map.setexplored(16, 5, true); - map.setexplored(17, 5, true); - map.setexplored(18, 5, true); - map.setexplored(17, 6, true); - map.setexplored(18, 6, true); - map.setexplored(19, 6, true); - map.setexplored(19, 7, true); - map.setexplored(19, 8, true); - } - else if (words[0] == "hidesecretlab") - { - map.setexplored(16, 5, false); - map.setexplored(17, 5, false); - map.setexplored(18, 5, false); - map.setexplored(17, 6, false); - map.setexplored(18, 6, false); - map.setexplored(19, 6, false); - map.setexplored(19, 7, false); - map.setexplored(19, 8, false); - } - else if (words[0] == "mapexplored") - { - if (words[1] == "none") - { - map.resetmap(); - } - else if (words[1] == "all") - { - map.fullmap(); - } - } - else if (words[0] == "mapreveal") - { - if (words[1] == "on") - { - map.revealmap = true; - } - else if (words[1] == "off") - { - map.revealmap = false; - } - } - else if (words[0] == "showteleporters") - { - map.showteleporters = true; - } - else if (words[0] == "showtargets") - { - map.showtargets = true; - } - else if (words[0] == "showtrinkets") - { - map.showtrinkets = true; - } - else if (words[0] == "hideteleporters") - { - map.showteleporters = false; - } - else if (words[0] == "hidetargets") - { - map.showtargets = false; - } - else if (words[0] == "hidetrinkets") - { - map.showtrinkets = false; - } - else if (words[0] == "hideplayer") - { - int player = obj.getplayer(); - if (INBOUNDS_VEC(player, obj.entities)) - { - obj.entities[player].invis = true; - } - } - else if (words[0] == "showplayer") - { - int player = obj.getplayer(); - if (INBOUNDS_VEC(player, obj.entities)) - { - obj.entities[player].invis = false; - } - } - else if (words[0] == "teleportscript") - { - game.teleportscript = words[1]; - } - else if (words[0] == "clearteleportscript") - { - game.teleportscript = ""; - } - else if (words[0] == "nocontrol") - { - game.hascontrol = false; - } - else if (words[0] == "hascontrol") - { - game.hascontrol = true; - } - else if (words[0] == "companion") - { - game.companion = ss_toi(words[1]); - } - else if (words[0] == "befadein") - { - graphics.setfade(0); - graphics.fademode = FADE_NONE; - } - else if (words[0] == "fadein") - { - graphics.fademode = FADE_START_FADEIN; - } - else if (words[0] == "fadeout") - { - graphics.fademode = FADE_START_FADEOUT; - } - else if (words[0] == "untilfade") - { - if (FADEMODE_IS_FADING(graphics.fademode)) - { - scriptdelay = 1; - position--; - } - } - else if (words[0] == "entersecretlab") - { - game.unlocknum(Unlock_SECRETLAB); - game.insecretlab = true; - map.fullmap(); - } - else if (words[0] == "leavesecretlab") - { - game.insecretlab = false; - } - else if (words[0] == "resetgame") - { - map.resetmap(); - map.resetplayer(); - graphics.towerbg.tdrawback = true; - - obj.resetallflags(); - i = obj.getplayer(); - if (INBOUNDS_VEC(i, obj.entities)) - { - obj.entities[i].tile = 0; - } - - for (i = 0; i < 100; i++) - { - obj.collect[i] = false; - obj.customcollect[i] = false; - } - game.deathcounts = 0; - game.advancetext = false; - game.hascontrol = true; - game.resetgameclock(); - game.gravitycontrol = 0; - game.teleport = false; - game.companion = 0; - game.teleport_to_new_area = false; - game.teleport_to_x = 0; - game.teleport_to_y = 0; - - game.teleportscript = ""; - - //get out of final level mode! - map.finalmode = false; - map.final_colormode = false; - map.final_mapcol = 0; - map.final_colorframe = 0; - map.finalstretch = false; - } - else if (words[0] == "loadscript") - { - loadalts(words[1], raw_words[1]); - position--; - } - else if (words[0] == "rollcredits") - { - if (map.custommode && !map.custommodeforreal) - { - game.returntoeditor(); - ed.show_note(loc::gettext("Rolled credits")); - } - else - { - game.gamestate = GAMECOMPLETE; - graphics.fademode = FADE_START_FADEIN; - game.creditposition = 0; - game.skip_message_timer = 1000; - game.old_skip_message_timer = 1000; - } - } - else if (words[0] == "finalmode") - { - map.finalmode = true; - map.gotoroom(ss_toi(words[1]), ss_toi(words[2])); - } - else if (words[0] == "rescued") - { - if (words[1] == "red") - { - game.crewstats[3] = true; - } - else if (words[1] == "green") - { - game.crewstats[4] = true; - } - else if (words[1] == "yellow") - { - game.crewstats[2] = true; - } - else if (words[1] == "blue") - { - game.crewstats[5] = true; - } - else if (words[1] == "purple") - { - game.crewstats[1] = true; - } - else if (words[1] == "player") - { - game.crewstats[0] = true; - } - else if (words[1] == "cyan") - { - game.crewstats[0] = true; - } - } - else if (words[0] == "missing") - { - if (words[1] == "red") - { - game.crewstats[3] = false; - } - else if (words[1] == "green") - { - game.crewstats[4] = false; - } - else if (words[1] == "yellow") - { - game.crewstats[2] = false; - } - else if (words[1] == "blue") - { - game.crewstats[5] = false; - } - else if (words[1] == "purple") - { - game.crewstats[1] = false; - } - else if (words[1] == "player") - { - game.crewstats[0] = false; - } - else if (words[1] == "cyan") - { - game.crewstats[0] = false; - } - } - else if (words[0] == "face") - { - int crewmate = getcrewmanfromname(words[1]); - if (crewmate != -1) i = crewmate; // Ensure AEM is kept - - crewmate = getcrewmanfromname(words[2]); - if (crewmate != -1) j = crewmate; // Ensure AEM is kept - - if (INBOUNDS_VEC(i, obj.entities) && INBOUNDS_VEC(j, obj.entities) && obj.entities[j].xp > obj.entities[i].xp + 5) - { - obj.entities[i].dir = 1; - } - else if (INBOUNDS_VEC(i, obj.entities) && INBOUNDS_VEC(j, obj.entities) && obj.entities[j].xp < obj.entities[i].xp - 5) - { - obj.entities[i].dir = 0; - } - } - else if (words[0] == "jukebox") - { - for (j = 0; j < (int) obj.entities.size(); j++) - { - if (obj.entities[j].type == EntityType_TERMINAL) - { - obj.entities[j].colour = EntityColour_INACTIVE_ENTITY; - } - } - if (ss_toi(words[1]) == 1) - { - obj.createblock(5, 88 - 4, 80, 20, 16, 25); - for (j = 0; j < (int) obj.entities.size(); j++) - { - if (obj.entities[j].xp == 88 && obj.entities[j].yp==80) - { - obj.entities[j].colour = EntityColour_ACTIVE_ENTITY; - } - } - } - else if (ss_toi(words[1]) == 2) - { - obj.createblock(5, 128 - 4, 80, 20, 16, 26); - for (j = 0; j < (int) obj.entities.size(); j++) - { - if (obj.entities[j].xp == 128 && obj.entities[j].yp==80) - { - obj.entities[j].colour = EntityColour_ACTIVE_ENTITY; - } - } - } - else if (ss_toi(words[1]) == 3) - { - obj.createblock(5, 176 - 4, 80, 20, 16, 27); - for (j = 0; j < (int) obj.entities.size(); j++) - { - if (obj.entities[j].xp == 176 && obj.entities[j].yp==80) - { - obj.entities[j].colour = EntityColour_ACTIVE_ENTITY; - } - } - } - else if (ss_toi(words[1]) == 4) - { - obj.createblock(5, 216 - 4, 80, 20, 16, 28); - for (j = 0; j < (int) obj.entities.size(); j++) - { - if (obj.entities[j].xp == 216 && obj.entities[j].yp==80) - { - obj.entities[j].colour = EntityColour_ACTIVE_ENTITY; - } - } - } - else if (ss_toi(words[1]) == 5) - { - obj.createblock(5, 88 - 4, 128, 20, 16, 29); - for (j = 0; j < (int) obj.entities.size(); j++) - { - if (obj.entities[j].xp == 88 && obj.entities[j].yp==128) - { - obj.entities[j].colour = EntityColour_ACTIVE_ENTITY; - } - } - } - else if (ss_toi(words[1]) == 6) - { - obj.createblock(5, 176 - 4, 128, 20, 16, 30); - for (j = 0; j < (int) obj.entities.size(); j++) - { - if (obj.entities[j].xp == 176 && obj.entities[j].yp==128) - { - obj.entities[j].colour = EntityColour_ACTIVE_ENTITY; - } - } - } - else if (ss_toi(words[1]) == 7) - { - obj.createblock(5, 40 - 4, 40, 20, 16, 31); - for (j = 0; j < (int) obj.entities.size(); j++) - { - if (obj.entities[j].xp == 40 && obj.entities[j].yp==40) - { - obj.entities[j].colour = EntityColour_ACTIVE_ENTITY; - } - } - } - else if (ss_toi(words[1]) == 8) - { - obj.createblock(5, 216 - 4, 128, 20, 16, 32); - for (j = 0; j < (int) obj.entities.size(); j++) - { - if (obj.entities[j].xp == 216 && obj.entities[j].yp==128) - { - obj.entities[j].colour = EntityColour_ACTIVE_ENTITY; - } - } - } - else if (ss_toi(words[1]) == 9) - { - obj.createblock(5, 128 - 4, 128, 20, 16, 33); - for (j = 0; j < (int) obj.entities.size(); j++) - { - if (obj.entities[j].xp == 128 && obj.entities[j].yp==128) - { - obj.entities[j].colour = EntityColour_ACTIVE_ENTITY; - } - } - } - else if (ss_toi(words[1]) == 10) - { - obj.createblock(5, 264 - 4, 40, 20, 16, 34); - for (j = 0; j < (int) obj.entities.size(); j++) - { - if (obj.entities[j].xp == 264 && obj.entities[j].yp==40) - { - obj.entities[j].colour = EntityColour_ACTIVE_ENTITY; - } - } - } - } - else if (words[0] == "createactivityzone") - { - int crew_color = i; // stay consistent with past behavior! - if (words[1] == "red") - { - i = 3; - crew_color = EntityColour_CREW_RED; - } - else if (words[1] == "green") - { - i = 4; - crew_color = EntityColour_CREW_GREEN; - } - else if (words[1] == "yellow") - { - i = 2; - crew_color = EntityColour_CREW_YELLOW; - } - else if (words[1] == "blue") - { - i = 5; - crew_color = EntityColour_CREW_BLUE; - } - else if (words[1] == "purple") - { - i = 1; - crew_color = EntityColour_CREW_PURPLE; - } - - int crewman = obj.getcrewman(crew_color); - if (INBOUNDS_VEC(crewman, obj.entities) && crew_color == EntityColour_CREW_GREEN) - { - obj.createblock(5, obj.entities[crewman].xp - 32, obj.entities[crewman].yp-20, 96, 60, i, "", (i == 35)); - } - else if (INBOUNDS_VEC(crewman, obj.entities)) - { - obj.createblock(5, obj.entities[crewman].xp - 32, 0, 96, 240, i, "", (i == 35)); - } - } - else if (words[0] == "setactivitycolour") - { - obj.customactivitycolour = words[1]; - } - else if (words[0] == "setactivitytext") - { - ++position; - if (INBOUNDS_VEC(position, commands)) - { - obj.customactivitytext = commands[position]; - } - } - else if (words[0] == "setactivityposition") - { - obj.customactivitypositiony = ss_toi(words[1]); - } - else if (words[0] == "createrescuedcrew") - { - //special for final level cutscene - //starting at 180, create the rescued crewmembers (ingoring violet, who's at 155) - i = 215; - if (game.crewstats[2] && game.lastsaved!=2) - { - obj.createentity(i, 153, 18, 14, 0, 17, 0); - i += 25; - } - if (game.crewstats[3] && game.lastsaved!=3) - { - obj.createentity(i, 153, 18, 15, 0, 17, 0); - i += 25; - } - if (game.crewstats[4] && game.lastsaved!=4) - { - obj.createentity(i, 153, 18, 13, 0, 17, 0); - i += 25; - } - if (game.crewstats[5] && game.lastsaved!=5) - { - obj.createentity(i, 153, 18, 16, 0, 17, 0); - i += 25; - } - } - else if (words[0] == "restoreplayercolour") - { - i = obj.getplayer(); - if (INBOUNDS_VEC(i, obj.entities)) - { - obj.entities[i].colour = cl.player_colour; - } - game.savecolour = cl.player_colour; - } - else if (words[0] == "changeplayercolour") - { - i = obj.getplayer(); - - if (INBOUNDS_VEC(i, obj.entities)) - { - obj.entities[i].colour = getcolorfromname(words[1]); - } - } - else if (words[0] == "changerespawncolour") - { - game.savecolour = getcolorfromname(words[1]); - } - else if (words[0] == "altstates") - { - obj.altstates = ss_toi(words[1]); - } - else if (words[0] == "activeteleporter") - { - i = obj.getteleporter(); - if (INBOUNDS_VEC(i, obj.entities)) - { - obj.entities[i].colour = EntityColour_TELEPORTER_ACTIVE; - } - } - else if (words[0] == "foundtrinket") - { - music.silencedasmusik(); - music.playef(Sound_TRINKET); - - size_t trinket = ss_toi(words[1]); - if (trinket < SDL_arraysize(obj.collect)) - { - obj.collect[trinket] = true; - } - - graphics.textboxremovefast(); - - graphics.createtextboxflipme("", 50, 85, TEXT_COLOUR("gray")); - graphics.textboxprintflags(PR_FONT_INTERFACE); - graphics.textboxcenterx(); - graphics.textboxtranslate(TEXTTRANSLATE_FUNCTION, foundtrinket_textbox1); - graphics.textboxapplyposition(); - - graphics.createtextboxflipme("", 50, 95, TEXT_COLOUR("gray")); - graphics.textboxprintflags(PR_FONT_INTERFACE); - graphics.textboxcenterx(); - graphics.textboxindex(graphics.textboxes.size() - 2); - graphics.textboxtranslate(TEXTTRANSLATE_FUNCTION, foundtrinket_textbox2); - graphics.textboxapplyposition(); - - if (!game.backgroundtext) - { - game.advancetext = true; - game.hascontrol = false; - game.pausescript = true; - if (key.isDown(90) || key.isDown(32) || key.isDown(86) - || key.isDown(KEYBOARD_UP) || key.isDown(KEYBOARD_DOWN)) game.jumpheld = true; - } - game.backgroundtext = false; - } - else if (words[0] == "foundlab") - { - music.playef(Sound_TRINKET); - - graphics.textboxremovefast(); - - graphics.createtextbox("", 50, 85, TEXT_COLOUR("gray")); - graphics.textboxprintflags(PR_FONT_INTERFACE); - graphics.textboxcenterx(); - graphics.textboxcentery(); - graphics.textboxtranslate(TEXTTRANSLATE_FUNCTION, foundlab_textbox1); - graphics.textboxapplyposition(); - - if (!game.backgroundtext) - { - game.advancetext = true; - game.hascontrol = false; - game.pausescript = true; - if (key.isDown(90) || key.isDown(32) || key.isDown(86) - || key.isDown(KEYBOARD_UP) || key.isDown(KEYBOARD_DOWN)) game.jumpheld = true; - } - game.backgroundtext = false; - } - else if (words[0] == "foundlab2") - { - graphics.textboxremovefast(); - - graphics.createtextbox("", 50, 85, TEXT_COLOUR("gray")); - graphics.textboxprintflags(PR_FONT_INTERFACE); - graphics.textboxcenterx(); - graphics.textboxcentery(); - graphics.textboxtranslate(TEXTTRANSLATE_FUNCTION, foundlab_textbox2); - graphics.textboxapplyposition(); - - if (!game.backgroundtext) - { - game.advancetext = true; - game.hascontrol = false; - game.pausescript = true; - if (key.isDown(90) || key.isDown(32) || key.isDown(86) - || key.isDown(KEYBOARD_UP) || key.isDown(KEYBOARD_DOWN)) game.jumpheld = true; - } - game.backgroundtext = false; - } - else if (words[0] == "everybodysad") - { - for (i = 0; i < (int) obj.entities.size(); i++) - { - if (obj.entities[i].rule == 6 || obj.entities[i].rule == 0) - { - obj.entities[i].tile = 144; - } - } - } - else if (words[0] == "startintermission2") - { - map.finalmode = true; //Enable final level mode - - game.savex = 228; - game.savey = 129; - game.saverx = 53; - game.savery = 49; - game.savegc = 0; - game.savedir = 0; //Intermission level 2 - game.savepoint = 0; - game.gravitycontrol = 0; - - map.gotoroom(46, 54); - } - else if (words[0] == "telesave") - { - if (!game.intimetrial && !game.nodeathmode && !game.inintermission) game.savetele(); - } - else if (words[0] == "createlastrescued") - { - r = graphics.crewcolour(game.lastsaved); - if (r == EntityColour_CREW_CYAN || r == EntityColour_CREW_PURPLE) - { - r = EntityColour_CREW_GRAY; // Default to gray if invalid color. - } - - obj.createentity(200, 153, 18, r, 0, 19, 30); - i = obj.getcrewman(game.lastsaved); - if (INBOUNDS_VEC(i, obj.entities)) - { - obj.entities[i].dir = 1; - } - } - else if (words[0] == "specialline") - { - //Localization is handled with regular cutscene dialogue - switch(ss_toi(words[1])) - { - case 1: - txt.resize(1); - - txt[0] = "I'm worried about " + game.unrescued() + ", Doctor!"; - break; - case 2: - txt.resize(3); - - if (game.crewrescued() < 5) - { - txt[1] = "to helping you find the"; - txt[2] = "rest of the crew!"; - } - else - { - txt.resize(2); - txt[1] = "to helping you find " + game.unrescued() + "!"; - } - break; - } - } - else if (words[0] == "trinketbluecontrol") - { - if (game.trinkets() == 20 && obj.flags[67]) - { - load("talkblue_trinket6"); - position--; - } - else if (game.trinkets() >= 19 && !obj.flags[67]) - { - load("talkblue_trinket5"); - position--; - } - else - { - load("talkblue_trinket4"); - position--; - } - } - else if (words[0] == "trinketyellowcontrol") - { - if (game.trinkets() >= 19) - { - load("talkyellow_trinket3"); - position--; - } - else - { - load("talkyellow_trinket2"); - position--; - } - } - else if (words[0] == "redcontrol") - { - if (game.insecretlab) - { - load("talkred_14"); - position--; - } - else if (game.roomx != 104) - { - if (game.roomx == 100) - { - load("talkred_10"); - position--; - } - else if (game.roomx == 107) - { - load("talkred_11"); - position--; - } - else if (game.roomx == 114) - { - load("talkred_12"); - position--; - } - } - else if (obj.flags[67]) - { - //game complete - load("talkred_13"); - position--; - } - else if (obj.flags[35] && !obj.flags[52]) - { - //Intermission level - obj.flags[52] = true; - load("talkred_9"); - position--; - } - else if (!obj.flags[51]) - { - //We're back home! - obj.flags[51] = true; - load("talkred_5"); - position--; - } - else if (!obj.flags[48] && game.crewstats[5]) - { - //Victoria's back - obj.flags[48] = true; - load("talkred_6"); - position--; - } - else if (!obj.flags[49] && game.crewstats[4]) - { - //Verdigris' back - obj.flags[49] = true; - load("talkred_7"); - position--; - } - else if (!obj.flags[50] && game.crewstats[2]) - { - //Vitellary's back - obj.flags[50] = true; - load("talkred_8"); - position--; - } - else if (!obj.flags[45] && !game.crewstats[5]) - { - obj.flags[45] = true; - load("talkred_2"); - position--; - } - else if (!obj.flags[46] && !game.crewstats[4]) - { - obj.flags[46] = true; - load("talkred_3"); - position--; - } - else if (!obj.flags[47] && !game.crewstats[2]) - { - obj.flags[47] = true; - load("talkred_4"); - position--; - } - else - { - obj.flags[45] = false; - obj.flags[46] = false; - obj.flags[47] = false; - load("talkred_1"); - position--; - } - } - //TODO: Non Urgent fix compiler nesting errors without adding complexity - if (words[0] == "greencontrol") - { - if (game.insecretlab) - { - load("talkgreen_11"); - position--; - } - else if (game.roomx == 103 && game.roomy == 109) - { - load("talkgreen_8"); - position--; - } - else if (game.roomx == 101 && game.roomy == 109) - { - load("talkgreen_9"); - position--; - } - else if (obj.flags[67]) - { - //game complete - load("talkgreen_10"); - position--; - } - else if (obj.flags[34] && !obj.flags[57]) - { - //Intermission level - obj.flags[57] = true; - load("talkgreen_7"); - position--; - } - else if (!obj.flags[53]) - { - //Home! - obj.flags[53] = true; - load("talkgreen_6"); - position--; - } - else if (!obj.flags[54] && game.crewstats[2]) - { - obj.flags[54] = true; - load("talkgreen_5"); - position--; - } - else if (!obj.flags[55] && game.crewstats[3]) - { - obj.flags[55] = true; - load("talkgreen_4"); - position--; - } - else if (!obj.flags[56] && game.crewstats[5]) - { - obj.flags[56] = true; - load("talkgreen_3"); - position--; - } - else if (!obj.flags[58]) - { - obj.flags[58] = true; - load("talkgreen_2"); - position--; - } - else - { - load("talkgreen_1"); - position--; - } - } - else if (words[0] == "bluecontrol") - { - if (game.insecretlab) - { - load("talkblue_9"); - position--; - } - else if (obj.flags[67]) - { - //game complete, everything changes for victoria - if (obj.flags[41] && !obj.flags[42]) - { - //second trinket conversation - obj.flags[42] = true; - load("talkblue_trinket2"); - position--; - } - else if (!obj.flags[41] && !obj.flags[42]) - { - //Third trinket conversation - obj.flags[42] = true; - load("talkblue_trinket3"); - position--; - } - else - { - //Ok, we've already dealt with the trinket thing; so either you have them all, or you don't. If you do: - if (game.trinkets() >= 20) - { - load("startepilogue"); - position--; - } - else - { - load("talkblue_8"); - position--; - } - } - } - else if (obj.flags[33] && !obj.flags[40]) - { - //Intermission level - obj.flags[40] = true; - load("talkblue_7"); - position--; - } - else if (!obj.flags[36] && game.crewstats[5]) - { - //Back on the ship! - obj.flags[36] = true; - load("talkblue_3"); - position--; - } - else if (!obj.flags[41] && game.crewrescued() <= 4) - { - //First trinket conversation - obj.flags[41] = true; - load("talkblue_trinket1"); - position--; - } - else if (obj.flags[41] && !obj.flags[42] && game.crewrescued() == 5) - { - //second trinket conversation - obj.flags[42] = true; - load("talkblue_trinket2"); - position--; - } - else if (!obj.flags[41] && !obj.flags[42] && game.crewrescued() == 5) - { - //Third trinket conversation - obj.flags[42] = true; - load("talkblue_trinket3"); - position--; - } - else if (!obj.flags[37] && game.crewstats[2]) - { - obj.flags[37] = true; - load("talkblue_4"); - position--; - } - else if (!obj.flags[38] && game.crewstats[3]) - { - obj.flags[38] = true; - load("talkblue_5"); - position--; - } - else if (!obj.flags[39] && game.crewstats[4]) - { - obj.flags[39] = true; - load("talkblue_6"); - position--; - } - else - { - //if all else fails: - //if yellow is found - if (game.crewstats[2]) - { - load("talkblue_2"); - position--; - } - else - { - load("talkblue_1"); - position--; - } - } - } - else if (words[0] == "yellowcontrol") - { - if (game.insecretlab) - { - load("talkyellow_12"); - position--; - } - else if (obj.flags[67]) - { - //game complete - load("talkyellow_11"); - position--; - } - else if (obj.flags[32] && !obj.flags[31]) - { - //Intermission level - obj.flags[31] = true; - load("talkyellow_6"); - position--; - } - else if (!obj.flags[27] && game.crewstats[2]) - { - //Back on the ship! - obj.flags[27] = true; - load("talkyellow_10"); - position--; - } - else if (!obj.flags[43] && game.crewrescued() == 5 && !game.crewstats[5]) - { - //If by chance we've rescued everyone except Victoria by the end, Vitellary provides you with - //the trinket information instead. - obj.flags[43] = true; - obj.flags[42] = true; - obj.flags[41] = true; - load("talkyellow_trinket1"); - position--; - } - else if (!obj.flags[24] && game.crewstats[5]) - { - obj.flags[24] = true; - load("talkyellow_8"); - position--; - } - else if (!obj.flags[26] && game.crewstats[4]) - { - obj.flags[26] = true; - load("talkyellow_7"); - position--; - } - else if (!obj.flags[25] && game.crewstats[3]) - { - obj.flags[25] = true; - load("talkyellow_9"); - position--; - } - else if (!obj.flags[28]) - { - obj.flags[28] = true; - load("talkyellow_3"); - position--; - } - else if (!obj.flags[29]) - { - obj.flags[29] = true; - load("talkyellow_4"); - position--; - } - else if (!obj.flags[30]) - { - obj.flags[30] = true; - load("talkyellow_5"); - position--; - } - else if (!obj.flags[23]) - { - obj.flags[23] = true; - load("talkyellow_2"); - position--; - } - else - { - load("talkyellow_1"); - position--; - obj.flags[23] = false; - } - } - else if (words[0] == "purplecontrol") - { - //Controls Purple's conversion - //Crew rescued: - if (game.insecretlab) - { - load("talkpurple_9"); - position--; - } - else if (obj.flags[67]) - { - //game complete - load("talkpurple_8"); - position--; - } - else if (!obj.flags[17] && game.crewstats[4]) - { - obj.flags[17] = true; - load("talkpurple_6"); - position--; - } - else if (!obj.flags[15] && game.crewstats[5]) - { - obj.flags[15] = true; - load("talkpurple_4"); - position--; - } - else if (!obj.flags[16] && game.crewstats[3]) - { - obj.flags[16] = true; - load("talkpurple_5"); - position--; - } - else if (!obj.flags[18] && game.crewstats[2]) - { - obj.flags[18] = true; - load("talkpurple_7"); - position--; - } - else if (obj.flags[19] && !obj.flags[20] && !obj.flags[21]) - { - //intermission one: if played one / not had first conversation / not played two [conversation one] - obj.flags[21] = true; - load("talkpurple_intermission1"); - position--; - } - else if (obj.flags[20] && obj.flags[21] && !obj.flags[22]) - { - //intermission two: if played two / had first conversation / not had second conversation [conversation two] - obj.flags[22] = true; - load("talkpurple_intermission2"); - position--; - } - else if (obj.flags[20] && !obj.flags[21] && !obj.flags[22]) - { - //intermission two: if played two / not had first conversation / not had second conversation [conversation three] - obj.flags[22] = true; - load("talkpurple_intermission3"); - position--; - } - else if (!obj.flags[12]) - { - //Intro conversation - obj.flags[12] = true; - load("talkpurple_intro"); - position--; - } - else if (!obj.flags[14]) - { - //Shorter intro conversation - obj.flags[14] = true; - load("talkpurple_3"); - position--; - } - else - { - //if all else fails: - //if green is found - if (game.crewstats[4]) - { - load("talkpurple_2"); - position--; - } - else - { - load("talkpurple_1"); - position--; - } - } - } - else if (words[0] == "textbuttons") - { - // Parse buttons in the next textbox - textbuttons = true; - } - else if (words[0] == "textcase") - { - // Used to disambiguate identical textboxes for translations (1 by default) - const int number = ss_toi(words[1]); - if (number >= 1 && number <= 255) - { - textcase = number; - } - } - else if (words[0] == "loadtext") - { - if (map.custommode) - { - loc::lang_custom = raw_words[1]; - loc::loadtext_custom(NULL); - } - } - else if (words[0] == "iflang") - { - if (loc::lang == raw_words[1]) - { - loadalts("custom_" + words[2], "custom_" + raw_words[2]); - position--; - } - } - else if (words[0] == "setfont" || words[0] == "setrtl") - { - if (words[0] == "setrtl") - { - if (words[1] == "on") - { - cl.rtl = true; - } - else if (words[1] == "off") - { - cl.rtl = false; - } - } - else if (words[1] == "") - { - font::set_level_font(cl.level_font_name.c_str()); - } - else - { - font::set_level_font(raw_words[1].c_str()); - } - if (words[0] == "setfont" && argexists[2] && words[2] == "all") - { - /* Immediately update all text boxes. */ - uint32_t flags = PR_FONT_IDX(font::font_idx_level, cl.rtl); - if (font::font_idx_level_is_custom) - { - flags |= PR_FONT_IDX_IS_CUSTOM; - } - - for (size_t i = 0; i < graphics.textboxes.size(); i++) - { - graphics.textboxes[i].print_flags = flags; - graphics.textboxes[i].resize(); - } - } - } - - position++; - } - else - { - running = false; - } - // Don't increment if we're at the max, signed int overflow is UB - if (execution_counter == SHRT_MAX) - { - // We must be in an infinite loop - vlog_warn("Warning: execution counter got to %i, stopping script", SHRT_MAX); - running = false; - } - else - { - execution_counter++; - } - } - - if(scriptdelay>0) - { - scriptdelay--; - } + if (!running) + { + return; + } + + // This counter here will stop the function when it gets too high + short execution_counter = 0; + while(running && scriptdelay<=0 && !game.pausescript) + { + if (INBOUNDS_VEC(position, commands)) + { + //Let's split or command in an array of words + tokenize(commands[position]); + + //For script assisted input + game.press_left = false; + game.press_right = false; + game.press_action = false; + game.press_map = false; + + //Ok, now we run a command based on that string + if (words[0] == "moveplayer") + { + //USAGE: moveplayer(x offset, y offset) + int player = obj.getplayer(); + if (INBOUNDS_VEC(player, obj.entities)) + { + obj.entities[player].xp += ss_toi(words[1]); + obj.entities[player].yp += ss_toi(words[2]); + obj.entities[player].lerpoldxp = obj.entities[player].xp; + obj.entities[player].lerpoldyp = obj.entities[player].yp; + } + scriptdelay = 1; + } +#if !defined(NO_CUSTOM_LEVELS) + if (words[0] == "warpdir") + { + int temprx=ss_toi(words[1])-1; + int tempry=ss_toi(words[2])-1; + const edlevelclass* room; + ed.setroomwarpdir(temprx, tempry, ss_toi(words[3])); + + room = ed.getroomprop(temprx, tempry); + + //Do we update our own room? + if(game.roomx-100==temprx && game.roomy-100==tempry){ + //If screen warping, then override all that: + graphics.backgrounddrawn = false; + map.warpx=false; map.warpy=false; + if(room->warpdir==0){ + map.background = 1; + //Be careful, we could be in a Lab or Warp Zone room... + if(room->tileset==2){ + //Lab + map.background = 2; + graphics.rcol = room->tilecol; + }else if(room->tileset==3){ + //Warp Zone + map.background = 6; + } + }else if(room->warpdir==1){ + map.warpx=true; + map.background=3; + graphics.rcol = ed.getwarpbackground(temprx,tempry); + }else if(room->warpdir==2){ + map.warpy=true; + map.background=4; + graphics.rcol = ed.getwarpbackground(temprx,tempry); + }else if(room->warpdir==3){ + map.warpx=true; map.warpy=true; + map.background = 5; + graphics.rcol = ed.getwarpbackground(temprx,tempry); + } + } + } + if (words[0] == "ifwarp") + { + const edlevelclass* const room = ed.getroomprop(ss_toi(words[1])-1, ss_toi(words[2])-1); + if (room->warpdir == ss_toi(words[3])) + { + load("custom_"+words[4]); + position--; + } + } +#endif + if (words[0] == "destroy") + { + if(words[1]=="gravitylines"){ + for(size_t edi=0; edi= ss_toi(words[1])) + { + load("custom_"+words[2]); + position--; + } + } + if (words[0] == "customiftrinketsless") + { + if (game.trinkets() < ss_toi(words[1])) + { + load("custom_"+words[2]); + position--; + } + } + else if (words[0] == "customifflag") + { + int flag = ss_toi(words[1]); + if (INBOUNDS_ARR(flag, obj.flags) && obj.flags[flag]) + { + load("custom_"+words[2]); + position--; + } + } + if (words[0] == "custommap") + { + if(words[1]=="on"){ + map.customshowmm=true; + }else if(words[1]=="off"){ + map.customshowmm=false; + } + } + if (words[0] == "delay") + { + //USAGE: delay(frames) + scriptdelay = ss_toi(words[1]); + } + if (words[0] == "flag") + { + int flag = ss_toi(words[1]); + if (INBOUNDS_ARR(flag, obj.flags)) + { + if (words[2] == "on") + { + obj.flags[flag] = true; + } + else if (words[2] == "off") + { + obj.flags[flag] = false; + } + } + } + if (words[0] == "flash") + { + //USAGE: flash(frames) + game.flashlight = ss_toi(words[1]); + } + if (words[0] == "shake") + { + //USAGE: shake(frames) + game.screenshake = ss_toi(words[1]); + } + if (words[0] == "walk") + { + //USAGE: walk(dir,frames) + if (words[1] == "left") + { + game.press_left = true; + } + else if (words[1] == "right") + { + game.press_right = true; + } + scriptdelay = ss_toi(words[2]); + } + if (words[0] == "flip") + { + game.press_action = true; + scriptdelay = 1; + } + if (words[0] == "tofloor") + { + int player = obj.getplayer(); + if(INBOUNDS_VEC(player, obj.entities) && obj.entities[player].onroof>0) + { + game.press_action = true; + scriptdelay = 1; + } + } + if (words[0] == "playef") + { + music.playef(ss_toi(words[1])); + } + if (words[0] == "play") + { + music.play(ss_toi(words[1])); + } + if (words[0] == "stopmusic") + { + music.haltdasmusik(); + } + if (words[0] == "resumemusic") + { + music.resumefade(0); + } + if (words[0] == "musicfadeout") + { + music.fadeout(false); + } + if (words[0] == "musicfadein") + { + music.fadein(); + } + if (words[0] == "trinketscriptmusic") + { + music.play(4); + } + if (words[0] == "gotoposition") + { + //USAGE: gotoposition(x position, y position, gravity position) + int player = obj.getplayer(); + if (INBOUNDS_VEC(player, obj.entities)) + { + obj.entities[player].xp = ss_toi(words[1]); + obj.entities[player].yp = ss_toi(words[2]); + obj.entities[player].lerpoldxp = obj.entities[player].xp; + obj.entities[player].lerpoldyp = obj.entities[player].yp; + } + game.gravitycontrol = ss_toi(words[3]); + + } + if (words[0] == "gotoroom") + { + //USAGE: gotoroom(x,y) (manually add 100) + map.gotoroom(ss_toi(words[1])+100, ss_toi(words[2])+100); + } + if (words[0] == "cutscene") + { + graphics.showcutscenebars = true; + } + if (words[0] == "endcutscene") + { + graphics.showcutscenebars = false; + } + if (words[0] == "audiopause") + { + if (words[1] == "on") + { + game.disabletemporaryaudiopause = false; + } + else if (words[1] == "off") + { + game.disabletemporaryaudiopause = true; + } + } + if (words[0] == "untilbars") + { + if (graphics.showcutscenebars) + { + if (graphics.cutscenebarspos < 360) + { + scriptdelay = 1; + position--; + } + } + else + { + if (graphics.cutscenebarspos > 0) + { + scriptdelay = 1; + position--; + } + } + } + else if (words[0] == "text") + { + //oh boy + //first word is the colour. + if (words[1] == "cyan") + { + r = 164; + g = 164; + b = 255; + } + else if (words[1] == "player") + { + r = 164; + g = 164; + b = 255; + } + else if (words[1] == "red") + { + r = 255; + g = 60; + b = 60; + } + else if (words[1] == "green") + { + r = 144; + g = 255; + b = 144; + } + else if (words[1] == "yellow") + { + r = 255; + g = 255; + b = 134; + } + else if (words[1] == "blue") + { + r = 95; + g = 95; + b = 255; + } + else if (words[1] == "purple") + { + r = 255; + g = 134; + b = 255; + } + else if (words[1] == "white") + { + r = 244; + g = 244; + b = 244; + } + else if (words[1] == "gray") + { + r = 174; + g = 174; + b = 174; + } + else if (words[1] == "orange") + { + r = 255; + g = 130; + b = 20; + } + else + { + //use a gray + r = 174; + g = 174; + b = 174; + } + + //next are the x,y coordinates + textx = ss_toi(words[2]); + texty = ss_toi(words[3]); + + //Number of lines for the textbox! + txt.clear(); + for (int i = 0; i < ss_toi(words[4]); i++) + { + position++; + if (INBOUNDS_VEC(position, commands)) + { + txt.push_back(commands[position]); + } + } + } + else if (words[0] == "position") + { + //are we facing left or right? for some objects we don't care, default at 0. + j = 0; + + //the first word is the object to position relative to + if (words[1] == "player") + { + i = obj.getplayer(); + if (INBOUNDS_VEC(i, obj.entities)) + { + j = obj.entities[i].dir; + } + } + else if (words[1] == "cyan") + { + i = obj.getcrewman(0); + j = obj.entities[i].dir; + } + else if (words[1] == "purple") + { + i = obj.getcrewman(1); + j = obj.entities[i].dir; + } + else if (words[1] == "yellow") + { + i = obj.getcrewman(2); + j = obj.entities[i].dir; + } + else if (words[1] == "red") + { + i = obj.getcrewman(3); + j = obj.entities[i].dir; + } + else if (words[1] == "green") + { + i = obj.getcrewman(4); + j = obj.entities[i].dir; + } + else if (words[1] == "blue") + { + i = obj.getcrewman(5); + j = obj.entities[i].dir; + } + else if (words[1] == "centerx") + { + words[2] = "donothing"; + j = -1; + textx = -500; + } + else if (words[1] == "centery") + { + words[2] = "donothing"; + j = -1; + texty = -500; + } + else if (words[1] == "center") + { + words[2] = "donothing"; + j = -1; + textx = -500; + texty = -500; + } + + //next is whether to position above or below + if (INBOUNDS_VEC(i, obj.entities) && words[2] == "above") + { + if (j == 1) //left + { + textx = obj.entities[i].xp -10000; //tells the box to be oriented correctly later + texty = obj.entities[i].yp - 16 - (txt.size()*8); + } + else if (j == 0) //Right + { + textx = obj.entities[i].xp - 16; + texty = obj.entities[i].yp - 18 - (txt.size() * 8); + } + } + else if (INBOUNDS_VEC(i, obj.entities)) + { + if (j == 1) //left + { + textx = obj.entities[i].xp -10000; //tells the box to be oriented correctly later + texty = obj.entities[i].yp + 26; + } + else if (j == 0) //Right + { + textx = obj.entities[i].xp - 16; + texty = obj.entities[i].yp + 26; + } + } + } + else if (words[0] == "customposition") + { + //are we facing left or right? for some objects we don't care, default at 0. + j = 0; + + //the first word is the object to position relative to + if (words[1] == "player") + { + i = obj.getcustomcrewman(0); + j = obj.entities[i].dir; + } + else if (words[1] == "cyan") + { + i = obj.getcustomcrewman(0); + j = obj.entities[i].dir; + } + else if (words[1] == "purple") + { + i = obj.getcustomcrewman(1); + j = obj.entities[i].dir; + } + else if (words[1] == "yellow") + { + i = obj.getcustomcrewman(2); + j = obj.entities[i].dir; + } + else if (words[1] == "red") + { + i = obj.getcustomcrewman(3); + j = obj.entities[i].dir; + } + else if (words[1] == "green") + { + i = obj.getcustomcrewman(4); + j = obj.entities[i].dir; + } + else if (words[1] == "blue") + { + i = obj.getcustomcrewman(5); + j = obj.entities[i].dir; + } + else if (words[1] == "centerx") + { + words[2] = "donothing"; + j = -1; + textx = -500; + } + else if (words[1] == "centery") + { + words[2] = "donothing"; + j = -1; + texty = -500; + } + else if (words[1] == "center") + { + words[2] = "donothing"; + j = -1; + textx = -500; + texty = -500; + } + + if(i==0 && words[1]!="player" && words[1]!="cyan"){ + //Requested crewmate is not actually on screen + words[2] = "donothing"; + j = -1; + textx = -500; + texty = -500; + } + + //next is whether to position above or below + if (INBOUNDS_VEC(i, obj.entities) && words[2] == "above") + { + if (j == 1) //left + { + textx = obj.entities[i].xp -10000; //tells the box to be oriented correctly later + texty = obj.entities[i].yp - 16 - (txt.size()*8); + } + else if (j == 0) //Right + { + textx = obj.entities[i].xp - 16; + texty = obj.entities[i].yp - 18 - (txt.size() * 8); + } + } + else if (INBOUNDS_VEC(i, obj.entities)) + { + if (j == 1) //left + { + textx = obj.entities[i].xp -10000; //tells the box to be oriented correctly later + texty = obj.entities[i].yp + 26; + } + else if (j == 0) //Right + { + textx = obj.entities[i].xp - 16; + texty = obj.entities[i].yp + 26; + } + } + } + else if (words[0] == "backgroundtext") + { + game.backgroundtext = true; + } + else if (words[0] == "flipme") + { + textflipme = !textflipme; + } + else if (words[0] == "speak_active" || words[0] == "speak") + { + //Ok, actually display the textbox we've initilised now! + //If using "speak", don't make the textbox active (so we can use multiple textboxes) + if (txt.empty()) + { + txt.resize(1); + } + graphics.createtextboxreal(txt[0], textx, texty, r, g, b, textflipme); + textflipme = false; + if ((int) txt.size() > 1) + { + for (i = 1; i < (int) txt.size(); i++) + { + graphics.addline(txt[i]); + } + } + + //the textbox cannot be outside the screen. Fix if it is. + if (textx <= -1000) + { + //position to the left of the player + textx += 10000; + textx -= graphics.textboxwidth(); + textx += 16; + graphics.textboxmoveto(textx); + } + + if (textx == -500 || textx == -1) + { + graphics.textboxcenterx(); + } + + if (texty == -500) + { + graphics.textboxcentery(); + } + + graphics.textboxadjust(); + if (words[0] == "speak_active") + { + graphics.textboxactive(); + } + + if (!game.backgroundtext) + { + game.advancetext = true; + game.hascontrol = false; + game.pausescript = true; + if (key.isDown(90) || key.isDown(32) || key.isDown(86) + || key.isDown(KEYBOARD_UP) || key.isDown(KEYBOARD_DOWN)) game.jumpheld = true; + } + game.backgroundtext = false; + } + else if (words[0] == "endtext") + { + graphics.textboxremove(); + game.hascontrol = true; + game.advancetext = false; + } + else if (words[0] == "endtextfast") + { + graphics.textboxremovefast(); + game.hascontrol = true; + game.advancetext = false; + } + else if (words[0] == "do") + { + //right, loop from this point + looppoint = position; + loopcount = ss_toi(words[1]); + } + else if (words[0] == "loop") + { + //right, loop from this point + loopcount--; + if (loopcount > 0) + { + position = looppoint; + } + } + else if (words[0] == "vvvvvvman") + { + //Create the super VVVVVV combo! + i = obj.getplayer(); + if (INBOUNDS_VEC(i, obj.entities)) + { + obj.entities[i].xp = 30; + obj.entities[i].yp = 46; + obj.entities[i].size = 13; + obj.entities[i].colour = 23; + obj.entities[i].cx = 36;// 6; + obj.entities[i].cy = 12+80;// 2; + obj.entities[i].h = 126-80;// 21; + } + } + else if (words[0] == "undovvvvvvman") + { + //Create the super VVVVVV combo! + i = obj.getplayer(); + if (INBOUNDS_VEC(i, obj.entities)) + { + obj.entities[i].xp = 100; + obj.entities[i].size = 0; + obj.entities[i].colour = 0; + obj.entities[i].cx = 6; + obj.entities[i].cy = 2; + obj.entities[i].h = 21; + } + } + else if (words[0] == "createentity") + { + std::string word6 = words[6]; + std::string word7 = words[7]; + std::string word8 = words[8]; + std::string word9 = words[9]; + if (!argexists[6]) words[6] = "0"; + if (!argexists[7]) words[7] = "0"; + if (!argexists[8]) words[8] = "320"; + if (!argexists[9]) words[9] = "240"; + obj.createentity( + ss_toi(words[1]), + ss_toi(words[2]), + ss_toi(words[3]), + ss_toi(words[4]), + ss_toi(words[5]), + ss_toi(words[6]), + ss_toi(words[7]), + ss_toi(words[8]), + ss_toi(words[9]) + ); + words[6] = word6; + words[7] = word7; + words[8] = word8; + words[9] = word9; + } + else if (words[0] == "createcrewman") + { + if (words[3] == "cyan") + { + r=0; + } + else if (words[3] == "red") + { + r=15; + } + else if (words[3] == "green") + { + r=13; + } + else if (words[3] == "yellow") + { + r=14; + } + else if (words[3] == "blue") + { + r=16; + } + else if (words[3] == "purple") + { + r=20; + } + else if (words[3] == "gray") + { + r=19; + } + else + { + r = 19; + } + + //convert the command to the right index + if (words[5] == "followplayer") words[5] = "10"; + if (words[5] == "followpurple") words[5] = "11"; + if (words[5] == "followyellow") words[5] = "12"; + if (words[5] == "followred") words[5] = "13"; + if (words[5] == "followgreen") words[5] = "14"; + if (words[5] == "followblue") words[5] = "15"; + + if (words[5] == "followposition") words[5] = "16"; + if (words[5] == "faceleft") + { + words[5] = "17"; + words[6] = "0"; + } + if (words[5] == "faceright") + { + words[5] = "17"; + words[6] = "1"; + } + if (words[5] == "faceplayer") + { + words[5] = "18"; + words[6] = "0"; + } + if (words[5] == "panic") + { + words[5] = "20"; + words[6] = "0"; + } + + if (ss_toi(words[5]) >= 16) + { + obj.createentity(ss_toi(words[1]), ss_toi(words[2]), 18, r, ss_toi(words[4]), ss_toi(words[5]), ss_toi(words[6])); + } + else + { + obj.createentity(ss_toi(words[1]), ss_toi(words[2]), 18, r, ss_toi(words[4]), ss_toi(words[5])); + } + } + else if (words[0] == "changemood") + { + if (words[1] == "player") + { + i=obj.getplayer(); + } + else if (words[1] == "cyan") + { + i=obj.getcrewman(0); + } + else if (words[1] == "customcyan") + { + i=obj.getcustomcrewman(0); + } + else if (words[1] == "red") + { + i=obj.getcrewman(3); + } + else if (words[1] == "green") + { + i=obj.getcrewman(4); + } + else if (words[1] == "yellow") + { + i=obj.getcrewman(2); + } + else if (words[1] == "blue") + { + i=obj.getcrewman(5); + } + else if (words[1] == "purple") + { + i=obj.getcrewman(1); + } + else if (words[1] == "pink") + { + i=obj.getcrewman(1); + } + + if (INBOUNDS_VEC(i, obj.entities) && ss_toi(words[2]) == 0) + { + obj.entities[i].tile = 0; + } + else if (INBOUNDS_VEC(i, obj.entities)) + { + obj.entities[i].tile = 144; + } + } + else if (words[0] == "changecustommood") + { + if (words[1] == "player") + { + i=obj.getcustomcrewman(0); + obj.customcrewmoods[0]=ss_toi(words[2]); + } + else if (words[1] == "cyan") + { + i=obj.getcustomcrewman(0); + obj.customcrewmoods[0]=ss_toi(words[2]); + } + else if (words[1] == "customcyan") + { + i=obj.getcustomcrewman(0); + obj.customcrewmoods[0]=ss_toi(words[2]); + } + else if (words[1] == "red") + { + i=obj.getcustomcrewman(3); + obj.customcrewmoods[3]=ss_toi(words[2]); + } + else if (words[1] == "green") + { + i=obj.getcustomcrewman(4); + obj.customcrewmoods[4]=ss_toi(words[2]); + } + else if (words[1] == "yellow") + { + i=obj.getcustomcrewman(2); + obj.customcrewmoods[2]=ss_toi(words[2]); + } + else if (words[1] == "blue") + { + i=obj.getcustomcrewman(5); + obj.customcrewmoods[5]=ss_toi(words[2]); + } + else if (words[1] == "purple") + { + i=obj.getcustomcrewman(1); + obj.customcrewmoods[1]=ss_toi(words[2]); + } + else if (words[1] == "pink") + { + i=obj.getcustomcrewman(1); + obj.customcrewmoods[1]=ss_toi(words[2]); + } + + if (INBOUNDS_VEC(i, obj.entities) && ss_toi(words[2]) == 0) + { + obj.entities[i].tile = 0; + } + else if (INBOUNDS_VEC(i, obj.entities)) + { + obj.entities[i].tile = 144; + } + } + else if (words[0] == "changetile") + { + if (words[1] == "player") + { + i=obj.getplayer(); + } + else if (words[1] == "cyan") + { + i=obj.getcrewman(0); + } + else if (words[1] == "red") + { + i=obj.getcrewman(3); + } + else if (words[1] == "green") + { + i=obj.getcrewman(4); + } + else if (words[1] == "yellow") + { + i=obj.getcrewman(2); + } + else if (words[1] == "blue") + { + i=obj.getcrewman(5); + } + else if (words[1] == "purple") + { + i=obj.getcrewman(1); + } + + if (INBOUNDS_VEC(i, obj.entities)) + { + obj.entities[i].tile = ss_toi(words[2]); + } + } + else if (words[0] == "flipgravity") + { + //not something I'll use a lot, I think. Doesn't need to be very robust! + if (words[1] == "player") + { + game.gravitycontrol = !game.gravitycontrol; + ++game.totalflips; + } + else + { + if (words[1] == "cyan") + { + i=obj.getcrewman(0); + } + else if (words[1] == "red") + { + i=obj.getcrewman(3); + } + else if (words[1] == "green") + { + i=obj.getcrewman(4); + } + else if (words[1] == "yellow") + { + i=obj.getcrewman(2); + } + else if (words[1] == "blue") + { + i=obj.getcrewman(5); + } + else if (words[1] == "purple") + { + i=obj.getcrewman(1); + } + + if (INBOUNDS_VEC(i, obj.entities) && obj.entities[i].rule == 7) + { + obj.entities[i].rule = 6; + obj.entities[i].tile = 0; + } + else if (INBOUNDS_VEC(i, obj.entities) && obj.getplayer() != i) // Don't destroy player entity + { + obj.entities[i].rule = 7; + obj.entities[i].tile = 6; + } + } + } + else if (words[0] == "changegravity") + { + //not something I'll use a lot, I think. Doesn't need to be very robust! + if (words[1] == "player") + { + i=obj.getplayer(); + } + else if (words[1] == "cyan") + { + i=obj.getcrewman(0); + } + else if (words[1] == "red") + { + i=obj.getcrewman(3); + } + else if (words[1] == "green") + { + i=obj.getcrewman(4); + } + else if (words[1] == "yellow") + { + i=obj.getcrewman(2); + } + else if (words[1] == "blue") + { + i=obj.getcrewman(5); + } + else if (words[1] == "purple") + { + i=obj.getcrewman(1); + } + + if (INBOUNDS_VEC(i, obj.entities)) + { + obj.entities[i].tile +=12; + } + } + else if (words[0] == "changedir") + { + if (words[1] == "player") + { + i=obj.getplayer(); + } + else if (words[1] == "cyan") + { + i=obj.getcrewman(0); + } + else if (words[1] == "red") + { + i=obj.getcrewman(3); + } + else if (words[1] == "green") + { + i=obj.getcrewman(4); + } + else if (words[1] == "yellow") + { + i=obj.getcrewman(2); + } + else if (words[1] == "blue") + { + i=obj.getcrewman(5); + } + else if (words[1] == "purple") + { + i=obj.getcrewman(1); + } + + if (INBOUNDS_VEC(i, obj.entities) && ss_toi(words[2]) == 0) + { + obj.entities[i].dir = 0; + } + else if (INBOUNDS_VEC(i, obj.entities)) + { + obj.entities[i].dir = 1; + } + } + else if (words[0] == "alarmon") + { + game.alarmon = true; + game.alarmdelay = 0; + } + else if (words[0] == "alarmoff") + { + game.alarmon = false; + } + else if (words[0] == "changeai") + { + if (words[1] == "player") + { + i=obj.getplayer(); + } + else if (words[1] == "cyan") + { + i=obj.getcrewman(0); + } + else if (words[1] == "red") + { + i=obj.getcrewman(3); + } + else if (words[1] == "green") + { + i=obj.getcrewman(4); + } + else if (words[1] == "yellow") + { + i=obj.getcrewman(2); + } + else if (words[1] == "blue") + { + i=obj.getcrewman(5); + } + else if (words[1] == "purple") + { + i=obj.getcrewman(1); + } + + if (words[2] == "followplayer") words[2] = "10"; + if (words[2] == "followpurple") words[2] = "11"; + if (words[2] == "followyellow") words[2] = "12"; + if (words[2] == "followred") words[2] = "13"; + if (words[2] == "followgreen") words[2] = "14"; + if (words[2] == "followblue") words[2] = "15"; + + if (words[2] == "followposition") words[2] = "16"; + if (words[2] == "faceleft") + { + words[2] = "17"; + words[3] = "0"; + } + if (words[2] == "faceright") + { + words[2] = "17"; + words[3] = "1"; + } + + + if (INBOUNDS_VEC(i, obj.entities)) + { + obj.entities[i].state = ss_toi(words[2]); + if (obj.entities[i].state == 16) + { + obj.entities[i].para=ss_toi(words[3]); + } + else if (obj.entities[i].state == 17) + { + obj.entities[i].dir=ss_toi(words[3]); + } + } + } + else if (words[0] == "activateteleporter") + { + i = obj.getteleporter(); + if (INBOUNDS_VEC(i, obj.entities)) + { + obj.entities[i].tile = 6; + obj.entities[i].colour = 102; + } + } + else if (words[0] == "changecolour") + { + if (words[1] == "player") + { + i=obj.getplayer(); + } + else if (words[1] == "cyan") + { + i=obj.getcrewman(0); + } + else if (words[1] == "red") + { + i=obj.getcrewman(3); + } + else if (words[1] == "green") + { + i=obj.getcrewman(4); + } + else if (words[1] == "yellow") + { + i=obj.getcrewman(2); + } + else if (words[1] == "blue") + { + i=obj.getcrewman(5); + } + else if (words[1] == "purple") + { + i=obj.getcrewman(1); + } + + if (INBOUNDS_VEC(i, obj.entities)) + { + if (words[2] == "cyan") + { + obj.entities[i].colour = 0; + } + else if (words[2] == "red") + { + obj.entities[i].colour = 15; + } + else if (words[2] == "green") + { + obj.entities[i].colour = 13; + } + else if (words[2] == "yellow") + { + obj.entities[i].colour = 14; + } + else if (words[2] == "blue") + { + obj.entities[i].colour = 16; + } + else if (words[2] == "purple") + { + obj.entities[i].colour = 20; + } + else if (words[2] == "teleporter") + { + obj.entities[i].colour = 102; + } + } + } + else if (words[0] == "squeak") + { + if (words[1] == "player") + { + music.playef(11); + } + else if (words[1] == "cyan") + { + music.playef(11); + } + else if (words[1] == "red") + { + music.playef(16); + } + else if (words[1] == "green") + { + music.playef(12); + } + else if (words[1] == "yellow") + { + music.playef(14); + } + else if (words[1] == "blue") + { + music.playef(13); + } + else if (words[1] == "purple") + { + music.playef(15); + } + else if (words[1] == "cry") + { + music.playef(2); + } + else if (words[1] == "terminal") + { + music.playef(20); + } + } + else if (words[0] == "blackout") + { + game.blackout = true; + } + else if (words[0] == "blackon") + { + game.blackout = false; + } + else if (words[0] == "setcheckpoint") + { + i = obj.getplayer(); + game.savepoint = 0; + if (INBOUNDS_VEC(i, obj.entities)) + { + game.savex = obj.entities[i].xp ; + game.savey = obj.entities[i].yp; + } + game.savegc = game.gravitycontrol; + game.saverx = game.roomx; + game.savery = game.roomy; + if (INBOUNDS_VEC(i, obj.entities)) + { + game.savedir = obj.entities[i].dir; + } + } + else if (words[0] == "gamestate") + { + game.state = ss_toi(words[1]); + game.statedelay = 0; + } + else if (words[0] == "textboxactive") + { + graphics.textboxactive(); + } + else if (words[0] == "gamemode") + { + if (words[1] == "teleporter") + { + game.mapmenuchange(TELEPORTERMODE); + + game.useteleporter = false; //good heavens don't actually use it + } + else if (words[1] == "game") + { + graphics.resumegamemode = true; + game.prevgamestate = GAMEMODE; + } + } + else if (words[0] == "ifexplored") + { + if (map.isexplored(ss_toi(words[1]), ss_toi(words[2]))) + { + load(words[3]); + position--; + } + } + else if (words[0] == "iflast") + { + if (game.lastsaved==ss_toi(words[1])) + { + load(words[2]); + position--; + } + } + else if (words[0] == "ifskip") + { + if (game.nocutscenes) + { + load(words[1]); + position--; + } + } + else if (words[0] == "ifflag") + { + int flag = ss_toi(words[1]); + if (INBOUNDS_ARR(flag, obj.flags) && obj.flags[flag]) + { + load(words[2]); + position--; + } + } + else if (words[0] == "ifcrewlost") + { + int crewmate = ss_toi(words[1]); + if (INBOUNDS_ARR(crewmate, game.crewstats) && !game.crewstats[crewmate]) + { + load(words[2]); + position--; + } + } + else if (words[0] == "iftrinkets") + { + if (game.trinkets() >= ss_toi(words[1])) + { + load(words[2]); + position--; + } + } + else if (words[0] == "iftrinketsless") + { + if (game.stat_trinkets < ss_toi(words[1])) + { + load(words[2]); + position--; + } + } + else if (words[0] == "hidecoordinates") + { + map.setexplored(ss_toi(words[1]), ss_toi(words[2]), false); + } + else if (words[0] == "showcoordinates") + { + map.setexplored(ss_toi(words[1]), ss_toi(words[2]), true); + } + else if (words[0] == "hideship") + { + map.hideship(); + } + else if (words[0] == "showship") + { + map.showship(); + } + else if (words[0] == "showsecretlab") + { + map.setexplored(16, 5, true); + map.setexplored(17, 5, true); + map.setexplored(18, 5, true); + map.setexplored(17, 6, true); + map.setexplored(18, 6, true); + map.setexplored(19, 6, true); + map.setexplored(19, 7, true); + map.setexplored(19, 8, true); + } + else if (words[0] == "hidesecretlab") + { + map.setexplored(16, 5, false); + map.setexplored(17, 5, false); + map.setexplored(18, 5, false); + map.setexplored(17, 6, false); + map.setexplored(18, 6, false); + map.setexplored(19, 6, false); + map.setexplored(19, 7, false); + map.setexplored(19, 8, false); + } + else if (words[0] == "showteleporters") + { + map.showteleporters = true; + } + else if (words[0] == "showtargets") + { + map.showtargets = true; + } + else if (words[0] == "showtrinkets") + { + map.showtrinkets = true; + } + else if (words[0] == "hideteleporters") + { + map.showteleporters = false; + } + else if (words[0] == "hidetargets") + { + map.showtargets = false; + } + else if (words[0] == "hidetrinkets") + { + map.showtrinkets = false; + } + else if (words[0] == "hideplayer") + { + int player = obj.getplayer(); + if (INBOUNDS_VEC(player, obj.entities)) + { + obj.entities[player].invis = true; + } + } + else if (words[0] == "showplayer") + { + int player = obj.getplayer(); + if (INBOUNDS_VEC(player, obj.entities)) + { + obj.entities[player].invis = false; + } + } + else if (words[0] == "teleportscript") + { + game.teleportscript = words[1]; + } + else if (words[0] == "clearteleportscript") + { + game.teleportscript = ""; + } + else if (words[0] == "nocontrol") + { + game.hascontrol = false; + } + else if (words[0] == "hascontrol") + { + game.hascontrol = true; + } + else if (words[0] == "companion") + { + game.companion = ss_toi(words[1]); + } + else if (words[0] == "befadein") + { + graphics.setfade(0); + graphics.fademode= 0; + } + else if (words[0] == "fadein") + { + graphics.fademode = 4; + } + else if (words[0] == "fadeout") + { + graphics.fademode = 2; + } + else if (words[0] == "untilfade") + { + if (graphics.fademode>1) + { + scriptdelay = 1; + position--; + } + } + else if (words[0] == "entersecretlab") + { + game.unlocknum(8); + game.insecretlab = true; + SDL_memset(map.explored, true, sizeof(map.explored)); + } + else if (words[0] == "leavesecretlab") + { + game.insecretlab = false; + } + else if (words[0] == "resetgame") + { + map.resetnames(); + map.resetmap(); + map.resetplayer(); + graphics.towerbg.tdrawback = true; + + obj.resetallflags(); + i = obj.getplayer(); + if (INBOUNDS_VEC(i, obj.entities)) + { + obj.entities[i].tile = 0; + } + + for (i = 0; i < 100; i++) + { + obj.collect[i] = false; + obj.customcollect[i] = false; + } + game.deathcounts = 0; + game.advancetext = false; + game.hascontrol = true; + game.resetgameclock(); + game.gravitycontrol = 0; + game.teleport = false; + game.companion = 0; + game.roomchange = false; + game.teleport_to_new_area = false; + game.teleport_to_x = 0; + game.teleport_to_y = 0; + + game.teleportscript = ""; + + //get out of final level mode! + map.finalmode = false; + map.final_colormode = false; + map.final_mapcol = 0; + map.final_colorframe = 0; + map.finalstretch = false; + } + else if (words[0] == "loadscript") + { + load(words[1]); + position--; + } + else if (words[0] == "rollcredits") + { +#if !defined(NO_CUSTOM_LEVELS) && !defined(NO_EDITOR) + if (map.custommode && !map.custommodeforreal) + { + game.returntoeditor(); + ed.note = "Rolled credits"; + ed.notedelay = 45; + } + else +#endif + { + game.gamestate = GAMECOMPLETE; + graphics.fademode = 4; + game.creditposition = 0; + } + } + else if (words[0] == "finalmode") + { + map.finalmode = true; + map.gotoroom(ss_toi(words[1]), ss_toi(words[2])); + } + else if (words[0] == "rescued") + { + if (words[1] == "red") + { + game.crewstats[3] = true; + } + else if (words[1] == "green") + { + game.crewstats[4] = true; + } + else if (words[1] == "yellow") + { + game.crewstats[2] = true; + } + else if (words[1] == "blue") + { + game.crewstats[5] = true; + } + else if (words[1] == "purple") + { + game.crewstats[1] = true; + } + else if (words[1] == "player") + { + game.crewstats[0] = true; + } + else if (words[1] == "cyan") + { + game.crewstats[0] = true; + } + } + else if (words[0] == "missing") + { + if (words[1] == "red") + { + game.crewstats[3] = false; + } + else if (words[1] == "green") + { + game.crewstats[4] = false; + } + else if (words[1] == "yellow") + { + game.crewstats[2] = false; + } + else if (words[1] == "blue") + { + game.crewstats[5] = false; + } + else if (words[1] == "purple") + { + game.crewstats[1] = false; + } + else if (words[1] == "player") + { + game.crewstats[0] = false; + } + else if (words[1] == "cyan") + { + game.crewstats[0] = false; + } + } + else if (words[0] == "face") + { + if (words[1] == "player") + { + i=obj.getplayer(); + } + else if (words[1] == "cyan") + { + i=obj.getcrewman(0); + } + else if (words[1] == "red") + { + i=obj.getcrewman(3); + } + else if (words[1] == "green") + { + i=obj.getcrewman(4); + } + else if (words[1] == "yellow") + { + i=obj.getcrewman(2); + } + else if (words[1] == "blue") + { + i=obj.getcrewman(5); + } + else if (words[1] == "purple") + { + i=obj.getcrewman(1); + } + + if (words[2] == "player") + { + j=obj.getplayer(); + } + else if (words[2] == "cyan") + { + j=obj.getcrewman(0); + } + else if (words[2] == "red") + { + j=obj.getcrewman(3); + } + else if (words[2] == "green") + { + j=obj.getcrewman(4); + } + else if (words[2] == "yellow") + { + j=obj.getcrewman(2); + } + else if (words[2] == "blue") + { + j=obj.getcrewman(5); + } + else if (words[2] == "purple") + { + j=obj.getcrewman(1); + } + + if (INBOUNDS_VEC(i, obj.entities) && INBOUNDS_VEC(j, obj.entities) && obj.entities[j].xp > obj.entities[i].xp + 5) + { + obj.entities[i].dir = 1; + } + else if (INBOUNDS_VEC(i, obj.entities) && INBOUNDS_VEC(j, obj.entities) && obj.entities[j].xp < obj.entities[i].xp - 5) + { + obj.entities[i].dir = 0; + } + } + else if (words[0] == "jukebox") + { + for (j = 0; j < (int) obj.entities.size(); j++) + { + if (obj.entities[j].type == 13) + { + obj.entities[j].colour = 4; + } + } + if (ss_toi(words[1]) == 1) + { + obj.createblock(5, 88 - 4, 80, 20, 16, 25); + for (j = 0; j < (int) obj.entities.size(); j++) + { + if (obj.entities[j].xp == 88 && obj.entities[j].yp==80) + { + obj.entities[j].colour = 5; + } + } + } + else if (ss_toi(words[1]) == 2) + { + obj.createblock(5, 128 - 4, 80, 20, 16, 26); + for (j = 0; j < (int) obj.entities.size(); j++) + { + if (obj.entities[j].xp == 128 && obj.entities[j].yp==80) + { + obj.entities[j].colour = 5; + } + } + } + else if (ss_toi(words[1]) == 3) + { + obj.createblock(5, 176 - 4, 80, 20, 16, 27); + for (j = 0; j < (int) obj.entities.size(); j++) + { + if (obj.entities[j].xp == 176 && obj.entities[j].yp==80) + { + obj.entities[j].colour = 5; + } + } + } + else if (ss_toi(words[1]) == 4) + { + obj.createblock(5, 216 - 4, 80, 20, 16, 28); + for (j = 0; j < (int) obj.entities.size(); j++) + { + if (obj.entities[j].xp == 216 && obj.entities[j].yp==80) + { + obj.entities[j].colour = 5; + } + } + } + else if (ss_toi(words[1]) == 5) + { + obj.createblock(5, 88 - 4, 128, 20, 16, 29); + for (j = 0; j < (int) obj.entities.size(); j++) + { + if (obj.entities[j].xp == 88 && obj.entities[j].yp==128) + { + obj.entities[j].colour = 5; + } + } + } + else if (ss_toi(words[1]) == 6) + { + obj.createblock(5, 176 - 4, 128, 20, 16, 30); + for (j = 0; j < (int) obj.entities.size(); j++) + { + if (obj.entities[j].xp == 176 && obj.entities[j].yp==128) + { + obj.entities[j].colour = 5; + } + } + } + else if (ss_toi(words[1]) == 7) + { + obj.createblock(5, 40 - 4, 40, 20, 16, 31); + for (j = 0; j < (int) obj.entities.size(); j++) + { + if (obj.entities[j].xp == 40 && obj.entities[j].yp==40) + { + obj.entities[j].colour = 5; + } + } + } + else if (ss_toi(words[1]) == 8) + { + obj.createblock(5, 216 - 4, 128, 20, 16, 32); + for (j = 0; j < (int) obj.entities.size(); j++) + { + if (obj.entities[j].xp == 216 && obj.entities[j].yp==128) + { + obj.entities[j].colour = 5; + } + } + } + else if (ss_toi(words[1]) == 9) + { + obj.createblock(5, 128 - 4, 128, 20, 16, 33); + for (j = 0; j < (int) obj.entities.size(); j++) + { + if (obj.entities[j].xp == 128 && obj.entities[j].yp==128) + { + obj.entities[j].colour = 5; + } + } + } + else if (ss_toi(words[1]) == 10) + { + obj.createblock(5, 264 - 4, 40, 20, 16, 34); + for (j = 0; j < (int) obj.entities.size(); j++) + { + if (obj.entities[j].xp == 264 && obj.entities[j].yp==40) + { + obj.entities[j].colour = 5; + } + } + } + } + else if (words[0] == "createactivityzone") + { + if (words[1] == "red") + { + i=3; + } + else if (words[1] == "green") + { + i=4; + } + else if (words[1] == "yellow") + { + i=2; + } + else if (words[1] == "blue") + { + i=5; + } + else if (words[1] == "purple") + { + i=1; + } + + int crewman = obj.getcrewman(i); + if (INBOUNDS_VEC(crewman, obj.entities) && i == 4) + { + obj.createblock(5, obj.entities[crewman].xp - 32, obj.entities[crewman].yp-20, 96, 60, i); + } + else if (INBOUNDS_VEC(crewman, obj.entities)) + { + obj.createblock(5, obj.entities[crewman].xp - 32, 0, 96, 240, i); + } + } + else if (words[0] == "createrescuedcrew") + { + //special for final level cutscene + //starting at 180, create the rescued crewmembers (ingoring violet, who's at 155) + i = 215; + if (game.crewstats[2] && game.lastsaved!=2) + { + obj.createentity(i, 153, 18, 14, 0, 17, 0); + i += 25; + } + if (game.crewstats[3] && game.lastsaved!=3) + { + obj.createentity(i, 153, 18, 15, 0, 17, 0); + i += 25; + } + if (game.crewstats[4] && game.lastsaved!=4) + { + obj.createentity(i, 153, 18, 13, 0, 17, 0); + i += 25; + } + if (game.crewstats[5] && game.lastsaved!=5) + { + obj.createentity(i, 153, 18, 16, 0, 17, 0); + i += 25; + } + } + else if (words[0] == "restoreplayercolour") + { + i = obj.getplayer(); + if (INBOUNDS_VEC(i, obj.entities)) + { + obj.entities[i].colour = 0; + } + } + else if (words[0] == "changeplayercolour") + { + i = obj.getplayer(); + + if (INBOUNDS_VEC(i, obj.entities)) + { + if (words[1] == "cyan") + { + obj.entities[i].colour = 0; + } + else if (words[1] == "red") + { + obj.entities[i].colour = 15; + } + else if (words[1] == "green") + { + obj.entities[i].colour = 13; + } + else if (words[1] == "yellow") + { + obj.entities[i].colour = 14; + } + else if (words[1] == "blue") + { + obj.entities[i].colour = 16; + } + else if (words[1] == "purple") + { + obj.entities[i].colour = 20; + } + else if (words[1] == "teleporter") + { + obj.entities[i].colour = 102; + } + } + } + else if (words[0] == "altstates") + { + obj.altstates = ss_toi(words[1]); + } + else if (words[0] == "activeteleporter") + { + i = obj.getteleporter(); + if (INBOUNDS_VEC(i, obj.entities)) + { + obj.entities[i].colour = 101; + } + } + else if (words[0] == "foundtrinket") + { + music.silencedasmusik(); + music.playef(3); + + size_t trinket = ss_toi(words[1]); + if (trinket < SDL_arraysize(obj.collect)) + { + obj.collect[trinket] = true; + } + + graphics.textboxremovefast(); + + graphics.createtextboxflipme(" Congratulations! ", 50, 85, 174, 174, 174); + graphics.addline(""); + graphics.addline("You have found a shiny trinket!"); + graphics.textboxcenterx(); + + std::string usethisnum; +#if !defined(NO_CUSTOM_LEVELS) + if (map.custommode) + { + usethisnum = help.number(ed.numtrinkets()); + } + else +#endif + { + usethisnum = "Twenty"; + } + graphics.createtextboxflipme(" " + help.number(game.trinkets()) + " out of " + usethisnum + " ", 50, 135, 174, 174, 174); + graphics.textboxcenterx(); + + if (!game.backgroundtext) + { + game.advancetext = true; + game.hascontrol = false; + game.pausescript = true; + if (key.isDown(90) || key.isDown(32) || key.isDown(86) + || key.isDown(KEYBOARD_UP) || key.isDown(KEYBOARD_DOWN)) game.jumpheld = true; + } + game.backgroundtext = false; + } + else if (words[0] == "foundlab") + { + music.playef(3); + + graphics.textboxremovefast(); + + graphics.createtextbox(" Congratulations! ", 50, 85, 174, 174, 174); + graphics.addline(""); + graphics.addline("You have found the secret lab!"); + graphics.textboxcenterx(); + graphics.textboxcentery(); + + if (!game.backgroundtext) + { + game.advancetext = true; + game.hascontrol = false; + game.pausescript = true; + if (key.isDown(90) || key.isDown(32) || key.isDown(86) + || key.isDown(KEYBOARD_UP) || key.isDown(KEYBOARD_DOWN)) game.jumpheld = true; + } + game.backgroundtext = false; + } + else if (words[0] == "foundlab2") + { + graphics.textboxremovefast(); + + graphics.createtextbox("The secret lab is separate from", 50, 85, 174, 174, 174); + graphics.addline("the rest of the game. You can"); + graphics.addline("now come back here at any time"); + graphics.addline("by selecting the new SECRET LAB"); + graphics.addline("option in the play menu."); + graphics.textboxcenterx(); + graphics.textboxcentery(); + + if (!game.backgroundtext) + { + game.advancetext = true; + game.hascontrol = false; + game.pausescript = true; + if (key.isDown(90) || key.isDown(32) || key.isDown(86) + || key.isDown(KEYBOARD_UP) || key.isDown(KEYBOARD_DOWN)) game.jumpheld = true; + } + game.backgroundtext = false; + } + else if (words[0] == "everybodysad") + { + for (i = 0; i < (int) obj.entities.size(); i++) + { + if (obj.entities[i].rule == 6 || obj.entities[i].rule == 0) + { + obj.entities[i].tile = 144; + } + } + } + else if (words[0] == "startintermission2") + { + map.finalmode = true; //Enable final level mode + + game.savex = 228; + game.savey = 129; + game.saverx = 53; + game.savery = 49; + game.savegc = 0; + game.savedir = 0; //Intermission level 2 + game.savepoint = 0; + game.gravitycontrol = 0; + + map.gotoroom(46, 54); + } + else if (words[0] == "telesave") + { + if (!game.intimetrial && !game.nodeathmode && !game.inintermission) game.savetele(); + } + else if (words[0] == "createlastrescued") + { + if (game.lastsaved==2) + { + r=14; + } + else if (game.lastsaved==3) + { + r=15; + } + else if (game.lastsaved==4) + { + r=13; + } + else if (game.lastsaved==5) + { + r=16; + } + else + { + r = 19; + } + + obj.createentity(200, 153, 18, r, 0, 19, 30); + i = obj.getcrewman(game.lastsaved); + if (INBOUNDS_VEC(i, obj.entities)) + { + obj.entities[i].dir = 1; + } + } + else if (words[0] == "specialline") + { + switch(ss_toi(words[1])) + { + case 1: + txt.resize(1); + + txt[0] = "I'm worried about " + game.unrescued() + ", Doctor!"; + break; + case 2: + txt.resize(3); + + if (game.crewrescued() < 5) + { + txt[1] = "to helping you find the"; + txt[2] = "rest of the crew!"; + } + else + { + txt.resize(2); + txt[1] = "to helping you find " + game.unrescued() + "!"; + } + break; + } + } + else if (words[0] == "trinketbluecontrol") + { + if (game.trinkets() == 20 && obj.flags[67]) + { + load("talkblue_trinket6"); + position--; + } + else if (game.trinkets() >= 19 && !obj.flags[67]) + { + load("talkblue_trinket5"); + position--; + } + else + { + load("talkblue_trinket4"); + position--; + } + } + else if (words[0] == "trinketyellowcontrol") + { + if (game.trinkets() >= 19) + { + load("talkyellow_trinket3"); + position--; + } + else + { + load("talkyellow_trinket2"); + position--; + } + } + else if (words[0] == "redcontrol") + { + if (game.insecretlab) + { + load("talkred_14"); + position--; + } + else if (game.roomx != 104) + { + if (game.roomx == 100) + { + load("talkred_10"); + position--; + } + else if (game.roomx == 107) + { + load("talkred_11"); + position--; + } + else if (game.roomx == 114) + { + load("talkred_12"); + position--; + } + } + else if (obj.flags[67]) + { + //game complete + load("talkred_13"); + position--; + } + else if (obj.flags[35] && !obj.flags[52]) + { + //Intermission level + obj.flags[52] = true; + load("talkred_9"); + position--; + } + else if (!obj.flags[51]) + { + //We're back home! + obj.flags[51] = true; + load("talkred_5"); + position--; + } + else if (!obj.flags[48] && game.crewstats[5]) + { + //Victoria's back + obj.flags[48] = true; + load("talkred_6"); + position--; + } + else if (!obj.flags[49] && game.crewstats[4]) + { + //Verdigris' back + obj.flags[49] = true; + load("talkred_7"); + position--; + } + else if (!obj.flags[50] && game.crewstats[2]) + { + //Vitellary's back + obj.flags[50] = true; + load("talkred_8"); + position--; + } + else if (!obj.flags[45] && !game.crewstats[5]) + { + obj.flags[45] = true; + load("talkred_2"); + position--; + } + else if (!obj.flags[46] && !game.crewstats[4]) + { + obj.flags[46] = true; + load("talkred_3"); + position--; + } + else if (!obj.flags[47] && !game.crewstats[2]) + { + obj.flags[47] = true; + load("talkred_4"); + position--; + } + else + { + obj.flags[45] = false; + obj.flags[46] = false; + obj.flags[47] = false; + load("talkred_1"); + position--; + } + } + //TODO: Non Urgent fix compiler nesting errors without adding complexity + if (words[0] == "greencontrol") + { + if (game.insecretlab) + { + load("talkgreen_11"); + position--; + } + else if (game.roomx == 103 && game.roomy == 109) + { + load("talkgreen_8"); + position--; + } + else if (game.roomx == 101 && game.roomy == 109) + { + load("talkgreen_9"); + position--; + } + else if (obj.flags[67]) + { + //game complete + load("talkgreen_10"); + position--; + } + else if (obj.flags[34] && !obj.flags[57]) + { + //Intermission level + obj.flags[57] = true; + load("talkgreen_7"); + position--; + } + else if (!obj.flags[53]) + { + //Home! + obj.flags[53] = true; + load("talkgreen_6"); + position--; + } + else if (!obj.flags[54] && game.crewstats[2]) + { + obj.flags[54] = true; + load("talkgreen_5"); + position--; + } + else if (!obj.flags[55] && game.crewstats[3]) + { + obj.flags[55] = true; + load("talkgreen_4"); + position--; + } + else if (!obj.flags[56] && game.crewstats[5]) + { + obj.flags[56] = true; + load("talkgreen_3"); + position--; + } + else if (!obj.flags[58]) + { + obj.flags[58] = true; + load("talkgreen_2"); + position--; + } + else + { + load("talkgreen_1"); + position--; + } + } + else if (words[0] == "bluecontrol") + { + if (game.insecretlab) + { + load("talkblue_9"); + position--; + } + else if (obj.flags[67]) + { + //game complete, everything changes for victoria + if (obj.flags[41] && !obj.flags[42]) + { + //second trinket conversation + obj.flags[42] = true; + load("talkblue_trinket2"); + position--; + } + else if (!obj.flags[41] && !obj.flags[42]) + { + //Third trinket conversation + obj.flags[42] = true; + load("talkblue_trinket3"); + position--; + } + else + { + //Ok, we've already dealt with the trinket thing; so either you have them all, or you don't. If you do: + if (game.trinkets() >= 20) + { + load("startepilogue"); + position--; + } + else + { + load("talkblue_8"); + position--; + } + } + } + else if (obj.flags[33] && !obj.flags[40]) + { + //Intermission level + obj.flags[40] = true; + load("talkblue_7"); + position--; + } + else if (!obj.flags[36] && game.crewstats[5]) + { + //Back on the ship! + obj.flags[36] = true; + load("talkblue_3"); + position--; + } + else if (!obj.flags[41] && game.crewrescued() <= 4) + { + //First trinket conversation + obj.flags[41] = true; + load("talkblue_trinket1"); + position--; + } + else if (obj.flags[41] && !obj.flags[42] && game.crewrescued() == 5) + { + //second trinket conversation + obj.flags[42] = true; + load("talkblue_trinket2"); + position--; + } + else if (!obj.flags[41] && !obj.flags[42] && game.crewrescued() == 5) + { + //Third trinket conversation + obj.flags[42] = true; + load("talkblue_trinket3"); + position--; + } + else if (!obj.flags[37] && game.crewstats[2]) + { + obj.flags[37] = true; + load("talkblue_4"); + position--; + } + else if (!obj.flags[38] && game.crewstats[3]) + { + obj.flags[38] = true; + load("talkblue_5"); + position--; + } + else if (!obj.flags[39] && game.crewstats[4]) + { + obj.flags[39] = true; + load("talkblue_6"); + position--; + } + else + { + //if all else fails: + //if yellow is found + if (game.crewstats[2]) + { + load("talkblue_2"); + position--; + } + else + { + load("talkblue_1"); + position--; + } + } + } + else if (words[0] == "yellowcontrol") + { + if (game.insecretlab) + { + load("talkyellow_12"); + position--; + } + else if (obj.flags[67]) + { + //game complete + load("talkyellow_11"); + position--; + } + else if (obj.flags[32] && !obj.flags[31]) + { + //Intermission level + obj.flags[31] = true; + load("talkyellow_6"); + position--; + } + else if (!obj.flags[27] && game.crewstats[2]) + { + //Back on the ship! + obj.flags[27] = true; + load("talkyellow_10"); + position--; + } + else if (!obj.flags[43] && game.crewrescued() == 5 && !game.crewstats[5]) + { + //If by chance we've rescued everyone except Victoria by the end, Vitellary provides you with + //the trinket information instead. + obj.flags[43] = true; + obj.flags[42] = true; + obj.flags[41] = true; + load("talkyellow_trinket1"); + position--; + } + else if (!obj.flags[24] && game.crewstats[5]) + { + obj.flags[24] = true; + load("talkyellow_8"); + position--; + } + else if (!obj.flags[26] && game.crewstats[4]) + { + obj.flags[26] = true; + load("talkyellow_7"); + position--; + } + else if (!obj.flags[25] && game.crewstats[3]) + { + obj.flags[25] = true; + load("talkyellow_9"); + position--; + } + else if (!obj.flags[28]) + { + obj.flags[28] = true; + load("talkyellow_3"); + position--; + } + else if (!obj.flags[29]) + { + obj.flags[29] = true; + load("talkyellow_4"); + position--; + } + else if (!obj.flags[30]) + { + obj.flags[30] = true; + load("talkyellow_5"); + position--; + } + else if (!obj.flags[23]) + { + obj.flags[23] = true; + load("talkyellow_2"); + position--; + } + else + { + load("talkyellow_1"); + position--; + obj.flags[23] = false; + } + } + else if (words[0] == "purplecontrol") + { + //Controls Purple's conversion + //Crew rescued: + if (game.insecretlab) + { + load("talkpurple_9"); + position--; + } + else if (obj.flags[67]) + { + //game complete + load("talkpurple_8"); + position--; + } + else if (!obj.flags[17] && game.crewstats[4]) + { + obj.flags[17] = true; + load("talkpurple_6"); + position--; + } + else if (!obj.flags[15] && game.crewstats[5]) + { + obj.flags[15] = true; + load("talkpurple_4"); + position--; + } + else if (!obj.flags[16] && game.crewstats[3]) + { + obj.flags[16] = true; + load("talkpurple_5"); + position--; + } + else if (!obj.flags[18] && game.crewstats[2]) + { + obj.flags[18] = true; + load("talkpurple_7"); + position--; + } + else if (obj.flags[19] && !obj.flags[20] && !obj.flags[21]) + { + //intermission one: if played one / not had first conversation / not played two [conversation one] + obj.flags[21] = true; + load("talkpurple_intermission1"); + position--; + } + else if (obj.flags[20] && obj.flags[21] && !obj.flags[22]) + { + //intermission two: if played two / had first conversation / not had second conversation [conversation two] + obj.flags[22] = true; + load("talkpurple_intermission2"); + position--; + } + else if (obj.flags[20] && !obj.flags[21] && !obj.flags[22]) + { + //intermission two: if played two / not had first conversation / not had second conversation [conversation three] + obj.flags[22] = true; + load("talkpurple_intermission3"); + position--; + } + else if (!obj.flags[12]) + { + //Intro conversation + obj.flags[12] = true; + load("talkpurple_intro"); + position--; + } + else if (!obj.flags[14]) + { + //Shorter intro conversation + obj.flags[14] = true; + load("talkpurple_3"); + position--; + } + else + { + //if all else fails: + //if green is found + if (game.crewstats[4]) + { + load("talkpurple_2"); + position--; + } + else + { + load("talkpurple_1"); + position--; + } + } + } + + position++; + } + else + { + running = false; + } + // Don't increment if we're at the max, signed int overflow is UB + if (execution_counter == SHRT_MAX) + { + // We must be in an infinite loop + printf("Warning: execution counter got to %i, stopping script\n", SHRT_MAX); + running = false; + } + else + { + execution_counter++; + } + } + + if(scriptdelay>0) + { + scriptdelay--; + } +} + +void scriptclass::resetgametomenu(void) +{ + obj.entities.clear(); + game.quittomenu(); + game.createmenu(Menu::gameover); } static void gotoerrorloadinglevel(void) { - game.quittomenu(); - game.createmenu(Menu::errorloadinglevel); - music.currentsong = -1; /* otherwise music.play won't work */ - music.play(Music_PRESENTINGVVVVVV); + game.createmenu(Menu::errorloadinglevel); + map.nexttowercolour(); + graphics.fademode = 4; /* start fade in */ + music.currentsong = -1; /* otherwise music.play won't work */ + music.play(6); /* title screen music */ } -#define DECLARE_MODE_FUNC(funcname, modename) \ - static bool funcname(const enum StartMode mode) \ - { \ - return mode >= Start_FIRST_##modename && mode <= Start_LAST_##modename; \ - } - -DECLARE_MODE_FUNC(is_no_death_mode, NODEATHMODE) -DECLARE_MODE_FUNC(is_intermission_1, INTERMISSION1) -DECLARE_MODE_FUNC(is_intermission_2, INTERMISSION2) - -#undef DECLARE_MODE_FUNC - -void scriptclass::startgamemode(const enum StartMode mode) +void scriptclass::startgamemode( int t ) { - if (mode == Start_QUIT) - { - VVV_exit(0); - } + switch(t) + { + case 0: //Normal new game + game.gamestate = GAMEMODE; + hardreset(); + game.start(); + game.jumpheld = true; + graphics.showcutscenebars = true; + graphics.setbars(320); - struct - { - bool initialized; - int size; - int cx; - int cy; - int w; - int h; - } - player_hitbox; - SDL_zero(player_hitbox); + //set flipmode + if (graphics.setflipmode) graphics.flipmode = true; + else obj.flags[73] = true; - if (GlitchrunnerMode_less_than_or_equal(Glitchrunner2_2)) - { - /* Preserve player hitbox */ - const int player_idx = obj.getplayer(); - if (INBOUNDS_VEC(player_idx, obj.entities)) - { - const entclass* player = &obj.entities[player_idx]; - player_hitbox.initialized = true; - player_hitbox.size = player->size; - player_hitbox.cx = player->cx; - player_hitbox.cy = player->cy; - player_hitbox.w = player->w; - player_hitbox.h = player->h; - } - } + if(obj.entities.empty()) + { + obj.createentity(game.savex, game.savey, 0, 0); //In this game, constant, never destroyed + } + map.resetplayer(); + map.gotoroom(game.saverx, game.savery); + map.initmapdata(); - /* State which needs to be reset before gameplay starts - * ex. before custom levels get loaded */ + load("intro"); + break; + case 1: + game.gamestate = GAMEMODE; + hardreset(); + game.start(); + game.loadtele(); + game.gravitycontrol = game.savegc; + game.jumpheld = true; - switch (mode) - { - case Start_EDITORPLAYTESTING: - break; - default: - textbox_colours.clear(); - add_default_colours(); - cl.onewaycol_override = false; - cl.player_colour = 0; - break; - } + //set flipmode + if (graphics.setflipmode) graphics.flipmode = true; + else obj.flags[73] = true; - hardreset(); + if(obj.entities.empty()) + { + obj.createentity(game.savex, game.savey, 0, 0); //In this game, constant, never destroyed + } + map.resetplayer(); + map.gotoroom(game.saverx, game.savery); + map.initmapdata(); + graphics.fademode = 4; + break; + case 2: //Load Quicksave + game.gamestate = GAMEMODE; + hardreset(); + game.start(); + game.loadquick(); + game.gravitycontrol = game.savegc; + game.jumpheld = true; - if (mode == Start_EDITOR) - { - game.gamestate = EDITORMODE; - } - else - { - game.gamestate = GAMEMODE; - } + //set flipmode + if (graphics.setflipmode) graphics.flipmode = true; + else obj.flags[73] = true; - // Font handling - switch (mode) - { - case Start_EDITORPLAYTESTING: - case Start_CUSTOM: - case Start_CUSTOM_QUICKSAVE: - break; - case Start_EDITOR: - font::set_level_font_new(); - break; - default: - font::set_level_font_interface(); - } + if(obj.entities.empty()) + { + obj.createentity(game.savex, game.savey, 0, 0); //In this game, constant, never destroyed + } + map.resetplayer(); + map.gotoroom(game.saverx, game.savery); + map.initmapdata(); + //a very special case for here needs to ensure that the tower is set correctly + if (map.towermode) + { + map.resetplayer(); - /* Indicate invincibility, glitchrunner, etc. for all modes except these */ - switch (mode) - { - case Start_EDITOR: - case Start_CUTSCENETEST: - break; - case Start_QUIT: - VVV_unreachable(); + i = obj.getplayer(); + if (INBOUNDS_VEC(i, obj.entities)) + { + map.ypos = obj.entities[i].yp - 120; + map.oldypos = map.ypos; + } + map.setbgobjlerp(graphics.towerbg); + map.cameramode = 0; + map.colsuperstate = 0; + } + graphics.fademode = 4; + break; + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + //Start Time Trial + music.fadeout(); - default: - /* If there's editor return text, make this show up after it */ - game.mode_indicator_timer = ed.return_message_timer + 2000; - game.old_mode_indicator_timer = game.mode_indicator_timer; - } + hardreset(); + game.nocutscenes = true; + game.intimetrial = true; + game.timetrialcountdown = 150; + game.timetrialparlost = false; + game.timetriallevel = t - 3; - game.jumpheld = true; + switch (t) + { + case 3: + game.timetrialpar = 75; + game.timetrialshinytarget = 2; + break; + case 4: + game.timetrialpar = 165; + game.timetrialshinytarget = 4; + break; + case 5: + game.timetrialpar = 105; + game.timetrialshinytarget = 2; + break; + case 6: + game.timetrialpar = 200; + game.timetrialshinytarget = 5; + break; + case 7: + game.timetrialpar = 120; + game.timetrialshinytarget = 1; + break; + case 8: + game.timetrialpar = 135; + game.timetrialshinytarget = 1; + map.finalmode = true; //Enable final level mode + map.final_colormode = false; + map.final_mapcol = 0; + map.final_colorframe = 0; + break; + } - switch (mode) - { - case Start_MAINGAME: - case Start_MAINGAME_TELESAVE: - case Start_MAINGAME_QUICKSAVE: - case Start_NODEATHMODE_WITHCUTSCENES: - case Start_NODEATHMODE_NOCUTSCENES: - game.nodeathmode = is_no_death_mode(mode); - game.nocutscenes = (mode == Start_NODEATHMODE_NOCUTSCENES); + game.gamestate = GAMEMODE; + game.starttrial(game.timetriallevel); + game.jumpheld = true; - game.start(); + if (graphics.setflipmode) graphics.flipmode = true;//set flipmode + if (obj.entities.empty()) + { + obj.createentity(game.savex, game.savey, 0, 0); //In this game, constant, never destroyed + } + map.resetplayer(); + map.gotoroom(game.saverx, game.savery); + map.initmapdata(); + graphics.fademode = 4; + break; + case 9: + game.gamestate = GAMEMODE; + hardreset(); + game.nodeathmode = true; + game.start(); + game.jumpheld = true; + graphics.showcutscenebars = true; + graphics.setbars(320); - switch (mode) - { - case Start_MAINGAME_TELESAVE: - game.loadtele(); - graphics.fademode = FADE_START_FADEIN; - break; - case Start_MAINGAME_QUICKSAVE: - game.loadquick(); - graphics.fademode = FADE_START_FADEIN; - break; - default: - graphics.showcutscenebars = true; - graphics.setbars(320); - load("intro"); + //set flipmode + if (graphics.setflipmode) graphics.flipmode = true; - if (!game.nocompetitive()) - { - game.nodeatheligible = true; - vlog_debug("NDM trophy is eligible."); - } - else - { - game.invalidate_ndm_trophy(); - } - } - break; + if(obj.entities.empty()) + { + obj.createentity(game.savex, game.savey, 0, 0); //In this game, constant, never destroyed + } + map.resetplayer(); + map.gotoroom(game.saverx, game.savery); + map.initmapdata(); - case Start_TIMETRIAL_SPACESTATION1: - case Start_TIMETRIAL_LABORATORY: - case Start_TIMETRIAL_TOWER: - case Start_TIMETRIAL_SPACESTATION2: - case Start_TIMETRIAL_WARPZONE: - case Start_TIMETRIAL_FINALLEVEL: - music.fadeout(); - game.nocutscenes = true; - game.intimetrial = true; - game.timetrialcountdown = 150; - game.timetriallevel = mode - Start_FIRST_TIMETRIAL; + load("intro"); + break; + case 10: + game.gamestate = GAMEMODE; + hardreset(); + game.nodeathmode = true; + game.nocutscenes = true; - if (map.invincibility) - { - game.sabotage_time_trial(); - } + game.start(); + game.jumpheld = true; + graphics.showcutscenebars = true; + graphics.setbars(320); - switch (mode) - { - case Start_TIMETRIAL_SPACESTATION1: - game.timetrialpar = 75; - game.timetrialshinytarget = 2; - break; - case Start_TIMETRIAL_LABORATORY: - game.timetrialpar = 165; - game.timetrialshinytarget = 4; - break; - case Start_TIMETRIAL_TOWER: - game.timetrialpar = 105; - game.timetrialshinytarget = 2; - break; - case Start_TIMETRIAL_SPACESTATION2: - game.timetrialpar = 200; - game.timetrialshinytarget = 5; - break; - case Start_TIMETRIAL_WARPZONE: - game.timetrialpar = 120; - game.timetrialshinytarget = 1; - break; - case Start_TIMETRIAL_FINALLEVEL: - game.timetrialpar = 135; - game.timetrialshinytarget = 1; - map.finalmode = true; - map.final_colormode = false; - map.final_mapcol = 0; - map.final_colorframe = 0; - break; - default: - VVV_unreachable(); - } + //set flipmode + if (graphics.setflipmode) graphics.flipmode = true; - game.starttrial(game.timetriallevel); + if(obj.entities.empty()) + { + obj.createentity(game.savex, game.savey, 0, 0); //In this game, constant, never destroyed + } + map.resetplayer(); + map.gotoroom(game.saverx, game.savery); + map.initmapdata(); - if (game.translator_exploring) - { - game.timetrialcountdown = 0; - game.timetrialparlost = true; - map.fullmap(); - } - graphics.fademode = FADE_START_FADEIN; - break; + load("intro"); + break; + case 11: + game.gamestate = GAMEMODE; + hardreset(); - case Start_SECRETLAB: - game.startspecial(0); + game.startspecial(0); + game.jumpheld = true; - /* Unlock the entire map */ - map.fullmap(); - /* Give all 20 trinkets */ - SDL_memset(obj.collect, true, sizeof(obj.collect[0]) * 20); - i = 400; /* previously a nested for-loop set this */ - game.insecretlab = true; - map.showteleporters = true; + //Secret lab, so reveal the map, give them all 20 trinkets + SDL_memset(obj.collect, true, sizeof(obj.collect[0]) * 20); + SDL_memset(map.explored, true, sizeof(map.explored)); + i = 400; /* previously a nested for-loop set this */ + game.insecretlab = true; + map.showteleporters = true; - music.play(Music_PIPEDREAM); - graphics.fademode = FADE_START_FADEIN; - break; + //set flipmode + if (graphics.setflipmode) graphics.flipmode = true; - case Start_INTERMISSION1_VITELLARY: - case Start_INTERMISSION1_VERMILION: - case Start_INTERMISSION1_VERDIGRIS: - case Start_INTERMISSION1_VICTORIA: - case Start_INTERMISSION2_VITELLARY: - case Start_INTERMISSION2_VERMILION: - case Start_INTERMISSION2_VERDIGRIS: - case Start_INTERMISSION2_VICTORIA: - music.fadeout(); + if(obj.entities.empty()) + { + obj.createentity(game.savex, game.savey, 0, 0); //In this game, constant, never destroyed + } + map.resetplayer(); + map.gotoroom(game.saverx, game.savery); + map.initmapdata(); + music.play(11); + graphics.fademode = 4; + break; + case 12: + game.gamestate = GAMEMODE; + hardreset(); + music.fadeout(); - switch (mode) - { - case Start_INTERMISSION1_VITELLARY: - case Start_INTERMISSION2_VITELLARY: - game.lastsaved = 2; - break; - case Start_INTERMISSION1_VERMILION: - case Start_INTERMISSION2_VERMILION: - game.lastsaved = 3; - break; - case Start_INTERMISSION1_VERDIGRIS: - case Start_INTERMISSION2_VERDIGRIS: - game.lastsaved = 4; - break; - case Start_INTERMISSION1_VICTORIA: - case Start_INTERMISSION2_VICTORIA: - game.lastsaved = 5; - break; - default: - VVV_unreachable(); - } + game.lastsaved = 2; - game.crewstats[game.lastsaved] = true; - game.inintermission = true; + game.crewstats[game.lastsaved] = true; + game.inintermission = true; + game.companion = 11; + game.supercrewmate = true; + game.scmprogress = 0; + map.finalmode = true; + map.final_colormode = false; + map.final_mapcol = 0; + map.final_colorframe = 0; + game.startspecial(1); + game.jumpheld = true; - if (is_intermission_1(mode)) - { - game.companion = 11; - game.supercrewmate = true; - game.scmprogress = 0; - } + //set flipmode + if (graphics.setflipmode) graphics.flipmode = true; + if(obj.entities.empty()) + { + obj.createentity(game.savex, game.savey, 0, 0); //In this game, constant, never destroyed + } + map.resetplayer(); + map.gotoroom(game.saverx, game.savery); + map.initmapdata(); - map.finalmode = true; - map.final_colormode = false; - map.final_mapcol = 0; - map.final_colorframe = 0; - game.startspecial(1); + load("intermission_1"); + break; + case 13: + game.gamestate = GAMEMODE; + hardreset(); + music.fadeout(); - if (is_intermission_1(mode)) - { - load("intermission_1"); - } - else if (is_intermission_2(mode)) - { - load("intermission_2"); - } - break; + game.lastsaved = 3; - case Start_EDITOR: - cl.reset(); - ed.reset(); - music.fadeout(); - map.custommode = true; - map.custommodeforreal = false; - graphics.fademode = FADE_START_FADEIN; - break; + game.crewstats[game.lastsaved] = true; + game.inintermission = true; + game.companion = 11; + game.supercrewmate = true; + game.scmprogress = 0; + map.finalmode = true; + map.final_colormode = false; + map.final_mapcol = 0; + map.final_colorframe = 0; + game.startspecial(1); + game.jumpheld = true; - case Start_EDITORPLAYTESTING: - music.fadeout(); + //set flipmode + if (graphics.setflipmode) graphics.flipmode = true; + if(obj.entities.empty()) + { + obj.createentity(game.savex, game.savey, 0, 0); //In this game, constant, never destroyed + } + map.resetplayer(); + map.gotoroom(game.saverx, game.savery); + map.initmapdata(); - //If warpdir() is used during playtesting, we need to set it back after! - for (int j = 0; j < cl.maxheight; j++) - { - for (int i = 0; i < cl.maxwidth; i++) - { - ed.kludgewarpdir[i+(j*cl.maxwidth)]=cl.roomproperties[i+(j*cl.maxwidth)].warpdir; - } - } + load("intermission_1"); + break; + case 14: + game.gamestate = GAMEMODE; + hardreset(); + music.fadeout(); - game.customstart(); - ed.ghosts.clear(); + game.lastsaved = 4; - map.custommode = true; - map.custommodeforreal = false; - map.customshowmm = true; - map.revealmap = true; + game.crewstats[game.lastsaved] = true; + game.inintermission = true; + game.companion = 11; + game.supercrewmate = true; + game.scmprogress = 0; + map.finalmode = true; + map.final_colormode = false; + map.final_mapcol = 0; + map.final_colorframe = 0; + game.startspecial(1); + game.jumpheld = true; - if (cl.levmusic > 0) - { - music.play(cl.levmusic); - } - else - { - music.currentsong = -1; - } - break; + //set flipmode + if (graphics.setflipmode) graphics.flipmode = true; + if(obj.entities.empty()) + { + obj.createentity(game.savex, game.savey, 0, 0); //In this game, constant, never destroyed + } + map.resetplayer(); + map.gotoroom(game.saverx, game.savery); + map.initmapdata(); - case Start_CUSTOM: - case Start_CUSTOM_QUICKSAVE: - { - map.custommodeforreal = true; - map.custommode = true; + load("intermission_1"); + break; + case 15: + game.gamestate = GAMEMODE; + hardreset(); + music.fadeout(); - std::string filename = std::string(cl.ListOfMetaData[game.playcustomlevel].filename); - if (!cl.load(filename)) - { - gotoerrorloadinglevel(); - return; - } - cl.findstartpoint(); + game.lastsaved = 5; - map.customshowmm = true; - map.revealmap = true; + game.crewstats[game.lastsaved] = true; + game.inintermission = true; + game.companion = 11; + game.supercrewmate = true; + game.scmprogress = 0; + map.finalmode = true; + map.final_colormode = false; + map.final_mapcol = 0; + map.final_colorframe = 0; + game.startspecial(1); + game.jumpheld = true; - music.fadeout(); - game.customstart(); + //set flipmode + if (graphics.setflipmode) graphics.flipmode = true; + if(obj.entities.empty()) + { + obj.createentity(game.savex, game.savey, 0, 0); //In this game, constant, never destroyed + } + map.resetplayer(); + map.gotoroom(game.saverx, game.savery); + map.initmapdata(); - switch (mode) - { - case Start_CUSTOM: - if (cl.levmusic > 0) - { - music.play(cl.levmusic); - } - else - { - music.currentsong = -1; - } - break; - case Start_CUSTOM_QUICKSAVE: - game.customloadquick(cl.ListOfMetaData[game.playcustomlevel].filename); - break; - default: - VVV_unreachable(); - } + load("intermission_1"); + break; + case 16: + game.gamestate = GAMEMODE; + hardreset(); + music.fadeout(); - graphics.fademode = FADE_START_FADEIN; - break; - } - case Start_CUTSCENETEST: - music.fadeout(); - game.translator_exploring = true; - game.translator_cutscene_test = true; - game.startspecial(2); - game.mapheld = true; + game.lastsaved = 2; - loadtest(game.cutscenetest_menu_play_id); - break; + game.crewstats[game.lastsaved] = true; + game.inintermission = true; + map.finalmode = true; + map.final_colormode = false; + map.final_mapcol = 0; + map.final_colorframe = 0; + game.startspecial(1); + game.jumpheld = true; - case Start_QUIT: - VVV_unreachable(); - break; - } + //set flipmode + if (graphics.setflipmode) graphics.flipmode = true; + if(obj.entities.empty()) + { + obj.createentity(game.savex, game.savey, 0, 0); //In this game, constant, never destroyed + } + map.resetplayer(); + map.gotoroom(game.saverx, game.savery); + map.initmapdata(); - game.gravitycontrol = game.savegc; - graphics.flipmode = graphics.setflipmode; + load("intermission_2"); + break; + case 17: + game.gamestate = GAMEMODE; + hardreset(); + music.fadeout(); - if (!map.custommode && !graphics.setflipmode) - { - /* Invalidate Flip Mode trophy */ - obj.flags[73] = true; - } + game.lastsaved = 3; - obj.entities.clear(); - obj.createentity(game.savex, game.savey, 0, 0); - if (player_hitbox.initialized) - { - /* Restore player hitbox */ - const int player_idx = obj.getplayer(); - if (INBOUNDS_VEC(player_idx, obj.entities)) - { - entclass* player = &obj.entities[player_idx]; - player->size = player_hitbox.size; - player->cx = player_hitbox.cx; - player->cy = player_hitbox.cy; - player->w = player_hitbox.w; - player->h = player_hitbox.h; - } - } + game.crewstats[game.lastsaved] = true; + game.inintermission = true; + map.finalmode = true; + map.final_colormode = false; + map.final_mapcol = 0; + map.final_colorframe = 0; + game.startspecial(1); + game.jumpheld = true; - map.resetplayer(); - map.gotoroom(game.saverx, game.savery); - map.initmapdata(); - if (map.custommode) - { - cl.generatecustomminimap(); - } + //set flipmode + if (graphics.setflipmode) graphics.flipmode = true; + if(obj.entities.empty()) + { + obj.createentity(game.savex, game.savey, 0, 0); //In this game, constant, never destroyed + } + map.resetplayer(); + map.gotoroom(game.saverx, game.savery); + map.initmapdata(); - /* If we are spawning in a tower, ensure variables are set correctly */ - if (map.towermode) - { - map.resetplayer(); + load("intermission_2"); + break; + case 18: + game.gamestate = GAMEMODE; + hardreset(); + music.fadeout(); - i = obj.getplayer(); - if (INBOUNDS_VEC(i, obj.entities)) - { - map.ypos = obj.entities[i].yp - 120; - map.oldypos = map.ypos; - } - map.setbgobjlerp(graphics.towerbg); - map.cameramode = 0; - map.colsuperstate = 0; - } + game.lastsaved = 4; + + game.crewstats[game.lastsaved] = true; + game.inintermission = true; + map.finalmode = true; + map.final_colormode = false; + map.final_mapcol = 0; + map.final_colorframe = 0; + game.startspecial(1); + game.jumpheld = true; + + //set flipmode + if (graphics.setflipmode) graphics.flipmode = true; + if(obj.entities.empty()) + { + obj.createentity(game.savex, game.savey, 0, 0); //In this game, constant, never destroyed + } + map.resetplayer(); + map.gotoroom(game.saverx, game.savery); + map.initmapdata(); + + load("intermission_2"); + break; + case 19: + game.gamestate = GAMEMODE; + hardreset(); + music.fadeout(); + + game.lastsaved = 5; + + game.crewstats[game.lastsaved] = true; + game.inintermission = true; + map.finalmode = true; + map.final_colormode = false; + map.final_mapcol = 0; + map.final_colorframe = 0; + game.startspecial(1); + game.jumpheld = true; + + //set flipmode + if (graphics.setflipmode) graphics.flipmode = true; + if(obj.entities.empty()) + { + obj.createentity(game.savex, game.savey, 0, 0); //In this game, constant, never destroyed + } + map.resetplayer(); + map.gotoroom(game.saverx, game.savery); + map.initmapdata(); + + load("intermission_2"); + break; +#if !defined(NO_CUSTOM_LEVELS) + case 20: + //Level editor + hardreset(); + ed.reset(); + music.fadeout(); + map.custommode = true; + map.custommodeforreal = false; + + game.gamestate = EDITORMODE; + game.jumpheld = true; + + if (graphics.setflipmode) graphics.flipmode = true;//set flipmode + if(obj.entities.empty()) + { + obj.createentity(game.savex, game.savey, 0, 0); //In this game, constant, never destroyed + } + map.resetplayer(); + map.gotoroom(game.saverx, game.savery); + map.initmapdata(); + graphics.fademode = 4; + break; + case 21: //play custom level (in editor) + game.gamestate = GAMEMODE; + music.fadeout(); + hardreset(); + //If warpdir() is used during playtesting, we need to set it back after! + for (int j = 0; j < ed.maxheight; j++) + { + for (int i = 0; i < ed.maxwidth; i++) + { + ed.kludgewarpdir[i+(j*ed.maxwidth)]=ed.level[i+(j*ed.maxwidth)].warpdir; + } + } + game.customstart(); + game.jumpheld = true; + + ed.ghosts.clear(); + + map.custommode = true; + + //set flipmode + if (graphics.setflipmode) graphics.flipmode = true; + + if(obj.entities.empty()) + { + obj.createentity(game.savex, game.savey, 0, 0); //In this game, constant, never destroyed + } + map.resetplayer(); + map.gotoroom(game.saverx, game.savery); + map.initmapdata(); + if(ed.levmusic>0){ + music.play(ed.levmusic); + }else{ + music.currentsong=-1; + } + break; + case 22: //play custom level (in game) + { + //Initilise the level + //First up, find the start point + std::string filename = std::string(ed.ListOfMetaData[game.playcustomlevel].filename); + if (!ed.load(filename)) + { + gotoerrorloadinglevel(); + break; + } + ed.findstartpoint(); + + game.gamestate = GAMEMODE; + music.fadeout(); + hardreset(); + game.customstart(); + game.jumpheld = true; + + map.custommodeforreal = true; + map.custommode = true; + + //set flipmode + if (graphics.setflipmode) graphics.flipmode = true; + + if(obj.entities.empty()) + { + obj.createentity(game.savex, game.savey, 0, 0); //In this game, constant, never destroyed + } + map.resetplayer(); + map.gotoroom(game.saverx, game.savery); + map.initmapdata(); + + ed.generatecustomminimap(); + map.customshowmm=true; + if(ed.levmusic>0){ + music.play(ed.levmusic); + }else{ + music.currentsong=-1; + } + graphics.fademode = 4; + break; + } + case 23: //Continue in custom level + { + //Initilise the level + //First up, find the start point + std::string filename = std::string(ed.ListOfMetaData[game.playcustomlevel].filename); + if (!ed.load(filename)) + { + gotoerrorloadinglevel(); + break; + } + ed.findstartpoint(); + + game.gamestate = GAMEMODE; + music.fadeout(); + hardreset(); + map.custommodeforreal = true; + map.custommode = true; + + game.customstart(); + game.customloadquick(ed.ListOfMetaData[game.playcustomlevel].filename); + game.jumpheld = true; + game.gravitycontrol = game.savegc; + + + //set flipmode + if (graphics.setflipmode) graphics.flipmode = true; + + if(obj.entities.empty()) + { + obj.createentity(game.savex, game.savey, 0, 0); //In this game, constant, never destroyed + } + map.resetplayer(); + map.gotoroom(game.saverx, game.savery); + map.initmapdata(); + ed.generatecustomminimap(); + graphics.fademode = 4; + break; + } +#endif + case 100: + VVV_exit(0); + break; + } } void scriptclass::teleport(void) { - //er, ok! Teleport to a new area, so! - //A general rule of thumb: if you teleport with a companion, get rid of them! - game.companion = 0; + //er, ok! Teleport to a new area, so! + //A general rule of thumb: if you teleport with a companion, get rid of them! + game.companion = 0; - i = obj.getplayer(); //less likely to have a serious collision error if the player is centered - if (INBOUNDS_VEC(i, obj.entities)) - { - obj.entities[i].xp = 150; - obj.entities[i].yp = 110; - if(game.teleport_to_x==17 && game.teleport_to_y==17) obj.entities[i].xp = 88; //prevent falling! - obj.entities[i].lerpoldxp = obj.entities[i].xp; - obj.entities[i].lerpoldyp = obj.entities[i].yp; - } + i = obj.getplayer(); //less likely to have a serious collision error if the player is centered + if (INBOUNDS_VEC(i, obj.entities)) + { + obj.entities[i].xp = 150; + obj.entities[i].yp = 110; + if(game.teleport_to_x==17 && game.teleport_to_y==17) obj.entities[i].xp = 88; //prevent falling! + obj.entities[i].lerpoldxp = obj.entities[i].xp; + obj.entities[i].lerpoldyp = obj.entities[i].yp; + } - if (game.teleportscript == "levelonecomplete") - { - game.teleport_to_x = 2; - game.teleport_to_y = 11; - } - else if (game.teleportscript == "gamecomplete") - { - game.teleport_to_x = 2; - game.teleport_to_y = 11; - } + if (game.teleportscript == "levelonecomplete") + { + game.teleport_to_x = 2; + game.teleport_to_y = 11; + } + else if (game.teleportscript == "gamecomplete") + { + game.teleport_to_x = 2; + game.teleport_to_y = 11; + } - game.gravitycontrol = 0; - map.gotoroom(100+game.teleport_to_x, 100+game.teleport_to_y); - j = obj.getteleporter(); - if (INBOUNDS_VEC(j, obj.entities)) - { - obj.entities[j].state = 2; - } - game.teleport_to_new_area = false; + game.gravitycontrol = 0; + map.gotoroom(100+game.teleport_to_x, 100+game.teleport_to_y); + j = obj.getteleporter(); + if (INBOUNDS_VEC(j, obj.entities)) + { + obj.entities[j].state = 2; + } + game.teleport_to_new_area = false; - if (INBOUNDS_VEC(j, obj.entities)) - { - game.savepoint = obj.entities[j].para; - game.savex = obj.entities[j].xp + 44; - game.savey = obj.entities[j].yp + 44; - } - game.savegc = 0; + if (INBOUNDS_VEC(j, obj.entities)) + { + game.savepoint = obj.entities[j].para; + game.savex = obj.entities[j].xp + 44; + game.savey = obj.entities[j].yp + 44; + } + game.savegc = 0; - game.saverx = game.roomx; - game.savery = game.roomy; - int player = obj.getplayer(); - if (INBOUNDS_VEC(player, obj.entities)) - { - game.savedir = obj.entities[player].dir; - } + game.saverx = game.roomx; + game.savery = game.roomy; + int player = obj.getplayer(); + if (INBOUNDS_VEC(player, obj.entities)) + { + game.savedir = obj.entities[player].dir; + } - if(game.teleport_to_x==0 && game.teleport_to_y==0) - { - game.setstate(4020); - } - else if(game.teleport_to_x==0 && game.teleport_to_y==16) - { - game.setstate(4030); - } - else if(game.teleport_to_x==7 && game.teleport_to_y==9) - { - game.setstate(4040); - } - else if(game.teleport_to_x==8 && game.teleport_to_y==11) - { - game.setstate(4050); - } - else if(game.teleport_to_x==14 && game.teleport_to_y==19) - { - game.setstate(4030); - } - else if(game.teleport_to_x==17 && game.teleport_to_y==12) - { - game.setstate(4020); - } - else if(game.teleport_to_x==17 && game.teleport_to_y==17) - { - game.setstate(4020); - } - else if(game.teleport_to_x==18 && game.teleport_to_y==7) - { - game.setstate(4060); - } - else - { - game.setstate(4010); - } + if(game.teleport_to_x==0 && game.teleport_to_y==0) + { + game.state = 4020; + } + else if(game.teleport_to_x==0 && game.teleport_to_y==16) + { + game.state = 4030; + } + else if(game.teleport_to_x==7 && game.teleport_to_y==9) + { + game.state = 4040; + } + else if(game.teleport_to_x==8 && game.teleport_to_y==11) + { + game.state = 4050; + } + else if(game.teleport_to_x==14 && game.teleport_to_y==19) + { + game.state = 4030; + } + else if(game.teleport_to_x==17 && game.teleport_to_y==12) + { + game.state = 4020; + } + else if(game.teleport_to_x==17 && game.teleport_to_y==17) + { + game.state = 4020; + } + else if(game.teleport_to_x==18 && game.teleport_to_y==7) + { + game.state = 4060; + } + else + { + game.state = 4010; + } - if (game.teleportscript != "") - { - game.setstate(0); - load(game.teleportscript); - game.teleportscript = ""; - } - else - { - //change music based on location - if (game.teleport_to_x == 2 && game.teleport_to_y == 11) - { - /* Special case: Ship music needs to be set here; - * ship teleporter on music map is -1 for jukebox. */ - music.niceplay(Music_PASSIONFOREXPLORING); - } - game.savetele_textbox(); - } + if (game.teleportscript != "") + { + game.state = 0; + load(game.teleportscript); + game.teleportscript = ""; + } + else + { + //change music based on location + if (game.teleport_to_x == 2 && game.teleport_to_y == 11) + { + /* Special case: Ship music needs to be set here; + * ship teleporter on music map is -1 for jukebox. */ + music.niceplay(4); + } + game.savetele_textbox(); + } } void scriptclass::hardreset(void) { - const bool version2_2 = GlitchrunnerMode_less_than_or_equal(Glitchrunner2_2); + const bool version2_2 = GlitchrunnerMode_less_than_or_equal(Glitchrunner2_2); - if (game.seed_use_sdl_getticks) - { - /* The RNG is 32-bit. We don't _really_ need 64-bit... */ - xoshiro_seed((Uint32) SDL_GetTicks64()); - } - else - { - xoshiro_seed(game.framecounter); - } + xoshiro_seed(SDL_GetTicks()); - //Game: - game.hascontrol = true; - game.gravitycontrol = 0; - game.teleport = false; - game.companion = 0; - if (!version2_2) - { - // Ironically, resetting more variables makes the janky fadeout system in glitchrunnermode even more glitchy - game.roomx = 0; - game.roomy = 0; - } - game.prevroomx = 0; - game.prevroomy = 0; - game.teleport_to_new_area = false; - game.teleport_to_x = 0; - game.teleport_to_y = 0; - game.teleportscript = ""; + //Game: + game.hascontrol = true; + game.gravitycontrol = 0; + game.teleport = false; + game.companion = 0; + game.roomchange = false; + if (!version2_2) + { + // Ironically, resetting more variables makes the janky fadeout system in glitchrunnermode even more glitchy + game.roomx = 0; + game.roomy = 0; + } + game.prevroomx = 0; + game.prevroomy = 0; + game.teleport_to_new_area = false; + game.teleport_to_x = 0; + game.teleport_to_y = 0; + game.teleportscript = ""; - game.tapleft = 0; - game.tapright = 0; - game.startscript = false; - game.newscript = ""; - game.alarmon = false; - game.alarmdelay = 0; - game.blackout = false; - game.useteleporter = false; - game.teleport_to_teleporter = 0; + game.tapleft = 0; + game.tapright = 0; + game.startscript = false; + game.newscript = ""; + game.alarmon = false; + game.alarmdelay = 0; + game.blackout = false; + game.useteleporter = false; + game.teleport_to_teleporter = 0; - game.nodeathmode = false; - game.nocutscenes = false; - game.nodeatheligible = false; + game.nodeathmode = false; + game.nocutscenes = false; - for (i = 0; i < (int) SDL_arraysize(game.crewstats); i++) - { - game.crewstats[i] = false; - } - game.crewstats[0] = true; - game.lastsaved = 0; + for (i = 0; i < (int) SDL_arraysize(game.crewstats); i++) + { + game.crewstats[i] = false; + } + game.crewstats[0] = true; + game.lastsaved = 0; - game.deathcounts = 0; - game.gameoverdelay = 0; - game.resetgameclock(); - game.gamesaved = false; - game.gamesavefailed = false; - game.savetime = "00:00"; - game.savetrinkets = 0; - if (!version2_2) - { - // Ironically, resetting more variables makes the janky fadeout system in glitchrunnermode even more glitchy - game.saverx = 0; - game.savery = 0; - game.savex = 0; - game.savey = 0; - game.savegc = 0; - } - game.savecolour = cl.player_colour; + game.deathcounts = 0; + game.gameoverdelay = 0; + game.resetgameclock(); + game.gamesaved = false; + game.gamesavefailed = false; + game.savetime = "00:00"; + game.savearea = "nowhere"; + game.savetrinkets = 0; + if (!version2_2) + { + // Ironically, resetting more variables makes the janky fadeout system in glitchrunnermode even more glitchy + game.saverx = 0; + game.savery = 0; + } - game.intimetrial = false; - game.timetrialcountdown = 0; - game.timetrialshinytarget = 0; - game.timetrialparlost = false; - game.timetrialpar = 0; - game.timetrialcheater = false; + game.intimetrial = false; + game.timetrialcountdown = 0; + game.timetrialshinytarget = 0; + game.timetrialparlost = false; + game.timetrialpar = 0; - game.translator_exploring = game.start_translator_exploring; - game.start_translator_exploring = false; - game.translator_exploring_allowtele = false; - game.translator_cutscene_test = false; + game.totalflips = 0; + game.hardestroom = "Welcome Aboard"; + game.hardestroomdeaths = 0; + game.currentroomdeaths=0; - game.totalflips = 0; - game.hardestroom = "Welcome Aboard"; - game.hardestroomdeaths = 0; - game.hardestroom_x = 13; - game.hardestroom_y = 5; - game.hardestroom_specialname = false; - game.hardestroom_finalstretch = false; - game.currentroomdeaths=0; + game.swnmode = false; + game.swntimer = 0; + game.swngame = 0;//Not playing sine wave ninja! + game.swnstate = 0; + game.swnstate2 = 0; + game.swnstate3 = 0; + game.swnstate4 = 0; + game.swndelay = 0; + game.swndeaths = 0; + game.supercrewmate = false; + game.scmhurt = false; + game.scmprogress = 0; + game.scmmoveme = false; + game.swncolstate = 0; + game.swncoldelay = 0; + game.swnrank = 0; + game.swnmessage = 0; + game.creditposx = 0; + game.creditposy = 0; + game.creditposdelay = 0; - game.swnmode = false; - game.swntimer = 0; - game.swngame = SWN_NONE; // Not playing sine wave ninja! - game.swnstate = 0; - game.swnstate2 = 0; - game.swnstate3 = 0; - game.swnstate4 = 0; - game.swndelay = 0; - game.swndeaths = 0; - game.supercrewmate = false; - game.scmhurt = false; - game.scmprogress = 0; - game.swncolstate = 0; - game.swncoldelay = 0; - game.swnrank = 0; - game.swnmessage = 0; - game.creditposx = 0; - game.creditposy = 0; - game.creditposdelay = 0; + game.inintermission = false; + game.insecretlab = false; - game.inintermission = false; - game.insecretlab = false; + game.state = 0; + game.statedelay = 0; - game.unlockstate(); - game.state = 0; - game.statedelay = 0; + game.hascontrol = true; + if (!GlitchrunnerMode_less_than_or_equal(Glitchrunner2_0)) + { + // Keep the "- Press ACTION to advance text -" prompt around, + // apparently the speedrunners call it the "text storage" glitch + game.advancetext = false; + } - game.hascontrol = true; - if (!GlitchrunnerMode_less_than_or_equal(Glitchrunner2_0)) - { - // Keep the "- Press ACTION to advance text -" prompt around, - // apparently the speedrunners call it the "text storage" glitch - game.advancetext = false; - } + game.pausescript = false; + game.completestop = false; - game.pausescript = false; - game.completestop = false; + game.flashlight = 0; + game.screenshake = 0; - game.flashlight = 0; - game.screenshake = 0; + game.activeactivity = -1; + game.act_fade = 5; - game.activeactivity = -1; - game.act_fade = 5; + game.disabletemporaryaudiopause = true; - game.disabletemporaryaudiopause = true; + //dwgraphicsclass + graphics.backgrounddrawn = false; + graphics.textbox.clear(); + graphics.flipmode = false; //This will be reset if needs be elsewhere + graphics.showcutscenebars = false; + graphics.setbars(0); - game.ingame_titlemode = false; + //mapclass + map.warpx = false; + map.warpy = false; + map.showteleporters = false; + map.showtargets = false; + map.showtrinkets = false; + map.finalmode = false; + map.finalstretch = false; + map.final_colormode = false; + map.final_colorframe = 0; + map.final_colorframedelay = 0; + map.final_mapcol = 0; + map.final_aniframe = 0; + map.final_aniframedelay = 0; + map.rcol = 0; + map.resetnames(); + map.custommode=false; + map.custommodeforreal=false; + if (!version2_2) + { + // Ironically, resetting more variables makes the janky fadeout system even more glitchy + map.towermode=false; + } + map.cameraseekframe = 0; + map.resumedelay = 0; + graphics.towerbg.scrolldir = 0; + map.customshowmm=true; - //dwgraphicsclass - graphics.backgrounddrawn = false; - graphics.textboxes.clear(); - graphics.flipmode = false; //This will be reset if needs be elsewhere - graphics.showcutscenebars = false; - graphics.setbars(0); + SDL_memset(map.roomdeaths, 0, sizeof(map.roomdeaths)); + SDL_memset(map.roomdeathsfinal, 0, sizeof(map.roomdeathsfinal)); + map.resetmap(); + //entityclass + obj.nearelephant = false; + obj.upsetmode = false; + obj.upset = 0; - //mapclass - map.warpx = false; - map.warpy = false; - map.showteleporters = false; - map.showtargets = false; - map.showtrinkets = false; - map.finalmode = false; - map.finalstretch = false; - map.final_colormode = false; - map.final_colorframe = 0; - map.final_colorframedelay = 0; - map.final_mapcol = 0; - map.final_aniframe = 0; - map.final_aniframedelay = 0; - map.rcol = 0; - map.custommode=false; - map.custommodeforreal=false; - if (!version2_2) - { - // Ironically, resetting more variables makes the janky fadeout system even more glitchy - map.towermode=false; - } - map.cameraseekframe = 0; - map.resumedelay = 0; - graphics.towerbg.scrolldir = 0; - map.customshowmm = true; - map.revealmap = true; + obj.trophytext = 0 ; + obj.trophytype = 0; + obj.altstates = 0; - SDL_memset(map.roomdeaths, 0, sizeof(map.roomdeaths)); - SDL_memset(map.roomdeathsfinal, 0, sizeof(map.roomdeathsfinal)); - map.resetmap(); - map.currentregion = 0; - SDL_zeroa(map.region); - //entityclass - obj.nearelephant = false; - obj.upsetmode = false; - obj.upset = 0; + obj.resetallflags(); - obj.trophytext = 0 ; - obj.trophytype = 0; - obj.altstates = 0; + for (i = 0; i < (int) SDL_arraysize(obj.customcrewmoods); i++){ + obj.customcrewmoods[i]=true; + } - obj.resetallflags(); + SDL_memset(obj.collect, false, sizeof(obj.collect)); + SDL_memset(obj.customcollect, false, sizeof(obj.customcollect)); + i = 100; //previously a for-loop iterating over collect/customcollect set this to 100 - for (i = 0; i < (int) SDL_arraysize(obj.customcrewmoods); i++){ - obj.customcrewmoods[i]=true; - } + int theplayer = obj.getplayer(); + if (INBOUNDS_VEC(theplayer, obj.entities)){ + obj.entities[theplayer].tile = 0; + } - SDL_memset(obj.collect, false, sizeof(obj.collect)); - SDL_memset(obj.customcollect, false, sizeof(obj.customcollect)); - i = 100; //previously a for-loop iterating over collect/customcollect set this to 100 + /* Disable duplicate player entities */ + for (int i = 0; i < (int) obj.entities.size(); i++) + { + if (obj.entities[i].rule == 0 && i != theplayer) + { + obj.disableentity(i); + } + } - int theplayer = obj.getplayer(); - if (INBOUNDS_VEC(theplayer, obj.entities)){ - obj.entities[theplayer].tile = 0; - } + obj.customscript = ""; - /* Disable duplicate player entities */ - for (int i = 0; i < (int) obj.entities.size(); i++) - { - if (obj.entities[i].rule == 0 && i != theplayer) - { - obj.disableentity(i); - } - } - - obj.customscript = ""; - - //Script Stuff - position = 0; - commands.clear(); - scriptdelay = 0; - scriptname = "null"; - running = false; - for (size_t ii = 0; ii < NUM_SCRIPT_ARGS; ++ii) - { - words[ii] = ""; - raw_words[ii] = ""; - } - - obj.customactivitycolour = ""; - obj.customactivitytext = ""; - obj.customactivitypositiony = -1; + //Script Stuff + position = 0; + commands.clear(); + scriptdelay = 0; + scriptname = "null"; + running = false; + for (size_t ii = 0; ii < SDL_arraysize(words); ++ii) + { + words[ii] = ""; + } } -bool scriptclass::loadcustom(const std::string& t) +void scriptclass::loadcustom(const std::string& t) { - //this magic function breaks down the custom script and turns into real scripting! - std::string cscriptname=""; - for(size_t i=0; i=7) cscriptname+=t[i]; - } + //this magic function breaks down the custom script and turns into real scripting! + std::string cscriptname=""; + for(size_t i=0; i=7) cscriptname+=t[i]; + } - std::string tstring; + std::string tstring; - std::vector* contents = NULL; - for(size_t i = 0; i < customscripts.size(); i++){ - Script& script_ = customscripts[i]; + std::vector* contents = NULL; + for(size_t i = 0; i < customscripts.size(); i++){ + Script& script_ = customscripts[i]; - if(script_.name == cscriptname){ - contents = &script_.contents; - break; - } - } - if(contents == NULL){ - return false; - } + if(script_.name == cscriptname){ + contents = &script_.contents; + break; + } + } + if(contents == NULL){ + return; + } - std::vector& lines = *contents; + std::vector& lines = *contents; - //Ok, we've got the relavent script segment, we do a pass to assess it, then run it! - int customcutscenemode=0; - for(size_t i=0; i= 0 ? ti : 1; - for (int ti2 = 0; ti2 < nti; ti2++) - { - i++; - if (INBOUNDS_VEC(i, lines)) - { - add(lines[i]); - } - } + if(customcutscenemode==1){ + add("cutscene()"); + add("untilbars()"); + } + int customtextmode=0; + int speakermode=0; //0, terminal, numbers for crew + int squeakmode=0;//default on + //Now run the script + for(size_t i=0; i=0 && ti<=50 ? ti : 1; + for(int ti2=0; ti2=0 ? ti : 1; - for(int ti2=0; ti2=0 && ti<=50 ? ti : 1; + for(int ti2=0; ti2 -#include #include #include -#include "Textbox.h" +#include #define filllines(lines) commands.insert(commands.end(), lines, lines + SDL_arraysize(lines)) -#ifdef SCRIPT_DEFINITION -#define TEXT_COLOUR(a) textbox_colours[a] -#else -#define TEXT_COLOUR(a) script.textbox_colours[a] -#endif struct Script { @@ -24,45 +17,6 @@ struct Script #define NUM_SCRIPT_ARGS 40 -enum StartMode -{ - Start_MAINGAME, - Start_MAINGAME_TELESAVE, - Start_MAINGAME_QUICKSAVE, - Start_TIMETRIAL_SPACESTATION1, - Start_TIMETRIAL_LABORATORY, - Start_TIMETRIAL_TOWER, - Start_TIMETRIAL_SPACESTATION2, - Start_TIMETRIAL_WARPZONE, - Start_TIMETRIAL_FINALLEVEL, - Start_NODEATHMODE_WITHCUTSCENES, - Start_NODEATHMODE_NOCUTSCENES, - Start_SECRETLAB, - Start_INTERMISSION1_VITELLARY, - Start_INTERMISSION1_VERMILION, - Start_INTERMISSION1_VERDIGRIS, - Start_INTERMISSION1_VICTORIA, - Start_INTERMISSION2_VITELLARY, - Start_INTERMISSION2_VERMILION, - Start_INTERMISSION2_VERDIGRIS, - Start_INTERMISSION2_VICTORIA, - Start_EDITOR, - Start_EDITORPLAYTESTING, - Start_CUSTOM, - Start_CUSTOM_QUICKSAVE, - Start_QUIT, - Start_CUTSCENETEST, - - Start_FIRST_NODEATHMODE = Start_NODEATHMODE_WITHCUTSCENES, - Start_LAST_NODEATHMODE = Start_NODEATHMODE_NOCUTSCENES, - Start_FIRST_INTERMISSION1 = Start_INTERMISSION1_VITELLARY, - Start_LAST_INTERMISSION1 = Start_INTERMISSION1_VICTORIA, - Start_FIRST_INTERMISSION2 = Start_INTERMISSION2_VITELLARY, - Start_LAST_INTERMISSION2 = Start_INTERMISSION2_VICTORIA, - - Start_FIRST_TIMETRIAL = Start_TIMETRIAL_SPACESTATION1 -}; - class scriptclass { public: @@ -70,28 +24,24 @@ public: scriptclass(void); - bool load(const std::string& name); + void load(const std::string& name); void loadother(const char* t); - bool loadcustom(const std::string& t); - void loadalts(const std::string& processed, const std::string& raw); - - void add_test_line(const std::string& speaker, const std::string& english, char textcase, bool textbuttons); - void loadtest(const std::string& name); + void loadcustom(const std::string& t); void inline add(const std::string& t) { commands.push_back(t); } - void add_default_colours(void); - void clearcustom(void); void tokenize(const std::string& t); void run(void); - void startgamemode(enum StartMode mode); + void resetgametomenu(void); + + void startgamemode(int t); void teleport(void); @@ -108,23 +58,11 @@ public: int scriptdelay; bool running; - // Textbox stuff - std::map textbox_colours; + //Textbox stuff int textx; int texty; - TextboxCrewmatePosition textcrewmateposition; - TextboxOriginalContext textoriginalcontext; int r,g,b; bool textflipme; - char textcase; - bool textbuttons; - bool textlarge; - int textboxtimer; - std::vector textbox_sprites; - TextboxImage textbox_image; - bool textbox_absolutepos; - bool textbox_force_outline; - bool textbox_outline; //Misc int i, j, k; diff --git a/desktop_version/src/Scripts.cpp b/desktop_version/src/Scripts.cpp index 18f1984c..01fc4ac3 100644 --- a/desktop_version/src/Scripts.cpp +++ b/desktop_version/src/Scripts.cpp @@ -2,19 +2,18 @@ #include -bool scriptclass::load(const std::string& name) +void scriptclass::load(const std::string& name) { //loads script name t into the array position = 0; commands.clear(); - scriptname = name; running = true; const char* t = name.c_str(); if (SDL_strncmp(t, "custom_", 7) == 0) { - return loadcustom(name); + loadcustom(name); } else if (SDL_strcmp(t, "intro") == 0) { @@ -420,6 +419,7 @@ bool scriptclass::load(const std::string& name) "untilbars()", }; filllines(lines); + return; } if (SDL_strcmp(t, "communicationstation") == 0) { @@ -1568,7 +1568,6 @@ bool scriptclass::load(const std::string& name) "delay(45)", "squeak(cry)", - "textcase(1)", "text(blue,0,0,1)", "Waaaa!", "position(blue,above)", @@ -1596,7 +1595,6 @@ bool scriptclass::load(const std::string& name) "speak_active", "squeak(cry)", - "textcase(2)", "text(blue,0,0,1)", "Waaaa!", "position(blue,above)", @@ -2724,7 +2722,7 @@ bool scriptclass::load(const std::string& name) "speak_active", "squeak(yellow)", - "changeai(yellow,faceleft)", // changedir(yellow,0) doesn't work + "changedir(yellow,0)", "text(yellow,0,0,3)", "We shouldn't really be able", "to move between dimensions", @@ -2733,6 +2731,7 @@ bool scriptclass::load(const std::string& name) "speak_active", "squeak(yellow)", + "changedir(yellow,0)", "text(yellow,0,0,2)", "Maybe this isn't a proper", "dimension at all?", @@ -2740,6 +2739,7 @@ bool scriptclass::load(const std::string& name) "speak_active", "squeak(yellow)", + "changedir(yellow,0)", "text(yellow,0,0,4)", "Maybe it's some kind of", "polar dimension? Something", @@ -2749,7 +2749,7 @@ bool scriptclass::load(const std::string& name) "speak_active", "squeak(yellow)", - "changeai(yellow,0)", // Make him face right again + "changedir(yellow,1)", "text(yellow,0,0,2)", "I can't wait to get back to the", "ship. I have a lot of tests to run!", @@ -4598,7 +4598,7 @@ bool scriptclass::load(const std::string& name) "squeak(purple)", "changemood(purple,0)", "text(purple,0,0,2)", - "If you can find him, he'd be", + "If you can find him, he'd be a", "a big help fixing the ship!", "position(purple,above)", "speak_active", @@ -5054,10 +5054,9 @@ bool scriptclass::load(const std::string& name) "squeak(purple)", "text(purple,0,0,2)", - "Remember that you can press {b_map}", + "Remember that you can press ENTER", "to check where you are on the map!", "position(purple,above)", - "textbuttons()", "speak_active", "squeak(purple)", @@ -5947,31 +5946,26 @@ bool scriptclass::load(const std::string& name) "delay(1)", "squeak(green)", - "textcase(1)", "text(purple,0,0,1)", "Captain! ", "position(purple,above)", "backgroundtext", "speak", - "textcase(2)", "text(yellow,0,0,1)", "Captain! ", "position(yellow,above)", "backgroundtext", "speak", - "textcase(3)", "text(red,0,0,1)", "Captain! ", "position(red,above)", "backgroundtext", "speak", - "textcase(4)", "text(green,0,0,1)", "Captain! ", "position(green,above)", "backgroundtext", "speak", - "textcase(5)", "text(blue,0,0,1)", "Captain!", "position(blue,above)", @@ -6542,37 +6536,31 @@ bool scriptclass::load(const std::string& name) "changemood(player,0)", "changemood(green,0)", "changemood(purple,0)", - "textcase(1)", "text(player,0,0,1)", "COMBINE!", "position(player,above)", "backgroundtext", "speak", - "textcase(2)", "text(purple,0,0,1)", "COMBINE!", "position(purple,above)", "backgroundtext", "speak", - "textcase(3)", "text(yellow,0,0,1)", "COMBINE!", "position(yellow,above)", "backgroundtext", "speak", - "textcase(4)", "text(red,0,0,1)", "COMBINE!", "position(red,above)", "backgroundtext", "speak", - "textcase(5)", "text(green,0,0,1)", "COMBINE!", "position(green,above)", "backgroundtext", "speak", - "textcase(6)", "text(blue,0,0,1)", "COMBINE!", "position(blue,above)", @@ -6736,30 +6724,9 @@ bool scriptclass::load(const std::string& name) }; filllines(lines); } - else if (SDL_strcmp(t, "disableaccessibility") == 0) - { - static const char* lines[] = { - "cutscene()", - "untilbars()", - - "squeak(terminal)", - "text(gray,0,114,3)", - "Please disable invincibility", - "and/or slowdown before entering", - "the Super Gravitron.", - "position(center)", - "speak", - - "endtext", - "endcutscene()", - "untilbars()", - }; - filllines(lines); - } else { loadother(t); } - return !commands.empty(); } diff --git a/desktop_version/src/SoundSystem.cpp b/desktop_version/src/SoundSystem.cpp new file mode 100644 index 00000000..8c5f962c --- /dev/null +++ b/desktop_version/src/SoundSystem.cpp @@ -0,0 +1,66 @@ +#include "SoundSystem.h" + +#include +#include + +#include "FileSystemUtils.h" + +MusicTrack::MusicTrack(const char* fileName) +{ + m_music = Mix_LoadMUS(fileName); + m_isValid = true; + if(m_music == NULL) + { + fprintf(stderr, "Unable to load Ogg Music file: %s\n", Mix_GetError()); + m_isValid = false; + } +} + +MusicTrack::MusicTrack(SDL_RWops *rw) +{ + m_music = Mix_LoadMUS_RW(rw, 1); + m_isValid = true; + if(m_music == NULL) + { + fprintf(stderr, "Unable to load Magic Binary Music file: %s\n", Mix_GetError()); + m_isValid = false; + } +} + +SoundTrack::SoundTrack(const char* fileName) +{ + unsigned char *mem; + size_t length; + + sound = NULL; + + FILESYSTEM_loadAssetToMemory(fileName, &mem, &length, false); + if (mem == NULL) + { + fprintf(stderr, "Unable to load WAV file %s\n", fileName); + SDL_assert(0 && "WAV file missing!"); + return; + } + SDL_RWops *fileIn = SDL_RWFromConstMem(mem, length); + sound = Mix_LoadWAV_RW(fileIn, 1); + FILESYSTEM_freeMemory(&mem); + + if (sound == NULL) + { + fprintf(stderr, "Unable to load WAV file: %s\n", Mix_GetError()); + } +} + +SoundSystem::SoundSystem(void) +{ + int audio_rate = 44100; + Uint16 audio_format = AUDIO_S16SYS; + int audio_channels = 2; + int audio_buffers = 1024; + + if (Mix_OpenAudio(audio_rate, audio_format, audio_channels, audio_buffers) != 0) + { + fprintf(stderr, "Unable to initialize audio: %s\n", Mix_GetError()); + SDL_assert(0 && "Unable to initialize audio!"); + } +} diff --git a/desktop_version/src/SoundSystem.h b/desktop_version/src/SoundSystem.h new file mode 100644 index 00000000..0cf3b84a --- /dev/null +++ b/desktop_version/src/SoundSystem.h @@ -0,0 +1,28 @@ +#ifndef SOUNDSYSTEM_H +#define SOUNDSYSTEM_H + +#include + +class MusicTrack +{ +public: + MusicTrack(const char* fileName); + MusicTrack(SDL_RWops *rw); + Mix_Music *m_music; + bool m_isValid; +}; + +class SoundTrack +{ +public: + SoundTrack(const char* fileName); + Mix_Chunk *sound; +}; + +class SoundSystem +{ +public: + SoundSystem(void); +}; + +#endif /* SOUNDSYSTEM_H */ diff --git a/desktop_version/src/Spacestation2.cpp b/desktop_version/src/Spacestation2.cpp index 1da7cbc6..c0192f7e 100644 --- a/desktop_version/src/Spacestation2.cpp +++ b/desktop_version/src/Spacestation2.cpp @@ -3,3637 +3,3634 @@ #include "Game.h" #include "Entity.h" #include "MakeAndPlay.h" +#include "UtilityClass.h" const short* spacestation2class::loadlevel(int rx, int ry) { - int t; - rx -= 100; - ry -= 100; + int t; + rx -= 100; + ry -= 100; - rx += 50 - 12; - ry += 50 - 14; //Space Station + rx += 50 - 12; + ry += 50 - 14; //Space Station - t = rx + (ry * 100); + t = rx + (ry * 100); - const short* result; - roomname = "Untitled room"; - roomname_special = false; + const short* result; + roomname = "Untitled room ["+help.String(rx) + "," + help.String(ry)+"]"; - switch(t) - { + switch(t) + { #if !defined(MAKEANDPLAY) - case rn(50,50): - { - - static const short contents[] = { - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,494,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 0,0,840,841,841,841,841,841,841,841,841,682,680,680,680,680,680,680,680,680,680,680,680,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 0,0,0,0,0,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 8,8,8,8,8,8,8,8,8,8,8,1120,6,6,6,6,6,680,680,680,680,680,680,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,574,680,680,680,680,680,680,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,680,680,680,680,680,680,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,493,653,654,680,680,680,680,680,680,652,653,494,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,493,653,654,680,680,680,680,680,680,680,680,680,680,652,653,494,492,492,492,492,492,492,492,492,492,492,492,492, - 653,653,653,653,653,653,653,653,653,653,653,653,654,680,680,680,680,680,680,680,680,680,680,680,680,680,680,652,653,653,653,653,653,653,653,653,653,653,653,653, - 0,0,0,0,0,716,0,0,0,716,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,716,0,0,0,716,0,0,0,0, - 0,0,0,0,0,716,0,0,0,716,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,716,0,0,0,716,0,0,0,0, - 0,0,0,0,0,716,0,0,0,716,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,716,0,0,0,716,0,0,0,0, - 0,0,0,0,0,716,0,0,0,716,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,716,0,0,0,716,0,0,0,0, - 0,0,0,0,0,716,0,0,0,716,0,840,841,682,680,680,680,680,680,680,680,680,680,680,680,680,681,841,842,0,0,716,0,0,0,716,0,0,0,0, - 0,0,0,0,0,716,0,0,0,716,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,716,0,0,0,716,0,0,0,0, - 0,0,0,0,0,716,0,0,0,716,0,0,0,840,841,841,841,841,841,841,841,841,841,841,841,841,842,0,0,0,0,716,0,0,0,716,0,0,0,0, - 0,0,0,0,196,197,197,197,197,197,198,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,716,0,0,0,716,0,0,0,0, - 0,0,0,0,276,277,277,277,277,277,278,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,716,0,0,0,716,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,716,0,0,0,716,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,716,0,0,0,716,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,196,197,197,197,197,197,198,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,276,277,277,277,277,277,278,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - }; - - obj.createentity(96, 40, 10, 0, 450500); // (savepoint) - if(game.intimetrial) - { - obj.createentity(136, 92, 11, 48); // (horizontal gravity line) - } - - roomname = "Outer Hull"; //If not yet in level, use "The Space Station"; - - result = contents; - break; - } - - case rn(49,50): - { - - static const short contents[] = { - 295,295,295,295,295,295,417,698,698,698,698,415,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, - 295,295,295,295,295,295,417,698,698,698,698,415,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, - 295,295,295,295,295,295,417,698,698,698,698,415,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, - 295,295,295,295,295,295,417,698,698,698,698,415,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, - 295,295,295,295,295,295,417,698,698,698,698,455,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456, - 295,295,295,295,295,295,417,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,820,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 295,295,295,295,295,295,417,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,820,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 295,295,295,295,295,295,417,859,859,859,859,859,859,859,859,859,859,859,859,859,859,859,860,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 295,295,295,295,295,295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 295,295,295,295,295,295,336,376,376,376,376,376,377,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, - 295,295,295,295,295,295,295,295,295,295,295,295,336,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376, - 295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, - 295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, - 295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, - 456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - }; - - roomname = "The Filter"; //If not yet in level, use "The Space Station" - result = contents; - break; - } - - case rn(49,49): - { - - static const short contents[] = { - 107,107,107,107,107,107,229,689,689,689,689,227,107,107,229,689,689,689,689,689,227,107,107,107,107,107,107,107,107,107,107,108,268,268,268,268,268,268,268,268, - 107,107,107,107,107,107,229,689,689,689,689,227,107,107,229,689,689,689,689,689,227,107,107,107,107,107,107,107,107,107,107,229,0,0,0,0,0,0,0,0, - 107,107,107,107,107,107,229,850,850,691,689,227,107,107,229,689,689,689,689,689,227,107,107,107,107,107,107,107,107,107,107,229,689,811,0,0,0,0,0,0, - 107,107,107,107,107,107,229,0,0,809,689,227,107,107,229,689,689,689,689,689,227,107,107,107,107,107,107,107,107,107,107,229,689,811,0,0,0,0,0,0, - 107,107,107,107,107,107,229,0,0,809,689,227,107,107,229,689,689,689,689,689,227,107,107,107,107,107,107,107,107,107,107,229,689,811,0,0,0,0,0,0, - 107,107,107,107,107,107,229,0,0,809,689,227,107,107,229,689,689,689,689,689,227,107,107,107,107,107,107,107,107,107,107,229,689,811,0,0,0,0,0,0, - 107,107,107,107,107,107,229,0,0,809,689,227,107,107,229,689,689,689,689,689,227,107,107,107,107,107,107,107,107,107,107,229,689,811,0,0,0,0,0,0, - 107,107,107,107,107,107,229,0,0,849,850,227,107,107,229,850,850,850,850,850,227,107,107,107,107,107,107,107,107,107,107,229,850,851,0,0,8,8,8,8, - 107,107,107,107,107,107,229,0,0,0,0,227,107,107,229,0,0,0,0,0,227,107,107,107,107,107,107,107,107,107,107,229,0,0,0,0,187,188,188,188, - 107,107,107,107,107,107,229,0,0,0,0,227,107,107,229,0,0,0,0,0,267,268,268,268,268,268,268,268,268,268,268,269,0,0,0,0,227,107,107,107, - 107,107,107,107,107,107,229,0,0,0,0,227,107,107,229,0,0,0,0,0,9,9,9,9,9,9,9,9,9,9,9,9,0,0,0,0,227,107,107,107, - 107,107,107,107,107,107,229,0,0,0,0,227,107,107,229,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,227,107,107,107, - 107,107,107,107,107,107,229,0,0,0,0,227,107,107,229,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,227,107,107,107, - 107,107,107,107,107,107,229,0,0,0,0,227,107,107,229,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,227,107,107,107, - 107,107,107,107,107,107,229,770,771,0,0,227,107,107,229,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,227,107,107,107, - 107,107,107,107,107,107,229,689,811,0,0,227,107,107,229,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,227,107,107,107, - 107,107,107,107,107,107,229,689,811,0,0,227,107,107,229,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,227,107,107,107, - 107,107,107,107,107,107,229,689,811,0,0,227,107,107,229,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,227,107,107,107, - 107,107,107,107,107,107,229,689,811,0,0,227,107,107,229,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,227,107,107,107, - 107,107,107,107,107,107,229,689,730,770,770,227,107,107,229,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,227,107,107,107, - 107,107,107,107,107,107,229,689,689,689,689,227,107,107,229,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,227,107,107,107, - 107,107,107,107,107,107,229,689,689,689,689,227,107,107,229,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,227,107,107,107, - 107,107,107,107,107,107,229,689,689,689,689,227,107,107,229,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,227,107,107,107, - 107,107,107,107,107,107,229,689,689,689,689,227,107,107,229,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,227,107,107,107, - 107,107,107,107,107,107,229,689,689,689,689,227,107,107,148,188,188,188,188,189,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,227,107,107,107, - 107,107,107,107,107,107,229,689,689,689,689,227,107,107,107,107,107,107,107,229,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,227,107,107,107, - 107,107,107,107,107,107,229,689,689,689,689,227,107,107,107,107,107,107,107,229,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,227,107,107,107, - 107,107,107,107,107,107,229,689,689,689,689,227,107,107,107,107,107,107,107,148,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,149,107,107,107, - 107,107,107,107,107,107,229,689,689,689,689,227,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107, - 107,107,107,107,107,107,229,689,689,689,689,227,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107, - }; - - obj.createentity(128, 176, 10, 1, 449490); // (savepoint) - obj.createentity(160, 192, 3); //Disappearing Platform - obj.createentity(192, 192, 3); //Disappearing Platform - obj.createentity(224, 192, 3); //Disappearing Platform - obj.createentity(256, 192, 3); //Disappearing Platform - obj.createentity(216-4, 168, 1, 0, 4, 160, 88, 256, 192); // Enemy, bounded - obj.createentity(184-24, 96, 1, 1, 4, 160, 88, 256, 192); // Enemy, bounded - obj.createentity(256, 8, 2, 10, 4); //Big Threadmill, >>>>>> - roomname = "Boldly To Go"; - result = contents; - break; - } - - - case rn(49,48): - { - - static const short contents[] = { - 289,289,289,289,289,289,411,0,0,800,680,409,289,289,411,680,680,680,680,680,409,289,289,289,289,289,289,289,289,289,289,411,0,0,0,0,409,289,289,289, - 289,289,289,289,289,289,411,0,0,800,680,409,289,289,411,680,680,680,680,680,409,289,289,289,289,289,289,289,289,289,289,411,0,0,0,0,409,289,289,289, - 289,289,289,289,289,289,411,0,0,800,680,409,289,289,411,680,680,680,680,680,409,289,289,289,289,289,289,289,289,289,289,411,0,0,0,0,409,289,289,289, - 289,289,289,289,289,289,411,0,0,800,680,409,289,289,411,680,680,680,680,680,409,289,289,289,289,289,289,289,289,289,289,411,0,0,0,0,409,289,289,289, - 289,289,289,289,289,289,411,0,0,800,680,409,289,289,411,680,680,680,680,680,409,289,289,289,289,289,289,289,289,289,289,411,0,0,0,0,409,289,289,289, - 289,289,289,289,289,289,411,0,0,800,680,409,289,289,411,680,680,680,680,680,409,289,289,289,289,289,289,289,289,289,289,411,0,0,0,0,409,289,289,289, - 289,289,289,289,289,289,411,0,0,800,680,409,289,289,411,680,680,680,680,680,409,289,289,289,289,289,289,289,289,289,289,411,0,0,0,0,409,289,289,289, - 289,289,289,289,289,289,411,0,0,800,680,409,289,289,411,680,680,680,680,680,409,289,289,289,289,289,289,289,289,289,289,411,0,0,0,0,409,289,289,289, - 289,289,289,289,289,289,411,0,0,800,680,409,289,289,411,680,680,680,680,680,409,289,289,289,289,289,289,289,289,289,289,411,761,761,761,761,409,289,289,289, - 289,289,289,289,289,289,411,0,0,800,680,409,289,289,411,680,680,680,680,680,409,289,289,289,289,289,289,289,289,289,289,411,680,680,680,680,409,289,289,289, - 289,289,289,289,289,289,411,0,0,800,680,409,289,289,411,680,680,680,680,680,409,289,290,450,450,450,450,450,450,450,450,451,680,680,680,680,409,289,289,289, - 289,289,289,289,289,289,411,0,0,800,680,409,289,289,411,680,680,680,680,680,409,289,411,680,680,680,680,680,680,680,680,680,680,680,680,680,409,289,289,289, - 289,289,289,289,289,289,411,0,0,840,841,409,289,289,411,841,841,682,680,680,409,289,411,680,680,680,680,680,680,680,680,680,680,680,680,680,409,289,289,289, - 289,289,289,289,289,289,411,0,0,0,0,409,289,289,411,0,0,800,680,680,409,289,411,680,680,680,680,680,680,680,680,680,680,680,680,680,409,289,289,289, - 289,289,289,289,289,289,411,0,0,0,0,409,289,289,411,0,0,800,680,680,409,289,411,680,680,680,680,680,680,680,680,680,680,680,680,680,409,289,289,289, - 289,289,289,289,289,289,411,0,0,0,0,409,289,289,411,0,0,800,680,680,409,289,411,680,680,680,680,6,6,6,6,6,6,6,6,6,409,289,289,289, - 289,289,289,289,289,289,411,0,0,0,0,409,289,289,411,0,0,800,680,680,409,289,411,680,680,680,680,369,370,370,370,370,370,370,370,370,331,289,289,289, - 289,289,289,289,289,289,411,761,762,0,0,409,289,289,411,0,0,800,680,680,409,289,411,680,680,680,680,449,450,450,450,450,450,450,450,450,450,450,450,450, - 289,289,289,289,289,289,411,680,802,0,0,409,289,289,411,0,0,800,680,680,409,289,411,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0, - 289,289,289,289,289,289,411,680,802,0,0,409,289,289,411,0,0,840,841,841,409,289,411,841,841,841,841,841,841,841,841,841,841,841,841,841,841,842,0,0, - 289,289,289,289,289,289,411,680,802,0,0,409,289,289,411,0,0,0,0,0,409,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 289,289,289,289,289,289,411,680,802,0,0,409,289,289,411,0,0,0,0,0,409,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 289,289,289,289,289,289,411,680,802,0,0,409,289,289,411,0,0,0,0,0,409,289,411,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, - 289,289,289,289,289,289,411,680,721,761,761,409,289,289,411,761,761,761,761,761,409,289,330,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370, - 289,289,289,289,289,289,411,680,680,680,680,409,289,289,411,680,680,680,680,680,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, - 289,289,289,289,289,289,411,680,680,680,680,409,289,289,411,680,680,680,680,680,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, - 289,289,289,289,289,289,411,680,680,680,680,409,289,289,411,680,680,680,680,680,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, - 289,289,289,289,289,289,411,680,680,680,680,409,289,289,411,680,680,680,680,680,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, - 289,289,289,289,289,289,411,680,680,680,680,409,289,289,411,680,680,680,680,680,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, - 289,289,289,289,289,289,411,680,680,680,680,409,289,289,411,680,680,680,680,680,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, - }; - - obj.createentity(192, 96, 9, 2); // (shiny trinket) - roomname = "One Way Room"; - result = contents; - break; - } - - - case rn(49,47): - { - - static const short contents[] = { - 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92, - 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,93,253,253,253,253,253, - 92,92,92,92,92,92,93,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,254,9,9,9,9,9, - 92,92,92,92,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 92,92,92,92,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 92,92,92,92,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 92,92,92,92,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 92,92,92,92,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 92,92,92,92,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 92,92,92,92,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 92,92,92,92,92,92,214,0,0,0,0,172,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173, - 92,92,92,92,92,92,214,0,0,0,0,212,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92, - 92,92,92,92,92,92,214,0,0,0,0,212,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92, - 92,92,92,92,92,92,214,0,0,763,764,212,92,92,92,92,92,92,92,92,92,92,92,92,92,92,93,253,253,253,253,253,253,253,253,253,253,253,253,253, - 92,92,92,92,92,92,214,0,0,803,683,212,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0, - 92,92,92,92,92,92,214,0,0,803,683,212,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0, - 92,92,92,92,92,92,214,0,0,803,683,212,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0, - 92,92,92,92,92,92,214,0,0,803,683,212,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0, - 92,92,92,92,92,92,214,0,0,803,683,212,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0, - 92,92,92,92,92,92,214,0,0,803,683,212,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0, - 92,92,92,92,92,92,214,0,0,803,683,212,92,92,93,253,253,253,253,253,253,253,253,253,253,253,254,0,0,0,0,0,0,0,0,0,0,0,0,0, - 92,92,92,92,92,92,214,0,0,803,683,212,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,172,173,173,173, - 92,92,92,92,92,92,214,0,0,803,683,212,92,92,214,683,683,683,683,683,683,683,683,805,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,92, - 92,92,92,92,92,92,214,0,0,803,683,212,92,92,214,683,683,683,683,683,683,683,683,805,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,92, - 92,92,92,92,92,92,214,0,0,803,683,212,92,92,214,683,683,683,683,683,683,683,683,805,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,92, - 92,92,92,92,92,92,214,0,0,803,683,212,92,92,214,683,683,683,683,683,683,683,683,805,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,92, - 92,92,92,92,92,92,214,0,0,803,683,212,92,92,214,683,683,683,683,683,683,683,683,805,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,92, - 92,92,92,92,92,92,214,0,0,803,683,212,92,92,214,683,683,683,683,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,92, - 92,92,92,92,92,92,214,0,0,803,683,212,92,92,214,683,683,683,683,683,172,173,173,173,173,173,173,173,173,173,173,174,0,0,0,0,212,92,92,92, - 92,92,92,92,92,92,214,0,0,803,683,212,92,92,214,683,683,683,683,683,212,92,92,92,92,92,92,92,92,92,92,214,0,0,0,0,212,92,92,92, - }; - - obj.createentity(56, 24, 2, 10, 4); //Big Threadmill, >>>>>> - obj.createentity(120, 24, 2, 10, 4); //Big Threadmill, >>>>>> - obj.createentity(184, 24, 2, 10, 4); //Big Threadmill, >>>>>> - obj.createentity(88, 72, 2, 10, 4); //Big Threadmill, >>>>>> - obj.createentity(216, 72, 2, 10, 4); //Big Threadmill, >>>>>> - obj.createentity(280, 72, 2, 10, 4); //Big Threadmill, >>>>>> - obj.createentity(64, 32, 10, 0, 447490); // (savepoint) - obj.createentity(288, 160, 2, 8, 4); //Threadmill, >>> - obj.createentity(280, 112, 2, 10, 4); //Big Threadmill, >>>>>> - obj.createentity(160, 216, 2, 10, 4); //Big Threadmill, >>>>>> - obj.createentity(224, 216, 2, 8, 4); //Threadmill, >>> - obj.createentity(248, 24, 2, 8, 4); //Threadmill, >>> - obj.createentity(120, 168, 2, 10, 4); //Big Threadmill, >>>>>> - obj.createentity(184, 168, 2, 8, 4); //Threadmill, >>> - obj.createentity(216, 112, 2, 10, 4); //Big Threadmill, >>>>>> - obj.createentity(152, 72, 2, 10, 4); //Big Threadmill, >>>>>> - obj.createentity(224, 120, 10, 0, 447491); // (savepoint) - - roomname = "Conveying a New Idea"; - result = contents; - break; - } - - - case rn(50,47): - { - - static const short contents[] = { - 98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98, - 259,259,259,259,259,259,259,259,259,259,259,259,100,98,98,98,98,98,98,98,98,98,98,98,98,98,98,99,259,259,259,259,259,259,259,259,100,98,98,98, - 9,9,9,9,9,9,9,9,9,9,9,9,258,259,259,259,259,259,259,259,259,259,259,259,259,259,259,260,7,7,7,7,7,7,7,7,218,98,98,98, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,680,680,680,680,680,680,680,218,98,98,98, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,218,98,98,98, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,218,98,98,98, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,218,98,98,98, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,218,98,98,98, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,218,98,98,98, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,680,680,680,218,98,98,98, - 179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,180,8,8,8,8,8,8,8,8,178,179,179,179,179,179,179,180,680,680,680,680,218,98,98,98, - 98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,139,179,179,179,179,179,179,179,179,140,98,98,98,98,98,98,220,680,680,680,680,218,98,98,98, - 98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,99,259,259,259,259,259,259,259,259,100,98,98,98,98,98,98,220,680,680,680,680,218,98,98,98, - 259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,260,9,9,9,9,9,9,9,9,258,259,259,259,100,98,98,220,680,680,680,680,218,98,98,98, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,680,680,680,680,218,98,98,98, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,800,680,680,218,98,98,220,680,680,680,680,218,98,98,98, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,800,680,680,218,98,98,220,680,680,680,680,218,98,98,98, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,800,680,680,218,98,98,220,680,680,680,680,218,98,98,98, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,800,680,680,218,98,98,220,680,680,680,680,218,98,98,98, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,800,680,680,218,98,98,220,680,680,680,680,218,98,98,98, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,800,680,680,218,98,98,220,680,680,680,680,218,98,98,98, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,800,680,680,218,98,98,220,680,680,680,680,218,98,98,98, - 179,179,179,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,800,680,680,218,98,98,220,680,680,680,680,218,98,98,98, - 98,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,840,841,841,218,98,98,220,841,841,841,841,218,98,98,98, - 98,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,218,98,98,98, - 98,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,218,98,98,98, - 98,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,218,98,98,98, - 98,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,218,98,98,98, - 98,98,98,220,0,0,0,0,178,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,140,98,98,220,0,0,0,0,218,98,98,98, - 98,98,98,220,0,0,0,0,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,0,0,0,0,218,98,98,98, - }; - - obj.createentity(0, 72, 2, 10, 4); //Big Threadmill, >>>>>> - obj.createentity(96, 24, 2, 10, 4); //Big Threadmill, >>>>>> - obj.createentity(160, 24, 2, 10, 4); //Big Threadmill, >>>>>> - obj.createentity(64, 168, 2, 10, 4); //Big Threadmill, >>>>>> - obj.createentity(128, 168, 2, 10, 4); //Big Threadmill, >>>>>> - obj.createentity(64, 160, 2, 10, 4); //Big Threadmill, >>>>>> - obj.createentity(128, 160, 2, 10, 4); //Big Threadmill, >>>>>> - obj.createentity(0, 160, 2, 10, 4); //Big Threadmill, >>>>>> - obj.createentity(0, 112, 2, 10, 4); //Big Threadmill, >>>>>> - obj.createentity(64, 112, 2, 10, 4); //Big Threadmill, >>>>>> - obj.createentity(64, 216, 2, 10, 4); //Big Threadmill, >>>>>> - obj.createentity(128, 216, 2, 10, 4); //Big Threadmill, >>>>>> - obj.createentity(192, 216, 2, 8, 4); //Threadmill, >>> - obj.createentity(0, 168, 2, 10, 4); //Big Threadmill, >>>>>> - obj.createentity(64, 72, 2, 10, 4); //Big Threadmill, >>>>>> - obj.createentity(192, 72, 2, 10, 4); //Big Threadmill, >>>>>> - obj.createentity(192, 112, 2, 8, 4); //Threadmill, >>> - roomname = "Upstream Downstream"; - result = contents; - break; - } - - case rn(50,48): - { - - static const short contents[] = { - 292,292,292,414,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,0,0,0,0,412,292,292,292, - 292,292,292,414,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,0,0,0,0,412,292,292,292, - 292,292,292,414,0,0,0,0,452,453,453,453,453,453,294,292,292,292,292,292,292,292,292,292,292,293,453,453,453,453,453,454,0,0,0,0,412,292,292,292, - 292,292,292,414,0,0,0,0,9,9,9,9,9,9,412,292,292,292,292,292,292,292,292,292,292,414,9,9,9,9,9,9,0,0,0,0,412,292,292,292, - 292,292,292,414,0,0,0,0,0,0,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,414,0,0,0,0,0,0,0,0,0,0,412,292,292,292, - 292,292,292,414,0,0,0,0,0,0,0,0,0,0,452,453,453,453,453,453,453,453,453,453,453,454,0,0,0,0,0,0,0,0,0,0,412,292,292,292, - 292,292,292,414,0,0,0,0,0,0,0,0,0,0,9,9,9,9,9,9,9,9,9,9,9,9,0,0,0,0,0,0,0,0,0,0,412,292,292,292, - 292,292,292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,292, - 292,292,292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,292, - 292,292,292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,292, - 292,292,292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,292, - 292,292,292,333,373,373,373,374,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,292, - 292,292,292,292,292,292,292,414,779,779,779,779,779,779,779,779,779,779,779,779,779,779,779,779,779,779,779,779,779,779,779,779,779,779,779,779,412,292,292,292, - 292,292,292,292,292,292,292,414,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,412,292,292,292, - 292,292,292,292,292,292,292,414,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,372,373,373,373,334,292,292,292, - 292,292,292,292,292,292,292,414,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,412,292,292,292,292,292,292,292, - 292,292,292,292,292,292,292,414,859,859,859,859,859,859,859,859,859,859,859,859,859,859,859,859,859,859,859,859,859,859,859,859,412,292,292,292,292,292,292,292, - 453,453,453,453,453,453,453,454,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,292,292,292,292,292, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,292,292,292,292,292, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,292,292,292,292,292, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,292,292,292,292,292, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,292,292,292,292,292, - 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,412,292,292,292,292,292,292,292, - 373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,334,292,292,292,292,292,292,292, - 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, - 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, - 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, - 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, - 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, - 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, - }; - - obj.platformtile = 119; - obj.createentity(64, 72, 2, 0, 4, 64, 72, 256, 160); // Platform, bounded - obj.createentity(96, 80, 2, 0, 4, 64, 72, 256, 160); // Platform, bounded - obj.createentity(128, 88, 2, 0, 4, 64, 72, 256, 160); // Platform, bounded - obj.createentity(160, 96, 2, 0, 4, 64, 72, 256, 160); // Platform, bounded - obj.createentity(192, 104, 2, 0, 4, 64, 72, 256, 160); // Platform, bounded - obj.createentity(224, 112, 2, 0, 4, 64, 72, 256, 160); // Platform, bounded - obj.createentity(264, 96, 10, 1, 448500); // (savepoint) - roomname = "The High Road is Low"; - result = contents; - break; - } - - case rn(50,49): - { - - static const short contents[] = { - 274,274,274,274,274,274,274,274,274,274,274,274,115,113,113,113,113,113,113,113,113,113,113,113,113,113,113,114,274,274,274,274,274,274,274,274,274,274,274,274, - 0,0,0,0,0,0,0,0,0,0,0,0,273,115,113,113,113,113,113,113,113,113,113,113,113,113,114,275,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,9,233,113,113,113,113,113,113,113,113,113,113,113,113,235,9,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,273,115,113,113,113,113,113,113,113,113,113,113,114,275,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,9,233,113,113,113,113,113,113,113,113,113,113,235,9,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,273,115,113,113,113,113,113,113,113,113,114,275,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,9,233,113,113,113,113,113,113,113,113,235,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 8,8,8,8,8,8,8,8,8,0,0,0,0,0,0,273,115,113,113,113,113,113,113,114,275,0,0,0,0,0,0,8,8,8,8,8,8,8,8,8, - 194,194,194,194,194,194,194,194,195,0,0,0,0,0,0,9,233,113,113,113,113,113,113,235,9,0,0,0,0,0,0,193,194,194,194,194,194,194,194,194, - 113,113,113,113,113,113,113,113,235,8,0,0,0,0,0,0,273,115,113,113,113,113,114,275,0,0,0,0,0,0,8,233,113,113,113,113,113,113,113,113, - 113,113,113,113,113,113,113,113,154,195,0,0,0,0,0,0,9,233,113,113,113,113,235,9,0,0,0,0,0,0,193,155,113,113,113,113,113,113,113,113, - 113,113,113,113,113,113,113,113,113,235,8,0,0,0,0,0,0,273,115,113,113,114,275,0,0,0,0,0,0,8,233,113,113,113,113,113,113,113,113,113, - 113,113,113,113,113,113,113,113,113,154,195,0,0,0,0,0,0,9,233,113,113,235,9,0,0,0,0,0,0,193,155,113,113,113,113,113,113,113,113,113, - 113,113,113,113,113,113,113,113,113,113,235,8,0,0,0,0,0,0,273,115,114,275,0,0,0,0,0,0,8,233,113,113,113,113,113,113,113,113,113,113, - 113,113,113,113,113,113,113,113,113,113,154,195,0,0,0,0,0,0,9,233,235,9,0,0,0,0,0,0,193,155,113,113,113,113,113,113,113,113,113,113, - 113,113,113,113,113,113,113,113,113,113,113,235,8,0,0,0,0,0,0,273,275,0,0,0,0,0,0,8,233,113,113,113,113,113,113,113,113,113,113,113, - 113,113,113,113,113,113,113,113,113,113,113,154,195,0,0,0,0,0,0,9,9,0,0,0,0,0,0,193,155,113,113,113,113,113,113,113,113,113,113,113, - 113,113,113,113,113,113,113,113,113,113,113,113,235,8,0,0,0,0,0,0,0,0,0,0,0,0,8,233,113,113,113,113,113,113,113,113,113,113,113,113, - 113,113,113,113,113,113,113,113,113,113,113,113,154,195,0,0,0,0,0,0,0,0,0,0,0,0,193,155,113,113,113,113,113,113,113,113,113,113,113,113, - 113,113,113,113,113,113,113,113,113,113,113,113,113,235,8,0,0,0,0,0,0,0,0,0,0,8,233,113,113,113,113,113,113,113,113,113,113,113,113,113, - 113,113,113,113,113,113,113,113,113,113,113,113,113,154,195,0,0,0,0,0,0,0,0,0,0,193,155,113,113,113,113,113,113,113,113,113,113,113,113,113, - 113,113,113,113,113,113,113,113,113,113,113,113,113,113,235,8,0,0,0,0,0,0,0,0,8,233,113,113,113,113,113,113,113,113,113,113,113,113,113,113, - 113,113,113,113,113,113,113,113,113,113,113,113,113,113,154,195,0,0,0,0,0,0,0,0,193,155,113,113,113,113,113,113,113,113,113,113,113,113,113,113, - 113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,235,8,0,0,0,0,0,0,8,233,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113, - 113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,154,195,0,0,0,0,0,0,193,155,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113, - 113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,235,8,0,0,0,0,8,233,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113, - 113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,154,195,0,0,0,0,193,155,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113, - 113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,235,8,8,8,8,233,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113, - 113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,154,194,194,194,194,155,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113, - 113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113, - }; - - obj.createentity(144, 200, 3, 51); //Disappearing Platform - obj.createentity(24, 16, 10, 0, 449500); // (savepoint) - obj.createentity(280, 16, 10, 0, 449501); // (savepoint) - obj.createentity(0, 8, 2, 10, 4); //Big Threadmill, >>>>>> - obj.createentity(64, 8, 2, 8, 4); //Threadmill, >>> - obj.createentity(224, 8, 2, 11, 4); //Big Threadmill, <<<<<< - obj.createentity(288, 8, 2, 9, 4); //Threadmill, <<< - roomname = "Give Me A V"; - result = contents; - break; - } - - case rn(51,49): - { - - static const short contents[] = { - 244,244,244,244,244,244,244,244,244,244,244,244,244,244,244,244,244,244,244,244,244,244,244,244,85,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,243,244,244,244,244,244,244,244,244,244,244,244,244,244,244,244, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,800,680,680,680,680,680,7,7,7,7,7,7,7,7,7,7,7,1125,9,9,9,9, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0, - 8,8,8,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0, - 164,164,164,165,0,0,0,0,0,0,0,0,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0, - 83,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0, - 83,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0, - 83,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0, - 83,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0, - 83,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 83,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 83,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0, - 83,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0, - 83,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0, - 83,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0, - 83,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0, - 83,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0, - 83,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0, - 83,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0, - 83,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0, - 83,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0, - 83,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,800,680,680,680,680,680,6,6,6,6,6,6,6,6,6,6,6,1122,8,8,8,8, - 83,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,163,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164, - 83,83,83,124,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,125,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83, - 83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83, - 83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83, - }; - - obj.createentity(0, 8, 2, 11, 4); //Big Threadmill, <<<<<< - obj.createentity(64, 8, 2, 11, 4); //Big Threadmill, <<<<<< - obj.createentity(128, 8, 2, 11, 4); //Big Threadmill, <<<<<< - obj.createentity(128, 104, 2, 11, 4); //Big Threadmill, <<<<<< - obj.createentity(192, 104, 2, 11, 4); //Big Threadmill, <<<<<< - obj.createentity(256, 104, 2, 11, 4); //Big Threadmill, <<<<<< - obj.createentity(152, 88, 10, 1, 449510); // (savepoint) - obj.createentity(152, 120, 10, 0, 449511); // (savepoint) - obj.createentity(128, 112, 2, 10, 4); //Big Threadmill, >>>>>> - obj.createentity(192, 112, 2, 10, 4); //Big Threadmill, >>>>>> - obj.createentity(256, 112, 2, 10, 4); //Big Threadmill, >>>>>> - obj.createentity(32, 208, 2, 8, 4); //Threadmill, >>> - obj.createentity(64, 208, 2, 10, 4); //Big Threadmill, >>>>>> - obj.createentity(128, 208, 2, 10, 4); //Big Threadmill, >>>>>> - roomname = "Select Track"; - result = contents; - break; - } - - case rn(52,49): - { - - static const short contents[] = { - 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, - 444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444, - 9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,8,8,8,8,8,8,8,8,0,0,0,0,0,0,0,0,8,8,8,8,8,8,8,8,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, - 364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364, - 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, - 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, - 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, - }; - - obj.createentity(0, 104, 2, 11, 4); //Big Threadmill, <<<<<< - obj.createentity(128, 104, 2, 11, 4); //Big Threadmill, <<<<<< - obj.createentity(256, 104, 2, 11, 4); //Big Threadmill, <<<<<< - obj.createentity(152, 128, 1, 0, 5, 72, 120, 256, 200); // Enemy, bounded - obj.createentity(240, 168, 1, 1, 5, 72, 120, 256, 200); // Enemy, bounded - obj.createentity(72, 168, 1, 1, 5, 72, 120, 256, 200); // Enemy, bounded - obj.createentity(0, 112, 2, 10, 4); //Big Threadmill, >>>>>> - obj.createentity(64, 112, 2, 10, 4); //Big Threadmill, >>>>>> - obj.createentity(128, 112, 2, 10, 4); //Big Threadmill, >>>>>> - obj.createentity(192, 112, 2, 10, 4); //Big Threadmill, >>>>>> - obj.createentity(256, 112, 2, 10, 4); //Big Threadmill, >>>>>> - obj.createentity(64, 32, 3,10); //Disappearing Platform - obj.createentity(96, 32, 3,10); //Disappearing Platform - obj.createentity(192, 32, 3,10); //Disappearing Platform - obj.createentity(224, 32, 3,10); //Disappearing Platform - roomname = "You Chose... Poorly"; - result = contents; - break; - } - - case rn(53,49): - { - - static const short contents[] = { - 107,107,107,107,107,107,107,107,229,0,0,0,0,809,689,689,227,107,107,107,107,107,107,229,689,689,811,0,0,0,0,227,107,107,107,107,107,107,107,107, - 268,268,268,268,268,268,268,268,269,0,0,0,0,809,689,689,227,107,107,107,107,107,107,229,689,689,811,0,0,0,0,267,268,268,268,268,268,268,268,268, - 9,9,9,9,9,9,9,9,9,0,0,0,0,809,689,689,227,107,107,107,107,107,107,229,689,689,811,0,0,0,0,9,9,9,9,9,9,9,9,9, - 0,0,0,0,0,0,0,0,0,0,0,0,0,809,689,689,227,107,107,107,107,107,107,229,689,689,811,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,809,689,689,227,107,107,107,107,107,107,229,689,689,811,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,809,689,689,227,107,107,107,107,107,107,229,689,689,811,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,809,689,689,227,107,107,107,107,107,107,229,689,689,811,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,809,689,689,227,107,107,107,107,107,107,229,689,689,811,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,809,689,689,227,107,107,107,107,107,107,229,689,689,811,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,809,689,689,227,107,107,107,107,107,107,229,689,689,811,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,809,689,689,227,107,107,107,107,107,107,229,689,689,811,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,809,689,689,227,107,107,107,107,107,107,229,689,689,811,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,809,689,689,227,107,107,107,107,107,107,229,689,689,811,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,267,268,268,268,268,268,268,269,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,809,689,689,689,689,689,689,689,689,689,689,689,689,811,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,809,689,689,689,689,689,689,689,689,689,689,689,689,811,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,809,689,689,689,689,689,689,689,689,689,689,689,689,811,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,809,689,689,689,689,689,689,689,689,689,689,689,689,811,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,809,689,689,689,689,689,689,689,689,689,689,689,689,811,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,809,689,689,689,689,689,689,689,689,689,689,689,689,811,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,849,850,850,850,850,850,850,850,850,850,850,850,850,851,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, - 188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188, - 107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107, - 107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107, - 107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107, - }; - - obj.createentity(0, 104, 2, 11, 4); //Big Threadmill, <<<<<< - obj.createentity(64, 104, 2, 11, 4); //Big Threadmill, <<<<<< - obj.createentity(192, 104, 2, 11, 4); //Big Threadmill, <<<<<< - obj.createentity(256, 104, 2, 11, 4); //Big Threadmill, <<<<<< - obj.createentity(152, 120, 10, 0, 449530); // (savepoint) - obj.createentity(0, 112, 2, 10, 4); //Big Threadmill, >>>>>> - obj.createentity(64, 112, 2, 10, 4); //Big Threadmill, >>>>>> - obj.createentity(128, 112, 2, 10, 4); //Big Threadmill, >>>>>> - obj.createentity(192, 112, 2, 10, 4); //Big Threadmill, >>>>>> - obj.createentity(256, 112, 2, 10, 4); //Big Threadmill, >>>>>> - roomname = "Hyperspace Bypass 5"; - result = contents; - break; - } - - case rn(54,49): - { - - static const short contents[] = { - 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,0,0,0,0,0,0,0,0,212,92,92,92, - 253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,254,0,0,0,0,0,0,0,0,212,92,92,92, - 9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,0,0,0,0,0,0,0,0,212,92,92,92, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,92, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,92, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,763,764,764,764,764,764,764,764,212,92,92,92, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,803,683,683,683,683,683,683,683,212,92,92,92, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,803,683,683,683,683,683,683,683,212,92,92,92, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,803,683,683,683,683,683,683,683,212,92,92,92, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,803,683,683,683,683,683,683,683,212,92,92,92, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,803,683,683,683,683,683,683,683,212,92,92,92, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,172,173,173,173,173,174,683,683,683,683,212,92,92,92, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,92,92,214,683,683,683,683,212,92,92,92, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,92,92,214,683,683,683,683,212,92,92,92, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,92,92,214,683,683,683,683,212,92,92,92, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,92,92,214,683,683,683,683,212,92,92,92, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,92,92,214,683,683,683,683,212,92,92,92, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,252,253,253,253,253,254,683,683,683,683,212,92,92,92, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,803,683,683,683,683,683,683,683,212,92,92,92, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,803,683,683,683,683,683,683,683,212,92,92,92, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,8,8,8,8,8,8,0,0,0,0,843,844,844,844,844,844,844,844,212,92,92,92, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,172,173,173,173,173,173,174,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,92, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,92,92,92,214,8,8,8,8,8,8,8,8,8,8,8,8,212,92,92,92, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,92,92,92,133,173,173,173,173,173,173,173,173,173,173,173,173,134,92,92,92, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92, - 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,212,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92, - 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,134,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92, - 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92, - 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92, - 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92, - }; - - obj.platformtile = 319; - obj.createentity(0, 104, 2, 11, 4); //Big Threadmill, <<<<<< - obj.createentity(64, 104, 2, 9, 4); //Threadmill, <<< - obj.createentity(0, 112, 2, 10, 4); //Big Threadmill, >>>>>> - obj.createentity(64, 112, 2, 8, 4); //Threadmill, >>> - obj.createentity(136, 104, 2, 0, 5, 136, 88, 200, 152); // Platform, bounded - obj.createentity(168, 104, 2, 0, 5, 136, 88, 200, 152); // Platform, bounded - obj.createentity(80, 112, 2, 8, 4); //Threadmill, >>> - obj.createentity(80, 104, 2, 9, 4); //Threadmill, <<< - roomname = "Plain Sailing from Here On"; - result = contents; - break; - } - - - case rn(54,48): - { - - static const short contents[] = { - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 644,644,644,644,644,644,644,644,644,644,644,644,485,483,483,484,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,485,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,643,644,644,645,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,603,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483, - 0,0,0,0,0,0,0,0,775,776,777,0,0,775,776,777,0,0,775,776,777,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483, - 0,0,0,0,0,0,0,0,815,695,817,0,0,815,695,817,0,0,815,695,817,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483, - 0,0,0,0,0,0,0,0,815,695,817,0,0,815,695,817,0,0,815,695,817,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483, - 0,0,0,0,0,0,0,0,855,856,857,0,0,855,856,857,0,0,855,856,857,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483, - 0,0,0,0,0,0,0,0,775,776,777,0,0,775,776,777,0,0,775,776,777,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483, - 0,0,0,0,0,0,0,0,815,695,817,0,0,815,695,817,0,0,815,695,817,0,0,0,0,0,0,0,0,0,0,0,8,8,8,8,603,483,483,483, - 0,0,0,0,0,0,0,0,815,695,817,0,0,815,695,817,0,0,815,695,817,0,0,0,0,0,0,0,0,0,0,0,563,564,564,564,525,483,483,483, - 0,0,0,0,0,0,0,0,855,856,857,0,0,855,856,857,0,0,855,856,857,0,0,0,0,0,0,0,0,0,0,0,643,644,644,644,485,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483, - 0,0,0,0,0,0,0,0,775,776,777,0,0,775,776,777,0,0,775,776,777,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483, - 0,0,0,0,0,0,0,0,815,695,817,0,0,815,695,817,0,0,815,695,817,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483, - 0,0,0,0,0,0,0,0,815,695,817,0,0,815,695,817,0,0,815,695,817,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483, - 8,8,8,0,0,0,0,0,855,856,857,0,0,855,856,857,0,0,855,856,857,0,0,0,0,8,8,8,8,8,8,8,0,0,0,0,603,483,483,483, - 564,564,565,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,563,564,564,564,564,564,565,0,0,0,0,603,483,483,483, - 483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,484,644,644,644,645,0,0,0,0,603,483,483,483, - 483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,605,0,0,0,0,0,0,0,0,603,483,483,483, - 483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,605,0,0,0,0,0,0,0,0,603,483,483,483, - 483,483,605,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,603,483,605,0,0,0,0,0,0,0,0,603,483,483,483, - 483,483,524,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,525,483,605,0,0,0,0,0,0,0,0,603,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,603,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,603,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,603,483,483,483, - }; - - obj.platformtile = 10; - obj.createentity(264, 128, 10, 0, 448540); // (savepoint) - obj.createentity(192, 32, 3, 10); //Disappearing Platform - obj.createentity(32, 176, 2, 3, 4); // Platform - obj.createentity(256, 120, 2, 8, 4); //Threadmill, >>> - obj.createentity(224, 184, 2, 8, 4); //Threadmill, >>> - obj.createentity(0, 16, 2, 10, 4); //Big Threadmill, >>>>>> - obj.createentity(64, 16, 2, 8, 4); //Threadmill, >>> - obj.createentity(104, 24, 10, 0, 448541); // (savepoint) - roomname = "Ha Ha Ha Not Really"; - result = contents; - break; - } - - - case rn(53,48): - { - - static const short contents[] = { - 510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510, - 671,671,671,671,671,671,671,671,671,671,512,511,671,671,671,671,671,671,671,671,671,671,671,671,671,671,512,511,671,671,671,671,671,671,671,671,671,671,671,671, - 9,9,9,9,9,9,9,9,9,9,630,632,9,9,9,9,9,9,9,9,9,9,9,9,9,9,630,632,9,9,9,9,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,630,632,0,0,0,0,0,0,0,0,0,0,0,0,0,0,630,632,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,630,632,0,0,0,0,0,0,0,0,0,0,0,0,0,0,630,632,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,670,672,0,0,0,0,0,0,0,0,0,0,0,0,0,0,670,672,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,9,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9,9,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,8,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,590,592,0,0,0,0,0,0,0,0,0,0,0,0,0,0,590,592,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,630,632,0,0,0,0,0,0,0,0,0,0,0,0,0,0,630,632,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,630,632,0,0,0,0,0,0,0,0,0,0,0,0,0,0,630,632,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,8,8,8,630,632,8,8,8,8,8,8,8,8,8,8,8,8,8,8,630,632,0,0,0,0, - 0,0,0,0,0,0,590,591,591,591,591,591,591,591,591,591,591,591,552,551,591,591,591,591,591,591,591,591,591,591,591,591,591,591,552,632,0,0,0,0, - 0,0,0,0,0,0,630,510,511,671,671,671,671,671,671,671,671,671,671,671,671,671,671,671,671,671,671,671,671,671,671,512,510,510,510,632,0,0,0,0, - 0,0,0,0,0,0,630,510,632,0,0,0,0,0,0,0,0,9,9,9,9,9,9,0,0,0,0,0,0,0,0,630,510,510,510,632,0,0,0,0, - 0,0,0,0,0,0,630,510,632,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,630,510,510,510,632,0,0,0,0, - 0,0,0,0,0,0,630,510,632,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,630,510,510,510,632,0,0,0,0, - 0,0,0,0,0,0,630,510,632,0,0,0,0,778,779,779,779,779,779,779,779,779,779,779,779,779,780,0,0,0,0,630,510,510,510,632,0,0,0,0, - 0,0,0,0,0,0,630,510,632,0,0,0,0,818,698,698,698,698,698,698,698,698,698,698,698,698,820,0,0,0,0,630,510,510,510,632,8,8,8,8, - 0,0,0,0,0,0,630,510,632,0,0,0,0,818,698,698,698,698,698,698,698,698,698,698,698,698,820,0,0,0,0,630,510,510,510,551,591,591,591,591, - 0,0,0,0,0,0,630,510,632,0,0,0,0,818,698,698,698,698,698,698,698,698,698,698,698,698,820,0,0,0,0,630,510,510,510,510,510,510,510,510, - 0,0,0,0,590,591,552,510,632,0,0,0,0,818,698,698,0,0,0,0,0,0,0,0,698,698,820,0,0,0,0,630,510,510,510,510,510,510,510,510, - 0,0,0,0,630,510,510,510,632,0,0,0,0,818,698,698,590,591,591,591,591,591,591,592,698,698,820,0,0,0,0,630,510,510,510,510,510,510,510,510, - 8,8,8,8,630,510,510,510,632,0,0,0,0,818,698,698,630,510,510,510,510,510,510,632,698,698,820,0,0,0,0,630,510,510,510,510,510,510,510,510, - 591,591,591,591,552,510,510,510,632,0,0,0,0,818,698,698,630,510,510,510,510,510,510,632,698,698,820,0,0,0,0,630,510,510,510,510,510,510,510,510, - 510,510,510,510,510,510,510,510,632,0,0,0,0,818,698,698,630,510,510,510,510,510,510,632,698,698,820,0,0,0,0,630,510,510,510,510,510,510,510,510, - 510,510,510,510,510,510,510,510,632,0,0,0,0,818,698,698,630,510,510,510,510,510,510,632,698,698,820,0,0,0,0,630,510,510,510,510,510,510,510,510, - 510,510,510,510,510,510,510,510,632,0,0,0,0,818,698,698,630,510,510,510,510,510,510,632,698,698,820,0,0,0,0,630,510,510,510,510,510,510,510,510, - }; - - obj.platformtile = 279; - obj.createentity(32, 168, 9, 3); // (shiny trinket) - obj.createentity(16, 112, 2, 9, 4); //Threadmill, <<< - obj.createentity(0, 112, 2, 9, 4); //Threadmill, <<< - obj.createentity(0, 104, 2, 10, 4); //Big Threadmill, >>>>>> - obj.createentity(256, 16, 2, 10, 4); //Big Threadmill, >>>>>> - obj.createentity(96, 32, 2, 3, 4); // Platform - obj.createentity(240, 88, 2, 2, 4); // Platform - obj.createentity(128, 184, 2, 10, 4); //Big Threadmill, >>>>>> - obj.createentity(152, 168, 10, 1, 448530); // (savepoint) - obj.createentity(72, 128, 2, 11, 4); //Big Threadmill, <<<<<< - obj.createentity(184, 128, 2, 11, 4); //Big Threadmill, <<<<<< - obj.createentity(48, 104, 2, 10, 4); //Big Threadmill, >>>>>> - - roomname="You Just Keep Coming Back"; - result = contents; - break; - } - - case rn(52,48): - { - - static const short contents[] = { - 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, - 450,450,450,450,291,289,289,289,290,450,450,450,450,450,450,450,450,450,291,289,289,290,450,450,450,450,450,450,450,450,450,291,289,289,289,290,450,450,450,450, - 9,9,9,9,409,289,289,289,411,7,7,7,7,7,7,7,7,7,409,289,289,411,7,7,7,7,7,7,7,7,7,409,289,289,289,411,9,9,9,9, - 0,0,0,0,449,450,450,450,451,680,680,680,680,680,680,680,680,680,409,289,289,411,680,680,680,680,680,680,680,680,680,449,450,450,450,451,0,0,0,0, - 0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,409,289,289,411,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0, - 0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,449,450,450,451,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0, - 0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,7,7,7,7,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0, - 0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0, - 0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0, - 0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0, - 0,0,0,0,0,0,800,680,369,370,370,371,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,369,370,370,371,680,802,0,0,0,0,0,0, - 0,0,0,0,0,0,800,680,409,289,289,411,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,409,289,289,411,680,802,0,0,0,0,0,0, - 0,0,0,0,0,0,800,680,409,289,289,411,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,409,289,289,411,680,802,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,409,289,289,411,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,409,289,289,411,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,409,289,289,411,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,409,289,289,411,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,800,680,409,289,289,411,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,409,289,289,411,680,802,0,0,0,0,0,0, - 0,0,0,0,0,0,800,680,409,289,289,411,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,409,289,289,411,680,802,0,0,0,0,0,0, - 0,0,0,0,0,0,800,680,449,450,450,451,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,449,450,450,451,680,802,0,0,0,0,0,0, - 0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0, - 0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0, - 0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0, - 0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,6,6,6,6,6,6,6,6,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0, - 0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,369,370,370,370,370,370,370,371,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0, - 0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,409,289,289,289,289,289,289,411,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0, - 0,0,369,370,370,370,370,370,371,680,680,680,680,680,680,680,409,289,289,289,289,289,289,411,680,680,680,680,680,680,680,369,370,370,370,370,370,371,0,0, - 8,8,409,289,289,289,289,289,411,6,6,6,6,6,6,6,409,289,289,289,289,289,289,411,6,6,6,6,6,6,6,409,289,289,289,289,289,411,8,8, - 370,370,331,289,289,289,289,289,330,370,370,370,370,370,370,370,331,289,289,289,289,289,289,330,370,370,370,370,370,370,370,331,289,289,289,289,289,330,370,370, - 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, - 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, - 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, - }; - - obj.platformtile = 359; - obj.createentity(256, 104, 2, 10, 4); //Big Threadmill, >>>>>> - obj.createentity(256, 112, 2, 11, 4); //Big Threadmill, <<<<<< - obj.createentity(0, 112, 2, 11, 4); //Big Threadmill, <<<<<< - obj.createentity(0, 104, 2, 10, 4); //Big Threadmill, >>>>>> - obj.createentity(120, 104, 2, 0, 4, 96, 64, 224, 160); // Platform, bounded - obj.createentity(168, 80, 2, 0, 4, 96, 64, 224, 160); // Platform, bounded - obj.createentity(72, 64, 10, 1, 448520); // (savepoint) - obj.createentity(232, 64, 10, 1, 448521); // (savepoint) - obj.createentity(232, 144, 10, 0, 448522); // (savepoint) - obj.createentity(72, 144, 10, 0, 448523); // (savepoint) - roomname = "Gordian Knot"; - result = contents; - break; - } - - - case rn(51,48): - { - - static const short contents[] = { - 313,313,313,313,313,313,313,435,0,0,0,0,433,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313, - 313,313,313,313,313,313,313,435,0,0,0,0,433,313,313,313,313,313,313,313,313,313,313,313,313,313,313,314,474,474,474,474,474,474,474,474,474,474,474,474, - 313,313,313,313,313,313,313,435,770,770,771,0,433,313,313,313,313,313,313,313,313,313,313,313,313,313,313,435,9,9,9,9,9,9,9,9,9,9,9,9, - 313,313,313,313,313,313,313,435,689,689,811,0,433,313,313,313,313,313,313,313,313,313,313,313,313,313,313,435,0,0,0,0,0,0,0,0,0,0,0,0, - 313,313,313,314,474,474,474,475,689,689,811,0,473,474,474,474,474,474,474,474,474,474,474,474,474,474,474,475,0,0,0,0,0,0,0,0,0,0,0,0, - 313,313,313,435,0,0,0,0,689,689,811,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 313,313,313,435,689,689,689,689,689,689,811,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 313,313,313,435,689,689,689,689,689,689,811,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 313,313,313,435,689,689,689,689,689,689,811,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 313,313,313,435,689,689,689,689,689,689,811,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 313,313,313,435,689,689,689,689,689,689,811,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 313,313,313,435,689,689,689,689,689,689,811,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 313,313,313,435,689,689,689,689,393,394,394,394,394,394,394,395,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 313,313,313,435,689,689,689,689,473,474,474,474,474,474,474,475,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 313,313,313,435,689,689,689,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 313,313,313,435,689,689,689,689,689,689,811,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 313,313,313,435,689,689,689,689,689,689,811,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 313,313,313,435,689,689,689,689,689,689,811,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 313,313,313,435,850,850,850,850,850,850,851,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 313,313,313,435,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 313,313,313,435,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 313,313,313,435,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 313,313,313,435,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 313,313,313,354,394,394,394,394,394,395,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 313,313,313,313,313,313,313,313,313,435,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 313,313,313,313,313,313,313,313,313,435,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, - 313,313,313,313,313,313,313,313,313,354,394,394,394,394,394,394,394,394,394,394,394,394,394,394,394,394,394,394,394,394,394,394,394,394,394,394,394,394,394,394, - 313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313, - 313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313, - 313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313, - }; - - obj.createentity(256, 112, 2, 11, 4); //Big Threadmill, <<<<<< - obj.createentity(192, 112, 2, 11, 4); //Big Threadmill, <<<<<< - obj.createentity(128, 112, 2, 11, 4); //Big Threadmill, <<<<<< - obj.createentity(64, 112, 2, 11, 4); //Big Threadmill, <<<<<< - obj.createentity(128, 104, 2, 10, 4); //Big Threadmill, >>>>>> - obj.createentity(192, 104, 2, 10, 4); //Big Threadmill, >>>>>> - obj.createentity(256, 104, 2, 10, 4); //Big Threadmill, >>>>>> - obj.createentity(96, 40, 2, 11, 4); //Big Threadmill, <<<<<< - obj.createentity(160, 40, 2, 11, 4); //Big Threadmill, <<<<<< - obj.createentity(32, 40, 2, 9, 4); //Threadmill, <<< - obj.createentity(72, 80, 10, 1, 448510); // (savepoint) - obj.createentity(104, 128, 1, 0, 5, 104, 120, 288, 200); // Enemy, bounded - obj.createentity(160+8, 168, 1, 1, 5, 104, 120, 288, 200); // Enemy, bounded - obj.createentity(216+16, 128, 1, 0, 5, 104, 120, 288, 200); // Enemy, bounded - - roomname = "Backsliders"; - result = contents; - break; - } - - case rn(51,47): - { - - static const short contents[] = { - 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,405,0,0,0,0,403,283,283,283,283,283,283,283,283,283,283,283,283,283,283, - 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,405,0,0,0,0,403,283,283,283,283,283,283,283,283,283,283,283,283,283,283, - 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,405,0,0,0,0,403,283,283,283,283,283,283,283,283,283,283,283,283,283,283, - 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,405,0,0,0,0,403,283,283,283,283,283,283,283,283,283,283,283,283,283,283, - 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,405,0,0,0,0,443,444,444,444,444,444,444,444,444,444,444,444,444,444,444, - 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,405,776,776,776,776,776,776,776,776,776,776,776,776,776,776,776,776,777,0,0, - 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,405,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,817,0,0, - 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,324,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364, - 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, - 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, - 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, - 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, - 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, - 283,283,283,283,283,283,283,283,283,284,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,285,283,283,283,283,283, - 283,284,444,444,444,444,444,444,444,445,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,284,444,444,444,444, - 283,405,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,443,445,695,817,0,0, - 283,405,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,817,0,0, - 283,405,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,817,0,0, - 283,405,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,363,365,695,817,0,0, - 283,324,364,364,364,364,364,364,364,364,364,365,695,695,695,695,363,364,364,364,364,364,364,364,364,364,364,364,364,365,695,695,695,695,403,324,364,364,364,364, - 283,283,283,283,283,283,283,284,444,444,444,445,695,695,695,695,403,283,283,283,283,283,283,283,283,283,283,283,283,405,695,695,695,695,443,444,444,444,444,444, - 283,283,283,283,283,283,283,405,695,695,695,695,695,695,695,695,403,283,283,283,283,283,283,283,283,283,283,283,283,405,695,695,695,695,695,695,695,817,0,0, - 283,283,283,283,283,283,283,405,856,856,856,856,856,856,856,856,403,283,283,283,283,283,283,283,283,283,283,283,283,405,856,856,856,856,856,856,856,857,0,0, - 283,283,283,283,283,283,283,405,0,0,0,0,0,0,0,0,403,283,283,283,283,283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,0,0,0,0, - 283,283,283,283,283,283,283,405,0,0,0,0,0,0,0,0,403,283,283,283,283,283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,0,0,0,0, - 283,283,283,283,283,283,283,405,0,0,0,0,363,364,364,364,325,283,283,283,283,283,283,283,283,283,283,283,283,324,364,364,364,364,364,364,364,364,364,364, - 283,283,283,283,283,283,283,405,0,0,0,0,403,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, - 283,283,283,283,283,283,283,405,0,0,0,0,403,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, - }; - - obj.createentity(72, 184, 10, 0, 447510); // (savepoint) - obj.createentity(80, 128, 2, 10, 4); //Big Threadmill, >>>>>> - obj.createentity(144, 128, 2, 10, 4); //Big Threadmill, >>>>>> - obj.createentity(208, 128, 2, 10, 4); //Big Threadmill, >>>>>> - - obj.createentity(24 - 8, 144 - 8, 1, 10, 0); // Enemy - - obj.createentity(24 - 8 + 117, 144 - 8, 1, 10, 1); // Enemy - obj.createentity(24 - 8 + (117 * 2), 144 - 8, 1, 10, 1); // Enemy - obj.createentity(24 - 8 + (117 * 3), 144 - 8, 1, 10, 1); // Enemy - - //LIES emitter starts here - roomname = "The Cuckoo"; - result = contents; - break; - } - - case rn(52,47): - { - - static const short contents[] = { - 310,311,471,471,471,471,471,471,471,471,471,471,471,471,471,471,471,471,471,471,312,310,310,310,310,310,310,432,0,0,0,0,430,432,0,0,0,0,0,0, - 310,432,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,430,310,310,310,310,310,310,432,0,0,0,0,430,432,0,0,0,0,0,0, - 310,432,0,0,0,0,0,0,772,773,773,773,773,773,773,773,773,773,773,773,430,310,310,310,310,310,310,432,0,0,0,0,430,432,0,0,0,0,0,0, - 310,432,0,0,0,0,0,0,812,692,692,692,692,692,692,692,692,692,692,692,430,310,310,310,310,310,310,432,0,0,0,0,430,432,0,0,0,0,0,0, - 471,472,0,0,0,390,391,391,391,391,391,391,391,391,391,391,392,692,692,692,430,310,310,310,310,310,310,432,0,0,0,0,430,432,0,0,0,0,0,0, - 0,0,0,0,0,430,311,471,471,471,471,471,471,471,471,312,432,692,692,692,430,310,310,311,471,471,471,472,0,0,0,0,430,432,0,0,0,0,0,0, - 0,0,0,0,0,430,432,0,812,692,692,692,692,692,692,430,432,692,692,692,430,310,310,432,692,814,0,0,0,0,0,0,430,432,0,0,0,0,0,0, - 0,0,0,0,0,430,432,0,812,692,692,692,692,692,692,430,432,692,692,692,430,310,310,432,692,814,0,0,0,0,0,0,430,432,0,0,0,0,0,0, - 0,0,0,0,0,430,432,0,812,692,692,692,692,692,692,430,432,692,692,692,430,310,310,432,692,814,0,0,0,0,0,0,430,432,0,0,0,0,0,0, - 391,391,391,391,391,352,432,0,812,692,692,692,692,692,692,430,432,692,692,692,430,310,310,432,692,814,0,0,0,0,0,0,430,432,0,0,0,0,0,0, - 310,310,310,310,310,310,432,0,812,692,390,392,692,692,692,430,432,692,692,692,430,310,310,432,692,814,0,0,0,0,0,0,430,432,0,0,0,0,0,0, - 310,310,310,310,310,310,432,0,812,692,430,432,692,692,692,430,432,692,692,692,430,310,310,432,692,814,0,0,0,0,0,0,430,432,0,0,0,0,0,0, - 310,310,310,310,310,310,432,0,812,692,430,432,692,692,692,430,432,692,692,692,430,310,310,432,692,814,0,0,0,0,0,0,430,432,0,0,0,0,0,0, - 310,310,310,310,310,310,432,0,812,692,430,432,692,692,692,430,432,692,692,692,430,310,310,432,692,814,0,0,0,0,0,0,430,432,0,0,0,0,0,0, - 310,310,310,310,310,310,432,0,812,692,430,432,692,692,692,430,432,692,692,692,430,310,310,432,692,814,0,0,390,391,391,391,352,432,0,0,0,0,0,0, - 310,310,310,310,310,310,432,0,852,853,430,432,853,853,853,430,432,853,853,853,430,310,310,432,853,854,0,0,430,310,310,310,310,432,0,0,0,0,0,0, - 471,471,471,471,471,312,432,0,0,0,430,432,0,0,0,430,432,0,0,0,470,312,311,472,0,0,0,0,470,312,311,471,471,472,0,0,0,0,0,0, - 0,0,0,0,0,470,472,0,0,0,470,472,0,0,0,470,472,0,0,0,0,470,472,0,0,0,0,0,0,470,472,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,390,392,0,0,0,390,392,0,0,0,390,392,0,0,0,0,390,392,0,0,0,0,0,0,390,392,0,0,0,0,0,0,0,0,0, - 391,391,391,391,391,352,432,0,0,0,430,432,0,0,0,430,432,0,0,0,390,352,351,392,0,0,0,0,390,352,351,391,391,392,0,0,0,0,0,0, - 471,471,471,471,471,471,472,0,0,0,430,432,0,0,0,470,472,0,0,0,430,310,310,432,0,0,0,0,470,471,471,471,471,472,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,430,432,0,0,0,0,0,0,0,0,430,310,310,432,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,430,432,0,0,0,0,0,0,0,0,430,310,310,432,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,430,432,0,0,0,0,0,0,0,0,430,310,310,432,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,430,432,0,0,0,0,0,0,0,0,430,310,310,432,0,0,0,0,0,0,0,0,8,8,8,8,8,8,8,8, - 391,391,391,391,391,391,391,391,391,391,352,351,391,391,391,391,391,391,391,391,352,310,310,351,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391, - 310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310, - 310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310, - }; - - obj.createentity(8, 200, 10, 1, 447520); // (savepoint) - obj.createentity(200, 192, 9, 4); // (shiny trinket) - obj.createentity(232, 96, 10, 1, 447521); // (savepoint) - - obj.createentity(24 - 60 - 8, 144 - 8, 1, 10, 0); // Enemy - - obj.createentity(24 - 60 - 8 + 117, 144 - 8, 1, 10, 1); // Enemy - obj.createentity(24 - 60 - 8 + (117 * 2), 144 - 8, 1, 10, 1); // Enemy - obj.createentity(24 - 60 - 8 + (117 * 3), 144 - 8, 1, 10, 1); // Enemy - //LIES Emitter, manually positioned - roomname = "Clarion Call"; - result = contents; - break; - } - - case rn(51,46): - { - - static const short contents[] = { - 110,110,110,110,110,110,232,686,686,686,686,686,230,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, - 110,110,110,110,111,271,272,686,686,686,686,686,230,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, - 110,110,110,110,232,686,686,686,686,686,686,686,230,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, - 110,110,110,110,232,686,686,686,686,686,686,686,230,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, - 110,110,110,110,232,686,686,686,686,686,686,686,230,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, - 110,110,110,110,232,686,686,686,686,686,686,686,230,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, - 110,110,110,110,151,191,192,686,686,686,686,686,230,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, - 110,110,110,110,110,110,232,686,686,686,686,686,230,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, - 110,110,110,110,110,110,232,686,686,686,686,686,230,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, - 110,110,110,110,110,110,232,686,686,686,686,686,230,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, - 110,110,110,110,110,110,232,686,686,686,686,686,230,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, - 110,110,110,110,110,110,232,686,686,686,686,686,230,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, - 110,110,110,110,110,110,232,686,686,686,686,686,270,271,271,271,271,271,271,271,271,271,271,271,271,112,110,110,110,110,110,110,110,110,110,110,110,110,110,110, - 110,110,110,110,110,110,232,686,686,686,686,686,686,686,686,808,0,0,0,0,0,0,0,0,0,230,110,110,110,110,110,110,110,110,110,110,110,110,110,110, - 110,110,110,110,110,110,232,686,686,686,686,686,686,686,686,808,0,0,0,0,0,0,0,0,0,230,110,110,110,110,110,110,110,110,110,110,110,110,110,110, - 110,110,110,110,110,110,232,686,686,686,686,686,686,686,686,808,0,0,0,0,0,0,0,0,0,230,110,110,110,110,110,110,110,110,110,110,110,110,110,110, - 110,110,110,110,110,110,232,686,686,686,686,686,686,686,686,808,0,0,0,0,0,0,0,0,0,230,110,110,110,110,110,110,110,110,110,110,110,110,110,110, - 110,110,110,110,110,110,232,686,686,686,686,686,686,686,686,808,0,0,0,0,0,0,0,0,0,230,110,110,110,110,110,110,110,110,110,110,110,110,110,110, - 110,110,110,110,110,110,232,686,686,686,686,686,686,686,686,808,0,0,0,0,0,0,0,0,0,230,110,110,110,110,110,110,110,110,110,110,110,110,110,110, - 110,110,110,110,110,110,232,686,686,686,686,686,686,686,686,808,0,0,0,0,0,0,0,0,0,230,110,110,110,110,110,110,110,110,110,110,110,110,110,110, - 110,110,110,110,110,110,232,686,686,686,686,686,686,686,686,808,0,0,0,0,0,0,0,0,0,230,110,110,110,110,110,110,110,110,110,110,110,110,110,110, - 110,110,110,110,110,110,232,686,686,686,686,686,686,686,686,808,0,0,0,0,0,0,0,0,0,230,110,110,110,110,110,110,110,110,110,110,110,110,110,110, - 110,110,110,110,110,110,232,686,686,686,686,686,686,686,686,808,0,0,0,0,0,0,0,0,0,230,110,110,110,110,110,110,110,110,110,110,110,110,110,110, - 110,110,110,110,110,110,232,686,686,686,686,686,686,686,686,808,0,0,0,0,0,0,0,0,0,230,110,110,110,110,110,110,110,110,110,110,110,110,110,110, - 110,110,110,110,110,110,232,686,686,686,686,686,686,686,686,808,0,0,0,0,0,0,0,0,0,230,110,110,110,110,110,110,110,110,110,110,110,110,110,110, - 110,110,110,110,110,110,151,191,191,191,191,191,191,191,191,191,191,191,191,191,192,0,0,0,0,230,110,110,110,110,110,110,110,110,110,110,110,110,110,110, - 110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,232,0,0,0,0,230,110,110,110,110,110,110,110,110,110,110,110,110,110,110, - 110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,232,0,0,0,0,230,110,110,110,110,110,110,110,110,110,110,110,110,110,110, - 110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,232,0,0,0,0,230,110,110,110,110,110,110,110,110,110,110,110,110,110,110, - 110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,232,0,0,0,0,230,110,110,110,110,110,110,110,110,110,110,110,110,110,110, - }; - - obj.createentity(176, 104, 10, 0, 446510); // (savepoint) - - obj.createentity(7 * 8, 17 * 8, 1, 12, 0); // Enemy - - obj.createentity(7*8, 2*8, 1, 12, 1); // Enemy - //FACTORY emitter starts here - roomname = "The Solution is Dilution"; - result = contents; - break; - } - - case rn(51,45): - { - - static const short contents[] = { - 92,92,92,92,92,92,214,683,683,683,683,683,252,253,94,92,92,92,92,92,214,0,0,0,0,212,92,92,92,92,92,92,92,92,92,92,92,92,92,92, - 92,92,92,92,92,92,214,683,683,683,683,683,683,683,212,92,92,92,92,92,214,0,0,0,0,212,92,92,92,92,92,92,92,92,92,92,92,92,92,92, - 92,92,92,92,92,92,214,683,683,683,683,683,683,683,212,92,92,92,92,92,214,0,0,0,0,212,92,92,92,92,92,92,92,92,92,92,92,92,92,92, - 92,92,92,92,92,92,214,683,683,683,683,683,683,683,212,92,92,92,92,92,214,0,0,0,0,212,92,92,92,92,92,92,92,92,92,92,92,92,92,92, - 92,92,92,92,92,92,214,683,683,683,683,683,683,683,212,92,92,92,92,92,214,0,0,0,0,212,92,92,92,92,92,92,92,92,92,92,92,92,92,92, - 92,92,92,92,92,92,214,683,683,683,683,683,683,683,212,92,92,92,92,92,214,0,0,0,0,212,92,92,92,92,92,92,92,92,92,92,92,92,92,92, - 92,92,92,92,92,92,214,683,683,683,683,683,683,683,212,92,92,92,92,92,214,0,0,0,0,212,92,92,92,92,92,92,92,92,92,92,92,92,92,92, - 92,92,92,92,92,92,214,683,683,683,683,683,172,173,134,92,92,92,92,92,214,0,0,0,0,212,92,92,92,92,92,92,92,92,92,92,92,92,92,92, - 92,92,92,92,92,92,214,683,683,683,683,683,212,92,92,92,92,92,92,92,214,0,0,0,0,212,92,92,92,92,92,92,92,92,92,92,92,92,92,92, - 92,92,92,92,92,92,214,683,683,683,683,683,212,92,92,92,92,92,92,92,214,0,0,0,0,252,253,253,253,253,253,253,253,253,253,253,253,253,253,253, - 92,92,92,92,93,253,254,683,683,683,683,683,212,92,92,92,92,92,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 92,92,92,92,214,683,683,683,683,683,683,683,212,92,92,92,92,92,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 92,92,92,92,214,683,683,683,683,683,683,683,212,92,92,92,92,92,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 92,92,92,92,214,683,683,683,683,683,683,683,212,92,92,92,92,92,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 92,92,92,92,214,683,683,683,683,683,683,683,212,92,92,92,92,92,92,92,133,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173, - 92,92,92,92,214,683,683,683,683,683,683,683,212,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92, - 92,92,92,92,214,683,683,683,683,683,683,683,212,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92, - 92,92,92,92,133,173,174,683,683,683,683,683,212,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92, - 92,92,92,92,92,92,214,683,683,683,683,683,212,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92, - 92,92,92,92,92,92,214,683,683,683,683,683,212,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92, - 92,92,92,92,92,92,214,683,683,683,683,683,252,253,94,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92, - 92,92,92,92,92,92,214,683,683,683,683,683,683,683,212,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92, - 92,92,92,92,92,92,214,683,683,683,683,683,683,683,212,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92, - 92,92,92,92,92,92,214,683,683,683,683,683,683,683,212,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92, - 92,92,92,92,92,92,214,683,683,683,683,683,683,683,212,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92, - 92,92,92,92,92,92,214,683,683,683,683,683,683,683,212,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92, - 92,92,92,92,92,92,214,683,683,683,683,683,683,683,212,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92, - 92,92,92,92,92,92,214,683,683,683,683,683,172,173,134,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92, - 92,92,92,92,92,92,214,683,683,683,683,683,212,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92, - 92,92,92,92,92,92,214,683,683,683,683,683,212,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92, - }; - - obj.createentity(96, 168, 10, 0, 445510); // (savepoint) - - obj.createentity(7 * 8, 36 * 8, 1, 12, 0); // Enemy - - obj.createentity(7 * 8, (36 * 8)-108, 1, 12, 1); // Enemy - obj.createentity(7 * 8, (36 * 8)-216, 1, 12, 1); // Enemy - //FACTORY emitter starts here (manually placed) - - roomname = "Lighter Than Air"; - result = contents; - break; - } - - - case rn(51,44): - { - - static const short contents[] = { - 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, - 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,293,453,453,453,453,453,453,453,294,292,292, - 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,293,454,0,0,0,0,0,0,0,412,292,292, - 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,293,454,0,0,0,0,0,0,0,0,412,292,292, - 292,292,292,292,292,292,293,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,454,0,0,0,0,0,0,0,0,0,412,292,292, - 292,292,292,292,292,292,414,701,701,701,701,701,701,701,701,823,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292, - 292,292,292,292,292,292,414,701,701,701,701,701,701,701,701,823,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292, - 292,292,292,292,292,292,414,701,701,701,701,701,701,701,701,823,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292, - 292,292,292,292,292,292,414,701,701,701,701,701,701,701,701,823,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292, - 292,292,292,292,292,292,414,701,701,701,701,701,701,701,701,823,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292, - 292,292,292,292,292,292,414,701,701,701,701,701,701,701,701,823,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292, - 292,292,292,292,292,292,414,701,701,701,701,701,701,701,701,823,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292, - 292,292,292,292,292,292,414,701,701,701,701,701,701,701,701,823,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292, - 292,292,292,292,292,292,414,701,701,701,701,701,701,701,701,823,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292, - 292,292,292,292,292,292,414,701,701,701,701,701,701,701,701,823,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292, - 292,292,292,292,292,292,414,701,701,701,701,701,701,701,701,823,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292, - 292,292,292,292,292,292,414,701,701,701,701,701,701,701,701,823,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292, - 292,292,292,292,292,292,414,701,701,701,701,701,701,701,701,823,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292, - 292,292,292,292,292,292,414,701,701,701,701,701,701,701,701,823,0,0,0,0,372,373,373,373,373,373,373,373,373,373,373,373,373,374,0,0,0,412,292,292, - 292,292,292,292,292,292,414,701,701,701,701,701,701,701,701,823,0,0,0,372,334,292,292,292,292,292,292,292,292,292,292,292,292,414,0,0,0,412,292,292, - 292,292,292,292,293,453,454,701,701,701,701,701,701,701,701,823,0,0,372,334,292,292,292,292,292,292,292,292,292,292,292,292,292,414,0,0,0,412,292,292, - 292,292,292,292,414,701,701,701,701,701,701,701,372,373,373,373,373,373,334,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,0,0,0,412,292,292, - 292,292,292,292,414,701,701,701,701,701,701,701,412,292,292,292,292,292,292,292,293,453,453,453,453,453,453,453,453,453,453,453,453,454,0,0,0,412,292,292, - 292,292,292,292,414,701,701,701,701,701,701,701,412,292,292,292,292,292,292,292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292, - 292,292,292,292,414,701,701,701,701,701,701,701,412,292,292,292,292,292,292,292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292, - 292,292,292,292,414,701,701,701,701,701,701,701,412,292,292,292,292,292,292,292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292, - 292,292,292,292,414,701,701,701,701,701,701,701,412,292,292,292,292,292,292,292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292, - 292,292,292,292,333,373,374,701,701,701,701,701,412,292,292,292,292,292,292,292,414,0,0,0,0,372,373,373,373,373,373,373,373,373,373,373,373,334,292,292, - 292,292,292,292,292,292,414,701,701,701,701,701,412,292,292,292,292,292,292,292,414,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292,292,292,292, - 292,292,292,292,292,292,414,701,701,701,701,701,412,292,292,292,292,292,292,292,414,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292,292,292,292, - }; - - obj.createentity(224, 200, 10, 1, 444510); // (savepoint) - - obj.createentity(56, 40, 1, 0, 2); // Enemy //collector - - obj.createentity(7 * 8, 36 * 8, 1, 12, 0); // Enemy - - obj.createentity(7 * 8, (36 * 8)-108, 1, 12, 1); // Enemy - obj.createentity(7 * 8, (36 * 8)-216, 1, 12, 1); // Enemy - //FACTORY emitter starts here (manually placed) - - if(!game.intimetrial || game.translator_exploring) - { - obj.createentity(18 * 8, (5 * 8) + 4, 14); //Teleporter! - } - roomname = "Level Complete!"; - result = contents; - break; - } - - //Ok! Big open area is here: - case rn(52,45): - { - - static const short contents[] = { - 286,286,286,286,408,0,0,0,0,0,806,686,686,686,686,686,686,686,686,686,808,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 286,286,286,286,408,0,0,0,0,0,806,686,686,686,686,686,686,686,686,686,808,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 286,286,286,286,408,0,0,0,0,0,806,686,686,686,686,686,686,686,686,686,808,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 286,286,286,286,408,0,0,0,0,0,806,686,686,686,686,686,686,686,686,686,808,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 286,286,287,447,448,0,0,0,0,0,806,686,686,686,686,686,686,686,686,686,808,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 286,286,408,0,0,0,0,0,0,0,806,686,686,686,686,686,686,686,686,686,808,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 286,286,408,0,0,0,0,0,0,0,806,686,686,686,686,686,686,686,686,686,808,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,366,367,367, - 286,286,408,0,0,0,0,0,0,0,806,686,686,686,686,686,686,686,686,686,808,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,446,447,447, - 286,286,408,0,0,0,0,0,0,0,806,686,686,686,686,686,686,686,686,686,808,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 447,447,448,0,0,0,0,0,0,0,806,686,686,686,686,686,686,686,686,686,727,767,767,767,767,767,767,767,767,767,767,767,767,767,767,767,768,0,0,0, - 0,0,0,0,0,0,0,0,0,0,806,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,808,0,0,0, - 0,0,0,0,0,0,0,0,0,0,806,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,808,0,0,0, - 0,0,0,0,0,0,0,0,0,0,806,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,808,0,0,0, - 0,0,0,0,0,0,0,0,0,0,806,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,366,368,686,686,686,686,808,0,0,0, - 367,367,367,367,368,0,0,0,0,0,806,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,406,408,686,686,686,686,808,0,0,0, - 286,286,286,286,408,0,0,0,0,0,806,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,406,327,367,368,686,686,808,0,0,0, - 286,286,286,286,408,0,0,0,0,0,806,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,406,286,286,408,686,686,808,0,0,0, - 286,286,286,286,408,0,0,0,0,0,806,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,366,367,328,286,286,408,686,686,808,0,0,0, - 286,286,286,286,327,367,368,0,0,0,806,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,406,286,286,286,286,408,686,686,808,0,0,0, - 286,286,286,286,286,286,408,0,0,0,806,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,406,286,286,286,286,327,367,368,808,0,0,0, - 286,286,286,286,286,286,408,0,0,0,806,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,406,286,286,286,286,286,286,408,808,0,0,0, - 286,286,286,286,286,286,327,367,367,367,367,367,367,368,686,686,686,686,686,686,686,686,686,686,686,686,686,686,406,286,286,286,286,286,286,408,808,0,0,0, - 286,286,286,286,286,286,286,286,286,286,286,286,286,408,686,686,686,686,686,686,686,686,686,686,686,686,686,686,406,286,286,286,286,286,286,408,808,0,0,0, - 286,286,286,286,286,286,286,286,286,286,286,286,286,327,367,367,367,367,367,367,367,367,367,368,686,686,686,686,406,286,286,286,286,286,286,408,808,0,0,0, - 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,408,686,686,686,686,406,286,286,286,286,286,286,327,367,368,0,0, - 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,327,367,367,367,367,328,286,286,286,286,286,286,286,286,408,0,0, - 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,327,367,367, - 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, - 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, - 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, - }; - roomname = "Green Grotto"; - result = contents; - break; - } - - case rn(52,44): - { - - static const short contents[] = { - 98,98,98,98,220,0,0,0,0,0,800,680,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,0,0,0,0,0,0,218,98,98,98,98, - 98,98,98,98,220,0,0,0,0,0,800,680,258,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,260,0,0,0,0,0,0,218,98,98,98,98, - 98,98,98,98,220,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0,0,218,98,99,259,259, - 98,98,98,98,220,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0,0,218,98,220,0,0, - 98,98,98,98,220,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0,0,218,98,220,0,0, - 98,98,98,98,220,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0,0,218,98,220,0,0, - 98,98,98,98,220,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0,0,218,98,220,0,0, - 98,98,98,98,139,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,140,98,220,0,0, - 98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,0,0, - 98,98,98,98,99,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,260,0,0, - 98,98,98,98,220,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0,0,0,0,0,0,0, - 98,98,98,98,220,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0,0,0,0,0,0,0, - 98,98,98,99,260,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0,0,0,0,0,0,0, - 98,98,98,220,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0,0,0,0,0,0,0, - 98,98,98,220,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0,0,0,0,0,0,0, - 98,98,98,220,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0,0,0,0,0,0,0, - 98,98,98,220,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0,0,0,0,0,0,0, - 98,98,98,220,0,0,0,0,0,0,800,680,178,179,179,179,179,179,179,179,180,680,680,680,680,680,680,802,0,0,0,0,0,0,0,0,0,0,0,0, - 98,98,98,220,0,0,0,0,0,0,800,680,258,259,259,259,259,259,259,259,260,680,680,680,680,680,680,802,0,0,0,0,0,0,0,0,0,0,0,0, - 98,98,98,220,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0,0,0,0,0,0,0, - 98,98,98,220,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0,0,0,0,0,0,0, - 98,98,98,220,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,681,841,841,841,841,841,841,842,0,0,0,0,0,0,0,0,0,0,0,0, - 98,98,98,220,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 98,98,98,139,180,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0,0,0,178,179,179,179,179,179,180,0,0,0,0, - 98,98,98,98,220,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0,0,0,258,259,259,259,259,259,260,0,0,0,0, - 98,98,98,98,220,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 98,98,98,98,220,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 98,98,98,98,220,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 98,98,98,98,220,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 98,98,98,98,220,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - }; - - obj.createentity(248 - 4, 160 - 48, 1, 1, 0); // Enemy - obj.createentity(124, 120, 20, 1); // (terminal) - obj.createblock(5, 124-4, 120, 20, 16, 14); - - obj.createentity(156, 40, 20, 1); // (terminal) - obj.createblock(5, 156-4, 40, 20, 16, 15); - - roomname = "The Hanged Man, Reversed"; - result = contents; - break; - } - - case rn(53,45): - { - - static const short contents[] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 370,370,370,370,370,370,370,371,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,369,370,370,370,370,370,370,370, - 450,450,450,450,450,450,450,451,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,449,450,450,450,450,450,450,450, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,369,370,370,370,370,370,370,370,370,370,370,370,370,371,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,449,450,450,450,450,450,450,450,450,450,450,450,450,451,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,371,0,0,0,0,0,0,0,0,369,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370, - 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,330,370,371,0,0,0,0,369,370,331,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, - 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,0,0,0,0,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, - 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,0,0,0,0,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, - }; - - obj.createentity(152, 120, 10, 0, 445530); // (savepoint) - roomname = "doomS"; - result = contents; - break; - } - - case rn(53,47): - { - - static const short contents[] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,169,170,170,171,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,169,170,170,171,0,0,0,0,0,0,0,0,209,89,89,211,0,0,0,0,0,0,0,0,169,170,170,171,0,0,0,0,0,0, - 0,0,0,0,0,0,209,89,89,211,0,0,0,0,0,0,0,0,209,89,89,211,0,0,0,0,0,0,0,0,209,89,89,211,0,0,0,0,0,0, - 0,0,0,0,0,0,249,91,90,251,0,0,0,0,0,0,0,0,249,91,90,251,0,0,0,0,0,0,0,0,249,91,90,251,0,0,0,0,0,0, - 0,0,0,0,0,0,0,249,251,0,0,0,0,0,0,0,0,0,0,249,251,0,0,0,0,0,0,0,0,0,0,249,251,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,169,171,0,0,0,0,0,0,0,0,0,0,169,171,0,0,0,0,0,0,0,0,0,0,169,171,0,0,0,0,0,0,0, - 0,0,0,0,0,0,169,131,130,171,0,0,0,0,0,0,0,0,169,131,130,171,0,0,0,0,0,0,0,0,169,131,130,171,0,0,0,0,0,0, - 0,0,0,0,0,0,209,89,89,211,0,0,0,0,0,0,0,0,209,89,89,211,0,0,0,0,0,0,0,0,209,89,89,211,0,0,0,0,0,0, - 0,0,0,0,0,0,209,89,89,211,0,0,0,0,0,0,0,0,209,89,89,211,0,0,0,0,0,0,0,0,209,89,89,211,0,0,0,0,0,0, - 0,0,0,0,0,0,209,89,89,211,0,0,0,0,0,0,0,0,209,89,89,211,0,0,0,0,0,0,0,0,209,89,89,211,0,0,0,0,0,0, - 0,0,0,0,0,0,209,89,89,211,0,0,0,0,0,0,0,0,209,89,89,211,0,0,0,0,0,0,0,0,209,89,89,211,0,0,0,0,0,0, - 8,8,8,8,8,8,209,89,89,211,8,8,8,8,8,8,8,8,209,89,89,211,8,8,8,8,8,8,8,8,209,89,89,211,8,8,8,8,8,8, - 170,170,170,170,170,170,131,89,89,130,170,170,170,170,170,170,170,170,131,89,89,130,170,170,170,170,170,170,170,170,131,89,89,130,170,170,170,170,170,170, - 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89, - 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89, - }; - - obj.createentity(24-60-8, 144-8, 1, 10, 0); // Enemy - //LIES Emitter, manually positioned - - obj.createentity(24 - 60 - 8 + 117, 144 - 8, 1, 10, 1); // Enemy - obj.createentity(24 - 60 - 8 + (117 * 2), 144 - 8, 1, 10, 1); // Enemy - obj.createentity(24 - 60 - 8 + (117 * 3), 144 - 8, 1, 10, 1); // Enemy - - roomname = "Chinese Rooms"; - result = contents; - break; - } - - case rn(53,46): - { - - static const short contents[] = { - 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,0,0,0,0,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, - 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,290,450,451,0,0,0,0,449,450,291,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, - 450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,451,0,0,0,0,0,0,0,0,449,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,369,370,370,370,370,370,370,370,370,370,370,370,370,371,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,449,450,450,450,450,450,450,450,450,450,450,450,450,451,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 370,370,370,370,370,370,370,371,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,369,370,370,370,370,370,370,370, - 450,450,450,450,450,450,450,451,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,449,450,450,450,450,450,450,450, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - }; - - obj.createentity(152, 96, 10, 1, 446530); // (savepoint) - roomname = "Swoop"; - result = contents; - break; - } - - case rn(52,46): - { - - static const short contents[] = { - 107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107, - 107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107, - 107,107,108,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268, - 107,107,229,689,811,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 107,107,229,689,811,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 107,107,229,689,811,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 107,107,229,689,811,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 107,107,229,689,811,0,0,187,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,189,0,0,0,0,0,0, - 107,107,229,689,811,0,0,267,268,268,268,268,268,268,268,268,268,268,268,109,107,107,108,268,268,268,268,268,268,268,268,268,109,229,0,0,0,0,0,0, - 107,107,229,689,811,0,0,9,9,9,9,9,9,9,9,9,9,9,9,227,107,107,229,9,9,9,9,9,9,9,9,9,227,229,0,0,0,0,0,0, - 107,107,229,689,811,0,0,0,0,0,0,0,0,0,0,0,0,0,0,227,107,107,229,0,0,0,0,0,0,0,0,0,227,229,0,0,0,0,0,0, - 107,107,229,689,811,0,0,0,0,0,0,0,0,0,0,0,0,0,0,267,268,268,269,0,0,0,0,0,0,0,0,0,227,229,0,0,0,0,0,0, - 107,107,229,689,811,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9,9,9,9,0,0,0,0,0,0,0,0,0,227,229,0,0,0,0,0,0, - 107,107,229,689,811,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,227,229,0,0,0,0,0,0, - 107,107,229,689,811,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,227,229,0,0,0,0,0,0, - 107,107,229,689,811,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,227,229,0,0,0,0,0,0, - 107,107,229,689,811,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,227,229,0,0,0,0,0,0, - 107,107,229,850,851,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,227,229,0,0,0,0,0,0, - 107,107,229,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,227,229,0,0,0,0,0,0, - 107,107,229,0,0,0,0,0,0,0,0,0,8,8,8,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,227,229,0,0,0,0,0,0, - 107,107,229,0,0,0,0,0,0,0,0,0,187,188,188,189,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,227,229,0,0,0,0,0,0, - 107,107,229,0,0,0,0,0,0,0,0,0,227,107,107,229,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,227,148,188,188,188,188,188,188, - 107,107,229,8,8,8,8,8,8,8,8,8,227,107,107,229,8,8,8,8,8,8,8,8,8,8,8,8,0,0,0,0,227,108,268,268,268,268,268,268, - 107,107,148,188,188,188,188,188,188,188,188,188,149,107,107,148,188,188,188,188,188,188,188,188,188,188,188,189,0,0,0,0,227,229,0,0,0,0,0,0, - 107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,229,0,0,0,0,227,229,0,0,0,0,0,0, - 107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,229,0,0,0,0,227,229,0,0,0,0,0,0, - 107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,229,0,0,0,0,227,229,0,0,0,0,0,0, - 107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,229,0,0,0,0,227,229,0,0,0,0,0,0, - 107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,229,0,0,0,0,227,229,0,0,0,0,0,0, - 107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,229,0,0,0,0,227,229,0,0,0,0,0,0, - }; - - obj.createentity(64, 40, 10, 1, 446520); // (savepoint) - obj.createentity(208, 88, 3, 827); //Disappearing Platform - obj.createentity(152, 160, 3, 827); //Disappearing Platform - obj.createentity(96, 88, 3, 827); //Disappearing Platform - obj.createentity(40, 160, 3, 827); //Disappearing Platform - roomname = "Manic Mine"; - result = contents; - break; - } - - - case rn(53,44): - { - - static const short contents[] = { - 89,89,89,89,89,89,89,89,89,89,89,89,89,89,211,0,0,0,0,0,0,0,0,0,0,209,89,89,89,89,89,89,89,89,89,89,89,89,89,89, - 89,89,89,89,89,89,89,89,89,89,89,89,89,89,211,0,0,0,0,0,0,0,0,0,0,209,89,89,89,89,89,89,89,89,89,89,89,89,89,89, - 250,250,250,250,250,250,250,250,250,250,250,250,91,89,211,0,0,0,0,0,0,0,0,0,0,209,89,90,250,250,250,250,250,250,250,250,250,250,250,250, - 0,0,0,0,0,0,0,0,0,0,0,0,209,89,211,0,0,0,0,0,0,0,0,0,0,209,89,211,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,209,89,211,0,0,0,0,0,0,0,0,0,0,209,89,211,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,209,89,211,8,8,0,0,0,0,0,0,8,8,209,89,211,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,209,89,211,210,210,0,0,0,0,0,0,210,210,209,89,211,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,209,89,211,9,9,0,0,0,0,0,0,9,9,209,89,211,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,209,89,211,0,0,0,0,0,0,0,0,0,0,209,89,211,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,209,89,211,0,0,0,0,0,0,0,0,0,0,209,89,211,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,209,89,211,0,8,8,0,0,0,0,8,8,0,209,89,211,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,209,89,211,0,210,210,0,0,0,0,210,210,0,209,89,211,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,209,89,211,0,9,9,0,0,0,0,9,9,0,209,89,211,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,209,89,211,0,0,0,0,0,0,0,0,0,0,209,89,211,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,775,776,776,776,209,89,211,776,776,776,776,776,776,776,776,776,776,209,89,211,776,776,776,777,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,815,695,695,695,209,89,211,695,695,695,695,695,695,695,695,695,695,209,89,211,695,695,695,817,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,815,695,695,695,209,89,211,695,695,695,695,695,695,695,695,695,695,209,89,211,695,695,695,817,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,815,695,695,695,209,89,211,695,695,695,695,695,695,695,695,695,695,209,89,211,695,695,695,817,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,815,695,695,695,209,89,130,170,170,170,170,170,170,170,170,170,170,131,89,211,695,695,695,817,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,815,695,695,695,249,250,91,89,89,89,89,89,89,89,89,89,89,90,250,251,695,695,695,817,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,815,695,695,695,695,695,249,250,250,250,250,250,250,250,250,250,250,251,695,695,695,695,695,817,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,815,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,817,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,815,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,817,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,815,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,817,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,815,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,817,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,855,856,856,856,856,856,856,856,856,856,856,856,856,856,856,856,856,856,856,856,856,856,856,857,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - }; - roomname = "Sorrow"; - result = contents; - break; - } - - - case rn(54,45): - { - - static const short contents[] = { - 0,0,0,0,0,433,313,435,0,0,809,689,473,474,474,474,474,474,474,315,313,313,313,313,313,313,313,313,313,435,689,689,811,0,0,433,313,313,313,313, - 0,0,0,0,0,433,313,435,0,0,809,689,689,689,689,689,689,689,689,433,313,313,313,313,313,313,313,313,313,435,689,689,811,0,0,433,313,313,313,313, - 0,0,0,0,0,433,313,435,0,0,809,689,689,689,689,689,689,689,689,473,474,474,474,474,474,474,474,315,313,435,689,689,811,0,0,433,313,313,313,313, - 0,0,0,0,0,433,313,435,0,0,809,689,689,689,689,689,689,689,689,0,0,0,0,0,0,0,0,433,313,435,689,689,811,0,0,433,313,313,313,313, - 0,0,0,0,0,433,313,435,0,0,809,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,433,313,435,689,689,811,0,0,433,313,313,313,313, - 0,0,0,0,0,433,313,435,0,0,809,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,433,313,435,689,689,811,0,0,433,313,313,313,313, - 394,394,394,394,394,355,313,435,0,0,809,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,433,313,435,689,689,811,0,0,433,313,313,313,313, - 474,474,474,474,474,315,313,435,0,0,809,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,433,313,435,689,689,811,0,0,433,313,313,313,313, - 0,0,0,0,0,433,313,435,0,0,0,0,0,0,0,0,689,689,689,0,0,0,0,689,689,689,689,433,313,435,689,689,811,0,0,433,313,313,313,313, - 0,0,0,0,0,433,313,354,394,394,394,394,394,394,394,395,689,689,689,393,394,394,395,689,689,689,689,433,313,435,689,689,811,0,0,433,313,313,313,313, - 0,0,0,0,0,433,313,314,474,474,474,474,474,474,474,475,689,689,689,473,474,474,475,689,689,689,689,433,313,435,689,689,811,0,0,433,313,313,313,313, - 0,0,0,0,0,433,313,435,0,0,0,0,0,0,0,0,689,689,689,0,0,0,0,689,689,689,689,433,313,435,689,689,811,0,0,433,313,313,313,313, - 0,0,0,0,0,433,313,435,0,0,809,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,433,313,435,689,689,811,0,0,433,313,313,313,313, - 0,0,0,0,0,433,313,435,0,0,809,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,433,313,435,689,689,811,0,0,433,313,313,313,313, - 0,0,0,0,0,433,313,435,0,0,809,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,433,313,435,689,689,811,0,0,433,313,313,313,313, - 0,0,0,0,0,433,313,435,0,0,809,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,433,313,435,689,689,811,0,0,433,313,313,313,313, - 0,0,0,0,0,433,313,435,0,0,809,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,433,313,435,689,689,811,0,0,433,313,313,313,313, - 0,0,0,0,0,433,313,435,0,0,809,689,0,0,0,0,0,689,689,689,0,0,0,0,0,0,0,433,313,435,689,689,811,0,0,433,313,313,313,313, - 0,0,0,0,0,433,313,435,0,0,809,689,393,394,394,394,395,689,689,689,393,394,394,394,394,394,394,355,313,435,689,689,811,0,0,433,313,313,313,313, - 0,0,0,0,0,433,313,435,0,0,809,689,473,474,474,474,475,689,689,689,473,474,474,474,474,474,474,474,474,475,689,689,811,0,0,433,313,313,313,313, - 0,0,0,0,0,433,313,435,0,0,809,689,0,0,0,0,0,689,689,689,0,0,0,0,0,0,0,0,0,0,689,689,811,0,0,433,313,313,313,313, - 0,0,0,0,0,433,313,435,0,0,809,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,811,0,0,433,313,313,313,313, - 0,0,0,0,0,433,313,435,0,0,849,850,850,850,850,850,850,850,850,850,850,850,850,850,850,850,850,850,850,850,850,850,851,0,0,433,313,313,313,313, - 0,0,0,0,0,433,313,435,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,433,313,313,313,313, - 0,0,0,0,0,433,313,435,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,433,313,313,313,313, - 0,0,0,0,0,433,313,435,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,433,313,313,313,313, - 394,394,394,394,394,355,313,354,394,394,394,394,394,394,394,394,395,0,0,0,0,0,0,0,0,0,0,393,394,394,394,394,394,394,394,355,313,313,313,313, - 313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,435,0,0,0,0,0,0,0,0,0,0,433,313,313,313,313,313,313,313,313,313,313,313,313, - 313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,354,394,394,394,394,394,394,394,394,394,394,355,313,313,313,313,313,313,313,313,313,313,313,313, - 313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313, - }; - - obj.createentity(144-4, 208, 1, 1, 6); // Enemy - obj.createentity(128+4, 8, 1, 0, 6); // Enemy - obj.createentity(64, 200, 2, 11, 4); //Big Threadmill, <<<<<< - obj.createentity(216, 200, 2, 11, 4); //Big Threadmill, <<<<<< - obj.createentity(96, 160, 2, 9, 4); //Threadmill, <<< - obj.createentity(160, 160, 2, 11, 4); //Big Threadmill, <<<<<< - obj.createentity(208, 160, 2, 9, 4); //Threadmill, <<< - obj.createentity(248, 184, 10, 1, 445540); // (savepoint) - obj.createentity(184, 24, 2, 9, 4); //Threadmill, <<< - obj.createentity(64, 64, 2, 11, 4); //Big Threadmill, <<<<<< - obj.createentity(152, 64, 2, 9, 4); //Threadmill, <<< - obj.createentity(152, 88, 2, 9, 4); //Threadmill, <<< - obj.createentity(64, 88, 2, 11, 4); //Big Threadmill, <<<<<< - obj.createentity(96, 136, 2, 9, 4); //Threadmill, <<< - obj.createentity(160, 136, 2, 9, 4); //Threadmill, <<< - obj.createentity(184, 136, 2, 9, 4); //Threadmill, <<< - obj.createentity(152, 24, 2, 9, 4); //Threadmill, <<< - obj.createentity(104, 200, 2, 9, 4); //Threadmill, <<< - obj.createentity(104, 136, 2, 9, 4); //Threadmill, <<< - obj.createentity(104, 160, 2, 9, 4); //Threadmill, <<< - - roomname = "$eeing Dollar $ign$"; - result = contents; - break; - } - - case rn(54,44): - { - - static const short contents[] = { - 86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86, - 86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,87,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247, - 247,247,247,247,247,88,86,86,86,86,86,86,86,86,86,86,86,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,818,698,246,247,247,247,88,86,86,86,86,86,86,86,86,208,698,698,698,698,698,698,698,698,698,698,698,698,698,820,0,0,0,0,0,0,0, - 0,0,0,818,698,820,0,818,698,246,247,247,247,88,86,86,86,86,208,698,698,698,698,698,698,698,698,698,698,698,698,698,820,0,0,0,0,0,0,0, - 0,0,0,818,698,820,0,818,699,859,859,859,859,246,247,88,86,86,208,698,698,698,698,698,698,698,698,698,698,698,698,698,820,0,0,0,0,0,0,0, - 0,0,0,818,698,820,0,818,820,0,0,0,0,0,0,246,88,86,208,698,698,698,698,698,698,698,698,698,698,698,698,698,820,0,0,0,0,0,0,0, - 0,0,0,818,698,820,0,818,820,0,778,779,779,779,779,779,206,86,208,698,698,698,698,698,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,818,698,820,0,818,820,0,818,699,859,859,859,859,206,86,208,698,698,698,698,166,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167, - 0,0,0,818,698,820,0,818,820,0,818,820,0,0,0,0,206,86,208,698,698,698,698,206,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86, - 0,0,0,818,698,820,0,818,820,0,818,820,0,778,780,0,206,86,208,698,698,698,698,206,86,86,86,86,86,87,247,247,247,247,247,247,247,247,247,247, - 0,0,0,818,698,820,0,818,820,0,818,820,0,858,860,0,206,86,208,698,698,698,698,206,86,86,86,86,86,208,0,0,0,0,0,0,0,0,0,0, - 0,0,0,818,698,820,0,818,820,0,818,820,0,0,0,0,206,86,208,698,698,698,698,206,86,86,86,86,86,208,698,698,820,0,0,0,0,0,0,0, - 0,0,0,818,698,820,0,818,820,0,818,739,779,779,779,779,206,86,208,698,698,698,698,206,86,86,86,86,86,208,698,698,820,0,0,0,0,0,0,0, - 0,0,0,818,698,820,0,818,820,0,858,859,859,859,859,166,128,86,208,698,698,698,698,206,86,86,86,86,86,208,698,698,820,0,0,0,0,0,0,0, - 0,0,0,818,698,820,0,818,820,0,0,0,0,166,167,128,86,86,208,698,698,698,698,206,86,86,86,86,86,208,698,698,820,0,0,0,0,0,0,0, - 0,0,0,818,698,820,0,818,698,166,167,167,167,128,86,86,86,86,208,698,698,698,698,206,86,86,86,86,86,208,698,698,820,0,0,0,0,0,0,0, - 0,0,0,818,698,166,167,167,167,128,86,86,86,86,86,86,86,86,208,698,698,698,698,206,86,86,86,86,86,208,698,698,820,0,0,166,167,167,167,167, - 0,0,0,818,698,206,86,87,247,247,247,247,247,247,247,247,247,247,248,698,698,698,698,206,86,86,86,86,86,208,698,698,820,0,0,206,86,86,86,86, - 0,0,0,818,698,206,86,208,0,0,0,0,0,0,0,0,0,0,0,698,698,698,698,206,86,86,86,86,86,208,698,698,820,0,0,206,86,86,86,86, - 0,0,0,858,859,206,86,208,859,859,700,698,698,698,698,698,698,698,698,698,698,698,698,206,86,86,86,86,86,208,698,698,820,0,0,206,86,86,86,86, - 0,0,0,0,0,206,86,208,0,0,818,698,698,698,698,698,698,698,698,698,698,698,698,206,86,86,86,86,86,208,698,698,820,0,0,206,86,86,86,86, - 0,0,0,0,0,206,86,208,0,0,818,698,698,698,698,698,698,698,698,698,698,698,698,206,86,86,86,86,86,208,698,698,820,0,0,206,86,86,86,86, - 0,0,0,0,0,206,86,208,0,0,818,698,698,698,698,698,698,698,698,698,698,698,698,206,86,86,86,86,86,208,698,698,820,0,0,206,86,86,86,86, - 0,0,0,0,0,206,86,208,0,0,818,698,0,0,0,0,0,0,0,0,0,0,0,206,86,86,86,86,86,208,698,698,820,0,0,206,86,86,86,86, - 0,0,0,0,0,206,86,208,0,0,818,698,166,167,167,167,167,167,167,167,167,167,167,128,86,86,86,86,86,208,698,698,820,0,0,206,86,86,86,86, - 0,0,0,0,0,206,86,208,0,0,818,698,206,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,208,698,698,820,0,0,206,86,86,86,86, - 0,0,0,0,0,206,86,208,0,0,818,698,206,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,208,698,698,820,0,0,206,86,86,86,86, - 0,0,0,0,0,206,86,208,0,0,818,698,206,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,208,698,698,820,0,0,206,86,86,86,86, - 0,0,0,0,0,206,86,208,0,0,818,698,206,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,208,698,698,820,0,0,206,86,86,86,86, - }; - - obj.createentity(184, 56, 2, 10, 4); //Big Threadmill, >>>>>> - obj.createentity(248, 56, 2, 10, 4); //Big Threadmill, >>>>>> - obj.createentity(312, 56, 2, 8, 4); //Threadmill, >>> - obj.createentity(152, 16, 2, 10, 4); //Big Threadmill, >>>>>> - obj.createentity(216, 16, 2, 10, 4); //Big Threadmill, >>>>>> - obj.createentity(280, 16, 2, 10, 4); //Big Threadmill, >>>>>> - obj.createentity(280, 128, 2, 11, 4); //Big Threadmill, <<<<<< - obj.createentity(272, 88, 2, 11, 4); //Big Threadmill, <<<<<< - obj.createentity(64, 152, 2, 10, 4); //Big Threadmill, >>>>>> - obj.createentity(120, 152, 2, 8, 4); //Threadmill, >>> - obj.createentity(96, 192, 2, 10, 4); //Big Threadmill, >>>>>> - obj.createentity(152, 192, 2, 8, 4); //Threadmill, >>> - obj.createentity(240, 88, 2, 9, 4); //Threadmill, <<< - roomname = "Parabolica"; - result = contents; - break; - } - - case rn(54,47): - { - - static const short contents[] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,0,0,0,0, - 0,0,0,0,166,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,168,0,0,0,0, - 0,0,0,0,246,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,248,779,780,0,0, - 0,0,0,0,0,0,0,818,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,820,0,0, - 0,0,0,0,0,0,0,818,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,820,0,0, - 0,0,0,0,0,0,0,818,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,820,0,0, - 0,0,0,0,0,0,0,818,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,820,0,0, - 0,0,0,0,0,0,0,818,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,820,0,0, - 0,0,0,0,0,0,0,858,859,859,859,166,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167, - 0,0,0,0,0,0,0,0,0,0,0,206,86,86,87,247,247,247,247,247,247,247,247,247,247,88,86,86,86,86,86,86,86,86,86,86,86,86,86,86, - 0,0,0,0,0,0,0,0,0,0,0,206,86,86,208,0,0,0,0,0,0,0,0,0,0,206,86,86,86,86,86,86,86,86,86,86,86,86,86,86, - 0,0,0,0,0,0,0,0,0,0,0,206,86,86,208,0,0,0,0,0,0,0,0,0,0,206,86,86,87,247,247,247,247,247,247,247,247,247,247,247, - 0,0,0,0,0,0,0,0,0,0,0,246,247,247,248,0,0,0,0,0,0,0,0,0,0,246,247,247,248,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,9,9,9,9,0,0,0,0,0,0,0,0,0,0,9,9,9,9,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,8,8,8,8,0,0,0,0,0,0,0,0,0,0,8,8,8,8,0,0,0,0,0,0,0,0,0,0,8,8,8,8,0,0,0,0, - 0,0,0,0,166,167,167,168,0,0,0,0,0,0,0,0,0,0,166,167,167,168,0,0,0,0,0,0,0,0,0,0,166,167,167,168,0,0,0,0, - 0,0,0,0,206,86,86,208,0,0,0,0,0,0,0,0,0,0,206,86,86,208,0,0,0,0,0,0,0,0,0,0,206,86,86,208,0,0,0,0, - 0,0,0,0,206,86,86,208,0,0,0,0,0,0,0,0,0,0,206,86,86,208,0,0,0,0,0,0,0,0,0,0,206,86,86,208,0,0,0,0, - 0,0,0,0,206,86,86,127,167,167,167,167,167,167,167,167,167,167,128,86,86,127,167,167,167,167,167,167,167,167,167,167,128,86,86,127,167,167,167,167, - 0,0,0,0,206,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86, - 8,8,8,8,206,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86, - 167,167,167,167,128,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86, - 86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86, - 86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86, - }; - - obj.createentity(96, 80, 10, 1, 447540); // (savepoint) - obj.createentity(64, 184, 2, 10, 4); //Big Threadmill, >>>>>> - obj.createentity(112, 184, 2, 8, 4); //Threadmill, >>> - obj.createentity(176, 184, 2, 10, 4); //Big Threadmill, >>>>>> - obj.createentity(224, 184, 2, 8, 4); //Threadmill, >>> - obj.createentity(232, 128, 2, 10, 4); //Big Threadmill, >>>>>> - obj.createentity(288, 128, 2, 8, 4); //Threadmill, >>> - obj.createentity(288, 184, 2, 8, 4); //Threadmill, >>> - obj.createentity(120, 112, 2, 10, 4); //Big Threadmill, >>>>>> - obj.createentity(168, 112, 2, 8, 4); //Threadmill, >>> - obj.createentity(208, 168, 10, 1, 447541); // (savepoint) - - obj.createentity(24 - 60 - 8, 144 - 8, 1, 10, 0); // Enemy - - obj.createentity(24 - 60 - 8 + 117, 144 - 8, 1, 10, 1); // Enemy - obj.createentity(24 - 60 - 8 + (117 * 2), 144 - 8, 1, 10, 1); // Enemy - obj.createentity(24 - 60 - 8 + (117 * 3), 144 - 8, 1, 10, 1); // Enemy - - //LIES Emitter, manually positioned - roomname = "Spikes Do!"; - result = contents; - break; - } - - case rn(54,46): - { - - static const short contents[] = { - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 656,656,656,656,656,656,656,656,656,656,656,497,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 0,0,0,0,0,0,0,800,680,680,680,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 0,0,0,0,0,0,0,800,680,680,680,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 0,0,0,0,0,0,0,800,680,680,680,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 0,0,0,0,0,0,0,800,680,680,680,655,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656, - 0,0,0,0,0,0,0,800,680,680,680,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,1125,9,9,9,9,9, - 0,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0, - 0,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0, - 0,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0, - 0,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0, - 0,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0, - 0,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0, - 0,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0, - 0,0,0,0,0,0,0,840,841,841,841,841,841,841,841,841,841,841,841,841,841,841,841,841,841,841,841,841,841,841,841,841,841,841,842,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 576,576,576,576,576,576,576,576,576,576,577,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 656,656,656,656,656,656,656,656,656,656,657,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - }; - - obj.createentity(64, 152, 10, 1, 446540); // (savepoint) - obj.createentity(120, 72, 3, 707); //Disappearing Platform - obj.createentity(248, 72, 3, 707); //Disappearing Platform - obj.createentity(184, 200, 3, 707); //Disappearing Platform - roomname = "What Lies Beneath?"; - result = contents; - break; - } - - case rn(55,47): - { - - static const short contents[] = { - 0,0,0,0,0,0,0,815,695,695,695,695,695,695,695,209,89,211,695,695,695,695,695,695,695,817,0,0,0,0,0,209,89,89,89,89,89,89,89,89, - 0,0,0,0,0,0,0,815,695,695,695,695,695,695,695,209,89,211,695,695,695,695,695,695,695,817,0,0,0,0,0,209,89,89,89,89,89,89,89,89, - 0,0,0,0,0,0,0,815,695,695,695,695,695,695,695,209,89,211,695,695,695,695,695,695,695,817,0,0,0,0,0,209,89,89,89,89,89,89,89,89, - 0,0,0,0,0,0,0,815,695,695,695,695,695,695,695,209,89,211,695,695,695,695,695,695,695,817,0,0,0,0,0,209,89,89,89,89,89,89,89,89, - 0,0,0,0,0,0,0,815,695,695,695,695,695,695,695,209,89,211,695,695,695,695,695,695,695,817,0,0,0,0,0,209,89,89,89,89,89,89,89,89, - 0,0,0,0,0,0,0,815,695,695,695,695,695,695,695,209,89,211,695,695,695,695,695,695,695,817,0,0,0,0,0,209,89,89,89,89,89,89,89,89, - 0,0,0,0,0,0,0,815,695,695,695,695,695,695,695,209,89,211,695,695,695,695,695,695,695,817,0,0,0,0,0,209,89,89,89,89,89,89,89,89, - 0,0,0,0,0,0,0,815,695,695,695,695,695,695,695,209,89,211,695,695,695,695,695,695,695,817,0,0,0,0,0,209,89,89,89,89,89,89,89,89, - 0,0,0,0,0,0,0,815,695,695,695,695,695,695,695,209,89,211,695,695,695,695,695,695,695,817,0,0,0,0,0,209,89,89,89,89,89,89,89,89, - 0,0,0,0,0,0,0,815,695,695,695,695,695,695,695,209,89,211,695,695,695,695,695,695,695,817,0,0,0,0,0,209,89,89,89,89,89,89,89,89, - 0,0,0,0,0,0,0,815,695,695,695,695,695,695,695,209,89,211,695,695,695,695,695,695,695,817,0,0,0,0,0,209,89,89,89,89,89,89,89,89, - 0,0,0,0,0,0,0,815,695,695,695,695,695,695,695,209,89,211,695,695,695,695,695,695,695,817,0,0,0,0,0,209,89,89,89,89,89,89,89,89, - 170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,131,89,211,695,695,695,695,695,695,695,817,0,0,0,0,0,249,250,250,250,250,250,250,91,89, - 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,211,695,695,695,695,695,695,695,817,0,0,0,0,0,0,0,0,0,0,0,0,209,89, - 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,211,695,695,695,695,695,695,695,817,0,0,0,0,0,0,0,0,0,0,0,0,209,89, - 250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,251,695,695,695,695,695,695,695,817,0,0,0,0,0,0,0,0,0,0,0,0,209,89, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,695,695,695,695,695,695,817,0,0,0,0,0,0,0,0,0,0,0,0,209,89, - 0,0,0,0,0,0,0,815,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,817,0,0,0,0,0,0,0,0,0,0,0,0,209,89, - 0,0,0,0,0,0,0,815,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,817,0,0,0,0,0,0,0,0,0,0,0,0,209,89, - 0,0,0,0,0,0,0,855,856,856,856,856,856,856,856,856,856,856,856,856,856,856,856,856,856,857,0,0,0,0,0,0,0,0,0,0,0,0,209,89, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,209,89, - 0,0,0,0,0,0,0,0,8,8,8,8,8,8,8,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,169,170,170,170,170,170,170,131,89, - 0,0,0,0,0,0,0,0,169,170,170,170,170,170,170,171,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,209,89,89,89,89,89,89,89,89, - 0,0,0,0,0,0,0,0,209,89,89,89,89,89,89,211,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,209,89,89,89,89,89,89,89,89, - 170,170,170,170,170,170,170,170,131,89,89,89,89,89,89,130,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,131,89,89,89,89,89,89,89,89, - 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89, - 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89, - 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89, - 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89, - 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89, - }; - - obj.createentity(0, 128, 2, 10, 4); //Big Threadmill, >>>>>> - obj.createentity(64, 128, 2, 10, 4); //Big Threadmill, >>>>>> - obj.createentity(112, 128, 2, 8, 4); //Threadmill, >>> - obj.createentity(0, 184, 2, 10, 4); //Big Threadmill, >>>>>> - obj.createentity(128, 184, 2, 10, 4); //Big Threadmill, >>>>>> - obj.createentity(184, 184, 2, 10, 4); //Big Threadmill, >>>>>> - obj.createentity(152, 168, 10, 1, 447550); // (savepoint) - - obj.createentity(264, 136, 1, 0, 2); // Enemy //Collector - obj.createentity(24 - 60 - 8, 144 - 8, 1, 10, 0); // Enemy - obj.createentity(24 - 60 - 8 + 117, 144 - 8, 1, 10, 1); // Enemy - obj.createentity(24 - 60 - 8 + (117 * 2), 144 - 8, 1, 10, 1); // Enemy - //LIES Emitter, manually positioned, collector! - roomname = "Chipper Cipher"; - result = contents; - break; - } - - case rn(55,46): - { - - static const short contents[] = { - 504,504,504,504,504,504,504,504,504,504,504,504,504,504,504,504,504,626,683,683,683,683,624,504,504,504,504,504,504,504,504,504,504,504,504,504,504,504,504,504, - 504,504,504,504,504,504,504,504,504,504,504,504,504,504,504,504,504,626,683,683,683,683,664,506,504,504,504,504,504,504,504,504,504,504,504,504,504,504,504,504, - 504,504,504,504,504,504,504,504,504,504,504,504,504,504,504,504,504,626,683,683,683,683,683,624,504,504,504,504,504,504,504,504,504,504,504,504,504,504,504,504, - 504,504,504,504,504,504,504,504,504,504,504,504,504,504,504,504,504,626,844,844,844,844,844,624,504,504,504,504,504,504,504,504,504,504,504,504,504,504,504,504, - 504,504,504,504,504,504,504,504,504,504,504,504,504,504,504,504,504,626,0,0,0,0,0,664,506,504,504,504,504,504,504,504,504,504,504,504,504,504,504,504, - 504,504,504,504,504,504,504,504,504,504,504,504,504,504,504,504,504,626,0,0,0,0,0,0,624,504,504,504,504,504,504,504,504,504,504,504,504,504,504,504, - 665,665,665,665,665,665,665,665,665,665,665,665,665,665,665,506,504,626,0,0,0,0,0,0,624,504,504,504,504,504,504,504,504,504,504,504,504,504,504,504, - 9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,624,504,626,0,0,0,0,0,0,664,506,504,504,504,504,504,504,504,504,504,504,504,504,504,504, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,624,504,626,0,0,0,0,0,0,0,624,504,504,504,504,504,504,504,504,504,504,504,504,504,504, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,624,504,626,0,0,0,0,0,0,0,624,504,504,504,504,504,504,504,504,504,504,504,504,504,504, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,624,504,626,0,0,0,0,0,0,0,664,506,504,504,504,504,504,504,504,504,504,504,504,504,504, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,624,504,626,0,0,0,0,0,0,0,0,624,504,504,504,504,504,504,504,504,504,504,504,504,504, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,624,504,626,0,0,0,0,0,0,0,0,624,504,504,504,504,504,504,504,504,504,504,504,504,504, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,624,504,626,0,0,0,0,0,0,0,0,664,506,504,504,504,504,504,504,504,504,504,504,504,504, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,624,504,626,0,0,0,0,0,0,0,0,0,624,504,504,504,504,504,504,504,504,504,504,504,504, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,624,504,626,0,0,0,0,0,0,0,0,0,624,504,504,504,504,504,504,504,504,504,504,504,504, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,624,504,626,0,0,0,0,0,0,0,0,0,664,506,504,504,504,504,504,504,504,504,504,504,504, - 0,0,0,0,0,0,0,763,764,764,764,764,764,764,764,624,504,626,764,764,764,764,764,764,764,765,0,0,624,504,504,504,504,504,504,504,504,504,504,504, - 0,0,0,0,0,0,0,803,683,683,683,683,683,683,683,624,504,626,683,683,683,683,683,683,683,805,0,0,624,504,504,504,504,504,504,504,504,504,504,504, - 0,0,0,0,0,0,0,803,683,683,683,683,683,683,683,624,504,626,683,683,683,683,683,683,683,805,0,0,664,506,504,504,504,504,504,504,504,504,504,504, - 0,0,0,0,0,0,0,803,683,683,683,683,683,683,683,624,504,626,683,683,683,683,683,683,683,805,0,0,0,624,504,504,504,504,504,504,504,504,504,504, - 0,0,0,0,0,0,0,803,683,683,683,683,683,683,683,624,504,626,683,683,683,683,683,683,683,805,0,0,0,624,504,504,504,504,504,504,504,504,504,504, - 0,0,0,0,0,0,0,803,683,683,683,683,683,683,683,624,504,626,683,683,683,683,683,683,683,805,0,0,0,664,506,504,504,504,504,504,504,504,504,504, - 0,0,0,0,0,0,0,803,683,683,683,683,683,683,683,624,504,626,683,683,683,683,683,683,683,805,0,0,0,0,624,504,504,504,504,504,504,504,504,504, - 0,0,0,0,0,0,0,803,683,683,683,683,683,683,683,624,504,626,683,683,683,683,683,683,683,805,0,0,0,0,624,504,504,504,504,504,504,504,504,504, - 0,0,0,0,0,0,0,803,683,683,683,683,683,683,683,624,504,626,683,683,683,683,683,683,683,805,0,0,0,0,664,506,504,504,504,504,504,504,504,504, - 0,0,0,0,0,0,0,803,683,683,683,683,683,683,683,624,504,626,683,683,683,683,683,683,683,805,0,0,0,0,0,624,504,504,504,504,504,504,504,504, - 0,0,0,0,0,0,0,803,683,683,683,683,683,683,683,624,504,626,683,683,683,683,683,683,683,805,0,0,0,0,0,624,504,504,504,504,504,504,504,504, - 0,0,0,0,0,0,0,803,683,683,683,683,683,683,683,624,504,626,683,683,683,683,683,683,683,805,0,0,0,0,0,624,504,504,504,504,504,504,504,504, - 0,0,0,0,0,0,0,803,683,683,683,683,683,683,683,624,504,626,683,683,683,683,683,683,683,805,0,0,0,0,0,624,504,504,504,504,504,504,504,504, - }; - - obj.createentity(40, 72, 3, 787); //Disappearing Platform - roomname = "If You Fall Up"; - result = contents; - break; - } - - case rn(55,45): - { - - static const short contents[] = { - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,618,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,499,659,659,659,659,659,500,498,499,659,659,659,659,659,500,498,498,620,0,0,0,0,618,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,618,498,620,0,0,0,0,0,618,498,498,620,0,0,0,0,618,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,618,498,620,0,0,0,0,0,618,498,498,620,0,0,0,0,618,498, - 498,498,499,659,659,659,659,500,498,498,498,498,498,498,498,498,620,0,0,0,0,0,658,659,660,0,0,0,0,0,618,498,498,620,0,0,0,0,618,498, - 498,498,620,9,9,9,9,658,659,659,659,659,659,500,498,498,620,0,0,0,0,0,9,9,9,0,0,0,0,0,618,498,498,620,0,0,0,0,618,498, - 498,498,620,0,0,0,0,9,9,9,9,9,9,658,659,659,660,0,0,0,0,0,0,0,0,0,0,0,0,0,658,659,659,660,0,0,0,0,618,498, - 498,498,620,0,0,0,0,0,0,0,0,0,0,9,9,9,9,0,0,0,0,0,0,0,0,0,0,0,0,0,9,9,9,9,0,0,0,0,618,498, - 498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498, - 498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498, - 498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498, - 498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498, - 498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498, - 498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,8,8,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498, - 498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,578,579,580,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498, - 498,498,620,0,0,0,0,0,0,0,0,0,0,8,8,8,8,0,0,0,0,0,618,498,620,0,0,0,0,0,8,8,8,8,8,8,8,8,618,498, - 498,498,620,0,0,0,0,8,8,8,8,8,8,578,579,579,580,0,0,0,0,0,618,498,620,0,0,0,0,0,578,579,579,579,579,579,579,579,540,498, - 498,498,620,0,0,0,0,578,579,579,579,579,579,540,498,498,620,0,0,0,0,0,618,498,620,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498, - 498,498,620,0,0,0,0,618,498,498,498,498,498,498,498,498,620,0,0,0,0,0,618,498,620,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498, - 498,498,620,0,0,0,0,618,498,498,498,498,498,498,498,498,539,579,579,579,579,579,540,498,620,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498, - 498,498,620,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498, - 498,498,620,0,0,0,0,658,659,659,659,659,659,659,659,659,659,659,659,659,659,659,500,498,620,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498, - 498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,620,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498, - 498,498,620,0,0,0,0,0,0,0,0,0,775,776,776,776,776,776,776,776,776,776,618,498,620,776,776,776,776,776,618,498,498,498,498,498,498,498,498,498, - 498,498,620,0,0,0,0,0,0,0,0,0,815,695,695,695,695,695,695,695,695,695,618,498,620,695,695,695,695,695,618,498,498,498,498,498,498,498,498,498, - 498,498,620,0,0,0,0,0,0,0,0,0,815,695,695,695,695,695,695,695,695,695,618,498,620,695,695,695,695,695,618,498,498,498,498,498,498,498,498,498, - 498,498,539,579,579,579,579,579,579,579,579,579,579,579,579,579,579,580,695,695,695,695,618,498,539,579,579,579,579,579,540,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,695,695,695,695,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,695,695,695,695,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,695,695,695,695,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, - }; - - obj.platformtile = 159; - obj.createentity(24, 80, 2, 3, 6); // Platform - obj.createentity(64, 176, 10, 0, 445550); // (savepoint) - obj.createentity(216 - 4, 192, 10, 1, 445551); // (savepoint) - roomname = "Just Pick Yourself Down"; - result = contents; - break; - } - - - case rn(55,44): - { - - static const short contents[] = { - 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, - 447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367, - 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, - 447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,288,286, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286, - 367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,368,0,0,0,0,406,286, - 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,408,0,0,0,0,406,286, - 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,408,0,0,0,0,406,286, - 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,408,0,0,0,0,406,286, - 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,408,0,0,0,0,406,286, - 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,408,0,0,0,0,406,286, - 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,408,0,0,0,0,406,286, - 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,408,0,0,0,0,406,286, - 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,408,0,0,0,0,406,286, - 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,408,0,0,0,0,406,286, - 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,408,0,0,0,0,406,286, - 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,408,0,0,0,0,406,286, - 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,408,0,0,0,0,406,286, - }; - - obj.createentity(32, 40, 10, 1, 444560); // (savepoint) - obj.createentity(56, 24, 10, 0, 444551); // (savepoint) - obj.createentity(80, 40, 10, 1, 444552); // (savepoint) - obj.createentity(104, 24, 10, 0, 444553); // (savepoint) - obj.createentity(128, 40, 10, 1, 444554); // (savepoint) - obj.createentity(152, 24, 10, 0, 444555); // (savepoint) - obj.createentity(176, 40, 10, 1, 444556); // (savepoint) - obj.createentity(200, 24, 10, 0, 444557); // (savepoint) - obj.createentity(224, 40, 10, 1, 444558); // (savepoint) - obj.createentity(248, 24, 10, 0, 444559); // (savepoint) - obj.createentity(272, 40, 10, 1, 444550); // (savepoint) - obj.createentity(0, 16, 2, 10, 4); //Big Threadmill, >>>>>> - obj.createentity(64, 16, 2, 10, 4); //Big Threadmill, >>>>>> - obj.createentity(128, 16, 2, 10, 4); //Big Threadmill, >>>>>> - obj.createentity(192, 16, 2, 10, 4); //Big Threadmill, >>>>>> - obj.createentity(256, 16, 2, 10, 4); //Big Threadmill, >>>>>> - obj.createentity(0, 56, 2, 10, 4); //Big Threadmill, >>>>>> - obj.createentity(64, 56, 2, 10, 4); //Big Threadmill, >>>>>> - obj.createentity(128, 56, 2, 10, 4); //Big Threadmill, >>>>>> - obj.createentity(192, 56, 2, 10, 4); //Big Threadmill, >>>>>> - obj.createentity(256, 56, 2, 10, 4); //Big Threadmill, >>>>>> - obj.createentity(0, 88, 2, 11, 4); //Big Threadmill, <<<<<< - obj.createentity(64, 88, 2, 11, 4); //Big Threadmill, <<<<<< - obj.createentity(128, 88, 2, 11, 4); //Big Threadmill, <<<<<< - obj.createentity(192, 88, 2, 11, 4); //Big Threadmill, <<<<<< - obj.createentity(240, 88, 2, 11, 4); //Big Threadmill, <<<<<< - obj.createentity(0, 128, 2, 11, 4); //Big Threadmill, <<<<<< - obj.createentity(64, 128, 2, 11, 4); //Big Threadmill, <<<<<< - obj.createentity(128, 128, 2, 11, 4); //Big Threadmill, <<<<<< - obj.createentity(192, 128, 2, 11, 4); //Big Threadmill, <<<<<< - obj.createentity(240, 128, 2, 9, 4); //Threadmill, <<< - roomname = "The Warning"; - result = contents; - break; - } - - //Super driller starts here! - case rn(56,44): - { - - static const short contents[] = { - 298,298,298,298,298,298,298,420,0,0,0,0,418,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298, - 459,459,459,459,459,459,459,460,0,0,0,0,418,298,298,298,298,298,298,298,298,299,459,459,459,459,300,298,298,298,298,298,298,298,298,298,298,298,298,298, - 0,0,0,0,0,0,0,0,0,0,0,0,418,298,298,298,298,298,298,298,298,420,9,9,9,9,418,298,298,298,298,298,298,298,298,298,298,298,298,298, - 0,0,0,0,0,0,0,0,0,0,0,0,418,298,298,298,298,298,298,298,298,420,0,0,0,0,418,298,298,298,298,298,298,298,298,298,298,298,298,298, - 0,0,0,0,0,0,0,0,0,0,0,0,418,298,298,298,298,298,298,298,298,420,0,0,0,0,418,298,298,298,298,298,298,298,298,298,298,298,298,298, - 0,0,0,0,0,0,0,0,0,0,0,0,418,298,298,298,298,298,298,299,459,460,0,0,0,0,458,459,300,298,298,298,298,298,298,298,298,298,298,298, - 0,0,0,0,0,0,0,0,0,0,0,0,418,298,298,298,298,298,298,420,9,9,0,0,0,0,9,9,418,298,298,298,298,298,298,298,298,298,298,298, - 0,0,0,0,0,0,0,0,0,0,0,0,418,298,298,298,298,298,298,420,0,0,0,0,0,0,0,0,418,298,298,298,298,298,298,298,298,298,298,298, - 379,379,379,379,379,380,0,0,0,0,0,0,418,298,298,298,298,298,298,420,0,0,0,0,0,0,0,0,418,298,298,298,298,298,298,298,298,298,298,298, - 298,298,298,298,298,420,0,0,0,0,0,0,418,298,298,298,298,299,459,460,0,0,0,0,0,0,0,0,458,459,300,298,298,298,298,298,298,298,298,298, - 298,298,298,298,298,420,0,0,0,0,0,0,418,298,298,298,298,420,9,9,0,0,0,0,0,0,0,0,9,9,418,298,298,298,298,298,298,298,298,298, - 298,298,298,298,298,420,0,0,378,379,379,379,340,298,298,298,298,420,0,0,0,0,0,0,0,0,0,0,0,0,418,298,298,298,298,298,298,298,298,298, - 298,298,298,298,298,420,0,0,458,459,459,459,300,298,298,298,298,420,0,0,0,0,0,0,0,0,0,0,0,0,418,298,298,298,298,298,298,298,298,298, - 298,298,298,298,298,420,0,0,0,0,0,0,418,298,298,299,459,460,0,0,0,0,0,0,0,0,0,0,0,0,458,459,300,298,298,298,298,298,298,298, - 298,298,298,298,298,420,0,0,0,0,0,0,418,298,298,420,9,9,0,0,0,0,0,0,0,0,0,0,0,0,9,9,418,298,298,298,298,298,298,298, - 298,298,298,298,298,420,0,0,0,0,0,0,418,298,298,420,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,418,298,298,298,298,298,298,298, - 298,298,298,298,298,339,379,379,379,380,0,0,418,298,298,420,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,418,298,298,298,298,298,298,298, - 299,459,459,459,459,459,459,459,459,460,0,0,418,299,459,460,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,458,459,300,298,298,298,298,298, - 420,0,0,0,0,0,0,0,0,0,0,0,418,420,9,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9,9,418,298,298,298,298,298, - 420,49,0,0,0,0,0,0,0,0,0,0,418,420,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,418,298,298,298,298,298, - 420,49,0,0,0,0,0,0,0,0,0,0,418,420,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,418,298,298,298,298,298, - 420,49,0,0,0,0,0,0,0,0,0,0,458,460,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,458,459,300,298,298,298, - 420,49,0,0,0,0,50,378,379,379,379,380,9,9,0,0,0,0,0,0,0,8,8,8,8,8,8,0,0,0,0,0,0,0,9,9,418,298,298,298, - 420,49,0,0,0,0,50,418,298,298,298,420,0,0,0,0,0,0,0,0,50,378,379,379,379,379,380,49,0,0,0,0,0,0,0,0,418,298,298,298, - 420,49,0,0,0,0,50,418,298,298,298,420,0,0,0,0,0,0,0,0,50,418,298,298,298,298,420,49,0,0,0,0,0,0,0,0,418,298,298,298, - 420,49,0,0,0,0,50,418,298,299,459,460,0,0,0,0,0,0,0,0,50,418,298,298,298,298,420,49,0,0,0,0,0,0,0,0,458,459,300,298, - 420,49,0,0,0,0,50,418,298,420,9,9,0,0,0,0,0,0,0,0,50,418,298,298,298,298,420,49,0,0,0,0,0,0,0,0,9,9,418,298, - 420,49,0,0,0,0,50,418,298,420,0,0,0,0,0,0,0,0,0,0,50,418,298,298,298,298,420,49,0,0,0,0,0,0,0,0,0,0,418,298, - 420,49,0,0,0,0,50,418,298,420,0,0,0,0,0,0,0,0,0,0,50,418,298,298,298,298,420,49,0,0,0,0,0,0,0,0,0,0,418,298, - 420,49,0,0,0,0,50,418,298,420,0,0,0,0,0,0,0,0,0,0,50,418,298,298,298,298,420,49,0,0,0,0,0,0,0,0,0,0,418,298, - }; - - obj.createentity(176, 80, 3, 55); //Disappearing Platform - obj.createentity(0, 56, 2, 8, 4); //Threadmill, >>> - obj.createentity(16, 56, 2, 8, 4); //Threadmill, >>> - obj.createentity(72, 72, 10, 1, 444561); // (savepoint) - obj.createentity(8, 144, 2, 10, 4); //Big Threadmill, >>>>>> - obj.createentity(48, 144, 2, 8, 4); //Threadmill, >>> - obj.createentity(0, 16, 2, 10, 4); //Big Threadmill, >>>>>> - - - roomname = "Getting Here is Half the Fun"; - result = contents; - break; - } - - case rn(56,45): - { - - static const short contents[] = { - 614,49,0,0,0,0,50,612,614,0,0,0,0,0,0,0,0,0,0,0,50,612,492,492,492,492,614,49,0,0,0,0,0,0,0,0,0,0,612,492, - 614,49,0,0,0,0,50,612,614,0,0,0,0,0,0,0,0,0,0,0,50,612,492,492,492,492,614,49,0,0,0,0,0,0,0,0,0,0,612,492, - 614,49,0,0,0,0,50,612,614,0,0,0,0,0,0,0,0,0,0,0,50,612,492,492,492,492,614,49,0,0,0,0,0,0,0,0,0,0,612,492, - 614,49,0,0,0,0,50,612,614,0,0,0,0,0,0,0,0,0,0,0,50,612,492,492,492,492,614,49,0,0,0,0,0,0,0,0,0,0,612,492, - 614,49,0,0,0,0,50,612,614,0,0,0,0,0,0,0,0,0,0,0,50,612,492,492,492,492,614,49,0,0,0,0,0,0,0,0,0,0,612,492, - 614,49,0,0,0,0,50,612,614,0,0,0,0,0,0,0,0,0,0,0,50,652,653,653,653,653,654,49,0,0,0,0,0,0,0,0,0,0,612,492, - 614,49,0,0,0,0,50,612,614,0,0,0,0,0,0,0,0,0,0,0,0,9,9,9,9,9,9,0,0,0,0,0,0,0,0,0,0,0,612,492, - 614,49,0,0,0,0,50,612,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492, - 614,49,0,0,0,0,50,612,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492, - 614,49,0,0,0,0,50,612,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492, - 614,49,0,0,0,0,50,612,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492, - 614,49,0,0,0,0,50,612,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492, - 614,49,0,0,0,0,50,612,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492, - 614,49,0,0,0,0,50,612,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492, - 614,49,0,0,0,0,50,612,614,8,8,8,8,8,8,8,8,8,8,0,0,0,0,0,0,0,0,0,0,8,8,8,8,8,8,8,8,8,612,492, - 614,49,0,0,0,0,50,612,533,573,573,573,573,573,573,573,573,573,574,49,0,0,0,0,0,0,0,0,50,572,573,573,573,573,573,573,573,573,534,492, - 614,49,0,0,0,0,50,612,492,492,492,492,492,492,492,492,492,492,614,49,0,0,0,0,0,0,0,0,50,612,492,492,492,492,492,492,492,492,492,492, - 614,49,0,0,0,0,50,612,492,492,492,492,492,492,492,492,492,492,614,49,0,0,0,0,0,0,0,0,50,652,494,492,492,492,492,492,492,492,492,492, - 614,49,0,0,0,0,50,612,492,492,492,492,492,492,492,492,492,492,533,574,49,0,0,0,0,0,0,0,0,50,612,492,492,492,492,492,492,492,492,492, - 614,49,0,0,0,0,50,612,492,492,492,492,492,492,492,492,492,492,492,614,49,0,0,0,0,0,0,0,0,50,612,492,492,492,492,492,492,492,492,492, - 614,49,0,0,0,0,50,612,492,492,492,492,492,492,492,492,492,492,492,614,49,0,0,0,0,0,0,0,0,50,652,494,492,492,492,492,492,492,492,492, - 614,49,0,0,0,0,50,612,492,492,492,492,492,492,492,492,492,492,492,533,574,49,0,0,0,0,0,0,0,0,50,612,492,492,492,492,492,492,492,492, - 614,49,0,0,0,0,50,612,492,492,492,492,492,492,492,492,492,492,492,492,614,49,0,0,0,0,0,0,0,0,50,612,492,492,492,492,492,492,492,492, - 614,49,0,0,0,0,50,612,492,492,492,492,492,492,492,492,492,492,492,492,614,49,0,0,0,0,0,0,0,0,50,652,494,492,492,492,492,492,492,492, - 614,49,0,0,0,0,50,612,492,492,492,492,492,492,492,492,492,492,492,492,533,574,49,0,0,0,0,0,0,0,0,50,612,492,492,492,492,492,492,492, - 614,49,0,0,0,0,50,612,492,492,492,492,492,492,492,492,492,492,492,492,492,614,49,0,0,0,0,0,0,0,0,50,612,492,492,492,492,492,492,492, - 614,49,0,0,0,0,50,612,492,492,492,492,492,492,492,492,492,492,492,492,492,614,49,0,0,0,0,0,0,0,0,50,652,494,492,492,492,492,492,492, - 614,49,0,0,0,0,50,612,492,492,492,492,492,492,492,492,492,492,492,492,492,533,574,49,0,0,0,0,0,0,0,0,50,612,492,492,492,492,492,492, - 614,49,0,0,0,0,50,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,49,0,0,0,0,0,0,0,0,50,612,492,492,492,492,492,492, - 614,49,0,0,0,0,50,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,49,0,0,0,0,0,0,0,0,50,612,492,492,492,492,492,492, - }; - - roomname = "Your Bitter Tears... Delicious"; - result = contents; - break; - } - - case rn(56,46): - { - - static const short contents[] = { - 208,49,0,0,0,0,50,206,86,86,86,86,86,86,86,86,86,86,86,86,86,87,248,49,0,0,0,0,0,0,0,0,50,206,86,86,86,86,86,86, - 208,49,0,0,0,0,50,206,86,86,86,86,86,86,86,86,86,86,86,86,87,248,9,0,0,0,0,0,0,0,0,0,50,206,86,86,86,86,86,86, - 208,49,0,0,0,0,50,206,86,86,86,86,86,86,86,86,86,86,86,87,248,9,0,0,0,0,0,0,0,0,0,0,50,206,86,86,86,86,86,86, - 208,49,0,0,0,0,50,206,86,86,86,86,86,86,86,86,86,86,87,248,9,0,0,0,0,0,0,0,0,0,0,0,50,206,86,86,86,86,86,86, - 208,49,0,0,0,0,50,206,86,86,86,86,86,86,86,86,86,87,248,9,0,0,0,0,0,0,0,0,0,0,0,0,50,206,86,86,86,86,86,86, - 208,49,0,0,0,0,50,206,86,86,86,86,86,86,86,86,87,248,9,0,0,0,0,0,0,0,0,0,0,0,0,0,50,206,86,86,86,86,86,86, - 208,49,0,0,0,0,50,206,86,86,86,86,86,86,86,87,248,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,206,86,86,86,86,86,86, - 208,49,0,0,0,0,50,206,86,86,86,86,86,86,87,248,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,206,86,86,86,86,86,86, - 208,49,0,0,0,0,50,206,86,86,86,86,86,87,248,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,206,86,86,86,86,86,86, - 208,49,0,0,0,0,50,206,86,86,86,86,86,208,49,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,206,86,86,86,86,86,86, - 208,49,0,0,0,0,50,206,86,86,86,86,86,208,49,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,206,86,86,86,86,86,86, - 208,49,0,0,0,0,50,206,86,86,86,86,86,208,49,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,206,86,86,86,86,86,86, - 208,49,0,0,0,0,50,206,86,86,86,86,86,208,49,0,0,0,0,0,0,0,0,8,8,0,0,0,0,0,0,0,50,206,86,86,86,86,86,86, - 208,49,0,0,0,0,50,206,86,86,86,86,86,208,49,0,0,0,0,0,0,0,50,166,168,49,0,0,0,0,0,0,50,206,86,86,86,86,86,86, - 208,49,0,0,0,0,50,206,86,86,86,86,86,208,49,0,0,0,0,0,0,0,50,206,208,49,0,0,0,0,0,0,50,206,86,86,86,86,86,86, - 208,49,0,0,0,0,50,206,86,86,86,86,86,208,49,0,0,0,0,0,0,0,50,206,208,49,0,0,0,0,0,0,50,206,86,86,86,86,86,86, - 208,49,0,0,0,0,50,206,86,86,86,86,86,208,49,0,0,0,0,0,0,0,50,206,208,49,0,0,0,0,0,0,50,206,86,86,86,86,86,86, - 208,49,0,0,0,0,50,206,86,86,86,86,86,208,49,0,0,0,0,0,0,0,50,206,208,49,0,0,0,0,0,0,50,206,86,86,86,86,86,86, - 208,49,0,0,0,0,50,206,86,86,86,86,86,208,49,0,0,0,0,0,0,0,50,206,208,49,0,0,0,0,0,0,50,206,86,86,86,86,86,86, - 208,49,0,0,0,0,50,206,86,86,86,86,86,208,49,0,0,0,0,0,0,0,50,206,208,49,0,0,0,0,0,0,50,206,86,86,86,86,86,86, - 208,49,0,0,0,0,50,206,86,86,86,86,86,208,49,0,0,0,0,0,0,0,50,206,208,49,0,0,0,0,0,0,50,206,86,86,86,86,86,86, - 208,49,0,0,0,0,50,206,86,86,86,86,86,208,49,0,0,0,0,0,0,0,50,206,208,49,0,0,0,0,0,0,50,206,86,86,86,86,86,86, - 208,49,0,0,0,0,50,206,86,86,86,86,86,127,168,8,0,0,0,0,0,0,50,206,208,49,0,0,0,0,0,0,50,206,86,86,86,86,86,86, - 208,49,0,0,0,0,50,206,86,86,86,86,86,86,127,168,8,0,0,0,0,0,50,206,127,168,8,0,0,0,0,8,166,128,86,86,86,86,86,86, - 208,49,0,0,0,0,50,206,86,86,86,86,86,86,86,127,168,8,0,0,0,0,50,206,86,127,168,0,0,0,0,166,128,86,86,86,86,86,86,86, - 208,49,0,0,0,0,50,206,86,86,86,86,86,86,86,86,127,168,0,0,0,0,50,206,86,86,208,0,0,0,0,206,86,86,86,86,86,86,86,86, - 208,49,0,0,0,0,50,206,86,86,86,86,86,86,86,86,86,208,0,0,0,0,50,206,86,86,208,0,0,0,0,206,86,86,86,86,86,86,86,86, - 208,49,0,0,0,0,50,206,86,86,86,86,86,86,86,86,86,208,0,0,0,0,50,206,86,86,208,0,0,0,0,206,86,86,86,86,86,86,86,86, - 208,49,0,0,0,0,50,206,86,86,86,86,86,86,86,86,86,208,0,0,0,0,50,206,86,86,208,0,0,0,0,206,86,86,86,86,86,86,86,86, - 208,49,0,0,0,0,50,206,86,86,86,86,86,86,86,86,86,208,0,0,0,0,50,206,86,86,208,0,0,0,0,206,86,86,86,86,86,86,86,86, - }; - - roomname = "Easy Mode Unlocked"; - result = contents; - break; - } - - case rn(56,47): - { - - static const short contents[] = { - 217,49,0,0,0,0,50,215,95,95,95,95,95,95,95,95,95,217,0,0,0,0,50,215,95,95,217,0,0,0,0,215,95,95,95,95,95,95,95,95, - 217,49,0,0,0,0,50,215,95,95,95,95,95,95,95,95,95,217,0,0,0,0,50,215,95,95,217,0,0,0,0,215,95,95,95,95,95,95,95,95, - 217,49,0,0,0,0,50,215,95,95,95,95,95,95,95,95,95,217,0,0,0,0,50,215,95,95,217,0,0,0,0,215,95,95,95,95,95,95,95,95, - 217,49,0,0,0,0,50,215,95,95,95,95,95,95,95,95,95,217,0,0,0,0,50,215,95,95,217,0,0,0,0,215,95,95,95,95,95,95,95,95, - 217,49,0,0,0,0,50,215,95,95,95,95,95,95,95,95,95,217,0,0,0,0,50,215,95,95,217,0,0,0,0,215,95,95,95,95,95,95,95,95, - 217,49,0,0,0,0,50,215,95,95,95,95,95,95,95,95,95,217,0,0,0,0,50,215,95,95,217,0,0,0,0,215,95,95,95,95,95,95,95,95, - 217,49,0,0,0,0,50,215,95,95,95,95,95,95,95,95,95,217,0,0,0,0,50,215,95,95,217,0,0,0,0,215,95,95,95,95,95,95,95,95, - 217,49,0,0,0,0,50,215,95,95,95,95,95,95,95,95,95,217,0,0,0,0,50,215,95,95,217,0,0,0,0,215,95,95,95,95,95,95,95,95, - 217,49,0,0,0,0,50,215,95,95,95,95,95,95,95,95,95,217,0,0,0,0,50,215,95,95,217,0,0,0,0,215,95,95,95,95,95,95,95,95, - 217,49,0,0,0,0,50,215,95,95,95,95,95,95,95,95,95,217,0,0,0,0,50,215,95,95,217,0,0,0,0,215,95,95,95,95,95,95,95,95, - 217,49,0,0,0,0,50,215,95,95,95,95,95,95,95,95,95,217,0,0,0,0,50,215,95,95,217,0,0,0,0,215,95,95,95,95,95,95,95,95, - 217,49,0,0,0,0,50,215,95,95,95,95,95,95,95,95,95,217,0,0,0,0,50,215,95,95,217,0,0,0,0,215,95,95,95,95,95,95,95,95, - 217,49,0,0,0,0,50,215,95,95,95,95,95,95,95,95,95,217,49,0,0,0,50,215,95,95,217,0,0,0,0,215,95,95,95,95,95,95,95,95, - 217,49,0,0,0,0,50,215,95,95,95,95,95,95,95,95,95,217,49,0,0,0,50,215,95,95,217,0,0,0,0,215,95,95,95,95,95,95,95,95, - 217,49,0,0,0,0,50,215,95,95,95,95,95,95,95,95,95,217,49,0,0,0,50,215,95,95,217,0,0,0,0,215,95,95,95,95,95,95,95,95, - 217,49,0,0,0,0,50,215,95,95,95,95,95,95,95,95,95,217,49,0,0,0,50,215,95,95,217,0,0,0,0,215,95,95,95,95,95,95,95,95, - 217,49,0,0,0,0,50,215,95,95,95,95,95,95,95,95,95,217,49,0,0,0,50,215,95,95,217,0,0,0,0,215,95,95,95,95,95,95,95,95, - 217,49,0,0,0,0,50,215,95,95,95,95,95,95,95,95,95,217,49,0,0,0,0,215,95,95,217,0,0,0,0,215,95,95,95,95,95,95,95,95, - 217,49,0,0,0,0,50,215,95,95,95,95,95,95,95,95,95,217,49,0,0,0,0,215,95,95,217,0,0,0,0,215,95,95,95,95,95,95,95,95, - 217,49,0,0,0,0,50,215,95,95,95,95,95,95,95,95,95,217,49,0,0,0,0,215,95,95,217,0,0,0,0,215,95,95,95,95,95,95,95,95, - 217,49,0,0,0,0,50,215,95,95,95,95,95,95,95,95,95,217,49,0,0,0,0,215,95,95,217,0,0,0,0,215,95,95,95,95,95,95,95,95, - 217,49,0,0,0,0,50,215,95,95,95,95,95,95,95,95,95,217,49,0,0,0,0,215,95,95,217,0,0,0,0,215,95,95,95,95,95,95,95,95, - 217,49,0,0,0,0,50,215,95,95,95,95,95,95,95,95,95,217,49,0,0,0,0,215,95,95,217,0,0,0,0,215,95,95,95,95,95,95,95,95, - 217,49,0,0,0,0,50,215,95,95,95,95,95,95,95,95,95,217,49,0,0,0,0,215,95,95,217,8,8,8,8,215,95,95,95,95,95,95,95,95, - 217,49,0,0,0,0,50,215,95,95,95,95,95,95,95,95,95,217,49,0,0,0,0,215,95,95,136,176,176,176,176,137,95,95,95,95,95,95,95,95, - 217,49,0,0,0,0,50,215,95,95,95,95,95,95,95,95,95,217,49,0,0,0,0,215,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95, - 217,49,0,0,0,0,50,215,95,95,95,95,95,95,95,95,95,217,49,0,0,0,0,215,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95, - 217,49,0,0,0,0,50,215,95,95,95,95,95,95,95,95,95,217,49,0,0,0,0,215,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95, - 217,49,0,0,0,0,50,215,95,95,95,95,95,95,95,95,95,217,49,0,0,0,0,215,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95, - 217,49,0,0,0,0,50,215,95,95,95,95,95,95,95,95,95,217,49,0,0,0,0,215,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95, - }; - - roomname = "Vici!"; - result = contents; - break; - } - - case rn(56,48): - { - - static const short contents[] = { - 432,49,0,0,0,0,50,430,310,310,310,310,310,310,310,310,310,432,49,0,0,0,0,430,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310, - 432,49,0,0,0,0,50,430,310,310,310,310,310,310,310,310,310,432,49,0,0,0,0,430,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310, - 432,49,0,0,0,0,50,430,310,310,310,310,310,310,310,310,310,432,49,0,0,0,0,470,312,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310, - 432,49,0,0,0,0,50,430,310,310,310,310,310,310,310,310,310,432,49,0,0,0,0,9,470,312,310,310,310,310,310,310,310,310,310,310,310,310,310,310, - 432,49,0,0,0,0,50,430,310,310,310,310,310,310,310,310,310,432,49,0,0,0,0,0,9,470,312,310,310,310,310,310,310,310,310,310,310,310,310,310, - 432,49,0,0,0,0,50,430,310,310,310,310,310,310,310,310,310,432,49,0,0,0,0,0,0,9,470,471,312,310,310,310,310,310,310,310,310,310,310,310, - 432,49,0,0,0,0,50,430,310,310,310,310,310,310,310,310,310,432,49,0,0,0,0,0,0,0,9,9,470,471,312,310,310,310,310,310,310,310,310,310, - 432,49,0,0,0,0,50,430,310,310,310,310,310,310,310,310,310,432,49,0,0,0,0,0,0,0,0,0,9,9,470,471,312,310,310,310,310,310,310,310, - 432,49,0,0,0,0,50,430,310,310,310,310,310,310,310,310,310,432,49,0,0,0,0,0,0,0,0,0,0,0,9,9,470,312,310,310,310,310,310,310, - 432,49,0,0,0,0,50,430,310,310,310,310,310,310,310,310,310,432,49,0,0,0,0,0,0,0,0,0,0,0,0,0,50,430,310,310,310,310,310,310, - 432,49,0,0,0,0,50,430,310,310,310,310,310,310,310,310,310,432,49,0,0,0,0,0,0,0,0,0,0,0,0,0,50,430,310,310,310,310,310,310, - 432,49,0,0,0,0,50,430,310,310,310,310,310,310,310,310,310,432,49,0,0,0,0,0,0,0,0,0,0,0,0,0,50,430,310,310,310,310,310,310, - 432,49,0,0,0,0,50,430,310,310,310,310,310,310,310,310,310,432,49,0,0,0,0,0,0,0,0,0,0,0,0,50,390,352,310,310,310,310,310,310, - 432,49,0,0,0,0,50,430,310,310,310,310,310,310,310,310,310,351,392,8,8,8,8,0,0,0,0,0,0,0,0,50,430,310,310,310,310,310,310,310, - 432,49,0,0,0,0,50,430,310,310,310,310,310,310,310,310,310,310,351,391,391,391,392,49,0,0,0,0,0,0,0,50,470,471,471,471,312,310,310,310, - 432,49,0,0,0,0,50,430,310,310,310,310,310,310,310,310,310,310,310,310,310,310,432,49,0,0,0,0,0,0,0,0,9,9,9,9,470,312,310,310, - 432,49,0,0,0,0,50,430,310,310,310,310,310,310,310,310,310,310,310,310,310,311,472,49,0,0,0,0,0,0,0,0,0,0,0,0,50,430,310,310, - 432,49,0,0,0,0,50,430,310,310,310,310,310,310,310,310,310,310,310,310,310,432,49,0,0,0,0,0,0,0,0,0,0,0,0,0,50,430,310,310, - 432,49,0,0,0,0,50,430,310,310,310,310,310,310,310,310,310,310,310,310,310,432,49,0,0,0,0,0,0,0,0,0,0,0,0,0,50,430,310,310, - 432,49,0,0,0,0,50,430,310,310,310,310,310,310,310,310,310,310,310,310,310,432,49,0,0,0,0,0,0,0,0,0,0,0,0,0,50,430,310,310, - 432,49,0,0,0,0,50,430,310,310,310,310,310,310,310,310,310,310,310,310,310,351,392,8,8,0,0,0,0,0,0,0,0,0,0,0,50,430,310,310, - 432,49,0,0,0,0,50,430,310,310,310,310,310,310,310,310,310,310,310,310,310,310,351,391,392,8,8,0,0,0,0,0,0,0,0,0,50,430,310,310, - 432,49,0,0,0,0,50,430,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,351,391,392,8,8,0,0,0,0,0,0,0,50,430,310,310, - 432,49,0,0,0,0,50,430,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,351,391,392,8,0,0,0,0,0,0,50,430,310,310, - 432,49,0,0,0,0,50,430,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,351,392,8,0,0,0,0,0,50,430,310,310, - 432,49,0,0,0,0,50,430,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,351,392,8,0,0,0,0,50,430,310,310, - 432,49,0,0,0,0,50,430,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,351,392,0,0,0,0,50,430,310,310, - 432,49,0,0,0,0,50,430,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,432,0,0,0,0,50,430,310,310, - 432,49,0,0,0,0,50,430,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,432,0,0,0,0,50,430,310,310, - 432,49,0,0,0,0,50,430,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,432,0,0,0,0,50,430,310,310, - }; - - roomname = "Vidi"; - result = contents; - break; - } - - case rn(56,49): - { - - static const short contents[] = { - 220,49,0,0,0,0,50,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,0,0,0,0,50,218,98,98, - 220,49,0,0,0,0,50,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,0,0,0,0,50,218,98,98, - 220,49,0,0,0,0,50,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,99,259,259,259,259,259,259,259,259,260,0,0,0,0,50,218,98,98, - 220,49,0,0,0,0,50,218,98,98,98,98,98,98,98,98,98,98,98,98,98,99,260,9,9,9,9,9,9,9,9,9,0,0,0,0,50,218,98,98, - 220,49,0,0,0,0,50,218,98,98,98,98,98,98,98,98,98,98,98,98,98,220,49,0,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,98, - 220,49,0,0,0,0,50,218,98,98,98,98,98,98,98,98,98,98,98,98,98,220,49,0,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,98, - 220,49,0,0,0,0,50,218,98,98,98,98,98,98,98,98,98,98,98,98,98,220,49,0,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,98, - 220,49,0,0,0,0,50,218,98,98,98,98,98,98,98,98,98,98,98,98,98,220,49,0,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,98, - 220,49,0,0,0,0,50,218,98,98,98,98,98,98,98,98,98,98,98,98,99,260,49,0,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,98, - 220,49,0,0,0,0,50,218,98,98,98,98,98,98,98,98,98,98,98,98,220,49,0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,98, - 220,49,0,0,0,0,50,218,98,98,98,98,98,98,98,98,98,98,98,98,220,49,0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,98, - 220,49,0,0,0,0,50,218,98,98,98,98,98,98,98,98,98,98,98,98,220,49,0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,98, - 220,49,0,0,0,0,50,218,98,98,98,98,98,98,98,98,98,98,98,99,260,49,0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,98, - 220,49,0,0,0,0,50,218,98,98,98,98,98,98,98,98,98,98,98,220,49,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,98, - 220,49,0,0,0,0,50,218,98,98,98,98,98,98,98,98,98,98,98,220,49,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,98, - 220,49,0,0,0,0,50,218,98,98,98,98,98,98,98,98,98,98,98,220,49,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,98, - 220,49,0,0,0,0,50,218,98,98,98,98,98,98,98,98,98,98,99,260,49,0,0,0,0,0,0,0,0,0,8,8,8,8,8,8,178,140,98,98, - 220,49,0,0,0,0,50,218,98,98,98,98,98,98,98,98,98,98,220,49,0,0,0,0,0,0,0,0,0,50,178,179,179,179,179,179,140,98,98,98, - 220,49,0,0,0,0,50,218,98,98,98,98,98,98,98,98,98,98,220,49,0,0,0,0,0,0,0,0,0,50,218,98,98,98,98,98,98,98,98,98, - 220,49,0,0,0,0,50,218,98,98,98,98,98,98,98,98,98,98,220,49,0,0,0,0,0,0,0,0,0,50,218,98,98,98,98,98,98,98,98,98, - 220,49,0,0,0,0,50,218,98,98,98,98,98,98,98,98,98,99,260,49,0,0,0,0,0,0,0,0,0,50,258,100,98,98,98,98,98,98,98,98, - 220,49,0,0,0,0,50,218,98,98,98,98,98,98,98,98,98,220,49,0,0,0,0,0,0,0,0,0,0,0,50,218,98,98,98,98,98,98,98,98, - 220,49,0,0,0,0,50,218,98,98,98,98,98,98,98,98,98,220,49,0,0,0,0,0,0,0,0,0,0,0,50,218,98,98,98,98,98,98,98,98, - 220,49,0,0,0,0,50,218,98,98,98,98,98,98,98,98,98,220,49,0,0,0,0,0,0,0,0,0,0,0,50,218,98,98,98,98,98,98,98,98, - 220,49,0,0,0,0,50,218,98,98,98,98,98,98,98,98,99,260,49,0,0,0,0,0,0,0,0,0,0,0,50,258,100,98,98,98,98,98,98,98, - 220,49,0,0,0,0,50,218,98,98,98,98,98,98,98,98,220,49,0,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,98,98,98,98,98,98, - 220,49,0,0,0,0,50,218,98,98,98,98,98,98,98,98,220,49,0,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,98,98,98,98,98,98, - 220,49,0,0,0,0,50,218,98,98,98,98,98,98,98,98,220,49,0,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,98,98,98,98,98,98, - 220,49,0,0,0,0,50,218,98,98,98,98,98,98,98,98,220,49,0,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,98,98,98,98,98,98, - 220,49,0,0,0,0,50,218,98,98,98,98,98,98,98,98,220,49,0,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,98,98,98,98,98,98, - }; - - roomname="Veni"; - result = contents; - break; - } - - case rn(56,50): - { - - static const short contents[] = { - 211,49,0,0,0,0,50,209,89,89,89,89,89,89,89,89,211,49,0,0,0,0,0,0,0,0,0,0,0,0,0,50,209,89,89,89,89,89,89,89, - 211,49,0,0,0,0,50,209,89,89,89,89,89,89,89,89,211,49,0,0,0,0,0,0,0,0,0,0,0,0,0,50,209,89,89,89,89,89,89,89, - 211,49,0,0,0,0,50,209,89,89,89,89,89,89,89,89,211,49,0,0,0,0,0,0,0,0,0,0,0,0,0,50,209,89,89,89,89,89,89,89, - 211,49,0,0,0,0,50,209,89,89,89,89,89,89,89,89,211,49,0,0,0,0,0,0,0,0,0,0,0,0,0,50,209,89,89,89,89,89,89,89, - 211,49,0,0,0,0,50,209,89,89,89,89,89,89,89,89,211,49,0,0,0,0,0,0,0,0,0,0,0,0,0,50,209,89,89,89,89,89,89,89, - 211,49,0,0,0,0,50,209,89,89,89,89,89,89,89,89,211,49,0,0,0,0,0,0,0,0,0,0,0,0,0,50,209,89,89,89,89,89,89,89, - 211,49,0,0,0,0,50,209,89,89,89,89,89,89,89,89,211,49,0,0,0,0,0,0,0,0,0,0,0,0,0,50,209,89,89,89,89,89,89,89, - 211,49,0,0,0,0,50,209,89,89,89,89,89,89,89,89,211,49,0,0,0,0,0,0,0,0,0,0,0,0,0,50,209,89,89,89,89,89,89,89, - 211,49,0,0,0,0,50,209,89,89,89,89,89,89,89,89,211,49,0,0,0,0,0,0,0,0,0,0,0,0,0,50,209,89,89,89,89,89,89,89, - 211,49,0,0,0,0,50,209,89,89,89,89,89,89,89,89,211,49,0,0,0,0,0,0,0,0,0,0,0,0,0,50,209,89,89,89,89,89,89,89, - 211,49,0,0,0,0,50,209,89,89,89,89,89,89,89,89,211,49,0,0,0,0,0,0,0,0,0,0,0,0,0,50,209,89,89,89,89,89,89,89, - 211,49,0,0,0,0,50,209,89,89,89,89,89,89,89,89,211,49,0,0,0,0,0,0,0,0,0,0,0,0,0,50,209,89,89,89,89,89,89,89, - 211,49,0,0,0,0,50,209,89,89,89,89,89,89,89,89,211,49,0,0,0,0,0,0,0,0,0,0,0,0,0,50,209,89,89,89,89,89,89,89, - 211,49,0,0,0,0,50,209,89,89,89,89,89,89,89,89,211,49,0,0,0,0,0,0,0,0,0,0,0,0,0,50,209,89,89,89,89,89,89,89, - 211,49,0,0,0,0,0,249,250,250,250,250,250,250,250,250,251,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,249,250,250,250,250,91,89,89, - 211,49,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,209,89,89, - 211,49,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,209,89,89, - 211,49,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,209,89,89, - 211,49,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,209,89,89, - 211,49,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,209,89,89, - 211,49,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,210,0,0,0,0,0,0,0,0,0,0,0,0,209,89,89, - 130,170,170,170,170,170,171,0,0,0,0,169,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,171,0,0,0,0,209,89,89, - 89,89,89,89,89,89,211,0,0,0,0,249,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,251,0,0,0,0,209,89,89, - 89,89,89,89,89,89,211,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,209,89,89, - 89,89,89,89,89,89,211,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,209,89,89, - 89,89,89,89,89,89,211,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,209,89,89, - 89,89,89,89,89,89,211,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,209,89,89, - 89,89,89,89,89,89,211,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,169,170,170,170,170,170,170,170,131,89,89, - 89,89,89,89,89,89,130,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,131,89,89,89,89,89,89,89,89,89,89, - 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89, - }; - - obj.createentity(224, 144, 9, 5); // (shiny trinket) - obj.createentity(96, 152, 10, 1, 450560); // (savepoint) - - obj.createentity(24, 152, 20, 1); // (terminal) - obj.createblock(5, 24-4, 152, 20, 16, 16); - roomname = "Doing Things The Hard Way"; - result = contents; - break; - } - - //Final section: The overlap - - case rn(53,43): - { - - static const short contents[] = { - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,761,761,761,761,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,496,656,656,656,656,656,656,656,656,656,656,656,656,656,657,680,680,680,680,655,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,497,495, - 495,495,495,617,9,9,9,9,9,9,9,9,9,9,1123,7,7,7,680,680,680,680,7,7,7,1125,9,9,9,9,9,9,9,9,9,9,9,9,615,495, - 656,656,656,657,0,0,0,0,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0,0,0,0,0,0,0,655,656, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 576,576,576,576,576,576,576,576,576,577,8,8,8,8,1120,680,680,680,680,680,680,680,680,680,680,1122,8,8,8,8,575,576,576,576,576,576,576,576,576,576, - 495,495,495,495,495,495,495,495,495,536,576,576,576,576,577,680,680,680,680,680,680,680,680,680,680,575,576,576,576,576,537,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,680,680,680,680,680,680,680,680,680,680,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,680,680,680,680,680,680,680,680,680,680,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,680,680,680,6,6,6,6,680,680,680,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,680,680,680,575,576,576,577,680,680,680,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,680,680,680,655,656,656,657,680,680,680,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,680,680,680,7,7,7,7,680,680,680,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,680,680,680,680,680,680,680,680,680,680,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,680,680,680,680,680,680,680,680,680,680,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,680,680,680,680,680,680,680,680,680,680,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,680,680,680,680,680,680,680,680,680,680,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,680,680,680,680,680,680,680,680,680,680,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,680,680,680,680,680,680,680,680,680,680,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,680,680,680,680,680,680,680,680,680,680,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,841,841,841,841,841,841,841,841,841,841,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - }; - - obj.platformtile = 707; - obj.createentity(272, 40, 2, 14, 2); // Platform - obj.createentity(240, 40, 3, 707); //Disappearing Platform - - if (game.intimetrial && game.timetriallevel > TimeTrial_SPACESTATION1) - { - obj.fatal_top(); - } - roomname = "Exhaust Chute"; - result = contents; - break; - } - - case rn(56,43): - { - - static const short contents[] = { - 301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301, - 301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301, - 462,462,462,462,303,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301, - 9,9,9,9,421,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301, - 0,0,0,0,421,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301, - 0,0,0,0,461,303,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301, - 0,0,0,0,0,421,301,301,301,301,301,301,301,301,301,301,301,301,301,301,302,462,462,462,462,462,462,462,462,462,462,462,462,462,303,301,301,301,301,301, - 0,0,0,0,0,421,301,301,301,301,301,301,301,301,301,301,301,301,302,462,463,704,704,704,704,704,704,704,704,704,704,704,704,704,421,301,301,301,301,301, - 0,0,0,0,0,461,303,301,301,301,301,301,301,301,301,301,302,462,463,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,461,303,301,301,301,301, - 0,0,0,0,0,0,421,301,301,301,301,301,301,301,302,462,463,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,421,301,301,301,301, - 0,0,0,0,0,0,421,301,301,301,301,301,302,462,463,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,461,303,301,301,301, - 0,0,0,0,0,0,461,462,462,462,462,462,463,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,421,301,301,301, - 0,0,0,0,0,0,0,0,824,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,461,303,301,301, - 0,0,0,0,0,0,0,0,824,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,421,301,301, - 0,0,0,0,0,0,0,0,824,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,421,301,301, - 0,0,0,0,0,0,0,0,824,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,421,301,301, - 0,0,0,0,0,0,0,0,824,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,421,301,301, - 0,0,0,0,0,0,0,0,824,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,381,343,301,301, - 382,382,382,382,382,382,382,382,382,382,382,382,383,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,421,301,301,301, - 301,301,301,301,301,301,301,301,301,301,301,301,342,382,383,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,381,343,301,301,301, - 462,462,462,462,462,462,462,462,462,462,462,462,303,301,342,382,383,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,421,301,301,301,301, - 704,704,704,704,704,704,704,704,704,704,704,704,421,301,301,301,342,382,383,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,381,343,301,301,301,301, - 0,0,0,0,0,0,0,0,824,704,704,704,421,301,301,301,301,301,342,382,383,704,704,704,704,704,704,704,704,704,704,704,704,704,421,301,301,301,301,301, - 0,0,0,0,0,0,0,0,864,865,865,865,421,301,301,301,301,301,301,301,342,382,382,382,382,382,382,382,382,382,382,382,382,382,343,301,301,301,301,301, - 0,0,0,0,0,0,0,0,0,0,0,0,421,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301, - 0,0,0,0,0,0,0,0,0,0,0,0,421,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301, - 382,382,382,382,382,382,382,383,0,0,0,0,421,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301, - 301,301,301,301,301,301,301,423,0,0,0,0,421,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301, - 301,301,301,301,301,301,301,423,0,0,0,0,421,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301, - 301,301,301,301,301,301,301,423,0,0,0,0,421,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301, - }; - - obj.createentity(0, 168, 2, 11, 4); //Big Threadmill, <<<<<< - obj.createentity(64, 168, 2, 9, 4); //Threadmill, <<< - obj.createentity(72, 128, 10, 1, 443560); // (savepoint) - - obj.createentity((21 * 8), (9 * 8), 14); //Teleporter! - - if(game.intimetrial) - { - obj.createblock(1, 56+16, 0, 32, 150, 82); - } - else - { - if(!obj.flags[7]) - { - if (game.nocutscenes) - { - obj.flags[7] = true; - game.teleportscript = "levelonecomplete"; - } - else - { - obj.createblock(1, 56, 0, 32, 150, 32); - } - } - } - roomname = "A Wrinkle in Time"; - result = contents; - break; - } - - - case rn(55,43): - { - - static const short contents[] = { - 86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86, - 86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86, - 247,247,247,88,86,86,86,87,247,247,247,247,247,247,247,88,86,86,86,86,86,86,86,86,87,247,247,247,247,247,247,247,88,86,86,86,87,247,247,247, - 9,9,9,206,86,86,86,208,9,9,9,9,9,9,9,206,86,86,86,86,86,86,86,86,208,9,9,9,9,9,9,9,206,86,86,86,208,9,9,9, - 0,0,0,246,247,247,247,248,0,0,0,0,0,0,0,206,86,86,86,86,86,86,86,86,208,0,0,0,0,0,0,0,246,247,247,247,248,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,246,247,247,247,247,247,247,247,247,248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,818,698,698,698,698,820,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,818,698,698,698,698,820,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,818,698,698,698,698,820,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,818,698,698,698,698,820,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,818,698,698,698,698,820,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,858,859,859,859,859,860,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,168,0,0,0,0,0,0,0,0,166,167,167,167,167,167,167,168,0,0,0,0,0,0,0,0, - 86,86,86,86,86,86,86,86,86,87,247,247,247,88,86,208,0,0,0,0,0,0,0,0,206,86,87,247,247,247,88,127,167,168,0,0,0,0,0,0, - 86,86,86,86,86,86,86,86,86,208,0,0,0,206,86,208,0,0,0,0,0,0,0,0,206,86,208,0,0,0,206,86,86,127,167,168,0,0,0,0, - 86,86,86,86,86,86,86,86,86,208,0,0,0,206,86,208,8,8,8,8,8,8,8,8,206,86,208,0,0,0,206,86,86,86,86,127,167,168,0,0, - 86,86,86,86,86,86,86,86,86,208,0,0,0,206,86,127,167,167,167,167,167,167,167,167,128,86,208,0,0,0,206,86,86,86,86,86,86,127,167,167, - 86,86,86,86,86,86,86,86,86,208,779,779,779,206,86,86,86,86,86,86,86,86,86,86,86,86,208,779,779,779,206,86,86,86,86,86,86,86,86,86, - 247,247,247,247,247,247,247,247,247,248,698,698,698,246,247,247,247,247,247,247,247,247,247,247,247,247,248,698,698,698,246,247,247,247,247,247,247,247,247,247, - 0,0,0,0,0,0,0,0,0,0,698,698,698,0,0,0,0,0,0,0,0,0,0,0,0,0,0,698,698,698,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,818,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,820,0,0,0,0,0,0, - 0,0,0,0,0,858,859,859,859,859,859,859,859,859,859,859,859,859,859,859,859,859,859,859,859,859,859,859,859,859,859,859,859,860,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167, - 86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86, - 86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86, - 86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86, - }; - - obj.createentity(0, 168, 2, 11, 4); //Big Threadmill, <<<<<< - obj.createentity(63, 64-16, 1, 3, 4, 64, 0, 256, 204); // Enemy, bounded - obj.createentity(256-28, 80, 1, 2, 4, 64, 0, 256, 204); // Enemy, bounded - obj.createentity(48, 168, 2, 9, 4); //Threadmill, <<< - obj.createentity(104, 168, 2, 11, 4); //Big Threadmill, <<<<<< - obj.createentity(152, 168, 2, 11, 4); //Big Threadmill, <<<<<< - obj.createentity(240, 168, 2, 11, 4); //Big Threadmill, <<<<<< - obj.createentity(288, 168, 2, 9, 4); //Threadmill, <<< - obj.createentity(160 - 48, 184 - 8, 1, 3, 5);// , 160, 0, 320, 240); // Enemy, bounded - obj.createentity(160 - 28 + 48, 184 - 8, 1, 2, 5);// , 0, 0, 160, 240); // Enemy, bounded - roomname = "Brass Sent Us Under The Top"; - result = contents; - break; - } - - case rn(54,43): - { - - static const short contents[] = { - 507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,629,0,0,0,0,0,0,627,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507, - 507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,629,0,0,0,0,0,0,627,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507, - 507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,629,0,0,0,0,0,0,667,668,509,507,507,507,507,508,668,668,668,668,668,668,668,668,668,668, - 507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,629,0,0,0,0,0,0,9,9,627,507,507,507,507,629,9,9,9,9,9,9,9,9,9,9, - 507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,629,0,0,0,0,0,0,0,0,667,668,668,668,668,669,0,0,0,0,0,0,0,0,0,0, - 668,668,668,668,668,668,668,668,509,507,507,507,507,507,507,629,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,627,507,507,507,507,507,507,629,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,627,507,507,507,507,507,507,629,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,627,507,507,507,507,507,507,629,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,627,507,507,507,507,507,507,629,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 588,588,589,0,0,769,770,770,627,507,507,507,507,507,507,629,770,770,771,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 507,507,629,0,0,809,689,689,627,507,507,507,507,507,507,629,689,689,811,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 507,507,629,0,0,809,689,689,627,507,507,507,507,507,507,629,689,689,811,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 507,507,629,0,0,809,689,689,627,507,507,507,507,507,507,629,689,689,811,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 507,507,629,0,0,809,689,689,627,507,507,507,507,507,507,548,588,588,588,588,589,0,0,0,0,0,0,0,0,0,0,0,0,587,588,588,588,588,588,588, - 507,507,629,0,0,809,689,689,627,507,507,507,507,507,507,507,507,507,507,507,629,0,0,0,0,0,0,0,0,0,0,0,0,627,507,507,507,507,507,507, - 507,507,629,0,0,809,689,689,627,507,507,507,507,507,507,507,507,507,507,507,629,0,0,0,0,0,0,0,0,0,0,0,0,627,507,507,507,507,507,507, - 507,507,629,0,0,809,689,689,627,507,507,507,507,507,507,507,507,507,507,507,629,8,8,8,8,8,8,8,8,8,8,8,8,627,507,507,507,507,507,507, - 507,507,629,0,0,809,689,689,627,507,507,507,507,507,507,507,507,507,507,507,548,588,588,588,588,588,588,588,588,588,588,588,588,549,507,507,507,507,507,507, - 507,507,629,0,0,809,689,689,627,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507, - 507,507,629,0,0,809,689,689,667,668,668,668,668,668,668,668,668,668,668,668,668,668,668,668,668,668,668,668,668,668,668,668,668,668,668,668,668,668,668,668, - 507,507,629,0,0,809,689,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 507,507,629,0,0,809,689,689,689,689,689,689,689,689,689,689,689,689,811,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 507,507,629,0,0,809,689,689,689,689,689,689,689,689,689,689,689,689,811,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 507,507,629,0,0,849,850,850,850,850,850,850,850,850,850,850,850,850,851,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 507,507,629,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 507,507,548,588,588,588,588,588,588,588,588,588,588,588,588,588,588,588,588,588,588,588,588,588,588,588,588,588,588,588,588,588,588,588,588,588,588,588,588,588, - 507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507, - 507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507, - 507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507, - }; - - obj.createentity(64, 168, 2, 11, 4); //Big Threadmill, <<<<<< - obj.createentity(128, 168, 2, 11, 4); //Big Threadmill, <<<<<< - obj.createentity(192, 168, 2, 11, 4); //Big Threadmill, <<<<<< - obj.createentity(256, 168, 2, 11, 4); //Big Threadmill, <<<<<< - obj.createentity(32+4, 48, 10, 0, 443540); // (savepoint) - obj.createentity(208-4, 48, 1, 0, 3, 104, 40, 324, 136); // Enemy, bounded - obj.createentity(136 + 4, 96, 10, 1, 443541); // (savepoint) - - roomname = "The Tomb of Mad Carew"; - result = contents; - break; - } - - case rn(52,43): - { - - static const short contents[] = { - 310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,432,0,0,812,692,692,692,692,692,430,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310, - 310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,432,0,0,812,692,692,692,692,692,430,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310, - 471,471,471,471,471,471,471,471,471,471,471,471,471,471,471,472,0,0,812,692,692,692,692,692,430,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,812,692,692,692,692,692,430,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,812,692,692,692,692,692,430,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,812,692,692,692,692,692,430,310,310,310,311,471,471,471,471,471,471,471,471,471,471,471, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,812,692,692,692,692,692,430,310,310,310,432,692,692,692,692,692,692,692,814,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,852,853,853,853,853,853,430,310,310,310,432,853,853,853,853,853,853,853,854,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,430,310,310,310,432,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,430,310,310,310,432,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,430,310,310,310,432,0,0,0,0,0,0,390,391,391,391,391, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,430,310,310,310,432,0,0,0,0,0,0,430,310,310,310,310, - 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,390,391,391,391,391,391,391,391,352,310,310,310,432,0,0,0,0,0,0,430,310,310,310,310, - 391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,352,310,310,310,310,310,310,310,310,310,310,310,432,0,0,0,0,0,0,430,310,310,310,310, - 310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,432,0,0,0,0,0,0,430,310,310,310,310, - 471,471,471,471,471,471,312,310,310,311,471,471,312,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,432,0,0,0,0,0,0,430,310,310,310,310, - 9,9,9,9,9,9,430,310,310,432,9,9,430,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,432,0,0,0,0,0,0,430,310,310,310,310, - 0,0,0,0,0,0,470,471,471,472,0,0,430,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,432,0,0,0,0,0,0,430,310,310,310,310, - 0,0,0,0,0,0,0,0,0,0,0,0,430,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,432,0,0,0,0,0,0,430,310,310,310,310, - 0,0,0,0,0,0,0,0,0,0,0,0,430,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,432,0,0,0,0,0,0,430,310,310,310,310, - 0,0,0,0,0,0,0,0,0,0,0,0,430,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,432,0,0,0,0,0,0,430,310,310,310,310, - 0,0,0,0,0,0,0,0,0,0,0,0,430,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,432,0,0,0,0,0,0,430,310,310,310,310, - 0,0,0,0,0,0,0,0,0,0,772,773,430,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,432,0,0,0,0,0,0,430,310,310,310,310, - 0,0,0,0,0,0,0,0,0,0,812,692,430,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,432,0,0,0,0,0,0,430,310,310,310,310, - 0,0,0,0,0,0,0,0,0,0,812,692,430,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,432,0,0,0,0,0,0,430,310,310,310,310, - 0,0,0,0,0,0,0,0,0,0,812,692,430,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,432,0,0,0,0,0,0,430,310,310,310,310, - 391,391,391,391,392,0,0,0,0,0,812,692,430,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,432,0,0,0,0,0,0,430,310,310,310,310, - 310,310,310,310,432,0,0,0,0,0,812,692,430,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,432,0,0,0,0,0,0,430,310,310,310,310, - 310,310,310,310,432,0,0,0,0,0,812,692,430,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,432,0,0,0,0,0,0,430,310,310,310,310, - 310,310,310,310,432,0,0,0,0,0,812,692,430,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,432,0,0,0,0,0,0,430,310,310,310,310, - }; - - obj.createentity(56, 144, 10, 0, 443520); // (savepoint) - obj.createentity(152, 80, 10, 1, 443521); // (savepoint) - roomname = "The Sensible Room"; - result = contents; - break; - } - - case rn(51,43): - { - - static const short contents[] = { - 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89, - 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89, - 250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 8,8,8,8,8,8,8,8,8,8,8,8,169,170,170,170,170,170,170,170,170,170,170,170,170,170,170,171,8,8,8,8,8,8,8,8,8,8,8,8, - 170,170,170,170,170,170,170,170,170,170,170,170,131,89,89,89,89,89,89,89,89,89,89,89,89,89,89,130,170,170,170,170,170,170,170,170,170,170,170,170, - 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89, - 250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,91,90,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250, - 9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,249,251,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170, - 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89, - 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89, - 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89, - }; - - obj.createentity(0, -200, 1, 16, 6, -64, -500, 320 + 64, 340); - roomname = "B-B-B-Busted"; - result = contents; - break; - } - - - case rn(50,43): - { - - static const short contents[] = { - 286,286,286,286,286,408,689,689,811,0,0,0,406,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, - 286,286,286,286,286,408,689,689,811,0,0,0,406,287,447,447,447,447,288,286,286,286,286,286,286,287,447,447,447,447,288,286,286,286,286,286,286,286,286,286, - 286,286,286,286,286,408,689,689,811,0,0,0,446,448,9,9,9,9,446,447,447,447,447,447,447,448,9,9,9,9,446,447,447,447,447,447,447,447,447,447, - 286,286,286,286,286,408,689,689,811,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 286,286,286,286,286,408,689,689,811,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 286,286,286,286,286,408,689,689,811,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 286,286,286,286,286,408,689,689,811,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 286,286,286,286,286,408,850,850,851,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 286,286,286,286,286,327,367,367,367,367,367,367,367,367,367,367,367,367,367,368,8,8,8,8,366,367,367,367,367,367,367,368,8,8,8,8,8,8,8,8, - 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,327,367,367,367,367,328,286,286,286,286,286,286,327,367,367,367,367,367,367,367,367, - 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, - 447,447,447,447,288,286,286,287,447,447,447,447,288,286,286,287,447,447,447,447,288,286,286,287,447,447,447,447,288,286,286,287,447,447,447,447,447,447,447,447, - 9,9,9,9,446,447,447,448,9,9,9,9,446,447,447,448,9,9,9,9,446,447,447,448,9,9,9,9,446,447,447,448,9,9,9,9,9,9,9,9, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 367,367,367,368,8,8,8,8,366,367,367,368,8,8,8,8,366,367,367,368,8,8,8,8,366,367,367,368,8,8,8,8,366,367,367,367,367,367,367,367, - 286,286,286,327,367,367,367,367,328,286,286,327,367,367,367,367,328,286,286,327,367,367,367,367,328,286,286,327,367,367,367,367,328,286,286,286,286,286,286,286, - 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, - 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, - }; - - obj.createentity(280, 192, 10, 1, 443500); // (savepoint) - obj.createentity(64, 80, 10, 1, 443501); // (savepoint) - - if(!game.nocutscenes) - { - obj.createblock(1, 0, 0, 112, 112, 8); - } - roomname = "V Stitch"; - result = contents; - break; - } - - - case rn(49,43): - { - - //No const here... - static short contents[] = { - 492,614,680,680,680,680,652,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,654,680,680,802,0,0,0,612,492,492,492,492,492, - 492,614,680,680,680,680,680,802,0,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,612,492,492,492,492,492, - 492,614,680,680,680,680,680,802,0,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,612,492,492,492,492,492, - 492,614,680,680,680,680,680,802,0,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,612,492,492,492,492,492, - 492,614,680,680,680,680,680,802,0,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,612,492,492,492,492,492, - 492,614,680,680,680,680,680,802,0,0,0,0,0,0,0,800,680,680,680,6,6,6,6,6,6,6,6,6,6,6,1122,8,8,8,612,492,492,492,492,492, - 492,614,680,680,680,680,680,802,0,0,0,0,0,0,0,840,841,841,841,572,573,573,573,573,573,573,573,573,573,573,573,573,573,573,534,492,492,492,492,492, - 492,614,680,680,680,680,680,802,0,0,0,0,0,0,0,0,0,0,0,612,492,492,493,653,653,653,653,653,653,653,653,653,653,653,653,653,653,494,492,492, - 492,614,680,680,680,680,680,802,0,0,0,0,0,0,0,0,0,0,0,652,653,653,654,9,9,9,9,9,9,9,9,9,9,9,9,9,9,612,492,492, - 492,533,573,573,573,573,573,573,573,573,574,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492, - 492,492,492,492,492,492,492,492,492,492,533,573,573,573,574,0,0,0,0,572,573,573,574,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,612,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,612,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,612,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,612,492,492,614,0,0,0,0,8,8,8,8,8,8,0,0,0,0,612,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,612,492,492,614,0,0,0,0,572,573,573,573,573,574,0,0,0,0,652,653,653, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,612,492,492,614,0,0,0,0,612,493,653,653,653,654,0,0,0,0,9,9,9, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,612,492,492,614,0,0,0,0,612,614,0,0,0,0,0,0,0,0,0,0,0, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,8,8,8,8,612,492,492,614,0,0,0,0,612,614,0,0,0,0,0,0,0,0,0,0,0, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,533,573,573,573,573,534,492,492,533,573,573,573,573,534,614,0,0,0,0,0,0,0,0,0,0,0, - 653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,654,0,0,0,0,0,0,0,0,0,0,0, - 680,680,680,680,680,680,680,802,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 680,680,680,680,680,680,680,802,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 841,841,841,841,841,841,841,842,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, - }; - - //Remove spikes in modes where the player shouldn't kill themselves - int spikevalue = (game.nodeathmode || (game.intimetrial && !game.translator_exploring)) ? 0 : 9; - for (int i = 23; i < 23+14; i++) - { - contents[i + 8*40] = spikevalue; - } - - obj.platformtile = 747; - obj.createentity(120, 72, 3, 747); //Disappearing Platform - obj.createentity(120, 112, 3, 747); //Disappearing Platform - obj.createentity(120, 128, 3, 747); //Disappearing Platform - obj.createentity(88, 72, 2, 15, 4); // Platform - obj.createentity(192, 128, 9, 6); // (shiny trinket) - obj.createentity(240, 136, 10, 0, 443490); // (savepoint) - roomname = "Prize for the Reckless"; - if(game.nodeathmode) - { - roomname = "I Can't Believe You Got This Far"; - roomname_special = true; - } - else if (game.intimetrial && !game.translator_exploring) - { - roomname = "Imagine Spikes There, if You Like"; - roomname_special = true; - } - result = contents; - break; - } - - case rn(48,43): - { - - static const short contents[] = { - 89,89,211,695,695,695,695,209,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89, - 89,89,211,695,695,695,695,209,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89, - 89,89,211,695,695,695,695,249,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,91,89,89, - 89,89,211,695,695,695,695,695,695,817,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,815,695,695,695,695,695,695,209,89,89, - 89,89,211,695,695,695,695,695,695,817,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,815,695,695,695,695,695,695,209,89,89, - 89,89,211,695,695,695,695,695,695,817,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,815,695,695,695,695,695,695,209,89,89, - 89,89,211,695,695,695,695,695,695,817,0,0,0,169,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,171,695,695,695,695,209,89,89, - 89,89,211,695,695,695,695,695,695,817,0,0,0,209,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,211,695,695,695,695,209,89,89, - 89,89,211,695,695,695,695,695,695,817,0,0,0,209,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,211,695,695,695,695,209,89,89, - 89,89,211,695,695,695,695,695,695,817,0,0,0,249,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,251,695,695,695,695,209,89,89, - 89,89,211,695,695,695,695,695,695,817,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,695,695,695,209,89,89, - 89,89,211,695,695,695,695,695,695,817,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,815,695,695,695,695,695,695,209,89,89, - 89,89,211,695,695,695,695,695,695,817,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,815,695,695,695,695,695,695,209,89,89, - 89,89,211,695,695,695,695,695,695,817,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,815,695,695,695,695,695,695,209,89,89, - 89,89,211,856,856,856,856,856,856,857,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,815,695,695,695,695,695,695,209,89,89, - 89,89,211,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,815,695,695,695,695,695,695,209,89,89, - 89,89,211,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,815,695,695,695,695,695,695,209,89,89, - 89,89,211,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,815,695,695,695,695,695,695,209,89,89, - 89,89,211,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,815,695,695,695,695,695,695,209,89,89, - 89,89,211,0,0,0,0,169,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,171,0,0,0,815,695,695,695,695,695,695,209,89,89, - 89,89,211,0,0,0,0,209,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,211,0,0,0,815,695,695,695,695,695,695,249,250,250, - 89,89,211,0,0,0,0,209,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,211,0,0,0,815,695,695,695,695,695,695,695,695,695, - 89,89,211,0,0,0,0,249,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,251,0,0,0,815,695,695,695,695,695,695,695,695,695, - 89,89,211,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,855,856,856,856,856,856,856,856,856,856, - 89,89,211,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 89,89,211,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 89,89,130,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170, - 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89, - 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89, - 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89, - }; - - obj.createentity(152, 32, 10, 1, 443480); // (savepoint) - obj.createentity(152, 184, 10, 0, 443481); // (savepoint) - obj.createentity(272, 120, 1, 2, 8); // Enemy - obj.createentity(32, 96, 1, 3, 8); // Enemy - obj.createentity(104, 80, 2, 10, 4); //Big Threadmill, >>>>>> - obj.createentity(168, 80, 2, 10, 4); //Big Threadmill, >>>>>> - obj.createentity(232, 80, 2, 8, 4); //Threadmill, >>> - obj.createentity(56, 144, 2, 10, 4); //Big Threadmill, >>>>>> - obj.createentity(120, 144, 2, 10, 4); //Big Threadmill, >>>>>> - obj.createentity(184, 144, 2, 8, 4); //Threadmill, >>> - roomname = "A Deception"; - result = contents; - break; - } - - case rn(48,42): - { - - static const short contents[] = { - 310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310, - 310,310,310,310,310,310,310,310,311,471,471,471,471,471,471,312,310,310,310,310,311,471,471,471,471,471,471,312,310,310,310,310,310,310,310,310,310,310,310,310, - 310,310,310,310,310,310,310,310,432,9,9,9,9,9,9,430,310,310,310,310,432,9,9,9,9,9,9,430,310,310,310,310,311,471,471,471,471,471,471,471, - 310,310,310,310,310,310,310,310,432,0,0,0,0,0,0,430,310,310,310,310,432,0,0,0,0,0,0,430,310,310,310,310,432,0,0,0,0,0,0,0, - 310,310,310,310,310,310,310,310,432,0,0,0,0,0,0,430,310,310,310,310,432,0,0,0,0,0,0,430,310,310,310,310,432,0,0,0,0,0,0,0, - 310,310,310,310,310,310,310,310,432,774,0,0,0,0,0,430,311,471,471,471,472,0,0,0,0,0,0,430,311,471,471,471,472,0,0,0,0,0,0,0, - 310,310,310,310,310,310,310,310,432,814,0,0,0,0,0,430,432,9,9,9,9,0,0,0,0,0,0,430,432,9,9,9,9,0,0,0,0,0,0,0, - 310,310,310,310,310,310,311,471,472,814,0,0,0,0,0,430,432,0,0,0,0,0,0,0,0,0,0,430,432,0,0,0,0,0,0,0,0,0,0,0, - 310,310,310,310,310,310,432,692,692,814,0,0,0,0,0,470,472,0,0,0,0,0,0,0,0,0,0,470,472,0,0,0,0,0,0,0,0,390,391,391, - 310,310,310,310,310,310,432,692,692,814,0,0,0,0,0,431,9,0,0,0,0,0,0,0,0,0,0,431,9,0,0,0,0,0,0,0,0,430,310,310, - 310,310,310,310,310,310,432,692,692,814,0,0,0,0,0,9,0,0,0,0,0,0,0,0,0,0,0,9,0,0,772,773,773,773,773,773,773,430,310,310, - 310,310,310,310,310,310,432,692,692,814,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,812,692,692,692,692,692,692,430,310,310, - 310,310,310,310,310,310,432,692,692,814,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,812,692,692,692,692,692,692,430,310,310, - 310,310,310,310,310,310,432,692,692,814,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,812,692,692,692,692,692,692,430,310,310, - 310,310,310,310,310,310,432,692,692,814,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,812,692,692,692,692,692,692,430,310,310, - 310,310,310,310,310,310,432,692,692,814,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,812,692,692,692,692,692,692,430,310,310, - 310,310,310,310,310,310,432,692,692,814,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,812,692,692,692,692,692,692,430,310,310, - 310,310,310,310,310,310,432,692,692,814,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,812,692,692,692,692,692,692,430,310,310, - 310,310,310,310,310,310,432,692,692,814,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,812,692,692,692,692,692,692,430,310,310, - 310,310,310,310,310,310,432,692,692,814,0,0,0,0,0,0,0,0,0,0,0,431,8,0,0,0,0,0,0,0,812,692,692,692,692,692,692,430,310,310, - 310,310,311,471,471,471,472,692,692,814,0,0,0,0,0,0,0,0,0,0,0,390,392,0,0,0,0,0,0,0,812,692,692,692,692,692,692,430,310,310, - 310,310,432,692,692,692,692,692,692,814,0,0,0,0,0,0,0,0,0,0,0,430,432,0,0,0,0,0,0,0,812,692,692,692,692,390,391,352,310,310, - 310,310,432,692,692,692,692,692,692,814,0,8,8,8,8,0,0,0,0,0,0,430,432,8,8,8,8,0,0,0,812,692,692,692,692,430,310,310,310,310, - 310,310,432,692,692,692,692,692,692,814,0,390,391,391,392,0,0,0,0,0,0,430,351,391,391,391,392,0,0,0,852,853,853,853,853,430,310,310,310,310, - 310,310,432,692,692,692,692,692,692,814,0,430,310,310,432,0,0,0,0,0,0,430,310,310,310,310,432,0,0,0,0,0,0,0,0,430,310,310,310,310, - 310,310,432,692,692,692,692,692,692,814,0,430,310,310,432,0,0,0,0,0,0,430,310,310,310,310,432,0,0,0,0,0,0,0,0,430,310,310,310,310, - 310,310,432,692,692,692,692,390,391,391,391,352,310,310,432,8,8,8,8,8,8,430,310,310,310,310,432,8,8,8,8,8,8,8,8,430,310,310,310,310, - 310,310,432,692,692,692,692,430,310,310,310,310,310,310,351,391,391,391,391,391,391,352,310,310,310,310,351,391,391,391,391,391,391,391,391,352,310,310,310,310, - 310,310,432,692,692,692,692,430,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310, - 310,310,432,692,692,692,692,430,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310, - }; - - obj.platformtile = 239; - obj.createentity(88, 112, 2, 0, 4, 88, 64, 264, 168); // Platform, bounded - obj.createentity(136, 112, 2, 1, 4, 88, 64, 264, 168); // Platform, bounded - obj.createentity(184, 112, 2, 0, 4, 88, 64, 264, 168); // Platform, bounded - obj.createentity(232, 112, 2, 1, 4, 88, 64, 264, 168); // Platform, bounded - obj.createentity(56, 64, 10, 0, 442480); // (savepoint) - obj.createentity(280, 152, 10, 1, 442481); // (savepoint) - - roomname = "Down Under"; - result = contents; - break; - } - - case rn(49,42): - { - - static const short contents[] = { - 295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,417,0,0,0,818,698,698,415,295,295,295,295,295, - 295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,417,0,0,0,818,698,698,415,295,295,295,295,295, - 456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,297,295,295,295,295,295,417,0,0,0,818,698,698,415,295,295,295,295,295, - 0,0,0,818,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,415,295,295,295,295,295,417,0,0,0,818,698,698,415,295,295,295,295,295, - 0,0,0,818,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,415,295,295,295,295,295,417,0,0,0,818,698,698,415,295,295,295,295,295, - 0,0,0,858,859,859,859,859,859,859,859,859,859,859,859,859,859,859,859,859,859,415,295,295,295,295,295,417,0,0,0,818,698,698,415,295,295,295,295,295, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295,295,295,417,0,0,0,818,698,698,415,295,295,295,295,295, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295,295,295,417,0,0,0,818,698,698,415,295,295,295,295,295, - 376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,377,0,0,0,0,415,295,295,295,295,295,417,0,0,0,818,698,698,415,295,295,295,295,295, - 295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,417,0,0,0,0,415,295,295,295,295,295,417,0,0,0,818,698,698,415,295,295,295,295,295, - 295,295,295,295,295,295,295,295,295,296,456,456,456,456,456,456,457,0,0,0,0,415,295,295,295,295,295,417,0,0,0,818,698,698,415,295,295,295,295,295, - 295,295,295,295,295,295,295,295,295,417,9,9,9,9,9,9,9,0,0,0,0,415,295,295,295,295,295,417,0,0,0,818,698,698,415,295,295,295,295,295, - 295,296,456,456,456,456,456,456,456,457,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295,295,295,417,0,0,0,818,698,698,415,295,295,295,295,295, - 295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295,295,295,417,0,0,0,818,698,698,415,295,295,295,295,295, - 295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295,295,295,417,0,0,0,818,698,698,415,295,295,295,295,295, - 295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295,295,295,417,0,0,0,818,698,698,415,295,295,295,295,295, - 295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295,295,295,417,0,0,0,818,698,698,415,295,295,295,295,295, - 295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295,295,295,417,0,0,0,818,698,698,415,295,295,295,295,295, - 295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295,295,295,417,0,0,0,858,859,859,415,295,295,295,295,295, - 295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295,295,295,417,0,0,0,0,0,0,415,295,295,295,295,295, - 295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295,295,295,417,0,0,0,0,0,0,415,295,295,295,295,295, - 295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,778,779,779,779,779,779,415,295,295,295,295,295,417,779,779,779,780,0,0,415,295,295,295,295,295, - 295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,818,698,698,698,698,698,415,295,295,295,295,295,417,698,698,698,820,0,0,415,295,295,295,295,295, - 295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295,295,295,417,698,698,698,820,0,0,415,295,295,295,295,295, - 295,417,0,0,0,0,0,0,0,0,0,0,0,375,376,376,376,376,376,376,376,337,295,295,295,295,295,417,698,698,698,820,0,0,415,295,295,295,295,295, - 295,417,0,0,0,0,8,8,8,8,8,8,8,415,295,295,295,295,295,295,295,295,295,295,295,295,295,417,698,698,698,820,0,0,415,295,295,295,295,295, - 295,417,0,0,0,0,375,376,376,376,376,376,376,337,295,295,295,295,295,295,295,295,295,295,295,295,295,417,698,698,698,820,0,0,415,295,295,295,295,295, - 295,417,779,779,779,779,415,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,417,698,698,698,820,0,0,415,295,295,295,295,295, - 295,417,698,698,698,698,415,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,417,698,698,698,820,0,0,415,295,295,295,295,295, - 295,417,698,698,698,698,415,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,417,698,698,698,820,0,0,415,295,295,295,295,295, - }; - - obj.createentity(16, 104, 2, 10, 4); //Big Threadmill, >>>>>> - obj.createentity(104, 184, 2, 11, 4); //Big Threadmill, <<<<<< - obj.createentity(144, 168, 10, 1, 442490); // (savepoint) - obj.createentity(24, 112, 10, 0, 442491); // (savepoint) - roomname = "Shenanigan"; - result = contents; - break; - } - - case rn(49,41): - { - - static const short contents[] = { - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, - 650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,491,489,489,489,489,489, - 0,0,0,0,0,0,0,0,809,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,609,489,489,489,489,489, - 0,0,0,0,0,0,0,0,809,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,609,489,489,489,489,489, - 0,0,0,0,0,0,0,0,809,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,609,489,489,489,489,489, - 0,0,0,0,0,0,0,0,849,850,850,850,850,850,850,850,850,850,850,850,850,850,850,850,850,850,850,850,850,850,850,850,850,850,609,489,489,489,489,489, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489, - 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,0,0,0,0,0,0,609,489,489,489,489,489, - 570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,571,0,0,0,769,770,770,609,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,809,689,689,609,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,809,689,689,609,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,809,689,689,609,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,809,689,689,609,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,809,689,689,609,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,809,689,689,609,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,809,689,689,609,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,809,689,689,609,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,809,689,689,609,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,809,689,689,609,489,489,489,489,489, - 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,809,689,689,609,489,489,489,489,489, - }; - - obj.createentity(192, 88, 10, 0, 441490); // (savepoint) - - if(!game.intimetrial || game.translator_exploring) - { - if(game.companion==0 && !obj.flags[10] && !game.crewstats[2]) //also need to check if he's rescued in a previous game - { - obj.createentity(42, 86, 16, 0); - obj.createblock(1, 0, 0, 140, 240, 34); - } - } - roomname = "Frown Upside Down"; - result = contents; - break; - } - - case rn(48,41): - { - - static const short contents[] = { - 298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298, - 298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298, - 298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298, - 298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298, - 298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298, - 298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298, - 298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298, - 298,298,298,298,298,298,299,459,459,459,459,459,459,459,300,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298, - 298,298,298,298,299,459,460,683,683,683,683,683,683,683,458,459,300,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298, - 298,298,298,299,460,683,683,683,683,683,683,683,683,683,683,683,458,300,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298, - 298,298,298,420,683,683,683,683,683,683,683,683,683,683,683,683,683,458,459,459,459,459,459,459,459,459,459,459,459,459,459,459,459,459,459,459,459,459,459,459, - 298,298,298,420,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,805,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 298,298,298,420,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,805,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 298,298,298,420,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,805,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 298,298,298,420,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,805,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 298,298,298,420,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,805,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 298,298,298,420,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,805,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 298,298,298,420,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,805,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,8,8, - 298,298,298,420,683,683,683,683,683,683,683,683,683,683,683,683,683,378,379,379,380,0,0,0,0,0,0,0,0,0,0,0,0,0,8,8,8,378,379,379, - 298,298,298,339,380,683,683,683,683,683,683,683,683,683,683,683,378,340,298,298,420,0,0,0,0,0,0,0,0,0,0,8,8,8,378,379,379,340,298,298, - 298,298,298,298,339,379,380,683,683,683,683,683,683,683,378,379,340,298,298,298,420,0,0,0,0,0,0,0,8,8,8,378,379,379,340,298,298,298,298,298, - 298,298,298,298,298,298,339,379,379,379,379,379,379,379,340,298,298,298,298,298,420,0,0,0,0,8,8,8,378,379,379,340,298,298,298,298,298,298,298,298, - 298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,420,8,8,8,8,378,379,379,340,298,298,298,298,298,298,298,298,298,298,298, - 298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,339,379,379,379,379,340,298,298,298,298,298,298,298,298,298,298,298,298,298,298, - 298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298, - 298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298, - 298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298, - 298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298, - 298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298, - 298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298, - }; - - obj.createentity((5 * 8) - 4, (8 * 8) + 4, 14); //Teleporter! - - if(game.intimetrial) - { - obj.createblock(1, 280, 0, 32, 240, 82); - } - roomname = "Energize"; - result = contents; - break; - } - - case rn(53,42): - { - - static const short contents[] = { - 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, - 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, - 453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453, - 0,0,0,818,698,698,698,698,698,698,698,698,698,698,698,820,0,0,9,9,9,9,0,0,818,698,698,698,698,698,698,698,698,698,698,698,820,0,0,0, - 0,0,0,818,698,698,698,698,698,698,698,698,698,698,698,820,0,0,0,0,0,0,0,0,818,698,698,698,698,698,698,698,698,698,698,698,820,0,0,0, - 0,0,0,818,698,698,698,698,698,698,698,698,698,698,698,820,0,0,0,0,0,0,0,0,818,698,698,698,698,698,698,698,698,698,698,698,820,0,0,0, - 0,0,0,818,698,698,698,698,698,698,698,698,698,698,698,820,0,0,0,0,0,0,0,0,818,698,698,698,698,698,698,698,698,698,698,698,820,0,0,0, - 0,0,0,818,698,698,698,698,698,698,698,698,698,698,698,820,0,0,0,0,0,0,0,0,818,698,698,698,698,698,698,698,698,698,698,698,820,0,0,0, - 0,0,0,818,698,698,698,698,698,698,698,698,698,698,698,820,0,0,0,0,0,0,0,0,818,698,698,698,698,698,698,698,698,698,698,698,820,0,0,0, - 0,0,0,818,698,698,698,698,698,698,698,698,698,698,698,820,0,0,0,0,0,0,0,0,818,698,698,698,698,698,698,698,698,698,698,698,820,0,0,0, - 0,0,0,818,698,698,698,698,698,698,698,698,698,698,698,820,0,0,0,0,0,0,0,0,818,698,698,698,698,698,698,698,698,698,698,698,820,0,0,0, - 0,0,0,818,698,698,698,698,698,698,698,698,698,698,698,820,0,0,0,0,0,0,0,0,818,698,698,698,698,698,698,698,698,698,698,698,820,0,0,0, - 0,0,0,858,859,859,859,859,859,859,859,859,859,859,859,860,0,0,0,0,0,0,0,0,858,859,859,859,859,859,859,859,859,859,859,859,860,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,0,0,0,0,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, - 373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,374,0,0,0,0,372,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373, - 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, - 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, - 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, - 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, - 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, - 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, - 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, - 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, - 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, - 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, - }; - - obj.createentity(40, 24, 10, 0, 442530); // (savepoint) - obj.createentity(264, 24, 10, 0, 442531); // (savepoint) - - roomname = "Driller"; - result = contents; - break; - } - - case rn(54,42): - { - - static const short contents[] = { - 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92, - 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,93,253,253,253,253,253,253,253,94,92,92,92,92,92,92,92,92,92,92,92, - 253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,254,9,9,9,9,9,9,9,212,92,92,92,92,92,92,92,92,92,92,92, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,92,92,92,92,92,92,92,92,92, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,92,92,92,92,92,92,92,92,92, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,92,92,92,92,92,92,92,92,92, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,92,92,92,92,92,92,92,92,92, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,92,92,92,92,92,92,92,92,92, - 0,0,0,0,0,0,0,0,0,0,0,0,0,172,173,174,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,92,92,92,92,92,92,92,92,92, - 0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,214,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,92,92,92,92,92,92,92,92,92, - 0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,214,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,92,92,92,92,92,92,92,92,92, - 0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,214,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,92,92,92,92,92,92,92,92,92, - 0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,214,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,92,92,92,92,92,92,92,92,92, - 0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,214,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,92,92,92,92,92,92,92,92,92, - 0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,214,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,92,92,92,92,92,92,92,92,92, - 0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,214,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,92,92,92,92,92,92,92,92,92, - 0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,214,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,92,92,92,92,92,92,92,92,92, - 0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,214,8,8,8,8,0,0,0,0,8,8,8,8,212,92,92,92,92,92,92,92,92,92,92,92, - 8,8,8,8,8,8,8,8,8,8,8,8,8,212,92,133,173,173,173,174,0,0,0,0,172,173,173,173,134,92,92,92,92,92,92,92,92,92,92,92, - 173,173,173,173,173,173,173,173,173,173,173,173,173,134,92,92,92,92,92,214,0,0,0,0,212,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92, - 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,0,0,0,0,212,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92, - 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,93,253,253,253,254,0,0,0,0,212,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92, - 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,0,0,0,0,0,0,0,0,212,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92, - 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,0,0,0,0,0,0,0,0,212,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92, - 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,0,0,0,0,0,0,0,0,212,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92, - 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,0,0,0,0,0,0,0,0,212,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92, - 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,0,0,0,0,0,0,0,0,212,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92, - 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,0,0,0,0,0,0,172,173,134,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92, - 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,0,0,0,0,0,0,212,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92, - 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,0,0,0,0,0,0,212,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92, - }; - - obj.createentity(128, 80, 3, 867); //Disappearing Platform - obj.createentity(160, 80, 3, 867); //Disappearing Platform - obj.createentity(192, 80, 3, 867); //Disappearing Platform - obj.createentity(128, 88, 3, 867); //Disappearing Platform - obj.createentity(160, 88, 3, 867); //Disappearing Platform - obj.createentity(192, 88, 3, 867); //Disappearing Platform - obj.createentity(128, 96, 3, 867); //Disappearing Platform - obj.createentity(128, 104, 3, 867); //Disappearing Platform - obj.createentity(128, 112, 3, 867); //Disappearing Platform - obj.createentity(128, 120, 3, 867); //Disappearing Platform - obj.createentity(160, 96, 3, 867); //Disappearing Platform - obj.createentity(160, 104, 3, 867); //Disappearing Platform - obj.createentity(160, 112, 3, 867); //Disappearing Platform - obj.createentity(160, 120, 3, 867); //Disappearing Platform - obj.createentity(192, 96, 3, 867); //Disappearing Platform - obj.createentity(192, 104, 3, 867); //Disappearing Platform - obj.createentity(192, 112, 3, 867); //Disappearing Platform - obj.createentity(192, 120, 3, 867); //Disappearing Platform - - if(!game.nocutscenes) - { - if(!obj.flags[68]) - { - obj.createblock(1, 32, 0, 320, 240, 17); - obj.flags[68] = true; - } - } - roomname = "Quicksand"; - result = contents; - break; - } - - case rn(52,42): - { - - static const short contents[] = { - 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95, - 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95, - 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,96,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256, - 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,217,9,9,9,9,9,9,9,9,9,9,9,9,9,9,0,0,0,0,0,0,0,0,0,0, - 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,217,0,0,0,0,0,0,0,0,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, - 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,217,0,0,0,0,0,0,0,0,175,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176, - 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,217,0,0,0,0,0,0,0,0,215,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95, - 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,217,0,0,0,0,0,0,0,0,215,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95, - 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,217,0,0,0,0,0,0,0,0,215,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95, - 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,217,0,0,769,770,770,770,770,770,215,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95, - 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,217,0,0,809,689,689,689,689,689,215,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95, - 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,217,0,0,809,689,689,689,689,689,215,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95, - 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,217,0,0,809,689,689,689,689,689,215,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95, - 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,217,0,0,809,689,689,689,689,689,215,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95, - 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,217,0,0,809,689,689,689,689,689,215,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95, - 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,217,0,0,809,689,689,689,689,689,215,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95, - }; - - obj.createentity(144, 40, 3); //Disappearing Platform - obj.createentity(200, 128, 3); //Disappearing Platform - roomname = "Boo! Think Fast!"; - result = contents; - break; - } - - case rn(50,42): - { - - static const short contents[] = { - 495,495,495,495,495,617,680,680,680,680,680,680,615,495,496,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,497,495,495,495,495, - 495,495,495,495,495,617,680,680,680,680,680,680,615,495,617,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,615,495,495,495,495, - 495,495,495,495,495,617,680,680,680,680,680,680,615,495,617,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,615,495,495,495,495, - 495,495,495,495,495,617,680,680,680,680,680,680,615,495,617,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,615,495,495,495,495, - 495,495,495,495,495,617,680,680,680,680,680,680,615,495,617,680,680,681,841,841,841,841,841,841,841,841,841,841,841,841,841,841,841,841,841,615,495,495,495,495, - 495,495,495,495,495,617,680,680,680,680,680,680,655,656,657,680,680,802,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495, - 495,495,495,495,495,617,680,680,680,680,680,680,7,7,7,680,680,802,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,655,656,656,656,656, - 495,495,495,495,495,617,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,495,617,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,495,617,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,495,617,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,495,617,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,495,617,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,495,536,576,576,576,576,576,576,576,576,577,680,680,802,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,680,680,802,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,495,496,656,656,656,656,656,656,656,656,657,680,680,802,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,495,617,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,495,617,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,495,617,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,495,617,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,495,617,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,495,617,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 495,495,495,495,495,617,680,680,680,680,680,680,6,6,6,680,680,802,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,575,576,576,576,576, - 495,495,495,495,495,617,680,680,680,680,680,680,575,576,577,680,680,802,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495, - 495,495,495,495,495,617,841,841,841,841,841,841,615,495,617,841,841,842,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495, - 495,495,495,495,495,617,0,0,0,0,0,0,615,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495, - 495,495,495,495,495,617,0,0,0,0,0,0,615,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495, - 495,495,495,495,495,617,0,0,0,0,0,0,615,495,617,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,615,495,495,495,495, - 495,495,495,495,495,617,0,0,0,0,0,0,615,495,536,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,537,495,495,495,495, - 495,495,495,495,495,617,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - }; - - obj.createentity(288, 160, 10, 1, 442500); // (savepoint) - - - obj.createentity(135, 75, 2, 0, 3, 100, 70, 320, 160); - obj.createentity(185, 110, 2, 0, 3, 100, 70, 320, 160); - obj.createentity(235, 145, 2, 0, 3, 100, 70, 320, 160); - roomname = "Stop and Reflect"; - result = contents; - break; - } - - case rn(51,42): - { - - static const short contents[] = { - 86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86, - 86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86, - 86,86,86,86,86,86,86,87,247,247,247,247,247,247,247,247,247,88,87,247,247,247,247,247,247,247,88,87,247,247,247,247,247,247,247,247,247,88,86,86, - 86,86,86,86,86,86,86,208,9,9,9,9,9,9,9,9,9,206,208,9,9,9,9,9,9,9,206,208,9,9,9,9,9,9,9,9,9,206,86,86, - 86,86,86,86,86,86,86,208,0,0,0,0,0,0,0,0,0,206,208,0,0,0,0,0,0,0,206,208,0,0,0,0,0,0,0,0,0,206,86,86, - 86,86,86,86,86,86,86,208,0,0,0,0,0,0,0,0,0,246,248,0,0,0,0,0,0,0,246,248,0,0,0,0,0,0,0,0,0,206,86,86, - 247,247,247,247,247,247,88,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,86, - 0,0,0,0,0,0,206,208,0,0,0,0,0,0,0,0,0,166,168,0,0,0,0,0,0,0,166,168,0,0,0,0,0,0,0,0,0,206,86,86, - 0,0,0,0,0,0,246,248,0,0,0,0,0,0,0,0,0,246,248,0,0,0,0,0,0,0,246,248,0,0,0,0,0,0,0,0,0,206,86,86, - 0,0,0,0,0,0,9,9,0,0,0,0,0,0,0,0,0,9,9,0,0,0,0,0,0,0,9,9,0,0,0,0,0,0,0,0,0,206,86,86, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,86, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,86, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,86, - 0,0,0,0,778,779,779,779,779,779,779,779,779,779,779,779,779,779,779,779,779,779,779,779,779,779,779,779,779,779,779,779,779,779,779,779,779,206,86,86, - 0,0,0,0,818,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,206,86,86, - 0,0,0,0,818,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,206,86,86, - 0,0,0,0,818,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,206,86,86, - 0,0,0,0,818,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,206,86,86, - 0,0,0,0,818,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,206,86,86, - 0,0,0,0,818,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,206,86,86, - 0,0,0,0,818,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,206,86,86, - 0,0,0,0,818,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,206,86,86, - 167,167,167,167,167,167,167,167,167,167,167,167,168,698,698,698,166,167,167,167,168,698,698,698,166,167,167,167,168,698,698,698,166,167,167,167,167,128,86,86, - 86,86,86,86,86,86,86,86,86,86,86,86,208,698,698,698,206,86,86,86,208,698,698,698,206,86,86,86,208,698,698,698,206,86,86,86,86,86,86,86, - 86,86,86,86,86,86,86,86,86,86,86,86,208,698,698,698,206,86,86,86,208,698,698,698,206,86,86,86,208,698,698,698,206,86,86,86,86,86,86,86, - 86,86,86,86,86,86,86,86,86,86,86,86,208,698,698,698,206,86,86,86,208,698,698,698,206,86,86,86,208,698,698,698,206,86,86,86,86,86,86,86, - 86,86,86,86,86,86,86,86,86,86,86,86,208,698,698,698,206,86,86,86,208,698,698,698,206,86,86,86,208,698,698,698,206,86,86,86,86,86,86,86, - 86,86,86,86,86,86,86,86,86,86,86,86,127,167,167,167,128,86,86,86,127,167,167,167,128,86,86,86,127,167,167,167,128,86,86,86,86,86,86,86, - 86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86, - 86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86, - }; - - obj.platformtile = 207; - obj.createentity(112-4, 200-4, 1, 1, 6, 104, 144, 264, 240); // Enemy, bounded - obj.createentity(176-4, 152, 1, 0, 6, 104, 144, 264, 240); // Enemy, bounded - obj.createentity(240-4, 200-4, 1, 1, 6, 104, 144, 264, 240); // Enemy, bounded - obj.createentity(64, 48, 2, 3, 4); // Platform - obj.createentity(272, 152, 9, 1); // (shiny trinket) - - if(!game.nocutscenes) - { - obj.createblock(1, 16, 0, 320, 240, 47); - } - - roomname = "Trench Warfare"; - result = contents; - break; - } - - case rn(50,41): - { - - static const short contents[] = { - 92,92,92,92,92,214,0,0,0,0,0,0,212,92,93,253,253,253,94,92,92,92,92,92,92,92,92,92,92,92,92,92,93,253,253,253,94,92,92,92, - 92,92,92,92,92,214,0,0,0,0,0,0,212,92,214,0,0,0,212,92,92,92,92,92,92,92,92,92,92,92,92,92,214,0,0,0,212,92,92,92, - 92,92,92,92,92,214,0,0,0,0,0,0,212,92,214,0,0,0,212,92,92,92,92,92,92,92,92,92,92,92,92,92,214,0,0,0,212,92,92,92, - 92,92,92,92,92,214,0,0,0,0,0,0,212,92,214,0,0,0,212,92,92,92,92,92,92,92,92,92,92,92,92,92,214,0,0,0,212,92,92,92, - 92,92,92,92,92,214,0,0,0,0,0,0,252,253,254,0,0,0,252,253,253,253,253,253,253,253,253,253,253,253,253,253,254,0,0,0,252,253,253,94, - 92,92,92,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212, - 92,92,92,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212, - 92,92,92,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212, - 92,92,92,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,763,764,764,764,764,764,764,764,764,212, - 92,92,92,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,803,683,683,683,683,683,683,683,683,212, - 92,92,92,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,803,683,683,683,683,683,683,683,683,212, - 92,92,92,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,803,683,683,683,683,683,683,683,683,212, - 92,92,92,92,92,133,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,174,0,0,0,172,173,173,173,173,174,683,683,683,683,683,683,212, - 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,0,0,0,212,92,92,92,92,214,683,683,683,683,683,683,212, - 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,92,92,92,212,92,92,92,92,214,683,683,683,683,683,683,212, - 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,0,0,0,212,92,92,92,92,214,683,683,683,683,683,683,212, - 92,92,92,92,92,93,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,254,0,0,0,252,253,253,253,253,254,683,683,683,683,683,683,212, - 92,92,92,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,803,683,683,683,683,683,683,683,683,212, - 92,92,92,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,803,683,683,683,683,683,683,683,683,212, - 92,92,92,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,803,683,683,683,683,683,683,683,683,212, - 92,92,92,92,92,214,764,764,764,764,764,764,764,764,764,764,764,764,764,764,764,764,764,764,764,764,764,764,764,764,725,683,683,683,683,683,683,683,683,212, - 92,92,92,92,92,214,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,212, - 92,92,92,92,92,214,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,212, - 92,92,92,92,92,214,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,212, - 92,92,92,92,92,214,683,683,683,683,683,683,172,173,174,683,683,683,172,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,134, - 92,92,92,92,92,214,683,683,683,683,683,683,212,92,214,683,683,683,212,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92, - 92,92,92,92,92,214,683,683,683,683,683,683,212,92,214,683,683,683,212,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92, - 92,92,92,92,92,214,683,683,683,683,683,683,212,92,214,683,683,683,212,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92, - 92,92,92,92,92,214,683,683,683,683,683,683,212,92,133,173,173,173,134,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92, - 92,92,92,92,92,214,683,683,683,683,683,683,212,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92, - }; - - obj.createentity(120+2, 8, 1, 0, 3); // Enemy - obj.createentity(264+2, 8, 1, 0, 3); // Enemy - obj.createentity(120+2, 208-4, 1, 1, 3); // Enemy - obj.createentity(192+2, 176-4, 1, 1, 3); // Enemy - obj.createentity(192+2, 40, 1, 0, 3); // Enemy - - obj.createentity(64, 80, 10, 1, 441501); // (savepoint) - obj.createentity(64, 136, 10, 0, 441502); // (savepoint) - - roomname = "The Yes Men"; - result = contents; - break; - } - - case rn(50,40): - { - - static const short contents[] = { - 283,283,283,283,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, - 283,283,283,283,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, - 283,283,283,283,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, - 283,283,283,283,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, - 283,283,283,283,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, - 283,283,283,283,283,405,0,0,0,0,0,0,443,444,444,444,444,444,444,444,444,444,444,444,444,444,285,283,284,444,444,444,444,444,444,444,444,444,444,444, - 283,283,283,283,283,405,0,0,0,0,0,0,9,9,9,9,9,9,9,9,9,9,9,9,9,9,403,283,405,0,0,0,0,0,815,695,695,695,695,695, - 283,283,283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,443,444,445,0,0,0,0,0,815,695,695,695,695,695, - 283,283,283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,815,695,695,695,695,695, - 283,283,283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,815,695,695,695,695,695, - 283,283,283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,815,695,695,695,695,695, - 283,283,283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,363,364,364,364,364,364,364, - 283,283,283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,283,283,283,283,283, - 283,283,283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,283,283,283,283,283, - 283,283,283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,283,283,283,283,283, - 283,283,283,283,283,324,364,364,364,364,364,364,364,364,364,364,365,8,8,8,8,363,364,364,364,364,364,364,364,364,364,364,364,325,283,283,283,283,283,283, - 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,324,364,364,364,364,325,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, - 283,283,283,283,283,284,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,285,283,283,283,283,283,283,283, - 283,283,283,283,283,405,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,403,283,283,283,283,283,283,283, - 283,283,283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,283,283,283,283,283,283, - 283,283,283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,443,444,444,444,444,444,444,444, - 283,283,283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,815,695,695,695,695,695, - 283,283,283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,815,695,695,695,695,695, - 283,283,283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,815,695,695,695,695,695, - 283,283,283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,815,695,695,695,695,695, - 283,283,283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,815,695,695,695,695,695, - 283,283,283,283,283,405,0,0,0,0,0,0,363,364,365,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,363,364,364,364,364,364,364,364,364, - 283,283,283,283,283,405,0,0,0,0,0,0,403,283,324,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,325,283,283,283,283,283,283,283,283, - 283,283,283,283,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, - 283,283,283,283,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, - }; - - obj.platformtile = 10; - obj.createentity(136-32, 64, 3, 10); //Disappearing Platform - obj.createentity(136, 64, 3, 10); //Disappearing Platform - obj.createentity(136+32, 64, 3, 10); //Disappearing Platform - obj.createentity(56, 104, 10, 1, 440500); // (savepoint) - obj.createentity(56, 152, 2, 3, 3); // Platform - obj.createentity(280, 192, 10, 1, 440501); // (savepoint) - - roomname = "Gantry and Dolly"; - result = contents; - break; - } - - case rn(51,40): - { - - static const short contents[] = { - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - 495,495,495,495,495,495,495,496,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,497,495,495,495,495, - 495,495,495,495,495,495,495,617,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,615,495,495,495,495, - 495,495,495,495,495,495,495,617,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,615,495,495,495,495, - 495,495,495,495,495,495,495,617,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,615,495,495,495,495, - 656,656,656,656,656,656,656,657,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,615,495,495,495,495, - 680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,575,576,576,576,537,495,495,495,495, - 680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,655,656,656,656,497,495,495,495,495, - 680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,615,495,495,495,495, - 680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,615,495,495,495,495, - 680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,615,495,495,495,495, - 576,577,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,615,495,495,495,495, - 495,536,576,577,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,615,495,495,495,495, - 495,495,495,536,576,577,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,615,495,495,495,495, - 495,495,495,495,495,536,576,577,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,615,495,495,495,495, - 495,495,495,495,495,495,495,536,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,577,680,680,680,680,615,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,680,680,680,680,615,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,680,680,680,680,615,495,495,495,495, - 495,495,495,496,656,656,656,656,656,656,656,656,656,497,495,496,656,656,656,656,656,656,656,656,656,656,656,656,497,495,617,680,680,680,680,615,495,495,495,495, - 495,495,495,617,680,680,680,680,680,680,680,680,680,615,495,617,680,680,680,680,680,680,680,680,680,680,680,680,615,495,617,680,680,680,680,615,495,495,495,495, - 656,656,656,657,680,680,680,680,680,680,680,680,680,615,495,617,680,680,680,680,680,680,680,680,680,680,680,680,615,495,617,680,680,680,680,615,495,495,495,495, - 680,680,680,680,680,680,680,680,680,680,680,680,680,615,495,617,680,680,680,680,680,680,680,680,680,680,680,680,615,495,617,680,680,680,680,615,495,495,495,495, - 680,680,680,680,680,680,680,680,680,680,680,680,680,615,495,617,680,680,680,680,680,680,680,680,680,680,680,680,615,495,617,680,680,680,680,615,495,495,495,495, - 680,680,680,680,680,680,680,575,576,577,680,680,680,655,656,657,680,680,680,575,576,576,576,576,577,680,680,680,655,656,657,680,680,680,680,615,495,495,495,495, - 680,680,680,680,680,680,680,615,495,617,680,680,680,680,680,680,680,680,680,615,495,495,495,495,617,680,680,680,680,680,680,680,680,680,680,615,495,495,495,495, - 680,680,680,680,680,680,680,615,495,617,680,680,680,680,680,680,680,680,680,615,495,495,495,495,617,680,680,680,680,680,680,680,680,680,680,615,495,495,495,495, - 576,576,576,576,576,576,576,537,495,617,680,680,680,680,680,680,680,680,680,615,495,495,495,495,617,680,680,680,680,680,680,680,680,680,680,615,495,495,495,495, - 495,495,495,495,495,495,495,495,495,617,680,680,680,680,680,680,680,680,680,615,495,495,495,495,617,680,680,680,680,680,680,680,680,680,680,615,495,495,495,495, - 495,495,495,495,495,495,495,495,495,536,576,576,576,576,576,576,576,576,576,537,495,495,495,495,536,576,576,576,576,576,576,576,576,576,576,537,495,495,495,495, - 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, - }; - - obj.createentity(88, 104, 21, 1); // (savepoint) - obj.createentity(112, 104, 21, 1, 440511); // (savepoint) - obj.createentity(136, 88, 1, 0, 0); // Enemy //the radar dish - //obj.createentity(176, 104, 10, 1, 440512); // (savepoint) - obj.createentity(200, 104, 21, 1); // (savepoint) - obj.createentity(224, 104, 21, 1); // (savepoint) - obj.createentity(256, 32, 1, 0, 0); // Enemy //in this case, the transmitter - - if(!game.intimetrial) - { - obj.createblock(1, 120, 0, 320, 240, 31); - } - - roomname = "Comms Relay"; - result = contents; - break; - } - - case rn(50,39): - { - - static const short contents[] = { - 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, - 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, - 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,293,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,294, - 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,412, - 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,412, - 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,412, - 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,412, - 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,698,698,698,372,373,374,698,698,698,698,372,373,373,373,374,698,698,698,698,698,698,412, - 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,698,698,698,412,292,414,698,698,698,698,412,292,292,292,414,698,698,698,698,698,698,412, - 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,698,698,698,412,292,414,698,698,698,698,412,292,292,292,414,698,698,698,698,698,698,412, - 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,698,698,698,452,453,454,698,698,698,698,412,292,292,292,414,698,698,698,698,698,698,412, - 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,698,698,698,698,698,698,698,698,698,698,412,292,292,292,414,698,698,698,698,698,698,412, - 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,859,859,859,859,859,859,859,859,859,859,412,292,292,292,414,859,859,859,859,859,859,412, - 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,0,0,0,0,0,0,0,0,0,0,412,292,292,292,414,0,0,0,0,0,0,452, - 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,0,0,0,0,0,0,0,0,0,0,412,292,292,292,414,0,0,0,0,0,0,0, - 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,333,373,373,373,373,373,374,0,0,0,0,412,292,292,292,414,0,0,0,0,0,0,0, - 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,0,0,0,0,412,292,292,292,414,0,0,0,0,0,0,0, - 292,292,292,292,292,293,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,454,0,0,0,0,412,292,292,292,414,0,0,0,0,0,0,0, - 292,292,292,292,292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,292,414,0,0,0,0,0,0,0, - 292,292,292,292,292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,292,414,0,0,0,0,0,0,0, - 292,292,292,292,292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,292,414,0,0,0,0,0,0,0, - 292,292,292,292,292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,292,414,0,0,0,0,0,0,0, - 292,292,292,292,292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,292,414,0,0,0,0,0,0,0, - 292,292,292,292,292,414,0,0,0,0,0,0,372,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,334,292,292,292,333,373,373,373,373,373,373,373, - 292,292,292,292,292,414,0,0,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, - 292,292,292,292,292,414,0,0,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, - 292,292,292,292,292,414,0,0,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, - 292,292,292,292,292,414,0,0,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, - 292,292,292,292,292,414,0,0,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, - 292,292,292,292,292,414,0,0,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, - }; - - obj.createentity(200, 32, 1, 0, 8); // Enemy - obj.createentity(168, 104, 10, 1, 439500); // (savepoint) - - roomname = "Security Sweep"; - result = contents; - break; - } - - case rn(51,39): - { - - static const short contents[] = { - 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95, - 95,95,96,256,256,256,256,256,256,256,256,256,97,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95, - 95,95,217,0,0,0,0,0,0,0,0,0,215,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95, - 95,95,217,0,0,0,0,0,0,0,0,0,215,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95, - 95,95,217,0,0,0,0,0,0,0,0,0,215,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95, - 95,95,217,0,0,0,0,0,0,0,0,0,215,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,96,256,256,256,256,256,256, - 95,95,217,0,0,0,175,176,177,0,0,0,215,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,217,0,0,0,0,0,0, - 95,95,217,0,0,0,215,95,217,0,0,0,215,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,217,0,0,0,0,0,0, - 95,95,217,0,0,0,215,95,217,770,771,0,215,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,217,0,0,0,0,0,0, - 95,95,217,0,0,0,215,95,217,689,811,0,255,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,97,95,217,0,0,0,0,0,0, - 95,95,217,0,0,0,215,95,217,689,811,0,0,0,0,0,0,0,809,689,689,811,0,0,0,0,0,0,0,809,689,215,95,217,0,0,0,0,0,0, - 95,95,217,0,0,0,215,95,217,689,811,0,0,0,0,0,0,0,809,689,689,811,0,0,0,0,0,0,0,809,689,215,95,217,0,0,0,0,0,0, - 95,95,217,0,0,0,215,95,217,689,811,0,0,0,0,0,0,0,809,689,689,811,0,0,0,0,0,0,0,809,689,215,95,217,0,0,0,0,0,0, - 256,256,257,0,0,0,215,95,217,689,811,0,0,0,0,0,0,0,809,689,689,811,0,0,0,0,0,0,0,809,689,215,95,217,0,0,0,0,0,0, - 0,0,0,0,0,0,215,95,217,689,811,0,0,0,0,0,0,0,809,689,689,811,0,0,0,0,0,0,0,809,689,215,95,217,0,0,0,0,0,0, - 0,0,0,0,0,0,215,95,217,689,811,0,0,0,0,0,0,0,809,689,689,811,0,0,0,0,0,0,0,809,689,215,95,217,0,0,0,175,176,176, - 0,0,0,0,0,0,215,95,217,689,811,0,0,0,0,0,0,0,809,689,689,811,0,0,0,0,0,0,0,809,689,215,95,217,0,0,0,215,95,95, - 0,0,0,0,0,0,215,95,217,689,811,0,0,0,0,0,0,0,809,689,689,811,0,0,0,0,0,0,0,809,689,215,95,217,0,0,0,215,95,95, - 0,0,0,0,0,0,215,95,217,689,811,0,0,0,0,0,0,0,809,689,689,811,0,0,0,0,0,0,0,809,689,215,95,217,0,0,0,215,95,95, - 0,0,0,0,0,0,215,95,136,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,177,0,809,689,215,95,217,0,0,0,215,95,95, - 0,0,0,0,0,0,215,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,217,0,849,850,215,95,217,0,0,0,215,95,95, - 0,0,0,0,0,0,215,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,217,0,0,0,215,95,217,0,0,0,215,95,95, - 0,0,0,0,0,0,215,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,217,0,0,0,255,256,257,0,0,0,215,95,95, - 176,176,176,176,176,176,137,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,217,0,0,0,0,0,0,0,0,0,215,95,95, - 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,217,0,0,0,0,0,0,0,0,0,215,95,95, - 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,217,0,0,0,0,0,0,0,0,0,215,95,95, - 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,217,0,0,0,0,0,0,0,0,0,215,95,95, - 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,136,176,176,176,176,176,176,176,176,176,137,95,95, - 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95, - 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95, - }; - - obj.createentity(24, 168, 10, 1, 439510); // (savepoint) - obj.createentity(280, 48, 10, 0, 439511); // (savepoint) - obj.createentity(80, 88, 1, 3, 3); // Enemy - obj.createentity(224 - 16, 128, 1, 2, 3); // Enemy - - obj.createentity(256-4, 200, 20, 1); // (terminal) - obj.createblock(5, 256-8, 200, 20, 16, 6); - roomname = "Linear Collider"; - result = contents; - break; - } - - case rn(52,39): - { - - static const short contents[] = { - 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, - 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, - 289,289,289,289,289,289,289,289,289,290,450,450,450,450,450,450,450,450,450,450,450,450,450,291,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, - 289,289,289,289,289,289,289,289,289,411,7,7,7,7,7,7,7,7,7,7,7,7,7,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, - 289,289,289,289,289,289,289,289,289,411,680,680,680,680,680,680,680,680,680,680,680,680,680,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, - 450,450,450,450,450,450,450,291,289,411,680,680,680,680,680,680,680,680,680,680,680,680,680,449,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450, - 0,0,0,0,0,0,0,409,289,411,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,409,289,411,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,409,289,411,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,409,289,411,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,409,289,411,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,409,289,411,680,680,680,680,680,680,681,841,841,841,841,841,841,682,680,680,680,680,680,680,680,802,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,409,289,411,680,680,680,680,680,680,802,0,0,0,0,0,0,800,680,680,680,680,680,680,369,370,371,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,409,289,411,680,680,680,680,680,680,802,0,0,0,0,0,0,800,680,680,680,680,680,680,409,289,411,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,409,289,411,680,680,680,680,680,680,802,0,0,0,0,0,0,800,680,680,680,680,680,680,409,289,411,0,0,0,0,0,0,0, - 370,370,371,0,0,0,0,409,289,411,680,680,680,680,680,680,802,0,0,0,0,0,0,800,680,680,680,680,680,680,409,289,330,370,370,370,370,370,370,370, - 289,289,411,0,0,0,0,409,289,411,680,680,680,680,680,680,802,0,0,0,0,0,0,800,680,680,680,680,680,680,409,289,289,289,289,289,289,289,289,289, - 289,289,411,0,0,0,0,449,450,451,680,680,680,680,680,680,721,761,761,761,761,761,761,722,680,680,680,680,680,680,409,289,289,289,289,289,289,289,289,289, - 289,289,411,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,409,289,289,289,289,289,289,289,289,289, - 289,289,411,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,409,289,289,289,289,289,289,289,289,289, - 289,289,411,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,409,289,289,289,289,289,289,289,289,289, - 289,289,411,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,409,289,289,289,289,289,289,289,289,289, - 289,289,330,370,370,370,370,370,370,370,370,370,370,370,370,370,371,680,680,680,680,680,680,680,680,680,680,680,680,680,409,289,289,289,289,289,289,289,289,289, - 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,680,680,680,680,680,680,680,680,680,680,680,680,680,409,289,289,289,289,289,289,289,289,289, - 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,6,6,6,6,6,6,6,6,6,680,680,680,680,409,289,289,289,289,289,289,289,289,289, - 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,330,370,370,370,370,370,370,370,370,371,680,680,680,680,409,289,289,289,289,289,289,289,289,289, - 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,841,841,841,841,409,289,289,289,289,289,289,289,289,289, - 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,0,0,0,0,409,289,289,289,289,289,289,289,289,289, - 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,0,0,0,0,409,289,289,289,289,289,289,289,289,289, - 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,0,0,0,0,409,289,289,289,289,289,289,289,289,289, - }; - - obj.createentity(192, 48, 10, 0, 439520); // (savepoint) - obj.createentity(112, 160, 10, 1, 439521); // (savepoint) - roomname = "Atmospheric Filtering Unit"; - result = contents; - break; - } - - case rn(53,39): - { - - static const short contents[] = { - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,484,644,644,644,644,485,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,695,695,695,695,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,695,695,695,695,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,695,695,695,695,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,695,695,695,695,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, - 644,644,644,644,644,644,644,644,644,644,644,644,644,644,645,695,695,695,695,643,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,485,483,483, - 0,0,0,0,0,0,0,815,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,603,483,483, - 0,0,0,0,0,0,0,815,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,603,483,483, - 0,0,0,0,0,0,0,815,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,603,483,483, - 0,0,0,0,0,0,0,815,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,603,483,483, - 0,0,0,0,0,0,0,815,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,603,483,483, - 0,0,0,0,0,0,0,815,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,603,483,483, - 0,0,0,0,0,0,0,815,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,603,483,483, - 0,0,0,0,0,0,0,815,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,603,483,483, - 0,0,0,0,0,0,0,815,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,603,483,483, - 564,564,564,564,565,0,0,815,695,563,564,564,564,564,564,564,564,564,564,564,564,564,564,564,565,695,695,695,695,563,564,565,695,695,695,695,695,603,483,483, - 483,483,483,483,605,0,0,815,695,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,695,695,695,695,603,483,605,695,695,695,695,695,603,483,483, - 483,483,483,483,605,0,0,815,695,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,695,695,695,695,603,483,605,695,695,695,695,695,603,483,483, - 483,483,483,483,605,0,0,815,695,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,695,695,695,695,603,483,605,695,695,695,695,695,603,483,483, - 483,483,483,483,605,0,0,815,695,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,695,695,695,695,603,483,605,695,695,695,695,695,603,483,483, - 483,483,483,483,524,564,564,564,564,525,483,483,483,483,483,483,483,483,483,483,483,483,483,483,524,564,564,564,564,525,483,605,695,695,695,695,695,603,483,483, - 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,695,695,695,695,695,603,483,483, - 483,483,484,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,645,695,695,695,695,695,603,483,483, - 483,483,605,0,0,0,0,815,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,603,483,483, - 483,483,605,0,0,0,0,815,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,603,483,483, - 483,483,605,0,0,0,0,855,856,856,856,856,856,856,856,856,856,856,856,856,856,856,856,856,856,856,856,856,856,856,856,856,856,856,856,856,856,603,483,483, - 483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483, - 483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483, - 483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483, - 483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483, - }; - - roomname = "Traffic Jam"; - - obj.createentity(45, 118, 1, 1, 4); - obj.createentity(205, 118, 1, 1, 4); - obj.createentity(125, 18, 1, 0, 4); - - obj.createentity(232, 184, 10, 0, 1); - result = contents; - break; - } - - case rn(53,40): - { - - static const short contents[] = { - 310,310,432,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,430,310,310, - 310,310,432,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,430,310,310, - 310,310,432,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,430,310,310, - 310,310,432,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,430,310,310, - 310,310,432,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,430,310,310, - 310,310,432,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,772,773,773,773,773,773,773,773,773,773,773,773,773,773,773,430,310,310, - 310,310,432,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,812,692,692,692,692,692,692,692,692,692,692,692,692,692,692,430,310,310, - 310,310,432,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,812,692,692,692,692,692,692,692,692,692,692,692,692,692,692,430,310,310, - 310,310,432,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,812,692,692,692,692,692,692,692,692,692,692,692,692,692,692,430,310,310, - 310,310,432,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,812,692,692,692,692,692,692,692,692,692,692,692,692,692,692,430,310,310, - 310,310,432,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,812,692,692,692,692,692,692,692,692,692,692,692,692,692,692,430,310,310, - 310,310,432,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,812,692,692,692,692,692,692,692,692,692,692,692,692,692,692,430,310,310, - 310,310,432,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,812,692,692,692,692,692,692,692,692,692,692,692,692,692,692,430,310,310, - 310,310,432,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,852,853,853,853,853,694,692,692,692,692,692,692,692,692,692,430,310,310, - 310,310,432,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,812,692,692,692,692,692,692,692,692,692,430,310,310, - 310,310,432,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,812,692,692,692,692,692,692,692,692,692,430,310,310, - 310,310,432,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,812,692,692,692,692,692,692,692,692,692,430,310,310, - 310,310,432,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,812,692,692,692,692,692,692,692,692,692,430,310,310, - 310,310,432,773,773,773,773,773,773,774,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,812,692,692,692,692,692,692,692,692,692,430,310,310, - 310,310,432,692,692,692,692,692,692,814,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,812,692,692,692,692,692,692,692,692,692,430,310,310, - 310,310,432,692,692,692,692,692,692,814,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,812,692,692,692,692,692,692,692,692,692,430,310,310, - 310,310,432,692,692,692,692,692,692,814,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,812,692,692,692,692,692,692,692,692,692,430,310,310, - 310,310,432,692,692,692,692,692,692,814,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,812,692,692,692,692,692,692,692,692,692,430,310,310, - 310,310,432,692,692,692,692,692,692,814,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,812,692,692,692,692,692,692,692,692,692,430,310,310, - 310,310,432,692,692,692,692,692,692,814,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,812,692,692,692,692,692,692,692,692,692,430,310,310, - 310,310,432,692,692,692,692,692,692,814,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,812,692,692,692,692,692,692,692,692,692,430,310,310, - 310,310,432,692,692,692,692,692,692,814,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,812,692,692,692,692,692,692,692,692,692,430,310,310, - 310,310,432,692,692,692,692,692,692,814,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,812,692,692,692,692,692,692,692,692,692,430,310,310, - 310,310,432,692,692,692,692,692,692,814,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,812,692,692,692,692,692,692,692,692,692,430,310,310, - 310,310,432,692,692,692,692,692,692,814,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,812,692,692,692,692,692,692,692,692,692,430,310,310, - }; - roomname = "Leap of Faith"; - result = contents; - break; - } - - case rn(53,41): - { - - static const short contents[] = { - 286,286,408,686,686,686,686,686,686,808,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,806,686,686,686,686,686,686,686,686,686,406,286,286, - 286,286,408,686,686,686,686,686,686,808,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,806,686,686,686,686,686,686,686,686,686,406,286,286, - 286,286,408,686,686,686,686,686,686,808,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,806,686,686,686,686,686,686,686,686,686,406,286,286, - 286,286,408,686,686,686,686,686,686,808,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,806,686,686,686,686,686,686,686,686,686,406,286,286, - 286,286,408,686,686,686,686,686,686,808,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,806,686,686,686,686,686,686,686,686,686,406,286,286, - 286,286,408,686,686,686,686,686,686,808,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,806,686,686,686,686,686,686,686,686,686,406,286,286, - 286,286,408,686,686,686,686,686,686,808,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,806,686,686,686,686,686,686,686,686,686,406,286,286, - 286,286,408,686,686,686,686,686,686,808,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,846,847,847,847,847,847,847,847,847,847,406,286,286, - 286,286,408,686,686,686,686,686,686,808,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286, - 286,286,408,686,686,686,686,686,686,808,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286, - 286,286,327,367,367,367,367,367,367,367,367,367,367,367,368,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286, - 286,286,286,286,286,286,286,286,286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286, - 447,447,447,447,447,447,447,447,288,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286, - 686,686,686,686,686,686,686,686,406,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286, - 686,686,686,686,686,686,686,686,406,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286, - 686,686,686,686,686,686,686,686,446,447,447,447,447,447,448,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286, - 686,686,686,686,686,686,686,686,686,808,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286, - 686,686,686,686,686,686,686,686,686,808,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286, - 686,686,686,686,686,686,686,686,686,808,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286, - 686,686,686,686,686,686,686,686,686,808,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286, - 686,686,686,686,686,686,686,686,686,808,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286, - 686,686,686,686,686,686,686,686,686,808,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286, - 686,686,686,686,686,686,686,686,686,808,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286, - 367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,328,286,286, - 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, - 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, - 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, - 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, - 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, - 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, - }; - - obj.createentity(152, 168, 10, 1, 441530); // (savepoint) - - if(!game.nocutscenes) - { - obj.createblock(1, 72, 0, 320, 240, 30); - } - - roomname = "Solitude"; - result = contents; - break; - } - - case rn(52,41): - { - - static const short contents[] = { - 83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83, - 83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83, - 83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83, - 83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83, - 83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83, - 83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83, - 83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83, - 83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83, - 83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83, - 83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83, - 83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83, - 83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83, - 244,244,244,244,244,244,244,244,244,244,244,244,244,244,244,244,244,244,244,244,244,244,244,244,244,244,244,244,244,244,244,244,244,244,244,244,244,244,244,244, - 680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680, - 680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680, - 680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680, - 680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680, - 680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680, - 680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680, - 680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680, - 680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680, - 680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680, - 680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680, - 164,164,164,164,164,164,164,164,164,164,164,164,165,680,680,680,680,680,680,680,680,680,680,680,680,680,680,163,164,164,164,164,164,164,164,164,164,164,164,164, - 83,83,83,83,83,83,83,83,83,83,83,83,205,6,6,6,6,6,6,6,6,6,6,6,6,6,6,203,83,83,83,83,83,83,83,83,83,83,83,83, - 83,83,83,83,83,83,83,83,83,83,83,83,124,164,164,164,164,164,164,164,164,164,164,164,164,164,164,125,83,83,83,83,83,83,83,83,83,83,83,83, - 83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83, - 83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83, - 83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83, - 83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83, - }; - - roomname = "Conundrum"; - - if(!game.nocutscenes) - { - obj.createblock(1, 10, 0, 60, 240, 22); - obj.createblock(1, 280, 0, 320, 240, 21); - } - result = contents; - break; - }; - - case rn(51,41): - { - - static const short contents[] = { - 86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86, - 86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86, - 87,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,88,86,86,86,86,86,86,86,86,86,86,86,86,86, - 208,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,820,0,818,820,0,818,206,86,86,86,86,86,86,86,86,86,86,86,86,86, - 208,698,699,859,859,859,859,859,859,859,859,859,859,859,859,859,859,859,859,700,820,0,818,820,0,818,206,86,86,86,86,86,86,86,86,86,86,86,86,86, - 208,698,820,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,818,820,0,818,820,0,818,206,86,86,86,86,86,86,86,86,86,86,86,86,86, - 208,698,820,0,778,779,779,779,779,779,779,779,779,779,779,779,779,780,0,818,820,0,818,820,0,818,206,86,86,86,86,86,86,86,86,86,86,86,86,86, - 208,698,820,0,818,699,859,859,859,859,859,859,859,859,859,859,700,820,0,818,820,0,818,820,0,818,206,86,86,86,86,86,86,86,86,86,86,86,86,86, - 208,698,820,0,818,820,0,0,0,0,0,0,0,0,0,0,818,820,0,818,820,0,818,820,0,818,206,86,86,86,86,86,86,86,86,86,86,86,86,86, - 208,698,820,0,818,820,0,778,779,779,779,779,779,779,780,0,818,820,0,818,820,0,818,820,0,818,206,86,86,86,86,86,86,86,86,86,86,86,86,86, - 208,698,820,0,818,820,0,818,699,859,859,859,859,700,820,0,818,820,0,818,820,0,818,820,0,818,206,86,86,86,86,86,86,86,86,86,86,86,86,86, - 208,698,820,0,818,820,0,818,820,0,0,0,0,818,820,0,818,820,0,818,820,0,818,820,0,818,206,86,86,86,86,86,86,86,86,86,86,86,86,86, - 208,698,820,0,818,820,0,818,820,0,778,780,0,818,820,0,818,820,0,818,820,0,818,820,0,818,246,247,247,247,247,247,247,247,247,247,247,247,247,247, - 208,698,820,0,818,820,0,818,820,0,858,860,0,818,820,0,818,820,0,818,820,0,818,820,0,818,698,820,0,818,698,698,820,0,818,698,698,698,698,698, - 208,698,820,0,818,820,0,818,820,0,0,0,0,818,820,0,818,820,0,818,820,0,818,820,0,818,698,820,0,818,698,698,820,0,818,698,698,698,698,698, - 208,698,820,0,818,820,0,818,739,779,779,779,779,740,820,0,818,820,0,818,820,0,818,820,0,818,698,820,0,818,698,698,820,0,818,698,698,698,698,698, - 208,698,820,0,818,820,0,858,859,859,859,859,859,859,860,0,818,820,0,818,820,0,818,820,0,818,698,820,0,818,698,698,820,0,818,698,698,698,698,698, - 208,698,820,0,818,820,0,0,0,0,0,0,0,0,0,0,818,820,0,818,820,0,818,820,0,818,698,820,0,818,698,698,820,0,818,698,698,698,698,698, - 208,698,820,0,818,739,779,779,779,779,779,779,779,779,779,779,740,820,0,818,820,0,818,820,0,818,698,820,0,818,698,698,820,0,818,698,698,698,698,698, - 208,698,820,0,858,859,859,859,859,859,859,859,859,859,859,859,859,860,0,818,820,0,818,820,0,818,698,820,0,818,698,698,820,0,818,698,698,698,698,698, - 208,698,820,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,818,820,0,818,820,0,818,698,820,0,818,698,698,820,0,818,698,698,698,698,698, - 208,698,739,779,779,779,779,779,779,779,779,779,779,779,779,779,779,779,779,740,820,0,818,820,0,818,698,820,0,818,698,698,820,0,818,698,698,698,698,698, - 208,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,820,0,818,820,0,818,698,820,0,818,698,698,820,0,818,698,698,698,698,698, - 127,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167, - 86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86, - 86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86, - 86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86, - 86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86, - 86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86, - 86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86, - }; - - roomname = "Welcome Aboard"; - result = contents; - break; - } - - case rn(52,40): - { - - static const short contents[] = { - 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,211,0,0,0,0,209,89,89,89,89,89,89,89,89,89, - 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,211,0,0,0,0,209,89,89,89,89,89,89,89,89,89, - 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,211,0,0,0,0,209,89,89,89,89,89,89,89,89,89, - 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,211,0,0,0,0,209,89,89,89,89,89,89,89,89,89, - 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,211,0,0,0,0,209,89,89,89,89,89,89,89,89,89, - 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,211,0,0,0,0,209,89,89,89,89,89,89,89,89,89, - 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,211,0,0,0,0,209,89,89,89,89,89,89,89,89,89, - 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,211,0,0,0,0,209,89,89,89,89,89,89,89,89,89, - 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,211,0,0,0,0,209,89,89,89,89,89,89,89,89,89, - 89,89,89,89,89,89,89,89,89,90,250,250,250,250,250,250,250,91,89,89,89,90,250,250,250,251,0,0,0,0,209,89,89,89,89,89,89,89,89,89, - 89,89,89,89,89,89,89,89,90,251,9,9,9,9,9,9,9,249,250,250,250,251,9,9,9,9,0,0,0,0,209,89,89,89,89,89,89,89,89,89, - 89,89,89,89,89,89,89,90,251,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,209,89,89,89,89,89,89,89,89,89, - 89,89,89,89,89,89,90,251,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,209,89,89,89,89,89,89,89,89,89, - 90,250,250,250,250,250,251,776,776,776,776,776,776,776,776,776,776,776,776,776,776,776,776,776,776,776,776,776,776,776,209,89,89,89,89,89,89,89,89,89, - 211,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,209,89,89,89,89,89,89,89,89,89, - 211,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,209,89,89,89,89,89,89,89,89,89, - 211,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,209,89,89,89,89,89,89,89,89,89, - 211,856,856,856,856,856,856,856,856,856,856,856,856,856,856,856,856,856,856,856,856,856,856,856,856,856,856,856,856,856,209,89,89,89,89,89,89,89,89,89, - 211,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,209,89,89,89,89,89,89,89,89,89, - 211,0,0,0,0,0,0,0,0,0,169,170,170,170,171,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,209,89,89,89,89,89,89,89,89,89, - 130,170,170,170,171,8,8,8,8,8,209,89,89,89,211,8,8,8,8,8,8,8,8,169,170,170,170,170,170,170,131,89,89,89,89,89,89,89,89,89, - 89,89,89,89,130,170,170,170,170,170,131,89,89,89,130,170,170,170,170,170,170,170,170,131,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89, - 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89, - 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89, - 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89, - 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89, - 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89, - 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89, - 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89, - 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89, - }; - - obj.createentity(216, 144, 10, 1, 440520); // (savepoint) - obj.createentity(16, 136, 9, 0); // (shiny trinket) - - roomname = "It's a Secret to Nobody"; - result = contents; - break; - } + case rn(50,50): + { + + static const short contents[] = { + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,494,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 0,0,840,841,841,841,841,841,841,841,841,682,680,680,680,680,680,680,680,680,680,680,680,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 0,0,0,0,0,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 8,8,8,8,8,8,8,8,8,8,8,1120,6,6,6,6,6,680,680,680,680,680,680,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,574,680,680,680,680,680,680,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,680,680,680,680,680,680,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,493,653,654,680,680,680,680,680,680,652,653,494,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,493,653,654,680,680,680,680,680,680,680,680,680,680,652,653,494,492,492,492,492,492,492,492,492,492,492,492,492, + 653,653,653,653,653,653,653,653,653,653,653,653,654,680,680,680,680,680,680,680,680,680,680,680,680,680,680,652,653,653,653,653,653,653,653,653,653,653,653,653, + 0,0,0,0,0,716,0,0,0,716,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,716,0,0,0,716,0,0,0,0, + 0,0,0,0,0,716,0,0,0,716,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,716,0,0,0,716,0,0,0,0, + 0,0,0,0,0,716,0,0,0,716,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,716,0,0,0,716,0,0,0,0, + 0,0,0,0,0,716,0,0,0,716,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,716,0,0,0,716,0,0,0,0, + 0,0,0,0,0,716,0,0,0,716,0,840,841,682,680,680,680,680,680,680,680,680,680,680,680,680,681,841,842,0,0,716,0,0,0,716,0,0,0,0, + 0,0,0,0,0,716,0,0,0,716,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,716,0,0,0,716,0,0,0,0, + 0,0,0,0,0,716,0,0,0,716,0,0,0,840,841,841,841,841,841,841,841,841,841,841,841,841,842,0,0,0,0,716,0,0,0,716,0,0,0,0, + 0,0,0,0,196,197,197,197,197,197,198,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,716,0,0,0,716,0,0,0,0, + 0,0,0,0,276,277,277,277,277,277,278,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,716,0,0,0,716,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,716,0,0,0,716,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,716,0,0,0,716,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,196,197,197,197,197,197,198,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,276,277,277,277,277,277,278,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + obj.createentity(96, 40, 10, 0, 450500); // (savepoint) + if(game.intimetrial) + { + obj.createentity(136, 92, 11, 48); // (horizontal gravity line) + } + + roomname = "Outer Hull"; //If not yet in level, use "The Space Station"; + + result = contents; + break; + } + + case rn(49,50): + { + + static const short contents[] = { + 295,295,295,295,295,295,417,698,698,698,698,415,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, + 295,295,295,295,295,295,417,698,698,698,698,415,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, + 295,295,295,295,295,295,417,698,698,698,698,415,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, + 295,295,295,295,295,295,417,698,698,698,698,415,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, + 295,295,295,295,295,295,417,698,698,698,698,455,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456, + 295,295,295,295,295,295,417,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,820,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 295,295,295,295,295,295,417,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,820,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 295,295,295,295,295,295,417,859,859,859,859,859,859,859,859,859,859,859,859,859,859,859,860,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 295,295,295,295,295,295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 295,295,295,295,295,295,336,376,376,376,376,376,377,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, + 295,295,295,295,295,295,295,295,295,295,295,295,336,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376, + 295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, + 295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, + 295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, + 456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + roomname = "The Filter"; //If not yet in level, use "The Space Station" + result = contents; + break; + } + + case rn(49,49): + { + + static const short contents[] = { + 107,107,107,107,107,107,229,689,689,689,689,227,107,107,229,689,689,689,689,689,227,107,107,107,107,107,107,107,107,107,107,108,268,268,268,268,268,268,268,268, + 107,107,107,107,107,107,229,689,689,689,689,227,107,107,229,689,689,689,689,689,227,107,107,107,107,107,107,107,107,107,107,229,0,0,0,0,0,0,0,0, + 107,107,107,107,107,107,229,850,850,691,689,227,107,107,229,689,689,689,689,689,227,107,107,107,107,107,107,107,107,107,107,229,689,811,0,0,0,0,0,0, + 107,107,107,107,107,107,229,0,0,809,689,227,107,107,229,689,689,689,689,689,227,107,107,107,107,107,107,107,107,107,107,229,689,811,0,0,0,0,0,0, + 107,107,107,107,107,107,229,0,0,809,689,227,107,107,229,689,689,689,689,689,227,107,107,107,107,107,107,107,107,107,107,229,689,811,0,0,0,0,0,0, + 107,107,107,107,107,107,229,0,0,809,689,227,107,107,229,689,689,689,689,689,227,107,107,107,107,107,107,107,107,107,107,229,689,811,0,0,0,0,0,0, + 107,107,107,107,107,107,229,0,0,809,689,227,107,107,229,689,689,689,689,689,227,107,107,107,107,107,107,107,107,107,107,229,689,811,0,0,0,0,0,0, + 107,107,107,107,107,107,229,0,0,849,850,227,107,107,229,850,850,850,850,850,227,107,107,107,107,107,107,107,107,107,107,229,850,851,0,0,8,8,8,8, + 107,107,107,107,107,107,229,0,0,0,0,227,107,107,229,0,0,0,0,0,227,107,107,107,107,107,107,107,107,107,107,229,0,0,0,0,187,188,188,188, + 107,107,107,107,107,107,229,0,0,0,0,227,107,107,229,0,0,0,0,0,267,268,268,268,268,268,268,268,268,268,268,269,0,0,0,0,227,107,107,107, + 107,107,107,107,107,107,229,0,0,0,0,227,107,107,229,0,0,0,0,0,9,9,9,9,9,9,9,9,9,9,9,9,0,0,0,0,227,107,107,107, + 107,107,107,107,107,107,229,0,0,0,0,227,107,107,229,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,227,107,107,107, + 107,107,107,107,107,107,229,0,0,0,0,227,107,107,229,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,227,107,107,107, + 107,107,107,107,107,107,229,0,0,0,0,227,107,107,229,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,227,107,107,107, + 107,107,107,107,107,107,229,770,771,0,0,227,107,107,229,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,227,107,107,107, + 107,107,107,107,107,107,229,689,811,0,0,227,107,107,229,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,227,107,107,107, + 107,107,107,107,107,107,229,689,811,0,0,227,107,107,229,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,227,107,107,107, + 107,107,107,107,107,107,229,689,811,0,0,227,107,107,229,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,227,107,107,107, + 107,107,107,107,107,107,229,689,811,0,0,227,107,107,229,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,227,107,107,107, + 107,107,107,107,107,107,229,689,730,770,770,227,107,107,229,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,227,107,107,107, + 107,107,107,107,107,107,229,689,689,689,689,227,107,107,229,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,227,107,107,107, + 107,107,107,107,107,107,229,689,689,689,689,227,107,107,229,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,227,107,107,107, + 107,107,107,107,107,107,229,689,689,689,689,227,107,107,229,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,227,107,107,107, + 107,107,107,107,107,107,229,689,689,689,689,227,107,107,229,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,227,107,107,107, + 107,107,107,107,107,107,229,689,689,689,689,227,107,107,148,188,188,188,188,189,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,227,107,107,107, + 107,107,107,107,107,107,229,689,689,689,689,227,107,107,107,107,107,107,107,229,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,227,107,107,107, + 107,107,107,107,107,107,229,689,689,689,689,227,107,107,107,107,107,107,107,229,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,227,107,107,107, + 107,107,107,107,107,107,229,689,689,689,689,227,107,107,107,107,107,107,107,148,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,149,107,107,107, + 107,107,107,107,107,107,229,689,689,689,689,227,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107, + 107,107,107,107,107,107,229,689,689,689,689,227,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107, + }; + + obj.createentity(128, 176, 10, 1, 449490); // (savepoint) + obj.createentity(160, 192, 3); //Disappearing Platform + obj.createentity(192, 192, 3); //Disappearing Platform + obj.createentity(224, 192, 3); //Disappearing Platform + obj.createentity(256, 192, 3); //Disappearing Platform + obj.createentity(216-4, 168, 1, 0, 4, 160, 88, 256, 192); // Enemy, bounded + obj.createentity(184-24, 96, 1, 1, 4, 160, 88, 256, 192); // Enemy, bounded + obj.createentity(256, 8, 2, 10, 4); //Big Threadmill, >>>>>> + roomname = "Boldly To Go"; + result = contents; + break; + } + + + case rn(49,48): + { + + static const short contents[] = { + 289,289,289,289,289,289,411,0,0,800,680,409,289,289,411,680,680,680,680,680,409,289,289,289,289,289,289,289,289,289,289,411,0,0,0,0,409,289,289,289, + 289,289,289,289,289,289,411,0,0,800,680,409,289,289,411,680,680,680,680,680,409,289,289,289,289,289,289,289,289,289,289,411,0,0,0,0,409,289,289,289, + 289,289,289,289,289,289,411,0,0,800,680,409,289,289,411,680,680,680,680,680,409,289,289,289,289,289,289,289,289,289,289,411,0,0,0,0,409,289,289,289, + 289,289,289,289,289,289,411,0,0,800,680,409,289,289,411,680,680,680,680,680,409,289,289,289,289,289,289,289,289,289,289,411,0,0,0,0,409,289,289,289, + 289,289,289,289,289,289,411,0,0,800,680,409,289,289,411,680,680,680,680,680,409,289,289,289,289,289,289,289,289,289,289,411,0,0,0,0,409,289,289,289, + 289,289,289,289,289,289,411,0,0,800,680,409,289,289,411,680,680,680,680,680,409,289,289,289,289,289,289,289,289,289,289,411,0,0,0,0,409,289,289,289, + 289,289,289,289,289,289,411,0,0,800,680,409,289,289,411,680,680,680,680,680,409,289,289,289,289,289,289,289,289,289,289,411,0,0,0,0,409,289,289,289, + 289,289,289,289,289,289,411,0,0,800,680,409,289,289,411,680,680,680,680,680,409,289,289,289,289,289,289,289,289,289,289,411,0,0,0,0,409,289,289,289, + 289,289,289,289,289,289,411,0,0,800,680,409,289,289,411,680,680,680,680,680,409,289,289,289,289,289,289,289,289,289,289,411,761,761,761,761,409,289,289,289, + 289,289,289,289,289,289,411,0,0,800,680,409,289,289,411,680,680,680,680,680,409,289,289,289,289,289,289,289,289,289,289,411,680,680,680,680,409,289,289,289, + 289,289,289,289,289,289,411,0,0,800,680,409,289,289,411,680,680,680,680,680,409,289,290,450,450,450,450,450,450,450,450,451,680,680,680,680,409,289,289,289, + 289,289,289,289,289,289,411,0,0,800,680,409,289,289,411,680,680,680,680,680,409,289,411,680,680,680,680,680,680,680,680,680,680,680,680,680,409,289,289,289, + 289,289,289,289,289,289,411,0,0,840,841,409,289,289,411,841,841,682,680,680,409,289,411,680,680,680,680,680,680,680,680,680,680,680,680,680,409,289,289,289, + 289,289,289,289,289,289,411,0,0,0,0,409,289,289,411,0,0,800,680,680,409,289,411,680,680,680,680,680,680,680,680,680,680,680,680,680,409,289,289,289, + 289,289,289,289,289,289,411,0,0,0,0,409,289,289,411,0,0,800,680,680,409,289,411,680,680,680,680,680,680,680,680,680,680,680,680,680,409,289,289,289, + 289,289,289,289,289,289,411,0,0,0,0,409,289,289,411,0,0,800,680,680,409,289,411,680,680,680,680,6,6,6,6,6,6,6,6,6,409,289,289,289, + 289,289,289,289,289,289,411,0,0,0,0,409,289,289,411,0,0,800,680,680,409,289,411,680,680,680,680,369,370,370,370,370,370,370,370,370,331,289,289,289, + 289,289,289,289,289,289,411,761,762,0,0,409,289,289,411,0,0,800,680,680,409,289,411,680,680,680,680,449,450,450,450,450,450,450,450,450,450,450,450,450, + 289,289,289,289,289,289,411,680,802,0,0,409,289,289,411,0,0,800,680,680,409,289,411,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0, + 289,289,289,289,289,289,411,680,802,0,0,409,289,289,411,0,0,840,841,841,409,289,411,841,841,841,841,841,841,841,841,841,841,841,841,841,841,842,0,0, + 289,289,289,289,289,289,411,680,802,0,0,409,289,289,411,0,0,0,0,0,409,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 289,289,289,289,289,289,411,680,802,0,0,409,289,289,411,0,0,0,0,0,409,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 289,289,289,289,289,289,411,680,802,0,0,409,289,289,411,0,0,0,0,0,409,289,411,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, + 289,289,289,289,289,289,411,680,721,761,761,409,289,289,411,761,761,761,761,761,409,289,330,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370, + 289,289,289,289,289,289,411,680,680,680,680,409,289,289,411,680,680,680,680,680,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, + 289,289,289,289,289,289,411,680,680,680,680,409,289,289,411,680,680,680,680,680,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, + 289,289,289,289,289,289,411,680,680,680,680,409,289,289,411,680,680,680,680,680,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, + 289,289,289,289,289,289,411,680,680,680,680,409,289,289,411,680,680,680,680,680,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, + 289,289,289,289,289,289,411,680,680,680,680,409,289,289,411,680,680,680,680,680,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, + 289,289,289,289,289,289,411,680,680,680,680,409,289,289,411,680,680,680,680,680,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, + }; + + obj.createentity(192, 96, 9, 2); // (shiny trinket) + roomname = "One Way Room"; + result = contents; + break; + } + + + case rn(49,47): + { + + static const short contents[] = { + 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92, + 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,93,253,253,253,253,253, + 92,92,92,92,92,92,93,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,254,9,9,9,9,9, + 92,92,92,92,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 92,92,92,92,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 92,92,92,92,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 92,92,92,92,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 92,92,92,92,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 92,92,92,92,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 92,92,92,92,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 92,92,92,92,92,92,214,0,0,0,0,172,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173, + 92,92,92,92,92,92,214,0,0,0,0,212,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92, + 92,92,92,92,92,92,214,0,0,0,0,212,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92, + 92,92,92,92,92,92,214,0,0,763,764,212,92,92,92,92,92,92,92,92,92,92,92,92,92,92,93,253,253,253,253,253,253,253,253,253,253,253,253,253, + 92,92,92,92,92,92,214,0,0,803,683,212,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0, + 92,92,92,92,92,92,214,0,0,803,683,212,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0, + 92,92,92,92,92,92,214,0,0,803,683,212,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0, + 92,92,92,92,92,92,214,0,0,803,683,212,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0, + 92,92,92,92,92,92,214,0,0,803,683,212,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0, + 92,92,92,92,92,92,214,0,0,803,683,212,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0, + 92,92,92,92,92,92,214,0,0,803,683,212,92,92,93,253,253,253,253,253,253,253,253,253,253,253,254,0,0,0,0,0,0,0,0,0,0,0,0,0, + 92,92,92,92,92,92,214,0,0,803,683,212,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,172,173,173,173, + 92,92,92,92,92,92,214,0,0,803,683,212,92,92,214,683,683,683,683,683,683,683,683,805,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,92, + 92,92,92,92,92,92,214,0,0,803,683,212,92,92,214,683,683,683,683,683,683,683,683,805,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,92, + 92,92,92,92,92,92,214,0,0,803,683,212,92,92,214,683,683,683,683,683,683,683,683,805,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,92, + 92,92,92,92,92,92,214,0,0,803,683,212,92,92,214,683,683,683,683,683,683,683,683,805,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,92, + 92,92,92,92,92,92,214,0,0,803,683,212,92,92,214,683,683,683,683,683,683,683,683,805,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,92, + 92,92,92,92,92,92,214,0,0,803,683,212,92,92,214,683,683,683,683,683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,92, + 92,92,92,92,92,92,214,0,0,803,683,212,92,92,214,683,683,683,683,683,172,173,173,173,173,173,173,173,173,173,173,174,0,0,0,0,212,92,92,92, + 92,92,92,92,92,92,214,0,0,803,683,212,92,92,214,683,683,683,683,683,212,92,92,92,92,92,92,92,92,92,92,214,0,0,0,0,212,92,92,92, + }; + + obj.createentity(56, 24, 2, 10, 4); //Big Threadmill, >>>>>> + obj.createentity(120, 24, 2, 10, 4); //Big Threadmill, >>>>>> + obj.createentity(184, 24, 2, 10, 4); //Big Threadmill, >>>>>> + obj.createentity(88, 72, 2, 10, 4); //Big Threadmill, >>>>>> + obj.createentity(216, 72, 2, 10, 4); //Big Threadmill, >>>>>> + obj.createentity(280, 72, 2, 10, 4); //Big Threadmill, >>>>>> + obj.createentity(64, 32, 10, 0, 447490); // (savepoint) + obj.createentity(288, 160, 2, 8, 4); //Threadmill, >>> + obj.createentity(280, 112, 2, 10, 4); //Big Threadmill, >>>>>> + obj.createentity(160, 216, 2, 10, 4); //Big Threadmill, >>>>>> + obj.createentity(224, 216, 2, 8, 4); //Threadmill, >>> + obj.createentity(248, 24, 2, 8, 4); //Threadmill, >>> + obj.createentity(120, 168, 2, 10, 4); //Big Threadmill, >>>>>> + obj.createentity(184, 168, 2, 8, 4); //Threadmill, >>> + obj.createentity(216, 112, 2, 10, 4); //Big Threadmill, >>>>>> + obj.createentity(152, 72, 2, 10, 4); //Big Threadmill, >>>>>> + obj.createentity(224, 120, 10, 0, 447491); // (savepoint) + + roomname = "Conveying a New Idea"; + result = contents; + break; + } + + + case rn(50,47): + { + + static const short contents[] = { + 98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98, + 259,259,259,259,259,259,259,259,259,259,259,259,100,98,98,98,98,98,98,98,98,98,98,98,98,98,98,99,259,259,259,259,259,259,259,259,100,98,98,98, + 9,9,9,9,9,9,9,9,9,9,9,9,258,259,259,259,259,259,259,259,259,259,259,259,259,259,259,260,7,7,7,7,7,7,7,7,218,98,98,98, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,680,680,680,680,680,680,680,218,98,98,98, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,218,98,98,98, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,218,98,98,98, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,218,98,98,98, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,218,98,98,98, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,218,98,98,98, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,680,680,680,680,218,98,98,98, + 179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,180,8,8,8,8,8,8,8,8,178,179,179,179,179,179,179,180,680,680,680,680,218,98,98,98, + 98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,139,179,179,179,179,179,179,179,179,140,98,98,98,98,98,98,220,680,680,680,680,218,98,98,98, + 98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,99,259,259,259,259,259,259,259,259,100,98,98,98,98,98,98,220,680,680,680,680,218,98,98,98, + 259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,260,9,9,9,9,9,9,9,9,258,259,259,259,100,98,98,220,680,680,680,680,218,98,98,98, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,680,680,680,680,218,98,98,98, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,800,680,680,218,98,98,220,680,680,680,680,218,98,98,98, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,800,680,680,218,98,98,220,680,680,680,680,218,98,98,98, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,800,680,680,218,98,98,220,680,680,680,680,218,98,98,98, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,800,680,680,218,98,98,220,680,680,680,680,218,98,98,98, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,800,680,680,218,98,98,220,680,680,680,680,218,98,98,98, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,800,680,680,218,98,98,220,680,680,680,680,218,98,98,98, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,800,680,680,218,98,98,220,680,680,680,680,218,98,98,98, + 179,179,179,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,800,680,680,218,98,98,220,680,680,680,680,218,98,98,98, + 98,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,840,841,841,218,98,98,220,841,841,841,841,218,98,98,98, + 98,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,218,98,98,98, + 98,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,218,98,98,98, + 98,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,218,98,98,98, + 98,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,218,98,98,98, + 98,98,98,220,0,0,0,0,178,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,140,98,98,220,0,0,0,0,218,98,98,98, + 98,98,98,220,0,0,0,0,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,0,0,0,0,218,98,98,98, + }; + + obj.createentity(0, 72, 2, 10, 4); //Big Threadmill, >>>>>> + obj.createentity(96, 24, 2, 10, 4); //Big Threadmill, >>>>>> + obj.createentity(160, 24, 2, 10, 4); //Big Threadmill, >>>>>> + obj.createentity(64, 168, 2, 10, 4); //Big Threadmill, >>>>>> + obj.createentity(128, 168, 2, 10, 4); //Big Threadmill, >>>>>> + obj.createentity(64, 160, 2, 10, 4); //Big Threadmill, >>>>>> + obj.createentity(128, 160, 2, 10, 4); //Big Threadmill, >>>>>> + obj.createentity(0, 160, 2, 10, 4); //Big Threadmill, >>>>>> + obj.createentity(0, 112, 2, 10, 4); //Big Threadmill, >>>>>> + obj.createentity(64, 112, 2, 10, 4); //Big Threadmill, >>>>>> + obj.createentity(64, 216, 2, 10, 4); //Big Threadmill, >>>>>> + obj.createentity(128, 216, 2, 10, 4); //Big Threadmill, >>>>>> + obj.createentity(192, 216, 2, 8, 4); //Threadmill, >>> + obj.createentity(0, 168, 2, 10, 4); //Big Threadmill, >>>>>> + obj.createentity(64, 72, 2, 10, 4); //Big Threadmill, >>>>>> + obj.createentity(192, 72, 2, 10, 4); //Big Threadmill, >>>>>> + obj.createentity(192, 112, 2, 8, 4); //Threadmill, >>> + roomname = "Upstream Downstream"; + result = contents; + break; + } + + case rn(50,48): + { + + static const short contents[] = { + 292,292,292,414,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,0,0,0,0,412,292,292,292, + 292,292,292,414,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,0,0,0,0,412,292,292,292, + 292,292,292,414,0,0,0,0,452,453,453,453,453,453,294,292,292,292,292,292,292,292,292,292,292,293,453,453,453,453,453,454,0,0,0,0,412,292,292,292, + 292,292,292,414,0,0,0,0,9,9,9,9,9,9,412,292,292,292,292,292,292,292,292,292,292,414,9,9,9,9,9,9,0,0,0,0,412,292,292,292, + 292,292,292,414,0,0,0,0,0,0,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,414,0,0,0,0,0,0,0,0,0,0,412,292,292,292, + 292,292,292,414,0,0,0,0,0,0,0,0,0,0,452,453,453,453,453,453,453,453,453,453,453,454,0,0,0,0,0,0,0,0,0,0,412,292,292,292, + 292,292,292,414,0,0,0,0,0,0,0,0,0,0,9,9,9,9,9,9,9,9,9,9,9,9,0,0,0,0,0,0,0,0,0,0,412,292,292,292, + 292,292,292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,292, + 292,292,292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,292, + 292,292,292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,292, + 292,292,292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,292, + 292,292,292,333,373,373,373,374,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,292, + 292,292,292,292,292,292,292,414,779,779,779,779,779,779,779,779,779,779,779,779,779,779,779,779,779,779,779,779,779,779,779,779,779,779,779,779,412,292,292,292, + 292,292,292,292,292,292,292,414,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,412,292,292,292, + 292,292,292,292,292,292,292,414,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,372,373,373,373,334,292,292,292, + 292,292,292,292,292,292,292,414,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,412,292,292,292,292,292,292,292, + 292,292,292,292,292,292,292,414,859,859,859,859,859,859,859,859,859,859,859,859,859,859,859,859,859,859,859,859,859,859,859,859,412,292,292,292,292,292,292,292, + 453,453,453,453,453,453,453,454,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,292,292,292,292,292, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,292,292,292,292,292, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,292,292,292,292,292, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,292,292,292,292,292, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,292,292,292,292,292, + 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,412,292,292,292,292,292,292,292, + 373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,334,292,292,292,292,292,292,292, + 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, + 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, + 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, + 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, + 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, + 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, + }; + + obj.platformtile = 119; + obj.createentity(64, 72, 2, 0, 4, 64, 72, 256, 160); // Platform, bounded + obj.createentity(96, 80, 2, 0, 4, 64, 72, 256, 160); // Platform, bounded + obj.createentity(128, 88, 2, 0, 4, 64, 72, 256, 160); // Platform, bounded + obj.createentity(160, 96, 2, 0, 4, 64, 72, 256, 160); // Platform, bounded + obj.createentity(192, 104, 2, 0, 4, 64, 72, 256, 160); // Platform, bounded + obj.createentity(224, 112, 2, 0, 4, 64, 72, 256, 160); // Platform, bounded + obj.createentity(264, 96, 10, 1, 448500); // (savepoint) + roomname = "The High Road is Low"; + result = contents; + break; + } + + case rn(50,49): + { + + static const short contents[] = { + 274,274,274,274,274,274,274,274,274,274,274,274,115,113,113,113,113,113,113,113,113,113,113,113,113,113,113,114,274,274,274,274,274,274,274,274,274,274,274,274, + 0,0,0,0,0,0,0,0,0,0,0,0,273,115,113,113,113,113,113,113,113,113,113,113,113,113,114,275,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,9,233,113,113,113,113,113,113,113,113,113,113,113,113,235,9,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,273,115,113,113,113,113,113,113,113,113,113,113,114,275,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,9,233,113,113,113,113,113,113,113,113,113,113,235,9,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,273,115,113,113,113,113,113,113,113,113,114,275,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,9,233,113,113,113,113,113,113,113,113,235,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 8,8,8,8,8,8,8,8,8,0,0,0,0,0,0,273,115,113,113,113,113,113,113,114,275,0,0,0,0,0,0,8,8,8,8,8,8,8,8,8, + 194,194,194,194,194,194,194,194,195,0,0,0,0,0,0,9,233,113,113,113,113,113,113,235,9,0,0,0,0,0,0,193,194,194,194,194,194,194,194,194, + 113,113,113,113,113,113,113,113,235,8,0,0,0,0,0,0,273,115,113,113,113,113,114,275,0,0,0,0,0,0,8,233,113,113,113,113,113,113,113,113, + 113,113,113,113,113,113,113,113,154,195,0,0,0,0,0,0,9,233,113,113,113,113,235,9,0,0,0,0,0,0,193,155,113,113,113,113,113,113,113,113, + 113,113,113,113,113,113,113,113,113,235,8,0,0,0,0,0,0,273,115,113,113,114,275,0,0,0,0,0,0,8,233,113,113,113,113,113,113,113,113,113, + 113,113,113,113,113,113,113,113,113,154,195,0,0,0,0,0,0,9,233,113,113,235,9,0,0,0,0,0,0,193,155,113,113,113,113,113,113,113,113,113, + 113,113,113,113,113,113,113,113,113,113,235,8,0,0,0,0,0,0,273,115,114,275,0,0,0,0,0,0,8,233,113,113,113,113,113,113,113,113,113,113, + 113,113,113,113,113,113,113,113,113,113,154,195,0,0,0,0,0,0,9,233,235,9,0,0,0,0,0,0,193,155,113,113,113,113,113,113,113,113,113,113, + 113,113,113,113,113,113,113,113,113,113,113,235,8,0,0,0,0,0,0,273,275,0,0,0,0,0,0,8,233,113,113,113,113,113,113,113,113,113,113,113, + 113,113,113,113,113,113,113,113,113,113,113,154,195,0,0,0,0,0,0,9,9,0,0,0,0,0,0,193,155,113,113,113,113,113,113,113,113,113,113,113, + 113,113,113,113,113,113,113,113,113,113,113,113,235,8,0,0,0,0,0,0,0,0,0,0,0,0,8,233,113,113,113,113,113,113,113,113,113,113,113,113, + 113,113,113,113,113,113,113,113,113,113,113,113,154,195,0,0,0,0,0,0,0,0,0,0,0,0,193,155,113,113,113,113,113,113,113,113,113,113,113,113, + 113,113,113,113,113,113,113,113,113,113,113,113,113,235,8,0,0,0,0,0,0,0,0,0,0,8,233,113,113,113,113,113,113,113,113,113,113,113,113,113, + 113,113,113,113,113,113,113,113,113,113,113,113,113,154,195,0,0,0,0,0,0,0,0,0,0,193,155,113,113,113,113,113,113,113,113,113,113,113,113,113, + 113,113,113,113,113,113,113,113,113,113,113,113,113,113,235,8,0,0,0,0,0,0,0,0,8,233,113,113,113,113,113,113,113,113,113,113,113,113,113,113, + 113,113,113,113,113,113,113,113,113,113,113,113,113,113,154,195,0,0,0,0,0,0,0,0,193,155,113,113,113,113,113,113,113,113,113,113,113,113,113,113, + 113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,235,8,0,0,0,0,0,0,8,233,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113, + 113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,154,195,0,0,0,0,0,0,193,155,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113, + 113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,235,8,0,0,0,0,8,233,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113, + 113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,154,195,0,0,0,0,193,155,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113, + 113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,235,8,8,8,8,233,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113, + 113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,154,194,194,194,194,155,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113, + 113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113, + }; + + obj.createentity(144, 200, 3, 51); //Disappearing Platform + obj.createentity(24, 16, 10, 0, 449500); // (savepoint) + obj.createentity(280, 16, 10, 0, 449501); // (savepoint) + obj.createentity(0, 8, 2, 10, 4); //Big Threadmill, >>>>>> + obj.createentity(64, 8, 2, 8, 4); //Threadmill, >>> + obj.createentity(224, 8, 2, 11, 4); //Big Threadmill, <<<<<< + obj.createentity(288, 8, 2, 9, 4); //Threadmill, <<< + roomname = "Give Me A V"; + result = contents; + break; + } + + case rn(51,49): + { + + static const short contents[] = { + 244,244,244,244,244,244,244,244,244,244,244,244,244,244,244,244,244,244,244,244,244,244,244,244,85,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,243,244,244,244,244,244,244,244,244,244,244,244,244,244,244,244, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,800,680,680,680,680,680,7,7,7,7,7,7,7,7,7,7,7,1125,9,9,9,9, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0, + 8,8,8,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0, + 164,164,164,165,0,0,0,0,0,0,0,0,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0, + 83,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0, + 83,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0, + 83,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0, + 83,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0, + 83,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 83,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 83,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0, + 83,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0, + 83,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0, + 83,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0, + 83,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0, + 83,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0, + 83,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0, + 83,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0, + 83,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0, + 83,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0, + 83,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,800,680,680,680,680,680,6,6,6,6,6,6,6,6,6,6,6,1122,8,8,8,8, + 83,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,163,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164, + 83,83,83,124,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,125,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83, + 83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83, + 83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83, + }; + + obj.createentity(0, 8, 2, 11, 4); //Big Threadmill, <<<<<< + obj.createentity(64, 8, 2, 11, 4); //Big Threadmill, <<<<<< + obj.createentity(128, 8, 2, 11, 4); //Big Threadmill, <<<<<< + obj.createentity(128, 104, 2, 11, 4); //Big Threadmill, <<<<<< + obj.createentity(192, 104, 2, 11, 4); //Big Threadmill, <<<<<< + obj.createentity(256, 104, 2, 11, 4); //Big Threadmill, <<<<<< + obj.createentity(152, 88, 10, 1, 449510); // (savepoint) + obj.createentity(152, 120, 10, 0, 449511); // (savepoint) + obj.createentity(128, 112, 2, 10, 4); //Big Threadmill, >>>>>> + obj.createentity(192, 112, 2, 10, 4); //Big Threadmill, >>>>>> + obj.createentity(256, 112, 2, 10, 4); //Big Threadmill, >>>>>> + obj.createentity(32, 208, 2, 8, 4); //Threadmill, >>> + obj.createentity(64, 208, 2, 10, 4); //Big Threadmill, >>>>>> + obj.createentity(128, 208, 2, 10, 4); //Big Threadmill, >>>>>> + roomname = "Select Track"; + result = contents; + break; + } + + case rn(52,49): + { + + static const short contents[] = { + 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, + 444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444, + 9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,8,8,8,8,8,8,8,8,0,0,0,0,0,0,0,0,8,8,8,8,8,8,8,8,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, + 364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364, + 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, + 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, + 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, + }; + + obj.createentity(0, 104, 2, 11, 4); //Big Threadmill, <<<<<< + obj.createentity(128, 104, 2, 11, 4); //Big Threadmill, <<<<<< + obj.createentity(256, 104, 2, 11, 4); //Big Threadmill, <<<<<< + obj.createentity(152, 128, 1, 0, 5, 72, 120, 256, 200); // Enemy, bounded + obj.createentity(240, 168, 1, 1, 5, 72, 120, 256, 200); // Enemy, bounded + obj.createentity(72, 168, 1, 1, 5, 72, 120, 256, 200); // Enemy, bounded + obj.createentity(0, 112, 2, 10, 4); //Big Threadmill, >>>>>> + obj.createentity(64, 112, 2, 10, 4); //Big Threadmill, >>>>>> + obj.createentity(128, 112, 2, 10, 4); //Big Threadmill, >>>>>> + obj.createentity(192, 112, 2, 10, 4); //Big Threadmill, >>>>>> + obj.createentity(256, 112, 2, 10, 4); //Big Threadmill, >>>>>> + obj.createentity(64, 32, 3,10); //Disappearing Platform + obj.createentity(96, 32, 3,10); //Disappearing Platform + obj.createentity(192, 32, 3,10); //Disappearing Platform + obj.createentity(224, 32, 3,10); //Disappearing Platform + roomname = "You Chose... Poorly"; + result = contents; + break; + } + + case rn(53,49): + { + + static const short contents[] = { + 107,107,107,107,107,107,107,107,229,0,0,0,0,809,689,689,227,107,107,107,107,107,107,229,689,689,811,0,0,0,0,227,107,107,107,107,107,107,107,107, + 268,268,268,268,268,268,268,268,269,0,0,0,0,809,689,689,227,107,107,107,107,107,107,229,689,689,811,0,0,0,0,267,268,268,268,268,268,268,268,268, + 9,9,9,9,9,9,9,9,9,0,0,0,0,809,689,689,227,107,107,107,107,107,107,229,689,689,811,0,0,0,0,9,9,9,9,9,9,9,9,9, + 0,0,0,0,0,0,0,0,0,0,0,0,0,809,689,689,227,107,107,107,107,107,107,229,689,689,811,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,809,689,689,227,107,107,107,107,107,107,229,689,689,811,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,809,689,689,227,107,107,107,107,107,107,229,689,689,811,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,809,689,689,227,107,107,107,107,107,107,229,689,689,811,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,809,689,689,227,107,107,107,107,107,107,229,689,689,811,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,809,689,689,227,107,107,107,107,107,107,229,689,689,811,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,809,689,689,227,107,107,107,107,107,107,229,689,689,811,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,809,689,689,227,107,107,107,107,107,107,229,689,689,811,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,809,689,689,227,107,107,107,107,107,107,229,689,689,811,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,809,689,689,227,107,107,107,107,107,107,229,689,689,811,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,267,268,268,268,268,268,268,269,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,809,689,689,689,689,689,689,689,689,689,689,689,689,811,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,809,689,689,689,689,689,689,689,689,689,689,689,689,811,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,809,689,689,689,689,689,689,689,689,689,689,689,689,811,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,809,689,689,689,689,689,689,689,689,689,689,689,689,811,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,809,689,689,689,689,689,689,689,689,689,689,689,689,811,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,809,689,689,689,689,689,689,689,689,689,689,689,689,811,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,849,850,850,850,850,850,850,850,850,850,850,850,850,851,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, + 188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188, + 107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107, + 107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107, + 107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107, + }; + + obj.createentity(0, 104, 2, 11, 4); //Big Threadmill, <<<<<< + obj.createentity(64, 104, 2, 11, 4); //Big Threadmill, <<<<<< + obj.createentity(192, 104, 2, 11, 4); //Big Threadmill, <<<<<< + obj.createentity(256, 104, 2, 11, 4); //Big Threadmill, <<<<<< + obj.createentity(152, 120, 10, 0, 449530); // (savepoint) + obj.createentity(0, 112, 2, 10, 4); //Big Threadmill, >>>>>> + obj.createentity(64, 112, 2, 10, 4); //Big Threadmill, >>>>>> + obj.createentity(128, 112, 2, 10, 4); //Big Threadmill, >>>>>> + obj.createentity(192, 112, 2, 10, 4); //Big Threadmill, >>>>>> + obj.createentity(256, 112, 2, 10, 4); //Big Threadmill, >>>>>> + roomname = "Hyperspace Bypass 5"; + result = contents; + break; + } + + case rn(54,49): + { + + static const short contents[] = { + 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,0,0,0,0,0,0,0,0,212,92,92,92, + 253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,254,0,0,0,0,0,0,0,0,212,92,92,92, + 9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,0,0,0,0,0,0,0,0,212,92,92,92, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,92, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,92, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,763,764,764,764,764,764,764,764,212,92,92,92, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,803,683,683,683,683,683,683,683,212,92,92,92, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,803,683,683,683,683,683,683,683,212,92,92,92, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,803,683,683,683,683,683,683,683,212,92,92,92, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,803,683,683,683,683,683,683,683,212,92,92,92, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,803,683,683,683,683,683,683,683,212,92,92,92, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,172,173,173,173,173,174,683,683,683,683,212,92,92,92, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,92,92,214,683,683,683,683,212,92,92,92, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,92,92,214,683,683,683,683,212,92,92,92, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,92,92,214,683,683,683,683,212,92,92,92, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,92,92,214,683,683,683,683,212,92,92,92, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,92,92,214,683,683,683,683,212,92,92,92, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,252,253,253,253,253,254,683,683,683,683,212,92,92,92, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,803,683,683,683,683,683,683,683,212,92,92,92, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,803,683,683,683,683,683,683,683,212,92,92,92, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,8,8,8,8,8,8,0,0,0,0,843,844,844,844,844,844,844,844,212,92,92,92, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,172,173,173,173,173,173,174,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,92, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,92,92,92,214,8,8,8,8,8,8,8,8,8,8,8,8,212,92,92,92, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,92,92,92,133,173,173,173,173,173,173,173,173,173,173,173,173,134,92,92,92, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92, + 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,212,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92, + 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,134,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92, + 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92, + 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92, + 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92, + }; + + obj.platformtile = 319; + obj.createentity(0, 104, 2, 11, 4); //Big Threadmill, <<<<<< + obj.createentity(64, 104, 2, 9, 4); //Threadmill, <<< + obj.createentity(0, 112, 2, 10, 4); //Big Threadmill, >>>>>> + obj.createentity(64, 112, 2, 8, 4); //Threadmill, >>> + obj.createentity(136, 104, 2, 0, 5, 136, 88, 200, 152); // Platform, bounded + obj.createentity(168, 104, 2, 0, 5, 136, 88, 200, 152); // Platform, bounded + obj.createentity(80, 112, 2, 8, 4); //Threadmill, >>> + obj.createentity(80, 104, 2, 9, 4); //Threadmill, <<< + roomname = "Plain Sailing from Here On"; + result = contents; + break; + } + + + case rn(54,48): + { + + static const short contents[] = { + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 644,644,644,644,644,644,644,644,644,644,644,644,485,483,483,484,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,485,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,643,644,644,645,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,603,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483, + 0,0,0,0,0,0,0,0,775,776,777,0,0,775,776,777,0,0,775,776,777,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483, + 0,0,0,0,0,0,0,0,815,695,817,0,0,815,695,817,0,0,815,695,817,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483, + 0,0,0,0,0,0,0,0,815,695,817,0,0,815,695,817,0,0,815,695,817,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483, + 0,0,0,0,0,0,0,0,855,856,857,0,0,855,856,857,0,0,855,856,857,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483, + 0,0,0,0,0,0,0,0,775,776,777,0,0,775,776,777,0,0,775,776,777,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483, + 0,0,0,0,0,0,0,0,815,695,817,0,0,815,695,817,0,0,815,695,817,0,0,0,0,0,0,0,0,0,0,0,8,8,8,8,603,483,483,483, + 0,0,0,0,0,0,0,0,815,695,817,0,0,815,695,817,0,0,815,695,817,0,0,0,0,0,0,0,0,0,0,0,563,564,564,564,525,483,483,483, + 0,0,0,0,0,0,0,0,855,856,857,0,0,855,856,857,0,0,855,856,857,0,0,0,0,0,0,0,0,0,0,0,643,644,644,644,485,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483, + 0,0,0,0,0,0,0,0,775,776,777,0,0,775,776,777,0,0,775,776,777,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483, + 0,0,0,0,0,0,0,0,815,695,817,0,0,815,695,817,0,0,815,695,817,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483, + 0,0,0,0,0,0,0,0,815,695,817,0,0,815,695,817,0,0,815,695,817,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483,483, + 8,8,8,0,0,0,0,0,855,856,857,0,0,855,856,857,0,0,855,856,857,0,0,0,0,8,8,8,8,8,8,8,0,0,0,0,603,483,483,483, + 564,564,565,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,563,564,564,564,564,564,565,0,0,0,0,603,483,483,483, + 483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,484,644,644,644,645,0,0,0,0,603,483,483,483, + 483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,605,0,0,0,0,0,0,0,0,603,483,483,483, + 483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,605,0,0,0,0,0,0,0,0,603,483,483,483, + 483,483,605,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,603,483,605,0,0,0,0,0,0,0,0,603,483,483,483, + 483,483,524,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,525,483,605,0,0,0,0,0,0,0,0,603,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,603,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,603,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,0,0,0,0,0,0,0,0,603,483,483,483, + }; + + obj.platformtile = 10; + obj.createentity(264, 128, 10, 0, 448540); // (savepoint) + obj.createentity(192, 32, 3, 10); //Disappearing Platform + obj.createentity(32, 176, 2, 3, 4); // Platform + obj.createentity(256, 120, 2, 8, 4); //Threadmill, >>> + obj.createentity(224, 184, 2, 8, 4); //Threadmill, >>> + obj.createentity(0, 16, 2, 10, 4); //Big Threadmill, >>>>>> + obj.createentity(64, 16, 2, 8, 4); //Threadmill, >>> + obj.createentity(104, 24, 10, 0, 448541); // (savepoint) + roomname = "Ha Ha Ha Not Really"; + result = contents; + break; + } + + + case rn(53,48): + { + + static const short contents[] = { + 510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510, + 671,671,671,671,671,671,671,671,671,671,512,511,671,671,671,671,671,671,671,671,671,671,671,671,671,671,512,511,671,671,671,671,671,671,671,671,671,671,671,671, + 9,9,9,9,9,9,9,9,9,9,630,632,9,9,9,9,9,9,9,9,9,9,9,9,9,9,630,632,9,9,9,9,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,630,632,0,0,0,0,0,0,0,0,0,0,0,0,0,0,630,632,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,630,632,0,0,0,0,0,0,0,0,0,0,0,0,0,0,630,632,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,670,672,0,0,0,0,0,0,0,0,0,0,0,0,0,0,670,672,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,9,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9,9,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,8,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,590,592,0,0,0,0,0,0,0,0,0,0,0,0,0,0,590,592,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,630,632,0,0,0,0,0,0,0,0,0,0,0,0,0,0,630,632,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,630,632,0,0,0,0,0,0,0,0,0,0,0,0,0,0,630,632,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,8,8,8,630,632,8,8,8,8,8,8,8,8,8,8,8,8,8,8,630,632,0,0,0,0, + 0,0,0,0,0,0,590,591,591,591,591,591,591,591,591,591,591,591,552,551,591,591,591,591,591,591,591,591,591,591,591,591,591,591,552,632,0,0,0,0, + 0,0,0,0,0,0,630,510,511,671,671,671,671,671,671,671,671,671,671,671,671,671,671,671,671,671,671,671,671,671,671,512,510,510,510,632,0,0,0,0, + 0,0,0,0,0,0,630,510,632,0,0,0,0,0,0,0,0,9,9,9,9,9,9,0,0,0,0,0,0,0,0,630,510,510,510,632,0,0,0,0, + 0,0,0,0,0,0,630,510,632,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,630,510,510,510,632,0,0,0,0, + 0,0,0,0,0,0,630,510,632,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,630,510,510,510,632,0,0,0,0, + 0,0,0,0,0,0,630,510,632,0,0,0,0,778,779,779,779,779,779,779,779,779,779,779,779,779,780,0,0,0,0,630,510,510,510,632,0,0,0,0, + 0,0,0,0,0,0,630,510,632,0,0,0,0,818,698,698,698,698,698,698,698,698,698,698,698,698,820,0,0,0,0,630,510,510,510,632,8,8,8,8, + 0,0,0,0,0,0,630,510,632,0,0,0,0,818,698,698,698,698,698,698,698,698,698,698,698,698,820,0,0,0,0,630,510,510,510,551,591,591,591,591, + 0,0,0,0,0,0,630,510,632,0,0,0,0,818,698,698,698,698,698,698,698,698,698,698,698,698,820,0,0,0,0,630,510,510,510,510,510,510,510,510, + 0,0,0,0,590,591,552,510,632,0,0,0,0,818,698,698,0,0,0,0,0,0,0,0,698,698,820,0,0,0,0,630,510,510,510,510,510,510,510,510, + 0,0,0,0,630,510,510,510,632,0,0,0,0,818,698,698,590,591,591,591,591,591,591,592,698,698,820,0,0,0,0,630,510,510,510,510,510,510,510,510, + 8,8,8,8,630,510,510,510,632,0,0,0,0,818,698,698,630,510,510,510,510,510,510,632,698,698,820,0,0,0,0,630,510,510,510,510,510,510,510,510, + 591,591,591,591,552,510,510,510,632,0,0,0,0,818,698,698,630,510,510,510,510,510,510,632,698,698,820,0,0,0,0,630,510,510,510,510,510,510,510,510, + 510,510,510,510,510,510,510,510,632,0,0,0,0,818,698,698,630,510,510,510,510,510,510,632,698,698,820,0,0,0,0,630,510,510,510,510,510,510,510,510, + 510,510,510,510,510,510,510,510,632,0,0,0,0,818,698,698,630,510,510,510,510,510,510,632,698,698,820,0,0,0,0,630,510,510,510,510,510,510,510,510, + 510,510,510,510,510,510,510,510,632,0,0,0,0,818,698,698,630,510,510,510,510,510,510,632,698,698,820,0,0,0,0,630,510,510,510,510,510,510,510,510, + }; + + obj.platformtile = 279; + obj.createentity(32, 168, 9, 3); // (shiny trinket) + obj.createentity(16, 112, 2, 9, 4); //Threadmill, <<< + obj.createentity(0, 112, 2, 9, 4); //Threadmill, <<< + obj.createentity(0, 104, 2, 10, 4); //Big Threadmill, >>>>>> + obj.createentity(256, 16, 2, 10, 4); //Big Threadmill, >>>>>> + obj.createentity(96, 32, 2, 3, 4); // Platform + obj.createentity(240, 88, 2, 2, 4); // Platform + obj.createentity(128, 184, 2, 10, 4); //Big Threadmill, >>>>>> + obj.createentity(152, 168, 10, 1, 448530); // (savepoint) + obj.createentity(72, 128, 2, 11, 4); //Big Threadmill, <<<<<< + obj.createentity(184, 128, 2, 11, 4); //Big Threadmill, <<<<<< + obj.createentity(48, 104, 2, 10, 4); //Big Threadmill, >>>>>> + + roomname="You Just Keep Coming Back"; + result = contents; + break; + } + + case rn(52,48): + { + + static const short contents[] = { + 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, + 450,450,450,450,291,289,289,289,290,450,450,450,450,450,450,450,450,450,291,289,289,290,450,450,450,450,450,450,450,450,450,291,289,289,289,290,450,450,450,450, + 9,9,9,9,409,289,289,289,411,7,7,7,7,7,7,7,7,7,409,289,289,411,7,7,7,7,7,7,7,7,7,409,289,289,289,411,9,9,9,9, + 0,0,0,0,449,450,450,450,451,680,680,680,680,680,680,680,680,680,409,289,289,411,680,680,680,680,680,680,680,680,680,449,450,450,450,451,0,0,0,0, + 0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,409,289,289,411,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0, + 0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,449,450,450,451,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0, + 0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,7,7,7,7,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0, + 0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0, + 0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0, + 0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0, + 0,0,0,0,0,0,800,680,369,370,370,371,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,369,370,370,371,680,802,0,0,0,0,0,0, + 0,0,0,0,0,0,800,680,409,289,289,411,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,409,289,289,411,680,802,0,0,0,0,0,0, + 0,0,0,0,0,0,800,680,409,289,289,411,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,409,289,289,411,680,802,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,409,289,289,411,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,409,289,289,411,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,409,289,289,411,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,409,289,289,411,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,800,680,409,289,289,411,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,409,289,289,411,680,802,0,0,0,0,0,0, + 0,0,0,0,0,0,800,680,409,289,289,411,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,409,289,289,411,680,802,0,0,0,0,0,0, + 0,0,0,0,0,0,800,680,449,450,450,451,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,449,450,450,451,680,802,0,0,0,0,0,0, + 0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0, + 0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0, + 0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0, + 0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,6,6,6,6,6,6,6,6,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0, + 0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,369,370,370,370,370,370,370,371,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0, + 0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,409,289,289,289,289,289,289,411,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0, + 0,0,369,370,370,370,370,370,371,680,680,680,680,680,680,680,409,289,289,289,289,289,289,411,680,680,680,680,680,680,680,369,370,370,370,370,370,371,0,0, + 8,8,409,289,289,289,289,289,411,6,6,6,6,6,6,6,409,289,289,289,289,289,289,411,6,6,6,6,6,6,6,409,289,289,289,289,289,411,8,8, + 370,370,331,289,289,289,289,289,330,370,370,370,370,370,370,370,331,289,289,289,289,289,289,330,370,370,370,370,370,370,370,331,289,289,289,289,289,330,370,370, + 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, + 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, + 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, + }; + + obj.platformtile = 359; + obj.createentity(256, 104, 2, 10, 4); //Big Threadmill, >>>>>> + obj.createentity(256, 112, 2, 11, 4); //Big Threadmill, <<<<<< + obj.createentity(0, 112, 2, 11, 4); //Big Threadmill, <<<<<< + obj.createentity(0, 104, 2, 10, 4); //Big Threadmill, >>>>>> + obj.createentity(120, 104, 2, 0, 4, 96, 64, 224, 160); // Platform, bounded + obj.createentity(168, 80, 2, 0, 4, 96, 64, 224, 160); // Platform, bounded + obj.createentity(72, 64, 10, 1, 448520); // (savepoint) + obj.createentity(232, 64, 10, 1, 448521); // (savepoint) + obj.createentity(232, 144, 10, 0, 448522); // (savepoint) + obj.createentity(72, 144, 10, 0, 448523); // (savepoint) + roomname = "Gordian Knot"; + result = contents; + break; + } + + + case rn(51,48): + { + + static const short contents[] = { + 313,313,313,313,313,313,313,435,0,0,0,0,433,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313, + 313,313,313,313,313,313,313,435,0,0,0,0,433,313,313,313,313,313,313,313,313,313,313,313,313,313,313,314,474,474,474,474,474,474,474,474,474,474,474,474, + 313,313,313,313,313,313,313,435,770,770,771,0,433,313,313,313,313,313,313,313,313,313,313,313,313,313,313,435,9,9,9,9,9,9,9,9,9,9,9,9, + 313,313,313,313,313,313,313,435,689,689,811,0,433,313,313,313,313,313,313,313,313,313,313,313,313,313,313,435,0,0,0,0,0,0,0,0,0,0,0,0, + 313,313,313,314,474,474,474,475,689,689,811,0,473,474,474,474,474,474,474,474,474,474,474,474,474,474,474,475,0,0,0,0,0,0,0,0,0,0,0,0, + 313,313,313,435,0,0,0,0,689,689,811,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 313,313,313,435,689,689,689,689,689,689,811,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 313,313,313,435,689,689,689,689,689,689,811,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 313,313,313,435,689,689,689,689,689,689,811,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 313,313,313,435,689,689,689,689,689,689,811,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 313,313,313,435,689,689,689,689,689,689,811,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 313,313,313,435,689,689,689,689,689,689,811,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 313,313,313,435,689,689,689,689,393,394,394,394,394,394,394,395,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 313,313,313,435,689,689,689,689,473,474,474,474,474,474,474,475,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 313,313,313,435,689,689,689,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 313,313,313,435,689,689,689,689,689,689,811,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 313,313,313,435,689,689,689,689,689,689,811,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 313,313,313,435,689,689,689,689,689,689,811,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 313,313,313,435,850,850,850,850,850,850,851,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 313,313,313,435,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 313,313,313,435,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 313,313,313,435,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 313,313,313,435,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 313,313,313,354,394,394,394,394,394,395,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 313,313,313,313,313,313,313,313,313,435,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 313,313,313,313,313,313,313,313,313,435,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, + 313,313,313,313,313,313,313,313,313,354,394,394,394,394,394,394,394,394,394,394,394,394,394,394,394,394,394,394,394,394,394,394,394,394,394,394,394,394,394,394, + 313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313, + 313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313, + 313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313, + }; + + obj.createentity(256, 112, 2, 11, 4); //Big Threadmill, <<<<<< + obj.createentity(192, 112, 2, 11, 4); //Big Threadmill, <<<<<< + obj.createentity(128, 112, 2, 11, 4); //Big Threadmill, <<<<<< + obj.createentity(64, 112, 2, 11, 4); //Big Threadmill, <<<<<< + obj.createentity(128, 104, 2, 10, 4); //Big Threadmill, >>>>>> + obj.createentity(192, 104, 2, 10, 4); //Big Threadmill, >>>>>> + obj.createentity(256, 104, 2, 10, 4); //Big Threadmill, >>>>>> + obj.createentity(96, 40, 2, 11, 4); //Big Threadmill, <<<<<< + obj.createentity(160, 40, 2, 11, 4); //Big Threadmill, <<<<<< + obj.createentity(32, 40, 2, 9, 4); //Threadmill, <<< + obj.createentity(72, 80, 10, 1, 448510); // (savepoint) + obj.createentity(104, 128, 1, 0, 5, 104, 120, 288, 200); // Enemy, bounded + obj.createentity(160+8, 168, 1, 1, 5, 104, 120, 288, 200); // Enemy, bounded + obj.createentity(216+16, 128, 1, 0, 5, 104, 120, 288, 200); // Enemy, bounded + + roomname = "Backsliders"; + result = contents; + break; + } + + case rn(51,47): + { + + static const short contents[] = { + 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,405,0,0,0,0,403,283,283,283,283,283,283,283,283,283,283,283,283,283,283, + 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,405,0,0,0,0,403,283,283,283,283,283,283,283,283,283,283,283,283,283,283, + 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,405,0,0,0,0,403,283,283,283,283,283,283,283,283,283,283,283,283,283,283, + 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,405,0,0,0,0,403,283,283,283,283,283,283,283,283,283,283,283,283,283,283, + 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,405,0,0,0,0,443,444,444,444,444,444,444,444,444,444,444,444,444,444,444, + 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,405,776,776,776,776,776,776,776,776,776,776,776,776,776,776,776,776,777,0,0, + 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,405,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,817,0,0, + 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,324,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364, + 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, + 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, + 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, + 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, + 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, + 283,283,283,283,283,283,283,283,283,284,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,285,283,283,283,283,283, + 283,284,444,444,444,444,444,444,444,445,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,284,444,444,444,444, + 283,405,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,443,445,695,817,0,0, + 283,405,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,817,0,0, + 283,405,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,817,0,0, + 283,405,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,363,365,695,817,0,0, + 283,324,364,364,364,364,364,364,364,364,364,365,695,695,695,695,363,364,364,364,364,364,364,364,364,364,364,364,364,365,695,695,695,695,403,324,364,364,364,364, + 283,283,283,283,283,283,283,284,444,444,444,445,695,695,695,695,403,283,283,283,283,283,283,283,283,283,283,283,283,405,695,695,695,695,443,444,444,444,444,444, + 283,283,283,283,283,283,283,405,695,695,695,695,695,695,695,695,403,283,283,283,283,283,283,283,283,283,283,283,283,405,695,695,695,695,695,695,695,817,0,0, + 283,283,283,283,283,283,283,405,856,856,856,856,856,856,856,856,403,283,283,283,283,283,283,283,283,283,283,283,283,405,856,856,856,856,856,856,856,857,0,0, + 283,283,283,283,283,283,283,405,0,0,0,0,0,0,0,0,403,283,283,283,283,283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,0,0,0,0, + 283,283,283,283,283,283,283,405,0,0,0,0,0,0,0,0,403,283,283,283,283,283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,0,0,0,0, + 283,283,283,283,283,283,283,405,0,0,0,0,363,364,364,364,325,283,283,283,283,283,283,283,283,283,283,283,283,324,364,364,364,364,364,364,364,364,364,364, + 283,283,283,283,283,283,283,405,0,0,0,0,403,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, + 283,283,283,283,283,283,283,405,0,0,0,0,403,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, + }; + + obj.createentity(72, 184, 10, 0, 447510); // (savepoint) + obj.createentity(80, 128, 2, 10, 4); //Big Threadmill, >>>>>> + obj.createentity(144, 128, 2, 10, 4); //Big Threadmill, >>>>>> + obj.createentity(208, 128, 2, 10, 4); //Big Threadmill, >>>>>> + + obj.createentity(24 - 8, 144 - 8, 1, 10, 0); // Enemy + + obj.createentity(24 - 8 + 117, 144 - 8, 1, 10, 1); // Enemy + obj.createentity(24 - 8 + (117 * 2), 144 - 8, 1, 10, 1); // Enemy + obj.createentity(24 - 8 + (117 * 3), 144 - 8, 1, 10, 1); // Enemy + + //LIES emitter starts here + roomname = "The Cuckoo"; + result = contents; + break; + } + + case rn(52,47): + { + + static const short contents[] = { + 310,311,471,471,471,471,471,471,471,471,471,471,471,471,471,471,471,471,471,471,312,310,310,310,310,310,310,432,0,0,0,0,430,432,0,0,0,0,0,0, + 310,432,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,430,310,310,310,310,310,310,432,0,0,0,0,430,432,0,0,0,0,0,0, + 310,432,0,0,0,0,0,0,772,773,773,773,773,773,773,773,773,773,773,773,430,310,310,310,310,310,310,432,0,0,0,0,430,432,0,0,0,0,0,0, + 310,432,0,0,0,0,0,0,812,692,692,692,692,692,692,692,692,692,692,692,430,310,310,310,310,310,310,432,0,0,0,0,430,432,0,0,0,0,0,0, + 471,472,0,0,0,390,391,391,391,391,391,391,391,391,391,391,392,692,692,692,430,310,310,310,310,310,310,432,0,0,0,0,430,432,0,0,0,0,0,0, + 0,0,0,0,0,430,311,471,471,471,471,471,471,471,471,312,432,692,692,692,430,310,310,311,471,471,471,472,0,0,0,0,430,432,0,0,0,0,0,0, + 0,0,0,0,0,430,432,0,812,692,692,692,692,692,692,430,432,692,692,692,430,310,310,432,692,814,0,0,0,0,0,0,430,432,0,0,0,0,0,0, + 0,0,0,0,0,430,432,0,812,692,692,692,692,692,692,430,432,692,692,692,430,310,310,432,692,814,0,0,0,0,0,0,430,432,0,0,0,0,0,0, + 0,0,0,0,0,430,432,0,812,692,692,692,692,692,692,430,432,692,692,692,430,310,310,432,692,814,0,0,0,0,0,0,430,432,0,0,0,0,0,0, + 391,391,391,391,391,352,432,0,812,692,692,692,692,692,692,430,432,692,692,692,430,310,310,432,692,814,0,0,0,0,0,0,430,432,0,0,0,0,0,0, + 310,310,310,310,310,310,432,0,812,692,390,392,692,692,692,430,432,692,692,692,430,310,310,432,692,814,0,0,0,0,0,0,430,432,0,0,0,0,0,0, + 310,310,310,310,310,310,432,0,812,692,430,432,692,692,692,430,432,692,692,692,430,310,310,432,692,814,0,0,0,0,0,0,430,432,0,0,0,0,0,0, + 310,310,310,310,310,310,432,0,812,692,430,432,692,692,692,430,432,692,692,692,430,310,310,432,692,814,0,0,0,0,0,0,430,432,0,0,0,0,0,0, + 310,310,310,310,310,310,432,0,812,692,430,432,692,692,692,430,432,692,692,692,430,310,310,432,692,814,0,0,0,0,0,0,430,432,0,0,0,0,0,0, + 310,310,310,310,310,310,432,0,812,692,430,432,692,692,692,430,432,692,692,692,430,310,310,432,692,814,0,0,390,391,391,391,352,432,0,0,0,0,0,0, + 310,310,310,310,310,310,432,0,852,853,430,432,853,853,853,430,432,853,853,853,430,310,310,432,853,854,0,0,430,310,310,310,310,432,0,0,0,0,0,0, + 471,471,471,471,471,312,432,0,0,0,430,432,0,0,0,430,432,0,0,0,470,312,311,472,0,0,0,0,470,312,311,471,471,472,0,0,0,0,0,0, + 0,0,0,0,0,470,472,0,0,0,470,472,0,0,0,470,472,0,0,0,0,470,472,0,0,0,0,0,0,470,472,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,390,392,0,0,0,390,392,0,0,0,390,392,0,0,0,0,390,392,0,0,0,0,0,0,390,392,0,0,0,0,0,0,0,0,0, + 391,391,391,391,391,352,432,0,0,0,430,432,0,0,0,430,432,0,0,0,390,352,351,392,0,0,0,0,390,352,351,391,391,392,0,0,0,0,0,0, + 471,471,471,471,471,471,472,0,0,0,430,432,0,0,0,470,472,0,0,0,430,310,310,432,0,0,0,0,470,471,471,471,471,472,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,430,432,0,0,0,0,0,0,0,0,430,310,310,432,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,430,432,0,0,0,0,0,0,0,0,430,310,310,432,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,430,432,0,0,0,0,0,0,0,0,430,310,310,432,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,430,432,0,0,0,0,0,0,0,0,430,310,310,432,0,0,0,0,0,0,0,0,8,8,8,8,8,8,8,8, + 391,391,391,391,391,391,391,391,391,391,352,351,391,391,391,391,391,391,391,391,352,310,310,351,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391, + 310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310, + 310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310, + }; + + obj.createentity(8, 200, 10, 1, 447520); // (savepoint) + obj.createentity(200, 192, 9, 4); // (shiny trinket) + obj.createentity(232, 96, 10, 1, 447521); // (savepoint) + + obj.createentity(24 - 60 - 8, 144 - 8, 1, 10, 0); // Enemy + + obj.createentity(24 - 60 - 8 + 117, 144 - 8, 1, 10, 1); // Enemy + obj.createentity(24 - 60 - 8 + (117 * 2), 144 - 8, 1, 10, 1); // Enemy + obj.createentity(24 - 60 - 8 + (117 * 3), 144 - 8, 1, 10, 1); // Enemy + //LIES Emitter, manually positioned + roomname = "Clarion Call"; + result = contents; + break; + } + + case rn(51,46): + { + + static const short contents[] = { + 110,110,110,110,110,110,232,686,686,686,686,686,230,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, + 110,110,110,110,111,271,272,686,686,686,686,686,230,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, + 110,110,110,110,232,686,686,686,686,686,686,686,230,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, + 110,110,110,110,232,686,686,686,686,686,686,686,230,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, + 110,110,110,110,232,686,686,686,686,686,686,686,230,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, + 110,110,110,110,232,686,686,686,686,686,686,686,230,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, + 110,110,110,110,151,191,192,686,686,686,686,686,230,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, + 110,110,110,110,110,110,232,686,686,686,686,686,230,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, + 110,110,110,110,110,110,232,686,686,686,686,686,230,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, + 110,110,110,110,110,110,232,686,686,686,686,686,230,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, + 110,110,110,110,110,110,232,686,686,686,686,686,230,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, + 110,110,110,110,110,110,232,686,686,686,686,686,230,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, + 110,110,110,110,110,110,232,686,686,686,686,686,270,271,271,271,271,271,271,271,271,271,271,271,271,112,110,110,110,110,110,110,110,110,110,110,110,110,110,110, + 110,110,110,110,110,110,232,686,686,686,686,686,686,686,686,808,0,0,0,0,0,0,0,0,0,230,110,110,110,110,110,110,110,110,110,110,110,110,110,110, + 110,110,110,110,110,110,232,686,686,686,686,686,686,686,686,808,0,0,0,0,0,0,0,0,0,230,110,110,110,110,110,110,110,110,110,110,110,110,110,110, + 110,110,110,110,110,110,232,686,686,686,686,686,686,686,686,808,0,0,0,0,0,0,0,0,0,230,110,110,110,110,110,110,110,110,110,110,110,110,110,110, + 110,110,110,110,110,110,232,686,686,686,686,686,686,686,686,808,0,0,0,0,0,0,0,0,0,230,110,110,110,110,110,110,110,110,110,110,110,110,110,110, + 110,110,110,110,110,110,232,686,686,686,686,686,686,686,686,808,0,0,0,0,0,0,0,0,0,230,110,110,110,110,110,110,110,110,110,110,110,110,110,110, + 110,110,110,110,110,110,232,686,686,686,686,686,686,686,686,808,0,0,0,0,0,0,0,0,0,230,110,110,110,110,110,110,110,110,110,110,110,110,110,110, + 110,110,110,110,110,110,232,686,686,686,686,686,686,686,686,808,0,0,0,0,0,0,0,0,0,230,110,110,110,110,110,110,110,110,110,110,110,110,110,110, + 110,110,110,110,110,110,232,686,686,686,686,686,686,686,686,808,0,0,0,0,0,0,0,0,0,230,110,110,110,110,110,110,110,110,110,110,110,110,110,110, + 110,110,110,110,110,110,232,686,686,686,686,686,686,686,686,808,0,0,0,0,0,0,0,0,0,230,110,110,110,110,110,110,110,110,110,110,110,110,110,110, + 110,110,110,110,110,110,232,686,686,686,686,686,686,686,686,808,0,0,0,0,0,0,0,0,0,230,110,110,110,110,110,110,110,110,110,110,110,110,110,110, + 110,110,110,110,110,110,232,686,686,686,686,686,686,686,686,808,0,0,0,0,0,0,0,0,0,230,110,110,110,110,110,110,110,110,110,110,110,110,110,110, + 110,110,110,110,110,110,232,686,686,686,686,686,686,686,686,808,0,0,0,0,0,0,0,0,0,230,110,110,110,110,110,110,110,110,110,110,110,110,110,110, + 110,110,110,110,110,110,151,191,191,191,191,191,191,191,191,191,191,191,191,191,192,0,0,0,0,230,110,110,110,110,110,110,110,110,110,110,110,110,110,110, + 110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,232,0,0,0,0,230,110,110,110,110,110,110,110,110,110,110,110,110,110,110, + 110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,232,0,0,0,0,230,110,110,110,110,110,110,110,110,110,110,110,110,110,110, + 110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,232,0,0,0,0,230,110,110,110,110,110,110,110,110,110,110,110,110,110,110, + 110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,232,0,0,0,0,230,110,110,110,110,110,110,110,110,110,110,110,110,110,110, + }; + + obj.createentity(176, 104, 10, 0, 446510); // (savepoint) + + obj.createentity(7 * 8, 17 * 8, 1, 12, 0); // Enemy + + obj.createentity(7*8, 2*8, 1, 12, 1); // Enemy + //FACTORY emitter starts here + roomname = "The Solution is Dilution"; + result = contents; + break; + } + + case rn(51,45): + { + + static const short contents[] = { + 92,92,92,92,92,92,214,683,683,683,683,683,252,253,94,92,92,92,92,92,214,0,0,0,0,212,92,92,92,92,92,92,92,92,92,92,92,92,92,92, + 92,92,92,92,92,92,214,683,683,683,683,683,683,683,212,92,92,92,92,92,214,0,0,0,0,212,92,92,92,92,92,92,92,92,92,92,92,92,92,92, + 92,92,92,92,92,92,214,683,683,683,683,683,683,683,212,92,92,92,92,92,214,0,0,0,0,212,92,92,92,92,92,92,92,92,92,92,92,92,92,92, + 92,92,92,92,92,92,214,683,683,683,683,683,683,683,212,92,92,92,92,92,214,0,0,0,0,212,92,92,92,92,92,92,92,92,92,92,92,92,92,92, + 92,92,92,92,92,92,214,683,683,683,683,683,683,683,212,92,92,92,92,92,214,0,0,0,0,212,92,92,92,92,92,92,92,92,92,92,92,92,92,92, + 92,92,92,92,92,92,214,683,683,683,683,683,683,683,212,92,92,92,92,92,214,0,0,0,0,212,92,92,92,92,92,92,92,92,92,92,92,92,92,92, + 92,92,92,92,92,92,214,683,683,683,683,683,683,683,212,92,92,92,92,92,214,0,0,0,0,212,92,92,92,92,92,92,92,92,92,92,92,92,92,92, + 92,92,92,92,92,92,214,683,683,683,683,683,172,173,134,92,92,92,92,92,214,0,0,0,0,212,92,92,92,92,92,92,92,92,92,92,92,92,92,92, + 92,92,92,92,92,92,214,683,683,683,683,683,212,92,92,92,92,92,92,92,214,0,0,0,0,212,92,92,92,92,92,92,92,92,92,92,92,92,92,92, + 92,92,92,92,92,92,214,683,683,683,683,683,212,92,92,92,92,92,92,92,214,0,0,0,0,252,253,253,253,253,253,253,253,253,253,253,253,253,253,253, + 92,92,92,92,93,253,254,683,683,683,683,683,212,92,92,92,92,92,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 92,92,92,92,214,683,683,683,683,683,683,683,212,92,92,92,92,92,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 92,92,92,92,214,683,683,683,683,683,683,683,212,92,92,92,92,92,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 92,92,92,92,214,683,683,683,683,683,683,683,212,92,92,92,92,92,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 92,92,92,92,214,683,683,683,683,683,683,683,212,92,92,92,92,92,92,92,133,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173, + 92,92,92,92,214,683,683,683,683,683,683,683,212,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92, + 92,92,92,92,214,683,683,683,683,683,683,683,212,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92, + 92,92,92,92,133,173,174,683,683,683,683,683,212,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92, + 92,92,92,92,92,92,214,683,683,683,683,683,212,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92, + 92,92,92,92,92,92,214,683,683,683,683,683,212,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92, + 92,92,92,92,92,92,214,683,683,683,683,683,252,253,94,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92, + 92,92,92,92,92,92,214,683,683,683,683,683,683,683,212,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92, + 92,92,92,92,92,92,214,683,683,683,683,683,683,683,212,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92, + 92,92,92,92,92,92,214,683,683,683,683,683,683,683,212,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92, + 92,92,92,92,92,92,214,683,683,683,683,683,683,683,212,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92, + 92,92,92,92,92,92,214,683,683,683,683,683,683,683,212,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92, + 92,92,92,92,92,92,214,683,683,683,683,683,683,683,212,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92, + 92,92,92,92,92,92,214,683,683,683,683,683,172,173,134,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92, + 92,92,92,92,92,92,214,683,683,683,683,683,212,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92, + 92,92,92,92,92,92,214,683,683,683,683,683,212,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92, + }; + + obj.createentity(96, 168, 10, 0, 445510); // (savepoint) + + obj.createentity(7 * 8, 36 * 8, 1, 12, 0); // Enemy + + obj.createentity(7 * 8, (36 * 8)-108, 1, 12, 1); // Enemy + obj.createentity(7 * 8, (36 * 8)-216, 1, 12, 1); // Enemy + //FACTORY emitter starts here (manually placed) + + roomname = "Lighter Than Air"; + result = contents; + break; + } + + + case rn(51,44): + { + + static const short contents[] = { + 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, + 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,293,453,453,453,453,453,453,453,294,292,292, + 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,293,454,0,0,0,0,0,0,0,412,292,292, + 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,293,454,0,0,0,0,0,0,0,0,412,292,292, + 292,292,292,292,292,292,293,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,454,0,0,0,0,0,0,0,0,0,412,292,292, + 292,292,292,292,292,292,414,701,701,701,701,701,701,701,701,823,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292, + 292,292,292,292,292,292,414,701,701,701,701,701,701,701,701,823,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292, + 292,292,292,292,292,292,414,701,701,701,701,701,701,701,701,823,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292, + 292,292,292,292,292,292,414,701,701,701,701,701,701,701,701,823,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292, + 292,292,292,292,292,292,414,701,701,701,701,701,701,701,701,823,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292, + 292,292,292,292,292,292,414,701,701,701,701,701,701,701,701,823,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292, + 292,292,292,292,292,292,414,701,701,701,701,701,701,701,701,823,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292, + 292,292,292,292,292,292,414,701,701,701,701,701,701,701,701,823,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292, + 292,292,292,292,292,292,414,701,701,701,701,701,701,701,701,823,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292, + 292,292,292,292,292,292,414,701,701,701,701,701,701,701,701,823,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292, + 292,292,292,292,292,292,414,701,701,701,701,701,701,701,701,823,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292, + 292,292,292,292,292,292,414,701,701,701,701,701,701,701,701,823,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292, + 292,292,292,292,292,292,414,701,701,701,701,701,701,701,701,823,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292, + 292,292,292,292,292,292,414,701,701,701,701,701,701,701,701,823,0,0,0,0,372,373,373,373,373,373,373,373,373,373,373,373,373,374,0,0,0,412,292,292, + 292,292,292,292,292,292,414,701,701,701,701,701,701,701,701,823,0,0,0,372,334,292,292,292,292,292,292,292,292,292,292,292,292,414,0,0,0,412,292,292, + 292,292,292,292,293,453,454,701,701,701,701,701,701,701,701,823,0,0,372,334,292,292,292,292,292,292,292,292,292,292,292,292,292,414,0,0,0,412,292,292, + 292,292,292,292,414,701,701,701,701,701,701,701,372,373,373,373,373,373,334,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,0,0,0,412,292,292, + 292,292,292,292,414,701,701,701,701,701,701,701,412,292,292,292,292,292,292,292,293,453,453,453,453,453,453,453,453,453,453,453,453,454,0,0,0,412,292,292, + 292,292,292,292,414,701,701,701,701,701,701,701,412,292,292,292,292,292,292,292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292, + 292,292,292,292,414,701,701,701,701,701,701,701,412,292,292,292,292,292,292,292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292, + 292,292,292,292,414,701,701,701,701,701,701,701,412,292,292,292,292,292,292,292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292, + 292,292,292,292,414,701,701,701,701,701,701,701,412,292,292,292,292,292,292,292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292, + 292,292,292,292,333,373,374,701,701,701,701,701,412,292,292,292,292,292,292,292,414,0,0,0,0,372,373,373,373,373,373,373,373,373,373,373,373,334,292,292, + 292,292,292,292,292,292,414,701,701,701,701,701,412,292,292,292,292,292,292,292,414,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292,292,292,292, + 292,292,292,292,292,292,414,701,701,701,701,701,412,292,292,292,292,292,292,292,414,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292,292,292,292, + }; + + obj.createentity(224, 200, 10, 1, 444510); // (savepoint) + + obj.createentity(56, 40, 1, 0, 2); // Enemy //collector + + obj.createentity(7 * 8, 36 * 8, 1, 12, 0); // Enemy + + obj.createentity(7 * 8, (36 * 8)-108, 1, 12, 1); // Enemy + obj.createentity(7 * 8, (36 * 8)-216, 1, 12, 1); // Enemy + //FACTORY emitter starts here (manually placed) + + if(!game.intimetrial) + { + obj.createentity(18 * 8, (5 * 8) + 4, 14); //Teleporter! + } + roomname = "Level Complete!"; + result = contents; + break; + } + + //Ok! Big open area is here: + case rn(52,45): + { + + static const short contents[] = { + 286,286,286,286,408,0,0,0,0,0,806,686,686,686,686,686,686,686,686,686,808,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 286,286,286,286,408,0,0,0,0,0,806,686,686,686,686,686,686,686,686,686,808,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 286,286,286,286,408,0,0,0,0,0,806,686,686,686,686,686,686,686,686,686,808,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 286,286,286,286,408,0,0,0,0,0,806,686,686,686,686,686,686,686,686,686,808,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 286,286,287,447,448,0,0,0,0,0,806,686,686,686,686,686,686,686,686,686,808,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 286,286,408,0,0,0,0,0,0,0,806,686,686,686,686,686,686,686,686,686,808,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 286,286,408,0,0,0,0,0,0,0,806,686,686,686,686,686,686,686,686,686,808,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,366,367,367, + 286,286,408,0,0,0,0,0,0,0,806,686,686,686,686,686,686,686,686,686,808,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,446,447,447, + 286,286,408,0,0,0,0,0,0,0,806,686,686,686,686,686,686,686,686,686,808,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 447,447,448,0,0,0,0,0,0,0,806,686,686,686,686,686,686,686,686,686,727,767,767,767,767,767,767,767,767,767,767,767,767,767,767,767,768,0,0,0, + 0,0,0,0,0,0,0,0,0,0,806,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,808,0,0,0, + 0,0,0,0,0,0,0,0,0,0,806,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,808,0,0,0, + 0,0,0,0,0,0,0,0,0,0,806,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,808,0,0,0, + 0,0,0,0,0,0,0,0,0,0,806,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,366,368,686,686,686,686,808,0,0,0, + 367,367,367,367,368,0,0,0,0,0,806,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,406,408,686,686,686,686,808,0,0,0, + 286,286,286,286,408,0,0,0,0,0,806,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,406,327,367,368,686,686,808,0,0,0, + 286,286,286,286,408,0,0,0,0,0,806,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,406,286,286,408,686,686,808,0,0,0, + 286,286,286,286,408,0,0,0,0,0,806,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,366,367,328,286,286,408,686,686,808,0,0,0, + 286,286,286,286,327,367,368,0,0,0,806,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,406,286,286,286,286,408,686,686,808,0,0,0, + 286,286,286,286,286,286,408,0,0,0,806,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,406,286,286,286,286,327,367,368,808,0,0,0, + 286,286,286,286,286,286,408,0,0,0,806,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,406,286,286,286,286,286,286,408,808,0,0,0, + 286,286,286,286,286,286,327,367,367,367,367,367,367,368,686,686,686,686,686,686,686,686,686,686,686,686,686,686,406,286,286,286,286,286,286,408,808,0,0,0, + 286,286,286,286,286,286,286,286,286,286,286,286,286,408,686,686,686,686,686,686,686,686,686,686,686,686,686,686,406,286,286,286,286,286,286,408,808,0,0,0, + 286,286,286,286,286,286,286,286,286,286,286,286,286,327,367,367,367,367,367,367,367,367,367,368,686,686,686,686,406,286,286,286,286,286,286,408,808,0,0,0, + 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,408,686,686,686,686,406,286,286,286,286,286,286,327,367,368,0,0, + 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,327,367,367,367,367,328,286,286,286,286,286,286,286,286,408,0,0, + 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,327,367,367, + 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, + 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, + 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, + }; + roomname = "Green Grotto"; + result = contents; + break; + } + + case rn(52,44): + { + + static const short contents[] = { + 98,98,98,98,220,0,0,0,0,0,800,680,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,0,0,0,0,0,0,218,98,98,98,98, + 98,98,98,98,220,0,0,0,0,0,800,680,258,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,260,0,0,0,0,0,0,218,98,98,98,98, + 98,98,98,98,220,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0,0,218,98,99,259,259, + 98,98,98,98,220,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0,0,218,98,220,0,0, + 98,98,98,98,220,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0,0,218,98,220,0,0, + 98,98,98,98,220,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0,0,218,98,220,0,0, + 98,98,98,98,220,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0,0,218,98,220,0,0, + 98,98,98,98,139,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,140,98,220,0,0, + 98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,0,0, + 98,98,98,98,99,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,260,0,0, + 98,98,98,98,220,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0,0,0,0,0,0,0, + 98,98,98,98,220,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0,0,0,0,0,0,0, + 98,98,98,99,260,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0,0,0,0,0,0,0, + 98,98,98,220,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0,0,0,0,0,0,0, + 98,98,98,220,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0,0,0,0,0,0,0, + 98,98,98,220,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0,0,0,0,0,0,0, + 98,98,98,220,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0,0,0,0,0,0,0, + 98,98,98,220,0,0,0,0,0,0,800,680,178,179,179,179,179,179,179,179,180,680,680,680,680,680,680,802,0,0,0,0,0,0,0,0,0,0,0,0, + 98,98,98,220,0,0,0,0,0,0,800,680,258,259,259,259,259,259,259,259,260,680,680,680,680,680,680,802,0,0,0,0,0,0,0,0,0,0,0,0, + 98,98,98,220,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0,0,0,0,0,0,0, + 98,98,98,220,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0,0,0,0,0,0,0, + 98,98,98,220,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,681,841,841,841,841,841,841,842,0,0,0,0,0,0,0,0,0,0,0,0, + 98,98,98,220,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 98,98,98,139,180,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0,0,0,178,179,179,179,179,179,180,0,0,0,0, + 98,98,98,98,220,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0,0,0,258,259,259,259,259,259,260,0,0,0,0, + 98,98,98,98,220,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 98,98,98,98,220,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 98,98,98,98,220,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 98,98,98,98,220,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 98,98,98,98,220,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + obj.createentity(248 - 4, 160 - 48, 1, 1, 0); // Enemy + obj.createentity(124, 120, 20, 1); // (terminal) + obj.createblock(5, 124-4, 120, 20, 16, 14); + + obj.createentity(156, 40, 20, 1); // (terminal) + obj.createblock(5, 156-4, 40, 20, 16, 15); + + roomname = "The Hanged Man, Reversed"; + result = contents; + break; + } + + case rn(53,45): + { + + static const short contents[] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 370,370,370,370,370,370,370,371,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,369,370,370,370,370,370,370,370, + 450,450,450,450,450,450,450,451,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,449,450,450,450,450,450,450,450, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,369,370,370,370,370,370,370,370,370,370,370,370,370,371,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,449,450,450,450,450,450,450,450,450,450,450,450,450,451,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,371,0,0,0,0,0,0,0,0,369,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370, + 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,330,370,371,0,0,0,0,369,370,331,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, + 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,0,0,0,0,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, + 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,0,0,0,0,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, + }; + + obj.createentity(152, 120, 10, 0, 445530); // (savepoint) + roomname = "doomS"; + result = contents; + break; + } + + case rn(53,47): + { + + static const short contents[] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,169,170,170,171,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,169,170,170,171,0,0,0,0,0,0,0,0,209,89,89,211,0,0,0,0,0,0,0,0,169,170,170,171,0,0,0,0,0,0, + 0,0,0,0,0,0,209,89,89,211,0,0,0,0,0,0,0,0,209,89,89,211,0,0,0,0,0,0,0,0,209,89,89,211,0,0,0,0,0,0, + 0,0,0,0,0,0,249,91,90,251,0,0,0,0,0,0,0,0,249,91,90,251,0,0,0,0,0,0,0,0,249,91,90,251,0,0,0,0,0,0, + 0,0,0,0,0,0,0,249,251,0,0,0,0,0,0,0,0,0,0,249,251,0,0,0,0,0,0,0,0,0,0,249,251,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,169,171,0,0,0,0,0,0,0,0,0,0,169,171,0,0,0,0,0,0,0,0,0,0,169,171,0,0,0,0,0,0,0, + 0,0,0,0,0,0,169,131,130,171,0,0,0,0,0,0,0,0,169,131,130,171,0,0,0,0,0,0,0,0,169,131,130,171,0,0,0,0,0,0, + 0,0,0,0,0,0,209,89,89,211,0,0,0,0,0,0,0,0,209,89,89,211,0,0,0,0,0,0,0,0,209,89,89,211,0,0,0,0,0,0, + 0,0,0,0,0,0,209,89,89,211,0,0,0,0,0,0,0,0,209,89,89,211,0,0,0,0,0,0,0,0,209,89,89,211,0,0,0,0,0,0, + 0,0,0,0,0,0,209,89,89,211,0,0,0,0,0,0,0,0,209,89,89,211,0,0,0,0,0,0,0,0,209,89,89,211,0,0,0,0,0,0, + 0,0,0,0,0,0,209,89,89,211,0,0,0,0,0,0,0,0,209,89,89,211,0,0,0,0,0,0,0,0,209,89,89,211,0,0,0,0,0,0, + 8,8,8,8,8,8,209,89,89,211,8,8,8,8,8,8,8,8,209,89,89,211,8,8,8,8,8,8,8,8,209,89,89,211,8,8,8,8,8,8, + 170,170,170,170,170,170,131,89,89,130,170,170,170,170,170,170,170,170,131,89,89,130,170,170,170,170,170,170,170,170,131,89,89,130,170,170,170,170,170,170, + 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89, + 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89, + }; + + obj.createentity(24-60-8, 144-8, 1, 10, 0); // Enemy + //LIES Emitter, manually positioned + + obj.createentity(24 - 60 - 8 + 117, 144 - 8, 1, 10, 1); // Enemy + obj.createentity(24 - 60 - 8 + (117 * 2), 144 - 8, 1, 10, 1); // Enemy + obj.createentity(24 - 60 - 8 + (117 * 3), 144 - 8, 1, 10, 1); // Enemy + + roomname = "Chinese Rooms"; + result = contents; + break; + } + + case rn(53,46): + { + + static const short contents[] = { + 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,0,0,0,0,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, + 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,290,450,451,0,0,0,0,449,450,291,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, + 450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,451,0,0,0,0,0,0,0,0,449,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,369,370,370,370,370,370,370,370,370,370,370,370,370,371,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,449,450,450,450,450,450,450,450,450,450,450,450,450,451,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 370,370,370,370,370,370,370,371,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,369,370,370,370,370,370,370,370, + 450,450,450,450,450,450,450,451,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,449,450,450,450,450,450,450,450, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + obj.createentity(152, 96, 10, 1, 446530); // (savepoint) + roomname = "Swoop"; + result = contents; + break; + } + + case rn(52,46): + { + + static const short contents[] = { + 107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107, + 107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107, + 107,107,108,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268, + 107,107,229,689,811,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 107,107,229,689,811,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 107,107,229,689,811,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 107,107,229,689,811,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 107,107,229,689,811,0,0,187,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,189,0,0,0,0,0,0, + 107,107,229,689,811,0,0,267,268,268,268,268,268,268,268,268,268,268,268,109,107,107,108,268,268,268,268,268,268,268,268,268,109,229,0,0,0,0,0,0, + 107,107,229,689,811,0,0,9,9,9,9,9,9,9,9,9,9,9,9,227,107,107,229,9,9,9,9,9,9,9,9,9,227,229,0,0,0,0,0,0, + 107,107,229,689,811,0,0,0,0,0,0,0,0,0,0,0,0,0,0,227,107,107,229,0,0,0,0,0,0,0,0,0,227,229,0,0,0,0,0,0, + 107,107,229,689,811,0,0,0,0,0,0,0,0,0,0,0,0,0,0,267,268,268,269,0,0,0,0,0,0,0,0,0,227,229,0,0,0,0,0,0, + 107,107,229,689,811,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9,9,9,9,0,0,0,0,0,0,0,0,0,227,229,0,0,0,0,0,0, + 107,107,229,689,811,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,227,229,0,0,0,0,0,0, + 107,107,229,689,811,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,227,229,0,0,0,0,0,0, + 107,107,229,689,811,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,227,229,0,0,0,0,0,0, + 107,107,229,689,811,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,227,229,0,0,0,0,0,0, + 107,107,229,850,851,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,227,229,0,0,0,0,0,0, + 107,107,229,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,227,229,0,0,0,0,0,0, + 107,107,229,0,0,0,0,0,0,0,0,0,8,8,8,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,227,229,0,0,0,0,0,0, + 107,107,229,0,0,0,0,0,0,0,0,0,187,188,188,189,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,227,229,0,0,0,0,0,0, + 107,107,229,0,0,0,0,0,0,0,0,0,227,107,107,229,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,227,148,188,188,188,188,188,188, + 107,107,229,8,8,8,8,8,8,8,8,8,227,107,107,229,8,8,8,8,8,8,8,8,8,8,8,8,0,0,0,0,227,108,268,268,268,268,268,268, + 107,107,148,188,188,188,188,188,188,188,188,188,149,107,107,148,188,188,188,188,188,188,188,188,188,188,188,189,0,0,0,0,227,229,0,0,0,0,0,0, + 107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,229,0,0,0,0,227,229,0,0,0,0,0,0, + 107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,229,0,0,0,0,227,229,0,0,0,0,0,0, + 107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,229,0,0,0,0,227,229,0,0,0,0,0,0, + 107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,229,0,0,0,0,227,229,0,0,0,0,0,0, + 107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,229,0,0,0,0,227,229,0,0,0,0,0,0, + 107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,229,0,0,0,0,227,229,0,0,0,0,0,0, + }; + + obj.createentity(64, 40, 10, 1, 446520); // (savepoint) + obj.createentity(208, 88, 3, 827); //Disappearing Platform + obj.createentity(152, 160, 3, 827); //Disappearing Platform + obj.createentity(96, 88, 3, 827); //Disappearing Platform + obj.createentity(40, 160, 3, 827); //Disappearing Platform + roomname = "Manic Mine"; + result = contents; + break; + } + + + case rn(53,44): + { + + static const short contents[] = { + 89,89,89,89,89,89,89,89,89,89,89,89,89,89,211,0,0,0,0,0,0,0,0,0,0,209,89,89,89,89,89,89,89,89,89,89,89,89,89,89, + 89,89,89,89,89,89,89,89,89,89,89,89,89,89,211,0,0,0,0,0,0,0,0,0,0,209,89,89,89,89,89,89,89,89,89,89,89,89,89,89, + 250,250,250,250,250,250,250,250,250,250,250,250,91,89,211,0,0,0,0,0,0,0,0,0,0,209,89,90,250,250,250,250,250,250,250,250,250,250,250,250, + 0,0,0,0,0,0,0,0,0,0,0,0,209,89,211,0,0,0,0,0,0,0,0,0,0,209,89,211,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,209,89,211,0,0,0,0,0,0,0,0,0,0,209,89,211,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,209,89,211,8,8,0,0,0,0,0,0,8,8,209,89,211,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,209,89,211,210,210,0,0,0,0,0,0,210,210,209,89,211,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,209,89,211,9,9,0,0,0,0,0,0,9,9,209,89,211,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,209,89,211,0,0,0,0,0,0,0,0,0,0,209,89,211,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,209,89,211,0,0,0,0,0,0,0,0,0,0,209,89,211,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,209,89,211,0,8,8,0,0,0,0,8,8,0,209,89,211,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,209,89,211,0,210,210,0,0,0,0,210,210,0,209,89,211,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,209,89,211,0,9,9,0,0,0,0,9,9,0,209,89,211,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,209,89,211,0,0,0,0,0,0,0,0,0,0,209,89,211,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,775,776,776,776,209,89,211,776,776,776,776,776,776,776,776,776,776,209,89,211,776,776,776,777,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,815,695,695,695,209,89,211,695,695,695,695,695,695,695,695,695,695,209,89,211,695,695,695,817,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,815,695,695,695,209,89,211,695,695,695,695,695,695,695,695,695,695,209,89,211,695,695,695,817,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,815,695,695,695,209,89,211,695,695,695,695,695,695,695,695,695,695,209,89,211,695,695,695,817,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,815,695,695,695,209,89,130,170,170,170,170,170,170,170,170,170,170,131,89,211,695,695,695,817,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,815,695,695,695,249,250,91,89,89,89,89,89,89,89,89,89,89,90,250,251,695,695,695,817,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,815,695,695,695,695,695,249,250,250,250,250,250,250,250,250,250,250,251,695,695,695,695,695,817,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,815,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,817,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,815,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,817,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,815,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,817,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,815,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,817,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,855,856,856,856,856,856,856,856,856,856,856,856,856,856,856,856,856,856,856,856,856,856,856,857,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + roomname = "Sorrow"; + result = contents; + break; + } + + + case rn(54,45): + { + + static const short contents[] = { + 0,0,0,0,0,433,313,435,0,0,809,689,473,474,474,474,474,474,474,315,313,313,313,313,313,313,313,313,313,435,689,689,811,0,0,433,313,313,313,313, + 0,0,0,0,0,433,313,435,0,0,809,689,689,689,689,689,689,689,689,433,313,313,313,313,313,313,313,313,313,435,689,689,811,0,0,433,313,313,313,313, + 0,0,0,0,0,433,313,435,0,0,809,689,689,689,689,689,689,689,689,473,474,474,474,474,474,474,474,315,313,435,689,689,811,0,0,433,313,313,313,313, + 0,0,0,0,0,433,313,435,0,0,809,689,689,689,689,689,689,689,689,0,0,0,0,0,0,0,0,433,313,435,689,689,811,0,0,433,313,313,313,313, + 0,0,0,0,0,433,313,435,0,0,809,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,433,313,435,689,689,811,0,0,433,313,313,313,313, + 0,0,0,0,0,433,313,435,0,0,809,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,433,313,435,689,689,811,0,0,433,313,313,313,313, + 394,394,394,394,394,355,313,435,0,0,809,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,433,313,435,689,689,811,0,0,433,313,313,313,313, + 474,474,474,474,474,315,313,435,0,0,809,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,433,313,435,689,689,811,0,0,433,313,313,313,313, + 0,0,0,0,0,433,313,435,0,0,0,0,0,0,0,0,689,689,689,0,0,0,0,689,689,689,689,433,313,435,689,689,811,0,0,433,313,313,313,313, + 0,0,0,0,0,433,313,354,394,394,394,394,394,394,394,395,689,689,689,393,394,394,395,689,689,689,689,433,313,435,689,689,811,0,0,433,313,313,313,313, + 0,0,0,0,0,433,313,314,474,474,474,474,474,474,474,475,689,689,689,473,474,474,475,689,689,689,689,433,313,435,689,689,811,0,0,433,313,313,313,313, + 0,0,0,0,0,433,313,435,0,0,0,0,0,0,0,0,689,689,689,0,0,0,0,689,689,689,689,433,313,435,689,689,811,0,0,433,313,313,313,313, + 0,0,0,0,0,433,313,435,0,0,809,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,433,313,435,689,689,811,0,0,433,313,313,313,313, + 0,0,0,0,0,433,313,435,0,0,809,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,433,313,435,689,689,811,0,0,433,313,313,313,313, + 0,0,0,0,0,433,313,435,0,0,809,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,433,313,435,689,689,811,0,0,433,313,313,313,313, + 0,0,0,0,0,433,313,435,0,0,809,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,433,313,435,689,689,811,0,0,433,313,313,313,313, + 0,0,0,0,0,433,313,435,0,0,809,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,433,313,435,689,689,811,0,0,433,313,313,313,313, + 0,0,0,0,0,433,313,435,0,0,809,689,0,0,0,0,0,689,689,689,0,0,0,0,0,0,0,433,313,435,689,689,811,0,0,433,313,313,313,313, + 0,0,0,0,0,433,313,435,0,0,809,689,393,394,394,394,395,689,689,689,393,394,394,394,394,394,394,355,313,435,689,689,811,0,0,433,313,313,313,313, + 0,0,0,0,0,433,313,435,0,0,809,689,473,474,474,474,475,689,689,689,473,474,474,474,474,474,474,474,474,475,689,689,811,0,0,433,313,313,313,313, + 0,0,0,0,0,433,313,435,0,0,809,689,0,0,0,0,0,689,689,689,0,0,0,0,0,0,0,0,0,0,689,689,811,0,0,433,313,313,313,313, + 0,0,0,0,0,433,313,435,0,0,809,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,811,0,0,433,313,313,313,313, + 0,0,0,0,0,433,313,435,0,0,849,850,850,850,850,850,850,850,850,850,850,850,850,850,850,850,850,850,850,850,850,850,851,0,0,433,313,313,313,313, + 0,0,0,0,0,433,313,435,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,433,313,313,313,313, + 0,0,0,0,0,433,313,435,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,433,313,313,313,313, + 0,0,0,0,0,433,313,435,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,433,313,313,313,313, + 394,394,394,394,394,355,313,354,394,394,394,394,394,394,394,394,395,0,0,0,0,0,0,0,0,0,0,393,394,394,394,394,394,394,394,355,313,313,313,313, + 313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,435,0,0,0,0,0,0,0,0,0,0,433,313,313,313,313,313,313,313,313,313,313,313,313, + 313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,354,394,394,394,394,394,394,394,394,394,394,355,313,313,313,313,313,313,313,313,313,313,313,313, + 313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313, + }; + + obj.createentity(144-4, 208, 1, 1, 6); // Enemy + obj.createentity(128+4, 8, 1, 0, 6); // Enemy + obj.createentity(64, 200, 2, 11, 4); //Big Threadmill, <<<<<< + obj.createentity(216, 200, 2, 11, 4); //Big Threadmill, <<<<<< + obj.createentity(96, 160, 2, 9, 4); //Threadmill, <<< + obj.createentity(160, 160, 2, 11, 4); //Big Threadmill, <<<<<< + obj.createentity(208, 160, 2, 9, 4); //Threadmill, <<< + obj.createentity(248, 184, 10, 1, 445540); // (savepoint) + obj.createentity(184, 24, 2, 9, 4); //Threadmill, <<< + obj.createentity(64, 64, 2, 11, 4); //Big Threadmill, <<<<<< + obj.createentity(152, 64, 2, 9, 4); //Threadmill, <<< + obj.createentity(152, 88, 2, 9, 4); //Threadmill, <<< + obj.createentity(64, 88, 2, 11, 4); //Big Threadmill, <<<<<< + obj.createentity(96, 136, 2, 9, 4); //Threadmill, <<< + obj.createentity(160, 136, 2, 9, 4); //Threadmill, <<< + obj.createentity(184, 136, 2, 9, 4); //Threadmill, <<< + obj.createentity(152, 24, 2, 9, 4); //Threadmill, <<< + obj.createentity(104, 200, 2, 9, 4); //Threadmill, <<< + obj.createentity(104, 136, 2, 9, 4); //Threadmill, <<< + obj.createentity(104, 160, 2, 9, 4); //Threadmill, <<< + + roomname = "$eeing Dollar $ign$"; + result = contents; + break; + } + + case rn(54,44): + { + + static const short contents[] = { + 86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86, + 86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,87,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247, + 247,247,247,247,247,88,86,86,86,86,86,86,86,86,86,86,86,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,818,698,246,247,247,247,88,86,86,86,86,86,86,86,86,208,698,698,698,698,698,698,698,698,698,698,698,698,698,820,0,0,0,0,0,0,0, + 0,0,0,818,698,820,0,818,698,246,247,247,247,88,86,86,86,86,208,698,698,698,698,698,698,698,698,698,698,698,698,698,820,0,0,0,0,0,0,0, + 0,0,0,818,698,820,0,818,699,859,859,859,859,246,247,88,86,86,208,698,698,698,698,698,698,698,698,698,698,698,698,698,820,0,0,0,0,0,0,0, + 0,0,0,818,698,820,0,818,820,0,0,0,0,0,0,246,88,86,208,698,698,698,698,698,698,698,698,698,698,698,698,698,820,0,0,0,0,0,0,0, + 0,0,0,818,698,820,0,818,820,0,778,779,779,779,779,779,206,86,208,698,698,698,698,698,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,818,698,820,0,818,820,0,818,699,859,859,859,859,206,86,208,698,698,698,698,166,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167, + 0,0,0,818,698,820,0,818,820,0,818,820,0,0,0,0,206,86,208,698,698,698,698,206,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86, + 0,0,0,818,698,820,0,818,820,0,818,820,0,778,780,0,206,86,208,698,698,698,698,206,86,86,86,86,86,87,247,247,247,247,247,247,247,247,247,247, + 0,0,0,818,698,820,0,818,820,0,818,820,0,858,860,0,206,86,208,698,698,698,698,206,86,86,86,86,86,208,0,0,0,0,0,0,0,0,0,0, + 0,0,0,818,698,820,0,818,820,0,818,820,0,0,0,0,206,86,208,698,698,698,698,206,86,86,86,86,86,208,698,698,820,0,0,0,0,0,0,0, + 0,0,0,818,698,820,0,818,820,0,818,739,779,779,779,779,206,86,208,698,698,698,698,206,86,86,86,86,86,208,698,698,820,0,0,0,0,0,0,0, + 0,0,0,818,698,820,0,818,820,0,858,859,859,859,859,166,128,86,208,698,698,698,698,206,86,86,86,86,86,208,698,698,820,0,0,0,0,0,0,0, + 0,0,0,818,698,820,0,818,820,0,0,0,0,166,167,128,86,86,208,698,698,698,698,206,86,86,86,86,86,208,698,698,820,0,0,0,0,0,0,0, + 0,0,0,818,698,820,0,818,698,166,167,167,167,128,86,86,86,86,208,698,698,698,698,206,86,86,86,86,86,208,698,698,820,0,0,0,0,0,0,0, + 0,0,0,818,698,166,167,167,167,128,86,86,86,86,86,86,86,86,208,698,698,698,698,206,86,86,86,86,86,208,698,698,820,0,0,166,167,167,167,167, + 0,0,0,818,698,206,86,87,247,247,247,247,247,247,247,247,247,247,248,698,698,698,698,206,86,86,86,86,86,208,698,698,820,0,0,206,86,86,86,86, + 0,0,0,818,698,206,86,208,0,0,0,0,0,0,0,0,0,0,0,698,698,698,698,206,86,86,86,86,86,208,698,698,820,0,0,206,86,86,86,86, + 0,0,0,858,859,206,86,208,859,859,700,698,698,698,698,698,698,698,698,698,698,698,698,206,86,86,86,86,86,208,698,698,820,0,0,206,86,86,86,86, + 0,0,0,0,0,206,86,208,0,0,818,698,698,698,698,698,698,698,698,698,698,698,698,206,86,86,86,86,86,208,698,698,820,0,0,206,86,86,86,86, + 0,0,0,0,0,206,86,208,0,0,818,698,698,698,698,698,698,698,698,698,698,698,698,206,86,86,86,86,86,208,698,698,820,0,0,206,86,86,86,86, + 0,0,0,0,0,206,86,208,0,0,818,698,698,698,698,698,698,698,698,698,698,698,698,206,86,86,86,86,86,208,698,698,820,0,0,206,86,86,86,86, + 0,0,0,0,0,206,86,208,0,0,818,698,0,0,0,0,0,0,0,0,0,0,0,206,86,86,86,86,86,208,698,698,820,0,0,206,86,86,86,86, + 0,0,0,0,0,206,86,208,0,0,818,698,166,167,167,167,167,167,167,167,167,167,167,128,86,86,86,86,86,208,698,698,820,0,0,206,86,86,86,86, + 0,0,0,0,0,206,86,208,0,0,818,698,206,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,208,698,698,820,0,0,206,86,86,86,86, + 0,0,0,0,0,206,86,208,0,0,818,698,206,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,208,698,698,820,0,0,206,86,86,86,86, + 0,0,0,0,0,206,86,208,0,0,818,698,206,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,208,698,698,820,0,0,206,86,86,86,86, + 0,0,0,0,0,206,86,208,0,0,818,698,206,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,208,698,698,820,0,0,206,86,86,86,86, + }; + + obj.createentity(184, 56, 2, 10, 4); //Big Threadmill, >>>>>> + obj.createentity(248, 56, 2, 10, 4); //Big Threadmill, >>>>>> + obj.createentity(312, 56, 2, 8, 4); //Threadmill, >>> + obj.createentity(152, 16, 2, 10, 4); //Big Threadmill, >>>>>> + obj.createentity(216, 16, 2, 10, 4); //Big Threadmill, >>>>>> + obj.createentity(280, 16, 2, 10, 4); //Big Threadmill, >>>>>> + obj.createentity(280, 128, 2, 11, 4); //Big Threadmill, <<<<<< + obj.createentity(272, 88, 2, 11, 4); //Big Threadmill, <<<<<< + obj.createentity(64, 152, 2, 10, 4); //Big Threadmill, >>>>>> + obj.createentity(120, 152, 2, 8, 4); //Threadmill, >>> + obj.createentity(96, 192, 2, 10, 4); //Big Threadmill, >>>>>> + obj.createentity(152, 192, 2, 8, 4); //Threadmill, >>> + obj.createentity(240, 88, 2, 9, 4); //Threadmill, <<< + roomname = "Parabolica"; + result = contents; + break; + } + + case rn(54,47): + { + + static const short contents[] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,0,0,0,0, + 0,0,0,0,166,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,168,0,0,0,0, + 0,0,0,0,246,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,248,779,780,0,0, + 0,0,0,0,0,0,0,818,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,820,0,0, + 0,0,0,0,0,0,0,818,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,820,0,0, + 0,0,0,0,0,0,0,818,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,820,0,0, + 0,0,0,0,0,0,0,818,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,820,0,0, + 0,0,0,0,0,0,0,818,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,820,0,0, + 0,0,0,0,0,0,0,858,859,859,859,166,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167, + 0,0,0,0,0,0,0,0,0,0,0,206,86,86,87,247,247,247,247,247,247,247,247,247,247,88,86,86,86,86,86,86,86,86,86,86,86,86,86,86, + 0,0,0,0,0,0,0,0,0,0,0,206,86,86,208,0,0,0,0,0,0,0,0,0,0,206,86,86,86,86,86,86,86,86,86,86,86,86,86,86, + 0,0,0,0,0,0,0,0,0,0,0,206,86,86,208,0,0,0,0,0,0,0,0,0,0,206,86,86,87,247,247,247,247,247,247,247,247,247,247,247, + 0,0,0,0,0,0,0,0,0,0,0,246,247,247,248,0,0,0,0,0,0,0,0,0,0,246,247,247,248,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,9,9,9,9,0,0,0,0,0,0,0,0,0,0,9,9,9,9,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,8,8,8,8,0,0,0,0,0,0,0,0,0,0,8,8,8,8,0,0,0,0,0,0,0,0,0,0,8,8,8,8,0,0,0,0, + 0,0,0,0,166,167,167,168,0,0,0,0,0,0,0,0,0,0,166,167,167,168,0,0,0,0,0,0,0,0,0,0,166,167,167,168,0,0,0,0, + 0,0,0,0,206,86,86,208,0,0,0,0,0,0,0,0,0,0,206,86,86,208,0,0,0,0,0,0,0,0,0,0,206,86,86,208,0,0,0,0, + 0,0,0,0,206,86,86,208,0,0,0,0,0,0,0,0,0,0,206,86,86,208,0,0,0,0,0,0,0,0,0,0,206,86,86,208,0,0,0,0, + 0,0,0,0,206,86,86,127,167,167,167,167,167,167,167,167,167,167,128,86,86,127,167,167,167,167,167,167,167,167,167,167,128,86,86,127,167,167,167,167, + 0,0,0,0,206,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86, + 8,8,8,8,206,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86, + 167,167,167,167,128,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86, + 86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86, + 86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86, + }; + + obj.createentity(96, 80, 10, 1, 447540); // (savepoint) + obj.createentity(64, 184, 2, 10, 4); //Big Threadmill, >>>>>> + obj.createentity(112, 184, 2, 8, 4); //Threadmill, >>> + obj.createentity(176, 184, 2, 10, 4); //Big Threadmill, >>>>>> + obj.createentity(224, 184, 2, 8, 4); //Threadmill, >>> + obj.createentity(232, 128, 2, 10, 4); //Big Threadmill, >>>>>> + obj.createentity(288, 128, 2, 8, 4); //Threadmill, >>> + obj.createentity(288, 184, 2, 8, 4); //Threadmill, >>> + obj.createentity(120, 112, 2, 10, 4); //Big Threadmill, >>>>>> + obj.createentity(168, 112, 2, 8, 4); //Threadmill, >>> + obj.createentity(208, 168, 10, 1, 447541); // (savepoint) + + obj.createentity(24 - 60 - 8, 144 - 8, 1, 10, 0); // Enemy + + obj.createentity(24 - 60 - 8 + 117, 144 - 8, 1, 10, 1); // Enemy + obj.createentity(24 - 60 - 8 + (117 * 2), 144 - 8, 1, 10, 1); // Enemy + obj.createentity(24 - 60 - 8 + (117 * 3), 144 - 8, 1, 10, 1); // Enemy + + //LIES Emitter, manually positioned + roomname = "Spikes Do!"; + result = contents; + break; + } + + case rn(54,46): + { + + static const short contents[] = { + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 656,656,656,656,656,656,656,656,656,656,656,497,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 0,0,0,0,0,0,0,800,680,680,680,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 0,0,0,0,0,0,0,800,680,680,680,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 0,0,0,0,0,0,0,800,680,680,680,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 0,0,0,0,0,0,0,800,680,680,680,655,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656, + 0,0,0,0,0,0,0,800,680,680,680,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,1125,9,9,9,9,9, + 0,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0, + 0,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0, + 0,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0, + 0,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0, + 0,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0, + 0,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0, + 0,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0, + 0,0,0,0,0,0,0,840,841,841,841,841,841,841,841,841,841,841,841,841,841,841,841,841,841,841,841,841,841,841,841,841,841,841,842,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 576,576,576,576,576,576,576,576,576,576,577,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 656,656,656,656,656,656,656,656,656,656,657,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + obj.createentity(64, 152, 10, 1, 446540); // (savepoint) + obj.createentity(120, 72, 3, 707); //Disappearing Platform + obj.createentity(248, 72, 3, 707); //Disappearing Platform + obj.createentity(184, 200, 3, 707); //Disappearing Platform + roomname = "What Lies Beneath?"; + result = contents; + break; + } + + case rn(55,47): + { + + static const short contents[] = { + 0,0,0,0,0,0,0,815,695,695,695,695,695,695,695,209,89,211,695,695,695,695,695,695,695,817,0,0,0,0,0,209,89,89,89,89,89,89,89,89, + 0,0,0,0,0,0,0,815,695,695,695,695,695,695,695,209,89,211,695,695,695,695,695,695,695,817,0,0,0,0,0,209,89,89,89,89,89,89,89,89, + 0,0,0,0,0,0,0,815,695,695,695,695,695,695,695,209,89,211,695,695,695,695,695,695,695,817,0,0,0,0,0,209,89,89,89,89,89,89,89,89, + 0,0,0,0,0,0,0,815,695,695,695,695,695,695,695,209,89,211,695,695,695,695,695,695,695,817,0,0,0,0,0,209,89,89,89,89,89,89,89,89, + 0,0,0,0,0,0,0,815,695,695,695,695,695,695,695,209,89,211,695,695,695,695,695,695,695,817,0,0,0,0,0,209,89,89,89,89,89,89,89,89, + 0,0,0,0,0,0,0,815,695,695,695,695,695,695,695,209,89,211,695,695,695,695,695,695,695,817,0,0,0,0,0,209,89,89,89,89,89,89,89,89, + 0,0,0,0,0,0,0,815,695,695,695,695,695,695,695,209,89,211,695,695,695,695,695,695,695,817,0,0,0,0,0,209,89,89,89,89,89,89,89,89, + 0,0,0,0,0,0,0,815,695,695,695,695,695,695,695,209,89,211,695,695,695,695,695,695,695,817,0,0,0,0,0,209,89,89,89,89,89,89,89,89, + 0,0,0,0,0,0,0,815,695,695,695,695,695,695,695,209,89,211,695,695,695,695,695,695,695,817,0,0,0,0,0,209,89,89,89,89,89,89,89,89, + 0,0,0,0,0,0,0,815,695,695,695,695,695,695,695,209,89,211,695,695,695,695,695,695,695,817,0,0,0,0,0,209,89,89,89,89,89,89,89,89, + 0,0,0,0,0,0,0,815,695,695,695,695,695,695,695,209,89,211,695,695,695,695,695,695,695,817,0,0,0,0,0,209,89,89,89,89,89,89,89,89, + 0,0,0,0,0,0,0,815,695,695,695,695,695,695,695,209,89,211,695,695,695,695,695,695,695,817,0,0,0,0,0,209,89,89,89,89,89,89,89,89, + 170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,131,89,211,695,695,695,695,695,695,695,817,0,0,0,0,0,249,250,250,250,250,250,250,91,89, + 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,211,695,695,695,695,695,695,695,817,0,0,0,0,0,0,0,0,0,0,0,0,209,89, + 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,211,695,695,695,695,695,695,695,817,0,0,0,0,0,0,0,0,0,0,0,0,209,89, + 250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,251,695,695,695,695,695,695,695,817,0,0,0,0,0,0,0,0,0,0,0,0,209,89, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,695,695,695,695,695,695,817,0,0,0,0,0,0,0,0,0,0,0,0,209,89, + 0,0,0,0,0,0,0,815,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,817,0,0,0,0,0,0,0,0,0,0,0,0,209,89, + 0,0,0,0,0,0,0,815,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,817,0,0,0,0,0,0,0,0,0,0,0,0,209,89, + 0,0,0,0,0,0,0,855,856,856,856,856,856,856,856,856,856,856,856,856,856,856,856,856,856,857,0,0,0,0,0,0,0,0,0,0,0,0,209,89, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,209,89, + 0,0,0,0,0,0,0,0,8,8,8,8,8,8,8,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,169,170,170,170,170,170,170,131,89, + 0,0,0,0,0,0,0,0,169,170,170,170,170,170,170,171,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,209,89,89,89,89,89,89,89,89, + 0,0,0,0,0,0,0,0,209,89,89,89,89,89,89,211,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,209,89,89,89,89,89,89,89,89, + 170,170,170,170,170,170,170,170,131,89,89,89,89,89,89,130,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,131,89,89,89,89,89,89,89,89, + 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89, + 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89, + 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89, + 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89, + 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89, + }; + + obj.createentity(0, 128, 2, 10, 4); //Big Threadmill, >>>>>> + obj.createentity(64, 128, 2, 10, 4); //Big Threadmill, >>>>>> + obj.createentity(112, 128, 2, 8, 4); //Threadmill, >>> + obj.createentity(0, 184, 2, 10, 4); //Big Threadmill, >>>>>> + obj.createentity(128, 184, 2, 10, 4); //Big Threadmill, >>>>>> + obj.createentity(184, 184, 2, 10, 4); //Big Threadmill, >>>>>> + obj.createentity(152, 168, 10, 1, 447550); // (savepoint) + + obj.createentity(264, 136, 1, 0, 2); // Enemy //Collector + obj.createentity(24 - 60 - 8, 144 - 8, 1, 10, 0); // Enemy + obj.createentity(24 - 60 - 8 + 117, 144 - 8, 1, 10, 1); // Enemy + obj.createentity(24 - 60 - 8 + (117 * 2), 144 - 8, 1, 10, 1); // Enemy + //LIES Emitter, manually positioned, collector! + roomname = "Chipper Cipher"; + result = contents; + break; + } + + case rn(55,46): + { + + static const short contents[] = { + 504,504,504,504,504,504,504,504,504,504,504,504,504,504,504,504,504,626,683,683,683,683,624,504,504,504,504,504,504,504,504,504,504,504,504,504,504,504,504,504, + 504,504,504,504,504,504,504,504,504,504,504,504,504,504,504,504,504,626,683,683,683,683,664,506,504,504,504,504,504,504,504,504,504,504,504,504,504,504,504,504, + 504,504,504,504,504,504,504,504,504,504,504,504,504,504,504,504,504,626,683,683,683,683,683,624,504,504,504,504,504,504,504,504,504,504,504,504,504,504,504,504, + 504,504,504,504,504,504,504,504,504,504,504,504,504,504,504,504,504,626,844,844,844,844,844,624,504,504,504,504,504,504,504,504,504,504,504,504,504,504,504,504, + 504,504,504,504,504,504,504,504,504,504,504,504,504,504,504,504,504,626,0,0,0,0,0,664,506,504,504,504,504,504,504,504,504,504,504,504,504,504,504,504, + 504,504,504,504,504,504,504,504,504,504,504,504,504,504,504,504,504,626,0,0,0,0,0,0,624,504,504,504,504,504,504,504,504,504,504,504,504,504,504,504, + 665,665,665,665,665,665,665,665,665,665,665,665,665,665,665,506,504,626,0,0,0,0,0,0,624,504,504,504,504,504,504,504,504,504,504,504,504,504,504,504, + 9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,624,504,626,0,0,0,0,0,0,664,506,504,504,504,504,504,504,504,504,504,504,504,504,504,504, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,624,504,626,0,0,0,0,0,0,0,624,504,504,504,504,504,504,504,504,504,504,504,504,504,504, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,624,504,626,0,0,0,0,0,0,0,624,504,504,504,504,504,504,504,504,504,504,504,504,504,504, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,624,504,626,0,0,0,0,0,0,0,664,506,504,504,504,504,504,504,504,504,504,504,504,504,504, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,624,504,626,0,0,0,0,0,0,0,0,624,504,504,504,504,504,504,504,504,504,504,504,504,504, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,624,504,626,0,0,0,0,0,0,0,0,624,504,504,504,504,504,504,504,504,504,504,504,504,504, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,624,504,626,0,0,0,0,0,0,0,0,664,506,504,504,504,504,504,504,504,504,504,504,504,504, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,624,504,626,0,0,0,0,0,0,0,0,0,624,504,504,504,504,504,504,504,504,504,504,504,504, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,624,504,626,0,0,0,0,0,0,0,0,0,624,504,504,504,504,504,504,504,504,504,504,504,504, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,624,504,626,0,0,0,0,0,0,0,0,0,664,506,504,504,504,504,504,504,504,504,504,504,504, + 0,0,0,0,0,0,0,763,764,764,764,764,764,764,764,624,504,626,764,764,764,764,764,764,764,765,0,0,624,504,504,504,504,504,504,504,504,504,504,504, + 0,0,0,0,0,0,0,803,683,683,683,683,683,683,683,624,504,626,683,683,683,683,683,683,683,805,0,0,624,504,504,504,504,504,504,504,504,504,504,504, + 0,0,0,0,0,0,0,803,683,683,683,683,683,683,683,624,504,626,683,683,683,683,683,683,683,805,0,0,664,506,504,504,504,504,504,504,504,504,504,504, + 0,0,0,0,0,0,0,803,683,683,683,683,683,683,683,624,504,626,683,683,683,683,683,683,683,805,0,0,0,624,504,504,504,504,504,504,504,504,504,504, + 0,0,0,0,0,0,0,803,683,683,683,683,683,683,683,624,504,626,683,683,683,683,683,683,683,805,0,0,0,624,504,504,504,504,504,504,504,504,504,504, + 0,0,0,0,0,0,0,803,683,683,683,683,683,683,683,624,504,626,683,683,683,683,683,683,683,805,0,0,0,664,506,504,504,504,504,504,504,504,504,504, + 0,0,0,0,0,0,0,803,683,683,683,683,683,683,683,624,504,626,683,683,683,683,683,683,683,805,0,0,0,0,624,504,504,504,504,504,504,504,504,504, + 0,0,0,0,0,0,0,803,683,683,683,683,683,683,683,624,504,626,683,683,683,683,683,683,683,805,0,0,0,0,624,504,504,504,504,504,504,504,504,504, + 0,0,0,0,0,0,0,803,683,683,683,683,683,683,683,624,504,626,683,683,683,683,683,683,683,805,0,0,0,0,664,506,504,504,504,504,504,504,504,504, + 0,0,0,0,0,0,0,803,683,683,683,683,683,683,683,624,504,626,683,683,683,683,683,683,683,805,0,0,0,0,0,624,504,504,504,504,504,504,504,504, + 0,0,0,0,0,0,0,803,683,683,683,683,683,683,683,624,504,626,683,683,683,683,683,683,683,805,0,0,0,0,0,624,504,504,504,504,504,504,504,504, + 0,0,0,0,0,0,0,803,683,683,683,683,683,683,683,624,504,626,683,683,683,683,683,683,683,805,0,0,0,0,0,624,504,504,504,504,504,504,504,504, + 0,0,0,0,0,0,0,803,683,683,683,683,683,683,683,624,504,626,683,683,683,683,683,683,683,805,0,0,0,0,0,624,504,504,504,504,504,504,504,504, + }; + + obj.createentity(40, 72, 3, 787); //Disappearing Platform + roomname = "If You Fall Up"; + result = contents; + break; + } + + case rn(55,45): + { + + static const short contents[] = { + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,618,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,499,659,659,659,659,659,500,498,499,659,659,659,659,659,500,498,498,620,0,0,0,0,618,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,618,498,620,0,0,0,0,0,618,498,498,620,0,0,0,0,618,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,618,498,620,0,0,0,0,0,618,498,498,620,0,0,0,0,618,498, + 498,498,499,659,659,659,659,500,498,498,498,498,498,498,498,498,620,0,0,0,0,0,658,659,660,0,0,0,0,0,618,498,498,620,0,0,0,0,618,498, + 498,498,620,9,9,9,9,658,659,659,659,659,659,500,498,498,620,0,0,0,0,0,9,9,9,0,0,0,0,0,618,498,498,620,0,0,0,0,618,498, + 498,498,620,0,0,0,0,9,9,9,9,9,9,658,659,659,660,0,0,0,0,0,0,0,0,0,0,0,0,0,658,659,659,660,0,0,0,0,618,498, + 498,498,620,0,0,0,0,0,0,0,0,0,0,9,9,9,9,0,0,0,0,0,0,0,0,0,0,0,0,0,9,9,9,9,0,0,0,0,618,498, + 498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498, + 498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498, + 498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498, + 498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498, + 498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498, + 498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,8,8,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498, + 498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,578,579,580,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498, + 498,498,620,0,0,0,0,0,0,0,0,0,0,8,8,8,8,0,0,0,0,0,618,498,620,0,0,0,0,0,8,8,8,8,8,8,8,8,618,498, + 498,498,620,0,0,0,0,8,8,8,8,8,8,578,579,579,580,0,0,0,0,0,618,498,620,0,0,0,0,0,578,579,579,579,579,579,579,579,540,498, + 498,498,620,0,0,0,0,578,579,579,579,579,579,540,498,498,620,0,0,0,0,0,618,498,620,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498, + 498,498,620,0,0,0,0,618,498,498,498,498,498,498,498,498,620,0,0,0,0,0,618,498,620,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498, + 498,498,620,0,0,0,0,618,498,498,498,498,498,498,498,498,539,579,579,579,579,579,540,498,620,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498, + 498,498,620,0,0,0,0,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498, + 498,498,620,0,0,0,0,658,659,659,659,659,659,659,659,659,659,659,659,659,659,659,500,498,620,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498, + 498,498,620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618,498,620,0,0,0,0,0,618,498,498,498,498,498,498,498,498,498, + 498,498,620,0,0,0,0,0,0,0,0,0,775,776,776,776,776,776,776,776,776,776,618,498,620,776,776,776,776,776,618,498,498,498,498,498,498,498,498,498, + 498,498,620,0,0,0,0,0,0,0,0,0,815,695,695,695,695,695,695,695,695,695,618,498,620,695,695,695,695,695,618,498,498,498,498,498,498,498,498,498, + 498,498,620,0,0,0,0,0,0,0,0,0,815,695,695,695,695,695,695,695,695,695,618,498,620,695,695,695,695,695,618,498,498,498,498,498,498,498,498,498, + 498,498,539,579,579,579,579,579,579,579,579,579,579,579,579,579,579,580,695,695,695,695,618,498,539,579,579,579,579,579,540,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,695,695,695,695,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,695,695,695,695,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + 498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,620,695,695,695,695,618,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, + }; + + obj.platformtile = 159; + obj.createentity(24, 80, 2, 3, 6); // Platform + obj.createentity(64, 176, 10, 0, 445550); // (savepoint) + obj.createentity(216 - 4, 192, 10, 1, 445551); // (savepoint) + roomname = "Just Pick Yourself Down"; + result = contents; + break; + } + + + case rn(55,44): + { + + static const short contents[] = { + 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, + 447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367, + 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, + 447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,288,286, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286, + 367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,368,0,0,0,0,406,286, + 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,408,0,0,0,0,406,286, + 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,408,0,0,0,0,406,286, + 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,408,0,0,0,0,406,286, + 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,408,0,0,0,0,406,286, + 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,408,0,0,0,0,406,286, + 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,408,0,0,0,0,406,286, + 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,408,0,0,0,0,406,286, + 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,408,0,0,0,0,406,286, + 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,408,0,0,0,0,406,286, + 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,408,0,0,0,0,406,286, + 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,408,0,0,0,0,406,286, + 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,408,0,0,0,0,406,286, + }; + + obj.createentity(32, 40, 10, 1, 444560); // (savepoint) + obj.createentity(56, 24, 10, 0, 444551); // (savepoint) + obj.createentity(80, 40, 10, 1, 444552); // (savepoint) + obj.createentity(104, 24, 10, 0, 444553); // (savepoint) + obj.createentity(128, 40, 10, 1, 444554); // (savepoint) + obj.createentity(152, 24, 10, 0, 444555); // (savepoint) + obj.createentity(176, 40, 10, 1, 444556); // (savepoint) + obj.createentity(200, 24, 10, 0, 444557); // (savepoint) + obj.createentity(224, 40, 10, 1, 444558); // (savepoint) + obj.createentity(248, 24, 10, 0, 444559); // (savepoint) + obj.createentity(272, 40, 10, 1, 444550); // (savepoint) + obj.createentity(0, 16, 2, 10, 4); //Big Threadmill, >>>>>> + obj.createentity(64, 16, 2, 10, 4); //Big Threadmill, >>>>>> + obj.createentity(128, 16, 2, 10, 4); //Big Threadmill, >>>>>> + obj.createentity(192, 16, 2, 10, 4); //Big Threadmill, >>>>>> + obj.createentity(256, 16, 2, 10, 4); //Big Threadmill, >>>>>> + obj.createentity(0, 56, 2, 10, 4); //Big Threadmill, >>>>>> + obj.createentity(64, 56, 2, 10, 4); //Big Threadmill, >>>>>> + obj.createentity(128, 56, 2, 10, 4); //Big Threadmill, >>>>>> + obj.createentity(192, 56, 2, 10, 4); //Big Threadmill, >>>>>> + obj.createentity(256, 56, 2, 10, 4); //Big Threadmill, >>>>>> + obj.createentity(0, 88, 2, 11, 4); //Big Threadmill, <<<<<< + obj.createentity(64, 88, 2, 11, 4); //Big Threadmill, <<<<<< + obj.createentity(128, 88, 2, 11, 4); //Big Threadmill, <<<<<< + obj.createentity(192, 88, 2, 11, 4); //Big Threadmill, <<<<<< + obj.createentity(240, 88, 2, 11, 4); //Big Threadmill, <<<<<< + obj.createentity(0, 128, 2, 11, 4); //Big Threadmill, <<<<<< + obj.createentity(64, 128, 2, 11, 4); //Big Threadmill, <<<<<< + obj.createentity(128, 128, 2, 11, 4); //Big Threadmill, <<<<<< + obj.createentity(192, 128, 2, 11, 4); //Big Threadmill, <<<<<< + obj.createentity(240, 128, 2, 9, 4); //Threadmill, <<< + roomname = "The Warning"; + result = contents; + break; + } + + //Super driller starts here! + case rn(56,44): + { + + static const short contents[] = { + 298,298,298,298,298,298,298,420,0,0,0,0,418,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298, + 459,459,459,459,459,459,459,460,0,0,0,0,418,298,298,298,298,298,298,298,298,299,459,459,459,459,300,298,298,298,298,298,298,298,298,298,298,298,298,298, + 0,0,0,0,0,0,0,0,0,0,0,0,418,298,298,298,298,298,298,298,298,420,9,9,9,9,418,298,298,298,298,298,298,298,298,298,298,298,298,298, + 0,0,0,0,0,0,0,0,0,0,0,0,418,298,298,298,298,298,298,298,298,420,0,0,0,0,418,298,298,298,298,298,298,298,298,298,298,298,298,298, + 0,0,0,0,0,0,0,0,0,0,0,0,418,298,298,298,298,298,298,298,298,420,0,0,0,0,418,298,298,298,298,298,298,298,298,298,298,298,298,298, + 0,0,0,0,0,0,0,0,0,0,0,0,418,298,298,298,298,298,298,299,459,460,0,0,0,0,458,459,300,298,298,298,298,298,298,298,298,298,298,298, + 0,0,0,0,0,0,0,0,0,0,0,0,418,298,298,298,298,298,298,420,9,9,0,0,0,0,9,9,418,298,298,298,298,298,298,298,298,298,298,298, + 0,0,0,0,0,0,0,0,0,0,0,0,418,298,298,298,298,298,298,420,0,0,0,0,0,0,0,0,418,298,298,298,298,298,298,298,298,298,298,298, + 379,379,379,379,379,380,0,0,0,0,0,0,418,298,298,298,298,298,298,420,0,0,0,0,0,0,0,0,418,298,298,298,298,298,298,298,298,298,298,298, + 298,298,298,298,298,420,0,0,0,0,0,0,418,298,298,298,298,299,459,460,0,0,0,0,0,0,0,0,458,459,300,298,298,298,298,298,298,298,298,298, + 298,298,298,298,298,420,0,0,0,0,0,0,418,298,298,298,298,420,9,9,0,0,0,0,0,0,0,0,9,9,418,298,298,298,298,298,298,298,298,298, + 298,298,298,298,298,420,0,0,378,379,379,379,340,298,298,298,298,420,0,0,0,0,0,0,0,0,0,0,0,0,418,298,298,298,298,298,298,298,298,298, + 298,298,298,298,298,420,0,0,458,459,459,459,300,298,298,298,298,420,0,0,0,0,0,0,0,0,0,0,0,0,418,298,298,298,298,298,298,298,298,298, + 298,298,298,298,298,420,0,0,0,0,0,0,418,298,298,299,459,460,0,0,0,0,0,0,0,0,0,0,0,0,458,459,300,298,298,298,298,298,298,298, + 298,298,298,298,298,420,0,0,0,0,0,0,418,298,298,420,9,9,0,0,0,0,0,0,0,0,0,0,0,0,9,9,418,298,298,298,298,298,298,298, + 298,298,298,298,298,420,0,0,0,0,0,0,418,298,298,420,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,418,298,298,298,298,298,298,298, + 298,298,298,298,298,339,379,379,379,380,0,0,418,298,298,420,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,418,298,298,298,298,298,298,298, + 299,459,459,459,459,459,459,459,459,460,0,0,418,299,459,460,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,458,459,300,298,298,298,298,298, + 420,0,0,0,0,0,0,0,0,0,0,0,418,420,9,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9,9,418,298,298,298,298,298, + 420,49,0,0,0,0,0,0,0,0,0,0,418,420,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,418,298,298,298,298,298, + 420,49,0,0,0,0,0,0,0,0,0,0,418,420,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,418,298,298,298,298,298, + 420,49,0,0,0,0,0,0,0,0,0,0,458,460,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,458,459,300,298,298,298, + 420,49,0,0,0,0,50,378,379,379,379,380,9,9,0,0,0,0,0,0,0,8,8,8,8,8,8,0,0,0,0,0,0,0,9,9,418,298,298,298, + 420,49,0,0,0,0,50,418,298,298,298,420,0,0,0,0,0,0,0,0,50,378,379,379,379,379,380,49,0,0,0,0,0,0,0,0,418,298,298,298, + 420,49,0,0,0,0,50,418,298,298,298,420,0,0,0,0,0,0,0,0,50,418,298,298,298,298,420,49,0,0,0,0,0,0,0,0,418,298,298,298, + 420,49,0,0,0,0,50,418,298,299,459,460,0,0,0,0,0,0,0,0,50,418,298,298,298,298,420,49,0,0,0,0,0,0,0,0,458,459,300,298, + 420,49,0,0,0,0,50,418,298,420,9,9,0,0,0,0,0,0,0,0,50,418,298,298,298,298,420,49,0,0,0,0,0,0,0,0,9,9,418,298, + 420,49,0,0,0,0,50,418,298,420,0,0,0,0,0,0,0,0,0,0,50,418,298,298,298,298,420,49,0,0,0,0,0,0,0,0,0,0,418,298, + 420,49,0,0,0,0,50,418,298,420,0,0,0,0,0,0,0,0,0,0,50,418,298,298,298,298,420,49,0,0,0,0,0,0,0,0,0,0,418,298, + 420,49,0,0,0,0,50,418,298,420,0,0,0,0,0,0,0,0,0,0,50,418,298,298,298,298,420,49,0,0,0,0,0,0,0,0,0,0,418,298, + }; + + obj.createentity(176, 80, 3, 55); //Disappearing Platform + obj.createentity(0, 56, 2, 8, 4); //Threadmill, >>> + obj.createentity(16, 56, 2, 8, 4); //Threadmill, >>> + obj.createentity(72, 72, 10, 1, 444561); // (savepoint) + obj.createentity(8, 144, 2, 10, 4); //Big Threadmill, >>>>>> + obj.createentity(48, 144, 2, 8, 4); //Threadmill, >>> + obj.createentity(0, 16, 2, 10, 4); //Big Threadmill, >>>>>> + + + roomname = "Getting Here is Half the Fun"; + result = contents; + break; + } + + case rn(56,45): + { + + static const short contents[] = { + 614,49,0,0,0,0,50,612,614,0,0,0,0,0,0,0,0,0,0,0,50,612,492,492,492,492,614,49,0,0,0,0,0,0,0,0,0,0,612,492, + 614,49,0,0,0,0,50,612,614,0,0,0,0,0,0,0,0,0,0,0,50,612,492,492,492,492,614,49,0,0,0,0,0,0,0,0,0,0,612,492, + 614,49,0,0,0,0,50,612,614,0,0,0,0,0,0,0,0,0,0,0,50,612,492,492,492,492,614,49,0,0,0,0,0,0,0,0,0,0,612,492, + 614,49,0,0,0,0,50,612,614,0,0,0,0,0,0,0,0,0,0,0,50,612,492,492,492,492,614,49,0,0,0,0,0,0,0,0,0,0,612,492, + 614,49,0,0,0,0,50,612,614,0,0,0,0,0,0,0,0,0,0,0,50,612,492,492,492,492,614,49,0,0,0,0,0,0,0,0,0,0,612,492, + 614,49,0,0,0,0,50,612,614,0,0,0,0,0,0,0,0,0,0,0,50,652,653,653,653,653,654,49,0,0,0,0,0,0,0,0,0,0,612,492, + 614,49,0,0,0,0,50,612,614,0,0,0,0,0,0,0,0,0,0,0,0,9,9,9,9,9,9,0,0,0,0,0,0,0,0,0,0,0,612,492, + 614,49,0,0,0,0,50,612,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492, + 614,49,0,0,0,0,50,612,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492, + 614,49,0,0,0,0,50,612,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492, + 614,49,0,0,0,0,50,612,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492, + 614,49,0,0,0,0,50,612,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492, + 614,49,0,0,0,0,50,612,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492, + 614,49,0,0,0,0,50,612,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492, + 614,49,0,0,0,0,50,612,614,8,8,8,8,8,8,8,8,8,8,0,0,0,0,0,0,0,0,0,0,8,8,8,8,8,8,8,8,8,612,492, + 614,49,0,0,0,0,50,612,533,573,573,573,573,573,573,573,573,573,574,49,0,0,0,0,0,0,0,0,50,572,573,573,573,573,573,573,573,573,534,492, + 614,49,0,0,0,0,50,612,492,492,492,492,492,492,492,492,492,492,614,49,0,0,0,0,0,0,0,0,50,612,492,492,492,492,492,492,492,492,492,492, + 614,49,0,0,0,0,50,612,492,492,492,492,492,492,492,492,492,492,614,49,0,0,0,0,0,0,0,0,50,652,494,492,492,492,492,492,492,492,492,492, + 614,49,0,0,0,0,50,612,492,492,492,492,492,492,492,492,492,492,533,574,49,0,0,0,0,0,0,0,0,50,612,492,492,492,492,492,492,492,492,492, + 614,49,0,0,0,0,50,612,492,492,492,492,492,492,492,492,492,492,492,614,49,0,0,0,0,0,0,0,0,50,612,492,492,492,492,492,492,492,492,492, + 614,49,0,0,0,0,50,612,492,492,492,492,492,492,492,492,492,492,492,614,49,0,0,0,0,0,0,0,0,50,652,494,492,492,492,492,492,492,492,492, + 614,49,0,0,0,0,50,612,492,492,492,492,492,492,492,492,492,492,492,533,574,49,0,0,0,0,0,0,0,0,50,612,492,492,492,492,492,492,492,492, + 614,49,0,0,0,0,50,612,492,492,492,492,492,492,492,492,492,492,492,492,614,49,0,0,0,0,0,0,0,0,50,612,492,492,492,492,492,492,492,492, + 614,49,0,0,0,0,50,612,492,492,492,492,492,492,492,492,492,492,492,492,614,49,0,0,0,0,0,0,0,0,50,652,494,492,492,492,492,492,492,492, + 614,49,0,0,0,0,50,612,492,492,492,492,492,492,492,492,492,492,492,492,533,574,49,0,0,0,0,0,0,0,0,50,612,492,492,492,492,492,492,492, + 614,49,0,0,0,0,50,612,492,492,492,492,492,492,492,492,492,492,492,492,492,614,49,0,0,0,0,0,0,0,0,50,612,492,492,492,492,492,492,492, + 614,49,0,0,0,0,50,612,492,492,492,492,492,492,492,492,492,492,492,492,492,614,49,0,0,0,0,0,0,0,0,50,652,494,492,492,492,492,492,492, + 614,49,0,0,0,0,50,612,492,492,492,492,492,492,492,492,492,492,492,492,492,533,574,49,0,0,0,0,0,0,0,0,50,612,492,492,492,492,492,492, + 614,49,0,0,0,0,50,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,49,0,0,0,0,0,0,0,0,50,612,492,492,492,492,492,492, + 614,49,0,0,0,0,50,612,492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,49,0,0,0,0,0,0,0,0,50,612,492,492,492,492,492,492, + }; + + roomname = "Your Bitter Tears... Delicious"; + result = contents; + break; + } + + case rn(56,46): + { + + static const short contents[] = { + 208,49,0,0,0,0,50,206,86,86,86,86,86,86,86,86,86,86,86,86,86,87,248,49,0,0,0,0,0,0,0,0,50,206,86,86,86,86,86,86, + 208,49,0,0,0,0,50,206,86,86,86,86,86,86,86,86,86,86,86,86,87,248,9,0,0,0,0,0,0,0,0,0,50,206,86,86,86,86,86,86, + 208,49,0,0,0,0,50,206,86,86,86,86,86,86,86,86,86,86,86,87,248,9,0,0,0,0,0,0,0,0,0,0,50,206,86,86,86,86,86,86, + 208,49,0,0,0,0,50,206,86,86,86,86,86,86,86,86,86,86,87,248,9,0,0,0,0,0,0,0,0,0,0,0,50,206,86,86,86,86,86,86, + 208,49,0,0,0,0,50,206,86,86,86,86,86,86,86,86,86,87,248,9,0,0,0,0,0,0,0,0,0,0,0,0,50,206,86,86,86,86,86,86, + 208,49,0,0,0,0,50,206,86,86,86,86,86,86,86,86,87,248,9,0,0,0,0,0,0,0,0,0,0,0,0,0,50,206,86,86,86,86,86,86, + 208,49,0,0,0,0,50,206,86,86,86,86,86,86,86,87,248,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,206,86,86,86,86,86,86, + 208,49,0,0,0,0,50,206,86,86,86,86,86,86,87,248,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,206,86,86,86,86,86,86, + 208,49,0,0,0,0,50,206,86,86,86,86,86,87,248,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,206,86,86,86,86,86,86, + 208,49,0,0,0,0,50,206,86,86,86,86,86,208,49,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,206,86,86,86,86,86,86, + 208,49,0,0,0,0,50,206,86,86,86,86,86,208,49,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,206,86,86,86,86,86,86, + 208,49,0,0,0,0,50,206,86,86,86,86,86,208,49,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,206,86,86,86,86,86,86, + 208,49,0,0,0,0,50,206,86,86,86,86,86,208,49,0,0,0,0,0,0,0,0,8,8,0,0,0,0,0,0,0,50,206,86,86,86,86,86,86, + 208,49,0,0,0,0,50,206,86,86,86,86,86,208,49,0,0,0,0,0,0,0,50,166,168,49,0,0,0,0,0,0,50,206,86,86,86,86,86,86, + 208,49,0,0,0,0,50,206,86,86,86,86,86,208,49,0,0,0,0,0,0,0,50,206,208,49,0,0,0,0,0,0,50,206,86,86,86,86,86,86, + 208,49,0,0,0,0,50,206,86,86,86,86,86,208,49,0,0,0,0,0,0,0,50,206,208,49,0,0,0,0,0,0,50,206,86,86,86,86,86,86, + 208,49,0,0,0,0,50,206,86,86,86,86,86,208,49,0,0,0,0,0,0,0,50,206,208,49,0,0,0,0,0,0,50,206,86,86,86,86,86,86, + 208,49,0,0,0,0,50,206,86,86,86,86,86,208,49,0,0,0,0,0,0,0,50,206,208,49,0,0,0,0,0,0,50,206,86,86,86,86,86,86, + 208,49,0,0,0,0,50,206,86,86,86,86,86,208,49,0,0,0,0,0,0,0,50,206,208,49,0,0,0,0,0,0,50,206,86,86,86,86,86,86, + 208,49,0,0,0,0,50,206,86,86,86,86,86,208,49,0,0,0,0,0,0,0,50,206,208,49,0,0,0,0,0,0,50,206,86,86,86,86,86,86, + 208,49,0,0,0,0,50,206,86,86,86,86,86,208,49,0,0,0,0,0,0,0,50,206,208,49,0,0,0,0,0,0,50,206,86,86,86,86,86,86, + 208,49,0,0,0,0,50,206,86,86,86,86,86,208,49,0,0,0,0,0,0,0,50,206,208,49,0,0,0,0,0,0,50,206,86,86,86,86,86,86, + 208,49,0,0,0,0,50,206,86,86,86,86,86,127,168,8,0,0,0,0,0,0,50,206,208,49,0,0,0,0,0,0,50,206,86,86,86,86,86,86, + 208,49,0,0,0,0,50,206,86,86,86,86,86,86,127,168,8,0,0,0,0,0,50,206,127,168,8,0,0,0,0,8,166,128,86,86,86,86,86,86, + 208,49,0,0,0,0,50,206,86,86,86,86,86,86,86,127,168,8,0,0,0,0,50,206,86,127,168,0,0,0,0,166,128,86,86,86,86,86,86,86, + 208,49,0,0,0,0,50,206,86,86,86,86,86,86,86,86,127,168,0,0,0,0,50,206,86,86,208,0,0,0,0,206,86,86,86,86,86,86,86,86, + 208,49,0,0,0,0,50,206,86,86,86,86,86,86,86,86,86,208,0,0,0,0,50,206,86,86,208,0,0,0,0,206,86,86,86,86,86,86,86,86, + 208,49,0,0,0,0,50,206,86,86,86,86,86,86,86,86,86,208,0,0,0,0,50,206,86,86,208,0,0,0,0,206,86,86,86,86,86,86,86,86, + 208,49,0,0,0,0,50,206,86,86,86,86,86,86,86,86,86,208,0,0,0,0,50,206,86,86,208,0,0,0,0,206,86,86,86,86,86,86,86,86, + 208,49,0,0,0,0,50,206,86,86,86,86,86,86,86,86,86,208,0,0,0,0,50,206,86,86,208,0,0,0,0,206,86,86,86,86,86,86,86,86, + }; + + roomname = "Easy Mode Unlocked"; + result = contents; + break; + } + + case rn(56,47): + { + + static const short contents[] = { + 217,49,0,0,0,0,50,215,95,95,95,95,95,95,95,95,95,217,0,0,0,0,50,215,95,95,217,0,0,0,0,215,95,95,95,95,95,95,95,95, + 217,49,0,0,0,0,50,215,95,95,95,95,95,95,95,95,95,217,0,0,0,0,50,215,95,95,217,0,0,0,0,215,95,95,95,95,95,95,95,95, + 217,49,0,0,0,0,50,215,95,95,95,95,95,95,95,95,95,217,0,0,0,0,50,215,95,95,217,0,0,0,0,215,95,95,95,95,95,95,95,95, + 217,49,0,0,0,0,50,215,95,95,95,95,95,95,95,95,95,217,0,0,0,0,50,215,95,95,217,0,0,0,0,215,95,95,95,95,95,95,95,95, + 217,49,0,0,0,0,50,215,95,95,95,95,95,95,95,95,95,217,0,0,0,0,50,215,95,95,217,0,0,0,0,215,95,95,95,95,95,95,95,95, + 217,49,0,0,0,0,50,215,95,95,95,95,95,95,95,95,95,217,0,0,0,0,50,215,95,95,217,0,0,0,0,215,95,95,95,95,95,95,95,95, + 217,49,0,0,0,0,50,215,95,95,95,95,95,95,95,95,95,217,0,0,0,0,50,215,95,95,217,0,0,0,0,215,95,95,95,95,95,95,95,95, + 217,49,0,0,0,0,50,215,95,95,95,95,95,95,95,95,95,217,0,0,0,0,50,215,95,95,217,0,0,0,0,215,95,95,95,95,95,95,95,95, + 217,49,0,0,0,0,50,215,95,95,95,95,95,95,95,95,95,217,0,0,0,0,50,215,95,95,217,0,0,0,0,215,95,95,95,95,95,95,95,95, + 217,49,0,0,0,0,50,215,95,95,95,95,95,95,95,95,95,217,0,0,0,0,50,215,95,95,217,0,0,0,0,215,95,95,95,95,95,95,95,95, + 217,49,0,0,0,0,50,215,95,95,95,95,95,95,95,95,95,217,0,0,0,0,50,215,95,95,217,0,0,0,0,215,95,95,95,95,95,95,95,95, + 217,49,0,0,0,0,50,215,95,95,95,95,95,95,95,95,95,217,0,0,0,0,50,215,95,95,217,0,0,0,0,215,95,95,95,95,95,95,95,95, + 217,49,0,0,0,0,50,215,95,95,95,95,95,95,95,95,95,217,49,0,0,0,50,215,95,95,217,0,0,0,0,215,95,95,95,95,95,95,95,95, + 217,49,0,0,0,0,50,215,95,95,95,95,95,95,95,95,95,217,49,0,0,0,50,215,95,95,217,0,0,0,0,215,95,95,95,95,95,95,95,95, + 217,49,0,0,0,0,50,215,95,95,95,95,95,95,95,95,95,217,49,0,0,0,50,215,95,95,217,0,0,0,0,215,95,95,95,95,95,95,95,95, + 217,49,0,0,0,0,50,215,95,95,95,95,95,95,95,95,95,217,49,0,0,0,50,215,95,95,217,0,0,0,0,215,95,95,95,95,95,95,95,95, + 217,49,0,0,0,0,50,215,95,95,95,95,95,95,95,95,95,217,49,0,0,0,50,215,95,95,217,0,0,0,0,215,95,95,95,95,95,95,95,95, + 217,49,0,0,0,0,50,215,95,95,95,95,95,95,95,95,95,217,49,0,0,0,0,215,95,95,217,0,0,0,0,215,95,95,95,95,95,95,95,95, + 217,49,0,0,0,0,50,215,95,95,95,95,95,95,95,95,95,217,49,0,0,0,0,215,95,95,217,0,0,0,0,215,95,95,95,95,95,95,95,95, + 217,49,0,0,0,0,50,215,95,95,95,95,95,95,95,95,95,217,49,0,0,0,0,215,95,95,217,0,0,0,0,215,95,95,95,95,95,95,95,95, + 217,49,0,0,0,0,50,215,95,95,95,95,95,95,95,95,95,217,49,0,0,0,0,215,95,95,217,0,0,0,0,215,95,95,95,95,95,95,95,95, + 217,49,0,0,0,0,50,215,95,95,95,95,95,95,95,95,95,217,49,0,0,0,0,215,95,95,217,0,0,0,0,215,95,95,95,95,95,95,95,95, + 217,49,0,0,0,0,50,215,95,95,95,95,95,95,95,95,95,217,49,0,0,0,0,215,95,95,217,0,0,0,0,215,95,95,95,95,95,95,95,95, + 217,49,0,0,0,0,50,215,95,95,95,95,95,95,95,95,95,217,49,0,0,0,0,215,95,95,217,8,8,8,8,215,95,95,95,95,95,95,95,95, + 217,49,0,0,0,0,50,215,95,95,95,95,95,95,95,95,95,217,49,0,0,0,0,215,95,95,136,176,176,176,176,137,95,95,95,95,95,95,95,95, + 217,49,0,0,0,0,50,215,95,95,95,95,95,95,95,95,95,217,49,0,0,0,0,215,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95, + 217,49,0,0,0,0,50,215,95,95,95,95,95,95,95,95,95,217,49,0,0,0,0,215,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95, + 217,49,0,0,0,0,50,215,95,95,95,95,95,95,95,95,95,217,49,0,0,0,0,215,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95, + 217,49,0,0,0,0,50,215,95,95,95,95,95,95,95,95,95,217,49,0,0,0,0,215,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95, + 217,49,0,0,0,0,50,215,95,95,95,95,95,95,95,95,95,217,49,0,0,0,0,215,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95, + }; + + roomname = "Vici!"; + result = contents; + break; + } + + case rn(56,48): + { + + static const short contents[] = { + 432,49,0,0,0,0,50,430,310,310,310,310,310,310,310,310,310,432,49,0,0,0,0,430,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310, + 432,49,0,0,0,0,50,430,310,310,310,310,310,310,310,310,310,432,49,0,0,0,0,430,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310, + 432,49,0,0,0,0,50,430,310,310,310,310,310,310,310,310,310,432,49,0,0,0,0,470,312,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310, + 432,49,0,0,0,0,50,430,310,310,310,310,310,310,310,310,310,432,49,0,0,0,0,9,470,312,310,310,310,310,310,310,310,310,310,310,310,310,310,310, + 432,49,0,0,0,0,50,430,310,310,310,310,310,310,310,310,310,432,49,0,0,0,0,0,9,470,312,310,310,310,310,310,310,310,310,310,310,310,310,310, + 432,49,0,0,0,0,50,430,310,310,310,310,310,310,310,310,310,432,49,0,0,0,0,0,0,9,470,471,312,310,310,310,310,310,310,310,310,310,310,310, + 432,49,0,0,0,0,50,430,310,310,310,310,310,310,310,310,310,432,49,0,0,0,0,0,0,0,9,9,470,471,312,310,310,310,310,310,310,310,310,310, + 432,49,0,0,0,0,50,430,310,310,310,310,310,310,310,310,310,432,49,0,0,0,0,0,0,0,0,0,9,9,470,471,312,310,310,310,310,310,310,310, + 432,49,0,0,0,0,50,430,310,310,310,310,310,310,310,310,310,432,49,0,0,0,0,0,0,0,0,0,0,0,9,9,470,312,310,310,310,310,310,310, + 432,49,0,0,0,0,50,430,310,310,310,310,310,310,310,310,310,432,49,0,0,0,0,0,0,0,0,0,0,0,0,0,50,430,310,310,310,310,310,310, + 432,49,0,0,0,0,50,430,310,310,310,310,310,310,310,310,310,432,49,0,0,0,0,0,0,0,0,0,0,0,0,0,50,430,310,310,310,310,310,310, + 432,49,0,0,0,0,50,430,310,310,310,310,310,310,310,310,310,432,49,0,0,0,0,0,0,0,0,0,0,0,0,0,50,430,310,310,310,310,310,310, + 432,49,0,0,0,0,50,430,310,310,310,310,310,310,310,310,310,432,49,0,0,0,0,0,0,0,0,0,0,0,0,50,390,352,310,310,310,310,310,310, + 432,49,0,0,0,0,50,430,310,310,310,310,310,310,310,310,310,351,392,8,8,8,8,0,0,0,0,0,0,0,0,50,430,310,310,310,310,310,310,310, + 432,49,0,0,0,0,50,430,310,310,310,310,310,310,310,310,310,310,351,391,391,391,392,49,0,0,0,0,0,0,0,50,470,471,471,471,312,310,310,310, + 432,49,0,0,0,0,50,430,310,310,310,310,310,310,310,310,310,310,310,310,310,310,432,49,0,0,0,0,0,0,0,0,9,9,9,9,470,312,310,310, + 432,49,0,0,0,0,50,430,310,310,310,310,310,310,310,310,310,310,310,310,310,311,472,49,0,0,0,0,0,0,0,0,0,0,0,0,50,430,310,310, + 432,49,0,0,0,0,50,430,310,310,310,310,310,310,310,310,310,310,310,310,310,432,49,0,0,0,0,0,0,0,0,0,0,0,0,0,50,430,310,310, + 432,49,0,0,0,0,50,430,310,310,310,310,310,310,310,310,310,310,310,310,310,432,49,0,0,0,0,0,0,0,0,0,0,0,0,0,50,430,310,310, + 432,49,0,0,0,0,50,430,310,310,310,310,310,310,310,310,310,310,310,310,310,432,49,0,0,0,0,0,0,0,0,0,0,0,0,0,50,430,310,310, + 432,49,0,0,0,0,50,430,310,310,310,310,310,310,310,310,310,310,310,310,310,351,392,8,8,0,0,0,0,0,0,0,0,0,0,0,50,430,310,310, + 432,49,0,0,0,0,50,430,310,310,310,310,310,310,310,310,310,310,310,310,310,310,351,391,392,8,8,0,0,0,0,0,0,0,0,0,50,430,310,310, + 432,49,0,0,0,0,50,430,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,351,391,392,8,8,0,0,0,0,0,0,0,50,430,310,310, + 432,49,0,0,0,0,50,430,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,351,391,392,8,0,0,0,0,0,0,50,430,310,310, + 432,49,0,0,0,0,50,430,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,351,392,8,0,0,0,0,0,50,430,310,310, + 432,49,0,0,0,0,50,430,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,351,392,8,0,0,0,0,50,430,310,310, + 432,49,0,0,0,0,50,430,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,351,392,0,0,0,0,50,430,310,310, + 432,49,0,0,0,0,50,430,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,432,0,0,0,0,50,430,310,310, + 432,49,0,0,0,0,50,430,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,432,0,0,0,0,50,430,310,310, + 432,49,0,0,0,0,50,430,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,432,0,0,0,0,50,430,310,310, + }; + + roomname = "Vidi"; + result = contents; + break; + } + + case rn(56,49): + { + + static const short contents[] = { + 220,49,0,0,0,0,50,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,0,0,0,0,50,218,98,98, + 220,49,0,0,0,0,50,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,0,0,0,0,50,218,98,98, + 220,49,0,0,0,0,50,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,99,259,259,259,259,259,259,259,259,260,0,0,0,0,50,218,98,98, + 220,49,0,0,0,0,50,218,98,98,98,98,98,98,98,98,98,98,98,98,98,99,260,9,9,9,9,9,9,9,9,9,0,0,0,0,50,218,98,98, + 220,49,0,0,0,0,50,218,98,98,98,98,98,98,98,98,98,98,98,98,98,220,49,0,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,98, + 220,49,0,0,0,0,50,218,98,98,98,98,98,98,98,98,98,98,98,98,98,220,49,0,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,98, + 220,49,0,0,0,0,50,218,98,98,98,98,98,98,98,98,98,98,98,98,98,220,49,0,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,98, + 220,49,0,0,0,0,50,218,98,98,98,98,98,98,98,98,98,98,98,98,98,220,49,0,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,98, + 220,49,0,0,0,0,50,218,98,98,98,98,98,98,98,98,98,98,98,98,99,260,49,0,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,98, + 220,49,0,0,0,0,50,218,98,98,98,98,98,98,98,98,98,98,98,98,220,49,0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,98, + 220,49,0,0,0,0,50,218,98,98,98,98,98,98,98,98,98,98,98,98,220,49,0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,98, + 220,49,0,0,0,0,50,218,98,98,98,98,98,98,98,98,98,98,98,98,220,49,0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,98, + 220,49,0,0,0,0,50,218,98,98,98,98,98,98,98,98,98,98,98,99,260,49,0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,98, + 220,49,0,0,0,0,50,218,98,98,98,98,98,98,98,98,98,98,98,220,49,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,98, + 220,49,0,0,0,0,50,218,98,98,98,98,98,98,98,98,98,98,98,220,49,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,98, + 220,49,0,0,0,0,50,218,98,98,98,98,98,98,98,98,98,98,98,220,49,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,98, + 220,49,0,0,0,0,50,218,98,98,98,98,98,98,98,98,98,98,99,260,49,0,0,0,0,0,0,0,0,0,8,8,8,8,8,8,178,140,98,98, + 220,49,0,0,0,0,50,218,98,98,98,98,98,98,98,98,98,98,220,49,0,0,0,0,0,0,0,0,0,50,178,179,179,179,179,179,140,98,98,98, + 220,49,0,0,0,0,50,218,98,98,98,98,98,98,98,98,98,98,220,49,0,0,0,0,0,0,0,0,0,50,218,98,98,98,98,98,98,98,98,98, + 220,49,0,0,0,0,50,218,98,98,98,98,98,98,98,98,98,98,220,49,0,0,0,0,0,0,0,0,0,50,218,98,98,98,98,98,98,98,98,98, + 220,49,0,0,0,0,50,218,98,98,98,98,98,98,98,98,98,99,260,49,0,0,0,0,0,0,0,0,0,50,258,100,98,98,98,98,98,98,98,98, + 220,49,0,0,0,0,50,218,98,98,98,98,98,98,98,98,98,220,49,0,0,0,0,0,0,0,0,0,0,0,50,218,98,98,98,98,98,98,98,98, + 220,49,0,0,0,0,50,218,98,98,98,98,98,98,98,98,98,220,49,0,0,0,0,0,0,0,0,0,0,0,50,218,98,98,98,98,98,98,98,98, + 220,49,0,0,0,0,50,218,98,98,98,98,98,98,98,98,98,220,49,0,0,0,0,0,0,0,0,0,0,0,50,218,98,98,98,98,98,98,98,98, + 220,49,0,0,0,0,50,218,98,98,98,98,98,98,98,98,99,260,49,0,0,0,0,0,0,0,0,0,0,0,50,258,100,98,98,98,98,98,98,98, + 220,49,0,0,0,0,50,218,98,98,98,98,98,98,98,98,220,49,0,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,98,98,98,98,98,98, + 220,49,0,0,0,0,50,218,98,98,98,98,98,98,98,98,220,49,0,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,98,98,98,98,98,98, + 220,49,0,0,0,0,50,218,98,98,98,98,98,98,98,98,220,49,0,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,98,98,98,98,98,98, + 220,49,0,0,0,0,50,218,98,98,98,98,98,98,98,98,220,49,0,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,98,98,98,98,98,98, + 220,49,0,0,0,0,50,218,98,98,98,98,98,98,98,98,220,49,0,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,98,98,98,98,98,98, + }; + + roomname="Veni"; + result = contents; + break; + } + + case rn(56,50): + { + + static const short contents[] = { + 211,49,0,0,0,0,50,209,89,89,89,89,89,89,89,89,211,49,0,0,0,0,0,0,0,0,0,0,0,0,0,50,209,89,89,89,89,89,89,89, + 211,49,0,0,0,0,50,209,89,89,89,89,89,89,89,89,211,49,0,0,0,0,0,0,0,0,0,0,0,0,0,50,209,89,89,89,89,89,89,89, + 211,49,0,0,0,0,50,209,89,89,89,89,89,89,89,89,211,49,0,0,0,0,0,0,0,0,0,0,0,0,0,50,209,89,89,89,89,89,89,89, + 211,49,0,0,0,0,50,209,89,89,89,89,89,89,89,89,211,49,0,0,0,0,0,0,0,0,0,0,0,0,0,50,209,89,89,89,89,89,89,89, + 211,49,0,0,0,0,50,209,89,89,89,89,89,89,89,89,211,49,0,0,0,0,0,0,0,0,0,0,0,0,0,50,209,89,89,89,89,89,89,89, + 211,49,0,0,0,0,50,209,89,89,89,89,89,89,89,89,211,49,0,0,0,0,0,0,0,0,0,0,0,0,0,50,209,89,89,89,89,89,89,89, + 211,49,0,0,0,0,50,209,89,89,89,89,89,89,89,89,211,49,0,0,0,0,0,0,0,0,0,0,0,0,0,50,209,89,89,89,89,89,89,89, + 211,49,0,0,0,0,50,209,89,89,89,89,89,89,89,89,211,49,0,0,0,0,0,0,0,0,0,0,0,0,0,50,209,89,89,89,89,89,89,89, + 211,49,0,0,0,0,50,209,89,89,89,89,89,89,89,89,211,49,0,0,0,0,0,0,0,0,0,0,0,0,0,50,209,89,89,89,89,89,89,89, + 211,49,0,0,0,0,50,209,89,89,89,89,89,89,89,89,211,49,0,0,0,0,0,0,0,0,0,0,0,0,0,50,209,89,89,89,89,89,89,89, + 211,49,0,0,0,0,50,209,89,89,89,89,89,89,89,89,211,49,0,0,0,0,0,0,0,0,0,0,0,0,0,50,209,89,89,89,89,89,89,89, + 211,49,0,0,0,0,50,209,89,89,89,89,89,89,89,89,211,49,0,0,0,0,0,0,0,0,0,0,0,0,0,50,209,89,89,89,89,89,89,89, + 211,49,0,0,0,0,50,209,89,89,89,89,89,89,89,89,211,49,0,0,0,0,0,0,0,0,0,0,0,0,0,50,209,89,89,89,89,89,89,89, + 211,49,0,0,0,0,50,209,89,89,89,89,89,89,89,89,211,49,0,0,0,0,0,0,0,0,0,0,0,0,0,50,209,89,89,89,89,89,89,89, + 211,49,0,0,0,0,0,249,250,250,250,250,250,250,250,250,251,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,249,250,250,250,250,91,89,89, + 211,49,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,209,89,89, + 211,49,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,209,89,89, + 211,49,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,209,89,89, + 211,49,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,209,89,89, + 211,49,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,209,89,89, + 211,49,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,210,0,0,0,0,0,0,0,0,0,0,0,0,209,89,89, + 130,170,170,170,170,170,171,0,0,0,0,169,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,171,0,0,0,0,209,89,89, + 89,89,89,89,89,89,211,0,0,0,0,249,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,251,0,0,0,0,209,89,89, + 89,89,89,89,89,89,211,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,209,89,89, + 89,89,89,89,89,89,211,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,209,89,89, + 89,89,89,89,89,89,211,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,209,89,89, + 89,89,89,89,89,89,211,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,209,89,89, + 89,89,89,89,89,89,211,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,169,170,170,170,170,170,170,170,131,89,89, + 89,89,89,89,89,89,130,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,131,89,89,89,89,89,89,89,89,89,89, + 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89, + }; + + obj.createentity(224, 144, 9, 5); // (shiny trinket) + obj.createentity(96, 152, 10, 1, 450560); // (savepoint) + + obj.createentity(24, 152, 20, 1); // (terminal) + obj.createblock(5, 24-4, 152, 20, 16, 16); + roomname = "Doing Things The Hard Way"; + result = contents; + break; + } + + //Final section: The overlap + + case rn(53,43): + { + + static const short contents[] = { + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,761,761,761,761,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,496,656,656,656,656,656,656,656,656,656,656,656,656,656,657,680,680,680,680,655,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,497,495, + 495,495,495,617,9,9,9,9,9,9,9,9,9,9,1123,7,7,7,680,680,680,680,7,7,7,1125,9,9,9,9,9,9,9,9,9,9,9,9,615,495, + 656,656,656,657,0,0,0,0,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0,0,0,0,0,0,0,655,656, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 576,576,576,576,576,576,576,576,576,577,8,8,8,8,1120,680,680,680,680,680,680,680,680,680,680,1122,8,8,8,8,575,576,576,576,576,576,576,576,576,576, + 495,495,495,495,495,495,495,495,495,536,576,576,576,576,577,680,680,680,680,680,680,680,680,680,680,575,576,576,576,576,537,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,680,680,680,680,680,680,680,680,680,680,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,680,680,680,680,680,680,680,680,680,680,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,680,680,680,6,6,6,6,680,680,680,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,680,680,680,575,576,576,577,680,680,680,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,680,680,680,655,656,656,657,680,680,680,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,680,680,680,7,7,7,7,680,680,680,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,680,680,680,680,680,680,680,680,680,680,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,680,680,680,680,680,680,680,680,680,680,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,680,680,680,680,680,680,680,680,680,680,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,680,680,680,680,680,680,680,680,680,680,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,680,680,680,680,680,680,680,680,680,680,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,680,680,680,680,680,680,680,680,680,680,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,680,680,680,680,680,680,680,680,680,680,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,841,841,841,841,841,841,841,841,841,841,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + }; + + obj.platformtile = 707; + obj.createentity(272, 40, 2, 14, 2); // Platform + obj.createentity(240, 40, 3, 707); //Disappearing Platform + + if(game.intimetrial && game.timetriallevel > 0) + { + obj.fatal_top(); + } + roomname = "Exhaust Chute"; + result = contents; + break; + } + + case rn(56,43): + { + + static const short contents[] = { + 301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301, + 301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301, + 462,462,462,462,303,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301, + 9,9,9,9,421,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301, + 0,0,0,0,421,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301, + 0,0,0,0,461,303,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301, + 0,0,0,0,0,421,301,301,301,301,301,301,301,301,301,301,301,301,301,301,302,462,462,462,462,462,462,462,462,462,462,462,462,462,303,301,301,301,301,301, + 0,0,0,0,0,421,301,301,301,301,301,301,301,301,301,301,301,301,302,462,463,704,704,704,704,704,704,704,704,704,704,704,704,704,421,301,301,301,301,301, + 0,0,0,0,0,461,303,301,301,301,301,301,301,301,301,301,302,462,463,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,461,303,301,301,301,301, + 0,0,0,0,0,0,421,301,301,301,301,301,301,301,302,462,463,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,421,301,301,301,301, + 0,0,0,0,0,0,421,301,301,301,301,301,302,462,463,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,461,303,301,301,301, + 0,0,0,0,0,0,461,462,462,462,462,462,463,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,421,301,301,301, + 0,0,0,0,0,0,0,0,824,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,461,303,301,301, + 0,0,0,0,0,0,0,0,824,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,421,301,301, + 0,0,0,0,0,0,0,0,824,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,421,301,301, + 0,0,0,0,0,0,0,0,824,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,421,301,301, + 0,0,0,0,0,0,0,0,824,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,421,301,301, + 0,0,0,0,0,0,0,0,824,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,381,343,301,301, + 382,382,382,382,382,382,382,382,382,382,382,382,383,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,421,301,301,301, + 301,301,301,301,301,301,301,301,301,301,301,301,342,382,383,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,381,343,301,301,301, + 462,462,462,462,462,462,462,462,462,462,462,462,303,301,342,382,383,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,421,301,301,301,301, + 704,704,704,704,704,704,704,704,704,704,704,704,421,301,301,301,342,382,383,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,381,343,301,301,301,301, + 0,0,0,0,0,0,0,0,824,704,704,704,421,301,301,301,301,301,342,382,383,704,704,704,704,704,704,704,704,704,704,704,704,704,421,301,301,301,301,301, + 0,0,0,0,0,0,0,0,864,865,865,865,421,301,301,301,301,301,301,301,342,382,382,382,382,382,382,382,382,382,382,382,382,382,343,301,301,301,301,301, + 0,0,0,0,0,0,0,0,0,0,0,0,421,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301, + 0,0,0,0,0,0,0,0,0,0,0,0,421,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301, + 382,382,382,382,382,382,382,383,0,0,0,0,421,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301, + 301,301,301,301,301,301,301,423,0,0,0,0,421,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301, + 301,301,301,301,301,301,301,423,0,0,0,0,421,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301, + 301,301,301,301,301,301,301,423,0,0,0,0,421,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301, + }; + + obj.createentity(0, 168, 2, 11, 4); //Big Threadmill, <<<<<< + obj.createentity(64, 168, 2, 9, 4); //Threadmill, <<< + obj.createentity(72, 128, 10, 1, 443560); // (savepoint) + + obj.createentity((21 * 8), (9 * 8), 14); //Teleporter! + + if(game.intimetrial) + { + obj.createblock(1, 56+16, 0, 32, 150, 82); + } + else + { + if(!obj.flags[7]) + { + if (game.nocutscenes) + { + obj.flags[7] = true; + game.teleportscript = "levelonecomplete"; + } + else + { + obj.createblock(1, 56, 0, 32, 150, 32); + } + } + } + roomname = "A Wrinkle in Time"; + result = contents; + break; + } + + + case rn(55,43): + { + + static const short contents[] = { + 86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86, + 86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86, + 247,247,247,88,86,86,86,87,247,247,247,247,247,247,247,88,86,86,86,86,86,86,86,86,87,247,247,247,247,247,247,247,88,86,86,86,87,247,247,247, + 9,9,9,206,86,86,86,208,9,9,9,9,9,9,9,206,86,86,86,86,86,86,86,86,208,9,9,9,9,9,9,9,206,86,86,86,208,9,9,9, + 0,0,0,246,247,247,247,248,0,0,0,0,0,0,0,206,86,86,86,86,86,86,86,86,208,0,0,0,0,0,0,0,246,247,247,247,248,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,246,247,247,247,247,247,247,247,247,248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,818,698,698,698,698,820,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,818,698,698,698,698,820,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,818,698,698,698,698,820,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,818,698,698,698,698,820,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,818,698,698,698,698,820,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,858,859,859,859,859,860,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,168,0,0,0,0,0,0,0,0,166,167,167,167,167,167,167,168,0,0,0,0,0,0,0,0, + 86,86,86,86,86,86,86,86,86,87,247,247,247,88,86,208,0,0,0,0,0,0,0,0,206,86,87,247,247,247,88,127,167,168,0,0,0,0,0,0, + 86,86,86,86,86,86,86,86,86,208,0,0,0,206,86,208,0,0,0,0,0,0,0,0,206,86,208,0,0,0,206,86,86,127,167,168,0,0,0,0, + 86,86,86,86,86,86,86,86,86,208,0,0,0,206,86,208,8,8,8,8,8,8,8,8,206,86,208,0,0,0,206,86,86,86,86,127,167,168,0,0, + 86,86,86,86,86,86,86,86,86,208,0,0,0,206,86,127,167,167,167,167,167,167,167,167,128,86,208,0,0,0,206,86,86,86,86,86,86,127,167,167, + 86,86,86,86,86,86,86,86,86,208,779,779,779,206,86,86,86,86,86,86,86,86,86,86,86,86,208,779,779,779,206,86,86,86,86,86,86,86,86,86, + 247,247,247,247,247,247,247,247,247,248,698,698,698,246,247,247,247,247,247,247,247,247,247,247,247,247,248,698,698,698,246,247,247,247,247,247,247,247,247,247, + 0,0,0,0,0,0,0,0,0,0,698,698,698,0,0,0,0,0,0,0,0,0,0,0,0,0,0,698,698,698,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,818,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,820,0,0,0,0,0,0, + 0,0,0,0,0,858,859,859,859,859,859,859,859,859,859,859,859,859,859,859,859,859,859,859,859,859,859,859,859,859,859,859,859,860,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167, + 86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86, + 86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86, + 86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86, + }; + + obj.createentity(0, 168, 2, 11, 4); //Big Threadmill, <<<<<< + obj.createentity(63, 64-16, 1, 3, 4, 64, 0, 256, 204); // Enemy, bounded + obj.createentity(256-28, 80, 1, 2, 4, 64, 0, 256, 204); // Enemy, bounded + obj.createentity(48, 168, 2, 9, 4); //Threadmill, <<< + obj.createentity(104, 168, 2, 11, 4); //Big Threadmill, <<<<<< + obj.createentity(152, 168, 2, 11, 4); //Big Threadmill, <<<<<< + obj.createentity(240, 168, 2, 11, 4); //Big Threadmill, <<<<<< + obj.createentity(288, 168, 2, 9, 4); //Threadmill, <<< + obj.createentity(160 - 48, 184 - 8, 1, 3, 5);// , 160, 0, 320, 240); // Enemy, bounded + obj.createentity(160 - 28 + 48, 184 - 8, 1, 2, 5);// , 0, 0, 160, 240); // Enemy, bounded + roomname = "Brass Sent Us Under The Top"; + result = contents; + break; + } + + case rn(54,43): + { + + static const short contents[] = { + 507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,629,0,0,0,0,0,0,627,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507, + 507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,629,0,0,0,0,0,0,627,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507, + 507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,629,0,0,0,0,0,0,667,668,509,507,507,507,507,508,668,668,668,668,668,668,668,668,668,668, + 507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,629,0,0,0,0,0,0,9,9,627,507,507,507,507,629,9,9,9,9,9,9,9,9,9,9, + 507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,629,0,0,0,0,0,0,0,0,667,668,668,668,668,669,0,0,0,0,0,0,0,0,0,0, + 668,668,668,668,668,668,668,668,509,507,507,507,507,507,507,629,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,627,507,507,507,507,507,507,629,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,627,507,507,507,507,507,507,629,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,627,507,507,507,507,507,507,629,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,627,507,507,507,507,507,507,629,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 588,588,589,0,0,769,770,770,627,507,507,507,507,507,507,629,770,770,771,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 507,507,629,0,0,809,689,689,627,507,507,507,507,507,507,629,689,689,811,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 507,507,629,0,0,809,689,689,627,507,507,507,507,507,507,629,689,689,811,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 507,507,629,0,0,809,689,689,627,507,507,507,507,507,507,629,689,689,811,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 507,507,629,0,0,809,689,689,627,507,507,507,507,507,507,548,588,588,588,588,589,0,0,0,0,0,0,0,0,0,0,0,0,587,588,588,588,588,588,588, + 507,507,629,0,0,809,689,689,627,507,507,507,507,507,507,507,507,507,507,507,629,0,0,0,0,0,0,0,0,0,0,0,0,627,507,507,507,507,507,507, + 507,507,629,0,0,809,689,689,627,507,507,507,507,507,507,507,507,507,507,507,629,0,0,0,0,0,0,0,0,0,0,0,0,627,507,507,507,507,507,507, + 507,507,629,0,0,809,689,689,627,507,507,507,507,507,507,507,507,507,507,507,629,8,8,8,8,8,8,8,8,8,8,8,8,627,507,507,507,507,507,507, + 507,507,629,0,0,809,689,689,627,507,507,507,507,507,507,507,507,507,507,507,548,588,588,588,588,588,588,588,588,588,588,588,588,549,507,507,507,507,507,507, + 507,507,629,0,0,809,689,689,627,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507, + 507,507,629,0,0,809,689,689,667,668,668,668,668,668,668,668,668,668,668,668,668,668,668,668,668,668,668,668,668,668,668,668,668,668,668,668,668,668,668,668, + 507,507,629,0,0,809,689,689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 507,507,629,0,0,809,689,689,689,689,689,689,689,689,689,689,689,689,811,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 507,507,629,0,0,809,689,689,689,689,689,689,689,689,689,689,689,689,811,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 507,507,629,0,0,849,850,850,850,850,850,850,850,850,850,850,850,850,851,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 507,507,629,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 507,507,548,588,588,588,588,588,588,588,588,588,588,588,588,588,588,588,588,588,588,588,588,588,588,588,588,588,588,588,588,588,588,588,588,588,588,588,588,588, + 507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507, + 507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507, + 507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507, + }; + + obj.createentity(64, 168, 2, 11, 4); //Big Threadmill, <<<<<< + obj.createentity(128, 168, 2, 11, 4); //Big Threadmill, <<<<<< + obj.createentity(192, 168, 2, 11, 4); //Big Threadmill, <<<<<< + obj.createentity(256, 168, 2, 11, 4); //Big Threadmill, <<<<<< + obj.createentity(32+4, 48, 10, 0, 443540); // (savepoint) + obj.createentity(208-4, 48, 1, 0, 3, 104, 40, 324, 136); // Enemy, bounded + obj.createentity(136 + 4, 96, 10, 1, 443541); // (savepoint) + + roomname = "The Tomb of Mad Carew"; + result = contents; + break; + } + + case rn(52,43): + { + + static const short contents[] = { + 310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,432,0,0,812,692,692,692,692,692,430,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310, + 310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,432,0,0,812,692,692,692,692,692,430,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310, + 471,471,471,471,471,471,471,471,471,471,471,471,471,471,471,472,0,0,812,692,692,692,692,692,430,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,812,692,692,692,692,692,430,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,812,692,692,692,692,692,430,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,812,692,692,692,692,692,430,310,310,310,311,471,471,471,471,471,471,471,471,471,471,471, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,812,692,692,692,692,692,430,310,310,310,432,692,692,692,692,692,692,692,814,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,852,853,853,853,853,853,430,310,310,310,432,853,853,853,853,853,853,853,854,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,430,310,310,310,432,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,430,310,310,310,432,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,430,310,310,310,432,0,0,0,0,0,0,390,391,391,391,391, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,430,310,310,310,432,0,0,0,0,0,0,430,310,310,310,310, + 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,390,391,391,391,391,391,391,391,352,310,310,310,432,0,0,0,0,0,0,430,310,310,310,310, + 391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,352,310,310,310,310,310,310,310,310,310,310,310,432,0,0,0,0,0,0,430,310,310,310,310, + 310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,432,0,0,0,0,0,0,430,310,310,310,310, + 471,471,471,471,471,471,312,310,310,311,471,471,312,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,432,0,0,0,0,0,0,430,310,310,310,310, + 9,9,9,9,9,9,430,310,310,432,9,9,430,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,432,0,0,0,0,0,0,430,310,310,310,310, + 0,0,0,0,0,0,470,471,471,472,0,0,430,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,432,0,0,0,0,0,0,430,310,310,310,310, + 0,0,0,0,0,0,0,0,0,0,0,0,430,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,432,0,0,0,0,0,0,430,310,310,310,310, + 0,0,0,0,0,0,0,0,0,0,0,0,430,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,432,0,0,0,0,0,0,430,310,310,310,310, + 0,0,0,0,0,0,0,0,0,0,0,0,430,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,432,0,0,0,0,0,0,430,310,310,310,310, + 0,0,0,0,0,0,0,0,0,0,0,0,430,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,432,0,0,0,0,0,0,430,310,310,310,310, + 0,0,0,0,0,0,0,0,0,0,772,773,430,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,432,0,0,0,0,0,0,430,310,310,310,310, + 0,0,0,0,0,0,0,0,0,0,812,692,430,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,432,0,0,0,0,0,0,430,310,310,310,310, + 0,0,0,0,0,0,0,0,0,0,812,692,430,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,432,0,0,0,0,0,0,430,310,310,310,310, + 0,0,0,0,0,0,0,0,0,0,812,692,430,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,432,0,0,0,0,0,0,430,310,310,310,310, + 391,391,391,391,392,0,0,0,0,0,812,692,430,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,432,0,0,0,0,0,0,430,310,310,310,310, + 310,310,310,310,432,0,0,0,0,0,812,692,430,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,432,0,0,0,0,0,0,430,310,310,310,310, + 310,310,310,310,432,0,0,0,0,0,812,692,430,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,432,0,0,0,0,0,0,430,310,310,310,310, + 310,310,310,310,432,0,0,0,0,0,812,692,430,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,432,0,0,0,0,0,0,430,310,310,310,310, + }; + + obj.createentity(56, 144, 10, 0, 443520); // (savepoint) + obj.createentity(152, 80, 10, 1, 443521); // (savepoint) + roomname = "The Sensible Room"; + result = contents; + break; + } + + case rn(51,43): + { + + static const short contents[] = { + 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89, + 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89, + 250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 8,8,8,8,8,8,8,8,8,8,8,8,169,170,170,170,170,170,170,170,170,170,170,170,170,170,170,171,8,8,8,8,8,8,8,8,8,8,8,8, + 170,170,170,170,170,170,170,170,170,170,170,170,131,89,89,89,89,89,89,89,89,89,89,89,89,89,89,130,170,170,170,170,170,170,170,170,170,170,170,170, + 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89, + 250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,91,90,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250, + 9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,249,251,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170, + 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89, + 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89, + 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89, + }; + + obj.createentity(0, -200, 1, 16, 6, -64, -500, 320 + 64, 340); + roomname = "B-B-B-Busted"; + result = contents; + break; + } + + + case rn(50,43): + { + + static const short contents[] = { + 286,286,286,286,286,408,689,689,811,0,0,0,406,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, + 286,286,286,286,286,408,689,689,811,0,0,0,406,287,447,447,447,447,288,286,286,286,286,286,286,287,447,447,447,447,288,286,286,286,286,286,286,286,286,286, + 286,286,286,286,286,408,689,689,811,0,0,0,446,448,9,9,9,9,446,447,447,447,447,447,447,448,9,9,9,9,446,447,447,447,447,447,447,447,447,447, + 286,286,286,286,286,408,689,689,811,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 286,286,286,286,286,408,689,689,811,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 286,286,286,286,286,408,689,689,811,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 286,286,286,286,286,408,689,689,811,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 286,286,286,286,286,408,850,850,851,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 286,286,286,286,286,327,367,367,367,367,367,367,367,367,367,367,367,367,367,368,8,8,8,8,366,367,367,367,367,367,367,368,8,8,8,8,8,8,8,8, + 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,327,367,367,367,367,328,286,286,286,286,286,286,327,367,367,367,367,367,367,367,367, + 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, + 447,447,447,447,288,286,286,287,447,447,447,447,288,286,286,287,447,447,447,447,288,286,286,287,447,447,447,447,288,286,286,287,447,447,447,447,447,447,447,447, + 9,9,9,9,446,447,447,448,9,9,9,9,446,447,447,448,9,9,9,9,446,447,447,448,9,9,9,9,446,447,447,448,9,9,9,9,9,9,9,9, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 367,367,367,368,8,8,8,8,366,367,367,368,8,8,8,8,366,367,367,368,8,8,8,8,366,367,367,368,8,8,8,8,366,367,367,367,367,367,367,367, + 286,286,286,327,367,367,367,367,328,286,286,327,367,367,367,367,328,286,286,327,367,367,367,367,328,286,286,327,367,367,367,367,328,286,286,286,286,286,286,286, + 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, + 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, + }; + + obj.createentity(280, 192, 10, 1, 443500); // (savepoint) + obj.createentity(64, 80, 10, 1, 443501); // (savepoint) + + if(!game.nocutscenes) + { + obj.createblock(1, 0, 0, 112, 112, 8); + } + roomname = "V Stitch"; + result = contents; + break; + } + + + case rn(49,43): + { + + //No const here... + static short contents[] = { + 492,614,680,680,680,680,652,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,654,680,680,802,0,0,0,612,492,492,492,492,492, + 492,614,680,680,680,680,680,802,0,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,612,492,492,492,492,492, + 492,614,680,680,680,680,680,802,0,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,612,492,492,492,492,492, + 492,614,680,680,680,680,680,802,0,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,612,492,492,492,492,492, + 492,614,680,680,680,680,680,802,0,0,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,612,492,492,492,492,492, + 492,614,680,680,680,680,680,802,0,0,0,0,0,0,0,800,680,680,680,6,6,6,6,6,6,6,6,6,6,6,1122,8,8,8,612,492,492,492,492,492, + 492,614,680,680,680,680,680,802,0,0,0,0,0,0,0,840,841,841,841,572,573,573,573,573,573,573,573,573,573,573,573,573,573,573,534,492,492,492,492,492, + 492,614,680,680,680,680,680,802,0,0,0,0,0,0,0,0,0,0,0,612,492,492,493,653,653,653,653,653,653,653,653,653,653,653,653,653,653,494,492,492, + 492,614,680,680,680,680,680,802,0,0,0,0,0,0,0,0,0,0,0,652,653,653,654,9,9,9,9,9,9,9,9,9,9,9,9,9,9,612,492,492, + 492,533,573,573,573,573,573,573,573,573,574,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492, + 492,492,492,492,492,492,492,492,492,492,533,573,573,573,574,0,0,0,0,572,573,573,574,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,612,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,612,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,612,492,492,614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,612,492,492,614,0,0,0,0,8,8,8,8,8,8,0,0,0,0,612,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,612,492,492,614,0,0,0,0,572,573,573,573,573,574,0,0,0,0,652,653,653, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,612,492,492,614,0,0,0,0,612,493,653,653,653,654,0,0,0,0,9,9,9, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,0,0,0,0,612,492,492,614,0,0,0,0,612,614,0,0,0,0,0,0,0,0,0,0,0, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,614,8,8,8,8,612,492,492,614,0,0,0,0,612,614,0,0,0,0,0,0,0,0,0,0,0, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,533,573,573,573,573,534,492,492,533,573,573,573,573,534,614,0,0,0,0,0,0,0,0,0,0,0, + 653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,654,0,0,0,0,0,0,0,0,0,0,0, + 680,680,680,680,680,680,680,802,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 680,680,680,680,680,680,680,802,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 841,841,841,841,841,841,841,842,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + }; + + //Remove spikes in modes where the player shouldn't kill themselves + int spikevalue = (game.nodeathmode || game.intimetrial) ? 0 : 9; + for (int i = 23; i < 23+14; i++) + { + contents[i + 8*40] = spikevalue; + } + + obj.platformtile = 747; + obj.createentity(120, 72, 3, 747); //Disappearing Platform + obj.createentity(120, 112, 3, 747); //Disappearing Platform + obj.createentity(120, 128, 3, 747); //Disappearing Platform + obj.createentity(88, 72, 2, 15, 4); // Platform + obj.createentity(192, 128, 9, 6); // (shiny trinket) + obj.createentity(240, 136, 10, 0, 443490); // (savepoint) + roomname = "Prize for the Reckless"; + if(game.nodeathmode) + { + roomname = "I Can't Believe You Got This Far"; + } + else if (game.intimetrial) + { + roomname = "Imagine Spikes There, if You Like"; + } + result = contents; + break; + } + + case rn(48,43): + { + + static const short contents[] = { + 89,89,211,695,695,695,695,209,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89, + 89,89,211,695,695,695,695,209,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89, + 89,89,211,695,695,695,695,249,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,91,89,89, + 89,89,211,695,695,695,695,695,695,817,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,815,695,695,695,695,695,695,209,89,89, + 89,89,211,695,695,695,695,695,695,817,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,815,695,695,695,695,695,695,209,89,89, + 89,89,211,695,695,695,695,695,695,817,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,815,695,695,695,695,695,695,209,89,89, + 89,89,211,695,695,695,695,695,695,817,0,0,0,169,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,171,695,695,695,695,209,89,89, + 89,89,211,695,695,695,695,695,695,817,0,0,0,209,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,211,695,695,695,695,209,89,89, + 89,89,211,695,695,695,695,695,695,817,0,0,0,209,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,211,695,695,695,695,209,89,89, + 89,89,211,695,695,695,695,695,695,817,0,0,0,249,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,251,695,695,695,695,209,89,89, + 89,89,211,695,695,695,695,695,695,817,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,695,695,695,209,89,89, + 89,89,211,695,695,695,695,695,695,817,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,815,695,695,695,695,695,695,209,89,89, + 89,89,211,695,695,695,695,695,695,817,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,815,695,695,695,695,695,695,209,89,89, + 89,89,211,695,695,695,695,695,695,817,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,815,695,695,695,695,695,695,209,89,89, + 89,89,211,856,856,856,856,856,856,857,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,815,695,695,695,695,695,695,209,89,89, + 89,89,211,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,815,695,695,695,695,695,695,209,89,89, + 89,89,211,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,815,695,695,695,695,695,695,209,89,89, + 89,89,211,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,815,695,695,695,695,695,695,209,89,89, + 89,89,211,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,815,695,695,695,695,695,695,209,89,89, + 89,89,211,0,0,0,0,169,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,171,0,0,0,815,695,695,695,695,695,695,209,89,89, + 89,89,211,0,0,0,0,209,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,211,0,0,0,815,695,695,695,695,695,695,249,250,250, + 89,89,211,0,0,0,0,209,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,211,0,0,0,815,695,695,695,695,695,695,695,695,695, + 89,89,211,0,0,0,0,249,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,251,0,0,0,815,695,695,695,695,695,695,695,695,695, + 89,89,211,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,855,856,856,856,856,856,856,856,856,856, + 89,89,211,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 89,89,211,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 89,89,130,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170, + 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89, + 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89, + 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89, + }; + + obj.createentity(152, 32, 10, 1, 443480); // (savepoint) + obj.createentity(152, 184, 10, 0, 443481); // (savepoint) + obj.createentity(272, 120, 1, 2, 8); // Enemy + obj.createentity(32, 96, 1, 3, 8); // Enemy + obj.createentity(104, 80, 2, 10, 4); //Big Threadmill, >>>>>> + obj.createentity(168, 80, 2, 10, 4); //Big Threadmill, >>>>>> + obj.createentity(232, 80, 2, 8, 4); //Threadmill, >>> + obj.createentity(56, 144, 2, 10, 4); //Big Threadmill, >>>>>> + obj.createentity(120, 144, 2, 10, 4); //Big Threadmill, >>>>>> + obj.createentity(184, 144, 2, 8, 4); //Threadmill, >>> + roomname = "A Deception"; + result = contents; + break; + } + + case rn(48,42): + { + + static const short contents[] = { + 310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310, + 310,310,310,310,310,310,310,310,311,471,471,471,471,471,471,312,310,310,310,310,311,471,471,471,471,471,471,312,310,310,310,310,310,310,310,310,310,310,310,310, + 310,310,310,310,310,310,310,310,432,9,9,9,9,9,9,430,310,310,310,310,432,9,9,9,9,9,9,430,310,310,310,310,311,471,471,471,471,471,471,471, + 310,310,310,310,310,310,310,310,432,0,0,0,0,0,0,430,310,310,310,310,432,0,0,0,0,0,0,430,310,310,310,310,432,0,0,0,0,0,0,0, + 310,310,310,310,310,310,310,310,432,0,0,0,0,0,0,430,310,310,310,310,432,0,0,0,0,0,0,430,310,310,310,310,432,0,0,0,0,0,0,0, + 310,310,310,310,310,310,310,310,432,774,0,0,0,0,0,430,311,471,471,471,472,0,0,0,0,0,0,430,311,471,471,471,472,0,0,0,0,0,0,0, + 310,310,310,310,310,310,310,310,432,814,0,0,0,0,0,430,432,9,9,9,9,0,0,0,0,0,0,430,432,9,9,9,9,0,0,0,0,0,0,0, + 310,310,310,310,310,310,311,471,472,814,0,0,0,0,0,430,432,0,0,0,0,0,0,0,0,0,0,430,432,0,0,0,0,0,0,0,0,0,0,0, + 310,310,310,310,310,310,432,692,692,814,0,0,0,0,0,470,472,0,0,0,0,0,0,0,0,0,0,470,472,0,0,0,0,0,0,0,0,390,391,391, + 310,310,310,310,310,310,432,692,692,814,0,0,0,0,0,431,9,0,0,0,0,0,0,0,0,0,0,431,9,0,0,0,0,0,0,0,0,430,310,310, + 310,310,310,310,310,310,432,692,692,814,0,0,0,0,0,9,0,0,0,0,0,0,0,0,0,0,0,9,0,0,772,773,773,773,773,773,773,430,310,310, + 310,310,310,310,310,310,432,692,692,814,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,812,692,692,692,692,692,692,430,310,310, + 310,310,310,310,310,310,432,692,692,814,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,812,692,692,692,692,692,692,430,310,310, + 310,310,310,310,310,310,432,692,692,814,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,812,692,692,692,692,692,692,430,310,310, + 310,310,310,310,310,310,432,692,692,814,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,812,692,692,692,692,692,692,430,310,310, + 310,310,310,310,310,310,432,692,692,814,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,812,692,692,692,692,692,692,430,310,310, + 310,310,310,310,310,310,432,692,692,814,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,812,692,692,692,692,692,692,430,310,310, + 310,310,310,310,310,310,432,692,692,814,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,812,692,692,692,692,692,692,430,310,310, + 310,310,310,310,310,310,432,692,692,814,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,812,692,692,692,692,692,692,430,310,310, + 310,310,310,310,310,310,432,692,692,814,0,0,0,0,0,0,0,0,0,0,0,431,8,0,0,0,0,0,0,0,812,692,692,692,692,692,692,430,310,310, + 310,310,311,471,471,471,472,692,692,814,0,0,0,0,0,0,0,0,0,0,0,390,392,0,0,0,0,0,0,0,812,692,692,692,692,692,692,430,310,310, + 310,310,432,692,692,692,692,692,692,814,0,0,0,0,0,0,0,0,0,0,0,430,432,0,0,0,0,0,0,0,812,692,692,692,692,390,391,352,310,310, + 310,310,432,692,692,692,692,692,692,814,0,8,8,8,8,0,0,0,0,0,0,430,432,8,8,8,8,0,0,0,812,692,692,692,692,430,310,310,310,310, + 310,310,432,692,692,692,692,692,692,814,0,390,391,391,392,0,0,0,0,0,0,430,351,391,391,391,392,0,0,0,852,853,853,853,853,430,310,310,310,310, + 310,310,432,692,692,692,692,692,692,814,0,430,310,310,432,0,0,0,0,0,0,430,310,310,310,310,432,0,0,0,0,0,0,0,0,430,310,310,310,310, + 310,310,432,692,692,692,692,692,692,814,0,430,310,310,432,0,0,0,0,0,0,430,310,310,310,310,432,0,0,0,0,0,0,0,0,430,310,310,310,310, + 310,310,432,692,692,692,692,390,391,391,391,352,310,310,432,8,8,8,8,8,8,430,310,310,310,310,432,8,8,8,8,8,8,8,8,430,310,310,310,310, + 310,310,432,692,692,692,692,430,310,310,310,310,310,310,351,391,391,391,391,391,391,352,310,310,310,310,351,391,391,391,391,391,391,391,391,352,310,310,310,310, + 310,310,432,692,692,692,692,430,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310, + 310,310,432,692,692,692,692,430,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310, + }; + + obj.platformtile = 239; + obj.createentity(88, 112, 2, 0, 4, 88, 64, 264, 168); // Platform, bounded + obj.createentity(136, 112, 2, 1, 4, 88, 64, 264, 168); // Platform, bounded + obj.createentity(184, 112, 2, 0, 4, 88, 64, 264, 168); // Platform, bounded + obj.createentity(232, 112, 2, 1, 4, 88, 64, 264, 168); // Platform, bounded + obj.createentity(56, 64, 10, 0, 442480); // (savepoint) + obj.createentity(280, 152, 10, 1, 442481); // (savepoint) + + roomname = "Down Under"; + result = contents; + break; + } + + case rn(49,42): + { + + static const short contents[] = { + 295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,417,0,0,0,818,698,698,415,295,295,295,295,295, + 295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,417,0,0,0,818,698,698,415,295,295,295,295,295, + 456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,297,295,295,295,295,295,417,0,0,0,818,698,698,415,295,295,295,295,295, + 0,0,0,818,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,415,295,295,295,295,295,417,0,0,0,818,698,698,415,295,295,295,295,295, + 0,0,0,818,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,415,295,295,295,295,295,417,0,0,0,818,698,698,415,295,295,295,295,295, + 0,0,0,858,859,859,859,859,859,859,859,859,859,859,859,859,859,859,859,859,859,415,295,295,295,295,295,417,0,0,0,818,698,698,415,295,295,295,295,295, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295,295,295,417,0,0,0,818,698,698,415,295,295,295,295,295, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295,295,295,417,0,0,0,818,698,698,415,295,295,295,295,295, + 376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,377,0,0,0,0,415,295,295,295,295,295,417,0,0,0,818,698,698,415,295,295,295,295,295, + 295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,417,0,0,0,0,415,295,295,295,295,295,417,0,0,0,818,698,698,415,295,295,295,295,295, + 295,295,295,295,295,295,295,295,295,296,456,456,456,456,456,456,457,0,0,0,0,415,295,295,295,295,295,417,0,0,0,818,698,698,415,295,295,295,295,295, + 295,295,295,295,295,295,295,295,295,417,9,9,9,9,9,9,9,0,0,0,0,415,295,295,295,295,295,417,0,0,0,818,698,698,415,295,295,295,295,295, + 295,296,456,456,456,456,456,456,456,457,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295,295,295,417,0,0,0,818,698,698,415,295,295,295,295,295, + 295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295,295,295,417,0,0,0,818,698,698,415,295,295,295,295,295, + 295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295,295,295,417,0,0,0,818,698,698,415,295,295,295,295,295, + 295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295,295,295,417,0,0,0,818,698,698,415,295,295,295,295,295, + 295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295,295,295,417,0,0,0,818,698,698,415,295,295,295,295,295, + 295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295,295,295,417,0,0,0,818,698,698,415,295,295,295,295,295, + 295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295,295,295,417,0,0,0,858,859,859,415,295,295,295,295,295, + 295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295,295,295,417,0,0,0,0,0,0,415,295,295,295,295,295, + 295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295,295,295,417,0,0,0,0,0,0,415,295,295,295,295,295, + 295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,778,779,779,779,779,779,415,295,295,295,295,295,417,779,779,779,780,0,0,415,295,295,295,295,295, + 295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,818,698,698,698,698,698,415,295,295,295,295,295,417,698,698,698,820,0,0,415,295,295,295,295,295, + 295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295,295,295,417,698,698,698,820,0,0,415,295,295,295,295,295, + 295,417,0,0,0,0,0,0,0,0,0,0,0,375,376,376,376,376,376,376,376,337,295,295,295,295,295,417,698,698,698,820,0,0,415,295,295,295,295,295, + 295,417,0,0,0,0,8,8,8,8,8,8,8,415,295,295,295,295,295,295,295,295,295,295,295,295,295,417,698,698,698,820,0,0,415,295,295,295,295,295, + 295,417,0,0,0,0,375,376,376,376,376,376,376,337,295,295,295,295,295,295,295,295,295,295,295,295,295,417,698,698,698,820,0,0,415,295,295,295,295,295, + 295,417,779,779,779,779,415,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,417,698,698,698,820,0,0,415,295,295,295,295,295, + 295,417,698,698,698,698,415,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,417,698,698,698,820,0,0,415,295,295,295,295,295, + 295,417,698,698,698,698,415,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,417,698,698,698,820,0,0,415,295,295,295,295,295, + }; + + obj.createentity(16, 104, 2, 10, 4); //Big Threadmill, >>>>>> + obj.createentity(104, 184, 2, 11, 4); //Big Threadmill, <<<<<< + obj.createentity(144, 168, 10, 1, 442490); // (savepoint) + obj.createentity(24, 112, 10, 0, 442491); // (savepoint) + roomname = "Shenanigan"; + result = contents; + break; + } + + case rn(49,41): + { + + static const short contents[] = { + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, + 650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,491,489,489,489,489,489, + 0,0,0,0,0,0,0,0,809,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,609,489,489,489,489,489, + 0,0,0,0,0,0,0,0,809,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,609,489,489,489,489,489, + 0,0,0,0,0,0,0,0,809,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,609,489,489,489,489,489, + 0,0,0,0,0,0,0,0,849,850,850,850,850,850,850,850,850,850,850,850,850,850,850,850,850,850,850,850,850,850,850,850,850,850,609,489,489,489,489,489, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609,489,489,489,489,489, + 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,0,0,0,0,0,0,609,489,489,489,489,489, + 570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,571,0,0,0,769,770,770,609,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,809,689,689,609,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,809,689,689,609,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,809,689,689,609,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,809,689,689,609,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,809,689,689,609,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,809,689,689,609,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,809,689,689,609,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,809,689,689,609,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,809,689,689,609,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,809,689,689,609,489,489,489,489,489, + 489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,611,0,0,0,809,689,689,609,489,489,489,489,489, + }; + + obj.createentity(192, 88, 10, 0, 441490); // (savepoint) + + if(!game.intimetrial) + { + if(game.companion==0 && !obj.flags[10] && !game.crewstats[2]) //also need to check if he's rescued in a previous game + { + obj.createentity(42, 86, 16, 0); + obj.createblock(1, 0, 0, 140, 240, 34); + } + } + roomname = "Frown Upside Down"; + result = contents; + break; + } + + case rn(48,41): + { + + static const short contents[] = { + 298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298, + 298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298, + 298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298, + 298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298, + 298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298, + 298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298, + 298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298, + 298,298,298,298,298,298,299,459,459,459,459,459,459,459,300,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298, + 298,298,298,298,299,459,460,683,683,683,683,683,683,683,458,459,300,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298, + 298,298,298,299,460,683,683,683,683,683,683,683,683,683,683,683,458,300,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298, + 298,298,298,420,683,683,683,683,683,683,683,683,683,683,683,683,683,458,459,459,459,459,459,459,459,459,459,459,459,459,459,459,459,459,459,459,459,459,459,459, + 298,298,298,420,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,805,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 298,298,298,420,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,805,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 298,298,298,420,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,805,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 298,298,298,420,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,805,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 298,298,298,420,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,805,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 298,298,298,420,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,805,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 298,298,298,420,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,805,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,8,8, + 298,298,298,420,683,683,683,683,683,683,683,683,683,683,683,683,683,378,379,379,380,0,0,0,0,0,0,0,0,0,0,0,0,0,8,8,8,378,379,379, + 298,298,298,339,380,683,683,683,683,683,683,683,683,683,683,683,378,340,298,298,420,0,0,0,0,0,0,0,0,0,0,8,8,8,378,379,379,340,298,298, + 298,298,298,298,339,379,380,683,683,683,683,683,683,683,378,379,340,298,298,298,420,0,0,0,0,0,0,0,8,8,8,378,379,379,340,298,298,298,298,298, + 298,298,298,298,298,298,339,379,379,379,379,379,379,379,340,298,298,298,298,298,420,0,0,0,0,8,8,8,378,379,379,340,298,298,298,298,298,298,298,298, + 298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,420,8,8,8,8,378,379,379,340,298,298,298,298,298,298,298,298,298,298,298, + 298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,339,379,379,379,379,340,298,298,298,298,298,298,298,298,298,298,298,298,298,298, + 298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298, + 298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298, + 298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298, + 298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298, + 298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298, + 298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298, + }; + + obj.createentity((5 * 8) - 4, (8 * 8) + 4, 14); //Teleporter! + + if(game.intimetrial) + { + obj.createblock(1, 280, 0, 32, 240, 82); + } + roomname = "Energize"; + result = contents; + break; + } + + case rn(53,42): + { + + static const short contents[] = { + 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, + 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, + 453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453, + 0,0,0,818,698,698,698,698,698,698,698,698,698,698,698,820,0,0,9,9,9,9,0,0,818,698,698,698,698,698,698,698,698,698,698,698,820,0,0,0, + 0,0,0,818,698,698,698,698,698,698,698,698,698,698,698,820,0,0,0,0,0,0,0,0,818,698,698,698,698,698,698,698,698,698,698,698,820,0,0,0, + 0,0,0,818,698,698,698,698,698,698,698,698,698,698,698,820,0,0,0,0,0,0,0,0,818,698,698,698,698,698,698,698,698,698,698,698,820,0,0,0, + 0,0,0,818,698,698,698,698,698,698,698,698,698,698,698,820,0,0,0,0,0,0,0,0,818,698,698,698,698,698,698,698,698,698,698,698,820,0,0,0, + 0,0,0,818,698,698,698,698,698,698,698,698,698,698,698,820,0,0,0,0,0,0,0,0,818,698,698,698,698,698,698,698,698,698,698,698,820,0,0,0, + 0,0,0,818,698,698,698,698,698,698,698,698,698,698,698,820,0,0,0,0,0,0,0,0,818,698,698,698,698,698,698,698,698,698,698,698,820,0,0,0, + 0,0,0,818,698,698,698,698,698,698,698,698,698,698,698,820,0,0,0,0,0,0,0,0,818,698,698,698,698,698,698,698,698,698,698,698,820,0,0,0, + 0,0,0,818,698,698,698,698,698,698,698,698,698,698,698,820,0,0,0,0,0,0,0,0,818,698,698,698,698,698,698,698,698,698,698,698,820,0,0,0, + 0,0,0,818,698,698,698,698,698,698,698,698,698,698,698,820,0,0,0,0,0,0,0,0,818,698,698,698,698,698,698,698,698,698,698,698,820,0,0,0, + 0,0,0,858,859,859,859,859,859,859,859,859,859,859,859,860,0,0,0,0,0,0,0,0,858,859,859,859,859,859,859,859,859,859,859,859,860,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,0,0,0,0,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, + 373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,374,0,0,0,0,372,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373, + 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, + 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, + 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, + 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, + 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, + 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, + 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, + 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, + 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, + 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, + }; + + obj.createentity(40, 24, 10, 0, 442530); // (savepoint) + obj.createentity(264, 24, 10, 0, 442531); // (savepoint) + + roomname = "Driller"; + result = contents; + break; + } + + case rn(54,42): + { + + static const short contents[] = { + 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92, + 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,93,253,253,253,253,253,253,253,94,92,92,92,92,92,92,92,92,92,92,92, + 253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,254,9,9,9,9,9,9,9,212,92,92,92,92,92,92,92,92,92,92,92, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,92,92,92,92,92,92,92,92,92, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,92,92,92,92,92,92,92,92,92, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,92,92,92,92,92,92,92,92,92, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,92,92,92,92,92,92,92,92,92, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,92,92,92,92,92,92,92,92,92, + 0,0,0,0,0,0,0,0,0,0,0,0,0,172,173,174,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,92,92,92,92,92,92,92,92,92, + 0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,214,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,92,92,92,92,92,92,92,92,92, + 0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,214,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,92,92,92,92,92,92,92,92,92, + 0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,214,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,92,92,92,92,92,92,92,92,92, + 0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,214,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,92,92,92,92,92,92,92,92,92, + 0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,214,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,92,92,92,92,92,92,92,92,92, + 0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,214,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,92,92,92,92,92,92,92,92,92, + 0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,214,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,92,92,92,92,92,92,92,92,92, + 0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,214,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,92,92,92,92,92,92,92,92,92, + 0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,214,8,8,8,8,0,0,0,0,8,8,8,8,212,92,92,92,92,92,92,92,92,92,92,92, + 8,8,8,8,8,8,8,8,8,8,8,8,8,212,92,133,173,173,173,174,0,0,0,0,172,173,173,173,134,92,92,92,92,92,92,92,92,92,92,92, + 173,173,173,173,173,173,173,173,173,173,173,173,173,134,92,92,92,92,92,214,0,0,0,0,212,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92, + 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,0,0,0,0,212,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92, + 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,93,253,253,253,254,0,0,0,0,212,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92, + 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,0,0,0,0,0,0,0,0,212,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92, + 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,0,0,0,0,0,0,0,0,212,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92, + 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,0,0,0,0,0,0,0,0,212,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92, + 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,0,0,0,0,0,0,0,0,212,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92, + 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,0,0,0,0,0,0,0,0,212,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92, + 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,0,0,0,0,0,0,172,173,134,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92, + 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,0,0,0,0,0,0,212,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92, + 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,0,0,0,0,0,0,212,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92, + }; + + obj.createentity(128, 80, 3, 867); //Disappearing Platform + obj.createentity(160, 80, 3, 867); //Disappearing Platform + obj.createentity(192, 80, 3, 867); //Disappearing Platform + obj.createentity(128, 88, 3, 867); //Disappearing Platform + obj.createentity(160, 88, 3, 867); //Disappearing Platform + obj.createentity(192, 88, 3, 867); //Disappearing Platform + obj.createentity(128, 96, 3, 867); //Disappearing Platform + obj.createentity(128, 104, 3, 867); //Disappearing Platform + obj.createentity(128, 112, 3, 867); //Disappearing Platform + obj.createentity(128, 120, 3, 867); //Disappearing Platform + obj.createentity(160, 96, 3, 867); //Disappearing Platform + obj.createentity(160, 104, 3, 867); //Disappearing Platform + obj.createentity(160, 112, 3, 867); //Disappearing Platform + obj.createentity(160, 120, 3, 867); //Disappearing Platform + obj.createentity(192, 96, 3, 867); //Disappearing Platform + obj.createentity(192, 104, 3, 867); //Disappearing Platform + obj.createentity(192, 112, 3, 867); //Disappearing Platform + obj.createentity(192, 120, 3, 867); //Disappearing Platform + + if(!game.nocutscenes) + { + if(!obj.flags[68]) + { + obj.createblock(1, 32, 0, 320, 240, 17); + obj.flags[68] = true; + } + } + roomname = "Quicksand"; + result = contents; + break; + } + + case rn(52,42): + { + + static const short contents[] = { + 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95, + 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95, + 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,96,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256, + 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,217,9,9,9,9,9,9,9,9,9,9,9,9,9,9,0,0,0,0,0,0,0,0,0,0, + 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,217,0,0,0,0,0,0,0,0,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, + 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,217,0,0,0,0,0,0,0,0,175,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176, + 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,217,0,0,0,0,0,0,0,0,215,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95, + 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,217,0,0,0,0,0,0,0,0,215,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95, + 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,217,0,0,0,0,0,0,0,0,215,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95, + 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,217,0,0,769,770,770,770,770,770,215,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95, + 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,217,0,0,809,689,689,689,689,689,215,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95, + 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,217,0,0,809,689,689,689,689,689,215,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95, + 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,217,0,0,809,689,689,689,689,689,215,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95, + 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,217,0,0,809,689,689,689,689,689,215,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95, + 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,217,0,0,809,689,689,689,689,689,215,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95, + 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,217,0,0,809,689,689,689,689,689,215,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95, + }; + + obj.createentity(144, 40, 3); //Disappearing Platform + obj.createentity(200, 128, 3); //Disappearing Platform + roomname = "Boo! Think Fast!"; + result = contents; + break; + } + + case rn(50,42): + { + + static const short contents[] = { + 495,495,495,495,495,617,680,680,680,680,680,680,615,495,496,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,497,495,495,495,495, + 495,495,495,495,495,617,680,680,680,680,680,680,615,495,617,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,615,495,495,495,495, + 495,495,495,495,495,617,680,680,680,680,680,680,615,495,617,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,615,495,495,495,495, + 495,495,495,495,495,617,680,680,680,680,680,680,615,495,617,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,615,495,495,495,495, + 495,495,495,495,495,617,680,680,680,680,680,680,615,495,617,680,680,681,841,841,841,841,841,841,841,841,841,841,841,841,841,841,841,841,841,615,495,495,495,495, + 495,495,495,495,495,617,680,680,680,680,680,680,655,656,657,680,680,802,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495, + 495,495,495,495,495,617,680,680,680,680,680,680,7,7,7,680,680,802,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,655,656,656,656,656, + 495,495,495,495,495,617,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,495,617,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,495,617,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,495,617,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,495,617,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,495,617,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,495,536,576,576,576,576,576,576,576,576,577,680,680,802,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,680,680,802,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,495,496,656,656,656,656,656,656,656,656,657,680,680,802,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,495,617,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,495,617,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,495,617,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,495,617,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,495,617,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,495,617,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 495,495,495,495,495,617,680,680,680,680,680,680,6,6,6,680,680,802,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,575,576,576,576,576, + 495,495,495,495,495,617,680,680,680,680,680,680,575,576,577,680,680,802,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495, + 495,495,495,495,495,617,841,841,841,841,841,841,615,495,617,841,841,842,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495, + 495,495,495,495,495,617,0,0,0,0,0,0,615,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495, + 495,495,495,495,495,617,0,0,0,0,0,0,615,495,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,495,495,495,495, + 495,495,495,495,495,617,0,0,0,0,0,0,615,495,617,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,615,495,495,495,495, + 495,495,495,495,495,617,0,0,0,0,0,0,615,495,536,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,537,495,495,495,495, + 495,495,495,495,495,617,0,0,0,0,0,0,615,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + }; + + obj.createentity(288, 160, 10, 1, 442500); // (savepoint) + + + obj.createentity(135, 75, 2, 0, 3, 100, 70, 320, 160); + obj.createentity(185, 110, 2, 0, 3, 100, 70, 320, 160); + obj.createentity(235, 145, 2, 0, 3, 100, 70, 320, 160); + roomname = "Stop and Reflect"; + result = contents; + break; + } + + case rn(51,42): + { + + static const short contents[] = { + 86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86, + 86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86, + 86,86,86,86,86,86,86,87,247,247,247,247,247,247,247,247,247,88,87,247,247,247,247,247,247,247,88,87,247,247,247,247,247,247,247,247,247,88,86,86, + 86,86,86,86,86,86,86,208,9,9,9,9,9,9,9,9,9,206,208,9,9,9,9,9,9,9,206,208,9,9,9,9,9,9,9,9,9,206,86,86, + 86,86,86,86,86,86,86,208,0,0,0,0,0,0,0,0,0,206,208,0,0,0,0,0,0,0,206,208,0,0,0,0,0,0,0,0,0,206,86,86, + 86,86,86,86,86,86,86,208,0,0,0,0,0,0,0,0,0,246,248,0,0,0,0,0,0,0,246,248,0,0,0,0,0,0,0,0,0,206,86,86, + 247,247,247,247,247,247,88,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,86, + 0,0,0,0,0,0,206,208,0,0,0,0,0,0,0,0,0,166,168,0,0,0,0,0,0,0,166,168,0,0,0,0,0,0,0,0,0,206,86,86, + 0,0,0,0,0,0,246,248,0,0,0,0,0,0,0,0,0,246,248,0,0,0,0,0,0,0,246,248,0,0,0,0,0,0,0,0,0,206,86,86, + 0,0,0,0,0,0,9,9,0,0,0,0,0,0,0,0,0,9,9,0,0,0,0,0,0,0,9,9,0,0,0,0,0,0,0,0,0,206,86,86, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,86, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,86, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,86, + 0,0,0,0,778,779,779,779,779,779,779,779,779,779,779,779,779,779,779,779,779,779,779,779,779,779,779,779,779,779,779,779,779,779,779,779,779,206,86,86, + 0,0,0,0,818,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,206,86,86, + 0,0,0,0,818,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,206,86,86, + 0,0,0,0,818,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,206,86,86, + 0,0,0,0,818,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,206,86,86, + 0,0,0,0,818,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,206,86,86, + 0,0,0,0,818,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,206,86,86, + 0,0,0,0,818,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,206,86,86, + 0,0,0,0,818,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,206,86,86, + 167,167,167,167,167,167,167,167,167,167,167,167,168,698,698,698,166,167,167,167,168,698,698,698,166,167,167,167,168,698,698,698,166,167,167,167,167,128,86,86, + 86,86,86,86,86,86,86,86,86,86,86,86,208,698,698,698,206,86,86,86,208,698,698,698,206,86,86,86,208,698,698,698,206,86,86,86,86,86,86,86, + 86,86,86,86,86,86,86,86,86,86,86,86,208,698,698,698,206,86,86,86,208,698,698,698,206,86,86,86,208,698,698,698,206,86,86,86,86,86,86,86, + 86,86,86,86,86,86,86,86,86,86,86,86,208,698,698,698,206,86,86,86,208,698,698,698,206,86,86,86,208,698,698,698,206,86,86,86,86,86,86,86, + 86,86,86,86,86,86,86,86,86,86,86,86,208,698,698,698,206,86,86,86,208,698,698,698,206,86,86,86,208,698,698,698,206,86,86,86,86,86,86,86, + 86,86,86,86,86,86,86,86,86,86,86,86,127,167,167,167,128,86,86,86,127,167,167,167,128,86,86,86,127,167,167,167,128,86,86,86,86,86,86,86, + 86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86, + 86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86, + }; + + obj.platformtile = 207; + obj.createentity(112-4, 200-4, 1, 1, 6, 104, 144, 264, 240); // Enemy, bounded + obj.createentity(176-4, 152, 1, 0, 6, 104, 144, 264, 240); // Enemy, bounded + obj.createentity(240-4, 200-4, 1, 1, 6, 104, 144, 264, 240); // Enemy, bounded + obj.createentity(64, 48, 2, 3, 4); // Platform + obj.createentity(272, 152, 9, 1); // (shiny trinket) + + if(!game.nocutscenes) + { + obj.createblock(1, 16, 0, 320, 240, 47); + } + + roomname = "Trench Warfare"; + result = contents; + break; + } + + case rn(50,41): + { + + static const short contents[] = { + 92,92,92,92,92,214,0,0,0,0,0,0,212,92,93,253,253,253,94,92,92,92,92,92,92,92,92,92,92,92,92,92,93,253,253,253,94,92,92,92, + 92,92,92,92,92,214,0,0,0,0,0,0,212,92,214,0,0,0,212,92,92,92,92,92,92,92,92,92,92,92,92,92,214,0,0,0,212,92,92,92, + 92,92,92,92,92,214,0,0,0,0,0,0,212,92,214,0,0,0,212,92,92,92,92,92,92,92,92,92,92,92,92,92,214,0,0,0,212,92,92,92, + 92,92,92,92,92,214,0,0,0,0,0,0,212,92,214,0,0,0,212,92,92,92,92,92,92,92,92,92,92,92,92,92,214,0,0,0,212,92,92,92, + 92,92,92,92,92,214,0,0,0,0,0,0,252,253,254,0,0,0,252,253,253,253,253,253,253,253,253,253,253,253,253,253,254,0,0,0,252,253,253,94, + 92,92,92,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212, + 92,92,92,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212, + 92,92,92,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212, + 92,92,92,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,763,764,764,764,764,764,764,764,764,212, + 92,92,92,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,803,683,683,683,683,683,683,683,683,212, + 92,92,92,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,803,683,683,683,683,683,683,683,683,212, + 92,92,92,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,803,683,683,683,683,683,683,683,683,212, + 92,92,92,92,92,133,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,174,0,0,0,172,173,173,173,173,174,683,683,683,683,683,683,212, + 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,0,0,0,212,92,92,92,92,214,683,683,683,683,683,683,212, + 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,92,92,92,212,92,92,92,92,214,683,683,683,683,683,683,212, + 92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,214,0,0,0,212,92,92,92,92,214,683,683,683,683,683,683,212, + 92,92,92,92,92,93,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,254,0,0,0,252,253,253,253,253,254,683,683,683,683,683,683,212, + 92,92,92,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,803,683,683,683,683,683,683,683,683,212, + 92,92,92,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,803,683,683,683,683,683,683,683,683,212, + 92,92,92,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,803,683,683,683,683,683,683,683,683,212, + 92,92,92,92,92,214,764,764,764,764,764,764,764,764,764,764,764,764,764,764,764,764,764,764,764,764,764,764,764,764,725,683,683,683,683,683,683,683,683,212, + 92,92,92,92,92,214,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,212, + 92,92,92,92,92,214,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,212, + 92,92,92,92,92,214,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,212, + 92,92,92,92,92,214,683,683,683,683,683,683,172,173,174,683,683,683,172,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,134, + 92,92,92,92,92,214,683,683,683,683,683,683,212,92,214,683,683,683,212,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92, + 92,92,92,92,92,214,683,683,683,683,683,683,212,92,214,683,683,683,212,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92, + 92,92,92,92,92,214,683,683,683,683,683,683,212,92,214,683,683,683,212,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92, + 92,92,92,92,92,214,683,683,683,683,683,683,212,92,133,173,173,173,134,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92, + 92,92,92,92,92,214,683,683,683,683,683,683,212,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92, + }; + + obj.createentity(120+2, 8, 1, 0, 3); // Enemy + obj.createentity(264+2, 8, 1, 0, 3); // Enemy + obj.createentity(120+2, 208-4, 1, 1, 3); // Enemy + obj.createentity(192+2, 176-4, 1, 1, 3); // Enemy + obj.createentity(192+2, 40, 1, 0, 3); // Enemy + + obj.createentity(64, 80, 10, 1, 441501); // (savepoint) + obj.createentity(64, 136, 10, 0, 441502); // (savepoint) + + roomname = "The Yes Men"; + result = contents; + break; + } + + case rn(50,40): + { + + static const short contents[] = { + 283,283,283,283,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, + 283,283,283,283,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, + 283,283,283,283,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, + 283,283,283,283,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, + 283,283,283,283,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, + 283,283,283,283,283,405,0,0,0,0,0,0,443,444,444,444,444,444,444,444,444,444,444,444,444,444,285,283,284,444,444,444,444,444,444,444,444,444,444,444, + 283,283,283,283,283,405,0,0,0,0,0,0,9,9,9,9,9,9,9,9,9,9,9,9,9,9,403,283,405,0,0,0,0,0,815,695,695,695,695,695, + 283,283,283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,443,444,445,0,0,0,0,0,815,695,695,695,695,695, + 283,283,283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,815,695,695,695,695,695, + 283,283,283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,815,695,695,695,695,695, + 283,283,283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,815,695,695,695,695,695, + 283,283,283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,363,364,364,364,364,364,364, + 283,283,283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,283,283,283,283,283, + 283,283,283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,283,283,283,283,283, + 283,283,283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,283,283,283,283,283, + 283,283,283,283,283,324,364,364,364,364,364,364,364,364,364,364,365,8,8,8,8,363,364,364,364,364,364,364,364,364,364,364,364,325,283,283,283,283,283,283, + 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,324,364,364,364,364,325,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, + 283,283,283,283,283,284,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,285,283,283,283,283,283,283,283, + 283,283,283,283,283,405,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,403,283,283,283,283,283,283,283, + 283,283,283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,283,283,283,283,283,283, + 283,283,283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,443,444,444,444,444,444,444,444, + 283,283,283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,815,695,695,695,695,695, + 283,283,283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,815,695,695,695,695,695, + 283,283,283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,815,695,695,695,695,695, + 283,283,283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,815,695,695,695,695,695, + 283,283,283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,815,695,695,695,695,695, + 283,283,283,283,283,405,0,0,0,0,0,0,363,364,365,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,363,364,364,364,364,364,364,364,364, + 283,283,283,283,283,405,0,0,0,0,0,0,403,283,324,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,325,283,283,283,283,283,283,283,283, + 283,283,283,283,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, + 283,283,283,283,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, + }; + + obj.platformtile = 10; + obj.createentity(136-32, 64, 3, 10); //Disappearing Platform + obj.createentity(136, 64, 3, 10); //Disappearing Platform + obj.createentity(136+32, 64, 3, 10); //Disappearing Platform + obj.createentity(56, 104, 10, 1, 440500); // (savepoint) + obj.createentity(56, 152, 2, 3, 3); // Platform + obj.createentity(280, 192, 10, 1, 440501); // (savepoint) + + roomname = "Gantry and Dolly"; + result = contents; + break; + } + + case rn(51,40): + { + + static const short contents[] = { + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + 495,495,495,495,495,495,495,496,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,497,495,495,495,495, + 495,495,495,495,495,495,495,617,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,615,495,495,495,495, + 495,495,495,495,495,495,495,617,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,615,495,495,495,495, + 495,495,495,495,495,495,495,617,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,615,495,495,495,495, + 656,656,656,656,656,656,656,657,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,615,495,495,495,495, + 680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,575,576,576,576,537,495,495,495,495, + 680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,655,656,656,656,497,495,495,495,495, + 680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,615,495,495,495,495, + 680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,615,495,495,495,495, + 680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,615,495,495,495,495, + 576,577,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,615,495,495,495,495, + 495,536,576,577,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,615,495,495,495,495, + 495,495,495,536,576,577,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,615,495,495,495,495, + 495,495,495,495,495,536,576,577,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,615,495,495,495,495, + 495,495,495,495,495,495,495,536,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,577,680,680,680,680,615,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,680,680,680,680,615,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,617,680,680,680,680,615,495,495,495,495, + 495,495,495,496,656,656,656,656,656,656,656,656,656,497,495,496,656,656,656,656,656,656,656,656,656,656,656,656,497,495,617,680,680,680,680,615,495,495,495,495, + 495,495,495,617,680,680,680,680,680,680,680,680,680,615,495,617,680,680,680,680,680,680,680,680,680,680,680,680,615,495,617,680,680,680,680,615,495,495,495,495, + 656,656,656,657,680,680,680,680,680,680,680,680,680,615,495,617,680,680,680,680,680,680,680,680,680,680,680,680,615,495,617,680,680,680,680,615,495,495,495,495, + 680,680,680,680,680,680,680,680,680,680,680,680,680,615,495,617,680,680,680,680,680,680,680,680,680,680,680,680,615,495,617,680,680,680,680,615,495,495,495,495, + 680,680,680,680,680,680,680,680,680,680,680,680,680,615,495,617,680,680,680,680,680,680,680,680,680,680,680,680,615,495,617,680,680,680,680,615,495,495,495,495, + 680,680,680,680,680,680,680,575,576,577,680,680,680,655,656,657,680,680,680,575,576,576,576,576,577,680,680,680,655,656,657,680,680,680,680,615,495,495,495,495, + 680,680,680,680,680,680,680,615,495,617,680,680,680,680,680,680,680,680,680,615,495,495,495,495,617,680,680,680,680,680,680,680,680,680,680,615,495,495,495,495, + 680,680,680,680,680,680,680,615,495,617,680,680,680,680,680,680,680,680,680,615,495,495,495,495,617,680,680,680,680,680,680,680,680,680,680,615,495,495,495,495, + 576,576,576,576,576,576,576,537,495,617,680,680,680,680,680,680,680,680,680,615,495,495,495,495,617,680,680,680,680,680,680,680,680,680,680,615,495,495,495,495, + 495,495,495,495,495,495,495,495,495,617,680,680,680,680,680,680,680,680,680,615,495,495,495,495,617,680,680,680,680,680,680,680,680,680,680,615,495,495,495,495, + 495,495,495,495,495,495,495,495,495,536,576,576,576,576,576,576,576,576,576,537,495,495,495,495,536,576,576,576,576,576,576,576,576,576,576,537,495,495,495,495, + 495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495, + }; + + obj.createentity(88, 104, 21, 1); // (savepoint) + obj.createentity(112, 104, 21, 1, 440511); // (savepoint) + obj.createentity(136, 88, 1, 0, 0); // Enemy //the radar dish + //obj.createentity(176, 104, 10, 1, 440512); // (savepoint) + obj.createentity(200, 104, 21, 1); // (savepoint) + obj.createentity(224, 104, 21, 1); // (savepoint) + obj.createentity(256, 32, 1, 0, 0); // Enemy //in this case, the transmitter + + if(!game.intimetrial) + { + obj.createblock(1, 120, 0, 320, 240, 31); + } + + roomname = "Comms Relay"; + result = contents; + break; + } + + case rn(50,39): + { + + static const short contents[] = { + 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, + 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, + 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,293,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,294, + 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,412, + 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,412, + 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,412, + 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,412, + 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,698,698,698,372,373,374,698,698,698,698,372,373,373,373,374,698,698,698,698,698,698,412, + 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,698,698,698,412,292,414,698,698,698,698,412,292,292,292,414,698,698,698,698,698,698,412, + 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,698,698,698,412,292,414,698,698,698,698,412,292,292,292,414,698,698,698,698,698,698,412, + 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,698,698,698,452,453,454,698,698,698,698,412,292,292,292,414,698,698,698,698,698,698,412, + 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,698,698,698,698,698,698,698,698,698,698,412,292,292,292,414,698,698,698,698,698,698,412, + 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,859,859,859,859,859,859,859,859,859,859,412,292,292,292,414,859,859,859,859,859,859,412, + 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,0,0,0,0,0,0,0,0,0,0,412,292,292,292,414,0,0,0,0,0,0,452, + 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,0,0,0,0,0,0,0,0,0,0,412,292,292,292,414,0,0,0,0,0,0,0, + 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,333,373,373,373,373,373,374,0,0,0,0,412,292,292,292,414,0,0,0,0,0,0,0, + 292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,0,0,0,0,412,292,292,292,414,0,0,0,0,0,0,0, + 292,292,292,292,292,293,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,454,0,0,0,0,412,292,292,292,414,0,0,0,0,0,0,0, + 292,292,292,292,292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,292,414,0,0,0,0,0,0,0, + 292,292,292,292,292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,292,414,0,0,0,0,0,0,0, + 292,292,292,292,292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,292,414,0,0,0,0,0,0,0, + 292,292,292,292,292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,292,414,0,0,0,0,0,0,0, + 292,292,292,292,292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,292,414,0,0,0,0,0,0,0, + 292,292,292,292,292,414,0,0,0,0,0,0,372,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,334,292,292,292,333,373,373,373,373,373,373,373, + 292,292,292,292,292,414,0,0,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, + 292,292,292,292,292,414,0,0,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, + 292,292,292,292,292,414,0,0,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, + 292,292,292,292,292,414,0,0,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, + 292,292,292,292,292,414,0,0,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, + 292,292,292,292,292,414,0,0,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292, + }; + + obj.createentity(200, 32, 1, 0, 8); // Enemy + obj.createentity(168, 104, 10, 1, 439500); // (savepoint) + + roomname = "Security Sweep"; + result = contents; + break; + } + + case rn(51,39): + { + + static const short contents[] = { + 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95, + 95,95,96,256,256,256,256,256,256,256,256,256,97,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95, + 95,95,217,0,0,0,0,0,0,0,0,0,215,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95, + 95,95,217,0,0,0,0,0,0,0,0,0,215,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95, + 95,95,217,0,0,0,0,0,0,0,0,0,215,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95, + 95,95,217,0,0,0,0,0,0,0,0,0,215,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,96,256,256,256,256,256,256, + 95,95,217,0,0,0,175,176,177,0,0,0,215,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,217,0,0,0,0,0,0, + 95,95,217,0,0,0,215,95,217,0,0,0,215,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,217,0,0,0,0,0,0, + 95,95,217,0,0,0,215,95,217,770,771,0,215,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,217,0,0,0,0,0,0, + 95,95,217,0,0,0,215,95,217,689,811,0,255,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,97,95,217,0,0,0,0,0,0, + 95,95,217,0,0,0,215,95,217,689,811,0,0,0,0,0,0,0,809,689,689,811,0,0,0,0,0,0,0,809,689,215,95,217,0,0,0,0,0,0, + 95,95,217,0,0,0,215,95,217,689,811,0,0,0,0,0,0,0,809,689,689,811,0,0,0,0,0,0,0,809,689,215,95,217,0,0,0,0,0,0, + 95,95,217,0,0,0,215,95,217,689,811,0,0,0,0,0,0,0,809,689,689,811,0,0,0,0,0,0,0,809,689,215,95,217,0,0,0,0,0,0, + 256,256,257,0,0,0,215,95,217,689,811,0,0,0,0,0,0,0,809,689,689,811,0,0,0,0,0,0,0,809,689,215,95,217,0,0,0,0,0,0, + 0,0,0,0,0,0,215,95,217,689,811,0,0,0,0,0,0,0,809,689,689,811,0,0,0,0,0,0,0,809,689,215,95,217,0,0,0,0,0,0, + 0,0,0,0,0,0,215,95,217,689,811,0,0,0,0,0,0,0,809,689,689,811,0,0,0,0,0,0,0,809,689,215,95,217,0,0,0,175,176,176, + 0,0,0,0,0,0,215,95,217,689,811,0,0,0,0,0,0,0,809,689,689,811,0,0,0,0,0,0,0,809,689,215,95,217,0,0,0,215,95,95, + 0,0,0,0,0,0,215,95,217,689,811,0,0,0,0,0,0,0,809,689,689,811,0,0,0,0,0,0,0,809,689,215,95,217,0,0,0,215,95,95, + 0,0,0,0,0,0,215,95,217,689,811,0,0,0,0,0,0,0,809,689,689,811,0,0,0,0,0,0,0,809,689,215,95,217,0,0,0,215,95,95, + 0,0,0,0,0,0,215,95,136,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,177,0,809,689,215,95,217,0,0,0,215,95,95, + 0,0,0,0,0,0,215,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,217,0,849,850,215,95,217,0,0,0,215,95,95, + 0,0,0,0,0,0,215,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,217,0,0,0,215,95,217,0,0,0,215,95,95, + 0,0,0,0,0,0,215,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,217,0,0,0,255,256,257,0,0,0,215,95,95, + 176,176,176,176,176,176,137,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,217,0,0,0,0,0,0,0,0,0,215,95,95, + 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,217,0,0,0,0,0,0,0,0,0,215,95,95, + 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,217,0,0,0,0,0,0,0,0,0,215,95,95, + 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,217,0,0,0,0,0,0,0,0,0,215,95,95, + 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,136,176,176,176,176,176,176,176,176,176,137,95,95, + 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95, + 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95, + }; + + obj.createentity(24, 168, 10, 1, 439510); // (savepoint) + obj.createentity(280, 48, 10, 0, 439511); // (savepoint) + obj.createentity(80, 88, 1, 3, 3); // Enemy + obj.createentity(224 - 16, 128, 1, 2, 3); // Enemy + + obj.createentity(256-4, 200, 20, 1); // (terminal) + obj.createblock(5, 256-8, 200, 20, 16, 6); + roomname = "Linear Collider"; + result = contents; + break; + } + + case rn(52,39): + { + + static const short contents[] = { + 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, + 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, + 289,289,289,289,289,289,289,289,289,290,450,450,450,450,450,450,450,450,450,450,450,450,450,291,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, + 289,289,289,289,289,289,289,289,289,411,7,7,7,7,7,7,7,7,7,7,7,7,7,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, + 289,289,289,289,289,289,289,289,289,411,680,680,680,680,680,680,680,680,680,680,680,680,680,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289, + 450,450,450,450,450,450,450,291,289,411,680,680,680,680,680,680,680,680,680,680,680,680,680,449,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450, + 0,0,0,0,0,0,0,409,289,411,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,409,289,411,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,409,289,411,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,409,289,411,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,409,289,411,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,802,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,409,289,411,680,680,680,680,680,680,681,841,841,841,841,841,841,682,680,680,680,680,680,680,680,802,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,409,289,411,680,680,680,680,680,680,802,0,0,0,0,0,0,800,680,680,680,680,680,680,369,370,371,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,409,289,411,680,680,680,680,680,680,802,0,0,0,0,0,0,800,680,680,680,680,680,680,409,289,411,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,409,289,411,680,680,680,680,680,680,802,0,0,0,0,0,0,800,680,680,680,680,680,680,409,289,411,0,0,0,0,0,0,0, + 370,370,371,0,0,0,0,409,289,411,680,680,680,680,680,680,802,0,0,0,0,0,0,800,680,680,680,680,680,680,409,289,330,370,370,370,370,370,370,370, + 289,289,411,0,0,0,0,409,289,411,680,680,680,680,680,680,802,0,0,0,0,0,0,800,680,680,680,680,680,680,409,289,289,289,289,289,289,289,289,289, + 289,289,411,0,0,0,0,449,450,451,680,680,680,680,680,680,721,761,761,761,761,761,761,722,680,680,680,680,680,680,409,289,289,289,289,289,289,289,289,289, + 289,289,411,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,409,289,289,289,289,289,289,289,289,289, + 289,289,411,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,409,289,289,289,289,289,289,289,289,289, + 289,289,411,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,409,289,289,289,289,289,289,289,289,289, + 289,289,411,0,0,0,0,0,800,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,409,289,289,289,289,289,289,289,289,289, + 289,289,330,370,370,370,370,370,370,370,370,370,370,370,370,370,371,680,680,680,680,680,680,680,680,680,680,680,680,680,409,289,289,289,289,289,289,289,289,289, + 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,680,680,680,680,680,680,680,680,680,680,680,680,680,409,289,289,289,289,289,289,289,289,289, + 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,6,6,6,6,6,6,6,6,6,680,680,680,680,409,289,289,289,289,289,289,289,289,289, + 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,330,370,370,370,370,370,370,370,370,371,680,680,680,680,409,289,289,289,289,289,289,289,289,289, + 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,841,841,841,841,409,289,289,289,289,289,289,289,289,289, + 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,0,0,0,0,409,289,289,289,289,289,289,289,289,289, + 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,0,0,0,0,409,289,289,289,289,289,289,289,289,289, + 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,0,0,0,0,409,289,289,289,289,289,289,289,289,289, + }; + + obj.createentity(192, 48, 10, 0, 439520); // (savepoint) + obj.createentity(112, 160, 10, 1, 439521); // (savepoint) + roomname = "Atmospheric Filtering Unit"; + result = contents; + break; + } + + case rn(53,39): + { + + static const short contents[] = { + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,484,644,644,644,644,485,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,695,695,695,695,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,695,695,695,695,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,695,695,695,695,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,695,695,695,695,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, + 644,644,644,644,644,644,644,644,644,644,644,644,644,644,645,695,695,695,695,643,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,485,483,483, + 0,0,0,0,0,0,0,815,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,603,483,483, + 0,0,0,0,0,0,0,815,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,603,483,483, + 0,0,0,0,0,0,0,815,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,603,483,483, + 0,0,0,0,0,0,0,815,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,603,483,483, + 0,0,0,0,0,0,0,815,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,603,483,483, + 0,0,0,0,0,0,0,815,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,603,483,483, + 0,0,0,0,0,0,0,815,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,603,483,483, + 0,0,0,0,0,0,0,815,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,603,483,483, + 0,0,0,0,0,0,0,815,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,603,483,483, + 564,564,564,564,565,0,0,815,695,563,564,564,564,564,564,564,564,564,564,564,564,564,564,564,565,695,695,695,695,563,564,565,695,695,695,695,695,603,483,483, + 483,483,483,483,605,0,0,815,695,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,695,695,695,695,603,483,605,695,695,695,695,695,603,483,483, + 483,483,483,483,605,0,0,815,695,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,695,695,695,695,603,483,605,695,695,695,695,695,603,483,483, + 483,483,483,483,605,0,0,815,695,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,695,695,695,695,603,483,605,695,695,695,695,695,603,483,483, + 483,483,483,483,605,0,0,815,695,603,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,695,695,695,695,603,483,605,695,695,695,695,695,603,483,483, + 483,483,483,483,524,564,564,564,564,525,483,483,483,483,483,483,483,483,483,483,483,483,483,483,524,564,564,564,564,525,483,605,695,695,695,695,695,603,483,483, + 483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,605,695,695,695,695,695,603,483,483, + 483,483,484,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,645,695,695,695,695,695,603,483,483, + 483,483,605,0,0,0,0,815,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,603,483,483, + 483,483,605,0,0,0,0,815,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,603,483,483, + 483,483,605,0,0,0,0,855,856,856,856,856,856,856,856,856,856,856,856,856,856,856,856,856,856,856,856,856,856,856,856,856,856,856,856,856,856,603,483,483, + 483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483, + 483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483, + 483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483, + 483,483,605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,603,483,483, + }; + + roomname = "Traffic Jam"; + + obj.createentity(45, 118, 1, 1, 4); + obj.createentity(205, 118, 1, 1, 4); + obj.createentity(125, 18, 1, 0, 4); + + obj.createentity(232, 184, 10, 0, 1); + result = contents; + break; + } + + case rn(53,40): + { + + static const short contents[] = { + 310,310,432,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,430,310,310, + 310,310,432,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,430,310,310, + 310,310,432,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,430,310,310, + 310,310,432,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,430,310,310, + 310,310,432,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,430,310,310, + 310,310,432,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,772,773,773,773,773,773,773,773,773,773,773,773,773,773,773,430,310,310, + 310,310,432,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,812,692,692,692,692,692,692,692,692,692,692,692,692,692,692,430,310,310, + 310,310,432,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,812,692,692,692,692,692,692,692,692,692,692,692,692,692,692,430,310,310, + 310,310,432,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,812,692,692,692,692,692,692,692,692,692,692,692,692,692,692,430,310,310, + 310,310,432,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,812,692,692,692,692,692,692,692,692,692,692,692,692,692,692,430,310,310, + 310,310,432,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,812,692,692,692,692,692,692,692,692,692,692,692,692,692,692,430,310,310, + 310,310,432,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,812,692,692,692,692,692,692,692,692,692,692,692,692,692,692,430,310,310, + 310,310,432,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,812,692,692,692,692,692,692,692,692,692,692,692,692,692,692,430,310,310, + 310,310,432,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,852,853,853,853,853,694,692,692,692,692,692,692,692,692,692,430,310,310, + 310,310,432,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,812,692,692,692,692,692,692,692,692,692,430,310,310, + 310,310,432,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,812,692,692,692,692,692,692,692,692,692,430,310,310, + 310,310,432,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,812,692,692,692,692,692,692,692,692,692,430,310,310, + 310,310,432,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,812,692,692,692,692,692,692,692,692,692,430,310,310, + 310,310,432,773,773,773,773,773,773,774,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,812,692,692,692,692,692,692,692,692,692,430,310,310, + 310,310,432,692,692,692,692,692,692,814,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,812,692,692,692,692,692,692,692,692,692,430,310,310, + 310,310,432,692,692,692,692,692,692,814,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,812,692,692,692,692,692,692,692,692,692,430,310,310, + 310,310,432,692,692,692,692,692,692,814,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,812,692,692,692,692,692,692,692,692,692,430,310,310, + 310,310,432,692,692,692,692,692,692,814,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,812,692,692,692,692,692,692,692,692,692,430,310,310, + 310,310,432,692,692,692,692,692,692,814,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,812,692,692,692,692,692,692,692,692,692,430,310,310, + 310,310,432,692,692,692,692,692,692,814,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,812,692,692,692,692,692,692,692,692,692,430,310,310, + 310,310,432,692,692,692,692,692,692,814,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,812,692,692,692,692,692,692,692,692,692,430,310,310, + 310,310,432,692,692,692,692,692,692,814,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,812,692,692,692,692,692,692,692,692,692,430,310,310, + 310,310,432,692,692,692,692,692,692,814,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,812,692,692,692,692,692,692,692,692,692,430,310,310, + 310,310,432,692,692,692,692,692,692,814,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,812,692,692,692,692,692,692,692,692,692,430,310,310, + 310,310,432,692,692,692,692,692,692,814,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,812,692,692,692,692,692,692,692,692,692,430,310,310, + }; + roomname = "Leap of Faith"; + result = contents; + break; + } + + case rn(53,41): + { + + static const short contents[] = { + 286,286,408,686,686,686,686,686,686,808,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,806,686,686,686,686,686,686,686,686,686,406,286,286, + 286,286,408,686,686,686,686,686,686,808,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,806,686,686,686,686,686,686,686,686,686,406,286,286, + 286,286,408,686,686,686,686,686,686,808,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,806,686,686,686,686,686,686,686,686,686,406,286,286, + 286,286,408,686,686,686,686,686,686,808,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,806,686,686,686,686,686,686,686,686,686,406,286,286, + 286,286,408,686,686,686,686,686,686,808,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,806,686,686,686,686,686,686,686,686,686,406,286,286, + 286,286,408,686,686,686,686,686,686,808,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,806,686,686,686,686,686,686,686,686,686,406,286,286, + 286,286,408,686,686,686,686,686,686,808,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,806,686,686,686,686,686,686,686,686,686,406,286,286, + 286,286,408,686,686,686,686,686,686,808,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,846,847,847,847,847,847,847,847,847,847,406,286,286, + 286,286,408,686,686,686,686,686,686,808,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286, + 286,286,408,686,686,686,686,686,686,808,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286, + 286,286,327,367,367,367,367,367,367,367,367,367,367,367,368,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286, + 286,286,286,286,286,286,286,286,286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286, + 447,447,447,447,447,447,447,447,288,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286, + 686,686,686,686,686,686,686,686,406,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286, + 686,686,686,686,686,686,686,686,406,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286, + 686,686,686,686,686,686,686,686,446,447,447,447,447,447,448,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286, + 686,686,686,686,686,686,686,686,686,808,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286, + 686,686,686,686,686,686,686,686,686,808,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286, + 686,686,686,686,686,686,686,686,686,808,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286, + 686,686,686,686,686,686,686,686,686,808,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286, + 686,686,686,686,686,686,686,686,686,808,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286, + 686,686,686,686,686,686,686,686,686,808,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286, + 686,686,686,686,686,686,686,686,686,808,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286, + 367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,328,286,286, + 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, + 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, + 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, + 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, + 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, + 286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, + }; + + obj.createentity(152, 168, 10, 1, 441530); // (savepoint) + + if(!game.nocutscenes) + { + obj.createblock(1, 72, 0, 320, 240, 30); + } + + roomname = "Solitude"; + result = contents; + break; + } + + case rn(52,41): + { + + static const short contents[] = { + 83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83, + 83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83, + 83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83, + 83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83, + 83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83, + 83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83, + 83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83, + 83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83, + 83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83, + 83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83, + 83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83, + 83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83, + 244,244,244,244,244,244,244,244,244,244,244,244,244,244,244,244,244,244,244,244,244,244,244,244,244,244,244,244,244,244,244,244,244,244,244,244,244,244,244,244, + 680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680, + 680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680, + 680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680, + 680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680, + 680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680, + 680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680, + 680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680, + 680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680, + 680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680, + 680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680, + 164,164,164,164,164,164,164,164,164,164,164,164,165,680,680,680,680,680,680,680,680,680,680,680,680,680,680,163,164,164,164,164,164,164,164,164,164,164,164,164, + 83,83,83,83,83,83,83,83,83,83,83,83,205,6,6,6,6,6,6,6,6,6,6,6,6,6,6,203,83,83,83,83,83,83,83,83,83,83,83,83, + 83,83,83,83,83,83,83,83,83,83,83,83,124,164,164,164,164,164,164,164,164,164,164,164,164,164,164,125,83,83,83,83,83,83,83,83,83,83,83,83, + 83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83, + 83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83, + 83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83, + 83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83, + }; + + roomname = "Conundrum"; + + if(!game.nocutscenes) + { + obj.createblock(1, 10, 0, 60, 240, 22); + obj.createblock(1, 280, 0, 320, 240, 21); + } + result = contents; + break; + }; + + case rn(51,41): + { + + static const short contents[] = { + 86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86, + 86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86, + 87,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,88,86,86,86,86,86,86,86,86,86,86,86,86,86, + 208,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,820,0,818,820,0,818,206,86,86,86,86,86,86,86,86,86,86,86,86,86, + 208,698,699,859,859,859,859,859,859,859,859,859,859,859,859,859,859,859,859,700,820,0,818,820,0,818,206,86,86,86,86,86,86,86,86,86,86,86,86,86, + 208,698,820,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,818,820,0,818,820,0,818,206,86,86,86,86,86,86,86,86,86,86,86,86,86, + 208,698,820,0,778,779,779,779,779,779,779,779,779,779,779,779,779,780,0,818,820,0,818,820,0,818,206,86,86,86,86,86,86,86,86,86,86,86,86,86, + 208,698,820,0,818,699,859,859,859,859,859,859,859,859,859,859,700,820,0,818,820,0,818,820,0,818,206,86,86,86,86,86,86,86,86,86,86,86,86,86, + 208,698,820,0,818,820,0,0,0,0,0,0,0,0,0,0,818,820,0,818,820,0,818,820,0,818,206,86,86,86,86,86,86,86,86,86,86,86,86,86, + 208,698,820,0,818,820,0,778,779,779,779,779,779,779,780,0,818,820,0,818,820,0,818,820,0,818,206,86,86,86,86,86,86,86,86,86,86,86,86,86, + 208,698,820,0,818,820,0,818,699,859,859,859,859,700,820,0,818,820,0,818,820,0,818,820,0,818,206,86,86,86,86,86,86,86,86,86,86,86,86,86, + 208,698,820,0,818,820,0,818,820,0,0,0,0,818,820,0,818,820,0,818,820,0,818,820,0,818,206,86,86,86,86,86,86,86,86,86,86,86,86,86, + 208,698,820,0,818,820,0,818,820,0,778,780,0,818,820,0,818,820,0,818,820,0,818,820,0,818,246,247,247,247,247,247,247,247,247,247,247,247,247,247, + 208,698,820,0,818,820,0,818,820,0,858,860,0,818,820,0,818,820,0,818,820,0,818,820,0,818,698,820,0,818,698,698,820,0,818,698,698,698,698,698, + 208,698,820,0,818,820,0,818,820,0,0,0,0,818,820,0,818,820,0,818,820,0,818,820,0,818,698,820,0,818,698,698,820,0,818,698,698,698,698,698, + 208,698,820,0,818,820,0,818,739,779,779,779,779,740,820,0,818,820,0,818,820,0,818,820,0,818,698,820,0,818,698,698,820,0,818,698,698,698,698,698, + 208,698,820,0,818,820,0,858,859,859,859,859,859,859,860,0,818,820,0,818,820,0,818,820,0,818,698,820,0,818,698,698,820,0,818,698,698,698,698,698, + 208,698,820,0,818,820,0,0,0,0,0,0,0,0,0,0,818,820,0,818,820,0,818,820,0,818,698,820,0,818,698,698,820,0,818,698,698,698,698,698, + 208,698,820,0,818,739,779,779,779,779,779,779,779,779,779,779,740,820,0,818,820,0,818,820,0,818,698,820,0,818,698,698,820,0,818,698,698,698,698,698, + 208,698,820,0,858,859,859,859,859,859,859,859,859,859,859,859,859,860,0,818,820,0,818,820,0,818,698,820,0,818,698,698,820,0,818,698,698,698,698,698, + 208,698,820,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,818,820,0,818,820,0,818,698,820,0,818,698,698,820,0,818,698,698,698,698,698, + 208,698,739,779,779,779,779,779,779,779,779,779,779,779,779,779,779,779,779,740,820,0,818,820,0,818,698,820,0,818,698,698,820,0,818,698,698,698,698,698, + 208,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,820,0,818,820,0,818,698,820,0,818,698,698,820,0,818,698,698,698,698,698, + 127,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167, + 86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86, + 86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86, + 86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86, + 86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86, + 86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86, + 86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86, + }; + + roomname = "Welcome Aboard"; + result = contents; + break; + } + + case rn(52,40): + { + + static const short contents[] = { + 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,211,0,0,0,0,209,89,89,89,89,89,89,89,89,89, + 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,211,0,0,0,0,209,89,89,89,89,89,89,89,89,89, + 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,211,0,0,0,0,209,89,89,89,89,89,89,89,89,89, + 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,211,0,0,0,0,209,89,89,89,89,89,89,89,89,89, + 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,211,0,0,0,0,209,89,89,89,89,89,89,89,89,89, + 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,211,0,0,0,0,209,89,89,89,89,89,89,89,89,89, + 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,211,0,0,0,0,209,89,89,89,89,89,89,89,89,89, + 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,211,0,0,0,0,209,89,89,89,89,89,89,89,89,89, + 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,211,0,0,0,0,209,89,89,89,89,89,89,89,89,89, + 89,89,89,89,89,89,89,89,89,90,250,250,250,250,250,250,250,91,89,89,89,90,250,250,250,251,0,0,0,0,209,89,89,89,89,89,89,89,89,89, + 89,89,89,89,89,89,89,89,90,251,9,9,9,9,9,9,9,249,250,250,250,251,9,9,9,9,0,0,0,0,209,89,89,89,89,89,89,89,89,89, + 89,89,89,89,89,89,89,90,251,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,209,89,89,89,89,89,89,89,89,89, + 89,89,89,89,89,89,90,251,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,209,89,89,89,89,89,89,89,89,89, + 90,250,250,250,250,250,251,776,776,776,776,776,776,776,776,776,776,776,776,776,776,776,776,776,776,776,776,776,776,776,209,89,89,89,89,89,89,89,89,89, + 211,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,209,89,89,89,89,89,89,89,89,89, + 211,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,209,89,89,89,89,89,89,89,89,89, + 211,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,209,89,89,89,89,89,89,89,89,89, + 211,856,856,856,856,856,856,856,856,856,856,856,856,856,856,856,856,856,856,856,856,856,856,856,856,856,856,856,856,856,209,89,89,89,89,89,89,89,89,89, + 211,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,209,89,89,89,89,89,89,89,89,89, + 211,0,0,0,0,0,0,0,0,0,169,170,170,170,171,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,209,89,89,89,89,89,89,89,89,89, + 130,170,170,170,171,8,8,8,8,8,209,89,89,89,211,8,8,8,8,8,8,8,8,169,170,170,170,170,170,170,131,89,89,89,89,89,89,89,89,89, + 89,89,89,89,130,170,170,170,170,170,131,89,89,89,130,170,170,170,170,170,170,170,170,131,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89, + 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89, + 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89, + 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89, + 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89, + 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89, + 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89, + 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89, + 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89, + }; + + obj.createentity(216, 144, 10, 1, 440520); // (savepoint) + obj.createentity(16, 136, 9, 0); // (shiny trinket) + + roomname = "It's a Secret to Nobody"; + result = contents; + break; + } #endif - default: - { - static const short contents[1200] = {0}; - roomname = "Outer Space"; - roomname_special = true; - obj.fatal_bottom(); - result = contents; - break; - } - } + default: + { + static const short contents[1200] = {0}; + roomname = "Outer Space"; + obj.fatal_bottom(); + result = contents; + break; + } + } - return result; + return result; } diff --git a/desktop_version/src/Spacestation2.h b/desktop_version/src/Spacestation2.h index a77a626e..6414eb3f 100644 --- a/desktop_version/src/Spacestation2.h +++ b/desktop_version/src/Spacestation2.h @@ -1,12 +1,13 @@ #ifndef SPACESTATION2_H #define SPACESTATION2_H +#include + class spacestation2class { public: - const short* loadlevel(int rx, int ry); - const char* roomname; - bool roomname_special; + const short* loadlevel(int rx, int ry); + std::string roomname; }; #endif /* SPACESTATION2_H */ diff --git a/desktop_version/src/SteamNetwork.c b/desktop_version/src/SteamNetwork.c index 6720d11d..ec094a34 100644 --- a/desktop_version/src/SteamNetwork.c +++ b/desktop_version/src/SteamNetwork.c @@ -2,17 +2,14 @@ #ifndef MAKEANDPLAY +#include #include #include -#include "CWrappers.h" -#include "Vlogging.h" - /* Steamworks interface versions */ #define VVVVVV_STEAMCLIENT "SteamClient017" #define VVVVVV_STEAMUSERSTATS "STEAMUSERSTATS_INTERFACE_VERSION011" -#define VVVVVV_STEAMSCREENSHOTS "STEAMSCREENSHOTS_INTERFACE_VERSION003" /* Shared object file name */ @@ -26,244 +23,204 @@ #error STEAM_LIBRARY: Unrecognized platform! #endif +/* Function Pointer Types */ + +typedef uint8_t (*SteamAPI_InitFunc)(void); +typedef void (*SteamAPI_ShutdownFunc)(void); +typedef void (*SteamAPI_RunCallbacksFunc)(void); +typedef intptr_t (*SteamInternal_CreateInterfaceFunc)(const char*); +typedef int32_t (*SteamAPI_GetHSteamUserFunc)(void); +typedef int32_t (*SteamAPI_GetHSteamPipeFunc)(void); +typedef intptr_t (*SteamAPI_ISteamClient_GetISteamUserStatsFunc)( + intptr_t, + int32_t, + int32_t, + const char* +); +typedef uint8_t (*SteamAPI_ISteamUserStats_RequestCurrentStatsFunc)(intptr_t); +typedef uint8_t (*SteamAPI_ISteamUserStats_StoreStatsFunc)(intptr_t); +typedef uint8_t (*SteamAPI_ISteamUserStats_GetStatFunc)( + intptr_t, + const char*, + int32_t* +); +typedef uint8_t (*SteamAPI_ISteamUserStats_SetStatFunc)( + intptr_t, + const char*, + int32_t +); +typedef uint8_t (*SteamAPI_ISteamUserStats_SetAchievementFunc)( + intptr_t, + const char* +); + /* DLL, Entry Points */ -struct ISteamClient; -struct ISteamUserStats; -struct ISteamScreenshots; -struct CallbackMsg_t -{ - int32_t m_hSteamUser; - int32_t m_iCallback; - uint8_t* m_pubParam; - int32_t m_cubParam; -}; -struct SteamAPICallCompleted_t -{ - uint64_t m_hAsyncCall; - int32_t m_iCallback; - uint32_t m_cubParam; -}; +static void *libHandle = NULL; +static intptr_t steamUserStats = (intptr_t) NULL; -#define FUNC_LIST \ - FOREACH_FUNC(uint8_t, SteamAPI_Init, (void)) \ - FOREACH_FUNC(void, SteamAPI_Shutdown, (void)) \ - FOREACH_FUNC(void, SteamAPI_RunCallbacks, (void)) \ - FOREACH_FUNC(struct ISteamClient*, SteamInternal_CreateInterface, (const char*)) \ - FOREACH_FUNC(int32_t, SteamAPI_GetHSteamUser, (void)) \ - FOREACH_FUNC(int32_t, SteamAPI_GetHSteamPipe, (void)) \ - FOREACH_FUNC(struct ISteamUserStats*, SteamAPI_ISteamClient_GetISteamUserStats, ( \ - struct ISteamClient*, \ - int32_t, \ - int32_t, \ - const char* \ - )) \ - FOREACH_FUNC(uint8_t, SteamAPI_ISteamUserStats_RequestCurrentStats, (struct ISteamUserStats*)) \ - FOREACH_FUNC(uint8_t, SteamAPI_ISteamUserStats_StoreStats, (struct ISteamUserStats*)) \ - FOREACH_FUNC(uint8_t, SteamAPI_ISteamUserStats_SetAchievement, ( \ - struct ISteamUserStats*, \ - const char* \ - )) \ - FOREACH_FUNC(struct ISteamScreenshots*, SteamAPI_ISteamClient_GetISteamScreenshots, ( \ - struct ISteamClient*, \ - int32_t, \ - int32_t, \ - const char* \ - )) \ - FOREACH_FUNC(void, SteamAPI_ISteamScreenshots_HookScreenshots, (\ - struct ISteamScreenshots*, \ - uint8_t \ - )) \ - FOREACH_FUNC(uint32_t, SteamAPI_ISteamScreenshots_WriteScreenshot, ( \ - struct ISteamScreenshots*, \ - void*, \ - uint32_t, \ - int32_t, \ - int32_t \ - )) \ - FOREACH_FUNC(void, SteamAPI_ManualDispatch_Init, (void)) \ - FOREACH_FUNC(void, SteamAPI_ManualDispatch_RunFrame, (int32_t)) \ - FOREACH_FUNC(uint8_t, SteamAPI_ManualDispatch_GetNextCallback, (int32_t, struct CallbackMsg_t*)) \ - FOREACH_FUNC(void, SteamAPI_ManualDispatch_FreeLastCallback, (int32_t)) \ - FOREACH_FUNC(uint8_t, SteamAPI_ManualDispatch_GetAPICallResult, ( \ - int32_t, \ - uint64_t, \ - void*, \ - int32_t, \ - int32_t, \ - uint8_t* \ - )) - -#define iScreenshotRequested 2302 - -static void* libHandle = NULL; -static struct ISteamUserStats* steamUserStats = NULL; -static struct ISteamScreenshots* steamScreenshots = NULL; - -#define FOREACH_FUNC(rettype, name, params) static rettype (*name) params = NULL; -FUNC_LIST -#undef FOREACH_FUNC +#define DEFINE_FUNC(name) static name##Func name = NULL; +DEFINE_FUNC(SteamAPI_Init) +DEFINE_FUNC(SteamAPI_Shutdown) +DEFINE_FUNC(SteamAPI_RunCallbacks) +DEFINE_FUNC(SteamInternal_CreateInterface) +DEFINE_FUNC(SteamAPI_GetHSteamUser) +DEFINE_FUNC(SteamAPI_GetHSteamPipe) +DEFINE_FUNC(SteamAPI_ISteamClient_GetISteamUserStats) +DEFINE_FUNC(SteamAPI_ISteamUserStats_RequestCurrentStats) +DEFINE_FUNC(SteamAPI_ISteamUserStats_StoreStats) +DEFINE_FUNC(SteamAPI_ISteamUserStats_GetStat) +DEFINE_FUNC(SteamAPI_ISteamUserStats_SetStat) +DEFINE_FUNC(SteamAPI_ISteamUserStats_SetAchievement) +#undef DEFINE_FUNC /* Clean up after ourselves... */ static void ClearPointers(void) { - SDL_UnloadObject(libHandle); - libHandle = NULL; - steamUserStats = NULL; -#define FOREACH_FUNC(rettype, name, params) name = NULL; - FUNC_LIST -#undef FOREACH_FUNC -} - -static void run_screenshot() -{ - if (!libHandle) - { - return; - } - - vlog_info("taking a screenshot"); - - SDL_Surface* surface = GRAPHICS_tempScreenshot(); - uint8_t success = UTIL_TakeScreenshot(&surface); - if (!success) - { - return; - } - SDL_Surface* surface2x = GRAPHICS_tempScreenshot2x(); - success = UTIL_UpscaleScreenshot2x(surface, &surface2x); - if (!success) - { - return; - } - - SteamAPI_ISteamScreenshots_WriteScreenshot( - steamScreenshots, - surface2x->pixels, - surface2x->w * surface2x->h * surface2x->format->BytesPerPixel, - surface2x->w, - surface2x->h - ); + SDL_UnloadObject(libHandle); + libHandle = NULL; + steamUserStats = (intptr_t) NULL; + SteamAPI_Init = NULL; + SteamAPI_Shutdown = NULL; + SteamAPI_RunCallbacks = NULL; + SteamInternal_CreateInterface = NULL; + SteamAPI_GetHSteamUser = NULL; + SteamAPI_GetHSteamPipe = NULL; + SteamAPI_ISteamClient_GetISteamUserStats = NULL; + SteamAPI_ISteamUserStats_RequestCurrentStats = NULL; + SteamAPI_ISteamUserStats_StoreStats = NULL; + SteamAPI_ISteamUserStats_GetStat = NULL; + SteamAPI_ISteamUserStats_SetStat = NULL; + SteamAPI_ISteamUserStats_SetAchievement = NULL; } /* NETWORK API Implementation */ -static int32_t steamPipe = 0; - int32_t STEAM_init(void) { #if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__HAIKU__) || defined(__DragonFly__) - return 0; + return 0; #endif - struct ISteamClient *steamClient; - int32_t steamUser; + intptr_t steamClient; + int32_t steamUser, steamPipe; - libHandle = SDL_LoadObject(STEAM_LIBRARY); - if (!libHandle) - { - vlog_info(STEAM_LIBRARY " not found!"); - return 0; - } + libHandle = SDL_LoadObject(STEAM_LIBRARY); + if (!libHandle) + { + printf("%s not found!\n", STEAM_LIBRARY); + return 0; + } -#define FOREACH_FUNC(rettype, name, params) \ - name = (rettype (*) params) (intptr_t) SDL_LoadFunction(libHandle, #name); \ - if (!name) \ - { \ - vlog_error(STEAM_LIBRARY " symbol " #name " not found!"); \ - ClearPointers(); \ - return 0; \ - } - FUNC_LIST -#undef FOREACH_FUNC + #define LOAD_FUNC(name) \ + name = (name##Func) SDL_LoadFunction(libHandle, #name); \ + if (!name) \ + { \ + printf("%s symbol %s not found!\n", STEAM_LIBRARY, #name); \ + ClearPointers(); \ + return 0; \ + } + LOAD_FUNC(SteamAPI_Init) + LOAD_FUNC(SteamAPI_Shutdown) + LOAD_FUNC(SteamAPI_RunCallbacks) + LOAD_FUNC(SteamInternal_CreateInterface) + LOAD_FUNC(SteamAPI_GetHSteamUser) + LOAD_FUNC(SteamAPI_GetHSteamPipe) + LOAD_FUNC(SteamAPI_ISteamClient_GetISteamUserStats) + LOAD_FUNC(SteamAPI_ISteamUserStats_RequestCurrentStats) + LOAD_FUNC(SteamAPI_ISteamUserStats_StoreStats) + LOAD_FUNC(SteamAPI_ISteamUserStats_GetStat) + LOAD_FUNC(SteamAPI_ISteamUserStats_SetStat) + LOAD_FUNC(SteamAPI_ISteamUserStats_SetAchievement) + #undef LOAD_FUNC - if (!SteamAPI_Init()) - { - vlog_error("Steamworks not initialized!"); - ClearPointers(); - return 0; - } - SteamAPI_ManualDispatch_Init(); - steamClient = SteamInternal_CreateInterface(VVVVVV_STEAMCLIENT); - steamUser = SteamAPI_GetHSteamUser(); - steamPipe = SteamAPI_GetHSteamPipe(); - if (!steamClient || !steamUser || !steamPipe) - { - SteamAPI_Shutdown(); - vlog_error(VVVVVV_STEAMCLIENT " not created!"); - ClearPointers(); - return 0; - } - steamUserStats = SteamAPI_ISteamClient_GetISteamUserStats( - steamClient, - steamUser, - steamPipe, - VVVVVV_STEAMUSERSTATS - ); - if (!steamUserStats) - { - SteamAPI_Shutdown(); - vlog_error(VVVVVV_STEAMUSERSTATS " not created!"); - ClearPointers(); - return 0; - } - SteamAPI_ISteamUserStats_RequestCurrentStats(steamUserStats); - steamScreenshots = SteamAPI_ISteamClient_GetISteamScreenshots( - steamClient, - steamUser, - steamPipe, - VVVVVV_STEAMSCREENSHOTS - ); - if (!steamScreenshots) - { - SteamAPI_Shutdown(); - vlog_error(VVVVVV_STEAMSCREENSHOTS " not created!"); - ClearPointers(); - return 0; - } - SteamAPI_ISteamScreenshots_HookScreenshots(steamScreenshots, 1); - return 1; + if (!SteamAPI_Init()) + { + printf("Steamworks not initialized!\n"); + ClearPointers(); + return 0; + } + steamClient = SteamInternal_CreateInterface(VVVVVV_STEAMCLIENT); + steamUser = SteamAPI_GetHSteamUser(); + steamPipe = SteamAPI_GetHSteamPipe(); + if (!steamClient || !steamUser || !steamPipe) + { + SteamAPI_Shutdown(); + printf(VVVVVV_STEAMCLIENT " not created!\n"); + ClearPointers(); + return 0; + } + steamUserStats = SteamAPI_ISteamClient_GetISteamUserStats( + steamClient, + steamUser, + steamPipe, + VVVVVV_STEAMUSERSTATS + ); + if (!steamUserStats) + { + SteamAPI_Shutdown(); + printf(VVVVVV_STEAMUSERSTATS " not created!\n"); + ClearPointers(); + return 0; + } + SteamAPI_ISteamUserStats_RequestCurrentStats(steamUserStats); + return 1; } void STEAM_shutdown(void) { - if (libHandle) - { - SteamAPI_Shutdown(); - ClearPointers(); - } + if (libHandle) + { + SteamAPI_Shutdown(); + ClearPointers(); + } } void STEAM_update(void) { - if (!libHandle) - { - return; - } - - SteamAPI_ManualDispatch_RunFrame(steamPipe); - struct CallbackMsg_t callback; - SDL_zero(callback); - while (SteamAPI_ManualDispatch_GetNextCallback(steamPipe, &callback)) - { - if (callback.m_iCallback == iScreenshotRequested) - { - run_screenshot(); - } - SteamAPI_ManualDispatch_FreeLastCallback(steamPipe); - } + if (libHandle) + { + SteamAPI_RunCallbacks(); + } } void STEAM_unlockAchievement(const char *name) { - if (libHandle) - { - SteamAPI_ISteamUserStats_SetAchievement( - steamUserStats, - name - ); - SteamAPI_ISteamUserStats_StoreStats(steamUserStats); - } + if (libHandle) + { + SteamAPI_ISteamUserStats_SetAchievement( + steamUserStats, + name + ); + SteamAPI_ISteamUserStats_StoreStats(steamUserStats); + } +} + +int32_t STEAM_getAchievementProgress(const char *name) +{ + int32_t result = -1; + if (libHandle) + { + SteamAPI_ISteamUserStats_GetStat( + steamUserStats, + name, + &result + ); + } + return result; +} + +void STEAM_setAchievementProgress(const char *name, int32_t stat) +{ + if (libHandle) + { + SteamAPI_ISteamUserStats_SetStat( + steamUserStats, + name, + stat + ); + SteamAPI_ISteamUserStats_StoreStats(steamUserStats); + } } #endif /* MAKEANDPLAY */ diff --git a/desktop_version/src/TerminalScripts.cpp b/desktop_version/src/TerminalScripts.cpp index b072b441..eb12d541 100644 --- a/desktop_version/src/TerminalScripts.cpp +++ b/desktop_version/src/TerminalScripts.cpp @@ -382,7 +382,6 @@ void scriptclass::loadother(const char* t) "speak_active", "squeak(player)", - "textcase(1)", "text(cyan,0,0,1)", "Yes!", "position(player,above)", @@ -400,7 +399,6 @@ void scriptclass::loadother(const char* t) "speak_active", "squeak(player)", - "textcase(2)", "text(cyan,0,0,1)", "Yes!", "position(player,above)", @@ -418,7 +416,7 @@ void scriptclass::loadother(const char* t) static const char* lines[] = { - //"delay(15)", "flash(5)", "shake(20)", "playef(9)", + //"delay(15)", "flash(5)", "shake(20)", "playef(9)", "text(gray,0,114,3)", " -= WARNING =- ", diff --git a/desktop_version/src/Textbook.c b/desktop_version/src/Textbook.c deleted file mode 100644 index b314d1b6..00000000 --- a/desktop_version/src/Textbook.c +++ /dev/null @@ -1,112 +0,0 @@ -#include "Textbook.h" - -#include - -#include "Alloc.h" -#include "Vlogging.h" - -void textbook_init(Textbook* textbook) -{ - textbook->pages_used = 0; - textbook->protect = false; -} - -void textbook_clear(Textbook* textbook) -{ - if (textbook->protect) - { - return; - } - - for (short p = 0; p < textbook->pages_used; p++) - { - VVV_free(textbook->page[p]); - } - textbook->pages_used = 0; -} - -void textbook_set_protected(Textbook* textbook, bool protect) -{ - /* A protected textbook is silently not cleared when requested. - * Not a memory leak as long as you unprotect and clear at some point. */ - textbook->protect = protect; -} - -const void* textbook_store_raw(Textbook* textbook, const void* data, size_t data_len) -{ - if (data == NULL) - { - return NULL; - } - - if (data_len > TEXTBOOK_PAGE_SIZE) - { - vlog_warn( - "Cannot store data of %ld bytes in Textbook, max page size is %d", - data_len, - TEXTBOOK_PAGE_SIZE - ); - return NULL; - } - - /* Find a suitable page to place our text on */ - short found_page = -1; - for (short p = 0; p < textbook->pages_used; p++) - { - size_t free = TEXTBOOK_PAGE_SIZE - textbook->page_len[p]; - - if (data_len <= free) - { - found_page = p; - break; - } - } - - if (found_page == -1) - { - /* Create a new page then */ - found_page = textbook->pages_used; - - if (found_page >= TEXTBOOK_MAX_PAGES) - { - vlog_warn( - "Textbook is full! %hd pages used (%d chars per page)", - textbook->pages_used, - TEXTBOOK_PAGE_SIZE - ); - return NULL; - } - - textbook->page[found_page] = (char*) SDL_malloc(TEXTBOOK_PAGE_SIZE); - if (textbook->page[found_page] == NULL) - { - return NULL; - } - - textbook->page_len[found_page] = 0; - textbook->pages_used++; - } - - size_t cursor = textbook->page_len[found_page]; - char* added_text = &textbook->page[found_page][cursor]; - SDL_memcpy(added_text, data, data_len); - textbook->page_len[found_page] += data_len; - - return added_text; -} - -const char* textbook_store(Textbook* textbook, const char* text) -{ - if (text == NULL) - { - return NULL; - } - - if (text[0] == '\0') - { - /* Don't go and store a single null terminator when we have one right here for you: */ - return ""; - } - - return (const char*) textbook_store_raw(textbook, text, SDL_strlen(text)+1); -} diff --git a/desktop_version/src/Textbook.h b/desktop_version/src/Textbook.h deleted file mode 100644 index 58ebb6e4..00000000 --- a/desktop_version/src/Textbook.h +++ /dev/null @@ -1,36 +0,0 @@ -#ifndef TEXTBOOK_H -#define TEXTBOOK_H - -#include -#include -#include - -#ifdef __cplusplus -extern "C" -{ -#endif - -/* The purpose of a Textbook is to store, potentially, a lot of text on a pile that shouldn't - * go anywhere until we change languages or (for example) unload an entire level's text. */ -#define TEXTBOOK_MAX_PAGES 1000 -#define TEXTBOOK_PAGE_SIZE 50000 -typedef struct _Textbook -{ - char* page[TEXTBOOK_MAX_PAGES]; - size_t page_len[TEXTBOOK_MAX_PAGES]; - - short pages_used; - bool protect; -} Textbook; - -void textbook_init(Textbook* textbook); -void textbook_clear(Textbook* textbook); -void textbook_set_protected(Textbook* textbook, bool protect); -const void* textbook_store_raw(Textbook* textbook, const void* data, size_t data_len); -const char* textbook_store(Textbook* textbook, const char* text); - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif /* TEXTBOOK_H */ diff --git a/desktop_version/src/Textbox.cpp b/desktop_version/src/Textbox.cpp index 40285c8e..3d829980 100644 --- a/desktop_version/src/Textbox.cpp +++ b/desktop_version/src/Textbox.cpp @@ -1,16 +1,12 @@ #include "Textbox.h" -#include +#include -#include "Font.h" -#include "Localization.h" -#include "UTF8.h" -#include "Vlogging.h" - -textboxclass::textboxclass(int gap) +textboxclass::textboxclass(void) { w = 0; h = 0; + lw = 0; tl = 0; prev_tl = 0; tm = 0; @@ -21,84 +17,27 @@ textboxclass::textboxclass(int gap) r = 0; g = 0; b = 0; - linegap = gap; + tr = 0; + tg = 0; + tb = 0; + max = 0; flipme = false; rand = 0; - - large = false; - - position_absolute = false; - - should_centerx = false; - should_centery = false; - - print_flags = PR_FONT_LEVEL; - translate = TEXTTRANSLATE_NONE; - function = NULL; - fill_buttons = false; - - sprites.clear(); - - image = TEXTIMAGE_NONE; - - force_outline = false; - outline = false; - - crewmate_position = TextboxCrewmatePosition(); - original = TextboxOriginalContext(); - original.text_case = 1; - spacing = TextboxSpacing(); - - other_textbox_index = -1; -} - -void textboxclass::addsprite(int x, int y, int tile, int col) -{ - TextboxSprite sprite; - sprite.x = x; - sprite.y = y; - sprite.tile = tile; - sprite.col = col; - sprites.push_back(sprite); -} - -void textboxclass::setimage(TextboxImage new_image) -{ - image = new_image; } void textboxclass::centerx(void) { resize(); xp = 160 - (w / 2); + resize(); } void textboxclass::centery(void) { resize(); yp = 120 - (h / 2); -} - -void textboxclass::applyposition(void) -{ resize(); - if (!position_absolute) - { - reposition(); - if (should_centerx) - { - centerx(); - } - if (should_centery) - { - centery(); - } - if (translate == TEXTTRANSLATE_CUTSCENE) - { - adjust(); - } - } } void textboxclass::adjust(void) @@ -108,14 +47,25 @@ void textboxclass::adjust(void) if (yp < 10) yp = 10; if (xp + w > 310) xp = 310 - w; if (yp + h > 230) yp = 230 - h; + resize(); } void textboxclass::initcol(int rr, int gg, int bb) +{ + tr = rr; + tg = gg; + tb = bb; + r = 0; + g = 0; + b = 0; + tl = 0.5; +} + +void textboxclass::setcol(int rr, int gg, int bb) { r = rr; g = gg; b = bb; - tl = 0.5; } void textboxclass::update(void) @@ -161,278 +111,21 @@ void textboxclass::removefast(void) void textboxclass::resize(void) { //Set the width and height to the correct sizes - int max = 0; - for (size_t iter = 0; iter < lines.size(); iter++) + max = 0; + for (size_t iter = 0; iter < line.size(); iter++) { - int len = font::len(print_flags, lines[iter].c_str()); - if (len > max) max = len; + unsigned int len = utf8::unchecked::distance(line[iter].begin(), line[iter].end()); + if (len > (unsigned int)max) max = len; } - // 16 for the borders - w = max + 16; - h = lines.size()*(font::height(print_flags) + linegap) + 16 - linegap; + lw = max; + w = (max +2) * 8; + h = (line.size() + 2) * 8; } -void textboxclass::reposition(void) +void textboxclass::addline(std::string t) { - // Function-based translation overrides position. - if (translate == TEXTTRANSLATE_FUNCTION) - { - return; - } - - const int font_height = font::height(print_flags); - - // Reposition based off crewmate position, if applicable - // Otherwise use original position, if applicable - if (crewmate_position.override_x) - { - if (crewmate_position.dir == 1) // left - { - xp = crewmate_position.x - w + 16; - } - else if (crewmate_position.dir == 0) // right - { - xp = crewmate_position.x - 16; - } - } - else - { - xp = original.x; - } - - if (crewmate_position.override_y) - { - if (crewmate_position.text_above) - { - if (crewmate_position.dir == 1) // left - { - yp = crewmate_position.y - 16 - (lines.size() * (font_height + linegap) - linegap); - } - else if (crewmate_position.dir == 0) // right - { - yp = crewmate_position.y - 18 - (lines.size() * (font_height + linegap) - linegap); - } - } - else - { - yp = crewmate_position.y + 26; - } - } - else - { - yp = original.y; - } -} - -void textboxclass::addline(const std::string& t) -{ - lines.push_back(t); + line.push_back(t); resize(); - if ((int)lines.size() > (large ? 26 : 11)) - { - lines.clear(); - } -} - -void textboxclass::pad(size_t left_pad, size_t right_pad) -{ - // Pad the current text with a certain number of spaces on the left and right - if (font::is_rtl(print_flags)) - { - // Swap left and right, because left will end up on the right and vice versa... - size_t old_left_pad = left_pad; - left_pad = right_pad; - right_pad = old_left_pad; - } - - for (size_t iter = 0; iter < lines.size(); iter++) - { - lines[iter] = std::string(left_pad, ' ') + lines[iter] + std::string(right_pad, ' '); - } - resize(); -} - -void textboxclass::padtowidth(size_t new_w) -{ - /* Pad the current text so that each line is new_w pixels wide. - * Each existing line is centered in that width. */ - resize(); - uint8_t glyph_w = 8; - font::glyph_dimensions(print_flags, &glyph_w, NULL); - size_t chars_w = SDL_max(w-16, new_w) / glyph_w; - for (size_t iter = 0; iter < lines.size(); iter++) - { - size_t n_glyphs = font::len(print_flags, lines[iter].c_str()) / glyph_w; - signed int padding_needed = chars_w - n_glyphs; - if (padding_needed < 0) - { - continue; - } - size_t left_pad = padding_needed / 2; - size_t right_pad = padding_needed - left_pad; - - lines[iter] = std::string(left_pad, ' ') + lines[iter] + std::string(right_pad, ' '); - } - resize(); -} - -void textboxclass::centertext(void) -{ - padtowidth(w-16); -} - -void textboxclass::wrap(int pad) -{ - /* This function just takes a single-line textbox and wraps it... - * pad = the total number of characters we are going to pad this textbox. - * (or how many characters we should stay clear of 288 pixels width in general) - * Only to be used after a manual graphics.createtextbox[flipme] call, - * or the retranslation of a text box created with said call. - * Returns the new, total height of the textbox. */ - if (lines.empty()) - { - vlog_error("textboxclass::wrap() has no first line!"); - return; - } - - std::string wrapped = font::string_wordwrap_balanced( - print_flags, - lines[0], - 36 * 8 - pad * 8 - ); - lines.clear(); - - size_t startline = 0; - size_t newline; - do { - size_t pos_n = wrapped.find('\n', startline); - size_t pos_p = wrapped.find('|', startline); - newline = SDL_min(pos_n, pos_p); - addline(wrapped.substr(startline, newline-startline)); - startline = newline + 1; - } while (newline != std::string::npos); -} - -void textboxclass::copyoriginaltext(void) -{ - // Copy the original back, but keep the limit of lines in mind - lines.clear(); - for (size_t i = 0; i < original.lines.size(); i++) - { - addline(original.lines[i]); - } -} - -void textboxclass::applyoriginalspacing(void) -{ - if (spacing.centertext) - { - centertext(); - } - if (spacing.pad_left > 0 || spacing.pad_right > 0) - { - pad(spacing.pad_left, spacing.pad_right); - } - if (spacing.padtowidth > 0) - { - padtowidth(spacing.padtowidth); - } -} - -void textboxclass::updatetext(void) -{ - switch (translate) - { - case TEXTTRANSLATE_NONE: - copyoriginaltext(); - applyoriginalspacing(); - break; - case TEXTTRANSLATE_CUTSCENE: - translatecutscene(); - break; - case TEXTTRANSLATE_FUNCTION: - if (function == NULL) - { - SDL_assert(0 && "function is NULL!"); - break; - } - function(this); - } -} - -void textboxclass::translatecutscene(void) -{ - if (!loc::is_cutscene_translated(original.script_name)) - { - copyoriginaltext(); - applyoriginalspacing(); - return; - } - - // English text needs to be un-wordwrapped, translated, and re-wordwrapped - std::string eng; - for (size_t i = 0; i < original.lines.size(); i++) - { - if (i != 0) - { - eng.append("\n"); - } - eng.append(original.lines[i]); - } - - eng = font::string_unwordwrap(eng); - const loc::TextboxFormat* format = loc::gettext_cutscene(original.script_name, eng, original.text_case); - if (format == NULL || format->text == NULL || format->text[0] == '\0') - { - copyoriginaltext(); - applyoriginalspacing(); - return; - } - - std::string tra; - if (format->tt) - { - tra = std::string(format->text); - size_t pipe; - while (true) - { - pipe = tra.find('|', 0); - if (pipe == std::string::npos) - { - break; - } - tra.replace(pipe, 1, "\n"); - } - } - else - { - tra = font::string_wordwrap_balanced(PR_FONT_LEVEL, format->text, format->wraplimit); - } - - lines.clear(); - size_t startline = 0; - size_t newline; - do - { - newline = tra.find('\n', startline); - lines.push_back(tra.substr(startline, newline - startline)); - startline = newline + 1; - } - while (newline != std::string::npos); - - resize(); - - if (format->centertext) - { - centertext(); - } - if (format->pad_left > 0 || format->pad_right > 0) - { - pad(format->pad_left, format->pad_right); - } - if (format->padtowidth > 0) - { - padtowidth(format->padtowidth); - } + if ((int) line.size() >= 12) line.clear(); } diff --git a/desktop_version/src/Textbox.h b/desktop_version/src/Textbox.h index 1e09b1bf..870d6acf 100644 --- a/desktop_version/src/Textbox.h +++ b/desktop_version/src/Textbox.h @@ -1,84 +1,25 @@ #ifndef TEXTBOX_H #define TEXTBOX_H -#include +#include #include #include -/* Position of the crewmate that the text box position is based off of. - * NOT a crewmate sprite inside the text box (that's a TextboxSprite). */ -struct TextboxCrewmatePosition -{ - bool override_x; - bool override_y; - int x; - int y; - int dir; - bool text_above; -}; - -struct TextboxOriginalContext -{ - int x; - int y; - std::vector lines; - std::string script_name; - char text_case; -}; - -/* Similar to, but NOT the same as a loc::TextboxFormat. */ -struct TextboxSpacing -{ - bool centertext; - unsigned char pad_left; - unsigned char pad_right; - unsigned short padtowidth; -}; - -struct TextboxSprite -{ - int x; - int y; - int col; - int tile; -}; - -enum TextboxImage -{ - TEXTIMAGE_NONE, - TEXTIMAGE_LEVELCOMPLETE, - TEXTIMAGE_GAMECOMPLETE -}; - -enum TextboxTranslate -{ - TEXTTRANSLATE_NONE, - TEXTTRANSLATE_CUTSCENE, - TEXTTRANSLATE_FUNCTION -}; - -class textboxclass; -typedef void (*TextboxFunction)(textboxclass* THIS); - class textboxclass { public: - textboxclass(int gap); - - void addsprite(int x, int y, int tile, int col); - - void setimage(TextboxImage image); + textboxclass(void); void centerx(void); void centery(void); - void applyposition(void); - void adjust(void); void initcol(int rr, int gg, int bb); + void setcol(int rr, int gg, int bb); + void update(void); void remove(void); @@ -87,65 +28,25 @@ public: void resize(void); - void reposition(void); - - void addline(const std::string& t); - - void pad(size_t left_pad, size_t right_pad); - - void padtowidth(size_t new_w); - - void centertext(void); - - void wrap(int pad); - - void copyoriginaltext(void); - - void applyoriginalspacing(void); - - void updatetext(void); - - void translatecutscene(void); + void addline(std::string t); public: //Fundamentals - std::vector lines; - int xp, yp, w, h; + std::vector line; + int xp, yp, lw, w, h; int r,g,b; - int linegap; + int tr,tg,tb; int timer; float tl; float prev_tl; int tm; + int max; + /* Whether to flip text box y-position in Flip Mode. */ bool flipme; int rand; - - bool large; - - bool position_absolute; - - bool should_centerx; - bool should_centery; - - uint32_t print_flags; - TextboxTranslate translate; - bool fill_buttons; - - std::vector sprites; - TextboxImage image; - - bool force_outline; - bool outline; - - TextboxCrewmatePosition crewmate_position; - TextboxOriginalContext original; - TextboxSpacing spacing; - TextboxFunction function; - - int other_textbox_index; }; #endif /* TEXTBOX_H */ diff --git a/desktop_version/src/ThirdPartyDeps.c b/desktop_version/src/ThirdPartyDeps.c index c0c7b406..93ab76e5 100644 --- a/desktop_version/src/ThirdPartyDeps.c +++ b/desktop_version/src/ThirdPartyDeps.c @@ -1,7 +1,5 @@ #include -#include "Alloc.h" - /* Handle third-party dependencies' needs here */ void* lodepng_malloc(size_t size) @@ -16,5 +14,5 @@ void* lodepng_realloc(void* ptr, size_t new_size) void lodepng_free(void* ptr) { - VVV_free(ptr); + SDL_free(ptr); } diff --git a/desktop_version/src/Tower.cpp b/desktop_version/src/Tower.cpp index 1d2a0471..5076c607 100644 --- a/desktop_version/src/Tower.cpp +++ b/desktop_version/src/Tower.cpp @@ -1,1140 +1,1153 @@ #include "Tower.h" -#include -#include - -#include "Constants.h" #include "MakeAndPlay.h" #include "UtilityClass.h" towerclass::towerclass(void) { - minitowermode = false; - //We create a blank map - SDL_memset(contents, 0, sizeof(contents)); - SDL_memset(back, 0, sizeof(back)); - SDL_memset(minitower, 0, sizeof(minitower)); + minitowermode = false; + //We init the lookup table: + for (size_t i = 0; i < SDL_arraysize(vmult); i++) + { + vmult[i] = i * 40; + } + //We create a blank map + SDL_memset(contents, 0, sizeof(contents)); + SDL_memset(back, 0, sizeof(back)); + SDL_memset(minitower, 0, sizeof(minitower)); - loadbackground(); - loadmap(); + loadbackground(); + loadmap(); } int towerclass::backat(int xp, int yp, int yoff) { - yp = (yp*8 + yoff) / 8; + yp = yp * 8; + yp += yoff; + yoff = yp % 8; + yp = (yp - yoff) / 8; - if (xp >= 0 && xp < 40) - { - yp = POS_MOD(yp, 120); - return back[TILE_IDX(xp, yp)]; - } - return 0; + if (xp >= 0 && xp < 40) + { + while (yp < 0) yp += 120; + while (yp >= 120) yp -= 120; + return back[xp + vmult[yp]]; + } + return 0; } int towerclass::at(int xp, int yp, int yoff) { - if (minitowermode) - { - return miniat(xp, yp, yoff); - } - else - { - yp = (yp*8 + yoff) / 8; + if (minitowermode) + { + return miniat(xp, yp, yoff); + } + else + { + yp = yp * 8; + yp += yoff; + yoff = yp % 8; + yp = (yp - yoff) / 8; - yp = POS_MOD(yp, 700); - if (xp >= 0 && xp < 40) - { - return contents[TILE_IDX(xp, yp)]; - } - else if (xp == -1) - { - return contents[TILE_IDX(0, yp)]; - } - else if (xp == 40) - { - return contents[TILE_IDX(39, yp)]; - } - return 0; - } + while (yp < 0) yp += 700; + while (yp >= 700) yp -= 700; + if (xp >= 0 && xp < 40) + { + return contents[xp + vmult[yp]]; + } + else if (xp == -1) + { + return contents[vmult[yp]]; + } + else if (xp == 40) + { + return contents[39 + vmult[yp]]; + } + return 0; + } } int towerclass::miniat(int xp, int yp, int yoff) { - yp = (yp*8 + yoff) / 8; + yp = yp * 8; + yp += yoff; + yoff = yp % 8; + yp = (yp - yoff) / 8; - yp = POS_MOD(yp, 100); - if (xp >= 0 && xp < 40) - { - return minitower[TILE_IDX(xp, yp)]; - } - else if (xp == -1) - { - return minitower[TILE_IDX(0, yp)]; - } - else if (xp == 40) - { - return minitower[TILE_IDX(39, yp)]; - } - return 0; + while (yp < 0) yp += 100; + while (yp >= 100) yp -= 100; + if (xp >= 0 && xp < 40) + { + return minitower[xp + vmult[yp]]; + } + else if (xp == -1) + { + return minitower[vmult[yp]]; + } + else if (xp == 40) + { + return minitower[39 + vmult[yp]]; + } + return 0; } void towerclass::loadminitower1(void) { - //Loads the first minitower into the array. + //Loads the first minitower into the array. #if !defined(MAKEANDPLAY) - static const short tmap[] = { - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,23,23,23,14,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,23,24,28,28,28,22,14,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,23,24,28,28,28,28,28,28,22,14,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,23,24,28,28,28,28,28,28,28,28,28,22,14,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,23,24,28,28,28,28,28,28,28,28,28,28,28,28,22,14,12,12,12,12,12, - 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12, - 28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12, - 28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12, - 28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12, - 28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12, - 28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12, - 28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12, - 28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12, - 6,6,6,6,6,6,6,6,28,28,28,28,28,28,28,28,28,28,28,28,6,6,6,6,6,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12, - 18,18,18,18,18,18,18,19,28,28,28,28,28,28,28,28,28,28,28,28,17,18,18,18,19,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12, - 12,12,12,12,12,12,12,15,19,28,28,28,28,28,28,28,28,28,17,18,16,12,12,12,15,19,28,28,28,28,28,28,28,28,20,12,12,12,12,12, - 12,12,12,12,12,12,12,12,15,19,28,28,28,28,28,28,17,18,16,12,12,12,12,12,12,15,19,28,28,28,28,28,28,28,20,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,15,19,28,28,28,17,18,16,12,12,12,12,12,12,12,12,12,15,19,28,28,28,28,28,28,20,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,15,18,18,18,16,12,12,12,12,12,12,12,12,12,12,12,12,15,19,28,28,28,28,28,20,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,15,19,28,28,28,28,20,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,28,28,28,28,20,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,28,28,28,28,22,14,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,23,24,28,28,28,28,28,22,14,12,12,12, - 12,12,13,23,23,23,23,23,23,23,23,14,12,12,12,12,12,12,12,12,12,12,12,12,12,13,23,24,7,7,28,28,28,28,28,28,20,12,12,12, - 12,12,21,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,13,23,24,7,7,28,28,28,28,28,28,28,28,20,12,12,12, - 12,12,21,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12,13,23,24,7,7,28,28,28,28,28,28,28,28,28,28,20,12,12,12, - 12,12,21,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,13,23,24,7,7,28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12, - 12,12,21,28,28,28,28,28,28,28,28,20,12,12,12,12,12,13,23,24,7,7,28,28,28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12, - 12,12,21,28,28,28,28,28,28,28,28,20,12,12,12,13,23,24,7,7,28,28,28,28,28,28,28,28,28,28,28,28,28,28,17,18,16,12,12,12, - 12,12,21,28,28,28,17,19,28,28,28,22,23,23,23,24,7,7,28,28,28,28,28,28,28,28,28,28,28,28,28,28,17,18,16,12,12,12,12,12, - 12,12,21,28,28,28,20,21,28,28,28,7,7,7,7,7,28,28,28,28,28,28,28,28,28,28,28,28,28,28,17,18,16,12,12,12,12,12,12,12, - 12,12,21,28,28,28,20,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,17,18,16,12,12,12,12,12,12,12,12,12, - 12,12,21,28,28,28,20,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,17,18,16,12,12,12,12,12,12,12,12,12,12,12, - 12,12,21,28,28,28,20,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,17,18,16,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,21,28,28,28,20,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,17,18,16,12,12,12,12,13,23,23,23,23,14,12,12,12,12,12, - 12,12,21,28,28,28,20,21,28,28,28,28,28,28,28,28,28,28,28,28,17,18,16,12,12,12,12,13,23,24,7,7,7,7,20,12,12,12,12,12, - 12,12,21,28,28,28,20,15,18,18,18,18,18,18,18,18,18,18,18,18,16,12,12,12,12,13,23,24,28,28,28,28,28,28,20,12,12,12,12,12, - 12,12,21,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,23,24,28,28,28,28,28,28,28,28,20,12,12,12,12,12, - 12,12,21,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,23,24,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12, - 12,12,21,28,28,28,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12, - 12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12, - 12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12, - 12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,17,19,28,28,28,28,20,12,12,12,12,12, - 12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,17,18,16,21,28,28,28,28,20,12,12,12,12,12, - 12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,17,18,16,12,12,21,28,28,28,28,20,12,12,12,12,12, - 12,12,15,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,16,12,12,13,23,24,28,28,28,28,20,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,23,24,28,28,28,28,28,28,20,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,23,24,28,28,28,28,28,28,28,28,20,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,23,24,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,23,24,28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12, - 12,12,12,12,12,12,12,12,13,23,23,23,23,23,23,23,23,23,23,24,28,28,28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,17,18,18,18,18,16,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,22,23,14,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,17,19,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,22,24,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,22,23,23,23,23,23,23,23,23, - 12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28, - 12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28, - 12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28, - 12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28, - 12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,6,6,6,6,6,6, - 12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,17,18,18,18,18,18, - 12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,28,28,28,28,17,19,28,28,28,28,28,0,0,28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,28,28,28,28,22,24,28,28,28,28,28,0,0,28,28,28,28,28,28,28,28,28,0,0,0,20,13,23,23,23,23, - 12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,0,0,0,0,28,28,28,28,28,28,28,28,28,0,0,0,20,21,28,28,28,28, - 12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,28,28,28,28,28,0,0,0,20,21,28,28,28,28, - 12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,28,28,28,28,28,0,0,0,20,21,28,28,28,28, - 12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,28,28,0,0,0,20,21,28,28,28,28, - 12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,28,28,0,0,0,20,21,28,28,28,28, - 12,12,12,12,12,12,12,12,21,0,0,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,28,28,0,0,0,20,21,28,28,17,18, - 12,12,12,12,12,12,12,12,21,0,0,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,28,28,0,0,0,20,21,28,28,20,12, - 12,12,12,12,12,12,12,12,21,0,0,0,0,28,28,28,0,0,0,0,0,0,0,0,0,0,0,0,0,17,19,0,0,0,20,21,28,28,22,23, - 12,12,12,12,12,12,12,12,21,0,0,0,0,28,28,28,0,0,0,0,0,0,0,0,0,0,0,0,0,22,24,0,0,0,20,21,28,28,28,28, - 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,21,28,28,28,28, - 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,21,28,28,28,28, - 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,21,28,28,28,28, - 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,21,28,28,28,28, - 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,15,18,18,18,18, - 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12, - }; + static const short tmap[] = { + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,23,23,23,14,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,23,24,28,28,28,22,14,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,23,24,28,28,28,28,28,28,22,14,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,23,24,28,28,28,28,28,28,28,28,28,22,14,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,23,24,28,28,28,28,28,28,28,28,28,28,28,28,22,14,12,12,12,12,12, + 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12, + 28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12, + 28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12, + 28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12, + 28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12, + 28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12, + 28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12, + 28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12, + 6,6,6,6,6,6,6,6,28,28,28,28,28,28,28,28,28,28,28,28,6,6,6,6,6,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12, + 18,18,18,18,18,18,18,19,28,28,28,28,28,28,28,28,28,28,28,28,17,18,18,18,19,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12, + 12,12,12,12,12,12,12,15,19,28,28,28,28,28,28,28,28,28,17,18,16,12,12,12,15,19,28,28,28,28,28,28,28,28,20,12,12,12,12,12, + 12,12,12,12,12,12,12,12,15,19,28,28,28,28,28,28,17,18,16,12,12,12,12,12,12,15,19,28,28,28,28,28,28,28,20,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,15,19,28,28,28,17,18,16,12,12,12,12,12,12,12,12,12,15,19,28,28,28,28,28,28,20,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,15,18,18,18,16,12,12,12,12,12,12,12,12,12,12,12,12,15,19,28,28,28,28,28,20,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,15,19,28,28,28,28,20,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,28,28,28,28,20,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,28,28,28,28,22,14,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,23,24,28,28,28,28,28,22,14,12,12,12, + 12,12,13,23,23,23,23,23,23,23,23,14,12,12,12,12,12,12,12,12,12,12,12,12,12,13,23,24,7,7,28,28,28,28,28,28,20,12,12,12, + 12,12,21,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,13,23,24,7,7,28,28,28,28,28,28,28,28,20,12,12,12, + 12,12,21,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12,13,23,24,7,7,28,28,28,28,28,28,28,28,28,28,20,12,12,12, + 12,12,21,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,13,23,24,7,7,28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12, + 12,12,21,28,28,28,28,28,28,28,28,20,12,12,12,12,12,13,23,24,7,7,28,28,28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12, + 12,12,21,28,28,28,28,28,28,28,28,20,12,12,12,13,23,24,7,7,28,28,28,28,28,28,28,28,28,28,28,28,28,28,17,18,16,12,12,12, + 12,12,21,28,28,28,17,19,28,28,28,22,23,23,23,24,7,7,28,28,28,28,28,28,28,28,28,28,28,28,28,28,17,18,16,12,12,12,12,12, + 12,12,21,28,28,28,20,21,28,28,28,7,7,7,7,7,28,28,28,28,28,28,28,28,28,28,28,28,28,28,17,18,16,12,12,12,12,12,12,12, + 12,12,21,28,28,28,20,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,17,18,16,12,12,12,12,12,12,12,12,12, + 12,12,21,28,28,28,20,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,17,18,16,12,12,12,12,12,12,12,12,12,12,12, + 12,12,21,28,28,28,20,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,17,18,16,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,21,28,28,28,20,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,17,18,16,12,12,12,12,13,23,23,23,23,14,12,12,12,12,12, + 12,12,21,28,28,28,20,21,28,28,28,28,28,28,28,28,28,28,28,28,17,18,16,12,12,12,12,13,23,24,7,7,7,7,20,12,12,12,12,12, + 12,12,21,28,28,28,20,15,18,18,18,18,18,18,18,18,18,18,18,18,16,12,12,12,12,13,23,24,28,28,28,28,28,28,20,12,12,12,12,12, + 12,12,21,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,23,24,28,28,28,28,28,28,28,28,20,12,12,12,12,12, + 12,12,21,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,23,24,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12, + 12,12,21,28,28,28,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12, + 12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12, + 12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12, + 12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,17,19,28,28,28,28,20,12,12,12,12,12, + 12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,17,18,16,21,28,28,28,28,20,12,12,12,12,12, + 12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,17,18,16,12,12,21,28,28,28,28,20,12,12,12,12,12, + 12,12,15,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,16,12,12,13,23,24,28,28,28,28,20,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,23,24,28,28,28,28,28,28,20,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,23,24,28,28,28,28,28,28,28,28,20,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,23,24,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,23,24,28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12, + 12,12,12,12,12,12,12,12,13,23,23,23,23,23,23,23,23,23,23,24,28,28,28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,17,18,18,18,18,16,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,22,23,14,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,17,19,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,22,24,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,22,23,23,23,23,23,23,23,23, + 12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28, + 12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28, + 12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28, + 12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28, + 12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,6,6,6,6,6,6, + 12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,17,18,18,18,18,18, + 12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,28,28,28,28,17,19,28,28,28,28,28,0,0,28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,28,28,28,28,22,24,28,28,28,28,28,0,0,28,28,28,28,28,28,28,28,28,0,0,0,20,13,23,23,23,23, + 12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,0,0,0,0,28,28,28,28,28,28,28,28,28,0,0,0,20,21,28,28,28,28, + 12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,28,28,28,28,28,0,0,0,20,21,28,28,28,28, + 12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,28,28,28,28,28,0,0,0,20,21,28,28,28,28, + 12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,28,28,0,0,0,20,21,28,28,28,28, + 12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,28,28,0,0,0,20,21,28,28,28,28, + 12,12,12,12,12,12,12,12,21,0,0,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,28,28,0,0,0,20,21,28,28,17,18, + 12,12,12,12,12,12,12,12,21,0,0,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,28,28,0,0,0,20,21,28,28,20,12, + 12,12,12,12,12,12,12,12,21,0,0,0,0,28,28,28,0,0,0,0,0,0,0,0,0,0,0,0,0,17,19,0,0,0,20,21,28,28,22,23, + 12,12,12,12,12,12,12,12,21,0,0,0,0,28,28,28,0,0,0,0,0,0,0,0,0,0,0,0,0,22,24,0,0,0,20,21,28,28,28,28, + 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,21,28,28,28,28, + 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,21,28,28,28,28, + 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,21,28,28,28,28, + 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,21,28,28,28,28, + 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,15,18,18,18,18, + 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12, + }; - SDL_memcpy(minitower, tmap, sizeof(minitower)); + SDL_memcpy(minitower, tmap, sizeof(minitower)); #endif } void towerclass::loadminitower2(void) { #if !defined(MAKEANDPLAY) - static const short tmap[] = { - 12,12,21,10,0,0,0,0,0,0,0,0,0,0,0,0,11,20,21,10,0,20,21,28,28,20,21,28,28,20,12,12,12,12,12,12,12,12,12,12, - 12,12,21,10,0,0,0,0,0,0,0,0,0,0,0,0,11,20,21,10,0,20,21,28,28,20,21,28,28,20,12,12,12,12,12,12,12,12,12,12, - 12,12,21,10,0,0,0,0,0,0,0,0,0,0,0,0,11,20,21,10,0,20,21,28,28,20,21,28,28,20,12,12,12,12,12,12,12,12,12,12, - 12,12,21,10,0,0,0,0,0,0,0,0,0,0,0,0,11,20,21,10,0,20,21,28,28,20,21,28,28,20,13,23,23,23,23,23,23,23,23,23, - 12,12,21,10,0,0,0,0,0,0,0,0,0,0,0,0,11,20,21,10,0,20,21,28,28,20,21,28,28,22,24,28,28,0,0,0,0,0,0,0, - 12,12,21,10,0,0,0,0,0,0,0,0,0,0,0,0,11,20,21,10,0,20,21,28,28,20,21,28,28,28,28,28,28,0,0,0,0,0,0,0, - 12,12,21,10,0,0,0,0,0,0,0,0,0,0,0,0,11,20,21,10,0,20,21,28,28,22,24,28,28,28,28,28,28,0,0,0,0,0,0,0, - 12,12,21,10,0,0,0,0,0,0,0,0,0,0,0,0,11,20,21,10,0,20,21,28,28,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0, - 12,12,21,10,0,0,0,0,0,0,0,0,0,0,0,0,11,20,21,10,0,22,24,28,28,28,28,28,28,28,28,28,28,0,17,18,18,18,18,18, - 12,12,21,10,0,0,0,0,0,0,0,0,0,0,0,0,11,20,21,10,0,28,28,28,28,28,28,28,28,28,28,0,0,0,20,12,12,12,12,12, - 12,12,21,10,0,0,0,0,0,0,0,0,0,0,0,0,11,20,21,10,0,28,28,28,28,28,28,28,28,28,28,0,0,0,20,12,12,12,12,12, - 12,12,21,10,0,0,0,0,0,0,0,0,0,0,0,0,11,20,21,10,0,28,28,28,28,28,28,28,28,0,0,0,0,0,20,12,12,12,12,12, - 23,23,24,0,0,0,0,0,0,0,0,0,0,0,0,0,11,22,24,10,0,28,28,28,28,28,28,28,28,0,0,0,0,0,20,12,12,12,12,12, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9,9,0,0,28,28,28,28,28,28,28,28,0,0,0,0,0,20,12,12,12,12,12, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,0,0,0,0,0,20,12,12,12,12,12, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,0,0,0,0,0,0,0,20,12,12,12,12,12, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,0,0,0,0,0,0,0,20,12,12,12,12,12, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12, - 18,18,18,18,18,18,18,19,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12, - 12,12,12,12,12,12,12,21,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12, - 23,23,23,23,23,23,23,24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,17,18,19,0,0,0,0,0,0,20,12,12,12,12,12, - 18,18,18,18,18,19,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,21,0,0,0,0,0,0,20,12,12,12,12,12, - 12,12,12,12,12,21,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,21,0,0,0,0,0,0,20,12,12,12,12,12, - 12,12,12,12,12,21,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,21,0,0,0,0,0,0,20,12,12,12,12,12, - 12,12,12,12,12,15,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,16,12,21,0,0,0,0,0,0,20,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,20,12,12,12,12,12, - 12,12,12,12,12,12,13,23,23,23,23,23,23,14,13,23,23,23,23,23,23,23,14,12,12,12,12,21,0,0,0,0,0,0,20,12,12,12,12,12, - 12,12,12,12,12,12,21,9,9,9,9,9,9,22,24,9,9,9,9,9,9,9,22,23,23,23,23,24,0,0,0,0,0,0,20,12,12,12,12,12, - 12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12, - 12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,0,0,0,0,20,12,12,12,12,12, - 12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,0,0,0,0,20,12,12,12,12,12, - 12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,0,0,0,0,20,12,12,12,12,12, - 12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,0,0,0,0,20,12,12,12,12,12, - 12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,0,0,0,0,20,12,12,12,12,12, - 12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,0,0,0,0,20,12,12,12,12,12, - 12,12,12,12,12,12,21,0,0,0,0,0,0,8,8,0,0,0,0,0,0,0,28,28,28,28,28,6,28,28,0,0,0,0,20,12,12,12,12,12, - 12,12,12,12,12,12,21,0,0,0,0,0,0,25,27,0,0,0,0,0,0,0,28,28,28,28,28,26,28,28,0,0,0,0,20,12,12,12,12,12, - 12,12,12,12,12,12,21,0,0,0,0,0,0,9,9,0,0,0,0,0,0,0,28,28,28,28,28,7,28,28,0,0,0,0,20,12,12,12,12,12, - 12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,0,0,0,0,20,12,12,12,12,12, - 12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,0,0,0,0,20,12,12,12,12,12, - 12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,0,0,0,0,20,12,12,12,12,12, - 12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,0,0,0,0,20,12,12,12,12,12, - 12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,0,0,0,0,20,12,12,12,12,12, - 12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,28,0,0,0,0,20,12,12,12,12,12, - 12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,28,0,0,0,0,20,12,12,12,12,12, - 12,12,12,12,12,12,21,8,8,8,8,8,8,17,18,18,18,19,8,8,8,6,17,18,18,18,18,19,28,28,0,0,0,0,20,12,12,12,12,12, - 12,12,12,12,12,12,15,18,18,18,18,18,18,16,12,12,12,15,18,18,18,18,16,12,12,12,12,21,28,28,0,0,0,0,20,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,6,6,0,0,0,0,20,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,15,18,19,0,0,0,0,20,12,12,12,12,12, - 12,12,12,12,12,13,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,14,13,23,23,23,24,0,0,0,0,20,12,12,12,12,12, - 12,12,12,12,12,21,10,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,20,21,28,28,28,28,0,0,0,0,20,12,12,12,12,12, - 12,12,12,12,12,21,10,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,20,21,28,28,28,28,0,0,0,0,20,12,12,12,12,12, - 12,12,12,12,12,21,10,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,22,24,28,28,28,28,0,0,0,0,20,12,12,12,12,12, - 12,12,12,12,12,21,10,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,28,28,0,0,0,0,20,12,12,12,12,12, - 12,12,12,12,12,21,10,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,28,0,0,0,0,0,20,12,12,12,12,12, - 12,12,12,12,12,21,10,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,28,0,0,0,0,0,20,12,12,12,12,12, - 12,12,12,12,12,21,10,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,28,28,28,0,0,0,0,0,20,12,12,12,12,12, - 12,12,12,12,12,21,10,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,28,28,28,0,0,0,0,0,20,12,12,12,12,12, - 12,12,12,12,12,21,10,0,0,0,0,25,27,0,0,0,28,28,28,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,20,12,12,12,12,12, - 12,12,12,12,12,21,10,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,20,12,12,12,12,12, - 12,12,12,12,12,21,10,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,20,12,12,12,12,12, - 12,12,12,12,12,21,10,0,0,0,0,0,0,0,0,0,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12, - 12,12,12,12,12,21,10,0,0,0,0,0,0,0,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12, - 12,12,12,12,12,21,10,0,0,0,0,0,0,0,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12, - 12,12,12,12,12,21,10,0,0,0,0,0,0,0,28,28,28,28,28,28,28,0,0,0,17,19,0,0,0,0,0,0,0,0,20,12,12,12,12,12, - 12,12,12,12,12,21,10,0,0,0,0,0,0,0,28,28,28,28,28,28,28,0,0,0,20,21,0,0,0,0,0,0,0,0,20,12,12,12,12,12, - 12,12,12,12,12,21,10,0,0,0,0,0,0,0,28,28,28,28,28,28,28,0,0,0,20,21,0,0,0,0,0,0,0,0,20,12,12,12,12,12, - 12,12,12,12,12,15,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,16,21,0,0,0,0,0,0,0,0,20,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,23,23,23,23,23,24,0,0,0,0,0,0,0,0,20,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,24,28,0,0,28,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,24,28,28,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,24,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,24,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,24,28,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,13,24,28,28,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,13,24,28,28,28,28,28,28,28,17,19,28,28,28,28,0,0,0,0,0,0,0,20,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,13,24,0,28,28,28,28,28,28,28,20,21,28,28,28,28,0,0,0,0,0,0,0,20,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,13,24,0,0,28,28,28,28,28,28,17,16,21,28,28,28,28,0,0,0,0,0,0,0,20,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,13,24,0,0,0,28,28,28,28,28,28,20,12,21,28,28,28,28,0,0,0,0,0,0,0,20,12,12,12,12,12, - 12,12,12,12,12,12,12,12,13,24,0,0,0,0,28,28,28,28,28,17,16,12,21,28,28,28,28,0,0,0,0,0,0,0,20,12,12,12,12,12, - 12,12,12,12,12,12,12,13,24,0,0,0,0,0,28,28,28,28,28,20,12,12,21,28,28,28,28,0,0,0,0,0,0,0,20,12,12,12,12,12, - 12,12,12,12,12,12,13,24,0,0,0,0,0,0,28,28,28,28,17,16,12,12,21,28,28,28,28,0,0,0,0,0,0,0,20,12,12,12,12,12, - 12,12,12,12,12,13,24,0,0,0,0,0,28,28,28,28,28,28,20,12,12,12,21,28,28,28,28,0,0,0,0,0,0,0,20,12,12,12,12,12, - 12,12,12,12,13,24,0,0,0,0,0,0,28,28,28,28,28,17,16,12,12,12,21,28,28,28,28,0,0,0,0,0,0,0,20,12,12,12,12,12, - 12,12,12,13,24,0,0,0,0,0,0,0,28,28,28,28,28,20,12,12,12,12,21,28,28,28,28,0,0,0,0,0,0,0,20,12,12,12,12,12, - 12,12,13,24,0,0,0,0,0,0,0,0,28,28,28,28,17,16,12,12,12,12,21,28,28,28,28,0,0,0,0,0,0,0,20,12,12,12,12,12, - 23,23,24,0,0,0,0,0,0,0,0,0,28,28,28,28,20,12,12,12,12,12,21,28,28,28,28,0,0,0,0,0,0,0,20,12,12,12,12,12, - 0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,17,16,12,12,12,12,12,21,28,28,28,28,0,0,0,0,0,0,0,20,12,12,12,12,12, - 0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,20,12,12,12,12,12,12,21,28,28,28,28,0,0,0,0,0,0,0,20,12,12,12,12,12, - 0,0,0,0,0,0,0,0,0,0,0,0,28,28,17,16,12,12,12,12,12,12,21,28,28,28,28,0,0,0,0,0,0,0,20,12,12,12,12,12, - 0,0,0,0,0,0,0,0,0,0,0,0,28,28,20,12,12,12,12,12,12,12,21,28,28,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12, - 18,18,18,18,18,18,18,18,18,18,18,18,18,18,16,12,12,12,12,12,12,12,21,28,28,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,28,28,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,28,28,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,28,28,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12, - }; + static const short tmap[] = { + 12,12,21,10,0,0,0,0,0,0,0,0,0,0,0,0,11,20,21,10,0,20,21,28,28,20,21,28,28,20,12,12,12,12,12,12,12,12,12,12, + 12,12,21,10,0,0,0,0,0,0,0,0,0,0,0,0,11,20,21,10,0,20,21,28,28,20,21,28,28,20,12,12,12,12,12,12,12,12,12,12, + 12,12,21,10,0,0,0,0,0,0,0,0,0,0,0,0,11,20,21,10,0,20,21,28,28,20,21,28,28,20,12,12,12,12,12,12,12,12,12,12, + 12,12,21,10,0,0,0,0,0,0,0,0,0,0,0,0,11,20,21,10,0,20,21,28,28,20,21,28,28,20,13,23,23,23,23,23,23,23,23,23, + 12,12,21,10,0,0,0,0,0,0,0,0,0,0,0,0,11,20,21,10,0,20,21,28,28,20,21,28,28,22,24,28,28,0,0,0,0,0,0,0, + 12,12,21,10,0,0,0,0,0,0,0,0,0,0,0,0,11,20,21,10,0,20,21,28,28,20,21,28,28,28,28,28,28,0,0,0,0,0,0,0, + 12,12,21,10,0,0,0,0,0,0,0,0,0,0,0,0,11,20,21,10,0,20,21,28,28,22,24,28,28,28,28,28,28,0,0,0,0,0,0,0, + 12,12,21,10,0,0,0,0,0,0,0,0,0,0,0,0,11,20,21,10,0,20,21,28,28,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0, + 12,12,21,10,0,0,0,0,0,0,0,0,0,0,0,0,11,20,21,10,0,22,24,28,28,28,28,28,28,28,28,28,28,0,17,18,18,18,18,18, + 12,12,21,10,0,0,0,0,0,0,0,0,0,0,0,0,11,20,21,10,0,28,28,28,28,28,28,28,28,28,28,0,0,0,20,12,12,12,12,12, + 12,12,21,10,0,0,0,0,0,0,0,0,0,0,0,0,11,20,21,10,0,28,28,28,28,28,28,28,28,28,28,0,0,0,20,12,12,12,12,12, + 12,12,21,10,0,0,0,0,0,0,0,0,0,0,0,0,11,20,21,10,0,28,28,28,28,28,28,28,28,0,0,0,0,0,20,12,12,12,12,12, + 23,23,24,0,0,0,0,0,0,0,0,0,0,0,0,0,11,22,24,10,0,28,28,28,28,28,28,28,28,0,0,0,0,0,20,12,12,12,12,12, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9,9,0,0,28,28,28,28,28,28,28,28,0,0,0,0,0,20,12,12,12,12,12, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,0,0,0,0,0,20,12,12,12,12,12, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,0,0,0,0,0,0,0,20,12,12,12,12,12, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,0,0,0,0,0,0,0,20,12,12,12,12,12, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12, + 18,18,18,18,18,18,18,19,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12, + 12,12,12,12,12,12,12,21,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12, + 23,23,23,23,23,23,23,24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,17,18,19,0,0,0,0,0,0,20,12,12,12,12,12, + 18,18,18,18,18,19,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,21,0,0,0,0,0,0,20,12,12,12,12,12, + 12,12,12,12,12,21,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,21,0,0,0,0,0,0,20,12,12,12,12,12, + 12,12,12,12,12,21,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,21,0,0,0,0,0,0,20,12,12,12,12,12, + 12,12,12,12,12,15,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,16,12,21,0,0,0,0,0,0,20,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,20,12,12,12,12,12, + 12,12,12,12,12,12,13,23,23,23,23,23,23,14,13,23,23,23,23,23,23,23,14,12,12,12,12,21,0,0,0,0,0,0,20,12,12,12,12,12, + 12,12,12,12,12,12,21,9,9,9,9,9,9,22,24,9,9,9,9,9,9,9,22,23,23,23,23,24,0,0,0,0,0,0,20,12,12,12,12,12, + 12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12, + 12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,0,0,0,0,20,12,12,12,12,12, + 12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,0,0,0,0,20,12,12,12,12,12, + 12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,0,0,0,0,20,12,12,12,12,12, + 12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,0,0,0,0,20,12,12,12,12,12, + 12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,0,0,0,0,20,12,12,12,12,12, + 12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,0,0,0,0,20,12,12,12,12,12, + 12,12,12,12,12,12,21,0,0,0,0,0,0,8,8,0,0,0,0,0,0,0,28,28,28,28,28,6,28,28,0,0,0,0,20,12,12,12,12,12, + 12,12,12,12,12,12,21,0,0,0,0,0,0,25,27,0,0,0,0,0,0,0,28,28,28,28,28,26,28,28,0,0,0,0,20,12,12,12,12,12, + 12,12,12,12,12,12,21,0,0,0,0,0,0,9,9,0,0,0,0,0,0,0,28,28,28,28,28,7,28,28,0,0,0,0,20,12,12,12,12,12, + 12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,0,0,0,0,20,12,12,12,12,12, + 12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,0,0,0,0,20,12,12,12,12,12, + 12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,0,0,0,0,20,12,12,12,12,12, + 12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,0,0,0,0,20,12,12,12,12,12, + 12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,0,0,0,0,20,12,12,12,12,12, + 12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,28,0,0,0,0,20,12,12,12,12,12, + 12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,28,0,0,0,0,20,12,12,12,12,12, + 12,12,12,12,12,12,21,8,8,8,8,8,8,17,18,18,18,19,8,8,8,6,17,18,18,18,18,19,28,28,0,0,0,0,20,12,12,12,12,12, + 12,12,12,12,12,12,15,18,18,18,18,18,18,16,12,12,12,15,18,18,18,18,16,12,12,12,12,21,28,28,0,0,0,0,20,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,6,6,0,0,0,0,20,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,15,18,19,0,0,0,0,20,12,12,12,12,12, + 12,12,12,12,12,13,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,14,13,23,23,23,24,0,0,0,0,20,12,12,12,12,12, + 12,12,12,12,12,21,10,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,20,21,28,28,28,28,0,0,0,0,20,12,12,12,12,12, + 12,12,12,12,12,21,10,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,20,21,28,28,28,28,0,0,0,0,20,12,12,12,12,12, + 12,12,12,12,12,21,10,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,22,24,28,28,28,28,0,0,0,0,20,12,12,12,12,12, + 12,12,12,12,12,21,10,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,28,28,0,0,0,0,20,12,12,12,12,12, + 12,12,12,12,12,21,10,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,28,0,0,0,0,0,20,12,12,12,12,12, + 12,12,12,12,12,21,10,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,28,0,0,0,0,0,20,12,12,12,12,12, + 12,12,12,12,12,21,10,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,28,28,28,0,0,0,0,0,20,12,12,12,12,12, + 12,12,12,12,12,21,10,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,28,28,28,0,0,0,0,0,20,12,12,12,12,12, + 12,12,12,12,12,21,10,0,0,0,0,25,27,0,0,0,28,28,28,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,20,12,12,12,12,12, + 12,12,12,12,12,21,10,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,20,12,12,12,12,12, + 12,12,12,12,12,21,10,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,20,12,12,12,12,12, + 12,12,12,12,12,21,10,0,0,0,0,0,0,0,0,0,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12, + 12,12,12,12,12,21,10,0,0,0,0,0,0,0,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12, + 12,12,12,12,12,21,10,0,0,0,0,0,0,0,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12, + 12,12,12,12,12,21,10,0,0,0,0,0,0,0,28,28,28,28,28,28,28,0,0,0,17,19,0,0,0,0,0,0,0,0,20,12,12,12,12,12, + 12,12,12,12,12,21,10,0,0,0,0,0,0,0,28,28,28,28,28,28,28,0,0,0,20,21,0,0,0,0,0,0,0,0,20,12,12,12,12,12, + 12,12,12,12,12,21,10,0,0,0,0,0,0,0,28,28,28,28,28,28,28,0,0,0,20,21,0,0,0,0,0,0,0,0,20,12,12,12,12,12, + 12,12,12,12,12,15,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,16,21,0,0,0,0,0,0,0,0,20,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,23,23,23,23,23,24,0,0,0,0,0,0,0,0,20,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,24,28,0,0,28,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,24,28,28,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,24,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,24,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,24,28,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,13,24,28,28,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,13,24,28,28,28,28,28,28,28,17,19,28,28,28,28,0,0,0,0,0,0,0,20,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,13,24,0,28,28,28,28,28,28,28,20,21,28,28,28,28,0,0,0,0,0,0,0,20,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,13,24,0,0,28,28,28,28,28,28,17,16,21,28,28,28,28,0,0,0,0,0,0,0,20,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,13,24,0,0,0,28,28,28,28,28,28,20,12,21,28,28,28,28,0,0,0,0,0,0,0,20,12,12,12,12,12, + 12,12,12,12,12,12,12,12,13,24,0,0,0,0,28,28,28,28,28,17,16,12,21,28,28,28,28,0,0,0,0,0,0,0,20,12,12,12,12,12, + 12,12,12,12,12,12,12,13,24,0,0,0,0,0,28,28,28,28,28,20,12,12,21,28,28,28,28,0,0,0,0,0,0,0,20,12,12,12,12,12, + 12,12,12,12,12,12,13,24,0,0,0,0,0,0,28,28,28,28,17,16,12,12,21,28,28,28,28,0,0,0,0,0,0,0,20,12,12,12,12,12, + 12,12,12,12,12,13,24,0,0,0,0,0,28,28,28,28,28,28,20,12,12,12,21,28,28,28,28,0,0,0,0,0,0,0,20,12,12,12,12,12, + 12,12,12,12,13,24,0,0,0,0,0,0,28,28,28,28,28,17,16,12,12,12,21,28,28,28,28,0,0,0,0,0,0,0,20,12,12,12,12,12, + 12,12,12,13,24,0,0,0,0,0,0,0,28,28,28,28,28,20,12,12,12,12,21,28,28,28,28,0,0,0,0,0,0,0,20,12,12,12,12,12, + 12,12,13,24,0,0,0,0,0,0,0,0,28,28,28,28,17,16,12,12,12,12,21,28,28,28,28,0,0,0,0,0,0,0,20,12,12,12,12,12, + 23,23,24,0,0,0,0,0,0,0,0,0,28,28,28,28,20,12,12,12,12,12,21,28,28,28,28,0,0,0,0,0,0,0,20,12,12,12,12,12, + 0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,17,16,12,12,12,12,12,21,28,28,28,28,0,0,0,0,0,0,0,20,12,12,12,12,12, + 0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,20,12,12,12,12,12,12,21,28,28,28,28,0,0,0,0,0,0,0,20,12,12,12,12,12, + 0,0,0,0,0,0,0,0,0,0,0,0,28,28,17,16,12,12,12,12,12,12,21,28,28,28,28,0,0,0,0,0,0,0,20,12,12,12,12,12, + 0,0,0,0,0,0,0,0,0,0,0,0,28,28,20,12,12,12,12,12,12,12,21,28,28,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12, + 18,18,18,18,18,18,18,18,18,18,18,18,18,18,16,12,12,12,12,12,12,12,21,28,28,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,28,28,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,28,28,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,28,28,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12, + }; - SDL_memcpy(minitower, tmap, sizeof(minitower)); + SDL_memcpy(minitower, tmap, sizeof(minitower)); #endif } void towerclass::loadbackground(void) { - //Loads the background into the array. - static const short tmap[] = { - 1,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,1,2,0,0,0,0,0,0,0,0,0,0,0,0,5,4,0,0, - 2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,1,2,0,0,0,0,0,0,0,0,0,0,0,0,5,1,1,4,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,1,2,0,0,0,0,0,0,0,0,0,0,0,0,5,1,1,1,1,4, - 0,5,4,0,0,0,0,0,0,5,4,0,0,0,0,0,0,0,0,3,1,4,0,0,0,0,0,0,0,0,0,0,0,5,1,1,1,1,1,2, - 5,1,1,4,0,0,0,0,5,1,1,4,0,0,0,0,0,0,0,0,3,1,4,0,0,0,0,0,0,0,0,0,5,1,1,1,1,1,2,0, - 1,1,1,1,4,0,0,5,1,1,1,1,4,0,0,0,0,0,0,0,0,3,1,4,0,0,0,0,0,0,0,5,1,1,1,1,1,2,0,0, - 1,1,1,1,1,4,5,1,1,1,1,1,1,4,0,0,0,0,0,0,0,0,3,1,4,0,0,0,0,0,0,3,1,1,1,1,1,4,0,0, - 1,1,1,1,1,1,1,1,1,1,1,1,1,1,4,0,0,0,0,0,0,0,0,3,1,4,0,0,0,0,0,0,3,1,1,1,1,1,4,0, - 1,1,1,1,1,1,1,1,2,3,1,1,2,3,1,4,0,0,0,0,0,0,0,0,3,1,4,0,0,0,0,0,0,3,1,1,1,1,1,4, - 1,1,1,1,1,1,1,2,0,0,3,2,0,0,3,2,0,0,0,0,0,0,5,4,5,1,1,4,0,0,0,0,0,0,3,1,1,1,1,1, - 1,1,1,1,1,1,2,0,5,4,0,0,0,0,0,0,0,0,0,0,0,5,1,1,1,1,1,1,4,0,0,0,0,0,0,3,1,1,1,1, - 1,1,1,1,1,1,4,5,1,2,0,0,0,0,0,0,0,0,0,0,0,3,1,1,1,2,3,1,1,4,0,0,0,0,0,0,3,1,1,1, - 1,1,1,1,1,1,1,1,2,0,0,0,0,0,0,0,0,0,0,0,0,0,3,1,1,4,0,3,1,1,4,0,0,0,0,0,0,3,1,1, - 3,1,1,1,1,1,1,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,1,1,2,0,5,1,1,1,4,0,0,0,0,0,0,3,1, - 0,3,1,1,1,1,2,0,0,0,0,0,0,0,0,0,0,0,0,5,4,5,1,1,2,0,0,3,1,1,1,2,0,0,0,0,0,0,0,3, - 0,0,3,1,1,1,4,0,0,0,0,0,5,4,0,0,0,0,5,1,1,1,1,2,0,0,0,0,3,1,2,0,5,4,0,0,0,0,0,0, - 0,0,0,3,1,1,1,4,0,0,0,5,1,2,0,0,0,0,3,1,1,1,1,4,5,4,0,0,5,1,4,5,1,1,4,0,0,0,0,0, - 0,0,0,0,3,1,1,1,4,0,0,3,1,4,0,0,0,0,5,1,1,1,1,1,1,1,4,5,1,1,1,1,1,1,2,0,0,0,0,0, - 0,0,0,0,5,1,1,1,1,4,0,0,3,1,4,5,4,5,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,0,0,0,0,0,0, - 0,0,0,5,1,1,1,1,1,1,4,0,0,3,1,1,1,1,1,1,1,1,2,3,1,1,1,1,1,1,1,1,2,0,0,0,0,0,0,5, - 0,0,5,1,1,1,2,3,1,1,1,4,0,0,3,1,1,1,1,1,1,2,0,0,3,1,1,1,1,1,1,1,4,0,0,0,0,0,5,1, - 0,0,3,1,1,2,0,0,3,1,1,1,4,0,0,3,1,1,1,1,1,4,0,0,0,3,2,3,1,1,1,1,1,4,0,0,0,0,3,1, - 0,0,0,3,2,0,0,0,0,3,2,3,1,4,0,0,3,1,1,1,1,1,4,0,0,0,0,0,3,1,1,2,3,1,4,0,0,0,0,3, - 0,0,0,0,0,0,5,4,0,0,0,0,3,1,4,0,0,3,2,3,1,1,1,4,0,0,0,0,0,3,2,0,0,3,1,4,0,0,0,0, - 0,0,0,0,0,0,3,1,4,0,0,0,0,3,1,4,0,0,0,5,1,1,1,2,0,0,0,0,0,0,0,0,0,0,3,2,0,0,0,0, - 0,0,0,0,0,0,5,1,1,4,5,4,0,0,3,2,0,0,0,3,1,1,2,0,0,5,4,0,0,0,0,5,4,0,0,0,0,0,0,0, - 0,0,0,0,0,5,1,1,1,1,1,2,0,0,0,0,0,0,0,0,3,1,4,0,0,3,1,4,0,0,5,1,1,4,0,0,5,4,0,0, - 0,0,0,0,5,1,1,1,1,1,2,0,0,0,0,0,0,0,0,0,0,3,1,4,0,0,3,1,4,5,1,2,3,1,4,5,1,1,4,0, - 0,0,0,5,1,1,1,1,1,1,4,0,0,0,0,0,0,0,0,0,0,0,3,1,4,0,0,3,1,1,2,0,0,3,1,1,1,1,1,4, - 0,0,0,3,1,1,2,3,1,1,1,4,0,0,0,0,0,0,0,0,0,0,0,3,1,4,0,0,3,2,0,0,0,0,3,1,1,1,1,1, - 4,0,0,0,3,2,0,0,3,1,1,1,4,0,0,0,0,0,0,0,0,0,0,0,3,1,4,0,0,0,0,0,0,0,5,1,1,1,1,1, - 1,4,0,0,0,0,0,0,5,1,1,1,1,4,0,0,0,0,5,4,0,0,0,0,0,3,1,4,0,5,4,0,0,5,1,1,1,1,1,1, - 3,1,4,0,0,0,0,5,1,1,1,1,1,1,4,0,0,0,3,1,4,5,4,0,0,5,1,2,0,3,1,4,5,1,1,1,2,3,1,1, - 0,3,1,4,0,0,5,1,1,1,2,3,1,1,2,0,0,0,0,3,1,1,1,4,5,1,2,0,0,0,3,1,1,1,1,2,0,5,1,1, - 0,5,1,1,4,5,1,1,1,2,0,0,3,2,0,0,0,0,0,5,1,1,1,1,1,2,0,0,0,0,0,3,1,1,2,0,5,1,1,1, - 5,1,1,1,1,1,1,1,1,4,5,4,0,0,0,0,0,0,0,3,1,1,1,1,1,4,0,0,0,0,0,5,1,2,0,0,3,1,1,1, - 1,1,1,2,3,1,1,1,1,1,1,1,4,5,4,0,0,5,4,0,3,1,1,1,1,1,4,0,0,0,5,1,2,0,0,0,0,3,1,1, - 1,1,2,0,0,3,1,1,1,1,1,1,1,1,1,4,5,1,2,0,5,1,1,1,2,3,2,0,0,0,3,1,4,0,0,0,0,0,3,1, - 1,2,0,0,0,0,3,1,1,2,3,1,1,1,1,1,1,2,0,5,1,1,1,1,4,0,0,5,4,0,0,3,1,4,0,0,0,0,0,3, - 2,0,0,0,0,0,5,1,2,0,0,3,1,1,1,1,2,0,5,1,1,1,1,1,1,4,5,1,1,4,0,0,3,1,4,0,0,0,0,0, - 0,0,0,0,0,5,1,2,0,0,0,0,3,1,1,1,4,5,1,1,1,1,1,1,1,1,1,1,1,2,0,0,0,3,2,0,0,0,0,0, - 0,0,0,0,0,3,2,0,0,0,0,0,0,3,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,0,0,0,0,0,0,0,0,0,0,0, - 0,5,4,0,0,0,0,5,4,0,0,0,0,0,3,1,1,1,1,2,3,1,1,1,1,1,1,2,0,0,5,4,0,0,5,4,0,0,0,5, - 5,1,1,4,0,0,5,1,2,0,0,0,0,0,0,3,1,1,2,0,0,3,1,1,1,1,2,0,0,5,1,1,4,5,1,2,0,0,5,1, - 1,1,1,1,4,5,1,2,0,0,0,0,0,0,0,0,3,2,0,0,0,0,3,1,1,2,0,0,5,1,1,1,1,1,2,0,0,5,1,1, - 1,1,1,1,1,1,1,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,1,1,4,0,0,3,1,1,1,1,2,0,0,5,1,1,1, - 1,1,1,1,1,1,1,2,0,5,4,0,0,0,0,0,0,0,0,0,0,5,1,1,1,1,4,0,0,3,1,1,2,0,0,5,1,1,1,1, - 1,1,1,1,1,1,1,4,5,1,2,0,0,0,0,0,0,0,0,0,5,1,1,1,1,1,1,4,0,0,3,1,4,0,0,3,1,1,1,1, - 1,1,1,1,1,1,1,1,1,2,0,0,0,0,0,0,0,0,0,5,1,1,1,1,1,1,1,2,0,0,5,1,1,4,0,0,3,1,1,1, - 1,1,1,1,1,1,1,1,2,0,0,0,0,0,0,0,0,0,5,1,1,1,1,1,1,1,2,0,0,5,1,1,1,2,0,0,5,1,1,1, - 3,1,1,1,1,1,1,2,0,0,0,0,0,5,4,0,0,5,1,1,1,1,1,1,1,2,0,0,5,1,1,1,2,0,0,5,1,1,1,1, - 0,3,1,1,1,1,1,4,0,0,5,4,5,1,1,4,5,1,1,1,1,1,1,1,2,0,0,5,1,1,1,2,0,0,5,1,1,1,1,1, - 0,0,3,1,1,1,1,1,4,5,1,1,1,1,1,1,1,1,1,1,1,1,1,1,4,0,0,3,1,1,2,0,0,5,1,1,1,1,1,1, - 0,0,0,3,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,4,0,0,3,2,0,0,5,1,1,1,1,1,1,1, - 0,0,0,5,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,4,0,0,0,0,0,3,1,1,1,1,1,1,1, - 0,0,5,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,3,1,4,0,0,0,0,0,3,1,1,1,1,1,1, - 0,5,1,1,1,1,1,1,1,1,1,1,1,1,1,2,3,1,1,1,1,1,1,2,0,0,3,1,4,0,0,0,0,5,1,2,3,1,1,1, - 5,1,1,1,1,1,1,1,1,1,1,1,2,3,2,0,0,3,1,1,1,1,2,0,0,0,0,3,1,4,0,0,5,1,2,0,0,3,1,1, - 1,1,1,1,1,1,1,1,1,1,1,1,4,0,0,5,4,0,3,1,1,2,0,0,0,0,0,0,3,1,4,5,1,2,0,0,0,0,3,1, - 1,1,1,1,1,1,1,1,1,1,1,1,1,4,5,1,1,4,0,3,1,4,0,0,0,0,0,0,5,1,1,1,2,0,0,0,0,0,0,3, - 3,1,1,1,1,2,3,1,1,2,3,1,1,1,1,1,1,1,4,0,3,1,4,0,0,0,0,5,1,1,1,2,0,0,0,0,0,0,0,0, - 0,3,1,1,2,0,0,3,2,0,0,3,1,1,1,1,1,1,2,0,0,3,2,0,0,0,5,1,1,1,2,0,0,0,0,0,0,0,0,0, - 0,0,3,2,0,0,0,0,0,0,0,0,3,1,1,1,1,2,0,0,0,0,0,0,0,5,1,1,1,1,4,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,5,1,1,1,2,0,0,0,0,0,0,0,5,1,2,3,1,1,1,4,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,5,1,1,1,1,4,0,0,0,0,0,0,5,1,2,0,0,3,1,1,1,4,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,5,1,1,1,2,3,1,4,0,0,0,0,0,3,2,0,0,0,0,3,1,1,1,4,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,5,1,1,1,2,0,0,3,1,4,0,0,0,0,0,0,0,0,0,0,0,3,1,1,1,4,0,0,0,0,0, - 0,0,0,0,0,0,0,0,5,1,1,1,2,0,0,0,0,3,1,4,0,0,0,0,0,0,0,0,0,0,5,1,1,1,2,0,0,0,0,0, - 0,0,0,0,0,0,0,5,1,1,1,2,0,0,0,0,0,0,3,1,4,0,0,0,0,0,0,0,0,5,1,1,1,2,0,0,0,0,0,0, - 0,0,0,0,0,0,5,1,1,1,2,0,0,0,0,0,0,0,0,3,1,4,0,0,0,0,0,0,5,1,1,1,2,0,0,0,0,0,0,0, - 0,0,0,0,0,5,1,1,1,2,0,0,0,0,0,0,0,0,0,5,1,1,4,0,0,0,0,5,1,1,1,2,0,0,0,0,0,0,0,0, - 0,0,0,0,5,1,1,1,2,0,0,0,0,0,0,0,0,0,5,1,1,1,1,4,0,0,5,1,1,1,2,0,0,0,0,0,0,0,0,0, - 0,0,0,5,1,1,1,2,0,0,0,0,0,0,0,0,0,5,1,1,1,1,1,1,4,5,1,1,1,2,0,0,0,0,0,0,0,0,0,0, - 0,0,5,1,1,1,1,4,0,0,0,0,0,0,0,0,5,1,1,1,1,1,1,1,1,1,1,1,2,0,0,0,0,0,0,0,0,0,0,0, - 0,5,1,1,1,2,3,1,4,0,0,0,0,0,0,5,1,1,1,1,1,1,1,1,1,1,1,2,0,0,0,0,0,0,0,0,0,0,0,0, - 5,1,1,1,2,0,0,3,1,4,0,0,0,0,5,1,1,1,2,3,2,3,2,3,1,1,1,4,0,0,0,0,0,0,0,0,0,0,0,0, - 1,1,1,2,0,0,0,5,1,2,0,0,0,5,1,1,1,2,0,0,0,0,0,0,3,1,1,1,4,0,0,0,0,0,0,0,0,0,0,0, - 1,1,2,0,0,0,5,1,2,0,0,0,5,1,1,1,1,4,0,0,0,0,0,0,0,3,1,1,1,4,0,0,0,0,0,0,0,0,0,0, - 1,2,0,0,0,0,3,1,4,0,0,5,1,1,1,1,1,2,0,0,0,0,0,0,0,5,1,1,1,1,4,0,0,0,0,0,0,0,0,0, - 2,0,0,0,0,0,0,3,1,4,5,1,1,1,1,1,1,4,0,0,0,0,0,0,5,1,2,3,1,1,1,4,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,3,1,1,1,1,1,1,1,1,1,4,5,4,0,0,0,3,2,0,0,3,1,1,1,4,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,5,1,1,1,1,1,1,1,1,1,1,1,2,0,0,0,0,0,0,0,5,1,1,1,1,4,0,0,0,0,0,0, - 0,0,0,0,0,0,0,5,1,2,3,1,1,1,1,1,1,1,1,2,0,0,0,0,0,0,0,5,1,1,1,1,1,1,4,0,0,0,0,0, - 0,0,0,0,0,0,5,1,1,4,0,3,1,1,1,1,1,1,2,0,0,0,0,0,0,0,5,1,1,1,1,1,1,1,2,0,0,0,0,0, - 0,0,0,0,0,0,3,1,1,1,4,0,3,1,1,1,1,2,0,0,0,5,4,0,0,5,1,1,1,1,1,1,1,2,0,5,4,0,0,0, - 0,0,0,0,0,0,0,3,1,1,2,0,5,1,1,1,1,4,0,0,5,1,2,0,5,1,1,1,1,1,1,1,2,0,5,1,1,4,0,0, - 0,0,0,0,0,0,0,5,1,2,0,5,1,1,1,1,1,1,4,0,3,1,4,5,1,1,1,1,1,1,1,2,0,5,1,1,1,1,4,0, - 0,0,0,0,0,0,5,1,2,0,5,1,1,1,1,1,1,1,1,4,0,3,1,1,1,1,1,1,1,1,2,0,5,1,1,1,1,1,1,4, - 0,0,0,0,0,0,3,2,0,0,3,1,1,1,1,2,3,1,1,1,4,0,3,1,1,1,1,1,1,1,4,0,3,1,1,1,1,1,1,1, - 0,0,5,4,0,0,0,0,0,0,0,3,1,1,2,0,5,1,1,1,2,0,0,3,1,1,1,1,1,1,1,4,0,3,1,1,1,1,1,1, - 0,5,1,1,4,0,0,0,0,0,0,0,3,2,0,5,1,1,1,1,4,0,0,0,3,1,1,1,1,1,1,1,4,0,3,1,1,1,1,2, - 0,3,1,1,1,4,0,0,0,0,0,0,0,0,5,1,1,1,1,1,1,4,0,0,0,3,1,1,1,1,1,1,1,4,5,1,1,1,2,0, - 0,0,3,1,1,1,4,0,0,0,0,0,0,0,3,1,1,1,1,1,1,2,0,5,4,0,3,1,1,1,1,1,1,1,1,1,1,2,0,0, - 0,0,0,3,1,1,1,4,0,0,0,0,0,0,0,3,1,1,1,1,2,0,5,1,2,0,5,1,1,1,1,1,1,1,1,1,2,0,0,0, - 0,0,0,5,1,1,1,2,0,0,0,0,0,0,0,5,1,1,1,1,4,5,1,2,0,5,1,2,3,1,1,1,1,1,1,1,4,0,0,0, - 0,0,5,1,1,1,2,0,5,4,0,0,0,0,5,1,1,1,1,1,1,1,2,0,0,3,2,0,5,1,1,1,1,1,1,1,1,4,0,0, - 0,5,1,1,1,2,0,0,3,1,4,0,0,5,1,1,1,1,1,1,1,2,0,5,4,0,0,0,3,1,1,1,1,1,1,1,1,1,4,0, - 5,1,1,1,2,0,5,4,0,3,1,4,0,3,1,1,1,1,1,1,2,0,5,1,1,4,5,4,0,3,1,1,1,1,2,3,1,1,1,4, - 1,1,1,2,0,5,1,1,4,0,3,1,4,0,3,1,1,1,1,2,0,5,1,1,1,1,1,1,4,5,1,1,1,2,0,0,3,1,1,1, - 1,1,1,4,5,1,1,1,1,4,5,1,1,4,0,3,1,1,1,4,0,3,1,1,1,1,1,1,1,1,1,1,1,4,0,0,0,3,1,1, - 1,1,1,1,1,1,2,3,1,1,1,1,1,1,4,0,3,1,1,1,4,0,3,1,1,1,1,1,1,1,1,1,1,1,4,0,0,5,1,1, - 3,1,1,1,1,1,4,0,3,1,1,1,1,1,1,4,0,3,1,1,1,4,0,3,1,1,1,1,1,2,3,1,1,1,2,0,5,1,1,1, - 0,3,1,1,1,1,1,4,0,3,1,1,1,1,1,1,4,0,3,1,1,2,0,5,1,1,1,1,1,4,0,3,1,1,4,5,1,1,1,1, - 0,0,3,1,1,1,1,1,4,0,3,1,1,1,1,1,1,4,0,3,2,0,5,1,1,1,1,1,1,1,4,0,3,1,1,1,1,1,1,2, - 0,0,0,3,1,1,1,1,1,4,0,3,1,1,1,1,1,1,4,0,0,5,1,1,1,1,1,1,1,1,2,0,5,1,1,1,1,1,2,0, - 0,0,0,0,3,1,1,1,1,2,0,0,3,1,1,1,1,1,1,4,5,1,1,1,1,1,1,1,1,2,0,5,1,1,1,1,1,2,0,0, - 4,0,0,0,0,3,1,1,2,0,5,4,5,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,0,5,1,1,1,1,1,2,0,0,0, - 1,4,0,0,0,0,3,2,0,5,1,1,1,2,3,1,1,1,1,1,1,1,1,2,3,1,1,2,0,5,1,1,1,1,1,2,0,0,0,0, - 1,1,4,0,0,0,0,0,5,1,1,1,2,0,5,1,1,1,1,1,1,1,1,4,0,3,2,0,5,1,1,1,1,1,2,0,0,0,0,0, - 1,1,1,4,0,0,0,5,1,1,1,2,0,5,1,2,3,2,3,1,1,1,1,1,4,0,0,0,3,1,1,1,1,2,0,0,0,0,0,0, - 1,1,1,2,0,0,5,1,1,1,2,0,5,1,2,0,0,0,0,3,1,1,1,1,1,4,0,0,0,3,1,1,2,0,0,0,0,0,0,5, - 1,1,2,0,0,5,1,1,1,1,4,0,3,2,0,0,0,0,0,5,1,1,1,1,1,1,4,0,0,0,3,2,0,0,0,0,0,0,5,1, - 1,2,0,0,5,1,1,1,1,1,1,4,0,0,0,0,0,0,5,1,2,3,1,1,1,1,2,0,0,0,0,0,0,0,0,0,0,5,1,1, - 1,4,0,0,3,1,1,1,1,1,1,1,4,0,0,0,0,5,1,2,0,0,3,1,1,2,0,0,5,4,0,0,0,0,0,0,5,1,1,1, - 1,1,4,0,0,3,1,1,1,1,1,1,1,4,0,0,5,1,2,0,0,0,0,3,2,0,0,5,1,1,4,0,0,0,0,5,1,1,1,1, - 1,1,1,4,0,0,3,1,1,1,1,2,3,1,4,5,1,2,0,0,0,0,0,0,0,0,5,1,1,1,1,4,0,0,5,1,1,1,1,1, - 1,1,1,1,4,0,0,3,1,1,2,0,0,3,1,1,2,0,0,0,0,0,0,0,0,5,1,1,1,1,1,1,4,5,1,1,1,2,3,1, - 1,1,1,1,2,0,0,0,3,2,0,0,0,0,3,2,0,0,0,0,0,0,0,0,5,1,2,3,1,1,1,1,1,1,1,1,2,0,0,3, - 1,1,1,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,1,2,0,0,3,1,1,2,3,1,1,2,0,0,0,0, - 1,1,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,1,2,0,0,0,0,3,2,0,0,3,2,0,0,0,0,0, - }; - SDL_memcpy(back, tmap, sizeof(back)); + //Loads the background into the array. + static const short tmap[] = { + 1,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,1,2,0,0,0,0,0,0,0,0,0,0,0,0,5,4,0,0, + 2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,1,2,0,0,0,0,0,0,0,0,0,0,0,0,5,1,1,4,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,1,2,0,0,0,0,0,0,0,0,0,0,0,0,5,1,1,1,1,4, + 0,5,4,0,0,0,0,0,0,5,4,0,0,0,0,0,0,0,0,3,1,4,0,0,0,0,0,0,0,0,0,0,0,5,1,1,1,1,1,2, + 5,1,1,4,0,0,0,0,5,1,1,4,0,0,0,0,0,0,0,0,3,1,4,0,0,0,0,0,0,0,0,0,5,1,1,1,1,1,2,0, + 1,1,1,1,4,0,0,5,1,1,1,1,4,0,0,0,0,0,0,0,0,3,1,4,0,0,0,0,0,0,0,5,1,1,1,1,1,2,0,0, + 1,1,1,1,1,4,5,1,1,1,1,1,1,4,0,0,0,0,0,0,0,0,3,1,4,0,0,0,0,0,0,3,1,1,1,1,1,4,0,0, + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,4,0,0,0,0,0,0,0,0,3,1,4,0,0,0,0,0,0,3,1,1,1,1,1,4,0, + 1,1,1,1,1,1,1,1,2,3,1,1,2,3,1,4,0,0,0,0,0,0,0,0,3,1,4,0,0,0,0,0,0,3,1,1,1,1,1,4, + 1,1,1,1,1,1,1,2,0,0,3,2,0,0,3,2,0,0,0,0,0,0,5,4,5,1,1,4,0,0,0,0,0,0,3,1,1,1,1,1, + 1,1,1,1,1,1,2,0,5,4,0,0,0,0,0,0,0,0,0,0,0,5,1,1,1,1,1,1,4,0,0,0,0,0,0,3,1,1,1,1, + 1,1,1,1,1,1,4,5,1,2,0,0,0,0,0,0,0,0,0,0,0,3,1,1,1,2,3,1,1,4,0,0,0,0,0,0,3,1,1,1, + 1,1,1,1,1,1,1,1,2,0,0,0,0,0,0,0,0,0,0,0,0,0,3,1,1,4,0,3,1,1,4,0,0,0,0,0,0,3,1,1, + 3,1,1,1,1,1,1,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,1,1,2,0,5,1,1,1,4,0,0,0,0,0,0,3,1, + 0,3,1,1,1,1,2,0,0,0,0,0,0,0,0,0,0,0,0,5,4,5,1,1,2,0,0,3,1,1,1,2,0,0,0,0,0,0,0,3, + 0,0,3,1,1,1,4,0,0,0,0,0,5,4,0,0,0,0,5,1,1,1,1,2,0,0,0,0,3,1,2,0,5,4,0,0,0,0,0,0, + 0,0,0,3,1,1,1,4,0,0,0,5,1,2,0,0,0,0,3,1,1,1,1,4,5,4,0,0,5,1,4,5,1,1,4,0,0,0,0,0, + 0,0,0,0,3,1,1,1,4,0,0,3,1,4,0,0,0,0,5,1,1,1,1,1,1,1,4,5,1,1,1,1,1,1,2,0,0,0,0,0, + 0,0,0,0,5,1,1,1,1,4,0,0,3,1,4,5,4,5,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,0,0,0,0,0,0, + 0,0,0,5,1,1,1,1,1,1,4,0,0,3,1,1,1,1,1,1,1,1,2,3,1,1,1,1,1,1,1,1,2,0,0,0,0,0,0,5, + 0,0,5,1,1,1,2,3,1,1,1,4,0,0,3,1,1,1,1,1,1,2,0,0,3,1,1,1,1,1,1,1,4,0,0,0,0,0,5,1, + 0,0,3,1,1,2,0,0,3,1,1,1,4,0,0,3,1,1,1,1,1,4,0,0,0,3,2,3,1,1,1,1,1,4,0,0,0,0,3,1, + 0,0,0,3,2,0,0,0,0,3,2,3,1,4,0,0,3,1,1,1,1,1,4,0,0,0,0,0,3,1,1,2,3,1,4,0,0,0,0,3, + 0,0,0,0,0,0,5,4,0,0,0,0,3,1,4,0,0,3,2,3,1,1,1,4,0,0,0,0,0,3,2,0,0,3,1,4,0,0,0,0, + 0,0,0,0,0,0,3,1,4,0,0,0,0,3,1,4,0,0,0,5,1,1,1,2,0,0,0,0,0,0,0,0,0,0,3,2,0,0,0,0, + 0,0,0,0,0,0,5,1,1,4,5,4,0,0,3,2,0,0,0,3,1,1,2,0,0,5,4,0,0,0,0,5,4,0,0,0,0,0,0,0, + 0,0,0,0,0,5,1,1,1,1,1,2,0,0,0,0,0,0,0,0,3,1,4,0,0,3,1,4,0,0,5,1,1,4,0,0,5,4,0,0, + 0,0,0,0,5,1,1,1,1,1,2,0,0,0,0,0,0,0,0,0,0,3,1,4,0,0,3,1,4,5,1,2,3,1,4,5,1,1,4,0, + 0,0,0,5,1,1,1,1,1,1,4,0,0,0,0,0,0,0,0,0,0,0,3,1,4,0,0,3,1,1,2,0,0,3,1,1,1,1,1,4, + 0,0,0,3,1,1,2,3,1,1,1,4,0,0,0,0,0,0,0,0,0,0,0,3,1,4,0,0,3,2,0,0,0,0,3,1,1,1,1,1, + 4,0,0,0,3,2,0,0,3,1,1,1,4,0,0,0,0,0,0,0,0,0,0,0,3,1,4,0,0,0,0,0,0,0,5,1,1,1,1,1, + 1,4,0,0,0,0,0,0,5,1,1,1,1,4,0,0,0,0,5,4,0,0,0,0,0,3,1,4,0,5,4,0,0,5,1,1,1,1,1,1, + 3,1,4,0,0,0,0,5,1,1,1,1,1,1,4,0,0,0,3,1,4,5,4,0,0,5,1,2,0,3,1,4,5,1,1,1,2,3,1,1, + 0,3,1,4,0,0,5,1,1,1,2,3,1,1,2,0,0,0,0,3,1,1,1,4,5,1,2,0,0,0,3,1,1,1,1,2,0,5,1,1, + 0,5,1,1,4,5,1,1,1,2,0,0,3,2,0,0,0,0,0,5,1,1,1,1,1,2,0,0,0,0,0,3,1,1,2,0,5,1,1,1, + 5,1,1,1,1,1,1,1,1,4,5,4,0,0,0,0,0,0,0,3,1,1,1,1,1,4,0,0,0,0,0,5,1,2,0,0,3,1,1,1, + 1,1,1,2,3,1,1,1,1,1,1,1,4,5,4,0,0,5,4,0,3,1,1,1,1,1,4,0,0,0,5,1,2,0,0,0,0,3,1,1, + 1,1,2,0,0,3,1,1,1,1,1,1,1,1,1,4,5,1,2,0,5,1,1,1,2,3,2,0,0,0,3,1,4,0,0,0,0,0,3,1, + 1,2,0,0,0,0,3,1,1,2,3,1,1,1,1,1,1,2,0,5,1,1,1,1,4,0,0,5,4,0,0,3,1,4,0,0,0,0,0,3, + 2,0,0,0,0,0,5,1,2,0,0,3,1,1,1,1,2,0,5,1,1,1,1,1,1,4,5,1,1,4,0,0,3,1,4,0,0,0,0,0, + 0,0,0,0,0,5,1,2,0,0,0,0,3,1,1,1,4,5,1,1,1,1,1,1,1,1,1,1,1,2,0,0,0,3,2,0,0,0,0,0, + 0,0,0,0,0,3,2,0,0,0,0,0,0,3,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,0,0,0,0,0,0,0,0,0,0,0, + 0,5,4,0,0,0,0,5,4,0,0,0,0,0,3,1,1,1,1,2,3,1,1,1,1,1,1,2,0,0,5,4,0,0,5,4,0,0,0,5, + 5,1,1,4,0,0,5,1,2,0,0,0,0,0,0,3,1,1,2,0,0,3,1,1,1,1,2,0,0,5,1,1,4,5,1,2,0,0,5,1, + 1,1,1,1,4,5,1,2,0,0,0,0,0,0,0,0,3,2,0,0,0,0,3,1,1,2,0,0,5,1,1,1,1,1,2,0,0,5,1,1, + 1,1,1,1,1,1,1,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,1,1,4,0,0,3,1,1,1,1,2,0,0,5,1,1,1, + 1,1,1,1,1,1,1,2,0,5,4,0,0,0,0,0,0,0,0,0,0,5,1,1,1,1,4,0,0,3,1,1,2,0,0,5,1,1,1,1, + 1,1,1,1,1,1,1,4,5,1,2,0,0,0,0,0,0,0,0,0,5,1,1,1,1,1,1,4,0,0,3,1,4,0,0,3,1,1,1,1, + 1,1,1,1,1,1,1,1,1,2,0,0,0,0,0,0,0,0,0,5,1,1,1,1,1,1,1,2,0,0,5,1,1,4,0,0,3,1,1,1, + 1,1,1,1,1,1,1,1,2,0,0,0,0,0,0,0,0,0,5,1,1,1,1,1,1,1,2,0,0,5,1,1,1,2,0,0,5,1,1,1, + 3,1,1,1,1,1,1,2,0,0,0,0,0,5,4,0,0,5,1,1,1,1,1,1,1,2,0,0,5,1,1,1,2,0,0,5,1,1,1,1, + 0,3,1,1,1,1,1,4,0,0,5,4,5,1,1,4,5,1,1,1,1,1,1,1,2,0,0,5,1,1,1,2,0,0,5,1,1,1,1,1, + 0,0,3,1,1,1,1,1,4,5,1,1,1,1,1,1,1,1,1,1,1,1,1,1,4,0,0,3,1,1,2,0,0,5,1,1,1,1,1,1, + 0,0,0,3,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,4,0,0,3,2,0,0,5,1,1,1,1,1,1,1, + 0,0,0,5,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,4,0,0,0,0,0,3,1,1,1,1,1,1,1, + 0,0,5,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,3,1,4,0,0,0,0,0,3,1,1,1,1,1,1, + 0,5,1,1,1,1,1,1,1,1,1,1,1,1,1,2,3,1,1,1,1,1,1,2,0,0,3,1,4,0,0,0,0,5,1,2,3,1,1,1, + 5,1,1,1,1,1,1,1,1,1,1,1,2,3,2,0,0,3,1,1,1,1,2,0,0,0,0,3,1,4,0,0,5,1,2,0,0,3,1,1, + 1,1,1,1,1,1,1,1,1,1,1,1,4,0,0,5,4,0,3,1,1,2,0,0,0,0,0,0,3,1,4,5,1,2,0,0,0,0,3,1, + 1,1,1,1,1,1,1,1,1,1,1,1,1,4,5,1,1,4,0,3,1,4,0,0,0,0,0,0,5,1,1,1,2,0,0,0,0,0,0,3, + 3,1,1,1,1,2,3,1,1,2,3,1,1,1,1,1,1,1,4,0,3,1,4,0,0,0,0,5,1,1,1,2,0,0,0,0,0,0,0,0, + 0,3,1,1,2,0,0,3,2,0,0,3,1,1,1,1,1,1,2,0,0,3,2,0,0,0,5,1,1,1,2,0,0,0,0,0,0,0,0,0, + 0,0,3,2,0,0,0,0,0,0,0,0,3,1,1,1,1,2,0,0,0,0,0,0,0,5,1,1,1,1,4,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,5,1,1,1,2,0,0,0,0,0,0,0,5,1,2,3,1,1,1,4,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,5,1,1,1,1,4,0,0,0,0,0,0,5,1,2,0,0,3,1,1,1,4,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,5,1,1,1,2,3,1,4,0,0,0,0,0,3,2,0,0,0,0,3,1,1,1,4,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,5,1,1,1,2,0,0,3,1,4,0,0,0,0,0,0,0,0,0,0,0,3,1,1,1,4,0,0,0,0,0, + 0,0,0,0,0,0,0,0,5,1,1,1,2,0,0,0,0,3,1,4,0,0,0,0,0,0,0,0,0,0,5,1,1,1,2,0,0,0,0,0, + 0,0,0,0,0,0,0,5,1,1,1,2,0,0,0,0,0,0,3,1,4,0,0,0,0,0,0,0,0,5,1,1,1,2,0,0,0,0,0,0, + 0,0,0,0,0,0,5,1,1,1,2,0,0,0,0,0,0,0,0,3,1,4,0,0,0,0,0,0,5,1,1,1,2,0,0,0,0,0,0,0, + 0,0,0,0,0,5,1,1,1,2,0,0,0,0,0,0,0,0,0,5,1,1,4,0,0,0,0,5,1,1,1,2,0,0,0,0,0,0,0,0, + 0,0,0,0,5,1,1,1,2,0,0,0,0,0,0,0,0,0,5,1,1,1,1,4,0,0,5,1,1,1,2,0,0,0,0,0,0,0,0,0, + 0,0,0,5,1,1,1,2,0,0,0,0,0,0,0,0,0,5,1,1,1,1,1,1,4,5,1,1,1,2,0,0,0,0,0,0,0,0,0,0, + 0,0,5,1,1,1,1,4,0,0,0,0,0,0,0,0,5,1,1,1,1,1,1,1,1,1,1,1,2,0,0,0,0,0,0,0,0,0,0,0, + 0,5,1,1,1,2,3,1,4,0,0,0,0,0,0,5,1,1,1,1,1,1,1,1,1,1,1,2,0,0,0,0,0,0,0,0,0,0,0,0, + 5,1,1,1,2,0,0,3,1,4,0,0,0,0,5,1,1,1,2,3,2,3,2,3,1,1,1,4,0,0,0,0,0,0,0,0,0,0,0,0, + 1,1,1,2,0,0,0,5,1,2,0,0,0,5,1,1,1,2,0,0,0,0,0,0,3,1,1,1,4,0,0,0,0,0,0,0,0,0,0,0, + 1,1,2,0,0,0,5,1,2,0,0,0,5,1,1,1,1,4,0,0,0,0,0,0,0,3,1,1,1,4,0,0,0,0,0,0,0,0,0,0, + 1,2,0,0,0,0,3,1,4,0,0,5,1,1,1,1,1,2,0,0,0,0,0,0,0,5,1,1,1,1,4,0,0,0,0,0,0,0,0,0, + 2,0,0,0,0,0,0,3,1,4,5,1,1,1,1,1,1,4,0,0,0,0,0,0,5,1,2,3,1,1,1,4,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,3,1,1,1,1,1,1,1,1,1,4,5,4,0,0,0,3,2,0,0,3,1,1,1,4,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,5,1,1,1,1,1,1,1,1,1,1,1,2,0,0,0,0,0,0,0,5,1,1,1,1,4,0,0,0,0,0,0, + 0,0,0,0,0,0,0,5,1,2,3,1,1,1,1,1,1,1,1,2,0,0,0,0,0,0,0,5,1,1,1,1,1,1,4,0,0,0,0,0, + 0,0,0,0,0,0,5,1,1,4,0,3,1,1,1,1,1,1,2,0,0,0,0,0,0,0,5,1,1,1,1,1,1,1,2,0,0,0,0,0, + 0,0,0,0,0,0,3,1,1,1,4,0,3,1,1,1,1,2,0,0,0,5,4,0,0,5,1,1,1,1,1,1,1,2,0,5,4,0,0,0, + 0,0,0,0,0,0,0,3,1,1,2,0,5,1,1,1,1,4,0,0,5,1,2,0,5,1,1,1,1,1,1,1,2,0,5,1,1,4,0,0, + 0,0,0,0,0,0,0,5,1,2,0,5,1,1,1,1,1,1,4,0,3,1,4,5,1,1,1,1,1,1,1,2,0,5,1,1,1,1,4,0, + 0,0,0,0,0,0,5,1,2,0,5,1,1,1,1,1,1,1,1,4,0,3,1,1,1,1,1,1,1,1,2,0,5,1,1,1,1,1,1,4, + 0,0,0,0,0,0,3,2,0,0,3,1,1,1,1,2,3,1,1,1,4,0,3,1,1,1,1,1,1,1,4,0,3,1,1,1,1,1,1,1, + 0,0,5,4,0,0,0,0,0,0,0,3,1,1,2,0,5,1,1,1,2,0,0,3,1,1,1,1,1,1,1,4,0,3,1,1,1,1,1,1, + 0,5,1,1,4,0,0,0,0,0,0,0,3,2,0,5,1,1,1,1,4,0,0,0,3,1,1,1,1,1,1,1,4,0,3,1,1,1,1,2, + 0,3,1,1,1,4,0,0,0,0,0,0,0,0,5,1,1,1,1,1,1,4,0,0,0,3,1,1,1,1,1,1,1,4,5,1,1,1,2,0, + 0,0,3,1,1,1,4,0,0,0,0,0,0,0,3,1,1,1,1,1,1,2,0,5,4,0,3,1,1,1,1,1,1,1,1,1,1,2,0,0, + 0,0,0,3,1,1,1,4,0,0,0,0,0,0,0,3,1,1,1,1,2,0,5,1,2,0,5,1,1,1,1,1,1,1,1,1,2,0,0,0, + 0,0,0,5,1,1,1,2,0,0,0,0,0,0,0,5,1,1,1,1,4,5,1,2,0,5,1,2,3,1,1,1,1,1,1,1,4,0,0,0, + 0,0,5,1,1,1,2,0,5,4,0,0,0,0,5,1,1,1,1,1,1,1,2,0,0,3,2,0,5,1,1,1,1,1,1,1,1,4,0,0, + 0,5,1,1,1,2,0,0,3,1,4,0,0,5,1,1,1,1,1,1,1,2,0,5,4,0,0,0,3,1,1,1,1,1,1,1,1,1,4,0, + 5,1,1,1,2,0,5,4,0,3,1,4,0,3,1,1,1,1,1,1,2,0,5,1,1,4,5,4,0,3,1,1,1,1,2,3,1,1,1,4, + 1,1,1,2,0,5,1,1,4,0,3,1,4,0,3,1,1,1,1,2,0,5,1,1,1,1,1,1,4,5,1,1,1,2,0,0,3,1,1,1, + 1,1,1,4,5,1,1,1,1,4,5,1,1,4,0,3,1,1,1,4,0,3,1,1,1,1,1,1,1,1,1,1,1,4,0,0,0,3,1,1, + 1,1,1,1,1,1,2,3,1,1,1,1,1,1,4,0,3,1,1,1,4,0,3,1,1,1,1,1,1,1,1,1,1,1,4,0,0,5,1,1, + 3,1,1,1,1,1,4,0,3,1,1,1,1,1,1,4,0,3,1,1,1,4,0,3,1,1,1,1,1,2,3,1,1,1,2,0,5,1,1,1, + 0,3,1,1,1,1,1,4,0,3,1,1,1,1,1,1,4,0,3,1,1,2,0,5,1,1,1,1,1,4,0,3,1,1,4,5,1,1,1,1, + 0,0,3,1,1,1,1,1,4,0,3,1,1,1,1,1,1,4,0,3,2,0,5,1,1,1,1,1,1,1,4,0,3,1,1,1,1,1,1,2, + 0,0,0,3,1,1,1,1,1,4,0,3,1,1,1,1,1,1,4,0,0,5,1,1,1,1,1,1,1,1,2,0,5,1,1,1,1,1,2,0, + 0,0,0,0,3,1,1,1,1,2,0,0,3,1,1,1,1,1,1,4,5,1,1,1,1,1,1,1,1,2,0,5,1,1,1,1,1,2,0,0, + 4,0,0,0,0,3,1,1,2,0,5,4,5,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,0,5,1,1,1,1,1,2,0,0,0, + 1,4,0,0,0,0,3,2,0,5,1,1,1,2,3,1,1,1,1,1,1,1,1,2,3,1,1,2,0,5,1,1,1,1,1,2,0,0,0,0, + 1,1,4,0,0,0,0,0,5,1,1,1,2,0,5,1,1,1,1,1,1,1,1,4,0,3,2,0,5,1,1,1,1,1,2,0,0,0,0,0, + 1,1,1,4,0,0,0,5,1,1,1,2,0,5,1,2,3,2,3,1,1,1,1,1,4,0,0,0,3,1,1,1,1,2,0,0,0,0,0,0, + 1,1,1,2,0,0,5,1,1,1,2,0,5,1,2,0,0,0,0,3,1,1,1,1,1,4,0,0,0,3,1,1,2,0,0,0,0,0,0,5, + 1,1,2,0,0,5,1,1,1,1,4,0,3,2,0,0,0,0,0,5,1,1,1,1,1,1,4,0,0,0,3,2,0,0,0,0,0,0,5,1, + 1,2,0,0,5,1,1,1,1,1,1,4,0,0,0,0,0,0,5,1,2,3,1,1,1,1,2,0,0,0,0,0,0,0,0,0,0,5,1,1, + 1,4,0,0,3,1,1,1,1,1,1,1,4,0,0,0,0,5,1,2,0,0,3,1,1,2,0,0,5,4,0,0,0,0,0,0,5,1,1,1, + 1,1,4,0,0,3,1,1,1,1,1,1,1,4,0,0,5,1,2,0,0,0,0,3,2,0,0,5,1,1,4,0,0,0,0,5,1,1,1,1, + 1,1,1,4,0,0,3,1,1,1,1,2,3,1,4,5,1,2,0,0,0,0,0,0,0,0,5,1,1,1,1,4,0,0,5,1,1,1,1,1, + 1,1,1,1,4,0,0,3,1,1,2,0,0,3,1,1,2,0,0,0,0,0,0,0,0,5,1,1,1,1,1,1,4,5,1,1,1,2,3,1, + 1,1,1,1,2,0,0,0,3,2,0,0,0,0,3,2,0,0,0,0,0,0,0,0,5,1,2,3,1,1,1,1,1,1,1,1,2,0,0,3, + 1,1,1,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,1,2,0,0,3,1,1,2,3,1,1,2,0,0,0,0, + 1,1,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,1,2,0,0,0,0,3,2,0,0,3,2,0,0,0,0,0, + }; + SDL_memcpy(back, tmap, sizeof(back)); } void towerclass::loadmap(void) { - //Loads the map into the array. + //Loads the map into the array. #if !defined(MAKEANDPLAY) - static const short tmap[] = { - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,13,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, - 12,12,12,12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28, - 12,12,12,12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28, - 12,12,12,12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28, - 12,12,12,12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28, - 12,12,12,12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28, - 12,12,12,12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28, - 12,12,12,12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28, - 12,12,12,12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28, - 12,12,12,12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28, - 12,12,12,12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28, - 12,12,12,12,12,12,12,12,12,12,12,15,18,18,18,18,18,19,28,28,28,28,17,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,23,23,24,28,28,28,28,22,23,23,14,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,28,0,0,28,28,28,28,0,0,28,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,28,0,0,28,28,28,28,0,0,28,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,28,0,0,0,28,28,0,0,0,28,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,13,23,23,24,28,0,0,17,18,18,19,0,0,28,22,23,23,14,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,22,23,23,24,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,15,18,18,18,18,19,0,0,28,28,0,0,17,18,18,18,18,16,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,13,23,23,23,23,24,0,0,28,28,0,0,22,23,23,23,23,14,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,17,18,18,19,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,22,14,13,24,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,22,24,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,15,18,18,18,18,19,10,0,28,28,0,11,17,18,18,18,18,16,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,13,23,23,23,23,24,0,0,28,28,0,0,22,23,23,23,23,14,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,15,18,18,18,18,18,18,18,18,18,18,19,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,13,23,23,23,23,23,23,23,23,23,23,24,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,17,18,18,18,18,18,18,18,18,18,18,16,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,22,23,23,23,23,23,23,23,23,23,23,14,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,15,18,18,18,18,18,18,18,18,18,18,18,19,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,13,23,23,23,23,23,23,23,23,23,23,23,24,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,17,18,18,18,18,18,18,18,18,18,18,16,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,22,23,23,23,23,23,14,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,15,18,18,18,18,18,19,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,10,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,10,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,10,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,10,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,24,10,28,28,0,11,22,14,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,11,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,11,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,11,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,11,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,11,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,24,10,0,28,28,0,0,11,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,10,0,0,28,28,0,11,17,16,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,10,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,10,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,10,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,10,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,13,23,23,23,24,0,0,0,28,28,0,0,22,23,23,23,23,14,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,11,17,18,18,18,18,19,10,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,22,23,23,23,23,24,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,15,18,18,18,18,19,10,0,28,28,0,11,17,18,18,18,18,16,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,13,23,23,23,23,24,0,0,28,28,0,0,22,23,23,23,23,14,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,11,17,18,18,19,10,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,22,23,23,24,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,15,18,18,19,28,0,0,0,28,28,0,0,0,28,17,18,18,16,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,28,0,0,0,28,28,0,0,0,28,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,28,0,0,0,28,28,0,0,0,28,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,28,0,0,0,28,28,0,0,0,28,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,28,0,0,0,28,28,0,0,0,28,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,28,0,0,28,28,28,28,0,0,28,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,15,18,18,19,28,28,28,28,17,18,18,16,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,13,23,23,23,23,23,23,23,23,23,23,23,24,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,21,28,28,28,17,18,18,18,18,18,18,18,18,18,18,18,18,16,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,21,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,21,28,28,28,20,12,12,12,12,12,12,12,13,23,23,23,23,23,23,23,23,23,23,14,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,21,28,28,28,20,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,21,28,28,28,20,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,21,28,28,28,20,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,21,28,28,28,20,12,12,12,12,13,23,23,24,0,0,0,0,0,0,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,21,28,28,28,20,12,12,12,12,21,0,0,0,0,0,0,0,0,0,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,21,28,28,28,20,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,28,28,20,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,21,28,28,28,20,12,12,12,12,21,0,0,0,0,0,0,0,8,8,0,0,28,28,20,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,21,28,28,28,20,12,13,23,23,24,0,0,0,0,0,0,8,17,19,0,0,28,28,20,12,12,12,12,12,12,12,12,12,12,12, - 23,23,23,23,23,24,28,28,28,20,12,21,28,28,28,0,0,0,0,0,8,17,16,21,0,0,28,28,22,23,23,23,23,23,23,23,23,23,23,23, - 28,28,28,28,28,28,28,28,28,20,12,21,28,28,28,0,0,0,0,8,17,16,12,21,0,0,28,28,28,28,28,28,28,28,28,28,28,28,28,28, - 28,28,28,28,28,28,28,28,28,20,12,21,28,28,28,0,0,0,8,17,16,12,12,21,0,0,28,28,28,28,28,28,28,28,28,28,28,28,28,28, - 28,28,28,28,28,28,28,28,28,20,12,21,28,28,28,0,0,8,17,16,12,12,12,21,0,0,28,28,28,28,28,28,28,28,28,28,28,28,28,28, - 18,18,18,18,18,18,18,18,18,16,12,21,28,28,28,0,0,17,16,12,12,12,12,15,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18, - 12,12,12,12,12,12,12,12,12,12,12,21,28,28,28,0,0,22,14,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,21,28,28,28,0,0,7,22,14,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,21,28,28,28,0,0,28,7,22,14,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,21,28,28,28,0,0,28,28,9,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,21,28,28,28,0,0,28,28,0,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,21,28,28,28,0,0,28,28,0,22,23,23,23,23,14,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,21,28,28,28,0,0,28,28,0,28,28,0,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,21,28,28,28,0,0,28,28,0,28,28,0,28,28,22,14,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,21,28,28,28,0,0,28,28,0,28,28,0,28,28,7,22,14,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,21,28,28,28,0,0,28,28,0,28,28,0,28,28,28,7,22,14,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,21,28,28,28,0,0,28,28,0,28,28,0,28,28,28,28,7,20,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,21,6,28,28,0,0,28,28,0,28,28,0,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,15,19,6,28,0,0,17,18,19,28,28,0,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,15,19,6,0,0,20,12,21,28,28,0,28,28,28,28,28,22,23,23,23,23,14,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,15,19,8,0,20,12,21,28,28,0,28,28,28,28,28,28,28,0,0,0,20,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,15,19,8,20,12,21,28,28,0,28,28,28,28,28,28,28,0,0,0,20,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,15,18,16,12,21,28,28,0,28,28,28,0,0,0,0,0,0,0,22,14,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,28,28,0,28,28,28,0,0,0,0,0,0,0,0,20,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,6,28,0,28,28,28,0,0,0,0,0,0,0,0,20,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,15,19,6,0,17,18,18,19,0,0,0,0,0,0,0,22,14,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,15,19,8,20,12,12,21,0,0,0,0,0,0,0,28,20,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,15,18,16,12,12,21,10,0,0,0,0,0,0,28,22,14,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,10,0,0,0,0,0,0,28,28,20,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,15,19,10,0,0,0,0,0,28,28,22,14,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,10,0,0,0,0,0,28,28,28,20,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,15,19,10,0,0,0,0,28,28,28,20,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,10,0,0,0,0,28,28,28,20,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,10,0,0,0,0,28,28,28,20,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,24,10,0,0,0,28,28,28,28,20,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,10,0,0,0,0,28,28,28,28,20,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,24,10,0,0,0,28,28,28,28,17,16,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,10,0,0,0,0,28,28,28,28,20,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,24,10,0,0,0,28,28,28,28,17,16,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,10,0,0,0,0,28,28,28,28,20,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,23,23,23,23,23,23,23,24,0,0,0,0,28,28,28,28,17,16,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,24,0,0,0,28,28,28,0,0,0,0,0,0,28,28,28,28,20,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,24,7,0,0,0,28,28,28,0,0,0,0,28,28,28,28,28,17,16,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,24,7,28,0,0,0,28,28,28,0,0,0,0,28,28,28,28,28,20,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,13,24,7,28,28,0,0,0,28,28,28,0,0,0,0,28,28,28,28,17,16,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,13,24,9,28,28,28,0,0,0,28,28,28,0,0,0,0,28,28,28,28,20,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,21,9,0,28,28,28,0,0,0,28,28,28,0,0,0,0,28,28,28,17,16,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,21,0,0,28,28,28,0,0,0,28,28,28,0,0,0,0,28,28,28,20,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,13,23,23,23,24,0,0,28,28,28,0,0,0,28,28,28,0,0,0,17,18,18,18,16,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,28,28,28,0,0,0,28,28,28,0,0,0,28,28,28,0,0,0,20,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,28,28,28,0,0,0,28,28,28,0,0,0,28,28,28,0,0,8,20,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,28,28,28,0,0,0,28,28,28,0,0,0,28,28,28,0,8,17,16,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,28,28,28,0,0,0,28,28,28,0,0,0,28,28,28,8,17,16,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,28,28,28,0,0,0,28,28,28,0,0,0,28,28,6,17,16,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,28,28,28,0,0,0,28,28,28,0,0,0,28,6,17,16,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,28,28,28,0,0,0,28,28,28,0,0,0,28,17,16,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,28,28,28,0,0,17,18,18,18,18,18,18,18,16,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,28,28,28,0,0,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,28,28,28,0,0,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,28,28,28,0,0,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,28,28,28,0,0,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,28,28,28,0,0,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,28,28,28,0,0,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,28,28,28,0,8,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,28,28,28,8,17,16,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,28,28,28,17,16,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 23,23,23,23,23,14,12,12,21,28,28,28,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, - 28,28,28,28,28,20,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28, - 28,28,28,28,28,20,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28, - 28,28,28,28,28,20,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28, - 28,28,28,28,28,20,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28, - 18,19,28,28,28,20,12,12,15,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18, - 12,21,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 23,24,28,28,28,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, - 7,7,28,28,28,28,28,28,28,28,28,28,28,28,28,28,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, - 28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28, - 28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28, - 28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28, - 28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28, - 28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28, - 28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28, - 28,28,0,0,0,0,0,8,8,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28, - 28,28,0,0,0,0,0,17,18,19,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28, - 0,0,0,0,0,0,0,22,23,24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,28,28,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,28,28,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,28,28,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,8,8,8,0,0,0,28,28,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,17,18,19,0,0,0,0,28,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,22,23,24,0,0,0,0,28,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,28,28,28,0,0,0,0,28,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,28,28,28,0,0,0,0,28,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,28,28,28,0,0,0,0,28,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,28,28,28,0,0,0,0,28,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,8,8,0,0, - 0,0,28,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,17,18,19,0,0, - 0,0,28,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,22,23,24,0,0, - 0,0,28,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,0,0, - 0,0,28,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,0,0, - 0,0,28,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,0,0, - 0,0,28,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,8,8,0,0,0,28,28,28,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,17,18,19,0,0,0,0,28,28,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,22,23,24,0,0,0,0,28,28,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,0,0,0,0,28,28,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,0,0,0,0,28,28,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,0,0,0,0,28,28,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,0,0,0,0,28,28,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,8,8,8,8,8,8,8,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,17,18,18,18,18,18,18,19,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,22,23,23,23,23,23,23,24,10,0,0,0,0,0,0,0,0,0,0,28,28,0,0,28,28,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,7,7,7,7,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,28,28,0,0,28,28,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,28,28,28,28,28,0,0,28,28,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,0,0,0,0,0,0,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,0,0,0,0,0,0,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,0,0,0,0,0,0,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,0,0,0,0,28,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,0,0,0,0,28,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,0,0,0,0,28,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,0,0,0,0,28,28,28,28,28,6,6,6,6,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,17,18,18,18,18,18,18,18,19,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,22,23,23,23,23,23,23,23,24,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,7,7,7,7,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,17,18,19,0,0,0,0,0,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,22,23,24,0,0,0,0,0,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,7,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,0,0,0,0,0,0,0,0,0,8,8,8,8,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,0,0,0,0,0,0,0,0,0,17,18,18,19,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,0,0,0,0,0,0,0,0,0,22,23,23,24,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,0,0,0,0,0,0,0,0,0,0, - 8,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,0,0,8,8,8,8,8,8,8,8, - 18,19,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,0,0,17,18,18,18,18,18,18,18, - 12,21,8,8,8,8,8,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,0,0,22,23,23,23,23,23,14,12, - 12,15,18,18,18,18,18,19,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,0,0,28,28,28,28,28,28,20,12, - 12,12,12,12,12,12,12,21,8,8,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,0,0,28,28,28,28,28,28,20,12, - 12,12,12,12,12,12,12,15,18,18,19,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,0,0,28,28,28,28,28,28,20,12, - 23,23,14,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,0,0,28,28,28,28,28,28,22,23, - 28,28,20,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,0,0,0,0,28,28,28,28,28,28, - 28,28,22,23,23,23,23,14,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,0,0,0,0,28,28,28,28,28,28, - 28,28,28,28,28,28,28,20,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,0,0,0,0,0,0,28,28,28,28, - 28,28,28,28,28,28,28,20,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,0,0,0,0,0,0,28,28,28,28, - 28,28,28,28,28,28,28,20,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,0,0,0,0,0,0,0,0,28,28, - 28,28,28,28,28,28,28,22,23,23,24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,0,0,0,0,0,0,0,0,28,28, - 0,0,0,0,0,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 8,8,8,0,0,0,0,0,0,28,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,8,8, - 18,18,19,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,17,18,18, - 12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,8,8,8,8,8,8,0,0,0,0,0,0,0,0,0,0,0,20,12,12, - 12,12,21,28,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,17,18,18,18,18,18,19,0,0,0,0,0,0,0,0,0,0,0,20,12,12, - 12,12,21,28,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,22,23,23,23,23,23,24,0,0,0,0,0,0,0,0,0,0,0,20,12,12, - 12,12,21,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,20,12,12, - 12,12,21,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,20,12,12, - 12,12,21,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,20,12,12, - 12,12,21,6,6,6,6,6,6,28,28,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,20,12,12, - 12,12,15,18,18,18,18,18,19,28,28,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,0,0,0,0,0,8,8,8,8,8,8,20,12,12, - 12,12,12,12,12,12,12,12,21,28,28,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,0,0,0,0,0,17,18,18,18,18,18,16,12,12, - 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,0,0,0,0,0,20,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,8,20,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,17,18,16,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,22,23,14,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,20,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,20,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,0,0,0,0,0,20,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,0,0,0,0,0,20,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,0,0,0,0,0,20,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,0,0,0,0,0,20,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,0,0,0,0,0,20,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,28,28,28,0,0,28,28,0,0,0,0,0,20,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,28,28,28,0,0,0,0,28,0,0,0,0,0,20,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,28,28,28,0,0,0,0,0,0,0,0,0,28,28,20,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,28,28,28,0,0,0,0,0,0,0,0,0,0,28,28,20,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,28,28,28,0,0,0,0,0,0,0,0,0,0,0,28,28,20,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,28,28,0,0,0,0,0,0,0,0,0,0,0,0,28,28,20,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,20,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,20,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,20,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,20,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,20,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,20,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,8,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,15,18,19,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,13,23,24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,8,8,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,15,18,19,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,13,23,24,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,0,0,0,0,0,8,8,8,8,8,6,6,6,6,6,6,6,6,6,6,6,6,20,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,0,0,0,0,0,17,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,16,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,0,0,0,0,0,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,0,0,0,0,0,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,0,0,0,0,0,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,0,0,0,0,0,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,0,0,0,0,0,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,0,0,0,0,0,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,0,0,0,0,0,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,8,8,0,0,0,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,15,18,19,0,0,0,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,13,23,24,0,0,0,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,0,0,0,0,0,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,0,0,0,0,0,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,0,0,0,0,0,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,0,0,0,0,0,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,0,0,0,0,0,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,0,0,0,0,0,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,0,0,0,0,0,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,0,0,0,8,8,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,0,0,0,17,18,16,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,13,23,23,23,23,23,14,21,0,0,0,20,12,12,12,13,23,14,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,21,9,9,9,9,9,20,21,0,0,0,20,12,12,12,21,9,22,14,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,21,0,0,0,0,0,20,21,0,0,0,20,12,12,12,21,0,9,22,14,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,21,0,0,0,0,0,20,21,0,0,0,22,23,23,23,24,0,0,9,22,14,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,21,0,0,0,0,0,20,21,0,0,0,0,0,0,0,0,0,0,0,9,20,12,12,12,12,12,12,12,12,12,12,12,13,23,23,23,23,14,12, - 23,24,0,0,0,0,0,20,21,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12,12,12,12,12,12,12,21,0,0,0,0,22,23, - 0,0,0,0,0,0,0,20,21,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12,12,12,12,12,12,12,21,0,0,0,0,0,0, - 0,0,0,0,0,0,0,22,24,0,0,0,0,0,0,0,0,0,0,0,0,22,23,23,23,23,14,12,12,12,12,12,12,21,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12,12,21,0,0,0,0,0,0, - 18,18,18,19,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12,12,15,19,0,0,17,18,18, - 12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12,12,13,24,0,0,20,12,12, - 12,12,12,15,18,18,18,18,18,18,18,19,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12,12,21,0,0,0,20,12,12, - 12,12,12,12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12,12,21,0,0,0,20,12,12, - 12,12,12,12,12,12,12,12,12,12,12,21,8,0,0,0,0,0,0,0,0,0,0,0,0,0,22,23,23,23,23,14,12,21,0,0,0,20,12,12, - 12,12,12,12,12,12,12,12,12,12,12,15,19,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,20,12,21,0,0,17,16,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,15,19,8,0,0,17,18,18,18,19,0,0,0,0,0,0,0,0,11,20,12,21,0,0,22,23,23,14, - 12,12,12,12,12,12,12,12,12,12,12,12,12,15,19,8,0,20,12,12,12,21,0,0,0,0,0,0,0,0,11,20,12,21,0,0,0,0,0,20, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,15,19,8,20,12,12,12,21,8,8,8,8,0,0,0,0,11,20,12,21,0,0,0,0,0,20, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,15,18,16,12,12,12,15,18,18,18,19,10,0,0,0,11,20,12,21,0,0,0,0,0,20, - 23,23,23,23,14,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,10,0,0,0,11,20,12,21,0,0,0,0,0,22, - 9,9,9,9,22,14,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,10,0,0,0,11,20,12,21,0,0,0,0,0,9, - 0,0,0,0,11,22,14,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,10,0,0,0,11,20,12,21,0,0,0,0,0,0, - 0,0,0,0,0,11,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,10,0,0,0,11,20,12,15,18,18,19,0,0,0, - 0,0,0,0,0,11,22,14,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,10,0,0,0,11,20,12,12,12,13,24,0,0,0, - 0,0,0,0,0,0,11,20,12,13,23,23,23,23,23,23,23,23,14,12,12,12,12,12,12,21,10,0,0,0,11,20,12,12,13,24,0,0,0,0, - 0,0,0,0,0,0,11,20,13,24,9,9,9,9,9,9,9,9,20,12,12,12,12,12,12,21,10,0,0,0,11,20,12,12,21,10,0,0,0,0, - 0,0,0,0,0,0,11,20,21,10,0,0,0,0,0,0,0,0,20,12,12,12,12,12,12,21,10,0,0,0,11,20,12,12,21,10,0,0,0,0, - 0,0,0,0,0,0,11,20,21,10,0,0,0,0,0,0,0,0,22,23,23,23,23,23,23,24,10,0,0,0,11,20,12,12,21,10,0,0,0,0, - 0,0,0,0,0,0,11,20,21,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,20,12,12,21,10,0,0,0,0, - 0,0,0,0,0,0,11,20,21,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,20,12,12,21,10,0,0,0,0, - 0,0,0,0,0,0,11,20,21,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,20,12,12,21,10,0,0,0,0, - 0,0,0,0,0,0,11,20,21,10,0,0,0,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,11,20,12,12,21,10,0,0,0,0, - 0,0,0,0,0,0,11,20,21,10,0,0,0,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,17,16,12,12,21,10,0,0,0,0, - 0,0,0,0,0,0,11,20,21,10,0,28,28,28,28,28,28,28,28,28,0,0,17,18,18,18,18,18,18,18,16,12,12,12,21,10,0,0,0,0, - 0,0,0,0,0,0,17,16,21,10,0,28,28,28,28,28,28,28,28,28,0,0,20,12,12,12,12,12,12,12,12,12,12,12,21,10,0,0,0,0, - 0,0,0,0,0,17,16,12,21,10,0,28,28,28,28,28,28,28,28,28,0,0,20,12,12,12,12,12,12,12,12,12,12,12,21,10,0,0,0,0, - 0,0,0,0,0,22,14,12,15,19,8,6,6,6,6,6,6,6,28,28,0,0,20,12,12,12,12,12,12,12,12,12,12,12,21,10,0,0,0,0, - 0,0,0,0,0,0,22,14,12,15,18,18,18,18,18,18,18,19,28,28,0,0,20,12,12,12,12,12,12,12,12,12,12,12,21,10,0,0,0,0, - 0,0,0,0,0,0,11,20,12,12,12,12,12,12,12,12,12,21,28,28,0,0,20,12,12,12,12,12,12,12,12,12,12,12,21,10,0,0,0,0, - 0,0,0,0,0,0,11,20,12,12,12,12,12,12,12,12,12,21,28,28,0,0,20,12,12,12,12,12,12,12,12,12,12,12,21,10,0,0,0,0, - 0,0,0,0,0,0,11,20,12,12,12,12,12,12,12,12,12,21,28,28,0,0,20,12,12,12,12,12,12,12,12,12,12,12,21,10,0,0,0,0, - 0,0,0,0,0,0,11,20,12,12,12,12,12,12,12,12,12,21,0,0,0,0,20,12,12,12,12,12,12,12,12,12,12,12,21,10,0,0,0,0, - 0,0,0,0,0,0,11,20,12,12,12,12,12,12,12,12,12,21,0,0,0,0,20,12,12,12,12,12,12,12,12,12,12,12,21,10,0,0,0,0, - 0,0,0,0,0,0,11,20,12,12,12,12,12,13,23,23,23,24,0,0,0,0,20,12,12,12,12,12,12,12,12,12,12,12,21,10,0,0,0,0, - 0,0,0,0,0,0,11,20,12,13,23,23,23,24,28,28,0,0,0,0,0,0,20,12,12,12,12,12,12,12,12,12,12,12,15,19,0,0,0,0, - 0,0,0,0,0,0,11,20,12,21,28,28,28,28,28,28,0,0,0,0,0,0,20,12,12,12,12,12,12,12,12,12,12,12,12,15,18,19,0,0, - 18,18,19,0,0,0,11,20,12,21,28,28,28,28,28,28,0,0,0,0,0,0,20,12,12,12,12,12,12,13,23,23,23,23,14,12,12,15,18,18, - 12,12,21,0,0,0,11,20,12,21,28,28,28,28,28,28,28,28,0,0,0,0,20,12,12,12,12,12,12,21,28,28,28,28,22,23,23,23,14,12, - 23,23,24,0,0,0,11,20,12,21,28,28,28,28,28,28,28,28,0,0,0,0,20,12,12,12,12,12,12,21,28,28,28,28,0,0,0,0,22,23, - 0,0,0,0,0,0,11,20,12,21,28,28,28,28,17,18,18,19,0,0,0,0,20,12,12,12,12,12,12,21,28,28,28,28,0,0,0,0,0,0, - 0,0,0,0,0,0,11,20,12,21,28,28,28,28,20,12,12,15,18,18,18,18,16,12,12,12,12,12,12,21,28,28,28,28,0,0,0,0,0,0, - 0,0,0,0,0,0,11,20,12,21,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,28,28,28,28,0,0,0,0,0,0, - 0,0,0,0,0,0,11,20,12,21,28,28,28,28,22,23,23,23,14,12,12,12,12,12,12,12,12,12,12,21,28,28,28,28,0,0,0,0,0,0, - 0,0,0,0,0,0,11,20,12,21,28,28,28,28,28,28,28,28,22,23,23,23,14,12,12,12,12,12,12,21,28,28,28,28,0,0,0,0,0,0, - 0,0,0,0,0,0,11,20,12,21,28,28,28,28,28,28,28,28,28,28,0,0,22,23,23,23,14,12,12,21,28,28,28,28,17,18,18,19,0,0, - 18,19,0,0,0,0,11,20,12,21,28,28,28,28,28,28,28,28,28,28,0,0,0,0,0,0,20,12,12,21,28,28,28,28,20,12,12,15,18,18, - 12,15,18,18,18,18,18,16,12,21,28,28,28,28,28,28,28,28,28,28,0,0,0,0,0,0,20,12,12,21,28,28,28,28,20,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,0,0,0,0,0,0,20,12,12,21,28,28,28,28,22,23,23,23,14,12, - 23,23,14,12,12,12,12,12,12,15,18,18,18,19,28,28,28,28,28,28,0,0,0,0,0,0,20,12,12,21,28,28,28,28,0,0,0,0,22,23, - 0,0,22,23,23,23,14,12,12,12,12,12,12,21,28,28,28,28,6,6,8,8,0,0,0,0,20,12,12,21,28,28,28,28,0,0,0,0,0,0, - 0,0,0,0,0,0,22,23,23,23,14,12,12,21,28,28,28,28,17,18,18,19,0,0,0,0,20,12,12,21,28,28,28,28,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,28,28,22,23,23,24,28,28,28,28,20,12,12,21,0,0,0,0,20,12,12,21,28,28,28,28,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,28,28,20,12,12,21,0,0,0,0,20,12,12,21,6,6,6,6,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,28,28,20,12,12,21,28,28,0,0,20,12,12,15,18,18,18,19,8,8,8,8,0,0, - 8,8,0,0,0,0,0,0,28,28,28,28,28,28,28,28,28,28,20,12,12,21,28,28,0,0,20,12,12,12,12,12,12,15,18,18,18,19,8,8, - 18,19,8,8,8,8,0,0,28,28,28,28,28,28,28,28,28,28,20,12,12,21,28,28,0,0,22,23,23,23,14,12,12,12,12,12,12,15,18,18, - 12,15,18,18,18,19,0,0,28,28,28,28,28,28,28,28,28,28,20,12,12,21,28,28,0,0,0,0,0,0,22,23,23,23,14,12,12,12,12,12, - 12,12,12,12,12,15,18,18,18,19,28,28,28,28,28,28,28,28,20,12,12,21,28,28,0,0,0,0,0,0,28,28,28,28,22,23,23,23,14,12, - 12,12,12,12,12,12,12,12,12,15,18,18,18,19,28,28,28,28,20,12,12,21,28,28,0,0,0,0,0,0,28,28,28,28,28,28,28,28,20,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,15,18,18,18,18,16,12,12,21,28,28,0,0,0,0,0,0,0,0,28,28,28,28,28,28,20,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,6,6,8,8,0,0,0,0,0,0,28,28,28,28,28,28,20,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,15,18,18,18,19,8,8,8,8,0,0,28,28,28,28,28,28,20,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,15,18,18,18,19,0,0,28,28,28,28,28,28,20,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,15,18,18,18,19,28,28,28,28,20,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,28,28,28,28,20,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,28,28,28,28,20,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,28,28,28,28,20,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,28,28,28,28,20,12, - 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,14,21,28,28,28,28,22,23, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,28,28,28,28,28,0,0,0,0,11,20,21,28,28,28,28,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,28,28,28,28,28,0,0,0,0,11,20,21,28,28,28,28,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,0,0,11,20,21,28,28,28,28,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,0,0,11,20,21,28,28,28,28,0,0, - 18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,19,28,28,0,0,11,20,15,18,18,18,18,18,18, - 12,12,12,13,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,28,28,0,0,11,20,12,12,12,12,12,12,12, - 12,12,12,21,10,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,0,0,11,20,12,12,12,12,12,12,12, - 12,12,12,21,10,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,0,0,11,20,12,12,12,12,12,12,12, - 12,12,12,21,10,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,0,0,11,20,12,12,12,12,12,12,12, - 12,12,12,21,10,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,0,0,11,20,12,12,12,12,12,12,12, - 12,12,12,21,10,0,0,0,0,17,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,16,12,12,12,12,12,12,12, - 12,12,12,21,10,0,0,0,0,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,14,12,12,12,12,12,12,12, - 12,12,12,21,10,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,28,28,28,28,28,28,0,0,0,0,0,11,20,12,12,12,12,12,12,12, - 12,12,12,21,10,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,28,28,28,28,28,28,0,0,0,0,0,11,20,12,12,12,12,12,12,12, - 12,12,12,21,10,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,28,28,28,28,28,28,0,0,0,0,0,11,20,12,12,12,12,12,12,12, - 12,12,12,21,10,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,28,28,28,28,28,28,0,0,0,0,0,11,20,12,12,12,12,12,12,12, - 12,12,12,15,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,19,0,0,0,0,11,20,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,13,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,0,0,0,0,11,20,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,21,10,0,0,0,0,0,0,0,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,11,20,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,21,10,0,0,0,0,0,0,0,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,11,20,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,21,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,20,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,21,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,20,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,21,10,0,0,0,0,17,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,16,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,21,10,0,0,0,0,22,23,23,23,23,23,23,23,23,23,23,23,23,23,14,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,21,10,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,21,10,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,21,10,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,21,10,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,15,18,18,18,18,18,18,18,18,18,18,18,18,18,18,19,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,13,23,23,23,23,23,23,23,23,23,24,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,21,0,0,0,0,17,18,18,18,18,18,18,18,18,18,16,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,21,0,0,0,0,22,23,23,23,23,14,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,22,23,23,23,23,23,23,14,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,22,23,23,14,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12,12,12, - 12,13,23,23,23,23,23,23,23,23,23,23,24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12,12,12, - 12,21,28,28,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12,12,12, - 12,21,28,28,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12,12,12, - 12,21,28,28,28,28,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12,12,12, - 12,21,28,28,28,28,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12,12,12, - 12,21,28,28,28,28,6,6,6,6,6,6,6,6,8,8,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12,12,12, - 12,21,28,28,28,28,17,18,18,18,18,18,18,18,18,18,19,0,0,0,0,0,0,17,18,18,19,0,0,0,0,0,20,12,12,12,12,12,12,12, - 12,21,28,28,28,28,20,12,12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,22,23,23,24,0,0,0,0,0,20,12,12,12,12,12,12,12, - 12,21,28,28,28,28,20,12,13,23,23,23,23,23,23,23,24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12,12,12, - 12,21,28,28,28,28,20,12,21,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12,12,12, - 12,21,28,28,28,28,20,12,21,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12,12,12, - 12,21,28,28,28,28,20,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12,12,12, - 12,21,28,28,28,28,20,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,17,18,16,12,12,12,12,12,12,12, - 12,21,28,28,28,28,20,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,0,0,0,0,0,0,22,23,23,23,23,23,14,12,12,12, - 12,21,28,28,28,28,20,12,21,28,28,28,28,28,28,28,28,28,6,6,6,6,28,28,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12, - 12,21,28,28,28,28,20,12,21,28,28,28,28,28,28,28,28,28,17,18,18,19,28,28,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12, - 12,21,28,28,28,28,20,12,21,28,28,28,28,28,28,28,28,28,22,23,23,24,28,28,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12, - 12,21,28,28,28,28,20,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12, - 12,21,28,28,28,28,20,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12, - 12,21,28,28,28,28,20,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12, - 12,21,28,28,28,28,20,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12, - 12,21,28,28,28,28,22,23,24,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,0,0,0,0,17,18,19,0,0,0,20,12,12,12, - 12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,0,0,0,0,22,23,24,0,0,0,20,12,12,12, - 12,21,28,28,28,28,28,28,28,28,28,28,28,17,19,28,28,28,28,28,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,20,12,12,12, - 12,21,28,28,28,28,28,28,28,28,28,28,28,20,21,28,28,28,28,28,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,20,12,12,12, - 12,15,18,18,18,18,18,18,18,18,18,18,18,16,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,0,0,0,0,20,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,6,6,6,6,6,28,28,28,28,28,28,28,28,28,28,28,28,0,0,0,0,20,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,15,18,18,18,18,19,28,28,28,28,28,17,19,28,28,28,28,28,28,28,0,0,20,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,6,6,6,6,6,20,21,28,28,28,28,28,28,28,0,0,20,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,15,18,18,18,18,18,16,21,28,28,28,28,28,28,28,0,0,20,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,28,28,28,17,18,18,18,18,18,16,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,28,28,28,22,23,14,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,28,28,28,28,28,20,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,28,28,28,28,28,20,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,28,28,28,28,28,20,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,28,28,28,28,28,20,12,12,12,12,12,12,12, - 23,23,23,23,23,14,13,23,23,23,23,23,23,14,12,12,12,12,12,12,12,12,12,12,12,12,21,28,28,28,28,28,22,14,13,23,23,23,23,23, - 28,28,28,28,28,22,24,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,22,24,28,28,28,28,28, - 28,28,28,28,28,7,7,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,7,7,28,28,28,28,28, - 28,28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28, - 28,28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28, - 28,28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28, - 28,28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28, - 18,18,18,18,18,18,18,18,19,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12,15,18,18,18,18,18,18,18,18,18,18,18,18,18, - 12,12,12,12,12,12,12,12,21,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,28,28,28,28,22,23,23,23,23,23,14,13,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,14,12,12,12, - 12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,22,24,28,28,28,0,0,0,0,0,0,0,0,0,0,0,11,20,12,12,12, - 12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,7,7,28,28,28,0,0,0,0,0,0,0,0,0,0,0,11,20,12,12,12, - 12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,0,0,11,20,12,12,12, - 12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,0,0,11,20,12,12,12, - 12,12,12,12,12,12,12,12,21,28,28,28,28,28,6,6,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,0,0,11,20,12,12,12, - 12,12,12,12,12,12,12,12,21,28,28,28,28,28,17,19,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,0,0,11,20,12,12,12, - 12,12,12,12,12,12,12,12,15,18,18,18,18,18,16,15,18,18,18,18,18,18,19,10,0,0,0,0,0,0,0,0,0,0,0,11,20,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,10,0,0,0,0,0,0,0,0,0,0,0,11,20,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,10,0,0,0,0,0,0,0,0,0,0,0,11,20,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,15,19,10,0,0,0,0,0,0,0,0,0,0,11,20,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,10,0,0,0,0,0,0,0,0,0,0,11,20,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,10,0,0,0,0,0,0,0,0,0,0,11,20,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,15,19,10,0,0,0,0,0,0,0,0,0,11,20,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,10,0,0,0,0,0,0,0,0,0,11,20,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,10,0,0,0,0,0,0,17,18,18,18,16,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,15,19,10,0,0,0,0,0,22,23,23,23,14,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,10,0,0,0,0,0,0,0,28,28,20,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,10,0,0,0,0,0,0,0,28,28,20,12,12,12, - 12,12,12,12,12,12,12,12,12,13,23,23,23,14,12,13,23,23,23,23,23,23,23,23,23,24,10,0,0,0,0,0,0,0,28,28,20,12,12,12, - 12,12,12,12,12,12,12,12,13,24,9,9,9,20,12,21,7,7,7,7,7,7,7,7,9,9,0,0,0,0,0,0,0,0,28,28,20,12,12,12, - 12,12,12,12,12,12,12,12,21,10,0,0,0,22,23,24,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,28,28,20,12,12,12, - 12,12,12,12,12,12,12,12,21,10,0,0,0,28,28,28,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,28,28,20,12,12,12, - 12,12,12,12,12,12,12,12,21,10,0,0,0,28,28,28,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,28,28,20,12,12,12, - 12,12,12,12,12,12,12,12,21,10,0,0,0,28,28,28,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,28,28,28,28,20,12,12,12, - 12,12,12,12,12,12,12,12,21,10,0,0,0,28,28,28,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,28,28,28,28,20,12,12,12, - 12,12,12,12,12,12,12,12,21,10,0,0,0,28,28,28,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,28,28,28,28,20,12,12,12, - 12,12,12,12,12,12,12,12,21,10,0,0,0,28,28,28,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,28,28,28,28,20,12,12,12, - 12,12,12,12,12,12,12,12,21,10,0,0,0,28,28,28,28,17,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,16,12,12,12, - 12,12,12,12,12,12,12,12,21,10,0,0,0,28,28,28,28,22,23,23,23,23,23,23,23,23,23,23,23,23,23,14,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,10,0,0,0,28,28,28,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,22,14,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,10,0,0,0,28,28,28,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,11,20,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,10,0,0,0,28,28,28,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,11,20,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,10,0,0,0,0,0,28,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,11,20,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,10,0,0,0,0,0,28,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,11,20,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,10,0,0,0,0,0,28,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,11,20,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,10,0,0,0,17,18,19,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,11,20,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,15,19,8,8,8,20,12,21,6,6,6,6,6,6,6,6,8,8,0,0,0,0,0,11,20,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,15,18,18,18,16,12,15,18,18,18,18,18,18,18,18,18,19,0,0,0,0,0,11,20,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,23,23,23,23,23,23,23,24,0,0,0,0,0,11,20,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,13,23,23,23,23,23,23,23,23,24,7,7,7,7,7,9,9,9,0,0,0,0,0,11,20,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,13,24,0,0,0,0,28,28,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,11,20,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,21,10,0,0,0,0,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,11,20,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,21,10,0,0,0,0,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,11,20,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,21,10,0,0,0,0,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,11,20,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,21,10,0,0,0,0,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,17,16,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,21,10,0,0,0,0,28,28,28,28,28,17,18,18,18,18,18,18,18,18,18,18,18,18,16,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,21,10,0,0,0,0,28,6,6,6,6,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,21,10,0,0,0,0,28,17,18,18,18,16,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,21,10,0,0,0,0,28,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,14,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,21,10,0,0,0,0,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,21,10,0,0,0,0,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,21,10,0,0,0,0,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,21,10,0,0,0,0,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,21,10,0,0,0,0,0,0,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,15,19,0,0,0,0,0,0,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,15,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,19,0,0,0,0,20,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,0,0,0,0,20,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,13,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,0,0,0,0,20,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,0,0,0,0,17,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,16,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,0,0,0,0,22,23,23,23,23,14,13,23,23,23,23,23,23,23,23,23,14,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,28,28,20,21,28,28,28,0,0,0,0,0,0,20,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,28,28,22,24,28,28,28,0,0,0,0,0,0,20,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,28,28,28,28,28,28,0,0,0,0,0,0,20,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,28,28,28,28,28,28,0,0,0,0,0,0,20,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,28,28,28,28,28,28,0,0,0,0,0,0,20,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,22,14,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,15,18,18,18,18,19,0,0,0,0,0,0,0,0,0,0,17,19,0,0,0,0,20,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,20,21,0,0,0,0,20,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,15,18,18,18,18,18,18,18,18,18,18,16,21,0,0,0,0,20,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,0,28,28,28,20,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,0,28,28,28,20,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,0,28,28,28,20,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,15,19,28,28,28,20,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,28,28,28,20,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,13,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,28,28,28,20,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,0,0,0,0,28,28,28,28,20,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,0,0,0,0,28,28,28,28,20,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,0,0,0,0,28,28,28,28,20,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,0,0,0,28,28,28,28,20,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,0,0,0,28,28,28,28,20,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,21,28,28,28,17,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,16,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,21,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,21,28,28,28,22,23,23,23,23,23,23,23,23,14,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,22,23,23,23,14,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,0,0,28,22,23,23,23,14,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,0,0,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,0,0,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,0,0,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,15,18,18,18,19,28,28,28,28,28,28,28,28,28,0,0,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,15,18,18,18,19,28,28,28,28,28,0,0,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,15,18,18,18,18,18,18,18,19,28,28,28,28,20,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,13,23,23,23,14,12,12,12,12,12,12,12,12,21,28,28,28,28,20,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,21,28,28,28,22,23,23,14,12,12,12,12,12,21,28,28,28,28,20,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,22,23,23,14,12,12,21,28,28,28,28,20,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,13,24,28,28,28,28,28,28,28,28,28,22,23,23,24,28,28,28,28,20,12,12,12,12,12,12,12,12,12, - 23,23,23,23,23,14,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,0,0,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12, - 28,28,28,28,28,20,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,0,0,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12, - 28,28,28,28,28,22,23,23,23,23,23,24,28,28,28,28,28,28,28,28,28,28,28,0,0,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12, - 28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,0,0,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12, - 28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,0,0,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12, - 28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,0,0,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12, - 28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,0,0,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12, - 18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,16,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - }; + static const short tmap[] = { + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,13,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, + 12,12,12,12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28, + 12,12,12,12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28, + 12,12,12,12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28, + 12,12,12,12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28, + 12,12,12,12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28, + 12,12,12,12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28, + 12,12,12,12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28, + 12,12,12,12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28, + 12,12,12,12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28, + 12,12,12,12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28, + 12,12,12,12,12,12,12,12,12,12,12,15,18,18,18,18,18,19,28,28,28,28,17,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,23,23,24,28,28,28,28,22,23,23,14,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,28,0,0,28,28,28,28,0,0,28,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,28,0,0,28,28,28,28,0,0,28,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,28,0,0,0,28,28,0,0,0,28,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,13,23,23,24,28,0,0,17,18,18,19,0,0,28,22,23,23,14,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,22,23,23,24,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,15,18,18,18,18,19,0,0,28,28,0,0,17,18,18,18,18,16,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,13,23,23,23,23,24,0,0,28,28,0,0,22,23,23,23,23,14,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,17,18,18,19,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,22,14,13,24,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,22,24,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,15,18,18,18,18,19,10,0,28,28,0,11,17,18,18,18,18,16,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,13,23,23,23,23,24,0,0,28,28,0,0,22,23,23,23,23,14,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,15,18,18,18,18,18,18,18,18,18,18,19,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,13,23,23,23,23,23,23,23,23,23,23,24,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,17,18,18,18,18,18,18,18,18,18,18,16,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,22,23,23,23,23,23,23,23,23,23,23,14,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,15,18,18,18,18,18,18,18,18,18,18,18,19,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,13,23,23,23,23,23,23,23,23,23,23,23,24,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,17,18,18,18,18,18,18,18,18,18,18,16,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,22,23,23,23,23,23,14,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,15,18,18,18,18,18,19,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,10,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,10,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,10,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,10,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,24,10,28,28,0,11,22,14,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,11,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,11,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,11,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,11,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,11,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,24,10,0,28,28,0,0,11,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,10,0,0,28,28,0,11,17,16,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,10,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,10,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,10,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,10,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,13,23,23,23,24,0,0,0,28,28,0,0,22,23,23,23,23,14,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,11,17,18,18,18,18,19,10,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,22,23,23,23,23,24,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,15,18,18,18,18,19,10,0,28,28,0,11,17,18,18,18,18,16,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,13,23,23,23,23,24,0,0,28,28,0,0,22,23,23,23,23,14,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,11,17,18,18,19,10,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,22,23,23,24,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,21,10,0,28,28,0,0,0,28,28,0,0,0,28,28,0,11,20,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,15,18,18,19,28,0,0,0,28,28,0,0,0,28,17,18,18,16,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,28,0,0,0,28,28,0,0,0,28,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,28,0,0,0,28,28,0,0,0,28,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,28,0,0,0,28,28,0,0,0,28,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,28,0,0,0,28,28,0,0,0,28,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,28,0,0,28,28,28,28,0,0,28,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,15,18,18,19,28,28,28,28,17,18,18,16,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,13,23,23,23,23,23,23,23,23,23,23,23,24,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,21,28,28,28,17,18,18,18,18,18,18,18,18,18,18,18,18,16,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,21,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,21,28,28,28,20,12,12,12,12,12,12,12,13,23,23,23,23,23,23,23,23,23,23,14,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,21,28,28,28,20,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,21,28,28,28,20,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,21,28,28,28,20,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,21,28,28,28,20,12,12,12,12,13,23,23,24,0,0,0,0,0,0,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,21,28,28,28,20,12,12,12,12,21,0,0,0,0,0,0,0,0,0,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,21,28,28,28,20,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,28,28,20,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,21,28,28,28,20,12,12,12,12,21,0,0,0,0,0,0,0,8,8,0,0,28,28,20,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,21,28,28,28,20,12,13,23,23,24,0,0,0,0,0,0,8,17,19,0,0,28,28,20,12,12,12,12,12,12,12,12,12,12,12, + 23,23,23,23,23,24,28,28,28,20,12,21,28,28,28,0,0,0,0,0,8,17,16,21,0,0,28,28,22,23,23,23,23,23,23,23,23,23,23,23, + 28,28,28,28,28,28,28,28,28,20,12,21,28,28,28,0,0,0,0,8,17,16,12,21,0,0,28,28,28,28,28,28,28,28,28,28,28,28,28,28, + 28,28,28,28,28,28,28,28,28,20,12,21,28,28,28,0,0,0,8,17,16,12,12,21,0,0,28,28,28,28,28,28,28,28,28,28,28,28,28,28, + 28,28,28,28,28,28,28,28,28,20,12,21,28,28,28,0,0,8,17,16,12,12,12,21,0,0,28,28,28,28,28,28,28,28,28,28,28,28,28,28, + 18,18,18,18,18,18,18,18,18,16,12,21,28,28,28,0,0,17,16,12,12,12,12,15,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18, + 12,12,12,12,12,12,12,12,12,12,12,21,28,28,28,0,0,22,14,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,21,28,28,28,0,0,7,22,14,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,21,28,28,28,0,0,28,7,22,14,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,21,28,28,28,0,0,28,28,9,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,21,28,28,28,0,0,28,28,0,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,21,28,28,28,0,0,28,28,0,22,23,23,23,23,14,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,21,28,28,28,0,0,28,28,0,28,28,0,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,21,28,28,28,0,0,28,28,0,28,28,0,28,28,22,14,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,21,28,28,28,0,0,28,28,0,28,28,0,28,28,7,22,14,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,21,28,28,28,0,0,28,28,0,28,28,0,28,28,28,7,22,14,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,21,28,28,28,0,0,28,28,0,28,28,0,28,28,28,28,7,20,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,21,6,28,28,0,0,28,28,0,28,28,0,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,15,19,6,28,0,0,17,18,19,28,28,0,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,15,19,6,0,0,20,12,21,28,28,0,28,28,28,28,28,22,23,23,23,23,14,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,15,19,8,0,20,12,21,28,28,0,28,28,28,28,28,28,28,0,0,0,20,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,15,19,8,20,12,21,28,28,0,28,28,28,28,28,28,28,0,0,0,20,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,15,18,16,12,21,28,28,0,28,28,28,0,0,0,0,0,0,0,22,14,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,28,28,0,28,28,28,0,0,0,0,0,0,0,0,20,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,6,28,0,28,28,28,0,0,0,0,0,0,0,0,20,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,15,19,6,0,17,18,18,19,0,0,0,0,0,0,0,22,14,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,15,19,8,20,12,12,21,0,0,0,0,0,0,0,28,20,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,15,18,16,12,12,21,10,0,0,0,0,0,0,28,22,14,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,10,0,0,0,0,0,0,28,28,20,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,15,19,10,0,0,0,0,0,28,28,22,14,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,10,0,0,0,0,0,28,28,28,20,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,15,19,10,0,0,0,0,28,28,28,20,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,10,0,0,0,0,28,28,28,20,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,10,0,0,0,0,28,28,28,20,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,24,10,0,0,0,28,28,28,28,20,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,10,0,0,0,0,28,28,28,28,20,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,24,10,0,0,0,28,28,28,28,17,16,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,10,0,0,0,0,28,28,28,28,20,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,24,10,0,0,0,28,28,28,28,17,16,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,10,0,0,0,0,28,28,28,28,20,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,23,23,23,23,23,23,23,24,0,0,0,0,28,28,28,28,17,16,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,24,0,0,0,28,28,28,0,0,0,0,0,0,28,28,28,28,20,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,24,7,0,0,0,28,28,28,0,0,0,0,28,28,28,28,28,17,16,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,24,7,28,0,0,0,28,28,28,0,0,0,0,28,28,28,28,28,20,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,13,24,7,28,28,0,0,0,28,28,28,0,0,0,0,28,28,28,28,17,16,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,13,24,9,28,28,28,0,0,0,28,28,28,0,0,0,0,28,28,28,28,20,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,21,9,0,28,28,28,0,0,0,28,28,28,0,0,0,0,28,28,28,17,16,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,21,0,0,28,28,28,0,0,0,28,28,28,0,0,0,0,28,28,28,20,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,13,23,23,23,24,0,0,28,28,28,0,0,0,28,28,28,0,0,0,17,18,18,18,16,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,28,28,28,0,0,0,28,28,28,0,0,0,28,28,28,0,0,0,20,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,28,28,28,0,0,0,28,28,28,0,0,0,28,28,28,0,0,8,20,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,28,28,28,0,0,0,28,28,28,0,0,0,28,28,28,0,8,17,16,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,28,28,28,0,0,0,28,28,28,0,0,0,28,28,28,8,17,16,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,28,28,28,0,0,0,28,28,28,0,0,0,28,28,6,17,16,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,28,28,28,0,0,0,28,28,28,0,0,0,28,6,17,16,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,28,28,28,0,0,0,28,28,28,0,0,0,28,17,16,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,28,28,28,0,0,17,18,18,18,18,18,18,18,16,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,28,28,28,0,0,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,28,28,28,0,0,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,28,28,28,0,0,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,28,28,28,0,0,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,28,28,28,0,0,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,28,28,28,0,0,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,28,28,28,0,8,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,28,28,28,8,17,16,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,28,28,28,17,16,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 23,23,23,23,23,14,12,12,21,28,28,28,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, + 28,28,28,28,28,20,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28, + 28,28,28,28,28,20,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28, + 28,28,28,28,28,20,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28, + 28,28,28,28,28,20,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28, + 18,19,28,28,28,20,12,12,15,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18, + 12,21,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 23,24,28,28,28,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, + 7,7,28,28,28,28,28,28,28,28,28,28,28,28,28,28,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, + 28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28, + 28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28, + 28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28, + 28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28, + 28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28, + 28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28, + 28,28,0,0,0,0,0,8,8,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28, + 28,28,0,0,0,0,0,17,18,19,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28, + 0,0,0,0,0,0,0,22,23,24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,28,28,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,28,28,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,28,28,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,8,8,8,0,0,0,28,28,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,17,18,19,0,0,0,0,28,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,22,23,24,0,0,0,0,28,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,28,28,28,0,0,0,0,28,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,28,28,28,0,0,0,0,28,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,28,28,28,0,0,0,0,28,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,28,28,28,0,0,0,0,28,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,8,8,0,0, + 0,0,28,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,17,18,19,0,0, + 0,0,28,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,22,23,24,0,0, + 0,0,28,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,0,0, + 0,0,28,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,0,0, + 0,0,28,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,0,0, + 0,0,28,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,8,8,0,0,0,28,28,28,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,17,18,19,0,0,0,0,28,28,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,22,23,24,0,0,0,0,28,28,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,0,0,0,0,28,28,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,0,0,0,0,28,28,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,0,0,0,0,28,28,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,0,0,0,0,28,28,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,8,8,8,8,8,8,8,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,17,18,18,18,18,18,18,19,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,22,23,23,23,23,23,23,24,10,0,0,0,0,0,0,0,0,0,0,28,28,0,0,28,28,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,7,7,7,7,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,28,28,0,0,28,28,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,28,28,28,28,28,0,0,28,28,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,0,0,0,0,0,0,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,0,0,0,0,0,0,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,0,0,0,0,0,0,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,0,0,0,0,28,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,0,0,0,0,28,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,0,0,0,0,28,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,0,0,0,0,28,28,28,28,28,6,6,6,6,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,17,18,18,18,18,18,18,18,19,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,22,23,23,23,23,23,23,23,24,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,7,7,7,7,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,17,18,19,0,0,0,0,0,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,22,23,24,0,0,0,0,0,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,7,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,0,0,0,0,0,0,0,0,0,8,8,8,8,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,0,0,0,0,0,0,0,0,0,17,18,18,19,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,0,0,0,0,0,0,0,0,0,22,23,23,24,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,0,0,0,0,0,0,0,0,0,0, + 8,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,0,0,8,8,8,8,8,8,8,8, + 18,19,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,0,0,17,18,18,18,18,18,18,18, + 12,21,8,8,8,8,8,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,0,0,22,23,23,23,23,23,14,12, + 12,15,18,18,18,18,18,19,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,0,0,28,28,28,28,28,28,20,12, + 12,12,12,12,12,12,12,21,8,8,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,0,0,28,28,28,28,28,28,20,12, + 12,12,12,12,12,12,12,15,18,18,19,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,0,0,28,28,28,28,28,28,20,12, + 23,23,14,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,0,0,28,28,28,28,28,28,22,23, + 28,28,20,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,0,0,0,0,28,28,28,28,28,28, + 28,28,22,23,23,23,23,14,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,0,0,0,0,28,28,28,28,28,28, + 28,28,28,28,28,28,28,20,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,0,0,0,0,0,0,28,28,28,28, + 28,28,28,28,28,28,28,20,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,0,0,0,0,0,0,28,28,28,28, + 28,28,28,28,28,28,28,20,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,0,0,0,0,0,0,0,0,28,28, + 28,28,28,28,28,28,28,22,23,23,24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,0,0,0,0,0,0,0,0,28,28, + 0,0,0,0,0,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 8,8,8,0,0,0,0,0,0,28,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,8,8, + 18,18,19,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,17,18,18, + 12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,8,8,8,8,8,8,0,0,0,0,0,0,0,0,0,0,0,20,12,12, + 12,12,21,28,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,17,18,18,18,18,18,19,0,0,0,0,0,0,0,0,0,0,0,20,12,12, + 12,12,21,28,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,22,23,23,23,23,23,24,0,0,0,0,0,0,0,0,0,0,0,20,12,12, + 12,12,21,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,20,12,12, + 12,12,21,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,20,12,12, + 12,12,21,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,20,12,12, + 12,12,21,6,6,6,6,6,6,28,28,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,20,12,12, + 12,12,15,18,18,18,18,18,19,28,28,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,0,0,0,0,0,8,8,8,8,8,8,20,12,12, + 12,12,12,12,12,12,12,12,21,28,28,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,0,0,0,0,0,17,18,18,18,18,18,16,12,12, + 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,0,0,0,0,0,20,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,8,20,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,17,18,16,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,22,23,14,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,20,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,20,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,0,0,0,0,0,20,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,0,0,0,0,0,20,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,0,0,0,0,0,20,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,0,0,0,0,0,20,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,0,0,0,0,0,20,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,28,28,28,0,0,28,28,0,0,0,0,0,20,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,28,28,28,0,0,0,0,28,0,0,0,0,0,20,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,28,28,28,0,0,0,0,0,0,0,0,0,28,28,20,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,28,28,28,0,0,0,0,0,0,0,0,0,0,28,28,20,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,28,28,28,0,0,0,0,0,0,0,0,0,0,0,28,28,20,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,28,28,0,0,0,0,0,0,0,0,0,0,0,0,28,28,20,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,20,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,20,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,20,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,20,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,20,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,20,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,8,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,15,18,19,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,13,23,24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,8,8,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,15,18,19,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,13,23,24,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,0,0,0,0,0,8,8,8,8,8,6,6,6,6,6,6,6,6,6,6,6,6,20,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,0,0,0,0,0,17,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,16,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,0,0,0,0,0,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,0,0,0,0,0,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,0,0,0,0,0,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,0,0,0,0,0,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,0,0,0,0,0,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,0,0,0,0,0,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,0,0,0,0,0,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,8,8,0,0,0,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,15,18,19,0,0,0,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,13,23,24,0,0,0,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,0,0,0,0,0,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,0,0,0,0,0,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,0,0,0,0,0,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,0,0,0,0,0,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,0,0,0,0,0,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,0,0,0,0,0,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,0,0,0,0,0,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,0,0,0,8,8,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,0,0,0,17,18,16,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,13,23,23,23,23,23,14,21,0,0,0,20,12,12,12,13,23,14,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,21,9,9,9,9,9,20,21,0,0,0,20,12,12,12,21,9,22,14,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,21,0,0,0,0,0,20,21,0,0,0,20,12,12,12,21,0,9,22,14,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,21,0,0,0,0,0,20,21,0,0,0,22,23,23,23,24,0,0,9,22,14,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,21,0,0,0,0,0,20,21,0,0,0,0,0,0,0,0,0,0,0,9,20,12,12,12,12,12,12,12,12,12,12,12,13,23,23,23,23,14,12, + 23,24,0,0,0,0,0,20,21,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12,12,12,12,12,12,12,21,0,0,0,0,22,23, + 0,0,0,0,0,0,0,20,21,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12,12,12,12,12,12,12,21,0,0,0,0,0,0, + 0,0,0,0,0,0,0,22,24,0,0,0,0,0,0,0,0,0,0,0,0,22,23,23,23,23,14,12,12,12,12,12,12,21,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12,12,21,0,0,0,0,0,0, + 18,18,18,19,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12,12,15,19,0,0,17,18,18, + 12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12,12,13,24,0,0,20,12,12, + 12,12,12,15,18,18,18,18,18,18,18,19,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12,12,21,0,0,0,20,12,12, + 12,12,12,12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12,12,21,0,0,0,20,12,12, + 12,12,12,12,12,12,12,12,12,12,12,21,8,0,0,0,0,0,0,0,0,0,0,0,0,0,22,23,23,23,23,14,12,21,0,0,0,20,12,12, + 12,12,12,12,12,12,12,12,12,12,12,15,19,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,20,12,21,0,0,17,16,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,15,19,8,0,0,17,18,18,18,19,0,0,0,0,0,0,0,0,11,20,12,21,0,0,22,23,23,14, + 12,12,12,12,12,12,12,12,12,12,12,12,12,15,19,8,0,20,12,12,12,21,0,0,0,0,0,0,0,0,11,20,12,21,0,0,0,0,0,20, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,15,19,8,20,12,12,12,21,8,8,8,8,0,0,0,0,11,20,12,21,0,0,0,0,0,20, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,15,18,16,12,12,12,15,18,18,18,19,10,0,0,0,11,20,12,21,0,0,0,0,0,20, + 23,23,23,23,14,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,10,0,0,0,11,20,12,21,0,0,0,0,0,22, + 9,9,9,9,22,14,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,10,0,0,0,11,20,12,21,0,0,0,0,0,9, + 0,0,0,0,11,22,14,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,10,0,0,0,11,20,12,21,0,0,0,0,0,0, + 0,0,0,0,0,11,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,10,0,0,0,11,20,12,15,18,18,19,0,0,0, + 0,0,0,0,0,11,22,14,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,10,0,0,0,11,20,12,12,12,13,24,0,0,0, + 0,0,0,0,0,0,11,20,12,13,23,23,23,23,23,23,23,23,14,12,12,12,12,12,12,21,10,0,0,0,11,20,12,12,13,24,0,0,0,0, + 0,0,0,0,0,0,11,20,13,24,9,9,9,9,9,9,9,9,20,12,12,12,12,12,12,21,10,0,0,0,11,20,12,12,21,10,0,0,0,0, + 0,0,0,0,0,0,11,20,21,10,0,0,0,0,0,0,0,0,20,12,12,12,12,12,12,21,10,0,0,0,11,20,12,12,21,10,0,0,0,0, + 0,0,0,0,0,0,11,20,21,10,0,0,0,0,0,0,0,0,22,23,23,23,23,23,23,24,10,0,0,0,11,20,12,12,21,10,0,0,0,0, + 0,0,0,0,0,0,11,20,21,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,20,12,12,21,10,0,0,0,0, + 0,0,0,0,0,0,11,20,21,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,20,12,12,21,10,0,0,0,0, + 0,0,0,0,0,0,11,20,21,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,20,12,12,21,10,0,0,0,0, + 0,0,0,0,0,0,11,20,21,10,0,0,0,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,11,20,12,12,21,10,0,0,0,0, + 0,0,0,0,0,0,11,20,21,10,0,0,0,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,17,16,12,12,21,10,0,0,0,0, + 0,0,0,0,0,0,11,20,21,10,0,28,28,28,28,28,28,28,28,28,0,0,17,18,18,18,18,18,18,18,16,12,12,12,21,10,0,0,0,0, + 0,0,0,0,0,0,17,16,21,10,0,28,28,28,28,28,28,28,28,28,0,0,20,12,12,12,12,12,12,12,12,12,12,12,21,10,0,0,0,0, + 0,0,0,0,0,17,16,12,21,10,0,28,28,28,28,28,28,28,28,28,0,0,20,12,12,12,12,12,12,12,12,12,12,12,21,10,0,0,0,0, + 0,0,0,0,0,22,14,12,15,19,8,6,6,6,6,6,6,6,28,28,0,0,20,12,12,12,12,12,12,12,12,12,12,12,21,10,0,0,0,0, + 0,0,0,0,0,0,22,14,12,15,18,18,18,18,18,18,18,19,28,28,0,0,20,12,12,12,12,12,12,12,12,12,12,12,21,10,0,0,0,0, + 0,0,0,0,0,0,11,20,12,12,12,12,12,12,12,12,12,21,28,28,0,0,20,12,12,12,12,12,12,12,12,12,12,12,21,10,0,0,0,0, + 0,0,0,0,0,0,11,20,12,12,12,12,12,12,12,12,12,21,28,28,0,0,20,12,12,12,12,12,12,12,12,12,12,12,21,10,0,0,0,0, + 0,0,0,0,0,0,11,20,12,12,12,12,12,12,12,12,12,21,28,28,0,0,20,12,12,12,12,12,12,12,12,12,12,12,21,10,0,0,0,0, + 0,0,0,0,0,0,11,20,12,12,12,12,12,12,12,12,12,21,0,0,0,0,20,12,12,12,12,12,12,12,12,12,12,12,21,10,0,0,0,0, + 0,0,0,0,0,0,11,20,12,12,12,12,12,12,12,12,12,21,0,0,0,0,20,12,12,12,12,12,12,12,12,12,12,12,21,10,0,0,0,0, + 0,0,0,0,0,0,11,20,12,12,12,12,12,13,23,23,23,24,0,0,0,0,20,12,12,12,12,12,12,12,12,12,12,12,21,10,0,0,0,0, + 0,0,0,0,0,0,11,20,12,13,23,23,23,24,28,28,0,0,0,0,0,0,20,12,12,12,12,12,12,12,12,12,12,12,15,19,0,0,0,0, + 0,0,0,0,0,0,11,20,12,21,28,28,28,28,28,28,0,0,0,0,0,0,20,12,12,12,12,12,12,12,12,12,12,12,12,15,18,19,0,0, + 18,18,19,0,0,0,11,20,12,21,28,28,28,28,28,28,0,0,0,0,0,0,20,12,12,12,12,12,12,13,23,23,23,23,14,12,12,15,18,18, + 12,12,21,0,0,0,11,20,12,21,28,28,28,28,28,28,28,28,0,0,0,0,20,12,12,12,12,12,12,21,28,28,28,28,22,23,23,23,14,12, + 23,23,24,0,0,0,11,20,12,21,28,28,28,28,28,28,28,28,0,0,0,0,20,12,12,12,12,12,12,21,28,28,28,28,0,0,0,0,22,23, + 0,0,0,0,0,0,11,20,12,21,28,28,28,28,17,18,18,19,0,0,0,0,20,12,12,12,12,12,12,21,28,28,28,28,0,0,0,0,0,0, + 0,0,0,0,0,0,11,20,12,21,28,28,28,28,20,12,12,15,18,18,18,18,16,12,12,12,12,12,12,21,28,28,28,28,0,0,0,0,0,0, + 0,0,0,0,0,0,11,20,12,21,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,28,28,28,28,0,0,0,0,0,0, + 0,0,0,0,0,0,11,20,12,21,28,28,28,28,22,23,23,23,14,12,12,12,12,12,12,12,12,12,12,21,28,28,28,28,0,0,0,0,0,0, + 0,0,0,0,0,0,11,20,12,21,28,28,28,28,28,28,28,28,22,23,23,23,14,12,12,12,12,12,12,21,28,28,28,28,0,0,0,0,0,0, + 0,0,0,0,0,0,11,20,12,21,28,28,28,28,28,28,28,28,28,28,0,0,22,23,23,23,14,12,12,21,28,28,28,28,17,18,18,19,0,0, + 18,19,0,0,0,0,11,20,12,21,28,28,28,28,28,28,28,28,28,28,0,0,0,0,0,0,20,12,12,21,28,28,28,28,20,12,12,15,18,18, + 12,15,18,18,18,18,18,16,12,21,28,28,28,28,28,28,28,28,28,28,0,0,0,0,0,0,20,12,12,21,28,28,28,28,20,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,0,0,0,0,0,0,20,12,12,21,28,28,28,28,22,23,23,23,14,12, + 23,23,14,12,12,12,12,12,12,15,18,18,18,19,28,28,28,28,28,28,0,0,0,0,0,0,20,12,12,21,28,28,28,28,0,0,0,0,22,23, + 0,0,22,23,23,23,14,12,12,12,12,12,12,21,28,28,28,28,6,6,8,8,0,0,0,0,20,12,12,21,28,28,28,28,0,0,0,0,0,0, + 0,0,0,0,0,0,22,23,23,23,14,12,12,21,28,28,28,28,17,18,18,19,0,0,0,0,20,12,12,21,28,28,28,28,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,28,28,22,23,23,24,28,28,28,28,20,12,12,21,0,0,0,0,20,12,12,21,28,28,28,28,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,28,28,20,12,12,21,0,0,0,0,20,12,12,21,6,6,6,6,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,28,28,20,12,12,21,28,28,0,0,20,12,12,15,18,18,18,19,8,8,8,8,0,0, + 8,8,0,0,0,0,0,0,28,28,28,28,28,28,28,28,28,28,20,12,12,21,28,28,0,0,20,12,12,12,12,12,12,15,18,18,18,19,8,8, + 18,19,8,8,8,8,0,0,28,28,28,28,28,28,28,28,28,28,20,12,12,21,28,28,0,0,22,23,23,23,14,12,12,12,12,12,12,15,18,18, + 12,15,18,18,18,19,0,0,28,28,28,28,28,28,28,28,28,28,20,12,12,21,28,28,0,0,0,0,0,0,22,23,23,23,14,12,12,12,12,12, + 12,12,12,12,12,15,18,18,18,19,28,28,28,28,28,28,28,28,20,12,12,21,28,28,0,0,0,0,0,0,28,28,28,28,22,23,23,23,14,12, + 12,12,12,12,12,12,12,12,12,15,18,18,18,19,28,28,28,28,20,12,12,21,28,28,0,0,0,0,0,0,28,28,28,28,28,28,28,28,20,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,15,18,18,18,18,16,12,12,21,28,28,0,0,0,0,0,0,0,0,28,28,28,28,28,28,20,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,6,6,8,8,0,0,0,0,0,0,28,28,28,28,28,28,20,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,15,18,18,18,19,8,8,8,8,0,0,28,28,28,28,28,28,20,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,15,18,18,18,19,0,0,28,28,28,28,28,28,20,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,15,18,18,18,19,28,28,28,28,20,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,28,28,28,28,20,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,28,28,28,28,20,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,28,28,28,28,20,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,28,28,28,28,20,12, + 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,14,21,28,28,28,28,22,23, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,28,28,28,28,28,0,0,0,0,11,20,21,28,28,28,28,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,28,28,28,28,28,0,0,0,0,11,20,21,28,28,28,28,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,0,0,11,20,21,28,28,28,28,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,0,0,11,20,21,28,28,28,28,0,0, + 18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,19,28,28,0,0,11,20,15,18,18,18,18,18,18, + 12,12,12,13,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,28,28,0,0,11,20,12,12,12,12,12,12,12, + 12,12,12,21,10,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,0,0,11,20,12,12,12,12,12,12,12, + 12,12,12,21,10,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,0,0,11,20,12,12,12,12,12,12,12, + 12,12,12,21,10,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,0,0,11,20,12,12,12,12,12,12,12, + 12,12,12,21,10,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,0,0,11,20,12,12,12,12,12,12,12, + 12,12,12,21,10,0,0,0,0,17,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,16,12,12,12,12,12,12,12, + 12,12,12,21,10,0,0,0,0,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,14,12,12,12,12,12,12,12, + 12,12,12,21,10,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,28,28,28,28,28,28,0,0,0,0,0,11,20,12,12,12,12,12,12,12, + 12,12,12,21,10,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,28,28,28,28,28,28,0,0,0,0,0,11,20,12,12,12,12,12,12,12, + 12,12,12,21,10,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,28,28,28,28,28,28,0,0,0,0,0,11,20,12,12,12,12,12,12,12, + 12,12,12,21,10,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,28,28,28,28,28,28,0,0,0,0,0,11,20,12,12,12,12,12,12,12, + 12,12,12,15,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,19,0,0,0,0,11,20,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,13,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,0,0,0,0,11,20,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,21,10,0,0,0,0,0,0,0,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,11,20,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,21,10,0,0,0,0,0,0,0,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,11,20,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,21,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,20,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,21,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,20,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,21,10,0,0,0,0,17,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,16,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,21,10,0,0,0,0,22,23,23,23,23,23,23,23,23,23,23,23,23,23,14,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,21,10,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,21,10,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,21,10,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,21,10,0,0,0,0,0,0,0,0,0,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,15,18,18,18,18,18,18,18,18,18,18,18,18,18,18,19,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,13,23,23,23,23,23,23,23,23,23,24,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,21,0,0,0,0,17,18,18,18,18,18,18,18,18,18,16,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,21,0,0,0,0,22,23,23,23,23,14,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,22,23,23,23,23,23,23,14,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,22,23,23,14,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12,12,12, + 12,13,23,23,23,23,23,23,23,23,23,23,24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12,12,12, + 12,21,28,28,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12,12,12, + 12,21,28,28,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12,12,12, + 12,21,28,28,28,28,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12,12,12, + 12,21,28,28,28,28,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12,12,12, + 12,21,28,28,28,28,6,6,6,6,6,6,6,6,8,8,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12,12,12, + 12,21,28,28,28,28,17,18,18,18,18,18,18,18,18,18,19,0,0,0,0,0,0,17,18,18,19,0,0,0,0,0,20,12,12,12,12,12,12,12, + 12,21,28,28,28,28,20,12,12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,22,23,23,24,0,0,0,0,0,20,12,12,12,12,12,12,12, + 12,21,28,28,28,28,20,12,13,23,23,23,23,23,23,23,24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12,12,12, + 12,21,28,28,28,28,20,12,21,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12,12,12, + 12,21,28,28,28,28,20,12,21,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12,12,12, + 12,21,28,28,28,28,20,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12,12,12, + 12,21,28,28,28,28,20,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,17,18,16,12,12,12,12,12,12,12, + 12,21,28,28,28,28,20,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,0,0,0,0,0,0,22,23,23,23,23,23,14,12,12,12, + 12,21,28,28,28,28,20,12,21,28,28,28,28,28,28,28,28,28,6,6,6,6,28,28,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12, + 12,21,28,28,28,28,20,12,21,28,28,28,28,28,28,28,28,28,17,18,18,19,28,28,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12, + 12,21,28,28,28,28,20,12,21,28,28,28,28,28,28,28,28,28,22,23,23,24,28,28,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12, + 12,21,28,28,28,28,20,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12, + 12,21,28,28,28,28,20,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12, + 12,21,28,28,28,28,20,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12, + 12,21,28,28,28,28,20,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12, + 12,21,28,28,28,28,22,23,24,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,0,0,0,0,17,18,19,0,0,0,20,12,12,12, + 12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,0,0,0,0,22,23,24,0,0,0,20,12,12,12, + 12,21,28,28,28,28,28,28,28,28,28,28,28,17,19,28,28,28,28,28,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,20,12,12,12, + 12,21,28,28,28,28,28,28,28,28,28,28,28,20,21,28,28,28,28,28,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,20,12,12,12, + 12,15,18,18,18,18,18,18,18,18,18,18,18,16,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,0,0,0,0,20,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,6,6,6,6,6,28,28,28,28,28,28,28,28,28,28,28,28,0,0,0,0,20,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,15,18,18,18,18,19,28,28,28,28,28,17,19,28,28,28,28,28,28,28,0,0,20,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,6,6,6,6,6,20,21,28,28,28,28,28,28,28,0,0,20,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,15,18,18,18,18,18,16,21,28,28,28,28,28,28,28,0,0,20,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,28,28,28,17,18,18,18,18,18,16,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,28,28,28,22,23,14,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,28,28,28,28,28,20,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,28,28,28,28,28,20,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,28,28,28,28,28,20,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,28,28,28,28,28,20,12,12,12,12,12,12,12, + 23,23,23,23,23,14,13,23,23,23,23,23,23,14,12,12,12,12,12,12,12,12,12,12,12,12,21,28,28,28,28,28,22,14,13,23,23,23,23,23, + 28,28,28,28,28,22,24,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,22,24,28,28,28,28,28, + 28,28,28,28,28,7,7,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,7,7,28,28,28,28,28, + 28,28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28, + 28,28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28, + 28,28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28, + 28,28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28, + 18,18,18,18,18,18,18,18,19,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12,15,18,18,18,18,18,18,18,18,18,18,18,18,18, + 12,12,12,12,12,12,12,12,21,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,28,28,28,28,22,23,23,23,23,23,14,13,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,14,12,12,12, + 12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,22,24,28,28,28,0,0,0,0,0,0,0,0,0,0,0,11,20,12,12,12, + 12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,7,7,28,28,28,0,0,0,0,0,0,0,0,0,0,0,11,20,12,12,12, + 12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,0,0,11,20,12,12,12, + 12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,0,0,11,20,12,12,12, + 12,12,12,12,12,12,12,12,21,28,28,28,28,28,6,6,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,0,0,11,20,12,12,12, + 12,12,12,12,12,12,12,12,21,28,28,28,28,28,17,19,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,0,0,11,20,12,12,12, + 12,12,12,12,12,12,12,12,15,18,18,18,18,18,16,15,18,18,18,18,18,18,19,10,0,0,0,0,0,0,0,0,0,0,0,11,20,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,10,0,0,0,0,0,0,0,0,0,0,0,11,20,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,10,0,0,0,0,0,0,0,0,0,0,0,11,20,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,15,19,10,0,0,0,0,0,0,0,0,0,0,11,20,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,10,0,0,0,0,0,0,0,0,0,0,11,20,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,10,0,0,0,0,0,0,0,0,0,0,11,20,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,15,19,10,0,0,0,0,0,0,0,0,0,11,20,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,10,0,0,0,0,0,0,0,0,0,11,20,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,10,0,0,0,0,0,0,17,18,18,18,16,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,15,19,10,0,0,0,0,0,22,23,23,23,14,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,10,0,0,0,0,0,0,0,28,28,20,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,10,0,0,0,0,0,0,0,28,28,20,12,12,12, + 12,12,12,12,12,12,12,12,12,13,23,23,23,14,12,13,23,23,23,23,23,23,23,23,23,24,10,0,0,0,0,0,0,0,28,28,20,12,12,12, + 12,12,12,12,12,12,12,12,13,24,9,9,9,20,12,21,7,7,7,7,7,7,7,7,9,9,0,0,0,0,0,0,0,0,28,28,20,12,12,12, + 12,12,12,12,12,12,12,12,21,10,0,0,0,22,23,24,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,28,28,20,12,12,12, + 12,12,12,12,12,12,12,12,21,10,0,0,0,28,28,28,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,28,28,20,12,12,12, + 12,12,12,12,12,12,12,12,21,10,0,0,0,28,28,28,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,28,28,20,12,12,12, + 12,12,12,12,12,12,12,12,21,10,0,0,0,28,28,28,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,28,28,28,28,20,12,12,12, + 12,12,12,12,12,12,12,12,21,10,0,0,0,28,28,28,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,28,28,28,28,20,12,12,12, + 12,12,12,12,12,12,12,12,21,10,0,0,0,28,28,28,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,28,28,28,28,20,12,12,12, + 12,12,12,12,12,12,12,12,21,10,0,0,0,28,28,28,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,28,28,28,28,20,12,12,12, + 12,12,12,12,12,12,12,12,21,10,0,0,0,28,28,28,28,17,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,16,12,12,12, + 12,12,12,12,12,12,12,12,21,10,0,0,0,28,28,28,28,22,23,23,23,23,23,23,23,23,23,23,23,23,23,14,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,10,0,0,0,28,28,28,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,22,14,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,10,0,0,0,28,28,28,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,11,20,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,10,0,0,0,28,28,28,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,11,20,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,10,0,0,0,0,0,28,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,11,20,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,10,0,0,0,0,0,28,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,11,20,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,10,0,0,0,0,0,28,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,11,20,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,10,0,0,0,17,18,19,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,11,20,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,15,19,8,8,8,20,12,21,6,6,6,6,6,6,6,6,8,8,0,0,0,0,0,11,20,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,15,18,18,18,16,12,15,18,18,18,18,18,18,18,18,18,19,0,0,0,0,0,11,20,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,23,23,23,23,23,23,23,24,0,0,0,0,0,11,20,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,13,23,23,23,23,23,23,23,23,24,7,7,7,7,7,9,9,9,0,0,0,0,0,11,20,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,13,24,0,0,0,0,28,28,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,11,20,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,21,10,0,0,0,0,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,11,20,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,21,10,0,0,0,0,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,11,20,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,21,10,0,0,0,0,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,11,20,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,21,10,0,0,0,0,28,28,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,17,16,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,21,10,0,0,0,0,28,28,28,28,28,17,18,18,18,18,18,18,18,18,18,18,18,18,16,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,21,10,0,0,0,0,28,6,6,6,6,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,21,10,0,0,0,0,28,17,18,18,18,16,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,21,10,0,0,0,0,28,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,14,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,21,10,0,0,0,0,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,21,10,0,0,0,0,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,21,10,0,0,0,0,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,21,10,0,0,0,0,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,21,10,0,0,0,0,0,0,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,15,19,0,0,0,0,0,0,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,15,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,19,0,0,0,0,20,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,0,0,0,0,20,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,13,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,0,0,0,0,20,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,28,28,28,28,28,28,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,0,0,0,0,17,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,16,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,0,0,0,0,22,23,23,23,23,14,13,23,23,23,23,23,23,23,23,23,14,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,28,28,20,21,28,28,28,0,0,0,0,0,0,20,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,28,28,22,24,28,28,28,0,0,0,0,0,0,20,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,28,28,28,28,28,28,0,0,0,0,0,0,20,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,28,28,28,28,28,28,0,0,0,0,0,0,20,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,28,28,28,28,28,28,0,0,0,0,0,0,20,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,22,14,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,15,18,18,18,18,19,0,0,0,0,0,0,0,0,0,0,17,19,0,0,0,0,20,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,20,21,0,0,0,0,20,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,15,18,18,18,18,18,18,18,18,18,18,16,21,0,0,0,0,20,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,0,28,28,28,20,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,0,28,28,28,20,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,0,28,28,28,20,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,15,19,28,28,28,20,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,28,28,28,20,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,13,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,28,28,28,20,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,0,0,0,0,28,28,28,28,20,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,0,0,0,0,28,28,28,28,20,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,0,0,0,0,28,28,28,28,20,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,0,0,0,28,28,28,28,20,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,0,0,0,28,28,28,28,20,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,21,28,28,28,17,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,16,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,21,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,21,28,28,28,22,23,23,23,23,23,23,23,23,14,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,22,23,23,23,14,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,0,0,28,22,23,23,23,14,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,0,0,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,0,0,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,28,28,0,0,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,15,18,18,18,19,28,28,28,28,28,28,28,28,28,0,0,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,15,18,18,18,19,28,28,28,28,28,0,0,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,15,18,18,18,18,18,18,18,19,28,28,28,28,20,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,13,23,23,23,14,12,12,12,12,12,12,12,12,21,28,28,28,28,20,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,21,28,28,28,22,23,23,14,12,12,12,12,12,21,28,28,28,28,20,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,21,28,28,28,28,28,28,22,23,23,14,12,12,21,28,28,28,28,20,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,13,24,28,28,28,28,28,28,28,28,28,22,23,23,24,28,28,28,28,20,12,12,12,12,12,12,12,12,12, + 23,23,23,23,23,14,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,0,0,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12, + 28,28,28,28,28,20,12,12,12,12,12,21,28,28,28,28,28,28,28,28,28,28,28,0,0,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12, + 28,28,28,28,28,22,23,23,23,23,23,24,28,28,28,28,28,28,28,28,28,28,28,0,0,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12, + 28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,0,0,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12, + 28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,0,0,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12, + 28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,0,0,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12, + 28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,0,0,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12, + 18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,16,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + }; - SDL_memcpy(contents, tmap, sizeof(contents)); + SDL_memcpy(contents, tmap, sizeof(contents)); #endif } diff --git a/desktop_version/src/Tower.h b/desktop_version/src/Tower.h index 8d7bae86..e9adafa3 100644 --- a/desktop_version/src/Tower.h +++ b/desktop_version/src/Tower.h @@ -23,6 +23,7 @@ public: short back[40 * 120]; short contents[40 * 700]; short minitower[40 * 100]; + int vmult[40 * 700]; bool minitowermode; }; diff --git a/desktop_version/src/TowerBG.h b/desktop_version/src/TowerBG.h index 2be0bc23..9648f6b9 100644 --- a/desktop_version/src/TowerBG.h +++ b/desktop_version/src/TowerBG.h @@ -5,15 +5,16 @@ struct TowerBG { - SDL_Texture* texture; - bool tdrawback; - int bypos; - int bscroll; - int colstate; - int scrolldir; - int r; - int g; - int b; + SDL_Surface* buffer; + SDL_Surface* buffer_lerp; + bool tdrawback; + int bypos; + int bscroll; + int colstate; + int scrolldir; + int r; + int g; + int b; }; #endif /* TOWERBG_H */ diff --git a/desktop_version/src/UTF8.c b/desktop_version/src/UTF8.c deleted file mode 100644 index 528b9964..00000000 --- a/desktop_version/src/UTF8.c +++ /dev/null @@ -1,202 +0,0 @@ -#include "UTF8.h" - -#define STARTS_0(byte) ((byte & 0x80) == 0x00) -#define STARTS_10(byte) ((byte & 0xC0) == 0x80) -#define STARTS_110(byte) ((byte & 0xE0) == 0xC0) -#define STARTS_1110(byte) ((byte & 0xF0) == 0xE0) -#define STARTS_11110(byte) ((byte & 0xF8) == 0xF0) -#define TAKE(byte, nbits) (byte & ((1 << nbits)-1)) - -static inline bool is_illegal(uint32_t codepoint) -{ - return (codepoint >= 0xD800 && codepoint <= 0xDFFF) || codepoint > 0x10FFFF; -} - -uint32_t UTF8_peek_next(const char* s_str, uint8_t* codepoint_nbytes) -{ - /* Get the next codepoint from a string, but instead of advancing the - * pointer, give the number of bytes the index will need to advance. */ - if (s_str == NULL) - { - return 0; - } - - // Pointer conversion to avoid all those brilliant signedness plot twists... - const unsigned char* str = (const unsigned char*) s_str; - uint32_t codepoint; - *codepoint_nbytes = 1; - - if (STARTS_0(str[0])) - { - // 0xxx xxxx - ASCII - codepoint = str[0]; - } - else if (STARTS_10(str[0])) - { - // 10xx xxxx - unexpected continuation byte - codepoint = 0xFFFD; - } - else if (STARTS_110(str[0])) - { - // 110x xxxx - 2-byte sequence - if (!STARTS_10(str[1])) - { - codepoint = 0xFFFD; - } - else - { - codepoint = - (TAKE(str[0], 5) << 6) | - (TAKE(str[1], 6)); - *codepoint_nbytes = 2; - } - } - else if (STARTS_1110(str[0])) - { - // 1110 xxxx - 3-byte sequence - if (!STARTS_10(str[1]) || !STARTS_10(str[2])) - { - codepoint = 0xFFFD; - } - else - { - codepoint = - (TAKE(str[0], 4) << 12) | - (TAKE(str[1], 6) << 6) | - (TAKE(str[2], 6)); - *codepoint_nbytes = 3; - } - } - else if (STARTS_11110(str[0])) - { - // 1111 0xxx - 4-byte sequence - if (!STARTS_10(str[1]) || !STARTS_10(str[2]) || !STARTS_10(str[3])) - { - codepoint = 0xFFFD; - } - else - { - codepoint = - (TAKE(str[0], 3) << 18) | - (TAKE(str[1], 6) << 12) | - (TAKE(str[2], 6) << 6) | - (TAKE(str[3], 6)); - *codepoint_nbytes = 4; - } - } - else - { - // 1111 1xxx - invalid - codepoint = 0xFFFD; - } - - // Overlong sequence? - if ( - (codepoint <= 0x7F && *codepoint_nbytes > 1) || - (codepoint > 0x7F && codepoint <= 0x7FF && *codepoint_nbytes > 2) || - (codepoint > 0x7FF && codepoint <= 0xFFFF && *codepoint_nbytes > 3) - ) { - codepoint = 0xFFFD; - } - - // UTF-16 surrogates are invalid, so are codepoints after 10FFFF - if (is_illegal(codepoint)) - { - codepoint = 0xFFFD; - } - - return codepoint; -} - -uint32_t UTF8_next(const char** p_str) -{ - /* Get the next codepoint from a string, and advance the pointer. - * Example usage: - * - * const char* str = "asdf"; - * uint32_t codepoint; - * while ((codepoint = UTF8_next(&str))) - * { - * // you have a codepoint congrats - * } - */ - if (p_str == NULL) - { - return 0; - } - - uint8_t codepoint_nbytes; - uint32_t codepoint = UTF8_peek_next(*p_str, &codepoint_nbytes); - *p_str += codepoint_nbytes; - return codepoint; -} - -UTF8_encoding UTF8_encode(uint32_t codepoint) -{ - UTF8_encoding enc = {0}; - - // Pretend the bytes array is unsigned... - unsigned char* bytes = (unsigned char*) &enc.bytes; - - if (is_illegal(codepoint)) - { - codepoint = 0xFFFD; - enc.error = true; - } - - if (codepoint <= 0x7F) - { - enc.nbytes = 1; - bytes[0] = codepoint; - } - else if (codepoint <= 0x7FF) - { - enc.nbytes = 2; - bytes[0] = 0xC0 | (codepoint >> 6); - bytes[1] = 0x80 | (codepoint & 0x3F); - } - else if (codepoint <= 0xFFFF) - { - enc.nbytes = 3; - bytes[0] = 0xE0 | (codepoint >> 12); - bytes[1] = 0x80 | ((codepoint >> 6) & 0x3F); - bytes[2] = 0x80 | (codepoint & 0x3F); - } - else - { - enc.nbytes = 4; - bytes[0] = 0xF0 | (codepoint >> 18); - bytes[1] = 0x80 | ((codepoint >> 12) & 0x3F); - bytes[2] = 0x80 | ((codepoint >> 6) & 0x3F); - bytes[3] = 0x80 | (codepoint & 0x3F); - } - - return enc; -} - -size_t UTF8_total_codepoints(const char* str) -{ - size_t total = 0; - while (UTF8_next(&str)) - { - total++; - } - return total; -} - -size_t UTF8_backspace(const char* str, size_t len) -{ - /* Given a string of length len, - * give the new length after removing the last character. - * In other words, the index at which to write a \0 byte. */ - - for (len -= 1; len > 0; len--) - { - if (!STARTS_10(str[len])) - { - break; - } - } - - return len; -} diff --git a/desktop_version/src/UTF8.h b/desktop_version/src/UTF8.h deleted file mode 100644 index 0f9b1cf1..00000000 --- a/desktop_version/src/UTF8.h +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef UTF8_H -#define UTF8_H - -#include -#include -#include - -#ifdef __cplusplus -extern "C" -{ -#endif - -typedef struct -{ - char bytes[5]; - uint8_t nbytes; - bool error; -} -UTF8_encoding; - - -uint32_t UTF8_peek_next(const char* s_str, uint8_t* codepoint_nbytes); - -uint32_t UTF8_next(const char** p_str); -UTF8_encoding UTF8_encode(uint32_t codepoint); - -size_t UTF8_total_codepoints(const char* str); -size_t UTF8_backspace(const char* str, size_t len); - - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif // UTF8_H diff --git a/desktop_version/src/Unreachable.h b/desktop_version/src/Unreachable.h deleted file mode 100644 index 28b18868..00000000 --- a/desktop_version/src/Unreachable.h +++ /dev/null @@ -1,17 +0,0 @@ -#ifndef UNREACHABLE_H -#define UNREACHABLE_H - -#include - -SDL_NORETURN SDL_INLINE void VVV_unreachable(void) -{ - /* __builtin_unreachable() and __assume(0) execute undefined behavior. - * Otherwise, a noreturn function returning is also undefined behavior. */ -#if _SDL_HAS_BUILTIN(__builtin_unreachable) - __builtin_unreachable(); -#elif defined(_MSC_VER) - __assume(0); -#endif -} - -#endif /* UNREACHABLE_H */ diff --git a/desktop_version/src/UtilityClass.cpp b/desktop_version/src/UtilityClass.cpp index 64766733..e060283d 100644 --- a/desktop_version/src/UtilityClass.cpp +++ b/desktop_version/src/UtilityClass.cpp @@ -4,319 +4,358 @@ #include #include -#include "Constants.h" -#include "Localization.h" #include "Maths.h" -#include "VFormat.h" + +static const char* GCChar(const SDL_GameControllerButton button) +{ + switch (button) + { + case SDL_CONTROLLER_BUTTON_A: + return "A"; + case SDL_CONTROLLER_BUTTON_B: + return "B"; + case SDL_CONTROLLER_BUTTON_X: + return "X"; + case SDL_CONTROLLER_BUTTON_Y: + return "Y"; + case SDL_CONTROLLER_BUTTON_BACK: + return "BACK"; + case SDL_CONTROLLER_BUTTON_GUIDE: + return "GUIDE"; + case SDL_CONTROLLER_BUTTON_START: + return "START"; + case SDL_CONTROLLER_BUTTON_LEFTSTICK: + return "L3"; + case SDL_CONTROLLER_BUTTON_RIGHTSTICK: + return "R3"; + case SDL_CONTROLLER_BUTTON_LEFTSHOULDER: + return "LB"; + case SDL_CONTROLLER_BUTTON_RIGHTSHOULDER: + return "RB"; + default: + SDL_assert(0 && "Unhandled button!"); + return NULL; + } +} int ss_toi(const std::string& str) { - int retval = 0; - bool negative = false; - static const int radix = 10; + int retval = 0; + bool negative = false; + static const int radix = 10; - for (size_t i = 0; i < str.size(); ++i) - { - const char chr = str[i]; + for (size_t i = 0; i < str.size(); ++i) + { + const char chr = str[i]; - if (i == 0 && chr == '-') - { - negative = true; - continue; - } + if (i == 0 && chr == '-') + { + negative = true; + continue; + } - if (SDL_isdigit(chr)) - { - retval *= radix; - retval += chr - '0'; - } - else - { - break; - } - } + if (SDL_isdigit(chr)) + { + retval *= radix; + retval += chr - '0'; + } + else + { + break; + } + } - if (negative) - { - return -retval; - } + if (negative) + { + return -retval; + } - return retval; + return retval; } bool next_split( - size_t* start, - size_t* len, - const char* str, - const char delim + size_t* start, + size_t* len, + const char* str, + const char delim ) { - size_t idx = 0; - *len = 0; + size_t idx = 0; + *len = 0; - if (str[idx] == '\0') - { - return false; - } + if (str[idx] == '\0') + { + return false; + } - while (true) - { - if (str[idx] == delim) - { - *start += 1; - return true; - } - else if (str[idx] == '\0') - { - return true; - } + while (true) + { + if (str[idx] == delim) + { + *start += 1; + return true; + } + else if (str[idx] == '\0') + { + return true; + } - idx += 1; - *start += 1; - *len += 1; - } + idx += 1; + *start += 1; + *len += 1; + } } bool next_split_s( - char buffer[], - const size_t buffer_size, - size_t* start, - const char* str, - const char delim + char buffer[], + const size_t buffer_size, + size_t* start, + const char* str, + const char delim ) { - size_t len = 0; - const size_t prev_start = *start; + size_t len = 0; + const size_t prev_start = *start; - const bool retval = next_split(start, &len, &str[*start], delim); + const bool retval = next_split(start, &len, &str[*start], delim); - if (retval) - { - /* Using SDL_strlcpy() here results in calling SDL_strlen() */ - /* on the whole string, which results in a visible freeze */ - /* if it's a very large string */ - const size_t length = SDL_min(buffer_size - 1, len); - SDL_memcpy(buffer, &str[prev_start], length); - buffer[length] = '\0'; - } + if (retval) + { + /* Using SDL_strlcpy() here results in calling SDL_strlen() */ + /* on the whole string, which results in a visible freeze */ + /* if it's a very large string */ + const size_t length = VVV_min(buffer_size - 1, len); + SDL_memcpy(buffer, &str[prev_start], length); + buffer[length] = '\0'; + } - return retval; + return retval; } UtilityClass::UtilityClass(void) : glow(0), - glowdir(0) + glowdir(0) { - slowsine = 0; + for (size_t i = 0; i < SDL_arraysize(splitseconds); i++) + { + splitseconds[i] = (i * 100) / 30; + } + + slowsine = 0; } std::string UtilityClass::String( int _v ) { - std::ostringstream os; - os << _v; - return(os.str()); + std::ostringstream os; + os << _v; + return(os.str()); } int UtilityClass::Int(const char* str, int fallback /*= 0*/) { - if (!is_number(str)) - { - return fallback; - } + if (!is_number(str)) + { + return fallback; + } - return (int) SDL_strtol(str, NULL, 0); + return (int) SDL_strtol(str, NULL, 0); } -int UtilityClass::hms_to_seconds(int h, int m, int s) +std::string UtilityClass::GCString(const std::vector& buttons) { - return h*3600 + m*60 + s; + std::string retval = ""; + for (size_t i = 0; i < buttons.size(); i += 1) + { + retval += GCChar(buttons[i]); + if ((i + 1) < buttons.size()) + { + retval += ","; + } + } + return retval; } -void UtilityClass::format_time(char* buffer, const size_t buffer_size, int seconds, int frames, bool always_minutes) +std::string UtilityClass::twodigits( int t ) { - int s = seconds % 60; - int m = (seconds / 60) % 60; - int h = seconds / 3600; - - if (h > 0) - { - /* H:MM:SS / H:MM:SS.CC */ - vformat_buf(buffer, buffer_size, - loc::gettext(frames == -1 ? "{hrs}:{min|digits=2}:{sec|digits=2}" : "{hrs}:{min|digits=2}:{sec|digits=2}.{cen|digits=2}"), - "hrs:int, min:int, sec:int, cen:int", - h, m, s, frames * 100 / 30 - ); - } - else if (m > 0 || always_minutes || frames == -1) - { - /* M:SS / M:SS.CC */ - vformat_buf(buffer, buffer_size, - loc::gettext(frames == -1 ? "{min}:{sec|digits=2}" : "{min}:{sec|digits=2}.{cen|digits=2}"), - "min:int, sec:int, cen:int", - m, s, frames * 100 / 30 - ); - } - else - { - /* S.CC */ - vformat_buf(buffer, buffer_size, - loc::gettext("{sec}.{cen|digits=2}"), - "sec:int, cen:int", - s, frames * 100 / 30 - ); - } + if (t < 10) + { + return "0" + String(t); + } + if (t >= 100) + { + return "??"; + } + return String(t); } std::string UtilityClass::timestring( int t ) { - //given a time t in frames, return a time in seconds - char output[SCREEN_WIDTH_CHARS + 1]; - format_time(output, sizeof(output), t / 30, t % 30, false); - return output; + //given a time t in frames, return a time in seconds + std::string tempstring = ""; + int temp = (t - (t % 30)) / 30; + if (temp < 60) //less than one minute + { + t = t % 30; + tempstring = String(temp) + ":" + twodigits(splitseconds[t]); + } + else + { + int temp2 = (temp - (temp % 60)) / 60; + temp = temp % 60; + t = t % 30; + tempstring = String(temp2) + ":" + twodigits(temp) + ":" + twodigits(splitseconds[t]); + } + return tempstring; } -std::string UtilityClass::number_words(int _t, const char* number_class) +std::string UtilityClass::number( int _t ) { - if (loc::lang != "en") - { - return loc::getnumber(_t, number_class); - } + static const std::string ones_place[] = {"One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine"}; + static const std::string tens_place[] = {"Ten", "Twenty", "Thirty", "Forty", "Fifty", "Sixty", "Seventy", "Eighty", "Ninety"}; + static const std::string teens[] = {"Eleven", "Twelve", "Thirteen", "Fourteen", "Fifteen", "Sixteen", "Seventeen", "Eighteen", "Nineteen"}; - static const std::string ones_place[] = {"One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine"}; - static const std::string tens_place[] = {"Ten", "Twenty", "Thirty", "Forty", "Fifty", "Sixty", "Seventy", "Eighty", "Ninety"}; - static const std::string teens[] = {"Eleven", "Twelve", "Thirteen", "Fourteen", "Fifteen", "Sixteen", "Seventeen", "Eighteen", "Nineteen"}; - - if (_t < 0 || _t > 100) - { - return String(_t); - } - else if (_t == 0) - { - return "Zero"; - } - else if (_t == 100) - { - return "One Hundred"; - } - else if (_t >= 1 && _t <= 9) - { - return ones_place[_t-1]; - } - else if (_t >= 11 && _t <= 19) - { - return teens[_t-11]; - } - else if (_t % 10 == 0) - { - return tens_place[(_t/10)-1]; - } - else - { - return tens_place[(_t/10)-1] + " " + ones_place[(_t%10)-1]; - } + if (_t < 0) + { + return "???"; + } + else if (_t > 100) + { + return "Lots"; + } + else if (_t == 0) + { + return "Zero"; + } + else if (_t == 100) + { + return "One Hundred"; + } + else if (_t >= 1 && _t <= 9) + { + return ones_place[_t-1]; + } + else if (_t >= 11 && _t <= 19) + { + return teens[_t-11]; + } + else if (_t % 10 == 0) + { + return tens_place[(_t/10)-1]; + } + else + { + return tens_place[(_t/10)-1] + " " + ones_place[(_t%10)-1]; + } } bool UtilityClass::intersects( SDL_Rect A, SDL_Rect B ) { - return (SDL_HasIntersection(&A, &B) == SDL_TRUE); + return (SDL_HasIntersection(&A, &B) == SDL_TRUE); } void UtilityClass::updateglow(void) { - slowsine++; - if (slowsine >= 64) slowsine = 0; + slowsine++; + if (slowsine >= 64) slowsine = 0; - if (glowdir == 0) { - glow+=2; - if (glow >= 62) glowdir = 1; - }else { - glow-=2; - if (glow < 2) glowdir = 0; - } + if (glowdir == 0) { + glow+=2; + if (glow >= 62) glowdir = 1; + }else { + glow-=2; + if (glow < 2) glowdir = 0; + } } bool is_number(const char* str) { - if (!SDL_isdigit(str[0]) && str[0] != '-') - { - return false; - } + if (!SDL_isdigit(str[0]) && str[0] != '-') + { + return false; + } - if (str[0] == '-' && str[1] == '\0') - { - return false; - } + if (str[0] == '-' && str[1] == '\0') + { + return false; + } - for (size_t i = 1; str[i] != '\0'; ++i) - { - if (!SDL_isdigit(str[i])) - { - return false; - } - } + for (size_t i = 1; str[i] != '\0'; ++i) + { + if (!SDL_isdigit(str[i])) + { + return false; + } + } - return true; + return true; +} + +static bool VVV_isxdigit(const unsigned char digit) +{ + return (digit >= 'a' && digit <= 'f') + || (digit >= 'A' && digit <= 'F') + || SDL_isdigit(digit); } bool is_positive_num(const char* str, const bool hex) { - if (str[0] == '\0') - { - return false; - } + if (str[0] == '\0') + { + return false; + } - for (size_t i = 0; str[i] != '\0'; ++i) - { - if (hex) - { - if (!SDL_isxdigit(str[i])) - { - return false; - } - } - else - { - if (!SDL_isdigit(str[i])) - { - return false; - } - } - } + for (size_t i = 0; str[i] != '\0'; ++i) + { + if (hex) + { + if (!VVV_isxdigit(str[i])) + { + return false; + } + } + else + { + if (!SDL_isdigit(str[i])) + { + return false; + } + } + } - return true; + return true; } bool endsWith(const char* str, const char* suffix) { - const size_t str_size = SDL_strlen(str); - const size_t suffix_size = SDL_strlen(suffix); + const size_t str_size = SDL_strlen(str); + const size_t suffix_size = SDL_strlen(suffix); - if (str_size < suffix_size) - { - return false; - } + if (str_size < suffix_size) + { + return false; + } - return SDL_strcmp(&str[str_size - suffix_size], suffix) == 0; + return SDL_strcmp(&str[str_size - suffix_size], suffix) == 0; } void VVV_fillstring( - char* buffer, - const size_t buffer_size, - const char fillchar + char* buffer, + const size_t buffer_size, + const char fillchar ) { - SDL_memset(buffer, fillchar, buffer_size - 1); - buffer[buffer_size - 1] = '\0'; + SDL_memset(buffer, fillchar, buffer_size - 1); + buffer[buffer_size - 1] = '\0'; } void _VVV_between( - const char* original, - const size_t left_length, - char* middle, - const size_t right_length, - const size_t middle_size + const char* original, + const size_t left_length, + char* middle, + const size_t right_length, + const size_t middle_size ) { - size_t middle_length = SDL_strlen(original); - middle_length -= left_length + right_length; - SDL_strlcpy( - middle, - &original[left_length], - SDL_min(middle_length + 1, middle_size) - ); + size_t middle_length = SDL_strlen(original); + middle_length -= left_length + right_length; + SDL_strlcpy( + middle, + &original[left_length], + VVV_min(middle_length + 1, middle_size) + ); } diff --git a/desktop_version/src/UtilityClass.h b/desktop_version/src/UtilityClass.h index 586dd2d2..b3b6af65 100644 --- a/desktop_version/src/UtilityClass.h +++ b/desktop_version/src/UtilityClass.h @@ -3,6 +3,7 @@ #include #include +#include int ss_toi(const std::string& str); @@ -41,16 +42,7 @@ void VVV_fillstring( if (whine) \ { \ whine = false; \ - vlog_error(message); \ - } \ - do { } while (false) - -#define WHINE_ONCE_ARGS(args) \ - static bool whine = true; \ - if (whine) \ - { \ - whine = false; \ - vlog_error args; \ + puts(message); \ } \ do { } while (false) @@ -76,6 +68,16 @@ void _VVV_between( sizeof(middle) \ ) +#ifndef __has_attribute +# define __has_attribute(x) 0 +#endif + +#if __has_attribute(__fallthrough__) +# define VVV_fallthrough __attribute__((__fallthrough__)) +#else +# define VVV_fallthrough do { } while (false) /* fallthrough */ +#endif + #define MAYBE_FAIL(expr) \ do \ { \ @@ -86,11 +88,6 @@ void _VVV_between( } \ while (false) -/* Positive modulo, because C/C++'s modulo operator sucks and is negative given - * negative divisors. - * WARNING! This double- and triple- evaluates. */ -#define POS_MOD(a, b) (((a) % (b) + (b)) % (b)) - //helperClass class UtilityClass { @@ -101,13 +98,13 @@ public: static int Int(const char* str, int fallback = 0); - int hms_to_seconds(int h, int m, int s); + static std::string GCString(const std::vector& buttons); - void format_time(char* buffer, const size_t buffer_size, int seconds, int frames, bool always_minutes); + std::string twodigits(int t); std::string timestring(int t); - std::string number_words(int _t, const char* number_class); + std::string number(int _t); static bool intersects( SDL_Rect A, SDL_Rect B ); @@ -117,6 +114,7 @@ public: int glow; int slowsine; int glowdir; + int splitseconds[30]; }; #ifndef HELP_DEFINITION diff --git a/desktop_version/src/VFormat.c b/desktop_version/src/VFormat.c deleted file mode 100644 index 09bef427..00000000 --- a/desktop_version/src/VFormat.c +++ /dev/null @@ -1,476 +0,0 @@ -#include "VFormat.h" - -#include -#include - -#include "Alloc.h" -#include "ButtonGlyphs.h" -#include "CWrappers.h" -#include "UTF8.h" - - -static inline bool is_whitespace(char ch) -{ - return ch == ' ' || ch == '\t'; -} - -static inline void trim_whitespace(const char** string, size_t* bytes) -{ - /* Strips leading and trailing whitespace. */ - - while (*bytes > 0 && is_whitespace((*string)[0])) - { - (*string)++; - (*bytes)--; - } - while (*bytes > 0 && is_whitespace((*string)[*bytes - 1])) - { - (*bytes)--; - } -} - -int vformat_button(ActionSet actionset, int action) -{ - /* Pack an ActionSet and Action into a single vararg int. - * action is an Action */ - return (((int) actionset) << 16) | action; -} - -static void vformat_unbutton(ActionSet* actionset, Action* action, const int vararg_value) -{ - // Unpack the ActionSet and Action from a packed vararg value. - *actionset = (ActionSet) (vararg_value >> 16); - action->intval = vararg_value & 0xFFFF; -} - -static inline void call_with_button(format_callback callback, void* userdata, int vararg_value) -{ - /* Call the given callback with the specified button character (from - * Unicode Private Use Area) so the text renderer can display it. */ - - ActionSet actionset; - Action action; - vformat_unbutton(&actionset, &action, vararg_value); - - const char* button_text = BUTTONGLYPHS_get_button(actionset, action, -1); - if (button_text == NULL) - { - callback(userdata, "[null]", 6); - return; - } - callback(userdata, button_text, SDL_strlen(button_text)); -} - -static inline void call_with_upper(format_callback callback, void* userdata, const char* string, size_t bytes) -{ - /* Call the given callback with the specified string, where the first - * letter is changed to uppercase. */ - if (bytes == 0) - { - return; - } - - uint8_t lower_letter_nbytes; - uint32_t lower_letter = UTF8_peek_next(string, &lower_letter_nbytes); - - UTF8_encoding upper_letter = UTF8_encode(LOC_toupper_ch(lower_letter)); - callback(userdata, upper_letter.bytes, upper_letter.nbytes); - callback(userdata, &string[lower_letter_nbytes], bytes - lower_letter_nbytes); -} - - -void vformat_cb_valist( - format_callback callback, - void* userdata, - const char* format_string, - const char* args_index, - va_list args -) -{ - /* Variant of vformat_cb which takes a va_list instead of `...` - * - * Also the core formatting function where everything comes together. - * The callback receives each part of the resulting string. - * These parts are not null-terminated. */ - - const char* cursor = format_string; - - while (true) - { - /* Fast path: maybe we're at the end? */ - if (cursor[0] == '\0') - { - return; - } - - /* Find the next { or }. The } is only needed now for escaping. */ - const char* first_a = SDL_strchr(cursor, '{'); - const char* first_b = SDL_strchr(cursor, '}'); - const char* next_stop = first_a; - if (next_stop == NULL || first_b < next_stop) - { - next_stop = first_b; - } - - if (next_stop == NULL) - { - /* No more placeholders or escapes in this string, run it to the end */ - callback(userdata, cursor, SDL_strlen(cursor)); - return; - } - - /* Output text until the placeholder... */ - callback(userdata, cursor, next_stop - cursor); - cursor = next_stop; - - if (cursor[0] == '}') - { - /* Just handle }}, for symmetry with {{ */ - callback(userdata, cursor, 1); - cursor++; - if (*cursor == '}') - { - cursor++; - } - } - else if (cursor[0] == '{' && cursor[1] == '{') - { - /* Just a {{ */ - callback(userdata, cursor, 1); - cursor += 2; - } - else if (cursor[0] == '{') - { - /* Start of a placeholder! - * A placeholder can consist of one or more parts separated by |, - * the first part always being the key, all others being flags. */ - - const char* placeholder_start = cursor; - cursor++; - const char* name = cursor; - size_t name_len = 0; - - bool flag_wordy = false; - bool flag_wordy2 = false; - int flag_digits = 0; - bool flag_spaces = false; - bool flag_upper = false; - - bool first_iter = true; - do - { - first_a = SDL_strchr(cursor, '|'); - first_b = SDL_strchr(cursor, '}'); - next_stop = first_a; - if (next_stop == NULL || first_b < next_stop) - { - next_stop = first_b; - } - - if (next_stop == NULL) - { - /* Unterminated placeholder */ - callback(userdata, placeholder_start, SDL_strlen(placeholder_start)); - return; - } - - size_t flag_len = next_stop - cursor; - - if (first_iter) - { - name_len = flag_len; - - first_iter = false; - } - else if (flag_len == 5 && SDL_memcmp(cursor, "wordy", 5) == 0) - { - flag_wordy = true; - } - else if (flag_len == 6 && SDL_memcmp(cursor, "wordy2", 6) == 0) - { - flag_wordy2 = true; - } - else if (flag_len >= 8 && SDL_memcmp(cursor, "digits=", 7) == 0) - { - /* strtol stops on the first non-digit anyway, so... */ - flag_digits = SDL_strtol(cursor + 7, NULL, 10); - } - else if (flag_len == 6 && SDL_memcmp(cursor, "spaces", 6) == 0) - { - flag_spaces = true; - } - else if (flag_len == 5 && SDL_memcmp(cursor, "upper", 5) == 0) - { - flag_upper = true; - } - - cursor = next_stop + 1; - } - while (next_stop[0] != '}'); - - /* Now look up the name in the arguments. - * The arguments index string is comma-separated, - * each argument is name:type. */ - va_list args_copy; -#ifndef va_copy /* Older VS releases don't have this yet, just copy the old way */ - args_copy = args; -#else - va_copy(args_copy, args); -#endif - - const char* args_index_cursor = args_index; - - bool match = false; - do - { - while (args_index_cursor[0] == ' ') - { - /* Skip spaces between args */ - args_index_cursor++; - } - - const char* next_comma = SDL_strchr(args_index_cursor, ','); - const char* next_colon = SDL_strchr(args_index_cursor, ':'); - if (next_comma == NULL) - { - next_comma = SDL_strchr(args_index_cursor, '\0'); - } - - if (next_colon == NULL || next_colon > next_comma) - { - break; - } - - const char* arg_name = args_index_cursor; - size_t arg_name_len = next_colon - arg_name; - const char* arg_type = next_colon + 1; - size_t arg_type_len = next_comma - arg_type; - - trim_whitespace(&arg_name, &arg_name_len); - trim_whitespace(&arg_type, &arg_type_len); - - match = (arg_name_len == name_len && SDL_memcmp(arg_name, name, name_len) == 0) - || (arg_name_len == 1 && arg_name[0] == '_'); - - if (arg_type_len == 3 && SDL_memcmp(arg_type, "int", 3) == 0) - { - int value = va_arg(args_copy, int); - - if (match) - { - if (flag_wordy || flag_wordy2) - { - char* number = HELP_number_words(value, flag_wordy2 ? "wordy2" : "wordy"); - if (flag_upper) - { - call_with_upper(callback, userdata, number, SDL_strlen(number)); - } - else - { - callback(userdata, number, SDL_strlen(number)); - } - VVV_free(number); - } - else - { - const char* format = flag_spaces ? "%*d" : "%0*d"; - char buffer[24]; - SDL_snprintf(buffer, sizeof(buffer), format, flag_digits, value); - callback(userdata, buffer, SDL_strlen(buffer)); - } - } - } - else if (arg_type_len == 3 && SDL_memcmp(arg_type, "str", 3) == 0) - { - const char* value = va_arg(args_copy, const char*); - - if (match) - { - if (value == NULL) - { - callback(userdata, "[null]", 6); - } - else if (flag_upper) - { - call_with_upper(callback, userdata, value, SDL_strlen(value)); - } - else - { - callback(userdata, value, SDL_strlen(value)); - } - } - } - else if (arg_type_len == 3 && SDL_memcmp(arg_type, "but", 3) == 0) - { - int vararg_value = va_arg(args_copy, int); - - if (match) - { - call_with_button(callback, userdata, vararg_value); - } - } - else - { - /* Unknown type, now what type do we give va_arg? */ - match = false; - break; - } - - if (match) - { - break; - } - - /* Remember: next_comma can also be the final '\0' */ - args_index_cursor = next_comma + 1; - } - while (args_index_cursor[-1] != '\0'); - - va_end(args_copy); - - if (!match) - { - callback(userdata, "[", 1); - callback(userdata, name, name_len); - callback(userdata, "?]", 2); - } - } - } -} - - -void vformat_cb( - format_callback callback, - void* userdata, - const char* format_string, - const char* args_index, - ... -) -{ - /* Format with a user-supplied callback. - * The callback receives each part of the resulting string. - * These parts are not null-terminated. */ - - va_list args; - va_start(args, args_index); - - vformat_cb_valist(callback, userdata, format_string, args_index, args); - - va_end(args); -} - -typedef struct _buffer_info -{ - size_t total_needed; - char* buffer_cursor; - size_t buffer_left; -} buffer_info; - -static void callback_buffer_append(void* userdata, const char* string, size_t bytes) -{ - /* Callback for vformat_buf. */ - - buffer_info* buf = (buffer_info*) userdata; - buf->total_needed += bytes; - - if (buf->buffer_cursor != NULL && buf->buffer_left > 0) - { - size_t copy_len = SDL_min(bytes, buf->buffer_left); - - SDL_memcpy(buf->buffer_cursor, string, copy_len); - - buf->buffer_cursor += copy_len; - buf->buffer_left -= copy_len; - } -} - -size_t vformat_buf_valist( - char* buffer, - size_t buffer_len, - const char* format_string, - const char* args_index, - va_list args -) -{ - /* Variant of vformat_buf which takes a va_list instead of `...` */ - - buffer_info buf; - buf.total_needed = 1; - buf.buffer_cursor = buffer; - buf.buffer_left = buffer_len; - - if (buf.buffer_left != 0) - { - /* We do still need to write the null terminator */ - buf.buffer_left--; - } - - vformat_cb_valist(callback_buffer_append, (void*) &buf, format_string, args_index, args); - if (buffer != NULL && buffer_len > 0) - { - *buf.buffer_cursor = '\0'; - } - - return buf.total_needed; -} - -size_t vformat_buf( - char* buffer, - size_t buffer_len, - const char* format_string, - const char* args_index, - ... -) -{ - /* Format to the specified buffer. - * Ensures buffer is not overrun, and that it is null-terminated. - * Returns total number of bytes that were needed, or that would have been needed. - * You may pass a NULL buffer and/or size 0 if you only need this needed length. */ - - va_list args; - va_start(args, args_index); - - size_t total_needed = vformat_buf_valist(buffer, buffer_len, format_string, args_index, args); - - va_end(args); - - return total_needed; -} - -char* vformat_alloc_valist( - const char* format_string, - const char* args_index, - va_list args -) -{ - /* Variant of vformat_alloc which takes a va_list instead of `...` */ - - size_t needed = vformat_buf_valist(NULL, 0, format_string, args_index, args); - char* buffer = (char*) SDL_malloc(needed); - if (buffer == NULL) - { - return NULL; - } - vformat_buf_valist(buffer, needed, format_string, args_index, args); - - return buffer; -} - -char* vformat_alloc( - const char* format_string, - const char* args_index, - ... -) -{ - /* Format to an automatically allocated and resized buffer. - * Caller must VVV_free. */ - - va_list args; - va_start(args, args_index); - - char* buffer = vformat_alloc_valist(format_string, args_index, args); - - va_end(args); - - return buffer; -} diff --git a/desktop_version/src/VFormat.h b/desktop_version/src/VFormat.h deleted file mode 100644 index 94b92e2c..00000000 --- a/desktop_version/src/VFormat.h +++ /dev/null @@ -1,139 +0,0 @@ -/* - * == VFormat == - * - * VVVVVV's format strings. See the function declarations below (vformat_*). - * - vformat_cb Calls a user-supplied callback function for each part of - * the resulting string. - * - vformat_buf Fills a user-supplied buffer with the result. - * - vformat_alloc Allocates a buffer with the result (caller must VVV_free). - * - * All include the following parameters: - * - format_string The string which needs placeholders to be filled in - * - args_index A string describing the varargs - * - ... The varargs (like printf-family functions) - * - * Variants ending in _valist are equivalent, but take a va_list instead of a variable - * number of arguments. These use va_copy (they have to) and thus leave the given - * va_list untouched. - * - * The FORMAT STRING can include placeholders, which look like {name} or {name|flags}. - * The name can be user-defined, as long as it appears in the ARGS INDEX. - * Flags are separated by |, invalid flags are ignored. - * - * The valid flags are: - * - wordy [ints only] use number words (Twenty) instead of digits (20) - * - digits=n [ints only] force minimum n digits, like n=5 --> 00031 - * - spaces [only if using digits=n] use leading spaces instead of 0s - * - upper uppercase the first character with loc::toupper_ch - * - * For example, {aa|digits=3|spaces} fills in the argument with the name "aa". - * Space is reserved for 3 digits, and unused columns are padded with spaces. - * This is equivalent to %3d in printf-family functions. - * - * Literal { and } characters can be included in the text by doubling them, - * like {{ and }}. Including curly braces of any kind inside placeholder tags, - * (as part of the name or flags), is unsupported. Included string arguments - * aren't subject to further parsing, so including curly braces in string - * arguments poses no problems. - * - * The ARGS INDEX defines the names and types of the arguments you pass. - * In the args index string, arguments are separated by commas, and each argument is - * in the format name:type. Whitespace around the : and , separators is ignored. - * - * The valid types are: - * - int Signed integer - * - str const char* - * - but Controller button icon: vformat_button(actionset, action) - * - * Special case: if an argument name is a single underscore (_), it matches - * any name not found earlier in the list. This should normally not be needed. - * - * Full example: - * - * char buffer[100]; - * vformat_buf(buffer, sizeof(buffer), - * "{crewmate} got {number} out of {total} trinkets in {m}:{s|digits=2}.{ms|digits=3}", - * "number:int, total:int, crewmate:str, m:int, s:int, ms:int", - * 2, 20, "Vermilion", 2, 3, 1 - * ); - * - * => "Vermilion got 2 out of 20 trinkets in 2:03.001" - * - * ERROR CONDITIONS: These functions should not cause any crashes or UB unless you - * mislead them on the programming side of things. For example, if your args index doesn't - * align with the varargs you actually pass, or you pass the wrong buffer size into - * vformat_buf. That means it should be safe to use user-generated content as a format - * string. If the format string refers to an argument name that is not found in the index, - * that placeholder will be filled in as [name?] (where `name` is filled in with the name). - * If you pass a NULL string argument, it will be rendered as [null]. - */ - - -#ifndef VFORMAT_H -#define VFORMAT_H - -#include -#include - -#include "ActionSets.h" - -#ifdef __cplusplus -extern "C" -{ -#endif - -typedef void (*format_callback)(void* userdata, const char* string, size_t bytes); - - -int vformat_button(ActionSet actionset, int action); - - -void vformat_cb_valist( - format_callback callback, - void* userdata, - const char* format_string, - const char* args_index, - va_list args -); - -void vformat_cb( - format_callback callback, - void* userdata, - const char* format_string, - const char* args_index, - ... -); - -size_t vformat_buf_valist( - char* buffer, - size_t buffer_len, - const char* format_string, - const char* args_index, - va_list args -); - -size_t vformat_buf( - char* buffer, - size_t buffer_len, - const char* format_string, - const char* args_index, - ... -); - -char* vformat_alloc_valist( - const char* format_string, - const char* args_index, - va_list args -); - -char* vformat_alloc( - const char* format_string, - const char* args_index, - ... -); - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif /* VFORMAT_H */ diff --git a/desktop_version/src/Version.h b/desktop_version/src/Version.h new file mode 100644 index 00000000..e1bf0cbc --- /dev/null +++ b/desktop_version/src/Version.h @@ -0,0 +1,8 @@ +#ifndef VERSION_H +#define VERSION_H + +#ifdef VERSION_H_OUT_EXISTS +#include "Version.h.out" +#endif + +#endif /* VERSION_H */ diff --git a/desktop_version/src/Version.h.in b/desktop_version/src/Version.h.in new file mode 100644 index 00000000..0837b9cb --- /dev/null +++ b/desktop_version/src/Version.h.in @@ -0,0 +1,7 @@ +#ifndef VERSION_H_OUT +#define VERSION_H_OUT + +#define INTERIM_COMMIT "@INTERIM_COMMIT@" +#define COMMIT_DATE "@COMMIT_DATE@" + +#endif /* VERSION_H_OUT */ diff --git a/desktop_version/src/Vlogging.c b/desktop_version/src/Vlogging.c deleted file mode 100644 index 15c6a69a..00000000 --- a/desktop_version/src/Vlogging.c +++ /dev/null @@ -1,294 +0,0 @@ -#include "Vlogging.h" - -#include -#include - -#if defined(__ANDROID__) || TARGET_OS_IPHONE -// forward to SDL logging on Android, since stdout/stderr are /dev/null -// they exist on iOS, but just get forwarded to the system log anyway, so might as well provide proper metadata -#define VLOG_USE_SDL 1 -#endif - -#ifdef VLOG_USE_SDL -# include -#elif defined(_WIN32) -# define WIN32_LEAN_AND_MEAN -# include -#elif defined(__unix__) || defined(__APPLE__) -# include -#endif - -#define COLOR(EXPR) (color_enabled && color_supported ? EXPR : "") - -#define Color_RESET COLOR("\x1b[0m") -#define Color_BOLD COLOR("\x1b[1m") -#define Color_BOLD_YELLOW COLOR("\x1b[1;33m") -#define Color_BOLD_RED COLOR("\x1b[1;31m") -#define Color_BOLD_GRAY COLOR("\x1b[1;90m") - -#ifdef __ANDROID__ -const int color_supported = 0; -#else -static int color_supported = 0; -#endif - -static int output_enabled = 1; -static int color_enabled = 1; -static int debug_enabled = 0; -static int info_enabled = 1; -static int warn_enabled = 1; -static int error_enabled = 1; - -static void check_color_support(void); - -void vlog_init(void) -{ -#ifdef VLOG_USE_SDL - SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_VERBOSE); -#endif - check_color_support(); -} - -void vlog_toggle_output(const int enable_output) -{ - output_enabled = enable_output; -} - -void vlog_toggle_color(const int enable_color) -{ - color_enabled = enable_color; -} - -void vlog_toggle_debug(const int enable_debug) -{ - debug_enabled = enable_debug; -} - -void vlog_toggle_info(const int enable_info) -{ - info_enabled = enable_info; -} - -void vlog_toggle_warn(const int enable_warn) -{ - warn_enabled = enable_warn; -} - -void vlog_toggle_error(const int enable_error) -{ - error_enabled = enable_error; -} - -SDL_PRINTF_VARARG_FUNC(1) void vlog_debug(const char* text, ...) -{ - va_list list; - - if (!output_enabled || !debug_enabled) - { - return; - } - -#ifdef VLOG_USE_SDL - va_start(list, text); - SDL_LogMessageV(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_DEBUG, text, list); - va_end(list); -#else - printf(Color_BOLD_GRAY); - printf("[DEBUG]"); - printf(Color_RESET); - printf(" "); - - va_start(list, text); - vprintf(text, list); - va_end(list); - - putchar('\n'); -#endif -} - -SDL_PRINTF_VARARG_FUNC(1) void vlog_info(const char* text, ...) -{ - va_list list; - - if (!output_enabled || !info_enabled) - { - return; - } - -#ifdef VLOG_USE_SDL - va_start(list, text); - SDL_LogMessageV(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO, text, list); - va_end(list); -#else - printf(Color_BOLD); - printf("[INFO]"); - printf(Color_RESET); - printf(" "); - - va_start(list, text); - vprintf(text, list); - va_end(list); - - putchar('\n'); -#endif -} - -SDL_PRINTF_VARARG_FUNC(1) void vlog_warn(const char* text, ...) -{ - va_list list; - - if (!output_enabled || !warn_enabled) - { - return; - } - -#ifdef VLOG_USE_SDL - va_start(list, text); - SDL_LogMessageV(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_WARN, text, list); - va_end(list); -#else - fprintf(stderr, Color_BOLD_YELLOW); - fprintf(stderr, "[WARN]"); - fprintf(stderr, Color_RESET); - fprintf(stderr, " "); - - va_start(list, text); - vfprintf(stderr, text, list); - va_end(list); - - fputc('\n', stderr); -#endif -} - -SDL_PRINTF_VARARG_FUNC(1) void vlog_error(const char* text, ...) -{ - va_list list; - - if (!output_enabled || !error_enabled) - { - return; - } - -#ifdef VLOG_USE_SDL - va_start(list, text); - SDL_LogMessageV(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_ERROR, text, list); - va_end(list); -#else - fprintf(stderr, Color_BOLD_RED); - fprintf(stderr, "[ERROR]"); - fprintf(stderr, Color_RESET); - fprintf(stderr, " "); - - va_start(list, text); - vfprintf(stderr, text, list); - va_end(list); - - fputc('\n', stderr); -#endif -} - -#ifdef _WIN32 -void vlog_open_console(void) -{ - static int run_once = 0; - if (run_once) - { - return; - } - run_once = 1; - - const BOOL success = AllocConsole(); - if (!success) - { - /* Debug, not error, because it might not be an error. - * (E.g. there is already an attached console.) */ - vlog_debug( - "Could not open console: AllocConsole() failed with %d", - GetLastError() - ); - return; - } - - const FILE* handle = freopen("CON", "w", stdout); - if (handle == NULL) - { - vlog_error("Could not redirect STDOUT to console."); - } - - handle = freopen("CON", "w", stderr); - if (handle == NULL) - { - vlog_error("Could not redirect STDERR to console."); - } - - handle = freopen("CON", "r", stdin); - if (handle == NULL) - { - vlog_error("Could not redirect STDIN to console."); - } - - check_color_support(); - - if (!SetConsoleOutputCP(CP_UTF8)) - { - vlog_warn( - "Could not set code page for console output to UTF-8: " - "SetConsoleOutputCP() failed with %d", - GetLastError() - ); - } -} -#endif /* _WIN32 */ - -static void check_color_support(void) -{ -#ifdef _WIN32 - /* VT100 colors are supported since Windows 10 build 16257, - * but it's not enabled by default. So we have to set it. */ - - const HANDLE hStdout = GetStdHandle(STD_OUTPUT_HANDLE); - if (hStdout == INVALID_HANDLE_VALUE) - { - vlog_error( - "Could not set color support: GetStdHandle() failed with %d", - GetLastError() - ); - return; - } - - const HANDLE hStderr = GetStdHandle(STD_ERROR_HANDLE); - if (hStderr == INVALID_HANDLE_VALUE) - { - vlog_error( - "Could not enable color support: GetStdHandle() failed with %d", - GetLastError() - ); - return; - } - - /* Older VS releases don't have this defined yet */ - #ifndef ENABLE_VIRTUAL_TERMINAL_PROCESSING - #define ENABLE_VIRTUAL_TERMINAL_PROCESSING 0x0004 - #endif - const BOOL success = SetConsoleMode( - hStdout, ENABLE_PROCESSED_OUTPUT | ENABLE_VIRTUAL_TERMINAL_PROCESSING - ); - if (!success) - { - /* Debug, not error, because it might not be an error. - * (E.g. this version of Windows doesn't support VT100 colors.) */ - vlog_debug( - "Could not enable color support: SetConsoleMode() failed with %d", - GetLastError() - ); - return; - } - - color_supported = 1; -#elif (defined(__unix__) || defined(__APPLE__)) && !defined(VLOG_USE_SDL) - if (isatty(STDOUT_FILENO) && isatty(STDERR_FILENO)) - { - color_supported = 1; - } -#endif -} diff --git a/desktop_version/src/Vlogging.h b/desktop_version/src/Vlogging.h deleted file mode 100644 index 99d203a8..00000000 --- a/desktop_version/src/Vlogging.h +++ /dev/null @@ -1,41 +0,0 @@ -#ifndef VLOGGING_H -#define VLOGGING_H - -#ifdef __cplusplus -extern "C" -{ -#endif - -#include - -void vlog_init(void); - -#ifdef _WIN32 -void vlog_open_console(void); -#endif - -void vlog_toggle_output(int enable_output); - -void vlog_toggle_color(int enable_color); - -void vlog_toggle_debug(int enable_debug); - -void vlog_toggle_info(int enable_info); - -void vlog_toggle_warn(int enable_warn); - -void vlog_toggle_error(int enable_error); - -SDL_PRINTF_VARARG_FUNC(1) void vlog_debug(const char* text, ...); - -SDL_PRINTF_VARARG_FUNC(1) void vlog_info(const char* text, ...); - -SDL_PRINTF_VARARG_FUNC(1) void vlog_warn(const char* text, ...); - -SDL_PRINTF_VARARG_FUNC(1) void vlog_error(const char* text, ...); - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif /* VLOGGING_H */ diff --git a/desktop_version/src/WarpClass.cpp b/desktop_version/src/WarpClass.cpp index 951ecd83..269199f0 100644 --- a/desktop_version/src/WarpClass.cpp +++ b/desktop_version/src/WarpClass.cpp @@ -3,1139 +3,1138 @@ #include "Game.h" #include "Entity.h" #include "MakeAndPlay.h" +#include "UtilityClass.h" const short* warpclass::loadlevel(int rx, int ry) { - int t; + int t; - rx -= 100; - ry -= 100; - rx += 50 - 14; - ry += 49; //warp + rx -= 100; + ry -= 100; + rx += 50 - 14; + ry += 49; //warp - t = rx + (ry * 100); - const short* result; - rcol = 0; - warpx = false; - warpy = false; + t = rx + (ry * 100); + const short* result; + rcol = 0; + warpx = false; + warpy = false; - roomname = "Untitled room"; - roomname_special = false; + roomname = "Untitled room ["+help.String(rx) + "," + help.String(ry)+"]"; - switch(t) - { + switch(t) + { #if !defined(MAKEANDPLAY) - case rn(50,50): - { - static const short contents[] = { - 120,120,120,120,120,120,120,120,120,120,120,120,120,200,80,202,0,0,0,0,0,0,0,0,200,80,202,120,120,120,120,120,120,120,120,120,120,120,120,120, - 120,120,120,120,120,120,120,120,120,120,120,120,120,200,80,202,0,0,0,0,0,0,0,0,200,80,202,120,120,120,120,120,120,120,120,120,120,120,120,120, - 120,120,120,120,120,120,120,120,120,120,120,120,120,200,80,202,0,0,0,0,0,0,0,0,200,80,202,120,120,120,120,120,120,120,120,120,120,120,120,120, - 161,161,161,161,161,161,161,161,161,161,161,161,161,122,80,202,0,0,0,0,0,0,0,0,200,80,202,120,120,120,120,120,120,120,120,120,120,120,120,120, - 80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,202,0,0,0,0,0,0,0,0,200,80,202,120,120,120,120,120,120,120,120,120,120,120,120,120, - 241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,242,0,0,0,0,0,0,0,0,200,80,202,120,120,120,120,120,120,120,120,120,120,120,120,120, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,80,202,120,120,120,120,120,120,120,120,120,120,120,120,120, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,80,202,120,120,120,120,120,120,120,120,120,120,120,120,120, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,80,202,120,120,120,120,120,120,120,120,120,120,120,120,120, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,80,202,120,120,120,120,120,120,120,120,120,120,120,120,120, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,80,202,120,120,120,120,120,120,120,120,120,120,120,120,120, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,80,202,120,120,120,120,120,120,120,120,120,120,120,120,120, - 161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,162,160,161,161,161,161,161,161,162,200,80,202,120,120,120,120,120,120,120,120,120,120,120,120,120, - 80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,202,200,80,80,80,80,80,80,202,200,80,202,120,120,120,120,120,120,120,120,120,120,120,120,120, - 241,241,241,241,241,241,241,241,241,241,241,241,241,82,80,202,200,80,80,80,80,80,80,202,200,80,121,161,161,161,161,161,161,161,161,161,161,161,161,161, - 120,120,120,120,120,120,120,120,120,120,120,120,120,200,80,202,200,80,80,80,80,80,80,202,200,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80, - 120,120,120,120,120,120,120,120,120,120,120,120,120,200,80,202,240,241,241,241,241,241,241,242,240,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241, - 120,120,120,120,120,120,120,120,120,120,120,120,120,200,80,202,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 120,120,120,120,120,120,120,120,120,120,120,120,120,200,80,202,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 120,120,120,120,120,120,120,120,120,120,120,120,120,200,80,202,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 120,120,120,120,120,120,120,120,120,120,120,120,120,200,80,202,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 120,120,120,120,120,120,120,120,120,120,120,120,120,200,80,202,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 120,120,120,120,120,120,120,120,120,120,120,120,120,200,80,202,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 120,120,120,120,120,120,120,120,120,120,120,120,120,200,80,202,0,0,0,0,0,0,0,0,160,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161, - 120,120,120,120,120,120,120,120,120,120,120,120,120,200,80,202,0,0,0,0,0,0,0,0,200,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80, - 120,120,120,120,120,120,120,120,120,120,120,120,120,200,80,202,0,0,0,0,0,0,0,0,200,80,81,241,241,241,241,241,241,241,241,241,241,241,241,241, - 120,120,120,120,120,120,120,120,120,120,120,120,120,200,80,202,0,0,0,0,0,0,0,0,200,80,202,120,120,120,120,120,120,120,120,120,120,120,120,120, - 120,120,120,120,120,120,120,120,120,120,120,120,120,200,80,202,0,0,0,0,0,0,0,0,200,80,202,120,120,120,120,120,120,120,120,120,120,120,120,120, - 120,120,120,120,120,120,120,120,120,120,120,120,120,200,80,202,0,0,0,0,0,0,0,0,200,80,202,120,120,120,120,120,120,120,120,120,120,120,120,120, - 120,120,120,120,120,120,120,120,120,120,120,120,120,200,80,202,0,0,0,0,0,0,0,0,200,80,202,120,120,120,120,120,120,120,120,120,120,120,120,120, - }; - - obj.createentity(288, 168, 10, 1, 50500); // (savepoint) - - if(game.intimetrial) - { - obj.createblock(0, 0, 0, 8, 240); - } - - rcol = 0; - warpy = true; - roomname = "This is how it is"; - result = contents; - break; - } - - case rn(51,50): - { - - static const short contents[] = { - 247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,248,206,86,208,246,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 167,167,167,167,167,168,166,167,167,167,167,168,0,0,0,0,206,86,208,0,0,0,0,166,167,167,167,167,167,167,167,167,168,166,167,167,167,167,167,167, - 247,247,247,247,247,248,206,86,86,86,86,208,0,0,0,0,206,86,208,0,0,0,0,206,86,86,86,86,86,86,86,86,208,246,247,247,247,247,247,247, - 0,0,0,0,0,0,206,86,86,86,86,208,0,0,0,0,206,86,208,0,0,0,0,206,86,87,247,247,247,247,88,86,208,0,0,0,0,0,0,0, - 0,0,0,0,0,0,206,86,86,86,86,208,0,0,0,0,206,86,208,0,0,0,0,206,86,208,126,126,126,126,206,86,208,0,0,0,0,0,0,0, - 0,0,0,0,0,0,206,86,86,86,86,208,0,0,0,0,206,86,208,0,0,0,0,206,86,208,126,126,126,126,206,86,208,0,0,0,0,0,0,0, - 0,0,0,0,0,0,246,247,247,247,247,248,0,0,0,0,206,86,208,0,0,0,0,206,86,208,126,126,126,126,206,86,208,0,0,0,0,0,0,0, - 0,0,0,0,0,0,166,167,167,167,167,168,0,0,0,0,206,86,208,0,0,0,0,206,86,208,126,126,126,126,206,86,208,0,0,0,0,0,0,0, - 0,0,0,0,0,0,206,86,86,86,86,208,0,0,0,0,206,86,208,0,0,0,0,206,86,127,167,167,167,167,128,86,208,0,0,0,0,0,0,0, - 167,167,168,0,0,0,206,86,86,86,86,208,0,0,0,0,206,86,208,0,0,0,0,206,86,86,86,86,86,86,86,86,208,0,0,0,0,166,167,167, - 247,247,248,0,0,0,206,86,86,86,86,208,0,0,0,0,206,86,208,0,0,0,0,246,247,247,247,247,247,247,247,247,248,0,0,0,0,246,247,247, - 0,0,0,0,0,0,206,86,86,86,86,208,0,0,0,0,206,86,208,0,0,0,0,0,0,0,0,0,0,0,166,167,168,0,0,0,0,0,0,0, - 0,0,0,0,0,0,206,86,86,86,86,208,0,0,0,0,206,86,208,0,0,0,0,0,0,0,0,0,0,0,206,86,208,0,0,0,0,0,0,0, - 0,0,0,0,0,0,206,86,86,86,86,208,0,0,0,0,206,86,208,0,0,0,0,0,0,0,0,0,0,0,246,247,248,0,0,0,0,0,0,0, - 0,0,0,0,0,0,206,86,86,86,86,208,0,0,0,0,206,86,208,0,0,0,0,166,167,168,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,206,86,86,86,86,208,0,0,0,0,206,86,208,0,0,0,0,206,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,246,247,247,247,247,248,0,0,0,0,246,247,248,0,0,0,0,246,247,248,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 167,167,167,167,167,168,0,0,0,0,0,0,0,0,0,0,166,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167, - 86,86,86,86,86,208,0,0,0,0,0,0,0,0,0,0,206,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86, - 247,247,247,88,86,208,0,0,0,0,0,0,0,0,0,0,206,86,87,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247, - 126,126,126,206,86,208,0,0,0,0,0,0,0,0,0,0,206,86,208,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, - 126,126,126,206,86,208,0,0,0,0,166,167,167,167,167,168,206,86,208,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, - 126,126,126,206,86,208,0,0,0,0,206,86,86,86,86,208,206,86,208,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, - 126,126,126,206,86,208,0,0,0,0,206,86,86,86,86,208,206,86,208,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, - }; - rcol = 2; - warpx = true; - roomname = "A Bisected Spiral"; - result = contents; - break; - } - - - case rn(51,51): - { - - static const short contents[] = { - 83,83,83,83,83,205,0,0,0,0,203,83,83,83,83,83,83,205,0,0,0,0,203,83,83,83,83,83,83,205,0,0,0,0,203,83,83,83,83,83, - 83,83,83,83,83,205,0,0,0,0,203,83,83,83,83,83,83,205,0,0,0,0,203,83,83,83,83,83,83,205,0,0,0,0,203,83,83,83,83,83, - 244,244,244,244,244,245,0,0,0,0,243,244,244,244,244,244,244,245,0,0,0,0,243,244,244,244,244,244,244,245,0,0,0,0,243,244,244,244,244,244, - 164,164,164,165,0,0,0,0,0,0,0,0,163,164,164,165,0,0,0,0,0,0,0,0,163,164,164,165,0,0,0,0,0,0,0,0,163,164,164,164, - 83,83,83,205,0,0,0,0,0,0,0,0,203,83,83,205,0,0,0,0,0,0,0,0,203,83,83,205,0,0,0,0,0,0,0,0,203,83,83,83, - 83,83,83,205,0,0,0,0,0,0,0,0,203,83,83,205,0,0,0,0,0,0,0,0,203,83,83,205,0,0,0,0,0,0,0,0,203,83,83,83, - 83,83,83,205,0,0,0,0,0,0,0,0,203,83,83,205,0,0,0,0,0,0,0,0,203,83,83,205,0,0,0,0,0,0,0,0,203,83,83,83, - 83,83,83,205,0,0,0,0,0,0,0,0,203,83,83,205,0,0,0,0,0,0,0,0,203,83,83,205,0,0,0,0,0,0,0,0,243,244,244,244, - 83,83,83,205,0,0,0,0,0,0,0,0,203,83,83,205,0,0,0,0,0,0,0,0,203,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0, - 83,83,83,205,0,0,0,0,0,0,0,0,203,83,83,205,0,0,0,0,0,0,0,0,203,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0, - 83,83,83,205,0,0,0,0,0,0,0,0,203,83,83,205,0,0,0,0,0,0,0,0,203,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0, - 83,83,83,205,0,0,0,0,0,0,0,0,203,83,83,205,0,0,0,0,0,0,0,0,203,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0, - 83,83,83,205,0,0,0,0,0,0,0,0,203,83,83,205,0,0,0,0,0,0,0,0,203,83,83,205,163,164,164,164,164,164,164,164,164,164,164,165, - 83,83,83,205,0,0,0,0,0,0,0,0,203,83,83,205,0,0,0,0,0,0,0,0,203,83,83,205,203,83,83,83,83,83,83,83,83,83,83,205, - 83,83,83,205,0,0,0,0,0,0,0,0,203,83,83,205,0,0,0,0,0,0,0,0,243,244,244,245,243,244,244,244,244,244,244,244,244,244,244,245, - 83,83,83,205,0,0,0,0,0,0,0,0,203,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,163,164,164,164, - 83,83,83,205,0,0,0,0,0,0,0,0,203,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83,83,83, - 83,83,83,205,0,0,0,0,0,0,0,0,203,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83,83,83, - 83,83,83,205,0,0,0,0,0,0,0,0,203,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83,83,83, - 83,83,83,205,0,0,0,0,0,0,0,0,203,83,83,205,163,164,164,164,164,164,164,164,164,164,164,165,0,0,0,0,0,0,0,0,203,83,83,83, - 83,83,83,205,0,0,0,0,0,0,0,0,203,83,83,205,203,83,83,83,83,83,83,83,83,83,83,205,0,0,0,0,0,0,0,0,203,83,83,83, - 83,83,83,205,0,0,0,0,0,0,0,0,243,244,244,245,243,244,244,244,244,244,244,244,244,244,244,245,0,0,0,0,0,0,0,0,203,83,83,83, - 83,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,163,164,164,164,164,165,0,0,0,0,0,0,0,0,203,83,83,83, - 83,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83,83,83,83,205,0,0,0,0,0,0,0,0,203,83,83,83, - 83,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83,83,83,83,205,0,0,0,0,0,0,0,0,203,83,83,83, - 244,244,244,245,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,243,244,244,244,244,245,0,0,0,0,0,0,0,0,243,244,244,244, - 164,164,164,164,164,165,0,0,0,0,163,164,164,164,164,164,164,165,0,0,0,0,163,164,164,164,164,164,164,165,0,0,0,0,163,164,164,164,164,164, - 83,83,83,83,83,205,0,0,0,0,203,83,83,83,83,83,83,205,0,0,0,0,203,83,83,83,83,83,83,205,0,0,0,0,203,83,83,83,83,83, - 83,83,83,83,83,205,0,0,0,0,203,83,83,83,83,83,83,205,0,0,0,0,203,83,83,83,83,83,83,205,0,0,0,0,203,83,83,83,83,83, - 83,83,83,83,83,205,0,0,0,0,203,83,83,83,83,83,83,205,0,0,0,0,203,83,83,83,83,83,83,205,0,0,0,0,203,83,83,83,83,83, - }; - - obj.createentity(248, 80, 10, 1, 51510); // (savepoint) - obj.createentity(136, 128, 1, 3, 3, 128, 120, 288, 152); // Enemy, bounded - obj.createentity(104, 192, 10, 1, 51511); // (savepoint) - rcol = 1; - warpy = true; - roomname = "Take the Red Pill"; - result = contents; - break; - } - - case rn(52,51): - { - - static const short contents[] = { - 95,95,95,95,95,217,0,0,0,0,215,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95, - 256,256,256,256,256,257,0,0,0,0,255,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 176,176,176,176,176,176,176,176,176,177,175,176,177,0,0,0,0,175,176,177,175,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176, - 256,256,256,256,256,256,256,256,256,257,215,95,217,0,0,0,0,215,95,217,255,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256, - 0,0,0,0,0,0,0,0,0,0,215,95,217,0,0,0,0,255,256,257,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,215,95,217,0,0,0,0,175,176,177,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,215,95,217,0,0,0,0,215,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,215,95,217,0,0,0,0,215,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 176,176,176,176,176,177,0,0,0,0,215,95,217,0,0,0,0,215,95,217,0,0,0,0,175,176,176,177,175,176,176,176,177,175,176,176,176,176,176,176, - 95,95,95,95,95,217,0,0,0,0,215,95,217,0,0,0,0,215,95,217,0,0,0,0,215,95,95,217,215,95,95,95,217,215,95,95,95,95,95,95, - 95,95,95,95,95,217,0,0,0,0,215,95,217,0,0,0,0,215,95,217,0,0,0,0,215,95,95,217,215,95,95,95,217,215,95,95,95,95,95,95, - 95,95,95,95,95,217,0,0,0,0,215,95,217,0,0,0,0,215,95,217,0,0,0,0,215,95,95,217,215,95,95,95,217,215,95,95,95,95,95,95, - 256,256,256,256,256,257,0,0,0,0,215,95,217,0,0,0,0,215,95,217,0,0,0,0,215,95,95,217,255,256,256,256,257,255,256,256,256,256,256,256, - 0,0,0,0,0,0,0,0,0,0,215,95,217,0,0,0,0,215,95,217,0,0,0,0,215,95,95,217,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,215,95,217,0,0,0,0,215,95,217,0,0,0,0,215,95,95,217,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,215,95,217,0,0,0,0,215,95,217,0,0,0,0,215,95,95,217,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,255,256,257,0,0,0,0,215,95,217,0,0,0,0,255,256,256,257,0,0,0,0,0,0,0,0,0,0,0,0, - 176,176,176,176,176,176,176,176,176,176,176,176,177,0,0,0,0,255,256,257,0,0,0,0,175,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176, - 95,95,95,95,95,95,95,95,95,95,95,95,217,0,0,0,0,0,0,0,0,0,0,0,215,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95, - 256,256,256,256,256,256,256,256,256,256,97,95,217,0,0,0,0,0,0,0,0,0,0,0,215,95,96,256,256,256,256,256,256,256,256,256,256,256,256,256, - 135,135,135,135,135,135,135,135,135,135,215,95,217,0,0,0,0,0,0,0,0,0,0,0,215,95,217,135,135,135,135,135,135,135,135,135,135,135,135,135, - 135,135,135,135,135,135,135,135,135,135,215,95,217,0,0,0,0,0,0,0,0,0,0,0,215,95,217,135,135,135,135,135,135,135,135,135,135,135,135,135, - 135,135,135,135,135,135,135,135,135,135,215,95,217,175,176,176,176,176,176,176,176,176,176,177,215,95,217,135,135,135,135,135,135,135,135,135,135,135,135,135, - 135,135,135,135,135,135,135,135,135,135,215,95,217,215,95,95,95,95,95,95,95,95,95,217,215,95,217,135,135,135,135,135,135,135,135,135,135,135,135,135, - 135,135,135,135,135,135,135,135,135,135,215,95,217,215,95,95,95,95,95,95,95,95,95,217,215,95,217,135,135,135,135,135,135,135,135,135,135,135,135,135, - 135,135,135,135,135,135,135,135,135,135,215,95,217,215,95,95,95,95,95,95,95,95,95,217,215,95,217,135,135,135,135,135,135,135,135,135,135,135,135,135, - }; - - obj.createentity(32, 24, 1, 3, 4, -56, -40, 384, 312); // Enemy, bounded - obj.createentity(96, 24, 1, 3, 4, -56, -40, 384, 312); // Enemy, bounded - obj.createentity(160, 24, 1, 3, 4, -56, -40, 384, 312); // Enemy, bounded - obj.createentity(224, 24, 1, 3, 4, -56, -40, 384, 312); // Enemy, bounded - obj.createentity(232, 152, 10, 1, 51520); // (savepoint) - rcol = 5; - warpx = true; - roomname = "Short Circuit"; - result = contents; - break; - } - - case rn(52,50): - { - - static const short contents[] = { - 213,212,92,214,172,174,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,92,92,92, - 213,212,92,214,252,254,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,92,92,92, - 213,212,92,214,0,0,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,92,92,92, - 213,212,92,214,0,0,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,92,92,92, - 213,212,92,214,0,0,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,92,92,92, - 213,212,92,214,0,0,0,0,0,0,0,0,252,254,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,92,92,92, - 213,212,92,214,0,0,0,0,0,0,0,0,7,7,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,92,92,92, - 213,212,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,214,0,0,0,0,0,0,252,254,0,0,0,0,0,0,212,92,92,92, - 213,212,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,214,0,0,0,0,0,0,7,7,0,0,0,0,0,0,212,92,92,92, - 213,212,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,92, - 213,212,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,92, - 213,212,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,252,253,253,253, - 213,212,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,252,254,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 213,212,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 213,212,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 213,212,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 213,212,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 213,212,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,172,173,173,173, - 213,212,92,214,0,0,0,0,0,0,0,0,6,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,92, - 213,212,92,214,0,0,0,0,0,0,0,0,172,174,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,92, - 213,212,92,214,0,0,0,0,0,0,0,0,212,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,6,0,0,0,0,0,0,212,92,92,92, - 213,212,92,214,0,0,0,0,0,0,0,0,212,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,172,174,0,0,0,0,0,0,212,92,92,92, - 213,212,92,214,0,0,0,0,0,0,0,0,212,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,92,92,92, - 213,212,92,214,0,0,0,0,0,0,0,0,212,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,92,92,92, - 213,212,92,214,0,0,0,0,0,0,0,0,212,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,92,92,92, - 213,212,92,214,0,0,0,0,0,0,0,0,212,214,0,0,0,0,0,0,6,6,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,92,92,92, - 213,212,92,214,0,0,0,0,0,0,0,0,212,214,0,0,0,0,0,0,172,174,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,92,92,92, - 213,212,92,214,172,174,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,92,92,92, - 213,212,92,214,212,214,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,92,92,92, - 213,212,92,214,252,254,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,92,92,92, - }; - - obj.createentity(32, 16, 10, 0, 50520); // (savepoint) - rcol = 4; - warpy = true; - roomname = "As you like it"; - result = contents; - break; - } - - - case rn(53,50): - { - - static const short contents[] = { - 250,250,250,250,250,250,251,0,0,0,209,211,249,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250, - 0,0,0,0,0,0,0,0,0,0,209,211,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,209,211,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,209,211,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 170,170,170,170,170,170,170,170,170,171,209,211,0,0,0,169,170,170,170,170,170,170,170,171,169,171,169,170,170,170,170,170,170,170,170,170,170,170,170,170, - 250,250,250,250,250,250,250,250,250,251,209,211,0,0,0,249,250,250,250,250,250,250,250,251,209,211,249,250,250,250,250,250,250,250,250,250,250,250,250,250, - 0,0,0,0,0,0,0,0,0,0,209,211,0,0,0,0,0,0,0,0,0,0,0,0,209,211,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,209,211,0,0,0,0,0,0,0,0,0,0,0,0,209,211,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,209,211,0,0,0,0,0,0,0,0,0,0,0,0,209,211,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 170,170,170,170,171,169,171,0,0,0,209,211,169,170,170,170,170,170,170,170,170,171,0,0,209,211,0,0,169,170,170,170,170,170,170,170,170,170,170,170, - 89,89,89,89,211,209,211,0,0,0,209,211,209,89,89,89,89,89,89,89,89,211,0,0,209,211,0,0,209,89,89,89,89,89,89,89,89,89,89,89, - 250,250,250,250,251,209,211,0,0,0,209,211,249,250,250,250,250,250,250,250,250,251,0,0,209,211,0,0,249,250,250,250,250,250,250,250,250,250,250,250, - 0,0,0,0,0,209,211,0,0,0,209,211,0,0,0,0,0,0,0,0,169,171,0,0,209,211,0,0,169,171,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,209,211,0,0,0,209,211,0,0,0,0,0,0,0,0,209,211,0,0,209,211,0,0,209,211,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,209,211,0,0,0,209,211,0,0,0,0,0,0,0,0,209,211,0,0,209,211,0,0,209,211,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,209,211,0,0,0,209,211,0,0,0,169,171,0,0,0,209,211,0,0,209,211,0,0,209,211,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,209,211,0,0,0,209,211,0,0,0,209,211,0,0,0,209,211,0,0,209,211,0,0,209,211,0,0,0,0,0,0,0,0,0,0, - 170,170,170,170,171,209,211,0,0,0,209,211,0,0,0,209,211,0,0,0,209,211,0,0,209,211,0,0,209,211,0,0,0,169,171,169,170,170,170,170, - 89,89,89,89,211,209,211,0,0,0,209,211,0,0,0,209,211,0,0,0,209,211,0,0,209,211,0,0,209,211,0,0,0,209,211,209,89,89,89,89, - 250,250,250,250,251,249,251,0,0,0,209,211,0,0,0,209,211,0,0,0,209,211,0,0,249,251,0,0,209,211,0,0,0,209,211,249,250,250,250,250, - 0,0,0,0,0,0,0,0,0,0,209,211,0,0,0,209,211,0,0,0,209,211,0,0,0,0,0,0,209,211,0,0,0,209,211,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,209,211,0,0,0,209,211,0,0,0,209,211,0,0,0,0,0,0,209,211,0,0,0,209,211,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,209,211,0,0,0,209,211,0,0,0,209,211,0,0,0,0,0,0,209,211,0,0,0,209,211,0,0,0,0,0, - 170,170,170,170,170,170,170,170,170,171,209,211,0,0,0,209,211,0,0,0,209,211,169,170,170,170,170,171,209,211,0,0,0,209,211,0,0,0,169,170, - 250,250,250,250,250,250,250,250,250,251,249,251,0,0,0,209,211,0,0,0,249,251,249,250,250,250,250,251,249,251,0,0,0,209,211,0,0,0,249,250, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,209,211,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,209,211,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,209,211,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,209,211,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,209,211,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,209,211,0,0,0,0,0, - 170,170,170,170,170,170,170,170,170,170,170,170,170,170,171,209,211,169,170,170,170,170,170,170,170,170,170,170,170,170,170,170,171,209,211,169,170,170,170,170, - 89,89,89,89,89,89,89,89,89,89,89,89,89,89,211,209,211,209,89,89,89,89,89,89,89,89,89,89,89,89,89,89,211,209,211,209,89,89,89,89, - }; - - obj.createentity(16, 120, 10, 1, 50530); // (savepoint) - rcol = 3; - warpx = true; - roomname = "Maze With No Entrance"; - result = contents; - break; - } - - case rn(53,49): - { - - static const short contents[] = { - 126,126,126,126,206,86,208,0,0,0,206,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86, - 126,126,126,126,206,86,208,0,0,0,246,247,248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,246,247, - 126,126,126,126,206,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 126,126,126,126,206,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 126,126,126,126,206,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 126,126,126,126,206,86,208,0,0,0,0,0,0,0,0,0,0,166,167,168,0,0,0,0,0,0,0,0,0,0,0,166,167,168,0,0,0,0,0,0, - 126,126,126,126,206,86,208,0,0,0,0,0,0,0,0,0,0,206,86,208,0,0,0,0,0,0,0,0,0,0,0,206,86,208,0,0,0,0,0,0, - 126,126,126,126,206,86,208,0,0,0,0,0,0,0,0,0,0,206,86,208,0,0,0,0,0,0,0,0,0,0,0,206,86,208,0,0,0,0,0,0, - 126,126,126,126,206,86,208,0,0,0,0,0,0,0,0,0,0,206,86,208,0,0,0,0,0,0,0,0,0,0,0,206,86,208,0,0,0,0,0,0, - 126,126,126,126,206,86,208,0,0,0,0,0,0,0,0,0,0,206,86,208,0,0,0,0,0,0,0,0,0,0,0,206,86,208,0,0,0,0,0,0, - 126,126,126,126,206,86,208,166,167,167,167,167,168,0,0,0,0,206,86,208,0,0,0,0,0,0,0,0,0,0,0,206,86,208,0,0,0,0,166,167, - 126,126,126,126,206,86,208,206,86,86,86,86,208,6,6,6,6,206,86,208,6,6,6,6,6,6,6,6,6,6,6,206,86,208,6,6,6,6,206,86, - 126,126,126,126,206,86,208,206,86,86,86,86,208,166,167,167,168,206,86,208,166,167,167,168,166,167,168,166,167,167,168,206,86,208,166,167,167,168,206,86, - 126,126,126,126,206,86,208,206,86,86,86,86,208,206,86,86,208,206,86,208,206,86,86,208,206,86,208,206,86,86,208,206,86,208,206,86,86,208,206,86, - 126,126,126,126,206,86,208,206,86,86,86,86,208,206,86,86,208,206,86,208,206,86,86,208,206,86,208,206,86,86,208,206,86,208,206,86,86,208,206,86, - 126,126,126,126,206,86,208,206,86,86,86,86,208,206,86,86,208,206,86,208,206,86,86,208,206,86,208,206,86,86,208,206,86,208,206,86,86,208,206,86, - 126,126,126,126,206,86,208,206,86,86,86,86,208,246,247,247,248,246,247,248,246,247,247,248,206,86,208,246,247,247,248,246,247,248,246,247,247,248,206,86, - 126,126,126,126,206,86,208,206,86,86,86,86,208,7,7,7,7,7,7,7,7,7,7,7,206,86,208,7,7,7,7,7,7,7,7,7,7,7,206,86, - 126,126,126,126,206,86,208,246,247,247,247,247,248,0,0,0,0,0,0,0,0,0,0,0,206,86,208,0,0,0,0,0,0,0,0,0,0,0,246,247, - 126,126,126,126,206,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0, - 126,126,126,126,206,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0, - 126,126,126,126,206,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0, - 126,126,126,126,206,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0, - 126,126,126,126,206,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,246,247,248,0,0,0,0,0,0,0,0,0,0,0,0,0, - 126,126,126,126,206,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 126,126,126,126,206,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 126,126,126,126,206,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 126,126,126,126,206,86,208,0,0,0,166,167,168,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,166,167, - 126,126,126,126,206,86,208,0,0,0,206,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86, - 126,126,126,126,206,86,208,0,0,0,206,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86, - }; - - obj.createentity(64, 152, 10, 0, 49530); // (savepoint) - rcol = 2; - warpy = true; - roomname = "As we go up, we go down"; - result = contents; - break; - } - - case rn(54,49): - { - - static const short contents[] = { - 80,80,80,202,200,202,200,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,202,200,202,200,80, - 241,241,241,242,200,202,240,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,242,200,202,240,241, - 0,0,0,0,200,202,7,7,7,7,7,7,160,161,161,162,7,7,7,7,7,7,7,160,161,161,162,7,7,7,7,7,7,7,7,7,200,202,0,0, - 0,0,0,0,200,202,0,0,0,0,0,0,240,241,241,242,0,0,0,0,0,0,0,240,241,241,242,0,0,0,0,0,0,0,0,0,240,242,0,0, - 0,0,0,0,200,202,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,200,202,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,200,202,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,200,202,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,200,202,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,240,242,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 161,161,161,161,161,162,0,0,0,0,160,162,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,160,161,161,161,161,161, - 80,80,80,80,80,202,0,0,0,0,200,202,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,80,80,80,80,80, - 80,80,80,80,80,202,0,0,0,0,200,202,6,6,6,6,0,0,0,0,0,0,0,6,6,6,6,0,0,0,0,0,0,0,200,80,80,80,80,80, - 80,80,80,80,80,202,0,0,0,0,200,202,160,161,161,162,0,0,0,0,0,0,0,160,161,161,162,0,0,0,0,0,0,0,200,80,80,80,80,80, - 80,80,80,80,80,202,0,0,0,0,200,202,200,80,80,202,0,0,0,0,0,0,0,200,80,80,202,0,0,0,0,0,0,0,200,80,80,80,80,80, - 80,80,80,80,80,202,0,0,0,0,200,202,240,241,241,242,0,0,0,0,0,0,0,240,241,241,242,0,0,0,0,0,0,0,200,80,80,80,80,80, - 80,80,80,80,80,202,0,0,0,0,200,202,7,7,7,7,0,0,0,0,0,0,0,7,7,7,7,0,0,0,0,0,0,0,200,80,80,80,80,80, - 80,80,80,80,80,202,0,0,0,0,200,202,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,80,80,80,80,80, - 241,241,241,241,241,242,0,0,0,0,200,202,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,240,241,241,241,241,241, - 0,0,0,0,0,0,0,0,0,0,200,202,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,200,202,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,200,202,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,200,202,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,200,202,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,200,202,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,200,202,0,0,0,0,0,0,0,0,0,0,0,160,161,161,162,0,0,0,0,0,0,0,0,0,160,162,0,0, - 0,0,0,0,0,0,0,0,0,0,200,202,0,0,0,0,6,6,6,6,6,6,6,240,241,241,242,6,6,6,6,6,6,6,6,6,200,202,0,0, - 161,161,161,161,161,161,161,161,161,162,200,202,0,0,0,0,160,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,162,200,202,160,161, - 80,80,80,80,80,80,80,80,80,202,200,202,0,0,0,0,200,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,202,200,202,200,80, - 80,80,80,80,80,80,80,80,80,202,200,202,0,0,0,0,200,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,202,200,202,200,80, - }; - - obj.createentity(296, 64, 10, 1, 49540); // (savepoint) - obj.createentity(152-4-15+8, 32, 1, 0, 6, 128, 32, 288, 200); // Enemy, bounded - obj.createentity(240-4-15+8, 186, 1, 1, 6, 128, 32, 288, 200); // Enemy, bounded - obj.createentity(296, 152, 10, 0, 49541); // (savepoint) - rcol = 0; - warpx = true; - roomname = "Time to get serious"; - result = contents; - break; - } - - - case rn(54,50): - { - - static const short contents[] = { - 86,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,86, - 86,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,86, - 86,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,86, - 86,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,86, - 86,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,86, - 86,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,86, - 86,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,86, - 86,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,86, - 86,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,246,247,247, - 86,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 86,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 86,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 86,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 86,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 86,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 86,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 86,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,166,167,168,166,167,167, - 86,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,246,247,248,206,86,86, - 86,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,86, - 86,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,86, - 86,86,208,0,0,0,0,0,0,0,0,166,167,167,167,168,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,86, - 86,86,208,0,0,0,0,0,0,0,0,246,247,247,247,248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,86, - 86,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,86, - 86,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,86, - 86,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,86, - 86,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,86, - 86,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,86, - 86,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,86, - 86,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,86, - 86,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,86, - }; - if(!game.intimetrial || game.translator_exploring) - { - obj.createentity((7 * 8) + 4, (6 * 8), 14); //Teleporter! - } - rcol = 2; - warpy = true; - roomname = "Wheeler's Wormhole"; - result = contents; - break; - } - - case rn(55,50): - { - - static const short contents[] = { - 212,92,92,214,252,253,253,254,212,92,92,214,212,92,92,214,212,92,92,214,212,92,92,214,212,92,92,214,212,92,92,214,212,92,92,214,212,92,92,214, - 212,92,92,214,0,0,0,0,252,253,253,254,212,92,92,214,212,92,92,214,212,92,92,214,212,92,92,214,212,92,92,214,212,92,92,214,212,92,92,214, - 212,92,92,214,0,0,0,0,0,0,0,0,252,253,253,254,212,92,92,214,212,92,92,214,212,92,92,214,212,92,92,214,212,92,92,214,212,92,92,214, - 212,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,214,212,92,92,214,212,92,92,214,212,92,92,214,212,92,92,214,212,92,92,214, - 212,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,214,252,253,253,254,212,92,92,214,212,92,92,214,212,92,92,214,212,92,92,214, - 212,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,214,0,0,0,0,252,253,253,254,212,92,92,214,212,92,92,214,212,92,92,214, - 212,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,214,0,0,0,0,0,0,0,0,252,253,253,254,212,92,92,214,212,92,92,214, - 212,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,214,212,92,92,214, - 252,253,253,254,0,0,0,0,0,0,0,0,0,0,0,0,252,253,253,254,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,214,252,253,253,254, - 0,0,0,0,0,0,0,0,172,173,173,174,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,214,0,0,0,0, - 0,0,0,0,0,0,0,0,212,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,214,0,0,0,0, - 0,0,0,0,0,0,0,0,212,92,92,214,0,0,0,0,172,173,173,174,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,214,0,0,0,0, - 0,0,0,0,0,0,0,0,212,92,92,214,0,0,0,0,252,253,253,254,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,214,0,0,0,0, - 0,0,0,0,0,0,0,0,212,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0,172,173,173,174,0,0,0,0,212,92,92,214,0,0,0,0, - 0,0,0,0,0,0,0,0,212,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0,252,253,253,254,0,0,0,0,212,92,92,214,0,0,0,0, - 0,0,0,0,0,0,0,0,212,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,214,0,0,0,0, - 172,173,173,174,0,0,0,0,212,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,252,253,253,254,172,173,173,174, - 252,253,253,254,172,173,173,174,212,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0,172,173,173,174,0,0,0,0,0,0,0,0,252,253,253,254, - 0,0,0,0,252,253,253,254,212,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,252,253,253,254,172,173,173,174,0,0,0,0,0,0,0,0,212,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,252,253,253,254,172,173,173,174,0,0,0,0,212,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,252,253,253,254,172,173,173,174,212,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,214,212,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,214,212,92,92,214,172,173,173,174,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,214,212,92,92,214,212,92,92,214,172,173,173,174,0,0,0,0, - 172,173,173,174,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,214,212,92,92,214,212,92,92,214,212,92,92,214,172,173,173,174, - 212,92,92,214,172,173,173,174,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,214,212,92,92,214,212,92,92,214,212,92,92,214,212,92,92,214, - 212,92,92,214,212,92,92,214,172,173,173,174,0,0,0,0,0,0,0,0,212,92,92,214,212,92,92,214,212,92,92,214,212,92,92,214,212,92,92,214, - 212,92,92,214,212,92,92,214,212,92,92,214,172,173,173,174,0,0,0,0,212,92,92,214,212,92,92,214,212,92,92,214,212,92,92,214,212,92,92,214, - 212,92,92,214,212,92,92,214,212,92,92,214,212,92,92,214,0,0,0,0,212,92,92,214,212,92,92,214,212,92,92,214,212,92,92,214,212,92,92,214, - }; - - obj.createentity(96, 72, 1, 3, 8, 64, 56, 256, 152); // Enemy, bounded - obj.createentity(240, 120, 1, 2, 8, 64, 56, 256, 152); // Enemy, bounded - obj.createentity(72, 16, 10, 0, 50550); // (savepoint) - obj.createentity(264, 176, 10, 1, 50551); // (savepoint) - rcol = 4; - warpx = true; - roomname = "Ascending and Descending"; - result = contents; - break; - } - - case rn(55,51): - { - - static const short contents[] = { - 83,83,83,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,83, - 244,244,244,245,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,243,245,0,0,0,0,243,245,0,0,0,0,203,83, - 0,0,0,0,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83, - 0,0,0,0,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83, - 0,0,0,0,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83, - 0,0,0,0,0,0,0,0,203,205,0,0,0,0,243,245,0,0,0,0,243,245,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83, - 164,164,164,165,0,0,0,0,203,205,0,0,0,0,163,164,165,163,164,164,164,164,164,164,164,164,164,164,164,164,165,163,164,165,0,0,0,0,203,83, - 83,83,83,205,0,0,0,0,243,245,0,0,0,0,203,83,205,203,83,83,83,83,83,83,83,83,83,83,83,83,205,203,83,205,0,0,0,0,203,83, - 83,83,83,205,0,0,0,0,0,0,0,0,0,0,243,244,245,243,244,244,244,244,244,244,244,244,244,244,244,244,245,243,244,245,0,0,0,0,203,83, - 83,83,83,205,0,0,0,0,0,0,0,0,0,0,163,164,164,164,164,164,164,164,164,165,7,7,7,7,7,7,7,7,163,165,0,0,0,0,203,83, - 83,83,83,205,0,0,0,0,0,0,0,0,0,0,243,244,244,244,244,244,244,244,244,245,0,0,0,0,0,0,0,0,243,245,0,0,0,0,203,83, - 83,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83, - 83,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83, - 83,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83, - 83,83,83,205,0,0,0,0,163,165,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83, - 83,83,83,205,0,0,0,0,203,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83, - 83,83,83,205,0,0,0,0,203,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83, - 83,83,83,205,0,0,0,0,203,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83, - 83,83,83,205,0,0,0,0,203,205,0,0,0,0,163,165,0,0,0,0,0,0,0,0,163,164,164,164,164,164,164,164,164,165,0,0,0,0,203,83, - 83,83,83,205,0,0,0,0,203,205,0,0,0,0,243,245,6,6,6,6,6,6,6,6,243,244,244,244,244,244,244,244,244,245,0,0,0,0,203,83, - 83,83,83,205,0,0,0,0,203,205,0,0,0,0,163,164,165,163,164,164,164,164,164,164,164,164,164,164,164,164,165,163,164,165,0,0,0,0,203,83, - 83,83,83,205,0,0,0,0,203,205,0,0,0,0,203,83,205,203,83,83,83,83,83,83,83,83,83,83,83,83,205,203,83,205,0,0,0,0,203,83, - 83,83,83,205,0,0,0,0,203,205,0,0,0,0,243,244,245,243,244,244,244,244,244,244,244,244,244,244,244,244,245,243,244,245,0,0,0,0,203,83, - 83,83,83,205,0,0,0,0,203,205,0,0,0,0,163,165,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,163,165,0,0,0,0,203,83, - 83,83,83,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,205,0,0,0,0,203,83, - 83,83,83,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,205,0,0,0,0,203,83, - 83,83,83,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,205,0,0,0,0,203,83, - 83,83,83,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,163,165,0,0,0,0,163,165,0,0,0,0,203,205,0,0,0,0,203,83, - 83,83,83,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,83, - 83,83,83,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,83, - }; - - obj.createentity(280, 24, 1, 2, 3, 128, 16, 304, 216); // Enemy, bounded - obj.createentity(136, 192, 1, 3, 3, 128, 16, 304, 216); // Enemy, bounded - obj.createentity(40, 8, 1, 0, 10, 24, -56, 120, 280); // Enemy, bounded - obj.createentity(88, 8, 1, 0, 10, 24, -40, 120, 272); // Enemy, bounded - obj.createentity(256, 128, 10, 1, 51550); // (savepoint) - obj.createentity(136, 32, 10, 1, 51551); // (savepoint) - rcol = 1; - warpy = true; - roomname = "Shockwave Rider"; - result = contents; - break; - } - - case rn(54,51): - { - - static const short contents[] = { - 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,211,209,89,89,211,209,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89, - 250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,251,249,250,250,251,249,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,171,169,170,170,171,0,0,0,169,170,170,170,170,170,170,170,170,170,170,170,170,170,170, - 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,211,209,89,89,211,0,0,0,209,89,89,89,89,89,89,89,89,89,89,89,89,89,89, - 250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,251,209,89,89,211,0,0,0,249,250,250,250,250,250,250,250,250,250,250,250,250,250,250, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,249,250,250,251,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,7,7,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,6,6,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,169,170,170,171,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 170,170,170,170,170,170,170,170,170,170,170,170,170,170,171,0,0,0,209,89,89,211,169,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170, - 89,89,89,89,89,89,89,89,89,89,89,89,89,89,211,0,0,0,209,89,89,211,209,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89, - 250,250,250,250,250,250,250,250,250,250,250,250,250,250,251,0,0,0,209,89,89,211,249,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,249,250,250,251,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,7,7,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,6,6,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,169,170,170,171,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,171,209,89,89,211,0,0,0,169,170,170,170,170,170,170,170,170,170,170,170,170,170,170, - 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,211,209,89,89,211,0,0,0,209,89,89,89,89,89,89,89,89,89,89,89,89,89,89, - 250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,251,249,250,250,251,0,0,0,249,250,250,250,250,250,250,250,250,250,250,250,250,250,250, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,171,169,170,170,171,169,170,170,170,170,170,170,170,170,171,0,0,0,0,169,170,170,170, - 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,211,209,89,89,211,209,89,89,89,89,89,89,89,89,211,0,0,0,0,209,89,89,89, - 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,211,209,89,89,211,209,89,89,89,89,89,89,89,89,211,0,0,0,0,209,89,89,89, - }; - - obj.createentity(296, 32, 10, 1, 51540); // (savepoint) - obj.createentity(184, 192, 1, 18, 48, -800, -24, 4000, 264); // Enemy, bounded - obj.createentity(88, 136, 1, 17, 48, -800, -32, 4000, 272); // Enemy, bounded - obj.createentity(184, 80, 1, 18, 48, -800, -32, 4000, 272); // Enemy, bounded - - - obj.createentity(8, 32, 20, 1); // (terminal) - obj.createblock(5, 8-8, 32, 20, 16, 17); - - rcol = 3; - warpx = true; - roomname = "Sweeney's Maze"; - result = contents; - break; - } - - case rn(54,52): - { - - static const short contents[] = { - 95,95,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,175,177,0,0,0,0,215,95,95,95, - 256,256,256,257,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,257,0,0,0,0,255,256,256,256, - 176,177,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,175,176, - 95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95, - 95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95, - 95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95, - 95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95, - 95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95, - 95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95, - 95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95, - 95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95, - 95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95, - 95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95, - 95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95, - 95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95, - 95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95, - 95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95, - 95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95, - 95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95, - 95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95, - 95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95, - 95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95, - 256,257,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,256, - 176,176,176,177,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,175,177,0,0,0,0,175,176,176,176, - 95,95,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,217,0,0,0,0,215,95,95,95, - 95,95,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,257,0,0,0,0,215,95,95,95, - }; - - obj.createentity(288, 200, 10, 1, 52540); // (savepoint) - obj.createentity(48, 16, 1, 1, 10, 0, -40, 320, 296); // Enemy, bounded - obj.createentity(64, 16+8+4+2, 1, 1, 10, 0, -48, 320, 280); // Enemy, bounded - obj.createentity(80, 16+16+8+4, 1, 1, 10, 0, -40, 320, 280); // Enemy, bounded - obj.createentity(96, 16+24+12+6, 1, 1, 10, 0, -40, 320, 304); // Enemy, bounded - obj.createentity(112, 16+32+16+8, 1, 1, 10, 0, -48, 320, 288); // Enemy, bounded - obj.createentity(128, 16+40+20+10, 1, 1, 10, 0, -40, 320, 280); // Enemy, bounded - obj.createentity(144, 16+48+24+12, 1, 1, 10, 0, -56, 320, 296); // Enemy, bounded - obj.createentity(160, 16+56+28+14, 1, 1, 10, 0, -48, 320, 288); // Enemy, bounded - obj.createentity(176, 16+64+32+16, 1, 1, 10, 0, -48, 320, 296); // Enemy, bounded - obj.createentity(192, 16+72+36+18, 1, 1, 10, 0, -40, 320, 280); // Enemy, bounded - obj.createentity(208, 16+80+40+20, 1, 1, 10, 0, -48, 320, 280); // Enemy, bounded - rcol = 5; - warpy = true; - roomname = "Mind The Gap"; - result = contents; - break; - } - - case rn(53,52): - { - - static const short contents[] = { - 207,207,207,207,207,207,207,207,207,207,207,207,207,206,86,208,206,208,0,0,0,0,206,208,206,86,208,207,207,207,207,206,86,208,246,247,247,248,206,86, - 207,207,207,207,207,207,207,207,207,207,207,207,207,206,86,208,206,208,0,0,0,0,206,208,206,86,208,207,207,207,207,206,86,208,0,0,0,0,206,86, - 167,167,167,167,167,167,167,167,167,167,167,167,167,128,86,208,206,208,0,0,0,0,206,208,206,86,127,167,167,167,167,128,86,208,0,0,0,0,206,86, - 86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,208,206,208,0,0,0,0,206,208,206,86,86,86,86,86,86,86,86,208,0,0,0,0,206,86, - 247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,248,206,208,0,0,0,0,206,208,246,247,247,247,247,247,247,247,247,248,0,0,0,0,246,247, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,246,248,0,0,0,0,246,248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,166,168,0,0,0,0,166,168,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 166,168,0,0,0,0,166,168,166,167,167,167,167,167,167,168,206,208,0,0,0,0,206,208,166,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167, - 246,248,0,0,0,0,246,248,246,247,247,247,247,247,247,248,206,208,0,0,0,0,206,208,246,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,246,248,0,0,0,0,246,248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,166,168,0,0,0,0,166,168,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,168,206,208,0,0,0,0,206,208,166,167,167,167,167,167,167,168,166,168,0,0,0,0,166,168, - 247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,248,206,208,0,0,0,0,206,208,246,247,247,247,247,247,247,248,246,248,0,0,0,0,246,248, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,246,248,0,0,0,0,246,248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,166,168,0,0,0,0,166,168,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 166,168,0,0,0,0,166,168,166,167,167,167,167,167,167,168,206,208,0,0,0,0,206,208,166,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167, - 246,248,0,0,0,0,246,248,246,247,247,247,247,247,247,248,246,248,0,0,0,0,246,248,246,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167, - 86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86, - 86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86, - }; - - obj.createentity(152, 200, 10, 1, 52530); // (savepoint) - obj.createentity(248, 48, 1, 3, 5, -24, -24, 344, 256); // Enemy, bounded - obj.createentity(152, 48, 1, 3, 5, -24, -24, 344, 256); // Enemy, bounded - obj.createentity(152, 96, 1, 2, 5, -24, -24, 344, 256); // Enemy, bounded - obj.createentity(56, 96, 1, 2, 5, -24, -24, 344, 256); // Enemy, bounded - obj.createentity(104, 144, 1, 3, 5, -24, -24, 344, 256); // Enemy, bounded - obj.createentity(200, 144, 1, 3, 5, -24, -24, 344, 256); // Enemy, bounded - obj.createentity(280, 16, 9, 12); //Shiny Trinket - - - obj.createentity(24, 200, 20, 1); // (terminal) - obj.createblock(5, 24-8, 200, 20, 16, 18); - rcol = 2; - warpx = true; - roomname = "Edge Games"; - result = contents; - break; - } - - case rn(53,51): - { - - static const short contents[] = { - 83,83,205,0,0,0,0,203,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,83,83, - 83,83,205,0,0,0,0,203,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,83,83, - 83,83,205,0,0,0,0,203,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,83,83, - 83,83,205,0,0,0,0,203,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,83,83, - 244,244,245,0,0,0,0,243,245,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,243,245,0,0,0,0,243,245,0,0,0,0,243,244,244, - 0,0,0,0,0,0,163,165,0,0,0,0,163,165,0,0,0,0,163,164,164,164,164,164,164,165,0,0,0,0,163,165,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,83,83,83,83,83,83,205,0,0,0,0,203,205,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,83,83,83,83,83,83,205,0,0,0,0,203,205,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,243,245,0,0,0,0,243,245,0,0,0,0,243,244,244,244,244,244,244,245,0,0,0,0,243,245,0,0,0,0,0,0,0,0, - 164,164,164,164,164,164,165,0,0,0,0,163,165,0,0,0,0,163,165,0,0,0,0,163,165,0,0,0,0,163,165,0,0,0,0,163,164,164,164,164, - 83,83,83,83,83,83,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,83,83,83,83, - 83,83,83,83,83,83,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,83,83,83,83, - 244,244,244,244,244,244,245,0,0,0,0,243,245,0,0,0,0,243,245,0,0,0,0,243,245,0,0,0,0,243,245,0,0,0,0,243,244,244,244,244, - 0,0,0,0,163,165,0,0,0,0,163,165,0,0,0,0,163,165,0,0,0,0,163,165,0,0,0,0,163,165,0,0,0,0,163,165,0,0,0,0, - 0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0, - 0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0, - 0,0,0,0,243,245,0,0,0,0,243,245,0,0,0,0,243,245,0,0,0,0,243,245,0,0,0,0,243,245,0,0,0,0,243,245,0,0,0,0, - 0,0,0,163,165,0,0,0,0,163,165,0,0,0,0,163,165,0,0,0,0,0,0,0,0,0,0,163,165,0,0,0,0,163,165,0,0,0,0,0, - 0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,0,0,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,0, - 0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,0,0,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,0, - 0,0,0,243,245,0,0,0,0,243,245,0,0,0,0,243,245,0,0,0,0,0,0,0,0,0,0,243,245,0,0,0,0,243,245,0,0,0,0,0, - 164,164,164,165,0,0,0,0,163,165,0,0,0,0,163,164,164,164,164,164,164,164,164,164,164,164,164,165,0,0,0,0,163,165,0,0,0,0,163,164, - 83,83,83,205,0,0,0,0,203,205,0,0,0,0,203,83,83,83,83,83,83,83,83,83,83,83,83,205,0,0,0,0,203,205,0,0,0,0,203,83, - 83,83,83,205,0,0,0,0,203,205,0,0,0,0,203,83,83,83,83,83,83,83,83,83,83,83,83,205,0,0,0,0,203,205,0,0,0,0,203,83, - 244,244,244,245,0,0,0,0,243,245,0,0,0,0,243,244,244,244,244,244,244,244,244,244,244,244,244,245,0,0,0,0,243,245,0,0,0,0,243,244, - 164,164,165,0,0,0,0,163,165,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,163,165,0,0,0,0,163,165,0,0,0,0,163,164,164, - 83,83,205,0,0,0,0,203,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,83,83, - 83,83,205,0,0,0,0,203,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,83,83, - 83,83,205,0,0,0,0,203,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,83,83, - 83,83,205,0,0,0,0,203,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,83,83, - }; - - obj.createentity(152, 112, 13); - rcol = 1; - warpx = true; - warpy = true; - roomname = "The Brown Gate"; - result = contents; - break; - } - - case rn(55,49): - { - - static const short contents[] = { - 0,0,212,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,214,0,0, - 0,0,212,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,214,0,0, - 0,0,252,253,254,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,252,253,254,0,0, - 6,6,172,173,174,0,0,0,0,0,0,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,0,0,0,0,172,173,174,6,6, - 173,174,212,92,214,0,0,0,0,0,0,172,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,174,0,0,0,0,212,92,214,172,173, - 253,254,252,253,254,0,0,0,0,0,0,252,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,254,0,0,0,0,252,253,254,252,253, - 0,0,0,0,0,0,0,0,0,0,0,7,7,7,7,7,7,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,6,6,6,0,0,0,0,6,6,6,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,172,173,173,174,0,0,0,0,172,173,173,174,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,172,173,173,174,0,0,0,0,0,212,92,92,214,0,0,0,0,212,92,92,214,0,0,0,0,0,172,173,173,174,0,0,0,0,0, - 6,6,6,6,6,252,253,253,254,6,6,6,6,6,252,253,253,254,0,0,0,0,252,253,253,254,6,6,6,6,6,252,253,253,254,6,6,6,6,6, - 173,173,173,173,173,173,173,173,173,173,173,173,173,174,172,173,174,0,0,0,0,0,0,172,173,174,172,173,173,173,173,173,173,173,173,173,173,173,173,173, - 92,92,92,92,92,92,92,92,92,92,92,92,92,214,212,92,214,0,0,0,0,0,0,212,92,214,212,92,92,92,92,92,92,92,92,92,92,92,92,92, - 253,253,253,253,253,253,253,253,253,253,253,253,253,254,212,92,214,0,0,0,0,0,0,212,92,214,252,253,253,253,253,253,253,253,253,253,253,253,253,253, - 7,7,172,173,174,7,7,7,7,7,7,7,7,7,212,92,214,0,0,0,0,0,0,212,92,214,7,7,7,7,7,7,7,7,7,172,173,174,7,7, - 0,0,212,92,214,0,0,0,0,0,0,0,0,0,212,92,214,172,173,173,173,173,174,212,92,214,0,0,0,0,0,0,0,0,0,212,92,214,0,0, - 0,0,252,253,254,0,0,0,0,0,0,0,0,0,252,253,254,252,253,253,253,253,254,252,253,254,0,0,0,0,0,0,0,0,0,252,253,254,0,0, - 0,0,172,173,174,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,172,173,174,0,0, - 0,0,212,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,214,0,0, - 0,0,212,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,214,0,0, - 0,0,212,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,214,0,0, - 0,0,212,92,214,0,0,0,0,172,173,173,173,173,173,174,0,0,0,0,0,0,0,0,172,173,173,173,173,173,174,0,0,0,0,212,92,214,0,0, - 0,0,212,92,214,0,0,0,0,252,253,253,253,253,253,254,0,0,0,0,0,0,0,0,252,253,253,253,253,253,254,0,0,0,0,212,92,214,0,0, - 0,0,212,92,214,0,0,0,0,7,7,7,7,7,7,7,0,0,0,0,0,0,0,0,7,7,7,7,7,7,7,0,0,0,0,212,92,214,0,0, - 0,0,212,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,214,0,0, - 0,0,212,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,214,0,0, - 0,0,212,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,214,0,0, - 0,0,212,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,214,0,0, - }; - - obj.createentity(152, 112, 13); - obj.createentity(152, 152, 10, 0, 49550); // (savepoint) - rcol = 4; - warpx = true; - warpy = true; - roomname = "To The Batcave!"; - result = contents; - break; - } - - case rn(55,52): - { - - static const short contents[] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,169,170,170,170,170,170,170,171,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,209,89,89,89,89,89,89,211,6,6,6,6,6,6,6,6,0,0,0,0,0,0,6,6, - 170,170,170,170,170,170,170,170,171,169,170,170,170,170,170,171,209,89,89,89,89,89,89,211,169,170,170,170,170,170,170,171,0,0,0,0,0,0,169,170, - 89,89,89,89,89,89,89,89,211,249,250,250,250,250,250,251,209,89,89,89,89,89,89,211,249,250,250,250,250,250,250,251,0,0,0,0,0,0,209,89, - 89,89,89,89,89,89,89,89,211,7,7,7,7,7,7,7,209,89,89,89,89,89,89,211,7,7,7,7,7,7,7,7,0,0,0,0,0,0,209,89, - 250,250,250,250,250,250,250,250,251,0,0,0,0,0,0,0,249,250,250,250,250,250,250,251,0,0,0,0,0,0,0,0,0,0,0,0,0,0,249,250, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,169,170,170,170,170,170,171,0,0,0,0,0,0,0,0,0,0,0,0,0,0,169,170,170,170,170,170,170,171,0, - 6,6,6,6,6,6,6,6,6,6,209,89,89,89,89,89,211,6,6,6,6,6,6,6,6,6,6,6,6,6,6,209,89,89,89,89,89,89,211,6, - 170,171,169,170,170,170,170,170,170,171,209,89,89,89,89,89,211,169,170,170,170,170,170,170,170,170,170,170,170,170,171,209,89,89,89,89,89,89,211,169, - 250,251,209,89,89,89,89,89,89,211,249,250,250,250,250,250,251,249,250,250,250,250,250,250,250,250,250,250,250,250,251,249,250,250,250,250,250,250,251,249, - 7,7,209,89,89,89,89,89,89,211,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, - 0,0,249,250,250,250,250,250,250,251,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - }; - - obj.createentity(152, 112, 13); - obj.createentity(136, 40, 10, 1, 52550); // (savepoint) - rcol = 3; - warpx = true; - warpy = true; - roomname = "This will make you flip"; - result = contents; - break; - } - - case rn(52,52): - { - - static const short contents[] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,217,216,216,216,216,215,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,217,216,216,216,216,215,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,217,216,216,216,216,215,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,217,216,216,216,216,215,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,217,216,216,216,216,215,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,217,216,216,216,216,215,95,217,175,176,176,177,0,0,0,0,0,0,0,0,0,0, - 176,176,177,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,217,216,216,216,216,215,95,217,215,95,95,217,0,0,0,0,0,0,0,0,175,176, - 95,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,136,176,176,176,176,137,95,217,215,95,95,217,0,0,0,0,0,0,0,0,215,95, - 95,95,217,6,6,6,6,6,6,6,6,6,0,0,0,0,215,95,95,95,95,95,95,95,95,217,215,95,95,217,6,6,6,6,6,6,6,6,215,95, - 95,95,217,175,176,176,176,176,176,176,176,177,0,0,0,0,255,256,256,256,256,256,256,256,256,257,215,95,95,217,175,176,176,176,177,175,176,177,215,95, - 256,256,257,255,256,256,256,256,256,256,256,257,0,0,0,0,175,177,7,7,7,7,7,175,176,177,215,95,95,217,215,95,95,95,217,255,256,257,255,256, - 176,177,0,0,0,0,0,0,0,175,176,177,0,0,0,0,255,257,0,0,0,0,0,215,95,217,215,95,95,217,215,95,95,95,217,7,7,7,175,176, - 256,257,0,0,0,0,0,0,0,215,95,217,0,0,0,0,7,7,0,0,0,0,0,255,256,257,255,256,256,257,255,256,256,256,257,0,0,0,255,256, - 0,0,0,0,0,0,0,0,0,215,95,217,0,0,0,0,0,0,0,0,0,0,0,175,176,177,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,215,95,217,0,0,0,0,0,0,0,0,0,0,0,215,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,215,95,217,0,0,0,0,0,0,0,0,0,0,0,215,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,215,95,217,0,0,0,0,0,0,0,0,0,0,0,215,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 176,177,0,0,0,0,0,0,0,215,95,217,0,0,0,0,0,0,0,0,0,0,0,215,95,217,0,0,0,0,0,0,0,175,176,176,176,176,176,176, - 95,217,0,0,0,0,0,0,0,255,256,257,0,0,0,0,0,0,0,0,0,0,0,215,95,217,0,0,0,0,6,6,6,215,95,95,95,95,95,95, - 95,217,175,176,176,176,176,176,176,176,176,176,176,176,176,176,176,177,0,0,0,0,0,215,95,217,0,0,0,0,175,176,177,215,95,95,95,95,95,95, - 256,257,255,256,256,256,256,256,256,256,256,256,256,256,256,256,256,257,6,6,6,6,6,255,256,257,0,0,0,0,255,256,257,255,256,256,256,256,256,256, - 7,7,7,7,7,7,7,7,7,175,176,176,176,176,176,177,175,176,176,176,176,176,176,176,176,177,0,0,0,0,175,176,176,177,7,7,7,7,7,7, - 0,0,0,0,0,0,0,0,0,215,95,95,95,95,95,217,215,95,95,95,95,95,95,95,95,217,0,0,0,0,215,95,95,217,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,255,256,256,256,256,256,257,215,95,96,256,256,256,256,97,95,217,0,0,0,0,215,95,95,217,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,217,216,216,216,216,215,95,217,0,0,0,0,255,256,256,257,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,217,216,216,216,216,215,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,217,216,216,216,216,215,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,217,216,216,216,216,215,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,217,216,216,216,216,215,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,217,216,216,216,216,215,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - }; - - obj.createentity(152, 112, 13); - obj.createentity(288, 120, 10, 1, 52520); // (savepoint) - rcol = 5; - warpx = true; - warpy = true; - roomname = "Twisty Little Passages"; - result = contents; - break; - } - - case rn(50,51): - { - - static const short contents[] = { - 83,83,83,83,83,83,83,83,83,83,83,83,83,205,203,83,83,83,83,83,83,83,83,83,83,205,0,0,0,0,203,83,83,83,83,83,83,83,83,83, - 83,83,83,83,83,83,83,83,83,83,83,83,83,205,203,83,83,83,83,83,83,83,83,83,83,205,0,0,0,0,203,83,83,83,83,83,83,83,83,83, - 83,83,83,83,83,83,83,83,83,83,83,83,83,205,243,244,244,244,244,244,244,244,244,244,244,245,0,0,0,0,203,83,83,83,83,83,83,83,83,83, - 83,83,83,83,83,83,83,83,83,83,83,83,83,205,163,164,165,163,164,164,164,164,164,164,164,165,0,0,0,0,203,83,83,83,83,83,83,83,83,83, - 244,244,244,244,244,244,244,244,244,244,244,244,244,245,203,83,205,243,244,244,244,244,244,244,244,245,0,0,0,0,243,244,244,244,244,244,244,244,244,244, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,243,244,245,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,7,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,6,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,163,164,165,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 164,164,164,164,164,164,165,49,50,163,165,0,0,0,203,83,205,163,164,164,164,164,164,164,164,165,0,0,0,0,163,164,165,49,50,163,164,165,163,164, - 83,83,83,83,83,83,205,49,50,203,205,0,0,0,203,83,205,203,83,83,83,83,83,83,83,205,0,0,0,0,203,83,205,49,50,203,83,205,203,83, - 244,244,244,244,244,244,245,49,50,243,245,0,0,0,203,83,205,243,244,244,244,244,244,244,244,245,0,0,0,0,203,83,205,49,50,203,83,205,243,244, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83,205,0,0,0,0,0,0,163,164,165,0,0,0,0,203,83,205,49,50,203,83,205,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83,205,0,0,0,0,0,0,203,83,205,163,164,164,165,203,83,205,49,50,203,83,205,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83,205,0,0,0,0,0,0,203,83,205,203,83,83,205,203,83,205,49,50,203,83,205,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83,205,0,0,0,0,0,0,203,83,205,203,83,83,205,203,83,205,49,50,203,83,205,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83,205,0,0,0,0,0,0,203,83,205,243,244,244,245,203,83,205,49,50,203,83,205,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83,205,0,0,0,0,0,0,203,83,205,0,0,0,0,203,83,205,49,50,203,83,205,0,0, - 164,164,164,164,164,164,165,49,50,163,165,0,0,0,203,83,205,0,0,0,0,0,0,203,83,205,0,0,0,0,203,83,205,49,50,203,83,205,163,164, - 83,83,83,83,83,83,205,49,50,203,205,0,0,0,203,83,205,0,0,0,0,0,0,203,83,205,0,0,0,0,203,83,205,49,50,203,83,205,203,83, - 244,244,244,244,244,244,245,49,50,243,245,0,0,0,203,83,205,0,0,0,0,0,0,243,244,245,0,0,0,0,243,244,245,49,50,243,244,245,243,244, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,243,244,245,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,7,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,6,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,163,164,165,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 164,164,164,164,164,164,164,164,164,164,164,164,164,165,203,83,205,163,164,164,164,164,164,164,164,165,0,0,0,0,163,164,164,164,164,164,164,164,164,164, - 83,83,83,83,83,83,83,83,83,83,83,83,83,205,243,244,245,243,244,244,244,244,244,244,244,245,0,0,0,0,203,83,83,83,83,83,83,83,83,83, - 83,83,83,83,83,83,83,83,83,83,83,83,83,205,163,164,164,164,164,164,164,164,164,164,164,165,0,0,0,0,203,83,83,83,83,83,83,83,83,83, - 83,83,83,83,83,83,83,83,83,83,83,83,83,205,203,83,83,83,83,83,83,83,83,83,83,205,0,0,0,0,203,83,83,83,83,83,83,83,83,83, - 83,83,83,83,83,83,83,83,83,83,83,83,83,205,203,83,83,83,83,83,83,83,83,83,83,205,0,0,0,0,203,83,83,83,83,83,83,83,83,83, - }; - - obj.createentity(152, 112, 13); - obj.createentity(24, 128, 10, 1, 52510); // (savepoint) - obj.createentity(56, 48, 1, 0, 10, -16, -16, 336, 256); // Enemy, bounded - obj.createentity(264, 48, 1, 0, 10, -16, -16, 336, 256); // Enemy, bounded - obj.createentity(152, 48, 1, 2, 8, -24, -24, 344, 256); // Enemy, bounded - obj.createentity(152, 176, 1, 2, 8, -24, -16, 344, 256); // Enemy, bounded - rcol = 1; - warpx = true; - warpy = true; - roomname = "That's Why I Have To Kill You"; - result = contents; - break; - } - - case rn(52,49): - { - - static const short contents[] = { - 86,86,86,86,86,208,0,0,0,0,206,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,208,0,0,0,0,206,86,86,86,86,86, - 86,86,86,86,86,208,0,0,0,0,206,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,208,0,0,0,0,206,86,86,86,86,86, - 86,86,86,86,86,208,0,0,0,0,206,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,208,0,0,0,0,206,86,86,86,86,86, - 86,86,86,86,86,208,0,0,0,0,206,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,208,0,0,0,0,206,86,86,86,86,86, - 86,86,86,86,86,208,0,0,0,0,206,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,208,0,0,0,0,206,86,86,86,86,86, - 86,86,86,86,86,208,0,0,0,0,206,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,208,0,0,0,0,206,86,86,86,86,86, - 247,247,247,247,247,248,0,0,0,0,246,248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,246,248,0,0,0,0,246,247,247,247,247,247, - 7,7,7,7,7,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,7,0,0,0,0,7,7,7,7,7,7, - 6,6,6,6,6,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,6,0,0,0,0,6,6,6,6,6,6, - 167,167,167,167,167,168,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,166,168,0,0,0,0,166,167,167,168,166,167, - 86,86,86,86,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,208,0,0,0,0,206,86,86,208,206,86, - 86,86,86,86,86,208,166,168,49,50,166,168,166,167,167,167,167,167,167,167,167,167,167,167,167,167,167,168,206,208,0,0,0,0,246,247,247,248,206,86, - 247,247,247,247,247,248,246,248,49,50,246,248,246,247,247,247,247,247,247,247,247,247,247,247,247,247,247,248,206,208,0,0,0,0,7,7,7,7,246,247, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,208,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,208,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,208,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,208,0,0,0,0,0,0,0,0,0,0, - 167,167,167,167,167,167,167,168,49,50,166,168,166,167,167,167,167,167,167,167,167,167,167,167,167,167,167,168,206,208,0,0,0,0,166,167,167,167,167,167, - 247,247,247,247,247,247,247,248,49,50,206,208,246,247,247,247,247,247,247,247,247,247,247,247,247,247,247,248,206,208,0,0,0,0,246,247,247,247,247,247, - 0,0,0,0,0,0,0,0,0,0,206,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,208,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,206,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,208,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,206,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,208,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,206,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,208,0,0,0,0,0,0,0,0,0,0, - 6,6,6,6,166,168,0,0,0,0,206,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,208,0,0,0,0,166,168,6,6,6,6, - 167,167,167,168,206,208,0,0,0,0,206,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,208,0,0,0,0,206,208,166,167,167,167, - 247,247,247,248,246,248,0,0,0,0,206,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,208,0,0,0,0,246,248,246,247,247,247, - 167,167,167,167,167,168,0,0,0,0,206,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,208,0,0,0,0,166,167,167,167,167,167, - 86,86,86,86,86,208,0,0,0,0,206,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,208,0,0,0,0,206,86,86,86,86,86, - 86,86,86,86,86,208,0,0,0,0,206,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,208,0,0,0,0,206,86,86,86,86,86, - 86,86,86,86,86,208,0,0,0,0,206,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,208,0,0,0,0,206,86,86,86,86,86, - }; - - obj.createentity(152, 112, 13); - obj.createentity(248, 16, 1, 0, 10, -24, -24, 344, 256); // Enemy, bounded - obj.createentity(64, 16, 1, 0, 10, -24, -24, 344, 256); // Enemy, bounded - obj.createentity(200, 56, 1, 2, 5, -24, -24, 344, 256); // Enemy, bounded - obj.createentity(152, 56, 1, 2, 5, -24, -24, 344, 256); // Enemy, bounded - obj.createentity(104, 56, 1, 2, 5, -24, -24, 344, 256); // Enemy, bounded - obj.createentity(152, 152, 10, 0, 49520); // (savepoint) - rcol = 2; - warpx = true; - warpy = true; - roomname = "I Love You"; - result = contents; - break; - } - - case rn(50,49): - { - - static const short contents[] = { - 83,83,205,0,0,0,0,0,203,83,83,83,83,83,83,83,83,205,203,83,83,83,205,0,0,0,0,0,203,83,83,83,205,0,0,0,0,0,203,83, - 83,83,205,0,0,0,0,0,243,244,244,244,244,244,244,244,244,245,203,83,83,83,205,0,0,0,0,0,243,244,244,244,245,0,0,0,0,0,203,83, - 83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83, - 83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83, - 83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83, - 83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83, - 83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83, - 83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,243,244,244,244,245,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83, - 83,83,205,0,0,0,0,0,163,164,164,164,165,0,0,0,0,0,163,164,164,164,164,164,164,164,164,164,164,164,164,164,165,0,0,0,0,0,203,83, - 83,83,205,0,0,0,0,0,203,83,83,83,205,0,0,0,0,0,203,83,83,83,83,83,83,83,83,83,83,83,83,83,205,0,0,0,0,0,203,83, - 244,244,245,0,0,0,0,0,203,83,83,83,205,0,0,0,0,0,203,83,84,244,244,244,244,244,244,244,244,244,85,83,205,0,0,0,0,0,243,244, - 0,0,0,0,0,0,0,0,203,83,83,83,205,0,0,0,0,0,203,83,205,123,123,123,123,123,123,123,123,123,203,83,205,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,203,83,83,83,205,0,0,0,0,0,203,83,205,123,123,123,123,123,123,123,123,123,203,83,205,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,203,83,83,83,205,0,0,0,0,0,203,83,205,123,123,123,123,123,123,123,123,123,203,83,205,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,203,83,83,83,205,0,0,0,0,0,203,83,205,123,123,123,123,123,123,123,123,123,203,83,205,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,203,83,83,83,205,0,0,0,0,0,203,83,205,123,123,123,123,123,123,123,123,123,203,83,205,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,203,83,83,83,205,0,0,0,0,0,203,83,205,123,123,123,123,123,123,123,123,123,203,83,205,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,203,83,83,83,205,0,0,0,0,0,203,83,205,123,123,123,123,123,123,123,123,123,203,83,205,0,0,0,0,0,0,0, - 164,164,165,0,0,0,0,0,203,83,83,83,205,0,0,0,0,0,203,83,124,164,164,164,164,164,164,164,164,164,125,83,205,0,0,0,0,0,163,164, - 83,83,205,0,0,0,0,0,203,83,83,83,205,0,0,0,0,0,203,83,83,83,83,83,83,83,83,83,83,83,83,83,205,0,0,0,0,0,203,83, - 83,83,205,0,0,0,0,0,203,83,83,83,205,0,0,0,0,0,243,244,244,244,244,244,244,244,244,244,244,244,244,244,245,0,0,0,0,0,203,83, - 83,83,205,0,0,0,0,0,203,83,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,163,164,164,164,165,0,0,0,0,0,203,83, - 83,83,205,0,0,0,0,0,203,83,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83,83,83,205,0,0,0,0,0,203,83, - 83,83,205,0,0,0,0,0,203,83,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83,83,83,205,0,0,0,0,0,203,83, - 83,83,205,0,0,0,0,0,203,83,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83,83,83,205,0,0,0,0,0,203,83, - 83,83,205,0,0,0,0,0,203,83,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83,83,83,205,0,0,0,0,0,203,83, - 83,83,205,0,0,0,0,0,203,83,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83,83,83,205,0,0,0,0,0,203,83, - 83,83,205,0,0,0,0,0,203,83,83,83,205,163,164,164,164,164,164,164,164,164,165,0,0,0,0,0,203,83,83,83,205,0,0,0,0,0,203,83, - 83,83,205,0,0,0,0,0,203,83,83,83,205,203,83,83,83,83,83,83,83,83,205,0,0,0,0,0,203,83,83,83,205,0,0,0,0,0,203,83, - 83,83,205,0,0,0,0,0,203,83,83,83,205,203,83,83,83,83,83,83,83,83,205,0,0,0,0,0,203,83,83,83,205,0,0,0,0,0,203,83, - }; - rcol = 1; - warpy = true; - roomname = "Green Dudes Can't Flip"; - result = contents; - break; - } - - - case rn(51,49): - { - - static const short contents[] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,175,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,177,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,215,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,217,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,215,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,217,0,0,0,0,0,0,0,0,0,0, - 176,176,176,177,0,0,0,0,0,0,255,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,257,0,0,0,0,0,0,175,176,176,176, - 95,95,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,95,95, - 95,95,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,95,95, - 256,256,256,257,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,256,256,256, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 176,176,176,177,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,175,176,176,176, - 95,95,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,95,95, - 95,95,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,95,95, - 256,256,256,257,0,0,0,0,0,0,175,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,177,0,0,0,0,0,0,255,256,256,256, - 0,0,0,0,0,0,0,0,0,0,215,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,217,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,215,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,217,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,255,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,257,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - }; - warpx = true; - warpy = true; - rcol = 5; - - obj.createentity(14 * 8, (8 * 8) + 4, 14); //Teleporter! - - if(game.intimetrial) - { - obj.createblock(1, 20, 0, 32, 240, 82); - } - - roomname = "Murdering Twinmaker"; - result = contents; - break; - } - - case rn(49,49): - { - - static const short contents[] = { - 80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,202,0,0,0,0,0,0,0,200,80,202,201,201,201,201,201,201,201,201,201,201,201,201,201,201, - 80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,202,0,0,0,0,0,0,0,200,80,202,201,201,201,201,201,201,201,201,201,201,201,201,201,201, - 80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,202,0,0,0,0,0,0,0,200,80,202,201,201,201,201,201,201,201,201,201,201,201,201,201,201, - 241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,242,0,0,0,0,0,0,0,200,80,202,201,201,201,201,201,201,201,201,201,201,201,201,201,201, - 161,162,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,80,202,201,201,201,201,201,201,201,201,201,201,201,201,201,201, - 80,202,0,160,161,161,161,161,161,161,161,161,161,161,161,162,0,0,0,0,0,0,0,200,80,202,201,201,201,201,201,201,201,201,201,201,201,201,201,201, - 80,202,0,240,241,241,241,241,241,241,241,241,241,241,241,242,0,0,0,0,0,0,0,200,80,202,201,201,201,201,201,201,201,201,201,201,201,201,201,201, - 80,202,0,160,162,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,80,202,201,201,201,201,201,201,201,201,201,201,201,201,201,201, - 80,202,0,200,202,0,160,161,161,161,161,161,161,161,161,162,0,0,0,0,0,0,0,200,80,121,161,161,161,161,161,161,161,161,161,161,161,161,161,161, - 80,202,0,200,202,0,240,241,241,241,241,241,241,241,241,242,0,0,0,0,0,0,0,200,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80, - 80,202,0,200,202,0,160,162,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,240,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241, - 80,202,0,200,202,0,200,202,0,160,161,161,161,161,161,162,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 80,202,0,200,202,0,200,202,0,240,241,241,241,241,241,242,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 80,202,0,200,202,0,200,202,0,160,162,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 80,202,0,200,202,0,200,202,0,200,202,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 80,202,0,200,202,0,200,202,0,200,202,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 80,202,0,200,202,0,200,202,0,240,242,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 80,202,0,200,202,0,200,202,0,160,161,161,161,161,161,162,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 80,202,0,200,202,0,200,202,0,240,241,241,241,241,241,242,0,0,0,0,0,0,0,160,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161, - 80,202,0,200,202,0,240,242,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80, - 80,202,0,200,202,0,160,161,161,161,161,161,161,161,161,162,0,0,0,0,0,0,0,200,80,81,241,241,241,241,241,241,241,241,241,241,241,241,241,241, - 80,202,0,200,202,0,240,241,241,241,241,241,241,241,241,242,0,0,0,0,0,0,0,200,80,202,201,201,201,201,201,201,201,201,201,201,201,201,201,201, - 80,202,0,240,242,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,80,202,201,201,201,201,201,201,201,201,201,201,201,201,201,201, - 80,202,0,160,161,161,161,161,161,161,161,161,161,161,161,162,0,0,0,0,0,0,0,200,80,202,201,201,201,201,201,201,201,201,201,201,201,201,201,201, - 80,202,0,240,241,241,241,241,241,241,241,241,241,241,241,242,0,0,0,0,0,0,0,200,80,202,201,201,201,201,201,201,201,201,201,201,201,201,201,201, - 241,242,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,80,202,201,201,201,201,201,201,201,201,201,201,201,201,201,201, - 161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,162,0,0,0,0,0,0,0,200,80,202,201,201,201,201,201,201,201,201,201,201,201,201,201,201, - 80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,202,0,0,0,0,0,0,0,200,80,202,201,201,201,201,201,201,201,201,201,201,201,201,201,201, - 80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,202,0,0,0,0,0,0,0,200,80,202,201,201,201,201,201,201,201,201,201,201,201,201,201,201, - 80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,202,0,0,0,0,0,0,0,200,80,202,201,201,201,201,201,201,201,201,201,201,201,201,201,201, - }; - rcol = 0; - warpy = true; - - if(!game.intimetrial || game.translator_exploring) - { - if(game.companion==0 && !obj.flags[11] && !game.crewstats[4]) //also need to check if he's rescued in a previous game - { - obj.createentity(255, 121, 15, 0); - obj.createblock(1, 215, 0, 160, 240, 35); - } - } - roomname = "It's Not Easy Being Green"; - result = contents; - break; - } + case rn(50,50): + { + static const short contents[] = { + 120,120,120,120,120,120,120,120,120,120,120,120,120,200,80,202,0,0,0,0,0,0,0,0,200,80,202,120,120,120,120,120,120,120,120,120,120,120,120,120, + 120,120,120,120,120,120,120,120,120,120,120,120,120,200,80,202,0,0,0,0,0,0,0,0,200,80,202,120,120,120,120,120,120,120,120,120,120,120,120,120, + 120,120,120,120,120,120,120,120,120,120,120,120,120,200,80,202,0,0,0,0,0,0,0,0,200,80,202,120,120,120,120,120,120,120,120,120,120,120,120,120, + 161,161,161,161,161,161,161,161,161,161,161,161,161,122,80,202,0,0,0,0,0,0,0,0,200,80,202,120,120,120,120,120,120,120,120,120,120,120,120,120, + 80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,202,0,0,0,0,0,0,0,0,200,80,202,120,120,120,120,120,120,120,120,120,120,120,120,120, + 241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,242,0,0,0,0,0,0,0,0,200,80,202,120,120,120,120,120,120,120,120,120,120,120,120,120, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,80,202,120,120,120,120,120,120,120,120,120,120,120,120,120, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,80,202,120,120,120,120,120,120,120,120,120,120,120,120,120, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,80,202,120,120,120,120,120,120,120,120,120,120,120,120,120, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,80,202,120,120,120,120,120,120,120,120,120,120,120,120,120, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,80,202,120,120,120,120,120,120,120,120,120,120,120,120,120, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,80,202,120,120,120,120,120,120,120,120,120,120,120,120,120, + 161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,162,160,161,161,161,161,161,161,162,200,80,202,120,120,120,120,120,120,120,120,120,120,120,120,120, + 80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,202,200,80,80,80,80,80,80,202,200,80,202,120,120,120,120,120,120,120,120,120,120,120,120,120, + 241,241,241,241,241,241,241,241,241,241,241,241,241,82,80,202,200,80,80,80,80,80,80,202,200,80,121,161,161,161,161,161,161,161,161,161,161,161,161,161, + 120,120,120,120,120,120,120,120,120,120,120,120,120,200,80,202,200,80,80,80,80,80,80,202,200,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80, + 120,120,120,120,120,120,120,120,120,120,120,120,120,200,80,202,240,241,241,241,241,241,241,242,240,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241, + 120,120,120,120,120,120,120,120,120,120,120,120,120,200,80,202,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 120,120,120,120,120,120,120,120,120,120,120,120,120,200,80,202,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 120,120,120,120,120,120,120,120,120,120,120,120,120,200,80,202,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 120,120,120,120,120,120,120,120,120,120,120,120,120,200,80,202,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 120,120,120,120,120,120,120,120,120,120,120,120,120,200,80,202,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 120,120,120,120,120,120,120,120,120,120,120,120,120,200,80,202,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 120,120,120,120,120,120,120,120,120,120,120,120,120,200,80,202,0,0,0,0,0,0,0,0,160,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161, + 120,120,120,120,120,120,120,120,120,120,120,120,120,200,80,202,0,0,0,0,0,0,0,0,200,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80, + 120,120,120,120,120,120,120,120,120,120,120,120,120,200,80,202,0,0,0,0,0,0,0,0,200,80,81,241,241,241,241,241,241,241,241,241,241,241,241,241, + 120,120,120,120,120,120,120,120,120,120,120,120,120,200,80,202,0,0,0,0,0,0,0,0,200,80,202,120,120,120,120,120,120,120,120,120,120,120,120,120, + 120,120,120,120,120,120,120,120,120,120,120,120,120,200,80,202,0,0,0,0,0,0,0,0,200,80,202,120,120,120,120,120,120,120,120,120,120,120,120,120, + 120,120,120,120,120,120,120,120,120,120,120,120,120,200,80,202,0,0,0,0,0,0,0,0,200,80,202,120,120,120,120,120,120,120,120,120,120,120,120,120, + 120,120,120,120,120,120,120,120,120,120,120,120,120,200,80,202,0,0,0,0,0,0,0,0,200,80,202,120,120,120,120,120,120,120,120,120,120,120,120,120, + }; + + obj.createentity(288, 168, 10, 1, 50500); // (savepoint) + + if(game.intimetrial) + { + obj.createblock(0, 0, 0, 8, 240); + } + + rcol = 0; + warpy = true; + roomname = "This is how it is"; + result = contents; + break; + } + + case rn(51,50): + { + + static const short contents[] = { + 247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,248,206,86,208,246,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 167,167,167,167,167,168,166,167,167,167,167,168,0,0,0,0,206,86,208,0,0,0,0,166,167,167,167,167,167,167,167,167,168,166,167,167,167,167,167,167, + 247,247,247,247,247,248,206,86,86,86,86,208,0,0,0,0,206,86,208,0,0,0,0,206,86,86,86,86,86,86,86,86,208,246,247,247,247,247,247,247, + 0,0,0,0,0,0,206,86,86,86,86,208,0,0,0,0,206,86,208,0,0,0,0,206,86,87,247,247,247,247,88,86,208,0,0,0,0,0,0,0, + 0,0,0,0,0,0,206,86,86,86,86,208,0,0,0,0,206,86,208,0,0,0,0,206,86,208,126,126,126,126,206,86,208,0,0,0,0,0,0,0, + 0,0,0,0,0,0,206,86,86,86,86,208,0,0,0,0,206,86,208,0,0,0,0,206,86,208,126,126,126,126,206,86,208,0,0,0,0,0,0,0, + 0,0,0,0,0,0,246,247,247,247,247,248,0,0,0,0,206,86,208,0,0,0,0,206,86,208,126,126,126,126,206,86,208,0,0,0,0,0,0,0, + 0,0,0,0,0,0,166,167,167,167,167,168,0,0,0,0,206,86,208,0,0,0,0,206,86,208,126,126,126,126,206,86,208,0,0,0,0,0,0,0, + 0,0,0,0,0,0,206,86,86,86,86,208,0,0,0,0,206,86,208,0,0,0,0,206,86,127,167,167,167,167,128,86,208,0,0,0,0,0,0,0, + 167,167,168,0,0,0,206,86,86,86,86,208,0,0,0,0,206,86,208,0,0,0,0,206,86,86,86,86,86,86,86,86,208,0,0,0,0,166,167,167, + 247,247,248,0,0,0,206,86,86,86,86,208,0,0,0,0,206,86,208,0,0,0,0,246,247,247,247,247,247,247,247,247,248,0,0,0,0,246,247,247, + 0,0,0,0,0,0,206,86,86,86,86,208,0,0,0,0,206,86,208,0,0,0,0,0,0,0,0,0,0,0,166,167,168,0,0,0,0,0,0,0, + 0,0,0,0,0,0,206,86,86,86,86,208,0,0,0,0,206,86,208,0,0,0,0,0,0,0,0,0,0,0,206,86,208,0,0,0,0,0,0,0, + 0,0,0,0,0,0,206,86,86,86,86,208,0,0,0,0,206,86,208,0,0,0,0,0,0,0,0,0,0,0,246,247,248,0,0,0,0,0,0,0, + 0,0,0,0,0,0,206,86,86,86,86,208,0,0,0,0,206,86,208,0,0,0,0,166,167,168,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,206,86,86,86,86,208,0,0,0,0,206,86,208,0,0,0,0,206,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,246,247,247,247,247,248,0,0,0,0,246,247,248,0,0,0,0,246,247,248,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 167,167,167,167,167,168,0,0,0,0,0,0,0,0,0,0,166,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167, + 86,86,86,86,86,208,0,0,0,0,0,0,0,0,0,0,206,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86, + 247,247,247,88,86,208,0,0,0,0,0,0,0,0,0,0,206,86,87,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247, + 126,126,126,206,86,208,0,0,0,0,0,0,0,0,0,0,206,86,208,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, + 126,126,126,206,86,208,0,0,0,0,166,167,167,167,167,168,206,86,208,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, + 126,126,126,206,86,208,0,0,0,0,206,86,86,86,86,208,206,86,208,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, + 126,126,126,206,86,208,0,0,0,0,206,86,86,86,86,208,206,86,208,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, + }; + rcol = 2; + warpx = true; + roomname = "A Bisected Spiral"; + result = contents; + break; + } + + + case rn(51,51): + { + + static const short contents[] = { + 83,83,83,83,83,205,0,0,0,0,203,83,83,83,83,83,83,205,0,0,0,0,203,83,83,83,83,83,83,205,0,0,0,0,203,83,83,83,83,83, + 83,83,83,83,83,205,0,0,0,0,203,83,83,83,83,83,83,205,0,0,0,0,203,83,83,83,83,83,83,205,0,0,0,0,203,83,83,83,83,83, + 244,244,244,244,244,245,0,0,0,0,243,244,244,244,244,244,244,245,0,0,0,0,243,244,244,244,244,244,244,245,0,0,0,0,243,244,244,244,244,244, + 164,164,164,165,0,0,0,0,0,0,0,0,163,164,164,165,0,0,0,0,0,0,0,0,163,164,164,165,0,0,0,0,0,0,0,0,163,164,164,164, + 83,83,83,205,0,0,0,0,0,0,0,0,203,83,83,205,0,0,0,0,0,0,0,0,203,83,83,205,0,0,0,0,0,0,0,0,203,83,83,83, + 83,83,83,205,0,0,0,0,0,0,0,0,203,83,83,205,0,0,0,0,0,0,0,0,203,83,83,205,0,0,0,0,0,0,0,0,203,83,83,83, + 83,83,83,205,0,0,0,0,0,0,0,0,203,83,83,205,0,0,0,0,0,0,0,0,203,83,83,205,0,0,0,0,0,0,0,0,203,83,83,83, + 83,83,83,205,0,0,0,0,0,0,0,0,203,83,83,205,0,0,0,0,0,0,0,0,203,83,83,205,0,0,0,0,0,0,0,0,243,244,244,244, + 83,83,83,205,0,0,0,0,0,0,0,0,203,83,83,205,0,0,0,0,0,0,0,0,203,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0, + 83,83,83,205,0,0,0,0,0,0,0,0,203,83,83,205,0,0,0,0,0,0,0,0,203,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0, + 83,83,83,205,0,0,0,0,0,0,0,0,203,83,83,205,0,0,0,0,0,0,0,0,203,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0, + 83,83,83,205,0,0,0,0,0,0,0,0,203,83,83,205,0,0,0,0,0,0,0,0,203,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0, + 83,83,83,205,0,0,0,0,0,0,0,0,203,83,83,205,0,0,0,0,0,0,0,0,203,83,83,205,163,164,164,164,164,164,164,164,164,164,164,165, + 83,83,83,205,0,0,0,0,0,0,0,0,203,83,83,205,0,0,0,0,0,0,0,0,203,83,83,205,203,83,83,83,83,83,83,83,83,83,83,205, + 83,83,83,205,0,0,0,0,0,0,0,0,203,83,83,205,0,0,0,0,0,0,0,0,243,244,244,245,243,244,244,244,244,244,244,244,244,244,244,245, + 83,83,83,205,0,0,0,0,0,0,0,0,203,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,163,164,164,164, + 83,83,83,205,0,0,0,0,0,0,0,0,203,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83,83,83, + 83,83,83,205,0,0,0,0,0,0,0,0,203,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83,83,83, + 83,83,83,205,0,0,0,0,0,0,0,0,203,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83,83,83, + 83,83,83,205,0,0,0,0,0,0,0,0,203,83,83,205,163,164,164,164,164,164,164,164,164,164,164,165,0,0,0,0,0,0,0,0,203,83,83,83, + 83,83,83,205,0,0,0,0,0,0,0,0,203,83,83,205,203,83,83,83,83,83,83,83,83,83,83,205,0,0,0,0,0,0,0,0,203,83,83,83, + 83,83,83,205,0,0,0,0,0,0,0,0,243,244,244,245,243,244,244,244,244,244,244,244,244,244,244,245,0,0,0,0,0,0,0,0,203,83,83,83, + 83,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,163,164,164,164,164,165,0,0,0,0,0,0,0,0,203,83,83,83, + 83,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83,83,83,83,205,0,0,0,0,0,0,0,0,203,83,83,83, + 83,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83,83,83,83,205,0,0,0,0,0,0,0,0,203,83,83,83, + 244,244,244,245,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,243,244,244,244,244,245,0,0,0,0,0,0,0,0,243,244,244,244, + 164,164,164,164,164,165,0,0,0,0,163,164,164,164,164,164,164,165,0,0,0,0,163,164,164,164,164,164,164,165,0,0,0,0,163,164,164,164,164,164, + 83,83,83,83,83,205,0,0,0,0,203,83,83,83,83,83,83,205,0,0,0,0,203,83,83,83,83,83,83,205,0,0,0,0,203,83,83,83,83,83, + 83,83,83,83,83,205,0,0,0,0,203,83,83,83,83,83,83,205,0,0,0,0,203,83,83,83,83,83,83,205,0,0,0,0,203,83,83,83,83,83, + 83,83,83,83,83,205,0,0,0,0,203,83,83,83,83,83,83,205,0,0,0,0,203,83,83,83,83,83,83,205,0,0,0,0,203,83,83,83,83,83, + }; + + obj.createentity(248, 80, 10, 1, 51510); // (savepoint) + obj.createentity(136, 128, 1, 3, 3, 128, 120, 288, 152); // Enemy, bounded + obj.createentity(104, 192, 10, 1, 51511); // (savepoint) + rcol = 1; + warpy = true; + roomname = "Take the Red Pill"; + result = contents; + break; + } + + case rn(52,51): + { + + static const short contents[] = { + 95,95,95,95,95,217,0,0,0,0,215,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95, + 256,256,256,256,256,257,0,0,0,0,255,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 176,176,176,176,176,176,176,176,176,177,175,176,177,0,0,0,0,175,176,177,175,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176, + 256,256,256,256,256,256,256,256,256,257,215,95,217,0,0,0,0,215,95,217,255,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256, + 0,0,0,0,0,0,0,0,0,0,215,95,217,0,0,0,0,255,256,257,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,215,95,217,0,0,0,0,175,176,177,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,215,95,217,0,0,0,0,215,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,215,95,217,0,0,0,0,215,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 176,176,176,176,176,177,0,0,0,0,215,95,217,0,0,0,0,215,95,217,0,0,0,0,175,176,176,177,175,176,176,176,177,175,176,176,176,176,176,176, + 95,95,95,95,95,217,0,0,0,0,215,95,217,0,0,0,0,215,95,217,0,0,0,0,215,95,95,217,215,95,95,95,217,215,95,95,95,95,95,95, + 95,95,95,95,95,217,0,0,0,0,215,95,217,0,0,0,0,215,95,217,0,0,0,0,215,95,95,217,215,95,95,95,217,215,95,95,95,95,95,95, + 95,95,95,95,95,217,0,0,0,0,215,95,217,0,0,0,0,215,95,217,0,0,0,0,215,95,95,217,215,95,95,95,217,215,95,95,95,95,95,95, + 256,256,256,256,256,257,0,0,0,0,215,95,217,0,0,0,0,215,95,217,0,0,0,0,215,95,95,217,255,256,256,256,257,255,256,256,256,256,256,256, + 0,0,0,0,0,0,0,0,0,0,215,95,217,0,0,0,0,215,95,217,0,0,0,0,215,95,95,217,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,215,95,217,0,0,0,0,215,95,217,0,0,0,0,215,95,95,217,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,215,95,217,0,0,0,0,215,95,217,0,0,0,0,215,95,95,217,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,255,256,257,0,0,0,0,215,95,217,0,0,0,0,255,256,256,257,0,0,0,0,0,0,0,0,0,0,0,0, + 176,176,176,176,176,176,176,176,176,176,176,176,177,0,0,0,0,255,256,257,0,0,0,0,175,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176, + 95,95,95,95,95,95,95,95,95,95,95,95,217,0,0,0,0,0,0,0,0,0,0,0,215,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95, + 256,256,256,256,256,256,256,256,256,256,97,95,217,0,0,0,0,0,0,0,0,0,0,0,215,95,96,256,256,256,256,256,256,256,256,256,256,256,256,256, + 135,135,135,135,135,135,135,135,135,135,215,95,217,0,0,0,0,0,0,0,0,0,0,0,215,95,217,135,135,135,135,135,135,135,135,135,135,135,135,135, + 135,135,135,135,135,135,135,135,135,135,215,95,217,0,0,0,0,0,0,0,0,0,0,0,215,95,217,135,135,135,135,135,135,135,135,135,135,135,135,135, + 135,135,135,135,135,135,135,135,135,135,215,95,217,175,176,176,176,176,176,176,176,176,176,177,215,95,217,135,135,135,135,135,135,135,135,135,135,135,135,135, + 135,135,135,135,135,135,135,135,135,135,215,95,217,215,95,95,95,95,95,95,95,95,95,217,215,95,217,135,135,135,135,135,135,135,135,135,135,135,135,135, + 135,135,135,135,135,135,135,135,135,135,215,95,217,215,95,95,95,95,95,95,95,95,95,217,215,95,217,135,135,135,135,135,135,135,135,135,135,135,135,135, + 135,135,135,135,135,135,135,135,135,135,215,95,217,215,95,95,95,95,95,95,95,95,95,217,215,95,217,135,135,135,135,135,135,135,135,135,135,135,135,135, + }; + + obj.createentity(32, 24, 1, 3, 4, -56, -40, 384, 312); // Enemy, bounded + obj.createentity(96, 24, 1, 3, 4, -56, -40, 384, 312); // Enemy, bounded + obj.createentity(160, 24, 1, 3, 4, -56, -40, 384, 312); // Enemy, bounded + obj.createentity(224, 24, 1, 3, 4, -56, -40, 384, 312); // Enemy, bounded + obj.createentity(232, 152, 10, 1, 51520); // (savepoint) + rcol = 5; + warpx = true; + roomname = "Short Circuit"; + result = contents; + break; + } + + case rn(52,50): + { + + static const short contents[] = { + 213,212,92,214,172,174,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,92,92,92, + 213,212,92,214,252,254,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,92,92,92, + 213,212,92,214,0,0,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,92,92,92, + 213,212,92,214,0,0,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,92,92,92, + 213,212,92,214,0,0,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,92,92,92, + 213,212,92,214,0,0,0,0,0,0,0,0,252,254,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,92,92,92, + 213,212,92,214,0,0,0,0,0,0,0,0,7,7,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,92,92,92, + 213,212,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,214,0,0,0,0,0,0,252,254,0,0,0,0,0,0,212,92,92,92, + 213,212,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,214,0,0,0,0,0,0,7,7,0,0,0,0,0,0,212,92,92,92, + 213,212,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,92, + 213,212,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,92, + 213,212,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,252,253,253,253, + 213,212,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,252,254,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 213,212,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 213,212,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 213,212,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 213,212,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 213,212,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,172,173,173,173, + 213,212,92,214,0,0,0,0,0,0,0,0,6,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,92, + 213,212,92,214,0,0,0,0,0,0,0,0,172,174,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,92, + 213,212,92,214,0,0,0,0,0,0,0,0,212,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,6,0,0,0,0,0,0,212,92,92,92, + 213,212,92,214,0,0,0,0,0,0,0,0,212,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,172,174,0,0,0,0,0,0,212,92,92,92, + 213,212,92,214,0,0,0,0,0,0,0,0,212,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,92,92,92, + 213,212,92,214,0,0,0,0,0,0,0,0,212,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,92,92,92, + 213,212,92,214,0,0,0,0,0,0,0,0,212,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,92,92,92, + 213,212,92,214,0,0,0,0,0,0,0,0,212,214,0,0,0,0,0,0,6,6,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,92,92,92, + 213,212,92,214,0,0,0,0,0,0,0,0,212,214,0,0,0,0,0,0,172,174,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,92,92,92, + 213,212,92,214,172,174,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,92,92,92, + 213,212,92,214,212,214,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,92,92,92, + 213,212,92,214,252,254,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,92,92,92, + }; + + obj.createentity(32, 16, 10, 0, 50520); // (savepoint) + rcol = 4; + warpy = true; + roomname = "As you like it"; + result = contents; + break; + } + + + case rn(53,50): + { + + static const short contents[] = { + 250,250,250,250,250,250,251,0,0,0,209,211,249,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250, + 0,0,0,0,0,0,0,0,0,0,209,211,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,209,211,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,209,211,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 170,170,170,170,170,170,170,170,170,171,209,211,0,0,0,169,170,170,170,170,170,170,170,171,169,171,169,170,170,170,170,170,170,170,170,170,170,170,170,170, + 250,250,250,250,250,250,250,250,250,251,209,211,0,0,0,249,250,250,250,250,250,250,250,251,209,211,249,250,250,250,250,250,250,250,250,250,250,250,250,250, + 0,0,0,0,0,0,0,0,0,0,209,211,0,0,0,0,0,0,0,0,0,0,0,0,209,211,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,209,211,0,0,0,0,0,0,0,0,0,0,0,0,209,211,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,209,211,0,0,0,0,0,0,0,0,0,0,0,0,209,211,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 170,170,170,170,171,169,171,0,0,0,209,211,169,170,170,170,170,170,170,170,170,171,0,0,209,211,0,0,169,170,170,170,170,170,170,170,170,170,170,170, + 89,89,89,89,211,209,211,0,0,0,209,211,209,89,89,89,89,89,89,89,89,211,0,0,209,211,0,0,209,89,89,89,89,89,89,89,89,89,89,89, + 250,250,250,250,251,209,211,0,0,0,209,211,249,250,250,250,250,250,250,250,250,251,0,0,209,211,0,0,249,250,250,250,250,250,250,250,250,250,250,250, + 0,0,0,0,0,209,211,0,0,0,209,211,0,0,0,0,0,0,0,0,169,171,0,0,209,211,0,0,169,171,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,209,211,0,0,0,209,211,0,0,0,0,0,0,0,0,209,211,0,0,209,211,0,0,209,211,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,209,211,0,0,0,209,211,0,0,0,0,0,0,0,0,209,211,0,0,209,211,0,0,209,211,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,209,211,0,0,0,209,211,0,0,0,169,171,0,0,0,209,211,0,0,209,211,0,0,209,211,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,209,211,0,0,0,209,211,0,0,0,209,211,0,0,0,209,211,0,0,209,211,0,0,209,211,0,0,0,0,0,0,0,0,0,0, + 170,170,170,170,171,209,211,0,0,0,209,211,0,0,0,209,211,0,0,0,209,211,0,0,209,211,0,0,209,211,0,0,0,169,171,169,170,170,170,170, + 89,89,89,89,211,209,211,0,0,0,209,211,0,0,0,209,211,0,0,0,209,211,0,0,209,211,0,0,209,211,0,0,0,209,211,209,89,89,89,89, + 250,250,250,250,251,249,251,0,0,0,209,211,0,0,0,209,211,0,0,0,209,211,0,0,249,251,0,0,209,211,0,0,0,209,211,249,250,250,250,250, + 0,0,0,0,0,0,0,0,0,0,209,211,0,0,0,209,211,0,0,0,209,211,0,0,0,0,0,0,209,211,0,0,0,209,211,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,209,211,0,0,0,209,211,0,0,0,209,211,0,0,0,0,0,0,209,211,0,0,0,209,211,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,209,211,0,0,0,209,211,0,0,0,209,211,0,0,0,0,0,0,209,211,0,0,0,209,211,0,0,0,0,0, + 170,170,170,170,170,170,170,170,170,171,209,211,0,0,0,209,211,0,0,0,209,211,169,170,170,170,170,171,209,211,0,0,0,209,211,0,0,0,169,170, + 250,250,250,250,250,250,250,250,250,251,249,251,0,0,0,209,211,0,0,0,249,251,249,250,250,250,250,251,249,251,0,0,0,209,211,0,0,0,249,250, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,209,211,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,209,211,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,209,211,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,209,211,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,209,211,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,209,211,0,0,0,0,0, + 170,170,170,170,170,170,170,170,170,170,170,170,170,170,171,209,211,169,170,170,170,170,170,170,170,170,170,170,170,170,170,170,171,209,211,169,170,170,170,170, + 89,89,89,89,89,89,89,89,89,89,89,89,89,89,211,209,211,209,89,89,89,89,89,89,89,89,89,89,89,89,89,89,211,209,211,209,89,89,89,89, + }; + + obj.createentity(16, 120, 10, 1, 50530); // (savepoint) + rcol = 3; + warpx = true; + roomname = "Maze With No Entrance"; + result = contents; + break; + } + + case rn(53,49): + { + + static const short contents[] = { + 126,126,126,126,206,86,208,0,0,0,206,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86, + 126,126,126,126,206,86,208,0,0,0,246,247,248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,246,247, + 126,126,126,126,206,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 126,126,126,126,206,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 126,126,126,126,206,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 126,126,126,126,206,86,208,0,0,0,0,0,0,0,0,0,0,166,167,168,0,0,0,0,0,0,0,0,0,0,0,166,167,168,0,0,0,0,0,0, + 126,126,126,126,206,86,208,0,0,0,0,0,0,0,0,0,0,206,86,208,0,0,0,0,0,0,0,0,0,0,0,206,86,208,0,0,0,0,0,0, + 126,126,126,126,206,86,208,0,0,0,0,0,0,0,0,0,0,206,86,208,0,0,0,0,0,0,0,0,0,0,0,206,86,208,0,0,0,0,0,0, + 126,126,126,126,206,86,208,0,0,0,0,0,0,0,0,0,0,206,86,208,0,0,0,0,0,0,0,0,0,0,0,206,86,208,0,0,0,0,0,0, + 126,126,126,126,206,86,208,0,0,0,0,0,0,0,0,0,0,206,86,208,0,0,0,0,0,0,0,0,0,0,0,206,86,208,0,0,0,0,0,0, + 126,126,126,126,206,86,208,166,167,167,167,167,168,0,0,0,0,206,86,208,0,0,0,0,0,0,0,0,0,0,0,206,86,208,0,0,0,0,166,167, + 126,126,126,126,206,86,208,206,86,86,86,86,208,6,6,6,6,206,86,208,6,6,6,6,6,6,6,6,6,6,6,206,86,208,6,6,6,6,206,86, + 126,126,126,126,206,86,208,206,86,86,86,86,208,166,167,167,168,206,86,208,166,167,167,168,166,167,168,166,167,167,168,206,86,208,166,167,167,168,206,86, + 126,126,126,126,206,86,208,206,86,86,86,86,208,206,86,86,208,206,86,208,206,86,86,208,206,86,208,206,86,86,208,206,86,208,206,86,86,208,206,86, + 126,126,126,126,206,86,208,206,86,86,86,86,208,206,86,86,208,206,86,208,206,86,86,208,206,86,208,206,86,86,208,206,86,208,206,86,86,208,206,86, + 126,126,126,126,206,86,208,206,86,86,86,86,208,206,86,86,208,206,86,208,206,86,86,208,206,86,208,206,86,86,208,206,86,208,206,86,86,208,206,86, + 126,126,126,126,206,86,208,206,86,86,86,86,208,246,247,247,248,246,247,248,246,247,247,248,206,86,208,246,247,247,248,246,247,248,246,247,247,248,206,86, + 126,126,126,126,206,86,208,206,86,86,86,86,208,7,7,7,7,7,7,7,7,7,7,7,206,86,208,7,7,7,7,7,7,7,7,7,7,7,206,86, + 126,126,126,126,206,86,208,246,247,247,247,247,248,0,0,0,0,0,0,0,0,0,0,0,206,86,208,0,0,0,0,0,0,0,0,0,0,0,246,247, + 126,126,126,126,206,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0, + 126,126,126,126,206,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0, + 126,126,126,126,206,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0, + 126,126,126,126,206,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0, + 126,126,126,126,206,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,246,247,248,0,0,0,0,0,0,0,0,0,0,0,0,0, + 126,126,126,126,206,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 126,126,126,126,206,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 126,126,126,126,206,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 126,126,126,126,206,86,208,0,0,0,166,167,168,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,166,167, + 126,126,126,126,206,86,208,0,0,0,206,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86, + 126,126,126,126,206,86,208,0,0,0,206,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86, + }; + + obj.createentity(64, 152, 10, 0, 49530); // (savepoint) + rcol = 2; + warpy = true; + roomname = "As we go up, we go down"; + result = contents; + break; + } + + case rn(54,49): + { + + static const short contents[] = { + 80,80,80,202,200,202,200,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,202,200,202,200,80, + 241,241,241,242,200,202,240,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,242,200,202,240,241, + 0,0,0,0,200,202,7,7,7,7,7,7,160,161,161,162,7,7,7,7,7,7,7,160,161,161,162,7,7,7,7,7,7,7,7,7,200,202,0,0, + 0,0,0,0,200,202,0,0,0,0,0,0,240,241,241,242,0,0,0,0,0,0,0,240,241,241,242,0,0,0,0,0,0,0,0,0,240,242,0,0, + 0,0,0,0,200,202,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,200,202,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,200,202,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,200,202,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,200,202,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,240,242,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 161,161,161,161,161,162,0,0,0,0,160,162,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,160,161,161,161,161,161, + 80,80,80,80,80,202,0,0,0,0,200,202,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,80,80,80,80,80, + 80,80,80,80,80,202,0,0,0,0,200,202,6,6,6,6,0,0,0,0,0,0,0,6,6,6,6,0,0,0,0,0,0,0,200,80,80,80,80,80, + 80,80,80,80,80,202,0,0,0,0,200,202,160,161,161,162,0,0,0,0,0,0,0,160,161,161,162,0,0,0,0,0,0,0,200,80,80,80,80,80, + 80,80,80,80,80,202,0,0,0,0,200,202,200,80,80,202,0,0,0,0,0,0,0,200,80,80,202,0,0,0,0,0,0,0,200,80,80,80,80,80, + 80,80,80,80,80,202,0,0,0,0,200,202,240,241,241,242,0,0,0,0,0,0,0,240,241,241,242,0,0,0,0,0,0,0,200,80,80,80,80,80, + 80,80,80,80,80,202,0,0,0,0,200,202,7,7,7,7,0,0,0,0,0,0,0,7,7,7,7,0,0,0,0,0,0,0,200,80,80,80,80,80, + 80,80,80,80,80,202,0,0,0,0,200,202,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,80,80,80,80,80, + 241,241,241,241,241,242,0,0,0,0,200,202,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,240,241,241,241,241,241, + 0,0,0,0,0,0,0,0,0,0,200,202,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,200,202,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,200,202,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,200,202,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,200,202,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,200,202,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,200,202,0,0,0,0,0,0,0,0,0,0,0,160,161,161,162,0,0,0,0,0,0,0,0,0,160,162,0,0, + 0,0,0,0,0,0,0,0,0,0,200,202,0,0,0,0,6,6,6,6,6,6,6,240,241,241,242,6,6,6,6,6,6,6,6,6,200,202,0,0, + 161,161,161,161,161,161,161,161,161,162,200,202,0,0,0,0,160,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,162,200,202,160,161, + 80,80,80,80,80,80,80,80,80,202,200,202,0,0,0,0,200,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,202,200,202,200,80, + 80,80,80,80,80,80,80,80,80,202,200,202,0,0,0,0,200,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,202,200,202,200,80, + }; + + obj.createentity(296, 64, 10, 1, 49540); // (savepoint) + obj.createentity(152-4-15+8, 32, 1, 0, 6, 128, 32, 288, 200); // Enemy, bounded + obj.createentity(240-4-15+8, 186, 1, 1, 6, 128, 32, 288, 200); // Enemy, bounded + obj.createentity(296, 152, 10, 0, 49541); // (savepoint) + rcol = 0; + warpx = true; + roomname = "Time to get serious"; + result = contents; + break; + } + + + case rn(54,50): + { + + static const short contents[] = { + 86,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,86, + 86,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,86, + 86,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,86, + 86,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,86, + 86,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,86, + 86,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,86, + 86,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,86, + 86,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,86, + 86,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,246,247,247, + 86,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 86,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 86,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 86,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 86,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 86,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 86,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 86,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,166,167,168,166,167,167, + 86,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,246,247,248,206,86,86, + 86,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,86, + 86,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,86, + 86,86,208,0,0,0,0,0,0,0,0,166,167,167,167,168,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,86, + 86,86,208,0,0,0,0,0,0,0,0,246,247,247,247,248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,86, + 86,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,86, + 86,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,86, + 86,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,86, + 86,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,86, + 86,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,86, + 86,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,86, + 86,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,86, + 86,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,86, + }; + if(!game.intimetrial) + { + obj.createentity((7 * 8) + 4, (6 * 8), 14); //Teleporter! + } + rcol = 2; + warpy = true; + roomname = "Wheeler's Wormhole"; + result = contents; + break; + } + + case rn(55,50): + { + + static const short contents[] = { + 212,92,92,214,252,253,253,254,212,92,92,214,212,92,92,214,212,92,92,214,212,92,92,214,212,92,92,214,212,92,92,214,212,92,92,214,212,92,92,214, + 212,92,92,214,0,0,0,0,252,253,253,254,212,92,92,214,212,92,92,214,212,92,92,214,212,92,92,214,212,92,92,214,212,92,92,214,212,92,92,214, + 212,92,92,214,0,0,0,0,0,0,0,0,252,253,253,254,212,92,92,214,212,92,92,214,212,92,92,214,212,92,92,214,212,92,92,214,212,92,92,214, + 212,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,214,212,92,92,214,212,92,92,214,212,92,92,214,212,92,92,214,212,92,92,214, + 212,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,214,252,253,253,254,212,92,92,214,212,92,92,214,212,92,92,214,212,92,92,214, + 212,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,214,0,0,0,0,252,253,253,254,212,92,92,214,212,92,92,214,212,92,92,214, + 212,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,214,0,0,0,0,0,0,0,0,252,253,253,254,212,92,92,214,212,92,92,214, + 212,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,214,212,92,92,214, + 252,253,253,254,0,0,0,0,0,0,0,0,0,0,0,0,252,253,253,254,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,214,252,253,253,254, + 0,0,0,0,0,0,0,0,172,173,173,174,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,214,0,0,0,0, + 0,0,0,0,0,0,0,0,212,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,214,0,0,0,0, + 0,0,0,0,0,0,0,0,212,92,92,214,0,0,0,0,172,173,173,174,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,214,0,0,0,0, + 0,0,0,0,0,0,0,0,212,92,92,214,0,0,0,0,252,253,253,254,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,214,0,0,0,0, + 0,0,0,0,0,0,0,0,212,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0,172,173,173,174,0,0,0,0,212,92,92,214,0,0,0,0, + 0,0,0,0,0,0,0,0,212,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0,252,253,253,254,0,0,0,0,212,92,92,214,0,0,0,0, + 0,0,0,0,0,0,0,0,212,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,214,0,0,0,0, + 172,173,173,174,0,0,0,0,212,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,252,253,253,254,172,173,173,174, + 252,253,253,254,172,173,173,174,212,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0,172,173,173,174,0,0,0,0,0,0,0,0,252,253,253,254, + 0,0,0,0,252,253,253,254,212,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,252,253,253,254,172,173,173,174,0,0,0,0,0,0,0,0,212,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,252,253,253,254,172,173,173,174,0,0,0,0,212,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,252,253,253,254,172,173,173,174,212,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,214,212,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,214,212,92,92,214,172,173,173,174,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,214,212,92,92,214,212,92,92,214,172,173,173,174,0,0,0,0, + 172,173,173,174,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,214,212,92,92,214,212,92,92,214,212,92,92,214,172,173,173,174, + 212,92,92,214,172,173,173,174,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,214,212,92,92,214,212,92,92,214,212,92,92,214,212,92,92,214, + 212,92,92,214,212,92,92,214,172,173,173,174,0,0,0,0,0,0,0,0,212,92,92,214,212,92,92,214,212,92,92,214,212,92,92,214,212,92,92,214, + 212,92,92,214,212,92,92,214,212,92,92,214,172,173,173,174,0,0,0,0,212,92,92,214,212,92,92,214,212,92,92,214,212,92,92,214,212,92,92,214, + 212,92,92,214,212,92,92,214,212,92,92,214,212,92,92,214,0,0,0,0,212,92,92,214,212,92,92,214,212,92,92,214,212,92,92,214,212,92,92,214, + }; + + obj.createentity(96, 72, 1, 3, 8, 64, 56, 256, 152); // Enemy, bounded + obj.createentity(240, 120, 1, 2, 8, 64, 56, 256, 152); // Enemy, bounded + obj.createentity(72, 16, 10, 0, 50550); // (savepoint) + obj.createentity(264, 176, 10, 1, 50551); // (savepoint) + rcol = 4; + warpx = true; + roomname = "Ascending and Descending"; + result = contents; + break; + } + + case rn(55,51): + { + + static const short contents[] = { + 83,83,83,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,83, + 244,244,244,245,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,243,245,0,0,0,0,243,245,0,0,0,0,203,83, + 0,0,0,0,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83, + 0,0,0,0,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83, + 0,0,0,0,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83, + 0,0,0,0,0,0,0,0,203,205,0,0,0,0,243,245,0,0,0,0,243,245,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83, + 164,164,164,165,0,0,0,0,203,205,0,0,0,0,163,164,165,163,164,164,164,164,164,164,164,164,164,164,164,164,165,163,164,165,0,0,0,0,203,83, + 83,83,83,205,0,0,0,0,243,245,0,0,0,0,203,83,205,203,83,83,83,83,83,83,83,83,83,83,83,83,205,203,83,205,0,0,0,0,203,83, + 83,83,83,205,0,0,0,0,0,0,0,0,0,0,243,244,245,243,244,244,244,244,244,244,244,244,244,244,244,244,245,243,244,245,0,0,0,0,203,83, + 83,83,83,205,0,0,0,0,0,0,0,0,0,0,163,164,164,164,164,164,164,164,164,165,7,7,7,7,7,7,7,7,163,165,0,0,0,0,203,83, + 83,83,83,205,0,0,0,0,0,0,0,0,0,0,243,244,244,244,244,244,244,244,244,245,0,0,0,0,0,0,0,0,243,245,0,0,0,0,203,83, + 83,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83, + 83,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83, + 83,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83, + 83,83,83,205,0,0,0,0,163,165,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83, + 83,83,83,205,0,0,0,0,203,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83, + 83,83,83,205,0,0,0,0,203,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83, + 83,83,83,205,0,0,0,0,203,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83, + 83,83,83,205,0,0,0,0,203,205,0,0,0,0,163,165,0,0,0,0,0,0,0,0,163,164,164,164,164,164,164,164,164,165,0,0,0,0,203,83, + 83,83,83,205,0,0,0,0,203,205,0,0,0,0,243,245,6,6,6,6,6,6,6,6,243,244,244,244,244,244,244,244,244,245,0,0,0,0,203,83, + 83,83,83,205,0,0,0,0,203,205,0,0,0,0,163,164,165,163,164,164,164,164,164,164,164,164,164,164,164,164,165,163,164,165,0,0,0,0,203,83, + 83,83,83,205,0,0,0,0,203,205,0,0,0,0,203,83,205,203,83,83,83,83,83,83,83,83,83,83,83,83,205,203,83,205,0,0,0,0,203,83, + 83,83,83,205,0,0,0,0,203,205,0,0,0,0,243,244,245,243,244,244,244,244,244,244,244,244,244,244,244,244,245,243,244,245,0,0,0,0,203,83, + 83,83,83,205,0,0,0,0,203,205,0,0,0,0,163,165,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,163,165,0,0,0,0,203,83, + 83,83,83,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,205,0,0,0,0,203,83, + 83,83,83,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,205,0,0,0,0,203,83, + 83,83,83,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,205,0,0,0,0,203,83, + 83,83,83,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,163,165,0,0,0,0,163,165,0,0,0,0,203,205,0,0,0,0,203,83, + 83,83,83,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,83, + 83,83,83,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,83, + }; + + obj.createentity(280, 24, 1, 2, 3, 128, 16, 304, 216); // Enemy, bounded + obj.createentity(136, 192, 1, 3, 3, 128, 16, 304, 216); // Enemy, bounded + obj.createentity(40, 8, 1, 0, 10, 24, -56, 120, 280); // Enemy, bounded + obj.createentity(88, 8, 1, 0, 10, 24, -40, 120, 272); // Enemy, bounded + obj.createentity(256, 128, 10, 1, 51550); // (savepoint) + obj.createentity(136, 32, 10, 1, 51551); // (savepoint) + rcol = 1; + warpy = true; + roomname = "Shockwave Rider"; + result = contents; + break; + } + + case rn(54,51): + { + + static const short contents[] = { + 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,211,209,89,89,211,209,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89, + 250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,251,249,250,250,251,249,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,171,169,170,170,171,0,0,0,169,170,170,170,170,170,170,170,170,170,170,170,170,170,170, + 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,211,209,89,89,211,0,0,0,209,89,89,89,89,89,89,89,89,89,89,89,89,89,89, + 250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,251,209,89,89,211,0,0,0,249,250,250,250,250,250,250,250,250,250,250,250,250,250,250, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,249,250,250,251,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,7,7,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,6,6,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,169,170,170,171,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 170,170,170,170,170,170,170,170,170,170,170,170,170,170,171,0,0,0,209,89,89,211,169,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170, + 89,89,89,89,89,89,89,89,89,89,89,89,89,89,211,0,0,0,209,89,89,211,209,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89, + 250,250,250,250,250,250,250,250,250,250,250,250,250,250,251,0,0,0,209,89,89,211,249,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,249,250,250,251,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,7,7,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,6,6,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,169,170,170,171,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,171,209,89,89,211,0,0,0,169,170,170,170,170,170,170,170,170,170,170,170,170,170,170, + 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,211,209,89,89,211,0,0,0,209,89,89,89,89,89,89,89,89,89,89,89,89,89,89, + 250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,251,249,250,250,251,0,0,0,249,250,250,250,250,250,250,250,250,250,250,250,250,250,250, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,171,169,170,170,171,169,170,170,170,170,170,170,170,170,171,0,0,0,0,169,170,170,170, + 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,211,209,89,89,211,209,89,89,89,89,89,89,89,89,211,0,0,0,0,209,89,89,89, + 89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,211,209,89,89,211,209,89,89,89,89,89,89,89,89,211,0,0,0,0,209,89,89,89, + }; + + obj.createentity(296, 32, 10, 1, 51540); // (savepoint) + obj.createentity(184, 192, 1, 18, 48, -800, -24, 4000, 264); // Enemy, bounded + obj.createentity(88, 136, 1, 17, 48, -800, -32, 4000, 272); // Enemy, bounded + obj.createentity(184, 80, 1, 18, 48, -800, -32, 4000, 272); // Enemy, bounded + + + obj.createentity(8, 32, 20, 1); // (terminal) + obj.createblock(5, 8-8, 32, 20, 16, 17); + + rcol = 3; + warpx = true; + roomname = "Sweeney's Maze"; + result = contents; + break; + } + + case rn(54,52): + { + + static const short contents[] = { + 95,95,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,175,177,0,0,0,0,215,95,95,95, + 256,256,256,257,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,257,0,0,0,0,255,256,256,256, + 176,177,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,175,176, + 95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95, + 95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95, + 95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95, + 95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95, + 95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95, + 95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95, + 95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95, + 95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95, + 95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95, + 95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95, + 95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95, + 95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95, + 95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95, + 95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95, + 95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95, + 95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95, + 95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95, + 95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95, + 95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95, + 256,257,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,256, + 176,176,176,177,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,175,177,0,0,0,0,175,176,176,176, + 95,95,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,217,0,0,0,0,215,95,95,95, + 95,95,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,257,0,0,0,0,215,95,95,95, + }; + + obj.createentity(288, 200, 10, 1, 52540); // (savepoint) + obj.createentity(48, 16, 1, 1, 10, 0, -40, 320, 296); // Enemy, bounded + obj.createentity(64, 16+8+4+2, 1, 1, 10, 0, -48, 320, 280); // Enemy, bounded + obj.createentity(80, 16+16+8+4, 1, 1, 10, 0, -40, 320, 280); // Enemy, bounded + obj.createentity(96, 16+24+12+6, 1, 1, 10, 0, -40, 320, 304); // Enemy, bounded + obj.createentity(112, 16+32+16+8, 1, 1, 10, 0, -48, 320, 288); // Enemy, bounded + obj.createentity(128, 16+40+20+10, 1, 1, 10, 0, -40, 320, 280); // Enemy, bounded + obj.createentity(144, 16+48+24+12, 1, 1, 10, 0, -56, 320, 296); // Enemy, bounded + obj.createentity(160, 16+56+28+14, 1, 1, 10, 0, -48, 320, 288); // Enemy, bounded + obj.createentity(176, 16+64+32+16, 1, 1, 10, 0, -48, 320, 296); // Enemy, bounded + obj.createentity(192, 16+72+36+18, 1, 1, 10, 0, -40, 320, 280); // Enemy, bounded + obj.createentity(208, 16+80+40+20, 1, 1, 10, 0, -48, 320, 280); // Enemy, bounded + rcol = 5; + warpy = true; + roomname = "Mind The Gap"; + result = contents; + break; + } + + case rn(53,52): + { + + static const short contents[] = { + 207,207,207,207,207,207,207,207,207,207,207,207,207,206,86,208,206,208,0,0,0,0,206,208,206,86,208,207,207,207,207,206,86,208,246,247,247,248,206,86, + 207,207,207,207,207,207,207,207,207,207,207,207,207,206,86,208,206,208,0,0,0,0,206,208,206,86,208,207,207,207,207,206,86,208,0,0,0,0,206,86, + 167,167,167,167,167,167,167,167,167,167,167,167,167,128,86,208,206,208,0,0,0,0,206,208,206,86,127,167,167,167,167,128,86,208,0,0,0,0,206,86, + 86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,208,206,208,0,0,0,0,206,208,206,86,86,86,86,86,86,86,86,208,0,0,0,0,206,86, + 247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,248,206,208,0,0,0,0,206,208,246,247,247,247,247,247,247,247,247,248,0,0,0,0,246,247, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,246,248,0,0,0,0,246,248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,166,168,0,0,0,0,166,168,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 166,168,0,0,0,0,166,168,166,167,167,167,167,167,167,168,206,208,0,0,0,0,206,208,166,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167, + 246,248,0,0,0,0,246,248,246,247,247,247,247,247,247,248,206,208,0,0,0,0,206,208,246,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,246,248,0,0,0,0,246,248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,166,168,0,0,0,0,166,168,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,168,206,208,0,0,0,0,206,208,166,167,167,167,167,167,167,168,166,168,0,0,0,0,166,168, + 247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,248,206,208,0,0,0,0,206,208,246,247,247,247,247,247,247,248,246,248,0,0,0,0,246,248, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,246,248,0,0,0,0,246,248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,166,168,0,0,0,0,166,168,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 166,168,0,0,0,0,166,168,166,167,167,167,167,167,167,168,206,208,0,0,0,0,206,208,166,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167, + 246,248,0,0,0,0,246,248,246,247,247,247,247,247,247,248,246,248,0,0,0,0,246,248,246,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167, + 86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86, + 86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86, + }; + + obj.createentity(152, 200, 10, 1, 52530); // (savepoint) + obj.createentity(248, 48, 1, 3, 5, -24, -24, 344, 256); // Enemy, bounded + obj.createentity(152, 48, 1, 3, 5, -24, -24, 344, 256); // Enemy, bounded + obj.createentity(152, 96, 1, 2, 5, -24, -24, 344, 256); // Enemy, bounded + obj.createentity(56, 96, 1, 2, 5, -24, -24, 344, 256); // Enemy, bounded + obj.createentity(104, 144, 1, 3, 5, -24, -24, 344, 256); // Enemy, bounded + obj.createentity(200, 144, 1, 3, 5, -24, -24, 344, 256); // Enemy, bounded + obj.createentity(280, 16, 9, 12); //Shiny Trinket + + + obj.createentity(24, 200, 20, 1); // (terminal) + obj.createblock(5, 24-8, 200, 20, 16, 18); + rcol = 2; + warpx = true; + roomname = "Edge Games"; + result = contents; + break; + } + + case rn(53,51): + { + + static const short contents[] = { + 83,83,205,0,0,0,0,203,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,83,83, + 83,83,205,0,0,0,0,203,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,83,83, + 83,83,205,0,0,0,0,203,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,83,83, + 83,83,205,0,0,0,0,203,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,83,83, + 244,244,245,0,0,0,0,243,245,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,243,245,0,0,0,0,243,245,0,0,0,0,243,244,244, + 0,0,0,0,0,0,163,165,0,0,0,0,163,165,0,0,0,0,163,164,164,164,164,164,164,165,0,0,0,0,163,165,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,83,83,83,83,83,83,205,0,0,0,0,203,205,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,83,83,83,83,83,83,205,0,0,0,0,203,205,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,243,245,0,0,0,0,243,245,0,0,0,0,243,244,244,244,244,244,244,245,0,0,0,0,243,245,0,0,0,0,0,0,0,0, + 164,164,164,164,164,164,165,0,0,0,0,163,165,0,0,0,0,163,165,0,0,0,0,163,165,0,0,0,0,163,165,0,0,0,0,163,164,164,164,164, + 83,83,83,83,83,83,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,83,83,83,83, + 83,83,83,83,83,83,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,83,83,83,83, + 244,244,244,244,244,244,245,0,0,0,0,243,245,0,0,0,0,243,245,0,0,0,0,243,245,0,0,0,0,243,245,0,0,0,0,243,244,244,244,244, + 0,0,0,0,163,165,0,0,0,0,163,165,0,0,0,0,163,165,0,0,0,0,163,165,0,0,0,0,163,165,0,0,0,0,163,165,0,0,0,0, + 0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0, + 0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0, + 0,0,0,0,243,245,0,0,0,0,243,245,0,0,0,0,243,245,0,0,0,0,243,245,0,0,0,0,243,245,0,0,0,0,243,245,0,0,0,0, + 0,0,0,163,165,0,0,0,0,163,165,0,0,0,0,163,165,0,0,0,0,0,0,0,0,0,0,163,165,0,0,0,0,163,165,0,0,0,0,0, + 0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,0,0,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,0, + 0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,0,0,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,0, + 0,0,0,243,245,0,0,0,0,243,245,0,0,0,0,243,245,0,0,0,0,0,0,0,0,0,0,243,245,0,0,0,0,243,245,0,0,0,0,0, + 164,164,164,165,0,0,0,0,163,165,0,0,0,0,163,164,164,164,164,164,164,164,164,164,164,164,164,165,0,0,0,0,163,165,0,0,0,0,163,164, + 83,83,83,205,0,0,0,0,203,205,0,0,0,0,203,83,83,83,83,83,83,83,83,83,83,83,83,205,0,0,0,0,203,205,0,0,0,0,203,83, + 83,83,83,205,0,0,0,0,203,205,0,0,0,0,203,83,83,83,83,83,83,83,83,83,83,83,83,205,0,0,0,0,203,205,0,0,0,0,203,83, + 244,244,244,245,0,0,0,0,243,245,0,0,0,0,243,244,244,244,244,244,244,244,244,244,244,244,244,245,0,0,0,0,243,245,0,0,0,0,243,244, + 164,164,165,0,0,0,0,163,165,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,163,165,0,0,0,0,163,165,0,0,0,0,163,164,164, + 83,83,205,0,0,0,0,203,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,83,83, + 83,83,205,0,0,0,0,203,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,83,83, + 83,83,205,0,0,0,0,203,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,83,83, + 83,83,205,0,0,0,0,203,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,83,83, + }; + + obj.createentity(152, 112, 13); + rcol = 1; + warpx = true; + warpy = true; + roomname = "The Brown Gate"; + result = contents; + break; + } + + case rn(55,49): + { + + static const short contents[] = { + 0,0,212,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,214,0,0, + 0,0,212,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,214,0,0, + 0,0,252,253,254,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,252,253,254,0,0, + 6,6,172,173,174,0,0,0,0,0,0,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,0,0,0,0,172,173,174,6,6, + 173,174,212,92,214,0,0,0,0,0,0,172,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,174,0,0,0,0,212,92,214,172,173, + 253,254,252,253,254,0,0,0,0,0,0,252,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,254,0,0,0,0,252,253,254,252,253, + 0,0,0,0,0,0,0,0,0,0,0,7,7,7,7,7,7,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,6,6,6,0,0,0,0,6,6,6,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,172,173,173,174,0,0,0,0,172,173,173,174,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,172,173,173,174,0,0,0,0,0,212,92,92,214,0,0,0,0,212,92,92,214,0,0,0,0,0,172,173,173,174,0,0,0,0,0, + 6,6,6,6,6,252,253,253,254,6,6,6,6,6,252,253,253,254,0,0,0,0,252,253,253,254,6,6,6,6,6,252,253,253,254,6,6,6,6,6, + 173,173,173,173,173,173,173,173,173,173,173,173,173,174,172,173,174,0,0,0,0,0,0,172,173,174,172,173,173,173,173,173,173,173,173,173,173,173,173,173, + 92,92,92,92,92,92,92,92,92,92,92,92,92,214,212,92,214,0,0,0,0,0,0,212,92,214,212,92,92,92,92,92,92,92,92,92,92,92,92,92, + 253,253,253,253,253,253,253,253,253,253,253,253,253,254,212,92,214,0,0,0,0,0,0,212,92,214,252,253,253,253,253,253,253,253,253,253,253,253,253,253, + 7,7,172,173,174,7,7,7,7,7,7,7,7,7,212,92,214,0,0,0,0,0,0,212,92,214,7,7,7,7,7,7,7,7,7,172,173,174,7,7, + 0,0,212,92,214,0,0,0,0,0,0,0,0,0,212,92,214,172,173,173,173,173,174,212,92,214,0,0,0,0,0,0,0,0,0,212,92,214,0,0, + 0,0,252,253,254,0,0,0,0,0,0,0,0,0,252,253,254,252,253,253,253,253,254,252,253,254,0,0,0,0,0,0,0,0,0,252,253,254,0,0, + 0,0,172,173,174,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,172,173,174,0,0, + 0,0,212,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,214,0,0, + 0,0,212,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,214,0,0, + 0,0,212,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,214,0,0, + 0,0,212,92,214,0,0,0,0,172,173,173,173,173,173,174,0,0,0,0,0,0,0,0,172,173,173,173,173,173,174,0,0,0,0,212,92,214,0,0, + 0,0,212,92,214,0,0,0,0,252,253,253,253,253,253,254,0,0,0,0,0,0,0,0,252,253,253,253,253,253,254,0,0,0,0,212,92,214,0,0, + 0,0,212,92,214,0,0,0,0,7,7,7,7,7,7,7,0,0,0,0,0,0,0,0,7,7,7,7,7,7,7,0,0,0,0,212,92,214,0,0, + 0,0,212,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,214,0,0, + 0,0,212,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,214,0,0, + 0,0,212,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,214,0,0, + 0,0,212,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,214,0,0, + }; + + obj.createentity(152, 112, 13); + obj.createentity(152, 152, 10, 0, 49550); // (savepoint) + rcol = 4; + warpx = true; + warpy = true; + roomname = "To The Batcave!"; + result = contents; + break; + } + + case rn(55,52): + { + + static const short contents[] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,169,170,170,170,170,170,170,171,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,209,89,89,89,89,89,89,211,6,6,6,6,6,6,6,6,0,0,0,0,0,0,6,6, + 170,170,170,170,170,170,170,170,171,169,170,170,170,170,170,171,209,89,89,89,89,89,89,211,169,170,170,170,170,170,170,171,0,0,0,0,0,0,169,170, + 89,89,89,89,89,89,89,89,211,249,250,250,250,250,250,251,209,89,89,89,89,89,89,211,249,250,250,250,250,250,250,251,0,0,0,0,0,0,209,89, + 89,89,89,89,89,89,89,89,211,7,7,7,7,7,7,7,209,89,89,89,89,89,89,211,7,7,7,7,7,7,7,7,0,0,0,0,0,0,209,89, + 250,250,250,250,250,250,250,250,251,0,0,0,0,0,0,0,249,250,250,250,250,250,250,251,0,0,0,0,0,0,0,0,0,0,0,0,0,0,249,250, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,169,170,170,170,170,170,171,0,0,0,0,0,0,0,0,0,0,0,0,0,0,169,170,170,170,170,170,170,171,0, + 6,6,6,6,6,6,6,6,6,6,209,89,89,89,89,89,211,6,6,6,6,6,6,6,6,6,6,6,6,6,6,209,89,89,89,89,89,89,211,6, + 170,171,169,170,170,170,170,170,170,171,209,89,89,89,89,89,211,169,170,170,170,170,170,170,170,170,170,170,170,170,171,209,89,89,89,89,89,89,211,169, + 250,251,209,89,89,89,89,89,89,211,249,250,250,250,250,250,251,249,250,250,250,250,250,250,250,250,250,250,250,250,251,249,250,250,250,250,250,250,251,249, + 7,7,209,89,89,89,89,89,89,211,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, + 0,0,249,250,250,250,250,250,250,251,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + obj.createentity(152, 112, 13); + obj.createentity(136, 40, 10, 1, 52550); // (savepoint) + rcol = 3; + warpx = true; + warpy = true; + roomname = "This will make you flip"; + result = contents; + break; + } + + case rn(52,52): + { + + static const short contents[] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,217,216,216,216,216,215,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,217,216,216,216,216,215,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,217,216,216,216,216,215,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,217,216,216,216,216,215,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,217,216,216,216,216,215,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,217,216,216,216,216,215,95,217,175,176,176,177,0,0,0,0,0,0,0,0,0,0, + 176,176,177,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,217,216,216,216,216,215,95,217,215,95,95,217,0,0,0,0,0,0,0,0,175,176, + 95,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,136,176,176,176,176,137,95,217,215,95,95,217,0,0,0,0,0,0,0,0,215,95, + 95,95,217,6,6,6,6,6,6,6,6,6,0,0,0,0,215,95,95,95,95,95,95,95,95,217,215,95,95,217,6,6,6,6,6,6,6,6,215,95, + 95,95,217,175,176,176,176,176,176,176,176,177,0,0,0,0,255,256,256,256,256,256,256,256,256,257,215,95,95,217,175,176,176,176,177,175,176,177,215,95, + 256,256,257,255,256,256,256,256,256,256,256,257,0,0,0,0,175,177,7,7,7,7,7,175,176,177,215,95,95,217,215,95,95,95,217,255,256,257,255,256, + 176,177,0,0,0,0,0,0,0,175,176,177,0,0,0,0,255,257,0,0,0,0,0,215,95,217,215,95,95,217,215,95,95,95,217,7,7,7,175,176, + 256,257,0,0,0,0,0,0,0,215,95,217,0,0,0,0,7,7,0,0,0,0,0,255,256,257,255,256,256,257,255,256,256,256,257,0,0,0,255,256, + 0,0,0,0,0,0,0,0,0,215,95,217,0,0,0,0,0,0,0,0,0,0,0,175,176,177,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,215,95,217,0,0,0,0,0,0,0,0,0,0,0,215,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,215,95,217,0,0,0,0,0,0,0,0,0,0,0,215,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,215,95,217,0,0,0,0,0,0,0,0,0,0,0,215,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 176,177,0,0,0,0,0,0,0,215,95,217,0,0,0,0,0,0,0,0,0,0,0,215,95,217,0,0,0,0,0,0,0,175,176,176,176,176,176,176, + 95,217,0,0,0,0,0,0,0,255,256,257,0,0,0,0,0,0,0,0,0,0,0,215,95,217,0,0,0,0,6,6,6,215,95,95,95,95,95,95, + 95,217,175,176,176,176,176,176,176,176,176,176,176,176,176,176,176,177,0,0,0,0,0,215,95,217,0,0,0,0,175,176,177,215,95,95,95,95,95,95, + 256,257,255,256,256,256,256,256,256,256,256,256,256,256,256,256,256,257,6,6,6,6,6,255,256,257,0,0,0,0,255,256,257,255,256,256,256,256,256,256, + 7,7,7,7,7,7,7,7,7,175,176,176,176,176,176,177,175,176,176,176,176,176,176,176,176,177,0,0,0,0,175,176,176,177,7,7,7,7,7,7, + 0,0,0,0,0,0,0,0,0,215,95,95,95,95,95,217,215,95,95,95,95,95,95,95,95,217,0,0,0,0,215,95,95,217,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,255,256,256,256,256,256,257,215,95,96,256,256,256,256,97,95,217,0,0,0,0,215,95,95,217,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,217,216,216,216,216,215,95,217,0,0,0,0,255,256,256,257,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,217,216,216,216,216,215,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,217,216,216,216,216,215,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,217,216,216,216,216,215,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,217,216,216,216,216,215,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,217,216,216,216,216,215,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + obj.createentity(152, 112, 13); + obj.createentity(288, 120, 10, 1, 52520); // (savepoint) + rcol = 5; + warpx = true; + warpy = true; + roomname = "Twisty Little Passages"; + result = contents; + break; + } + + case rn(50,51): + { + + static const short contents[] = { + 83,83,83,83,83,83,83,83,83,83,83,83,83,205,203,83,83,83,83,83,83,83,83,83,83,205,0,0,0,0,203,83,83,83,83,83,83,83,83,83, + 83,83,83,83,83,83,83,83,83,83,83,83,83,205,203,83,83,83,83,83,83,83,83,83,83,205,0,0,0,0,203,83,83,83,83,83,83,83,83,83, + 83,83,83,83,83,83,83,83,83,83,83,83,83,205,243,244,244,244,244,244,244,244,244,244,244,245,0,0,0,0,203,83,83,83,83,83,83,83,83,83, + 83,83,83,83,83,83,83,83,83,83,83,83,83,205,163,164,165,163,164,164,164,164,164,164,164,165,0,0,0,0,203,83,83,83,83,83,83,83,83,83, + 244,244,244,244,244,244,244,244,244,244,244,244,244,245,203,83,205,243,244,244,244,244,244,244,244,245,0,0,0,0,243,244,244,244,244,244,244,244,244,244, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,243,244,245,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,7,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,6,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,163,164,165,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 164,164,164,164,164,164,165,49,50,163,165,0,0,0,203,83,205,163,164,164,164,164,164,164,164,165,0,0,0,0,163,164,165,49,50,163,164,165,163,164, + 83,83,83,83,83,83,205,49,50,203,205,0,0,0,203,83,205,203,83,83,83,83,83,83,83,205,0,0,0,0,203,83,205,49,50,203,83,205,203,83, + 244,244,244,244,244,244,245,49,50,243,245,0,0,0,203,83,205,243,244,244,244,244,244,244,244,245,0,0,0,0,203,83,205,49,50,203,83,205,243,244, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83,205,0,0,0,0,0,0,163,164,165,0,0,0,0,203,83,205,49,50,203,83,205,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83,205,0,0,0,0,0,0,203,83,205,163,164,164,165,203,83,205,49,50,203,83,205,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83,205,0,0,0,0,0,0,203,83,205,203,83,83,205,203,83,205,49,50,203,83,205,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83,205,0,0,0,0,0,0,203,83,205,203,83,83,205,203,83,205,49,50,203,83,205,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83,205,0,0,0,0,0,0,203,83,205,243,244,244,245,203,83,205,49,50,203,83,205,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83,205,0,0,0,0,0,0,203,83,205,0,0,0,0,203,83,205,49,50,203,83,205,0,0, + 164,164,164,164,164,164,165,49,50,163,165,0,0,0,203,83,205,0,0,0,0,0,0,203,83,205,0,0,0,0,203,83,205,49,50,203,83,205,163,164, + 83,83,83,83,83,83,205,49,50,203,205,0,0,0,203,83,205,0,0,0,0,0,0,203,83,205,0,0,0,0,203,83,205,49,50,203,83,205,203,83, + 244,244,244,244,244,244,245,49,50,243,245,0,0,0,203,83,205,0,0,0,0,0,0,243,244,245,0,0,0,0,243,244,245,49,50,243,244,245,243,244, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,243,244,245,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,7,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,6,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,163,164,165,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 164,164,164,164,164,164,164,164,164,164,164,164,164,165,203,83,205,163,164,164,164,164,164,164,164,165,0,0,0,0,163,164,164,164,164,164,164,164,164,164, + 83,83,83,83,83,83,83,83,83,83,83,83,83,205,243,244,245,243,244,244,244,244,244,244,244,245,0,0,0,0,203,83,83,83,83,83,83,83,83,83, + 83,83,83,83,83,83,83,83,83,83,83,83,83,205,163,164,164,164,164,164,164,164,164,164,164,165,0,0,0,0,203,83,83,83,83,83,83,83,83,83, + 83,83,83,83,83,83,83,83,83,83,83,83,83,205,203,83,83,83,83,83,83,83,83,83,83,205,0,0,0,0,203,83,83,83,83,83,83,83,83,83, + 83,83,83,83,83,83,83,83,83,83,83,83,83,205,203,83,83,83,83,83,83,83,83,83,83,205,0,0,0,0,203,83,83,83,83,83,83,83,83,83, + }; + + obj.createentity(152, 112, 13); + obj.createentity(24, 128, 10, 1, 52510); // (savepoint) + obj.createentity(56, 48, 1, 0, 10, -16, -16, 336, 256); // Enemy, bounded + obj.createentity(264, 48, 1, 0, 10, -16, -16, 336, 256); // Enemy, bounded + obj.createentity(152, 48, 1, 2, 8, -24, -24, 344, 256); // Enemy, bounded + obj.createentity(152, 176, 1, 2, 8, -24, -16, 344, 256); // Enemy, bounded + rcol = 1; + warpx = true; + warpy = true; + roomname = "That's Why I Have To Kill You"; + result = contents; + break; + } + + case rn(52,49): + { + + static const short contents[] = { + 86,86,86,86,86,208,0,0,0,0,206,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,208,0,0,0,0,206,86,86,86,86,86, + 86,86,86,86,86,208,0,0,0,0,206,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,208,0,0,0,0,206,86,86,86,86,86, + 86,86,86,86,86,208,0,0,0,0,206,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,208,0,0,0,0,206,86,86,86,86,86, + 86,86,86,86,86,208,0,0,0,0,206,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,208,0,0,0,0,206,86,86,86,86,86, + 86,86,86,86,86,208,0,0,0,0,206,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,208,0,0,0,0,206,86,86,86,86,86, + 86,86,86,86,86,208,0,0,0,0,206,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,208,0,0,0,0,206,86,86,86,86,86, + 247,247,247,247,247,248,0,0,0,0,246,248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,246,248,0,0,0,0,246,247,247,247,247,247, + 7,7,7,7,7,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,7,0,0,0,0,7,7,7,7,7,7, + 6,6,6,6,6,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,6,0,0,0,0,6,6,6,6,6,6, + 167,167,167,167,167,168,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,166,168,0,0,0,0,166,167,167,168,166,167, + 86,86,86,86,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,208,0,0,0,0,206,86,86,208,206,86, + 86,86,86,86,86,208,166,168,49,50,166,168,166,167,167,167,167,167,167,167,167,167,167,167,167,167,167,168,206,208,0,0,0,0,246,247,247,248,206,86, + 247,247,247,247,247,248,246,248,49,50,246,248,246,247,247,247,247,247,247,247,247,247,247,247,247,247,247,248,206,208,0,0,0,0,7,7,7,7,246,247, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,208,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,208,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,208,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,208,0,0,0,0,0,0,0,0,0,0, + 167,167,167,167,167,167,167,168,49,50,166,168,166,167,167,167,167,167,167,167,167,167,167,167,167,167,167,168,206,208,0,0,0,0,166,167,167,167,167,167, + 247,247,247,247,247,247,247,248,49,50,206,208,246,247,247,247,247,247,247,247,247,247,247,247,247,247,247,248,206,208,0,0,0,0,246,247,247,247,247,247, + 0,0,0,0,0,0,0,0,0,0,206,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,208,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,206,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,208,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,206,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,208,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,206,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,208,0,0,0,0,0,0,0,0,0,0, + 6,6,6,6,166,168,0,0,0,0,206,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,208,0,0,0,0,166,168,6,6,6,6, + 167,167,167,168,206,208,0,0,0,0,206,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,208,0,0,0,0,206,208,166,167,167,167, + 247,247,247,248,246,248,0,0,0,0,206,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,208,0,0,0,0,246,248,246,247,247,247, + 167,167,167,167,167,168,0,0,0,0,206,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,208,0,0,0,0,166,167,167,167,167,167, + 86,86,86,86,86,208,0,0,0,0,206,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,208,0,0,0,0,206,86,86,86,86,86, + 86,86,86,86,86,208,0,0,0,0,206,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,208,0,0,0,0,206,86,86,86,86,86, + 86,86,86,86,86,208,0,0,0,0,206,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,208,0,0,0,0,206,86,86,86,86,86, + }; + + obj.createentity(152, 112, 13); + obj.createentity(248, 16, 1, 0, 10, -24, -24, 344, 256); // Enemy, bounded + obj.createentity(64, 16, 1, 0, 10, -24, -24, 344, 256); // Enemy, bounded + obj.createentity(200, 56, 1, 2, 5, -24, -24, 344, 256); // Enemy, bounded + obj.createentity(152, 56, 1, 2, 5, -24, -24, 344, 256); // Enemy, bounded + obj.createentity(104, 56, 1, 2, 5, -24, -24, 344, 256); // Enemy, bounded + obj.createentity(152, 152, 10, 0, 49520); // (savepoint) + rcol = 2; + warpx = true; + warpy = true; + roomname = "I Love You"; + result = contents; + break; + } + + case rn(50,49): + { + + static const short contents[] = { + 83,83,205,0,0,0,0,0,203,83,83,83,83,83,83,83,83,205,203,83,83,83,205,0,0,0,0,0,203,83,83,83,205,0,0,0,0,0,203,83, + 83,83,205,0,0,0,0,0,243,244,244,244,244,244,244,244,244,245,203,83,83,83,205,0,0,0,0,0,243,244,244,244,245,0,0,0,0,0,203,83, + 83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83, + 83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83, + 83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83, + 83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83, + 83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83, + 83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,243,244,244,244,245,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83, + 83,83,205,0,0,0,0,0,163,164,164,164,165,0,0,0,0,0,163,164,164,164,164,164,164,164,164,164,164,164,164,164,165,0,0,0,0,0,203,83, + 83,83,205,0,0,0,0,0,203,83,83,83,205,0,0,0,0,0,203,83,83,83,83,83,83,83,83,83,83,83,83,83,205,0,0,0,0,0,203,83, + 244,244,245,0,0,0,0,0,203,83,83,83,205,0,0,0,0,0,203,83,84,244,244,244,244,244,244,244,244,244,85,83,205,0,0,0,0,0,243,244, + 0,0,0,0,0,0,0,0,203,83,83,83,205,0,0,0,0,0,203,83,205,123,123,123,123,123,123,123,123,123,203,83,205,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,203,83,83,83,205,0,0,0,0,0,203,83,205,123,123,123,123,123,123,123,123,123,203,83,205,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,203,83,83,83,205,0,0,0,0,0,203,83,205,123,123,123,123,123,123,123,123,123,203,83,205,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,203,83,83,83,205,0,0,0,0,0,203,83,205,123,123,123,123,123,123,123,123,123,203,83,205,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,203,83,83,83,205,0,0,0,0,0,203,83,205,123,123,123,123,123,123,123,123,123,203,83,205,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,203,83,83,83,205,0,0,0,0,0,203,83,205,123,123,123,123,123,123,123,123,123,203,83,205,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,203,83,83,83,205,0,0,0,0,0,203,83,205,123,123,123,123,123,123,123,123,123,203,83,205,0,0,0,0,0,0,0, + 164,164,165,0,0,0,0,0,203,83,83,83,205,0,0,0,0,0,203,83,124,164,164,164,164,164,164,164,164,164,125,83,205,0,0,0,0,0,163,164, + 83,83,205,0,0,0,0,0,203,83,83,83,205,0,0,0,0,0,203,83,83,83,83,83,83,83,83,83,83,83,83,83,205,0,0,0,0,0,203,83, + 83,83,205,0,0,0,0,0,203,83,83,83,205,0,0,0,0,0,243,244,244,244,244,244,244,244,244,244,244,244,244,244,245,0,0,0,0,0,203,83, + 83,83,205,0,0,0,0,0,203,83,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,163,164,164,164,165,0,0,0,0,0,203,83, + 83,83,205,0,0,0,0,0,203,83,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83,83,83,205,0,0,0,0,0,203,83, + 83,83,205,0,0,0,0,0,203,83,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83,83,83,205,0,0,0,0,0,203,83, + 83,83,205,0,0,0,0,0,203,83,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83,83,83,205,0,0,0,0,0,203,83, + 83,83,205,0,0,0,0,0,203,83,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83,83,83,205,0,0,0,0,0,203,83, + 83,83,205,0,0,0,0,0,203,83,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83,83,83,205,0,0,0,0,0,203,83, + 83,83,205,0,0,0,0,0,203,83,83,83,205,163,164,164,164,164,164,164,164,164,165,0,0,0,0,0,203,83,83,83,205,0,0,0,0,0,203,83, + 83,83,205,0,0,0,0,0,203,83,83,83,205,203,83,83,83,83,83,83,83,83,205,0,0,0,0,0,203,83,83,83,205,0,0,0,0,0,203,83, + 83,83,205,0,0,0,0,0,203,83,83,83,205,203,83,83,83,83,83,83,83,83,205,0,0,0,0,0,203,83,83,83,205,0,0,0,0,0,203,83, + }; + rcol = 1; + warpy = true; + roomname = "Green Dudes Can't Flip"; + result = contents; + break; + } + + + case rn(51,49): + { + + static const short contents[] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,175,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,177,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,215,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,217,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,215,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,217,0,0,0,0,0,0,0,0,0,0, + 176,176,176,177,0,0,0,0,0,0,255,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,257,0,0,0,0,0,0,175,176,176,176, + 95,95,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,95,95, + 95,95,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,95,95, + 256,256,256,257,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,256,256,256, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 176,176,176,177,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,175,176,176,176, + 95,95,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,95,95, + 95,95,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,95,95, + 256,256,256,257,0,0,0,0,0,0,175,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,177,0,0,0,0,0,0,255,256,256,256, + 0,0,0,0,0,0,0,0,0,0,215,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,217,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,215,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,217,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,255,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,257,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + warpx = true; + warpy = true; + rcol = 5; + + obj.createentity(14 * 8, (8 * 8) + 4, 14); //Teleporter! + + if(game.intimetrial) + { + obj.createblock(1, 20, 0, 32, 240, 82); + } + + roomname = "Murdering Twinmaker"; + result = contents; + break; + } + + case rn(49,49): + { + + static const short contents[] = { + 80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,202,0,0,0,0,0,0,0,200,80,202,201,201,201,201,201,201,201,201,201,201,201,201,201,201, + 80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,202,0,0,0,0,0,0,0,200,80,202,201,201,201,201,201,201,201,201,201,201,201,201,201,201, + 80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,202,0,0,0,0,0,0,0,200,80,202,201,201,201,201,201,201,201,201,201,201,201,201,201,201, + 241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,242,0,0,0,0,0,0,0,200,80,202,201,201,201,201,201,201,201,201,201,201,201,201,201,201, + 161,162,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,80,202,201,201,201,201,201,201,201,201,201,201,201,201,201,201, + 80,202,0,160,161,161,161,161,161,161,161,161,161,161,161,162,0,0,0,0,0,0,0,200,80,202,201,201,201,201,201,201,201,201,201,201,201,201,201,201, + 80,202,0,240,241,241,241,241,241,241,241,241,241,241,241,242,0,0,0,0,0,0,0,200,80,202,201,201,201,201,201,201,201,201,201,201,201,201,201,201, + 80,202,0,160,162,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,80,202,201,201,201,201,201,201,201,201,201,201,201,201,201,201, + 80,202,0,200,202,0,160,161,161,161,161,161,161,161,161,162,0,0,0,0,0,0,0,200,80,121,161,161,161,161,161,161,161,161,161,161,161,161,161,161, + 80,202,0,200,202,0,240,241,241,241,241,241,241,241,241,242,0,0,0,0,0,0,0,200,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80, + 80,202,0,200,202,0,160,162,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,240,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241, + 80,202,0,200,202,0,200,202,0,160,161,161,161,161,161,162,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 80,202,0,200,202,0,200,202,0,240,241,241,241,241,241,242,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 80,202,0,200,202,0,200,202,0,160,162,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 80,202,0,200,202,0,200,202,0,200,202,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 80,202,0,200,202,0,200,202,0,200,202,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 80,202,0,200,202,0,200,202,0,240,242,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 80,202,0,200,202,0,200,202,0,160,161,161,161,161,161,162,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 80,202,0,200,202,0,200,202,0,240,241,241,241,241,241,242,0,0,0,0,0,0,0,160,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161, + 80,202,0,200,202,0,240,242,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80, + 80,202,0,200,202,0,160,161,161,161,161,161,161,161,161,162,0,0,0,0,0,0,0,200,80,81,241,241,241,241,241,241,241,241,241,241,241,241,241,241, + 80,202,0,200,202,0,240,241,241,241,241,241,241,241,241,242,0,0,0,0,0,0,0,200,80,202,201,201,201,201,201,201,201,201,201,201,201,201,201,201, + 80,202,0,240,242,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,80,202,201,201,201,201,201,201,201,201,201,201,201,201,201,201, + 80,202,0,160,161,161,161,161,161,161,161,161,161,161,161,162,0,0,0,0,0,0,0,200,80,202,201,201,201,201,201,201,201,201,201,201,201,201,201,201, + 80,202,0,240,241,241,241,241,241,241,241,241,241,241,241,242,0,0,0,0,0,0,0,200,80,202,201,201,201,201,201,201,201,201,201,201,201,201,201,201, + 241,242,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,80,202,201,201,201,201,201,201,201,201,201,201,201,201,201,201, + 161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,162,0,0,0,0,0,0,0,200,80,202,201,201,201,201,201,201,201,201,201,201,201,201,201,201, + 80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,202,0,0,0,0,0,0,0,200,80,202,201,201,201,201,201,201,201,201,201,201,201,201,201,201, + 80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,202,0,0,0,0,0,0,0,200,80,202,201,201,201,201,201,201,201,201,201,201,201,201,201,201, + 80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,202,0,0,0,0,0,0,0,200,80,202,201,201,201,201,201,201,201,201,201,201,201,201,201,201, + }; + rcol = 0; + warpy = true; + + if(!game.intimetrial) + { + if(game.companion==0 && !obj.flags[11] && !game.crewstats[4]) //also need to check if he's rescued in a previous game + { + obj.createentity(255, 121, 15, 0); + obj.createblock(1, 215, 0, 160, 240, 35); + } + } + roomname = "It's Not Easy Being Green"; + result = contents; + break; + } #endif - default: - { - static const short contents[1200] = {0}; - //roomname = "Outer Space"; - //roomname_special = true; - result = contents; - break; - } - } + default: + { + static const short contents[1200] = {0}; + //roomname = "Outer Space"; + result = contents; + break; + } + } - return result; + return result; } diff --git a/desktop_version/src/WarpClass.h b/desktop_version/src/WarpClass.h index e2d4bfab..7b84cb34 100644 --- a/desktop_version/src/WarpClass.h +++ b/desktop_version/src/WarpClass.h @@ -1,14 +1,15 @@ #ifndef WARPCLASS_H #define WARPCLASS_H +#include + class warpclass { public: - const short* loadlevel(int rx, int ry); - const char* roomname; - bool roomname_special; - int rcol; - bool warpx, warpy; + const short* loadlevel(int rx, int ry); + std::string roomname; + int rcol; + bool warpx, warpy; }; #endif /* WARPCLASS_H */ diff --git a/desktop_version/src/XMLUtils.h b/desktop_version/src/XMLUtils.h index d1832bd0..b56f2361 100644 --- a/desktop_version/src/XMLUtils.h +++ b/desktop_version/src/XMLUtils.h @@ -27,31 +27,3 @@ tinyxml2::XMLDeclaration* update_declaration(tinyxml2::XMLDocument& doc); tinyxml2::XMLComment* update_comment(tinyxml2::XMLNode* parent, const char* text); } // namespace xml - - -// XMLHandle doc, XMLElement* elem -#define FOR_EACH_XML_ELEMENT(doc, elem) \ - for ( \ - elem = doc \ - .FirstChildElement() \ - .FirstChildElement() \ - .ToElement(); \ - elem != NULL; \ - elem = elem->NextSiblingElement() \ - ) - -// XMLElement* elem, XMLElement* subelem -#define FOR_EACH_XML_SUB_ELEMENT(elem, subelem) \ - for ( \ - subelem = elem->FirstChildElement(); \ - subelem != NULL; \ - subelem = subelem->NextSiblingElement() \ - ) - -// XMLElement* elem, const char* expect -#define EXPECT_ELEM(elem, expect) \ - if (SDL_strcmp(elem->Value(), expect) != 0) \ - { \ - continue; \ - } \ - do { } while (false) diff --git a/desktop_version/src/Xoshiro.c b/desktop_version/src/Xoshiro.c index 667c9969..29335006 100644 --- a/desktop_version/src/Xoshiro.c +++ b/desktop_version/src/Xoshiro.c @@ -1,6 +1,4 @@ -#include "Xoshiro.h" - -#include "Vlogging.h" +#include /* Implements the xoshiro128+ PRNG. */ @@ -46,15 +44,11 @@ uint32_t xoshiro_next(void) s[3] = rotl(s[3], 11); - vlog_debug("Next xoshiro is %u.", result); - return result; } void xoshiro_seed(uint32_t s) { - vlog_debug("Xoshiro seeded with %u.", s); - const uint32_t s0 = splitmix32(&s); const uint32_t s1 = splitmix32(&s); const uint32_t s2 = splitmix32(&s); diff --git a/desktop_version/src/editor.cpp b/desktop_version/src/editor.cpp new file mode 100644 index 00000000..4f48cc03 --- /dev/null +++ b/desktop_version/src/editor.cpp @@ -0,0 +1,6063 @@ +#if !defined(NO_CUSTOM_LEVELS) + +#define ED_DEFINITION +#include "editor.h" + +#include +#include +#include +#include + +#include "DeferCallbacks.h" +#include "Entity.h" +#include "Enums.h" +#include "FileSystemUtils.h" +#include "Graphics.h" +#include "KeyPoll.h" +#include "Map.h" +#include "Music.h" +#include "Script.h" +#include "UtilityClass.h" +#include "XMLUtils.h" + +#ifdef _WIN32 +#define SCNx32 "x" +#define SCNu32 "u" +#else +#ifndef __STDC_FORMAT_MACROS +#define __STDC_FORMAT_MACROS +#endif +#ifndef _POSIX_SOURCE +#define _POSIX_SOURCE +#endif +#include +#endif + +edlevelclass::edlevelclass(void) +{ + tileset=0; + tilecol=0; + warpdir=0; + platx1=0; + platy1=0; + platx2=320; + platy2=240; + platv=4; + enemyx1=0; + enemyy1=0; + enemyx2=320; + enemyy2=240; + enemytype=0; + directmode=0; +} + +editorclass::editorclass(void) +{ + //We create a blank map + SDL_memset(contents, 0, sizeof(contents)); + + for (size_t i = 0; i < SDL_arraysize(vmult); i++) + { + vmult[i] = i * 40 * maxwidth; + } + + reset(); +} + +// comparison, not case sensitive. +static bool compare_nocase (std::string first, std::string second) +{ + unsigned int i=0; + while ( (iSDL_tolower(second[i])) + return false; + ++i; + } + if (first.length()"); + + //Encode general XML entities + size_t start_pos = 0; + while ((start_pos = value.find("&#", start_pos)) != std::string::npos) + { + if (start_pos + 2 >= value.length()) + { + return ""; + } + + bool hex = value[start_pos + 2] == 'x'; + size_t end = value.find(';', start_pos); + + if (end == std::string::npos) + { + return ""; + } + + size_t real_start = start_pos + 2 + ((int) hex); + std::string number(value.substr(real_start, end - real_start)); + + if (!is_positive_num(number.c_str(), hex)) + { + return ""; + } + + uint32_t character = 0; + if (hex) + { + SDL_sscanf(number.c_str(), "%" SCNx32, &character); + } + else + { + SDL_sscanf(number.c_str(), "%" SCNu32, &character); + } + uint32_t utf32[] = {character, 0}; + std::string utf8; + utf8::unchecked::utf32to8(utf32, utf32 + 1, std::back_inserter(utf8)); + value.replace(start_pos, end - start_pos + 1, utf8); + } + + return value; +} + +#define TAG_FINDER(NAME, TAG) \ +static std::string NAME(const std::string& buf) \ +{ \ + return find_tag(buf, "<" TAG ">", ""); \ +} + +TAG_FINDER(find_metadata, "MetaData") //only for checking that it exists + +TAG_FINDER(find_creator, "Creator") +TAG_FINDER(find_title, "Title") +TAG_FINDER(find_desc1, "Desc1") +TAG_FINDER(find_desc2, "Desc2") +TAG_FINDER(find_desc3, "Desc3") +TAG_FINDER(find_website, "website") + +#undef TAG_FINDER + +static void levelMetaDataCallback(const char* filename) +{ + extern editorclass ed; + LevelMetaData temp; + std::string filename_ = filename; + + if (!endsWith(filename, ".vvvvvv") + || !FILESYSTEM_isFile(filename) + || FILESYSTEM_isMounted(filename)) + { + return; + } + + if (ed.getLevelMetaData(filename_, temp)) + { + ed.ListOfMetaData.push_back(temp); + } +} + +void editorclass::getDirectoryData(void) +{ + + ListOfMetaData.clear(); + + FILESYSTEM_clearLevelDirError(); + + loadZips(); + + FILESYSTEM_enumerateLevelDirFileNames(levelMetaDataCallback); + + for(size_t i = 0; i < ListOfMetaData.size(); i++) + { + for(size_t k = 0; k < ListOfMetaData.size(); k++) + { + if(compare_nocase(ListOfMetaData[i].title, ListOfMetaData[k].title )) + { + std::swap(ListOfMetaData[i] , ListOfMetaData[k]); + } + } + } + +} +bool editorclass::getLevelMetaData(std::string& _path, LevelMetaData& _data ) +{ + unsigned char *uMem; + FILESYSTEM_loadFileToMemory(_path.c_str(), &uMem, NULL, true); + + if (uMem == NULL) + { + printf("Level %s not found :(\n", _path.c_str()); + return false; + } + + std::string buf((char*) uMem); + + FILESYSTEM_freeMemory(&uMem); + + if (find_metadata(buf) == "") + { + printf("Couldn't load metadata for %s\n", _path.c_str()); + return false; + } + + _data.creator = find_creator(buf); + _data.title = find_title(buf); + _data.Desc1 = find_desc1(buf); + _data.Desc2 = find_desc2(buf); + _data.Desc3 = find_desc3(buf); + _data.website = find_website(buf); + + _data.filename = _path; + return true; +} + +void editorclass::reset(void) +{ + version=2; //New smaller format change is 2 + + mapwidth=5; + mapheight=5; + + EditorData::GetInstance().title="Untitled Level"; + EditorData::GetInstance().creator="Unknown"; + Desc1=""; + Desc2=""; + Desc3=""; + website=""; + + roomnamehide=0; + zmod=false; + xmod=false; + cmod=false; + vmod=false; + hmod=false; + bmod=false; + spacemod=false; + spacemenu=0; + shiftmenu=false; + shiftkey=false; + saveandquit=false; + note=""; + notedelay=0; + oldnotedelay=0; + deletekeyheld=false; + textmod = TEXT_NONE; + + titlemod=false; + creatormod=false; + desc1mod=false; + desc2mod=false; + desc3mod=false; + websitemod=false; + settingsmod=false; + warpmod=false; //Two step process + warpent=-1; + + boundarymod=0; + boundarytype=0; + boundx1=0; + boundx2=0; + boundy1=0; + boundy2=0; + + textent=0; + scripttexttype=0; + + drawmode=0; + dmtile=0; + dmtileeditor=0; + entcol=0; + + tilex=0; + tiley=0; + levx=0; + levy=0; + keydelay=0; + lclickdelay=0; + savekey=false; + loadkey=false; + updatetiles=true; + changeroom=true; + levmusic=0; + + entframe=0; + entframedelay=0; + + edentity.clear(); + levmusic=0; + + for (int j = 0; j < maxheight; j++) + { + for (int i = 0; i < maxwidth; i++) + { + level[i+(j*maxwidth)].tileset=0; + level[i+(j*maxwidth)].tilecol=(i+j)%32; + level[i+(j*maxwidth)].roomname=""; + level[i+(j*maxwidth)].warpdir=0; + level[i+(j*maxwidth)].platx1=0; + level[i+(j*maxwidth)].platy1=0; + level[i+(j*maxwidth)].platx2=320; + level[i+(j*maxwidth)].platy2=240; + level[i+(j*maxwidth)].platv=4; + level[i+(j*maxwidth)].enemyx1=0; + level[i+(j*maxwidth)].enemyy1=0; + level[i+(j*maxwidth)].enemyx2=320; + level[i+(j*maxwidth)].enemyy2=240; + level[i+(j*maxwidth)].enemytype=0; + level[i+(j*maxwidth)].directmode=0; + kludgewarpdir[i+(j*maxwidth)]=0; + } + } + + SDL_zeroa(contents); + + hooklist.clear(); + + sb.clear(); + + clearscriptbuffer(); + sbx=0; + sby=0; + pagey=0; + scripteditmod=false; + sbscript="null"; + scripthelppage=0; + scripthelppagedelay=0; + + hookmenupage=0; + hookmenu=0; + script.clearcustom(); + + returneditoralpha = 0; + oldreturneditoralpha = 0; + + ghosts.clear(); + currentghosts = 0; + + onewaycol_override = false; + + loaded_filepath = ""; +} + +void editorclass::gethooks(void) +{ + //Scan through the script and create a hooks list based on it + hooklist.clear(); + for (size_t i = 0; i < script.customscripts.size(); i++) + { + Script& script_ = script.customscripts[i]; + + hooklist.push_back(script_.name); + } +} + +void editorclass::loadhookineditor(std::string t) +{ + //Find hook t in the scriptclass, then load it into the editor + clearscriptbuffer(); + + for(size_t i = 0; i < script.customscripts.size(); i++) + { + Script& script_ = script.customscripts[i]; + + if(script_.name == t) + { + sb = script_.contents; + break; + } + } + + if(sb.empty()) + { + //Always have one line or we'll have problems + sb.resize(1); + } +} + +void editorclass::addhooktoscript(std::string t) +{ + //Adds hook+the scriptbuffer to the end of the scriptclass + removehookfromscript(t); + Script script_; + script_.name = t; + script_.contents = sb; + script.customscripts.push_back(script_); +} + +void editorclass::removehookfromscript(std::string t) +{ + /* Find hook t in the scriptclass, then removes it (and any other code with it) + * When this loop reaches the end, it wraps to SIZE_MAX; SIZE_MAX + 1 is 0 */ + size_t i; + for (i = script.customscripts.size() - 1; i + 1 > 0; --i) + { + if (script.customscripts[i].name == t) + { + script.customscripts.erase(script.customscripts.begin() + i); + } + } +} + +void editorclass::removehook(std::string t) +{ + //Check the hooklist for the hook t. If it's there, remove it from here and the script + size_t i; + removehookfromscript(t); + /* When this loop reaches the end, it wraps to SIZE_MAX; SIZE_MAX + 1 is 0 */ + for (i = hooklist.size() - 1; i + 1 > 0; --i) + { + if (hooklist[i] == t) + { + hooklist.erase(hooklist.begin() + i); + } + } +} + +void editorclass::addhook(std::string t) +{ + //Add an empty function to the list in both editor and script + removehook(t); + hooklist.push_back(t); + addhooktoscript(t); +} + +bool editorclass::checkhook(std::string t) +{ + //returns true if hook t already is in the list + for(size_t i=0; i1) + { + sb.erase(sb.begin() + t); + } +} + +void editorclass::insertline(int t) +{ + //insert a blank line into script at line t + sb.insert(sb.begin() + t, ""); +} + +void editorclass::getlin(const enum textmode mode, const std::string& prompt, std::string* ptr) +{ + textmod = mode; + textptr = ptr; + textdesc = prompt; + key.enabletextentry(); + if (ptr) + { + key.keybuffer = *ptr; + } + else + { + key.keybuffer = ""; + textptr = &(key.keybuffer); + } + + oldenttext = key.keybuffer; +} + +const int* editorclass::loadlevel( int rxi, int ryi ) +{ + //Set up our buffer array to be picked up by mapclass + rxi -= 100; + ryi -= 100; + if(rxi<0)rxi+=mapwidth; + if(ryi<0)ryi+=mapheight; + if(rxi>=mapwidth)rxi-=mapwidth; + if(ryi>=mapheight)ryi-=mapheight; + + static int result[1200]; + + for (int j = 0; j < 30; j++) + { + for (int i = 0; i < 40; i++) + { + result[i + j*40] = gettile(rxi, ryi, i, j); + } + } + + return result; +} + +int editorclass::getlevelcol(const int tileset, const int tilecol) +{ + if(tileset==0) //Space Station + { + return tilecol; + } + else if(tileset==1) //Outside + { + return 32+tilecol; + } + else if(tileset==2) //Lab + { + return 40+tilecol; + } + else if(tileset==3) //Warp Zone + { + return 46+tilecol; + } + else if(tileset==4) //Ship + { + return 52+tilecol; + } + return 0; +} + +int editorclass::getenemycol(int t) +{ + switch(t) + { + //RED + case 3: + case 7: + case 12: + case 23: + case 28: + case 34: + case 42: + case 48: + case 58: + return 6; + break; + //GREEN + case 5: + case 9: + case 22: + case 25: + case 29: + case 31: + case 38: + case 46: + case 52: + case 53: + return 7; + break; + //BLUE + case 1: + case 6: + case 14: + case 27: + case 33: + case 44: + case 50: + case 57: + return 12; + break; + //YELLOW + case 4: + case 17: + case 24: + case 30: + case 37: + case 45: + case 51: + case 55: + return 9; + break; + //PURPLE + case 2: + case 11: + case 15: + case 19: + case 32: + case 36: + case 49: + return 20; + break; + //CYAN + case 8: + case 10: + case 13: + case 18: + case 26: + case 35: + case 41: + case 47: + case 54: + return 11; + break; + //PINK + case 16: + case 20: + case 39: + case 43: + case 56: + return 8; + break; + //ORANGE + case 21: + case 40: + return 17; + break; + default: + return 6; + break; + } +} + +int editorclass::getwarpbackground(int rx, int ry) +{ + const edlevelclass* const room = getroomprop(rx, ry); + switch(room->tileset) + { + case 0: //Space Station + switch(room->tilecol) + { + case 0: + return 3; + break; + case 1: + return 2; + break; + case 2: + return 1; + break; + case 3: + return 4; + break; + case 4: + return 5; + break; + case 5: + return 3; + break; + case 6: + return 1; + break; + case 7: + return 0; + break; + case 8: + return 5; + break; + case 9: + return 0; + break; + case 10: + return 2; + break; + case 11: + return 1; + break; + case 12: + return 5; + break; + case 13: + return 0; + break; + case 14: + return 3; + break; + case 15: + return 2; + break; + case 16: + return 4; + break; + case 17: + return 0; + break; + case 18: + return 3; + break; + case 19: + return 1; + break; + case 20: + return 4; + break; + case 21: + return 5; + break; + case 22: + return 1; + break; + case 23: + return 4; + break; + case 24: + return 5; + break; + case 25: + return 0; + break; + case 26: + return 3; + break; + case 27: + return 1; + break; + case 28: + return 5; + break; + case 29: + return 4; + break; + case 30: + return 5; + break; + case 31: + return 2; + break; + default: + return 6; + break; + } + break; + case 1: //Outside + switch(room->tilecol) + { + case 0: + return 3; + break; + case 1: + return 1; + break; + case 2: + return 0; + break; + case 3: + return 2; + break; + case 4: + return 4; + break; + case 5: + return 5; + break; + case 6: + return 2; + break; + case 7: + return 4; + break; + default: + return 6; + break; + } + break; + case 2: //Lab + switch(room->tilecol) + { + case 0: + return 0; + break; + case 1: + return 1; + break; + case 2: + return 2; + break; + case 3: + return 3; + break; + case 4: + return 4; + break; + case 5: + return 5; + break; + case 6: + return 6; + break; + default: + return 6; + break; + } + break; + case 3: //Warp Zone + switch(room->tilecol) + { + case 0: + return 0; + break; + case 1: + return 1; + break; + case 2: + return 2; + break; + case 3: + return 3; + break; + case 4: + return 4; + break; + case 5: + return 5; + break; + case 6: + return 6; + break; + default: + return 6; + break; + } + break; + case 4: //Ship + switch(room->tilecol) + { + case 0: + return 5; + break; + case 1: + return 0; + break; + case 2: + return 4; + break; + case 3: + return 2; + break; + case 4: + return 3; + break; + case 5: + return 1; + break; + case 6: + return 6; + break; + default: + return 6; + break; + } + break; + case 5: //Tower + return 6; + break; + default: + return 6; + break; + } +} + +int editorclass::getenemyframe(int t) +{ + switch(t) + { + case 0: + return 78; + break; + case 1: + return 88; + break; + case 2: + return 36; + break; + case 3: + return 164; + break; + case 4: + return 68; + break; + case 5: + return 48; + break; + case 6: + return 176; + break; + case 7: + return 168; + break; + case 8: + return 112; + break; + case 9: + return 114; + break; + default: + return 78; + break; + } +} + +int editorclass::gettileidx( + const int rx, + const int ry, + const int x, + const int y +) { + const int yoff = y + ry*30; + int mult; + int idx; + + if (INBOUNDS_ARR(yoff, vmult)) + { + mult = vmult[yoff]; + } + else + { + mult = 0; + } + + idx = x + rx*40 + mult; + + return idx; +} + +void editorclass::settile( + const int rx, + const int ry, + const int x, + const int y, + const int t +) { + const int idx = gettileidx(rx, ry, x, y); + + if (!INBOUNDS_ARR(idx, contents)) + { + return; + } + + contents[idx] = t; +} + +int editorclass::gettile( + const int rx, + const int ry, + const int x, + const int y +) { + const int idx = gettileidx(rx, ry, x, y); + + if (!INBOUNDS_ARR(idx, contents)) + { + return 0; + } + + return contents[idx]; +} + +int editorclass::getabstile(const int x, const int y) +{ + int idx; + int yoff; + + if (INBOUNDS_ARR(y, vmult)) + { + yoff = vmult[y]; + } + else + { + yoff = 0; + } + + idx = x + yoff; + + if (!INBOUNDS_ARR(idx, contents)) + { + return 0; + } + + return contents[idx]; +} + + +int editorclass::getroompropidx(const int rx, const int ry) +{ + return rx + ry*maxwidth; +} + +const edlevelclass* editorclass::getroomprop(const int rx, const int ry) +{ + const int idx = getroompropidx(rx, ry); + + if (INBOUNDS_ARR(idx, level)) + { + return &level[idx]; + } + + static edlevelclass blank; + blank.tileset = 1; + blank.directmode = 1; + blank.roomname.clear(); + + return ␣ +} + +#define FOREACH_PROP(NAME, TYPE) \ +void editorclass::setroom##NAME(const int rx, const int ry, const TYPE NAME) \ +{ \ + const int idx = getroompropidx(rx, ry); \ + \ + if (!INBOUNDS_ARR(idx, level)) \ + { \ + return; \ + } \ + \ + level[idx].NAME = NAME; \ +} + +ROOM_PROPERTIES + +#undef FOREACH_PROP + + +void editorclass::placetilelocal( int x, int y, int t ) +{ + if(x>=0 && y>=0 && x<40 && y<30) + { + settile(levx, levy, x, y, t); + } + updatetiles=true; +} + +int editorclass::base( int x, int y ) +{ + //Return the base tile for the given tileset and colour + const edlevelclass* const room = getroomprop(x, y); + if(room->tileset==0) //Space Station + { + if(room->tilecol>=22) + { + return 483 + ((room->tilecol-22)*3); + } + else if(room->tilecol>=11) + { + return 283 + ((room->tilecol-11)*3); + } + else + { + return 83 + (room->tilecol*3); + } + } + else if(room->tileset==1) //Outside + { + return 480 + (room->tilecol*3); + } + else if(room->tileset==2) //Lab + { + return 280 + (room->tilecol*3); + } + else if(room->tileset==3) //Warp Zone/Intermission + { + return 80 + (room->tilecol*3); + } + else if(room->tileset==4) //SHIP + { + return 101 + (room->tilecol*3); + } + return 0; +} + +int editorclass::backbase( int x, int y ) +{ + //Return the base tile for the background of the given tileset and colour + const edlevelclass* const room = getroomprop(x, y); + if(room->tileset==0) //Space Station + { + //Pick depending on tilecol + switch(room->tilecol) + { + case 0: + case 5: + case 26: + return 680; //Blue + break; + case 3: + case 16: + case 23: + return 683; //Yellow + break; + case 9: + case 12: + case 21: + return 686; //Greeny Cyan + break; + case 4: + case 8: + case 24: + case 28: + case 30: + return 689; //Green + break; + case 20: + case 29: + return 692; //Orange + break; + case 2: + case 6: + case 11: + case 22: + case 27: + return 695; //Red + break; + case 1: + case 10: + case 15: + case 19: + case 31: + return 698; //Pink + break; + case 14: + case 18: + return 701; //Dark Blue + break; + case 7: + case 13: + case 17: + case 25: + return 704; //Cyan + break; + default: + return 680; + break; + } + + } + else if(room->tileset==1) //outside + { + return 680 + (room->tilecol*3); + } + else if(room->tileset==2) //Lab + { + return 0; + } + else if(room->tileset==3) //Warp Zone/Intermission + { + return 120 + (room->tilecol*3); + } + else if(room->tileset==4) //SHIP + { + return 741 + (room->tilecol*3); + } + return 0; +} + +int editorclass::at( int x, int y ) +{ + if(x<0) return at(0,y); + if(y<0) return at(x,0); + if(x>=40) return at(39,y); + if(y>=30) return at(x,29); + + if(x>=0 && y>=0 && x<40 && y<30) + { + return gettile(levx, levy, x, y); + } + return 0; +} + + +int editorclass::freewrap( int x, int y ) +{ + if(x<0) return freewrap(x+(mapwidth*40),y); + if(y<0) return freewrap(x,y+(mapheight*30)); + if(x>=(mapwidth*40)) return freewrap(x-(mapwidth*40),y); + if(y>=(mapheight*30)) return freewrap(x,y-(mapheight*30)); + + if(x>=0 && y>=0 && x<(mapwidth*40) && y<(mapheight*30)) + { + if(getabstile(x, y)==0) + { + return 0; + } + else + { + if(getabstile(x, y)>=2 && getabstile(x, y)<80) + { + return 0; + } + if(getabstile(x, y)>=680) + { + return 0; + } + } + } + return 1; +} + +int editorclass::backonlyfree( int x, int y ) +{ + //Returns 1 if tile is a background tile, 0 otherwise + if(x<0) return backonlyfree(0,y); + if(y<0) return backonlyfree(x,0); + if(x>=40) return backonlyfree(39,y); + if(y>=30) return backonlyfree(x,29); + + if(x>=0 && y>=0 && x<40 && y<30) + { + if(gettile(levx, levy, x, y)>=680) + { + return 1; + } + } + return 0; +} + +int editorclass::backfree( int x, int y ) +{ + //Returns 0 if tile is not a block or background tile, 1 otherwise + if(x<0) return backfree(0,y); + if(y<0) return backfree(x,0); + if(x>=40) return backfree(39,y); + if(y>=30) return backfree(x,29); + + if(x>=0 && y>=0 && x<40 && y<30) + { + if(gettile(levx, levy, x, y)==0) + { + return 0; + } + } + return 1; +} + +int editorclass::spikefree( int x, int y ) +{ + //Returns 0 if tile is not a block or spike, 1 otherwise + if(x==-1) return free(0,y); + if(y==-1) return free(x,0); + if(x==40) return free(39,y); + if(y==30) return free(x,29); + + if(x>=0 && y>=0 && x<40 && y<30) + { + if(gettile(levx, levy, x, y)==0) + { + return 0; + } + else + { + if(gettile(levx, levy, x, y)>=680) + { + return 0; + } + } + } + return 1; +} + +int editorclass::free( int x, int y ) +{ + //Returns 0 if tile is not a block, 1 otherwise + if(x==-1) return free(0,y); + if(y==-1) return free(x,0); + if(x==40) return free(39,y); + if(y==30) return free(x,29); + + if(x>=0 && y>=0 && x<40 && y<30) + { + if(gettile(levx, levy, x, y)==0) + { + return 0; + } + else + { + if(gettile(levx, levy, x, y)>=2 && gettile(levx, levy, x, y)<80) + { + return 0; + } + if(gettile(levx, levy, x, y)>=680) + { + return 0; + } + } + } + return 1; +} + +int editorclass::absfree( int x, int y ) +{ + //Returns 0 if tile is not a block, 1 otherwise, abs on grid + if(x>=0 && y>=0 && x=2 && getabstile(x, y)<80) + { + return 0; + } + if(getabstile(x, y)>=680) + { + return 0; + } + } + } + return 1; +} + +int editorclass::match( int x, int y ) +{ + if(free(x-1,y)==0 && free(x,y-1)==0 && free(x+1,y)==0 && free(x,y+1)==0) return 0; + + if(free(x-1,y)==0 && free(x,y-1)==0) return 10; + if(free(x+1,y)==0 && free(x,y-1)==0) return 11; + if(free(x-1,y)==0 && free(x,y+1)==0) return 12; + if(free(x+1,y)==0 && free(x,y+1)==0) return 13; + + if(free(x,y-1)==0) return 1; + if(free(x-1,y)==0) return 2; + if(free(x,y+1)==0) return 3; + if(free(x+1,y)==0) return 4; + if(free(x-1,y-1)==0) return 5; + if(free(x+1,y-1)==0) return 6; + if(free(x-1,y+1)==0) return 7; + if(free(x+1,y+1)==0) return 8; + + return 0; +} + +int editorclass::outsidematch( int x, int y ) +{ + + if(backonlyfree(x-1,y)==0 && backonlyfree(x+1,y)==0) return 2; + if(backonlyfree(x,y-1)==0 && backonlyfree(x,y+1)==0) return 1; + + return 0; +} + +int editorclass::backmatch( int x, int y ) +{ + //Returns the first position match for a border + // 5 1 6 + // 2 X 4 + // 7 3 8 + if(backfree(x-1,y)==0 && backfree(x,y-1)==0 && backfree(x+1,y)==0 && backfree(x,y+1)==0) return 0; + + if(backfree(x-1,y)==0 && backfree(x,y-1)==0) return 10; + if(backfree(x+1,y)==0 && backfree(x,y-1)==0) return 11; + if(backfree(x-1,y)==0 && backfree(x,y+1)==0) return 12; + if(backfree(x+1,y)==0 && backfree(x,y+1)==0) return 13; + + if(backfree(x,y-1)==0) return 1; + if(backfree(x-1,y)==0) return 2; + if(backfree(x,y+1)==0) return 3; + if(backfree(x+1,y)==0) return 4; + if(backfree(x-1,y-1)==0) return 5; + if(backfree(x+1,y-1)==0) return 6; + if(backfree(x-1,y+1)==0) return 7; + if(backfree(x+1,y+1)==0) return 8; + + return 0; +} + +int editorclass::edgetile( int x, int y ) +{ + switch(match(x,y)) + { + case 14: + return 0; + break; + case 10: + return 80; + break; + case 11: + return 82; + break; + case 12: + return 160; + break; + case 13: + return 162; + break; + case 1: + return 81; + break; + case 2: + return 120; + break; + case 3: + return 161; + break; + case 4: + return 122; + break; + case 5: + return 42; + break; + case 6: + return 41; + break; + case 7: + return 2; + break; + case 8: + return 1; + break; + case 0: + default: + return 0; + break; + } +} + +int editorclass::outsideedgetile( int x, int y ) +{ + switch(outsidematch(x,y)) + { + case 2: + return 0; + break; + case 1: + return 1; + break; + case 0: + default: + return 2; + break; + } +} + + +int editorclass::backedgetile( int x, int y ) +{ + switch(backmatch(x,y)) + { + case 14: + return 0; + break; + case 10: + return 80; + break; + case 11: + return 82; + break; + case 12: + return 160; + break; + case 13: + return 162; + break; + case 1: + return 81; + break; + case 2: + return 120; + break; + case 3: + return 161; + break; + case 4: + return 122; + break; + case 5: + return 42; + break; + case 6: + return 41; + break; + case 7: + return 2; + break; + case 8: + return 1; + break; + case 0: + default: + return 0; + break; + } +} + +int editorclass::labspikedir( int x, int y, int t ) +{ + // a slightly more tricky case + if(free(x,y+1)==1) return 63 + (t*2); + if(free(x,y-1)==1) return 64 + (t*2); + if(free(x-1,y)==1) return 51 + (t*2); + if(free(x+1,y)==1) return 52 + (t*2); + return 63 + (t*2); +} + +int editorclass::spikedir( int x, int y ) +{ + if(free(x,y+1)==1) return 8; + if(free(x,y-1)==1) return 9; + if(free(x-1,y)==1) return 49; + if(free(x+1,y)==1) return 50; + return 8; +} + +void editorclass::findstartpoint(void) +{ + //Ok! Scan the room for the closest checkpoint + int testeditor=-1; + //First up; is there a start point on this screen? + for(size_t i=0; itileset; + + if (reversed) + { + tiles--; + } + else + { + tiles++; + } + + const int modulus = SDL_arraysize(tilesets); + tiles = (tiles % modulus + modulus) % modulus; + setroomtileset(levx, levy, tiles); + + clamp_tilecol(levx, levy, false); + + char buffer[64]; + SDL_snprintf(buffer, sizeof(buffer), "Now using %s Tileset", tilesets[tiles]); + + note = buffer; + notedelay = 45; + updatetiles = true; +} + +void editorclass::switch_tilecol(const bool reversed) +{ + int tilecol = getroomprop(levx, levy)->tilecol; + + if (reversed) + { + tilecol--; + } + else + { + tilecol++; + } + + setroomtilecol(levx, levy, tilecol); + + clamp_tilecol(levx, levy, true); + + notedelay = 45; + note = "Tileset Colour Changed"; + updatetiles = true; +} + +void editorclass::clamp_tilecol(const int rx, const int ry, const bool wrap) +{ + const edlevelclass* const room = getroomprop(rx, ry); + const int tileset = room->tileset; + int tilecol = room->tilecol; + + int mincol = -1; + int maxcol = 5; + + // Only Space Station allows tileset -1 + if (tileset != 0) + { + mincol = 0; + } + + switch (tileset) + { + case 0: + maxcol = 31; + break; + case 1: + maxcol = 7; + break; + case 2: + if (room->directmode) + { + maxcol = 6; + } + break; + case 3: + maxcol = 6; + break; + case 5: + maxcol = 29; + break; + } + + // If wrap is true, wrap-around, otherwise just cap + if (tilecol > maxcol) + { + tilecol = (wrap ? mincol : maxcol); + } + if (tilecol < mincol) + { + tilecol = (wrap ? maxcol : mincol); + } + + setroomtilecol(rx, ry, tilecol); +} + +void editorclass::switch_enemy(const bool reversed) +{ + const edlevelclass* const room = getroomprop(levx, levy); + + int enemy = room->enemytype; + + if (reversed) + { + enemy--; + } + else + { + enemy++; + } + + const int modulus = 10; + enemy = (enemy % modulus + modulus) % modulus; + setroomenemytype(levx, levy, enemy); + + note = "Enemy Type Changed"; + notedelay = 45; +} + +void editorclass::switch_warpdir(const bool reversed) +{ + static const int modulus = 4; + const edlevelclass* const room = getroomprop(levx, levy); + + int warpdir = room->warpdir; + + if (reversed) + { + --warpdir; + } + else + { + ++warpdir; + } + + warpdir = (warpdir % modulus + modulus) % modulus; + setroomwarpdir(levx, levy, warpdir); + + switch (warpdir) + { + default: + note = "Room warping disabled"; + break; + case 1: + note = "Room warps horizontally"; + break; + case 2: + note = "Room warps vertically"; + break; + case 3: + note = "Room warps in all directions"; + break; + } + + notedelay = 45; +} + +bool editorclass::load(std::string& _path) +{ + tinyxml2::XMLDocument doc; + tinyxml2::XMLHandle hDoc(&doc); + tinyxml2::XMLElement* pElem; + tinyxml2::XMLHandle hRoot(NULL); + + reset(); + + static const char *levelDir = "levels/"; + if (_path.compare(0, SDL_strlen(levelDir), levelDir) != 0) + { + _path = levelDir + _path; + } + + FILESYSTEM_unmountAssets(); + if (game.cliplaytest && game.playassets != "") + { + MAYBE_FAIL(FILESYSTEM_mountAssets(game.playassets.c_str())); + } + else + { + MAYBE_FAIL(FILESYSTEM_mountAssets(_path.c_str())); + } + + if (!FILESYSTEM_loadTiXml2Document(_path.c_str(), doc)) + { + printf("No level %s to load :(\n", _path.c_str()); + return false; + } + + loaded_filepath = _path; + + version = 0; + + { + pElem=hDoc.FirstChildElement().ToElement(); + // should always have a valid root but handle gracefully if it does + if (!pElem) + { + printf("No valid root! Corrupt level file?\n"); + } + + pElem->QueryIntAttribute("version", &version); + // save this for later + hRoot=tinyxml2::XMLHandle(pElem); + } + + for( pElem = hRoot.FirstChildElement( "Data" ).FirstChild().ToElement(); pElem; pElem=pElem->NextSiblingElement()) + { + const char* pKey = pElem->Value(); + const char* pText = pElem->GetText() ; + if(pText == NULL) + { + pText = ""; + } + + if (SDL_strcmp(pKey, "MetaData") == 0) + { + + for( tinyxml2::XMLElement* subElem = pElem->FirstChildElement(); subElem; subElem= subElem->NextSiblingElement()) + { + const char* pKey_ = subElem->Value(); + const char* pText_ = subElem->GetText() ; + if(pText_ == NULL) + { + pText_ = ""; + } + + if(SDL_strcmp(pKey_, "Creator") == 0) + { + EditorData::GetInstance().creator = pText_; + } + + if(SDL_strcmp(pKey_, "Title") == 0) + { + EditorData::GetInstance().title = pText_; + } + + if(SDL_strcmp(pKey_, "Desc1") == 0) + { + Desc1 = pText_; + } + + if(SDL_strcmp(pKey_, "Desc2") == 0) + { + Desc2 = pText_; + } + + if(SDL_strcmp(pKey_, "Desc3") == 0) + { + Desc3 = pText_; + } + + if(SDL_strcmp(pKey_, "website") == 0) + { + website = pText_; + } + + if(SDL_strcmp(pKey_, "onewaycol_override") == 0) + { + onewaycol_override = help.Int(pText_); + } + } + } + + if (SDL_strcmp(pKey, "mapwidth") == 0) + { + mapwidth = help.Int(pText); + } + if (SDL_strcmp(pKey, "mapheight") == 0) + { + mapheight = help.Int(pText); + } + if (SDL_strcmp(pKey, "levmusic") == 0) + { + levmusic = help.Int(pText); + } + + + if (SDL_strcmp(pKey, "contents") == 0 && pText[0] != '\0') + { + int x = 0; + int y = 0; + + char buffer[16]; + size_t start = 0; + + while (next_split_s(buffer, sizeof(buffer), &start, pText, ',')) + { + const int idx = x + maxwidth*40*y; + + if (INBOUNDS_ARR(idx, contents)) + { + contents[idx] = help.Int(buffer); + } + + ++x; + + if (x == mapwidth*40) + { + x = 0; + ++y; + } + } + } + + + if (SDL_strcmp(pKey, "edEntities") == 0) + { + for( tinyxml2::XMLElement* edEntityEl = pElem->FirstChildElement(); edEntityEl; edEntityEl=edEntityEl->NextSiblingElement()) + { + edentities entity = edentities(); + const char* text = edEntityEl->GetText(); + + if (text != NULL) + { + size_t len = SDL_strlen(text); + + // And now we come to the part where we have to deal with + // the terrible decisions of the past. + // + // For some reason, the closing tag of edentities generated + // by 2.2 and below has not only been put on a separate + // line, but also indented to match with the opening tag as + // well. Like this: + // + // contents + // + // + // Instead of doing contents. + // + // This is COMPLETELY terrible. This requires the XML to be + // parsed in an extremely specific and quirky way, which + // TinyXML-1 just happened to do. + // + // TinyXML-2 by default interprets the newline and the next + // indentation of whitespace literally, so you end up with + // tag contents that has a linefeed plus a bunch of extra + // spaces. You can't fix this by setting the whitespace + // mode to COLLAPSE_WHITESPACE, that does way more than + // TinyXML-1 ever did - it removes the leading whitespace + // from things like this, and + // collapses XML-encoded whitespace like + // this, which TinyXML-1 never did. + // + // Best solution here is to specifically hardcode removing + // the linefeed + the extremely specific amount of + // whitespace at the end of the contents. + + if (endsWith(text, "\n ")) // linefeed + exactly 12 spaces + { + // 12 spaces + 1 linefeed = 13 chars + len -= 13; + } + + entity.scriptname = std::string(text, len); + } + edEntityEl->QueryIntAttribute("x", &entity.x); + edEntityEl->QueryIntAttribute("y", &entity.y); + edEntityEl->QueryIntAttribute("t", &entity.t); + + edEntityEl->QueryIntAttribute("p1", &entity.p1); + edEntityEl->QueryIntAttribute("p2", &entity.p2); + edEntityEl->QueryIntAttribute("p3", &entity.p3); + edEntityEl->QueryIntAttribute("p4", &entity.p4); + edEntityEl->QueryIntAttribute("p5", &entity.p5); + edEntityEl->QueryIntAttribute("p6", &entity.p6); + + edentity.push_back(entity); + } + } + + if (SDL_strcmp(pKey, "levelMetaData") == 0) + { + int i = 0; + for( tinyxml2::XMLElement* edLevelClassElement = pElem->FirstChildElement(); edLevelClassElement; edLevelClassElement=edLevelClassElement->NextSiblingElement()) + { + if (!INBOUNDS_ARR(i, level)) + { + continue; + } + + if(edLevelClassElement->GetText() != NULL) + { + level[i].roomname = std::string(edLevelClassElement->GetText()) ; + } + + edLevelClassElement->QueryIntAttribute("tileset", &level[i].tileset); + edLevelClassElement->QueryIntAttribute("tilecol", &level[i].tilecol); + edLevelClassElement->QueryIntAttribute("platx1", &level[i].platx1); + edLevelClassElement->QueryIntAttribute("platy1", &level[i].platy1); + edLevelClassElement->QueryIntAttribute("platx2", &level[i].platx2); + edLevelClassElement->QueryIntAttribute("platy2", &level[i].platy2); + edLevelClassElement->QueryIntAttribute("platv", &level[i].platv); + edLevelClassElement->QueryIntAttribute("enemyx1", &level[i].enemyx1); + edLevelClassElement->QueryIntAttribute("enemyy1", &level[i].enemyy1); + edLevelClassElement->QueryIntAttribute("enemyx2", &level[i].enemyx2); + edLevelClassElement->QueryIntAttribute("enemyy2", &level[i].enemyy2); + edLevelClassElement->QueryIntAttribute("enemytype", &level[i].enemytype); + edLevelClassElement->QueryIntAttribute("directmode", &level[i].directmode); + + edLevelClassElement->QueryIntAttribute("warpdir", &level[i].warpdir); + + i++; + + } + } + + if (SDL_strcmp(pKey, "script") == 0 && pText[0] != '\0') + { + Script script_; + bool headerfound = false; + + size_t start = 0; + size_t len = 0; + size_t prev_start = 0; + + while (next_split(&start, &len, &pText[start], '|')) + { + if (len > 0 && pText[prev_start + len - 1] == ':') + { + if (headerfound) + { + script.customscripts.push_back(script_); + } + + script_.name = std::string(&pText[prev_start], len - 1); + script_.contents.clear(); + headerfound = true; + + goto next; + } + + if (headerfound) + { + script_.contents.push_back(std::string(&pText[prev_start], len)); + } + +next: + prev_start = start; + } + + /* Add the last script */ + if (headerfound) + { + script.customscripts.push_back(script_); + } + } + } + + if (mapwidth < maxwidth) + { + /* Unscramble platv, since it was stored incorrectly + * in 2.2 and previous... */ + size_t i; + int x = 0; + int y = 0; + int temp_platv[numrooms]; + + for (i = 0; i < numrooms; ++i) + { + temp_platv[i] = level[i].platv; + } + + for (i = 0; i < numrooms; ++i) + { + if (x < mapwidth) + { + const int platv_idx = x + y * mapwidth; + if (INBOUNDS_ARR(platv_idx, temp_platv)) + { + level[i].platv = temp_platv[platv_idx]; + } + } + else + { + level[i].platv = 4; /* default */ + } + + ++x; + + if (x >= maxwidth) + { + x = 0; + ++y; + } + } + } + + gethooks(); + version=2; + + return true; + +fail: + return false; +} + +bool editorclass::save(std::string& _path) +{ + tinyxml2::XMLDocument doc; + + std::string newpath("levels/" + _path); + + // Try to preserve the XML of the currently-loaded one + bool already_exists = !loaded_filepath.empty() && FILESYSTEM_loadTiXml2Document(loaded_filepath.c_str(), doc); + if (!already_exists && !loaded_filepath.empty()) + { + printf("Currently-loaded %s not found\n", loaded_filepath.c_str()); + } + + loaded_filepath = newpath; + + tinyxml2::XMLElement* msg; + + xml::update_declaration(doc); + + tinyxml2::XMLElement * root = xml::update_element(doc, "MapData"); + root->SetAttribute("version",version); + + xml::update_comment(root, " Save file "); + + tinyxml2::XMLElement * data = xml::update_element(root, "Data"); + + msg = xml::update_element(data, "MetaData"); + + //getUser + xml::update_tag(msg, "Creator", EditorData::GetInstance().creator.c_str()); + + xml::update_tag(msg, "Title", EditorData::GetInstance().title.c_str()); + + xml::update_tag(msg, "Created", version); + + xml::update_tag(msg, "Modified", EditorData::GetInstance().modifier.c_str()); + + xml::update_tag(msg, "Modifiers", version); + + xml::update_tag(msg, "Desc1", Desc1.c_str()); + + xml::update_tag(msg, "Desc2", Desc2.c_str()); + + xml::update_tag(msg, "Desc3", Desc3.c_str()); + + xml::update_tag(msg, "website", website.c_str()); + + if (onewaycol_override) + { + xml::update_tag(msg, "onewaycol_override", onewaycol_override); + } + else + { + // Delete the element. I could just delete one, but just to be sure, + // I will delete all of them if there are more than one + tinyxml2::XMLElement* element; + while ((element = msg->FirstChildElement("onewaycol_override")) + != NULL) + { + doc.DeleteNode(element); + } + } + + xml::update_tag(data, "mapwidth", mapwidth); + + xml::update_tag(data, "mapheight", mapheight); + + xml::update_tag(data, "levmusic", levmusic); + + //New save format + std::string contentsString=""; + for(int y = 0; y < mapheight*30; y++ ) + { + for(int x = 0; x < mapwidth*40; x++ ) + { + contentsString += help.String(getabstile(x, y)) + ","; + } + } + xml::update_tag(data, "contents", contentsString.c_str()); + + + msg = xml::update_element_delete_contents(data, "edEntities"); + for(size_t i = 0; i < edentity.size(); i++) + { + tinyxml2::XMLElement *edentityElement = doc.NewElement( "edentity" ); + edentityElement->SetAttribute( "x", edentity[i].x); + edentityElement->SetAttribute( "y", edentity[i].y); + edentityElement->SetAttribute( "t", edentity[i].t); + edentityElement->SetAttribute( "p1", edentity[i].p1); + edentityElement->SetAttribute( "p2", edentity[i].p2); + edentityElement->SetAttribute( "p3", edentity[i].p3); + edentityElement->SetAttribute( "p4", edentity[i].p4); + edentityElement->SetAttribute( "p5", edentity[i].p5); + edentityElement->SetAttribute( "p6", edentity[i].p6); + edentityElement->LinkEndChild( doc.NewText( edentity[i].scriptname.c_str() )) ; + msg->LinkEndChild( edentityElement ); + } + + msg = xml::update_element_delete_contents(data, "levelMetaData"); + + int temp_platv[numrooms]; + SDL_memset(temp_platv, 4 /* default */, sizeof(temp_platv)); + + if (mapwidth < maxwidth) + { + /* Re-scramble platv, since it was stored incorrectly + * in 2.2 and previous... */ + size_t i; + int x = 0; + int y = 0; + for (i = 0; i < numrooms; ++i) + { + if (x < mapwidth) + { + const int platv_idx = x + y * mapwidth; + if (INBOUNDS_ARR(platv_idx, temp_platv)) + { + temp_platv[platv_idx] = level[i].platv; + } + } + + ++x; + + if (x >= mapwidth) + { + /* Skip to next actual row. */ + i += maxwidth - mapwidth; + x = 0; + ++y; + } + } + } + + for(size_t i = 0; i < SDL_arraysize(level); i++) + { + tinyxml2::XMLElement *edlevelclassElement = doc.NewElement( "edLevelClass" ); + edlevelclassElement->SetAttribute( "tileset", level[i].tileset); + edlevelclassElement->SetAttribute( "tilecol", level[i].tilecol); + edlevelclassElement->SetAttribute( "platx1", level[i].platx1); + edlevelclassElement->SetAttribute( "platy1", level[i].platy1); + edlevelclassElement->SetAttribute( "platx2", level[i].platx2); + edlevelclassElement->SetAttribute( "platy2", level[i].platy2); + edlevelclassElement->SetAttribute( "platv", temp_platv[i]); + edlevelclassElement->SetAttribute( "enemyx1", level[i].enemyx1); + edlevelclassElement->SetAttribute( "enemyy1", level[i].enemyy1); + edlevelclassElement->SetAttribute( "enemyx2", level[i].enemyx2); + edlevelclassElement->SetAttribute( "enemyy2", level[i].enemyy2); + edlevelclassElement->SetAttribute( "enemytype", level[i].enemytype); + edlevelclassElement->SetAttribute( "directmode", level[i].directmode); + edlevelclassElement->SetAttribute( "warpdir", level[i].warpdir); + + edlevelclassElement->LinkEndChild( doc.NewText( level[i].roomname.c_str() )) ; + msg->LinkEndChild( edlevelclassElement ); + } + + std::string scriptString; + for(size_t i = 0; i < script.customscripts.size(); i++) + { + Script& script_ = script.customscripts[i]; + + scriptString += script_.name + ":|"; + for (size_t ii = 0; ii < script_.contents.size(); ++ii) + { + scriptString += script_.contents[ii]; + + // Inserts a space if the line ends with a : + if (script_.contents[ii].length() && *script_.contents[ii].rbegin() == ':') + { + scriptString += " "; + } + + scriptString += "|"; + } + } + xml::update_tag(data, "script", scriptString.c_str()); + + return FILESYSTEM_saveTiXml2Document(newpath.c_str(), doc); +} + + +static void addedentity( int xp, int yp, int tp, int p1 = 0, int p2 = 0, int p3 = 0, int p4 = 0, int p5 = 320, int p6 = 240) +{ + edentities entity; + + entity.x=xp; + entity.y=yp; + entity.t=tp; + entity.p1=p1; + entity.p2=p2; + entity.p3=p3; + entity.p4=p4; + entity.p5=p5; + entity.p6=p6; + entity.scriptname=""; + + edentity.push_back(entity); +} + +static void removeedentity( int t ) +{ + edentity.erase(edentity.begin() + t); +} + +static int edentat( int xp, int yp ) +{ + for(size_t i=0; itileset==1) tm=96; + + for(int j=0; j<36; j++) + { + for(int i=0; i<48; i++) + { + temp=absfree(int(i*0.83) + (i2*40),int(j*0.83)+(j2*30)); + if(temp>=1) + { + //Fill in this pixel + FillRect(graphics.images[12], (i2*48)+i, (j2*36)+j, 1, 1, graphics.getRGB(tm, tm, tm)); + } + } + } + } + } + } + else if(mapheight<=10 && mapwidth<=10) + { + //2x map + for(int j2=0; j2tileset==1) tm=96; + + for(int j=0; j<18; j++) + { + for(int i=0; i<24; i++) + { + temp=absfree(int(i*1.6) + (i2*40),int(j*1.6)+(j2*30)); + if(temp>=1) + { + //Fill in this pixel + FillRect(graphics.images[12], (i2*24)+i, (j2*18)+j, 1, 1, graphics.getRGB(tm, tm, tm)); + } + } + } + } + } + } + else + { + for(int j2=0; j2tileset==1) tm=96; + + for(int j=0; j<9; j++) + { + for(int i=0; i<12; i++) + { + temp=absfree(3+(i*3) + (i2*40),(j*3)+(j2*30)); + if(temp>=1) + { + //Fill in this pixel + FillRect(graphics.images[12], (i2*12)+i, (j2*9)+j, 1, 1, graphics.getRGB(tm, tm, tm)); + } + } + } + } + } + } +} + +#if !defined(NO_EDITOR) +static void editormenurender(int tr, int tg, int tb) +{ + extern editorclass ed; + switch (game.currentmenuname) + { + case Menu::ed_settings: + graphics.bigprint( -1, 75, "Map Settings", tr, tg, tb, true); + if (game.currentmenuoption == 3) + { + if (!game.ghostsenabled) + graphics.Print(2, 230, "Editor ghost trail is OFF", tr/2, tg/2, tb/2); + else + graphics.Print(2, 230, "Editor ghost trail is ON", tr, tg, tb); + } + break; + case Menu::ed_desc: + if(ed.titlemod) + { + if(ed.entframe<2) + { + graphics.bigprint( -1, 35, key.keybuffer+"_", tr, tg, tb, true); + } + else + { + graphics.bigprint( -1, 35, key.keybuffer+" ", tr, tg, tb, true); + } + } + else + { + graphics.bigprint( -1, 35, EditorData::GetInstance().title, tr, tg, tb, true); + } + if(ed.creatormod) + { + if(ed.entframe<2) + { + graphics.Print( -1, 60, "by " + key.keybuffer+ "_", tr, tg, tb, true); + } + else + { + graphics.Print( -1, 60, "by " + key.keybuffer+ " ", tr, tg, tb, true); + } + } + else + { + graphics.Print( -1, 60, "by " + EditorData::GetInstance().creator, tr, tg, tb, true); + } + if(ed.websitemod) + { + if(ed.entframe<2) + { + graphics.Print( -1, 70, key.keybuffer+"_", tr, tg, tb, true); + } + else + { + graphics.Print( -1, 70, key.keybuffer+" ", tr, tg, tb, true); + } + } + else + { + graphics.Print( -1, 70, ed.website, tr, tg, tb, true); + } + if(ed.desc1mod) + { + if(ed.entframe<2) + { + graphics.Print( -1, 90, key.keybuffer+"_", tr, tg, tb, true); + } + else + { + graphics.Print( -1, 90, key.keybuffer+" ", tr, tg, tb, true); + } + } + else + { + graphics.Print( -1, 90, ed.Desc1, tr, tg, tb, true); + } + if(ed.desc2mod) + { + if(ed.entframe<2) + { + graphics.Print( -1, 100, key.keybuffer+"_", tr, tg, tb, true); + } + else + { + graphics.Print( -1, 100, key.keybuffer+" ", tr, tg, tb, true); + } + } + else + { + graphics.Print( -1, 100, ed.Desc2, tr, tg, tb, true); + } + if(ed.desc3mod) + { + if(ed.entframe<2) + { + graphics.Print( -1, 110, key.keybuffer+"_", tr, tg, tb, true); + } + else + { + graphics.Print( -1, 110, key.keybuffer+" ", tr, tg, tb, true); + } + } + else + { + graphics.Print( -1, 110, ed.Desc3, tr, tg, tb, true); + } + break; + case Menu::ed_music: + { + graphics.bigprint( -1, 65, "Map Music", tr, tg, tb, true); + + graphics.Print( -1, 85, "Current map music:", tr, tg, tb, true); + std::string songname; + switch(ed.levmusic) + { + case 0: + songname = "No background music"; + break; + case 1: + songname = "1: Pushing Onwards"; + break; + case 2: + songname = "2: Positive Force"; + break; + case 3: + songname = "3: Potential for Anything"; + break; + case 4: + songname = "4: Passion for Exploring"; + break; + case 5: + songname = "N/A: Pause"; + break; + case 6: + songname = "5: Presenting VVVVVV"; + break; + case 7: + songname = "N/A: Plenary"; + break; + case 8: + songname = "6: Predestined Fate"; + break; + case 9: + songname = "N/A: ecroF evitisoP"; + break; + case 10: + songname = "7: Popular Potpourri"; + break; + case 11: + songname = "8: Pipe Dream"; + break; + case 12: + songname = "9: Pressure Cooker"; + break; + case 13: + songname = "10: Paced Energy"; + break; + case 14: + songname = "11: Piercing the Sky"; + break; + case 15: + songname = "N/A: Predestined Fate Remix"; + break; + default: + songname = "?: something else"; + break; + } + graphics.Print( -1, 120, songname, tr, tg, tb, true); + break; + } + case Menu::ed_quit: + graphics.bigprint( -1, 90, "Save before", tr, tg, tb, true); + graphics.bigprint( -1, 110, "quitting?", tr, tg, tb, true); + break; + default: + break; + } +} + +void editorrender(void) +{ + extern editorclass ed; + const edlevelclass* const room = ed.getroomprop(ed.levx, ed.levy); + + //Draw grid + + ClearSurface(graphics.backBuffer); + for(int j=0; j<30; j++) + { + for(int i=0; i<40; i++) + { + fillbox(i*8, j*8, (i*8)+7, (j*8)+7, graphics.getRGB(8,8,8)); //a simple grid + if(i%4==0) fillbox(i*8, j*8, (i*8)+7, (j*8)+7, graphics.getRGB(16,16,16)); + if(j%4==0) fillbox(i*8, j*8, (i*8)+7, (j*8)+7, graphics.getRGB(16,16,16)); + + //Minor guides + if(i==9) fillbox(i*8, j*8, (i*8)+7, (j*8)+7, graphics.getRGB(24,24,24)); + if(i==30) fillbox(i*8, j*8, (i*8)+7, (j*8)+7, graphics.getRGB(24,24,24)); + if(j==6 || j==7) fillbox(i*8, j*8, (i*8)+7, (j*8)+7, graphics.getRGB(24,24,24)); + if(j==21 || j==22) fillbox(i*8, j*8, (i*8)+7, (j*8)+7, graphics.getRGB(24,24,24)); + + //Major guides + if(i==20 || i==19) fillbox(i*8, j*8, (i*8)+7, (j*8)+7, graphics.getRGB(32,32,32)); + if(j==14) fillbox(i*8, j*8, (i*8)+7, (j*8)+7, graphics.getRGB(32,32,32)); + } + } + + //Or draw background + if(!ed.settingsmod) + { + switch(room->warpdir) + { + case 1: + graphics.rcol=ed.getwarpbackground(ed.levx, ed.levy); + graphics.drawbackground(3); + break; + case 2: + graphics.rcol=ed.getwarpbackground(ed.levx, ed.levy); + graphics.drawbackground(4); + break; + case 3: + graphics.rcol=ed.getwarpbackground(ed.levx, ed.levy); + graphics.drawbackground(5); + break; + default: + break; + } + } + + //Draw map, in function + int temp; + if(room->tileset==0 || room->tileset==10) + { + for (int j = 0; j < 30; j++) + { + for (int i = 0; i < 40; i++) + { + temp=ed.gettile(ed.levx, ed.levy, i, j); + if(temp>0) graphics.drawtile(i*8,j*8,temp); + } + } + } + else + { + for (int j = 0; j < 30; j++) + { + for (int i = 0; i < 40; i++) + { + temp=ed.gettile(ed.levx, ed.levy, i, j); + if(temp>0) graphics.drawtile2(i*8,j*8,temp); + } + } + } + + //Edge tile fix + + //Buffer the sides of the new room with tiles from other rooms, to ensure no gap problems. + for(int j=0; j<30; j++) + { + //left edge + if(ed.freewrap((ed.levx*40)-1,j+(ed.levy*30))==1) + { + FillRect(graphics.backBuffer, 0,j*8, 2,8, graphics.getRGB(255,255,255-help.glow)); + } + //right edge + if(ed.freewrap((ed.levx*40)+40,j+(ed.levy*30))==1) + { + FillRect(graphics.backBuffer, 318,j*8, 2,8, graphics.getRGB(255,255,255-help.glow)); + } + } + + for(int i=0; i<40; i++) + { + if(ed.freewrap((ed.levx*40)+i,(ed.levy*30)-1)==1) + { + FillRect(graphics.backBuffer, i*8,0, 8,2, graphics.getRGB(255,255,255-help.glow)); + } + + if(ed.freewrap((ed.levx*40)+i,30+(ed.levy*30))==1) + { + FillRect(graphics.backBuffer, i*8,238, 8,2, graphics.getRGB(255,255,255-help.glow)); + } + } + + //Draw entities + obj.customplatformtile=game.customcol*12; + + int temp2=edentat(ed.tilex+ (ed.levx*40),ed.tiley+ (ed.levy*30)); + + // Special case for drawing gray entities + bool custom_gray = room->tileset == 3 && room->tilecol == 6; + colourTransform gray_ct; + gray_ct.colour = 0xFFFFFFFF; + + // Draw entities backward to remain accurate with ingame + for (int i = edentity.size() - 1; i >= 0; i--) + { + point tpoint; + SDL_Rect drawRect; + + //if() on screen + if(edentity[i].x / 40 == ed.levx && edentity[i].y / 30 == ed.levy) + { + switch(edentity[i].t) + { + case 1: //Entities + if (custom_gray) { + graphics.setcol(18); + ed.entcolreal = graphics.ct.colour; + } + graphics.drawsprite((edentity[i].x*8)- (ed.levx*40*8),(edentity[i].y*8)- (ed.levy*30*8),ed.getenemyframe(room->enemytype),ed.entcolreal); + if(edentity[i].p1==0) graphics.Print((edentity[i].x*8)- (ed.levx*40*8)+4,(edentity[i].y*8)- (ed.levy*30*8)+4, "V", 255, 255, 255 - help.glow, false); + if(edentity[i].p1==1) graphics.Print((edentity[i].x*8)- (ed.levx*40*8)+4,(edentity[i].y*8)- (ed.levy*30*8)+4, "^", 255, 255, 255 - help.glow, false); + if(edentity[i].p1==2) graphics.Print((edentity[i].x*8)- (ed.levx*40*8)+4,(edentity[i].y*8)- (ed.levy*30*8)+4, "<", 255, 255, 255 - help.glow, false); + if(edentity[i].p1==3) graphics.Print((edentity[i].x*8)- (ed.levx*40*8)+4,(edentity[i].y*8)- (ed.levy*30*8)+4, ">", 255, 255, 255 - help.glow, false); + fillboxabs((edentity[i].x*8)- (ed.levx*40*8),(edentity[i].y*8)- (ed.levy*30*8),16,16,graphics.getBGR(255,164,255)); + break; + case 2: //Threadmills & platforms + if (!INBOUNDS_VEC(obj.customplatformtile, graphics.entcolours)) + { + continue; + } + tpoint.x = (edentity[i].x*8)- (ed.levx*40*8); + tpoint.y = (edentity[i].y*8)- (ed.levy*30*8); + drawRect = graphics.tiles_rect; + drawRect.x += tpoint.x; + drawRect.y += tpoint.y; + for (int j = 0; j < 4; j++) { + if (custom_gray) BlitSurfaceTinted(graphics.entcolours[obj.customplatformtile],NULL, graphics.backBuffer, &drawRect, gray_ct); + else BlitSurfaceStandard(graphics.entcolours[obj.customplatformtile],NULL, graphics.backBuffer, &drawRect); + drawRect.x += 8; + } + + if(edentity[i].p1<=4) + { + if(edentity[i].p1==0) graphics.Print((edentity[i].x*8)- (ed.levx*40*8)+12,(edentity[i].y*8)- (ed.levy*30*8), "V", 255 - help.glow, 255 - help.glow, 255 - help.glow, false); + if(edentity[i].p1==1) graphics.Print((edentity[i].x*8)- (ed.levx*40*8)+12,(edentity[i].y*8)- (ed.levy*30*8), "^", 255 - help.glow, 255 - help.glow, 255 - help.glow, false); + if(edentity[i].p1==2) graphics.Print((edentity[i].x*8)- (ed.levx*40*8)+12,(edentity[i].y*8)- (ed.levy*30*8), "<", 255 - help.glow, 255 - help.glow, 255 - help.glow, false); + if(edentity[i].p1==3) graphics.Print((edentity[i].x*8)- (ed.levx*40*8)+12,(edentity[i].y*8)- (ed.levy*30*8), ">", 255 - help.glow, 255 - help.glow, 255 - help.glow, false); + fillboxabs((edentity[i].x*8)- (ed.levx*40*8),(edentity[i].y*8)- (ed.levy*30*8),32,8,graphics.getBGR(255,255,255)); + } + + if(edentity[i].p1==5) + { + graphics.Print((edentity[i].x*8)- (ed.levx*40*8),(edentity[i].y*8)- (ed.levy*30*8), ">>>>", 255 - help.glow, 255 - help.glow, 255 - help.glow, false); + fillboxabs((edentity[i].x*8)- (ed.levx*40*8),(edentity[i].y*8)- (ed.levy*30*8),32,8,graphics.getBGR(255,255,255)); + } + else if(edentity[i].p1==6) + { + graphics.Print((edentity[i].x*8)- (ed.levx*40*8),(edentity[i].y*8)- (ed.levy*30*8), "<<<<", 255 - help.glow, 255 - help.glow, 255 - help.glow, false); + fillboxabs((edentity[i].x*8)- (ed.levx*40*8),(edentity[i].y*8)- (ed.levy*30*8),32,8,graphics.getBGR(255,255,255)); + } + + if(edentity[i].p1>=7) + { + tpoint.x = (edentity[i].x*8)- (ed.levx*40*8)+32; + tpoint.y = (edentity[i].y*8)- (ed.levy*30*8); + drawRect = graphics.tiles_rect; + drawRect.x += tpoint.x; + drawRect.y += tpoint.y; + for (int j = 0; j < 4; j++) { + if (custom_gray) BlitSurfaceTinted(graphics.entcolours[obj.customplatformtile],NULL, graphics.backBuffer, &drawRect, gray_ct); + else BlitSurfaceStandard(graphics.entcolours[obj.customplatformtile],NULL, graphics.backBuffer, &drawRect); + drawRect.x += 8; + } + } + + if(edentity[i].p1==7) + { + graphics.Print((edentity[i].x*8)- (ed.levx*40*8)+4,(edentity[i].y*8)- (ed.levy*30*8), "> > > > ", 255 - help.glow, 255 - help.glow, 255 - help.glow, false); + fillboxabs((edentity[i].x*8)- (ed.levx*40*8),(edentity[i].y*8)- (ed.levy*30*8),64,8,graphics.getBGR(255,255,255)); + } + else if(edentity[i].p1==8) + { + graphics.Print((edentity[i].x*8)- (ed.levx*40*8)+4,(edentity[i].y*8)- (ed.levy*30*8), "< < < < ", 255 - help.glow, 255 - help.glow, 255 - help.glow, false); + fillboxabs((edentity[i].x*8)- (ed.levx*40*8),(edentity[i].y*8)- (ed.levy*30*8),64,8,graphics.getBGR(255,255,255)); + } + break; + case 3: //Disappearing Platform + if (!INBOUNDS_VEC(obj.customplatformtile, graphics.entcolours)) + { + continue; + } + tpoint.x = (edentity[i].x*8)- (ed.levx*40*8); + tpoint.y = (edentity[i].y*8)- (ed.levy*30*8); + drawRect = graphics.tiles_rect; + drawRect.x += tpoint.x; + drawRect.y += tpoint.y; + for (int j = 0; j < 4; j++) { + if (custom_gray) BlitSurfaceTinted(graphics.entcolours[obj.customplatformtile],NULL, graphics.backBuffer, &drawRect, gray_ct); + else BlitSurfaceStandard(graphics.entcolours[obj.customplatformtile],NULL, graphics.backBuffer, &drawRect); + drawRect.x += 8; + } + + graphics.Print((edentity[i].x*8)- (ed.levx*40*8),(edentity[i].y*8)- (ed.levy*30*8), "////", 255 - help.glow, 255 - help.glow, 255 - help.glow, false); + fillboxabs((edentity[i].x*8)- (ed.levx*40*8),(edentity[i].y*8)- (ed.levy*30*8),32,8,graphics.getBGR(255,255,255)); + break; + case 9: //Shiny Trinket + graphics.drawsprite((edentity[i].x*8)- (ed.levx*40*8),(edentity[i].y*8)- (ed.levy*30*8),22,196,196,196); + fillboxabs((edentity[i].x*8)- (ed.levx*40*8),(edentity[i].y*8)- (ed.levy*30*8),16,16,graphics.getRGB(164,164,255)); + break; + case 10: //Checkpoints + graphics.drawsprite((edentity[i].x*8)- (ed.levx*40*8),(edentity[i].y*8)- (ed.levy*30*8),20 + edentity[i].p1,196,196,196); + fillboxabs((edentity[i].x*8)- (ed.levx*40*8),(edentity[i].y*8)- (ed.levy*30*8),16,16,graphics.getRGB(164,164,255)); + break; + case 11: //Gravity lines + if(edentity[i].p1==0) //Horizontal + { + int tx = edentity[i].p2; + int tx2 = tx + edentity[i].p3/8; + int ty = edentity[i].y % 30; + FillRect(graphics.backBuffer, (tx*8),(ty*8)+4, (tx2-tx)*8,1, graphics.getRGB(194,194,194)); + fillboxabs((edentity[i].x*8)- (ed.levx*40*8),(edentity[i].y*8)- (ed.levy*30*8),8,8,graphics.getRGB(164,255,164)); + } + else //Vertical + { + int tx = edentity[i].x % 40; + int ty = edentity[i].p2; + int ty2 = ty + edentity[i].p3/8; + FillRect(graphics.backBuffer, (tx*8)+3,(ty*8), 1,(ty2-ty)*8, graphics.getRGB(194,194,194)); + fillboxabs((edentity[i].x*8)- (ed.levx*40*8),(edentity[i].y*8)- (ed.levy*30*8),8,8,graphics.getRGB(164,255,164)); + } + break; + case 13://Warp tokens + graphics.drawsprite((edentity[i].x*8)- (ed.levx*40*8),(edentity[i].y*8)- (ed.levy*30*8),18+(ed.entframe%2),196,196,196); + fillboxabs((edentity[i].x*8)- (ed.levx*40*8),(edentity[i].y*8)- (ed.levy*30*8),16,16,graphics.getRGB(164,164,255)); + if(temp2==i) + { + graphics.bprint((edentity[i].x*8)- (ed.levx*40*8),(edentity[i].y*8)- (ed.levy*30*8)-8, + "("+help.String(((edentity[i].p1-int(edentity[i].p1%40))/40)+1)+","+help.String(((edentity[i].p2-int(edentity[i].p2%30))/30)+1)+")",210,210,255); + } + else + { + graphics.bprint((edentity[i].x*8)- (ed.levx*40*8),(edentity[i].y*8)- (ed.levy*30*8)-8,help.String(ed.findwarptoken(i)),210,210,255); + } + break; + case 15: //Crewmates + graphics.drawsprite((edentity[i].x*8)- (ed.levx*40*8)-4,(edentity[i].y*8)- (ed.levy*30*8),144,graphics.crewcolourreal(edentity[i].p1)); + fillboxabs((edentity[i].x*8)- (ed.levx*40*8),(edentity[i].y*8)- (ed.levy*30*8),16,24,graphics.getRGB(164,164,164)); + break; + case 16: //Start + if(edentity[i].p1==0) //Left + { + graphics.drawsprite((edentity[i].x*8)- (ed.levx*40*8)-4,(edentity[i].y*8)- (ed.levy*30*8),0,graphics.col_crewcyan); + } + else if(edentity[i].p1==1) + { + graphics.drawsprite((edentity[i].x*8)- (ed.levx*40*8)-4,(edentity[i].y*8)- (ed.levy*30*8),3,graphics.col_crewcyan); + } + fillboxabs((edentity[i].x*8)- (ed.levx*40*8),(edentity[i].y*8)- (ed.levy*30*8),16,24,graphics.getRGB(164,255,255)); + if(ed.entframe<2) + { + graphics.bprint((edentity[i].x*8)- (ed.levx*40*8)-12,(edentity[i].y*8)- (ed.levy*30*8)-8,"START",255,255,255); + } + else + { + graphics.bprint((edentity[i].x*8)- (ed.levx*40*8)-12,(edentity[i].y*8)- (ed.levy*30*8)-8,"START",196,196,196); + } + break; + case 17: //Roomtext + if(edentity[i].scriptname.length()<1) + { + fillboxabs((edentity[i].x*8)- (ed.levx*40*8),(edentity[i].y*8)- (ed.levy*30*8),8,8,graphics.getRGB(96,96,96)); + } + else + { + int length = utf8::unchecked::distance(edentity[i].scriptname.begin(), edentity[i].scriptname.end()); + fillboxabs((edentity[i].x*8)- (ed.levx*40*8),(edentity[i].y*8)- (ed.levy*30*8),length*8,8,graphics.getRGB(96,96,96)); + } + graphics.Print((edentity[i].x*8)- (ed.levx*40*8),(edentity[i].y*8)- (ed.levy*30*8), edentity[i].scriptname, 196, 196, 255 - help.glow); + break; + case 18: //Terminals + { + int usethistile = edentity[i].p1; + int usethisy = (edentity[i].y % 30) * 8; + // Not a boolean: just swapping 0 and 1, leaving the rest alone + if (usethistile == 0) + { + usethistile = 1; // Unflipped + } + else if (usethistile == 1) + { + usethistile = 0; // Flipped; + usethisy -= 8; + } + graphics.drawsprite((edentity[i].x*8)- (ed.levx*40*8), usethisy + 8, usethistile + 16, 96,96,96); + fillboxabs((edentity[i].x*8)- (ed.levx*40*8),(edentity[i].y*8)- (ed.levy*30*8),16,24,graphics.getRGB(164,164,164)); + if(temp2==i) + { + graphics.bprint((edentity[i].x*8)- (ed.levx*40*8),(edentity[i].y*8)- (ed.levy*30*8)-8,edentity[i].scriptname,210,210,255); + } + break; + } + case 19: //Script Triggers + fillboxabs((edentity[i].x*8)- (ed.levx*40*8),(edentity[i].y*8)- (ed.levy*30*8),edentity[i].p1*8,edentity[i].p2*8,graphics.getRGB(255,164,255)); + fillboxabs((edentity[i].x*8)- (ed.levx*40*8),(edentity[i].y*8)- (ed.levy*30*8),8,8,graphics.getRGB(255,255,255)); + if(temp2==i) + { + graphics.bprint((edentity[i].x*8)- (ed.levx*40*8),(edentity[i].y*8)- (ed.levy*30*8)-8,edentity[i].scriptname,210,210,255); + } + break; + case 50: //Warp lines + if(edentity[i].p1>=2) //Horizontal + { + int tx=edentity[i].x-(ed.levx*40); + int tx2=edentity[i].x-(ed.levx*40); + int ty=edentity[i].y-(ed.levy*30); + if (edentity[i].p4 != 1) + { + // Unlocked + while(ed.free(tx,ty)==0) tx--; + while(ed.free(tx2,ty)==0) tx2++; + tx++; + edentity[i].p2=tx; + edentity[i].p3=(tx2-tx)*8; + } + else + { + // Locked + tx = edentity[i].p2; + tx2 = tx + edentity[i].p3/8; + } + fillboxabs((tx*8),(ty*8)+1, (tx2-tx)*8,6, graphics.getRGB(255,255,194)); + fillboxabs((edentity[i].x*8)- (ed.levx*40*8),(edentity[i].y*8)- (ed.levy*30*8),8,8,graphics.getRGB(255,255,164)); + } + else //Vertical + { + int tx=edentity[i].x-(ed.levx*40); + int ty=edentity[i].y-(ed.levy*30); + int ty2=edentity[i].y-(ed.levy*30); + if (edentity[i].p4 != 1) + { + // Unlocked + while(ed.free(tx,ty)==0) ty--; + while(ed.free(tx,ty2)==0) ty2++; + ty++; + edentity[i].p2=ty; + edentity[i].p3=(ty2-ty)*8; + } + else + { + // Locked + ty = edentity[i].p2; + ty2 = ty + edentity[i].p3/8; + } + fillboxabs((tx*8)+1,(ty*8), 6,(ty2-ty)*8, graphics.getRGB(255,255,194)); + fillboxabs((edentity[i].x*8)- (ed.levx*40*8),(edentity[i].y*8)- (ed.levy*30*8),8,8,graphics.getRGB(255,255,164)); + } + break; + } + } + + //Need to also check warp point destinations + if(edentity[i].t==13 && ed.warpent!=i) + { + if (edentity[i].p1 / 40 == ed.levx && edentity[i].p2 / 30 == ed.levy) + { + graphics.drawsprite((edentity[i].p1*8)- (ed.levx*40*8),(edentity[i].p2*8)- (ed.levy*30*8),18+(ed.entframe%2),64,64,64); + fillboxabs((edentity[i].p1*8)- (ed.levx*40*8),(edentity[i].p2*8)- (ed.levy*30*8),16,16,graphics.getRGB(64,64,96)); + if(ed.tilex+(ed.levx*40)==edentity[i].p1 && ed.tiley+(ed.levy*30)==edentity[i].p2) + { + graphics.bprint((edentity[i].p1*8)- (ed.levx*40*8),(edentity[i].p2*8)- (ed.levy*30*8)-8, + "("+help.String(((edentity[i].x-int(edentity[i].x%40))/40)+1)+","+help.String(((edentity[i].y-int(edentity[i].y%30))/30)+1)+")",190,190,225); + } + else + { + graphics.bprint((edentity[i].p1*8)- (ed.levx*40*8),(edentity[i].p2*8)- (ed.levy*30*8)-8,help.String(ed.findwarptoken(i)),190,190,225); + } + } + } + } + + if(ed.boundarymod>0) + { + if(ed.boundarymod==1) + { + fillboxabs(ed.tilex*8, ed.tiley*8, 8,8,graphics.getRGB(255-(help.glow/2),191+(help.glow),210+(help.glow/2))); + fillboxabs((ed.tilex*8)+2, (ed.tiley*8)+2, 4,4,graphics.getRGB(128-(help.glow/4),100+(help.glow/2),105+(help.glow/4))); + } + else if(ed.boundarymod==2) + { + if((ed.tilex*8)+8<=ed.boundx1 || (ed.tiley*8)+8<=ed.boundy1) + { + fillboxabs(ed.boundx1, ed.boundy1, 8, 8,graphics.getRGB(255-(help.glow/2),191+(help.glow),210+(help.glow/2))); + fillboxabs(ed.boundx1+2, ed.boundy1+2, 4, 4,graphics.getRGB(128-(help.glow/4),100+(help.glow/2),105+(help.glow/4))); + } + else + { + fillboxabs(ed.boundx1, ed.boundy1, (ed.tilex*8)+8-ed.boundx1,(ed.tiley*8)+8-ed.boundy1,graphics.getRGB(255-(help.glow/2),191+(help.glow),210+(help.glow/2))); + fillboxabs(ed.boundx1+2, ed.boundy1+2, (ed.tilex*8)+8-ed.boundx1-4,(ed.tiley*8)+8-ed.boundy1-4,graphics.getRGB(128-(help.glow/4),100+(help.glow/2),105+(help.glow/4))); + } + } + } + else + { + //Draw boundaries + if(room->enemyx1!=0 || room->enemyy1!=0 + || room->enemyx2!=320 || room->enemyy2!=240) + { + fillboxabs( room->enemyx1, room->enemyy1, + room->enemyx2-room->enemyx1, + room->enemyy2-room->enemyy1, + graphics.getBGR(255-(help.glow/2),64,64)); + } + + if(room->platx1!=0 || room->platy1!=0 + || room->platx2!=320 || room->platy2!=240) + { + fillboxabs( room->platx1, room->platy1, + room->platx2-room->platx1, + room->platy2-room->platy1, + graphics.getBGR(64,64,255-(help.glow/2))); + } + } + + //Draw ghosts (spooky!) + if (game.ghostsenabled) { + ClearSurface(graphics.ghostbuffer); + for (int i = 0; i < (int)ed.ghosts.size(); i++) { + if (i <= ed.currentghosts) { // We don't want all of them to show up at once :) + if (ed.ghosts[i].rx != ed.levx || ed.ghosts[i].ry != ed.levy + || !INBOUNDS_VEC(ed.ghosts[i].frame, graphics.sprites)) + continue; + point tpoint; + tpoint.x = ed.ghosts[i].x; + tpoint.y = ed.ghosts[i].y; + graphics.setcolreal(ed.ghosts[i].realcol); + Uint32 alpha = graphics.ct.colour & graphics.backBuffer->format->Amask; + Uint32 therest = graphics.ct.colour & 0x00FFFFFF; + alpha = (3 * (alpha >> 24) / 4) << 24; + graphics.ct.colour = therest | alpha; + SDL_Rect drawRect = graphics.sprites_rect; + drawRect.x += tpoint.x; + drawRect.y += tpoint.y; + BlitSurfaceColoured(graphics.sprites[ed.ghosts[i].frame],NULL, graphics.ghostbuffer, &drawRect, graphics.ct); + } + } + SDL_BlitSurface(graphics.ghostbuffer, NULL, graphics.backBuffer, &graphics.bg_rect); + } + + //Draw Cursor + switch(ed.drawmode) + { + case 0: + case 1: + case 2: + case 9: + case 10: + case 12: //Single point + fillboxabs((ed.tilex*8),(ed.tiley*8),8,8, graphics.getRGB(200,32,32)); + break; + case 3: + case 4: + case 8: + case 13://2x2 + fillboxabs((ed.tilex*8),(ed.tiley*8),16,16, graphics.getRGB(200,32,32)); + break; + case 5: + case 6: + case 7://Platform + fillboxabs((ed.tilex*8),(ed.tiley*8),32,8, graphics.getRGB(200,32,32)); + break; + case 14: //X if not on edge + if(ed.tilex==0 || ed.tilex==39 || ed.tiley==0 || ed.tiley==29) + { + fillboxabs((ed.tilex*8),(ed.tiley*8),8,8, graphics.getRGB(200,32,32)); + } + else + { + graphics.Print((ed.tilex*8),(ed.tiley*8),"X",255,0,0); + } + break; + case 11: + case 15: + case 16: //2x3 + fillboxabs((ed.tilex*8),(ed.tiley*8),16,24, graphics.getRGB(200,32,32)); + break; + } + + if(ed.drawmode<3) + { + if(ed.bmod && ed.drawmode<2) + { + fillboxabs((ed.tilex*8),0,8,240,graphics.getRGB(200,32,32)); + } + else if(ed.hmod && ed.drawmode<2) + { + fillboxabs(0,(ed.tiley*8),320,8,graphics.getRGB(200,32,32)); + } + else if(ed.vmod && ed.drawmode<2) + { + fillboxabs((ed.tilex*8)-32,(ed.tiley*8)-32,24+48,24+48, graphics.getRGB(200,32,32)); + } + else if(ed.cmod && ed.drawmode<2) + { + fillboxabs((ed.tilex*8)-24,(ed.tiley*8)-24,24+32,24+32, graphics.getRGB(200,32,32)); + } + else if(ed.xmod && ed.drawmode<2) + { + fillboxabs((ed.tilex*8)-16,(ed.tiley*8)-16,24+16,24+16, graphics.getRGB(200,32,32)); + } + else if(ed.zmod && ed.drawmode<2) + { + fillboxabs((ed.tilex*8)-8,(ed.tiley*8)-8,24,24, graphics.getRGB(200,32,32)); + } + + + } + + //If in directmode, show current directmode tile + if(room->directmode==1) + { + //Tile box for direct mode + int t2=0; + if(ed.dmtileeditor>0) + { + if(ed.dmtileeditor<=4) + { + t2=graphics.lerp((4-ed.dmtileeditor+1)*12, (4-ed.dmtileeditor)*12); + } + + //Draw five lines of the editor + temp=ed.dmtile-(ed.dmtile%40); + temp-=80; + FillRect(graphics.backBuffer, 0,-t2,320,40, graphics.getRGB(0,0,0)); + FillRect(graphics.backBuffer, 0,-t2+40,320,2, graphics.getRGB(255,255,255)); + if(room->tileset==0) + { + const int numtiles = (((int) graphics.tiles.size()) / 40) * 40; + + for(int i=0; i<40; i++) + { + graphics.drawtile(i*8,0-t2,(temp+numtiles+i)%numtiles); + graphics.drawtile(i*8,8-t2,(temp+numtiles+40+i)%numtiles); + graphics.drawtile(i*8,16-t2,(temp+numtiles+80+i)%numtiles); + graphics.drawtile(i*8,24-t2,(temp+numtiles+120+i)%numtiles); + graphics.drawtile(i*8,32-t2,(temp+numtiles+160+i)%numtiles); + } + } + else + { + const int numtiles = (((int) graphics.tiles2.size()) / 40) * 40; + + for(int i=0; i<40; i++) + { + graphics.drawtile2(i*8,0-t2,(temp+numtiles+i)%numtiles); + graphics.drawtile2(i*8,8-t2,(temp+numtiles+40+i)%numtiles); + graphics.drawtile2(i*8,16-t2,(temp+numtiles+80+i)%numtiles); + graphics.drawtile2(i*8,24-t2,(temp+numtiles+120+i)%numtiles); + graphics.drawtile2(i*8,32-t2,(temp+numtiles+160+i)%numtiles); + } + } + //Highlight our little block + fillboxabs(((ed.dmtile%40)*8)-2,16-t2-2,12,12,graphics.getRGB(196, 196, 255 - help.glow)); + fillboxabs(((ed.dmtile%40)*8)-1,16-t2-1,10,10,graphics.getRGB(0,0,0)); + } + + if(ed.dmtileeditor>0 && t2<=30) + { + graphics.bprint(2, 45-t2, "Tile:", 196, 196, 255 - help.glow, false); + graphics.bprint(58, 45-t2, help.String(ed.dmtile), 196, 196, 255 - help.glow, false); + FillRect(graphics.backBuffer, 44,44-t2,10,10, graphics.getRGB(196, 196, 255 - help.glow)); + FillRect(graphics.backBuffer, 45,45-t2,8,8, graphics.getRGB(0,0,0)); + + if(room->tileset==0) + { + graphics.drawtile(45,45-t2,ed.dmtile); + } + else + { + graphics.drawtile2(45,45-t2,ed.dmtile); + } + } + else + { + graphics.bprint(2, 12, "Tile:", 196, 196, 255 - help.glow, false); + graphics.bprint(58, 12, help.String(ed.dmtile), 196, 196, 255 - help.glow, false); + FillRect(graphics.backBuffer, 44,11,10,10, graphics.getRGB(196, 196, 255 - help.glow)); + FillRect(graphics.backBuffer, 45,12,8,8, graphics.getRGB(0,0,0)); + + if(room->tileset==0) + { + graphics.drawtile(45,12,ed.dmtile); + } + else + { + graphics.drawtile2(45,12,ed.dmtile); + } + } + } + + + + + //Draw GUI + if(ed.boundarymod>0) + { + if(ed.boundarymod==1) + { + FillRect(graphics.backBuffer, 0,230,320,240, graphics.getRGB(32,32,32)); + FillRect(graphics.backBuffer, 0,231,320,240, graphics.getRGB(0,0,0)); + switch(ed.boundarytype) + { + case 0: + graphics.Print(4, 232, "SCRIPT BOX: Click on top left", 255,255,255, false); + break; + case 1: + graphics.Print(4, 232, "ENEMY BOUNDS: Click on top left", 255,255,255, false); + break; + case 2: + graphics.Print(4, 232, "PLATFORM BOUNDS: Click on top left", 255,255,255, false); + break; + case 3: + graphics.Print(4, 232, "COPY TILES: Click on top left", 255,255,255, false); + break; + default: + graphics.Print(4, 232, "Click on top left", 255,255,255, false); + break; + } + } + else if(ed.boundarymod==2) + { + FillRect(graphics.backBuffer, 0,230,320,240, graphics.getRGB(32,32,32)); + FillRect(graphics.backBuffer, 0,231,320,240, graphics.getRGB(0,0,0)); + switch(ed.boundarytype) + { + case 0: + graphics.Print(4, 232, "SCRIPT BOX: Click on bottom right", 255,255,255, false); + break; + case 1: + graphics.Print(4, 232, "ENEMY BOUNDS: Click on bottom right", 255,255,255, false); + break; + case 2: + graphics.Print(4, 232, "PLATFORM BOUNDS: Click on bottom right", 255,255,255, false); + break; + case 3: + graphics.Print(4, 232, "COPY TILES: Click on bottom right", 255,255,255, false); + break; + default: + graphics.Print(4, 232, "Click on bottom right", 255,255,255, false); + break; + } + } + } + else if(ed.scripteditmod) + { + //Elaborate C64 BASIC menu goes here! + FillRect(graphics.backBuffer, 0,0,320,240, graphics.getBGR(123, 111, 218)); + FillRect(graphics.backBuffer, 14,16,292,208, graphics.getRGB(162,48,61)); + switch(ed.scripthelppage) + { + case 0: + graphics.Print(16,28,"**** VVVVVV SCRIPT EDITOR ****", 123, 111, 218, true); + graphics.Print(16,44,"PRESS ESC TO RETURN TO MENU", 123, 111, 218, true); + + if(!ed.hooklist.empty()) + { + for(int i=0; i<9; i++) + { + if(ed.hookmenupage+i<(int)ed.hooklist.size()) + { + if(ed.hookmenupage+i==ed.hookmenu) + { + std::string tstring="> " + ed.hooklist[(ed.hooklist.size()-1)-(ed.hookmenupage+i)] + " <"; + for (size_t ii = 0; ii < tstring.length(); ii++) + { + tstring[ii] = SDL_toupper(tstring[ii]); + } + graphics.Print(16,68+(i*16),tstring,123, 111, 218, true); + } + else + { + graphics.Print(16,68+(i*16),ed.hooklist[(ed.hooklist.size()-1)-(ed.hookmenupage+i)],123, 111, 218, true); + } + } + } + } + else + { + graphics.Print(16,110,"NO SCRIPT IDS FOUND", 123, 111, 218, true); + graphics.Print(16,130,"CREATE A SCRIPT WITH EITHER", 123, 111, 218, true); + graphics.Print(16,140,"THE TERMINAL OR SCRIPT BOX TOOLS", 123, 111, 218, true); + } + break; + case 1: + //Current scriptname + FillRect(graphics.backBuffer, 14,226,292,12, graphics.getRGB(162,48,61)); + graphics.Print(16,228,"CURRENT SCRIPT: " + ed.sbscript, 123, 111, 218, true); + //Draw text + for(int i=0; i<25; i++) + { + if(i+ed.pagey<(int)ed.sb.size()) + { + graphics.Print(16,20+(i*8),ed.sb[i+ed.pagey], 123, 111, 218, false); + } + } + //Draw cursor + if(ed.entframe<2) + { + graphics.Print(16+(ed.sbx*8),20+(ed.sby*8),"_",123, 111, 218, false); + } + break; + } + } + else if(ed.settingsmod) + { + if(!game.colourblindmode) + { + graphics.drawtowerbackground(graphics.titlebg); + } + else + { + ClearSurface(graphics.backBuffer); + } + + int tr = graphics.titlebg.r - (help.glow / 4) - int(fRandom() * 4); + int tg = graphics.titlebg.g - (help.glow / 4) - int(fRandom() * 4); + int tb = graphics.titlebg.b - (help.glow / 4) - int(fRandom() * 4); + if (tr < 0) tr = 0; + if(tr>255) tr=255; + if (tg < 0) tg = 0; + if(tg>255) tg=255; + if (tb < 0) tb = 0; + if(tb>255) tb=255; + editormenurender(tr, tg, tb); + + graphics.drawmenu(tr, tg, tb); + } + else if (ed.textmod) + { + FillRect(graphics.backBuffer, 0, 221, 320, 240, graphics.getRGB(32, 32, 32)); + FillRect(graphics.backBuffer, 0, 222, 320, 240, graphics.getRGB(0, 0, 0)); + graphics.Print(4, 224, ed.textdesc, 255, 255, 255, false); + std::string input = key.keybuffer; + if (ed.entframe < 2) + { + input += "_"; + } + else + { + input += " "; + } + graphics.Print(4, 232, input, 196, 196, 255 - help.glow, true); + } + else if(ed.warpmod) + { + //placing warp token + FillRect(graphics.backBuffer, 0,221,320,240, graphics.getRGB(32,32,32)); + FillRect(graphics.backBuffer, 0,222,320,240, graphics.getRGB(0,0,0)); + graphics.Print(4, 224, "Left click to place warp destination", 196, 196, 255 - help.glow, false); + graphics.Print(4, 232, "Right click to cancel", 196, 196, 255 - help.glow, false); + } + else + { + if(ed.spacemod) + { + FillRect(graphics.backBuffer, 0,208,320,240, graphics.getRGB(32,32,32)); + FillRect(graphics.backBuffer, 0,209,320,240, graphics.getRGB(0,0,0)); + + //Draw little icons for each thingy + int tx=6, ty=211, tg=32; + + if(ed.spacemenu==0) + { + for(int i=0; i<10; i++) + { + FillRect(graphics.backBuffer, 4+(i*tg), 209,20,20,graphics.getRGB(32,32,32)); + } + FillRect(graphics.backBuffer, 4+(ed.drawmode*tg), 209,20,20,graphics.getRGB(64,64,64)); + //0: + graphics.drawtile(tx,ty,83); + graphics.drawtile(tx+8,ty,83); + graphics.drawtile(tx,ty+8,83); + graphics.drawtile(tx+8,ty+8,83); + //1: + tx+=tg; + graphics.drawtile(tx,ty,680); + graphics.drawtile(tx+8,ty,680); + graphics.drawtile(tx,ty+8,680); + graphics.drawtile(tx+8,ty+8,680); + //2: + tx+=tg; + graphics.drawtile(tx+4,ty+4,8); + //3: + tx+=tg; + graphics.drawsprite(tx,ty,22,196,196,196); + //4: + tx+=tg; + graphics.drawsprite(tx,ty,21,196,196,196); + //5: + tx+=tg; + graphics.drawtile(tx,ty+4,3); + graphics.drawtile(tx+8,ty+4,4); + //6: + tx+=tg; + graphics.drawtile(tx,ty+4,24); + graphics.drawtile(tx+8,ty+4,24); + //7: + tx+=tg; + graphics.drawtile(tx,ty+4,1); + graphics.drawtile(tx+8,ty+4,1); + //8: + tx+=tg; + graphics.drawsprite(tx,ty,78+ed.entframe,196,196,196); + //9: + tx+=tg; + FillRect(graphics.backBuffer, tx+2,ty+8,12,1,graphics.getRGB(255,255,255)); + + for (int i = 0; i < 10; i++) + { + fillboxabs(4+(i*tg), 209,20,20,graphics.getRGB(96,96,96)); + const int col = i == ed.drawmode ? 255 : 164; + const std::string glyph = i == 9 ? "0" : help.String(i + 1); + graphics.Print(22 + i*tg - 4, 225 - 4, glyph, col, col, col, false); + } + + fillboxabs(4+(ed.drawmode*tg), 209,20,20,graphics.getRGB(200,200,200)); + + graphics.Print(4, 232, "1/2", 196, 196, 255 - help.glow, false); + } + else + { + for(int i=0; i<7; i++) + { + FillRect(graphics.backBuffer, 4+(i*tg), 209,20,20,graphics.getRGB(32,32,32)); + } + FillRect(graphics.backBuffer, 4+((ed.drawmode-10)*tg), 209,20,20,graphics.getRGB(64,64,64)); + //10: + graphics.Print(tx,ty,"A",196, 196, 255 - help.glow, false); + graphics.Print(tx+8,ty,"B",196, 196, 255 - help.glow, false); + graphics.Print(tx,ty+8,"C",196, 196, 255 - help.glow, false); + graphics.Print(tx+8,ty+8,"D",196, 196, 255 - help.glow, false); + //11: + tx+=tg; + graphics.drawsprite(tx,ty,17,196,196,196); + //12: + tx+=tg; + fillboxabs(tx+4,ty+4,8,8,graphics.getRGB(96,96,96)); + //13: + tx+=tg; + graphics.drawsprite(tx,ty,18+(ed.entframe%2),196,196,196); + //14: + tx+=tg; + FillRect(graphics.backBuffer, tx+6,ty+2,4,12,graphics.getRGB(255,255,255)); + //15: + tx+=tg; + graphics.drawsprite(tx,ty,186,graphics.col_crewblue); + //16: + tx+=tg; + graphics.drawsprite(tx,ty,184,graphics.col_crewcyan); + + for (int i = 0; i < 7; i++) + { + fillboxabs(4 + i*tg, 209, 20, 20, graphics.getRGB(96, 96, 96)); + const int col = i + 10 == ed.drawmode ? 255 : 164; + static const char glyphs[] = "RTYUIOP"; + graphics.Print(22 + i*tg - 4, 225 - 4, std::string(1, glyphs[i]), col, col, col, false); + } + + fillboxabs(4 + (ed.drawmode - 10) * tg, 209, 20, 20, graphics.getRGB(200, 200, 200)); + + graphics.Print(4, 232, "2/2", 196, 196, 255 - help.glow, false); + } + + graphics.Print(128, 232, "< and > keys change tool", 196, 196, 255 - help.glow, false); + + FillRect(graphics.backBuffer, 0,198,120,10, graphics.getRGB(32,32,32)); + FillRect(graphics.backBuffer, 0,199,119,9, graphics.getRGB(0,0,0)); + switch(ed.drawmode) + { + case 0: + graphics.bprint(2,199, "1: Walls",196, 196, 255 - help.glow); + break; + case 1: + graphics.bprint(2,199, "2: Backing",196, 196, 255 - help.glow); + break; + case 2: + graphics.bprint(2,199, "3: Spikes",196, 196, 255 - help.glow); + break; + case 3: + graphics.bprint(2,199, "4: Trinkets",196, 196, 255 - help.glow); + break; + case 4: + graphics.bprint(2,199, "5: Checkpoint",196, 196, 255 - help.glow); + break; + case 5: + graphics.bprint(2,199, "6: Disappear",196, 196, 255 - help.glow); + break; + case 6: + graphics.bprint(2,199, "7: Conveyors",196, 196, 255 - help.glow); + break; + case 7: + graphics.bprint(2,199, "8: Moving",196, 196, 255 - help.glow); + break; + case 8: + graphics.bprint(2,199, "9: Enemies",196, 196, 255 - help.glow); + break; + case 9: + graphics.bprint(2,199, "0: Grav Line",196, 196, 255 - help.glow); + break; + case 10: + graphics.bprint(2,199, "R: Roomtext",196, 196, 255 - help.glow); + break; + case 11: + graphics.bprint(2,199, "T: Terminal",196, 196, 255 - help.glow); + break; + case 12: + graphics.bprint(2,199, "Y: Script Box",196, 196, 255 - help.glow); + break; + case 13: + graphics.bprint(2,199, "U: Warp Token",196, 196, 255 - help.glow); + break; + case 14: + graphics.bprint(2,199, "I: Warp Lines",196, 196, 255 - help.glow); + break; + case 15: + graphics.bprint(2,199, "O: Crewmate",196, 196, 255 - help.glow); + break; + case 16: + graphics.bprint(2,199, "P: Start Point",196, 196, 255 - help.glow); + break; + } + + FillRect(graphics.backBuffer, 260,198,80,10, graphics.getRGB(32,32,32)); + FillRect(graphics.backBuffer, 261,199,80,9, graphics.getRGB(0,0,0)); + graphics.bprint(268,199, "("+help.String(ed.levx+1)+","+help.String(ed.levy+1)+")",196, 196, 255 - help.glow, false); + + } + else + { + //FillRect(graphics.backBuffer, 0,230,72,240, graphics.RGB(32,32,32)); + //FillRect(graphics.backBuffer, 0,231,71,240, graphics.RGB(0,0,0)); + if(room->roomname!="") + { + if (graphics.translucentroomname) + { + graphics.footerrect.y = 230+ed.roomnamehide; + SDL_BlitSurface(graphics.footerbuffer, NULL, graphics.backBuffer, &graphics.footerrect); + } + else + { + FillRect(graphics.backBuffer, 0,230+ed.roomnamehide,320,10, graphics.getRGB(0,0,0)); + } + graphics.bprint(5,231+ed.roomnamehide,room->roomname, 196, 196, 255 - help.glow, true); + graphics.bprint(4, 222, "SPACE ^ SHIFT ^", 196, 196, 255 - help.glow, false); + graphics.bprint(268,222, "("+help.String(ed.levx+1)+","+help.String(ed.levy+1)+")",196, 196, 255 - help.glow, false); + } + else + { + graphics.bprint(4, 232, "SPACE ^ SHIFT ^", 196, 196, 255 - help.glow, false); + graphics.bprint(268,232, "("+help.String(ed.levx+1)+","+help.String(ed.levy+1)+")",196, 196, 255 - help.glow, false); + } + } + + if(ed.shiftmenu) + { + fillboxabs(0, 117,171+8,140,graphics.getRGB(64,64,64)); + FillRect(graphics.backBuffer, 0,118,170+8,140, graphics.getRGB(0,0,0)); + graphics.Print(4, 120, "F1: Change Tileset",164,164,164,false); + graphics.Print(4, 130, "F2: Change Colour",164,164,164,false); + graphics.Print(4, 140, "F3: Change Enemies",164,164,164,false); + graphics.Print(4, 150, "F4: Enemy Bounds",164,164,164,false); + graphics.Print(4, 160, "F5: Platform Bounds",164,164,164,false); + + graphics.Print(4, 180, "F9: Reload Resources",164,164,164,false); + graphics.Print(4, 190, "F10: Direct Mode",164,164,164,false); + + graphics.Print(4, 210, "W: Change Warp Dir",164,164,164,false); + graphics.Print(4, 220, "E: Change Roomname",164,164,164,false); + + fillboxabs(220, 207,100,60,graphics.getRGB(64,64,64)); + FillRect(graphics.backBuffer, 221,208,160,60, graphics.getRGB(0,0,0)); + graphics.Print(224, 210, "S: Save Map",164,164,164,false); + graphics.Print(224, 220, "L: Load Map",164,164,164,false); + } + } + + + if(!ed.settingsmod && !ed.scripteditmod) + { + //Same as above, without borders + switch(ed.drawmode) + { + case 0: + graphics.bprint(2,2, "1: Walls",196, 196, 255 - help.glow); + break; + case 1: + graphics.bprint(2,2, "2: Backing",196, 196, 255 - help.glow); + break; + case 2: + graphics.bprint(2,2, "3: Spikes",196, 196, 255 - help.glow); + break; + case 3: + graphics.bprint(2,2, "4: Trinkets",196, 196, 255 - help.glow); + break; + case 4: + graphics.bprint(2,2, "5: Checkpoint",196, 196, 255 - help.glow); + break; + case 5: + graphics.bprint(2,2, "6: Disappear",196, 196, 255 - help.glow); + break; + case 6: + graphics.bprint(2,2, "7: Conveyors",196, 196, 255 - help.glow); + break; + case 7: + graphics.bprint(2,2, "8: Moving",196, 196, 255 - help.glow); + break; + case 8: + graphics.bprint(2,2, "9: Enemies",196, 196, 255 - help.glow); + break; + case 9: + graphics.bprint(2,2, "0: Grav Line",196, 196, 255 - help.glow); + break; + case 10: + graphics.bprint(2,2, "R: Roomtext",196, 196, 255 - help.glow); + break; + case 11: + graphics.bprint(2,2, "T: Terminal",196, 196, 255 - help.glow); + break; + case 12: + graphics.bprint(2,2, "Y: Script Box",196, 196, 255 - help.glow); + break; + case 13: + graphics.bprint(2,2, "U: Warp Token",196, 196, 255 - help.glow); + break; + case 14: + graphics.bprint(2,2, "I: Warp Lines",196, 196, 255 - help.glow); + break; + case 15: + graphics.bprint(2,2, "O: Crewmate",196, 196, 255 - help.glow); + break; + case 16: + graphics.bprint(2,2, "P: Start Point",196, 196, 255 - help.glow); + break; + } + } + + if(ed.notedelay>0 || ed.oldnotedelay>0) + { + float alpha = graphics.lerp(ed.oldnotedelay, ed.notedelay); + FillRect(graphics.backBuffer, 0,115,320,18, graphics.getRGB(92,92,92)); + FillRect(graphics.backBuffer, 0,116,320,16, graphics.getRGB(0,0,0)); + graphics.Print(0,121, ed.note,196-((45.0f-alpha)*4), 196-((45.0f-alpha)*4), 196-((45.0f-alpha)*4), true); + } + + graphics.drawfade(); + + graphics.render(); +} + +void editorrenderfixed(void) +{ + extern editorclass ed; + const edlevelclass* const room = ed.getroomprop(ed.levx, ed.levy); + graphics.updatetitlecolours(); + + game.customcol=ed.getlevelcol(room->tileset, room->tilecol)+1; + ed.entcol=ed.getenemycol(game.customcol); + + graphics.setcol(ed.entcol); + ed.entcolreal = graphics.ct.colour; + + if (game.ghostsenabled) + { + for (size_t i = 0; i < ed.ghosts.size(); i++) + { + GhostInfo& ghost = ed.ghosts[i]; + + if ((int) i > ed.currentghosts || ghost.rx != ed.levx || ghost.ry != ed.levy) + { + continue; + } + + graphics.setcol(ghost.col); + ghost.realcol = graphics.ct.colour; + } + + if (ed.currentghosts + 1 < (int)ed.ghosts.size()) { + ed.currentghosts++; + if (ed.zmod) ed.currentghosts++; + } else { + ed.currentghosts = (int)ed.ghosts.size() - 1; + } + } + + if (!ed.settingsmod) + { + switch(room->warpdir) + { + case 1: + graphics.rcol=ed.getwarpbackground(ed.levx, ed.levy); + graphics.updatebackground(3); + break; + case 2: + graphics.rcol=ed.getwarpbackground(ed.levx, ed.levy); + graphics.updatebackground(4); + break; + case 3: + graphics.rcol=ed.getwarpbackground(ed.levx, ed.levy); + graphics.updatebackground(5); + break; + default: + break; + } + } + else if (!game.colourblindmode) + { + graphics.updatetowerbackground(graphics.titlebg); + } + + /* Correct gravity lines */ + for (size_t i = 0; i < edentity.size(); ++i) + { + if (edentity[i].x / 40 != ed.levx + || edentity[i].y / 30 != ed.levy + || edentity[i].t != 11 + /* Is the gravity line locked? */ + || edentity[i].p4 == 1) + { + continue; + } + + if (edentity[i].p1 == 0) + { + /* Horizontal */ + int tx = edentity[i].x % 40; + int tx2 = tx; + int ty = edentity[i].y % 30; + while (!ed.spikefree(tx, ty)) + { + --tx; + } + while (!ed.spikefree(tx2, ty)) + { + ++tx2; + } + ++tx; + edentity[i].p2 = tx; + edentity[i].p3 = (tx2 - tx) * 8; + } + else + { + /* Vertical */ + int tx = edentity[i].x % 40; + int ty = edentity[i].y % 30; + int ty2 = ty; + /* Unlocked */ + while (!ed.spikefree(tx, ty)) + { + --ty; + } + while (!ed.spikefree(tx, ty2)) + { + ++ty2; + } + ++ty; + edentity[i].p2 = ty; + edentity[i].p3 = (ty2 - ty) * 8; + } + } + + if (ed.getroomprop(ed.levx, ed.levy)->directmode == 1) + { + if (ed.dmtileeditor > 0) + { + ed.dmtileeditor--; + } + } + else + { + ed.dmtileeditor = 0; + } + + if (ed.getroomprop(ed.levx, ed.levy)->roomname != "") + { + if (ed.tiley < 28) + { + if (ed.roomnamehide > 0) + { + ed.roomnamehide--; + } + } + else + { + if (ed.roomnamehide < 12) + { + ed.roomnamehide++; + } + } + } + else + { + if (ed.tiley < 28) + { + ed.roomnamehide = 0; + } + else + { + ed.roomnamehide = 12; + } + } +} + +void editorlogic(void) +{ + extern editorclass ed; + //Misc + help.updateglow(); + + graphics.titlebg.bypos -= 2; + graphics.titlebg.bscroll = -2; + + ed.entframedelay--; + if(ed.entframedelay<=0) + { + ed.entframe=(ed.entframe+1)%4; + ed.entframedelay=8; + } + + ed.oldnotedelay = ed.notedelay; + if(ed.notedelay>0) + { + ed.notedelay--; + } + + if (graphics.fademode == 1) + { + //Return to game + graphics.titlebg.colstate = 10; + map.nexttowercolour(); + game.quittomenu(); + music.play(6); //should be before game.quittomenu() + ed.settingsmod=false; + } +} + +static void creategameoptions(void) +{ + game.createmenu(Menu::options); +} + +static void nextbgcolor(void) +{ + map.nexttowercolour(); +} + +static void editormenuactionpress(void) +{ + extern editorclass ed; + switch (game.currentmenuname) + { + case Menu::ed_desc: + switch (game.currentmenuoption) + { + case 0: + ed.titlemod=true; + key.enabletextentry(); + key.keybuffer=EditorData::GetInstance().title; + break; + case 1: + ed.creatormod=true; + key.enabletextentry(); + key.keybuffer=EditorData::GetInstance().creator; + break; + case 2: + ed.desc1mod=true; + key.enabletextentry(); + key.keybuffer=ed.Desc1; + break; + case 3: + ed.websitemod=true; + key.enabletextentry(); + key.keybuffer=ed.website; + break; + case 4: + game.returnmenu(); + map.nexttowercolour(); + break; + } + music.playef(11); + break; + case Menu::ed_settings: + switch (game.currentmenuoption) + { + case 0: + //Change level description stuff + music.playef(11); + game.createmenu(Menu::ed_desc); + map.nexttowercolour(); + break; + case 1: + //Enter script editormode + music.playef(11); + ed.scripteditmod=true; + ed.clearscriptbuffer(); + key.keybuffer=""; + ed.hookmenupage=0; + ed.hookmenu=0; + ed.scripthelppage=0; + ed.scripthelppagedelay=0; + ed.sby=0; + ed.sbx=0, ed.pagey=0; + break; + case 2: + music.playef(11); + game.createmenu(Menu::ed_music); + map.nexttowercolour(); + if(ed.levmusic>0) music.play(ed.levmusic); + break; + case 3: + music.playef(11); + game.ghostsenabled = !game.ghostsenabled; + break; + case 4: + //Load level + ed.settingsmod=false; + graphics.backgrounddrawn=false; + map.nexttowercolour(); + + ed.keydelay = 6; + ed.getlin(TEXT_LOAD, "Enter map filename to load:", &(ed.filename)); + game.mapheld=true; + graphics.backgrounddrawn=false; + break; + case 5: + //Save level + ed.settingsmod=false; + map.nexttowercolour(); + + ed.keydelay = 6; + ed.getlin(TEXT_SAVE, "Enter map filename to save as:", &(ed.filename)); + game.mapheld=true; + graphics.backgrounddrawn=false; + break; + case 6: + /* Game options */ + music.playef(11); + game.gamestate = TITLEMODE; + game.ingame_titlemode = true; + game.ingame_editormode = true; + + DEFER_CALLBACK(creategameoptions); + DEFER_CALLBACK(nextbgcolor); + break; + default: + music.playef(11); + game.createmenu(Menu::ed_quit); + map.nexttowercolour(); + break; + } + break; + case Menu::ed_music: + switch (game.currentmenuoption) + { + case 0: + case 1: + switch (game.currentmenuoption) + { + case 0: + ed.levmusic++; + break; + case 1: + ed.levmusic--; + break; + } + ed.levmusic = (ed.levmusic % 16 + 16) % 16; + if(ed.levmusic>0) + { + music.play(ed.levmusic); + } + else + { + music.haltdasmusik(); + } + music.playef(11); + break; + case 2: + music.playef(11); + music.fadeout(); + game.returnmenu(); + map.nexttowercolour(); + break; + } + break; + case Menu::ed_quit: + switch (game.currentmenuoption) + { + case 0: + //Saving and quit + ed.saveandquit=true; + + ed.settingsmod=false; + map.nexttowercolour(); + + ed.keydelay = 6; + ed.getlin(TEXT_SAVE, "Enter map filename to save as:", &(ed.filename)); + game.mapheld=true; + graphics.backgrounddrawn=false; + break; + case 1: + //Quit without saving + music.playef(11); + music.fadeout(); + graphics.fademode = 2; + break; + case 2: + //Go back to editor + music.playef(11); + game.returnmenu(); + map.nexttowercolour(); + break; + } + break; + default: + break; + } +} + +void editorinput(void) +{ + extern editorclass ed; + if (graphics.fademode == 3 /* fading out */) + { + return; + } + game.mx = (float) key.mx; + game.my = (float) key.my; + ed.tilex=(game.mx - (game.mx%8))/8; + ed.tiley=(game.my - (game.my%8))/8; + if (graphics.screenbuffer->stretchMode == 1) { + // In this mode specifically, we have to fix the mouse coordinates + int winwidth, winheight; + graphics.screenbuffer->GetWindowSize(&winwidth, &winheight); + ed.tilex = ed.tilex * 320 / winwidth; + ed.tiley = ed.tiley * 240 / winheight; + } + + bool up_pressed = key.isDown(SDLK_UP) || key.isDown(SDL_CONTROLLER_BUTTON_DPAD_UP); + bool down_pressed = key.isDown(SDLK_DOWN) || key.isDown(SDL_CONTROLLER_BUTTON_DPAD_DOWN); + bool left_pressed = key.isDown(SDLK_LEFT) || key.isDown(SDL_CONTROLLER_BUTTON_DPAD_LEFT); + bool right_pressed = key.isDown(SDLK_RIGHT) || key.isDown(SDL_CONTROLLER_BUTTON_DPAD_RIGHT); + + game.press_left = false; + game.press_right = false; + game.press_action = false; + game.press_map = false; + game.press_interact = false; + + if (key.isDown(KEYBOARD_LEFT) || key.isDown(KEYBOARD_a) || key.controllerWantsLeft(false)) + { + game.press_left = true; + } + if (key.isDown(KEYBOARD_RIGHT) || key.isDown(KEYBOARD_d) || key.controllerWantsRight(false)) + { + game.press_right = true; + } + if (key.isDown(KEYBOARD_z) || key.isDown(KEYBOARD_SPACE) || key.isDown(KEYBOARD_v) || key.isDown(game.controllerButton_flip)) + { + game.press_action = true; + }; + + if (key.keymap[SDLK_F9] && (ed.keydelay==0)) { + ed.keydelay = 30; + ed.note="Reloaded resources"; + ed.notedelay=45; + graphics.reloadresources(); + } + + if (key.isDown(KEYBOARD_ENTER)) game.press_map = true; + if (key.isDown(27) && !ed.settingskey) + { + ed.settingskey=true; + if (ed.textmod) + { + key.disabletextentry(); + if (ed.textmod >= FIRST_ENTTEXT && ed.textmod <= LAST_ENTTEXT) + { + *ed.textptr = ed.oldenttext; + if (ed.oldenttext == "") + { + removeedentity(ed.textent); + } + } + + ed.textmod = TEXT_NONE; + + ed.shiftmenu = false; + ed.shiftkey = false; + } + else if (key.textentry()) + { + key.disabletextentry(); + ed.titlemod=false; + ed.desc1mod=false; + ed.desc2mod=false; + ed.desc3mod=false; + ed.websitemod=false; + ed.creatormod=false; + music.playef(11); + + ed.shiftmenu=false; + ed.shiftkey=false; + } + else if(ed.boundarymod>0) + { + ed.boundarymod=0; + } + else + { + + music.playef(11); + if (ed.settingsmod) + { + if (ed.scripteditmod) + { + ed.scripteditmod = false; + } + else if (ed.settingsmod) + { + if (game.currentmenuname == Menu::ed_settings) + { + ed.settingsmod = false; + } + else + { + game.returnmenu(); + map.nexttowercolour(); + } + } + } + else + { + ed.settingsmod = true; + } + graphics.backgrounddrawn=false; + + if (ed.settingsmod) + { + bool edsettings_in_stack = game.currentmenuname == Menu::ed_settings; + if (!edsettings_in_stack) + { + size_t i; + for (i = 0; i < game.menustack.size(); ++i) + { + if (game.menustack[i].name == Menu::ed_settings) + { + edsettings_in_stack = true; + break; + } + } + } + if (edsettings_in_stack) + { + game.returntomenu(Menu::ed_settings); + } + else + { + game.createmenu(Menu::ed_settings); + } + map.nexttowercolour(); + } + } + } + + if (!key.isDown(27)) + { + ed.settingskey=false; + } + + if(key.keymap[SDLK_LCTRL] || key.keymap[SDLK_RCTRL]) + { + if(key.leftbutton) key.rightbutton=true; + } + + if(ed.scripteditmod) + { + if(ed.scripthelppage==0) + { + //hook select menu + if(ed.keydelay>0) ed.keydelay--; + + if(up_pressed && ed.keydelay<=0) + { + ed.keydelay=6; + ed.hookmenu--; + } + + if(down_pressed && ed.keydelay<=0) + { + ed.keydelay=6; + ed.hookmenu++; + } + + if(ed.hookmenu>=(int)ed.hooklist.size()) + { + ed.hookmenu=ed.hooklist.size()-1; + } + if(ed.hookmenu<0) ed.hookmenu=0; + + if(ed.hookmenu=ed.hookmenupage+9) + { + ed.hookmenupage=ed.hookmenu+8; + } + + if(!key.keymap[SDLK_BACKSPACE]) ed.deletekeyheld=0; + + if(key.keymap[SDLK_BACKSPACE] && ed.deletekeyheld==0 && !ed.hooklist.empty()) + { + ed.deletekeyheld=1; + music.playef(2); + ed.removehook(ed.hooklist[(ed.hooklist.size()-1)-ed.hookmenu]); + } + + if (!game.press_action && !game.press_left && !game.press_right + && !up_pressed && !down_pressed && !key.isDown(27)) game.jumpheld = false; + if (!game.jumpheld) + { + if (game.press_action || game.press_left || game.press_right || game.press_map + || up_pressed || down_pressed || key.isDown(27)) + { + game.jumpheld = true; + } + if ((game.press_action || game.press_map) && !ed.hooklist.empty()) + { + game.mapheld=true; + ed.scripthelppage=1; + key.enabletextentry(); + key.keybuffer=""; + ed.sbscript=ed.hooklist[(ed.hooklist.size()-1)-ed.hookmenu]; + ed.loadhookineditor(ed.sbscript); + + ed.sby=ed.sb.size()-1; + ed.pagey=0; + while(ed.sby>=20) + { + ed.pagey++; + ed.sby--; + } + key.keybuffer=ed.sb[ed.pagey+ed.sby]; + ed.sbx = utf8::unchecked::distance(ed.sb[ed.pagey+ed.sby].begin(), ed.sb[ed.pagey+ed.sby].end()); + music.playef(11); + } + } + } + else if(ed.scripthelppage==1) + { + //Script editor! + if (key.isDown(27)) + { + ed.scripthelppage=0; + game.jumpheld = true; + //save the script for use again! + ed.addhook(ed.sbscript); + } + + if(ed.keydelay>0) ed.keydelay--; + + if(up_pressed && ed.keydelay<=0) + { + ed.keydelay=6; + ed.sby--; + if(ed.sby<=5) + { + if(ed.pagey>0) + { + ed.pagey--; + ed.sby++; + } + else + { + if(ed.sby<0) ed.sby=0; + } + } + key.keybuffer=ed.sb[ed.pagey+ed.sby]; + } + + if(down_pressed && ed.keydelay<=0) + { + ed.keydelay=6; + if(ed.sby+ed.pagey<(int)ed.sb.size()-1) + { + ed.sby++; + if(ed.sby>=20) + { + ed.pagey++; + ed.sby--; + } + } + key.keybuffer=ed.sb[ed.pagey+ed.sby]; + } + + if(key.linealreadyemptykludge) + { + ed.keydelay=6; + key.linealreadyemptykludge=false; + } + + if(key.pressedbackspace && ed.sb[ed.pagey+ed.sby]=="" && ed.keydelay<=0) + { + //Remove this line completely + ed.removeline(ed.pagey+ed.sby); + ed.sby--; + if(ed.sby<=5) + { + if(ed.pagey>0) + { + ed.pagey--; + ed.sby++; + } + else + { + if(ed.sby<0) ed.sby=0; + } + } + key.keybuffer=ed.sb[ed.pagey+ed.sby]; + ed.keydelay=6; + } + + /* Remove all pipes, they are the line separator in the XML + * When this loop reaches the end, it wraps to SIZE_MAX; SIZE_MAX + 1 is 0 */ + {size_t i; for (i = key.keybuffer.length() - 1; i + 1 > 0; --i) + { + if (key.keybuffer[i] == '|') + { + key.keybuffer.erase(key.keybuffer.begin() + i); + } + }} + + ed.sb[ed.pagey+ed.sby]=key.keybuffer; + ed.sbx = utf8::unchecked::distance(ed.sb[ed.pagey+ed.sby].begin(), ed.sb[ed.pagey+ed.sby].end()); + + if(!game.press_map && !key.isDown(27)) game.mapheld=false; + if (!game.mapheld) + { + if(game.press_map) + { + game.mapheld=true; + //Continue to next line + if(ed.sby+ed.pagey>=(int)ed.sb.size()) //we're on the last line + { + ed.sby++; + if(ed.sby>=20) + { + ed.pagey++; + ed.sby--; + } + key.keybuffer=ed.sb[ed.pagey+ed.sby]; + ed.sbx = utf8::unchecked::distance(ed.sb[ed.pagey+ed.sby].begin(), ed.sb[ed.pagey+ed.sby].end()); + } + else + { + //We're not, insert a line instead + ed.sby++; + if(ed.sby>=20) + { + ed.pagey++; + ed.sby--; + } + ed.insertline(ed.sby+ed.pagey); + key.keybuffer=""; + ed.sbx = 0; + } + } + } + } + } + else if (ed.textmod) + { + *ed.textptr = key.keybuffer; + + if (!game.press_map && !key.isDown(27)) + { + game.mapheld = false; + } + if (!game.mapheld && game.press_map) + { + game.mapheld = true; + key.disabletextentry(); + switch (ed.textmod) + { + case TEXT_GOTOROOM: + { + char coord_x[16]; + char coord_y[16]; + + const char* comma = SDL_strchr(key.keybuffer.c_str(), ','); + + bool valid_input = comma != NULL; + + if (valid_input) + { + SDL_strlcpy( + coord_x, + key.keybuffer.c_str(), + VVV_min(comma - key.keybuffer.c_str() + 1, sizeof(coord_x)) + ); + SDL_strlcpy(coord_y, &comma[1], sizeof(coord_y)); + + valid_input = is_number(coord_x) && is_number(coord_y); + } + + if (!valid_input) + { + ed.note = "[ ERROR: Invalid format ]"; + ed.notedelay = 45; + break; + } + + ed.levx = clamp(help.Int(coord_x) - 1, 0, ed.mapwidth - 1); + ed.levy = clamp(help.Int(coord_y) - 1, 0, ed.mapheight - 1); + graphics.backgrounddrawn = false; + break; + } + case TEXT_LOAD: + { + std::string loadstring = ed.filename + ".vvvvvv"; + if (ed.load(loadstring)) + { + // don't use filename, it has the full path + char buffer[64]; + SDL_snprintf(buffer, sizeof(buffer), "[ Loaded map: %s.vvvvvv ]", ed.filename.c_str()); + ed.note = buffer; + } + else + { + ed.note = "[ ERROR: Could not load level ]"; + } + ed.notedelay = 45; + break; + } + case TEXT_SAVE: + { + std::string savestring = ed.filename + ".vvvvvv"; + if (ed.save(savestring)) + { + char buffer[64]; + SDL_snprintf(buffer, sizeof(buffer), "[ Saved map: %s.vvvvvv ]", ed.filename.c_str()); + ed.note = buffer; + } + else + { + ed.note = "[ ERROR: Could not save level! ]"; + ed.saveandquit = false; + } + ed.notedelay = 45; + + if (ed.saveandquit) + { + graphics.fademode = 2; // quit editor + } + break; + } + case TEXT_SCRIPT: + ed.clearscriptbuffer(); + if (!ed.checkhook(key.keybuffer)) + { + ed.addhook(key.keybuffer); + } + break; + default: + break; + } + + ed.shiftmenu = false; + ed.shiftkey = false; + ed.textmod = TEXT_NONE; + } + } + else if (key.textentry()) + { + if(ed.titlemod) + { + EditorData::GetInstance().title=key.keybuffer; + } + else if(ed.creatormod) + { + EditorData::GetInstance().creator=key.keybuffer; + } + else if(ed.websitemod) + { + ed.website=key.keybuffer; + } + else if(ed.desc1mod) + { + ed.Desc1=key.keybuffer; + } + else if(ed.desc2mod) + { + ed.Desc2=key.keybuffer; + } + else if(ed.desc3mod) + { + ed.Desc3=key.keybuffer; + } + + if(!game.press_map && !key.isDown(27)) game.mapheld=false; + if (!game.mapheld) + { + if(game.press_map) + { + game.mapheld=true; + if(ed.titlemod) + { + EditorData::GetInstance().title=key.keybuffer; + ed.titlemod=false; + } + else if(ed.creatormod) + { + EditorData::GetInstance().creator=key.keybuffer; + ed.creatormod=false; + } + else if(ed.websitemod) + { + ed.website=key.keybuffer; + ed.websitemod=false; + } + else if(ed.desc1mod) + { + ed.Desc1=key.keybuffer; + } + else if(ed.desc2mod) + { + ed.Desc2=key.keybuffer; + } + else if(ed.desc3mod) + { + ed.Desc3=key.keybuffer; + ed.desc3mod=false; + } + key.disabletextentry(); + + if(ed.desc1mod) + { + ed.desc1mod=false; + + ed.desc2mod=true; + key.enabletextentry(); + key.keybuffer=ed.Desc2; + } + else if(ed.desc2mod) + { + ed.desc2mod=false; + + ed.desc3mod=true; + key.enabletextentry(); + key.keybuffer=ed.Desc3; + } + music.playef(11); + } + } + } + else + { + if(ed.settingsmod) + { + if (!game.press_action && !game.press_left && !game.press_right + && !up_pressed && !down_pressed) game.jumpheld = false; + if (!game.jumpheld) + { + if (game.press_action || game.press_left || game.press_right || game.press_map + || up_pressed || down_pressed) + { + game.jumpheld = true; + } + + if(game.menustart) + { + if (game.press_left || up_pressed) + { + game.currentmenuoption--; + } + else if (game.press_right || down_pressed) + { + game.currentmenuoption++; + } + } + + if (game.currentmenuoption < 0) game.currentmenuoption = game.menuoptions.size()-1; + if (game.currentmenuoption >= (int) game.menuoptions.size() ) game.currentmenuoption = 0; + + if (game.press_action) + { + editormenuactionpress(); + } + } + } + else if (ed.keydelay > 0) + { + ed.keydelay--; + } + else if (key.keymap[SDLK_LCTRL] || key.keymap[SDLK_RCTRL]) + { + // Ctrl modifiers + int numtiles; + if (ed.getroomprop(ed.levx, ed.levy)->tileset == 0) + { + numtiles = (((int) graphics.tiles.size()) / 40) * 40; + } + else + { + numtiles = (((int) graphics.tiles2.size()) / 40) * 40; + } + ed.dmtileeditor=10; + if(left_pressed) + { + ed.dmtile--; + ed.keydelay=3; + if(ed.dmtile<0) ed.dmtile+=numtiles; + } + else if(right_pressed) + { + ed.dmtile++; + ed.keydelay=3; + + if(ed.dmtile>=numtiles) ed.dmtile-=numtiles; + } + if(up_pressed) + { + ed.dmtile-=40; + ed.keydelay=3; + if(ed.dmtile<0) ed.dmtile+=numtiles; + } + else if(down_pressed) + { + ed.dmtile+=40; + ed.keydelay=3; + + if(ed.dmtile>=numtiles) ed.dmtile-=numtiles; + } + } + else if (key.keymap[SDLK_LSHIFT] || key.keymap[SDLK_RSHIFT]) + { + // Shift modifiers + if (key.keymap[SDLK_F1]) + { + ed.switch_tileset(true); + graphics.backgrounddrawn = false; + ed.keydelay = 6; + } + if (key.keymap[SDLK_F2]) + { + ed.switch_tilecol(true); + graphics.backgrounddrawn = false; + ed.keydelay = 6; + } + if (key.keymap[SDLK_F3]) + { + ed.switch_enemy(true); + ed.keydelay=6; + } + if (key.keymap[SDLK_w]) + { + ed.switch_warpdir(true); + graphics.backgrounddrawn = false; + ed.keydelay = 6; + } + + if (up_pressed || down_pressed || left_pressed || right_pressed) + { + ed.keydelay=6; + if(up_pressed) + { + ed.mapheight--; + } + else if(down_pressed) + { + ed.mapheight++; + } + else if(left_pressed) + { + ed.mapwidth--; + } + else if(right_pressed) + { + ed.mapwidth++; + } + + if(ed.mapwidth<1) ed.mapwidth=1; + if(ed.mapheight<1) ed.mapheight=1; + if(ed.mapwidth>=ed.maxwidth) ed.mapwidth=ed.maxwidth; + if(ed.mapheight>=ed.maxheight) ed.mapheight=ed.maxheight; + ed.note = "Mapsize is now [" + help.String(ed.mapwidth) + "," + help.String(ed.mapheight) + "]"; + ed.notedelay=45; + } + + if(!ed.shiftkey) + { + if(ed.shiftmenu) + { + ed.shiftmenu=false; + } + else + { + ed.shiftmenu=true; + } + } + ed.shiftkey=true; + } + else + { + // No modifiers + ed.shiftkey=false; + if(key.keymap[SDLK_F1]) + { + ed.switch_tileset(false); + graphics.backgrounddrawn = false; + ed.keydelay = 6; + } + if(key.keymap[SDLK_F2]) + { + ed.switch_tilecol(false); + graphics.backgrounddrawn = false; + ed.keydelay = 6; + } + if(key.keymap[SDLK_F3]) + { + ed.switch_enemy(false); + ed.keydelay=6; + } + if(key.keymap[SDLK_F4]) + { + ed.keydelay=6; + ed.boundarytype=1; + ed.boundarymod=1; + } + if(key.keymap[SDLK_F5]) + { + ed.keydelay=6; + ed.boundarytype=2; + ed.boundarymod=1; + } + if(key.keymap[SDLK_F10]) + { + if(ed.getroomprop(ed.levx, ed.levy)->directmode==1) + { + ed.setroomdirectmode(ed.levx, ed.levy, 0); + ed.note="Direct Mode Disabled"; + /* Kludge fix for rainbow BG here... */ + if (ed.getroomprop(ed.levx, ed.levy)->tileset == 2 + && ed.getroomprop(ed.levx, ed.levy)->tilecol == 6) + { + ed.setroomtilecol(ed.levx, ed.levy, 0); + } + } + else + { + ed.setroomdirectmode(ed.levx, ed.levy, 1); + ed.note="Direct Mode Enabled"; + } + graphics.backgrounddrawn=false; + + ed.notedelay=45; + ed.updatetiles=true; + ed.keydelay=6; + } + if(key.keymap[SDLK_1]) ed.drawmode=0; + if(key.keymap[SDLK_2]) ed.drawmode=1; + if(key.keymap[SDLK_3]) ed.drawmode=2; + if(key.keymap[SDLK_4]) ed.drawmode=3; + if(key.keymap[SDLK_5]) ed.drawmode=4; + if(key.keymap[SDLK_6]) ed.drawmode=5; + if(key.keymap[SDLK_7]) ed.drawmode=6; + if(key.keymap[SDLK_8]) ed.drawmode=7; + if(key.keymap[SDLK_9]) ed.drawmode=8; + if(key.keymap[SDLK_0]) ed.drawmode=9; + if(key.keymap[SDLK_r]) ed.drawmode=10; + if(key.keymap[SDLK_t]) ed.drawmode=11; + if(key.keymap[SDLK_y]) ed.drawmode=12; + if(key.keymap[SDLK_u]) ed.drawmode=13; + if(key.keymap[SDLK_i]) ed.drawmode=14; + if(key.keymap[SDLK_o]) ed.drawmode=15; + if(key.keymap[SDLK_p]) ed.drawmode=16; + + if(key.keymap[SDLK_w]) + { + ed.switch_warpdir(false); + graphics.backgrounddrawn = false; + ed.keydelay = 6; + } + if(key.keymap[SDLK_e]) + { + ed.keydelay = 6; + ed.getlin(TEXT_ROOMNAME, "Enter new room name:", const_cast(&(ed.getroomprop(ed.levx, ed.levy)->roomname))); + game.mapheld=true; + } + if (key.keymap[SDLK_g]) + { + ed.keydelay = 6; + ed.getlin(TEXT_GOTOROOM, "Enter room coordinates x,y:", NULL); + game.mapheld=true; + } + + //Save and load + if(key.keymap[SDLK_s]) + { + ed.keydelay = 6; + ed.getlin(TEXT_SAVE, "Enter map filename to save map as:", &(ed.filename)); + game.mapheld=true; + } + + if(key.keymap[SDLK_l]) + { + ed.keydelay = 6; + ed.getlin(TEXT_LOAD, "Enter map filename to load:", &(ed.filename)); + game.mapheld=true; + } + + if(!game.press_map) game.mapheld=false; + if (!game.mapheld) + { + if(game.press_map) + { + game.mapheld=true; + + //Ok! Scan the room for the closest checkpoint + int testeditor=-1; + int startpoint=0; + //First up; is there a start point on this screen? + for(size_t i=0; i16) ed.drawmode=0; + if(ed.drawmode>9) + { + if(ed.spacemod) ed.spacemenu=1; + } + else + { + if(ed.spacemod) ed.spacemenu=0; + } + + if(up_pressed) + { + ed.keydelay=6; + graphics.backgrounddrawn=false; + ed.levy--; + ed.updatetiles=true; + ed.changeroom=true; + } + else if(down_pressed) + { + ed.keydelay=6; + graphics.backgrounddrawn=false; + ed.levy++; + ed.updatetiles=true; + ed.changeroom=true; + } + else if(left_pressed) + { + ed.keydelay=6; + graphics.backgrounddrawn=false; + ed.levx--; + ed.updatetiles=true; + ed.changeroom=true; + } + else if(right_pressed) + { + ed.keydelay=6; + graphics.backgrounddrawn=false; + ed.levx++; + ed.updatetiles=true; + ed.changeroom=true; + } + + if(ed.levx<0) ed.levx+=ed.mapwidth; + if(ed.levx>= ed.mapwidth) ed.levx-=ed.mapwidth; + if(ed.levy<0) ed.levy+=ed.mapheight; + if(ed.levy>=ed.mapheight) ed.levy-=ed.mapheight; + if(key.keymap[SDLK_SPACE]) + { + ed.spacemod = !ed.spacemod; + ed.keydelay=6; + } + } + + if(!ed.settingsmod) + { + if(ed.boundarymod>0) + { + if(key.leftbutton) + { + if(ed.lclickdelay==0) + { + if(ed.boundarymod==1) + { + ed.lclickdelay=1; + ed.boundx1=(ed.tilex*8); + ed.boundy1=(ed.tiley*8); + ed.boundarymod=2; + } + else if(ed.boundarymod==2) + { + if((ed.tilex*8)+8>=ed.boundx1 && (ed.tiley*8)+8>=ed.boundy1) + { + ed.boundx2=(ed.tilex*8)+8; + ed.boundy2=(ed.tiley*8)+8; + } + else + { + ed.boundx2=ed.boundx1+8; + ed.boundy2=ed.boundy1+8; + } + if(ed.boundarytype==0) + { + //Script trigger + ed.lclickdelay=1; + ed.textent=edentity.size(); + addedentity((ed.boundx1/8)+(ed.levx*40),(ed.boundy1/8)+ (ed.levy*30),19, + (ed.boundx2-ed.boundx1)/8, (ed.boundy2-ed.boundy1)/8); + ed.getlin(TEXT_SCRIPT, "Enter script name:", &(edentity[ed.textent].scriptname)); + ed.lclickdelay=1; + } + else if(ed.boundarytype==1) + { + //Enemy bounds + ed.setroomenemyx1(ed.levx, ed.levy, ed.boundx1); + ed.setroomenemyy1(ed.levx, ed.levy, ed.boundy1); + ed.setroomenemyx2(ed.levx, ed.levy, ed.boundx2); + ed.setroomenemyy2(ed.levx, ed.levy, ed.boundy2); + } + else if(ed.boundarytype==2) + { + //Platform bounds + ed.setroomplatx1(ed.levx, ed.levy, ed.boundx1); + ed.setroomplaty1(ed.levx, ed.levy, ed.boundy1); + ed.setroomplatx2(ed.levx, ed.levy, ed.boundx2); + ed.setroomplaty2(ed.levx, ed.levy, ed.boundy2); + } + else if(ed.boundarytype==3) + { + //Copy + } + ed.boundarymod=0; + ed.lclickdelay=1; + } + } + } + else + { + ed.lclickdelay=0; + } + if(key.rightbutton) + { + ed.boundarymod=0; + } + } + else if(ed.warpmod) + { + //Placing warp token + if(key.leftbutton) + { + if(ed.lclickdelay==0) + { + if(ed.free(ed.tilex, ed.tiley)==0) + { + edentity[ed.warpent].p1=ed.tilex+(ed.levx*40); + edentity[ed.warpent].p2=ed.tiley+(ed.levy*30); + ed.warpmod=false; + ed.warpent=-1; + ed.lclickdelay=1; + } + } + } + else + { + ed.lclickdelay=0; + } + if(key.rightbutton) + { + removeedentity(ed.warpent); + ed.warpmod=false; + ed.warpent=-1; + } + } + else + { + //Mouse input + if(key.leftbutton) + { + if(ed.lclickdelay==0) + { + //Depending on current mode, place something + if(ed.drawmode==0) + { + //place tiles + //Are we in direct mode? + if(ed.getroomprop(ed.levx, ed.levy)->directmode>=1) + { + if(ed.bmod) + { + for(int i=0; i<30; i++) + { + ed.placetilelocal(ed.tilex, i, ed.dmtile); + } + } + else if(ed.hmod) + { + for(int i=0; i<40; i++) + { + ed.placetilelocal(i, ed.tiley, ed.dmtile); + } + } + else if(ed.vmod) + { + for(int j=-4; j<5; j++) + { + for(int i=-4; i<5; i++) + { + ed.placetilelocal(ed.tilex+i, ed.tiley+j, ed.dmtile); + } + } + } + else if(ed.cmod) + { + for(int j=-3; j<4; j++) + { + for(int i=-3; i<4; i++) + { + ed.placetilelocal(ed.tilex+i, ed.tiley+j, ed.dmtile); + } + } + } + else if(ed.xmod) + { + for(int j=-2; j<3; j++) + { + for(int i=-2; i<3; i++) + { + ed.placetilelocal(ed.tilex+i, ed.tiley+j, ed.dmtile); + } + } + } + else if(ed.zmod) + { + for(int j=-1; j<2; j++) + { + for(int i=-1; i<2; i++) + { + ed.placetilelocal(ed.tilex+i, ed.tiley+j, ed.dmtile); + } + } + } + else + { + ed.placetilelocal(ed.tilex, ed.tiley, ed.dmtile); + } + } + else + { + if(ed.bmod) + { + for(int i=0; i<30; i++) + { + ed.placetilelocal(ed.tilex, i, 80); + } + } + else if(ed.hmod) + { + for(int i=0; i<40; i++) + { + ed.placetilelocal(i, ed.tiley, 80); + } + } + else if(ed.vmod) + { + for(int j=-4; j<5; j++) + { + for(int i=-4; i<5; i++) + { + ed.placetilelocal(ed.tilex+i, ed.tiley+j, 80); + } + } + } + else if(ed.cmod) + { + for(int j=-3; j<4; j++) + { + for(int i=-3; i<4; i++) + { + ed.placetilelocal(ed.tilex+i, ed.tiley+j, 80); + } + } + } + else if(ed.xmod) + { + for(int j=-2; j<3; j++) + { + for(int i=-2; i<3; i++) + { + ed.placetilelocal(ed.tilex+i, ed.tiley+j, 80); + } + } + } + else if(ed.zmod) + { + for(int j=-1; j<2; j++) + { + for(int i=-1; i<2; i++) + { + ed.placetilelocal(ed.tilex+i, ed.tiley+j, 80); + } + } + } + else + { + ed.placetilelocal(ed.tilex, ed.tiley, 80); + } + } + } + else if(ed.drawmode==1) + { + //place background tiles + if(ed.bmod) + { + for(int i=0; i<30; i++) + { + ed.placetilelocal(ed.tilex, i, 2); + } + } + else if(ed.hmod) + { + for(int i=0; i<40; i++) + { + ed.placetilelocal(i, ed.tiley, 2); + } + } + else if(ed.vmod) + { + for(int j=-4; j<5; j++) + { + for(int i=-4; i<5; i++) + { + ed.placetilelocal(ed.tilex+i, ed.tiley+j, 2); + } + } + } + else if(ed.cmod) + { + for(int j=-3; j<4; j++) + { + for(int i=-3; i<4; i++) + { + ed.placetilelocal(ed.tilex+i, ed.tiley+j, 2); + } + } + } + else if(ed.xmod) + { + for(int j=-2; j<3; j++) + { + for(int i=-2; i<3; i++) + { + ed.placetilelocal(ed.tilex+i, ed.tiley+j, 2); + } + } + } + else if(ed.zmod) + { + for(int j=-1; j<2; j++) + { + for(int i=-1; i<2; i++) + { + ed.placetilelocal(ed.tilex+i, ed.tiley+j, 2); + } + } + } + else + { + ed.placetilelocal(ed.tilex, ed.tiley, 2); + } + } + else if(ed.drawmode==2) + { + //place spikes + ed.placetilelocal(ed.tilex, ed.tiley, 8); + } + + int tmp=edentat(ed.tilex+ (ed.levx*40),ed.tiley+ (ed.levy*30)); + if(tmp==-1) + { + //Room text and script triggers can be placed in walls + if(ed.drawmode==10) + { + ed.lclickdelay=1; + ed.textent=edentity.size(); + addedentity(ed.tilex+ (ed.levx*40),ed.tiley+ (ed.levy*30),17); + ed.getlin(TEXT_ROOMTEXT, "Enter roomtext:", &(edentity[ed.textent].scriptname)); + } + else if(ed.drawmode==12) //Script Trigger + { + ed.boundarytype=0; + ed.boundx1=ed.tilex*8; + ed.boundy1=ed.tiley*8; + ed.boundarymod=2; + ed.lclickdelay=1; + } + } + if(tmp==-1 && ed.free(ed.tilex,ed.tiley)==0) + { + if(ed.drawmode==3) + { + if(ed.numtrinkets()<100) + { + addedentity(ed.tilex+ (ed.levx*40),ed.tiley+ (ed.levy*30),9); + ed.lclickdelay=1; + } + else + { + ed.note="ERROR: Max number of trinkets is 100"; + ed.notedelay=45; + } + } + else if(ed.drawmode==4) + { + addedentity(ed.tilex+ (ed.levx*40),ed.tiley+ (ed.levy*30),10, 1); + ed.lclickdelay=1; + } + else if(ed.drawmode==5) + { + addedentity(ed.tilex+ (ed.levx*40),ed.tiley+ (ed.levy*30),3); + ed.lclickdelay=1; + } + else if(ed.drawmode==6) + { + addedentity(ed.tilex+ (ed.levx*40),ed.tiley+ (ed.levy*30),2,5); + ed.lclickdelay=1; + } + else if(ed.drawmode==7) + { + addedentity(ed.tilex+ (ed.levx*40),ed.tiley+ (ed.levy*30),2,0); + ed.lclickdelay=1; + } + else if(ed.drawmode==8) + { + addedentity(ed.tilex+ (ed.levx*40),ed.tiley+ (ed.levy*30),1,0); + ed.lclickdelay=1; + } + else if(ed.drawmode==9) + { + addedentity(ed.tilex+ (ed.levx*40),ed.tiley+ (ed.levy*30),11,0); + ed.lclickdelay=1; + } + else if(ed.drawmode==11) + { + ed.lclickdelay=1; + ed.textent=edentity.size(); + addedentity(ed.tilex+(ed.levx*40),ed.tiley+ (ed.levy*30),18,0); + ed.getlin(TEXT_SCRIPT, "Enter script name:", &(edentity[ed.textent].scriptname)); + } + else if(ed.drawmode==13) + { + ed.warpmod=true; + ed.warpent=edentity.size(); + addedentity(ed.tilex+ (ed.levx*40),ed.tiley+ (ed.levy*30),13); + ed.lclickdelay=1; + } + else if(ed.drawmode==14) + { + //Warp lines + if(ed.tilex==0) + { + addedentity(ed.tilex+ (ed.levx*40),ed.tiley+ (ed.levy*30),50,0); + } + else if(ed.tilex==39) + { + addedentity(ed.tilex+ (ed.levx*40),ed.tiley+ (ed.levy*30),50,1); + } + else if(ed.tiley==0) + { + addedentity(ed.tilex+ (ed.levx*40),ed.tiley+ (ed.levy*30),50,2); + } + else if(ed.tiley==29) + { + addedentity(ed.tilex+ (ed.levx*40),ed.tiley+ (ed.levy*30),50,3); + } + else + { + ed.note="ERROR: Warp lines must be on edges"; + ed.notedelay=45; + } + ed.lclickdelay=1; + } + else if(ed.drawmode==15) //Crewmate + { + if(ed.numcrewmates()<100) + { + addedentity(ed.tilex+ (ed.levx*40),ed.tiley+ (ed.levy*30),15,int(fRandom() * 6)); + ed.lclickdelay=1; + } + else + { + ed.note="ERROR: Max number of crewmates is 100"; + ed.notedelay=45; + } + } + else if(ed.drawmode==16) //Start Point + { + //If there is another start point, destroy it + for(size_t i=0; i=5) + { + edentity[tmp].p1=(edentity[tmp].p1+1)%9; + if(edentity[tmp].p1<5) edentity[tmp].p1=5; + } + else + { + edentity[tmp].p1=(edentity[tmp].p1+1)%4; + } + ed.lclickdelay=1; + } + else if(edentity[tmp].t==10) + { + // If it's not textured as a checkpoint, leave it alone + if (edentity[tmp].p1 == 0 || edentity[tmp].p1 == 1) + { + edentity[tmp].p1=(edentity[tmp].p1+1)%2; + } + ed.lclickdelay=1; + } + else if(edentity[tmp].t==11) + { + edentity[tmp].p1=(edentity[tmp].p1+1)%2; + ed.lclickdelay=1; + } + else if(edentity[tmp].t==15) + { + edentity[tmp].p1=(edentity[tmp].p1+1)%6; + ed.lclickdelay=1; + } + else if(edentity[tmp].t==16) + { + edentity[tmp].p1=(edentity[tmp].p1+1)%2; + ed.lclickdelay=1; + } + else if(edentity[tmp].t==17) + { + ed.getlin(TEXT_ROOMTEXT, "Enter roomtext:", &(edentity[tmp].scriptname)); + ed.textent=tmp; + ed.lclickdelay=1; + } + else if(edentity[tmp].t==18 || edentity[tmp].t==19) + { + ed.lclickdelay=1; + ed.textent=tmp; + ed.getlin(TEXT_SCRIPT, "Enter script name:", &(edentity[ed.textent].scriptname)); + if (edentity[tmp].t == 18 + && (edentity[tmp].p1 == 0 || edentity[tmp].p1 == 1)) + { + // Flip the terminal, but if it's not textured as a terminal leave it alone + edentity[tmp].p1 = (edentity[tmp].p1 + 1) % 2; + } + } + } + } + else + { + ed.lclickdelay=0; + } + + if(key.rightbutton) + { + //place tiles + if(ed.drawmode < 2) { + if(ed.bmod) + { + for(int i=0; i<30; i++) + { + ed.placetilelocal(ed.tilex, i, 0); + } + } + else if(ed.hmod) + { + for(int i=0; i<40; i++) + { + ed.placetilelocal(i, ed.tiley, 0); + } + } + else if(ed.vmod) + { + for(int j=-4; j<5; j++) + { + for(int i=-4; i<5; i++) + { + ed.placetilelocal(ed.tilex+i, ed.tiley+j, 0); + } + } + } + else if(ed.cmod) + { + for(int j=-3; j<4; j++) + { + for(int i=-3; i<4; i++) + { + ed.placetilelocal(ed.tilex+i, ed.tiley+j, 0); + } + } + } + else if(ed.xmod) + { + for(int j=-2; j<3; j++) + { + for(int i=-2; i<3; i++) + { + ed.placetilelocal(ed.tilex+i, ed.tiley+j, 0); + } + } + } + else if(ed.zmod) + { + for(int j=-1; j<2; j++) + { + for(int i=-1; i<2; i++) + { + ed.placetilelocal(ed.tilex+i, ed.tiley+j, 0); + } + } + } + else + { + ed.placetilelocal(ed.tilex, ed.tiley, 0); + } + } + else + { + ed.placetilelocal(ed.tilex, ed.tiley, 0); + } + for(size_t i=0; idirectmode==0) + { + ed.updatetiles=false; + //Correctly set the tiles in the current room + switch(ed.getroomprop(ed.levx, ed.levy)->tileset) + { + case 0: //The Space Station + for(int j=0; j<30; j++) + { + for(int i=0; i<40; i++) + { + int temp=ed.gettile(ed.levx, ed.levy, i, j); + if(temp>=3 && temp<80) + { + //Fix spikes + ed.settile(ed.levx, ed.levy, i, j, ed.spikedir(i, j)); + } + else if(temp==2 || temp>=680) + { + //Fix background + ed.settile( + ed.levx, + ed.levy, + i, + j, + ed.backedgetile(i, j) + ed.backbase(ed.levx, ed.levy) + ); + } + else if(temp>0) + { + //Fix tiles + ed.settile( + ed.levx, + ed.levy, + i, + j, + ed.edgetile(i, j) + ed.base(ed.levx, ed.levy) + ); + } + } + } + break; + case 1: //Outside + for(int j=0; j<30; j++) + { + for(int i=0; i<40; i++) + { + int temp=ed.gettile(ed.levx, ed.levy, i, j); + if(temp>=3 && temp<80) + { + //Fix spikes + ed.settile(ed.levx, ed.levy, i, j, ed.spikedir(i, j)); + } + else if(temp==2 || temp>=680) + { + //Fix background + ed.settile( + ed.levx, + ed.levy, + i, + j, + ed.outsideedgetile(i, j) + ed.backbase(ed.levx, ed.levy) + ); + } + else if(temp>0) + { + //Fix tiles + ed.settile( + ed.levx, + ed.levy, + i, + j, + ed.edgetile(i, j) + ed.base(ed.levx, ed.levy) + ); + } + } + } + break; + case 2: //Lab + for(int j=0; j<30; j++) + { + for(int i=0; i<40; i++) + { + int temp=ed.gettile(ed.levx, ed.levy, i, j); + if(temp>=3 && temp<80) + { + //Fix spikes + ed.settile( + ed.levx, + ed.levy, + i, + j, + ed.labspikedir( + i, + j, + ed.getroomprop(ed.levx, ed.levy)->tilecol + ) + ); + } + else if(temp==2 || temp>=680) + { + //Fix background + ed.settile(ed.levx, ed.levy, i, j, 713); + } + else if(temp>0) + { + //Fix tiles + ed.settile( + ed.levx, + ed.levy, + i, + j, + ed.edgetile(i, j) + ed.base(ed.levx, ed.levy) + ); + } + } + } + break; + case 3: //Warp Zone/Intermission + for(int j=0; j<30; j++) + { + for(int i=0; i<40; i++) + { + int temp=ed.gettile(ed.levx, ed.levy, i, j); + if(temp>=3 && temp<80) + { + //Fix spikes + ed.settile(ed.levx, ed.levy, i, j, ed.spikedir(i, j)); + } + else if(temp==2 || temp>=680) + { + //Fix background + ed.settile(ed.levx, ed.levy, i, j, 713); + } + else if(temp>0) + { + //Fix tiles + ed.settile( + ed.levx, + ed.levy, + i, + j, + ed.edgetile(i, j) + ed.base(ed.levx, ed.levy) + ); + } + } + } + break; + case 4: //The ship + for(int j=0; j<30; j++) + { + for(int i=0; i<40; i++) + { + int temp=ed.gettile(ed.levx, ed.levy, i, j); + if(temp>=3 && temp<80) + { + //Fix spikes + ed.settile(ed.levx, ed.levy, i, j, ed.spikedir(i, j)); + } + else if(temp==2 || temp>=680) + { + //Fix background + ed.settile( + ed.levx, + ed.levy, + i, + j, + ed.backedgetile(i, j) + ed.backbase(ed.levx, ed.levy) + ); + } + else if(temp>0) + { + //Fix tiles + ed.settile( + ed.levx, + ed.levy, + i, + j, + ed.edgetile(i, j) + ed.base(ed.levx, ed.levy) + ); + } + } + } + break; + case 5: //The Tower + break; + case 6: //Custom Set 1 + break; + case 7: //Custom Set 2 + break; + case 8: //Custom Set 3 + break; + case 9: //Custom Set 4 + break; + } + } +} +#endif /* NO_EDITOR */ + +// Return a graphics-ready color based off of the given tileset and tilecol +// Much kudos to Dav999 for saving me a lot of work, because I stole these colors from const.lua in Ved! -Info Teddy +Uint32 editorclass::getonewaycol(const int rx, const int ry) +{ + const edlevelclass* const room = getroomprop(rx, ry); + switch (room->tileset) { + + case 0: // Space Station + switch (room->tilecol) { + case -1: + return graphics.getRGB(109, 109, 109); + case 0: + return graphics.getRGB(131, 141, 235); + case 1: + return graphics.getRGB(227, 140, 227); + case 2: + return graphics.getRGB(242, 126, 151); + case 3: + return graphics.getRGB(229, 235, 133); + case 4: + return graphics.getRGB(148, 238, 130); + case 5: + return graphics.getRGB(140, 165, 227); + case 6: + return graphics.getRGB(227, 140, 148); + case 7: + return graphics.getRGB(140, 173, 228); + case 8: + return graphics.getRGB(142, 235, 137); + case 9: + return graphics.getRGB(137, 235, 206); + case 10: + return graphics.getRGB(235, 139, 223); + case 11: + return graphics.getRGB(238, 130, 138); + case 12: + return graphics.getRGB(137, 235, 178); + case 13: + return graphics.getRGB(125, 205, 247); + case 14: + return graphics.getRGB(190, 137, 235); + case 15: + return graphics.getRGB(235, 137, 206); + case 16: + return graphics.getRGB(229, 247, 127); + case 17: + return graphics.getRGB(127, 200, 247); + case 18: + return graphics.getRGB(197, 137, 235); + case 19: + return graphics.getRGB(235, 131, 175); + case 20: + return graphics.getRGB(242, 210, 123); + case 21: + return graphics.getRGB(131, 235, 158); + case 22: + return graphics.getRGB(242, 126, 151); + case 23: + return graphics.getRGB(219, 243, 123); + case 24: + return graphics.getRGB(131, 234, 145); + case 25: + return graphics.getRGB(131, 199, 234); + case 26: + return graphics.getRGB(141, 131, 234); + case 27: + return graphics.getRGB(226, 140, 144); + case 28: + return graphics.getRGB(129, 236, 144); + case 29: + return graphics.getRGB(235, 231, 131); + case 30: + return graphics.getRGB(153, 235, 131); + case 31: + return graphics.getRGB(207, 131, 235); + } + break; + + case 1: // Outside + switch (room->tilecol) { + case 0: + return graphics.getRGB(57, 86, 140); + case 1: + return graphics.getRGB(156, 42, 42); + case 2: + return graphics.getRGB(42, 156, 155); + case 3: + return graphics.getRGB(125, 36, 162); + case 4: + return graphics.getRGB(191, 198, 0); + case 5: + return graphics.getRGB(0, 198, 126); + case 6: + return graphics.getRGB(224, 110, 177); + case 7: + return graphics.getRGB(255, 142, 87); + } + break; + + case 2: // Lab + switch (room->tilecol) { + case 0: + return graphics.getRGB(0, 165, 206); + case 1: + return graphics.getRGB(206, 5, 0); + case 2: + return graphics.getRGB(222, 0, 173); + case 3: + return graphics.getRGB(27, 67, 255); + case 4: + return graphics.getRGB(194, 206, 0); + case 5: + return graphics.getRGB(0, 206, 39); + case 6: + return graphics.getRGB(0, 165, 206); + } + break; + + case 3: // Warp Zone + switch (room->tilecol) { + case 0: + return graphics.getRGB(113, 178, 197); + case 1: + return graphics.getRGB(197, 113, 119); + case 2: + return graphics.getRGB(196, 113, 197); + case 3: + return graphics.getRGB(149, 113, 197); + case 4: + return graphics.getRGB(197, 182, 113); + case 5: + return graphics.getRGB(141, 197, 113); + case 6: + return graphics.getRGB(109, 109, 109); + } + break; + + case 4: // Ship + switch (room->tilecol) { + case 0: + return graphics.getRGB(0, 206, 39); + case 1: + return graphics.getRGB(0, 165, 206); + case 2: + return graphics.getRGB(194, 206, 0); + case 3: + return graphics.getRGB(206, 0, 160); + case 4: + return graphics.getRGB(27, 67, 255); + case 5: + return graphics.getRGB(206, 5, 0); + } + break; + + } + + // Uh, I guess return solid white + return graphics.getRGB(255, 255, 255); +} + +// This version detects the room automatically +Uint32 editorclass::getonewaycol(void) +{ + if (game.gamestate == EDITORMODE) + return getonewaycol(levx, levy); + else if (map.custommode) + return getonewaycol(game.roomx - 100, game.roomy - 100); + + // Uh, I guess return solid white + return graphics.getRGB(255, 255, 255); +} + +static bool inbounds(const edentities* entity) +{ + extern editorclass ed; + return entity->x >= 0 + && entity->y >= 0 + && entity->x < ed.mapwidth * 40 + && entity->y < ed.mapheight * 30; +} + +int editorclass::numtrinkets(void) +{ + int temp = 0; + for (size_t i = 0; i < edentity.size(); i++) + { + if (edentity[i].t == 9 && inbounds(&edentity[i])) + { + temp++; + } + } + return temp; +} + +int editorclass::numcrewmates(void) +{ + int temp = 0; + for (size_t i = 0; i < edentity.size(); i++) + { + if (edentity[i].t == 15 && inbounds(&edentity[i])) + { + temp++; + } + } + return temp; +} + +#endif /* NO_CUSTOM_LEVELS */ diff --git a/desktop_version/src/editor.h b/desktop_version/src/editor.h new file mode 100644 index 00000000..8de6c189 --- /dev/null +++ b/desktop_version/src/editor.h @@ -0,0 +1,326 @@ +#if !defined(NO_CUSTOM_LEVELS) + +#ifndef EDITOR_H +#define EDITOR_H + +#include +#include +#include + +// Text entry field type +enum textmode { + TEXT_NONE, + + // In-editor text fields + TEXT_LOAD, + TEXT_SAVE, + TEXT_ROOMNAME, + TEXT_SCRIPT, + TEXT_ROOMTEXT, + TEXT_GOTOROOM, + LAST_EDTEXT = TEXT_GOTOROOM, + + // Settings-mode text fields + TEXT_TITLE, + TEXT_DESC, + TEXT_WEBSITE, + TEXT_CREATOR, + NUM_TEXTMODES, + + // Text modes with an entity + FIRST_ENTTEXT = TEXT_SCRIPT, + LAST_ENTTEXT = TEXT_ROOMTEXT +}; + +class edentities{ +public: + int x, y, t; + //parameters + int p1, p2, p3, p4, p5, p6; + std::string scriptname; +}; + + +#define ROOM_PROPERTIES \ + FOREACH_PROP(tileset, int) \ + FOREACH_PROP(tilecol, int) \ + FOREACH_PROP(roomname, std::string) \ + FOREACH_PROP(warpdir, int) \ + FOREACH_PROP(platx1, int) \ + FOREACH_PROP(platy1, int) \ + FOREACH_PROP(platx2, int) \ + FOREACH_PROP(platy2, int) \ + FOREACH_PROP(platv, int) \ + FOREACH_PROP(enemyx1, int) \ + FOREACH_PROP(enemyy1, int) \ + FOREACH_PROP(enemyx2, int) \ + FOREACH_PROP(enemyy2, int) \ + FOREACH_PROP(enemytype, int) \ + FOREACH_PROP(directmode, int) + +class edlevelclass{ +public: + edlevelclass(void); +#define FOREACH_PROP(NAME, TYPE) TYPE NAME; + ROOM_PROPERTIES +#undef FOREACH_PROP +}; + +struct LevelMetaData +{ + std::string title; + std::string creator; + std::string Desc1; + std::string Desc2; + std::string Desc3; + std::string website; + std::string filename; + + std::string modifier; + std::string timeCreated; + std::string timeModified; + + int version; +}; + + +extern std::vector edentity; + +class EditorData +{ + public: + + static EditorData& GetInstance(void) + { + static EditorData instance; // Guaranteed to be destroyed. + // Instantiated on first use. + return instance; + } + + + std::string title; + std::string creator; + + std::string modifier; +}; + +struct GhostInfo { + int rx; // game.roomx-100 + int ry; // game.roomy-100 + int x; // .xp + int y; // .yp + int col; // .colour + Uint32 realcol; + int frame; // .drawframe +}; + +class editorclass{ + //Special class to handle ALL editor variables locally + public: + editorclass(void); + + std::string Desc1; + std::string Desc2; + std::string Desc3; + std::string website; + + std::vector ListOfMetaData; + + void loadZips(void); + void getDirectoryData(void); + bool getLevelMetaData(std::string& filename, LevelMetaData& _data ); + + void reset(void); + void getlin(const enum textmode mode, const std::string& prompt, std::string* ptr); + const int* loadlevel(int rxi, int ryi); + + int gettileidx( + const int rx, + const int ry, + const int x, + const int y + ); + void settile( + const int rx, + const int ry, + const int x, + const int y, + const int t + ); + int gettile( + const int rx, + const int ry, + const int x, + const int y + ); + int getabstile(const int x, const int y); + + int getroompropidx(const int rx, const int ry); + const edlevelclass* getroomprop(const int rx, const int ry); +#define FOREACH_PROP(NAME, TYPE) \ + void setroom##NAME(const int rx, const int ry, const TYPE NAME); + ROOM_PROPERTIES +#undef FOREACH_PROP + + void placetilelocal(int x, int y, int t); + + int getenemyframe(int t); + int base(int x, int y); + + int backbase(int x, int y); + + int at(int x, int y); + + int freewrap(int x, int y); + + int backonlyfree(int x, int y); + + int backfree(int x, int y); + + int spikefree(int x, int y); + int free(int x, int y); + int absfree(int x, int y); + + int match(int x, int y); + int outsidematch(int x, int y); + + int backmatch(int x, int y); + + void switch_tileset(const bool reversed); + void switch_tilecol(const bool reversed); + void clamp_tilecol(const int rx, const int ry, const bool wrap); + void switch_enemy(const bool reversed); + void switch_warpdir(const bool reversed); + + bool load(std::string& _path); + bool save(std::string& _path); + void generatecustomminimap(void); + int edgetile(int x, int y); + int outsideedgetile(int x, int y); + + int backedgetile(int x, int y); + + int labspikedir(int x, int y, int t); + int spikedir(int x, int y); + int findtrinket(int t); + int findcrewmate(int t); + int findwarptoken(int t); + void findstartpoint(void); + int getlevelcol(const int tileset, const int tilecol); + int getenemycol(int t); + int entcol; + Uint32 entcolreal; + + //Colouring stuff + int getwarpbackground(int rx, int ry); + + std::vector getLevelDirFileNames( ); + static const int maxwidth = 20, maxheight = 20; //Special; the physical max the engine allows + static const int numrooms = maxwidth * maxheight; + int contents[40 * 30 * numrooms]; + int vmult[30 * maxheight]; + int numtrinkets(void); + int numcrewmates(void); + edlevelclass level[numrooms]; //Maxwidth*maxheight + int kludgewarpdir[numrooms]; //Also maxwidth*maxheight + + int notedelay; + int oldnotedelay; + std::string note; + std::string keybuffer; + std::string filename; + std::string loaded_filepath; + + int drawmode; + int tilex, tiley; + int keydelay, lclickdelay; + bool savekey, loadkey; + int levx, levy; + int entframe, entframedelay; + + int scripttexttype; + std::string oldenttext; + + enum textmode textmod; // In text entry + std::string* textptr; // Pointer to text we're changing + std::string textdesc; // Description (for editor mode text fields) + union { + int desc; // Which description row we're changing + int textent; // Entity ID for text prompt + }; + bool xmod, zmod, cmod, vmod, bmod, hmod, spacemod, warpmod; + bool titlemod, creatormod, desc1mod, desc2mod, desc3mod, websitemod; + + int roomnamehide; + bool saveandquit; + bool shiftmenu, shiftkey; + int spacemenu; + bool settingsmod, settingskey; + int warpent; + bool updatetiles, changeroom; + int deletekeyheld; + + int boundarymod, boundarytype; + int boundx1, boundx2, boundy1, boundy2; + + int levmusic; + int mapwidth, mapheight; //Actual width and height of stage + + int version; + + //Script editor stuff + void removeline(int t); + void insertline(int t); + + bool scripteditmod; + int scripthelppage, scripthelppagedelay; + std::vector sb; + std::string sbscript; + int sbx, sby; + int pagey; + + //Functions for interfacing with the script: + void addhook(std::string t); + void removehook(std::string t); + void addhooktoscript(std::string t); + void removehookfromscript(std::string t); + void loadhookineditor(std::string t); + void clearscriptbuffer(void); + void gethooks(void); + bool checkhook(std::string t); + std::vector hooklist; + + int hookmenupage, hookmenu; + + //Direct Mode variables + int dmtile; + int dmtileeditor; + + Uint32 getonewaycol(const int rx, const int ry); + Uint32 getonewaycol(void); + bool onewaycol_override; + + int returneditoralpha; + int oldreturneditoralpha; + + std::vector ghosts; + int currentghosts; +}; + +#if !defined(NO_EDITOR) +void editorrender(void); + +void editorrenderfixed(void); + +void editorlogic(void); + +void editorinput(void); +#endif + +#ifndef ED_DEFINITION +extern editorclass ed; +#endif + +#endif /* EDITOR_H */ + +#endif /* NO_CUSTOM_LEVELS */ diff --git a/desktop_version/src/lodepng_wrapper.c b/desktop_version/src/lodepng_wrapper.c deleted file mode 100644 index a2cbb9b3..00000000 --- a/desktop_version/src/lodepng_wrapper.c +++ /dev/null @@ -1,2 +0,0 @@ -/* Workaround for being unable to rename lodepng.cpp to lodepng.c */ -#include "../../third_party/lodepng/lodepng.cpp" diff --git a/desktop_version/src/main.cpp b/desktop_version/src/main.cpp index 4b87dbff..a384d534 100644 --- a/desktop_version/src/main.cpp +++ b/desktop_version/src/main.cpp @@ -1,46 +1,34 @@ #include -#ifdef __EMSCRIPTEN__ -#include -#include -#endif +#include -#include "ButtonGlyphs.h" -#include "CustomLevels.h" #include "DeferCallbacks.h" -#include "Editor.h" +#include "editor.h" #include "Enums.h" #include "Entity.h" #include "Exit.h" #include "FileSystemUtils.h" -#include "Font.h" -#include "FontBidi.h" #include "Game.h" #include "Graphics.h" -#include "GraphicsUtil.h" #include "Input.h" -#include "InterimVersion.h" #include "KeyPoll.h" -#include "LevelDebugger.h" -#include "Localization.h" -#include "LocalizationStorage.h" #include "Logic.h" #include "Map.h" #include "Music.h" #include "Network.h" #include "preloader.h" -#include "ReleaseVersion.h" #include "Render.h" #include "RenderFixed.h" #include "Screen.h" #include "Script.h" +#include "SoundSystem.h" #include "UtilityClass.h" -#include "Vlogging.h" scriptclass script; -std::vector customentities; -customlevelclass cl; +#if !defined(NO_CUSTOM_LEVELS) +std::vector edentity; editorclass ed; +#endif UtilityClass help; Graphics graphics; @@ -58,19 +46,16 @@ static int savey = 0; static int saverx = 0; static int savery = 0; static int savegc = 0; -static int savemusic = -1; +static int savemusic = 0; static std::string playassets; static std::string playtestname; -static volatile Uint64 time_ = 0; -static volatile Uint64 timePrev = 0; +static volatile Uint32 time_ = 0; +static volatile Uint32 timePrev = 0; static volatile Uint32 accumulator = 0; - -#ifndef __EMSCRIPTEN__ -static volatile Uint64 f_time = 0; -static volatile Uint64 f_timePrev = 0; -#endif +static volatile Uint32 f_time = 0; +static volatile Uint32 f_timePrev = 0; enum FuncType { @@ -104,6 +89,9 @@ static void teleportermodeinput(void) } } +/* Only gets used in EDITORMODE. I assume the compiler will optimize this away + * if this is a NO_CUSTOM_LEVELS or NO_EDITOR build + */ static void flipmodeoff(void) { graphics.flipmode = false; @@ -155,7 +143,7 @@ static const inline struct ImplFunc* get_gamestate_funcs( FUNC_LIST_END FUNC_LIST_BEGIN(TELEPORTERMODE) - {Func_fixed, teleporterrenderfixed}, + {Func_fixed, maprenderfixed}, {Func_delta, teleporterrender}, {Func_input, teleportermodeinput}, {Func_fixed, maplogic}, @@ -169,19 +157,20 @@ static const inline struct ImplFunc* get_gamestate_funcs( FUNC_LIST_END FUNC_LIST_BEGIN(GAMECOMPLETE2) - {Func_fixed, gamecompleterenderfixed2}, {Func_delta, gamecompleterender2}, {Func_input, gamecompleteinput2}, {Func_fixed, gamecompletelogic2}, FUNC_LIST_END +#if !defined(NO_CUSTOM_LEVELS) && !defined(NO_EDITOR) FUNC_LIST_BEGIN(EDITORMODE) {Func_fixed, flipmodeoff}, {Func_input, editorinput}, - {Func_fixed, editorlogic}, {Func_fixed, editorrenderfixed}, {Func_delta, editorrender}, + {Func_fixed, editorlogic}, FUNC_LIST_END +#endif FUNC_LIST_BEGIN(PRELOADER) {Func_input, preloaderinput}, @@ -238,10 +227,6 @@ static void unfocused_run(void); static const struct ImplFunc unfocused_func_list[] = { { Func_input, /* we still need polling when unfocused */ - NULL - }, - { - Func_delta, unfocused_run } }; @@ -354,46 +339,10 @@ static void inline deltaloop(void); static void cleanup(void); -#ifdef __EMSCRIPTEN__ -static void emscriptenloop(void) -{ - timePrev = time_; - time_ = SDL_GetTicks64(); - deltaloop(); -} -#endif - -static void keep_console_open(const bool open_console) -{ - if (!open_console) - { - return; - } - - printf("Press ENTER to quit."); - - int c; - do - { - c = getchar(); - } - while (c != '\n' && c != EOF); -} - int main(int argc, char *argv[]) { char* baseDir = NULL; char* assetsPath = NULL; - char* langDir = NULL; - char* fontsDir = NULL; - bool seed_use_sdl_getticks = false; - bool open_console = false; - bool print_version = false; - bool print_addresses = false; - int invalid_arg = 0; - int invalid_partial_arg = 0; - - vlog_init(); for (int i = 1; i < argc; ++i) { @@ -405,18 +354,11 @@ int main(int argc, char *argv[]) } \ else \ { \ - invalid_partial_arg = i; \ + printf("%s option requires one argument.\n", argv[i]); \ + VVV_exit(1); \ } - if (ARG("-version")) - { - print_version = true; - } - else if (ARG("-addresses")) - { - print_addresses = true; - } - else if (ARG("-renderer")) + if (ARG("-renderer")) { ARG_INNER({ i++; @@ -437,20 +379,6 @@ int main(int argc, char *argv[]) assetsPath = argv[i]; }) } - else if (ARG("-langdir")) - { - ARG_INNER({ - i++; - langDir = argv[i]; - }) - } - else if (ARG("-fontsdir")) - { - ARG_INNER({ - i++; - fontsDir = argv[i]; - }) - } else if (ARG("-playing") || ARG("-p")) { ARG_INNER({ @@ -485,131 +413,18 @@ int main(int argc, char *argv[]) playassets = "levels/" + std::string(argv[i]) + ".vvvvvv"; }) } - else if (ARG("-leveldebugger")) - { - level_debugger::set_forced(); - } - else if (ARG("-nooutput")) - { - vlog_toggle_output(0); - } - else if (ARG("-forcecolor") || ARG("-forcecolour")) - { - vlog_toggle_color(1); - } - else if (ARG("-nocolor") || ARG("-nocolour")) - { - vlog_toggle_color(0); - } - else if (ARG("-debug")) - { - vlog_toggle_debug(1); - } - else if (ARG("-noinfo")) - { - vlog_toggle_info(0); - } - else if (ARG("-nowarn")) - { - vlog_toggle_warn(0); - } - else if (ARG("-noerror")) - { - vlog_toggle_error(0); - } - else if (ARG("-translator")) - { - loc::show_translator_menu = true; - } -#ifdef _WIN32 - else if (ARG("-console")) - { - open_console = true; - } -#endif - else if (ARG("-seed-use-sdl-getticks")) - { - seed_use_sdl_getticks = true; - } #undef ARG_INNER #undef ARG else { - invalid_arg = i; + printf("Error: invalid option: %s\n", argv[i]); + VVV_exit(1); } } -#if defined(ALWAYS_SHOW_TRANSLATOR_MENU) - loc::show_translator_menu = true; -#endif - -#ifdef _WIN32 - if (open_console) + if(!FILESYSTEM_init(argv[0], baseDir, assetsPath)) { - vlog_open_console(); - } -#endif - - if (invalid_arg > 0) - { - vlog_error("Error: invalid option: %s", argv[invalid_arg]); - keep_console_open(open_console); - VVV_exit(1); - } - else if (invalid_partial_arg > 0) - { - vlog_error("%s option requires one argument.", argv[invalid_partial_arg]); - keep_console_open(open_console); - VVV_exit(1); - } - - if (print_version) - { - /* Just print the version and exit. No vlogging. */ - puts( - "VVVVVV " RELEASE_VERSION -#ifdef MAKEANDPLAY - " [M&P]" -#endif - ); -#ifdef INTERIM_VERSION_EXISTS - puts(COMMIT_DATE); - puts(INTERIM_COMMIT); - puts(BRANCH_NAME); -#endif - keep_console_open(open_console); - VVV_exit(0); - } - else if (print_addresses) - { - printf("cl : %p\n", (void*) &cl); - printf("ed : %p\n", (void*) &ed); - printf("game : %p\n", (void*) &game); - printf("gameScreen : %p\n", (void*) &gameScreen); - printf("graphics : %p\n", (void*) &graphics); - printf("help : %p\n", (void*) &help); - printf("key : %p\n", (void*) &key); - printf("map : %p\n", (void*) &map); - printf("music : %p\n", (void*) &music); - printf("obj : %p\n", (void*) &obj); - printf("script : %p\n", (void*) &script); - - keep_console_open(open_console); - VVV_exit(0); - } - - SDL_SetHintWithPriority(SDL_HINT_IME_SHOW_UI, "1", SDL_HINT_OVERRIDE); - SDL_SetHintWithPriority(SDL_HINT_IME_SUPPORT_EXTENDED_TEXT, "1", SDL_HINT_OVERRIDE); - - /* We already do the button swapping in ButtonGlyphs, disable SDL's swapping */ - SDL_SetHintWithPriority(SDL_HINT_GAMECONTROLLER_USE_BUTTON_LABELS, "0", SDL_HINT_OVERRIDE); - - SDL_SetHintWithPriority(SDL_HINT_ORIENTATIONS, "LandscapeLeft LandscapeRight", SDL_HINT_OVERRIDE); - - if(!FILESYSTEM_init(argv[0], baseDir, assetsPath, langDir, fontsDir)) - { - vlog_error("Unable to initialize filesystem!"); - SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Error", "Unable to initialize filesystem!", NULL); + puts("Unable to initialize filesystem!"); VVV_exit(1); } @@ -626,40 +441,61 @@ int main(int argc, char *argv[]) NETWORK_init(); - vlog_info("\t\t"); - vlog_info("\t\t"); - vlog_info("\t\t VVVVVV"); - vlog_info("\t\t"); - vlog_info("\t\t"); - vlog_info("\t\t 8888888888888888 "); - vlog_info("\t\t88888888888888888888"); - vlog_info("\t\t888888 8888 88"); - vlog_info("\t\t888888 8888 88"); - vlog_info("\t\t88888888888888888888"); - vlog_info("\t\t88888888888888888888"); - vlog_info("\t\t888888 88"); - vlog_info("\t\t88888888 8888"); - vlog_info("\t\t 8888888888888888 "); - vlog_info("\t\t 88888888 "); - vlog_info("\t\t 8888888888888888 "); - vlog_info("\t\t88888888888888888888"); - vlog_info("\t\t88888888888888888888"); - vlog_info("\t\t88888888888888888888"); - vlog_info("\t\t8888 88888888 8888"); - vlog_info("\t\t8888 88888888 8888"); - vlog_info("\t\t 888888888888 "); - vlog_info("\t\t 8888 8888 "); - vlog_info("\t\t 888888 888888 "); - vlog_info("\t\t 888888 888888 "); - vlog_info("\t\t 888888 888888 "); - vlog_info("\t\t"); - vlog_info("\t\t"); + printf("\t\t\n"); + printf("\t\t\n"); + printf("\t\t VVVVVV\n"); + printf("\t\t\n"); + printf("\t\t\n"); + printf("\t\t 8888888888888888 \n"); + printf("\t\t88888888888888888888\n"); + printf("\t\t888888 8888 88\n"); + printf("\t\t888888 8888 88\n"); + printf("\t\t88888888888888888888\n"); + printf("\t\t88888888888888888888\n"); + printf("\t\t888888 88\n"); + printf("\t\t88888888 8888\n"); + printf("\t\t 8888888888888888 \n"); + printf("\t\t 88888888 \n"); + printf("\t\t 8888888888888888 \n"); + printf("\t\t88888888888888888888\n"); + printf("\t\t88888888888888888888\n"); + printf("\t\t88888888888888888888\n"); + printf("\t\t8888 88888888 8888\n"); + printf("\t\t8888 88888888 8888\n"); + printf("\t\t 888888888888 \n"); + printf("\t\t 8888 8888 \n"); + printf("\t\t 888888 888888 \n"); + printf("\t\t 888888 888888 \n"); + printf("\t\t 888888 888888 \n"); + printf("\t\t\n"); + printf("\t\t\n"); + + //Set up screen + + + + + // Load Ini + - // Set up screen graphics.init(); game.init(); - game.seed_use_sdl_getticks = seed_use_sdl_getticks; + + // This loads music too... + if (!graphics.reloadresources()) + { + /* Something wrong with the default assets? We can't use them to + * display the error message, and we have to bail. */ + SDL_ShowSimpleMessageBox( + SDL_MESSAGEBOX_ERROR, + graphics.error_title, + graphics.error, + NULL + ); + + VVV_exit(1); + } game.gamestate = PRELOADER; @@ -677,64 +513,19 @@ int main(int argc, char *argv[]) { // Prioritize unlock.vvv first (2.2 and below), // but settings have been migrated to settings.vvv (2.3 and up) - struct ScreenSettings screen_settings; - SDL_zero(screen_settings); - ScreenSettings_default(&screen_settings); + ScreenSettings screen_settings; game.loadstats(&screen_settings); game.loadsettings(&screen_settings); - gameScreen.init(&screen_settings); + gameScreen.init(screen_settings); } + graphics.screenbuffer = &gameScreen; - BUTTONGLYPHS_init(); - font::load_main(); - font::bidi_init(); - - // This loads music too... - if (!graphics.reloadresources()) - { - /* Something wrong with the default assets? We can't use them to - * display the error message, and we have to bail. */ - const char* message; - if (FILESYSTEM_levelDirHasError()) - { - message = FILESYSTEM_getLevelDirError(); - } - else - { - message = loc::gettext("Something went wrong, but we forgot the error message."); - } - SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Error", message, NULL); - - VVV_exit(1); - } - - loc::loadtext(false); - loc::loadlanguagelist(); - game.createmenu(Menu::mainmenu); - - graphics.create_buffers(); + graphics.create_buffers(gameScreen.GetFormat()); if (game.skipfakeload) game.gamestate = TITLEMODE; if (game.slowdown == 0) game.slowdown = 30; - int min_lang_set = loc::lang_set_current; - if (baseDir != NULL) - { - /* For people who manage tons of basedirs, never re-ask - * the language, except in the default basedir. */ - min_lang_set = 1; - } - - if (loc::lang_set < min_lang_set && !loc::languagelist.empty()) - { - loc::pre_title_lang_menu = true; - game.gamestate = TITLEMODE; - game.menustart = true; - game.createmenu(Menu::language); - game.currentmenuoption = loc::languagelist_curlang; - } - //Check to see if you've already unlocked some achievements here from before the update if (game.swnbestrank > 0){ if(game.swnbestrank >= 1) game.unlockAchievement("vvvvvvsupgrav5"); @@ -745,18 +536,9 @@ int main(int argc, char *argv[]) if(game.swnbestrank >= 6) game.unlockAchievement("vvvvvvsupgrav60"); } - if (game.unlock[UnlockTrophy_GAME_COMPLETE]) - { - game.unlockAchievement("vvvvvvgamecomplete"); - } - if (game.unlock[UnlockTrophy_FLIPMODE_COMPLETE]) - { - game.unlockAchievement("vvvvvvgamecompleteflip"); - } - if (game.unlock[UnlockTrophy_NODEATHMODE_COMPLETE]) - { - game.unlockAchievement("vvvvvvmaster"); - } + if(game.unlock[5]) game.unlockAchievement("vvvvvvgamecomplete"); + if(game.unlock[19]) game.unlockAchievement("vvvvvvgamecompleteflip"); + if(game.unlock[20]) game.unlockAchievement("vvvvvvmaster"); if (game.bestgamedeaths > -1) { if (game.bestgamedeaths <= 500) { @@ -773,33 +555,16 @@ int main(int argc, char *argv[]) } } - if (game.bestrank[TimeTrial_SPACESTATION1] >= 3) - { - game.unlockAchievement("vvvvvvtimetrial_station1_fixed"); - } - if (game.bestrank[TimeTrial_LABORATORY] >= 3) - { - game.unlockAchievement("vvvvvvtimetrial_lab_fixed"); - } - if (game.bestrank[TimeTrial_TOWER] >= 3) - { - game.unlockAchievement("vvvvvvtimetrial_tower_fixed"); - } - if (game.bestrank[TimeTrial_SPACESTATION2] >= 3) - { - game.unlockAchievement("vvvvvvtimetrial_station2_fixed"); - } - if (game.bestrank[TimeTrial_WARPZONE] >= 3) - { - game.unlockAchievement("vvvvvvtimetrial_warp_fixed"); - } - if (game.bestrank[TimeTrial_FINALLEVEL] >= 3) - { - game.unlockAchievement("vvvvvvtimetrial_final_fixed"); - } + if(game.bestrank[0]>=3) game.unlockAchievement("vvvvvvtimetrial_station1_fixed"); + if(game.bestrank[1]>=3) game.unlockAchievement("vvvvvvtimetrial_lab_fixed"); + if(game.bestrank[2]>=3) game.unlockAchievement("vvvvvvtimetrial_tower_fixed"); + if(game.bestrank[3]>=3) game.unlockAchievement("vvvvvvtimetrial_station2_fixed"); + if(game.bestrank[4]>=3) game.unlockAchievement("vvvvvvtimetrial_warp_fixed"); + if(game.bestrank[5]>=3) game.unlockAchievement("vvvvvvtimetrial_final_fixed"); obj.init(); +#if !defined(NO_CUSTOM_LEVELS) if (startinplaytest) { game.levelpage = 0; game.playcustomlevel = 0; @@ -807,36 +572,23 @@ int main(int argc, char *argv[]) game.menustart = true; LevelMetaData meta; - CliPlaytestArgs pt_args; - if (cl.getLevelMetaDataAndPlaytestArgs(playtestname, meta, &pt_args)) { - cl.ListOfMetaData.clear(); - cl.ListOfMetaData.push_back(meta); + if (ed.getLevelMetaData(playtestname, meta)) { + ed.ListOfMetaData.clear(); + ed.ListOfMetaData.push_back(meta); } else { - cl.loadZips(); - if (cl.getLevelMetaDataAndPlaytestArgs(playtestname, meta, &pt_args)) { - cl.ListOfMetaData.clear(); - cl.ListOfMetaData.push_back(meta); + ed.loadZips(); + if (ed.getLevelMetaData(playtestname, meta)) { + ed.ListOfMetaData.clear(); + ed.ListOfMetaData.push_back(meta); } else { - vlog_error("Level not found"); - keep_console_open(open_console); + printf("Level not found\n"); VVV_exit(1); } } - if (pt_args.valid) - { - savefileplaytest = true; - savex = pt_args.x; - savey = pt_args.y; - saverx = pt_args.rx; - savery = pt_args.ry; - savegc = pt_args.gc; - savemusic = pt_args.music; - } - game.loadcustomlevelstats(); - game.customleveltitle=cl.ListOfMetaData[game.playcustomlevel].title; - game.customlevelfilename=cl.ListOfMetaData[game.playcustomlevel].filename; + game.customleveltitle=ed.ListOfMetaData[game.playcustomlevel].title; + game.customlevelfilename=ed.ListOfMetaData[game.playcustomlevel].filename; if (savefileplaytest) { game.playx = savex; game.playy = savey; @@ -845,75 +597,59 @@ int main(int argc, char *argv[]) game.playgc = savegc; game.playmusic = savemusic; game.cliplaytest = true; - script.startgamemode(Start_CUSTOM_QUICKSAVE); + script.startgamemode(23); } else { - script.startgamemode(Start_CUSTOM); + script.startgamemode(22); } - graphics.fademode = FADE_NONE; + graphics.fademode = 0; } - - /* Only create the window after we have loaded all the assets. */ - SDL_ShowWindow(gameScreen.m_window); +#endif key.isActive = true; gamestate_funcs = get_gamestate_funcs(game.gamestate, &num_gamestate_funcs); loop_assign_active_funcs(); -#ifdef __EMSCRIPTEN__ - emscripten_set_main_loop(emscriptenloop, 0, 0); -#else while (true) { - f_time = SDL_GetTicks64(); + f_time = SDL_GetTicks(); - const Uint64 f_timetaken = f_time - f_timePrev; - const int timestep = game.get_timestep(); - if (!game.over30mode && f_timetaken < (Uint64) timestep) + const Uint32 f_timetaken = f_time - f_timePrev; + if (!game.over30mode && f_timetaken < 34) { - const volatile Uint64 f_delay = timestep - f_timetaken; - SDL_Delay((Uint32) f_delay); - f_time = SDL_GetTicks64(); + const volatile Uint32 f_delay = 34 - f_timetaken; + SDL_Delay(f_delay); + f_time = SDL_GetTicks(); } f_timePrev = f_time; timePrev = time_; - time_ = SDL_GetTicks64(); + time_ = SDL_GetTicks(); deltaloop(); } cleanup(); -#endif - return 0; } static void cleanup(void) { /* Order matters! */ - if (FILESYSTEM_isInit()) /* not necessary but silences logs */ - { - game.savestatsandsettings(); - } - + game.savestatsandsettings(); + gameScreen.destroy(); graphics.grphx.destroy(); graphics.destroy_buffers(); graphics.destroy(); - font::bidi_destroy(); - font::destroy(); - gameScreen.destroy(); music.destroy(); - map.destroy(); NETWORK_shutdown(); - loc::resettext(true); SDL_Quit(); FILESYSTEM_deinit(); } -SDL_NORETURN void VVV_exit(const int exit_code) +void VVV_exit(const int exit_code) { cleanup(); exit(exit_code); @@ -960,13 +696,9 @@ static void inline deltaloop(void) if (implfunc->type == Func_delta && implfunc->func != NULL) { - graphics.clear(); - - graphics.set_render_target(graphics.gameTexture); - implfunc->func(); - gameScreen.RenderPresent(); + gameScreen.FlipScreen(); } } } @@ -988,31 +720,18 @@ static void unfocused_run(void) { if (!game.blackout) { - graphics.fill_rect(0, 0, 0); + ClearSurface(graphics.backBuffer); #define FLIP(YPOS) graphics.flipmode ? 232 - YPOS : YPOS -#define FLIP_PR_CJK_LOW (graphics.flipmode ? PR_CJK_HIGH : PR_CJK_LOW) -#define FLIP_PR_CJK_HIGH (graphics.flipmode ? PR_CJK_LOW : PR_CJK_HIGH) - /* The pause screen can also appear on the language screen, where highlighting - * a language changes the used language metadata but not the loaded strings... */ - uint32_t flags = PR_CEN | PR_BOR | PR_FONT_IDX(loc::langmeta.font_idx, loc::langmeta.rtl); - font::print(flags | FLIP_PR_CJK_HIGH, -1, FLIP(110), loc::gettext("Game paused"), 196 - help.glow, 255 - help.glow, 196 - help.glow); - - if (BUTTONGLYPHS_keyboard_is_available()) - { - font::print(flags | FLIP_PR_CJK_LOW, -1, FLIP(120), loc::gettext("[click to resume]"), 196 - help.glow, 255 - help.glow, 196 - help.glow); - - font::print(flags | FLIP_PR_CJK_HIGH, -1, FLIP(220), loc::gettext("Press M to mute in game"), 164 - help.glow, 196 - help.glow, 164 - help.glow); - font::print(flags, -1, FLIP(230), loc::gettext("Press N to mute music only"), 164 - help.glow, 196 - help.glow, 164 - help.glow); - } -#undef FLIP_PR_CJK_HIGH -#undef FLIP_PR_CJK_LOW + graphics.bprint(5, FLIP(110), "Game paused", 196 - help.glow, 255 - help.glow, 196 - help.glow, true); + graphics.bprint(5, FLIP(120), "[click to resume]", 196 - help.glow, 255 - help.glow, 196 - help.glow, true); + graphics.bprint(5, FLIP(220), "Press M to mute in game", 164 - help.glow, 196 - help.glow, 164 - help.glow, true); + graphics.bprint(5, FLIP(230), "Press N to mute music only", 164 - help.glow, 196 - help.glow, 164 - help.glow, true); #undef FLIP } graphics.render(); + gameScreen.FlipScreen(); //We are minimised, so lets put a bit of a delay to save CPU -#ifndef __EMSCRIPTEN__ SDL_Delay(100); -#endif } static void focused_begin(void) @@ -1029,8 +748,6 @@ static void focused_end(void) static enum LoopCode loop_end(void) { - ++game.framecounter; - //We did editorinput, now it's safe to turn this off key.linealreadyemptykludge = false; @@ -1062,7 +779,24 @@ static enum LoopCode loop_end(void) game.musicmutebutton--; } - music.updatemutestate(); + if (game.muted) + { + Mix_VolumeMusic(0) ; + Mix_Volume(-1,0); + } + else + { + Mix_Volume(-1,MIX_MAX_VOLUME * music.user_sound_volume / USER_VOLUME_MAX); + + if (game.musicmuted) + { + Mix_VolumeMusic(0); + } + else + { + Mix_VolumeMusic(music.musicVolume * music.user_music_volume / USER_VOLUME_MAX); + } + } if (key.resetWindow) { diff --git a/desktop_version/src/preloader.cpp b/desktop_version/src/preloader.cpp index 4b47ef99..9105b275 100644 --- a/desktop_version/src/preloader.cpp +++ b/desktop_version/src/preloader.cpp @@ -1,20 +1,12 @@ -#include "Constants.h" #include "Enums.h" -#include "Font.h" #include "Game.h" #include "Graphics.h" -#include "GraphicsUtil.h" #include "KeyPoll.h" -#include "Localization.h" -#include "Maths.h" #include "UtilityClass.h" -#include "VFormat.h" static int pre_fakepercent=0, pre_transition=30; static bool pre_startgame=false; -static SDL_Color pre_darkcol = {0, 0, 0, 0}; -static SDL_Color pre_lightcol = {0, 0, 0, 0}; -static int pre_curcol = 0, pre_coltimer = 0, pre_offset = 0; +static int pre_darkcol=0, pre_lightcol=0, pre_curcol=0, pre_coltimer=0, pre_offset=0; static int pre_frontrectx=30, pre_frontrecty=20, pre_frontrectw=260, pre_frontrecth=200; static int pre_temprectx=0, pre_temprecty=0, pre_temprectw=320, pre_temprecth=240; @@ -59,37 +51,35 @@ void preloaderrenderfixed(void) void preloaderrender(void) { - bool print_percentage = false; - if(pre_transition>=30){ switch(pre_curcol) { case 0: - pre_lightcol = graphics.getRGB(0xBF,0x59,0x6F); - pre_darkcol = graphics.getRGB(0x88,0x3E,0x53); + pre_lightcol = graphics.RGBflip(0xBF,0x59,0x6F); + pre_darkcol = graphics.RGBflip(0x88,0x3E,0x53); break; case 1: - pre_lightcol = graphics.getRGB(0x6C,0xBC,0x5C); - pre_darkcol = graphics.getRGB(0x50,0x86,0x40); + pre_lightcol = graphics.RGBflip(0x6C,0xBC,0x5C); + pre_darkcol = graphics.RGBflip(0x50,0x86,0x40); break; case 2: - pre_lightcol = graphics.getRGB(0x5D,0x57,0xAA); - pre_darkcol = graphics.getRGB(0x2F,0x2F,0x6C); + pre_lightcol = graphics.RGBflip(0x5D,0x57,0xAA); + pre_darkcol = graphics.RGBflip(0x2F,0x2F,0x6C); break; case 3: - pre_lightcol = graphics.getRGB(0xB7,0xBA,0x5E); - pre_darkcol = graphics.getRGB(0x84,0x83,0x42); + pre_lightcol = graphics.RGBflip(0xB7,0xBA,0x5E); + pre_darkcol = graphics.RGBflip(0x84,0x83,0x42); break; case 4: - pre_lightcol = graphics.getRGB(0x57,0x90,0xAA); - pre_darkcol = graphics.getRGB(0x2F,0x5B,0x6C); + pre_lightcol = graphics.RGBflip(0x57,0x90,0xAA); + pre_darkcol = graphics.RGBflip(0x2F,0x5B,0x6C); break; case 5: - pre_lightcol = graphics.getRGB(0x90,0x61,0xB1); - pre_darkcol = graphics.getRGB(0x58,0x3D,0x71); + pre_lightcol = graphics.RGBflip(0x90,0x61,0xB1); + pre_darkcol = graphics.RGBflip(0x58,0x3D,0x71); break; default: - pre_lightcol = graphics.getRGB(0x00,0x00,0x00); - pre_darkcol = graphics.getRGB(0x08,0x00,0x00); + pre_lightcol = graphics.RGBflip(0x00,0x00,0x00); + pre_darkcol = graphics.RGBflip(0x08,0x00,0x00); break; } @@ -97,17 +87,21 @@ void preloaderrender(void) pre_temprecty = (i * 16)- pre_offset; if (i % 2 == 0) { - graphics.fill_rect(pre_temprectx, pre_temprecty, pre_temprectw,pre_temprecth, pre_lightcol); + FillRect(graphics.backBuffer, pre_temprectx, pre_temprecty, pre_temprectw,pre_temprecth, pre_lightcol); } else { - graphics.fill_rect(pre_temprectx, pre_temprecty, pre_temprectw,pre_temprecth, pre_darkcol); + FillRect(graphics.backBuffer, pre_temprectx, pre_temprecty, pre_temprectw,pre_temprecth, pre_darkcol); } } - graphics.fill_rect(pre_frontrectx, pre_frontrecty, pre_frontrectw,pre_frontrecth, graphics.getRGB(0x3E,0x31,0xA2)); + FillRect(graphics.backBuffer, pre_frontrectx, pre_frontrecty, pre_frontrectw,pre_frontrecth, graphics.getBGR(0x3E,0x31,0xA2)); - print_percentage = true; + if(pre_fakepercent==100){ + graphics.Print(282-(15*8), 204, "LOADING... " + help.String(int(pre_fakepercent))+"%", 124, 112, 218, false); + }else{ + graphics.Print(282-(14*8), 204, "LOADING... " + help.String(int(pre_fakepercent))+"%", 124, 112, 218, false); + } //Render if (pre_startgame) { @@ -116,26 +110,14 @@ void preloaderrender(void) }else if (pre_transition <= -10) { //Switch to TITLEMODE (handled by preloaderrenderfixed) }else if (pre_transition < 5) { - graphics.fill_rect(0, 0, 0); + ClearSurface(graphics.backBuffer); }else if (pre_transition < 20) { pre_temprecty = 0; pre_temprecth = 240; - graphics.fill_rect(0, 0, 0); - graphics.fill_rect(pre_frontrectx, pre_frontrecty, pre_frontrectw,pre_frontrecth, graphics.getRGB(0x3E,0x31,0xA2)); + FillRect(graphics.backBuffer, pre_temprectx, pre_temprecty, pre_temprectw,pre_temprecth, 0x000000); + FillRect(graphics.backBuffer, pre_frontrectx, pre_frontrecty, pre_frontrectw,pre_frontrecth, graphics.getBGR(0x3E,0x31,0xA2)); - print_percentage = true; - } - - if (print_percentage) { - char buffer[SCREEN_WIDTH_CHARS + 1]; - vformat_buf( - buffer, sizeof(buffer), - loc::gettext("LOADING... {percent|digits=2|spaces}%"), - "percent:int", - pre_fakepercent - ); - - font::print(PR_RIGHT | PR_CJK_HIGH | PR_RTL_XFLIP, 282, 204, buffer, 124, 112, 218); + graphics.Print(282-(15*8), 204, "LOADING... 100%", 124, 112, 218, false); } graphics.drawfade(); diff --git a/desktop_version/version.cmake b/desktop_version/version.cmake index 2b9d2646..7983867e 100644 --- a/desktop_version/version.cmake +++ b/desktop_version/version.cmake @@ -1,42 +1,19 @@ # Expects INPUT_FILE and OUTPUT_FILE to be defined -# find_package sets GIT_FOUND and GIT_EXECUTABLE -find_package(Git) +# Get interim commit and date of commit +EXECUTE_PROCESS( + COMMAND "${GIT_EXECUTABLE}" log -1 --format=%h + OUTPUT_VARIABLE INTERIM_COMMIT + OUTPUT_STRIP_TRAILING_WHITESPACE +) -if(GIT_FOUND) - # Get interim commit and date of commit - execute_process( - COMMAND "${GIT_EXECUTABLE}" log -1 --format=%h - OUTPUT_VARIABLE INTERIM_COMMIT - OUTPUT_STRIP_TRAILING_WHITESPACE - ) +EXECUTE_PROCESS( + COMMAND "${GIT_EXECUTABLE}" log -1 --format=%cs + OUTPUT_VARIABLE COMMIT_DATE + OUTPUT_STRIP_TRAILING_WHITESPACE +) - execute_process( - COMMAND "${GIT_EXECUTABLE}" log -1 --format=%cd --date=short - OUTPUT_VARIABLE COMMIT_DATE - OUTPUT_STRIP_TRAILING_WHITESPACE - ) - - execute_process( - COMMAND "${GIT_EXECUTABLE}" branch --show-current - OUTPUT_VARIABLE BRANCH_NAME - OUTPUT_STRIP_TRAILING_WHITESPACE - ) -endif() - -# Defaults if we don't have git or its commands fail for any reason or give blanks -# For annoying CMake reasons, must use "${VAR}" syntax rather than VAR -if("${INTERIM_COMMIT}" STREQUAL "") - set(INTERIM_COMMIT "(commit?)") -endif() -if("${COMMIT_DATE}" STREQUAL "") - set(COMMIT_DATE "(date?)") -endif() -if("${BRANCH_NAME}" STREQUAL "") - set(BRANCH_NAME "(branch?)") -endif() - -message(STATUS "This is interim commit ${INTERIM_COMMIT} (committed ${COMMIT_DATE}) on branch ${BRANCH_NAME}") +MESSAGE(STATUS "This is interim commit ${INTERIM_COMMIT} (committed ${COMMIT_DATE})") # Take the template file and replace the macros with what we have -configure_file(${INPUT_FILE} ${OUTPUT_FILE}) +CONFIGURE_FILE(${INPUT_FILE} ${OUTPUT_FILE}) diff --git a/logo.gif b/logo.gif deleted file mode 100644 index 31042201..00000000 Binary files a/logo.gif and /dev/null differ diff --git a/mobile_version/application.xml b/mobile_version/application.xml index 353e1ec7..fcafcbbd 100644 --- a/mobile_version/application.xml +++ b/mobile_version/application.xml @@ -1,105 +1,73 @@ - - - com.distractionware.vvvvvvmobile - 2.2.1 - mobileDevice - VVVVVV - VVVVVV - - - - - - - - - - - - - - - - - - - - - - ]]> - true - - - UIStatusBarStyle - UIStatusBarStyleBlackOpaque - UIRequiresPersistentWiFi - NO - UIPrerenderedIcon - - UIApplicationExitsOnSuspend - - - UIDeviceFamily - - - 1 - - - - - - ]]> - high - - - - VVVVVV - vvvvvv.swf - true - true - standard - true - landscape - direct - - - - - icons/icon_48.png - icons/icon_57.png - icons/icon_72.png - icons/icon_76.png - icons/icon_96.png - icons/icon_114.png - icons/icon_120.png - icons/icon_144.png - icons/icon_152.png - icons/icon_512.png - icons/icon_1024.png - - - - - - + + + com.distractionware.vvvvvvmobile + 1.02 + mobileDevice + VVVVVV + VVVVVV + + + + + +]]> + + + UIStatusBarStyle +UIStatusBarStyleBlackOpaque +UIRequiresPersistentWiFi +NO +UIPrerenderedIcon + +UIApplicationExitsOnSuspend + +UIDeviceFamily + + + 1 + + 2 +]]> + standard + + + VVVVVV + vvvvvv.swf + true + landscape + gpu + standard + true + true + + + icons/icon_48.png + icons/icon_57.png + icons/icon_72.png + icons/icon_76.png + icons/icon_96.png + icons/icon_114.png + icons/icon_120.png + icons/icon_144.png + icons/icon_152.png + icons/icon_512.png + icons/icon_1024.png + + + + com.milkmangames.extensions.GameCenter + + \ No newline at end of file diff --git a/mobile_version/data/bitmapflipsprites.png b/mobile_version/data/bitmapflipsprites.png deleted file mode 100644 index b876e7ab..00000000 Binary files a/mobile_version/data/bitmapflipsprites.png and /dev/null differ diff --git a/mobile_version/data/bitmapsprites.png b/mobile_version/data/bitmapsprites.png deleted file mode 100644 index 86b3c1ae..00000000 Binary files a/mobile_version/data/bitmapsprites.png and /dev/null differ diff --git a/mobile_version/data/c64.fnt b/mobile_version/data/c64.fnt deleted file mode 100644 index 58c7fb39..00000000 --- a/mobile_version/data/c64.fnt +++ /dev/null @@ -1,107 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/mobile_version/data/vvvvvv_graphics.png b/mobile_version/data/vvvvvv_graphics.png deleted file mode 100644 index 655fddb4..00000000 Binary files a/mobile_version/data/vvvvvv_graphics.png and /dev/null differ diff --git a/mobile_version/data/vvvvvv_graphics.xml b/mobile_version/data/vvvvvv_graphics.xml deleted file mode 100644 index 2682379e..00000000 --- a/mobile_version/data/vvvvvv_graphics.xml +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/mobile_version/readme.MD b/mobile_version/readme.MD index 555467de..d599aa83 100644 --- a/mobile_version/readme.MD +++ b/mobile_version/readme.MD @@ -1,4 +1,4 @@ -This is the source code for the Adobe Air mobile version of VVVVVV, which is forked from the original flash source code. This version is not maintained, and is only included here for those curious. If you're looking for the current, maintained C++ version, it's [in this folder](https://github.com/TerryCavanagh/VVVVVV/tree/master/desktop_version). +This is the source code for the adobe air mobile version of VVVVVV, which is forked from the original flash source code. The mobile version needs a different data.zip folder, which [can be downloaded from here](https://thelettervsixtim.es/makeandplay/). Just like the asset contents from the C++ version, the contents of this folder are still under a proprietary license. diff --git a/mobile_version/src/EditorDataclass.as b/mobile_version/src/EditorDataclass.as index b7766a5b..ad88845e 100644 --- a/mobile_version/src/EditorDataclass.as +++ b/mobile_version/src/EditorDataclass.as @@ -1,4 +1,9 @@ package { + import flash.display.*; + import flash.geom.*; + import flash.events.*; + import flash.net.*; + public class EditorDataclass{ public function EditorDataclass():void { clear(); diff --git a/mobile_version/src/EmbeddedAssets.as b/mobile_version/src/EmbeddedAssets.as deleted file mode 100644 index 350a2338..00000000 --- a/mobile_version/src/EmbeddedAssets.as +++ /dev/null @@ -1,12 +0,0 @@ -package { - public class EmbeddedAssets { - /* PNG texture */ - [Embed(source = "../data/vvvvvv_graphics.png")] - public static const vvvvvv_graphics:Class; - - /* XML file */ - [Embed(source = "../data/vvvvvv_graphics.xml", - mimeType = "application/octet-stream")] - public static const vvvvvv_graphics_xml:Class; - } -} \ No newline at end of file diff --git a/mobile_version/src/LevelMetaData.as b/mobile_version/src/LevelMetaData.as index ac8f3779..bea5ef71 100644 --- a/mobile_version/src/LevelMetaData.as +++ b/mobile_version/src/LevelMetaData.as @@ -1,4 +1,5 @@ package { + import flash.display.*; import flash.geom.*; import flash.events.*; import flash.net.*; diff --git a/mobile_version/src/Load.as b/mobile_version/src/Load.as deleted file mode 100644 index 5e08380d..00000000 --- a/mobile_version/src/Load.as +++ /dev/null @@ -1,16 +0,0 @@ -package{ - import flash.display.Sprite; - import starling.core.Starling; - - [SWF(backgroundColor="#000000", frameRate="30")] - public class Load extends Sprite{ - private var _starling:Starling; - - public function Load() { - Starling.multitouchEnabled = true; - - _starling = new Starling(Main, stage); - _starling.start(); - } - } -} \ No newline at end of file diff --git a/mobile_version/src/Main.as b/mobile_version/src/Main.as index 2e1e3ba2..a010f250 100644 --- a/mobile_version/src/Main.as +++ b/mobile_version/src/Main.as @@ -1,35 +1,36 @@ -package { +package{ + import flash.display.*; import flash.geom.*; - import flash.net.*; - import flash.display.Screen; - import flash.display.StageAlign; - import flash.display.StageQuality; - import flash.display.StageScaleMode; - import flash.system.Capabilities; - import starling.core.Starling; - import starling.display.Image; - import starling.text.BitmapFont; - import starling.text.TextField; - import starling.core.StatsDisplay; - import starling.events.Event; - import starling.utils.Color; - import starling.textures.*; - import starling.display.*; - import flash.filesystem.File; - import starling.events.KeyboardEvent; - import flash.ui.Keyboard; - import starling.utils.AssetManager; - import bigroom.input.KeyPoll; - //import com.mesmotronic.ane.AndroidFullScreen; //This doesn't seem to be needed anymore - import flash.display.StageDisplayState; + import flash.events.*; + import flash.net.*; import flash.media.*; - - + import flash.text.*; + import flash.ui.ContextMenu; + import flash.ui.ContextMenuItem; + import flash.events.ContextMenuEvent; + import flash.ui.Keyboard; + import flash.ui.Mouse; + import bigroom.input.KeyPoll; + import flash.system.fscommand; + import flash.system.Capabilities; import flash.utils.getTimer; import flash.utils.Timer; - import flash.events.TimerEvent; + //import com.mesmotronic.ane.AndroidFullScreen; - public class Main extends Sprite{ + //import com.sociodox.theminer.TheMiner; //Profiler + + //Real value + //[SWF(width = "1136", height = "768", frameRate = "30", backgroundColor = "#000000")] //Set the size and color of the Flash file + //Big frame for big androids! + //[SWF(width = "3000", height = "2000", frameRate = "30", backgroundColor = "#000000")] //Set the size and color of the Flash file + [SWF(frameRate = "30", backgroundColor = "#000000")] //Set the size and color of the Flash file + //iPad test + //[SWF(width = "1024", height = "768", frameRate="60", backgroundColor = "#000000")] //Set the size and color of the Flash file + //iPhone test + //[SWF(width = "480", height = "320", frameRate="30", backgroundColor = "#000000")] //Set the size and color of the Flash file + //[SWF(width = "960", height = "640", frameRate="30", backgroundColor = "#000000")] //Set the size and color of the Flash file + + public class Main extends Sprite { static public var BLOCK:Number = 0; static public var TRIGGER:Number = 1; static public var DAMAGE:Number = 2; @@ -48,11 +49,7 @@ package { public var EDITORMODE:int = 8; public var CONTROLTUTORIALMODE:int = 9; - public var addedtwice:Boolean = false; - - public function Main() { - super(); - + public function Main():void { if (stage) gameinit(); else addEventListener(Event.ADDED_TO_STAGE, gameinit); } @@ -60,395 +57,565 @@ package { private function gameinit(e:Event = null):void { removeEventListener(Event.ADDED_TO_STAGE, gameinit); // entry point - if (addedtwice) return; //I don't think I actually need this, but... I have a hunch - addedtwice = true; + var tempbmp:Bitmap; + + this.mouseEnabled = false; + this.mouseChildren = false; //Ok: quick security check to make sure it doesn't get posted about - key = new KeyPoll(Starling.current.nativeStage); - - //immersivemode = AndroidFullScreen.isSupported; - stage.addEventListener(Event.RESIZE, function(e:Event):void{ - androidresize(); - }); - - device.deviceresolution = device.ANDROID; - - editor.init(); //Load in all the levels - - //General game variables - obj.init(); - help.init(); - - /*obj.createblock(BLOCK,20,200,128,16); - obj.createblock(BLOCK,130,170,128,16); - obj.createblock(BLOCK,240,150,128,16); - obj.createblock(BLOCK,240,20,128,16); - obj.createblock(BLOCK,130,40,128,16); - obj.createblock(BLOCK,20,60,128,16);*/ - - //Input - key.definestickrange(device.xres / 2, 0, 6); - - SoundMixer.soundTransform = new SoundTransform(1); - - music.currentsong = -1; music.musicfade = 0;//no music, no amb - music.initefchannels(); music.currentefchan = 0; - music.nicechange = -1; - - music.numplays = 0; - music.musicchan.push(new music_1()); // 0: Level Complete - music.musicchan.push(new vmaintheme_hq()); // 1: VVVVVV Main Theme (Pushing Forward) - music.musicchan.push(new vtempo_hq()); // 2: VVVVVV Tempo Theme (Positive Force) - music.musicchan.push(new vpfa_hq()); // 3: Potential for Anything - music.musicchan.push(new passionforexploring()); // 4: UU Brothers Instrumental - music.musicchan.push(new souleye_intermission()); // 5: Jingle: Intermission - music.musicchan.push(new presentingvvvvvv()); // 6: Jingle: Menu Loop - music.musicchan.push(new music_2()); // 7: Jingle: Game Complete - music.musicchan.push(new configmegamix_hq()); // 8: Config Megamix - music.musicchan.push(new posreverse()); // 9: Tempo Theme, Reversed - music.musicchan.push(new poppot()); // 10: Extra - music.musicchan.push(new pipedream_hq()); // 11: Highscore - music.musicchan.push(new pressurecooker_hq()); // 12: Pressure Cooker - music.musicchan.push(new pacedenergy()); // NEW 13: Paced Energy - music.musicchan.push(new piercingthesky()); // NEW 14: Piercing the Sky - music.musicchan.push(new predestinedfateremix()); // NEW 15: Predestined Fate Remix - - music.efchan.push(new ef_0()); - music.efchan.push(new ef_1()); - music.efchan.push(new ef_2()); - music.efchan.push(new ef_3()); - music.efchan.push(new ef_4()); - music.efchan.push(new ef_5()); - music.efchan.push(new ef_6()); - music.efchan.push(new ef_7()); - music.efchan.push(new ef_8()); - music.efchan.push(new ef_9()); - music.efchan.push(new ef_10()); - music.efchan.push(new ef_11()); - music.efchan.push(new ef_12()); - music.efchan.push(new ef_13()); - music.efchan.push(new ef_14()); - music.efchan.push(new ef_15()); - music.efchan.push(new ef_16()); - music.efchan.push(new ef_17()); - music.efchan.push(new ef_18()); - music.efchan.push(new ef_19()); - music.efchan.push(new ef_20()); - music.efchan.push(new ef_21()); - music.efchan.push(new ef_22()); - music.efchan.push(new ef_23()); - music.efchan.push(new ef_24()); - music.efchan.push(new ef_25()); - music.efchan.push(new ef_26()); - music.efchan.push(new ef_27()); + if (sitelock()) { + key = new KeyPoll(stage); - /* - Graphics Init - */ - dwgfx.init(stage); - //Load assets - dwgfx.starlingassets = new AssetManager(); - dwgfx.starlingassets.enqueue(EmbeddedAssets); - - Starling.current.nativeStage.scaleMode = StageScaleMode.NO_SCALE; - Starling.current.nativeStage.align = StageAlign.TOP_LEFT; - Starling.current.nativeStage.quality = StageQuality.LOW; - - //TO DO: orientation code - game = new gameclass(dwgfx, map, obj, help, music); + //ANDROID SPECIFIC CODE HERE + /* + if (AndroidFullScreen.isSupported) { + if (!AndroidFullScreen.immersiveMode()){ + stage.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE; + device.xres = flash.system.Capabilities.screenResolutionX; + device.yres = flash.system.Capabilities.screenResolutionY; + immersivemode = false; + }else { + device.xres = stage.stageWidth; + device.yres = stage.stageHeight; + immersivemode = true; + } + }else { + */ + stage.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE; + device.xres = flash.system.Capabilities.screenResolutionX; + device.yres = flash.system.Capabilities.screenResolutionY; + immersivemode = false; + //} - map.ypos = (700-29) * 8; - map.bypos = map.ypos / 2; - map.cameramode = 0; - - - ///Test Start: - //-- Comment this for real start - /* - gamestate = GAMEMODE; - /*map.finalmode = true; //Enable final level mode - //map.finalx = 41; map.finaly = 52; //Midpoint - //map.finalx = 48; map.finaly = 52; //Just before the tower - map.finalx = 46; map.finaly = 54; //Current - //map.finalstretch = true; - map.final_colormode = true; - map.final_mapcol = 0; - map.final_colorframe = 0; - */ - /* - game.starttest(obj, music); - obj.createentity(game, game.savex, game.savey, 0); //In this game, constant, never destroyed - map.gotoroom(game.saverx, game.savery, dwgfx, game, obj, music); - music.play(1); - */ - //game.crewstats[1] = true; - //game.crewstats[2] = true; - //game.crewstats[3] = true; - //game.crewstats[4] = true; - //game.crewstats[5] = true; - //script.load("intro"); - - //crew member test - //obj.createentity(game, game.savex - 10, game.savey - 10, 14); - //game.companion = 6; //different rules for different members - - - - //-- - //Uncomment this if testing the final level - /* - map.finalmode = true; //Enable final level mode - map.finalx = 46; map.finaly = 54; //Current + /* + if (immersivemode) { + stage.addEventListener(Event.RESIZE, androidresize); + } + */ + /* + trace("NOTE: REMEMBER TO FIX RESOLUTION SUPPORT BEFORE BUILDING"); + device.xres = 1024; + device.yres = 768; + device.deviceresolution = device.IPAD; + */ + //Testing:Let's be an ipad + /* + device.xres = 1024; + device.yres = 768; + device.deviceresolution = device.IPAD; + */ + /* + device.xres = 480; + device.yres = 320; + device.deviceresolution = device.IPHONE; + */ + /* + device.xres = 960; + device.yres = 640; + device.deviceresolution = device.IPHONE; + */ + + editor.init(); //Load in all the levels + + if (device.xres < device.yres) { + //Switch them! + t = device.yres; + device.yres = device.xres; + device.xres = t; + } + + if (device.yres < 768) { + device.deviceresolution = device.IPHONE; + }else { + device.deviceresolution = device.IPAD; + } + + //Manually enable androids here! Mostly just changed buttons sizes + // device.deviceresolution = device.ANDROID; + + //General game variables + obj.init(); + help.init(); + + /*obj.createblock(BLOCK,20,200,128,16); + obj.createblock(BLOCK,130,170,128,16); + obj.createblock(BLOCK,240,150,128,16); + obj.createblock(BLOCK,240,20,128,16); + obj.createblock(BLOCK,130,40,128,16); + obj.createblock(BLOCK,20,60,128,16);*/ + + //Input + key.definestickrange(device.xres / 2, 0, 6); + + SoundMixer.soundTransform = new SoundTransform(1); + + music.currentsong = -1; music.musicfade = 0;//no music, no amb + music.initefchannels(); music.currentefchan = 0; + music.nicechange = -1; + + music.numplays = 0; + music.musicchan.push(new music_1()); // 0: Level Complete + music.musicchan.push(new vmaintheme_hq()); // 1: VVVVVV Main Theme (Pushing Forward) + music.musicchan.push(new vtempo_hq()); // 2: VVVVVV Tempo Theme (Positive Force) + music.musicchan.push(new vpfa_hq()); // 3: Potential for Anything + music.musicchan.push(new passionforexploring()); // 4: UU Brothers Instrumental + music.musicchan.push(new souleye_intermission()); // 5: Jingle: Intermission + music.musicchan.push(new presentingvvvvvv()); // 6: Jingle: Menu Loop + music.musicchan.push(new music_2()); // 7: Jingle: Game Complete + music.musicchan.push(new configmegamix_hq()); // 8: Config Megamix + music.musicchan.push(new posreverse()); // 9: Tempo Theme, Reversed + music.musicchan.push(new poppot()); // 10: Extra + music.musicchan.push(new pipedream_hq()); // 11: Highscore + music.musicchan.push(new pressurecooker_hq()); // 12: Pressure Cooker + music.musicchan.push(new pacedenergy()); // NEW 13: Paced Energy + music.musicchan.push(new piercingthesky()); // NEW 14: Piercing the Sky + music.musicchan.push(new predestinedfateremix()); // NEW 15: Predestined Fate Remix + + music.efchan.push(new ef_0()); + music.efchan.push(new ef_1()); + music.efchan.push(new ef_2()); + music.efchan.push(new ef_3()); + music.efchan.push(new ef_4()); + music.efchan.push(new ef_5()); + music.efchan.push(new ef_6()); + music.efchan.push(new ef_7()); + music.efchan.push(new ef_8()); + music.efchan.push(new ef_9()); + music.efchan.push(new ef_10()); + music.efchan.push(new ef_11()); + music.efchan.push(new ef_12()); + music.efchan.push(new ef_13()); + music.efchan.push(new ef_14()); + music.efchan.push(new ef_15()); + music.efchan.push(new ef_16()); + music.efchan.push(new ef_17()); + music.efchan.push(new ef_18()); + music.efchan.push(new ef_19()); + music.efchan.push(new ef_20()); + music.efchan.push(new ef_21()); + music.efchan.push(new ef_22()); + music.efchan.push(new ef_23()); + music.efchan.push(new ef_24()); + music.efchan.push(new ef_25()); + music.efchan.push(new ef_26()); + music.efchan.push(new ef_27()); + + /* + Graphics Init + */ + //First we init the class and add its display list to the main display list + + dwgfx.buttonimg.push(new BitmapData(92, 30, true, 0x00000000)); + dwgfx.buttonimg.push(new BitmapData(92, 30, true, 0x00000000)); + dwgfx.buttonimg.push(new BitmapData(40, 40, true, 0x00000000)); + dwgfx.buttonimg.push(new BitmapData(40, 40, true, 0x00000000)); + tempbmp = new im_button_0(); dwgfx.buffer = tempbmp.bitmapData; dwgfx.addbutton(); + tempbmp = new im_button_1(); dwgfx.buffer = tempbmp.bitmapData; dwgfx.addbutton(); + tempbmp = new im_button_2(); dwgfx.buffer = tempbmp.bitmapData; dwgfx.addbutton(); + tempbmp = new im_button_3(); dwgfx.buffer = tempbmp.bitmapData; dwgfx.addbutton(); + tempbmp = new im_button_4(); dwgfx.buffer = tempbmp.bitmapData; dwgfx.addbutton(); + tempbmp = new im_button_5(); dwgfx.buffer = tempbmp.bitmapData; dwgfx.addbutton(); + tempbmp = new im_button_6(); dwgfx.buffer = tempbmp.bitmapData; dwgfx.addbutton(); + tempbmp = new im_button_7(); dwgfx.buffer = tempbmp.bitmapData; dwgfx.addbutton(); + tempbmp = new im_button_8(); dwgfx.buffer = tempbmp.bitmapData; dwgfx.addbutton(); + tempbmp = new im_button_9(); dwgfx.buffer = tempbmp.bitmapData; dwgfx.addbutton(); + tempbmp = new im_button_10(); dwgfx.buffer = tempbmp.bitmapData; dwgfx.addbutton(); + tempbmp = new im_button_11(); dwgfx.buffer = tempbmp.bitmapData; dwgfx.addbutton(); + tempbmp = new im_button_12(); dwgfx.buffer = tempbmp.bitmapData; dwgfx.addbutton(); + + dwgfx.init(); + + //We load all our graphics in: + tempbmp = new im_tiles(); dwgfx.buffer = tempbmp.bitmapData; dwgfx.maketilearray(); + tempbmp = new im_tiles2(); dwgfx.buffer = tempbmp.bitmapData; dwgfx.maketile2array(); + tempbmp = new im_tiles3(); dwgfx.buffer = tempbmp.bitmapData; dwgfx.maketile3array(); + tempbmp = new im_sprites(); dwgfx.buffer = tempbmp.bitmapData; dwgfx.makespritearray(); + tempbmp = new im_flipsprites(); dwgfx.buffer = tempbmp.bitmapData; dwgfx.makeflipspritearray(); + tempbmp = new im_bfont(); dwgfx.buffer = tempbmp.bitmapData; dwgfx.makebfont(); + tempbmp = new im_bfontmask(); dwgfx.buffer = tempbmp.bitmapData; dwgfx.makebfontmask(); + tempbmp = new im_teleporter(); dwgfx.buffer = tempbmp.bitmapData; dwgfx.maketelearray(); + tempbmp = new im_entcolours(); dwgfx.buffer = tempbmp.bitmapData; dwgfx.makeentcolourarray(); + //Load in the images + tempbmp = new im_image0(); dwgfx.buffer = tempbmp.bitmapData; dwgfx.addimage(); // 0 + tempbmp = new im_image1(); dwgfx.buffer = tempbmp.bitmapData; dwgfx.addimage(); // 1 (this is the minimap!) + tempbmp = new im_image2(); dwgfx.buffer = tempbmp.bitmapData; dwgfx.addimage(); // 2 + tempbmp = new im_image3(); dwgfx.buffer = tempbmp.bitmapData; dwgfx.addimage(); // 3 + tempbmp = new im_image4(); dwgfx.buffer = tempbmp.bitmapData; dwgfx.addimage(); // 4 + tempbmp = new im_image5(); dwgfx.buffer = tempbmp.bitmapData; dwgfx.addimage(); // 5 + tempbmp = new im_image6(); dwgfx.buffer = tempbmp.bitmapData; dwgfx.addimage(); // 6 + tempbmp = new im_image7(); dwgfx.buffer = tempbmp.bitmapData; dwgfx.addimage(); // 7 + tempbmp = new im_image8(); dwgfx.buffer = tempbmp.bitmapData; dwgfx.addimage(); // 8 + tempbmp = new im_image9(); dwgfx.buffer = tempbmp.bitmapData; dwgfx.addimage(); // 9 + tempbmp = new im_image10(); dwgfx.buffer = tempbmp.bitmapData; dwgfx.addimage(); // 10 + + tempbmp = new im_image1(); dwgfx.buffer = tempbmp.bitmapData; dwgfx.addimage(); // Minimap + tempbmp = new im_image1(); dwgfx.buffer = tempbmp.bitmapData; dwgfx.addimage(); // Minimap + + tempbmp = new im_mobileimage1(); dwgfx.buffer = tempbmp.bitmapData; dwgfx.addmobileimage(); + tempbmp = new im_mobileimage2(); dwgfx.buffer = tempbmp.bitmapData; dwgfx.addmobileimage(); + tempbmp = new im_mobileimage3(); dwgfx.buffer = tempbmp.bitmapData; dwgfx.addmobileimage(); + tempbmp = new im_mobileimage4(); dwgfx.buffer = tempbmp.bitmapData; dwgfx.addmobileimage(); + tempbmp = new im_mobileimage5(); dwgfx.buffer = tempbmp.bitmapData; dwgfx.addmobileimage(); + tempbmp = new im_mobileimage6(); dwgfx.buffer = tempbmp.bitmapData; dwgfx.addmobileimage(); + tempbmp = new im_mobileimage7(); dwgfx.buffer = tempbmp.bitmapData; dwgfx.addmobileimage(); + tempbmp = new im_mobileimage8(); dwgfx.buffer = tempbmp.bitmapData; dwgfx.addmobileimage(); + tempbmp = new im_mobileimage9(); dwgfx.buffer = tempbmp.bitmapData; dwgfx.addmobileimage(); + + tempbmp = new im_imgplayerlevel0(); dwgfx.buffer = tempbmp.bitmapData; dwgfx.addplayerlevelimage(); + tempbmp = new im_imgplayerlevel1(); dwgfx.buffer = tempbmp.bitmapData; dwgfx.addplayerlevelimage(); + tempbmp = new im_imgplayerlevel2(); dwgfx.buffer = tempbmp.bitmapData; dwgfx.addplayerlevelimage(); + tempbmp = new im_imgplayerlevel3(); dwgfx.buffer = tempbmp.bitmapData; dwgfx.addplayerlevelimage(); + tempbmp = new im_imgplayerlevel4(); dwgfx.buffer = tempbmp.bitmapData; dwgfx.addplayerlevelimage(); + tempbmp = new im_imgplayerlevel5(); dwgfx.buffer = tempbmp.bitmapData; dwgfx.addplayerlevelimage(); + tempbmp = new im_imgplayerlevel6(); dwgfx.buffer = tempbmp.bitmapData; dwgfx.addplayerlevelimage(); + tempbmp = new im_imgplayerlevel7(); dwgfx.buffer = tempbmp.bitmapData; dwgfx.addplayerlevelimage(); + tempbmp = new im_imgplayerlevel8(); dwgfx.buffer = tempbmp.bitmapData; dwgfx.addplayerlevelimage(); + tempbmp = new im_imgplayerlevel9(); dwgfx.buffer = tempbmp.bitmapData; dwgfx.addplayerlevelimage(); + tempbmp = new im_imgplayerlevel10(); dwgfx.buffer = tempbmp.bitmapData; dwgfx.addplayerlevelimage(); + tempbmp = new im_imgplayerlevel11(); dwgfx.buffer = tempbmp.bitmapData; dwgfx.addplayerlevelimage(); + tempbmp = new im_imgplayerlevel12(); dwgfx.buffer = tempbmp.bitmapData; dwgfx.addplayerlevelimage(); + tempbmp = new im_imgplayerlevel13(); dwgfx.buffer = tempbmp.bitmapData; dwgfx.addplayerlevelimage(); + tempbmp = new im_imgplayerlevel14(); dwgfx.buffer = tempbmp.bitmapData; dwgfx.addplayerlevelimage(); + tempbmp = new im_imgplayerlevel15(); dwgfx.buffer = tempbmp.bitmapData; dwgfx.addplayerlevelimage(); + tempbmp = new im_imgplayerlevel16(); dwgfx.buffer = tempbmp.bitmapData; dwgfx.addplayerlevelimage(); + + //Now that the graphics are loaded, init the background buffer + dwgfx.buffer=new BitmapData(320,240,false,0x000000); + + stage.scaleMode = StageScaleMode.NO_SCALE; + stage.align = StageAlign.TOP_LEFT; + stage.quality = StageQuality.LOW; + + //EXACT FIT + dwgfx.screensizemultiplier = device.yres / 240; + dwgfx.screen.width = 320 * dwgfx.screensizemultiplier; + dwgfx.screen.height = device.yres; + + dwgfx.screen.x = (device.xres / 2) - (320 * dwgfx.screensizemultiplier / 2); + dwgfx.screen.y = 0; + + dwgfx.initbuttonpositions(); + + //PIXEL PERFECT + /* + dwgfx.screensizemultiplier = int(device.yres / 240); + dwgfx.screen.width = 320 * dwgfx.screensizemultiplier; + dwgfx.screen.height = 240 * dwgfx.screensizemultiplier; + + dwgfx.screenoffx = (device.xres / 2) - (320 * dwgfx.screensizemultiplier / 2); + dwgfx.screenoffy = (device.yres / 2) - (240 * dwgfx.screensizemultiplier / 2); + dwgfx.screen.x = dwgfx.screenoffx; + dwgfx.screen.y = dwgfx.screenoffy; + */ + + addChild(dwgfx); + //stage.addChild(new TheMiner()); //Profiler + + + //Iphone orientation fix + var startOrientation:String = stage.orientation; + if (startOrientation == StageOrientation.DEFAULT || startOrientation == StageOrientation.UPSIDE_DOWN){ + //stage.setOrientation(StageOrientation.ROTATED_RIGHT); + stage.setAspectRatio(StageAspectRatio.LANDSCAPE); + }else{ + stage.setOrientation(startOrientation); + } + stage.addEventListener(StageOrientationEvent.ORIENTATION_CHANGING, orientationChangeListener); + + game = new gameclass(dwgfx, map, obj, help, music); + + + map.ypos = (700-29) * 8; + map.bypos = map.ypos / 2; + map.cameramode = 0; + + + ///Test Start: + //-- Comment this for real start + /* + gamestate = GAMEMODE; + /*map.finalmode = true; //Enable final level mode //map.finalx = 41; map.finaly = 52; //Midpoint - map.final_colormode = false; map.final_mapcol = 0; map.final_colorframe = 0; - */ - //And this if after the midpoint: - /* - map.finalx = 52; map.finaly = 53; //Current - map.finalstretch = true; + //map.finalx = 48; map.finaly = 52; //Just before the tower + map.finalx = 46; map.finaly = 54; //Current + //map.finalstretch = true; map.final_colormode = true; map.final_mapcol = 0; map.final_colorframe = 0; - //map.background = 6; - */ - //-- Jumping right in - /* - game.gamestate = GAMEMODE; - game.starttest(obj, music); - //game.loadquick(map, obj, music); - obj.createentity(game, game.savex, game.savey, 0); //In this game, constant, never destroyed - map.gotoroom(game.saverx, game.savery, dwgfx, game, obj, music); - music.play(4); - //fscommand("quit"); - - game.crewstats[1] = true; - //game.crewstats[2] = true; - game.crewstats[3] = true; - game.crewstats[4] = true; - //game.crewstats[5] = true; - - map.showtargets = true; - map.showteleporters = true; - //map.showtrinkets = true; - - //obj.flags[34] = 1; - //obj.flags[20] = 1; - //obj.flags[67] = 1; //Game complete - for (i = 0; i < 20; i++) { - obj.collect[i] = true; - } - game.trinkets = 19; obj.collect[18] = false; - game.stat_trinkets = 20; - //obj.altstates = 1; - - //initilise map info - for (j = 0; j < 20; j++) { + */ + /* + game.starttest(obj, music); + obj.createentity(game, game.savex, game.savey, 0); //In this game, constant, never destroyed + map.gotoroom(game.saverx, game.savery, dwgfx, game, obj, music); + music.play(1); + */ + //game.crewstats[1] = true; + //game.crewstats[2] = true; + //game.crewstats[3] = true; + //game.crewstats[4] = true; + //game.crewstats[5] = true; + //script.load("intro"); + + //crew member test + //obj.createentity(game, game.savex - 10, game.savey - 10, 14); + //game.companion = 6; //different rules for different members + + + + //-- + //Uncomment this if testing the final level + /* + map.finalmode = true; //Enable final level mode + map.finalx = 46; map.finaly = 54; //Current + //map.finalx = 41; map.finaly = 52; //Midpoint + map.final_colormode = false; map.final_mapcol = 0; map.final_colorframe = 0; + */ + //And this if after the midpoint: + /* + map.finalx = 52; map.finaly = 53; //Current + map.finalstretch = true; + map.final_colormode = true; + map.final_mapcol = 0; + map.final_colorframe = 0; + //map.background = 6; + */ + //-- Jumping right in + /* + game.gamestate = GAMEMODE; + game.starttest(obj, music); + //game.loadquick(map, obj, music); + obj.createentity(game, game.savex, game.savey, 0); //In this game, constant, never destroyed + map.gotoroom(game.saverx, game.savery, dwgfx, game, obj, music); + music.play(4); + //fscommand("quit"); + + game.crewstats[1] = true; + //game.crewstats[2] = true; + game.crewstats[3] = true; + game.crewstats[4] = true; + //game.crewstats[5] = true; + + map.showtargets = true; + map.showteleporters = true; + //map.showtrinkets = true; + + //obj.flags[34] = 1; + //obj.flags[20] = 1; + //obj.flags[67] = 1; //Game complete for (i = 0; i < 20; i++) { - map.explored[i + (j * 20)] = 1; + obj.collect[i] = true; } - } - */ - //obj.entities[obj.getplayer()].size = 13; - - //game.gamestate = 6; - - //game.intimetrail = true; game.timetrialcountdown = 0; - //game.nodeathmode = true; - //dwgfx.flipmode = true; - //game.nocutscenes = true; - //map.invincibility = true; - //stage.frameRate = 24; - //game.colourblindmode = true; - //game.noflashingmode = true; - //for intermission 2 test - //game.lastsaved = 3; - /* - game.swnmode = true; - game.swngame = 2; - game.swndelay = 120; - game.swntimer = 60 * 30; - */ - //script.load("intermission_2"); - - - //for intermission 1 test - /* - game.companion = 11; - game.supercrewmate = true; - game.scmprogress = 0; - game.scmprogress = 10; - game.lastsaved = 4; - music.play(8); - */ - //game.sfpsmode = true; //Run at 60 FPS - //stage.frameRate = 60; // doesn't work, it's a bit more complex than this - will have to do a double sized window instead... - - //dwgfx.flipmode = true; - - //Testing some unlock stuff - /* - game.unlock[9] = true; //Space Station Intro Time Trial - game.unlock[10] = true; //Lab Time Trial - game.unlock[11] = true; //Tower Time Trial - game.unlock[12] = true; //Space Station 2 Time Trial - game.unlock[13] = true; //Warp Zone Time Trial - game.unlock[14] = true; //Final Level Time Trial - - game.unlock[17] = true; //No death mode - game.unlock[18] = true; //Flip Mode - - */ - //-- Normal start, with no fancy stuff! - - /* - game.gamestate = CLICKTOSTART; - dwgfx.createtextbox(" Click to Start ", 96, 107, 164, 164, 255); - dwgfx.textboxcenter(); - */ - //No click to start any more! Instead go right to the menu - - //INIT GRAPHIC MODE HERE - game.loadstats(map, dwgfx); - //updategraphicsmode(game, dwgfx); - - game.gamestate = TITLEMODE; + game.trinkets = 19; obj.collect[18] = false; + game.stat_trinkets = 20; + //obj.altstates = 1; - game.menustart = false; - game.mainmenu = 0; - - /*if (game.quicksummary != "") { - game.mainmenu = 2; - } - if (game.telesummary != "") { - game.mainmenu = 1; - }*/ //what the hell is that for - - - /* - game.gamestate = 6; - game.menustart = true; - map.ypos = (700-29) * 8; - map.bypos = map.ypos / 2; - map.cameramode = 0; - */ - //--Everything after this is screen recording - - //ok, screenrecording here - //don't record anything (comment both next parts) - - game.recording = 0; - - if(game.recording==1){ - trace("warning! recording input!"); - }else if(game.recording==2){ - trace("playing back input!"); - game.recordstring = "blahblahblah"; - help.toclipboard(game.recordstring); - - game.initplayback(); - game.playbackpos = 5; - game.savex = game.playback[0]; game.savey = game.playback[1]; - game.saverx = game.playback[2]; game.savery = game.playback[3]; - game.savegc = game.playback[4]; game.savedir = 1; - } - - //addEventListener(Event.ENTER_FRAME, mainloop); - - dwgfx.starlingassets.loadQueue(function(ratio:Number):void { - trace(ratio); - if (ratio == 1){ - waitforassetstoload(); + //initilise map info + for (j = 0; j < 20; j++) { + for (i = 0; i < 20; i++) { + map.explored[i + (j * 20)] = 1; + } } - }); + */ + //obj.entities[obj.getplayer()].size = 13; + + //game.gamestate = 6; + + //game.intimetrail = true; game.timetrialcountdown = 0; + //game.nodeathmode = true; + //dwgfx.flipmode = true; + //game.nocutscenes = true; + //map.invincibility = true; + //stage.frameRate = 24; + //game.colourblindmode = true; + //game.noflashingmode = true; + //for intermission 2 test + //game.lastsaved = 3; + /* + game.swnmode = true; + game.swngame = 2; + game.swndelay = 120; + game.swntimer = 60 * 30; + */ + //script.load("intermission_2"); + + + //for intermission 1 test + /* + game.companion = 11; + game.supercrewmate = true; + game.scmprogress = 0; + game.scmprogress = 10; + game.lastsaved = 4; + music.play(8); + */ + //game.sfpsmode = true; //Run at 60 FPS + //stage.frameRate = 60; // doesn't work, it's a bit more complex than this - will have to do a double sized window instead... + + //dwgfx.flipmode = true; + + //Testing some unlock stuff + /* + game.unlock[9] = true; //Space Station Intro Time Trial + game.unlock[10] = true; //Lab Time Trial + game.unlock[11] = true; //Tower Time Trial + game.unlock[12] = true; //Space Station 2 Time Trial + game.unlock[13] = true; //Warp Zone Time Trial + game.unlock[14] = true; //Final Level Time Trial + + game.unlock[17] = true; //No death mode + game.unlock[18] = true; //Flip Mode + + */ + //-- Normal start, with no fancy stuff! + + /* + game.gamestate = CLICKTOSTART; + dwgfx.createtextbox(" Click to Start ", 96, 107, 164, 164, 255); + dwgfx.textboxcenter(); + */ + //No click to start any more! Instead go right to the menu + + //INIT GRAPHIC MODE HERE + game.loadstats(map, dwgfx); + + //updategraphicsmode(game, dwgfx); + + game.gamestate = TITLEMODE; + + game.menustart = false; + game.mainmenu = 0; + + /*if (game.quicksummary != "") { + game.mainmenu = 2; + } + if (game.telesummary != "") { + game.mainmenu = 1; + }*/ //what the hell is that for + + + /* + game.gamestate = 6; + game.menustart = true; + map.ypos = (700-29) * 8; + map.bypos = map.ypos / 2; + map.cameramode = 0; + */ + //--Everything after this is screen recording + + //ok, screenrecording here + //don't record anything (comment both next parts) + + game.recording = 0; + + if(game.recording==1){ + trace("warning! recording input!"); + }else if(game.recording==2){ + trace("playing back input!"); + game.recordstring = "blahblahblah"; + help.toclipboard(game.recordstring); + + game.initplayback(); + game.playbackpos = 5; + game.savex = game.playback[0]; game.savey = game.playback[1]; + game.saverx = game.playback[2]; game.savery = game.playback[3]; + game.savegc = game.playback[4]; game.savedir = 1; + } + + //addEventListener(Event.ENTER_FRAME, mainloop); + + // start the tick-timer, which updates roughly every 4 milliseconds + _timer.addEventListener(TimerEvent.TIMER, mainloop); + _timer.start(); + }else { + dwgfx.init(); + addChild(dwgfx); + //We load the font in: + tempbmp = new im_bfont(); dwgfx.buffer = tempbmp.bitmapData; dwgfx.makebfont(); + tempbmp = new im_bfontmask(); dwgfx.buffer = tempbmp.bitmapData; dwgfx.makebfontmask(); + //Now that the graphics are loaded, init the background buffer + dwgfx.buffer = new BitmapData(320, 240, false, 0x000000); + + addEventListener(Event.ENTER_FRAME, lockedloop); + } } - public function waitforassetstoload():void { - //Wait till this has loaded the texture before processing - dwgfx.button_texture.push(new RenderTexture(92, 30)); - dwgfx.button_texture.push(new RenderTexture(92, 30)); - dwgfx.button_texture.push(new RenderTexture(40, 40)); - dwgfx.button_texture.push(new RenderTexture(40, 40)); - dwgfx.addbutton("mobilebuttons/map"); - dwgfx.addbutton("mobilebuttons/back"); - dwgfx.addbutton("mobilebuttons/talk_1"); - dwgfx.addbutton("mobilebuttons/talk_2"); - dwgfx.addbutton("mobilebuttons/use_1"); - dwgfx.addbutton("mobilebuttons/use_2"); - dwgfx.addbutton("mobilebuttons/teleport_1"); - dwgfx.addbutton("mobilebuttons/teleport_2"); - dwgfx.addbutton("mobilebuttons/controls_1"); - dwgfx.addbutton("mobilebuttons/controls_2"); - dwgfx.addbutton("mobilebuttons/gamecenter"); - dwgfx.addbutton("mobilebuttons/button_left"); - dwgfx.addbutton("mobilebuttons/button_right"); - dwgfx.initbuttonstuff(); + public function visit_distractionware(e:Event):void{ + var distractionware_link:URLRequest = new URLRequest( "http://www.distractionware.com" ); + navigateToURL( distractionware_link, "_blank" ); + } + + public function visit_sponsor(e:Event):void{ + var sponsor_link:URLRequest = new URLRequest( "http://www.kongregate.com/?gamereferral=dontlookback" ); + navigateToURL( sponsor_link, "_blank" ); + } + + public function visit_sponsor_logo():void{ + var sponsor_link:URLRequest = new URLRequest( "http://www.kongregate.com/?gamereferral=dontlookback" ); + navigateToURL( sponsor_link, "_blank" ); + } + + /* + public function androidresize(e:Event):void { + if (immersivemode) { + device.xres = stage.stageWidth; + device.yres = stage.stageHeight; + }else{ + device.xres = flash.system.Capabilities.screenResolutionX; + device.yres = flash.system.Capabilities.screenResolutionY; + } + if (device.xres < device.yres) { + //Switch them! + t = device.yres; + device.yres = device.xres; + device.xres = t; + } - //We load all our graphics in: - dwgfx.maketilearray(); - dwgfx.maketile2array(); - dwgfx.maketile3array(); - dwgfx.makespritearray(); - dwgfx.makeflipspritearray(); - dwgfx.maketelearray(); - dwgfx.makeentcolourarray(); + key.definestickrange(device.xres / 2, 0, 6); - //Load in the images - dwgfx.addimage("levelcomplete"); // 0 - dwgfx.addimage("minimap"); // 1 (this is the minimap!) - dwgfx.addimage("covered"); // 2 - dwgfx.addimage("elephant"); // 3 - dwgfx.addimage("gamecomplete"); // 4 - dwgfx.addimage("fliplevelcomplete"); // 5 - dwgfx.addimage("flipgamecomplete"); // 6 - dwgfx.addimage("site"); // 7 - dwgfx.addimage("site2"); // 8 - dwgfx.addimage("site3"); // 9 - dwgfx.addimage("ending"); // 10 + dwgfx.screensizemultiplier = device.yres / 240; + dwgfx.screen.width = 320 * dwgfx.screensizemultiplier; + dwgfx.screen.height = device.yres; - dwgfx.addimage("minimap"); // Minimap - dwgfx.addimage_rendertexture("minimap"); // Minimap + dwgfx.screen.x = (device.xres / 2) - (320 * dwgfx.screensizemultiplier / 2); + dwgfx.screen.y = 0; - dwgfx.addmobileimage("controls/touchscreen"); - dwgfx.addmobileimage("controls/lefthand_off"); - dwgfx.addmobileimage("controls/lefthand_near"); - dwgfx.addmobileimage("controls/lefthand_far"); - dwgfx.addmobileimage("controls/righthand_off"); - dwgfx.addmobileimage("controls/righthand_near"); - dwgfx.addmobileimage("controls/righthand_far"); - dwgfx.addmobileimage("controls/arrowleft"); - dwgfx.addmobileimage("controls/arrowright"); + dwgfx.initbuttonpositions(); + } + */ + + public function orientationChangeListener(e:StageOrientationEvent):void{ + if (e.afterOrientation == StageOrientation.DEFAULT || e.afterOrientation == StageOrientation.UPSIDE_DOWN) { + e.preventDefault(); + } + } + + public function lockedloop(e:Event):void { + dwgfx.backbuffer.lock(); - dwgfx.addplayerlevelimage("playerlevels/playerlevel_0"); - dwgfx.addplayerlevelimage("playerlevels/playerlevel_1"); - dwgfx.addplayerlevelimage("playerlevels/playerlevel_2"); - dwgfx.addplayerlevelimage("playerlevels/playerlevel_3"); - dwgfx.addplayerlevelimage("playerlevels/playerlevel_4"); - dwgfx.addplayerlevelimage("playerlevels/playerlevel_5"); - dwgfx.addplayerlevelimage("playerlevels/playerlevel_6"); - dwgfx.addplayerlevelimage("playerlevels/playerlevel_7"); - dwgfx.addplayerlevelimage("playerlevels/playerlevel_8"); - dwgfx.addplayerlevelimage("playerlevels/playerlevel_9"); - dwgfx.addplayerlevelimage("playerlevels/playerlevel_10"); - dwgfx.addplayerlevelimage("playerlevels/playerlevel_11"); - dwgfx.addplayerlevelimage("playerlevels/playerlevel_12"); - dwgfx.addplayerlevelimage("playerlevels/playerlevel_13"); - dwgfx.addplayerlevelimage("playerlevels/playerlevel_14"); - dwgfx.addplayerlevelimage("playerlevels/playerlevel_15"); - dwgfx.addplayerlevelimage("playerlevels/playerlevel_16"); + dwgfx.bprint(5, 110, "Sorry! This game can only be", 196-help.glow, 196-help.glow, 255-help.glow, true); + dwgfx.bprint(5, 120, "played on thelettervsixtim.es", 196-help.glow, 196-help.glow, 255-help.glow, true); + dwgfx.render(); + dwgfx.backbuffer.unlock(); - var c64fontbm:BitmapFont = new BitmapFont(dwgfx.starlingassets.getTexture("c64/c64_0"), - XML(new c64font_xml)); - TextField.registerCompositor(c64fontbm, "c64"); - - _timer.addEventListener(TimerEvent.TIMER, mainloop); - _timer.start(); - - androidresize(); + help.updateglow(); + } + + public function setstage(w:int, h:int):void { + //stage.stageWidth = w; + //stage.stageHeight = h; } public function sitelock():Boolean { - //we don't care about this on mobile - return true; + //No preloader for Kong version + var currUrl:String = stage.loaderInfo.url.toLowerCase(); + //chat.kongregate.com + if ((currUrl.indexOf("ile:///") <= 0) || (currUrl.indexOf("http") == 0)){ + //if ((currUrl.indexOf("distractionware.com/games") <= 0) && (currUrl.indexOf("thelettervsixtim.es/secretarea") <= 0)){ + return true; + //return false; + }else{ + return true; + } } public function input():void { @@ -574,9 +741,9 @@ package { if (game.platform.wakeupcall > 0) { game.platform.wakeupcall--; if (game.platform.wakeupcall == 0) { - //if(immersivemode){ - // AndroidFullScreen.immersiveMode(); - //} + if(immersivemode){ + //AndroidFullScreen.immersiveMode(); + } } } @@ -601,54 +768,52 @@ package { } } - public function dorender():void { - dwgfx.backbuffer.drawBundled(function():void { - if (!game.infocus) { - //dwgfx.backbuffer.lock(); - /* - dwgfx.bprint(5, 110, "Game paused", 196 - help.glow, 255 - help.glow, 196 - help.glow, true); - dwgfx.bprint(5, 120, "[click to resume]", 196 - help.glow, 255 - help.glow, 196 - help.glow, true); - dwgfx.bprint(5, 230, "Press M to mute in game", 164 - help.glow, 196 - help.glow, 164 - help.glow, true); - */ - dwgfx.render(); - //dwgfx.backbuffer.unlock(); - }else { - switch(game.gamestate){ - case TITLEMODE: - titlerender(key, dwgfx, map, game, obj, help); - break; - case GAMEMODE: - if (map.towermode) { - towerrender(key, dwgfx, game, map, obj, help); - }else{ - gamerender(key, dwgfx, game, map, obj, help); - } - break; - case CONTROLTUTORIALMODE: - controltutorialrender(key, dwgfx, game, map, obj, help); - break; - case MAPMODE: - maprender(key, dwgfx, game, map, obj, help); - break; - case TELEPORTERMODE: - teleporterrender(key, dwgfx, game, map, obj, help); - break; - case GAMECOMPLETE: - gamecompleterender(key, dwgfx, game, map, obj, help); - break; - case GAMECOMPLETE2: - gamecompleterender2(key, dwgfx, game, obj, help); - break; - case CLICKTOSTART: - //dwgfx.backbuffer.lock(); - //dwgfx.bprint(5, 115, "[Click to start]", 196 - help.glow, 196 - help.glow, 255 - help.glow, true); - dwgfx.drawgui(help); - dwgfx.render(); - //dwgfx.backbuffer.unlock(); - break; - } + public function render():void { + if (!game.infocus) { + dwgfx.backbuffer.lock(); + /* + dwgfx.bprint(5, 110, "Game paused", 196 - help.glow, 255 - help.glow, 196 - help.glow, true); + dwgfx.bprint(5, 120, "[click to resume]", 196 - help.glow, 255 - help.glow, 196 - help.glow, true); + dwgfx.bprint(5, 230, "Press M to mute in game", 164 - help.glow, 196 - help.glow, 164 - help.glow, true); + */ + dwgfx.render(); + dwgfx.backbuffer.unlock(); + }else { + switch(game.gamestate){ + case TITLEMODE: + titlerender(key, dwgfx, map, game, obj, help); + break; + case GAMEMODE: + if (map.towermode) { + towerrender(key, dwgfx, game, map, obj, help); + }else{ + gamerender(key, dwgfx, game, map, obj, help); + } + break; + case CONTROLTUTORIALMODE: + controltutorialrender(key, dwgfx, game, map, obj, help); + break; + case MAPMODE: + maprender(key, dwgfx, game, map, obj, help); + break; + case TELEPORTERMODE: + teleporterrender(key, dwgfx, game, map, obj, help); + break; + case GAMECOMPLETE: + gamecompleterender(key, dwgfx, game, obj, help); + break; + case GAMECOMPLETE2: + gamecompleterender2(key, dwgfx, game, obj, help); + break; + case CLICKTOSTART: + dwgfx.backbuffer.lock(); + //dwgfx.bprint(5, 115, "[Click to start]", 196 - help.glow, 196 - help.glow, 255 - help.glow, true); + dwgfx.drawgui(help); + dwgfx.render(); + dwgfx.backbuffer.unlock(); + break; } - }); + } } public function mainloop(e:TimerEvent):void { @@ -664,45 +829,82 @@ package { logic(); if (key.hasclicked) key.click = false; } - dorender(); + render(); e.updateAfterEvent(); } } - public function androidresize():void { - /*if(immersivemode){ - AndroidFullScreen.stage = Starling.current.nativeStage; // Set this to your app's stage - AndroidFullScreen.fullScreen(); - - device.xres = AndroidFullScreen.immersiveWidth; - device.yres = AndroidFullScreen.immersiveHeight; - }else {*/ - Starling.current.nativeStage.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE; - if(!device.localtesting){ - //device.xres = flash.system.Capabilities.screenResolutionX; - //device.yres = flash.system.Capabilities.screenResolutionY; - device.xres = Screen.mainScreen.safeArea.width; - device.yres = Screen.mainScreen.safeArea.height; - }else{ - device.xres = 1280; - device.yres = 800; - } - //} - - if (device.xres < device.yres) { - //Switch them! - var t:int = device.yres; - device.yres = device.xres; - device.xres = t; - } - key.definestickrange(device.xres / 2, 0, 6); - - dwgfx.updatescreen(device.xres, device.yres); - if(dwgfx.buttonsready) dwgfx.initbuttonpositions(); + public function setzoom(t:int, dwgfx:dwgraphicsclass):void { + /* + switch(t) { + case 1: + dwgfx.screen.width = 320; + dwgfx.screen.height = 240; + dwgfx.screen.x = (640 - 320) / 2; + dwgfx.screen.y = (480 - 240) / 2; + break; + case 2: + dwgfx.screen.width = 640; + dwgfx.screen.height = 480; + dwgfx.screen.x = 0; + dwgfx.screen.y = 0; + break; + case 3: + dwgfx.screen.width = 960; + dwgfx.screen.height = 720; + dwgfx.screen.x = (640 - 960) / 2; + dwgfx.screen.y = (480 - 720) / 2; + break; + case 4: + dwgfx.screen.width = 1280; + dwgfx.screen.height = 960; + dwgfx.screen.x = (640 - 1280) / 2; + dwgfx.screen.y = (480 - 960) / 2; + break; + } + */ } public function updategraphicsmode(game:gameclass, dwgfx:dwgraphicsclass):void { - //ghost of a function that once was + /* + swfStage = stage; + + if (game.advanced_mode) { //advanced graphics mode + //Screen Smooting + dwgfx.screen.smoothing = game.advanced_smoothing; + + //Scaling + if(game.advanced_scaling==0){ + swfStage.scaleMode = StageScaleMode.SHOW_ALL; + setzoom(2, dwgfx); + }else{ + swfStage.scaleMode = StageScaleMode.NO_SCALE; //Turn Scaling off + setzoom(game.advanced_scaling, dwgfx); + } + + stage.fullScreenSourceRect = null; + //Fullscreen + if (game.fullscreen) { + stage.displayState = StageDisplayState.FULL_SCREEN; + Mouse.hide(); + }else { + stage.displayState = StageDisplayState.NORMAL; + Mouse.show(); + } + }else{ + swfStage.scaleMode = StageScaleMode.SHOW_ALL; + if (game.fullscreen) { + dwgfx.screen.smoothing = true; + stage.fullScreenSourceRect = new Rectangle(0, 0, 640, 480); + stage.displayState = StageDisplayState.FULL_SCREEN; + Mouse.hide(); + }else { + dwgfx.screen.smoothing = false; + stage.displayState = StageDisplayState.NORMAL; + Mouse.show(); + } + } + */ } // Timer information (a shout out to ChevyRay for the implementation) @@ -714,7 +916,6 @@ package { private var _delta:Number = 0; private var _timer:Timer = new Timer(4); - public var dwgfx:dwgraphicsclass = new dwgraphicsclass(); public var music:musicclass = new musicclass(); public var help:helpclass = new helpclass(); @@ -731,12 +932,75 @@ package { public var i:int, j:int, k:int, temp:int, tempx:int, tempy:int, tempstring:String; public var tr:int, tg:int, tb:int, t:int; public var tvel:Number; + public var swfStage:Stage; public var immersivemode:Boolean; + //Embedded resources: + //Graphics + [Embed(source = '../data/graphics/tiles.png')] private var im_tiles:Class; + [Embed(source = '../data/graphics/tiles2.png')] private var im_tiles2:Class; + [Embed(source = '../data/graphics/tiles3.png')] private var im_tiles3:Class; + [Embed(source = '../data/graphics/sprites.png')] private var im_sprites:Class; + [Embed(source = '../data/graphics/flipsprites.png')] private var im_flipsprites:Class; + [Embed(source = '../data/graphics/font.png')] private var im_bfont:Class; + [Embed(source = '../data/graphics/fontmask.png')] private var im_bfontmask:Class; + [Embed(source = '../data/graphics/teleporter.png')] private var im_teleporter:Class; + [Embed(source = '../data/graphics/entcolours.png')] private var im_entcolours:Class; - [Embed(source="../data/c64.fnt", mimeType="application/octet-stream")] - public static const c64font_xml:Class; + [Embed(source = '../data/graphics/levelcomplete.png')] private var im_image0:Class; + [Embed(source = '../data/graphics/minimap.png')] private var im_image1:Class; + [Embed(source = '../data/graphics/covered.png')] private var im_image2:Class; + [Embed(source = '../data/graphics/elephant.png')] private var im_image3:Class; + [Embed(source = '../data/graphics/gamecomplete.png')] private var im_image4:Class; + [Embed(source = '../data/graphics/fliplevelcomplete.png')] private var im_image5:Class; + [Embed(source = '../data/graphics/flipgamecomplete.png')] private var im_image6:Class; + [Embed(source = '../data/graphics/site.png')] private var im_image7:Class; + [Embed(source = '../data/graphics/site2.png')] private var im_image8:Class; + [Embed(source = '../data/graphics/site3.png')] private var im_image9:Class; + [Embed(source = '../data/graphics/ending.png')] private var im_image10:Class; - //Music + [Embed(source = '../data/graphics/controls/touchscreen.png')] private var im_mobileimage1:Class; + [Embed(source = '../data/graphics/controls/lefthand_off.png')] private var im_mobileimage2:Class; + [Embed(source = '../data/graphics/controls/lefthand_near.png')] private var im_mobileimage3:Class; + [Embed(source = '../data/graphics/controls/lefthand_far.png')] private var im_mobileimage4:Class; + [Embed(source = '../data/graphics/controls/righthand_off.png')] private var im_mobileimage5:Class; + [Embed(source = '../data/graphics/controls/righthand_near.png')] private var im_mobileimage6:Class; + [Embed(source = '../data/graphics/controls/righthand_far.png')] private var im_mobileimage7:Class; + [Embed(source = '../data/graphics/controls/arrowleft.png')] private var im_mobileimage8:Class; + [Embed(source = '../data/graphics/controls/arrowright.png')] private var im_mobileimage9:Class; + //Playerlevel images + [Embed(source = '../data/graphics/playerlevels/playerlevel_0.png')] private var im_imgplayerlevel0:Class; + [Embed(source = '../data/graphics/playerlevels/playerlevel_1.png')] private var im_imgplayerlevel1:Class; + [Embed(source = '../data/graphics/playerlevels/playerlevel_2.png')] private var im_imgplayerlevel2:Class; + [Embed(source = '../data/graphics/playerlevels/playerlevel_3.png')] private var im_imgplayerlevel3:Class; + [Embed(source = '../data/graphics/playerlevels/playerlevel_4.png')] private var im_imgplayerlevel4:Class; + [Embed(source = '../data/graphics/playerlevels/playerlevel_5.png')] private var im_imgplayerlevel5:Class; + [Embed(source = '../data/graphics/playerlevels/playerlevel_6.png')] private var im_imgplayerlevel6:Class; + [Embed(source = '../data/graphics/playerlevels/playerlevel_7.png')] private var im_imgplayerlevel7:Class; + [Embed(source = '../data/graphics/playerlevels/playerlevel_8.png')] private var im_imgplayerlevel8:Class; + [Embed(source = '../data/graphics/playerlevels/playerlevel_9.png')] private var im_imgplayerlevel9:Class; + [Embed(source = '../data/graphics/playerlevels/playerlevel_10.png')] private var im_imgplayerlevel10:Class; + [Embed(source = '../data/graphics/playerlevels/playerlevel_11.png')] private var im_imgplayerlevel11:Class; + [Embed(source = '../data/graphics/playerlevels/playerlevel_12.png')] private var im_imgplayerlevel12:Class; + [Embed(source = '../data/graphics/playerlevels/playerlevel_13.png')] private var im_imgplayerlevel13:Class; + [Embed(source = '../data/graphics/playerlevels/playerlevel_14.png')] private var im_imgplayerlevel14:Class; + [Embed(source = '../data/graphics/playerlevels/playerlevel_15.png')] private var im_imgplayerlevel15:Class; + [Embed(source = '../data/graphics/playerlevels/playerlevel_16.png')] private var im_imgplayerlevel16:Class; + //iOS Buttons + [Embed(source = '../data/graphics/mobilebuttons/map.png')] private var im_button_0:Class; + [Embed(source = '../data/graphics/mobilebuttons/back.png')] private var im_button_1:Class; + [Embed(source = '../data/graphics/mobilebuttons/talk_1.png')] private var im_button_2:Class; + [Embed(source = '../data/graphics/mobilebuttons/talk_2.png')] private var im_button_3:Class; + [Embed(source = '../data/graphics/mobilebuttons/use_1.png')] private var im_button_4:Class; + [Embed(source = '../data/graphics/mobilebuttons/use_2.png')] private var im_button_5:Class; + [Embed(source = '../data/graphics/mobilebuttons/teleport_1.png')] private var im_button_6:Class; + [Embed(source = '../data/graphics/mobilebuttons/teleport_2.png')] private var im_button_7:Class; + [Embed(source = '../data/graphics/mobilebuttons/controls_1.png')] private var im_button_8:Class; + [Embed(source = '../data/graphics/mobilebuttons/controls_2.png')] private var im_button_9:Class; + [Embed(source = '../data/graphics/mobilebuttons/gamecenter.png')] private var im_button_10:Class; + [Embed(source = '../data/graphics/mobilebuttons/button_left.png')] private var im_button_11:Class; + [Embed(source = '../data/graphics/mobilebuttons/button_right.png')] private var im_button_12:Class; + + //Music [Embed(source = '../data/music/levelcomplete.mp3')] private var music_1:Class; [Embed(source = '../data/music/endgame.mp3')] private var music_2:Class; //Sound effects @@ -769,4 +1033,4 @@ package { [Embed(source = '../data/sounds/trophy.mp3')] private var ef_26:Class; [Embed(source = '../data/sounds/rescue.mp3')] private var ef_27:Class; } -} \ No newline at end of file +} \ No newline at end of file diff --git a/mobile_version/src/Preloader.as b/mobile_version/src/Preloader.as new file mode 100644 index 00000000..286678d1 --- /dev/null +++ b/mobile_version/src/Preloader.as @@ -0,0 +1,310 @@ +//Big thanks to Muku for his help with working out how to do a preloader in FlashDevelop! + +package { + import flash.display.*; + import flash.geom.*; + import flash.events.*; + import flash.net.*; + import flash.utils.getDefinitionByName; + import flash.system.fscommand; + import flash.ui.ContextMenu; + import flash.ui.ContextMenuItem; + //import com.kongregate.as3.client.KongregateAPI; + + //Mochi and Kongregate stuff is more or less ready here + + public dynamic class Preloader extends MovieClip { + public function Preloader() { + fscommand("trapallkeys", "true"); + if (stage.root.loaderInfo.url.search(/.swf$/) >= 0) { + //fscommand("showmenu", "false"); + } + stage.showDefaultContextMenu = (stage.root.loaderInfo.url.search(/.swf$/) >= 0); + + //For the offline version, manually change this + if (checksite()) { + adson = false; + }else{ + adson = true; + } + adson = false; + + //Let's assume the kong API is clever enough to do its own checking + //var kongregate:KongregateAPI = new KongregateAPI(); + //this.addChild ( kongregate ); + + //stage.showDefaultContextMenu = false; + + + //show c64 intro (30, 0), set to (-10, 100) to not show + //transition = -10; fakepercent = 100; + transition = 30; fakepercent = 0; + + + var rc_menu:ContextMenu = new ContextMenu(); + rc_menu.hideBuiltInItems(); + this.contextMenu = rc_menu; + ct = new ColorTransform(0, 0, 0, 1, 255, 255, 255, 1); //Set to white + + darkcol = 0x000000; lightcol = 0x000000; curcol = 0; + offset = 0; coltimer = 0; + + frontrect = new Rectangle(30, 20, 260, 200); + temprect = new Rectangle(0, 0, 320, 24); + + tl = new Point(0, 0); + tpoint = new Point(0, 0); + bfont_rect=new Rectangle(0,0,8,8); + var tempbmp:Bitmap; + tempbmp = new im_bfont(); buffer = tempbmp.bitmapData; + makebfont(); + + backbuffer=new BitmapData(320, 240,false,0x000000); + screenbuffer = new BitmapData(320, 240, false, 0x000000); + screen = new Bitmap(screenbuffer); + screen.width = 640;//320;//;640; + screen.height = 480;// 240;//480; + + addChild(screen); + + addEventListener(Event.ENTER_FRAME, checkFrame); + + if (!adson) { + /* + loading = new im_loading(); + loading.x = 320 - (loading.width / 2); + loading.y = 316; + addChild(loading); + */ + } + + showctp = false; + startgame = false; + } + + public function visit_distractionware(e:Event):void{ + var distractionware_link:URLRequest = new URLRequest( "http://www.distractionware.com" ); + navigateToURL( distractionware_link, "_blank" ); + } + + public function visit_sponsor(e:Event):void{ + var sponsor_link:URLRequest = new URLRequest( "http://www.kongregate.com/?gamereferral=dontlookback" ); + navigateToURL( sponsor_link, "_blank" ); + } + + public function print(x:int, y:int, t:String, r:int, g:int, b:int, cen:Boolean = false):void { + if (r < 0) r = 0; if (g < 0) g = 0; if (b < 0) b = 0; + if (r > 255) r = 255; if (g > 255) g = 255; if (b > 255) b = 255; + ct.color = RGB(r, g, b); + if (cen) x = x - (len(t)); + bfontpos = 0; + for (var i:int = 0; i < t.length; i++) { + cur = t.charCodeAt(i); + tpoint.x = x + bfontpos; tpoint.y = y; + bfont[cur].colorTransform(bfont_rect, ct); + backbuffer.copyPixels(bfont[cur], bfont_rect, tpoint); + bfontpos+=bfontlen[cur]; + } + } + + public function checkFrame(e:Event):void { + var p:Number = this.loaderInfo.bytesLoaded / this.loaderInfo.bytesTotal; + + //if (stage.root.loaderInfo.url.search(/.swf$/) >= 0) p = 0; //Not for the demo! + transition = -10; fakepercent = 100; + + if (transition < 30) transition--; + if(transition>=30){ + if (int(p * 100) >= fakepercent) fakepercent++; + if (fakepercent >= 100) { + fakepercent = 100; + startgame = true; + } + + offset = (offset + 4 + int(Math.random()*5))%32; + coltimer--; + if (coltimer <= 0) { + curcol = (curcol + int(Math.random() * 5)) % 6; + coltimer = 8; + } + switch(curcol) { + case 0: + lightcol = 0xBF596F; + darkcol = 0x883E53; + break; + case 1: + lightcol = 0x6CBC5C; + darkcol = 0x508640; + break; + case 2: + lightcol = 0x5D57AA; + darkcol = 0x2F2F6C; + break; + case 3: + lightcol = 0xB7BA5E; + darkcol = 0x848342; + break; + case 4: + lightcol = 0x5790AA; + darkcol = 0x2F5B6C; + break; + case 5: + lightcol = 0x9061B1; + darkcol = 0x583D71; + break; + } + + for (var i:int = 0; i < 18; i++) { + temprect.y = (i * 16) -offset; + if (i % 2 == 0) { + backbuffer.fillRect(temprect, lightcol); + }else{ + backbuffer.fillRect(temprect, darkcol); + } + } + + backbuffer.fillRect(frontrect, 0x3E31A2); + + + tempstring = "LOADING... " + String(int(fakepercent))+"%"; + print(282, 204, tempstring, 124, 112, 218, true); + + //Render + screenbuffer.lock(); + screenbuffer.copyPixels(backbuffer, backbuffer.rect, tl, null, null, false); + screenbuffer.unlock(); + + backbuffer.lock(); + backbuffer.fillRect(backbuffer.rect, 0x000000); + backbuffer.unlock(); + if (currentFrame >= totalFrames){ + if (startgame) { + transition = 29; + } + } + }else if (transition <= -10) { + if (currentFrame >= totalFrames){ + startup(); + } + }else if (transition < 5) { + backbuffer.fillRect(backbuffer.rect, 0x000000); + //Render + screenbuffer.lock(); + screenbuffer.copyPixels(backbuffer, backbuffer.rect, tl, null, null, false); + screenbuffer.unlock(); + + backbuffer.lock(); + backbuffer.fillRect(backbuffer.rect, 0x000000); + backbuffer.unlock(); + }else if (transition < 20) { + temprect.y = 0; + temprect.height = 240; + backbuffer.fillRect(temprect, 0x000000); + backbuffer.fillRect(frontrect, 0x3E31A2); + + tempstring = "LOADING... 100%"; + print(282, 204, tempstring, 124, 112, 218, true); + //Render + screenbuffer.lock(); + screenbuffer.copyPixels(backbuffer, backbuffer.rect, tl, null, null, false); + screenbuffer.unlock(); + + backbuffer.lock(); + backbuffer.fillRect(backbuffer.rect, 0x000000); + backbuffer.unlock(); + } + } + + private function startup():void { + // hide loader + //stop(); + removeChild(screen); + removeEventListener(Event.ENTER_FRAME, checkFrame); + //loaderInfo.removeEventListener(ProgressEvent.PROGRESS, progress); + var mainClass:Class = getDefinitionByName("Main") as Class; + addChild(new mainClass() as DisplayObject); + //stage.removeChild(this); + } + + public function checksite():Boolean { + //Returns true if on a site that doesn't use mochiads + var currUrl:String = stage.loaderInfo.url.toLowerCase(); + //chat.kongregate.com + if ((currUrl.indexOf("distractionware.com") <= 0) && + (currUrl.indexOf("flashgamelicense.com") <= 0) && + (currUrl.indexOf("kongregate.com") <= 0) && + (currUrl.indexOf("chat.kongregate.com") <= 0)){ + //return true; + return false; + }else{ + return true; + } + } + + public function len(t:String):int { + bfontpos = 0; + for (var i:int = 0; i < t.length; i++) { + cur = t.charCodeAt(i); + bfontpos+=bfontlen[cur]; + } + return bfontpos; + } + + public function RGB(red:Number,green:Number,blue:Number):Number{ + return (blue | (green << 8) | (red << 16)) + } + + public function makebfont():void { + for (var j:Number = 0; j < 16; j++) { + for (var i:Number = 0; i < 16; i++) { + var t:BitmapData = new BitmapData(8, 8, true, 0x000000); + var t2emprect:Rectangle = new Rectangle(i * 8, j * 8, 8, 8); + t.copyPixels(buffer, t2emprect, tl); + bfont.push(t); + } + } + + //Ok, now we work out the lengths (this data string cortesy of a program I wrote!) + for (i = 0; i < 256; i++) bfontlen.push(6); + var maprow:Array; + var tstring:String="4,3,5,7,6,7,6,3,4,4,7,7,3,5,2,5,6,5,6,6,6,6,6,6,6,6,2,3,5,5,5,6,7,6,6,6,6,5,5,6,6,3,6,6,5,7,7,6,6,6,6,6,5,6,7,7,7,7,5,4,5,4,5,6,4,6,6,6,6,5,5,6,6,3,6,6,5,7,7,6,6,6,6,6,5,6,7,7,7,7,5,5,3,5,6,4"; + + maprow = new Array(); + maprow = tstring.split(","); + for(var k:int = 0; k < 96; k++) { + bfontlen[k + 32] = 8;// int(maprow[k]); + } + } + + public var darkcol:int, lightcol:int, curcol:int, coltimer:int; + public var offset:int; + + public var buffer:BitmapData; + public var backbuffer:BitmapData; + public var screenbuffer:BitmapData; + public var screen:Bitmap; + + public var frontrect:Rectangle; + public var temprect:Rectangle; + + public var showctp:Boolean; + public var startgame:Boolean; + public var adson:Boolean; + + [Embed(source = '../data/graphics/font.png')] private var im_bfont:Class; + public var bfontlen:Array = new Array(); + public var bfont:Array = new Array(); + public var bfont_rect:Rectangle; + public var tl:Point, tpoint:Point; + public var bfontpos:int; + public var cur:int; + public var ct:ColorTransform; + + public var tempstring:String; + public var fakepercent:int; + + public var transition:int; + + public var statcookie:SharedObject; + } +} \ No newline at end of file diff --git a/mobile_version/src/blockclass.as b/mobile_version/src/blockclass.as index 864ca8d9..23801faf 100644 --- a/mobile_version/src/blockclass.as +++ b/mobile_version/src/blockclass.as @@ -1,7 +1,10 @@ -package { +package { + import flash.display.*; import flash.geom.*; + import flash.events.*; + import flash.net.*; - public class blockclass { + public class blockclass extends Sprite { public function blockclass():void { rect = new Rectangle(); clear(); diff --git a/mobile_version/src/com/adobe/utils/AGALMiniAssembler.as b/mobile_version/src/com/adobe/utils/AGALMiniAssembler.as deleted file mode 100644 index ca511f44..00000000 --- a/mobile_version/src/com/adobe/utils/AGALMiniAssembler.as +++ /dev/null @@ -1,805 +0,0 @@ -/* -Copyright (c) 2015, Adobe Systems Incorporated -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - -* Redistributions of source code must retain the above copyright notice, -this list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright -notice, this list of conditions and the following disclaimer in the -documentation and/or other materials provided with the distribution. - -* Neither the name of Adobe Systems Incorporated nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS -IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -package com.adobe.utils -{ - // =========================================================================== - // Imports - // --------------------------------------------------------------------------- - import flash.display3D.*; - import flash.utils.*; - - // =========================================================================== - // Class - // --------------------------------------------------------------------------- - public class AGALMiniAssembler - { // ====================================================================== - // Constants - // ---------------------------------------------------------------------- - protected static const REGEXP_OUTER_SPACES:RegExp = /^\s+|\s+$/g; - - // ====================================================================== - // Properties - // ---------------------------------------------------------------------- - // AGAL bytes and error buffer - private var _agalcode:ByteArray = null; - private var _error:String = ""; - - private var debugEnabled:Boolean = false; - - private static var initialized:Boolean = false; - public var verbose:Boolean = false; - - // ====================================================================== - // Getters - // ---------------------------------------------------------------------- - public function get error():String { return _error; } - public function get agalcode():ByteArray { return _agalcode; } - - // ====================================================================== - // Constructor - // ---------------------------------------------------------------------- - public function AGALMiniAssembler( debugging:Boolean = false ):void - { - debugEnabled = debugging; - if ( !initialized ) - init(); - } - // ====================================================================== - // Methods - // ---------------------------------------------------------------------- - - public function assemble2( ctx3d : Context3D, version:uint, vertexsrc:String, fragmentsrc:String ) : Program3D - { - var agalvertex : ByteArray = assemble ( VERTEX, vertexsrc, version ); - var agalfragment : ByteArray = assemble ( FRAGMENT, fragmentsrc, version ); - var prog : Program3D = ctx3d.createProgram(); - prog.upload(agalvertex,agalfragment); - return prog; - } - - public function assemble( mode:String, source:String, version:uint=1, ignorelimits:Boolean=false ):ByteArray - { - var start:uint = getTimer(); - - _agalcode = new ByteArray(); - _error = ""; - - var isFrag:Boolean = false; - - if ( mode == FRAGMENT ) - isFrag = true; - else if ( mode != VERTEX ) - _error = 'ERROR: mode needs to be "' + FRAGMENT + '" or "' + VERTEX + '" but is "' + mode + '".'; - - agalcode.endian = Endian.LITTLE_ENDIAN; - agalcode.writeByte( 0xa0 ); // tag version - agalcode.writeUnsignedInt( version ); // AGAL version, big endian, bit pattern will be 0x01000000 - agalcode.writeByte( 0xa1 ); // tag program id - agalcode.writeByte( isFrag ? 1 : 0 ); // vertex or fragment - - initregmap(version, ignorelimits); - - var lines:Array = source.replace( /[\f\n\r\v]+/g, "\n" ).split( "\n" ); - var nest:int = 0; - var nops:int = 0; - var i:int; - var lng:int = lines.length; - - for ( i = 0; i < lng && _error == ""; i++ ) - { - var line:String = new String( lines[i] ); - line = line.replace( REGEXP_OUTER_SPACES, "" ); - - // remove comments - var startcomment:int = line.search( "//" ); - if ( startcomment != -1 ) - line = line.slice( 0, startcomment ); - - // grab options - var optsi:int = line.search( /<.*>/g ); - var opts:Array; - if ( optsi != -1 ) - { - opts = line.slice( optsi ).match( /([\w\.\-\+]+)/gi ); - line = line.slice( 0, optsi ); - } - - // find opcode - var opCode:Array = line.match( /^\w{3}/ig ); - if ( !opCode ) - { - if ( line.length >= 3 ) - trace( "warning: bad line "+i+": "+lines[i] ); - continue; - } - var opFound:OpCode = OPMAP[ opCode[0] ]; - - // if debug is enabled, output the opcodes - if ( debugEnabled ) - trace( opFound ); - - if ( opFound == null ) - { - if ( line.length >= 3 ) - trace( "warning: bad line "+i+": "+lines[i] ); - continue; - } - - line = line.slice( line.search( opFound.name ) + opFound.name.length ); - - if ( ( opFound.flags & OP_VERSION2 ) && version<2 ) - { - _error = "error: opcode requires version 2."; - break; - } - - if ( ( opFound.flags & OP_VERT_ONLY ) && isFrag ) - { - _error = "error: opcode is only allowed in vertex programs."; - break; - } - - if ( ( opFound.flags & OP_FRAG_ONLY ) && !isFrag ) - { - _error = "error: opcode is only allowed in fragment programs."; - break; - } - if ( verbose ) - trace( "emit opcode=" + opFound ); - - agalcode.writeUnsignedInt( opFound.emitCode ); - nops++; - - if ( nops > MAX_OPCODES ) - { - _error = "error: too many opcodes. maximum is "+MAX_OPCODES+"."; - break; - } - - // get operands, use regexp - var regs:Array; - - // will match both syntax - regs = line.match( /vc\[([vof][acostdip]?)(\d*)?(\.[xyzw](\+\d{1,3})?)?\](\.[xyzw]{1,4})?|([vof][acostdip]?)(\d*)?(\.[xyzw]{1,4})?/gi ); - - if ( !regs || regs.length != opFound.numRegister ) - { - _error = "error: wrong number of operands. found "+regs.length+" but expected "+opFound.numRegister+"."; - break; - } - - var badreg:Boolean = false; - var pad:uint = 64 + 64 + 32; - var regLength:uint = regs.length; - - for ( var j:int = 0; j < regLength; j++ ) - { - var isRelative:Boolean = false; - var relreg:Array = regs[ j ].match( /\[.*\]/ig ); - if ( relreg && relreg.length > 0 ) - { - regs[ j ] = regs[ j ].replace( relreg[ 0 ], "0" ); - - if ( verbose ) - trace( "IS REL" ); - isRelative = true; - } - - var res:Array = regs[j].match( /^\b[A-Za-z]{1,2}/ig ); - if ( !res ) - { - _error = "error: could not parse operand "+j+" ("+regs[j]+")."; - badreg = true; - break; - } - var regFound:Register = REGMAP[ res[ 0 ] ]; - - // if debug is enabled, output the registers - if ( debugEnabled ) - trace( regFound ); - - if ( regFound == null ) - { - _error = "error: could not find register name for operand "+j+" ("+regs[j]+")."; - badreg = true; - break; - } - - if ( isFrag ) - { - if ( !( regFound.flags & REG_FRAG ) ) - { - _error = "error: register operand "+j+" ("+regs[j]+") only allowed in vertex programs."; - badreg = true; - break; - } - if ( isRelative ) - { - _error = "error: register operand "+j+" ("+regs[j]+") relative adressing not allowed in fragment programs."; - badreg = true; - break; - } - } - else - { - if ( !( regFound.flags & REG_VERT ) ) - { - _error = "error: register operand "+j+" ("+regs[j]+") only allowed in fragment programs."; - badreg = true; - break; - } - } - - regs[j] = regs[j].slice( regs[j].search( regFound.name ) + regFound.name.length ); - //trace( "REGNUM: " +regs[j] ); - var idxmatch:Array = isRelative ? relreg[0].match( /\d+/ ) : regs[j].match( /\d+/ ); - var regidx:uint = 0; - - if ( idxmatch ) - regidx = uint( idxmatch[0] ); - - if ( regFound.range < regidx ) - { - _error = "error: register operand "+j+" ("+regs[j]+") index exceeds limit of "+(regFound.range+1)+"."; - badreg = true; - break; - } - - var regmask:uint = 0; - var maskmatch:Array = regs[j].match( /(\.[xyzw]{1,4})/ ); - var isDest:Boolean = ( j == 0 && !( opFound.flags & OP_NO_DEST ) ); - var isSampler:Boolean = ( j == 2 && ( opFound.flags & OP_SPECIAL_TEX ) ); - var reltype:uint = 0; - var relsel:uint = 0; - var reloffset:int = 0; - - if ( isDest && isRelative ) - { - _error = "error: relative can not be destination"; - badreg = true; - break; - } - - if ( maskmatch ) - { - regmask = 0; - var cv:uint; - var maskLength:uint = maskmatch[0].length; - for ( var k:int = 1; k < maskLength; k++ ) - { - cv = maskmatch[0].charCodeAt(k) - "x".charCodeAt(0); - if ( cv > 2 ) - cv = 3; - if ( isDest ) - regmask |= 1 << cv; - else - regmask |= cv << ( ( k - 1 ) << 1 ); - } - if ( !isDest ) - for ( ; k <= 4; k++ ) - regmask |= cv << ( ( k - 1 ) << 1 ); // repeat last - } - else - { - regmask = isDest ? 0xf : 0xe4; // id swizzle or mask - } - - if ( isRelative ) - { - var relname:Array = relreg[0].match( /[A-Za-z]{1,2}/ig ); - var regFoundRel:Register = REGMAP[ relname[0]]; - if ( regFoundRel == null ) - { - _error = "error: bad index register"; - badreg = true; - break; - } - reltype = regFoundRel.emitCode; - var selmatch:Array = relreg[0].match( /(\.[xyzw]{1,1})/ ); - if ( selmatch.length==0 ) - { - _error = "error: bad index register select"; - badreg = true; - break; - } - relsel = selmatch[0].charCodeAt(1) - "x".charCodeAt(0); - if ( relsel > 2 ) - relsel = 3; - var relofs:Array = relreg[0].match( /\+\d{1,3}/ig ); - if ( relofs.length > 0 ) - reloffset = relofs[0]; - if ( reloffset < 0 || reloffset > 255 ) - { - _error = "error: index offset "+reloffset+" out of bounds. [0..255]"; - badreg = true; - break; - } - if ( verbose ) - trace( "RELATIVE: type="+reltype+"=="+relname[0]+" sel="+relsel+"=="+selmatch[0]+" idx="+regidx+" offset="+reloffset ); - } - - if ( verbose ) - trace( " emit argcode="+regFound+"["+regidx+"]["+regmask+"]" ); - if ( isDest ) - { - agalcode.writeShort( regidx ); - agalcode.writeByte( regmask ); - agalcode.writeByte( regFound.emitCode ); - pad -= 32; - } else - { - if ( isSampler ) - { - if ( verbose ) - trace( " emit sampler" ); - var samplerbits:uint = 5; // type 5 - var optsLength:uint = opts == null ? 0 : opts.length; - var bias:Number = 0; - for ( k = 0; k 50){ bvx = 9 - (Math.random() * 19); if (bvx > -6 && bvx < 6) bvx = 6; - bvx = bvx * 1.5; + bvx = bvx * 1.5; bb = new Rectangle(Math.random() * 320, Math.random() * 240, 32, 12); }else { bvy = 9 - (Math.random() * 19); if (bvy > -6 && bvy < 6) bvy = 6; - bvy = bvy * 1.5; + bvy = bvy * 1.5; bb = new Rectangle(Math.random() * 320, Math.random() * 240, 12, 32); } var bint:Number = 0.5 + ((Math.random() * 100) / 200); @@ -144,7 +77,7 @@ package{ crewframe = 0; crewframedelay = 4; menuoffset = 0; resumegamemode = false; - //Textboxes! + //Textboxes! for (i = 0; i < 30; i++) { var t:textboxclass = new textboxclass; textbox.push(t); @@ -158,27 +91,67 @@ package{ fadeamount = 0; fademode = 0; + bigbuffer = new BitmapData(320, 32, true, 0x000000); + bigbufferscreen = new Bitmap(bigbuffer); + bigbufferscreen.width = 640; + bigbufferscreen.height = 20; - //var devicexres:int = int(Capabilities.screenResolutionX); - //var deviceyres:int = int(Capabilities.screenResolutionY); - //updatescreen(starstage.stageWidth, starstage.stageHeight); + towerbuffer = new BitmapData(320, 240, true, 0x000000); + frontbuffer = new BitmapData(320, 240, true, 0x000000); - //Starling.current.showStats = true; - } - - public function initbuttonstuff():void { - button_image_width.push(0); button_image_height.push(0); - button_image_width.push(0); button_image_height.push(0); - button_image_width.push(0); button_image_height.push(0); - button_image_width.push(0); button_image_height.push(0); - button_image.push(new Image(button_texture[0])); - button_image.push(new Image(button_texture[1])); - button_image.push(new Image(button_texture[2])); - button_image.push(new Image(button_texture[3])); - button_image[0].touchable = false; button_image[0].textureSmoothing = TextureSmoothing.NONE; - button_image[1].touchable = false; button_image[1].textureSmoothing = TextureSmoothing.NONE; - button_image[2].touchable = false; button_image[2].textureSmoothing = TextureSmoothing.NONE; - button_image[3].touchable = false; button_image[3].textureSmoothing = TextureSmoothing.NONE; + menubuffer = new BitmapData(320, 240, false, 0x000000); //yeah yeah I know this is lazy + + backbuffer=new BitmapData(320, 240,false,0x000000); + screenbuffer = new BitmapData(320,240,false,0x000000); + + temptile = new BitmapData(8, 8, false, 0x000000); + tempsprite = new BitmapData(32, 32, false, 0x000000); + screen = new Bitmap(screenbuffer); + + //screen.width = 640;//320;//;640; + //screen.height = 480;// 240;//480; + screen.smoothing = true; + + addChild(screen); + + buttonscreen.push(new Bitmap(buttonimg[0])); + buttonscreen.push(new Bitmap(buttonimg[1])); + buttonscreen.push(new Bitmap(buttonimg[2])); + buttonscreen.push(new Bitmap(buttonimg[3])); + + /* + if (device.deviceresolution == device.IPAD) { + buttonsize = 90; + buttonyspacing = buttonsize / 3; + buttonxspacing = 40; + buttonscreen[0].width = 92*3; buttonscreen[0].height = buttonsize; + buttonscreen[1].width = 92*3; buttonscreen[1].height = buttonsize; + buttonscreen[2].width = 40*3; buttonscreen[2].height = 40*3; + buttonscreen[3].width = 40 * 3; buttonscreen[3].height = 40 * 3; + buttonydiff = buttonscreen[2].height / 2; + }else if (device.deviceresolution == device.ANDROID) { + */ + + /* + }else { + buttonsize = 30; + buttonyspacing = buttonsize / 3; + buttonxspacing = 20; + buttonscreen[0].width = 92; buttonscreen[0].height = buttonsize; + buttonscreen[1].width = 92; buttonscreen[1].height = buttonsize; + buttonscreen[2].width = 40; buttonscreen[2].height = 40; + buttonscreen[3].width = 40; buttonscreen[3].height = 40; + buttonydiff = buttonscreen[2].height / 2; + } + */ + + /*buttonscreen.push(new Bitmap(buttonimg[1])); + buttonscreen[1].width = buttonsize; buttonscreen[1].height = buttonsize; + buttonscreen.push(new Bitmap(buttonimg[2])); + buttonscreen[2].width = buttonsize; buttonscreen[2].height = buttonsize; + buttonscreen.push(new Bitmap(buttonimg[3])); + buttonscreen[3].width = buttonsize; buttonscreen[3].height = buttonsize; + */ for (i = 0; i < 10; i++) { buttonlerp.push(int(0)); @@ -199,81 +172,72 @@ package{ initbuttonpositions(); + /* + buttonscreen[0].x = buttonxspacing; + buttonscreen[0].y = device.yres - buttonsize-buttonyspacing-buttonydiff; + buttonpos.push(new Point(buttonscreen[0].x, buttonscreen[0].y)); + + buttonscreen[1].x = buttonxspacing + buttonsize + buttonxspacing; + buttonscreen[1].y = device.yres - buttonsize-buttonyspacing; + buttonpos.push(new Point(buttonscreen[1].x, buttonscreen[1].y)); + + buttonscreen[2].x = device.xres - buttonxspacing - buttonsize; + buttonscreen[2].y = buttonsize / 4; + buttonpos.push(new Point(buttonscreen[2].x, buttonscreen[2].y)); + + buttonscreen[3].x = device.xres - buttonxspacing - buttonsize - buttonxspacing - buttonsize; + buttonscreen[3].y = device.yres - buttonsize-buttonyspacing; + buttonpos.push(new Point(buttonscreen[3].x, buttonscreen[3].y)); + */ drawonscreenbutton(0, -1); drawonscreenbutton(1, -1); drawonscreenbutton(2, -1); drawonscreenbutton(3, -1); - starstage.addChild(button_image[0]); - starstage.addChild(button_image[1]); - starstage.addChild(button_image[2]); - starstage.addChild(button_image[3]); - - buttonsready = true; - } - - public function updatescreen(w:int, h:int):void { - starstage.stageWidth = w; - starstage.stageHeight = h; - - Starling.current.viewPort = new Rectangle(0, 0, w, h); - - // set rectangle dimensions for viewPort: - var stretchscalex:Number = w / screenwidth; - var stretchscaley:Number = h / screenheight; - screensizemultiplier = Math.min(stretchscalex, stretchscaley); - - //Never mess with starling's viewport for VVVVVV - instead, mess with the - //screen image - screen.width = screenwidth * screensizemultiplier; - screen.height = screenheight * screensizemultiplier; - - screen.x = (w / 2) - (screenwidth * screensizemultiplier / 2); - } + addChild(buttonscreen[0]); + addChild(buttonscreen[1]); + addChild(buttonscreen[2]); + addChild(buttonscreen[3]); + /* + drawonscreenbutton(0, 0); + drawonscreenbutton(1, 0); + drawonscreenbutton(2, 0); + drawonscreenbutton(3, 0); + showarrows(); + */ + } public function initbuttonpositions():void { - devicex = device.xres; + devicex = device.xres; devicey = device.yres; - buttonsize = devicey / (32 / 3); + buttonsize = device.yres / (32 / 3); buttonyspacing = buttonsize / 3; - buttonxspacing = (buttonsize * 3) / 3; + buttonxspacing = (buttonsize * 3) / 3; + buttonscreen[0].width = (buttonsize * 46) / 15; buttonscreen[0].height = buttonsize; + buttonscreen[1].width = (buttonsize * 46) / 15; buttonscreen[1].height = buttonsize; + buttonscreen[2].width = (buttonsize * 5) / 3; buttonscreen[2].height = (buttonsize * 5) / 3; + buttonscreen[3].width = (buttonsize * 5) / 3; buttonscreen[3].height = (buttonsize * 5) / 3; + buttonydiff = buttonscreen[2].height / 2; - button_image[0].width = (buttonsize * 46) / 15; button_image[0].height = buttonsize; - button_image[1].width = (buttonsize * 46) / 15; button_image[1].height = buttonsize; - button_image[2].width = (buttonsize * 5) / 3; button_image[2].height = (buttonsize * 5) / 3; - button_image[3].width = (buttonsize * 5) / 3; button_image[3].height = (buttonsize * 5) / 3; + buttonscreen[0].x = device.xres + 1; + buttonscreen[0].y = 0; + buttonpos[0].setTo(buttonscreen[0].x, buttonscreen[0].y); - button_image_width[0] = int(button_image[0].width); - button_image_width[1] = int(button_image[1].width); - button_image_width[2] = int(button_image[2].width); - button_image_width[3] = int(button_image[3].width); - button_image_height[0] = int(button_image[0].height); - button_image_height[1] = int(button_image[1].height); - button_image_height[2] = int(button_image[2].height); - button_image_height[3] = int(button_image[3].height); + buttonscreen[1].x = 0; + buttonscreen[1].y = 0; + buttonpos[1].setTo(buttonscreen[1].x, buttonscreen[1].y); + buttonscreen[2].x = (buttonxspacing / 2); + buttonscreen[2].y = device.yres - buttonsize-buttonyspacing - buttonydiff; + buttonpos[2].setTo(buttonscreen[2].x, buttonscreen[2].y); - buttonydiff = button_image_height[2] / 2; - - button_image[0].x = devicex + 1; - button_image[0].y = 0; - buttonpos[0].setTo(button_image[0].x, button_image[0].y); - - button_image[1].x = 0; - button_image[1].y = 0; - buttonpos[1].setTo(button_image[1].x, button_image[1].y); - - button_image[2].x = (buttonxspacing / 2); - button_image[2].y = devicey - buttonsize-buttonyspacing - buttonydiff; - buttonpos[2].setTo(button_image[2].x, button_image[2].y); - - button_image[3].x = (buttonxspacing/2) + buttonsize + buttonxspacing ; - button_image[3].y = devicey - buttonsize-buttonyspacing; - buttonpos[3].setTo(button_image[3].x, button_image[3].y); + buttonscreen[3].x = (buttonxspacing/2) + buttonsize + buttonxspacing; + buttonscreen[3].y = device.yres - buttonsize-buttonyspacing; + buttonpos[3].setTo(buttonscreen[3].x, buttonscreen[3].y); } public function mobile_changebutton(t:int):void { - if (newbuttontype[0] != t) { + if (newbuttontype[0] != t) { if (currentbuttontype[0] != t) { newbuttontype[0] = t; buttonstate[0] = 1; @@ -282,7 +246,7 @@ package{ } public function mobile_changeleftbutton(t:int):void { - if (newbuttontype[1] != t) { + if (newbuttontype[1] != t) { if (currentbuttontype[1] != t) { newbuttontype[1] = t; buttonstate[1] = 1; @@ -311,7 +275,7 @@ package{ } public function drawbutton(game:gameclass, help:helpclass):void { - //Called every frame, this function controls what buttons appear and when, + //Called every frame, this function controls what buttons appear and when, //and lerps them in and out in a nice way. //buttonstate[0]: // 0 - Normal, slide in if not in @@ -355,13 +319,13 @@ package{ changebuttonframe(3, 12); if (game.press_left) { - changebuttonpos(2, (buttonxspacing/2), devicey - buttonsize-buttonyspacing - buttonydiff+10); + changebuttonpos(2, buttonxspacing/2, devicey - buttonsize-buttonyspacing - buttonydiff+10); }else{ - changebuttonpos(2, (buttonxspacing/2), devicey - buttonsize-buttonyspacing - buttonydiff); + changebuttonpos(2, buttonxspacing/2, devicey - buttonsize-buttonyspacing - buttonydiff); } if (game.press_right) { - changebuttonpos(3, (buttonxspacing/2) + buttonsize + buttonxspacing, devicey - buttonsize-buttonyspacing - buttonydiff+10); + changebuttonpos(3, (buttonxspacing/2)+ buttonsize + buttonxspacing, devicey - buttonsize-buttonyspacing - buttonydiff+10); }else{ changebuttonpos(3, (buttonxspacing/2) + buttonsize + buttonxspacing, devicey - buttonsize-buttonyspacing - buttonydiff); } @@ -372,7 +336,7 @@ package{ case BUTTON_BLANK: //Blank changebuttonframe(1, -1); - changebuttonpos(1, 0 - ((button_image_width[1] * (buttonlerp[1])) / 100), 0); + changebuttonpos(1, 0 - ((buttonscreen[1].width * (buttonlerp[1])) / 100), 0); break; case BUTTON_CONTROLS: //Controls button @@ -382,15 +346,15 @@ package{ changebuttonframe(1, 8); } if (flipmode) { - changebuttonpos(1, 0 - ((button_image_width[1] * (buttonlerp[1])) / 100), devicey - buttonyspacing - button_image_height[1]); + changebuttonpos(1, 0 - ((buttonscreen[1].width * (buttonlerp[1])) / 100), devicey-buttonyspacing-buttonscreen[1].height); }else { - changebuttonpos(1, 0 - ((button_image_width[1] * (buttonlerp[1])) / 100), buttonyspacing); + changebuttonpos(1, 0 - ((buttonscreen[1].width * (buttonlerp[1])) / 100), buttonyspacing); } break; case BUTTON_GAMECENTER: changebuttonframe(1, 10); - changebuttonpos(1, 0 - ((button_image_width[1] * (buttonlerp[1])) / 100), 5); + changebuttonpos(1, 0 - ((buttonscreen[1].width * (buttonlerp[1])) / 100), 5); break; } @@ -398,20 +362,20 @@ package{ case BUTTON_BLANK: //Blank changebuttonframe(0, -1); - changebuttonpos(0, devicex - ((button_image_width[0] * (100-buttonlerp[0])) / 100), 0); + changebuttonpos(0, devicex - ((buttonscreen[0].width * (100-buttonlerp[0])) / 100), 0); break; case BUTTON_MENU: //Menu button changebuttonframe(0, 0); - changebuttonpos(0, devicex - ((button_image_width[0] * (100-buttonlerp[0])) / 100), 0); + changebuttonpos(0, devicex - ((buttonscreen[0].width * (100-buttonlerp[0])) / 100), 0); break; case BUTTON_BACK: //Back button changebuttonframe(0, 1); if (flipmode) { - changebuttonpos(0, devicex - ((button_image_width[0] * (100 - buttonlerp[0])) / 100), devicey - buttonyspacing - button_image_height[0]); + changebuttonpos(0, devicex - ((buttonscreen[0].width * (100 - buttonlerp[0])) / 100), devicey - buttonyspacing - buttonscreen[0].height); }else{ - changebuttonpos(0, devicex - ((button_image_width[0] * (100 - buttonlerp[0])) / 100), buttonyspacing); + changebuttonpos(0, devicex - ((buttonscreen[0].width * (100 - buttonlerp[0])) / 100), buttonyspacing); } break; case BUTTON_USE: @@ -421,7 +385,7 @@ package{ }else { changebuttonframe(0, 5); } - changebuttonpos(0, devicex - ((button_image_width[0] * (100-buttonlerp[0])) / 100), buttonyspacing); + changebuttonpos(0, devicex - ((buttonscreen[0].width * (100-buttonlerp[0])) / 100), buttonyspacing); break; case BUTTON_TALK: //Talk button @@ -430,7 +394,7 @@ package{ }else { changebuttonframe(0, 3); } - changebuttonpos(0, devicex - ((button_image_width[0] * (100-buttonlerp[0])) / 100), buttonyspacing); + changebuttonpos(0, devicex - ((buttonscreen[0].width * (100-buttonlerp[0])) / 100), buttonyspacing); break; case BUTTON_TELEPORT: //Teleport button @@ -439,34 +403,48 @@ package{ }else { changebuttonframe(0, 7); } - changebuttonpos(0, devicex - ((button_image_width[0] * (100-buttonlerp[0])) / 100), buttonyspacing); + changebuttonpos(0, devicex - ((buttonscreen[0].width * (100-buttonlerp[0])) / 100), buttonyspacing); break; } + + /* + if (game.press_left) { drawonscreenbutton(0, 1); + }else{ drawonscreenbutton(0, 0);} + + if (game.press_right) { drawonscreenbutton(1, 1); + }else { drawonscreenbutton(1, 0); } + + if (game.press_map) { drawonscreenbutton(2, 1); + }else { drawonscreenbutton(2, 0); } + */ + //Draw circle pad! + //if (key.controlstick != -1) { + /* + backbuffer.copyPixels(dwgfx.buttonimg[13], dwgfx.buttonimg[13].rect, new Point(key.controlstick_x - 18+18, key.controlstick_y - 18+18)); + for (i = 0; i < key.touchPoints; i++) { + if (key.touchid[i] == key.controlstick) { + dwgfx.backbuffer.copyPixels(dwgfx.buttonimg[14], dwgfx.buttonimg[14].rect, new Point(key.touchx[i] - 18, key.touchy[i] - 18)); + } + } + */ + //} } - public function addbutton(imgname:String):void { - var sourcetexture:Texture = starlingassets.getTexture(imgname); - var tmpimage:Image = new Image(sourcetexture); - - var newtexture:RenderTexture = new RenderTexture(int(tmpimage.texture.width), int(tmpimage.texture.height)); - newtexture.draw(tmpimage); - - sourcetexture.dispose(); - tmpimage.dispose(); - - button_texture.push(newtexture); + public function addbutton():void { + var t:BitmapData = new BitmapData(buffer.width, buffer.height, true, 0x00000000); + t.copyPixels(buffer, new Rectangle(0,0,buffer.width, buffer.height), new Point(0,0)); + buttonimg.push(t); } public function drawonscreenbutton(t:int, t2:int):void { //Draw button t with frame t2 if (t2 == -1) { - button_texture[t].clear(); + buttonimg[t].fillRect(buttonimg[t].rect, 0x00000000); } if (buttonframe[t] != t2) { buttonframe[t] = t2; - button_texture[t].clear(); - var tempimg:Image = new Image(button_texture[4 + t2]); - button_texture[t].draw(tempimg); + buttonimg[t].fillRect(buttonimg[t].rect, 0x00000000); + buttonimg[t].copyPixels(buttonimg[4 + t2], buttonimg[t].rect, tl); } } @@ -475,169 +453,167 @@ package{ if (buttonframe[t] != t2) { buttonframe[t] = t2; if (t2 == -1) { - button_texture[t].clear(); + buttonimg[t].fillRect(buttonimg[t].rect, 0x00000000); }else{ - button_texture[t].clear(); - var tempimg:Image = new Image(button_texture[4 + t2]); - button_texture[t].draw(tempimg); + buttonimg[t].fillRect(buttonimg[t].rect, 0x00000000); + buttonimg[t].copyPixels(buttonimg[4 + t2], buttonimg[t].rect, tl); } } } public function changebuttonpos(t:int, xp:int, yp:int):void { - button_image[t].x = xp; - button_image[t].y = yp; + buttonscreen[t].x = xp; + buttonscreen[t].y = yp; } public function changebuttonxpos(t:int, xp:int):void { - button_image[t].x = xp; + buttonscreen[t].x = xp; } public function showarrows():void { if (buttonactive[0] == false) { buttonhighlight[0] = 120; buttonactive[0] = true; - starstage.addChild(button_image[0]); - starstage.addChild(button_image[1]); - starstage.addChild(button_image[2]); + addChild(buttonscreen[0]); + addChild(buttonscreen[1]); + addChild(buttonscreen[2]); } } public function hidearrows():void { if (buttonactive[0] == true) { buttonactive[0] = false; - starstage.removeChild(button_image[0]); - starstage.removeChild(button_image[1]); - starstage.removeChild(button_image[2]); + removeChild(buttonscreen[0]); + removeChild(buttonscreen[1]); + removeChild(buttonscreen[2]); } } + public function drawspritesetcol(x:int, y:int, t:int, c:int, help:helpclass):void { - setcol(c, help); - sprites[t].color = ct.color; - tposition.identity(); - tposition.translate(x, y); - backbuffer.draw(sprites[t], tposition); + tpoint.x = x; tpoint.y = y; + setcol(c, help); + sprites[t].colorTransform(sprites_rect, ct); + backbuffer.copyPixels(sprites[t], sprites_rect, tpoint); + } + + + public function makebfont():void { + for (var j:Number = 0; j < 16; j++) { + for (var i:Number = 0; i < 16; i++) { + var t:BitmapData = new BitmapData(8, 8, true, 0x000000); + var t2:BitmapData = new BitmapData(8, 8, true, 0x000000); + var temprect:Rectangle = new Rectangle(i * 8, j * 8, 8, 8); + t.copyPixels(buffer, temprect, tl); + t2.draw(t, flipfontmatrix); + bfont.push(t); + flipbfont.push(t2); + } + } + + //Ok, now we work out the lengths (this data string cortesy of a program I wrote!) + for (i = 0; i < 256; i++) bfontlen.push(6); + var maprow:Array; + var tstring:String="4,3,5,7,6,7,6,3,4,4,7,7,3,5,2,5,6,5,6,6,6,6,6,6,6,6,2,3,5,5,5,6,7,6,6,6,6,5,5,6,6,3,6,6,5,7,7,6,6,6,6,6,5,6,7,7,7,7,5,4,5,4,5,6,4,6,6,6,6,5,5,6,6,3,6,6,5,7,7,6,6,6,6,6,5,6,7,7,7,7,5,5,3,5,6,4"; + + maprow = new Array(); + maprow = tstring.split(","); + for(var k:int = 0; k < 96; k++) { + bfontlen[k + 32] = 8;// int(maprow[k]); + } + } + + public function makebfontmask():void { + for (var j:Number = 0; j < 16; j++) { + for (var i:Number = 0; i < 16; i++) { + var t:BitmapData = new BitmapData(9, 9, true, 0x000000); + var t2:BitmapData = new BitmapData(9, 9, true, 0x000000); + var temprect:Rectangle = new Rectangle(i * 9, j * 9, 9, 9); + t.copyPixels(buffer, temprect, tl); + t2.draw(t, flipfontmatrix2); + bfontmask.push(t); + flipbfontmask.push(t2); + } + } } public function makeentcolourarray():void { - var sourcetexture:Texture = starlingassets.getTexture("entcolours"); - for (var j:int = 0; j < 60; j++) { - for (var i:int = 0; i < 12; i++) { - var tiletex:Texture = Texture.fromTexture(sourcetexture, new Rectangle(i * 8, j * 8, 8, 8)); - var t:Image = new Image(tiletex); - t.textureSmoothing = TextureSmoothing.NONE; - t.touchable = false; + for (var j:Number = 0; j < 60; j++) { + for (var i:Number = 0; i < 12; i++) { + var t:BitmapData = new BitmapData(8, 8, true, 0x000000); + var temprect:Rectangle = new Rectangle(i * 8, j * 8, 8, 8); + t.copyPixels(buffer, temprect, tl); entcolours.push(t); } } } public function maketilearray():void { - var sourcetexture:Texture = starlingassets.getTexture("tiles"); - for (var j:int = 0; j < 30; j++) { - for (var i:int = 0; i < 40; i++) { - var tiletex:Texture = Texture.fromTexture(sourcetexture, new Rectangle(i * 8, j * 8, 8, 8)); - var tile:Image = new Image(tiletex); - tile.textureSmoothing = TextureSmoothing.NONE; - tile.touchable = false; - tiles.push(tile); + for (var j:Number = 0; j < 30; j++) { + for (var i:Number = 0; i < 40; i++) { + var t:BitmapData = new BitmapData(8, 8, true, 0x000000); + var temprect:Rectangle = new Rectangle(i * 8, j * 8, 8, 8); + t.copyPixels(buffer, temprect, tl); + tiles.push(t); } } } public function maketile2array():void { - var sourcetexture:Texture = starlingassets.getTexture("tiles2"); - for (var j:int = 0; j < 30; j++) { - for (var i:int = 0; i < 40; i++) { - var tiletex:Texture = Texture.fromTexture(sourcetexture, new Rectangle(i * 8, j * 8, 8, 8)); - var tile:Image = new Image(tiletex); - tile.textureSmoothing = TextureSmoothing.NONE; - tile.touchable = false; - tiles2.push(tile); + for (var j:Number = 0; j < 30; j++) { + for (var i:Number = 0; i < 40; i++) { + var t:BitmapData = new BitmapData(8, 8, true, 0x000000); + var temprect:Rectangle = new Rectangle(i * 8, j * 8, 8, 8); + t.copyPixels(buffer, temprect, tl); + tiles2.push(t); } } } public function maketile3array():void { - var sourcetexture:Texture = starlingassets.getTexture("tiles3"); - for (var j:int = 0; j < 30; j++) { - for (var i:int = 0; i < 30; i++) { - var tiletex:Texture = Texture.fromTexture(sourcetexture, new Rectangle(i * 8, j * 8, 8, 8)); - var tile:Image = new Image(tiletex); - tile.textureSmoothing = TextureSmoothing.NONE; - tile.touchable = false; - tiles3.push(tile); + for (var j:Number = 0; j < 30; j++) { + for (var i:Number = 0; i < 30; i++) { + var t:BitmapData = new BitmapData(8, 8, true, 0x000000); + var temprect:Rectangle = new Rectangle(i * 8, j * 8, 8, 8); + t.copyPixels(buffer, temprect, tl); + tiles3.push(t); } } } public function makespritearray():void { - var sourcetexture:Texture = starlingassets.getTexture("sprites"); - for (var j:int = 0; j < 16; j++) { - for (var i:int = 0; i < 12; i++) { - var tiletex:Texture = Texture.fromTexture(sourcetexture, new Rectangle(i * 32, j * 32, 32, 32)); - var t:Image = new Image(tiletex); - t.textureSmoothing = TextureSmoothing.NONE; - t.touchable = false; - sprites.push(t); - } - } - - //Sprites also need to load flash bitmapdatas, which are used for pixel perfect hittests - var b:Bitmap = new img_bitmapsprites(); - var buffer:BitmapData = b.bitmapData; - - for (j = 0; j < 16; j++) { - for (i = 0; i < 12; i++) { - var tb:BitmapData = new BitmapData(32, 32, true, 0x000000); + for (var j:Number = 0; j < 16; j++) { + for (var i:Number = 0; i < 12; i++) { + var t:BitmapData = new BitmapData(32, 32, true, 0x000000); var temprect:Rectangle = new Rectangle(i * 32, j * 32, 32, 32); - tb.copyPixels(buffer, temprect, tl); - sprites_bitmap.push(tb); + t.copyPixels(buffer, temprect, tl); + sprites.push(t); } } } public function makeflipspritearray():void { - var sourcetexture:Texture = starlingassets.getTexture("flipsprites"); - for (var j:int = 0; j < 16; j++) { - for (var i:int = 0; i < 12; i++) { - var tiletex:Texture = Texture.fromTexture(sourcetexture, new Rectangle(i * 32, j * 32, 32, 32)); - var t:Image = new Image(tiletex); - t.textureSmoothing = TextureSmoothing.NONE; - t.touchable = false; - flipsprites.push(t); - } - } - - - //Sprites also need to load flash bitmapdatas, which are used for pixel perfect hittests - var b:Bitmap = new img_bitmapflipsprites(); - var buffer:BitmapData = b.bitmapData; - - for (j = 0; j < 16; j++) { - for (i = 0; i < 12; i++) { - var tb:BitmapData = new BitmapData(32, 32, true, 0x000000); + for (var j:Number = 0; j < 16; j++) { + for (var i:Number = 0; i < 12; i++) { + var t:BitmapData = new BitmapData(32, 32, true, 0x000000); var temprect:Rectangle = new Rectangle(i * 32, j * 32, 32, 32); - tb.copyPixels(buffer, temprect, tl); - flipsprites_bitmap.push(tb); + t.copyPixels(buffer, temprect, tl); + flipsprites.push(t); } } } public function maketelearray():void { - var sourcetexture:Texture = starlingassets.getTexture("teleporter"); - for (var i:int = 0; i < 10; i++) { - var tiletex:Texture = Texture.fromTexture(sourcetexture, new Rectangle(i * 96, j * 96, 96, 96)); - var t:Image = new Image(tiletex); - t.textureSmoothing = TextureSmoothing.NONE; - t.touchable = false; + for (var i:Number = 0; i < 10; i++) { + var t:BitmapData = new BitmapData(96, 96, true, 0x000000); + var temprect:Rectangle = new Rectangle(i * 96, 0, 96, 96); + t.copyPixels(buffer, temprect, tl); tele.push(t); } } public function drawmobilebutton(game:gameclass, xp:int, yp:int, wp:int, hp:int, t:String, cr:int, cg:int, cb:int, xoff:int = -8, yoff:int = -10):void { - xp = xp + xoff; + xp = xp + xoff; yp = yp + yoff; drawfillrect(xp + 4, yp + 4, wp, hp, cr * 0.25, cg * 0.25, cb * 0.25); drawfillrect(xp, yp, wp, hp, cr, cg, cb); @@ -851,7 +827,51 @@ package{ } public function drawlevelmenu(game:gameclass, cr:int, cg:int, cb:int, division:int = 30):void { - trace("dwgfx.drawlevelmenu() is not implemented yet"); + for (var i:int = 0; i < game.nummenuoptions; i++){ + if (i == game.currentmenuoption){ + if(game.nummenuoptions-i<=2){ + //Draw it highlighted + if (game.menuoptionsactive[i]) { + tempstring = game.menuoptions[i]; tempstring = "[ " + tempstring.toUpperCase() + " ]"; + print(110 + (i * division) - 16 +game.menuxoff, 140 + 8 + (i * 12) +game.menuyoff, tempstring, cr, cg, cb); + }else{ + tempstring = game.menuoptions[i]; + tempstring = "[ " + tempstring + " ]"; + //Draw it in gray + print(110 + (i * division) - 16 +game.menuxoff, 140 + 8 + (i * 12) + game.menuyoff, tempstring, 128, 128, 128); + } + }else{ + //Draw it highlighted + if (game.menuoptionsactive[i]){ + tempstring = game.menuoptions[i]; tempstring = "[ " + tempstring.toUpperCase() + " ]"; + print(110 + (i * division) - 16 +game.menuxoff, 140 + (i * 12) +game.menuyoff, tempstring, cr, cg, cb); + }else{ + tempstring = game.menuoptions[i]; + tempstring = "[ " + tempstring + " ]"; + //Draw it in gray + print(110 + (i * division) - 16 +game.menuxoff, 140 + (i * 12)+game.menuyoff, tempstring, 128, 128, 128); + } + } + }else{ + if(game.nummenuoptions-i<=2){ + //Draw it normally + if (game.menuoptionsactive[i]){ + print(110 + (i * division) +game.menuxoff, 140+8 + (i * 12)+game.menuyoff, game.menuoptions[i], cr, cg, cb); + }else{ + //Draw it in gray + print(110 + (i * division) +game.menuxoff, 140+8 + (i * 12)+game.menuyoff, game.menuoptions[i], 128, 128, 128); + } + }else{ + //Draw it normally + if (game.menuoptionsactive[i]){ + print(110 + (i * division) +game.menuxoff, 140 + (i * 12)+game.menuyoff, game.menuoptions[i], cr, cg, cb); + }else{ + //Draw it in gray + print(110 + (i * division) +game.menuxoff, 140 + (i * 12)+game.menuyoff, game.menuoptions[i], 128, 128, 128); + } + } + } + } } //Fade functions @@ -887,14 +907,16 @@ package{ public function drawfade():void { if (fademode == 1) { - cls(0x000000); + backbuffer.fillRect(backbuffer.rect, 0x000000); }else if(fademode==3){ for (i = 0; i < 15; i++) { - drawfillrect(fadebars[i], i * 16, fadeamount, 16, 0, 0, 0); + setmadrect(fadebars[i], i * 16, fadeamount, 16); + backbuffer.fillRect(madrect, 0x000000); } }else if(fademode==5){ for (i = 0; i < 15; i++) { - drawfillrect(fadebars[i]-fadeamount, i * 16, 500, 16, 0, 0, 0); + setmadrect(fadebars[i]-fadeamount, i * 16, 500, 16); + backbuffer.fillRect(madrect, 0x000000); } } } @@ -919,7 +941,7 @@ package{ m = ntextbox; ntextbox++; } - if (m < 20) { + if(m<20){ textbox[m].clear(); textbox[m].line[0] = t; textbox[m].xp = xp; @@ -997,7 +1019,8 @@ package{ public function drawtextbox(x:int, y:int, w:int, h:int, r:int, g:int, b:int):void { //given these parameters, draw a textbox - drawfillrect(x, y, w * 8, h * 8, r / 6, g / 6, b / 6); + madrect.x = x; madrect.y = y; madrect.width = w*8; madrect.height = h*8; + backbuffer.fillRect(madrect, RGB(r / 6, g / 6, b / 6)); drawcoloredtile(x, y, 40, r, g, b); drawcoloredtile(x + (w*8) - 8, y, 42, r, g, b); drawcoloredtile(x, y + (h*8) - 8, 45, r, g, b); @@ -1014,9 +1037,10 @@ package{ } } - public function drawpixeltextbox(x:int, y:int, w:int, h:int, w2:int, h2:int, r:int, g:int, b:int, xo:int = 0, yo:int = 0):void { + public function drawpixeltextbox(x:int, y:int, w:int, h:int, w2:int, h2:int, r:int, g:int, b:int, xo:int=0, yo:int=0):void { //given these parameters, draw a textbox with a pixel width - drawfillrect(x, y, w, h, r / 6, g / 6, b / 6); + madrect.x = x; madrect.y = y; madrect.width = w; madrect.height = h; + backbuffer.fillRect(madrect, RGB(r / 6, g / 6, b / 6)); for (k = 0; k < w2-2; k++) { drawcoloredtile(x + 8-xo + (k * 8), y, 41, r, g, b); @@ -1034,9 +1058,13 @@ package{ drawcoloredtile(x + (w) - 8, y + (h) - 8, 47, r, g, b); } - public function drawcustompixeltextbox(x:int, y:int, w:int, h:int, w2:int, h2:int, r:int, g:int, b:int, xo:int = 0, yo:int = 0):void { + public function drawcustompixeltextbox(x:int, y:int, w:int, h:int, w2:int, h2:int, r:int, g:int, b:int, xo:int=0, yo:int=0):void { //given these parameters, draw a textbox with a pixel width - drawfillrect(x, y, w, h, r / 6, g / 6, b / 6); + + //madrect.x = x; madrect.y = y; madrect.w = w; madrect.h = h; + //backbuffer.fillRect(madrect, RGB(r / 6, g / 6, b / 6)); + madrect.x = x; madrect.y = y; madrect.width = w; madrect.height = h; + backbuffer.fillRect(madrect, RGB(r / 6, g / 6, b / 6)); for (k = 0; k < w2-2; k++){ drawcoloredtile(x + 8-xo + (k * 8), y, 41, r, g, b); @@ -1064,67 +1092,34 @@ package{ drawcoloredtile(x + (w) - 8, y + (h) - 8, 47, r, g, b); } - public var subtex:Texture; - public var subimage:Image; - public function drawpartimage(t:Texture, xp:int, yp:int, wp:int, hp:int):void { - // Acquire SubTexture and build an Image from it. - trect.x = 0; - trect.y = 0; - trect.width = wp; - trect.height = hp; + public function drawpartimage(t:int, xp:int, yp:int, wp:int, hp:int):void { + tpoint.x = xp; tpoint.y = yp; + madrect.x = 0; madrect.y = 0; madrect.width = wp; madrect.height = hp; - if (subtex == null) { - subtex = Texture.fromTexture(t, trect); - subimage = new Image(subtex); // alloc. avoidable with pooling? - subimage.touchable = false; - subimage.textureSmoothing = TextureSmoothing.NONE; - - tposition.identity(); - tposition.translate(xp, yp); - backbuffer.draw(subimage, tposition); - return; - }else { - //dispose of the old one - //No memory leaks, but this is throwing away a texture every call, which might - //get expensive? Ideally you'd reuse an image here if it hasn't changed. - //Or, maybe easier, make a function that grabs the chunk we need and keeps it somewhere - //else, hardcoding around the problem. Let's see if this is a problem in practice, though. - subtex.dispose(); - subimage.dispose(); - - subtex = Texture.fromTexture(t, trect); - subimage = new Image(subtex); - subimage.touchable = false; - subimage.textureSmoothing = TextureSmoothing.NONE; - - tposition.identity(); - tposition.translate(xp, yp); - backbuffer.draw(subimage, tposition); - return; - } + backbuffer.copyPixels(images[t], madrect, tpoint); } public function cutscenebars():void { if (showcutscenebars) { cutscenebarspos += 25; if (cutscenebarspos >= 360) cutscenebarspos = 360; - drawfillrect(0, 0, cutscenebarspos, 16, 0, 0, 0); - drawfillrect(360 - cutscenebarspos, 224, cutscenebarspos, 16, 0, 0, 0); + setmadrect(0, 0, cutscenebarspos, 16); + backbuffer.fillRect(madrect, 0x000000); + setmadrect(360-cutscenebarspos, 224, cutscenebarspos, 16); + backbuffer.fillRect(madrect, 0x000000); }else { //disappearing if (cutscenebarspos > 0) { cutscenebarspos -= 25; - //draw - drawfillrect(0, 0, cutscenebarspos, 16, 0, 0, 0); - drawfillrect(360 - cutscenebarspos, 224, cutscenebarspos, 16, 0, 0, 0); + //draw + setmadrect(0, 0, cutscenebarspos, 16); + backbuffer.fillRect(madrect, 0x000000); + setmadrect(360-cutscenebarspos, 224, cutscenebarspos, 16); + backbuffer.fillRect(madrect, 0x000000); } } } - //For android: this function draws textboxes to a buffer first, where they're later copied to the screen - //buffer is a 320x500 image. X coordinates aren't changed, but y coordinates are - public var textbox_ybuffer:int; - public var textbox_ybufferheight:int = 0; public function drawgui(help:helpclass):void { textboxcleanup(); //Draw all the textboxes to the screen @@ -1142,8 +1137,8 @@ package{ print(textbox[i].xp + 8, textbox[i].yp + 8 + (j * 8), textbox[i].line[j], 196, 196, 255 - help.glow); } } - }else { - drawfillrect(textbox[i].textrect.x, textbox[i].textrect.y, textbox[i].textrect.width, textbox[i].textrect.height, textbox[i].r/6, textbox[i].g/6, textbox[i].b / 6); + }else{ + backbuffer.fillRect(textbox[i].textrect, RGB(textbox[i].r/6, textbox[i].g/6, textbox[i].b / 6)); drawcoloredtile(textbox[i].xp, textbox[i].yp, 40, textbox[i].r, textbox[i].g, textbox[i].b); drawcoloredtile(textbox[i].xp+textbox[i].w-8, textbox[i].yp, 42, textbox[i].r, textbox[i].g, textbox[i].b); @@ -1228,258 +1223,111 @@ package{ return (blue | (green << 8) | (red << 16)) } - public function addmobileimage(imgname:String):void { - var sourcetexture:Texture = starlingassets.getTexture(imgname); - var t:Image = new Image(sourcetexture); - t.touchable = false; - t.textureSmoothing = TextureSmoothing.NONE; + public function addmobileimage():void { + var t:BitmapData = new BitmapData(buffer.width, buffer.height, true, 0x000000); + setmadrect(0, 0, buffer.width, buffer.height); + t.copyPixels(buffer, madrect, tl); mobileimages.push(t); } - public function addimage(imgname:String):void { - var sourcetexture:Texture = starlingassets.getTexture(imgname); - var t:Image = new Image(sourcetexture); - t.touchable = false; - t.textureSmoothing = TextureSmoothing.NONE; + public function addimage():void { + var t:BitmapData = new BitmapData(buffer.width, buffer.height, true, 0x000000); + setmadrect(0, 0, buffer.width, buffer.height); + t.copyPixels(buffer, madrect, tl); images.push(t); } - public function addimage_rendertexture(imgname:String):void { - customminimap = starlingassets.getTexture(imgname) as RenderTexture; - var t:Image = new Image(customminimap); - t.touchable = false; - t.textureSmoothing = TextureSmoothing.NONE; - images.push(t); - } - - public function addplayerlevelimage(imgname:String):void { - var sourcetexture:Texture = starlingassets.getTexture(imgname); - var t:Image = new Image(sourcetexture); - t.touchable = false; - t.textureSmoothing = TextureSmoothing.NONE; + public function addplayerlevelimage():void { + var t:BitmapData = new BitmapData(buffer.width, buffer.height, true, 0x000000); + setmadrect(0, 0, buffer.width, buffer.height); + t.copyPixels(buffer, madrect, tl); playerlevelimages.push(t); } - public function addbackground(imgname:String):void { - //Don't think this is actually used in VVVVVV - var sourcetexture:Texture = starlingassets.getTexture(imgname); - var t:Image = new Image(sourcetexture); - t.touchable = false; - t.textureSmoothing = TextureSmoothing.NONE; + public function addbackground():void { + var t:BitmapData = new BitmapData(160, 144, true, 0x000000); + t.copyPixels(buffer, bg_rect, tl); backgrounds.push(t); } - public var towerx_pix:int; - public var towery_pix:int; - public var tower_bgcol:Vector. = new Vector.; - public var tower_bgdarkcol:Vector. = new Vector.; - public var lasttowercolstate:int = -1; - public var lasttowercolstate_front:int = -1; - public var maptdrawfront:Boolean = true; - public var forcetowerupdate:int = 10; - public var forcefronttowerupdate:int = 10; - public var towerfront_lastypos:int = 0; - public var tower_lastypos:int = 0; - - public var forcewarpzonehorizontalupdate:int = 2; - public var forcewarpzoneverticalupdate:int = 1; - public var forcetowerstaticupdate:int = 1; - - public function forcescreenupdates():void { - if (forcetowerupdate < 3) forcetowerupdate = 3; - if (forcefronttowerupdate < 3) forcefronttowerupdate = 3; - if (forcetowerstaticupdate < 3) forcetowerstaticupdate = 3; - if (forcewarpzoneverticalupdate < 1) forcewarpzoneverticalupdate = 1; - if (forcewarpzonehorizontalupdate < 1) forcewarpzonehorizontalupdate = 1; - } - public function drawtowerbackground(map:mapclass):void { - if (map.bypos < 0) { - map.bypos += 120 * 8; - forcetowerupdate += 5; - } - - if (map.scrolldir == 1) { - if (map.tdrawback || lasttowercolstate != map.colstate || forcetowerupdate > 0) { - //Draw the whole thing; needed for every colour cycle! - towerbufferbackground_meshbatch.y = 0; - tower_lastypos = map.bypos; - - towerbufferbackground_meshbatch.clear(); - //Draw the whole thing; needed for every colour cycle! - for (j = 0; j < 40; j++) { - for (i = 0; i < 40; i++) { - temp = map.tower.backat(i, j, map.bypos); - drawtowertile3(i * 8, (j * 8) - (map.bypos % 8), temp, map.colstate); - } - } - - backbuffer.draw(towerbufferbackground_meshbatch); - - map.tdrawback = false; - lasttowercolstate = map.colstate; - if (forcetowerupdate > 0) forcetowerupdate--; - }else { - //just scroll down a bit - towerbufferbackground_meshbatch.y = -int(map.bypos - tower_lastypos); - backbuffer.draw(towerbufferbackground_meshbatch); - - if (towerbufferbackground_meshbatch.y < -80) { - towerbufferbackground_meshbatch.y = 0; - map.tdrawback = true; - } - } - }else{ - if (map.tdrawback || lasttowercolstate != map.colstate || forcetowerupdate > 0) { - //Draw the whole thing; needed for every colour cycle! - towerbufferbackground_meshbatch.y = 0; - tower_lastypos = map.bypos; - - towerbufferbackground_meshbatch.clear(); - //Draw the whole thing; needed for every colour cycle! - for (j = -10; j < 30; j++) { - for (i = 0; i < 40; i++) { - temp = map.tower.backat(i, j, map.bypos); - drawtowertile3(i * 8, (j * 8) - (map.bypos % 8), temp, map.colstate); - } - } - - backbuffer.draw(towerbufferbackground_meshbatch); - - map.tdrawback = false; - lasttowercolstate = map.colstate; - if (forcetowerupdate > 0) forcetowerupdate--; - }else { - //just scroll down a bit - towerbufferbackground_meshbatch.y = -int(map.bypos - tower_lastypos); - backbuffer.draw(towerbufferbackground_meshbatch); - - if (towerbufferbackground_meshbatch.y > 80) { - towerbufferbackground_meshbatch.y = 0; - map.tdrawback = true; - } - } - } - } - - public function drawtowerbackgroundsolo(map:mapclass):void { - if (map.bypos < 0) { - map.bypos += 120 * 8; - forcetowerupdate += 5; - } + if (map.bypos < 0) map.bypos += 120 * 8; if (map.scrolldir == 1) map.tdrawback = true; - if (map.tdrawback || lasttowercolstate != map.colstate || forcetowerupdate > 0) { + if (map.tdrawback) { //Draw the whole thing; needed for every colour cycle! - towerbufferbackground_meshbatch.y = 0; - tower_lastypos = map.bypos; - - towerbufferbackground_meshbatch.clear(); - //Draw the whole thing; needed for every colour cycle! - for (j = -10; j < 31; j++) { + for (j = 0; j < 30; j++) { for (i = 0; i < 40; i++) { temp = map.tower.backat(i, j, map.bypos); drawtowertile3(i * 8, (j * 8) - (map.bypos % 8), temp, map.colstate); } } - backbuffer.draw(towerbufferbackground_meshbatch); + backbuffer.copyPixels(towerbuffer, towerbuffer.rect, tl, null, null, false); map.tdrawback = false; - lasttowercolstate = map.colstate; - if (forcetowerupdate > 0) forcetowerupdate--; }else { - //just scroll down a bit - towerbufferbackground_meshbatch.y = -int(map.bypos - tower_lastypos); - backbuffer.draw(towerbufferbackground_meshbatch); - - if (towerbufferbackground_meshbatch.y > 80) { - towerbufferbackground_meshbatch.y = 0; - map.tdrawback = true; + //just update the bottom + towerbuffer.scroll(0, -map.bscroll); + for (i = 0; i < 40; i++) { + temp = map.tower.backat(i, 0, map.bypos); + drawtowertile3(i * 8, -(map.bypos % 8), temp, map.colstate); } + + backbuffer.copyPixels(towerbuffer, towerbuffer.rect, tl, null, null, false); } } - public function drawtowermap(game:gameclass, map:mapclass):void { - if (game.deathseq > 0) { forcefronttowerupdate = 20; } + public function drawtowerbackgroundsolo(map:mapclass):void { + if (map.bypos < 0) map.bypos += 120 * 8; - if (map.scrolldir == 1) { - if (maptdrawfront || lasttowercolstate_front != map.colstate || forcefronttowerupdate > 0) { - towerbufferforeground_meshbatch.y = 0; - towerfront_lastypos = map.ypos; - towerbufferforeground_meshbatch.clear(); - - for (j = 0; j < 40; j++) { - for (i = 0; i < 40; i++) { - temp = map.tower.at(i, j, map.ypos); - if (temp > 0) drawtile3_batch(i * 8, (j * 8) - (map.ypos % 8), temp, map.colstate); - } - } - - backbuffer.draw(towerbufferforeground_meshbatch); - - maptdrawfront = false; - lasttowercolstate_front = map.colstate; - if (forcefronttowerupdate > 0) forcefronttowerupdate--; - }else { - //just scroll down a bit - towerbufferforeground_meshbatch.y = -int(map.ypos - towerfront_lastypos); - backbuffer.draw(towerbufferforeground_meshbatch); - - if (towerbufferforeground_meshbatch.y < -80) { - towerbufferforeground_meshbatch.y = 0; - maptdrawfront = true; + if (map.tdrawback) { + //Draw the whole thing; needed for every colour cycle! + for (j = 0; j < 31; j++) { + for (i = 0; i < 40; i++) { + temp = map.tower.backat(i, j, map.bypos); + drawtowertile3(i * 8, (j * 8) - (map.bypos % 8), temp, map.colstate); } } - }else{ - if (maptdrawfront || lasttowercolstate_front != map.colstate || forcefronttowerupdate > 0) { - towerbufferforeground_meshbatch.y = 0; - towerfront_lastypos = map.ypos; - towerbufferforeground_meshbatch.clear(); - - for (j = -10; j < 30; j++) { - for (i = 0; i < 40; i++) { - temp = map.tower.at(i, j, map.ypos); - if (temp > 0) drawtile3_batch(i * 8, (j * 8) - (map.ypos % 8), temp, map.colstate); - } - } - - backbuffer.draw(towerbufferforeground_meshbatch); - - maptdrawfront = false; - lasttowercolstate_front = map.colstate; - if (forcefronttowerupdate > 0) forcefronttowerupdate--; - }else { - //just scroll down a bit - towerbufferforeground_meshbatch.y = -int(map.ypos - towerfront_lastypos); - backbuffer.draw(towerbufferforeground_meshbatch); - - if (towerbufferforeground_meshbatch.y > 80) { - towerbufferforeground_meshbatch.y = 0; - maptdrawfront = true; - } + + backbuffer.copyPixels(towerbuffer, towerbuffer.rect, tl, null, null, false); + + map.tdrawback = false; + }else { + //just update the bottom + towerbuffer.scroll(0, -map.bscroll); + for (i = 0; i < 40; i++) { + temp = map.tower.backat(i, 0, map.bypos); + drawtowertile3(i * 8, -(map.bypos % 8), temp, map.colstate); + } + + backbuffer.copyPixels(towerbuffer, towerbuffer.rect, tl, null, null, false); + } + } + + public function drawtowermap(map:mapclass):void { + for (j = 0; j < 30; j++) { + for (i = 0; i < 40; i++) { + temp = map.tower.at(i, j, map.ypos); + if (temp > 0) drawtile3(i * 8, (j * 8) - (map.ypos % 8), temp, map.colstate); } } } public function drawtowermap_nobackground(map:mapclass):void { - towerbufferforeground_meshbatch.clear(); - for (j = 0; j < 30; j++) { for (i = 0; i < 40; i++) { temp = map.tower.at(i, j, map.ypos); - if (temp > 0 && temp<28) drawtile3_batch(i * 8, (j * 8) - (map.ypos % 8), temp, map.colstate); + if (temp > 0 && temp<28) drawtile3(i * 8, (j * 8) - (map.ypos % 8), temp, map.colstate); } } - - backbuffer.draw(towerbufferforeground_meshbatch); } public function drawtowerspikes(map:mapclass):void { for (i = 0; i < 40; i++) { - drawtile3(i * 8, -8 + map.spikeleveltop, 9, map.colstate); - drawtile3(i * 8, 230 - map.spikelevelbottom, 8, map.colstate); + drawtile3(i * 8, -8+map.spikeleveltop, 9, map.colstate); + drawtile3(i * 8, 230-map.spikelevelbottom, 8, map.colstate); } } @@ -1497,53 +1345,39 @@ package{ for (var i:int = 0; i < obj.nentity; i++) { if (!obj.entities[i].invis && obj.entities[i].active) { if (obj.entities[i].size == 0) { // Sprites - tposition.identity(); - tposition.translate(obj.entities[i].xp, obj.entities[i].yp - map.ypos); - + tpoint.x = obj.entities[i].xp; tpoint.y = obj.entities[i].yp-map.ypos; setcol(obj.entities[i].colour, help); - sprites[obj.entities[i].drawframe].color = ct.color; - backbuffer.draw(sprites[obj.entities[i].drawframe], tposition); + sprites[obj.entities[i].drawframe].colorTransform(sprites_rect, ct); + backbuffer.copyPixels(sprites[obj.entities[i].drawframe], sprites_rect, tpoint); //screenwrapping! if (!map.minitowermode) { if ( map.ypos >= 500 && map.ypos <= 5000) { //The "wrapping" area of the tower if (tpoint.x < 0) { - tposition.identity(); - tposition.translate(obj.entities[i].xp + 320, obj.entities[i].yp - map.ypos); - backbuffer.draw(sprites[obj.entities[i].drawframe], tposition); + tpoint.x += 320; + backbuffer.copyPixels(sprites[obj.entities[i].drawframe], sprites_rect, tpoint); } if (tpoint.x > 300) { - tposition.identity(); - tposition.translate(obj.entities[i].xp - 320, obj.entities[i].yp - map.ypos); - backbuffer.draw(sprites[obj.entities[i].drawframe], tposition); + tpoint.x -= 320; + backbuffer.copyPixels(sprites[obj.entities[i].drawframe], sprites_rect, tpoint); } } } - }else if (obj.entities[i].size == 1) { // Tiles - tposition.identity(); - tposition.translate(obj.entities[i].xp, obj.entities[i].yp - map.ypos); - backbuffer.draw(tiles[obj.entities[i].drawframe], tposition); + }else if (obj.entities[i].size == 1) { // Tiles + tpoint.x = obj.entities[i].xp; tpoint.y = obj.entities[i].yp-map.ypos; + backbuffer.copyPixels(tiles[obj.entities[i].drawframe], tiles_rect, tpoint); }else if (obj.entities[i].size == 2) { // Special: Moving platform, 4 tiles - tposition.identity(); - tposition.translate(obj.entities[i].xp, obj.entities[i].yp - map.ypos); - backbuffer.draw(tiles[obj.entities[i].drawframe], tposition); - - tposition.identity(); - tposition.translate(obj.entities[i].xp + 8, obj.entities[i].yp - map.ypos); - backbuffer.draw(tiles[obj.entities[i].drawframe], tposition); - - tposition.identity(); - tposition.translate(obj.entities[i].xp + 16, obj.entities[i].yp - map.ypos); - backbuffer.draw(tiles[obj.entities[i].drawframe], tposition); - - tposition.identity(); - tposition.translate(obj.entities[i].xp + 24, obj.entities[i].yp - map.ypos); + tpoint.x = obj.entities[i].xp; tpoint.y = obj.entities[i].yp-map.ypos; + backbuffer.copyPixels(tiles[obj.entities[i].drawframe], tiles_rect, tpoint); + tpoint.x += 8; backbuffer.copyPixels(tiles[obj.entities[i].drawframe], tiles_rect, tpoint); + tpoint.x += 8; backbuffer.copyPixels(tiles[obj.entities[i].drawframe], tiles_rect, tpoint); + tpoint.x += 8; backbuffer.copyPixels(tiles[obj.entities[i].drawframe], tiles_rect, tpoint); }else if (obj.entities[i].size == 3) { // Big chunky pixels! prect.x = obj.entities[i].xp; prect.y = obj.entities[i].yp-map.ypos; //A seperate index of colours, for simplicity - if (obj.entities[i].colour == 1) { - drawfillrect(prect.x, prect.y, prect.width, prect.height, 196 - (Math.random() * 64), 10, 10); + if(obj.entities[i].colour==1){ + backbuffer.fillRect(prect, RGB(196 - (Math.random() * 64), 10, 10)); }else if (obj.entities[i].colour == 2) { - drawfillrect(prect.x, prect.y, prect.width, prect.height, 160- help.glow/2 - (Math.random()*20), 200- help.glow/2, 220 - help.glow); + backbuffer.fillRect(prect, RGB(160- help.glow/2 - (Math.random()*20), 200- help.glow/2, 220 - help.glow)); } }else if (obj.entities[i].size == 4) { // Small pickups drawhuetile(obj.entities[i].xp, obj.entities[i].yp-map.ypos, obj.entities[i].tile, obj.entities[i].colour); @@ -1563,25 +1397,24 @@ package{ public function drawbackground(t:int, map:mapclass):void { switch(t) { case 1: - //Starfield - drawfillrect(0, 0, 320, 240, 0, 0, 0); + //Starfield + backbuffer.fillRect(backbuffer.rect, 0x000000); for (i = 0; i < 50; i++) { if (starsspeed[i] <= 6) { - drawfillrect(stars[i].x, stars[i].y, stars[i].width, stars[i].height, 34, 34, 34); + backbuffer.fillRect(stars[i], 0x222222); }else { - drawfillrect(stars[i].x, stars[i].y, stars[i].width, stars[i].height, 85, 85, 85); + backbuffer.fillRect(stars[i], 0x555555); } stars[i].x -= starsspeed[i]; if (stars[i].x < -10) { stars[i].x += 340; stars[i].y = Math.random() * 240; - starsspeed[i] = 4 + (Math.random()*4); + starsspeed[i] = 4+(Math.random()*4); } } break; case 2: - //Lab - i = 0; + //Lab switch(rcol) { //Akward ordering to match tileset case 0: bcol2 = RGB(0, 16*backboxint[i], 16*backboxint[i]); break; //Cyan @@ -1599,7 +1432,7 @@ package{ if (spcol >= 12) spcol = 0; } switch(spcol) { - case 0: bcol2 = RGB(0, 16 * backboxint[i], 16 * backboxint[i]); break; //Cyan + case 0: bcol2 = RGB(0, 16*backboxint[i], 16*backboxint[i]); break; //Cyan case 1: bcol2 = RGB(0, (spcoldel+1)*backboxint[i], 16*backboxint[i]); break; //Cyan case 2: bcol2 = RGB(0, 0, 16*backboxint[i]); break; //Blue case 3: bcol2 = RGB((16-spcoldel)*backboxint[i], 0, 16*backboxint[i]); break; //Blue @@ -1614,7 +1447,7 @@ package{ } break; } - cls(bcol2); + backbuffer.fillRect(backbuffer.rect, bcol2); for (i = 0; i < 18; i++) { switch(rcol) { //Akward ordering to match tileset @@ -1642,11 +1475,11 @@ package{ } break; } - drawfillrect(backboxes[i].x, backboxes[i].y, backboxes[i].width, backboxes[i].height, bcol); + backbuffer.fillRect(backboxes[i], bcol); backboxrect.x = backboxes[i].x + 1; backboxrect.y = backboxes[i].y + 1; backboxrect.width = backboxes[i].width - 2; backboxrect.height = backboxes[i].height - 2; - drawfillrect(backboxrect.x, backboxrect.y, backboxrect.width, backboxrect.height, bcol2); + backbuffer.fillRect(backboxrect, bcol2); backboxes[i].x += backboxvx[i]; backboxes[i].y += backboxvy[i]; @@ -1657,65 +1490,67 @@ package{ } break; case 3: //Warp zone (horizontal) - backoffset += 3; if (backoffset >= 16) backoffset -= 16; + backoffset+=3; if (backoffset >= 16) backoffset -= 16; - if (forcewarpzonehorizontalupdate > 0) { - warpzonehorizontal_meshbatch.x = 0; - warpzonehorizontal_meshbatch.clear(); + if (backgrounddrawn) { + towerbuffer.scroll( -3, 0); for (j = 0; j < 15; j++) { - for (i = -1; i < 21; i++) { + temp = 680 + (rcol * 3); + drawtowertile(317 - backoffset, (j * 16), temp+40); //20*16 = 320 + drawtowertile(317 - backoffset + 8, (j * 16), temp + 41); + drawtowertile(317 - backoffset, (j * 16) + 8, temp + 80); + drawtowertile(317 - backoffset + 8, (j * 16) + 8, temp + 81); + } + }else { + //draw the whole thing for the first time! + backoffset = 0; + towerbuffer.fillRect(towerbuffer.rect, 0x000000); + for (j = 0; j < 15; j++) { + for (i = 0; i < 21; i++) { temp = 680 + (rcol * 3); - tposition.identity(); tposition.translate(int((i * 16) - backoffset), int(j * 16)); - warpzonehorizontal_meshbatch.addMesh(tiles2[temp+40], tposition); - tposition.identity(); tposition.translate(int((i * 16) - backoffset + 8), int((j * 16))); - warpzonehorizontal_meshbatch.addMesh(tiles2[temp + 41], tposition); - tposition.identity(); tposition.translate(int((i * 16) - backoffset), int((j * 16) + 8)); - warpzonehorizontal_meshbatch.addMesh(tiles2[temp + 80], tposition); - tposition.identity(); tposition.translate(int((i * 16) - backoffset + 8), int((j * 16) + 8)); - warpzonehorizontal_meshbatch.addMesh(tiles2[temp + 81], tposition); + drawtowertile((i * 16) - backoffset, (j * 16), temp+40); + drawtowertile((i * 16) - backoffset + 8, (j * 16), temp + 41); + drawtowertile((i * 16) - backoffset, (j * 16) + 8, temp + 80); + drawtowertile((i * 16) - backoffset + 8, (j * 16) + 8, temp + 81); } } - - backbuffer.draw(warpzonehorizontal_meshbatch); - forcewarpzonehorizontalupdate--; - }else { - warpzonehorizontal_meshbatch.x = backoffset; - backbuffer.draw(warpzonehorizontal_meshbatch); + backgrounddrawn = true; } + backbuffer.copyPixels(towerbuffer, towerbuffer.rect, tl); break; case 4: //Warp zone (vertical) - backoffset += 3; - if (backoffset >= 16) backoffset -= 16; + backoffset+=3; if (backoffset >= 16) backoffset -= 16; - if (forcewarpzoneverticalupdate > 0) { - warpzonevertical_meshbatch.y = 0; - warpzonevertical_meshbatch.clear(); - for (j = -1; j < 16; j++) { + if (backgrounddrawn) { + towerbuffer.scroll(0, -3); + for (i = 0; i < 21; i++) { + temp = 760 + (rcol * 3); + drawtowertile((i * 16), 237 - backoffset, temp + 40); //14*17=240 - 3 + drawtowertile((i * 16) + 8, 237 - backoffset, temp + 41); + drawtowertile((i * 16), 237 - backoffset + 8, temp + 80); + drawtowertile((i * 16) + 8, 237 - backoffset + 8, temp + 81); + } + }else { + //draw the whole thing for the first time! + backoffset = 0; + towerbuffer.fillRect(towerbuffer.rect, 0x000000); + for (j = 0; j < 15; j++) { for (i = 0; i < 21; i++) { temp = 760 + (rcol * 3); - tposition.identity(); tposition.translate(int((i * 16)), int((j * 16) - backoffset)); - warpzonevertical_meshbatch.addMesh(tiles2[temp+40], tposition); - tposition.identity(); tposition.translate(int((i * 16) + 8), int((j * 16) - backoffset)); - warpzonevertical_meshbatch.addMesh(tiles2[temp + 41], tposition); - tposition.identity(); tposition.translate(int((i * 16)), int((j * 16) - backoffset + 8)); - warpzonevertical_meshbatch.addMesh(tiles2[temp + 80], tposition); - tposition.identity(); tposition.translate(int((i * 16) + 8), int((j * 16) - backoffset + 8)); - warpzonevertical_meshbatch.addMesh(tiles2[temp + 81], tposition); + drawtowertile((i * 16), (j * 16)- backoffset, temp+40); + drawtowertile((i * 16)+ 8, (j * 16)- backoffset, temp + 41); + drawtowertile((i * 16), (j * 16)- backoffset + 8, temp + 80); + drawtowertile((i * 16)+ 8, (j * 16)- backoffset + 8, temp + 81); } } - - backbuffer.draw(warpzonevertical_meshbatch); - forcewarpzoneverticalupdate--; - }else { - warpzonevertical_meshbatch.y = backoffset; - backbuffer.draw(warpzonevertical_meshbatch); + backgrounddrawn = true; } - //backbuffer.copyPixels(towerbuffer, towerbuffer.rect, tl); + backbuffer.copyPixels(towerbuffer, towerbuffer.rect, tl); break; case 5: - //Warp zone, central + //Warp zone, central switch(rcol) { //Akward ordering to match tileset case 0: warpbcol = 0x0A100E; warpfcol = 0x102221; break; //Cyan @@ -1733,24 +1568,24 @@ package{ warpskip = (warpskip + 1) % 2; } - for (i = 10; i >= 0; i--) { + for (i = 10 ; i >= 0; i--) { temp = (i << 4) + backoffset; setwarprect(160 - temp, 120 - temp, temp * 2, temp * 2); if (i % 2 == warpskip) { - drawfillrect(warprect.x, warprect.y, warprect.width, warprect.height, warpbcol); + backbuffer.fillRect(warprect, warpbcol); }else { - drawfillrect(warprect.x, warprect.y, warprect.width, warprect.height, warpfcol); + backbuffer.fillRect(warprect, warpfcol); } } break; case 6: //Final Starfield - cls(0x000000); + backbuffer.fillRect(backbuffer.rect, 0x000000); for (i = 0; i < 50; i++) { if (starsspeed[i] <= 8) { - drawfillrect(stars[i].x, stars[i].y, stars[i].width, stars[i].height, 0x222222); + backbuffer.fillRect(stars[i], 0x222222); }else { - drawfillrect(stars[i].x, stars[i].y, stars[i].width, stars[i].height, 0x555555); + backbuffer.fillRect(stars[i], 0x555555); } stars[i].y -= starsspeed[i]; if (stars[i].y < -10) { @@ -1762,118 +1597,71 @@ package{ break; case 7: //Static, unscrolling section of the tower - if (forcetowerstaticupdate > 0) { - towerbufferstatic_meshbatch.clear(); - - for (j = 0; j < 30; j++) { - for (i = 0; i < 40; i++) { - tposition.identity(); - tposition.translate(int(i * 8), int(j * 8)); - towerbufferstatic_meshbatch.addMesh(tiles3[map.tower.backat(i, j, 200) + (15 * 30)], tposition); - } - } - - backbuffer.draw(towerbufferstatic_meshbatch); - forcetowerstaticupdate--; - }else { - backbuffer.draw(towerbufferstatic_meshbatch); - } + for (j = 0; j < 30; j++) { for (i = 0; i < 40; i++) { drawtile3(i * 8, j * 8, map.tower.backat(i, j, 200), 15); } } break; case 8: //Static, unscrolling section of the tower - if (forcetowerstaticupdate > 0) { - towerbufferstatic_meshbatch.clear(); - - for (j = 0; j < 30; j++) { - for (i = 0; i < 40; i++) { - tposition.identity(); - tposition.translate(int(i * 8), int(j * 8)); - towerbufferstatic_meshbatch.addMesh(tiles3[map.tower.backat(i, j, 200) + (15 * 10)], tposition); - } - } - - backbuffer.draw(towerbufferstatic_meshbatch); - forcetowerstaticupdate--; - }else { - backbuffer.draw(towerbufferstatic_meshbatch); - } + for (j = 0; j < 30; j++) { for (i = 0; i < 40; i++) { drawtile3(i * 8, j * 8, map.tower.backat(i, j, 200), 10); } } break; case 9: //Static, unscrolling section of the tower - if (forcetowerstaticupdate > 0) { - towerbufferstatic_meshbatch.clear(); - - for (j = 0; j < 30; j++) { - for (i = 0; i < 40; i++) { - tposition.identity(); - tposition.translate(int(i * 8), int(j * 8)); - towerbufferstatic_meshbatch.addMesh(tiles3[map.tower.backat(i, j, 600)], tposition); - } - } - - backbuffer.draw(towerbufferstatic_meshbatch); - forcetowerstaticupdate--; - }else { - backbuffer.draw(towerbufferstatic_meshbatch); - } + for (j = 0; j < 30; j++) { for (i = 0; i < 40; i++) { drawtile3(i * 8, j * 8, map.tower.backat(i, j, 600), 0); } } break; default: - drawfillrect(0, 0, 320, 240, 0, 0, 0); + backbuffer.fillRect(backbuffer.rect, 0x000000); + //backbuffer.copyPixels(backgrounds[t], bg_rect, tl); break; } } - public function textbox_drawimage(t:int, xp:int, yp:int, cent:Boolean=false):void { - trace("dwgfx.textbox_drawimage() is not implemented yet"); - } - public function drawimage(t:int, xp:int, yp:int, cent:Boolean=false):void { if (cent) { - tposition.identity(); - tposition.translate(160 - int(images[t].width / 2), yp); - backbuffer.draw(images[t], tposition); + tpoint.x = 160 - int(images[t].width / 2); tpoint.y = yp; + trect.x = 0; trect.y = 0; trect.width = images[t].width; trect.height = images[t].height; + backbuffer.copyPixels(images[t], trect, tpoint); }else { - tposition.identity(); - tposition.translate(xp, yp); - backbuffer.draw(images[t], tposition); + tpoint.x = xp; tpoint.y = yp; + trect.x = 0; trect.y = 0; trect.width = images[t].width; trect.height = images[t].height; + backbuffer.copyPixels(images[t], trect, tpoint); } } public function drawmobileimage(t:int, xp:int, yp:int, cent:Boolean=false):void { if (cent) { - tposition.identity(); - tposition.translate(160 - int(mobileimages[t].width / 2), yp); - backbuffer.draw(mobileimages[t], tposition); + tpoint.x = 160 - int(mobileimages[t].width / 2); tpoint.y = yp; + trect.x = 0; trect.y = 0; trect.width = mobileimages[t].width; trect.height = mobileimages[t].height; + backbuffer.copyPixels(mobileimages[t], trect, tpoint); }else { - tposition.identity(); - tposition.translate(xp, yp); - backbuffer.draw(mobileimages[t], tposition); + tpoint.x = xp; tpoint.y = yp; + trect.x = 0; trect.y = 0; trect.width = mobileimages[t].width; trect.height = mobileimages[t].height; + backbuffer.copyPixels(mobileimages[t], trect, tpoint); } } public function drawmobilehands(t:int, xp:int, yp:int):void { - tposition.identity(); - tposition.translate(xp, yp); - backbuffer.draw(mobileimages[t], tposition); + tpoint.x = xp; tpoint.y = yp; + trect.x = 0; trect.y = 0; trect.width = mobileimages[t].width; trect.height = 70; + backbuffer.copyPixels(mobileimages[t], trect, tpoint); } public function drawplayerlevelimage(t:int, xp:int, yp:int):void { - tposition.identity(); - tposition.translate(xp, yp); - backbuffer.draw(playerlevelimages[t], tposition); + tpoint.x = xp; tpoint.y = yp; + trect.x = 0; trect.y = 0; trect.width = playerlevelimages[t].width; trect.height = playerlevelimages[t].height; + backbuffer.copyPixels(playerlevelimages[t], trect, tpoint); } public function drawimagecol(t:int, xp:int, yp:int, r:int, g:int, b:int, cent:Boolean = false):void { + setcolreal(RGB(r,g,b)); if (cent) { - tposition.identity(); - tposition.translate(160 - int(images[t].width / 2), yp); - images[t].color = RGB(r, g, b); - backbuffer.draw(images[t], tposition); + tpoint.x = 160 - int(images[t].width / 2); tpoint.y = yp; + trect.x = 0; trect.y = 0; trect.width = images[t].width; trect.height = images[t].height; + images[t].colorTransform(trect, ct); + backbuffer.copyPixels(images[t], trect, tpoint); }else { - tposition.identity(); - tposition.translate(xp, yp); - images[t].color = RGB(r, g, b); - backbuffer.draw(images[t], tposition); + tpoint.x = xp; tpoint.y = yp; + trect.x = 0; trect.y = 0; trect.width = images[t].width; trect.height = images[t].height; + images[t].colorTransform(trect, ct); + backbuffer.copyPixels(images[t], trect, tpoint); } } @@ -1889,7 +1677,7 @@ package{ } public function setcol(t:int, help:helpclass):void { - //Setup predefinied colours as per our zany palette + //Setup predefinied colours as per our zany palette switch(t) { //Player Normal case 0: ct.color = RGB(160- help.glow/2 - (Math.random()*20), 200- help.glow/2, 220 - help.glow); break; @@ -2036,30 +1824,25 @@ package{ public function setcolreal(t:int):void { ct.color = t; } - - public function textbox_drawcoloredtile(x:int, y:int, t:int, r:int, g:int, b:int):void { - trace("dwgfx.textbox_drawcoloredtile() is not implemented yet"); - } - + public function drawcoloredtile(x:int, y:int, t:int, r:int, g:int, b:int):void { - tposition.identity(); - tposition.translate(x, y); - - tiles[t].color = RGB(r, g, b); - backbuffer.draw(tiles[t], tposition); + tpoint.x = x; tpoint.y = y; + setcolreal(RGB(r,g,b)); + tiles[t].colorTransform(tiles_rect, ct); + backbuffer.copyPixels(tiles[t], tiles_rect, tpoint); } public function drawhuetile(x:int, y:int, t:int, c:int):void { - tposition.identity(); - tposition.translate(x, y); + tpoint.x = x; tpoint.y = y; switch(c) { - case 0: tiles[t].color = RGB(250-(Math.random()*32), 250-(Math.random()*32), 10); break; - case 1: tiles[t].color = RGB(250-(Math.random()*32), 250-(Math.random()*32), 10); break; + case 0:setcolreal(RGB(250-(Math.random()*32), 250-(Math.random()*32), 10)); break; + case 1:setcolreal(RGB(250-(Math.random()*32), 250-(Math.random()*32), 10)); break; - default: tiles[t].color = RGB(250-(Math.random()*32), 250-(Math.random()*32), 10); break; + default:setcolreal(RGB(250-(Math.random()*32), 250-(Math.random()*32), 10)); break; } - backbuffer.draw(tiles[t], tposition); + tiles[t].colorTransform(tiles_rect, ct); + backbuffer.copyPixels(tiles[t], tiles_rect, tpoint); } public function drawcrewman(x:int, y:int, t:int, act:Boolean, help:helpclass, noshift:Boolean=false):void { @@ -2162,32 +1945,42 @@ package{ } public function drawsprite(x:int, y:int, t:int, r:int, g:int, b:int):void { - sprites[t].color = RGB(r, g, b); - tposition.identity(); - tposition.translate(x, y); - backbuffer.draw(sprites[t], tposition); - } - - public function textbox_drawsprite(x:int, y:int, t:int, r:int, g:int, b:int):void { - trace("dwgfx.textbox_drawsprite() is not implemented yet"); + tpoint.x = x; tpoint.y = y; + setcolreal(RGB(r,g,b)); + sprites[t].colorTransform(sprites_rect, ct); + backbuffer.copyPixels(sprites[t], sprites_rect, tpoint); } public function drawgravityline(t:int, obj:entityclass):void { if (obj.entities[t].life == 0) { + /* switch(linestate) { - case 0: drawfillrect(line_rect.x, line_rect.y, line_rect.width, line_rect.height, 200 - 20, 200 - 20, 200 - 20); break; - case 1: drawfillrect(line_rect.x, line_rect.y, line_rect.width, line_rect.height, 225 - 30, 245 - 30, 245 - 30); break; - case 2: drawfillrect(line_rect.x, line_rect.y, line_rect.width, line_rect.height, 245 - 30, 245 - 30, 225 - 30); break; - case 3: drawfillrect(line_rect.x, line_rect.y, line_rect.width, line_rect.height, 164 - 10, 200 - 20, 200 - 20); break; - case 4: drawfillrect(line_rect.x, line_rect.y, line_rect.width, line_rect.height, 224 - 20, 255 - 30, 196 - 20); break; - case 5: drawfillrect(line_rect.x, line_rect.y, line_rect.width, line_rect.height, 205 - 20, 235 - 30, 196 - 20); break; - case 6: drawfillrect(line_rect.x, line_rect.y, line_rect.width, line_rect.height, 164 - 10, 164 - 10, 164 - 10); break; - case 7: drawfillrect(line_rect.x, line_rect.y, line_rect.width, line_rect.height, 225 - 30, 245 - 30, 205 - 20); break; - case 8: drawfillrect(line_rect.x, line_rect.y, line_rect.width, line_rect.height, 205 - 20, 255 - 30, 225 - 30); break; - case 9: drawfillrect(line_rect.x, line_rect.y, line_rect.width, line_rect.height, 245 - 30, 245 - 30, 245 - 30); break; + case 0: backbuffer.fillRect(line_rect, RGB(0, 200, 0)); break; + case 1: backbuffer.fillRect(line_rect, RGB(16, 245, 0)); break; + case 2: backbuffer.fillRect(line_rect, RGB(0, 245, 16)); break; + case 3: backbuffer.fillRect(line_rect, RGB(16, 200, 0)); break; + case 4: backbuffer.fillRect(line_rect, RGB(24, 255, 16)); break; + case 5: backbuffer.fillRect(line_rect, RGB(16, 235, 0)); break; + case 6: backbuffer.fillRect(line_rect, RGB(0, 164, 16)); break; + case 7: backbuffer.fillRect(line_rect, RGB(16, 245, 24)); break; + case 8: backbuffer.fillRect(line_rect, RGB(0, 255, 16)); break; + case 9: backbuffer.fillRect(line_rect, RGB(96, 245, 96)); break; + } + */ + switch(linestate) { + case 0: backbuffer.fillRect(line_rect, RGB(200 - 20, 200 - 20, 200 - 20)); break; + case 1: backbuffer.fillRect(line_rect, RGB(225 - 30, 245 - 30, 245 - 30)); break; + case 2: backbuffer.fillRect(line_rect, RGB(245 - 30, 245 - 30, 225 - 30)); break; + case 3: backbuffer.fillRect(line_rect, RGB(164 - 10, 200 - 20, 200 - 20)); break; + case 4: backbuffer.fillRect(line_rect, RGB(224 - 20, 255 - 30, 196 - 20)); break; + case 5: backbuffer.fillRect(line_rect, RGB(205 - 20, 235 - 30, 196 - 20)); break; + case 6: backbuffer.fillRect(line_rect, RGB(164 - 10, 164 - 10, 164 - 10)); break; + case 7: backbuffer.fillRect(line_rect, RGB(225 - 30, 245 - 30, 205 - 20)); break; + case 8: backbuffer.fillRect(line_rect, RGB(205 - 20, 255 - 30, 225 - 30)); break; + case 9: backbuffer.fillRect(line_rect, RGB(245 - 30, 245 - 30, 245 - 30)); break; } }else{ - drawfillrect(line_rect.x, line_rect.y, line_rect.width, line_rect.height, 96, 96, 96); + backbuffer.fillRect(line_rect, RGB(96, 96, 96)); } } @@ -2206,229 +1999,184 @@ package{ if (!obj.entities[i].invis && obj.entities[i].active) { if (obj.entities[i].size == 0) { // Sprites if (flipmode) { - tposition.identity(); - tposition.translate(int(obj.entities[i].xp), int(obj.entities[i].yp)); + tpoint.x = obj.entities[i].xp; tpoint.y = obj.entities[i].yp; setcol(obj.entities[i].colour, help); - flipsprites[obj.entities[i].drawframe].color = ct.color; - backbuffer.draw(flipsprites[obj.entities[i].drawframe], tposition); + flipsprites[obj.entities[i].drawframe].colorTransform(sprites_rect, ct); + backbuffer.copyPixels(flipsprites[obj.entities[i].drawframe], sprites_rect, tpoint); if (map.warpx) { //screenwrapping! if (tpoint.x < 0) { - tposition.identity(); - tposition.translate(int(obj.entities[i].xp) + 320, int(obj.entities[i].yp)); - backbuffer.draw(flipsprites[obj.entities[i].drawframe], tposition); + tpoint.x += 320; + backbuffer.copyPixels(flipsprites[obj.entities[i].drawframe], sprites_rect, tpoint); } if (tpoint.x > 300) { - tposition.identity(); - tposition.translate(int(obj.entities[i].xp) - 320, int(obj.entities[i].yp)); - backbuffer.draw(flipsprites[obj.entities[i].drawframe], tposition); + tpoint.x -= 320; + backbuffer.copyPixels(flipsprites[obj.entities[i].drawframe], sprites_rect, tpoint); } }else if (map.warpy) { if (tpoint.y < 0) { - tposition.identity(); - tposition.translate(int(obj.entities[i].xp), int(obj.entities[i].yp) + 230); - backbuffer.draw(flipsprites[obj.entities[i].drawframe], tposition); + tpoint.y += 230; + backbuffer.copyPixels(flipsprites[obj.entities[i].drawframe], sprites_rect, tpoint); } if (tpoint.y > 210) { - tposition.identity(); - tposition.translate(int(obj.entities[i].xp), int(obj.entities[i].yp) - 230); - backbuffer.draw(flipsprites[obj.entities[i].drawframe], tposition); + tpoint.y -= 230; + backbuffer.copyPixels(flipsprites[obj.entities[i].drawframe], sprites_rect, tpoint); } } - }else { - tposition.identity(); - tposition.translate(int(obj.entities[i].xp), int(obj.entities[i].yp)); + }else{ + tpoint.x = obj.entities[i].xp; tpoint.y = obj.entities[i].yp; setcol(obj.entities[i].colour, help); - sprites[obj.entities[i].drawframe].color = ct.color; - backbuffer.draw(sprites[obj.entities[i].drawframe], tposition); + sprites[obj.entities[i].drawframe].colorTransform(sprites_rect, ct); + backbuffer.copyPixels(sprites[obj.entities[i].drawframe], sprites_rect, tpoint); if (map.warpx) { //screenwrapping! if (tpoint.x < 0) { - tposition.identity(); - tposition.translate(int(obj.entities[i].xp) + 320, int(obj.entities[i].yp)); - backbuffer.draw(sprites[obj.entities[i].drawframe], tposition); + tpoint.x += 320; + backbuffer.copyPixels(sprites[obj.entities[i].drawframe], sprites_rect, tpoint); } if (tpoint.x > 300) { - tposition.identity(); - tposition.translate(int(obj.entities[i].xp) - 320, int(obj.entities[i].yp)); - backbuffer.draw(sprites[obj.entities[i].drawframe], tposition); + tpoint.x -= 320; + backbuffer.copyPixels(sprites[obj.entities[i].drawframe], sprites_rect, tpoint); } }else if (map.warpy) { if (tpoint.y < 0) { - tposition.identity(); - tposition.translate(int(obj.entities[i].xp), int(obj.entities[i].yp) + 230); - backbuffer.draw(sprites[obj.entities[i].drawframe], tposition); + tpoint.y += 230; + backbuffer.copyPixels(sprites[obj.entities[i].drawframe], sprites_rect, tpoint); } if (tpoint.y > 210) { - tposition.identity(); - tposition.translate(int(obj.entities[i].xp), int(obj.entities[i].yp) - 230); - backbuffer.draw(sprites[obj.entities[i].drawframe], tposition); + tpoint.y -= 230; + backbuffer.copyPixels(sprites[obj.entities[i].drawframe], sprites_rect, tpoint); } } } }else if (obj.entities[i].size == 1) { // Tiles - tposition.identity(); - tposition.translate(int(obj.entities[i].xp), int(obj.entities[i].yp)); - backbuffer.draw(tiles[obj.entities[i].drawframe], tposition); + tpoint.x = obj.entities[i].xp; tpoint.y = obj.entities[i].yp; + backbuffer.copyPixels(tiles[obj.entities[i].drawframe], tiles_rect, tpoint); }else if (obj.entities[i].size == 2) { // Special: Moving platform, 4 tiles - tposition.identity(); tposition.translate(int(obj.entities[i].xp), int(obj.entities[i].yp)); - if (map.custommode) { - backbuffer.draw(entcolours[obj.entities[i].drawframe], tposition); - tposition.identity(); tposition.translate(int(obj.entities[i].xp) + 8, int(obj.entities[i].yp)); - backbuffer.draw(entcolours[obj.entities[i].drawframe], tposition); - tposition.identity(); tposition.translate(int(obj.entities[i].xp) + 16, int(obj.entities[i].yp)); - backbuffer.draw(entcolours[obj.entities[i].drawframe], tposition) - tposition.identity(); tposition.translate(int(obj.entities[i].xp) + 24, int(obj.entities[i].yp)); - backbuffer.draw(entcolours[obj.entities[i].drawframe], tposition) - }else { - backbuffer.draw(tiles[obj.entities[i].drawframe], tposition); - tposition.identity(); tposition.translate(int(obj.entities[i].xp) + 8, int(obj.entities[i].yp)); - backbuffer.draw(tiles[obj.entities[i].drawframe], tposition); - tposition.identity(); tposition.translate(int(obj.entities[i].xp) + 16, int(obj.entities[i].yp)); - backbuffer.draw(tiles[obj.entities[i].drawframe], tposition) - tposition.identity(); tposition.translate(int(obj.entities[i].xp) + 24, int(obj.entities[i].yp)); - backbuffer.draw(tiles[obj.entities[i].drawframe], tposition) + tpoint.x = obj.entities[i].xp; tpoint.y = obj.entities[i].yp; + if(map.custommode){ + backbuffer.copyPixels(entcolours[obj.entities[i].drawframe], tiles_rect, tpoint); + tpoint.x += 8; backbuffer.copyPixels(entcolours[obj.entities[i].drawframe], tiles_rect, tpoint); + tpoint.x += 8; backbuffer.copyPixels(entcolours[obj.entities[i].drawframe], tiles_rect, tpoint); + tpoint.x += 8; backbuffer.copyPixels(entcolours[obj.entities[i].drawframe], tiles_rect, tpoint); + }else{ + backbuffer.copyPixels(tiles[obj.entities[i].drawframe], tiles_rect, tpoint); + tpoint.x += 8; backbuffer.copyPixels(tiles[obj.entities[i].drawframe], tiles_rect, tpoint); + tpoint.x += 8; backbuffer.copyPixels(tiles[obj.entities[i].drawframe], tiles_rect, tpoint); + tpoint.x += 8; backbuffer.copyPixels(tiles[obj.entities[i].drawframe], tiles_rect, tpoint); } }else if (obj.entities[i].size == 3) { // Big chunky pixels! - prect.x = int(obj.entities[i].xp); prect.y = int(obj.entities[i].yp); + prect.x = obj.entities[i].xp; prect.y = obj.entities[i].yp; //A seperate index of colours, for simplicity - if (obj.entities[i].colour == 1) { - drawfillrect(prect.x, prect.y, prect.width, prect.height, 196 - (Math.random() * 64), 10, 10); + if(obj.entities[i].colour==1){ + backbuffer.fillRect(prect, RGB(196 - (Math.random() * 64), 10, 10)); }else if (obj.entities[i].colour == 2) { - drawfillrect(prect.x, prect.y, prect.width, prect.height, 160 - help.glow / 2 - (Math.random() * 20), 200 - help.glow / 2, 220 - help.glow); + backbuffer.fillRect(prect, RGB(160- help.glow/2 - (Math.random()*20), 200- help.glow/2, 220 - help.glow)); } }else if (obj.entities[i].size == 4) { // Small pickups - drawhuetile(int(obj.entities[i].xp), int(obj.entities[i].yp), obj.entities[i].tile, obj.entities[i].colour); + drawhuetile(obj.entities[i].xp, obj.entities[i].yp, obj.entities[i].tile, obj.entities[i].colour); }else if (obj.entities[i].size == 5) { //Horizontal Line - line_rect.x = int(obj.entities[i].xp); line_rect.y = int(obj.entities[i].yp); + line_rect.x = obj.entities[i].xp; line_rect.y = obj.entities[i].yp; line_rect.width = obj.entities[i].w; line_rect.height = 1; drawgravityline(i, obj); }else if (obj.entities[i].size == 6) { //Vertical Line - line_rect.x = int(obj.entities[i].xp); line_rect.y = int(obj.entities[i].yp); + line_rect.x = obj.entities[i].xp; line_rect.y = obj.entities[i].yp; line_rect.width = 1; line_rect.height = obj.entities[i].h; drawgravityline(i, obj); }else if (obj.entities[i].size == 7) { //Teleporter - drawtele(int(obj.entities[i].xp), int(obj.entities[i].yp), obj.entities[i].drawframe, obj.entities[i].colour, help); + drawtele(obj.entities[i].xp, obj.entities[i].yp, obj.entities[i].drawframe, obj.entities[i].colour, help); }else if (obj.entities[i].size == 8) { // Special: Moving platform, 8 tiles - tposition.identity(); tposition.translate(int(obj.entities[i].xp), int(obj.entities[i].yp)); + tpoint.x = obj.entities[i].xp; tpoint.y = obj.entities[i].yp; if (map.custommode) { - backbuffer.draw(entcolours[obj.entities[i].drawframe], tposition); - tposition.identity(); tposition.translate(int(obj.entities[i].xp + 8), int(obj.entities[i].yp)); - backbuffer.draw(entcolours[obj.entities[i].drawframe], tposition); - tposition.identity(); tposition.translate(int(obj.entities[i].xp + 16), int(obj.entities[i].yp)); - backbuffer.draw(entcolours[obj.entities[i].drawframe], tposition); - tposition.identity(); tposition.translate(int(obj.entities[i].xp + 24), int(obj.entities[i].yp)); - backbuffer.draw(entcolours[obj.entities[i].drawframe], tposition); - tposition.identity(); tposition.translate(int(obj.entities[i].xp + 32), int(obj.entities[i].yp)); - backbuffer.draw(entcolours[obj.entities[i].drawframe], tposition); - tposition.identity(); tposition.translate(int(obj.entities[i].xp + 40), int(obj.entities[i].yp)); - backbuffer.draw(entcolours[obj.entities[i].drawframe], tposition); - tposition.identity(); tposition.translate(int(obj.entities[i].xp + 48), int(obj.entities[i].yp)); - backbuffer.draw(entcolours[obj.entities[i].drawframe], tposition); - tposition.identity(); tposition.translate(int(obj.entities[i].xp + 56), int(obj.entities[i].yp)); - backbuffer.draw(entcolours[obj.entities[i].drawframe], tposition); + backbuffer.copyPixels(entcolours[obj.entities[i].drawframe], tiles_rect, tpoint); + tpoint.x += 8; backbuffer.copyPixels(entcolours[obj.entities[i].drawframe], tiles_rect, tpoint); + tpoint.x += 8; backbuffer.copyPixels(entcolours[obj.entities[i].drawframe], tiles_rect, tpoint); + tpoint.x += 8; backbuffer.copyPixels(entcolours[obj.entities[i].drawframe], tiles_rect, tpoint); + tpoint.x += 8; backbuffer.copyPixels(entcolours[obj.entities[i].drawframe], tiles_rect, tpoint); + tpoint.x += 8; backbuffer.copyPixels(entcolours[obj.entities[i].drawframe], tiles_rect, tpoint); + tpoint.x += 8; backbuffer.copyPixels(entcolours[obj.entities[i].drawframe], tiles_rect, tpoint); + tpoint.x += 8; backbuffer.copyPixels(entcolours[obj.entities[i].drawframe], tiles_rect, tpoint); }else{ - backbuffer.draw(tiles[obj.entities[i].drawframe], tposition); - tposition.identity(); tposition.translate(int(obj.entities[i].xp + 8), int(obj.entities[i].yp)); - backbuffer.draw(tiles[obj.entities[i].drawframe], tposition); - tposition.identity(); tposition.translate(int(obj.entities[i].xp + 16), int(obj.entities[i].yp)); - backbuffer.draw(tiles[obj.entities[i].drawframe], tposition); - tposition.identity(); tposition.translate(int(obj.entities[i].xp + 24), int(obj.entities[i].yp)); - backbuffer.draw(tiles[obj.entities[i].drawframe], tposition); - tposition.identity(); tposition.translate(int(obj.entities[i].xp + 32), int(obj.entities[i].yp)); - backbuffer.draw(tiles[obj.entities[i].drawframe], tposition); - tposition.identity(); tposition.translate(int(obj.entities[i].xp + 40), int(obj.entities[i].yp)); - backbuffer.draw(tiles[obj.entities[i].drawframe], tposition); - tposition.identity(); tposition.translate(int(obj.entities[i].xp + 48), int(obj.entities[i].yp)); - backbuffer.draw(tiles[obj.entities[i].drawframe], tposition); - tposition.identity(); tposition.translate(int(obj.entities[i].xp + 56), int(obj.entities[i].yp)); - backbuffer.draw(tiles[obj.entities[i].drawframe], tposition); + backbuffer.copyPixels(tiles[obj.entities[i].drawframe], tiles_rect, tpoint); + tpoint.x += 8; backbuffer.copyPixels(tiles[obj.entities[i].drawframe], tiles_rect, tpoint); + tpoint.x += 8; backbuffer.copyPixels(tiles[obj.entities[i].drawframe], tiles_rect, tpoint); + tpoint.x += 8; backbuffer.copyPixels(tiles[obj.entities[i].drawframe], tiles_rect, tpoint); + tpoint.x += 8; backbuffer.copyPixels(tiles[obj.entities[i].drawframe], tiles_rect, tpoint); + tpoint.x += 8; backbuffer.copyPixels(tiles[obj.entities[i].drawframe], tiles_rect, tpoint); + tpoint.x += 8; backbuffer.copyPixels(tiles[obj.entities[i].drawframe], tiles_rect, tpoint); + tpoint.x += 8; backbuffer.copyPixels(tiles[obj.entities[i].drawframe], tiles_rect, tpoint); } }else if (obj.entities[i].size == 9) { // Really Big Sprite! (2x2) if (flipmode) { - setcol(obj.entities[i].colour, help); + setcol(obj.entities[i].colour, help); - tposition.identity(); - tposition.translate(int(obj.entities[i].xp), int(obj.entities[i].yp)); - flipsprites[obj.entities[i].drawframe].color = ct.color; - backbuffer.draw(flipsprites[obj.entities[i].drawframe], tposition); + tpoint.x = obj.entities[i].xp; tpoint.y = obj.entities[i].yp; + flipsprites[obj.entities[i].drawframe].colorTransform(sprites_rect, ct); + backbuffer.copyPixels(flipsprites[obj.entities[i].drawframe], sprites_rect, tpoint); - tposition.identity(); - tposition.translate(int(obj.entities[i].xp) + 32, int(obj.entities[i].yp)); - flipsprites[obj.entities[i].drawframe + 1].color = ct.color; - backbuffer.draw(flipsprites[obj.entities[i].drawframe + 1], tposition); + tpoint.x = obj.entities[i].xp+32; tpoint.y = obj.entities[i].yp; + flipsprites[obj.entities[i].drawframe+1].colorTransform(sprites_rect, ct); + backbuffer.copyPixels(flipsprites[obj.entities[i].drawframe+1], sprites_rect, tpoint); - tposition.identity(); - tposition.translate(int(obj.entities[i].xp), int(obj.entities[i].yp) + 32); - flipsprites[obj.entities[i].drawframe + 12].color = ct.color; - backbuffer.draw(flipsprites[obj.entities[i].drawframe + 12], tposition); + tpoint.x = obj.entities[i].xp; tpoint.y = obj.entities[i].yp+32; + flipsprites[obj.entities[i].drawframe+12].colorTransform(sprites_rect, ct); + backbuffer.copyPixels(flipsprites[obj.entities[i].drawframe+12], sprites_rect, tpoint); - tposition.identity(); - tposition.translate(int(obj.entities[i].xp) + 32, int(obj.entities[i].yp) + 32); - flipsprites[obj.entities[i].drawframe + 13].color = ct.color; - backbuffer.draw(flipsprites[obj.entities[i].drawframe + 13], tposition); + tpoint.x = obj.entities[i].xp+32; tpoint.y = obj.entities[i].yp+32; + flipsprites[obj.entities[i].drawframe+13].colorTransform(sprites_rect, ct); + backbuffer.copyPixels(flipsprites[obj.entities[i].drawframe + 13], sprites_rect, tpoint); }else{ - setcol(obj.entities[i].colour, help); + setcol(obj.entities[i].colour, help); - tposition.identity(); - tposition.translate(int(obj.entities[i].xp), int(obj.entities[i].yp)); - sprites[obj.entities[i].drawframe].color = ct.color; - backbuffer.draw(sprites[obj.entities[i].drawframe], tposition); + tpoint.x = obj.entities[i].xp; tpoint.y = obj.entities[i].yp; + sprites[obj.entities[i].drawframe].colorTransform(sprites_rect, ct); + backbuffer.copyPixels(sprites[obj.entities[i].drawframe], sprites_rect, tpoint); - tposition.identity(); - tposition.translate(int(obj.entities[i].xp) + 32, int(obj.entities[i].yp)); - sprites[obj.entities[i].drawframe + 1].color = ct.color; - backbuffer.draw(sprites[obj.entities[i].drawframe + 1], tposition); + tpoint.x = obj.entities[i].xp+32; tpoint.y = obj.entities[i].yp; + sprites[obj.entities[i].drawframe+1].colorTransform(sprites_rect, ct); + backbuffer.copyPixels(sprites[obj.entities[i].drawframe+1], sprites_rect, tpoint); - tposition.identity(); - tposition.translate(int(obj.entities[i].xp), int(obj.entities[i].yp) + 32); - sprites[obj.entities[i].drawframe + 12].color = ct.color; - backbuffer.draw(sprites[obj.entities[i].drawframe + 12], tposition); + tpoint.x = obj.entities[i].xp; tpoint.y = obj.entities[i].yp+32; + sprites[obj.entities[i].drawframe+12].colorTransform(sprites_rect, ct); + backbuffer.copyPixels(sprites[obj.entities[i].drawframe+12], sprites_rect, tpoint); - tposition.identity(); - tposition.translate(int(obj.entities[i].xp) + 32, int(obj.entities[i].yp) + 32); - sprites[obj.entities[i].drawframe + 13].color = ct.color; - backbuffer.draw(sprites[obj.entities[i].drawframe + 13], tposition); + tpoint.x = obj.entities[i].xp+32; tpoint.y = obj.entities[i].yp+32; + sprites[obj.entities[i].drawframe+13].colorTransform(sprites_rect, ct); + backbuffer.copyPixels(sprites[obj.entities[i].drawframe + 13], sprites_rect, tpoint); } }else if (obj.entities[i].size == 10) { // 2x1 Sprite if (flipmode) { - setcol(obj.entities[i].colour, help); + setcol(obj.entities[i].colour, help); - tposition.identity(); - tposition.translate(int(obj.entities[i].xp), int(obj.entities[i].yp)); - flipsprites[obj.entities[i].drawframe].color = ct.color; - backbuffer.draw(flipsprites[obj.entities[i].drawframe], tposition); + tpoint.x = obj.entities[i].xp; tpoint.y = obj.entities[i].yp; + flipsprites[obj.entities[i].drawframe].colorTransform(sprites_rect, ct); + backbuffer.copyPixels(flipsprites[obj.entities[i].drawframe], sprites_rect, tpoint); - tposition.identity(); - tposition.translate(int(obj.entities[i].xp) + 32, int(obj.entities[i].yp)); - flipsprites[obj.entities[i].drawframe + 1].color = ct.color; - backbuffer.draw(flipsprites[obj.entities[i].drawframe + 1], tposition); + tpoint.x = obj.entities[i].xp+32; tpoint.y = obj.entities[i].yp; + flipsprites[obj.entities[i].drawframe+1].colorTransform(sprites_rect, ct); + backbuffer.copyPixels(flipsprites[obj.entities[i].drawframe + 1], sprites_rect, tpoint); }else{ - setcol(obj.entities[i].colour, help); + setcol(obj.entities[i].colour, help); - tposition.identity(); - tposition.translate(int(obj.entities[i].xp), int(obj.entities[i].yp)); - sprites[obj.entities[i].drawframe].color = ct.color; - backbuffer.draw(sprites[obj.entities[i].drawframe], tposition); + tpoint.x = obj.entities[i].xp; tpoint.y = obj.entities[i].yp; + sprites[obj.entities[i].drawframe].colorTransform(sprites_rect, ct); + backbuffer.copyPixels(sprites[obj.entities[i].drawframe], sprites_rect, tpoint); - tposition.identity(); - tposition.translate(int(obj.entities[i].xp) + 32, int(obj.entities[i].yp)); - sprites[obj.entities[i].drawframe + 1].color = ct.color; - backbuffer.draw(sprites[obj.entities[i].drawframe + 1], tposition); + tpoint.x = obj.entities[i].xp+32; tpoint.y = obj.entities[i].yp; + sprites[obj.entities[i].drawframe+1].colorTransform(sprites_rect, ct); + backbuffer.copyPixels(sprites[obj.entities[i].drawframe + 1], sprites_rect, tpoint); } }else if (obj.entities[i].size == 11) { //The fucking elephant - setcol(obj.entities[i].colour, help); - images[3].color = ct.color; - drawimage(3, int(obj.entities[i].xp), int(obj.entities[i].yp)); + setcol(obj.entities[i].colour, help); + images[3].colorTransform(images[3].rect, ct); + drawimage(3, obj.entities[i].xp, obj.entities[i].yp); }else if (obj.entities[i].size == 12) { // Regular sprites that don't wrap if (flipmode) { //forget this for a minute; - tpoint.x = int(obj.entities[i].xp); tpoint.y = int(obj.entities[i].yp); + tpoint.x = obj.entities[i].xp; tpoint.y = obj.entities[i].yp; setcol(obj.entities[i].colour, help); - flipsprites[obj.entities[i].drawframe].color = ct.color; - tposition.identity(); - tposition.translate(tpoint.x, tpoint.y); - backbuffer.draw(flipsprites[obj.entities[i].drawframe], tposition); + flipsprites[obj.entities[i].drawframe].colorTransform(sprites_rect, ct); + backbuffer.copyPixels(flipsprites[obj.entities[i].drawframe], sprites_rect, tpoint); //if we're outside the screen, we need to draw indicators if (obj.entities[i].xp < -20 && obj.entities[i].vx > 0) { @@ -2440,11 +2188,8 @@ package{ tpoint.y = tpoint.y+4; setcol(23, help); - tiles[1167].color = ct.color; - tposition.identity(); - tposition.translate(tpoint.x, tpoint.y); - - backbuffer.draw(tiles[1167], tposition); + tiles[1167].colorTransform(tiles_rect, ct); + backbuffer.copyPixels(tiles[1167], tiles_rect, tpoint); }else if (obj.entities[i].xp > 340 && obj.entities[i].vx < 0) { if (obj.entities[i].xp > 420) { tpoint.x = 320 - (int(( obj.entities[i].xp-320) / 10)); @@ -2454,20 +2199,14 @@ package{ tpoint.y = tpoint.y+4; setcol(23, help); - tiles[1166].color = ct.color; - - tposition.identity(); - tposition.translate(tpoint.x, tpoint.y); - - backbuffer.draw(tiles[1166], tposition); + tiles[1166].colorTransform(tiles_rect, ct); + backbuffer.copyPixels(tiles[1166], tiles_rect, tpoint); } }else{ - tpoint.x = int(obj.entities[i].xp); tpoint.y = int(obj.entities[i].yp); + tpoint.x = obj.entities[i].xp; tpoint.y = obj.entities[i].yp; setcol(obj.entities[i].colour, help); - sprites[obj.entities[i].drawframe].color = ct.color; - tposition.identity(); - tposition.translate(tpoint.x, tpoint.y); - backbuffer.draw(sprites[obj.entities[i].drawframe], tposition); + sprites[obj.entities[i].drawframe].colorTransform(sprites_rect, ct); + backbuffer.copyPixels(sprites[obj.entities[i].drawframe], sprites_rect, tpoint); //if we're outside the screen, we need to draw indicators @@ -2480,11 +2219,8 @@ package{ tpoint.y = tpoint.y+4; setcol(23, help); - tiles[1167].color = ct.color; - tposition.identity(); - tposition.translate(tpoint.x, tpoint.y); - - backbuffer.draw(tiles[1167], tposition); + tiles[1167].colorTransform(tiles_rect, ct); + backbuffer.copyPixels(tiles[1167], tiles_rect, tpoint); }else if (obj.entities[i].xp > 340 && obj.entities[i].vx < 0) { if (obj.entities[i].xp > 420) { tpoint.x = 320 - (int(( obj.entities[i].xp-320) / 10)); @@ -2494,31 +2230,37 @@ package{ tpoint.y = tpoint.y+4; setcol(23, help); - tiles[1166].color = ct.color; - - tposition.identity(); - tposition.translate(tpoint.x, tpoint.y); - - backbuffer.draw(tiles[1166], tposition); + tiles[1166].colorTransform(tiles_rect, ct); + backbuffer.copyPixels(tiles[1166], tiles_rect, tpoint); } } }else if (obj.entities[i].size == 13) { // Special for epilogue: huge hero! if (flipmode) { - tposition.identity(); - tposition.scale(6, 6); - tposition.translate(int(obj.entities[i].xp), int(obj.entities[i].yp)); + scaleMatrix = new Matrix(); + scaleMatrix.scale(6, 6); + bigbuffer.fillRect(bigbuffer.rect, 0x000000); + tpoint.x = obj.entities[i].xp; tpoint.y = obj.entities[i].yp; setcol(obj.entities[i].colour, help); - flipsprites[obj.entities[i].drawframe].color = ct.color; - backbuffer.draw(flipsprites[obj.entities[i].drawframe], tposition); + flipsprites[obj.entities[i].drawframe].colorTransform(sprites_rect, ct); + bigbuffer.copyPixels(flipsprites[obj.entities[i].drawframe], sprites_rect, new Point(0, 0)); + + scaleMatrix.translate(obj.entities[i].xp, obj.entities[i].yp); + backbuffer.draw(bigbufferscreen, scaleMatrix); + scaleMatrix.translate(-obj.entities[i].xp, -obj.entities[i].yp); }else { - tposition.identity(); - tposition.scale(6, 6); - tposition.translate(int(obj.entities[i].xp), int(obj.entities[i].yp)); + scaleMatrix = new Matrix(); + scaleMatrix.scale(6, 6); + bigbuffer.fillRect(bigbuffer.rect, 0x000000); + tpoint.x = obj.entities[i].xp; tpoint.y = obj.entities[i].yp; setcol(obj.entities[i].colour, help); - sprites[obj.entities[i].drawframe].color = ct.color; - backbuffer.draw(sprites[obj.entities[i].drawframe], tposition); + sprites[obj.entities[i].drawframe].colorTransform(sprites_rect, ct); + bigbuffer.copyPixels(sprites[obj.entities[i].drawframe], sprites_rect, new Point(0, 0)); + + scaleMatrix.translate(obj.entities[i].xp, obj.entities[i].yp); + backbuffer.draw(bigbufferscreen, scaleMatrix); + scaleMatrix.translate(-obj.entities[i].xp, -obj.entities[i].yp); } } } @@ -2526,81 +2268,67 @@ package{ } public function drawbuffertile(x:int, y:int, t:int):void { - trace("dwgfx.drawbuffertile() is not implemented yet"); + tpoint.x = x; tpoint.y = y; + buffer.copyPixels(tiles[t], tiles_rect, tpoint); } public function drawforetile(x:int, y:int, t:int):void { - tposition.identity(); - tposition.translate(x, y); - frontbuffer_meshbatch.addMesh(tiles[t], tposition); + tpoint.x = x; tpoint.y = y; + frontbuffer.copyPixels(tiles[t], tiles_rect, tpoint); } public function drawforetile2(x:int, y:int, t:int):void { - tposition.identity(); - tposition.translate(x, y); - frontbuffer_meshbatch.addMesh(tiles2[t], tposition); + tpoint.x = x; tpoint.y = y; + frontbuffer.copyPixels(tiles2[t], tiles_rect, tpoint); } public function drawforetile3(x:int, y:int, t:int, off:int):void { - tposition.identity(); - tposition.translate(x, y); - frontbuffer_meshbatch.addMesh(tiles3[t+(off*30)], tposition); + tpoint.x = x; tpoint.y = y; + frontbuffer.copyPixels(tiles3[t+(off*30)], tiles_rect, tpoint); } + public function drawtele(x:int, y:int, t:int, c:int, help:helpclass):void { - tele[0].color = RGB(16, 16, 16); - tposition.identity(); - tposition.translate(x, y); - backbuffer.draw(tele[0], tposition); + tpoint.x = x; tpoint.y = y; - setcol(c, help); + setcolreal(RGB(16,16,16)); + tele[0].colorTransform(tele_rect, ct); + backbuffer.copyPixels(tele[0], tele_rect, tpoint); + + setcol(c, help); if (t > 9) t = 8; if (t < 0) t = 0; - tele[t].color = ct.color; - - tposition.identity(); - tposition.translate(x, y); - backbuffer.draw(tele[t], tposition); + tele[t].colorTransform(tele_rect, ct); + backbuffer.copyPixels(tele[t], tele_rect, tpoint); } public function drawtile(x:int, y:int, t:int):void { - tposition.identity(); - tposition.translate(x, y); - backbuffer.draw(tiles[t], tposition); + tpoint.x = x; tpoint.y = y; + backbuffer.copyPixels(tiles[t], tiles_rect, tpoint); } public function drawtile2(x:int, y:int, t:int):void { - tposition.identity(); - tposition.translate(x, y); - backbuffer.draw(tiles2[t], tposition); + tpoint.x = x; tpoint.y = y; + backbuffer.copyPixels(tiles2[t], tiles_rect, tpoint); } public function drawtile3(x:int, y:int, t:int, off:int):void { - tposition.identity(); - tposition.translate(x, y); - backbuffer.draw(tiles3[t + (off * 30)], tposition); - } - - public function drawtile3_batch(x:int, y:int, t:int, off:int):void { - tposition.identity(); - tposition.translate(x, y); - towerbufferforeground_meshbatch.addMesh(tiles3[t + (off * 30)], tposition); + tpoint.x = x; tpoint.y = y; + backbuffer.copyPixels(tiles3[t+(off*30)], tiles_rect, tpoint); } public function drawtowertile3(x:int, y:int, t:int, off:int):void { - tposition.identity(); - tposition.translate(x, y); - towerbufferbackground_meshbatch.addMesh(tiles3[t+(off*30)], tposition); + tpoint.x = x; tpoint.y = y; + towerbuffer.copyPixels(tiles3[t+(off*30)], tiles_rect, tpoint); } public function drawtowertile(x:int, y:int, t:int):void { - tposition.identity(); - tposition.translate(x, y); - backbuffer.draw(tiles2[t], tposition); + tpoint.x = x; tpoint.y = y; + towerbuffer.copyPixels(tiles2[t], tiles_rect, tpoint, null, null, true); } public function drawmap(map:mapclass):void { if (!foregrounddrawn) { - frontbuffer_meshbatch.clear(); + frontbuffer.fillRect(frontbuffer.rect, 0x000000); if(map.tileset==0){ for (j = 0; j < 29+map.extrarow; j++) { for (i = 0; i < 40; i++) { @@ -2620,17 +2348,17 @@ package{ } } } - foregrounddrawn = true; + foregrounddrawn=true; } - backbuffer.draw(frontbuffer_meshbatch); + backbuffer.copyPixels(frontbuffer, frontbuffer.rect, tl); } public function drawfinalmap(map:mapclass):void { //Update colour cycling for final level if (map.final_colormode) { map.final_aniframedelay--; - if (map.final_aniframedelay == 0) foregrounddrawn = false; + if(map.final_aniframedelay==0) foregrounddrawn=false; if (map.final_aniframedelay <= 0) { map.final_aniframedelay = 2; map.final_aniframe++; @@ -2639,9 +2367,9 @@ package{ } if (!foregrounddrawn) { - frontbuffer_meshbatch.clear(); + frontbuffer.fillRect(frontbuffer.rect, 0x000000); if(map.tileset==0){ - for (j = 0; j < 29 + map.extrarow; j++) { + for (j = 0; j < 29+map.extrarow; j++) { for (i = 0; i < 40; i++) { if(map.contents[i + map.vmult[j]]>0) drawforetile(i * 8, j * 8, map.finalat(i,j)); } @@ -2656,69 +2384,54 @@ package{ foregrounddrawn=true; } - backbuffer.draw(frontbuffer_meshbatch); + backbuffer.copyPixels(frontbuffer, frontbuffer.rect, tl); } public function drawmaptileat(xp:int, yp:int, mapx:int, mapy:int, map:mapclass):void { - //Not used anymore, phew - trace("dwgfx.drawmaptileat() is not implemented yet"); + if (mapx < 100) mapx = 119; if (mapy < 100) mapy = 119; + if (mapx > 119) mapx = 100; if (mapy > 119) mapy = 100; + if (map.explored[(mapx - 100) + ((mapy - 100) * 20)] == 1) { + madrect.x = (mapx - 100)*12; madrect.y = (mapy - 100)*9; madrect.width = 12; madrect.height = 9; + madpoint.x = xp; madpoint.y = yp; + backbuffer.copyPixels(images[1], madrect, madpoint); + }else { + drawimage(2, xp, yp); + } } public function drawminimap(game:gameclass, map:mapclass):void { - //Not used anymore, phew - trace("dwgfx.drawminimap() is not implemented yet"); + drawfillrect(272, 8, 40, 31, 196, 196, 196); + drawfillrect(273, 9, 38, 29, 164,164,164); + for (j = 0; j < 3; j++){ + for (i = 0; i < 3; i++) { + drawmaptileat(274 + (i * 12), 10 + (j * 9), game.roomx - 1 + i, game.roomy - 1 + j, map); + } + } } - + public function drawrect(x:int, y:int, w:int, h:int, r:int, g:int, b:int):void { //Draw the retangle indicated by that object - tquad.x = x; tquad.y = y; - tquad.width = w; tquad.height = 1; - tquad.color = RGB(r, g, b); - backbuffer.draw(tquad); + madrect.x = x; madrect.y = y; + madrect.width = w; madrect.height = 1; + backbuffer.fillRect(madrect, RGB(r,g,b)); - tquad.width = 1; tquad.height = h; - backbuffer.draw(tquad); + madrect.width = 1; madrect.height = h; + backbuffer.fillRect(madrect, RGB(r,g,b)); - tquad.x = x + w - 1; - backbuffer.draw(tquad); + madrect.x = x + w - 1; + madrect.width = 1; madrect.height = h; + backbuffer.fillRect(madrect, RGB(r,g,b)); - tquad.x = x; tquad.y = y + h - 1; - tquad.width = w; tquad.height = 1; - backbuffer.draw(tquad); + madrect.x = x; madrect.y = y + h - 1; + madrect.width = w; madrect.height = 1; + backbuffer.fillRect(madrect, RGB(r,g,b)); } - public function cls(c:int):void { - drawfillrect(0, 0, screenwidth, screenheight, c); - } - - public function drawfillrect(x:int, y:int, w:int, h:int, r:int, g:int = -1, b:int = -1):void { + public function drawfillrect(x:int, y:int, w:int, h:int, r:int, g:int, b:int):void { //Draw the retangle indicated by that object - tquad.x = x; - tquad.y = y; - tquad.width = w; - tquad.height = h; - if (b == -1) { - tquad.color = r; - }else{ - tquad.color = RGB(r, g, b); - } - - backbuffer.draw(tquad); - } - - public function drawfillrect_onimage(img:RenderTexture, x:int, y:int, w:int, h:int, r:int, g:int = -1, b:int = -1):void { - //Draw the retangle indicated by that object - tquad.x = x; - tquad.y = y; - tquad.width = w; - tquad.height = h; - if (b == -1) { - tquad.color = r; - }else{ - tquad.color = RGB(r, g, b); - } - - img.draw(tquad); + madrect.x = x; madrect.y = y; + madrect.width = w; madrect.height = h; + backbuffer.fillRect(madrect, RGB(r,g,b)); } public function printcrewname(x:int, y:int, t:int):void { @@ -2757,85 +2470,82 @@ package{ } } - public function printmask(x:int, y:int, t:String, cen:Boolean = false):void { - trace("dwgfx.printmask() is not implemented yet"); - } - - public function textbox_print(x:int, y:int, t:String, r:int, g:int, b:int, cen:Boolean = false):void { - trace("dwgfx.textbox_print() is not implemented yet"); + public function printmask(x:int, y:int, t:String, cen:Boolean = false):void { + if (cen) x = 160 - (len(t) / 2); + bfontpos = 0; + for (var i:int = 0; i < t.length; i++) { + cur = t.charCodeAt(i); + tpoint.x = x + bfontpos-1; tpoint.y = y; + if (flipmode) { + backbuffer.copyPixels(flipbfontmask[cur], bfont_rect, tpoint); + }else{ + backbuffer.copyPixels(bfontmask[cur], bfont_rect, tpoint); + } + bfontpos+=bfontlen[cur]; + } } public function print(x:int, y:int, t:String, r:int, g:int, b:int, cen:Boolean = false):void { if (r < 0) r = 0; if (g < 0) g = 0; if (b < 0) b = 0; if (r > 255) r = 255; if (g > 255) g = 255; if (b > 255) b = 255; - if (cen) { - x = 0; - ttf.format.horizontalAlign = "center"; - }else { - ttf.format.horizontalAlign = "left"; - } - - ttf.format.color = RGB(r, g, b); - ttf.text = t; - - if (flipmode) { - tposition.identity(); - tposition.scale(1, -1); - tposition.translate(x, y + 8); - backbuffer.draw(ttf, tposition); - }else{ - tposition.identity(); - tposition.translate(x, y); - backbuffer.draw(ttf, tposition); + ct.color = RGB(r, g, b); + if (cen) x = 160 - (len(t) / 2); + bfontpos = 0; + for (var i:int = 0; i < t.length; i++) { + cur = t.charCodeAt(i); + tpoint.x = x + bfontpos; tpoint.y = y; + if (flipmode) { + flipbfont[cur].colorTransform(bfont_rect, ct); + backbuffer.copyPixels(flipbfont[cur], bfont_rect, tpoint); + }else { + bfont[cur].colorTransform(bfont_rect, ct); + backbuffer.copyPixels(bfont[cur], bfont_rect, tpoint); + } + bfontpos+=bfontlen[cur]; } } public function rprint(x:int, y:int, t:String, r:int, g:int, b:int, cen:Boolean = false):void { if (r < 0) r = 0; if (g < 0) g = 0; if (b < 0) b = 0; if (r > 255) r = 255; if (g > 255) g = 255; if (b > 255) b = 255; - ttf.format.horizontalAlign = "right"; - x = x - 320; - - ttf.format.color = RGB(r, g, b); - ttf.text = t; - - if (flipmode) { - tposition.identity(); - tposition.scale(1, -1); - tposition.translate(x, y + 8); - backbuffer.draw(ttf, tposition); - }else { - tposition.identity(); - tposition.translate(x, y); - backbuffer.draw(ttf, tposition); + ct.color = RGB(r, g, b); + if (cen) x = 308 - (len(t)); + bfontpos = 0; + for (var i:int = 0; i < t.length; i++) { + cur = t.charCodeAt(i); + tpoint.x = x + bfontpos; tpoint.y = y; + if (flipmode) { + flipbfont[cur].colorTransform(bfont_rect, ct); + backbuffer.copyPixels(flipbfont[cur], bfont_rect, tpoint); + }else{ + bfont[cur].colorTransform(bfont_rect, ct); + backbuffer.copyPixels(bfont[cur], bfont_rect, tpoint); + } + bfontpos+=bfontlen[cur]; } } public function printoff(x:int, y:int, t:String, r:int, g:int, b:int, cen:Boolean = false):void { - if (r < 0) r = 0; if (g < 0) g = 0; if (b < 0) b = 0; + if (r < 0) r = 0; if (g < 0) g = 0; if (b < 0) b = 0; if (r > 255) r = 255; if (g > 255) g = 255; if (b > 255) b = 255; - if (cen) { - ttf.format.horizontalAlign = "center"; - }else { - ttf.format.horizontalAlign = "left"; - } - - ttf.format.color = RGB(r, g, b); - ttf.text = t; - - if (flipmode) { - tposition.identity(); - tposition.scale(1, -1); - tposition.translate(x, y + 8); - backbuffer.draw(ttf, tposition); - }else { - tposition.identity(); - tposition.translate(x, y); - backbuffer.draw(ttf, tposition); + ct.color = RGB(r, g, b); + if (cen) x = (160 - (len(t) / 2))+x; + bfontpos = 0; + for (var i:int = 0; i < t.length; i++) { + cur = t.charCodeAt(i); + tpoint.x = x + bfontpos; tpoint.y = y; + if (flipmode) { + flipbfont[cur].colorTransform(bfont_rect, ct); + backbuffer.copyPixels(flipbfont[cur], bfont_rect, tpoint); + }else{ + bfont[cur].colorTransform(bfont_rect, ct); + backbuffer.copyPixels(bfont[cur], bfont_rect, tpoint); + } + bfontpos+=bfontlen[cur]; } } - public function bprint(x:int, y:int, t:String, r:int, g:int, b:int, cen:Boolean = false):void { + public function bprint(x:int, y:int, t:String, r:int, g:int, b:int, cen:Boolean=false):void { //printmask(x, y, t, cen); print(x, y - 1, t, 0, 0, 0, cen); if (cen) { @@ -2851,11 +2561,38 @@ package{ } public function printmasktemptile(x:int, y:int, t:String, cen:Boolean = false):void { - trace("dwgfx.printmasktemptile() is not implemented yet"); + if (cen) x = 160- (len(t) / 2); + bfontpos = 0; + for (var i:int = 0; i < t.length; i++) { + cur = t.charCodeAt(i); + tpoint.x = x + bfontpos - 1; tpoint.y = y; + if (flipmode) { + temptile.copyPixels(flipbfontmask[cur], bfont_rect, tpoint); + }else{ + temptile.copyPixels(bfontmask[cur], bfont_rect, tpoint); + } + bfontpos+=bfontlen[cur]; + } } public function printtemptile(x:int, y:int, t:String, r:int, g:int, b:int, cen:Boolean = false):void { - trace("dwgfx.printtemptile() is not implemented yet"); + if (r < 0) r = 0; if (g < 0) g = 0; if (b < 0) b = 0; + if (r > 255) r = 255; if (g > 255) g = 255; if (b > 255) b = 255; + ct.color = RGB(r, g, b); + if (cen) x = 160 - (len(t) / 2); + bfontpos = 0; + for (var i:int = 0; i < t.length; i++) { + cur = t.charCodeAt(i); + tpoint.x = x + bfontpos; tpoint.y = y; + if (flipmode) { + flipbfont[cur].colorTransform(bfont_rect, ct); + temptile.copyPixels(flipbfont[cur], bfont_rect, tpoint); + }else{ + bfont[cur].colorTransform(bfont_rect, ct); + temptile.copyPixels(bfont[cur], bfont_rect, tpoint); + } + bfontpos+=bfontlen[cur]; + } } public function onscreen(t:int):Boolean { @@ -2866,154 +2603,175 @@ package{ public function bigrprint(x:int, y:int, t:String, r:int, g:int, b:int, cen:Boolean = false, sc:Number = 2):void { if (r < 0) r = 0; if (g < 0) g = 0; if (b < 0) b = 0; if (r > 255) r = 255; if (g > 255) g = 255; if (b > 255) b = 255; - ttf.format.horizontalAlign = "right"; - x = x - 320; + ct.color = RGB(r, g, b); - ttf.format.color = RGB(r, g, b); - ttf.format.size = BitmapFont.NATIVE_SIZE * sc; - ttf.text = t; + scaleMatrix = new Matrix(); + scaleMatrix.scale(sc, sc); - if (flipmode) { - tposition.identity(); - tposition.scale(1, -1); - tposition.translate(x, y + (8 * sc)); - backbuffer.draw(ttf, tposition); - }else { - tposition.identity(); - tposition.translate(x, y); - backbuffer.draw(ttf, tposition); + bigbuffer.fillRect(bigbuffer.rect, 0x000000); + + x = x / sc; + + x -= (len(t)); + + //if (r < -1) r = -1; if (g < 0) g = 0; if (b < 0) b = 0;? + //if (r > 255) r = 255; if (g > 255) g = 255; if (b > 255) b = 255; + ct.color = RGB(r, g, b); + if(sc==2){ + if (cen) x = 80 - (len(t)/2); + }else if (sc == 3) { + if (cen) x = 160/3 - (len(t) / 2); + }else if (sc == 4) { + if (cen) x = 40 - (len(t) / 2); } - ttf.format.size = BitmapFont.NATIVE_SIZE; + bfontpos = 0; + for (i = 0; i < t.length; i++) { + cur = t.charCodeAt(i); + if (flipmode) { + flipbfont[cur].colorTransform(bfont_rect, ct); + bigbuffer.copyPixels(flipbfont[cur], bfont_rect, new Point(x + bfontpos, 0)); + }else { + bfont[cur].colorTransform(bfont_rect, ct); + bigbuffer.copyPixels(bfont[cur], bfont_rect, new Point(x + bfontpos, 0)); + } + bfontpos+=bfontlen[cur]; + } + + scaleMatrix.translate(0, y); + backbuffer.draw(bigbufferscreen, scaleMatrix); + scaleMatrix.translate(0, -y); } public function bigprint(x:int, y:int, t:String, r:int, g:int, b:int, cen:Boolean = false, sc:Number = 2):void { - if (r < 0) r = 0; if (g < 0) g = 0; if (b < 0) b = 0; + if (r < 0) r = 0; if (g < 0) g = 0; if (b < 0) b = 0; if (r > 255) r = 255; if (g > 255) g = 255; if (b > 255) b = 255; - if (cen) { - x = 0; - ttf.format.horizontalAlign = "center"; - }else { - ttf.format.horizontalAlign = "left"; + ct.color = RGB(r, g, b); + + scaleMatrix = new Matrix(); + scaleMatrix.scale(sc, sc); + + bigbuffer.fillRect(bigbuffer.rect, 0x000000); + + x = x / sc; + + //if (r < -1) r = -1; if (g < 0) g = 0; if (b < 0) b = 0;? + //if (r > 255) r = 255; if (g > 255) g = 255; if (b > 255) b = 255; + ct.color = RGB(r, g, b); + if(sc==2){ + if (cen) x = 80 - (len(t)/2); + }else if (sc == 3) { + if (cen) x = 160/3 - (len(t) / 2); + }else if (sc == 4) { + if (cen) x = 40 - (len(t) / 2); + } + bfontpos = 0; + for (var ti:int = 0; ti < t.length; ti++) { + cur = t.charCodeAt(ti); + if (flipmode) { + flipbfont[cur].colorTransform(bfont_rect, ct); + bigbuffer.copyPixels(flipbfont[cur], bfont_rect, new Point(x + bfontpos, 0)); + }else { + bfont[cur].colorTransform(bfont_rect, ct); + bigbuffer.copyPixels(bfont[cur], bfont_rect, new Point(x + bfontpos, 0)); + } + bfontpos+=bfontlen[cur]; } - ttf.format.color = RGB(r, g, b); - ttf.format.size = BitmapFont.NATIVE_SIZE * sc; - ttf.text = t; - - if (flipmode) { - tposition.identity(); - tposition.scale(1, -1); - tposition.translate(x, y + (8 * sc)); - backbuffer.draw(ttf, tposition); - }else { - tposition.identity(); - tposition.translate(x, y); - backbuffer.draw(ttf, tposition); - } - - ttf.format.size = BitmapFont.NATIVE_SIZE; + scaleMatrix.translate(0, y); + backbuffer.draw(bigbufferscreen, scaleMatrix); + scaleMatrix.translate(0, -y); } + public function bprinttemptile(x:int, y:int, t:String, r:int, g:int, b:int, cen:Boolean=false):void { + printmasktemptile(x, y, t, cen); + printtemptile(x, y, t, r, g, b, cen); + } public function len(t:String):int { - //For VVVVVV, we're using a fixed width font, so... - return t.length * 8; + bfontpos = 0; + for (var i:int = 0; i < t.length; i++) { + cur = t.charCodeAt(i); + bfontpos+=bfontlen[cur]; + } + return bfontpos; } public function flashlight():void { - drawfillrect(0, 0, 320, 240, 187, 187, 187); + backbuffer.fillRect(backbuffer.rect, 0xBBBBBB); } public function screenshake():void { - screenmenubuffer.draw(smallscreen); - - if (flipmode) { - tposition.identity(); - tposition.scale(1, -1); - tposition.translate(int((Math.random() * 7) - 4), screenheight + int((Math.random() * 7) - 4)); - drawfillrect(0, 0, screenwidth, screenheight, 0, 0, 0); - backbuffer.draw(screenmenubuffer_image, tposition); + screenbuffer.lock(); + if(flipmode){ + tpoint.x = int((Math.random() * 7) - 4); tpoint.y = int((Math.random() * 7) - 4); + flipmatrix.translate(tpoint.x, tpoint.y); + screenbuffer.draw(backbuffer, flipmatrix); + flipmatrix.translate(-tpoint.x, -tpoint.y); }else{ - tposition.identity(); - tposition.translate(int((Math.random() * 7) - 4), int((Math.random() * 7) - 4)); - - backbuffer.draw(screenmenubuffer_image, tposition); + screenbuffer.copyPixels(backbuffer, backbuffer.rect, tl, null, null, false); + tpoint.x = (Math.random() * 7) - 4; tpoint.y = (Math.random() * 7) - 4; + screenbuffer.copyPixels(backbuffer, backbuffer.rect, tpoint, null, null, false); } + screenbuffer.unlock(); + + backbuffer.lock(); + backbuffer.fillRect(backbuffer.rect, 0x000000); + backbuffer.unlock(); } public function render():void { - if (flipmode) { - tposition.identity(); - tposition.scale(1, -1); - tposition.translate(0, screenheight); - - screenmenubuffer.drawBundled(function():void { - screenmenubuffer.draw(smallscreen); - }); - - backbuffer.draw(screenmenubuffer_image, tposition); + screenbuffer.lock(); + if(flipmode){ + screenbuffer.draw(backbuffer, flipmatrix); + }else{ + screenbuffer.copyPixels(backbuffer, backbuffer.rect, tl, null, null, false); } - } - - public function clear_menubuffer():void { - tquad.x = 0; tquad.y = 0; - tquad.width = screenwidth; - tquad.height = screenheight; - tquad.color = RGB(0, 0, 0); + screenbuffer.unlock(); - menubuffer.drawBundled(function():void { - menubuffer.draw(tquad); - }); - screenmenubuffer.drawBundled(function():void { - screenmenubuffer.draw(tquad); - }); - } - - public function setup_menubuffer():void { - menubuffer.draw(smallscreen); + backbuffer.lock(); + backbuffer.fillRect(backbuffer.rect, 0x000000); + backbuffer.unlock(); } public function menuoffrender():void { - //The backbuffer currently contains the menu, so we save this... - screenmenubuffer.draw(smallscreen); + screenbuffer.lock(); + screenbuffer.copyPixels(menubuffer, menubuffer.rect, tl, null, null, false); - //Then we draw the old in-game screen instead - backbuffer.draw(menubuffer_image); - - //Finally, we draw the menu back on top of this, offset. - if (flipmode) { - tposition.identity(); - tposition.scale(1, -1); - tposition.translate(0, screenheight + menuoffset); - backbuffer.draw(screenmenubuffer_image, tposition); + if(flipmode){ + flipmatrix.translate(0, menuoffset); + screenbuffer.draw(backbuffer, flipmatrix); + flipmatrix.translate(0, -menuoffset); }else { - tposition.identity(); - tposition.translate(0, menuoffset); - backbuffer.draw(screenmenubuffer_image, tposition); + tpoint.x = 0; + tpoint.y = menuoffset; + screenbuffer.copyPixels(backbuffer, backbuffer.rect, tpoint, null, null, false); } + + screenbuffer.unlock(); + + backbuffer.lock(); + backbuffer.fillRect(backbuffer.rect, 0x000000); + backbuffer.unlock(); } - public var tquad:Quad; - public var ttf:TextField; - public var tposition:Matrix; - public var starlingassets:AssetManager; - public var starstage:Stage - - public var backgrounds:Vector. = new Vector.; - public var images:Vector. = new Vector.; - public var playerlevelimages:Vector. = new Vector.; - public var mobileimages:Vector. = new Vector.; - public var tele:Vector. = new Vector.; - public var tiles:Vector. = new Vector.; - public var tiles2:Vector. = new Vector.; - public var tiles3:Vector. = new Vector.; - public var sprites:Vector. = new Vector.; - public var flipsprites:Vector. = new Vector.; - public var sprites_bitmap:Vector. = new Vector.; - public var flipsprites_bitmap:Vector. = new Vector.; - public var entcolours:Vector. = new Vector.; - public var customminimap:RenderTexture; - + public var backgrounds:Vector. = new Vector.; + public var images:Vector. = new Vector.; + public var playerlevelimages:Vector. = new Vector.; + public var mobileimages:Vector. = new Vector.; + public var tele:Vector. = new Vector.; + public var tele_rect:Rectangle; + public var tiles:Vector. = new Vector.; + public var tiles2:Vector. = new Vector.; + public var tiles3:Vector. = new Vector.; + public var sprites:Vector. = new Vector.; + public var flipsprites:Vector. = new Vector.; + public var entcolours:Vector. = new Vector.; + public var bfont:Vector. = new Vector.; + public var bfontmask:Vector. = new Vector.; + public var flipbfont:Vector. = new Vector.; + public var flipbfontmask:Vector. = new Vector.; + public var bfontlen:Vector. = new Vector.; + public var bfontpos:int; public var cur:int; public var ct:ColorTransform; public var tiles_rect:Rectangle; @@ -3031,30 +2789,22 @@ package{ public var tempstring:String; public var alphamult:uint; public var stemp:String; + public var buffer:BitmapData; public var i:int, j:int, k:int, m:int; public var tpoint:Point, trect:Rectangle; public var madrect:Rectangle, madpoint:Point; - public var temptile:RenderTexture; - public var tempsprite:RenderTexture; + public var temptile:BitmapData; + public var tempsprite:BitmapData; public var footerrect:Rectangle; - //Actual backgrounds - public var backbuffer:RenderTexture; - public var frontbuffer_meshbatch:MeshBatch; - public var menubuffer:RenderTexture; - public var menubuffer_image:Image; - public var screenmenubuffer:RenderTexture; - public var screenmenubuffer_image:Image; - public var towerbufferforeground_meshbatch:MeshBatch; - public var towerbufferbackground_meshbatch:MeshBatch; - public var towerbufferstatic_meshbatch:MeshBatch; - public var warpzonehorizontal_meshbatch:MeshBatch; - public var warpzonevertical_meshbatch:MeshBatch; - public var screen:Image; - public var smallscreen:Image; + public var backbuffer:BitmapData; + public var frontbuffer:BitmapData; + public var towerbuffer:BitmapData; + public var screenbuffer:BitmapData; + public var menubuffer:BitmapData; + public var screen:Bitmap; public var updatebackground:Boolean; - //Textbox Stuff public var ntextbox:int; public var textbox:Vector. = new Vector.; @@ -3096,16 +2846,17 @@ package{ public var flipfontmatrix:Matrix = new Matrix(); public var flipfontmatrix2:Matrix = new Matrix(); + public var scaleMatrix:Matrix = new Matrix(); + public var bigbuffer:BitmapData; + public var bigbufferscreen:Bitmap; + //Mobile stuff public var screensizemultiplier:Number; public var screenoffx:int, screenoffy:int; - public var buttonsready:Boolean = false; - public var button_texture:Vector. = new Vector.; - public var button_image:Vector. = new Vector.; - public var button_image_width:Vector. = new Vector.; - public var button_image_height:Vector. = new Vector.; + public var buttonimg:Vector. = new Vector.; + public var buttonscreen:Vector. = new Vector.; public var buttonactive:Vector. = new Vector.; public var buttonhighlight:Vector. = new Vector.; @@ -3119,11 +2870,5 @@ package{ public var b_gap:int = 40, b_size:int = 26; public var devicex:int, devicey:int; - - [Embed(source = "../data/bitmapsprites.png")] - public static const img_bitmapsprites:Class; - - [Embed(source = "../data/bitmapflipsprites.png")] - public static const img_bitmapflipsprites:Class; } } \ No newline at end of file diff --git a/mobile_version/src/edentitiesclass.as b/mobile_version/src/edentitiesclass.as index 78d4ddd0..493eaf33 100644 --- a/mobile_version/src/edentitiesclass.as +++ b/mobile_version/src/edentitiesclass.as @@ -1,4 +1,9 @@ package { + import flash.display.*; + import flash.geom.*; + import flash.events.*; + import flash.net.*; + public class edentitiesclass { public function edentitiesclass():void { clear(); diff --git a/mobile_version/src/editor.as b/mobile_version/src/editor.as index 8edb57ea..6dbe5828 100644 --- a/mobile_version/src/editor.as +++ b/mobile_version/src/editor.as @@ -1,9 +1,9 @@ package { + import flash.display.*; + import flash.display3D.textures.RectangleTexture; import flash.geom.*; import flash.events.*; import flash.net.*; - import starling.display.Image; - import starling.textures.RenderTexture; public class editor { public static function init():void { @@ -1249,17 +1249,17 @@ package { } public static function fillbox(dwgfx:dwgraphicsclass, x:int, y:int, x2:int, y2:int, c:int):void { - dwgfx.drawfillrect(x, y, x2 - x, 1, c); - dwgfx.drawfillrect(x, y2 - 1, x2 - x, 1, c); - dwgfx.drawfillrect(x, y, 1, y2 - y, c); - dwgfx.drawfillrect(x2 - 1, y, 1, y2 - y, c); + dwgfx.backbuffer.fillRect(new Rectangle(x, y, x2 - x, 1), c); + dwgfx.backbuffer.fillRect(new Rectangle(x, y2 - 1, x2 - x, 1), c); + dwgfx.backbuffer.fillRect(new Rectangle(x, y, 1, y2 - y), c); + dwgfx.backbuffer.fillRect(new Rectangle(x2 - 1, y, 1, y2 - y), c); } public static function fillboxabs(dwgfx:dwgraphicsclass, x:int, y:int, x2:int, y2:int, c:int):void { - dwgfx.drawfillrect(x, y, x2, 1, c); - dwgfx.drawfillrect(x, y + y2 - 1, x2, 1, c); - dwgfx.drawfillrect(x, y, 1, y2, c); - dwgfx.drawfillrect(x + x2 - 1, y, 1, y2, c); + dwgfx.backbuffer.fillRect(new Rectangle(x, y, x2, 1), c); + dwgfx.backbuffer.fillRect(new Rectangle(x, y + y2 - 1, x2, 1), c); + dwgfx.backbuffer.fillRect(new Rectangle(x, y, 1, y2), c); + dwgfx.backbuffer.fillRect(new Rectangle(x + x2 - 1, y, 1, y2), c); } public static function generatecustomminimap(dwgfx:dwgraphicsclass, map:mapclass):void { @@ -1291,74 +1291,68 @@ package { map.custommmysize = 180 - (map.custommmyoff * 2); } - if (dwgfx.customminimap == null) { - dwgfx.customminimap = new RenderTexture(240, 180); - dwgfx.images[12] = new Image(dwgfx.customminimap); - } - dwgfx.customminimap.clear(dwgfx.RGB(0, 0, 0), 1.0); + dwgfx.images[12].fillRect(dwgfx.images[12].rect, dwgfx.RGBA(0, 0, 0)); - dwgfx.customminimap.drawBundled(function():void { - var tm:int = 0; - var temp:int = 0; - //Scan over the map size - if(mapheight<=5 && mapwidth<=5){ - //4x map - for (var j2:int = 0; j2 < mapheight; j2++){ - for (var i2:int = 0; i2 < mapwidth; i2++) { - //Ok, now scan over each square - tm = 196; - if (level[i2 + (j2 * maxwidth)].tileset == 1) tm = 96; - - for (var j:int = 0; j < 36; j++) { - for (var i:int = 0; i < 48; i++) { - temp = absfree(int(i * 0.83) + (i2 * 40), int(j * 0.83) + (j2 * 30)); - if(temp>=1){ - //Fill in this pixel - dwgfx.drawfillrect_onimage(dwgfx.customminimap, (i2 * 48) + i, (j2 * 36) + j, 1, 1, tm, tm, tm); - } - } - } - } - } - }else if (mapheight <= 10 && mapwidth <= 10) { - //2x map - for (j2 = 0; j2 < mapheight; j2++) { - for (i2 = 0; i2 < mapwidth; i2++) { - //Ok, now scan over each square - tm = 196; - if (level[i2 + (j2 * maxwidth)].tileset == 1) tm = 96; - - for (j = 0; j < 18; j++) { - for (i = 0; i < 24; i++) { - temp = absfree(int(i * 1.6) + (i2 * 40), int(j * 1.6) + (j2 * 30)); - if (temp >= 1) { - //Fill in this pixel - dwgfx.drawfillrect_onimage(dwgfx.customminimap, (i2 * 24) + i, (j2 * 18) + j, 1, 1, tm, tm, tm); - } - } - } - } - } - }else { - for (j2 = 0; j2 < mapheight; j2++) { - for (i2 = 0; i2 < mapwidth; i2++) { - //Ok, now scan over each square - tm=196; - if (level[i2 + (j2 * maxwidth)].tileset == 1) tm = 96; - - for (j = 0; j < 9; j++) { - for (i = 0; i < 12; i++) { - temp = absfree(3 + (i * 3) + (i2 * 40), (j * 3) + (j2 * 30)); - if(temp>=1){ - //Fill in this pixel - dwgfx.drawfillrect_onimage(dwgfx.customminimap, (i2 * 12) + i, (j2 * 9) + j, 1, 1, tm, tm, tm); - } + var tm:int = 0; + var temp:int = 0; + //Scan over the map size + if(mapheight<=5 && mapwidth<=5){ + //4x map + for (var j2:int = 0; j2 < mapheight; j2++){ + for (var i2:int = 0; i2 < mapwidth; i2++) { + //Ok, now scan over each square + tm = 196; + if (level[i2 + (j2 * maxwidth)].tileset == 1) tm = 96; + + for (var j:int = 0; j < 36; j++) { + for (var i:int = 0; i < 48; i++) { + temp = absfree(int(i * 0.83) + (i2 * 40), int(j * 0.83) + (j2 * 30)); + if(temp>=1){ + //Fill in this pixel + dwgfx.images[12].fillRect(new Rectangle((i2 * 48) + i, (j2 * 36) + j, 1, 1), dwgfx.RGBA(tm, tm, tm)); } } } } } - }); + }else if (mapheight <= 10 && mapwidth <= 10) { + //2x map + for (j2 = 0; j2 < mapheight; j2++) { + for (i2 = 0; i2 < mapwidth; i2++) { + //Ok, now scan over each square + tm = 196; + if (level[i2 + (j2 * maxwidth)].tileset == 1) tm = 96; + + for (j = 0; j < 18; j++) { + for (i = 0; i < 24; i++) { + temp = absfree(int(i * 1.6) + (i2 * 40), int(j * 1.6) + (j2 * 30)); + if (temp >= 1) { + //Fill in this pixel + dwgfx.images[12].fillRect(new Rectangle((i2 * 24) + i, (j2 * 18) + j, 1, 1), dwgfx.RGBA(tm, tm, tm)); + } + } + } + } + } + }else { + for (j2 = 0; j2 < mapheight; j2++) { + for (i2 = 0; i2 < mapwidth; i2++) { + //Ok, now scan over each square + tm=196; + if (level[i2 + (j2 * maxwidth)].tileset == 1) tm = 96; + + for (j = 0; j < 9; j++) { + for (i = 0; i < 12; i++) { + temp = absfree(3 + (i * 3) + (i2 * 40), (j * 3) + (j2 * 30)); + if(temp>=1){ + //Fill in this pixel + dwgfx.images[12].fillRect(new Rectangle((i2 * 12) + i, (j2 * 9) + j, 1, 1), dwgfx.RGBA(tm, tm, tm)); + } + } + } + } + } + } } public static function editorrender(dwgfx:dwgraphicsclass, game:gameclass, map:mapclass, obj:entityclass, help:helpclass):void { diff --git a/mobile_version/src/edlevelclass.as b/mobile_version/src/edlevelclass.as index 56f96300..19f18a8f 100644 --- a/mobile_version/src/edlevelclass.as +++ b/mobile_version/src/edlevelclass.as @@ -1,4 +1,9 @@ package { + import flash.display.*; + import flash.geom.*; + import flash.events.*; + import flash.net.*; + public class edlevelclass{ public function edlevelclass():void { clear(); diff --git a/mobile_version/src/entclass.as b/mobile_version/src/entclass.as index d8e65ddf..c95c3e6e 100644 --- a/mobile_version/src/entclass.as +++ b/mobile_version/src/entclass.as @@ -1,7 +1,10 @@ -package { +package { + import flash.display.*; import flash.geom.*; + import flash.events.*; + import flash.net.*; - public class entclass{ + public class entclass extends Sprite { public function entclass():void { clear(); } diff --git a/mobile_version/src/entityclass.as b/mobile_version/src/entityclass.as index 813f7154..d1deaed8 100644 --- a/mobile_version/src/entityclass.as +++ b/mobile_version/src/entityclass.as @@ -1,8 +1,11 @@ -package { +package { import bigroom.input.KeyPoll; + import flash.display.*; import flash.geom.*; - - public class entityclass { + import flash.events.*; + import flash.net.*; + + public class entityclass extends Sprite { static public var BLOCK:Number = 0; static public var TRIGGER:Number = 1; static public var DAMAGE:Number = 2; @@ -584,8 +587,8 @@ package { break; case TRIGGER: //Trigger blocks[k].type = TRIGGER; - blocks[k].xp = xp; - blocks[k].yp = yp; + blocks[k].x = xp; + blocks[k].y = yp; blocks[k].wp = w; blocks[k].hp = h; blocks[k].rectset(xp, yp, w, h); @@ -595,8 +598,8 @@ package { break; case DAMAGE: //Damage blocks[k].type = DAMAGE; - blocks[k].xp = xp; - blocks[k].yp = yp; + blocks[k].x = xp; + blocks[k].y = yp; blocks[k].wp = w; blocks[k].hp = h; blocks[k].rectset(xp, yp, w, h); @@ -605,8 +608,8 @@ package { break; case DIRECTIONAL: //Directional blocks[k].type = DIRECTIONAL; - blocks[k].xp = xp; - blocks[k].yp = yp; + blocks[k].x = xp; + blocks[k].y = yp; blocks[k].wp = w; blocks[k].hp = h; blocks[k].rectset(xp, yp, w, h); @@ -626,8 +629,8 @@ package { break; case ACTIVITY: //Activity Zone blocks[k].type = ACTIVITY; - blocks[k].xp = xp; - blocks[k].yp = yp; + blocks[k].x = xp; + blocks[k].y = yp; blocks[k].wp = w; blocks[k].hp = h; blocks[k].rectset(xp, yp, w, h); @@ -813,19 +816,19 @@ package { trig=0; break; case 25: - blocks[k].prompt = "Passion for exploring"; + blocks[k].prompt = "Passion for Exploring"; blocks[k].script = "terminal_juke1"; setblockcolour(k, "orange"); trig=0; break; case 26: - blocks[k].prompt = "Pushing onwards"; + blocks[k].prompt = "Pushing Onwards"; blocks[k].script = "terminal_juke2"; setblockcolour(k, "orange"); trig=0; break; case 27: - blocks[k].prompt = "Positive force"; + blocks[k].prompt = "Positive Force"; blocks[k].script = "terminal_juke3"; setblockcolour(k, "orange"); trig=0; @@ -837,13 +840,13 @@ package { trig=0; break; case 29: - blocks[k].prompt = "Potential for anything"; + blocks[k].prompt = "Potential for Anything"; blocks[k].script = "terminal_juke5"; setblockcolour(k, "orange"); trig=0; break; case 30: - blocks[k].prompt = "Predestined fate"; + blocks[k].prompt = "Predestined Fate"; blocks[k].script = "terminal_juke6"; setblockcolour(k, "orange"); trig=0; @@ -867,7 +870,7 @@ package { trig=0; break; case 34: - blocks[k].prompt = "ecrof evitisoP"; + blocks[k].prompt = "ecroF evitisoP"; blocks[k].script = "terminal_juke10"; setblockcolour(k, "orange"); trig=0; @@ -1273,7 +1276,7 @@ package { entities[k].gravity = true; break; - case 1: + case 1: //Simple enemy, bouncing off the walls entities[k].rule = 1; entities[k].xp = xp; entities[k].yp = yp; entities[k].behave = vx; entities[k].para = vy; @@ -3787,14 +3790,14 @@ package { colpoint1.x = entities[i].xp; colpoint1.y = entities[i].yp; colpoint2.x = entities[j].xp; colpoint2.y = entities[j].yp; if (dwgfx.flipmode) { - if (dwgfx.flipsprites_bitmap[entities[i].drawframe].hitTest( - colpoint1, 1, dwgfx.flipsprites_bitmap[entities[j].drawframe], colpoint2, 1)) { + if (dwgfx.flipsprites[entities[i].drawframe].hitTest( + colpoint1, 1, dwgfx.flipsprites[entities[j].drawframe], colpoint2, 1)) { //Do the collision stuff game.deathseq = 30; } - }else { - if (dwgfx.sprites_bitmap[entities[i].drawframe].hitTest( - colpoint1, 1, dwgfx.sprites_bitmap[entities[j].drawframe], colpoint2, 1)) { + }else{ + if (dwgfx.sprites[entities[i].drawframe].hitTest( + colpoint1, 1, dwgfx.sprites[entities[j].drawframe], colpoint2, 1)) { //Do the collision stuff game.deathseq = 30; } @@ -3848,9 +3851,9 @@ package { if (entities[j].onentity > 0) { //ok; only check the actual collision if they're in a close proximity temp = entities[i].yp - entities[j].yp; - if (temp < 30 || temp > -30) { + if (temp > -30 && temp < 30) { temp = entities[i].xp - entities[j].xp; - if (temp < 30 || temp > -30) { + if (temp > -30 && temp < 30) { if (entitycollide(i, j)) entities[j].state = entities[j].onentity; } } @@ -3887,14 +3890,14 @@ package { colpoint1.x = entities[i].xp; colpoint1.y = entities[i].yp; colpoint2.x = entities[j].xp; colpoint2.y = entities[j].yp; if (dwgfx.flipmode) { - if (dwgfx.flipsprites_bitmap[entities[i].drawframe].hitTest( - colpoint1, 1, dwgfx.flipsprites_bitmap[entities[j].drawframe], colpoint2, 1)) { + if (dwgfx.flipsprites[entities[i].drawframe].hitTest( + colpoint1, 1, dwgfx.flipsprites[entities[j].drawframe], colpoint2, 1)) { //Do the collision stuff game.deathseq = 30; game.scmhurt = true; } - }else { - if (dwgfx.sprites_bitmap[entities[i].drawframe].hitTest( - colpoint1, 1, dwgfx.sprites_bitmap[entities[j].drawframe], colpoint2, 1)) { + }else{ + if (dwgfx.sprites[entities[i].drawframe].hitTest( + colpoint1, 1, dwgfx.sprites[entities[j].drawframe], colpoint2, 1)) { //Do the collision stuff game.deathseq = 30; game.scmhurt = true; } @@ -4016,4 +4019,4 @@ package { public var mobilemenus:Boolean = true; } -} \ No newline at end of file +} diff --git a/mobile_version/src/gameclass.as b/mobile_version/src/gameclass.as index e2e69729..2f487b8f 100644 --- a/mobile_version/src/gameclass.as +++ b/mobile_version/src/gameclass.as @@ -325,7 +325,7 @@ //These coordinates now need to be translated to actual screen coordinates //Gamecenter if(menustart && !showloadingnotice) { - if (inbox(m_touchx, m_touchy, 0, 0, dwgfx.button_image_width[0] + (dwgfx.buttonxspacing * 2), dwgfx.button_image_height[0] + (dwgfx.buttonyspacing * 2))) { + if (inbox(m_touchx, m_touchy, 0, 0, dwgfx.buttonscreen[0].width + (dwgfx.buttonxspacing * 2), dwgfx.buttonscreen[0].height + (dwgfx.buttonyspacing * 2))) { //Bring up game center achievements scores.showAchievements(); } @@ -465,11 +465,11 @@ m_touchy = key.touchy[key.touchPoints - 1]; if (dwgfx.flipmode) m_touchy = dwgfx.devicey - m_touchy; - if (inbox(m_touchx, m_touchy, dwgfx.devicex - dwgfx.button_image_width[0] - dwgfx.buttonxspacing, 0, dwgfx.button_image_width[0] + (dwgfx.buttonxspacing*2), dwgfx.button_image_height[0] + (dwgfx.buttonyspacing*2) )) { + if (inbox(m_touchx, m_touchy, dwgfx.devicex - dwgfx.buttonscreen[0].width - dwgfx.buttonxspacing, 0, dwgfx.buttonscreen[0].width + (dwgfx.buttonxspacing*2), dwgfx.buttonscreen[0].height + (dwgfx.buttonyspacing*2) )) { press_map = true; } if(menupage == 0){ - if (inbox(m_touchx, m_touchy, 0, 0, dwgfx.button_image_width[1] + (dwgfx.buttonxspacing*2), dwgfx.button_image_height[1] + (dwgfx.buttonyspacing*2) )) { + if (inbox(m_touchx, m_touchy, 0, 0, dwgfx.buttonscreen[1].width + (dwgfx.buttonxspacing*2), dwgfx.buttonscreen[1].height + (dwgfx.buttonyspacing*2) )) { menupage = 30; music.playef(11, 10); } @@ -646,12 +646,12 @@ }else */ if (insecretlab) { - if (inbox(key.touchx[i], key.touchy[i], 0, 0, dwgfx.button_image_width[0] + (dwgfx.buttonxspacing * 2), dwgfx.button_image_height[0] + (dwgfx.buttonyspacing * 2) )) { + if (inbox(key.touchx[i], key.touchy[i], 0, 0, dwgfx.buttonscreen[0].width + (dwgfx.buttonxspacing * 2), dwgfx.buttonscreen[0].height + (dwgfx.buttonyspacing * 2) )) { scores.opengamecenter(); press_map = true; } } - if (inbox(key.touchx[i], key.touchy[i], dwgfx.devicex - dwgfx.button_image_width[0] - dwgfx.buttonxspacing, 0, dwgfx.button_image_width[0] + (dwgfx.buttonxspacing*2), dwgfx.button_image_height[0] + (dwgfx.buttonyspacing*2) )) { + if (inbox(key.touchx[i], key.touchy[i], dwgfx.devicex - dwgfx.buttonscreen[0].width - dwgfx.buttonxspacing, 0, dwgfx.buttonscreen[0].width + (dwgfx.buttonxspacing*2), dwgfx.buttonscreen[0].height + (dwgfx.buttonyspacing*2) )) { press_map = true; }else { if (key.touchid[i] != key.controlstick) { @@ -670,12 +670,12 @@ // press_action = true; //}else if (insecretlab) { - if (inbox(key.touchx[i], key.touchy[i], 0, 0, dwgfx.button_image_width[0] + (dwgfx.buttonxspacing * 2), dwgfx.button_image_height[0] + (dwgfx.buttonyspacing * 2) )) { + if (inbox(key.touchx[i], key.touchy[i], 0, 0, dwgfx.buttonscreen[0].width + (dwgfx.buttonxspacing * 2), dwgfx.buttonscreen[0].height + (dwgfx.buttonyspacing * 2) )) { scores.opengamecenter(); press_map = true; } } - if (inbox(key.touchx[i], key.touchy[i], dwgfx.devicex - dwgfx.button_image_width[0] - dwgfx.buttonxspacing, 0, dwgfx.button_image_width[0] + (dwgfx.buttonxspacing*2), dwgfx.button_image_height[0] + (dwgfx.buttonyspacing*2) )) { + if (inbox(key.touchx[i], key.touchy[i], dwgfx.devicex - dwgfx.buttonscreen[0].width - dwgfx.buttonxspacing, 0, dwgfx.buttonscreen[0].width + (dwgfx.buttonxspacing*2), dwgfx.buttonscreen[0].height + (dwgfx.buttonyspacing*2) )) { press_map = true; }else{ if (inbox(key.touchx[i], key.touchy[i], 0, 0, dwgfx.devicex / 2, dwgfx.devicey)) { @@ -729,12 +729,12 @@ //D-Pad controls for (i = 0; i < key.touchPoints; i++) { if (insecretlab) { - if (inbox(key.touchx[i], key.touchy[i], 0, 0, dwgfx.button_image_width[0] + (dwgfx.buttonxspacing * 2), dwgfx.button_image_height[0] + (dwgfx.buttonyspacing * 2) )) { + if (inbox(key.touchx[i], key.touchy[i], 0, 0, dwgfx.buttonscreen[0].width + (dwgfx.buttonxspacing * 2), dwgfx.buttonscreen[0].height + (dwgfx.buttonyspacing * 2) )) { scores.opengamecenter(); press_map = true; } } - if (inbox(key.touchx[i], key.touchy[i], dwgfx.devicex - dwgfx.button_image_width[0] - dwgfx.buttonxspacing, 0, dwgfx.button_image_width[0] + (dwgfx.buttonxspacing*2), dwgfx.button_image_height[0] + (dwgfx.buttonyspacing*2) )) { + if (inbox(key.touchx[i], key.touchy[i], dwgfx.devicex - dwgfx.buttonscreen[0].width - dwgfx.buttonxspacing, 0, dwgfx.buttonscreen[0].width + (dwgfx.buttonxspacing*2), dwgfx.buttonscreen[0].height + (dwgfx.buttonyspacing*2) )) { press_map = true; }else if (inbox(key.touchx[i], key.touchy[i], 0, dwgfx.buttonpos[2].y - (dwgfx.devicey*2/3), dwgfx.buttonsize + dwgfx.buttonxspacing+ (dwgfx.buttonxspacing/2), dwgfx.devicey)) { press_left = true; diff --git a/mobile_version/src/helpclass.as b/mobile_version/src/helpclass.as index 5c2c723b..59f0b59b 100644 --- a/mobile_version/src/helpclass.as +++ b/mobile_version/src/helpclass.as @@ -1,11 +1,11 @@ -package { +package { import flash.display.*; import flash.geom.*; import flash.events.*; import flash.net.*; import flash.system.System; - public class helpclass{ + public class helpclass extends Sprite { public function init():void { sine = new Array(); cosine = new Array(); diff --git a/mobile_version/src/includes/input.as b/mobile_version/src/includes/input.as index 91f170e2..5c792a83 100644 --- a/mobile_version/src/includes/input.as +++ b/mobile_version/src/includes/input.as @@ -239,8 +239,8 @@ public function titleinput(key:KeyPoll, dwgfx:dwgraphicsclass, map:mapclass, gam }else if (game.currentmenuoption == 4) { //More games (external link) music.playef(11, 10); - //var distractionware_link:URLRequest = new URLRequest( "http://distractionware.com/games/ios/" ); - var distractionware_link:URLRequest = new URLRequest( "http://distractionware.com/games/android/" ); + var distractionware_link:URLRequest = new URLRequest( "http://distractionware.com/games/ios/" ); + //var distractionware_link:URLRequest = new URLRequest( "http://distractionware.com/games/android/" ); navigateToURL( distractionware_link, "_blank" ); } }else{ @@ -649,7 +649,7 @@ public function titleinput(key:KeyPoll, dwgfx:dwgraphicsclass, map:mapclass, gam } }else if (game.currentmenuname == "unlockmenu") { if (game.currentmenuoption == 0) { - //unlock time trials seperately... + //unlock time trials separately... music.playef(11, 10); game.createmenu("unlockmenutrials"); map.nexttowercolour(); @@ -1337,7 +1337,7 @@ public function gameinput(key:KeyPoll, dwgfx:dwgraphicsclass, game:gameclass, ma game.gamestate = 5; dwgfx.menuoffset = 240; //actually this should count the roomname if (map.extrarow) dwgfx.menuoffset -= 10; - dwgfx.setup_menubuffer(); + dwgfx.menubuffer.copyPixels(dwgfx.screenbuffer, dwgfx.screenbuffer.rect, dwgfx.tl, null, null, false); dwgfx.resumegamemode = false; game.useteleporter = true; @@ -1371,7 +1371,7 @@ public function gameinput(key:KeyPoll, dwgfx:dwgraphicsclass, game:gameclass, ma game.gamestate = MAPMODE; game.gamesaved = false; dwgfx.resumegamemode = false; game.menupage = 20; // The Map Page - dwgfx.setup_menubuffer(); + dwgfx.menubuffer.copyPixels(dwgfx.screenbuffer, dwgfx.screenbuffer.rect, dwgfx.tl, null, null, false); dwgfx.menuoffset = 240; //actually this should count the roomname if (map.extrarow) dwgfx.menuoffset -= 10; }else if (game.intimetrial && dwgfx.fademode == 0) { @@ -1382,7 +1382,7 @@ public function gameinput(key:KeyPoll, dwgfx:dwgraphicsclass, game:gameclass, ma game.gamestate = MAPMODE; game.gamesaved = false; dwgfx.resumegamemode = false; game.menupage = 10; // The Map Page - dwgfx.setup_menubuffer(); + dwgfx.menubuffer.copyPixels(dwgfx.screenbuffer, dwgfx.screenbuffer.rect, dwgfx.tl, null, null, false); dwgfx.menuoffset = 240; //actually this should count the roomname if (map.extrarow) dwgfx.menuoffset -= 10; }else{ @@ -1399,7 +1399,7 @@ public function gameinput(key:KeyPoll, dwgfx:dwgraphicsclass, game:gameclass, ma map.cursordelay = 0; map.cursorstate = 0; game.gamesaved = false; dwgfx.resumegamemode = false; game.menupage = 0; // The Map Page - dwgfx.setup_menubuffer(); + dwgfx.menubuffer.copyPixels(dwgfx.screenbuffer, dwgfx.screenbuffer.rect, dwgfx.tl, null, null, false); dwgfx.menuoffset = 240; //actually this should count the roomname if (map.extrarow) dwgfx.menuoffset -= 10; } @@ -1411,7 +1411,7 @@ public function gameinput(key:KeyPoll, dwgfx:dwgraphicsclass, game:gameclass, ma game.gamestate = MAPMODE; game.gamesaved = false; dwgfx.resumegamemode = false; game.menupage = 10; // The Map Page - dwgfx.setup_menubuffer(); + dwgfx.menubuffer.copyPixels(dwgfx.screenbuffer, dwgfx.screenbuffer.rect, dwgfx.tl, null, null, false); dwgfx.menuoffset = 240; //actually this should count the roomname if (map.extrarow) dwgfx.menuoffset -= 10; } @@ -1553,7 +1553,7 @@ public function mapinput(key:KeyPoll, dwgfx:dwgraphicsclass, game:gameclass, map } if (dwgfx.fademode == 1) { - dwgfx.clear_menubuffer(); + dwgfx.menubuffer.fillRect(dwgfx.menubuffer.rect, 0x000000); dwgfx.resumegamemode = true; obj.removeallblocks(); game.menukludge = false; diff --git a/mobile_version/src/includes/logic.as b/mobile_version/src/includes/logic.as index 46fd3af2..4993a378 100644 --- a/mobile_version/src/includes/logic.as +++ b/mobile_version/src/includes/logic.as @@ -465,7 +465,7 @@ public function gamelogic(key:KeyPoll, dwgfx:dwgraphicsclass, game:gameclass, ma if (obj.entities[i].type == 2 && obj.entities[i].state == 3) { //Ok! super magical exception for the room with the intention death for the shiny trinket //fix this when the maps are finalised - if (game.roomx != 111 && game.roomy != 107) { + if (game.roomx != 111 || game.roomy != 107 || map.custommode) { obj.entities[i].state = 4; }else { obj.entities[i].state = 4; diff --git a/mobile_version/src/includes/render.as b/mobile_version/src/includes/render.as index 6d4d653f..72dd7872 100644 --- a/mobile_version/src/includes/render.as +++ b/mobile_version/src/includes/render.as @@ -1,12 +1,11 @@ import flash.geom.Point; -import starling.textures.Texture; public function titlerender(key:KeyPoll, dwgfx:dwgraphicsclass, map:mapclass, game:gameclass, obj:entityclass, help:helpclass):void { dwgfx.drawbutton(game, help); - //dwgfx.backbuffer.lock(); + dwgfx.backbuffer.lock(); + dwgfx.backbuffer.fillRect(dwgfx.backbuffer.rect, 0x000000); if (!game.menustart) { - dwgfx.cls(0x000000); tr = 164 - (help.glow / 2) - Math.random() * 4; tg = 164 - (help.glow / 2) - Math.random() * 4; tb = 164 - (help.glow / 2) - Math.random() * 4; @@ -27,10 +26,9 @@ public function titlerender(key:KeyPoll, dwgfx:dwgraphicsclass, map:mapclass, ga /*dwgfx.print(5, 5, "IGF WIP Build, 29th Oct '09", tr, tg, tb, true); dwgfx.print(5, 200, "Game by Terry Cavanagh", tr, tg, tb, true); - dwgfx.print(5, 210, "Music by Magnus Palsson", tr, tg, tb, true); + dwgfx.print(5, 210, "Music by Magnus P~lsson", tr, tg, tb, true); dwgfx.print(5, 220, "Roomnames by Bennett Foddy", tr, tg, tb, true);*/ }else { - dwgfx.cls(dwgfx.tower_bgdarkcol[map.colstate]); if(!game.colourblindmode) dwgfx.drawtowerbackgroundsolo(map); tr = map.r - (help.glow / 4) - Math.random() * 4; @@ -41,7 +39,8 @@ public function titlerender(key:KeyPoll, dwgfx:dwgraphicsclass, map:mapclass, ga if (tb < 0) tb = 0; if(tb>255) tb=255; temp = 30+20; - if (game.currentmenuname == "mainmenu") { + + if(game.currentmenuname=="mainmenu"){ dwgfx.drawsprite((160 - 96) + 0 * 32, temp, 23, tr, tg, tb); dwgfx.drawsprite((160 - 96) + 1 * 32, temp, 23, tr, tg, tb); dwgfx.drawsprite((160 - 96) + 2 * 32, temp, 23, tr, tg, tb); @@ -117,7 +116,7 @@ public function titlerender(key:KeyPoll, dwgfx:dwgraphicsclass, map:mapclass, ga //dwgfx.print( 40, 85, "http://www.distractionware.com", tr, tg, tb, true); dwgfx.print( -1, 120, "and features music by", tr, tg, tb, true); - dwgfx.bigprint( 40, 135, "Magnus Palsson", tr, tg, tb, true, 2); + dwgfx.bigprint( 40, 135, "Magnus P~lsson", tr, tg, tb, true, 2); dwgfx.drawimagecol(8, -1, 156, tr *0.75, tg *0.75, tb *0.75, true); //dwgfx.print( 40, 155, "http://souleye.madtracker.net", tr, tg, tb, true); }else if (game.currentmenuname == "credits2") { @@ -200,7 +199,7 @@ public function titlerender(key:KeyPoll, dwgfx:dwgraphicsclass, map:mapclass, ga dwgfx.print( 80, 80,"Joshua Buergel", tr, tg, tb); dwgfx.print( 80, 90,"Joshua Hochner", tr, tg, tb); dwgfx.print( 80, 100,"Kurt Ostfeld", tr, tg, tb); - dwgfx.print( 80, 110,"Magnus Palsson", tr, tg, tb); + dwgfx.print( 80, 110,"Magnus P~lsson", tr, tg, tb); dwgfx.print( 80, 120,"Mark Neschadimenko", tr, tg, tb); dwgfx.print( 80, 130,"Matt Antonellis", tr, tg, tb); dwgfx.print( 80, 140,"Matthew Reppert", tr, tg, tb); @@ -484,7 +483,7 @@ public function titlerender(key:KeyPoll, dwgfx:dwgraphicsclass, map:mapclass, ga /* dwgfx.bigprint( -1, 30, "Unlock Time Trials", tr, tg, tb, true); dwgfx.print( -1, 65, "You can unlock each time", tr, tg, tb, true); - dwgfx.print( -1, 75, "trial seperately.", tr, tg, tb, true); + dwgfx.print( -1, 75, "trial separately.", tr, tg, tb, true); */ }else if (game.currentmenuname == "timetrials") { /* @@ -689,27 +688,27 @@ public function titlerender(key:KeyPoll, dwgfx:dwgraphicsclass, map:mapclass, ga }else if (game.currentmenuname == "unlocktimetrial") { dwgfx.bigprint( -1, 45, "Congratulations!", tr, tg, tb, true, 2); - dwgfx.print( -1, 125, "Your have unlocked", tr, tg, tb, true); + dwgfx.print( -1, 125, "You have unlocked", tr, tg, tb, true); dwgfx.print( -1, 135, "a new Time Trial.", tr, tg, tb, true); }else if (game.currentmenuname == "unlocktimetrials") { dwgfx.bigprint( -1, 45, "Congratulations!", tr, tg, tb, true, 2); - dwgfx.print( -1, 125, "Your have unlocked some", tr, tg, tb, true); + dwgfx.print( -1, 125, "You have unlocked some", tr, tg, tb, true); dwgfx.print( -1, 135, "new Time Trials.", tr, tg, tb, true); }else if (game.currentmenuname == "unlocknodeathmode") { dwgfx.bigprint( -1, 45, "Congratulations!", tr, tg, tb, true, 2); - dwgfx.print( -1, 125, "Your have unlocked", tr, tg, tb, true); + dwgfx.print( -1, 125, "You have unlocked", tr, tg, tb, true); dwgfx.print( -1, 135, "No Death Mode.", tr, tg, tb, true); }else if (game.currentmenuname == "unlockflipmode") { dwgfx.bigprint( -1, 45, "Congratulations!", tr, tg, tb, true, 2); - dwgfx.print( -1, 125, "Your have unlocked", tr, tg, tb, true); + dwgfx.print( -1, 125, "You have unlocked", tr, tg, tb, true); dwgfx.print( -1, 135, "Flip Mode.", tr, tg, tb, true); }else if (game.currentmenuname == "unlockintermission") { dwgfx.bigprint( -1, 45, "Congratulations!", tr, tg, tb, true, 2); - dwgfx.print( -1, 125, "Your have unlocked", tr, tg, tb, true); + dwgfx.print( -1, 125, "You have unlocked", tr, tg, tb, true); dwgfx.print( -1, 135, "the intermission levels.", tr, tg, tb, true); } @@ -785,14 +784,14 @@ public function titlerender(key:KeyPoll, dwgfx:dwgraphicsclass, map:mapclass, ga }else{ dwgfx.render(); } - //dwgfx.backbuffer.unlock(); + dwgfx.backbuffer.unlock(); } -public function gamecompleterender(key:KeyPoll, dwgfx:dwgraphicsclass, game:gameclass, map:mapclass, obj:entityclass, help:helpclass):void { +public function gamecompleterender(key:KeyPoll, dwgfx:dwgraphicsclass, game:gameclass, obj:entityclass, help:helpclass):void { dwgfx.drawbutton(game, help); - //dwgfx.backbuffer.lock(); - dwgfx.cls(dwgfx.tower_bgdarkcol[map.colstate]); + dwgfx.backbuffer.lock(); + dwgfx.backbuffer.fillRect(dwgfx.backbuffer.rect, 0x000000); if(!game.colourblindmode) dwgfx.drawtowerbackgroundsolo(map); //dwgfx.drawtowermap(map); @@ -857,7 +856,7 @@ public function gamecompleterender(key:KeyPoll, dwgfx:dwgraphicsclass, game:game if (dwgfx.onscreen(640 + game.creditposition)) { dwgfx.print(40, 640 + game.creditposition, "With Music by", tr, tg, tb); - dwgfx.bigprint(60, 650 + game.creditposition, "Magnus Palsson", tr, tg, tb); + dwgfx.bigprint(60, 650 + game.creditposition, "Magnus P~lsson", tr, tg, tb); } if (dwgfx.onscreen(680 + game.creditposition)) { @@ -935,7 +934,7 @@ if (dwgfx.onscreen(1410 + game.creditposition)) dwgfx.print(-1, 1420 + game.cred if (dwgfx.onscreen(1420 + game.creditposition)) dwgfx.print(-1, 1430 + game.creditposition,"Joshua Buergel", tr, tg, tb, true); if (dwgfx.onscreen(1430 + game.creditposition)) dwgfx.print(-1, 1440 + game.creditposition,"Joshua Hochner", tr, tg, tb, true); if (dwgfx.onscreen(1440 + game.creditposition)) dwgfx.print(-1, 1450 + game.creditposition,"Kurt Ostfeld", tr, tg, tb, true); -if (dwgfx.onscreen(1450 + game.creditposition)) dwgfx.print(-1, 1460 + game.creditposition, "Magnus Palsson", tr, tg, tb, true); +if (dwgfx.onscreen(1450 + game.creditposition)) dwgfx.print(-1, 1460 + game.creditposition, "Magnus P~lsson", tr, tg, tb, true); if (dwgfx.onscreen(1460 + game.creditposition)) dwgfx.print(-1, 1470 + game.creditposition,"Mark Neschadimenko", tr, tg, tb, true); if (dwgfx.onscreen(1470 + game.creditposition)) dwgfx.print(-1, 1480 + game.creditposition,"Matt Antonellis", tr, tg, tb, true); if (dwgfx.onscreen(1480 + game.creditposition)) dwgfx.print(-1, 1490 + game.creditposition,"Matthew Reppert", tr, tg, tb, true); @@ -972,14 +971,14 @@ if (dwgfx.onscreen(1760 + game.creditposition)) dwgfx.bigprint( -1, 1760 + game. }else{ dwgfx.render(); } - //dwgfx.backbuffer.unlock(); + dwgfx.backbuffer.unlock(); } public function gamecompleterender2(key:KeyPoll, dwgfx:dwgraphicsclass, game:gameclass, obj:entityclass, help:helpclass):void { dwgfx.drawbutton(game, help); - //dwgfx.backbuffer.lock(); - dwgfx.cls(0x000000); + dwgfx.backbuffer.lock(); + dwgfx.backbuffer.fillRect(dwgfx.backbuffer.rect, 0x000000); dwgfx.drawimage(10, 0, 0); @@ -1014,7 +1013,7 @@ public function gamecompleterender2(key:KeyPoll, dwgfx:dwgraphicsclass, game:gam }else{ dwgfx.render(); } - //dwgfx.backbuffer.unlock(); + dwgfx.backbuffer.unlock(); } public function gamerender(key:KeyPoll, dwgfx:dwgraphicsclass, game:gameclass, map:mapclass, @@ -1022,7 +1021,7 @@ public function gamerender(key:KeyPoll, dwgfx:dwgraphicsclass, game:gameclass, m dwgfx.drawbutton(game, help); - //dwgfx.backbuffer.lock(); + dwgfx.backbuffer.lock(); if(!game.blackout){ if(!game.colourblindmode) dwgfx.drawbackground(map.background, map); @@ -1051,8 +1050,6 @@ public function gamerender(key:KeyPoll, dwgfx:dwgraphicsclass, game:gameclass, m } dwgfx.drawentities(map, obj, help); - }else { - dwgfx.cls(0x000000); } /*for(i=0; i 100 && !game.advancetext && game.hascontrol && !script.running && !game.intimetrial) { i = obj.getplayer(); if(dwgfx.flipmode){ - dwgfx.print(5, 20, "- Press ENTER to Teleport -", game.readytotele - 20 - (help.glow / 2), game.readytotele - 20 - (help.glow / 2), game.readytotele, true); + dwgfx.bprint(5, 20, "- Press ENTER to Teleport -", game.readytotele - 20 - (help.glow / 2), game.readytotele - 20 - (help.glow / 2), game.readytotele, true); }else { - dwgfx.print(5, 210, "- Press ENTER to Teleport -", game.readytotele - 20 - (help.glow / 2), game.readytotele - 20 - (help.glow / 2), game.readytotele, true); + dwgfx.bprint(5, 210, "- Press ENTER to Teleport -", game.readytotele - 20 - (help.glow / 2), game.readytotele - 20 - (help.glow / 2), game.readytotele, true); } } } @@ -1307,7 +1304,7 @@ public function gamerender(key:KeyPoll, dwgfx:dwgraphicsclass, game:gameclass, m dwgfx.render(); } - //dwgfx.backbuffer.unlock(); + dwgfx.backbuffer.unlock(); } public function maprender(key:KeyPoll, dwgfx:dwgraphicsclass, game:gameclass, map:mapclass, @@ -1315,14 +1312,13 @@ public function maprender(key:KeyPoll, dwgfx:dwgraphicsclass, game:gameclass, ma dwgfx.drawbutton(game, help); - //dwgfx.backbuffer.lock(); + dwgfx.backbuffer.lock(); //dwgfx.drawgui(help); //draw screen alliteration //Roomname: - dwgfx.drawfillrect(0, 0, 320, 12, 0, 0, 0); temp = map.area(game.roomx, game.roomy); if (temp < 2 && !map.custommode && dwgfx.fademode == 0) { if (game.roomx >= 102 && game.roomx <= 104 && game.roomy >= 110 && game.roomy <= 111) { @@ -1347,17 +1343,19 @@ public function maprender(key:KeyPoll, dwgfx:dwgraphicsclass, game:gameclass, ma dwgfx.crewframedelay = 8; dwgfx.crewframe = (dwgfx.crewframe + 1) % 2; } - + //Menubar: - //dwgfx.drawtextbox( -10, 212, 42, 3, 65, 185, 207); - dwgfx.drawfillrect(0, 212, 320, 24, 11, 31, 35); - dwgfx.drawfillrect(0, 212, 320, 2, 65, 185, 207); - dwgfx.drawfillrect(0, 215, 320, 1, 65, 185, 207); - dwgfx.drawfillrect(0, 230, 320, 1, 65, 185, 207); - dwgfx.drawfillrect(0, 232, 320, 2, 65, 185, 207); - + dwgfx.drawtextbox( -10, 212, 42, 3, 65, 185, 207); switch(game.menupage) { + case 0: + dwgfx.print(30 - 8, 220, "[MAP]", 196, 196, 255 - help.glow); + if (game.insecretlab) { dwgfx.print(103, 220, "GRAV", 64, 64, 64); + }else if (obj.flags[67] == 1 && !map.custommode) { dwgfx.print(103, 220, "SHIP", 64,64,64); + }else{ dwgfx.print(103, 220, "CREW", 64,64,64);} + dwgfx.print(185-4, 220, "STATS", 64,64,64); + dwgfx.print(258, 220, "SAVE", 64, 64, 64); + if (game.mobilemenu) { dwgfx.drawmobilebutton(game, 30 - 8, 220, 56, dwgfx.b_size, "MAP", 65, 185, 207); if (game.insecretlab) { dwgfx.drawmobilebutton(game, 103, 220, 56, dwgfx.b_size, "GRAV", 32, 92, 104); @@ -1365,13 +1363,6 @@ public function maprender(key:KeyPoll, dwgfx:dwgraphicsclass, game:gameclass, ma }else{ dwgfx.drawmobilebutton(game, 103, 220, 56, dwgfx.b_size, "CREW", 32, 92, 104);} dwgfx.drawmobilebutton(game, 185-4, 220, 56, dwgfx.b_size, "STATS", 32, 92, 104); dwgfx.drawmobilebutton(game, 258, 220, 56, dwgfx.b_size, "QUIT", 32, 92, 104); - }else { - dwgfx.print(30 - 8, 220, "[MAP]", 196, 196, 255 - help.glow); - if (game.insecretlab) { dwgfx.print(103, 220, "GRAV", 64, 64, 64); - }else if (obj.flags[67] == 1 && !map.custommode) { dwgfx.print(103, 220, "SHIP", 64,64,64); - }else{ dwgfx.print(103, 220, "CREW", 64,64,64);} - dwgfx.print(185-4, 220, "STATS", 64,64,64); - dwgfx.print(258, 220, "SAVE", 64, 64, 64); } if (map.finalmode || (map.custommode && !map.customshowmm)) { @@ -1388,7 +1379,7 @@ public function maprender(key:KeyPoll, dwgfx:dwgraphicsclass, game:gameclass, ma }else if(map.custommode){ //draw the map image dwgfx.drawcustompixeltextbox(35 + map.custommmxoff, 16 + map.custommmyoff, map.custommmxsize + 10, map.custommmysize + 10, (map.custommmxsize + 10) / 8, (map.custommmysize + 10) / 8, 65, 185, 207, 4, 0); - dwgfx.drawpartimage(dwgfx.customminimap as Texture, 40 + map.custommmxoff, 21 + map.custommmyoff, map.custommmxsize, map.custommmysize); + dwgfx.drawpartimage(12, 40 + map.custommmxoff, 21 + map.custommmyoff, map.custommmxsize, map.custommmysize); //Black out here if(map.customzoom==4){ @@ -1573,16 +1564,16 @@ public function maprender(key:KeyPoll, dwgfx:dwgraphicsclass, game:gameclass, ma break; case 1: if (game.insecretlab) { + dwgfx.print(30, 220, "MAP", 64,64,64); + dwgfx.print(103-8, 220, "[GRAV]", 196, 196, 255 - help.glow); + dwgfx.print(185-4, 220, "STATS", 64,64,64); + dwgfx.print(258, 220, "SAVE", 64, 64, 64); + if (game.mobilemenu) { dwgfx.drawmobilebutton(game, 30 - 8, 220, 56, dwgfx.b_size, "MAP", 32, 92, 104); dwgfx.drawmobilebutton(game, 103, 220, 56, dwgfx.b_size, "GRAV", 65, 185, 207); dwgfx.drawmobilebutton(game, 185-4, 220, 56, dwgfx.b_size, "STATS", 32, 92, 104); dwgfx.drawmobilebutton(game, 258, 220, 56, dwgfx.b_size, "QUIT", 32, 92, 104); - }else { - dwgfx.print(30, 220, "MAP", 64,64,64); - dwgfx.print(103-8, 220, "[GRAV]", 196, 196, 255 - help.glow); - dwgfx.print(185-4, 220, "STATS", 64,64,64); - dwgfx.print(258, 220, "SAVE", 64, 64, 64); } if (dwgfx.flipmode) { @@ -1619,16 +1610,16 @@ public function maprender(key:KeyPoll, dwgfx:dwgraphicsclass, game:gameclass, ma } } }else if (obj.flags[67] == 1 && !map.custommode) { + dwgfx.print(30, 220, "MAP", 64,64,64); + dwgfx.print(103-8, 220, "[SHIP]", 196, 196, 255 - help.glow); + dwgfx.print(185-4, 220, "STATS", 64,64,64); + dwgfx.print(258, 220, "SAVE", 64, 64, 64); + if (game.mobilemenu) { dwgfx.drawmobilebutton(game, 30 - 8, 220, 56, dwgfx.b_size, "MAP", 32, 92, 104); dwgfx.drawmobilebutton(game, 103, 220, 56, dwgfx.b_size, "SHIP", 65, 185, 207); dwgfx.drawmobilebutton(game, 185-4, 220, 56, dwgfx.b_size, "STATS", 32, 92, 104); dwgfx.drawmobilebutton(game, 258, 220, 56, dwgfx.b_size, "QUIT", 32, 92, 104); - }else { - dwgfx.print(30, 220, "MAP", 64,64,64); - dwgfx.print(103-8, 220, "[SHIP]", 196, 196, 255 - help.glow); - dwgfx.print(185-4, 220, "STATS", 64,64,64); - dwgfx.print(258, 220, "SAVE", 64, 64, 64); } if (game.mobilemenu) { @@ -1644,16 +1635,16 @@ public function maprender(key:KeyPoll, dwgfx:dwgraphicsclass, game:gameclass, ma dwgfx.print(0, 105, "Press ACTION to warp to the ship.", 196, 196, 255 - help.glow, true); } }else if(map.custommode){ + dwgfx.print(30, 220, "MAP", 64,64,64); + dwgfx.print(103-8, 220, "[CREW]", 196, 196, 255 - help.glow); + dwgfx.print(185-4, 220, "STATS", 64,64,64); + dwgfx.print(258, 220, "SAVE", 64, 64, 64); + if (game.mobilemenu) { dwgfx.drawmobilebutton(game, 30 - 8, 220, 56, dwgfx.b_size, "MAP", 32, 92, 104); dwgfx.drawmobilebutton(game, 103, 220, 56, dwgfx.b_size, "CREW", 65, 185, 207); dwgfx.drawmobilebutton(game, 185-4, 220, 56, dwgfx.b_size, "STATS", 32, 92, 104); dwgfx.drawmobilebutton(game, 258, 220, 56, dwgfx.b_size, "QUIT", 32, 92, 104); - }else { - dwgfx.print(30, 220, "MAP", 64,64,64); - dwgfx.print(103-8, 220, "[CREW]", 196, 196, 255 - help.glow); - dwgfx.print(185-4, 220, "STATS", 64,64,64); - dwgfx.print(258, 220, "SAVE", 64, 64, 64); } if (dwgfx.flipmode){ @@ -1684,16 +1675,16 @@ public function maprender(key:KeyPoll, dwgfx:dwgraphicsclass, game:gameclass, ma } } }else{ + dwgfx.print(30, 220, "MAP", 64,64,64); + dwgfx.print(103-8, 220, "[CREW]", 196, 196, 255 - help.glow); + dwgfx.print(185-4, 220, "STATS", 64,64,64); + dwgfx.print(258, 220, "SAVE", 64, 64, 64); + if (game.mobilemenu) { dwgfx.drawmobilebutton(game, 30 - 8, 220, 56, dwgfx.b_size, "MAP", 32, 92, 104); dwgfx.drawmobilebutton(game, 103, 220, 56, dwgfx.b_size, "CREW", 65, 185, 207); dwgfx.drawmobilebutton(game, 185-4, 220, 56, dwgfx.b_size, "STATS", 32, 92, 104); dwgfx.drawmobilebutton(game, 258, 220, 56, dwgfx.b_size, "QUIT", 32, 92, 104); - }else { - dwgfx.print(30, 220, "MAP", 64,64,64); - dwgfx.print(103-8, 220, "[CREW]", 196, 196, 255 - help.glow); - dwgfx.print(185-4, 220, "STATS", 64,64,64); - dwgfx.print(258, 220, "SAVE", 64, 64, 64); } if (dwgfx.flipmode) { @@ -1740,20 +1731,20 @@ public function maprender(key:KeyPoll, dwgfx:dwgraphicsclass, game:gameclass, ma } break; case 2: - if (game.mobilemenu) { + dwgfx.print(30, 220, "MAP", 64,64,64); + if (game.insecretlab) { dwgfx.print(103, 220, "GRAV", 64, 64, 64); + }else if (obj.flags[67] == 1 && !map.custommode) { dwgfx.print(103, 220, "SHIP", 64,64,64); + }else{ dwgfx.print(103, 220, "CREW", 64,64,64);} + dwgfx.print(185-12, 220, "[STATS]", 196, 196, 255 - help.glow); + dwgfx.print(258, 220, "SAVE", 64, 64, 64); + + if (game.mobilemenu) { dwgfx.drawmobilebutton(game, 30 - 8, 220, 56, dwgfx.b_size, "MAP", 32, 92, 104); if (game.insecretlab) { dwgfx.drawmobilebutton(game, 103, 220, 56, dwgfx.b_size, "GRAV", 32, 92, 104); }else if (obj.flags[67] == 1 && !map.custommode) { dwgfx.drawmobilebutton(game, 103, 220, 56, dwgfx.b_size, "SHIP", 32, 92, 104); }else{ dwgfx.drawmobilebutton(game, 103, 220, 56, dwgfx.b_size, "CREW", 32, 92, 104);} dwgfx.drawmobilebutton(game, 185-4, 220, 56, dwgfx.b_size, "STATS", 65, 185, 207); dwgfx.drawmobilebutton(game, 258, 220, 56, dwgfx.b_size, "QUIT", 32, 92, 104); - }else { - dwgfx.print(30, 220, "MAP", 64,64,64); - if (game.insecretlab) { dwgfx.print(103, 220, "GRAV", 64, 64, 64); - }else if (obj.flags[67] == 1 && !map.custommode) { dwgfx.print(103, 220, "SHIP", 64,64,64); - }else{ dwgfx.print(103, 220, "CREW", 64,64,64);} - dwgfx.print(185-12, 220, "[STATS]", 196, 196, 255 - help.glow); - dwgfx.print(258, 220, "SAVE", 64, 64, 64); } if (map.custommode) { @@ -1799,6 +1790,13 @@ public function maprender(key:KeyPoll, dwgfx:dwgraphicsclass, game:gameclass, ma } break; case 3: + dwgfx.print(30, 220, "MAP", 64,64,64); + if (game.insecretlab) { dwgfx.print(103, 220, "GRAV", 64, 64, 64); + }else if (obj.flags[67] == 1 && !map.custommode) { dwgfx.print(103, 220, "SHIP", 64,64,64); + }else{ dwgfx.print(103, 220, "CREW", 64,64,64);} + dwgfx.print(185-4, 220, "STATS", 64,64,64); + dwgfx.print(258 - 8, 220, "[SAVE]", 196, 196, 255 - help.glow); + if (game.mobilemenu) { dwgfx.drawmobilebutton(game, 30 - 8, 220, 56, dwgfx.b_size, "MAP", 32, 92, 104); if (game.insecretlab) { dwgfx.drawmobilebutton(game, 103, 220, 56, dwgfx.b_size, "GRAV", 32, 92, 104); @@ -1806,13 +1804,6 @@ public function maprender(key:KeyPoll, dwgfx:dwgraphicsclass, game:gameclass, ma }else{ dwgfx.drawmobilebutton(game, 103, 220, 56, dwgfx.b_size, "CREW", 32, 92, 104);} dwgfx.drawmobilebutton(game, 185-4, 220, 56, dwgfx.b_size, "STATS", 32, 92, 104); dwgfx.drawmobilebutton(game, 258, 220, 56, dwgfx.b_size, "QUIT", 65, 185, 207); - }else { - dwgfx.print(30, 220, "MAP", 64,64,64); - if (game.insecretlab) { dwgfx.print(103, 220, "GRAV", 64, 64, 64); - }else if (obj.flags[67] == 1 && !map.custommode) { dwgfx.print(103, 220, "SHIP", 64,64,64); - }else{ dwgfx.print(103, 220, "CREW", 64,64,64);} - dwgfx.print(185-4, 220, "STATS", 64,64,64); - dwgfx.print(258 - 8, 220, "[SAVE]", 196, 196, 255 - help.glow); } dwgfx.print(0, 80, "Quit to main menu?", 255 - (help.glow * 2), 255 - (help.glow * 2), 255 - help.glow, true); @@ -2149,20 +2140,21 @@ public function maprender(key:KeyPoll, dwgfx:dwgraphicsclass, game:gameclass, ma } } - //dwgfx.backbuffer.unlock(); + dwgfx.backbuffer.unlock(); } public function towerrender(key:KeyPoll, dwgfx:dwgraphicsclass, game:gameclass, map:mapclass, obj:entityclass, help:helpclass):void { + dwgfx.drawbutton(game, help); //Couple of changes for the towermode - //dwgfx.backbuffer.lock(); - dwgfx.cls(dwgfx.tower_bgdarkcol[map.colstate]); + dwgfx.backbuffer.lock(); + dwgfx.backbuffer.fillRect(dwgfx.backbuffer.rect, 0x000000); if (!game.colourblindmode) { dwgfx.drawtowerbackground(map); - dwgfx.drawtowermap(game, map); + dwgfx.drawtowermap(map); }else { dwgfx.drawtowermap_nobackground(map); } @@ -2199,12 +2191,12 @@ public function towerrender(key:KeyPoll, dwgfx:dwgraphicsclass, game:gameclass, dwgfx.drawgui(help); if (dwgfx.flipmode) { - if (game.advancetext) dwgfx.print(5, 228, "- Tap screen to advance text -", 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2), true); + if (game.advancetext) dwgfx.bprint(5, 228, "- Tap screen to advance text -", 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2), true); }else{ - if (game.advancetext) dwgfx.print(5, 5, "- Tap screen to advance text -", 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2), true); + if (game.advancetext) dwgfx.bprint(5, 5, "- Tap screen to advance text -", 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2), true); } - dwgfx.drawfillrect(dwgfx.footerrect.x, dwgfx.footerrect.y, dwgfx.footerrect.width, dwgfx.footerrect.height, 0); + dwgfx.backbuffer.fillRect(dwgfx.footerrect, 0x000000); dwgfx.print(5, 231, map.roomname, 196, 196, 255 - help.glow, true); //dwgfx.rprint(5, 231, String(game.coins), 255 - help.glow/2, 255 - help.glow/2, 196, true); @@ -2267,18 +2259,17 @@ public function towerrender(key:KeyPoll, dwgfx:dwgraphicsclass, game:gameclass, } dwgfx.render(); - //dwgfx.backbuffer.unlock(); + dwgfx.backbuffer.unlock(); } public function teleporterrender(key:KeyPoll, dwgfx:dwgraphicsclass, game:gameclass, map:mapclass, obj:entityclass, help:helpclass):void { dwgfx.drawbutton(game, help); - //dwgfx.backbuffer.lock(); + dwgfx.backbuffer.lock(); //draw screen alliteration //Roomname: - dwgfx.drawfillrect(0, 0, 320, 12, 0, 0, 0); temp = map.area(game.roomx, game.roomy); if (temp < 2 && !map.custommode && dwgfx.fademode==0) { if (game.roomx >= 102 && game.roomx <= 104 && game.roomy >= 110 && game.roomy <= 111) { @@ -2373,9 +2364,9 @@ public function teleporterrender(key:KeyPoll, dwgfx:dwgraphicsclass, game:gamecl dwgfx.drawgui(help); if (dwgfx.flipmode) { - if (game.advancetext) dwgfx.print(5, 228, "- Tap screen to advance text -", 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2), true); + if (game.advancetext) dwgfx.bprint(5, 228, "- Tap screen to advance text -", 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2), true); }else{ - if (game.advancetext) dwgfx.print(5, 5, "- Tap screen to advance text -", 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2), true); + if (game.advancetext) dwgfx.bprint(5, 5, "- Tap screen to advance text -", 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2), true); } @@ -2419,14 +2410,14 @@ public function teleporterrender(key:KeyPoll, dwgfx:dwgraphicsclass, game:gamecl } } - //dwgfx.backbuffer.unlock(); + dwgfx.backbuffer.unlock(); } public function controltutorialrender(key:KeyPoll, dwgfx:dwgraphicsclass, game:gameclass, map:mapclass, obj:entityclass, help:helpclass):void { dwgfx.drawbutton(game, help); - //dwgfx.backbuffer.lock(); + dwgfx.backbuffer.lock(); //Background color dwgfx.drawfillrect(0, 0, 320, 240, 10, 24, 26); @@ -2453,12 +2444,12 @@ public function controltutorialrender(key:KeyPoll, dwgfx:dwgraphicsclass, game:g dwgfx.print(5, 10, "-= TOUCHSCREEN CONTROLS =-", 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2), true); if(game.controltutorialstate>=3 &&game.controltutorialstate<=6){ - dwgfx.print(5, 195 + 8, "Swipe and hold on the left side", 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2), true); - dwgfx.print(5, 205 + 8, "of the screen to move", 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2), true); + dwgfx.print(5, 195, "Swipe and hold on the left side", 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2), true); + dwgfx.print(5, 205, "of the screen to move", 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2), true); } if(game.controltutorialstate>=7 &&game.controltutorialstate<=11){ - dwgfx.print(5, 200 + 8, "Tap on the right to flip", 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2), true); + dwgfx.print(5, 200, "Tap on the right to flip", 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2), true); } if (game.controltutorialstate >= 13) { @@ -2529,5 +2520,5 @@ public function controltutorialrender(key:KeyPoll, dwgfx:dwgraphicsclass, game:g dwgfx.render(); } - //dwgfx.backbuffer.unlock(); -} \ No newline at end of file + dwgfx.backbuffer.unlock(); +} diff --git a/mobile_version/src/includes/scripts.as b/mobile_version/src/includes/scripts.as index 7e3e555b..1488233f 100644 --- a/mobile_version/src/includes/scripts.as +++ b/mobile_version/src/includes/scripts.as @@ -4710,7 +4710,7 @@ add("squeak(blue)"); add("text(blue,0,0,3)"); - add("This lab is amazing! The scentists"); + add("This lab is amazing! The scientists"); add("who worked here know a lot more"); add("about warp technology than we do!"); add("position(blue,below)"); @@ -5819,4 +5819,4 @@ } running = true; -} \ No newline at end of file +} diff --git a/mobile_version/src/includes/terminalscripts.as b/mobile_version/src/includes/terminalscripts.as index cd07a551..bf13cefb 100644 --- a/mobile_version/src/includes/terminalscripts.as +++ b/mobile_version/src/includes/terminalscripts.as @@ -674,7 +674,7 @@ add(" NEXT UNLOCK: "); add(" 5 Trinkets"); add(""); - add(" Pushing onwards "); + add(" Pushing Onwards "); add("position(center)"); add("speak_active"); add("endtext"); @@ -687,7 +687,7 @@ add(" NEXT UNLOCK: "); add(" 8 Trinkets"); add(""); - add(" Positive force "); + add(" Positive Force "); add("position(center)"); add("speak_active"); add("endtext"); @@ -713,7 +713,7 @@ add(" NEXT UNLOCK: "); add(" 12 Trinkets"); add(""); - add(" Potential for anything "); + add(" Potential for Anything "); add("position(center)"); add("speak_active"); add("endtext"); @@ -739,7 +739,7 @@ add(" NEXT UNLOCK: "); add(" 16 Trinkets"); add(""); - add(" Predestined fate "); + add(" Predestined Fate "); add("position(center)"); add("speak_active"); add("endtext"); @@ -813,4 +813,4 @@ add("squeak(terminal)"); add("jukebox(10)"); } -} \ No newline at end of file +} diff --git a/mobile_version/src/mapclass.as b/mobile_version/src/mapclass.as index 692ce9ef..3ee1ddfd 100644 --- a/mobile_version/src/mapclass.as +++ b/mobile_version/src/mapclass.as @@ -1,9 +1,10 @@ -package { +package { + import flash.display.*; import flash.geom.*; import flash.events.*; import flash.net.*; - public class mapclass { + public class mapclass extends Sprite { public function mapclass():void { //Start here! r = 196; g = 196; b = 196; @@ -611,8 +612,6 @@ package { game.activetele = false; game.readytotele = 0; game.mobilequicksave_thisroom = false; - dwgfx.forcescreenupdates(); - obj.opt_useblock = false; obj.opt_usetrigger = false; obj.opt_usedamage = false; @@ -791,7 +790,7 @@ package { case 1: return "Dimension VVVVVV"; break; case 2: return "Laboratory"; break; case 3: return "The Tower"; break; - case 4: return "Warpzone"; break; + case 4: return "Warp Zone"; break; case 5: return "Space Station"; break; case 6: return "Outside Dimension VVVVVV"; break; case 7: return "Outside Dimension VVVVVV"; break; @@ -893,7 +892,7 @@ package { } } - if (rx == 119 && ry == 108) { + if (rx == 119 && ry == 108 && !custommode) { background = 5; dwgfx.rcol = 3; warpx = true; @@ -1609,4 +1608,4 @@ obj.createentity(game, 72, 156, 11, 200); // (horizontal gravity line) public var spikecount:int; } -} \ No newline at end of file +} diff --git a/mobile_version/src/musicclass.as b/mobile_version/src/musicclass.as index 950e4aa8..254cd2c1 100644 --- a/mobile_version/src/musicclass.as +++ b/mobile_version/src/musicclass.as @@ -1,8 +1,9 @@ -package { +package { + import flash.display.*; import flash.media.*; import flash.events.*; - public class musicclass { + public class musicclass extends Sprite { //For Music stuff public function play(t:int):void { if (currentsong !=t) { diff --git a/mobile_version/src/platformclass.as b/mobile_version/src/platformclass.as index 06e2d7b5..fc5e0d69 100644 --- a/mobile_version/src/platformclass.as +++ b/mobile_version/src/platformclass.as @@ -2,10 +2,13 @@ package { //import com.sticksports.nativeExtensions.SilentSwitch; import flash.events.*; + import flash.media.SoundMixer; + import flash.media.AudioPlaybackMode; public class platformclass { public function init():void { //SilentSwitch.apply(); + SoundMixer.audioPlaybackMode = AudioPlaybackMode.AMBIENT; } public function callonwake():void { diff --git a/mobile_version/src/saveclass.as b/mobile_version/src/saveclass.as index 164fc397..7868839d 100644 --- a/mobile_version/src/saveclass.as +++ b/mobile_version/src/saveclass.as @@ -1,9 +1,10 @@ -package { +package { + import flash.display.*; import flash.geom.*; import flash.events.*; import flash.net.*; - public class saveclass { + public class saveclass extends Sprite { public function saveclass():void { } diff --git a/mobile_version/src/scoreclass.as b/mobile_version/src/scoreclass.as index bad5cc6c..076c5a75 100644 --- a/mobile_version/src/scoreclass.as +++ b/mobile_version/src/scoreclass.as @@ -1,11 +1,10 @@ package { - //import com.milkmangames.nativeextensions.ios.*; - //import com.milkmangames.nativeextensions.ios.events.*; + import com.milkmangames.nativeextensions.ios.*; + import com.milkmangames.nativeextensions.ios.events.*; import flash.display.Stage; public class scoreclass { public function init(mystage:Stage):void { - /* if (!GameCenter.isSupported()){ trace("GameCenter is not supported on this platform."); } @@ -33,51 +32,41 @@ package { gameCenter.addEventListener(GameCenterErrorEvent.ACHIEVEMENT_REPORT_FAILED,onAchievementFailed); gameCenter.addEventListener(GameCenterErrorEvent.ACHIEVEMENT_RESET_FAILED,onResetFailed); GameCenter.gameCenter.authenticateLocalUser(); - */ } CONFIG::iphonemode { /** Check Authentication */ - private function checkAuthentication():Boolean { - /* + private function checkAuthentication():Boolean{ if (!GameCenter.gameCenter.isUserAuthenticated()){ trace("not logged in!"); return false; } - */ return true; } /** Reset Achievements */ - public function resetAchievements():void { - /* + public function resetAchievements():void{ if (!checkAuthentication()) return; GameCenter.gameCenter.resetAchievements(); - */ } public function reportScore(t:int):void{ // we make sure you're logged in before bothering to report the score. // later iOS versions may take care of waiting/resubmitting for you, but earlier ones won't. - /* if (!checkAuthentication()) return; t = t * 2; //Score is in 30 frame increments GameCenter.gameCenter.reportScoreForCategory(t, "grp.supgravleaderboard"); - */ } public function opengamecenter():void { - /* if (!checkAuthentication()) return; GameCenter.gameCenter.showLeaderboardForCategory("grp.supgravleaderboard"); - */ } /** Show Achievements */ - public function showAchievements():void { - /* + public function showAchievements():void{ if (!checkAuthentication()) return; //trace("showing achievements..."); @@ -86,7 +75,6 @@ package { }catch (e:Error){ //trace("ERR showachievements:"+e.message+"/"+e.name+"/"+e.errorID); } - */ } public var vvvvvvgamecomplete:int = 0; @@ -109,8 +97,7 @@ package { public var vvvvvvsupgrav60:int = 17; public var vvvvvvmaster:int = 18; - public function reportAchievement(t:int):void { - /* + public function reportAchievement(t:int):void{ if (!checkAuthentication()) return; // the '1.0' is a float (Number) value from 0.0-100.0 the percent completion of the achievement. @@ -135,13 +122,11 @@ package { case 17: GameCenter.gameCenter.reportAchievement("grp.vvvvvvsupgrav60", 100.0); break; case 18: GameCenter.gameCenter.reportAchievement("grp.vvvvvvmaster", 100.0); break; } - */ } // // Events // - /* private function onAuthSucceeded(e:GameCenterEvent):void { trace("Auth succeeded!"); @@ -191,11 +176,10 @@ package { { trace("failed to reset:"+e.message); } - */ } CONFIG::iphonemode { - //public var gameCenter:GameCenter; + public var gameCenter:GameCenter; public var gamecenteron:Boolean = true; } } diff --git a/mobile_version/src/scriptclass.as b/mobile_version/src/scriptclass.as index 9d511365..b1d12d8e 100644 --- a/mobile_version/src/scriptclass.as +++ b/mobile_version/src/scriptclass.as @@ -1,12 +1,13 @@ -package { +package { import flash.ui.Keyboard; + import flash.display.*; import flash.geom.*; import flash.events.*; import flash.net.*; import bigroom.input.KeyPoll; import flash.system.fscommand; - public class scriptclass { + public class scriptclass extends Sprite { public var GAMEMODE:int = 0; public var TITLEMODE:int = 1; public var CLICKTOSTART:int = 2; @@ -771,7 +772,7 @@ package { game.gamestate = 5; dwgfx.menuoffset = 240; //actually this should count the roomname if (map.extrarow) dwgfx.menuoffset -= 10; - dwgfx.setup_menubuffer(); + dwgfx.menubuffer.copyPixels(dwgfx.screenbuffer, dwgfx.screenbuffer.rect, dwgfx.tl, null, null, false); dwgfx.resumegamemode = false; game.useteleporter = false; //good heavens don't actually use it @@ -1062,7 +1063,7 @@ package { }else if (words[0] == "foundlab2") { dwgfx.textboxremovefast(); - dwgfx.createtextbox("The secret lab is seperate from", 50, 85, 174, 174, 174); + dwgfx.createtextbox("The secret lab is separate from", 50, 85, 174, 174, 174); dwgfx.addline("the rest of the game. You can"); dwgfx.addline("now come back here at any time"); dwgfx.addline("by selecting the new SECRET LAB"); diff --git a/mobile_version/src/starling/animation/DelayedCall.as b/mobile_version/src/starling/animation/DelayedCall.as deleted file mode 100644 index 46e6e673..00000000 --- a/mobile_version/src/starling/animation/DelayedCall.as +++ /dev/null @@ -1,140 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= - -package starling.animation -{ - import starling.core.starling_internal; - import starling.events.Event; - import starling.events.EventDispatcher; - - /** A DelayedCall allows you to execute a method after a certain time has passed. Since it - * implements the IAnimatable interface, it can be added to a juggler. In most cases, you - * do not have to use this class directly; the juggler class contains a method to delay - * calls directly. - * - *

DelayedCall dispatches an Event of type 'Event.REMOVE_FROM_JUGGLER' when it is finished, - * so that the juggler automatically removes it when its no longer needed.

- * - * @see Juggler - */ - public class DelayedCall extends EventDispatcher implements IAnimatable - { - private var _currentTime:Number; - private var _totalTime:Number; - private var _callback:Function; - private var _args:Array; - private var _repeatCount:int; - - /** Creates a delayed call. */ - public function DelayedCall(callback:Function, delay:Number, args:Array=null) - { - reset(callback, delay, args); - } - - /** Resets the delayed call to its default values, which is useful for pooling. */ - public function reset(callback:Function, delay:Number, args:Array=null):DelayedCall - { - _currentTime = 0; - _totalTime = Math.max(delay, 0.0001); - _callback = callback; - _args = args; - _repeatCount = 1; - - return this; - } - - /** @inheritDoc */ - public function advanceTime(time:Number):void - { - var previousTime:Number = _currentTime; - _currentTime += time; - - if (_currentTime > _totalTime) - _currentTime = _totalTime; - - if (previousTime < _totalTime && _currentTime >= _totalTime) - { - if (_repeatCount == 0 || _repeatCount > 1) - { - _callback.apply(null, _args); - - if (_repeatCount > 0) _repeatCount -= 1; - _currentTime = 0; - advanceTime((previousTime + time) - _totalTime); - } - else - { - // save call & args: they might be changed through an event listener - var call:Function = _callback; - var args:Array = _args; - - // in the callback, people might want to call "reset" and re-add it to the - // juggler; so this event has to be dispatched *before* executing 'call'. - dispatchEventWith(Event.REMOVE_FROM_JUGGLER); - call.apply(null, args); - } - } - } - - /** Advances the delayed call so that it is executed right away. If 'repeatCount' is - * anything else than '1', this method will complete only the current iteration. */ - public function complete():void - { - var restTime:Number = _totalTime - _currentTime; - if (restTime > 0) advanceTime(restTime); - } - - /** Indicates if enough time has passed, and the call has already been executed. */ - public function get isComplete():Boolean - { - return _repeatCount == 1 && _currentTime >= _totalTime; - } - - /** The time for which calls will be delayed (in seconds). */ - public function get totalTime():Number { return _totalTime; } - - /** The time that has already passed (in seconds). */ - public function get currentTime():Number { return _currentTime; } - - /** The number of times the call will be repeated. - * Set to '0' to repeat indefinitely. @default 1 */ - public function get repeatCount():int { return _repeatCount; } - public function set repeatCount(value:int):void { _repeatCount = value; } - - /** The callback that will be executed when the time is up. */ - public function get callback():Function { return _callback; } - - /** The arguments that the callback will be executed with. - * Beware: not a copy, but the actual object! */ - public function get arguments():Array { return _args; } - - // delayed call pooling - - private static var sPool:Vector. = new []; - - /** @private */ - starling_internal static function fromPool(call:Function, delay:Number, - args:Array=null):DelayedCall - { - if (sPool.length) return sPool.pop().reset(call, delay, args); - else return new DelayedCall(call, delay, args); - } - - /** @private */ - starling_internal static function toPool(delayedCall:DelayedCall):void - { - // reset any object-references, to make sure we don't prevent any garbage collection - delayedCall._callback = null; - delayedCall._args = null; - delayedCall.removeEventListeners(); - sPool.push(delayedCall); - } - } -} \ No newline at end of file diff --git a/mobile_version/src/starling/animation/IAnimatable.as b/mobile_version/src/starling/animation/IAnimatable.as deleted file mode 100644 index d954426f..00000000 --- a/mobile_version/src/starling/animation/IAnimatable.as +++ /dev/null @@ -1,30 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= - -package starling.animation -{ - /** The IAnimatable interface describes objects that are animated depending on the passed time. - * Any object that implements this interface can be added to a juggler. - * - *

When an object should no longer be animated, it has to be removed from the juggler. - * To do this, you can manually remove it via the method juggler.remove(object), - * or the object can request to be removed by dispatching a Starling event with the type - * Event.REMOVE_FROM_JUGGLER. The "Tween" class is an example of a class that - * dispatches such an event; you don't have to remove tweens manually from the juggler.

- * - * @see Juggler - * @see Tween - */ - public interface IAnimatable - { - /** Advance the time by a number of seconds. @param time in seconds. */ - function advanceTime(time:Number):void; - } -} \ No newline at end of file diff --git a/mobile_version/src/starling/animation/Juggler.as b/mobile_version/src/starling/animation/Juggler.as deleted file mode 100644 index 810a7e82..00000000 --- a/mobile_version/src/starling/animation/Juggler.as +++ /dev/null @@ -1,396 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= - -package starling.animation -{ - import flash.utils.Dictionary; - - import starling.core.starling_internal; - import starling.events.Event; - import starling.events.EventDispatcher; - - /** The Juggler takes objects that implement IAnimatable (like Tweens) and executes them. - * - *

A juggler is a simple object. It does no more than saving a list of objects implementing - * "IAnimatable" and advancing their time if it is told to do so (by calling its own - * "advanceTime"-method). When an animation is completed, it throws it away.

- * - *

There is a default juggler available at the Starling class:

- * - *
-     *  var juggler:Juggler = Starling.juggler;
-     *  
- * - *

You can create juggler objects yourself, just as well. That way, you can group - * your game into logical components that handle their animations independently. All you have - * to do is call the "advanceTime" method on your custom juggler once per frame.

- * - *

Another handy feature of the juggler is the "delayCall"-method. Use it to - * execute a function at a later time. Different to conventional approaches, the method - * will only be called when the juggler is advanced, giving you perfect control over the - * call.

- * - *
-     *  juggler.delayCall(object.removeFromParent, 1.0);
-     *  juggler.delayCall(object.addChild, 2.0, theChild);
-     *  juggler.delayCall(function():void { rotation += 0.1; }, 3.0);
-     *  
- * - * @see Tween - * @see DelayedCall - */ - public class Juggler implements IAnimatable - { - private var _objects:Vector.; - private var _objectIDs:Dictionary; - private var _elapsedTime:Number; - private var _timeScale:Number; - - private static var sCurrentObjectID:uint; - - /** Create an empty juggler. */ - public function Juggler() - { - _elapsedTime = 0; - _timeScale = 1.0; - _objects = new []; - _objectIDs = new Dictionary(true); - } - - /** Adds an object to the juggler. - * - * @return Unique numeric identifier for the animation. This identifier may be used - * to remove the object via removeByID(). - */ - public function add(object:IAnimatable):uint - { - return addWithID(object, getNextID()); - } - - private function addWithID(object:IAnimatable, objectID:uint):uint - { - if (object && !(object in _objectIDs)) - { - var dispatcher:EventDispatcher = object as EventDispatcher; - if (dispatcher) dispatcher.addEventListener(Event.REMOVE_FROM_JUGGLER, onRemove); - - _objects[_objects.length] = object; - _objectIDs[object] = objectID; - - return objectID; - } - else return 0; - } - - /** Determines if an object has been added to the juggler. */ - public function contains(object:IAnimatable):Boolean - { - return object in _objectIDs; - } - - /** Removes an object from the juggler. - * - * @return The (now meaningless) unique numeric identifier for the animation, or zero - * if the object was not found. - */ - public function remove(object:IAnimatable):uint - { - var objectID:uint = 0; - - if (object && object in _objectIDs) - { - var dispatcher:EventDispatcher = object as EventDispatcher; - if (dispatcher) dispatcher.removeEventListener(Event.REMOVE_FROM_JUGGLER, onRemove); - - var index:int = _objects.indexOf(object); - _objects[index] = null; - - objectID = _objectIDs[object]; - delete _objectIDs[object]; - } - - return objectID; - } - - /** Removes an object from the juggler, identified by the unique numeric identifier you - * received when adding it. - * - *

It's not uncommon that an animatable object is added to a juggler repeatedly, - * e.g. when using an object-pool. Thus, when using the remove method, - * you might accidentally remove an object that has changed its context. By using - * removeByID instead, you can be sure to avoid that, since the objectID - * will always be unique.

- * - * @return if successful, the passed objectID; if the object was not found, zero. - */ - public function removeByID(objectID:uint):uint - { - for (var i:int=_objects.length-1; i>=0; --i) - { - var object:IAnimatable = _objects[i]; - - if (_objectIDs[object] == objectID) - { - remove(object); - return objectID; - } - } - - return 0; - } - - /** Removes all tweens with a certain target. */ - public function removeTweens(target:Object):void - { - if (target == null) return; - - for (var i:int=_objects.length-1; i>=0; --i) - { - var tween:Tween = _objects[i] as Tween; - if (tween && tween.target == target) - { - tween.removeEventListener(Event.REMOVE_FROM_JUGGLER, onRemove); - _objects[i] = null; - delete _objectIDs[tween]; - } - } - } - - /** Removes all delayed and repeated calls with a certain callback. */ - public function removeDelayedCalls(callback:Function):void - { - if (callback == null) return; - - for (var i:int=_objects.length-1; i>=0; --i) - { - var delayedCall:DelayedCall = _objects[i] as DelayedCall; - if (delayedCall && delayedCall.callback == callback) - { - delayedCall.removeEventListener(Event.REMOVE_FROM_JUGGLER, onRemove); - _objects[i] = null; - delete _objectIDs[tween]; - } - } - } - - /** Figures out if the juggler contains one or more tweens with a certain target. */ - public function containsTweens(target:Object):Boolean - { - if (target) - { - for (var i:int=_objects.length-1; i>=0; --i) - { - var tween:Tween = _objects[i] as Tween; - if (tween && tween.target == target) return true; - } - } - - return false; - } - - /** Figures out if the juggler contains one or more delayed calls with a certain callback. */ - public function containsDelayedCalls(callback:Function):Boolean - { - if (callback != null) - { - for (var i:int=_objects.length-1; i>=0; --i) - { - var delayedCall:DelayedCall = _objects[i] as DelayedCall; - if (delayedCall && delayedCall.callback == callback) return true; - } - } - - return false; - } - - /** Removes all objects at once. */ - public function purge():void - { - // the object vector is not purged right away, because if this method is called - // from an 'advanceTime' call, this would make the loop crash. Instead, the - // vector is filled with 'null' values. They will be cleaned up on the next call - // to 'advanceTime'. - - for (var i:int=_objects.length-1; i>=0; --i) - { - var object:IAnimatable = _objects[i]; - var dispatcher:EventDispatcher = object as EventDispatcher; - if (dispatcher) dispatcher.removeEventListener(Event.REMOVE_FROM_JUGGLER, onRemove); - _objects[i] = null; - delete _objectIDs[object]; - } - } - - /** Delays the execution of a function until delay seconds have passed. - * This method provides a convenient alternative for creating and adding a DelayedCall - * manually. - * - * @return Unique numeric identifier for the delayed call. This identifier may be used - * to remove the object via removeByID(). - */ - public function delayCall(call:Function, delay:Number, ...args):uint - { - if (call == null) throw new ArgumentError("call must not be null"); - - var delayedCall:DelayedCall = DelayedCall.starling_internal::fromPool(call, delay, args); - delayedCall.addEventListener(Event.REMOVE_FROM_JUGGLER, onPooledDelayedCallComplete); - return add(delayedCall); - } - - /** Runs a function at a specified interval (in seconds). A 'repeatCount' of zero - * means that it runs indefinitely. - * - * @return Unique numeric identifier for the delayed call. This identifier may be used - * to remove the object via removeByID(). - */ - public function repeatCall(call:Function, interval:Number, repeatCount:int=0, ...args):uint - { - if (call == null) throw new ArgumentError("call must not be null"); - - var delayedCall:DelayedCall = DelayedCall.starling_internal::fromPool(call, interval, args); - delayedCall.repeatCount = repeatCount; - delayedCall.addEventListener(Event.REMOVE_FROM_JUGGLER, onPooledDelayedCallComplete); - return add(delayedCall); - } - - private function onPooledDelayedCallComplete(event:Event):void - { - DelayedCall.starling_internal::toPool(event.target as DelayedCall); - } - - /** Utilizes a tween to animate the target object over time seconds. Internally, - * this method uses a tween instance (taken from an object pool) that is added to the - * juggler right away. This method provides a convenient alternative for creating - * and adding a tween manually. - * - *

Fill 'properties' with key-value pairs that describe both the - * tween and the animation target. Here is an example:

- * - *
-         *  juggler.tween(object, 2.0, {
-         *      transition: Transitions.EASE_IN_OUT,
-         *      delay: 20, // -> tween.delay = 20
-         *      x: 50      // -> tween.animate("x", 50)
-         *  });
-         *  
- * - *

To cancel the tween, call 'Juggler.removeTweens' with the same target, or pass - * the returned 'IAnimatable' instance to 'Juggler.remove()'. Do not use the returned - * IAnimatable otherwise; it is taken from a pool and will be reused.

- * - *

Note that some property types may be animated in a special way:

- *
    - *
  • If the property contains the string color or Color, - * it will be treated as an unsigned integer with a color value - * (e.g. 0xff0000 for red). Each color channel will be animated - * individually.
  • - *
  • The same happens if you append the string #rgb to the name.
  • - *
  • If you append #rad, the property is treated as an angle in radians, - * making sure it always uses the shortest possible arc for the rotation.
  • - *
  • The string #deg does the same for angles in degrees.
  • - *
- */ - public function tween(target:Object, time:Number, properties:Object):uint - { - if (target == null) throw new ArgumentError("target must not be null"); - - var tween:Tween = Tween.starling_internal::fromPool(target, time); - - for (var property:String in properties) - { - var value:Object = properties[property]; - - if (tween.hasOwnProperty(property)) - tween[property] = value; - else if (target.hasOwnProperty(Tween.getPropertyName(property))) - tween.animate(property, value as Number); - else - throw new ArgumentError("Invalid property: " + property); - } - - tween.addEventListener(Event.REMOVE_FROM_JUGGLER, onPooledTweenComplete); - return add(tween); - } - - private function onPooledTweenComplete(event:Event):void - { - Tween.starling_internal::toPool(event.target as Tween); - } - - /** Advances all objects by a certain time (in seconds). */ - public function advanceTime(time:Number):void - { - var numObjects:int = _objects.length; - var currentIndex:int = 0; - var i:int; - - time *= _timeScale; - if (numObjects == 0 || time == 0) return; - _elapsedTime += time; - - // there is a high probability that the "advanceTime" function modifies the list - // of animatables. we must not process new objects right now (they will be processed - // in the next frame), and we need to clean up any empty slots in the list. - - for (i=0; i { return _objects; } - } -} diff --git a/mobile_version/src/starling/animation/Transitions.as b/mobile_version/src/starling/animation/Transitions.as deleted file mode 100644 index de708b61..00000000 --- a/mobile_version/src/starling/animation/Transitions.as +++ /dev/null @@ -1,233 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= -// -// easing functions thankfully taken from http://dojotoolkit.org -// and http://www.robertpenner.com/easing -// - -package starling.animation -{ - import flash.utils.Dictionary; - - import starling.errors.AbstractClassError; - - /** The Transitions class contains static methods that define easing functions. - * Those functions are used by the Tween class to execute animations. - * - *

Here is a visual representation of the available transitions:

- * - * - *

You can define your own transitions through the "registerTransition" function. A - * transition function must have the following signature, where ratio is - * in the range 0-1:

- * - *
function myTransition(ratio:Number):Number
- */ - public class Transitions - { - public static const LINEAR:String = "linear"; - public static const EASE_IN:String = "easeIn"; - public static const EASE_OUT:String = "easeOut"; - public static const EASE_IN_OUT:String = "easeInOut"; - public static const EASE_OUT_IN:String = "easeOutIn"; - public static const EASE_IN_BACK:String = "easeInBack"; - public static const EASE_OUT_BACK:String = "easeOutBack"; - public static const EASE_IN_OUT_BACK:String = "easeInOutBack"; - public static const EASE_OUT_IN_BACK:String = "easeOutInBack"; - public static const EASE_IN_ELASTIC:String = "easeInElastic"; - public static const EASE_OUT_ELASTIC:String = "easeOutElastic"; - public static const EASE_IN_OUT_ELASTIC:String = "easeInOutElastic"; - public static const EASE_OUT_IN_ELASTIC:String = "easeOutInElastic"; - public static const EASE_IN_BOUNCE:String = "easeInBounce"; - public static const EASE_OUT_BOUNCE:String = "easeOutBounce"; - public static const EASE_IN_OUT_BOUNCE:String = "easeInOutBounce"; - public static const EASE_OUT_IN_BOUNCE:String = "easeOutInBounce"; - - private static var sTransitions:Dictionary; - - /** @private */ - public function Transitions() { throw new AbstractClassError(); } - - /** Returns the transition function that was registered under a certain name. */ - public static function getTransition(name:String):Function - { - if (sTransitions == null) registerDefaults(); - return sTransitions[name]; - } - - /** Registers a new transition function under a certain name. */ - public static function register(name:String, func:Function):void - { - if (sTransitions == null) registerDefaults(); - sTransitions[name] = func; - } - - private static function registerDefaults():void - { - sTransitions = new Dictionary(); - - register(LINEAR, linear); - register(EASE_IN, easeIn); - register(EASE_OUT, easeOut); - register(EASE_IN_OUT, easeInOut); - register(EASE_OUT_IN, easeOutIn); - register(EASE_IN_BACK, easeInBack); - register(EASE_OUT_BACK, easeOutBack); - register(EASE_IN_OUT_BACK, easeInOutBack); - register(EASE_OUT_IN_BACK, easeOutInBack); - register(EASE_IN_ELASTIC, easeInElastic); - register(EASE_OUT_ELASTIC, easeOutElastic); - register(EASE_IN_OUT_ELASTIC, easeInOutElastic); - register(EASE_OUT_IN_ELASTIC, easeOutInElastic); - register(EASE_IN_BOUNCE, easeInBounce); - register(EASE_OUT_BOUNCE, easeOutBounce); - register(EASE_IN_OUT_BOUNCE, easeInOutBounce); - register(EASE_OUT_IN_BOUNCE, easeOutInBounce); - } - - // transition functions - - protected static function linear(ratio:Number):Number - { - return ratio; - } - - protected static function easeIn(ratio:Number):Number - { - return ratio * ratio * ratio; - } - - protected static function easeOut(ratio:Number):Number - { - var invRatio:Number = ratio - 1.0; - return invRatio * invRatio * invRatio + 1; - } - - protected static function easeInOut(ratio:Number):Number - { - return easeCombined(easeIn, easeOut, ratio); - } - - protected static function easeOutIn(ratio:Number):Number - { - return easeCombined(easeOut, easeIn, ratio); - } - - protected static function easeInBack(ratio:Number):Number - { - var s:Number = 1.70158; - return Math.pow(ratio, 2) * ((s + 1.0)*ratio - s); - } - - protected static function easeOutBack(ratio:Number):Number - { - var invRatio:Number = ratio - 1.0; - var s:Number = 1.70158; - return Math.pow(invRatio, 2) * ((s + 1.0)*invRatio + s) + 1.0; - } - - protected static function easeInOutBack(ratio:Number):Number - { - return easeCombined(easeInBack, easeOutBack, ratio); - } - - protected static function easeOutInBack(ratio:Number):Number - { - return easeCombined(easeOutBack, easeInBack, ratio); - } - - protected static function easeInElastic(ratio:Number):Number - { - if (ratio == 0 || ratio == 1) return ratio; - else - { - var p:Number = 0.3; - var s:Number = p/4.0; - var invRatio:Number = ratio - 1; - return -1.0 * Math.pow(2.0, 10.0*invRatio) * Math.sin((invRatio-s)*(2.0*Math.PI)/p); - } - } - - protected static function easeOutElastic(ratio:Number):Number - { - if (ratio == 0 || ratio == 1) return ratio; - else - { - var p:Number = 0.3; - var s:Number = p/4.0; - return Math.pow(2.0, -10.0*ratio) * Math.sin((ratio-s)*(2.0*Math.PI)/p) + 1; - } - } - - protected static function easeInOutElastic(ratio:Number):Number - { - return easeCombined(easeInElastic, easeOutElastic, ratio); - } - - protected static function easeOutInElastic(ratio:Number):Number - { - return easeCombined(easeOutElastic, easeInElastic, ratio); - } - - protected static function easeInBounce(ratio:Number):Number - { - return 1.0 - easeOutBounce(1.0 - ratio); - } - - protected static function easeOutBounce(ratio:Number):Number - { - var s:Number = 7.5625; - var p:Number = 2.75; - var l:Number; - if (ratio < (1.0/p)) - { - l = s * Math.pow(ratio, 2); - } - else - { - if (ratio < (2.0/p)) - { - ratio -= 1.5/p; - l = s * Math.pow(ratio, 2) + 0.75; - } - else - { - if (ratio < 2.5/p) - { - ratio -= 2.25/p; - l = s * Math.pow(ratio, 2) + 0.9375; - } - else - { - ratio -= 2.625/p; - l = s * Math.pow(ratio, 2) + 0.984375; - } - } - } - return l; - } - - protected static function easeInOutBounce(ratio:Number):Number - { - return easeCombined(easeInBounce, easeOutBounce, ratio); - } - - protected static function easeOutInBounce(ratio:Number):Number - { - return easeCombined(easeOutBounce, easeInBounce, ratio); - } - - protected static function easeCombined(startFunc:Function, endFunc:Function, ratio:Number):Number - { - if (ratio < 0.5) return 0.5 * startFunc(ratio*2.0); - else return 0.5 * endFunc((ratio-0.5)*2.0) + 0.5; - } - } -} \ No newline at end of file diff --git a/mobile_version/src/starling/animation/Tween.as b/mobile_version/src/starling/animation/Tween.as deleted file mode 100644 index 561bd944..00000000 --- a/mobile_version/src/starling/animation/Tween.as +++ /dev/null @@ -1,451 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= - - -package starling.animation -{ - import starling.core.starling_internal; - import starling.events.Event; - import starling.events.EventDispatcher; - import starling.utils.Color; - - /** A Tween animates numeric properties of objects. It uses different transition functions - * to give the animations various styles. - * - *

The primary use of this class is to do standard animations like movement, fading, - * rotation, etc. But there are no limits on what to animate; as long as the property you want - * to animate is numeric (int, uint, Number), the tween can handle it. For a list - * of available Transition types, look at the "Transitions" class.

- * - *

Here is an example of a tween that moves an object to the right, rotates it, and - * fades it out:

- * - * - * var tween:Tween = new Tween(object, 2.0, Transitions.EASE_IN_OUT); - * tween.animate("x", object.x + 50); - * tween.animate("rotation", deg2rad(45)); - * tween.fadeTo(0); // equivalent to 'animate("alpha", 0)' - * Starling.juggler.add(tween); - * - *

Note that the object is added to a juggler at the end of this sample. That's because a - * tween will only be executed if its "advanceTime" method is executed regularly - the - * juggler will do that for you, and will remove the tween when it is finished.

- * - * @see Juggler - * @see Transitions - */ - public class Tween extends EventDispatcher implements IAnimatable - { - private static const HINT_MARKER:String = '#'; - - private var _target:Object; - private var _transitionFunc:Function; - private var _transitionName:String; - - private var _properties:Vector.; - private var _startValues:Vector.; - private var _endValues:Vector.; - private var _updateFuncs:Vector.; - - private var _onStart:Function; - private var _onUpdate:Function; - private var _onRepeat:Function; - private var _onComplete:Function; - - private var _onStartArgs:Array; - private var _onUpdateArgs:Array; - private var _onRepeatArgs:Array; - private var _onCompleteArgs:Array; - - private var _totalTime:Number; - private var _currentTime:Number; - private var _progress:Number; - private var _delay:Number; - private var _roundToInt:Boolean; - private var _nextTween:Tween; - private var _repeatCount:int; - private var _repeatDelay:Number; - private var _reverse:Boolean; - private var _currentCycle:int; - - /** Creates a tween with a target, duration (in seconds) and a transition function. - * @param target the object that you want to animate - * @param time the duration of the Tween (in seconds) - * @param transition can be either a String (e.g. one of the constants defined in the - * Transitions class) or a function. Look up the 'Transitions' class for a - * documentation about the required function signature. */ - public function Tween(target:Object, time:Number, transition:Object="linear") - { - reset(target, time, transition); - } - - /** Resets the tween to its default values. Useful for pooling tweens. */ - public function reset(target:Object, time:Number, transition:Object="linear"):Tween - { - _target = target; - _currentTime = 0.0; - _totalTime = Math.max(0.0001, time); - _progress = 0.0; - _delay = _repeatDelay = 0.0; - _onStart = _onUpdate = _onRepeat = _onComplete = null; - _onStartArgs = _onUpdateArgs = _onRepeatArgs = _onCompleteArgs = null; - _roundToInt = _reverse = false; - _repeatCount = 1; - _currentCycle = -1; - _nextTween = null; - - if (transition is String) - this.transition = transition as String; - else if (transition is Function) - this.transitionFunc = transition as Function; - else - throw new ArgumentError("Transition must be either a string or a function"); - - if (_properties) _properties.length = 0; else _properties = new []; - if (_startValues) _startValues.length = 0; else _startValues = new []; - if (_endValues) _endValues.length = 0; else _endValues = new []; - if (_updateFuncs) _updateFuncs.length = 0; else _updateFuncs = new []; - - return this; - } - - /** Animates the property of the target to a certain value. You can call this method - * multiple times on one tween. - * - *

Some property types are handled in a special way:

- *
    - *
  • If the property contains the string color or Color, - * it will be treated as an unsigned integer with a color value - * (e.g. 0xff0000 for red). Each color channel will be animated - * individually.
  • - *
  • The same happens if you append the string #rgb to the name.
  • - *
  • If you append #rad, the property is treated as an angle in radians, - * making sure it always uses the shortest possible arc for the rotation.
  • - *
  • The string #deg does the same for angles in degrees.
  • - *
- */ - public function animate(property:String, endValue:Number):void - { - if (_target == null) return; // tweening null just does nothing. - - var pos:int = _properties.length; - var updateFunc:Function = getUpdateFuncFromProperty(property); - - _properties[pos] = getPropertyName(property); - _startValues[pos] = Number.NaN; - _endValues[pos] = endValue; - _updateFuncs[pos] = updateFunc; - } - - /** Animates the 'scaleX' and 'scaleY' properties of an object simultaneously. */ - public function scaleTo(factor:Number):void - { - animate("scaleX", factor); - animate("scaleY", factor); - } - - /** Animates the 'x' and 'y' properties of an object simultaneously. */ - public function moveTo(x:Number, y:Number):void - { - animate("x", x); - animate("y", y); - } - - /** Animates the 'alpha' property of an object to a certain target value. */ - public function fadeTo(alpha:Number):void - { - animate("alpha", alpha); - } - - /** Animates the 'rotation' property of an object to a certain target value, using the - * smallest possible arc. 'type' may be either 'rad' or 'deg', depending on the unit of - * measurement. */ - public function rotateTo(angle:Number, type:String="rad"):void - { - animate("rotation#" + type, angle); - } - - /** @inheritDoc */ - public function advanceTime(time:Number):void - { - if (time == 0 || (_repeatCount == 1 && _currentTime == _totalTime)) return; - - var i:int; - var previousTime:Number = _currentTime; - var restTime:Number = _totalTime - _currentTime; - var carryOverTime:Number = time > restTime ? time - restTime : 0.0; - - _currentTime += time; - - if (_currentTime <= 0) - return; // the delay is not over yet - else if (_currentTime > _totalTime) - _currentTime = _totalTime; - - if (_currentCycle < 0 && previousTime <= 0 && _currentTime > 0) - { - _currentCycle++; - if (_onStart != null) _onStart.apply(this, _onStartArgs); - } - - var ratio:Number = _currentTime / _totalTime; - var reversed:Boolean = _reverse && (_currentCycle % 2 == 1); - var numProperties:int = _startValues.length; - _progress = reversed ? _transitionFunc(1.0 - ratio) : _transitionFunc(ratio); - - for (i=0; i= _totalTime) - { - if (_repeatCount == 0 || _repeatCount > 1) - { - _currentTime = -_repeatDelay; - _currentCycle++; - if (_repeatCount > 1) _repeatCount--; - if (_onRepeat != null) _onRepeat.apply(this, _onRepeatArgs); - } - else - { - // save callback & args: they might be changed through an event listener - var onComplete:Function = _onComplete; - var onCompleteArgs:Array = _onCompleteArgs; - - // in the 'onComplete' callback, people might want to call "tween.reset" and - // add it to another juggler; so this event has to be dispatched *before* - // executing 'onComplete'. - dispatchEventWith(Event.REMOVE_FROM_JUGGLER); - if (onComplete != null) onComplete.apply(this, onCompleteArgs); - if (_currentTime == 0) carryOverTime = 0; // tween was reset - } - } - - if (carryOverTime) - advanceTime(carryOverTime); - } - - // animation hints - - private function getUpdateFuncFromProperty(property:String):Function - { - var updateFunc:Function; - var hint:String = getPropertyHint(property); - - switch (hint) - { - case null: updateFunc = updateStandard; break; - case "rgb": updateFunc = updateRgb; break; - case "rad": updateFunc = updateRad; break; - case "deg": updateFunc = updateDeg; break; - default: - trace("[Starling] Ignoring unknown property hint:", hint); - updateFunc = updateStandard; - } - - return updateFunc; - } - - /** @private */ - internal static function getPropertyHint(property:String):String - { - // colorization is special; it does not require a hint marker, just the word 'color'. - if (property.indexOf("color") != -1 || property.indexOf("Color") != -1) - return "rgb"; - - var hintMarkerIndex:int = property.indexOf(HINT_MARKER); - if (hintMarkerIndex != -1) return property.substr(hintMarkerIndex+1); - else return null; - } - - /** @private */ - internal static function getPropertyName(property:String):String - { - var hintMarkerIndex:int = property.indexOf(HINT_MARKER); - if (hintMarkerIndex != -1) return property.substring(0, hintMarkerIndex); - else return property; - } - - private function updateStandard(property:String, startValue:Number, endValue:Number):void - { - var newValue:Number = startValue + _progress * (endValue - startValue); - if (_roundToInt) newValue = Math.round(newValue); - _target[property] = newValue; - } - - private function updateRgb(property:String, startValue:Number, endValue:Number):void - { - _target[property] = Color.interpolate(uint(startValue), uint(endValue), _progress); - } - - private function updateRad(property:String, startValue:Number, endValue:Number):void - { - updateAngle(Math.PI, property, startValue, endValue); - } - - private function updateDeg(property:String, startValue:Number, endValue:Number):void - { - updateAngle(180, property, startValue, endValue); - } - - private function updateAngle(pi:Number, property:String, startValue:Number, endValue:Number):void - { - while (Math.abs(endValue - startValue) > pi) - { - if (startValue < endValue) endValue -= 2.0 * pi; - else endValue += 2.0 * pi; - } - - updateStandard(property, startValue, endValue); - } - - /** The end value a certain property is animated to. Throws an ArgumentError if the - * property is not being animated. */ - public function getEndValue(property:String):Number - { - var index:int = _properties.indexOf(property); - if (index == -1) throw new ArgumentError("The property '" + property + "' is not animated"); - else return _endValues[index] as Number; - } - - /** Indicates if the tween is finished. */ - public function get isComplete():Boolean - { - return _currentTime >= _totalTime && _repeatCount == 1; - } - - /** The target object that is animated. */ - public function get target():Object { return _target; } - - /** The transition method used for the animation. @see Transitions */ - public function get transition():String { return _transitionName; } - public function set transition(value:String):void - { - _transitionName = value; - _transitionFunc = Transitions.getTransition(value); - - if (_transitionFunc == null) - throw new ArgumentError("Invalid transiton: " + value); - } - - /** The actual transition function used for the animation. */ - public function get transitionFunc():Function { return _transitionFunc; } - public function set transitionFunc(value:Function):void - { - _transitionName = "custom"; - _transitionFunc = value; - } - - /** The total time the tween will take per repetition (in seconds). */ - public function get totalTime():Number { return _totalTime; } - - /** The time that has passed since the tween was created (in seconds). */ - public function get currentTime():Number { return _currentTime; } - - /** The current progress between 0 and 1, as calculated by the transition function. */ - public function get progress():Number { return _progress; } - - /** The delay before the tween is started (in seconds). @default 0 */ - public function get delay():Number { return _delay; } - public function set delay(value:Number):void - { - _currentTime = _currentTime + _delay - value; - _delay = value; - } - - /** The number of times the tween will be executed. - * Set to '0' to tween indefinitely. @default 1 */ - public function get repeatCount():int { return _repeatCount; } - public function set repeatCount(value:int):void { _repeatCount = value; } - - /** The amount of time to wait between repeat cycles (in seconds). @default 0 */ - public function get repeatDelay():Number { return _repeatDelay; } - public function set repeatDelay(value:Number):void { _repeatDelay = value; } - - /** Indicates if the tween should be reversed when it is repeating. If enabled, - * every second repetition will be reversed. @default false */ - public function get reverse():Boolean { return _reverse; } - public function set reverse(value:Boolean):void { _reverse = value; } - - /** Indicates if the numeric values should be cast to Integers. @default false */ - public function get roundToInt():Boolean { return _roundToInt; } - public function set roundToInt(value:Boolean):void { _roundToInt = value; } - - /** A function that will be called when the tween starts (after a possible delay). */ - public function get onStart():Function { return _onStart; } - public function set onStart(value:Function):void { _onStart = value; } - - /** A function that will be called each time the tween is advanced. */ - public function get onUpdate():Function { return _onUpdate; } - public function set onUpdate(value:Function):void { _onUpdate = value; } - - /** A function that will be called each time the tween finishes one repetition - * (except the last, which will trigger 'onComplete'). */ - public function get onRepeat():Function { return _onRepeat; } - public function set onRepeat(value:Function):void { _onRepeat = value; } - - /** A function that will be called when the tween is complete. */ - public function get onComplete():Function { return _onComplete; } - public function set onComplete(value:Function):void { _onComplete = value; } - - /** The arguments that will be passed to the 'onStart' function. */ - public function get onStartArgs():Array { return _onStartArgs; } - public function set onStartArgs(value:Array):void { _onStartArgs = value; } - - /** The arguments that will be passed to the 'onUpdate' function. */ - public function get onUpdateArgs():Array { return _onUpdateArgs; } - public function set onUpdateArgs(value:Array):void { _onUpdateArgs = value; } - - /** The arguments that will be passed to the 'onRepeat' function. */ - public function get onRepeatArgs():Array { return _onRepeatArgs; } - public function set onRepeatArgs(value:Array):void { _onRepeatArgs = value; } - - /** The arguments that will be passed to the 'onComplete' function. */ - public function get onCompleteArgs():Array { return _onCompleteArgs; } - public function set onCompleteArgs(value:Array):void { _onCompleteArgs = value; } - - /** Another tween that will be started (i.e. added to the same juggler) as soon as - * this tween is completed. */ - public function get nextTween():Tween { return _nextTween; } - public function set nextTween(value:Tween):void { _nextTween = value; } - - // tween pooling - - private static var sTweenPool:Vector. = new []; - - /** @private */ - starling_internal static function fromPool(target:Object, time:Number, - transition:Object="linear"):Tween - { - if (sTweenPool.length) return sTweenPool.pop().reset(target, time, transition); - else return new Tween(target, time, transition); - } - - /** @private */ - starling_internal static function toPool(tween:Tween):void - { - // reset any object-references, to make sure we don't prevent any garbage collection - tween._onStart = tween._onUpdate = tween._onRepeat = tween._onComplete = null; - tween._onStartArgs = tween._onUpdateArgs = tween._onRepeatArgs = tween._onCompleteArgs = null; - tween._target = null; - tween._transitionFunc = null; - tween.removeEventListeners(); - sTweenPool.push(tween); - } - } -} diff --git a/mobile_version/src/starling/assets/AssetFactory.as b/mobile_version/src/starling/assets/AssetFactory.as deleted file mode 100644 index 01cfeecc..00000000 --- a/mobile_version/src/starling/assets/AssetFactory.as +++ /dev/null @@ -1,122 +0,0 @@ -package starling.assets -{ - import flash.system.Capabilities; - import flash.utils.ByteArray; - import flash.utils.getQualifiedClassName; - - import starling.errors.AbstractClassError; - - /** An AssetFactory is responsible for creating a concrete instance of an asset. - * - *

The AssetManager contains a list of AssetFactories, registered via 'registerFactory'. - * When the asset queue is processed, each factory (sorted by priority) will be asked if it - * can handle a certain AssetReference (via the 'canHandle') method. If it can, the 'create' - * method will be called, which is responsible for creating at least one asset.

- * - *

By extending 'AssetFactory' and registering your class at the AssetManager, you can - * customize how assets are being created and even add new types of assets.

- */ - public class AssetFactory - { - private var _priority:int; - private var _mimeTypes:Vector.; - private var _extensions:Vector.; - - /** Creates a new instance. */ - public function AssetFactory() - { - if (Capabilities.isDebugger && - getQualifiedClassName(this) == "starling.assets::AssetFactory") - { - throw new AbstractClassError(); - } - - _mimeTypes = new []; - _extensions = new []; - } - - /** Returns 'true' if this factory can handle the given reference. The default - * implementation checks if extension and/or mime type of the reference match those - * of the factory. */ - public function canHandle(reference:AssetReference):Boolean - { - var mimeType:String = reference.mimeType; - var extension:String = reference.extension; - - return reference.data is ByteArray && ( - (mimeType && _mimeTypes.indexOf(reference.mimeType.toLowerCase()) != -1) || - (extension && _extensions.indexOf(reference.extension.toLowerCase()) != -1)); - } - - /** This method will only be called if 'canHandle' returned 'true' for the given reference. - * It's responsible for creating at least one concrete asset and passing it to 'onComplete'. - * - * @param reference The asset to be created. If a local or remote URL is referenced, - * it will already have been loaded, and 'data' will contain a ByteArray. - * @param helper Contains useful utility methods to be used by the factory. Look - * at the class documentation for more information. - * @param onComplete To be called when loading is successful. 'type' parameter is optional. - *
function(name:String, asset:Object, type:String):void;
- * @param onError To be called when creation fails for some reason. Do not call - * 'onComplete' when that happens.
function(error:String):void
- */ - public function create(reference:AssetReference, helper:AssetFactoryHelper, - onComplete:Function, onError:Function):void - { - // to be implemented by subclasses - } - - /** Add one or more mime types that identify the supported data types. Used by - * 'canHandle' to figure out if the factory is suitable for an asset reference. */ - public function addMimeTypes(...args):void - { - for each (var mimeType:String in args) - { - mimeType = mimeType.toLowerCase(); - - if (_mimeTypes.indexOf(mimeType) == -1) - _mimeTypes[_mimeTypes.length] = mimeType; - } - } - - /** Add one or more file extensions (without leading dot) that identify the supported data - * types. Used by 'canHandle' to figure out if the factory is suitable for an asset - * reference. */ - public function addExtensions(...args):void - { - for each (var extension:String in args) - { - extension = extension.toLowerCase(); - - if (_extensions.indexOf(extension) == -1) - _extensions[_extensions.length] = extension; - } - } - - /** Returns the mime types this factory supports. */ - public function getMimeTypes(out:Vector.=null):Vector. - { - out ||= new Vector.(); - - for (var i:int=0; i<_mimeTypes.length; ++i) - out[i] = _mimeTypes[i]; - - return out; - } - - /** Returns the file extensions this factory supports. */ - public function getExtensions(out:Vector.=null):Vector. - { - out ||= new Vector.(); - - for (var i:int=0; i<_extensions.length; ++i) - out[i] = _extensions[i]; - - return out; - } - - /** @private */ - internal function get priority():int { return _priority; } - internal function set priority(value:int):void { _priority = value; } - } -} diff --git a/mobile_version/src/starling/assets/AssetFactoryHelper.as b/mobile_version/src/starling/assets/AssetFactoryHelper.as deleted file mode 100644 index 6c8b57ea..00000000 --- a/mobile_version/src/starling/assets/AssetFactoryHelper.as +++ /dev/null @@ -1,124 +0,0 @@ -package starling.assets -{ - import starling.utils.SystemUtil; - - /** A helper class that's passed to an AssetFactory's "create" method. */ - public class AssetFactoryHelper - { - private var _dataLoader:DataLoader; - private var _getNameFromUrlFunc:Function; - private var _getExtensionFromUrlFunc:Function; - private var _addPostProcessorFunc:Function; - private var _addAssetFunc:Function; - private var _onRestoreFunc:Function; - private var _logFunc:Function; - - /** @private */ - public function AssetFactoryHelper() - { } - - /** Forwarded to the AssetManager's method with the same name. */ - public function getNameFromUrl(url:String):String - { - if (_getNameFromUrlFunc != null) return _getNameFromUrlFunc(url); - else return ""; - } - - /** Forwarded to the AssetManager's method with the same name. */ - public function getExtensionFromUrl(url:String):String - { - if (_getExtensionFromUrlFunc != null) return _getExtensionFromUrlFunc(url); - else return ""; - } - - /** Accesses a URL (local or remote) and passes the loaded ByteArray to the - * 'onComplete' callback - or executes 'onError' when the data can't be loaded. - * - * @param url a string containing an URL. - * @param onComplete function(data:ByteArray, mimeType:String):void; - * @param onError function(error:String):void; - */ - public function loadDataFromUrl(url:String, onComplete:Function, onError:Function):void - { - if (_dataLoader) _dataLoader.load(url, onComplete, onError); - } - - /** Adds a method to be called by the AssetManager when the queue has finished processing. - * Useful e.g. if assets depend on other assets (like an atlas XML depending on the atlas - * texture). - * - * @param processor function(manager:AssetManager):void; - * @param priority Processors with a higher priority will be called first. - * The default processor for texture atlases is called with a - * priority of '100', others with '0'. - */ - public function addPostProcessor(processor:Function, priority:int=0):void - { - if (_addPostProcessorFunc != null) _addPostProcessorFunc(processor, priority); - } - - /** Textures are required to call this method when they begin their restoration process - * after a context loss. */ - public function onBeginRestore():void - { - if (_onRestoreFunc != null) _onRestoreFunc(false); - } - - /** Textures are required to call this method when they have finished their restoration - * process after a context loss. */ - public function onEndRestore():void - { - if (_onRestoreFunc != null) _onRestoreFunc(true); - } - - /** Forwarded to the AssetManager's method with the same name. */ - public function log(message:String):void - { - if (_logFunc != null) _logFunc(message); - } - - /** Adds additional assets to the AssetManager. To be called when the factory - * creates more than one asset. */ - public function addComplementaryAsset(name:String, asset:Object, type:String=null):void - { - if (_addAssetFunc != null) _addAssetFunc(name, asset, type); - } - - /** Delay the execution of 'call' until it's allowed. (On mobile, the context - * may not be accessed while the application is in the background.) - */ - public function executeWhenContextReady(call:Function, ...args):void - { - // On mobile, it is not allowed / endorsed to make stage3D calls while the app - // is in the background. Thus, we pause execution if that's the case. - - if (SystemUtil.isDesktop) call.apply(this, args); - else - { - args.unshift(call); - SystemUtil.executeWhenApplicationIsActive.apply(this, args); - } - } - - /** @private */ - internal function set getNameFromUrlFunc(value:Function):void { _getNameFromUrlFunc = value; } - - /** @private */ - internal function set getExtensionFromUrlFunc(value:Function):void { _getExtensionFromUrlFunc = value; } - - /** @private */ - internal function set dataLoader(value:DataLoader):void { _dataLoader = value; } - - /** @private */ - internal function set logFunc(value:Function):void { _logFunc = value; } - - /** @private */ - internal function set addAssetFunc(value:Function):void { _addAssetFunc = value; } - - /** @private */ - internal function set onRestoreFunc(value:Function):void { _onRestoreFunc = value; } - - /** @private */ - internal function set addPostProcessorFunc(value:Function):void { _addPostProcessorFunc = value; } - } -} diff --git a/mobile_version/src/starling/assets/AssetManager.as b/mobile_version/src/starling/assets/AssetManager.as deleted file mode 100644 index 44541910..00000000 --- a/mobile_version/src/starling/assets/AssetManager.as +++ /dev/null @@ -1,1034 +0,0 @@ -package starling.assets -{ - import flash.media.Sound; - import flash.media.SoundChannel; - import flash.media.SoundTransform; - import flash.net.URLRequest; - import flash.system.System; - import flash.utils.ByteArray; - import flash.utils.Dictionary; - import flash.utils.describeType; - import flash.utils.getQualifiedClassName; - import flash.utils.setTimeout; - - import starling.core.Starling; - import starling.events.Event; - import starling.events.EventDispatcher; - import starling.text.BitmapFont; - import starling.textures.Texture; - import starling.textures.TextureAtlas; - import starling.textures.TextureOptions; - import starling.utils.MathUtil; - import starling.utils.execute; - - /** Dispatched when all textures have been restored after a context loss. */ - [Event(name="texturesRestored", type="starling.events.Event")] - - /** The AssetManager handles loading and accessing a variety of asset types. You can - * add assets directly (via the 'add...' methods) or asynchronously via a queue. This allows - * you to deal with assets in a unified way, no matter if they are loaded from a file, - * directory, URL, or from an embedded object. - * - *

The class can deal with the following media types: - *

    - *
  • Textures (either from Bitmaps or ATF data)
  • - *
  • Texture atlases
  • - *
  • Bitmap Fonts
  • - *
  • Sounds
  • - *
  • XML data
  • - *
  • JSON data
  • - *
  • ByteArrays
  • - *
  • other AssetManagers
  • - *
- *

- * - *

For more information on how to add assets from different sources, read the documentation - * of the "enqueue()" method.

- * - * Context Loss - * - *

When the stage3D context is lost, the AssetManager will automatically restore all - * loaded textures. To save memory, it will get them from their original sources. Since - * this is done asynchronously, your images might not reappear all at once, but during - * a time frame of several seconds. If you want, you can pause your game during that time; - * the AssetManager dispatches an "Event.TEXTURES_RESTORED" event when all textures have - * been restored.

- * - * Error Handling - * - *

Loading of some assets may fail while the queue is being processed. In that case, the - * AssetManager will call the 'onError' callback that you can optional provide to the - * 'loadQueue' method. Queue processing will continue after an error, so it's always - * guaranteed that the 'onComplete' callback is executed, too.

- * - * Texture Properties - * - *

When you enqueue a texture, its properties for "format", "scale", "mipMapping", and - * "repeat" will reflect the settings of the AssetManager at the time they were enqueued. - * This means that you can enqueue a bunch of textures, then change the settings and enqueue - * some more. Like this:

- * - * - * var appDir:File = File.applicationDirectory; - * var assets:AssetManager = new AssetManager(); - * - * assets.textureOptions.format = Context3DTextureFormat.BGRA; - * assets.enqueue(appDir.resolvePath("textures/32bit")); - * - * assets.textureOptions.format = Context3DTextureFormat.BGRA_PACKED; - * assets.enqueue(appDir.resolvePath("textures/16bit")); - * - * assets.loadQueue(...); - * - * Nesting - * - *

When you enqueue one or more AssetManagers to another one, the "loadQueue" method will - * load the assets of the "child" AssetManager, as well. Later, when accessing assets, - * the "parent" AssetManager will return the "child" assets as well - just like it returns, - * say, the SubTextures from a contained TextureAtlas.

- * - *

The main advantage of grouping your assets like this is something else, though: it - * allows to remove (and dispose) a complete group of assets in one step. The example - * below loads the assets from two directories. When the contents of one of them are no - * longer needed, all its assets are removed together.

- * - * - * var manager:AssetManager = new AssetManager(); - * var appDir:File = File.applicationDirectory; - * - * var redAssets:AssetManager = new AssetManager(); - * redAssets.enqueueSingle(appDir.resolvePath("textures/red/")); - * - * var greenAssets:AssetManager = new AssetManager(); - * greenAssets.enqueueSingle(appDir.resolvePath("textures/green/")); - * - * manager.enqueueSingle(redAssets, "redAssets"); - * manager.enqueueSingle(greenAssets, "greenAssets"); - * manager.loadQueue(...); // loads both "red" and "green" assets - * - * // ... later, remove all "red" assets together - * manager.removeAssetManager("redAssets"); - * - * Customization - * - *

You can customize how assets are created by extending the 'AssetFactory' class and - * registering an instance of your new class at the AssetManager via 'registerFactory'. - * Factories are probed by priority; any factory with a priority > 0 will be executed - * before the built-in factories.

- * - *

An asset type is identified by a unique String. You can add your own asset types - * by creating a custom 'AssetFactory' and having it add the asset with custom string - * identifier.

- * - *

By overriding the methods 'getNameFromUrl', 'getExtensionFromUrl', 'disposeAsset', - * and 'log', you can customize how assets are named and disposed, and you can forward - * any logging to an external logger. To customize the way data is loaded from URLs or - * files, you can assign a custom 'DataLoader' instance to the AssetManager.

- * - * @see starling.assets.AssetFactory - * @see starling.assets.AssetType - * @see starling.assets.DataLoader - */ - public class AssetManager extends EventDispatcher - { - private var _starling:Starling; - private var _assets:Dictionary; - private var _verbose:Boolean; - private var _numConnections:int; - private var _dataLoader:DataLoader; - private var _textureOptions:TextureOptions; - private var _queue:Vector.; - private var _registerBitmapFontsWithFontFace:Boolean; - private var _assetFactories:Vector.; - private var _numRestoredTextures:int; - private var _numLostTextures:int; - - // Regex for name / extension extraction from URLs. - private static const NAME_REGEX:RegExp = /(([^?\/\\]+?)(?:\.([\w\-]+))?)(?:\?.*)?$/; - - // fallback for unnamed assets - private static const NO_NAME:String = "unnamed"; - private static var sNoNameCount:int = 0; - - // helper objects - private static var sNames:Vector. = new []; - - /** Create a new instance with the given scale factor. */ - public function AssetManager(scaleFactor:Number=1) - { - _assets = new Dictionary(); - _verbose = true; - _textureOptions = new TextureOptions(scaleFactor); - _queue = new []; - _numConnections = 3; - _dataLoader = new DataLoader(); - _assetFactories = new []; - - registerFactory(new BitmapTextureFactory()); - registerFactory(new AtfTextureFactory()); - registerFactory(new SoundFactory()); - registerFactory(new JsonFactory()); - registerFactory(new XmlFactory()); - registerFactory(new ByteArrayFactory(), -100); - } - - /** Disposes all assets and purges the queue. - * - *

Beware that all references to the assets will remain intact, even though the assets - * are no longer valid. Call 'purge' if you want to remove all resources and reuse - * the AssetManager later.

- */ - public function dispose():void - { - purgeQueue(); - - for each (var store:Dictionary in _assets) - for each (var asset:Object in store) - disposeAsset(asset); - } - - /** Removes assets of all types (disposing them along the way), empties the queue and - * aborts any pending load operations. */ - public function purge():void - { - log("Purging all assets, emptying queue"); - - purgeQueue(); - dispose(); - - _assets = new Dictionary(); - } - - // queue processing - - /** Enqueues one or more raw assets; they will only be available after successfully - * executing the "loadQueue" method. This method accepts a variety of different objects: - * - *
    - *
  • Strings or URLRequests containing an URL to a local or remote resource. Supported - * types: png, jpg, gif, atf, mp3, xml, fnt, json, binary.
  • - *
  • Instances of the File class (AIR only) pointing to a directory or a file. - * Directories will be scanned recursively for all supported types.
  • - *
  • Classes that contain static embedded assets.
  • - *
  • If the file extension is not recognized, the data is analyzed to see if - * contains XML or JSON data. If it's neither, it is stored as ByteArray.
  • - *
- * - *

Suitable object names are extracted automatically: A file named "image.png" will be - * accessible under the name "image". When enqueuing embedded assets via a class, - * the variable name of the embedded object will be used as its name. An exception - * are texture atlases: they will have the same name as the actual texture they are - * referencing.

- * - *

XMLs are made available via "getXml()"; this includes XMLs containing texture - * atlases or bitmap fonts, which are processed along the way. Bitmap fonts are also - * registered at the TextField class.

- * - *

If you pass in JSON data, it will be parsed into an object and will be available via - * "getObject()".

- */ - public function enqueue(...assets):void - { - for each (var asset:Object in assets) - { - if (asset is Array) - { - enqueue.apply(this, asset); - } - else if (asset is Class) - { - var typeXml:XML = describeType(asset); - var childNode:XML; - - if (_verbose) - log("Looking for static embedded assets in '" + - (typeXml.@name).split("::").pop() + "'"); - - for each (childNode in typeXml.constant.(@type == "Class")) - enqueueSingle(asset[childNode.@name], childNode.@name); - - for each (childNode in typeXml.variable.(@type == "Class")) - enqueueSingle(asset[childNode.@name], childNode.@name); - } - else if (getQualifiedClassName(asset) == "flash.filesystem::File") - { - if (!asset["exists"]) - { - log("File or directory not found: '" + asset["url"] + "'"); - } - else if (!asset["isHidden"]) - { - if (asset["isDirectory"]) - enqueue.apply(this, asset["getDirectoryListing"]()); - else - enqueueSingle(asset); - } - } - else if (asset is String || asset is URLRequest || asset is AssetManager) - { - enqueueSingle(asset); - } - else - { - log("Ignoring unsupported asset type: " + getQualifiedClassName(asset)); - } - } - } - - /** Enqueues a single asset with a custom name that can be used to access it later. - * If the asset is a texture, you can also add custom texture options. - * - * @param asset The asset that will be enqueued; accepts the same objects as the - * 'enqueue' method. - * @param name The name under which the asset will be found later. If you pass null or - * omit the parameter, it's attempted to generate a name automatically. - * @param options Custom options that will be used if 'asset' points to texture data. - * @return the name with which the asset was registered. - */ - public function enqueueSingle(asset:Object, name:String=null, - options:TextureOptions=null):String - { - if (asset is Class) - asset = new asset(); - - var assetReference:AssetReference = new AssetReference(asset); - assetReference.name = name || getNameFromUrl(assetReference.url) || getUniqueName(); - assetReference.extension = getExtensionFromUrl(assetReference.url); - assetReference.textureOptions = options || _textureOptions; - var logName:String = getFilenameFromUrl(assetReference.url) || assetReference.name; - - _queue.push(assetReference); - log("Enqueuing '" + logName + "'"); - return assetReference.name; - } - - /** Removes the asset(s) with the given name(s) from the queue. Note that this won't work - * after loading has started, even if these specific assets have not yet been processed. */ - public function dequeue(...assetNames):void - { - _queue = _queue.filter(function(asset:AssetReference, i:int, v:*):Boolean - { - return assetNames.indexOf(asset.name) == -1; - }); - } - - /** Empties the queue and aborts any pending load operations. */ - public function purgeQueue():void - { - _queue.length = 0; - _dataLoader.close(); - dispatchEventWith(Event.CANCEL); - } - - /** Loads all enqueued assets asynchronously. The 'onComplete' callback will be executed - * once all assets have been loaded - even when there have been errors, which are - * forwarded to the optional 'onError' callback. The 'onProgress' function will be called - * with a 'ratio' between '0.0' and '1.0' and is also optional. Furthermore, all - * parameters of all the callbacks are optional. - * - *

When you call this method, the manager will save a reference to "Starling.current"; - * all textures that are loaded will be accessible only from within this instance. Thus, - * if you are working with more than one Starling instance, be sure to call - * "makeCurrent()" on the appropriate instance before processing the queue.

- * - * @param onComplete function(manager:AssetManager):void; - * @param onError function(error:String, asset:AssetReference):void; - * @param onProgress function(ratio:Number):void; - */ - public function loadQueue(onComplete:Function, - onError:Function=null, onProgress:Function=null):void - { - if (_queue.length == 0) - { - finish(); - return; - } - - // By using an event listener, we can make a call to "cancel" affect - // only the currently active loading process(es). - addEventListener(Event.CANCEL, onCanceled); - - var factoryHelper:AssetFactoryHelper = new AssetFactoryHelper(); - factoryHelper.getNameFromUrlFunc = getNameFromUrl; - factoryHelper.getExtensionFromUrlFunc = getExtensionFromUrl; - factoryHelper.addPostProcessorFunc = addPostProcessor; - factoryHelper.addAssetFunc = addAsset; - factoryHelper.onRestoreFunc = onAssetRestored; - factoryHelper.dataLoader = _dataLoader; - factoryHelper.logFunc = log; - - var i:int; - var self:AssetManager = this; - var canceled:Boolean = false; - var queue:Vector. = _queue.concat(); - var numAssets:int = queue.length; - var numComplete:int = 0; - var numConnections:int = MathUtil.min(_numConnections, numAssets); - var assetProgress:Vector. = new Vector.(numAssets, true); - var postProcessors:Vector. = new []; - - _starling = Starling.current; - _queue.length = 0; - - for (i=0; i, progressRatios:Vector., index:int, - helper:AssetFactoryHelper, onComplete:Function, onProgress:Function, - onError:Function, onIntermediateError:Function):void - { - var referenceCount:int = queue.length; - var reference:AssetReference = queue[index]; - progressRatios[index] = 0; - - if (reference.url) - _dataLoader.load(reference.url, onLoadComplete, onLoadError, onLoadProgress); - else if (reference.data is AssetManager) - (reference.data as AssetManager).loadQueue(onManagerComplete, onIntermediateError, onLoadProgress); - else - setTimeout(onLoadComplete, 1, reference.data); - - function onLoadComplete(data:Object, mimeType:String=null, - name:String=null, extension:String=null):void - { - if (_starling) _starling.makeCurrent(); - - onLoadProgress(1.0); - - if (data) reference.data = data; - if (name) reference.name = name; - if (extension) reference.extension = extension; - if (mimeType) reference.mimeType = mimeType; - - var assetFactory:AssetFactory = getFactoryFor(reference); - if (assetFactory == null) - execute(onAnyError, "Warning: no suitable factory found for '" + reference.name + "'"); - else - assetFactory.create(reference, helper, onComplete, onFactoryError); - } - - function onLoadProgress(ratio:Number):void - { - progressRatios[index] = ratio; - - var totalRatio:Number = 0; - var multiplier:Number = 1.0 / referenceCount; - - for (var k:int=0; k 0) totalRatio += multiplier * r; - } - - execute(onProgress, MathUtil.min(totalRatio, 1.0)); - } - - function onLoadError(error:String):void - { - onLoadProgress(1.0); - execute(onAnyError, "Error loading " + reference.name + ": " + error); - } - - function onAnyError(error:String):void - { - log(error); - execute(onError, error, reference); - } - - function onFactoryError(error:String):void - { - execute(onAnyError, "Error creating " + reference.name + ": " + error); - } - - function onManagerComplete():void - { - onComplete(reference.name, reference.data); - } - } - - private function getFactoryFor(asset:AssetReference):AssetFactory - { - var numFactories:int = _assetFactories.length; - for (var i:int=0; iBeware: if the slot (name + type) was already taken, the existing object will be - * disposed and replaced by the new one.

- * - * @param name The name with which the asset can be retrieved later. Must be - * unique within this asset type. - * @param asset The actual asset to add (e.g. a texture, a sound, etc). - * @param type The type of the asset. If omitted, the type will be determined - * automatically (which works for all standard types defined within - * the 'AssetType' class). - */ - public function addAsset(name:String, asset:Object, type:String=null):void - { - type ||= AssetType.fromAsset(asset); - - var store:Dictionary = _assets[type]; - if (store == null) - { - store = new Dictionary(); - _assets[type] = store; - } - - log("Adding " + type + " '" + name + "'"); - - var prevAsset:Object = store[name]; - if (prevAsset && prevAsset != asset) - { - log("Warning: name was already in use; disposing the previous " + type); - disposeAsset(prevAsset); - } - - store[name] = asset; - } - - /** Retrieves an asset of the given type, with the given name. If 'recursive' is true, - * the method will traverse included texture atlases and asset managers. - * - *

Typically, you will use one of the type-safe convenience methods instead, like - * 'getTexture', 'getSound', etc.

- */ - public function getAsset(type:String, name:String, recursive:Boolean=true):Object - { - if (recursive) - { - var managerStore:Dictionary = _assets[AssetType.ASSET_MANAGER]; - if (managerStore) - { - for each (var manager:AssetManager in managerStore) - { - var asset:Object = manager.getAsset(type, name, true); - if (asset) return asset; - } - } - - if (type == AssetType.TEXTURE) - { - var atlasStore:Dictionary = _assets[AssetType.TEXTURE_ATLAS]; - if (atlasStore) - { - for each (var atlas:TextureAtlas in atlasStore) - { - var texture:Texture = atlas.getTexture(name); - if (texture) return texture; - } - } - } - } - - var store:Dictionary = _assets[type]; - if (store) return store[name]; - else return null; - } - - /** Retrieves an alphabetically sorted list of all assets that have the given type and - * start with the given prefix. If 'recursive' is true, the method will traverse included - * texture atlases and asset managers. */ - public function getAssetNames(assetType:String, prefix:String="", recursive:Boolean=true, - out:Vector.=null):Vector. - { - out ||= new Vector.(); - - if (recursive) - { - var managerStore:Dictionary = _assets[AssetType.ASSET_MANAGER]; - if (managerStore) - { - for each (var manager:AssetManager in managerStore) - manager.getAssetNames(assetType, prefix, true, out); - } - - if (assetType == AssetType.TEXTURE) - { - var atlasStore:Dictionary = _assets[AssetType.TEXTURE_ATLAS]; - if (atlasStore) - { - for each (var atlas:TextureAtlas in atlasStore) - atlas.getNames(prefix, out); - } - } - } - - getDictionaryKeys(_assets[assetType], prefix, out); - out.sort(Array.CASEINSENSITIVE); - return out; - } - - /** Removes the asset with the given name and type, and will optionally dispose it. */ - public function removeAsset(assetType:String, name:String, dispose:Boolean=true):void - { - var store:Dictionary = _assets[assetType]; - if (store) - { - var asset:Object = store[name]; - if (asset) - { - log("Removing " + assetType + " '" + name + "'"); - if (dispose) disposeAsset(asset); - delete store[name]; - } - } - } - - // convenience access methods - - /** Returns a texture with a certain name. Includes textures stored inside atlases. */ - public function getTexture(name:String):Texture - { - return getAsset(AssetType.TEXTURE, name) as Texture; - } - - /** Returns all textures that start with a certain string, sorted alphabetically - * (especially useful for "MovieClip"). Includes textures stored inside atlases. */ - public function getTextures(prefix:String="", out:Vector.=null):Vector. - { - if (out == null) out = new []; - - for each (var name:String in getTextureNames(prefix, sNames)) - out[out.length] = getTexture(name); // avoid 'push' - - sNames.length = 0; - return out; - } - - /** Returns all texture names that start with a certain string, sorted alphabetically. - * Includes textures stored inside atlases. */ - public function getTextureNames(prefix:String="", out:Vector.=null):Vector. - { - return getAssetNames(AssetType.TEXTURE, prefix, true, out); - } - - /** Returns a texture atlas with a certain name, or null if it's not found. */ - public function getTextureAtlas(name:String):TextureAtlas - { - return getAsset(AssetType.TEXTURE_ATLAS, name) as TextureAtlas; - } - - /** Returns all texture atlas names that start with a certain string, sorted alphabetically. - * If you pass an out-vector, the names will be added to that vector. */ - public function getTextureAtlasNames(prefix:String="", out:Vector.=null):Vector. - { - return getAssetNames(AssetType.TEXTURE_ATLAS, prefix, true, out); - } - - /** Returns a sound with a certain name, or null if it's not found. */ - public function getSound(name:String):Sound - { - return getAsset(AssetType.SOUND, name) as Sound; - } - - /** Returns all sound names that start with a certain string, sorted alphabetically. - * If you pass an out-vector, the names will be added to that vector. */ - public function getSoundNames(prefix:String="", out:Vector.=null):Vector. - { - return getAssetNames(AssetType.SOUND, prefix, true, out); - } - - /** Generates a new SoundChannel object to play back the sound. This method returns a - * SoundChannel object, which you can access to stop the sound and to control volume. */ - public function playSound(name:String, startTime:Number=0, loops:int=0, - transform:SoundTransform=null):SoundChannel - { - var sound:Sound = getSound(name); - if (sound) return sound.play(startTime, loops, transform); - else return null; - } - - /** Returns an XML with a certain name, or null if it's not found. */ - public function getXml(name:String):XML - { - return getAsset(AssetType.XML_DOCUMENT, name) as XML; - } - - /** Returns all XML names that start with a certain string, sorted alphabetically. - * If you pass an out-vector, the names will be added to that vector. */ - public function getXmlNames(prefix:String="", out:Vector.=null):Vector. - { - return getAssetNames(AssetType.XML_DOCUMENT, prefix, true, out); - } - - /** Returns an object with a certain name, or null if it's not found. Enqueued JSON - * data is parsed and can be accessed with this method. */ - public function getObject(name:String):Object - { - return getAsset(AssetType.OBJECT, name); - } - - /** Returns all object names that start with a certain string, sorted alphabetically. - * If you pass an out-vector, the names will be added to that vector. */ - public function getObjectNames(prefix:String="", out:Vector.=null):Vector. - { - return getAssetNames(AssetType.OBJECT, prefix, true, out); - } - - /** Returns a byte array with a certain name, or null if it's not found. */ - public function getByteArray(name:String):ByteArray - { - return getAsset(AssetType.BYTE_ARRAY, name) as ByteArray; - } - - /** Returns all byte array names that start with a certain string, sorted alphabetically. - * If you pass an out-vector, the names will be added to that vector. */ - public function getByteArrayNames(prefix:String="", out:Vector.=null):Vector. - { - return getAssetNames(AssetType.BYTE_ARRAY, prefix, true, out); - } - - /** Returns a bitmap font with a certain name, or null if it's not found. */ - public function getBitmapFont(name:String):BitmapFont - { - return getAsset(AssetType.BITMAP_FONT, name) as BitmapFont; - } - - /** Returns all bitmap font names that start with a certain string, sorted alphabetically. - * If you pass an out-vector, the names will be added to that vector. */ - public function getBitmapFontNames(prefix:String="", out:Vector.=null):Vector. - { - return getAssetNames(AssetType.BITMAP_FONT, prefix, true, out); - } - - /** Returns an asset manager with a certain name, or null if it's not found. */ - public function getAssetManager(name:String):AssetManager - { - return getAsset(AssetType.ASSET_MANAGER, name) as AssetManager; - } - - /** Returns all asset manager names that start with a certain string, sorted alphabetically. - * If you pass an out-vector, the names will be added to that vector. */ - public function getAssetManagerNames(prefix:String="", out:Vector.=null):Vector. - { - return getAssetNames(AssetType.ASSET_MANAGER, prefix, true, out); - } - - /** Removes a certain texture, optionally disposing it. */ - public function removeTexture(name:String, dispose:Boolean=true):void - { - removeAsset(AssetType.TEXTURE, name, dispose); - } - - /** Removes a certain texture atlas, optionally disposing it. */ - public function removeTextureAtlas(name:String, dispose:Boolean=true):void - { - removeAsset(AssetType.TEXTURE_ATLAS, name, dispose); - } - - /** Removes a certain sound. */ - public function removeSound(name:String):void - { - removeAsset(AssetType.SOUND, name); - } - - /** Removes a certain Xml object, optionally disposing it. */ - public function removeXml(name:String, dispose:Boolean=true):void - { - removeAsset(AssetType.XML_DOCUMENT, name, dispose); - } - - /** Removes a certain object. */ - public function removeObject(name:String):void - { - removeAsset(AssetType.OBJECT, name); - } - - /** Removes a certain byte array, optionally disposing its memory right away. */ - public function removeByteArray(name:String, dispose:Boolean=true):void - { - removeAsset(AssetType.BYTE_ARRAY, name, dispose); - } - - /** Removes a certain bitmap font, optionally disposing it. */ - public function removeBitmapFont(name:String, dispose:Boolean=true):void - { - removeAsset(AssetType.BITMAP_FONT, name, dispose); - } - - /** Removes a certain asset manager and optionally disposes it right away. */ - public function removeAssetManager(name:String, dispose:Boolean=true):void - { - removeAsset(AssetType.ASSET_MANAGER, name, dispose); - } - - // registration of factories - - /** Registers a custom AssetFactory. If you use any priority > 0, the factory will - * be called before the default factories. The final factory to be invoked is the - * 'ByteArrayFactory', which is using a priority of '-100'. */ - public function registerFactory(factory:AssetFactory, priority:int=0):void - { - factory.priority = priority; - - _assetFactories.push(factory); - _assetFactories.sort(comparePriorities); - } - - /** Unregisters the specified AssetFactory. */ - public function unregisterFactory(factory:AssetFactory):void - { - var index:int = _assetFactories.indexOf(factory); - if (index != -1) _assetFactories.removeAt(index); - } - - private static function comparePriorities(a:Object, b:Object):int - { - if (a.priority == b.priority) return 0; - return a.priority > b.priority ? -1 : 1; - } - - // helpers - - private function getFilenameFromUrl(url:String):String - { - if (url) - { - var matches:Array = NAME_REGEX.exec(decodeURIComponent(url)); - if (matches && matches.length > 1) return matches[1]; - } - return null; - } - - /** This method is called internally to determine the name under which an asset will be - * accessible; override it if you need a custom naming scheme. - * - * @return the name to be used for the asset, or 'null' if it can't be determined. */ - protected function getNameFromUrl(url:String):String - { - if (url) - { - var matches:Array = NAME_REGEX.exec(decodeURIComponent(url)); - if (matches && matches.length > 2) return matches[2]; - } - return null; - } - - /** This method is called internally to determine the extension that's passed to the - * 'AssetFactory' (via the 'AssetReference'). Override it if you need to customize - * e.g. the extension of a server URL. - * - * @return the extension to be used for the asset, or an empty string if it can't be - * determined. */ - protected function getExtensionFromUrl(url:String):String - { - if (url) - { - var matches:Array = NAME_REGEX.exec(decodeURIComponent(url)); - if (matches && matches.length > 3) return matches[3]; - } - return ""; - } - - /** Disposes the given asset. ByteArrays are cleared, XMLs are disposed using - * 'System.disposeXML'. If the object contains a 'dispose' method, it will be called. - * Override if you need to add custom cleanup code for a certain asset. */ - protected function disposeAsset(asset:Object):void - { - if (asset is ByteArray) (asset as ByteArray).clear(); - if (asset is XML) System.disposeXML(asset as XML); - if ("dispose" in asset) asset["dispose"](); - } - - /** This method is called during loading of assets when 'verbose' is activated. Per - * default, it traces 'message' to the console. */ - protected function log(message:String):void - { - if (_verbose) trace("[AssetManager]", message); - } - - private static function getDictionaryKeys(dictionary:Dictionary, prefix:String="", - out:Vector.=null):Vector. - { - if (out == null) out = new []; - if (dictionary) - { - for (var name:String in dictionary) - if (name.indexOf(prefix) == 0) - out[out.length] = name; // avoid 'push' - - out.sort(Array.CASEINSENSITIVE); - } - return out; - } - - private static function getUniqueName():String - { - return NO_NAME + "-" + sNoNameCount++; - } - - // properties - - /** When activated, the class will trace information about added/enqueued assets. - * @default true */ - public function get verbose():Boolean { return _verbose; } - public function set verbose(value:Boolean):void { _verbose = value; } - - /** Returns the number of raw assets that have been enqueued, but not yet loaded. */ - public function get numQueuedAssets():int { return _queue.length; } - - /** The maximum number of parallel connections that are spawned when loading the queue. - * More connections can reduce loading times, but require more memory. @default 3. */ - public function get numConnections():int { return _numConnections; } - public function set numConnections(value:int):void - { - _numConnections = MathUtil.min(1, value); - } - - /** Textures will be created with the options set up in this object at the time of - * enqueuing. */ - public function get textureOptions():TextureOptions { return _textureOptions; } - public function set textureOptions(value:TextureOptions):void { _textureOptions.copyFrom(value); } - - /** The DataLoader is used to load any data from files or URLs. If you need to customize - * its behavior (e.g. to add a caching mechanism), assign your custom instance here. */ - public function get dataLoader():DataLoader { return _dataLoader; } - public function set dataLoader(value:DataLoader):void { _dataLoader = value; } - - /** Indicates if bitmap fonts should be registered with their "face" attribute from the - * font XML file. Per default, they are registered with the name of the texture file. - * @default false */ - public function get registerBitmapFontsWithFontFace():Boolean - { - return _registerBitmapFontsWithFontFace; - } - - public function set registerBitmapFontsWithFontFace(value:Boolean):void - { - _registerBitmapFontsWithFontFace = value; - } - } -} - -import starling.assets.AssetManager; - -class AssetPostProcessor -{ - private var _priority:int; - private var _callback:Function; - - public function AssetPostProcessor(callback:Function, priority:int) - { - if (callback == null || callback.length != 1) - throw new ArgumentError("callback must be a function " + - "accepting one 'AssetStore' parameter"); - - _callback = callback; - _priority = priority; - } - - internal function execute(store:AssetManager):void - { - _callback(store); - } - - public function get priority():int { return _priority; } -} \ No newline at end of file diff --git a/mobile_version/src/starling/assets/AssetReference.as b/mobile_version/src/starling/assets/AssetReference.as deleted file mode 100644 index d978f100..00000000 --- a/mobile_version/src/starling/assets/AssetReference.as +++ /dev/null @@ -1,56 +0,0 @@ -package starling.assets -{ - import starling.textures.TextureOptions; - - /** The description of an asset to be created by an AssetFactory. */ - public class AssetReference - { - private var _name:String; - private var _url:String; - private var _data:Object; - private var _mimeType:String; - private var _extension:String; - private var _textureOptions:TextureOptions; - - /** Creates a new instance with the given data, which is typically some kind of file - * reference / URL or an instance of an asset class. If 'data' contains an URL, an - * equivalent value will be assigned to the 'url' property. */ - public function AssetReference(data:Object) - { - _data = data; - _textureOptions = new TextureOptions(); - - if (data is String) _url = data as String; - else if ("url" in data) _url = data["url"] as String; - } - - /** The name with which the asset should be added to the AssetManager. */ - public function get name():String { return _name; } - public function set name(value:String):void { _name = value; } - - /** The url from which the asset needs to be / has been loaded. */ - public function get url():String { return _url; } - public function set url(value:String):void { _url = value; } - - /** The raw data of the asset. This property often contains an URL; when it's passed - * to an AssetFactory, loading has already completed, and the property contains a - * ByteArray with the loaded data. */ - public function get data():Object { return _data; } - public function set data(value:Object):void { _data = value; } - - /** The mime type of the asset, if loaded from a server. */ - public function get mimeType():String { return _mimeType; } - public function set mimeType(value:String):void { _mimeType = value; } - - /** The file extension of the asset, if the filename or URL contains one. */ - public function get extension():String { return _extension; } - public function set extension(value:String):void { _extension = value; } - - /** The TextureOptions describing how to create a texture, if the asset references one. */ - public function get textureOptions():TextureOptions { return _textureOptions; } - public function set textureOptions(value:TextureOptions):void - { - _textureOptions.copyFrom(value); - } - } -} diff --git a/mobile_version/src/starling/assets/AssetType.as b/mobile_version/src/starling/assets/AssetType.as deleted file mode 100644 index 68631d28..00000000 --- a/mobile_version/src/starling/assets/AssetType.as +++ /dev/null @@ -1,40 +0,0 @@ -package starling.assets -{ - import flash.media.Sound; - import flash.media.Video; - import flash.utils.ByteArray; - - import starling.errors.AbstractClassError; - import starling.text.BitmapFont; - import starling.textures.Texture; - import starling.textures.TextureAtlas; - - /** An enumeration class containing all the asset types supported by the AssetManager. */ - public class AssetType - { - /** @private */ - public function AssetType() { throw new AbstractClassError(); } - - public static const TEXTURE:String = "texture"; - public static const TEXTURE_ATLAS:String = "textureAtlas"; - public static const SOUND:String = "sound"; - public static const XML_DOCUMENT:String = "xml"; - public static const OBJECT:String = "object"; - public static const BYTE_ARRAY:String = "byteArray"; - public static const BITMAP_FONT:String = "bitmapFont"; - public static const ASSET_MANAGER:String = "assetManager"; - - /** Figures out the asset type string from the type of the given instance. */ - public static function fromAsset(asset:Object):String - { - if (asset is Texture) return TEXTURE; - else if (asset is TextureAtlas) return TEXTURE_ATLAS; - else if (asset is Sound) return SOUND; - else if (asset is XML) return XML_DOCUMENT; - else if (asset is ByteArray) return BYTE_ARRAY; - else if (asset is BitmapFont) return BITMAP_FONT; - else if (asset is AssetManager) return ASSET_MANAGER; - else return OBJECT; - } - } -} diff --git a/mobile_version/src/starling/assets/AtfTextureFactory.as b/mobile_version/src/starling/assets/AtfTextureFactory.as deleted file mode 100644 index 9e587170..00000000 --- a/mobile_version/src/starling/assets/AtfTextureFactory.as +++ /dev/null @@ -1,73 +0,0 @@ -package starling.assets -{ - import flash.utils.ByteArray; - - import starling.textures.AtfData; - import starling.textures.Texture; - import starling.utils.execute; - - /** This AssetFactory creates texture assets from ATF files. */ - public class AtfTextureFactory extends AssetFactory - { - /** Creates a new instance. */ - public function AtfTextureFactory() - { - addExtensions("atf"); // not used, actually, since we can parse the ATF header, anyway. - } - - /** @inheritDoc */ - override public function canHandle(reference:AssetReference):Boolean - { - return (reference.data is ByteArray && AtfData.isAtfData(reference.data as ByteArray)); - } - - /** @inheritDoc */ - override public function create(reference:AssetReference, helper:AssetFactoryHelper, - onComplete:Function, onError:Function):void - { - helper.executeWhenContextReady(createTexture); - - function createTexture():void - { - var onReady:Function = reference.textureOptions.onReady as Function; - reference.textureOptions.onReady = function():void - { - execute(onReady, texture); - onComplete(reference.name, texture); - }; - - var texture:Texture = null; - var url:String = reference.url; - - try { texture = Texture.fromData(reference.data, reference.textureOptions); } - catch (e:Error) { onError(e.message); } - - if (url && texture) - { - texture.root.onRestore = function():void - { - helper.onBeginRestore(); - helper.loadDataFromUrl(url, function(data:ByteArray):void - { - helper.executeWhenContextReady(function():void - { - try { texture.root.uploadAtfData(data); } - catch (e:Error) { helper.log("Texture restoration failed: " + e.message); } - - helper.onEndRestore(); - }); - }, onReloadError); - }; - } - - reference.data = null; // prevent closures from keeping reference - } - - function onReloadError(error:String):void - { - helper.log("Texture restoration failed for " + reference.url + ". " + error); - helper.onEndRestore(); - } - } - } -} diff --git a/mobile_version/src/starling/assets/BitmapTextureFactory.as b/mobile_version/src/starling/assets/BitmapTextureFactory.as deleted file mode 100644 index 24915e4e..00000000 --- a/mobile_version/src/starling/assets/BitmapTextureFactory.as +++ /dev/null @@ -1,167 +0,0 @@ -package starling.assets -{ - import flash.display.Bitmap; - import flash.display.BitmapData; - import flash.display.Loader; - import flash.display.LoaderInfo; - import flash.events.Event; - import flash.events.IOErrorEvent; - import flash.system.ImageDecodingPolicy; - import flash.system.LoaderContext; - import flash.utils.ByteArray; - - import starling.textures.Texture; - import starling.textures.TextureOptions; - import starling.utils.ByteArrayUtil; - import starling.utils.execute; - - /** This AssetFactory creates texture assets from bitmaps and image files. */ - public class BitmapTextureFactory extends AssetFactory - { - private static const MAGIC_NUMBERS_JPG:Array = [0xff, 0xd8]; - private static const MAGIC_NUMBERS_PNG:Array = [0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A]; - private static const MAGIC_NUMBERS_GIF:Array = [0x47, 0x49, 0x46, 0x38]; - - /** Creates a new instance. */ - public function BitmapTextureFactory() - { - addMimeTypes("image/png", "image/jpg", "image/jpeg", "image/gif"); - addExtensions("png", "jpg", "jpeg", "gif"); - } - - /** @inheritDoc */ - override public function canHandle(reference:AssetReference):Boolean - { - if (super.canHandle(reference) || - reference.data is Bitmap || reference.data is BitmapData) - { - return true; - } - else if (reference.data is ByteArray) - { - var byteData:ByteArray = reference.data as ByteArray; - return ByteArrayUtil.startsWithBytes(byteData, MAGIC_NUMBERS_PNG) || - ByteArrayUtil.startsWithBytes(byteData, MAGIC_NUMBERS_JPG) || - ByteArrayUtil.startsWithBytes(byteData, MAGIC_NUMBERS_GIF); - } - else return false; - } - - /** @inheritDoc */ - override public function create(reference:AssetReference, helper:AssetFactoryHelper, - onComplete:Function, onError:Function):void - { - var texture:Texture = null; - var url:String = reference.url; - var data:Object = reference.data; - var name:String = reference.name; - var options:TextureOptions = reference.textureOptions; - var onReady:Function = reference.textureOptions.onReady as Function; - - if (data is Bitmap) - onBitmapDataCreated((data as Bitmap).bitmapData); - else if (data is BitmapData) - onBitmapDataCreated(data as BitmapData); - else if (data is ByteArray) - createBitmapDataFromByteArray(data as ByteArray, onBitmapDataCreated, onError); - - // prevent closures from keeping references - reference.data = data = null; - - function onBitmapDataCreated(bitmapData:BitmapData):void - { - helper.executeWhenContextReady(createFromBitmapData, bitmapData); - } - - function createFromBitmapData(bitmapData:BitmapData):void - { - options.onReady = complete; - - try { texture = Texture.fromData(bitmapData, options); } - catch (e:Error) { onError(e.message); } - - if (texture && url) texture.root.onRestore = restoreTexture; - } - - function complete():void - { - execute(onReady, texture); - onComplete(name, texture); - } - - function restoreTexture():void - { - helper.onBeginRestore(); - - reload(url, function(bitmapData:BitmapData):void - { - helper.executeWhenContextReady(function():void - { - try { texture.root.uploadBitmapData(bitmapData); } - catch (e:Error) { helper.log("Texture restoration failed: " + e.message); } - - helper.onEndRestore(); - }); - }); - } - - function reload(url:String, onComplete:Function):void - { - helper.loadDataFromUrl(url, function(data:ByteArray):void - { - createBitmapDataFromByteArray(data, onComplete, onReloadError); - }, onReloadError); - } - - function onReloadError(error:String):void - { - helper.log("Texture restoration failed for " + url + ". " + error); - helper.onEndRestore(); - } - } - - /** Called by 'create' to convert a ByteArray to a BitmapData. - * - * @param data A ByteArray that contains image data - * (like the contents of a PNG or JPG file). - * @param onComplete Called with the BitmapData when successful. - *
function(bitmapData:BitmapData):void;
- * @param onError To be called when creation fails for some reason. - *
function(error:String):void
- */ - protected function createBitmapDataFromByteArray(data:ByteArray, - onComplete:Function, onError:Function):void - { - var loader:Loader = new Loader(); - var loaderInfo:LoaderInfo = loader.contentLoaderInfo; - loaderInfo.addEventListener(IOErrorEvent.IO_ERROR, onIoError); - loaderInfo.addEventListener(Event.COMPLETE, onLoaderComplete); - var loaderContext:LoaderContext = new LoaderContext(); - loaderContext.imageDecodingPolicy = ImageDecodingPolicy.ON_LOAD; - loader.loadBytes(data, loaderContext); - - function onIoError(event:IOErrorEvent):void - { - cleanup(); - execute(onError, event.text); - } - - function onLoaderComplete(event:Object):void - { - complete(event.target.content.bitmapData); - } - - function complete(bitmapData:BitmapData):void - { - cleanup(); - execute(onComplete, bitmapData); - } - - function cleanup():void - { - loaderInfo.removeEventListener(IOErrorEvent.IO_ERROR, onIoError); - loaderInfo.removeEventListener(Event.COMPLETE, onLoaderComplete); - } - } - } -} diff --git a/mobile_version/src/starling/assets/ByteArrayFactory.as b/mobile_version/src/starling/assets/ByteArrayFactory.as deleted file mode 100644 index 79d02371..00000000 --- a/mobile_version/src/starling/assets/ByteArrayFactory.as +++ /dev/null @@ -1,30 +0,0 @@ -package starling.assets -{ - import flash.utils.ByteArray; - - /** This AssetFactory forwards ByteArrays to the AssetManager. It's the fallback when - * no other factory can handle an asset reference (default priority: -100). */ - public class ByteArrayFactory extends AssetFactory - { - /** Creates a new instance. */ - public function ByteArrayFactory() - { - // not used, actually - this factory is used as a fallback with low priority - addExtensions("bin"); - addMimeTypes("application/octet-stream"); - } - - /** @inheritDoc */ - override public function canHandle(reference:AssetReference):Boolean - { - return reference.data is ByteArray; - } - - /** @inheritDoc */ - override public function create(reference:AssetReference, helper:AssetFactoryHelper, - onComplete:Function, onError:Function):void - { - onComplete(reference.name, reference.data as ByteArray); - } - } -} diff --git a/mobile_version/src/starling/assets/DataLoader.as b/mobile_version/src/starling/assets/DataLoader.as deleted file mode 100644 index 4fe81f7b..00000000 --- a/mobile_version/src/starling/assets/DataLoader.as +++ /dev/null @@ -1,138 +0,0 @@ -package starling.assets -{ - import flash.events.ErrorEvent; - import flash.events.Event; - import flash.events.HTTPStatusEvent; - import flash.events.IOErrorEvent; - import flash.events.ProgressEvent; - import flash.events.SecurityErrorEvent; - import flash.net.URLLoader; - import flash.net.URLLoaderDataFormat; - import flash.net.URLRequest; - import flash.utils.Dictionary; - - import starling.utils.execute; - - /** Loads binary data from a local or remote URL with a very simple callback system. - * - *

The DataLoader is used by the AssetManager to load any local or remote data. - * Its single purpose is to get the binary data that's stored at a specific URL.

- * - *

You can use this class for your own purposes (as an easier to use 'URLLoader' - * alternative), or you can extend the class to modify the AssetManager's behavior. - * E.g. you could extend this class to add a caching mechanism for remote assets. - * Assign an instance of your extended class to the AssetManager's dataLoader - * property.

- */ - public class DataLoader - { - // This HTTPStatusEvent is only available in AIR - private static const HTTP_RESPONSE_STATUS:String = "httpResponseStatus"; - - private var _urlLoaders:Dictionary; - - /** Creates a new DataLoader instance. */ - public function DataLoader() - { - _urlLoaders = new Dictionary(true); - } - - /** Loads the binary data from a specific URL. Always supply both 'onComplete' and - * 'onError' parameters; in case of an error, only the latter will be called. - * - *

The 'onComplete' callback may have up to four parameters, all of them being optional. - * If you pass a callback that just takes zero or one, it will work just as well. The - * additional parameters may be used to describe the name and type of the downloaded - * data. They are not provided by the base class, but the AssetManager will check - * if they are available.

- * - * @param url a String containing an URL. - * @param onComplete will be called when the data has been loaded. - * function(data:ByteArray, mimeType:String, name:String, extension:String):void - * @param onError will be called in case of an error. The 2nd parameter is optional. - * function(error:String, httpStatus:int):void - * @param onProgress will be called multiple times with the current load ratio (0-1). - * function(ratio:Number):void - */ - public function load(url:String, onComplete:Function, - onError:Function, onProgress:Function=null):void - { - var message:String; - var mimeType:String = null; - var httpStatus:int = 0; - var request:URLRequest = new URLRequest(url); - var loader:URLLoader = new URLLoader(); - loader.dataFormat = URLLoaderDataFormat.BINARY; - loader.addEventListener(IOErrorEvent.IO_ERROR, onLoadError); - loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onLoadError); - loader.addEventListener(HTTP_RESPONSE_STATUS, onHttpResponseStatus); - loader.addEventListener(ProgressEvent.PROGRESS, onLoadProgress); - loader.addEventListener(Event.COMPLETE, onLoadComplete); - loader.load(request); - - _urlLoaders[loader] = true; - - function onHttpResponseStatus(event:HTTPStatusEvent):void - { - httpStatus = event.status; - mimeType = getHttpHeader(event["responseHeaders"], "Content-Type"); - } - - function onLoadError(event:ErrorEvent):void - { - cleanup(); - message = event.type + " - " + event.text; - execute(onError, message); - } - - function onLoadProgress(event:ProgressEvent):void - { - if (onProgress != null && event.bytesTotal > 0) - onProgress(event.bytesLoaded / event.bytesTotal); - } - - function onLoadComplete(event:Object):void - { - cleanup(); - - if (httpStatus < 400) - execute(onComplete, loader.data, mimeType); - else - execute(onError, "Unexpected HTTP status '" + httpStatus + "'. URL: " + - request.url, httpStatus); - } - - function cleanup():void - { - loader.removeEventListener(IOErrorEvent.IO_ERROR, onLoadError); - loader.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, onLoadError); - loader.removeEventListener(HTTP_RESPONSE_STATUS, onHttpResponseStatus); - loader.removeEventListener(ProgressEvent.PROGRESS, onLoadProgress); - loader.removeEventListener(Event.COMPLETE, onLoadComplete); - delete _urlLoaders[loader]; - } - } - - /** Aborts all current load operations. The loader can still be used, though. */ - public function close():void - { - for (var loader:* in _urlLoaders) - { - try { loader.close(); } - catch (e:Error) {} - } - - _urlLoaders = new Dictionary(true); - } - - private static function getHttpHeader(headers:Array, headerName:String):String - { - if (headers) - { - for each (var header:Object in headers) - if (header.name == headerName) return header.value; - } - return null; - } - } -} diff --git a/mobile_version/src/starling/assets/JsonFactory.as b/mobile_version/src/starling/assets/JsonFactory.as deleted file mode 100644 index 8f8494c9..00000000 --- a/mobile_version/src/starling/assets/JsonFactory.as +++ /dev/null @@ -1,40 +0,0 @@ -package starling.assets -{ - import flash.utils.ByteArray; - - import starling.utils.ByteArrayUtil; - - /** This AssetFactory creates objects from JSON data. */ - public class JsonFactory extends AssetFactory - { - /** Creates a new instance. */ - public function JsonFactory() - { - addExtensions("json"); - addMimeTypes("application/json", "text/json"); - } - - /** @inheritDoc */ - override public function canHandle(reference:AssetReference):Boolean - { - return super.canHandle(reference) || (reference.data is ByteArray && - ByteArrayUtil.startsWithString(reference.data as ByteArray, "{")); - } - - /** @inheritDoc */ - override public function create(reference:AssetReference, helper:AssetFactoryHelper, - onComplete:Function, onError:Function):void - { - try - { - var bytes:ByteArray = reference.data as ByteArray; - var object:Object = JSON.parse(bytes.readUTFBytes(bytes.length)); - onComplete(reference.name, object); - } - catch (e:Error) - { - onError("Could not parse JSON: " + e.message); - } - } - } -} diff --git a/mobile_version/src/starling/assets/SoundFactory.as b/mobile_version/src/starling/assets/SoundFactory.as deleted file mode 100644 index 84e097b6..00000000 --- a/mobile_version/src/starling/assets/SoundFactory.as +++ /dev/null @@ -1,60 +0,0 @@ -package starling.assets -{ - import flash.media.Sound; - import flash.utils.ByteArray; - - import starling.utils.ByteArrayUtil; - - /** This AssetFactory creates sound assets. */ - public class SoundFactory extends AssetFactory - { - private static const MAGIC_NUMBERS_A:Array = [0xFF, 0xFB]; - private static const MAGIC_NUMBERS_B:Array = [0x49, 0x44, 0x33]; - - /** Creates a new instance. */ - public function SoundFactory() - { - addMimeTypes("audio/mp3", "audio/mpeg3", "audio/mpeg"); - addExtensions("mp3"); - } - - /** @inheritDoc */ - override public function canHandle(reference:AssetReference):Boolean - { - if (reference.data is Sound || super.canHandle(reference)) - return true; - else if (reference.data is ByteArray) - { - var byteData:ByteArray = reference.data as ByteArray; - return ByteArrayUtil.startsWithBytes(byteData, MAGIC_NUMBERS_A) || - ByteArrayUtil.startsWithBytes(byteData, MAGIC_NUMBERS_B); - } - else return false; - } - - /** @inheritDoc */ - override public function create(reference:AssetReference, helper:AssetFactoryHelper, - onComplete:Function, onError:Function):void - { - var sound:Sound = reference.data as Sound; - var bytes:ByteArray = reference.data as ByteArray; - - if (bytes) - { - try - { - sound = new Sound(); - sound.loadCompressedDataFromByteArray(bytes, bytes.length); - } - catch (e:Error) - { - onError("Could not load sound data: " + e.message); - return; - } - - } - - onComplete(reference.name, sound); - } - } -} diff --git a/mobile_version/src/starling/assets/XmlFactory.as b/mobile_version/src/starling/assets/XmlFactory.as deleted file mode 100644 index 54af6099..00000000 --- a/mobile_version/src/starling/assets/XmlFactory.as +++ /dev/null @@ -1,84 +0,0 @@ -package starling.assets -{ - import flash.utils.ByteArray; - - import starling.text.BitmapFont; - import starling.text.TextField; - import starling.textures.Texture; - import starling.textures.TextureAtlas; - import starling.utils.ByteArrayUtil; - - /** This AssetFactory creates XML assets, texture atlases and bitmap fonts. */ - public class XmlFactory extends AssetFactory - { - /** Creates a new instance. */ - public function XmlFactory() - { - addMimeTypes("application/xml", "text/xml"); - addExtensions("xml", "fnt"); - } - - /** Returns true if mime type or extension fit for XML data, or if the data starts - * with a "<" character. */ - override public function canHandle(reference:AssetReference):Boolean - { - return super.canHandle(reference) || (reference.data is ByteArray && - ByteArrayUtil.startsWithString(reference.data as ByteArray, "<")); - } - - /** Creates the XML asset and passes it to 'onComplete'. If the XML contains a - * TextureAtlas or a BitmapFont, adds suitable post processors. */ - override public function create(reference:AssetReference, helper:AssetFactoryHelper, - onComplete:Function, onError:Function):void - { - var xml:XML = reference.data as XML; - var bytes:ByteArray = reference.data as ByteArray; - - if (bytes) - { - try { xml = new XML(bytes); } - catch (e:Error) - { - onError("Could not parse XML: " + e.message); - return; - } - } - - var rootNode:String = xml.localName(); - - if (rootNode == "TextureAtlas") - helper.addPostProcessor(textureAtlasPostProcessor, 100); - else if (rootNode == "font") - helper.addPostProcessor(bitmapFontPostProcessor); - - onComplete(reference.name, xml); - - // prevent closures from keeping references - reference.data = bytes = null; - - function textureAtlasPostProcessor(store:AssetManager):void - { - var name:String = helper.getNameFromUrl(xml.@imagePath.toString()); - var texture:Texture = store.getTexture(name); - if (texture) store.addAsset(name, new TextureAtlas(texture, xml)); - else helper.log("Cannot create atlas: texture '" + name + "' is missing."); - } - - function bitmapFontPostProcessor(store:AssetManager):void - { - var textureName:String = helper.getNameFromUrl(xml.pages.page.@file.toString()); - var texture:Texture = store.getTexture(textureName); - var fontName:String = store.registerBitmapFontsWithFontFace ? - xml.info.@face.toString() : textureName; - - if (texture) - { - var bitmapFont:BitmapFont = new BitmapFont(texture, xml); - store.addAsset(fontName, bitmapFont); - TextField.registerCompositor(bitmapFont, fontName); - } - else helper.log("Cannot create bitmap font: texture '" + textureName + "' is missing."); - } - } - } -} diff --git a/mobile_version/src/starling/core/Starling.as b/mobile_version/src/starling/core/Starling.as deleted file mode 100644 index 042eedc1..00000000 --- a/mobile_version/src/starling/core/Starling.as +++ /dev/null @@ -1,1051 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= - -package starling.core -{ - import flash.display.Shape; - import flash.display.Sprite; - import flash.display.Stage3D; - import flash.display.StageAlign; - import flash.display.StageScaleMode; - import flash.display3D.Context3D; - import flash.display3D.Context3DProfile; - import flash.errors.IllegalOperationError; - import flash.events.ErrorEvent; - import flash.events.Event; - import flash.events.KeyboardEvent; - import flash.events.MouseEvent; - import flash.events.TouchEvent; - import flash.geom.Rectangle; - import flash.system.Capabilities; - import flash.text.TextField; - import flash.text.TextFieldAutoSize; - import flash.text.TextFormat; - import flash.text.TextFormatAlign; - import flash.ui.Mouse; - import flash.ui.Multitouch; - import flash.ui.MultitouchInputMode; - import flash.utils.getTimer; - import flash.utils.setTimeout; - - import starling.animation.Juggler; - import starling.display.DisplayObject; - import starling.display.Stage; - import starling.events.EventDispatcher; - import starling.events.ResizeEvent; - import starling.events.TouchPhase; - import starling.events.TouchProcessor; - import starling.rendering.Painter; - import starling.utils.Align; - import starling.utils.RectangleUtil; - import starling.utils.SystemUtil; - - /** Dispatched when a new render context is created. The 'data' property references the context. */ - [Event(name="context3DCreate", type="starling.events.Event")] - - /** Dispatched when the root class has been created. The 'data' property references that object. */ - [Event(name="rootCreated", type="starling.events.Event")] - - /** Dispatched when a fatal error is encountered. The 'data' property contains an error string. */ - [Event(name="fatalError", type="starling.events.Event")] - - /** Dispatched when the display list is about to be rendered. This event provides the last - * opportunity to make changes before the display list is rendered. */ - [Event(name="render", type="starling.events.Event")] - - /** The Starling class represents the core of the Starling framework. - * - *

The Starling framework makes it possible to create 2D applications and games that make - * use of the Stage3D architecture introduced in Flash Player 11. It implements a display tree - * system that is very similar to that of conventional Flash, while leveraging modern GPUs - * to speed up rendering.

- * - *

The Starling class represents the link between the conventional Flash display tree and - * the Starling display tree. To create a Starling-powered application, you have to create - * an instance of the Starling class:

- * - *
var starling:Starling = new Starling(Game, stage);
- * - *

The first parameter has to be a Starling display object class, e.g. a subclass of - * starling.display.Sprite. In the sample above, the class "Game" is the - * application root. An instance of "Game" will be created as soon as Starling is initialized. - * The second parameter is the conventional (Flash) stage object. Per default, Starling will - * display its contents directly below the stage.

- * - *

It is recommended to store the Starling instance as a member variable, to make sure - * that the Garbage Collector does not destroy it. After creating the Starling object, you - * have to start it up like this:

- * - *
starling.start();
- * - *

It will now render the contents of the "Game" class in the frame rate that is set up for - * the application (as defined in the Flash stage).

- * - * Context3D Profiles - * - *

Stage3D supports different rendering profiles, and Starling works with all of them. The - * last parameter of the Starling constructor allows you to choose which profile you want. - * The following profiles are available:

- * - *
    - *
  • BASELINE_CONSTRAINED: provides the broadest hardware reach. If you develop for the - * browser, this is the profile you should test with.
  • - *
  • BASELINE: recommend for any mobile application, as it allows Starling to use a more - * memory efficient texture type (RectangleTextures). It also supports more complex - * AGAL code.
  • - *
  • BASELINE_EXTENDED: adds support for textures up to 4096x4096 pixels. This is - * especially useful on mobile devices with very high resolutions.
  • - *
  • STANDARD_CONSTRAINED, STANDARD, STANDARD_EXTENDED: each provide more AGAL features, - * among other things. Most Starling games will not gain much from them.
  • - *
- * - *

The recommendation is to deploy your app with the profile "auto" (which makes Starling - * pick the best available of those), but to test it in all available profiles.

- * - * Accessing the Starling object - * - *

From within your application, you can access the current Starling object anytime - * through the static method Starling.current. It will return the active Starling - * instance (most applications will only have one Starling object, anyway).

- * - * Viewport - * - *

The area the Starling content is rendered into is, per default, the complete size of the - * stage. You can, however, use the "viewPort" property to change it. This can be useful - * when you want to render only into a part of the screen, or if the player size changes. For - * the latter, you can listen to the RESIZE-event dispatched by the Starling - * stage.

- * - * Native overlay - * - *

Sometimes you will want to display native Flash content on top of Starling. That's what the - * nativeOverlay property is for. It returns a Flash Sprite lying directly - * on top of the Starling content. You can add conventional Flash objects to that overlay.

- * - *

Beware, though, that conventional Flash content on top of 3D content can lead to - * performance penalties on some (mobile) platforms. For that reason, always remove all child - * objects from the overlay when you don't need them any longer.

- * - * Multitouch - * - *

Starling supports multitouch input on devices that provide it. During development, - * where most of us are working with a conventional mouse and keyboard, Starling can simulate - * multitouch events with the help of the "Shift" and "Ctrl" (Mac: "Cmd") keys. Activate - * this feature by enabling the simulateMultitouch property.

- * - * Skipping Unchanged Frames - * - *

It happens surprisingly often in an app or game that a scene stays completely static for - * several frames. So why redraw the stage at all in those situations? That's exactly the - * point of the skipUnchangedFrames-property. If enabled, static scenes are - * recognized as such and the back buffer is simply left as it is. On a mobile device, the - * impact of this feature can't be overestimated! There's simply no better way to enhance - * battery life. Make it a habit to always activate it; look at the documentation of the - * corresponding property for details.

- * - * Handling a lost render context - * - *

On some operating systems and under certain conditions (e.g. returning from system - * sleep), Starling's stage3D render context may be lost. Starling will try to recover - * from a lost context automatically; to be able to do this, it will cache textures in - * RAM. This will take up quite a bit of extra memory, though, which might be problematic - * especially on mobile platforms. To avoid the higher memory footprint, it's recommended - * to load your textures with Starling's "AssetManager"; it is smart enough to recreate a - * texture directly from its origin.

- * - *

In case you want to react to a context loss manually, Starling dispatches an event with - * the type "Event.CONTEXT3D_CREATE" when the context is restored, and textures will execute - * their root.onRestore callback, to which you can attach your own logic. - * Refer to the "Texture" class for more information.

- * - * Sharing a 3D Context - * - *

Per default, Starling handles the Stage3D context itself. If you want to combine - * Starling with another Stage3D engine, however, this may not be what you want. In this case, - * you can make use of the shareContext property:

- * - *
    - *
  1. Manually create and configure a context3D object that both frameworks can work with - * (ideally through RenderUtil.requestContext3D and - * context.configureBackBuffer).
  2. - *
  3. Initialize Starling with the stage3D instance that contains that configured context. - * This will automatically enable shareContext.
  4. - *
  5. Call start() on your Starling instance (as usual). This will make - * Starling queue input events (keyboard/mouse/touch).
  6. - *
  7. Create a game loop (e.g. using the native ENTER_FRAME event) and let it - * call Starling's nextFrame as well as the equivalent method of the other - * Stage3D engine. Surround those calls with context.clear() and - * context.present().
  8. - *
- * - *

The Starling wiki contains a tutorial with more - * information about this topic.

- * - * @see starling.utils.AssetManager - * @see starling.textures.Texture - * - */ - public class Starling extends EventDispatcher - { - /** The version of the Starling framework. */ - public static const VERSION:String = "2.1"; - - // members - - private var _stage:Stage; // starling.display.stage! - private var _rootClass:Class; - private var _root:DisplayObject; - private var _juggler:Juggler; - private var _painter:Painter; - private var _touchProcessor:TouchProcessor; - private var _antiAliasing:int; - private var _frameTimestamp:Number; - private var _frameID:uint; - private var _leftMouseDown:Boolean; - private var _statsDisplay:StatsDisplay; - private var _started:Boolean; - private var _rendering:Boolean; - private var _supportHighResolutions:Boolean; - private var _skipUnchangedFrames:Boolean; - private var _showStats:Boolean; - - private var _viewPort:Rectangle; - private var _previousViewPort:Rectangle; - private var _clippedViewPort:Rectangle; - - private var _nativeStage:flash.display.Stage; - private var _nativeStageEmpty:Boolean; - private var _nativeOverlay:Sprite; - - private static var sCurrent:Starling; - private static var sAll:Vector. = new []; - - // construction - - /** Creates a new Starling instance. - * @param rootClass A subclass of 'starling.display.DisplayObject'. It will be created - * as soon as initialization is finished and will become the first child - * of the Starling stage. Pass null if you don't want to - * create a root object right away. (You can use the - * rootClass property later to make that happen.) - * @param stage The Flash (2D) stage. - * @param viewPort A rectangle describing the area into which the content will be - * rendered. Default: stage size - * @param stage3D The Stage3D object into which the content will be rendered. If it - * already contains a context, sharedContext will be set - * to true. Default: the first available Stage3D. - * @param renderMode The Context3D render mode that should be requested. - * Use this parameter if you want to force "software" rendering. - * @param profile The Context3D profile that should be requested. - * - *
    - *
  • If you pass a profile String, this profile is enforced.
  • - *
  • Pass an Array of profiles to make Starling pick the first - * one that works (starting with the first array element).
  • - *
  • Pass the String "auto" to make Starling pick the best available - * profile automatically.
  • - *
- */ - public function Starling(rootClass:Class, stage:flash.display.Stage, - viewPort:Rectangle=null, stage3D:Stage3D=null, - renderMode:String="auto", profile:Object="auto") - { - if (stage == null) throw new ArgumentError("Stage must not be null"); - if (viewPort == null) viewPort = new Rectangle(0, 0, stage.stageWidth, stage.stageHeight); - if (stage3D == null) stage3D = stage.stage3Ds[0]; - - // TODO it might make sense to exchange the 'renderMode' and 'profile' parameters. - - SystemUtil.initialize(); - sAll.push(this); - makeCurrent(); - - _rootClass = rootClass; - _viewPort = viewPort; - _previousViewPort = new Rectangle(); - _stage = new Stage(viewPort.width, viewPort.height, stage.color); - _nativeOverlay = new Sprite(); - _nativeStage = stage; - _nativeStage.addChild(_nativeOverlay); - _touchProcessor = new TouchProcessor(_stage); - _juggler = new Juggler(); - _antiAliasing = 0; - _supportHighResolutions = false; - _painter = new Painter(stage3D); - _frameTimestamp = getTimer() / 1000.0; - _frameID = 1; - - // all other modes are problematic in Starling, so we force those here - stage.scaleMode = StageScaleMode.NO_SCALE; - stage.align = StageAlign.TOP_LEFT; - - // register touch/mouse event handlers - for each (var touchEventType:String in touchEventTypes) - stage.addEventListener(touchEventType, onTouch, false, 0, true); - - // register other event handlers - stage.addEventListener(Event.ENTER_FRAME, onEnterFrame, false, 0, true); - stage.addEventListener(KeyboardEvent.KEY_DOWN, onKey, false, 0, true); - stage.addEventListener(KeyboardEvent.KEY_UP, onKey, false, 0, true); - stage.addEventListener(Event.RESIZE, onResize, false, 0, true); - stage.addEventListener(Event.MOUSE_LEAVE, onMouseLeave, false, 0, true); - - stage3D.addEventListener(Event.CONTEXT3D_CREATE, onContextCreated, false, 10, true); - stage3D.addEventListener(ErrorEvent.ERROR, onStage3DError, false, 10, true); - - if (_painter.shareContext) - { - setTimeout(initialize, 1); // we don't call it right away, because Starling should - // behave the same way with or without a shared context - } - else - { - if (!SystemUtil.supportsDepthAndStencil) - trace("[Starling] Mask support requires 'depthAndStencil' to be enabled" + - " in the application descriptor."); - - _painter.requestContext3D(renderMode, profile); - } - } - - /** Disposes all children of the stage and the render context; removes all registered - * event listeners. */ - public function dispose():void - { - stop(true); - - _nativeStage.removeEventListener(Event.ENTER_FRAME, onEnterFrame, false); - _nativeStage.removeEventListener(KeyboardEvent.KEY_DOWN, onKey, false); - _nativeStage.removeEventListener(KeyboardEvent.KEY_UP, onKey, false); - _nativeStage.removeEventListener(Event.RESIZE, onResize, false); - _nativeStage.removeEventListener(Event.MOUSE_LEAVE, onMouseLeave, false); - _nativeStage.removeChild(_nativeOverlay); - - stage3D.removeEventListener(Event.CONTEXT3D_CREATE, onContextCreated, false); - stage3D.removeEventListener(Event.CONTEXT3D_CREATE, onContextRestored, false); - stage3D.removeEventListener(ErrorEvent.ERROR, onStage3DError, false); - - for each (var touchEventType:String in touchEventTypes) - _nativeStage.removeEventListener(touchEventType, onTouch, false); - - _touchProcessor.dispose(); - _painter.dispose(); - _stage.dispose(); - - var index:int = sAll.indexOf(this); - if (index != -1) sAll.removeAt(index); - if (sCurrent == this) sCurrent = null; - } - - // functions - - private function initialize():void - { - makeCurrent(); - updateViewPort(true); - - // ideal time: after viewPort setup, before root creation - dispatchEventWith(Event.CONTEXT3D_CREATE, false, context); - - initializeRoot(); - _frameTimestamp = getTimer() / 1000.0; - } - - private function initializeRoot():void - { - if (_root == null && _rootClass != null) - { - _root = new _rootClass() as DisplayObject; - if (_root == null) throw new Error("Invalid root class: " + _rootClass); - _stage.addChildAt(_root, 0); - - dispatchEventWith(starling.events.Event.ROOT_CREATED, false, _root); - } - } - - /** Calls advanceTime() (with the time that has passed since the last frame) - * and render(). */ - public function nextFrame():void - { - var now:Number = getTimer() / 1000.0; - var passedTime:Number = now - _frameTimestamp; - _frameTimestamp = now; - - // to avoid overloading time-based animations, the maximum delta is truncated. - if (passedTime > 1.0) passedTime = 1.0; - - // after about 25 days, 'getTimer()' will roll over. A rare event, but still ... - if (passedTime < 0.0) passedTime = 1.0 / _nativeStage.frameRate; - - advanceTime(passedTime); - render(); - } - - /** Dispatches ENTER_FRAME events on the display list, advances the Juggler - * and processes touches. */ - public function advanceTime(passedTime:Number):void - { - if (!contextValid) - return; - - makeCurrent(); - - _touchProcessor.advanceTime(passedTime); - _stage.advanceTime(passedTime); - _juggler.advanceTime(passedTime); - } - - /** Renders the complete display list. Before rendering, the context is cleared; afterwards, - * it is presented (to avoid this, enable shareContext). - * - *

This method also dispatches an Event.RENDER-event on the Starling - * instance. That's the last opportunity to make changes before the display list is - * rendered.

*/ - public function render():void - { - if (!contextValid) - return; - - makeCurrent(); - updateViewPort(); - - var doRedraw:Boolean = _stage.requiresRedraw || mustAlwaysRender; - if (doRedraw) - { - dispatchEventWith(starling.events.Event.RENDER); - - var shareContext:Boolean = _painter.shareContext; - var scaleX:Number = _viewPort.width / _stage.stageWidth; - var scaleY:Number = _viewPort.height / _stage.stageHeight; - - _painter.nextFrame(); - _painter.pixelSize = 1.0 / contentScaleFactor; - _painter.state.setProjectionMatrix( - _viewPort.x < 0 ? -_viewPort.x / scaleX : 0.0, - _viewPort.y < 0 ? -_viewPort.y / scaleY : 0.0, - _clippedViewPort.width / scaleX, - _clippedViewPort.height / scaleY, - _stage.stageWidth, _stage.stageHeight, _stage.cameraPosition); - - if (!shareContext) - _painter.clear(_stage.color, 0.0); - - _stage.render(_painter); - _painter.finishFrame(); - _painter.frameID = ++_frameID; - - if (!shareContext) - _painter.present(); - } - - if (_statsDisplay) - { - _statsDisplay.drawCount = _painter.drawCount; - if (!doRedraw) _statsDisplay.markFrameAsSkipped(); - } - } - - private function updateViewPort(forceUpdate:Boolean=false):void - { - // the last set viewport is stored in a variable; that way, people can modify the - // viewPort directly (without a copy) and we still know if it has changed. - - if (forceUpdate || !RectangleUtil.compare(_viewPort, _previousViewPort)) - { - _previousViewPort.setTo(_viewPort.x, _viewPort.y, _viewPort.width, _viewPort.height); - - // Constrained mode requires that the viewport is within the native stage bounds; - // thus, we use a clipped viewport when configuring the back buffer. (In baseline - // mode, that's not necessary, but it does not hurt either.) - - _clippedViewPort = _viewPort.intersection( - new Rectangle(0, 0, _nativeStage.stageWidth, _nativeStage.stageHeight)); - - var contentScaleFactor:Number = - _supportHighResolutions ? _nativeStage.contentsScaleFactor : 1.0; - - _painter.configureBackBuffer(_clippedViewPort, contentScaleFactor, - _antiAliasing, true); - } - } - - private function updateNativeOverlay():void - { - _nativeOverlay.x = _viewPort.x; - _nativeOverlay.y = _viewPort.y; - _nativeOverlay.scaleX = _viewPort.width / _stage.stageWidth; - _nativeOverlay.scaleY = _viewPort.height / _stage.stageHeight; - } - - /** Stops Starling right away and displays an error message on the native overlay. - * This method will also cause Starling to dispatch a FATAL_ERROR event. */ - public function stopWithFatalError(message:String):void - { - var background:Shape = new Shape(); - background.graphics.beginFill(0x0, 0.8); - background.graphics.drawRect(0, 0, _stage.stageWidth, _stage.stageHeight); - background.graphics.endFill(); - - var textField:TextField = new TextField(); - var textFormat:TextFormat = new TextFormat("Verdana", 14, 0xFFFFFF); - textFormat.align = TextFormatAlign.CENTER; - textField.defaultTextFormat = textFormat; - textField.wordWrap = true; - textField.width = _stage.stageWidth * 0.75; - textField.autoSize = TextFieldAutoSize.CENTER; - textField.text = message; - textField.x = (_stage.stageWidth - textField.width) / 2; - textField.y = (_stage.stageHeight - textField.height) / 2; - textField.background = true; - textField.backgroundColor = 0x550000; - - updateNativeOverlay(); - nativeOverlay.addChild(background); - nativeOverlay.addChild(textField); - stop(true); - - trace("[Starling]", message); - dispatchEventWith(starling.events.Event.FATAL_ERROR, false, message); - } - - /** Make this Starling instance the current one. */ - public function makeCurrent():void - { - sCurrent = this; - } - - /** As soon as Starling is started, it will queue input events (keyboard/mouse/touch); - * furthermore, the method nextFrame will be called once per Flash Player - * frame. (Except when shareContext is enabled: in that case, you have to - * call that method manually.) */ - public function start():void - { - _started = _rendering = true; - _frameTimestamp = getTimer() / 1000.0; - - // mainly for Android: force redraw when app moves into foreground - setTimeout(setRequiresRedraw, 100); - } - - /** Stops all logic and input processing, effectively freezing the app in its current state. - * Per default, rendering will continue: that's because the classic display list - * is only updated when stage3D is. (If Starling stopped rendering, conventional Flash - * contents would freeze, as well.) - * - *

However, if you don't need classic Flash contents, you can stop rendering, too. - * On some mobile systems (e.g. iOS), you are even required to do so if you have - * activated background code execution.

- */ - public function stop(suspendRendering:Boolean=false):void - { - _started = false; - _rendering = !suspendRendering; - } - - /** Makes sure that the next frame is actually rendered. - * - *

When skipUnchangedFrames is enabled, some situations require that you - * manually force a redraw, e.g. when a RenderTexture is changed. This method is the - * easiest way to do so; it's just a shortcut to stage.setRequiresRedraw(). - *

- */ - public function setRequiresRedraw():void - { - _stage.setRequiresRedraw(); - } - - // event handlers - - private function onStage3DError(event:ErrorEvent):void - { - if (event.errorID == 3702) - { - var mode:String = Capabilities.playerType == "Desktop" ? "renderMode" : "wmode"; - stopWithFatalError("Context3D not available! Possible reasons: wrong " + mode + - " or missing device support."); - } - else - stopWithFatalError("Stage3D error: " + event.text); - } - - private function onContextCreated(event:Event):void - { - stage3D.removeEventListener(Event.CONTEXT3D_CREATE, onContextCreated); - stage3D.addEventListener(Event.CONTEXT3D_CREATE, onContextRestored, false, 10, true); - - trace("[Starling] Context ready. Display Driver:", context.driverInfo); - initialize(); - } - - private function onContextRestored(event:Event):void - { - trace("[Starling] Context restored."); - updateViewPort(true); - dispatchEventWith(Event.CONTEXT3D_CREATE, false, context); - } - - private function onEnterFrame(event:Event):void - { - // On mobile, the native display list is only updated on stage3D draw calls. - // Thus, we render even when Starling is paused. - - if (!shareContext) - { - if (_started) nextFrame(); - else if (_rendering) render(); - } - - updateNativeOverlay(); - } - - private function onKey(event:KeyboardEvent):void - { - if (!_started) return; - - var keyEvent:starling.events.KeyboardEvent = new starling.events.KeyboardEvent( - event.type, event.charCode, event.keyCode, event.keyLocation, - event.ctrlKey, event.altKey, event.shiftKey); - - makeCurrent(); - _stage.dispatchEvent(keyEvent); - - if (keyEvent.isDefaultPrevented()) - event.preventDefault(); - } - - private function onResize(event:Event):void - { - var stageWidth:int = event.target.stageWidth; - var stageHeight:int = event.target.stageHeight; - - if (contextValid) - dispatchResizeEvent(); - else - addEventListener(Event.CONTEXT3D_CREATE, dispatchResizeEvent); - - function dispatchResizeEvent():void - { - // on Android, the context is not valid while we're resizing. To avoid problems - // with user code, we delay the event dispatching until it becomes valid again. - - makeCurrent(); - removeEventListener(Event.CONTEXT3D_CREATE, dispatchResizeEvent); - _stage.dispatchEvent(new ResizeEvent(Event.RESIZE, stageWidth, stageHeight)); - } - } - - private function onMouseLeave(event:Event):void - { - _touchProcessor.enqueueMouseLeftStage(); - } - - private function onTouch(event:Event):void - { - if (!_started) return; - - var globalX:Number; - var globalY:Number; - var touchID:int; - var phase:String; - var pressure:Number = 1.0; - var width:Number = 1.0; - var height:Number = 1.0; - - // figure out general touch properties - if (event is MouseEvent) - { - var mouseEvent:MouseEvent = event as MouseEvent; - globalX = mouseEvent.stageX; - globalY = mouseEvent.stageY; - touchID = 0; - - // MouseEvent.buttonDown returns true for both left and right button (AIR supports - // the right mouse button). We only want to react on the left button for now, - // so we have to save the state for the left button manually. - if (event.type == MouseEvent.MOUSE_DOWN) _leftMouseDown = true; - else if (event.type == MouseEvent.MOUSE_UP) _leftMouseDown = false; - } - else - { - var touchEvent:TouchEvent = event as TouchEvent; - - // On a system that supports both mouse and touch input, the primary touch point - // is dispatched as mouse event as well. Since we don't want to listen to that - // event twice, we ignore the primary touch in that case. - - if (Mouse.supportsCursor && touchEvent.isPrimaryTouchPoint) return; - else - { - globalX = touchEvent.stageX; - globalY = touchEvent.stageY; - touchID = touchEvent.touchPointID; - pressure = touchEvent.pressure; - width = touchEvent.sizeX; - height = touchEvent.sizeY; - } - } - - // figure out touch phase - switch (event.type) - { - case TouchEvent.TOUCH_BEGIN: phase = TouchPhase.BEGAN; break; - case TouchEvent.TOUCH_MOVE: phase = TouchPhase.MOVED; break; - case TouchEvent.TOUCH_END: phase = TouchPhase.ENDED; break; - case MouseEvent.MOUSE_DOWN: phase = TouchPhase.BEGAN; break; - case MouseEvent.MOUSE_UP: phase = TouchPhase.ENDED; break; - case MouseEvent.MOUSE_MOVE: - phase = (_leftMouseDown ? TouchPhase.MOVED : TouchPhase.HOVER); break; - } - - // move position into viewport bounds - globalX = _stage.stageWidth * (globalX - _viewPort.x) / _viewPort.width; - globalY = _stage.stageHeight * (globalY - _viewPort.y) / _viewPort.height; - - // enqueue touch in touch processor - _touchProcessor.enqueue(touchID, phase, globalX, globalY, pressure, width, height); - - // allow objects that depend on mouse-over state to be updated immediately - if (event.type == MouseEvent.MOUSE_UP && Mouse.supportsCursor) - _touchProcessor.enqueue(touchID, TouchPhase.HOVER, globalX, globalY); - } - - private function get touchEventTypes():Array - { - var types:Array = []; - - if (multitouchEnabled) - types.push(TouchEvent.TOUCH_BEGIN, TouchEvent.TOUCH_MOVE, TouchEvent.TOUCH_END); - - if (!multitouchEnabled || Mouse.supportsCursor) - types.push(MouseEvent.MOUSE_DOWN, MouseEvent.MOUSE_MOVE, MouseEvent.MOUSE_UP); - - return types; - } - - private function get mustAlwaysRender():Boolean - { - // On mobile, and in some browsers with the "baselineConstrained" profile, the - // standard display list is only rendered after calling "context.present()". - // In such a case, we cannot omit frames if there is any content on the stage. - - if (!_skipUnchangedFrames || _painter.shareContext) - return true; - else if (SystemUtil.isDesktop && profile != Context3DProfile.BASELINE_CONSTRAINED) - return false; - else - { - // Rendering can be skipped when both this and previous frame are empty. - var nativeStageEmpty:Boolean = isNativeDisplayObjectEmpty(_nativeStage); - var mustAlwaysRender:Boolean = !nativeStageEmpty || !_nativeStageEmpty; - _nativeStageEmpty = nativeStageEmpty; - - return mustAlwaysRender; - } - } - - // properties - - /** Indicates if this Starling instance is started. */ - public function get isStarted():Boolean { return _started; } - - /** The default juggler of this instance. Will be advanced once per frame. */ - public function get juggler():Juggler { return _juggler; } - - /** The painter, which is used for all rendering. The same instance is passed to all - * rendermethods each frame. */ - public function get painter():Painter { return _painter; } - - /** The render context of this instance. */ - public function get context():Context3D { return _painter.context; } - - /** Indicates if multitouch simulation with "Shift" and "Ctrl"/"Cmd"-keys is enabled. - * @default false */ - public function get simulateMultitouch():Boolean { return _touchProcessor.simulateMultitouch; } - public function set simulateMultitouch(value:Boolean):void - { - _touchProcessor.simulateMultitouch = value; - } - - /** Indicates if Stage3D render methods will report errors. It's recommended to activate - * this when writing custom rendering code (shaders, etc.), since you'll get more detailed - * error messages. However, it has a very negative impact on performance, and it prevents - * ATF textures from being restored on a context loss. Never activate for release builds! - * - * @default false */ - public function get enableErrorChecking():Boolean { return _painter.enableErrorChecking; } - public function set enableErrorChecking(value:Boolean):void - { - _painter.enableErrorChecking = value; - } - - /** The anti-aliasing level. 0 - none, 16 - maximum. @default 0 */ - public function get antiAliasing():int { return _antiAliasing; } - public function set antiAliasing(value:int):void - { - if (_antiAliasing != value) - { - _antiAliasing = value; - if (contextValid) updateViewPort(true); - } - } - - /** The viewport into which Starling contents will be rendered. */ - public function get viewPort():Rectangle { return _viewPort; } - public function set viewPort(value:Rectangle):void { _viewPort = value.clone(); } - - /** The ratio between viewPort width and stage width. Useful for choosing a different - * set of textures depending on the display resolution. */ - public function get contentScaleFactor():Number - { - return (_viewPort.width * _painter.backBufferScaleFactor) / _stage.stageWidth; - } - - /** A Flash Sprite placed directly on top of the Starling content. Use it to display native - * Flash components. */ - public function get nativeOverlay():Sprite { return _nativeOverlay; } - - /** Indicates if a small statistics box (with FPS, memory usage and draw count) is - * displayed. - * - *

When the box turns dark green, more than 50% of the frames since the box' last - * update could skip rendering altogether. This will only happen if the property - * skipUnchangedFrames is enabled.

- * - *

Beware that the memory usage should be taken with a grain of salt. The value is - * determined via System.totalMemory and does not take texture memory - * into account. It is recommended to use Adobe Scout for reliable and comprehensive - * memory analysis.

- */ - public function get showStats():Boolean { return _showStats; } - public function set showStats(value:Boolean):void - { - _showStats = value; - - if (value) - { - if (_statsDisplay) _stage.addChild(_statsDisplay); - else showStatsAt(); - } - else if (_statsDisplay) - { - _statsDisplay.removeFromParent(); - } - } - - /** Displays the statistics box at a certain position. */ - public function showStatsAt(horizontalAlign:String="left", - verticalAlign:String="top", scale:Number=1):void - { - _showStats = true; - - if (context == null) - { - // Starling is not yet ready - we postpone this until it's initialized. - addEventListener(starling.events.Event.ROOT_CREATED, onRootCreated); - } - else - { - var stageWidth:int = _stage.stageWidth; - var stageHeight:int = _stage.stageHeight; - - if (_statsDisplay == null) - { - _statsDisplay = new StatsDisplay(); - _statsDisplay.touchable = false; - } - - _stage.addChild(_statsDisplay); - _statsDisplay.scaleX = _statsDisplay.scaleY = scale; - - if (horizontalAlign == Align.LEFT) _statsDisplay.x = 0; - else if (horizontalAlign == Align.RIGHT) _statsDisplay.x = stageWidth - _statsDisplay.width; - else if (horizontalAlign == Align.CENTER) _statsDisplay.x = (stageWidth - _statsDisplay.width) / 2; - else throw new ArgumentError("Invalid horizontal alignment: " + horizontalAlign); - - if (verticalAlign == Align.TOP) _statsDisplay.y = 0; - else if (verticalAlign == Align.BOTTOM) _statsDisplay.y = stageHeight - _statsDisplay.height; - else if (verticalAlign == Align.CENTER) _statsDisplay.y = (stageHeight - _statsDisplay.height) / 2; - else throw new ArgumentError("Invalid vertical alignment: " + verticalAlign); - } - - function onRootCreated():void - { - if (_showStats) showStatsAt(horizontalAlign, verticalAlign, scale); - removeEventListener(starling.events.Event.ROOT_CREATED, onRootCreated); - } - } - - /** The Starling stage object, which is the root of the display tree that is rendered. */ - public function get stage():Stage { return _stage; } - - /** The Flash Stage3D object Starling renders into. */ - public function get stage3D():Stage3D { return _painter.stage3D; } - - /** The Flash (2D) stage object Starling renders beneath. */ - public function get nativeStage():flash.display.Stage { return _nativeStage; } - - /** The instance of the root class provided in the constructor. Available as soon as - * the event 'ROOT_CREATED' has been dispatched. */ - public function get root():DisplayObject { return _root; } - - /** The class that will be instantiated by Starling as the 'root' display object. - * Must be a subclass of 'starling.display.DisplayObject'. - * - *

If you passed null as first parameter to the Starling constructor, - * you can use this property to set the root class at a later time. As soon as the class - * is instantiated, Starling will dispatch a ROOT_CREATED event.

- * - *

Beware: you cannot change the root class once the root object has been - * instantiated.

- */ - public function get rootClass():Class { return _rootClass; } - public function set rootClass(value:Class):void - { - if (_rootClass != null && _root != null) - throw new Error("Root class may not change after root has been instantiated"); - else if (_rootClass == null) - { - _rootClass = value; - if (context) initializeRoot(); - } - } - - /** Indicates if another Starling instance (or another Stage3D framework altogether) - * uses the same render context. If enabled, Starling will not execute any destructive - * context operations (e.g. not call 'configureBackBuffer', 'clear', 'present', etc. - * This has to be done manually, then. @default false */ - public function get shareContext() : Boolean { return _painter.shareContext; } - public function set shareContext(value : Boolean) : void { _painter.shareContext = value; } - - /** The Context3D profile of the current render context, or null - * if the context has not been created yet. */ - public function get profile():String { return _painter.profile; } - - /** Indicates that if the device supports HiDPI screens Starling will attempt to allocate - * a larger back buffer than indicated via the viewPort size. Note that this is used - * on Desktop only; mobile AIR apps still use the "requestedDisplayResolution" parameter - * the application descriptor XML. @default false */ - public function get supportHighResolutions():Boolean { return _supportHighResolutions; } - public function set supportHighResolutions(value:Boolean):void - { - if (_supportHighResolutions != value) - { - _supportHighResolutions = value; - if (contextValid) updateViewPort(true); - } - } - - /** When enabled, Starling will skip rendering the stage if it hasn't changed since the - * last frame. This is great for apps that remain static from time to time, since it will - * greatly reduce power consumption. You should activate this whenever possible! - * - *

The reason why it's disabled by default is just that it causes problems with Render- - * and VideoTextures. When you use those, you either have to disable this property - * temporarily, or call setRequiresRedraw() (ideally on the stage) whenever - * those textures are changing. Otherwise, the changes won't show up.

- * - * @default false - */ - public function get skipUnchangedFrames():Boolean { return _skipUnchangedFrames; } - public function set skipUnchangedFrames(value:Boolean):void - { - _skipUnchangedFrames = value; - _nativeStageEmpty = false; // required by 'mustAlwaysRender' - } - - /** The TouchProcessor is passed all mouse and touch input and is responsible for - * dispatching TouchEvents to the Starling display tree. If you want to handle these - * types of input manually, pass your own custom subclass to this property. */ - public function get touchProcessor():TouchProcessor { return _touchProcessor; } - public function set touchProcessor(value:TouchProcessor):void - { - if (value == null) throw new ArgumentError("TouchProcessor must not be null"); - else if (value != _touchProcessor) - { - _touchProcessor.dispose(); - _touchProcessor = value; - } - } - - /** The number of frames that have been rendered since this instance was created. */ - public function get frameID():uint { return _frameID; } - - /** Indicates if the Context3D object is currently valid (i.e. it hasn't been lost or - * disposed). */ - public function get contextValid():Boolean { return _painter.contextValid; } - - // static properties - - /** The currently active Starling instance. */ - public static function get current():Starling { return sCurrent; } - - /** All Starling instances.

CAUTION: not a copy, but the actual object! Do not modify!

*/ - public static function get all():Vector. { return sAll; } - - /** The render context of the currently active Starling instance. */ - public static function get context():Context3D { return sCurrent ? sCurrent.context : null; } - - /** The default juggler of the currently active Starling instance. */ - public static function get juggler():Juggler { return sCurrent ? sCurrent._juggler : null; } - - /** The painter used for all rendering of the currently active Starling instance. */ - public static function get painter():Painter { return sCurrent ? sCurrent._painter : null; } - - /** The contentScaleFactor of the currently active Starling instance. */ - public static function get contentScaleFactor():Number - { - return sCurrent ? sCurrent.contentScaleFactor : 1.0; - } - - /** Indicates if multitouch input should be supported. */ - public static function get multitouchEnabled():Boolean - { - return Multitouch.inputMode == MultitouchInputMode.TOUCH_POINT; - } - - public static function set multitouchEnabled(value:Boolean):void - { - if (sCurrent) throw new IllegalOperationError( - "'multitouchEnabled' must be set before Starling instance is created"); - else - Multitouch.inputMode = value ? MultitouchInputMode.TOUCH_POINT : - MultitouchInputMode.NONE; - } - - /** The number of frames that have been rendered since the current instance was created. */ - public static function get frameID():uint - { - return sCurrent ? sCurrent._frameID : 0; - } - } -} - -import flash.display.DisplayObject; -import flash.display.DisplayObjectContainer; - -// put here to avoid naming conflicts -function isNativeDisplayObjectEmpty(object:DisplayObject):Boolean -{ - if (object == null) return true; - else if (object is DisplayObjectContainer) - { - var container:DisplayObjectContainer = object as DisplayObjectContainer; - var numChildren:int = container.numChildren; - - for (var i:int=0; i UPDATE_INTERVAL) - { - update(); - _frameCount = _skipCount = _totalTime = 0; - } - } - - /** Updates the displayed values. */ - public function update():void - { - _background.color = _skipCount > _frameCount / 2 ? 0x003F00 : 0x0; - _fps = _totalTime > 0 ? _frameCount / _totalTime : 0; - _memory = System.totalMemory * B_TO_MB; - _gpuMemory = supportsGpuMem ? Starling.context['totalGPUMemory'] * B_TO_MB : -1; - - var fpsText:String = _fps.toFixed(_fps < 100 ? 1 : 0); - var memText:String = _memory.toFixed(_memory < 100 ? 1 : 0); - var gpuMemText:String = _gpuMemory.toFixed(_gpuMemory < 100 ? 1 : 0); - var drwText:String = (_totalTime > 0 ? _drawCount-2 : _drawCount).toString(); // ignore self - - _values.text = fpsText + "\n" + memText + "\n" + - (_gpuMemory >= 0 ? gpuMemText + "\n" : "") + drwText; - } - - /** Call this once in every frame that can skip rendering because nothing changed. */ - public function markFrameAsSkipped():void - { - _skipCount += 1; - } - - public override function render(painter:Painter):void - { - // By calling 'finishQuadBatch' and 'excludeFromCache', we can make sure that the stats - // display is always rendered with exactly two draw calls. That is taken into account - // when showing the drawCount value (see 'ignore self' comment above) - - painter.excludeFromCache(this); - painter.finishMeshBatch(); - super.render(painter); - } - - /** Indicates if the current runtime supports the 'totalGPUMemory' API. */ - private function get supportsGpuMem():Boolean - { - return "totalGPUMemory" in Starling.context; - } - - /** The number of Stage3D draw calls per second. */ - public function get drawCount():int { return _drawCount; } - public function set drawCount(value:int):void { _drawCount = value; } - - /** The current frames per second (updated twice per second). */ - public function get fps():Number { return _fps; } - public function set fps(value:Number):void { _fps = value; } - - /** The currently used system memory in MB. */ - public function get memory():Number { return _memory; } - public function set memory(value:Number):void { _memory = value; } - - /** The currently used graphics memory in MB. */ - public function get gpuMemory():Number { return _gpuMemory; } - public function set gpuMemory(value:Number):void { _gpuMemory = value; } - } -} \ No newline at end of file diff --git a/mobile_version/src/starling/core/starling_internal.as b/mobile_version/src/starling/core/starling_internal.as deleted file mode 100644 index 2fa3be73..00000000 --- a/mobile_version/src/starling/core/starling_internal.as +++ /dev/null @@ -1,22 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= - -package starling.core -{ - /** - * This namespace is used for undocumented APIs -- usually implementation - * details -- which can't be private because they need to visible - * to other classes. - * - * APIs in this namespace are completely unsupported and are likely to - * change in future versions of Starling. - */ - public namespace starling_internal; -} \ No newline at end of file diff --git a/mobile_version/src/starling/display/BlendMode.as b/mobile_version/src/starling/display/BlendMode.as deleted file mode 100644 index 3794e2df..00000000 --- a/mobile_version/src/starling/display/BlendMode.as +++ /dev/null @@ -1,136 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= - -package starling.display -{ - import flash.display3D.Context3DBlendFactor; - - import starling.core.Starling; - - /** A class that provides constant values for visual blend mode effects. - * - *

A blend mode is always defined by two 'Context3DBlendFactor' values. A blend factor - * represents a particular four-value vector that is multiplied with the source or destination - * color in the blending formula. The blending formula is:

- * - *
result = source × sourceFactor + destination × destinationFactor
- * - *

In the formula, the source color is the output color of the pixel shader program. The - * destination color is the color that currently exists in the color buffer, as set by - * previous clear and draw operations.

- * - *

You can add your own blend modes via BlendMode.register. - * To get the math right, remember that all colors in Starling use premultiplied alpha (PMA), - * which means that their RGB values were multiplied with the alpha value.

- * - * @see flash.display3D.Context3DBlendFactor - */ - public class BlendMode - { - private var _name:String; - private var _sourceFactor:String; - private var _destinationFactor:String; - - private static var sBlendModes:Object; - - /** Creates a new BlendMode instance. Don't call this method directly; instead, - * register a new blend mode using BlendMode.register. */ - public function BlendMode(name:String, sourceFactor:String, destinationFactor:String) - { - _name = name; - _sourceFactor = sourceFactor; - _destinationFactor = destinationFactor; - } - - /** Inherits the blend mode from this display object's parent. */ - public static const AUTO:String = "auto"; - - /** Deactivates blending, i.e. disabling any transparency. */ - public static const NONE:String = "none"; - - /** The display object appears in front of the background. */ - public static const NORMAL:String = "normal"; - - /** Adds the values of the colors of the display object to the colors of its background. */ - public static const ADD:String = "add"; - - /** Multiplies the values of the display object colors with the the background color. */ - public static const MULTIPLY:String = "multiply"; - - /** Multiplies the complement (inverse) of the display object color with the complement of - * the background color, resulting in a bleaching effect. */ - public static const SCREEN:String = "screen"; - - /** Erases the background when drawn on a RenderTexture. */ - public static const ERASE:String = "erase"; - - /** When used on a RenderTexture, the drawn object will act as a mask for the current - * content, i.e. the source alpha overwrites the destination alpha. */ - public static const MASK:String = "mask"; - - /** Draws under/below existing objects; useful especially on RenderTextures. */ - public static const BELOW:String = "below"; - - // static access methods - - /** Returns the blend mode with the given name. - * Throws an ArgumentError if the mode does not exist. */ - public static function get(modeName:String):BlendMode - { - if (sBlendModes == null) registerDefaults(); - if (modeName in sBlendModes) return sBlendModes[modeName]; - else throw new ArgumentError("Blend mode not found: " + modeName); - } - - /** Registers a blending mode under a certain name. */ - public static function register(name:String, srcFactor:String, dstFactor:String):BlendMode - { - if (sBlendModes == null) registerDefaults(); - var blendMode:BlendMode = new BlendMode(name, srcFactor, dstFactor); - sBlendModes[name] = blendMode; - return blendMode; - } - - private static function registerDefaults():void - { - if (sBlendModes) return; - - sBlendModes = {}; - register("none" , Context3DBlendFactor.ONE, Context3DBlendFactor.ZERO); - register("normal", Context3DBlendFactor.ONE, Context3DBlendFactor.ONE_MINUS_SOURCE_ALPHA); - register("add", Context3DBlendFactor.ONE, Context3DBlendFactor.ONE); - register("multiply", Context3DBlendFactor.DESTINATION_COLOR, Context3DBlendFactor.ONE_MINUS_SOURCE_ALPHA); - register("screen", Context3DBlendFactor.ONE, Context3DBlendFactor.ONE_MINUS_SOURCE_COLOR); - register("erase", Context3DBlendFactor.ZERO, Context3DBlendFactor.ONE_MINUS_SOURCE_ALPHA); - register("mask", Context3DBlendFactor.ZERO, Context3DBlendFactor.SOURCE_ALPHA); - register("below", Context3DBlendFactor.ONE_MINUS_DESTINATION_ALPHA, Context3DBlendFactor.DESTINATION_ALPHA); - } - - // instance methods / properties - - /** Sets the appropriate blend factors for source and destination on the current context. */ - public function activate():void - { - Starling.context.setBlendFactors(_sourceFactor, _destinationFactor); - } - - /** Returns the name of the blend mode. */ - public function toString():String { return _name; } - - /** The source blend factor of this blend mode. */ - public function get sourceFactor():String { return _sourceFactor; } - - /** The destination blend factor of this blend mode. */ - public function get destinationFactor():String { return _destinationFactor; } - - /** Returns the name of the blend mode. */ - public function get name():String { return _name; } - } -} \ No newline at end of file diff --git a/mobile_version/src/starling/display/Button.as b/mobile_version/src/starling/display/Button.as deleted file mode 100644 index 54c84330..00000000 --- a/mobile_version/src/starling/display/Button.as +++ /dev/null @@ -1,455 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= - -package starling.display -{ - import flash.geom.Rectangle; - import flash.ui.Mouse; - import flash.ui.MouseCursor; - - import starling.events.Event; - import starling.events.Touch; - import starling.events.TouchEvent; - import starling.events.TouchPhase; - import starling.styles.MeshStyle; - import starling.text.TextField; - import starling.text.TextFormat; - import starling.textures.Texture; - - /** Dispatched when the user triggers the button. Bubbles. */ - [Event(name="triggered", type="starling.events.Event")] - - /** A simple button composed of an image and, optionally, text. - * - *

You can use different textures for various states of the button. If you're providing - * only an up state, the button is simply scaled a little when it is touched.

- * - *

In addition, you can overlay text on the button. To customize the text, you can use - * properties equivalent to those of the TextField class. Move the text to a certain position - * by updating the textBounds property.

- * - *

To react on touches on a button, there is special Event.TRIGGERED event. - * Use this event instead of normal touch events. That way, users can cancel button - * activation by moving the mouse/finger away from the button before releasing.

- */ - public class Button extends DisplayObjectContainer - { - private static const MAX_DRAG_DIST:Number = 50; - - private var _upState:Texture; - private var _downState:Texture; - private var _overState:Texture; - private var _disabledState:Texture; - - private var _contents:Sprite; - private var _body:Image; - private var _textField:TextField; - private var _textBounds:Rectangle; - private var _overlay:Sprite; - - private var _scaleWhenDown:Number; - private var _scaleWhenOver:Number; - private var _alphaWhenDown:Number; - private var _alphaWhenDisabled:Number; - private var _useHandCursor:Boolean; - private var _enabled:Boolean; - private var _state:String; - private var _triggerBounds:Rectangle; - - /** Creates a button with a set of state-textures and (optionally) some text. - * Any state that is left 'null' will display the up-state texture. Beware that all - * state textures should have the same dimensions. */ - public function Button(upState:Texture, text:String="", downState:Texture=null, - overState:Texture=null, disabledState:Texture=null) - { - if (upState == null) throw new ArgumentError("Texture 'upState' cannot be null"); - - _upState = upState; - _downState = downState; - _overState = overState; - _disabledState = disabledState; - - _state = ButtonState.UP; - _body = new Image(upState); - _body.pixelSnapping = true; - _scaleWhenDown = downState ? 1.0 : 0.9; - _scaleWhenOver = _alphaWhenDown = 1.0; - _alphaWhenDisabled = disabledState ? 1.0: 0.5; - _enabled = true; - _useHandCursor = true; - _textBounds = new Rectangle(0, 0, _body.width, _body.height); - _triggerBounds = new Rectangle(); - - _contents = new Sprite(); - _contents.addChild(_body); - addChild(_contents); - addEventListener(TouchEvent.TOUCH, onTouch); - - this.touchGroup = true; - this.text = text; - } - - /** @inheritDoc */ - public override function dispose():void - { - // text field might be disconnected from parent, so we have to dispose it manually - if (_textField) - _textField.dispose(); - - super.dispose(); - } - - /** Readjusts the dimensions of the button according to its current state texture. - * Call this method to synchronize button and texture size after assigning a texture - * with a different size. */ - public function readjustSize():void - { - var prevWidth:Number = _body.width; - var prevHeight:Number = _body.height; - - _body.readjustSize(); - - var scaleX:Number = _body.width / prevWidth; - var scaleY:Number = _body.height / prevHeight; - - _textBounds.x *= scaleX; - _textBounds.y *= scaleY; - _textBounds.width *= scaleX; - _textBounds.height *= scaleY; - - if (_textField) createTextField(); - } - - private function createTextField():void - { - if (_textField == null) - { - _textField = new TextField(_textBounds.width, _textBounds.height); - _textField.pixelSnapping = _body.pixelSnapping; - _textField.touchable = false; - _textField.autoScale = true; - _textField.batchable = true; - } - - _textField.width = _textBounds.width; - _textField.height = _textBounds.height; - _textField.x = _textBounds.x; - _textField.y = _textBounds.y; - } - - private function onTouch(event:TouchEvent):void - { - Mouse.cursor = (_useHandCursor && _enabled && event.interactsWith(this)) ? - MouseCursor.BUTTON : MouseCursor.AUTO; - - var touch:Touch = event.getTouch(this); - var isWithinBounds:Boolean; - - if (!_enabled) - { - return; - } - else if (touch == null) - { - state = ButtonState.UP; - } - else if (touch.phase == TouchPhase.HOVER) - { - state = ButtonState.OVER; - } - else if (touch.phase == TouchPhase.BEGAN && _state != ButtonState.DOWN) - { - _triggerBounds = getBounds(stage, _triggerBounds); - _triggerBounds.inflate(MAX_DRAG_DIST, MAX_DRAG_DIST); - - state = ButtonState.DOWN; - } - else if (touch.phase == TouchPhase.MOVED) - { - isWithinBounds = _triggerBounds.contains(touch.globalX, touch.globalY); - - if (_state == ButtonState.DOWN && !isWithinBounds) - { - // reset button when finger is moved too far away ... - state = ButtonState.UP; - } - else if (_state == ButtonState.UP && isWithinBounds) - { - // ... and reactivate when the finger moves back into the bounds. - state = ButtonState.DOWN; - } - } - else if (touch.phase == TouchPhase.ENDED && _state == ButtonState.DOWN) - { - state = ButtonState.UP; - if (!touch.cancelled) dispatchEventWith(Event.TRIGGERED, true); - } - } - - /** The current state of the button. The corresponding strings are found - * in the ButtonState class. */ - public function get state():String { return _state; } - public function set state(value:String):void - { - _state = value; - _contents.x = _contents.y = 0; - _contents.scaleX = _contents.scaleY = _contents.alpha = 1.0; - - switch (_state) - { - case ButtonState.DOWN: - setStateTexture(_downState); - _contents.alpha = _alphaWhenDown; - _contents.scaleX = _contents.scaleY = _scaleWhenDown; - _contents.x = (1.0 - _scaleWhenDown) / 2.0 * _body.width; - _contents.y = (1.0 - _scaleWhenDown) / 2.0 * _body.height; - break; - case ButtonState.UP: - setStateTexture(_upState); - break; - case ButtonState.OVER: - setStateTexture(_overState); - _contents.scaleX = _contents.scaleY = _scaleWhenOver; - _contents.x = (1.0 - _scaleWhenOver) / 2.0 * _body.width; - _contents.y = (1.0 - _scaleWhenOver) / 2.0 * _body.height; - break; - case ButtonState.DISABLED: - setStateTexture(_disabledState); - _contents.alpha = _alphaWhenDisabled; - break; - default: - throw new ArgumentError("Invalid button state: " + _state); - } - } - - private function setStateTexture(texture:Texture):void - { - _body.texture = texture ? texture : _upState; - } - - /** The scale factor of the button on touch. Per default, a button without a down state - * texture will be made slightly smaller, while a button with a down state texture - * remains unscaled. */ - public function get scaleWhenDown():Number { return _scaleWhenDown; } - public function set scaleWhenDown(value:Number):void { _scaleWhenDown = value; } - - /** The scale factor of the button while the mouse cursor hovers over it. @default 1.0 */ - public function get scaleWhenOver():Number { return _scaleWhenOver; } - public function set scaleWhenOver(value:Number):void { _scaleWhenOver = value; } - - /** The alpha value of the button on touch. @default 1.0 */ - public function get alphaWhenDown():Number { return _alphaWhenDown; } - public function set alphaWhenDown(value:Number):void { _alphaWhenDown = value; } - - /** The alpha value of the button when it is disabled. @default 0.5 */ - public function get alphaWhenDisabled():Number { return _alphaWhenDisabled; } - public function set alphaWhenDisabled(value:Number):void { _alphaWhenDisabled = value; } - - /** Indicates if the button can be triggered. */ - public function get enabled():Boolean { return _enabled; } - public function set enabled(value:Boolean):void - { - if (_enabled != value) - { - _enabled = value; - state = value ? ButtonState.UP : ButtonState.DISABLED; - } - } - - /** The text that is displayed on the button. */ - public function get text():String { return _textField ? _textField.text : ""; } - public function set text(value:String):void - { - if (value.length == 0) - { - if (_textField) - { - _textField.text = value; - _textField.removeFromParent(); - } - } - else - { - createTextField(); - _textField.text = value; - - if (_textField.parent == null) - _contents.addChild(_textField); - } - } - - /** The format of the button's TextField. */ - public function get textFormat():TextFormat - { - if (_textField == null) createTextField(); - return _textField.format; - } - - public function set textFormat(value:TextFormat):void - { - if (_textField == null) createTextField(); - _textField.format = value; - } - - /** The style that is used to render the button's TextField. */ - public function get textStyle():MeshStyle - { - if (_textField == null) createTextField(); - return _textField.style; - } - - public function set textStyle(value:MeshStyle):void - { - if (_textField == null) createTextField(); - _textField.style = value; - } - - /** The style that is used to render the Button. */ - public function get style():MeshStyle { return _body.style; } - public function set style(value:MeshStyle):void { _body.style = value; } - - /** The texture that is displayed when the button is not being touched. */ - public function get upState():Texture { return _upState; } - public function set upState(value:Texture):void - { - if (value == null) - throw new ArgumentError("Texture 'upState' cannot be null"); - - if (_upState != value) - { - _upState = value; - if ( _state == ButtonState.UP || - (_state == ButtonState.DISABLED && _disabledState == null) || - (_state == ButtonState.DOWN && _downState == null) || - (_state == ButtonState.OVER && _overState == null)) - { - setStateTexture(value); - } - } - } - - /** The texture that is displayed while the button is touched. */ - public function get downState():Texture { return _downState; } - public function set downState(value:Texture):void - { - if (_downState != value) - { - _downState = value; - if (_state == ButtonState.DOWN) setStateTexture(value); - } - } - - /** The texture that is displayed while mouse hovers over the button. */ - public function get overState():Texture { return _overState; } - public function set overState(value:Texture):void - { - if (_overState != value) - { - _overState = value; - if (_state == ButtonState.OVER) setStateTexture(value); - } - } - - /** The texture that is displayed when the button is disabled. */ - public function get disabledState():Texture { return _disabledState; } - public function set disabledState(value:Texture):void - { - if (_disabledState != value) - { - _disabledState = value; - if (_state == ButtonState.DISABLED) setStateTexture(value); - } - } - - /** The bounds of the button's TextField. Allows moving the text to a custom position. - * CAUTION: not a copy, but the actual object! Text will only update on re-assignment. - */ - public function get textBounds():Rectangle { return _textBounds; } - public function set textBounds(value:Rectangle):void - { - _textBounds.copyFrom(value); - createTextField(); - } - - /** The color of the button's state image. Just like every image object, each pixel's - * color is multiplied with this value. @default white */ - public function get color():uint { return _body.color; } - public function set color(value:uint):void { _body.color = value; } - - /** The smoothing type used for the button's state image. */ - public function get textureSmoothing():String { return _body.textureSmoothing; } - public function set textureSmoothing(value:String):void { _body.textureSmoothing = value; } - - /** The overlay sprite is displayed on top of the button contents. It scales with the - * button when pressed. Use it to add additional objects to the button (e.g. an icon). */ - public function get overlay():Sprite - { - if (_overlay == null) - _overlay = new Sprite(); - - _contents.addChild(_overlay); // make sure it's always on top - return _overlay; - } - - /** Indicates if the mouse cursor should transform into a hand while it's over the button. - * @default true */ - public override function get useHandCursor():Boolean { return _useHandCursor; } - public override function set useHandCursor(value:Boolean):void { _useHandCursor = value; } - - /** Controls whether or not the instance snaps to the nearest pixel. This can prevent the - * object from looking blurry when it's not exactly aligned with the pixels of the screen. - * @default true */ - public function get pixelSnapping():Boolean { return _body.pixelSnapping; } - public function set pixelSnapping(value:Boolean):void - { - _body.pixelSnapping = value; - if (_textField) _textField.pixelSnapping = value; - } - - /** @private */ - override public function set width(value:Number):void - { - // The Button might use a Scale9Grid -> - // we must update the body width/height manually for the grid to scale properly. - - var newWidth:Number = value / (this.scaleX || 1.0); - var scale:Number = newWidth / (_body.width || 1.0); - - _body.width = newWidth; - _textBounds.x *= scale; - _textBounds.width *= scale; - - if (_textField) _textField.width = newWidth; - } - - /** @private */ - override public function set height(value:Number):void - { - var newHeight:Number = value / (this.scaleY || 1.0); - var scale:Number = newHeight / (_body.height || 1.0); - - _body.height = newHeight; - _textBounds.y *= scale; - _textBounds.height *= scale; - - if (_textField) _textField.height = newHeight; - } - - /** The current scaling grid used for the button's state image. Use this property to create - * buttons that resize in a smart way, i.e. with the four corners keeping the same size - * and only stretching the center area. - * - * @see Image#scale9Grid - * @default null - */ - public function get scale9Grid():Rectangle { return _body.scale9Grid; } - public function set scale9Grid(value:Rectangle):void { _body.scale9Grid = value; } - } -} \ No newline at end of file diff --git a/mobile_version/src/starling/display/ButtonState.as b/mobile_version/src/starling/display/ButtonState.as deleted file mode 100644 index 151b8f62..00000000 --- a/mobile_version/src/starling/display/ButtonState.as +++ /dev/null @@ -1,33 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= - -package starling.display -{ - import starling.errors.AbstractClassError; - - /** A class that provides constant values for the states of the Button class. */ - public class ButtonState - { - /** @private */ - public function ButtonState() { throw new AbstractClassError(); } - - /** The button's default state. */ - public static const UP:String = "up"; - - /** The button is pressed. */ - public static const DOWN:String = "down"; - - /** The mouse hovers over the button. */ - public static const OVER:String = "over"; - - /** The button was disabled altogether. */ - public static const DISABLED:String = "disabled"; - } -} \ No newline at end of file diff --git a/mobile_version/src/starling/display/Canvas.as b/mobile_version/src/starling/display/Canvas.as deleted file mode 100644 index 9e5cf299..00000000 --- a/mobile_version/src/starling/display/Canvas.as +++ /dev/null @@ -1,121 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= - -package starling.display -{ - import flash.geom.Point; - - import starling.geom.Polygon; - import starling.rendering.IndexData; - import starling.rendering.VertexData; - - /** A display object supporting basic vector drawing functionality. In its current state, - * the main use of this class is to provide a range of forms that can be used as masks. - */ - public class Canvas extends DisplayObjectContainer - { - private var _polygons:Vector.; - private var _fillColor:uint; - private var _fillAlpha:Number; - - /** Creates a new (empty) Canvas. Call one or more of the 'draw' methods to add content. */ - public function Canvas() - { - _polygons = new []; - _fillColor = 0xffffff; - _fillAlpha = 1.0; - touchGroup = true; - } - - /** @inheritDoc */ - public override function dispose():void - { - _polygons.length = 0; - super.dispose(); - } - - /** @inheritDoc */ - public override function hitTest(localPoint:Point):DisplayObject - { - if (!visible || !touchable || !hitTestMask(localPoint)) return null; - - // we could also use the standard hit test implementation, but the polygon class can - // do that much more efficiently (it contains custom implementations for circles, etc). - - for (var i:int = 0, len:int = _polygons.length; i < len; ++i) - if (_polygons[i].containsPoint(localPoint)) return this; - - return null; - } - - /** Draws a circle. */ - public function drawCircle(x:Number, y:Number, radius:Number):void - { - appendPolygon(Polygon.createCircle(x, y, radius)); - } - - /** Draws an ellipse. */ - public function drawEllipse(x:Number, y:Number, width:Number, height:Number):void - { - var radiusX:Number = width / 2.0; - var radiusY:Number = height / 2.0; - - appendPolygon(Polygon.createEllipse(x + radiusX, y + radiusY, radiusX, radiusY)); - } - - /** Draws a rectangle. */ - public function drawRectangle(x:Number, y:Number, width:Number, height:Number):void - { - appendPolygon(Polygon.createRectangle(x, y, width, height)); - } - - /** Draws an arbitrary polygon. */ - public function drawPolygon(polygon:Polygon):void - { - appendPolygon(polygon); - } - - /** Specifies a simple one-color fill that subsequent calls to drawing methods - * (such as drawCircle()) will use. */ - public function beginFill(color:uint=0xffffff, alpha:Number=1.0):void - { - _fillColor = color; - _fillAlpha = alpha; - } - - /** Resets the color to 'white' and alpha to '1'. */ - public function endFill():void - { - _fillColor = 0xffffff; - _fillAlpha = 1.0; - } - - /** Removes all existing vertices. */ - public function clear():void - { - removeChildren(0, -1, true); - _polygons.length = 0; - } - - private function appendPolygon(polygon:Polygon):void - { - var vertexData:VertexData = new VertexData(); - var indexData:IndexData = new IndexData(polygon.numTriangles * 3); - - polygon.triangulate(indexData); - polygon.copyToVertexData(vertexData); - - vertexData.colorize("color", _fillColor, _fillAlpha); - - addChild(new Mesh(vertexData, indexData)); - _polygons[_polygons.length] = polygon; - } - } -} diff --git a/mobile_version/src/starling/display/DisplayObject.as b/mobile_version/src/starling/display/DisplayObject.as deleted file mode 100644 index 34b1d179..00000000 --- a/mobile_version/src/starling/display/DisplayObject.as +++ /dev/null @@ -1,1111 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= - -package starling.display -{ - import flash.errors.IllegalOperationError; - import flash.geom.Matrix; - import flash.geom.Matrix3D; - import flash.geom.Point; - import flash.geom.Rectangle; - import flash.geom.Vector3D; - import flash.system.Capabilities; - import flash.ui.Mouse; - import flash.ui.MouseCursor; - import flash.utils.getQualifiedClassName; - - import starling.core.Starling; - import starling.core.starling_internal; - import starling.errors.AbstractClassError; - import starling.errors.AbstractMethodError; - import starling.events.Event; - import starling.events.EventDispatcher; - import starling.events.TouchEvent; - import starling.filters.FragmentFilter; - import starling.rendering.BatchToken; - import starling.rendering.Painter; - import starling.utils.Align; - import starling.utils.MathUtil; - import starling.utils.MatrixUtil; - - use namespace starling_internal; - - /** Dispatched when an object is added to a parent. */ - [Event(name="added", type="starling.events.Event")] - - /** Dispatched when an object is connected to the stage (directly or indirectly). */ - [Event(name="addedToStage", type="starling.events.Event")] - - /** Dispatched when an object is removed from its parent. */ - [Event(name="removed", type="starling.events.Event")] - - /** Dispatched when an object is removed from the stage and won't be rendered any longer. */ - [Event(name="removedFromStage", type="starling.events.Event")] - - /** Dispatched once every frame on every object that is connected to the stage. */ - [Event(name="enterFrame", type="starling.events.EnterFrameEvent")] - - /** Dispatched when an object is touched. Bubbles. */ - [Event(name="touch", type="starling.events.TouchEvent")] - - /** Dispatched when a key on the keyboard is released. */ - [Event(name="keyUp", type="starling.events.KeyboardEvent")] - - /** Dispatched when a key on the keyboard is pressed. */ - [Event(name="keyDown", type="starling.events.KeyboardEvent")] - - /** - * The DisplayObject class is the base class for all objects that are rendered on the - * screen. - * - *

The Display Tree

- * - *

In Starling, all displayable objects are organized in a display tree. Only objects that - * are part of the display tree will be displayed (rendered).

- * - *

The display tree consists of leaf nodes (Image, Quad) that will be rendered directly to - * the screen, and of container nodes (subclasses of "DisplayObjectContainer", like "Sprite"). - * A container is simply a display object that has child nodes - which can, again, be either - * leaf nodes or other containers.

- * - *

At the base of the display tree, there is the Stage, which is a container, too. To create - * a Starling application, you create a custom Sprite subclass, and Starling will add an - * instance of this class to the stage.

- * - *

A display object has properties that define its position in relation to its parent - * (x, y), as well as its rotation and scaling factors (scaleX, scaleY). Use the - * alpha and visible properties to make an object translucent or - * invisible.

- * - *

Every display object may be the target of touch events. If you don't want an object to be - * touchable, you can disable the "touchable" property. When it's disabled, neither the object - * nor its children will receive any more touch events.

- * - * Transforming coordinates - * - *

Within the display tree, each object has its own local coordinate system. If you rotate - * a container, you rotate that coordinate system - and thus all the children of the - * container.

- * - *

Sometimes you need to know where a certain point lies relative to another coordinate - * system. That's the purpose of the method getTransformationMatrix. It will - * create a matrix that represents the transformation of a point in one coordinate system to - * another.

- * - * Customization - * - *

DisplayObject is an abstract class, which means you cannot instantiate it directly, - * but have to use one of its many subclasses instead. For leaf nodes, this is typically - * 'Mesh' or its subclasses 'Quad' and 'Image'. To customize rendering of these objects, - * you can use fragment filters (via the filter-property on 'DisplayObject') - * or mesh styles (via the style-property on 'Mesh'). Look at the respective - * class documentation for more information.

- * - * @see DisplayObjectContainer - * @see Sprite - * @see Stage - * @see Mesh - * @see starling.filters.FragmentFilter - * @see starling.styles.MeshStyle - */ - public class DisplayObject extends EventDispatcher - { - // private members - - private var _x:Number; - private var _y:Number; - private var _pivotX:Number; - private var _pivotY:Number; - private var _scaleX:Number; - private var _scaleY:Number; - private var _skewX:Number; - private var _skewY:Number; - private var _rotation:Number; - private var _alpha:Number; - private var _visible:Boolean; - private var _touchable:Boolean; - private var _blendMode:String; - private var _name:String; - private var _useHandCursor:Boolean; - private var _transformationMatrix:Matrix; - private var _transformationMatrix3D:Matrix3D; - private var _orientationChanged:Boolean; - private var _is3D:Boolean; - private var _maskee:DisplayObject; - - // internal members (for fast access on rendering) - - /** @private */ internal var _parent:DisplayObjectContainer; - /** @private */ internal var _lastParentOrSelfChangeFrameID:uint; - /** @private */ internal var _lastChildChangeFrameID:uint; - /** @private */ internal var _tokenFrameID:uint; - /** @private */ internal var _pushToken:BatchToken = new BatchToken(); - /** @private */ internal var _popToken:BatchToken = new BatchToken(); - /** @private */ internal var _hasVisibleArea:Boolean; - /** @private */ internal var _filter:FragmentFilter; - /** @private */ internal var _mask:DisplayObject; - - // helper objects - - private static var sAncestors:Vector. = new []; - private static var sHelperPoint:Point = new Point(); - private static var sHelperPoint3D:Vector3D = new Vector3D(); - private static var sHelperPointAlt3D:Vector3D = new Vector3D(); - private static var sHelperRect:Rectangle = new Rectangle(); - private static var sHelperMatrix:Matrix = new Matrix(); - private static var sHelperMatrixAlt:Matrix = new Matrix(); - private static var sHelperMatrix3D:Matrix3D = new Matrix3D(); - private static var sHelperMatrixAlt3D:Matrix3D = new Matrix3D(); - - /** @private */ - public function DisplayObject() - { - if (Capabilities.isDebugger && - getQualifiedClassName(this) == "starling.display::DisplayObject") - { - throw new AbstractClassError(); - } - - _x = _y = _pivotX = _pivotY = _rotation = _skewX = _skewY = 0.0; - _scaleX = _scaleY = _alpha = 1.0; - _visible = _touchable = _hasVisibleArea = true; - _blendMode = BlendMode.AUTO; - _transformationMatrix = new Matrix(); - } - - /** Disposes all resources of the display object. - * GPU buffers are released, event listeners are removed, filters and masks are disposed. */ - public function dispose():void - { - if (_filter) _filter.dispose(); - if (_mask) _mask.dispose(); - removeEventListeners(); - mask = null; // clear 'mask._maskee', just to be sure. - } - - /** Removes the object from its parent, if it has one, and optionally disposes it. */ - public function removeFromParent(dispose:Boolean=false):void - { - if (_parent) _parent.removeChild(this, dispose); - else if (dispose) this.dispose(); - } - - /** Creates a matrix that represents the transformation from the local coordinate system - * to another. If you pass an out-matrix, the result will be stored in this - * matrix instead of creating a new object. */ - public function getTransformationMatrix(targetSpace:DisplayObject, - out:Matrix=null):Matrix - { - var commonParent:DisplayObject; - var currentObject:DisplayObject; - - if (out) out.identity(); - else out = new Matrix(); - - if (targetSpace == this) - { - return out; - } - else if (targetSpace == _parent || (targetSpace == null && _parent == null)) - { - out.copyFrom(transformationMatrix); - return out; - } - else if (targetSpace == null || targetSpace == base) - { - // targetCoordinateSpace 'null' represents the target space of the base object. - // -> move up from this to base - - currentObject = this; - while (currentObject != targetSpace) - { - out.concat(currentObject.transformationMatrix); - currentObject = currentObject._parent; - } - - return out; - } - else if (targetSpace._parent == this) // optimization - { - targetSpace.getTransformationMatrix(this, out); - out.invert(); - - return out; - } - - // 1. find a common parent of this and the target space - - commonParent = findCommonParent(this, targetSpace); - - // 2. move up from this to common parent - - currentObject = this; - while (currentObject != commonParent) - { - out.concat(currentObject.transformationMatrix); - currentObject = currentObject._parent; - } - - if (commonParent == targetSpace) - return out; - - // 3. now move up from target until we reach the common parent - - sHelperMatrix.identity(); - currentObject = targetSpace; - while (currentObject != commonParent) - { - sHelperMatrix.concat(currentObject.transformationMatrix); - currentObject = currentObject._parent; - } - - // 4. now combine the two matrices - - sHelperMatrix.invert(); - out.concat(sHelperMatrix); - - return out; - } - - /** Returns a rectangle that completely encloses the object as it appears in another - * coordinate system. If you pass an out-rectangle, the result will be - * stored in this rectangle instead of creating a new object. */ - public function getBounds(targetSpace:DisplayObject, out:Rectangle=null):Rectangle - { - throw new AbstractMethodError(); - } - - /** Returns the object that is found topmost beneath a point in local coordinates, or nil - * if the test fails. Untouchable and invisible objects will cause the test to fail. */ - public function hitTest(localPoint:Point):DisplayObject - { - // on a touch test, invisible or untouchable objects cause the test to fail - if (!_visible || !_touchable) return null; - - // if we've got a mask and the hit occurs outside, fail - if (_mask && !hitTestMask(localPoint)) return null; - - // otherwise, check bounding box - if (getBounds(this, sHelperRect).containsPoint(localPoint)) return this; - else return null; - } - - /** Checks if a certain point is inside the display object's mask. If there is no mask, - * this method always returns true (because having no mask is equivalent - * to having one that's infinitely big). */ - public function hitTestMask(localPoint:Point):Boolean - { - if (_mask) - { - if (_mask.stage) getTransformationMatrix(_mask, sHelperMatrixAlt); - else - { - sHelperMatrixAlt.copyFrom(_mask.transformationMatrix); - sHelperMatrixAlt.invert(); - } - - var helperPoint:Point = localPoint == sHelperPoint ? new Point() : sHelperPoint; - MatrixUtil.transformPoint(sHelperMatrixAlt, localPoint, helperPoint); - return _mask.hitTest(helperPoint) != null; - } - else return true; - } - - /** Transforms a point from the local coordinate system to global (stage) coordinates. - * If you pass an out-point, the result will be stored in this point instead - * of creating a new object. */ - public function localToGlobal(localPoint:Point, out:Point=null):Point - { - if (is3D) - { - sHelperPoint3D.setTo(localPoint.x, localPoint.y, 0); - return local3DToGlobal(sHelperPoint3D, out); - } - else - { - getTransformationMatrix(base, sHelperMatrixAlt); - return MatrixUtil.transformPoint(sHelperMatrixAlt, localPoint, out); - } - } - - /** Transforms a point from global (stage) coordinates to the local coordinate system. - * If you pass an out-point, the result will be stored in this point instead - * of creating a new object. */ - public function globalToLocal(globalPoint:Point, out:Point=null):Point - { - if (is3D) - { - globalToLocal3D(globalPoint, sHelperPoint3D); - stage.getCameraPosition(this, sHelperPointAlt3D); - return MathUtil.intersectLineWithXYPlane(sHelperPointAlt3D, sHelperPoint3D, out); - } - else - { - getTransformationMatrix(base, sHelperMatrixAlt); - sHelperMatrixAlt.invert(); - return MatrixUtil.transformPoint(sHelperMatrixAlt, globalPoint, out); - } - } - - /** Renders the display object with the help of a painter object. Never call this method - * directly, except from within another render method. - * - * @param painter Captures the current render state and provides utility functions - * for rendering. - */ - public function render(painter:Painter):void - { - throw new AbstractMethodError(); - } - - /** Moves the pivot point to a certain position within the local coordinate system - * of the object. If you pass no arguments, it will be centered. */ - public function alignPivot(horizontalAlign:String="center", - verticalAlign:String="center"):void - { - var bounds:Rectangle = getBounds(this, sHelperRect); - setOrientationChanged(); - - if (horizontalAlign == Align.LEFT) _pivotX = bounds.x; - else if (horizontalAlign == Align.CENTER) _pivotX = bounds.x + bounds.width / 2.0; - else if (horizontalAlign == Align.RIGHT) _pivotX = bounds.x + bounds.width; - else throw new ArgumentError("Invalid horizontal alignment: " + horizontalAlign); - - if (verticalAlign == Align.TOP) _pivotY = bounds.y; - else if (verticalAlign == Align.CENTER) _pivotY = bounds.y + bounds.height / 2.0; - else if (verticalAlign == Align.BOTTOM) _pivotY = bounds.y + bounds.height; - else throw new ArgumentError("Invalid vertical alignment: " + verticalAlign); - } - - // 3D transformation - - /** Creates a matrix that represents the transformation from the local coordinate system - * to another. This method supports three dimensional objects created via 'Sprite3D'. - * If you pass an out-matrix, the result will be stored in this matrix - * instead of creating a new object. */ - public function getTransformationMatrix3D(targetSpace:DisplayObject, - out:Matrix3D=null):Matrix3D - { - var commonParent:DisplayObject; - var currentObject:DisplayObject; - - if (out) out.identity(); - else out = new Matrix3D(); - - if (targetSpace == this) - { - return out; - } - else if (targetSpace == _parent || (targetSpace == null && _parent == null)) - { - out.copyFrom(transformationMatrix3D); - return out; - } - else if (targetSpace == null || targetSpace == base) - { - // targetCoordinateSpace 'null' represents the target space of the base object. - // -> move up from this to base - - currentObject = this; - while (currentObject != targetSpace) - { - out.append(currentObject.transformationMatrix3D); - currentObject = currentObject._parent; - } - - return out; - } - else if (targetSpace._parent == this) // optimization - { - targetSpace.getTransformationMatrix3D(this, out); - out.invert(); - - return out; - } - - // 1. find a common parent of this and the target space - - commonParent = findCommonParent(this, targetSpace); - - // 2. move up from this to common parent - - currentObject = this; - while (currentObject != commonParent) - { - out.append(currentObject.transformationMatrix3D); - currentObject = currentObject._parent; - } - - if (commonParent == targetSpace) - return out; - - // 3. now move up from target until we reach the common parent - - sHelperMatrix3D.identity(); - currentObject = targetSpace; - while (currentObject != commonParent) - { - sHelperMatrix3D.append(currentObject.transformationMatrix3D); - currentObject = currentObject._parent; - } - - // 4. now combine the two matrices - - sHelperMatrix3D.invert(); - out.append(sHelperMatrix3D); - - return out; - } - - /** Transforms a 3D point from the local coordinate system to global (stage) coordinates. - * This is achieved by projecting the 3D point onto the (2D) view plane. - * - *

If you pass an out-point, the result will be stored in this point - * instead of creating a new object.

*/ - public function local3DToGlobal(localPoint:Vector3D, out:Point=null):Point - { - var stage:Stage = this.stage; - if (stage == null) throw new IllegalOperationError("Object not connected to stage"); - - getTransformationMatrix3D(stage, sHelperMatrixAlt3D); - MatrixUtil.transformPoint3D(sHelperMatrixAlt3D, localPoint, sHelperPoint3D); - return MathUtil.intersectLineWithXYPlane(stage.cameraPosition, sHelperPoint3D, out); - } - - /** Transforms a point from global (stage) coordinates to the 3D local coordinate system. - * If you pass an out-vector, the result will be stored in this vector - * instead of creating a new object. */ - public function globalToLocal3D(globalPoint:Point, out:Vector3D=null):Vector3D - { - var stage:Stage = this.stage; - if (stage == null) throw new IllegalOperationError("Object not connected to stage"); - - getTransformationMatrix3D(stage, sHelperMatrixAlt3D); - sHelperMatrixAlt3D.invert(); - return MatrixUtil.transformCoords3D( - sHelperMatrixAlt3D, globalPoint.x, globalPoint.y, 0, out); - } - - // internal methods - - /** @private */ - starling_internal function setParent(value:DisplayObjectContainer):void - { - // check for a recursion - var ancestor:DisplayObject = value; - while (ancestor != this && ancestor != null) - ancestor = ancestor._parent; - - if (ancestor == this) - throw new ArgumentError("An object cannot be added as a child to itself or one " + - "of its children (or children's children, etc.)"); - else - _parent = value; - } - - /** @private */ - internal function setIs3D(value:Boolean):void - { - _is3D = value; - } - - /** @private */ - internal function get isMask():Boolean - { - return _maskee != null; - } - - // render cache - - /** Forces the object to be redrawn in the next frame. - * This will prevent the object to be drawn from the render cache. - * - *

This method is called every time the object changes in any way. When creating - * custom mesh styles or any other custom rendering code, call this method if the object - * needs to be redrawn.

- * - *

If the object needs to be redrawn just because it does not support the render cache, - * call painter.excludeFromCache() in the object's render method instead. - * That way, Starling's skipUnchangedFrames policy won't be disrupted.

- */ - public function setRequiresRedraw():void - { - var parent:DisplayObject = _parent || _maskee; - var frameID:int = Starling.frameID; - - _lastParentOrSelfChangeFrameID = frameID; - _hasVisibleArea = _alpha != 0.0 && _visible && _maskee == null && - _scaleX != 0.0 && _scaleY != 0.0; - - while (parent && parent._lastChildChangeFrameID != frameID) - { - parent._lastChildChangeFrameID = frameID; - parent = parent._parent || parent._maskee; - } - } - - /** Indicates if the object needs to be redrawn in the upcoming frame, i.e. if it has - * changed its location relative to the stage or some other aspect of its appearance - * since it was last rendered. */ - public function get requiresRedraw():Boolean - { - var frameID:uint = Starling.frameID; - - return _lastParentOrSelfChangeFrameID == frameID || - _lastChildChangeFrameID == frameID; - } - - /** @private Makes sure the object is not drawn from cache in the next frame. - * This method is meant to be called only from Painter.finishFrame(), - * since it requires rendering to be concluded. */ - starling_internal function excludeFromCache():void - { - var object:DisplayObject = this; - var max:uint = 0xffffffff; - - while (object && object._tokenFrameID != max) - { - object._tokenFrameID = max; - object = object._parent; - } - } - - // helpers - - private function setOrientationChanged():void - { - _orientationChanged = true; - setRequiresRedraw(); - } - - private static function findCommonParent(object1:DisplayObject, - object2:DisplayObject):DisplayObject - { - var currentObject:DisplayObject = object1; - - while (currentObject) - { - sAncestors[sAncestors.length] = currentObject; // avoiding 'push' - currentObject = currentObject._parent; - } - - currentObject = object2; - while (currentObject && sAncestors.indexOf(currentObject) == -1) - currentObject = currentObject._parent; - - sAncestors.length = 0; - - if (currentObject) return currentObject; - else throw new ArgumentError("Object not connected to target"); - } - - // stage event handling - - /** @private */ - public override function dispatchEvent(event:Event):void - { - if (event.type == Event.REMOVED_FROM_STAGE && stage == null) - return; // special check to avoid double-dispatch of RfS-event. - else - super.dispatchEvent(event); - } - - // enter frame event optimization - - // To avoid looping through the complete display tree each frame to find out who's - // listening to ENTER_FRAME events, we manage a list of them manually in the Stage class. - // We need to take care that (a) it must be dispatched only when the object is - // part of the stage, (b) it must not cause memory leaks when the user forgets to call - // dispose and (c) there might be multiple listeners for this event. - - /** @inheritDoc */ - public override function addEventListener(type:String, listener:Function):void - { - if (type == Event.ENTER_FRAME && !hasEventListener(type)) - { - addEventListener(Event.ADDED_TO_STAGE, addEnterFrameListenerToStage); - addEventListener(Event.REMOVED_FROM_STAGE, removeEnterFrameListenerFromStage); - if (this.stage) addEnterFrameListenerToStage(); - } - - super.addEventListener(type, listener); - } - - /** @inheritDoc */ - public override function removeEventListener(type:String, listener:Function):void - { - super.removeEventListener(type, listener); - - if (type == Event.ENTER_FRAME && !hasEventListener(type)) - { - removeEventListener(Event.ADDED_TO_STAGE, addEnterFrameListenerToStage); - removeEventListener(Event.REMOVED_FROM_STAGE, removeEnterFrameListenerFromStage); - removeEnterFrameListenerFromStage(); - } - } - - /** @inheritDoc */ - public override function removeEventListeners(type:String=null):void - { - if ((type == null || type == Event.ENTER_FRAME) && hasEventListener(Event.ENTER_FRAME)) - { - removeEventListener(Event.ADDED_TO_STAGE, addEnterFrameListenerToStage); - removeEventListener(Event.REMOVED_FROM_STAGE, removeEnterFrameListenerFromStage); - removeEnterFrameListenerFromStage(); - } - - super.removeEventListeners(type); - } - - private function addEnterFrameListenerToStage():void - { - Starling.current.stage.addEnterFrameListener(this); - } - - private function removeEnterFrameListenerFromStage():void - { - Starling.current.stage.removeEnterFrameListener(this); - } - - // properties - - /** The transformation matrix of the object relative to its parent. - * - *

If you assign a custom transformation matrix, Starling will try to figure out - * suitable values for x, y, scaleX, scaleY, and rotation. - * However, if the matrix was created in a different way, this might not be possible. - * In that case, Starling will apply the matrix, but not update the corresponding - * properties.

- * - *

CAUTION: not a copy, but the actual object!

*/ - public function get transformationMatrix():Matrix - { - if (_orientationChanged) - { - _orientationChanged = false; - - if (_skewX == 0.0 && _skewY == 0.0) - { - // optimization: no skewing / rotation simplifies the matrix math - - if (_rotation == 0.0) - { - _transformationMatrix.setTo(_scaleX, 0.0, 0.0, _scaleY, - _x - _pivotX * _scaleX, _y - _pivotY * _scaleY); - } - else - { - var cos:Number = Math.cos(_rotation); - var sin:Number = Math.sin(_rotation); - var a:Number = _scaleX * cos; - var b:Number = _scaleX * sin; - var c:Number = _scaleY * -sin; - var d:Number = _scaleY * cos; - var tx:Number = _x - _pivotX * a - _pivotY * c; - var ty:Number = _y - _pivotX * b - _pivotY * d; - - _transformationMatrix.setTo(a, b, c, d, tx, ty); - } - } - else - { - _transformationMatrix.identity(); - _transformationMatrix.scale(_scaleX, _scaleY); - MatrixUtil.skew(_transformationMatrix, _skewX, _skewY); - _transformationMatrix.rotate(_rotation); - _transformationMatrix.translate(_x, _y); - - if (_pivotX != 0.0 || _pivotY != 0.0) - { - // prepend pivot transformation - _transformationMatrix.tx = _x - _transformationMatrix.a * _pivotX - - _transformationMatrix.c * _pivotY; - _transformationMatrix.ty = _y - _transformationMatrix.b * _pivotX - - _transformationMatrix.d * _pivotY; - } - } - } - - return _transformationMatrix; - } - - public function set transformationMatrix(matrix:Matrix):void - { - const PI_Q:Number = Math.PI / 4.0; - - setRequiresRedraw(); - _orientationChanged = false; - _transformationMatrix.copyFrom(matrix); - _pivotX = _pivotY = 0; - - _x = matrix.tx; - _y = matrix.ty; - - _skewX = Math.atan(-matrix.c / matrix.d); - _skewY = Math.atan( matrix.b / matrix.a); - - // NaN check ("isNaN" causes allocation) - if (_skewX != _skewX) _skewX = 0.0; - if (_skewY != _skewY) _skewY = 0.0; - - _scaleY = (_skewX > -PI_Q && _skewX < PI_Q) ? matrix.d / Math.cos(_skewX) - : -matrix.c / Math.sin(_skewX); - _scaleX = (_skewY > -PI_Q && _skewY < PI_Q) ? matrix.a / Math.cos(_skewY) - : matrix.b / Math.sin(_skewY); - - if (MathUtil.isEquivalent(_skewX, _skewY)) - { - _rotation = _skewX; - _skewX = _skewY = 0; - } - else - { - _rotation = 0; - } - } - - /** The 3D transformation matrix of the object relative to its parent. - * - *

For 2D objects, this property returns just a 3D version of the 2D transformation - * matrix. Only the 'Sprite3D' class supports real 3D transformations.

- * - *

CAUTION: not a copy, but the actual object!

*/ - public function get transformationMatrix3D():Matrix3D - { - // this method needs to be overridden in 3D-supporting subclasses (like Sprite3D). - - if (_transformationMatrix3D == null) - _transformationMatrix3D = new Matrix3D(); - - return MatrixUtil.convertTo3D(transformationMatrix, _transformationMatrix3D); - } - - /** Indicates if this object or any of its parents is a 'Sprite3D' object. */ - public function get is3D():Boolean { return _is3D; } - - /** Indicates if the mouse cursor should transform into a hand while it's over the sprite. - * @default false */ - public function get useHandCursor():Boolean { return _useHandCursor; } - public function set useHandCursor(value:Boolean):void - { - if (value == _useHandCursor) return; - _useHandCursor = value; - - if (_useHandCursor) - addEventListener(TouchEvent.TOUCH, onTouch); - else - removeEventListener(TouchEvent.TOUCH, onTouch); - } - - private function onTouch(event:TouchEvent):void - { - Mouse.cursor = event.interactsWith(this) ? MouseCursor.BUTTON : MouseCursor.AUTO; - } - - /** The bounds of the object relative to the local coordinates of the parent. */ - public function get bounds():Rectangle - { - return getBounds(_parent); - } - - /** The width of the object in pixels. - * Note that for objects in a 3D space (connected to a Sprite3D), this value might not - * be accurate until the object is part of the display list. */ - public function get width():Number { return getBounds(_parent, sHelperRect).width; } - public function set width(value:Number):void - { - // this method calls 'this.scaleX' instead of changing _scaleX directly. - // that way, subclasses reacting on size changes need to override only the scaleX method. - - var actualWidth:Number; - var scaleIsNaN:Boolean = _scaleX != _scaleX; // avoid 'isNaN' call - - if (_scaleX == 0.0 || scaleIsNaN) { scaleX = 1.0; actualWidth = width; } - else actualWidth = Math.abs(width / _scaleX); - - if (actualWidth) scaleX = value / actualWidth; - } - - /** The height of the object in pixels. - * Note that for objects in a 3D space (connected to a Sprite3D), this value might not - * be accurate until the object is part of the display list. */ - public function get height():Number { return getBounds(_parent, sHelperRect).height; } - public function set height(value:Number):void - { - var actualHeight:Number; - var scaleIsNaN:Boolean = _scaleY != _scaleY; // avoid 'isNaN' call - - if (_scaleY == 0.0 || scaleIsNaN) { scaleY = 1.0; actualHeight = height; } - else actualHeight = Math.abs(height / _scaleY); - - if (actualHeight) scaleY = value / actualHeight; - } - - /** The x coordinate of the object relative to the local coordinates of the parent. */ - public function get x():Number { return _x; } - public function set x(value:Number):void - { - if (_x != value) - { - _x = value; - setOrientationChanged(); - } - } - - /** The y coordinate of the object relative to the local coordinates of the parent. */ - public function get y():Number { return _y; } - public function set y(value:Number):void - { - if (_y != value) - { - _y = value; - setOrientationChanged(); - } - } - - /** The x coordinate of the object's origin in its own coordinate space (default: 0). */ - public function get pivotX():Number { return _pivotX; } - public function set pivotX(value:Number):void - { - if (_pivotX != value) - { - _pivotX = value; - setOrientationChanged(); - } - } - - /** The y coordinate of the object's origin in its own coordinate space (default: 0). */ - public function get pivotY():Number { return _pivotY; } - public function set pivotY(value:Number):void - { - if (_pivotY != value) - { - _pivotY = value; - setOrientationChanged(); - } - } - - /** The horizontal scale factor. '1' means no scale, negative values flip the object. - * @default 1 */ - public function get scaleX():Number { return _scaleX; } - public function set scaleX(value:Number):void - { - if (_scaleX != value) - { - _scaleX = value; - setOrientationChanged(); - } - } - - /** The vertical scale factor. '1' means no scale, negative values flip the object. - * @default 1 */ - public function get scaleY():Number { return _scaleY; } - public function set scaleY(value:Number):void - { - if (_scaleY != value) - { - _scaleY = value; - setOrientationChanged(); - } - } - - /** Sets both 'scaleX' and 'scaleY' to the same value. The getter simply returns the - * value of 'scaleX' (even if the scaling values are different). @default 1 */ - public function get scale():Number { return scaleX; } - public function set scale(value:Number):void { scaleX = scaleY = value; } - - /** The horizontal skew angle in radians. */ - public function get skewX():Number { return _skewX; } - public function set skewX(value:Number):void - { - value = MathUtil.normalizeAngle(value); - - if (_skewX != value) - { - _skewX = value; - setOrientationChanged(); - } - } - - /** The vertical skew angle in radians. */ - public function get skewY():Number { return _skewY; } - public function set skewY(value:Number):void - { - value = MathUtil.normalizeAngle(value); - - if (_skewY != value) - { - _skewY = value; - setOrientationChanged(); - } - } - - /** The rotation of the object in radians. (In Starling, all angles are measured - * in radians.) */ - public function get rotation():Number { return _rotation; } - public function set rotation(value:Number):void - { - value = MathUtil.normalizeAngle(value); - - if (_rotation != value) - { - _rotation = value; - setOrientationChanged(); - } - } - - /** @private Indicates if the object is rotated or skewed in any way. */ - internal function get isRotated():Boolean - { - return _rotation != 0.0 || _skewX != 0.0 || _skewY != 0.0; - } - - /** The opacity of the object. 0 = transparent, 1 = opaque. @default 1 */ - public function get alpha():Number { return _alpha; } - public function set alpha(value:Number):void - { - if (value != _alpha) - { - _alpha = value < 0.0 ? 0.0 : (value > 1.0 ? 1.0 : value); - setRequiresRedraw(); - } - } - - /** The visibility of the object. An invisible object will be untouchable. */ - public function get visible():Boolean { return _visible; } - public function set visible(value:Boolean):void - { - if (value != _visible) - { - _visible = value; - setRequiresRedraw(); - } - } - - /** Indicates if this object (and its children) will receive touch events. */ - public function get touchable():Boolean { return _touchable; } - public function set touchable(value:Boolean):void { _touchable = value; } - - /** The blend mode determines how the object is blended with the objects underneath. - * @default auto - * @see starling.display.BlendMode */ - public function get blendMode():String { return _blendMode; } - public function set blendMode(value:String):void - { - if (value != _blendMode) - { - _blendMode = value; - setRequiresRedraw(); - } - } - - /** The name of the display object (default: null). Used by 'getChildByName()' of - * display object containers. */ - public function get name():String { return _name; } - public function set name(value:String):void { _name = value; } - - /** The filter that is attached to the display object. The starling.filters - * package contains several classes that define specific filters you can use. To combine - * several filters, assign an instance of the FilterChain class; to remove - * all filters, assign null. - * - *

Beware that a filter instance may only be used on one object at a time! Furthermore, - * when you remove or replace a filter, it is NOT disposed automatically (since you might - * want to reuse it on a different object).

- * - * @default null - * @see starling.filters.FragmentFilter - * @see starling.filters.FilterChain - */ - public function get filter():FragmentFilter { return _filter; } - public function set filter(value:FragmentFilter):void - { - if (value != _filter) - { - if (_filter) _filter.setTarget(null); - if (value) value.setTarget(this); - - _filter = value; - setRequiresRedraw(); - } - } - - /** The display object that acts as a mask for the current object. - * Assign null to remove it. - * - *

A pixel of the masked display object will only be drawn if it is within one of the - * mask's polygons. Texture pixels and alpha values of the mask are not taken into - * account. The mask object itself is never visible.

- * - *

If the mask is part of the display list, masking will occur at exactly the - * location it occupies on the stage. If it is not, the mask will be placed in the local - * coordinate system of the target object (as if it was one of its children).

- * - *

For rectangular masks, you can use simple quads; for other forms (like circles - * or arbitrary shapes) it is recommended to use a 'Canvas' instance.

- * - *

Beware that a mask will typically cause at least two additional draw calls: - * one to draw the mask to the stencil buffer and one to erase it. However, if the - * mask object is an instance of starling.display.Quad and is aligned - * parallel to the stage axes, rendering will be optimized: instead of using the - * stencil buffer, the object will be clipped using the scissor rectangle. That's - * faster and reduces the number of draw calls, so make use of this when possible.

- * - * @see Canvas - * @default null - */ - public function get mask():DisplayObject { return _mask; } - public function set mask(value:DisplayObject):void - { - if (_mask != value) - { - if (_mask) _mask._maskee = null; - if (value) - { - value._maskee = this; - value._hasVisibleArea = false; - } - - _mask = value; - setRequiresRedraw(); - } - } - - /** The display object container that contains this display object. */ - public function get parent():DisplayObjectContainer { return _parent; } - - /** The topmost object in the display tree the object is part of. */ - public function get base():DisplayObject - { - var currentObject:DisplayObject = this; - while (currentObject._parent) currentObject = currentObject._parent; - return currentObject; - } - - /** The root object the display object is connected to (i.e. an instance of the class - * that was passed to the Starling constructor), or null if the object is not connected - * to the stage. */ - public function get root():DisplayObject - { - var currentObject:DisplayObject = this; - while (currentObject._parent) - { - if (currentObject._parent is Stage) return currentObject; - else currentObject = currentObject.parent; - } - - return null; - } - - /** The stage the display object is connected to, or null if it is not connected - * to the stage. */ - public function get stage():Stage { return this.base as Stage; } - } -} diff --git a/mobile_version/src/starling/display/DisplayObjectContainer.as b/mobile_version/src/starling/display/DisplayObjectContainer.as deleted file mode 100644 index c3962bca..00000000 --- a/mobile_version/src/starling/display/DisplayObjectContainer.as +++ /dev/null @@ -1,508 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= - -package starling.display -{ - import flash.geom.Matrix; - import flash.geom.Point; - import flash.geom.Rectangle; - import flash.system.Capabilities; - import flash.utils.getQualifiedClassName; - - import starling.core.starling_internal; - import starling.errors.AbstractClassError; - import starling.events.Event; - import starling.filters.FragmentFilter; - import starling.rendering.BatchToken; - import starling.rendering.Painter; - import starling.utils.MatrixUtil; - - use namespace starling_internal; - - /** - * A DisplayObjectContainer represents a collection of display objects. - * It is the base class of all display objects that act as a container for other objects. By - * maintaining an ordered list of children, it defines the back-to-front positioning of the - * children within the display tree. - * - *

A container does not a have size in itself. The width and height properties represent the - * extents of its children. Changing those properties will scale all children accordingly.

- * - *

As this is an abstract class, you can't instantiate it directly, but have to - * use a subclass instead. The most lightweight container class is "Sprite".

- * - * Adding and removing children - * - *

The class defines methods that allow you to add or remove children. When you add a child, - * it will be added at the frontmost position, possibly occluding a child that was added - * before. You can access the children via an index. The first child will have index 0, the - * second child index 1, etc.

- * - * Adding and removing objects from a container triggers non-bubbling events. - * - *
    - *
  • Event.ADDED: the object was added to a parent.
  • - *
  • Event.ADDED_TO_STAGE: the object was added to a parent that is - * connected to the stage, thus becoming visible now.
  • - *
  • Event.REMOVED: the object was removed from a parent.
  • - *
  • Event.REMOVED_FROM_STAGE: the object was removed from a parent that - * is connected to the stage, thus becoming invisible now.
  • - *
- * - * Especially the ADDED_TO_STAGE event is very helpful, as it allows you to - * automatically execute some logic (e.g. start an animation) when an object is rendered the - * first time. - * - * @see Sprite - * @see DisplayObject - */ - public class DisplayObjectContainer extends DisplayObject - { - // members - - private var _children:Vector.; - private var _touchGroup:Boolean; - - // helper objects - private static var sHelperMatrix:Matrix = new Matrix(); - private static var sHelperPoint:Point = new Point(); - private static var sBroadcastListeners:Vector. = new []; - private static var sSortBuffer:Vector. = new []; - private static var sCacheToken:BatchToken = new BatchToken(); - - // construction - - /** @private */ - public function DisplayObjectContainer() - { - if (Capabilities.isDebugger && - getQualifiedClassName(this) == "starling.display::DisplayObjectContainer") - { - throw new AbstractClassError(); - } - - _children = new []; - } - - /** Disposes the resources of all children. */ - public override function dispose():void - { - for (var i:int=_children.length-1; i>=0; --i) - _children[i].dispose(); - - super.dispose(); - } - - // child management - - /** Adds a child to the container. It will be at the frontmost position. */ - public function addChild(child:DisplayObject):DisplayObject - { - return addChildAt(child, _children.length); - } - - /** Adds a child to the container at a certain index. */ - public function addChildAt(child:DisplayObject, index:int):DisplayObject - { - var numChildren:int = _children.length; - - if (index >= 0 && index <= numChildren) - { - setRequiresRedraw(); - - if (child.parent == this) - { - setChildIndex(child, index); // avoids dispatching events - } - else - { - _children.insertAt(index, child); - - child.removeFromParent(); - child.setParent(this); - child.dispatchEventWith(Event.ADDED, true); - - if (stage) - { - var container:DisplayObjectContainer = child as DisplayObjectContainer; - if (container) container.broadcastEventWith(Event.ADDED_TO_STAGE); - else child.dispatchEventWith(Event.ADDED_TO_STAGE); - } - } - - return child; - } - else - { - throw new RangeError("Invalid child index"); - } - } - - /** Removes a child from the container. If the object is not a child, the method returns - * null. If requested, the child will be disposed right away. */ - public function removeChild(child:DisplayObject, dispose:Boolean=false):DisplayObject - { - var childIndex:int = getChildIndex(child); - if (childIndex != -1) return removeChildAt(childIndex, dispose); - else return null; - } - - /** Removes a child at a certain index. The index positions of any display objects above - * the child are decreased by 1. If requested, the child will be disposed right away. */ - public function removeChildAt(index:int, dispose:Boolean=false):DisplayObject - { - if (index >= 0 && index < _children.length) - { - setRequiresRedraw(); - - var child:DisplayObject = _children[index]; - child.dispatchEventWith(Event.REMOVED, true); - - if (stage) - { - var container:DisplayObjectContainer = child as DisplayObjectContainer; - if (container) container.broadcastEventWith(Event.REMOVED_FROM_STAGE); - else child.dispatchEventWith(Event.REMOVED_FROM_STAGE); - } - - child.setParent(null); - index = _children.indexOf(child); // index might have changed by event handler - if (index >= 0) _children.removeAt(index); - if (dispose) child.dispose(); - - return child; - } - else - { - throw new RangeError("Invalid child index"); - } - } - - /** Removes a range of children from the container (endIndex included). - * If no arguments are given, all children will be removed. */ - public function removeChildren(beginIndex:int=0, endIndex:int=-1, dispose:Boolean=false):void - { - if (endIndex < 0 || endIndex >= numChildren) - endIndex = numChildren - 1; - - for (var i:int=beginIndex; i<=endIndex; ++i) - removeChildAt(beginIndex, dispose); - } - - /** Returns a child object at a certain index. If you pass a negative index, - * '-1' will return the last child, '-2' the second to last child, etc. */ - public function getChildAt(index:int):DisplayObject - { - var numChildren:int = _children.length; - - if (index < 0) - index = numChildren + index; - - if (index >= 0 && index < numChildren) - return _children[index]; - else - throw new RangeError("Invalid child index"); - } - - /** Returns a child object with a certain name (non-recursively). */ - public function getChildByName(name:String):DisplayObject - { - var numChildren:int = _children.length; - for (var i:int=0; i out.x) minX = out.x; - if (maxX < out.right) maxX = out.right; - if (minY > out.y) minY = out.y; - if (maxY < out.bottom) maxY = out.bottom; - } - - out.setTo(minX, minY, maxX - minX, maxY - minY); - } - - return out; - } - - /** @inheritDoc */ - public override function hitTest(localPoint:Point):DisplayObject - { - if (!visible || !touchable || !hitTestMask(localPoint)) return null; - - var target:DisplayObject = null; - var localX:Number = localPoint.x; - var localY:Number = localPoint.y; - var numChildren:int = _children.length; - - for (var i:int = numChildren - 1; i >= 0; --i) // front to back! - { - var child:DisplayObject = _children[i]; - if (child.isMask) continue; - - sHelperMatrix.copyFrom(child.transformationMatrix); - sHelperMatrix.invert(); - - MatrixUtil.transformCoords(sHelperMatrix, localX, localY, sHelperPoint); - target = child.hitTest(sHelperPoint); - - if (target) return _touchGroup ? this : target; - } - - return null; - } - - /** @inheritDoc */ - public override function render(painter:Painter):void - { - var numChildren:int = _children.length; - var frameID:uint = painter.frameID; - var cacheEnabled:Boolean = frameID !=0; - var selfOrParentChanged:Boolean = _lastParentOrSelfChangeFrameID == frameID; - - for (var i:int=0; i, compareFunc:Function, - startIndex:int, length:int, - buffer:Vector.):void - { - // This is a port of the C++ merge sort algorithm shown here: - // http://www.cprogramming.com/tutorial/computersciencetheory/mergesort.html - - if (length > 1) - { - var i:int; - var endIndex:int = startIndex + length; - var halfLength:int = length / 2; - var l:int = startIndex; // current position in the left subvector - var r:int = startIndex + halfLength; // current position in the right subvector - - // sort each subvector - mergeSort(input, compareFunc, startIndex, halfLength, buffer); - mergeSort(input, compareFunc, startIndex + halfLength, length - halfLength, buffer); - - // merge the vectors, using the buffer vector for temporary storage - for (i = 0; i < length; i++) - { - // Check to see if any elements remain in the left vector; - // if so, we check if there are any elements left in the right vector; - // if so, we compare them. Otherwise, we know that the merge must - // take the element from the left vector. */ - if (l < startIndex + halfLength && - (r == endIndex || compareFunc(input[l], input[r]) <= 0)) - { - buffer[i] = input[l]; - l++; - } - else - { - buffer[i] = input[r]; - r++; - } - } - - // copy the sorted subvector back to the input - for(i = startIndex; i < endIndex; i++) - input[i] = buffer[int(i - startIndex)]; - } - } - - /** @private */ - internal function getChildEventListeners(object:DisplayObject, eventType:String, - listeners:Vector.):void - { - var container:DisplayObjectContainer = object as DisplayObjectContainer; - - if (object.hasEventListener(eventType)) - listeners[listeners.length] = object; // avoiding 'push' - - if (container) - { - var children:Vector. = container._children; - var numChildren:int = children.length; - - for (var i:int=0; iTypically, the Image class will act as an equivalent of Flash's Bitmap class. Instead - * of BitmapData, Starling uses textures to represent the pixels of an image. To display a - * texture, you have to map it onto a quad - and that's what the Image class is for.

- * - *

While the base class Quad already supports textures, the Image - * class adds some additional functionality.

- * - *

First of all, it provides a convenient constructor that will automatically synchronize - * the size of the image with the displayed texture.

- * - *

Furthermore, it adds support for a "Scale9" grid. This splits up the image into - * nine regions, the corners of which will always maintain their original size. - * The center region stretches in both directions to fill the remaining space; the side - * regions will stretch accordingly in either horizontal or vertical direction.

- * - *

Finally, you can repeat a texture horizontally and vertically within the image's region, - * just like the tiles of a wallpaper. Use the tileGrid property to do that.

- * - * @see starling.textures.Texture - * @see Quad - */ - public class Image extends Quad - { - private var _scale9Grid:Rectangle; - private var _tileGrid:Rectangle; - - // helper objects - private static var sPadding:Padding = new Padding(); - private static var sBounds:Rectangle = new Rectangle(); - private static var sBasCols:Vector. = new Vector.(3, true); - private static var sBasRows:Vector. = new Vector.(3, true); - private static var sPosCols:Vector. = new Vector.(3, true); - private static var sPosRows:Vector. = new Vector.(3, true); - private static var sTexCols:Vector. = new Vector.(3, true); - private static var sTexRows:Vector. = new Vector.(3, true); - - /** Creates an image with a texture mapped onto it. */ - public function Image(texture:Texture) - { - super(100, 100); - this.texture = texture; - readjustSize(); - } - - /** The current scaling grid that is in effect. If set to null, the image is scaled just - * like any other display object; assigning a rectangle will divide the image into a grid - * of nine regions, based on the center rectangle. The four corners of this grid will - * always maintain their original size; the other regions will stretch (horizontally, - * vertically, or both) to fill the complete area. - * - *

Notes:

- * - *
    - *
  • Assigning a Scale9 rectangle will change the number of vertices to a maximum of 16 - * (less if possible) and all vertices will be colored like vertex 0 (the top left vertex). - *
  • - *
  • For Scale3-grid behavior, assign a zero size for all but the center row / column. - * This will cause the 'caps' to scale in a way that leaves the aspect ratio intact.
  • - *
  • An image can have either a scale9Grid or a tileGrid, but - * not both. Assigning one will delete the other.
  • - *
  • Changes will only be applied on assignment. To force an update, simply call - * image.scale9Grid = image.scale9Grid.
  • - *
  • Assignment causes an implicit call to readjustSize(), - * and the same will happen when the texture is changed afterwards.
  • - *
- * - * @default null - */ - public function get scale9Grid():Rectangle { return _scale9Grid; } - public function set scale9Grid(value:Rectangle):void - { - if (value) - { - if (_scale9Grid == null) _scale9Grid = value.clone(); - else _scale9Grid.copyFrom(value); - - readjustSize(); - _tileGrid = null; - } - else _scale9Grid = null; - - setupVertices(); - } - - /** The current tiling grid that is in effect. If set to null, the image is scaled just - * like any other display object; assigning a rectangle will divide the image into a grid - * displaying the current texture in each and every cell. The assigned rectangle points - * to the bounds of one cell; all other elements will be calculated accordingly. A zero - * or negative value for the rectangle's width or height will be replaced with the actual - * texture size. Thus, you can make a 2x2 grid simply like this: - * - * - * var image:Image = new Image(texture); - * image.tileGrid = new Rectangle(); - * image.scale = 2; - * - *

Notes:

- * - *
    - *
  • Assigning a tile rectangle will change the number of vertices to whatever is - * required by the grid. New vertices will be colored just like vertex 0 (the top left - * vertex).
  • - *
  • An image can have either a scale9Grid or a tileGrid, but - * not both. Assigning one will delete the other.
  • - *
  • Changes will only be applied on assignment. To force an update, simply call - * image.tileGrid = image.tileGrid.
  • - *
- * - * @default null - */ - public function get tileGrid():Rectangle { return _tileGrid; } - public function set tileGrid(value:Rectangle):void - { - if (value) - { - if (_tileGrid == null) _tileGrid = value.clone(); - else _tileGrid.copyFrom(value); - - _scale9Grid = null; - } - else _tileGrid = null; - - setupVertices(); - } - - /** @private */ - override protected function setupVertices():void - { - if (texture && _scale9Grid) setupScale9Grid(); - else if (texture && _tileGrid) setupTileGrid(); - else super.setupVertices(); - } - - /** @private */ - override public function set scaleX(value:Number):void - { - super.scaleX = value; - if (texture && (_scale9Grid || _tileGrid)) setupVertices(); - } - - /** @private */ - override public function set scaleY(value:Number):void - { - super.scaleY = value; - if (texture && (_scale9Grid || _tileGrid)) setupVertices(); - } - - /** @private */ - override public function set texture(value:Texture):void - { - if (value != texture) - { - super.texture = value; - if (_scale9Grid && value) readjustSize(); - } - } - - // vertex setup - - private function setupScale9Grid():void - { - var texture:Texture = this.texture; - var frame:Rectangle = texture.frame; - var absScaleX:Number = scaleX > 0 ? scaleX : -scaleX; - var absScaleY:Number = scaleY > 0 ? scaleY : -scaleY; - - // If top and bottom row / left and right column are empty, this is actually - // a scale3 grid. In that case, we want the 'caps' to maintain their aspect ratio. - - if (MathUtil.isEquivalent(_scale9Grid.width, texture.frameWidth)) - absScaleY /= absScaleX; - else if (MathUtil.isEquivalent(_scale9Grid.height, texture.frameHeight)) - absScaleX /= absScaleY; - - var invScaleX:Number = 1.0 / absScaleX; - var invScaleY:Number = 1.0 / absScaleY; - var vertexData:VertexData = this.vertexData; - var indexData:IndexData = this.indexData; - var prevNumVertices:int = vertexData.numVertices; - var numVertices:int, numQuads:int; - var correction:Number; - - // The following rectangles are used to figure everything out. - // The meaning of each is depicted in this sketch: http://i.imgur.com/KUcv71O.jpg - - var gridCenter:Rectangle = Pool.getRectangle(); - var textureBounds:Rectangle = Pool.getRectangle(); - var pixelBounds:Rectangle = Pool.getRectangle(); - var intersection:Rectangle = Pool.getRectangle(); - - gridCenter.copyFrom(_scale9Grid); - textureBounds.setTo(0, 0, texture.frameWidth, texture.frameHeight); - - if (frame) pixelBounds.setTo(-frame.x, -frame.y, texture.width, texture.height); - else pixelBounds.copyFrom(textureBounds); - - // calculate 3x3 grid according to texture and scale9 properties, - // taking special care about the texture frame (headache included) - - RectangleUtil.intersect(gridCenter, pixelBounds, intersection); - - sBasCols[0] = sBasCols[2] = 0; - sBasRows[0] = sBasRows[2] = 0; - sBasCols[1] = intersection.width; - sBasRows[1] = intersection.height; - - if (pixelBounds.x < gridCenter.x) - sBasCols[0] = gridCenter.x - pixelBounds.x; - - if (pixelBounds.y < gridCenter.y) - sBasRows[0] = gridCenter.y - pixelBounds.y; - - if (pixelBounds.right > gridCenter.right) - sBasCols[2] = pixelBounds.right - gridCenter.right; - - if (pixelBounds.bottom > gridCenter.bottom) - sBasRows[2] = pixelBounds.bottom - gridCenter.bottom; - - // set vertex positions - - if (pixelBounds.x < gridCenter.x) - sPadding.left = pixelBounds.x * invScaleX; - else - sPadding.left = gridCenter.x * invScaleX + pixelBounds.x - gridCenter.x; - - if (pixelBounds.right > gridCenter.right) - sPadding.right = (textureBounds.width - pixelBounds.right) * invScaleX; - else - sPadding.right = (textureBounds.width - gridCenter.right) * invScaleX + gridCenter.right - pixelBounds.right; - - if (pixelBounds.y < gridCenter.y) - sPadding.top = pixelBounds.y * invScaleY; - else - sPadding.top = gridCenter.y * invScaleY + pixelBounds.y - gridCenter.y; - - if (pixelBounds.bottom > gridCenter.bottom) - sPadding.bottom = (textureBounds.height - pixelBounds.bottom) * invScaleY; - else - sPadding.bottom = (textureBounds.height - gridCenter.bottom) * invScaleY + gridCenter.bottom - pixelBounds.bottom; - - sPosCols[0] = sBasCols[0] * invScaleX; - sPosCols[2] = sBasCols[2] * invScaleX; - sPosCols[1] = textureBounds.width - sPadding.left - sPadding.right - sPosCols[0] - sPosCols[2]; - - sPosRows[0] = sBasRows[0] * invScaleY; - sPosRows[2] = sBasRows[2] * invScaleY; - sPosRows[1] = textureBounds.height - sPadding.top - sPadding.bottom - sPosRows[0] - sPosRows[2]; - - // if the total width / height becomes smaller than the outer columns / rows, - // we hide the center column / row and scale the rest normally. - - if (sPosCols[1] <= 0) - { - correction = textureBounds.width / (textureBounds.width - gridCenter.width) * absScaleX; - sPadding.left *= correction; - sPosCols[0] *= correction; - sPosCols[1] = 0.0; - sPosCols[2] *= correction; - } - - if (sPosRows[1] <= 0) - { - correction = textureBounds.height / (textureBounds.height - gridCenter.height) * absScaleY; - sPadding.top *= correction; - sPosRows[0] *= correction; - sPosRows[1] = 0.0; - sPosRows[2] *= correction; - } - - // now set the texture coordinates - - sTexCols[0] = sBasCols[0] / pixelBounds.width; - sTexCols[2] = sBasCols[2] / pixelBounds.width; - sTexCols[1] = 1.0 - sTexCols[0] - sTexCols[2]; - - sTexRows[0] = sBasRows[0] / pixelBounds.height; - sTexRows[2] = sBasRows[2] / pixelBounds.height; - sTexRows[1] = 1.0 - sTexRows[0] - sTexRows[2]; - - numVertices = setupScale9GridAttributes( - sPadding.left, sPadding.top, sPosCols, sPosRows, sTexCols, sTexRows); - - // update indices - - numQuads = numVertices / 4; - vertexData.numVertices = numVertices; - indexData.numIndices = 0; - - for (var i:int=0; i, posRows:Vector., - texCols:Vector., texRows:Vector.):int - { - const posAttr:String = "position"; - const texAttr:String = "texCoords"; - - var row:int, col:int; - var colWidthPos:Number, rowHeightPos:Number; - var colWidthTex:Number, rowHeightTex:Number; - var vertexData:VertexData = this.vertexData; - var texture:Texture = this.texture; - var currentX:Number = startX; - var currentY:Number = startY; - var currentU:Number = 0.0; - var currentV:Number = 0.0; - var vertexID:int = 0; - - for (row = 0; row < 3; ++row) - { - rowHeightPos = posRows[row]; - rowHeightTex = texRows[row]; - - if (rowHeightPos > 0) - { - for (col = 0; col < 3; ++col) - { - colWidthPos = posCols[col]; - colWidthTex = texCols[col]; - - if (colWidthPos > 0) - { - vertexData.setPoint(vertexID, posAttr, currentX, currentY); - texture.setTexCoords(vertexData, vertexID, texAttr, currentU, currentV); - vertexID++; - - vertexData.setPoint(vertexID, posAttr, currentX + colWidthPos, currentY); - texture.setTexCoords(vertexData, vertexID, texAttr, currentU + colWidthTex, currentV); - vertexID++; - - vertexData.setPoint(vertexID, posAttr, currentX, currentY + rowHeightPos); - texture.setTexCoords(vertexData, vertexID, texAttr, currentU, currentV + rowHeightTex); - vertexID++; - - vertexData.setPoint(vertexID, posAttr, currentX + colWidthPos, currentY + rowHeightPos); - texture.setTexCoords(vertexData, vertexID, texAttr, currentU + colWidthTex, currentV + rowHeightTex); - vertexID++; - - currentX += colWidthPos; - } - - currentU += colWidthTex; - } - - currentY += rowHeightPos; - } - - currentX = startX; - currentU = 0.0; - currentV += rowHeightTex; - } - - return vertexID; - } - - private function setupTileGrid():void - { - // calculate the grid of vertices simulating a repeating / tiled texture. - // again, texture frames make this somewhat more complicated than one would think. - - var texture:Texture = this.texture; - var frame:Rectangle = texture.frame; - var vertexData:VertexData = this.vertexData; - var indexData:IndexData = this.indexData; - var bounds:Rectangle = getBounds(this, sBounds); - var prevNumVertices:int = vertexData.numVertices; - var color:uint = prevNumVertices ? vertexData.getColor(0) : 0xffffff; - var alpha:Number = prevNumVertices ? vertexData.getAlpha(0) : 1.0; - var invScaleX:Number = scaleX > 0 ? 1.0 / scaleX : -1.0 / scaleX; - var invScaleY:Number = scaleY > 0 ? 1.0 / scaleY : -1.0 / scaleY; - var frameWidth:Number = _tileGrid.width > 0 ? _tileGrid.width : texture.frameWidth; - var frameHeight:Number = _tileGrid.height > 0 ? _tileGrid.height : texture.frameHeight; - - frameWidth *= invScaleX; - frameHeight *= invScaleY; - - var tileX:Number = frame ? -frame.x * (frameWidth / frame.width) : 0; - var tileY:Number = frame ? -frame.y * (frameHeight / frame.height) : 0; - var tileWidth:Number = texture.width * (frameWidth / texture.frameWidth); - var tileHeight:Number = texture.height * (frameHeight / texture.frameHeight); - var modX:Number = (_tileGrid.x * invScaleX) % frameWidth; - var modY:Number = (_tileGrid.y * invScaleY) % frameHeight; - - if (modX < 0) modX += frameWidth; - if (modY < 0) modY += frameHeight; - - var startX:Number = modX + tileX; - var startY:Number = modY + tileY; - - if (startX > (frameWidth - tileWidth)) startX -= frameWidth; - if (startY > (frameHeight - tileHeight)) startY -= frameHeight; - - var posLeft:Number, posRight:Number, posTop:Number, posBottom:Number; - var texLeft:Number, texRight:Number, texTop:Number, texBottom:Number; - var posAttrName:String = "position"; - var texAttrName:String = "texCoords"; - var currentX:Number; - var currentY:Number = startY; - var vertexID:int = 0; - - indexData.numIndices = 0; - - while (currentY < bounds.height) - { - currentX = startX; - - while (currentX < bounds.width) - { - indexData.addQuad(vertexID, vertexID + 1, vertexID + 2, vertexID + 3); - - posLeft = currentX < 0 ? 0 : currentX; - posTop = currentY < 0 ? 0 : currentY; - posRight = currentX + tileWidth > bounds.width ? bounds.width : currentX + tileWidth; - posBottom = currentY + tileHeight > bounds.height ? bounds.height : currentY + tileHeight; - - vertexData.setPoint(vertexID, posAttrName, posLeft, posTop); - vertexData.setPoint(vertexID + 1, posAttrName, posRight, posTop); - vertexData.setPoint(vertexID + 2, posAttrName, posLeft, posBottom); - vertexData.setPoint(vertexID + 3, posAttrName, posRight, posBottom); - - texLeft = (posLeft - currentX) / tileWidth; - texTop = (posTop - currentY) / tileHeight; - texRight = (posRight - currentX) / tileWidth; - texBottom = (posBottom - currentY) / tileHeight; - - texture.setTexCoords(vertexData, vertexID, texAttrName, texLeft, texTop); - texture.setTexCoords(vertexData, vertexID + 1, texAttrName, texRight, texTop); - texture.setTexCoords(vertexData, vertexID + 2, texAttrName, texLeft, texBottom); - texture.setTexCoords(vertexData, vertexID + 3, texAttrName, texRight, texBottom); - - currentX += frameWidth; - vertexID += 4; - } - - currentY += frameHeight; - } - - // trim to actual size - vertexData.numVertices = vertexID; - - for (var i:int = prevNumVertices; i < vertexID; ++i) - { - vertexData.setColor(i, "color", color); - vertexData.setAlpha(i, "color", alpha); - } - - setRequiresRedraw(); - } - } -} diff --git a/mobile_version/src/starling/display/Mesh.as b/mobile_version/src/starling/display/Mesh.as deleted file mode 100644 index 82977fba..00000000 --- a/mobile_version/src/starling/display/Mesh.as +++ /dev/null @@ -1,332 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= - -package starling.display -{ - import flash.geom.Point; - import flash.geom.Rectangle; - - import starling.core.starling_internal; - import starling.geom.Polygon; - import starling.rendering.IndexData; - import starling.rendering.Painter; - import starling.rendering.VertexData; - import starling.rendering.VertexDataFormat; - import starling.styles.MeshStyle; - import starling.textures.Texture; - import starling.utils.MatrixUtil; - import starling.utils.MeshUtil; - import starling.utils.execute; - - use namespace starling_internal; - - /** The base class for all tangible (non-container) display objects, spawned up by a number - * of triangles. - * - *

Since Starling uses Stage3D for rendering, all rendered objects must be constructed - * from triangles. A mesh stores the information of its triangles through VertexData and - * IndexData structures. The default format stores position, color and texture coordinates - * for each vertex.

- * - *

How a mesh is rendered depends on its style. Per default, this is an instance - * of the MeshStyle base class; however, subclasses may extend its behavior - * to add support for color transformations, normal mapping, etc.

- * - * @see MeshBatch - * @see starling.styles.MeshStyle - * @see starling.rendering.VertexData - * @see starling.rendering.IndexData - */ - public class Mesh extends DisplayObject - { - /** @private */ internal var _style:MeshStyle; - /** @private */ internal var _vertexData:VertexData; - /** @private */ internal var _indexData:IndexData; - /** @private */ internal var _pixelSnapping:Boolean; - - private static var sDefaultStyle:Class = MeshStyle; - private static var sDefaultStyleFactory:Function = null; - - /** Creates a new mesh with the given vertices and indices. - * If you don't pass a style, an instance of MeshStyle will be created - * for you. Note that the format of the vertex data will be matched to the - * given style right away. */ - public function Mesh(vertexData:VertexData, indexData:IndexData, style:MeshStyle=null) - { - if (vertexData == null) throw new ArgumentError("VertexData must not be null"); - if (indexData == null) throw new ArgumentError("IndexData must not be null"); - - _vertexData = vertexData; - _indexData = indexData; - - setStyle(style, false); - } - - /** @inheritDoc */ - override public function dispose():void - { - _vertexData.clear(); - _indexData.clear(); - - super.dispose(); - } - - /** @inheritDoc */ - override public function hitTest(localPoint:Point):DisplayObject - { - if (!visible || !touchable || !hitTestMask(localPoint)) return null; - else return MeshUtil.containsPoint(_vertexData, _indexData, localPoint) ? this : null; - } - - /** @inheritDoc */ - override public function getBounds(targetSpace:DisplayObject, out:Rectangle=null):Rectangle - { - return MeshUtil.calculateBounds(_vertexData, this, targetSpace, out); - } - - /** @inheritDoc */ - override public function render(painter:Painter):void - { - if (_pixelSnapping) - MatrixUtil.snapToPixels(painter.state.modelviewMatrix, painter.pixelSize); - - painter.batchMesh(this); - } - - /** Sets the style that is used to render the mesh. Styles (which are always subclasses of - * MeshStyle) provide a means to completely modify the way a mesh is rendered. - * For example, they may add support for color transformations or normal mapping. - * - *

When assigning a new style, the vertex format will be changed to fit it. - * Do not use the same style instance on multiple objects! Instead, make use of - * style.clone() to assign an identical style to multiple meshes.

- * - * @param meshStyle the style to assign. If null, the default - * style will be created. - * @param mergeWithPredecessor if enabled, all attributes of the previous style will be - * be copied to the new one, if possible. - * @see #defaultStyle - * @see #defaultStyleFactory - */ - public function setStyle(meshStyle:MeshStyle=null, mergeWithPredecessor:Boolean=true):void - { - if (meshStyle == null) meshStyle = createDefaultMeshStyle(); - else if (meshStyle == _style) return; - else if (meshStyle.target) meshStyle.target.setStyle(); - - if (_style) - { - if (mergeWithPredecessor) meshStyle.copyFrom(_style); - _style.setTarget(null); - } - - _style = meshStyle; - _style.setTarget(this, _vertexData, _indexData); - } - - private function createDefaultMeshStyle():MeshStyle - { - var meshStyle:MeshStyle; - - if (sDefaultStyleFactory != null) - { - if (sDefaultStyleFactory.length == 0) meshStyle = sDefaultStyleFactory(); - else meshStyle = sDefaultStyleFactory(this); - } - - if (meshStyle == null) - meshStyle = new sDefaultStyle() as MeshStyle; - - return meshStyle; - } - - /** This method is called whenever the mesh's vertex data was changed. - * The base implementation simply forwards to setRequiresRedraw. */ - public function setVertexDataChanged():void - { - setRequiresRedraw(); - } - - /** This method is called whenever the mesh's index data was changed. - * The base implementation simply forwards to setRequiresRedraw. */ - public function setIndexDataChanged():void - { - setRequiresRedraw(); - } - - // vertex manipulation - - /** The position of the vertex at the specified index, in the mesh's local coordinate - * system. - * - *

Only modify the position of a vertex if you know exactly what you're doing, as - * some classes might not work correctly when their vertices are moved. E.g. the - * Quad class expects its vertices to spawn up a perfectly rectangular - * area; some of its optimized methods won't work correctly if that premise is no longer - * fulfilled or the original bounds change.

- */ - public function getVertexPosition(vertexID:int, out:Point=null):Point - { - return _style.getVertexPosition(vertexID, out); - } - - public function setVertexPosition(vertexID:int, x:Number, y:Number):void - { - _style.setVertexPosition(vertexID, x, y); - } - - /** Returns the alpha value of the vertex at the specified index. */ - public function getVertexAlpha(vertexID:int):Number - { - return _style.getVertexAlpha(vertexID); - } - - /** Sets the alpha value of the vertex at the specified index to a certain value. */ - public function setVertexAlpha(vertexID:int, alpha:Number):void - { - _style.setVertexAlpha(vertexID, alpha); - } - - /** Returns the RGB color of the vertex at the specified index. */ - public function getVertexColor(vertexID:int):uint - { - return _style.getVertexColor(vertexID); - } - - /** Sets the RGB color of the vertex at the specified index to a certain value. */ - public function setVertexColor(vertexID:int, color:uint):void - { - _style.setVertexColor(vertexID, color); - } - - /** Returns the texture coordinates of the vertex at the specified index. */ - public function getTexCoords(vertexID:int, out:Point = null):Point - { - return _style.getTexCoords(vertexID, out); - } - - /** Sets the texture coordinates of the vertex at the specified index to the given values. */ - public function setTexCoords(vertexID:int, u:Number, v:Number):void - { - _style.setTexCoords(vertexID, u, v); - } - - // properties - - /** The vertex data describing all vertices of the mesh. - * Any change requires a call to setRequiresRedraw. */ - protected function get vertexData():VertexData { return _vertexData; } - - /** The index data describing how the vertices are interconnected. - * Any change requires a call to setRequiresRedraw. */ - protected function get indexData():IndexData { return _indexData; } - - /** The style that is used to render the mesh. Styles (which are always subclasses of - * MeshStyle) provide a means to completely modify the way a mesh is rendered. - * For example, they may add support for color transformations or normal mapping. - * - *

The setter will simply forward the assignee to setStyle(value).

- * - * @default MeshStyle - */ - public function get style():MeshStyle { return _style; } - public function set style(value:MeshStyle):void - { - setStyle(value); - } - - /** The texture that is mapped to the mesh (or null, if there is none). */ - public function get texture():Texture { return _style.texture; } - public function set texture(value:Texture):void { _style.texture = value; } - - /** Changes the color of all vertices to the same value. - * The getter simply returns the color of the first vertex. */ - public function get color():uint { return _style.color; } - public function set color(value:uint):void { _style.color = value; } - - /** The smoothing filter that is used for the texture. - * @default bilinear */ - public function get textureSmoothing():String { return _style.textureSmoothing; } - public function set textureSmoothing(value:String):void { _style.textureSmoothing = value; } - - /** Indicates if pixels at the edges will be repeated or clamped. Only works for - * power-of-two textures; for a solution that works with all kinds of textures, - * see Image.tileGrid. @default false */ - public function get textureRepeat():Boolean { return _style.textureRepeat; } - public function set textureRepeat(value:Boolean):void { _style.textureRepeat = value; } - - /** Controls whether or not the instance snaps to the nearest pixel. This can prevent the - * object from looking blurry when it's not exactly aligned with the pixels of the screen. - * @default false */ - public function get pixelSnapping():Boolean { return _pixelSnapping; } - public function set pixelSnapping(value:Boolean):void { _pixelSnapping = value; } - - /** The total number of vertices in the mesh. */ - public function get numVertices():int { return _vertexData.numVertices; } - - /** The total number of indices referencing vertices. */ - public function get numIndices():int { return _indexData.numIndices; } - - /** The total number of triangles in this mesh. - * (In other words: the number of indices divided by three.) */ - public function get numTriangles():int { return _indexData.numTriangles; } - - /** The format used to store the vertices. */ - public function get vertexFormat():VertexDataFormat { return _style.vertexFormat; } - - // static properties - - /** The default style used for meshes if no specific style is provided. The default is - * starling.rendering.MeshStyle, and any assigned class must be a subclass - * of the same. */ - public static function get defaultStyle():Class { return sDefaultStyle; } - public static function set defaultStyle(value:Class):void - { - sDefaultStyle = value; - } - - /** A factory method that is used to create the 'MeshStyle' for a mesh if no specific - * style is provided. That's useful if you are creating a hierarchy of objects, all - * of which need to have a certain style. Different to the defaultStyle - * property, this method allows plugging in custom logic and passing arguments to the - * constructor. Return null to fall back to the default behavior (i.e. - * to instantiate defaultStyle). The mesh-parameter is optional - * and may be omitted. - * - * - * Mesh.defaultStyleFactory = function(mesh:Mesh):MeshStyle - * { - * return new ColorizeMeshStyle(Math.random() * 0xffffff); - * } - */ - public static function get defaultStyleFactory():Function { return sDefaultStyleFactory; } - public static function set defaultStyleFactory(value:Function):void - { - sDefaultStyleFactory = value; - } - - // static methods - - /** Creates a mesh from the specified polygon. - * Vertex positions and indices will be set up according to the polygon; - * any other vertex attributes (e.g. texture coordinates) need to be set up manually. - */ - public static function fromPolygon(polygon:Polygon, style:MeshStyle=null):Mesh - { - var vertexData:VertexData = new VertexData(null, polygon.numVertices); - var indexData:IndexData = new IndexData(polygon.numTriangles); - - polygon.copyToVertexData(vertexData); - polygon.triangulate(indexData); - - return new Mesh(vertexData, indexData, style); - } - } -} diff --git a/mobile_version/src/starling/display/MeshBatch.as b/mobile_version/src/starling/display/MeshBatch.as deleted file mode 100644 index 50ae1c0e..00000000 --- a/mobile_version/src/starling/display/MeshBatch.as +++ /dev/null @@ -1,300 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= - -package starling.display -{ - import flash.geom.Matrix; - - import starling.rendering.IndexData; - import starling.rendering.MeshEffect; - import starling.rendering.Painter; - import starling.rendering.VertexData; - import starling.styles.MeshStyle; - import starling.utils.MatrixUtil; - import starling.utils.MeshSubset; - - /** Combines a number of meshes to one display object and renders them efficiently. - * - *

The most basic tangible (non-container) display object in Starling is the Mesh. - * However, a mesh typically does not render itself; it just holds the data describing its - * geometry. Rendering is orchestrated by the "MeshBatch" class. As its name suggests, it - * acts as a batch for an arbitrary number of Mesh instances; add meshes to a batch and they - * are all rendered together, in one draw call.

- * - *

You can only batch meshes that share similar properties, e.g. they need to have the - * same texture and the same blend mode. The first object you add to a batch will decide - * this state; call canAddMesh to find out if a new mesh shares that state. - * To reset the current state, you can call clear; this will also remove all - * geometry that has been added thus far.

- * - *

Starling will use MeshBatch instances (or compatible objects) for all rendering. - * However, you can also instantiate MeshBatch instances yourself and add them to the display - * tree. That makes sense for an object containing a large number of meshes; that way, that - * object can be created once and then rendered very efficiently, without having to copy its - * vertices and indices between buffers and GPU memory.

- * - * @see Mesh - * @see Sprite - */ - public class MeshBatch extends Mesh - { - /** The maximum number of vertices that fit into one MeshBatch. */ - public static const MAX_NUM_VERTICES:int = 65535; - - private var _effect:MeshEffect; - private var _batchable:Boolean; - private var _vertexSyncRequired:Boolean; - private var _indexSyncRequired:Boolean; - - // helper object - private static var sFullMeshSubset:MeshSubset = new MeshSubset(); - - /** Creates a new, empty MeshBatch instance. */ - public function MeshBatch() - { - var vertexData:VertexData = new VertexData(); - var indexData:IndexData = new IndexData(); - - super(vertexData, indexData); - } - - /** @inheritDoc */ - override public function dispose():void - { - if (_effect) _effect.dispose(); - super.dispose(); - } - - /** This method must be called whenever the mesh's vertex data was changed. Makes - * sure that the vertex buffer is synchronized before rendering, and forces a redraw. */ - override public function setVertexDataChanged():void - { - _vertexSyncRequired = true; - super.setVertexDataChanged(); - } - - /** This method must be called whenever the mesh's index data was changed. Makes - * sure that the index buffer is synchronized before rendering, and forces a redraw. */ - override public function setIndexDataChanged():void - { - _indexSyncRequired = true; - super.setIndexDataChanged(); - } - - private function setVertexAndIndexDataChanged():void - { - _vertexSyncRequired = _indexSyncRequired = true; - } - - private function syncVertexBuffer():void - { - _effect.uploadVertexData(_vertexData); - _vertexSyncRequired = false; - } - - private function syncIndexBuffer():void - { - _effect.uploadIndexData(_indexData); - _indexSyncRequired = false; - } - - /** Removes all geometry. */ - public function clear():void - { - if (_parent) setRequiresRedraw(); - - _vertexData.numVertices = 0; - _indexData.numIndices = 0; - _vertexSyncRequired = true; - _indexSyncRequired = true; - } - - /** Adds a mesh to the batch by appending its vertices and indices. - * - * @param mesh the mesh to add to the batch. - * @param matrix transform all vertex positions with a certain matrix. If this - * parameter is omitted, mesh.transformationMatrix - * will be used instead (except if the last parameter is enabled). - * @param alpha will be multiplied with each vertex' alpha value. - * @param subset the subset of the mesh you want to add, or null for - * the complete mesh. - * @param ignoreTransformations when enabled, the mesh's vertices will be added - * without transforming them in any way (no matter the value of the - * matrix parameter). - */ - public function addMesh(mesh:Mesh, matrix:Matrix=null, alpha:Number=1.0, - subset:MeshSubset=null, ignoreTransformations:Boolean=false):void - { - if (ignoreTransformations) matrix = null; - else if (matrix == null) matrix = mesh.transformationMatrix; - if (subset == null) subset = sFullMeshSubset; - - var targetVertexID:int = _vertexData.numVertices; - var targetIndexID:int = _indexData.numIndices; - var meshStyle:MeshStyle = mesh._style; - - if (targetVertexID == 0) - setupFor(mesh); - - meshStyle.batchVertexData(_style, targetVertexID, matrix, subset.vertexID, subset.numVertices); - meshStyle.batchIndexData(_style, targetIndexID, targetVertexID - subset.vertexID, - subset.indexID, subset.numIndices); - - if (alpha != 1.0) _vertexData.scaleAlphas("color", alpha, targetVertexID, subset.numVertices); - if (_parent) setRequiresRedraw(); - - _indexSyncRequired = _vertexSyncRequired = true; - } - - /** Adds a mesh to the batch by copying its vertices and indices to the given positions. - * Beware that you need to check for yourself if those positions make sense; for example, - * you need to make sure that they are aligned within the 3-indices groups making up - * the mesh's triangles. - * - *

It's easiest to only add objects with an identical setup, e.g. only quads. - * For the latter, indices are aligned in groups of 6 (one quad requires six indices), - * and the vertices in groups of 4 (one vertex for every corner).

- */ - public function addMeshAt(mesh:Mesh, indexID:int, vertexID:int):void - { - var numIndices:int = mesh.numIndices; - var numVertices:int = mesh.numVertices; - var matrix:Matrix = mesh.transformationMatrix; - var meshStyle:MeshStyle = mesh._style; - - if (_vertexData.numVertices == 0) - setupFor(mesh); - - meshStyle.batchVertexData(_style, vertexID, matrix, 0, numVertices); - meshStyle.batchIndexData(_style, indexID, vertexID, 0, numIndices); - - if (alpha != 1.0) _vertexData.scaleAlphas("color", alpha, vertexID, numVertices); - if (_parent) setRequiresRedraw(); - - _indexSyncRequired = _vertexSyncRequired = true; - } - - private function setupFor(mesh:Mesh):void - { - var meshStyle:MeshStyle = mesh._style; - var meshStyleType:Class = meshStyle.type; - - if (_style.type != meshStyleType) - setStyle(new meshStyleType() as MeshStyle, false); - - _style.copyFrom(meshStyle); - } - - /** Indicates if the given mesh instance fits to the current state of the batch. - * Will always return true for the first added mesh; later calls - * will check if the style matches and if the maximum number of vertices is not - * exceeded. - * - * @param mesh the mesh to add to the batch. - * @param numVertices if -1, mesh.numVertices will be used - */ - public function canAddMesh(mesh:Mesh, numVertices:int=-1):Boolean - { - var currentNumVertices:int = _vertexData.numVertices; - - if (currentNumVertices == 0) return true; - if (numVertices < 0) numVertices = mesh.numVertices; - if (numVertices == 0) return true; - if (numVertices + currentNumVertices > MAX_NUM_VERTICES) return false; - - return _style.canBatchWith(mesh._style); - } - - /** If the batchable property is enabled, this method will add the batch - * to the painter's current batch. Otherwise, this will actually do the drawing. */ - override public function render(painter:Painter):void - { - if (_vertexData.numVertices == 0) return; - if (_pixelSnapping) MatrixUtil.snapToPixels( - painter.state.modelviewMatrix, painter.pixelSize); - - if (_batchable) - { - painter.batchMesh(this); - } - else - { - painter.finishMeshBatch(); - painter.drawCount += 1; - painter.prepareToDraw(); - painter.excludeFromCache(this); - - if (_vertexSyncRequired) syncVertexBuffer(); - if (_indexSyncRequired) syncIndexBuffer(); - - _style.updateEffect(_effect, painter.state); - _effect.render(0, _indexData.numTriangles); - } - } - - /** @inheritDoc */ - override public function setStyle(meshStyle:MeshStyle=null, - mergeWithPredecessor:Boolean=true):void - { - super.setStyle(meshStyle, mergeWithPredecessor); - - if (_effect) - _effect.dispose(); - - _effect = style.createEffect(); - _effect.onRestore = setVertexAndIndexDataChanged; - } - - /** The total number of vertices in the mesh. If you change this to a smaller value, - * the surplus will be deleted. Make sure that no indices reference those deleted - * vertices! */ - public function set numVertices(value:int):void - { - if (_vertexData.numVertices != value) - { - _vertexData.numVertices = value; - _vertexSyncRequired = true; - setRequiresRedraw(); - } - } - - /** The total number of indices in the mesh. If you change this to a smaller value, - * the surplus will be deleted. Always make sure that the number of indices - * is a multiple of three! */ - public function set numIndices(value:int):void - { - if (_indexData.numIndices != value) - { - _indexData.numIndices = value; - _indexSyncRequired = true; - setRequiresRedraw(); - } - } - - /** Indicates if this object will be added to the painter's batch on rendering, - * or if it will draw itself right away. - * - *

Only batchable meshes can profit from the render cache; but batching large meshes - * may take up a lot of CPU time. Activate this property only if the batch contains just - * a handful of vertices (say, 20 quads).

- * - * @default false - */ - public function get batchable():Boolean { return _batchable; } - public function set batchable(value:Boolean):void - { - if (_batchable != value) - { - _batchable = value; - setRequiresRedraw(); - } - } - } -} diff --git a/mobile_version/src/starling/display/MovieClip.as b/mobile_version/src/starling/display/MovieClip.as deleted file mode 100644 index 320a4a2a..00000000 --- a/mobile_version/src/starling/display/MovieClip.as +++ /dev/null @@ -1,479 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= - -package starling.display -{ - import flash.errors.IllegalOperationError; - import flash.media.Sound; - import flash.media.SoundTransform; - - import starling.animation.IAnimatable; - import starling.events.Event; - import starling.textures.Texture; - - /** Dispatched whenever the movie has displayed its last frame. */ - [Event(name="complete", type="starling.events.Event")] - - /** A MovieClip is a simple way to display an animation depicted by a list of textures. - * - *

Pass the frames of the movie in a vector of textures to the constructor. The movie clip - * will have the width and height of the first frame. If you group your frames with the help - * of a texture atlas (which is recommended), use the getTextures-method of the - * atlas to receive the textures in the correct (alphabetic) order.

- * - *

You can specify the desired framerate via the constructor. You can, however, manually - * give each frame a custom duration. You can also play a sound whenever a certain frame - * appears, or execute a callback (a "frame action").

- * - *

The methods play and pause control playback of the movie. You - * will receive an event of type Event.COMPLETE when the movie finished - * playback. If the movie is looping, the event is dispatched once per loop.

- * - *

As any animated object, a movie clip has to be added to a juggler (or have its - * advanceTime method called regularly) to run. The movie will dispatch - * an event of type "Event.COMPLETE" whenever it has displayed its last frame.

- * - * @see starling.textures.TextureAtlas - */ - public class MovieClip extends Image implements IAnimatable - { - private var _frames:Vector.; - private var _defaultFrameDuration:Number; - private var _currentTime:Number; - private var _currentFrameID:int; - private var _loop:Boolean; - private var _playing:Boolean; - private var _muted:Boolean; - private var _wasStopped:Boolean; - private var _soundTransform:SoundTransform; - - /** Creates a movie clip from the provided textures and with the specified default framerate. - * The movie will have the size of the first frame. */ - public function MovieClip(textures:Vector., fps:Number=12) - { - if (textures.length > 0) - { - super(textures[0]); - init(textures, fps); - } - else - { - throw new ArgumentError("Empty texture array"); - } - } - - private function init(textures:Vector., fps:Number):void - { - if (fps <= 0) throw new ArgumentError("Invalid fps: " + fps); - var numFrames:int = textures.length; - - _defaultFrameDuration = 1.0 / fps; - _loop = true; - _playing = true; - _currentTime = 0.0; - _currentFrameID = 0; - _wasStopped = true; - _frames = new []; - - for (var i:int=0; i numFrames) throw new ArgumentError("Invalid frame id"); - if (duration < 0) duration = _defaultFrameDuration; - - var frame:MovieClipFrame = new MovieClipFrame(texture, duration); - frame.sound = sound; - _frames.insertAt(frameID, frame); - - if (frameID == numFrames) - { - var prevStartTime:Number = frameID > 0 ? _frames[frameID - 1].startTime : 0.0; - var prevDuration:Number = frameID > 0 ? _frames[frameID - 1].duration : 0.0; - frame.startTime = prevStartTime + prevDuration; - } - else - updateStartTimes(); - } - - /** Removes the frame at a certain ID. The successors will move down. */ - public function removeFrameAt(frameID:int):void - { - if (frameID < 0 || frameID >= numFrames) throw new ArgumentError("Invalid frame id"); - if (numFrames == 1) throw new IllegalOperationError("Movie clip must not be empty"); - - _frames.removeAt(frameID); - - if (frameID != numFrames) - updateStartTimes(); - } - - /** Returns the texture of a certain frame. */ - public function getFrameTexture(frameID:int):Texture - { - if (frameID < 0 || frameID >= numFrames) throw new ArgumentError("Invalid frame id"); - return _frames[frameID].texture; - } - - /** Sets the texture of a certain frame. */ - public function setFrameTexture(frameID:int, texture:Texture):void - { - if (frameID < 0 || frameID >= numFrames) throw new ArgumentError("Invalid frame id"); - _frames[frameID].texture = texture; - } - - /** Returns the sound of a certain frame. */ - public function getFrameSound(frameID:int):Sound - { - if (frameID < 0 || frameID >= numFrames) throw new ArgumentError("Invalid frame id"); - return _frames[frameID].sound; - } - - /** Sets the sound of a certain frame. The sound will be played whenever the frame - * is displayed. */ - public function setFrameSound(frameID:int, sound:Sound):void - { - if (frameID < 0 || frameID >= numFrames) throw new ArgumentError("Invalid frame id"); - _frames[frameID].sound = sound; - } - - /** Returns the method that is executed at a certain frame. */ - public function getFrameAction(frameID:int):Function - { - if (frameID < 0 || frameID >= numFrames) throw new ArgumentError("Invalid frame id"); - return _frames[frameID].action; - } - - /** Sets an action that will be executed whenever a certain frame is reached. */ - public function setFrameAction(frameID:int, action:Function):void - { - if (frameID < 0 || frameID >= numFrames) throw new ArgumentError("Invalid frame id"); - _frames[frameID].action = action; - } - - /** Returns the duration of a certain frame (in seconds). */ - public function getFrameDuration(frameID:int):Number - { - if (frameID < 0 || frameID >= numFrames) throw new ArgumentError("Invalid frame id"); - return _frames[frameID].duration; - } - - /** Sets the duration of a certain frame (in seconds). */ - public function setFrameDuration(frameID:int, duration:Number):void - { - if (frameID < 0 || frameID >= numFrames) throw new ArgumentError("Invalid frame id"); - _frames[frameID].duration = duration; - updateStartTimes(); - } - - /** Reverses the order of all frames, making the clip run from end to start. - * Makes sure that the currently visible frame stays the same. */ - public function reverseFrames():void - { - _frames.reverse(); - _currentTime = totalTime - _currentTime; - _currentFrameID = numFrames - _currentFrameID - 1; - updateStartTimes(); - } - - // playback methods - - /** Starts playback. Beware that the clip has to be added to a juggler, too! */ - public function play():void - { - _playing = true; - } - - /** Pauses playback. */ - public function pause():void - { - _playing = false; - } - - /** Stops playback, resetting "currentFrame" to zero. */ - public function stop():void - { - _playing = false; - _wasStopped = true; - currentFrame = 0; - } - - // helpers - - private function updateStartTimes():void - { - var numFrames:int = this.numFrames; - var prevFrame:MovieClipFrame = _frames[0]; - prevFrame.startTime = 0; - - for (var i:int=1; i= restTimeInFrame) - { - changedFrame = false; - passedTime -= restTimeInFrame; - _currentTime = frame.startTime + frame.duration; - - if (_currentFrameID == finalFrameID) - { - if (hasEventListener(Event.COMPLETE)) - { - dispatchCompleteEvent = true; - } - else if (_loop) - { - _currentTime = 0; - _currentFrameID = 0; - changedFrame = true; - } - else return; - } - else - { - _currentFrameID += 1; - changedFrame = true; - } - - frame = _frames[_currentFrameID]; - frameAction = frame.action; - - if (changedFrame) - frame.playSound(_soundTransform); - - if (dispatchCompleteEvent) - { - texture = frame.texture; - dispatchEventWith(Event.COMPLETE); - advanceTime(passedTime); - return; - } - else if (frameAction != null) - { - texture = frame.texture; - frame.executeAction(this, _currentFrameID); - advanceTime(passedTime); - return; - } - - restTimeInFrame = frame.duration; - - // prevent a mean floating point problem (issue #851) - if (passedTime + 0.0001 > restTimeInFrame && passedTime - 0.0001 < restTimeInFrame) - passedTime = restTimeInFrame; - } - - if (previousFrameID != _currentFrameID) - texture = _frames[_currentFrameID].texture; - - _currentTime += passedTime; - } - - // properties - - /** The total number of frames. */ - public function get numFrames():int { return _frames.length; } - - /** The total duration of the clip in seconds. */ - public function get totalTime():Number - { - var lastFrame:MovieClipFrame = _frames[_frames.length-1]; - return lastFrame.startTime + lastFrame.duration; - } - - /** The time that has passed since the clip was started (each loop starts at zero). */ - public function get currentTime():Number { return _currentTime; } - public function set currentTime(value:Number):void - { - if (value < 0 || value > totalTime) throw new ArgumentError("Invalid time: " + value); - - var lastFrameID:int = _frames.length - 1; - _currentTime = value; - _currentFrameID = 0; - - while (_currentFrameID < lastFrameID && _frames[_currentFrameID + 1].startTime <= value) - ++_currentFrameID; - - var frame:MovieClipFrame = _frames[_currentFrameID]; - texture = frame.texture; - } - - /** Indicates if the clip should loop. @default true */ - public function get loop():Boolean { return _loop; } - public function set loop(value:Boolean):void { _loop = value; } - - /** If enabled, no new sounds will be started during playback. Sounds that are already - * playing are not affected. */ - public function get muted():Boolean { return _muted; } - public function set muted(value:Boolean):void { _muted = value; } - - /** The SoundTransform object used for playback of all frame sounds. @default null */ - public function get soundTransform():SoundTransform { return _soundTransform; } - public function set soundTransform(value:SoundTransform):void { _soundTransform = value; } - - /** The index of the frame that is currently displayed. */ - public function get currentFrame():int { return _currentFrameID; } - public function set currentFrame(value:int):void - { - if (value < 0 || value >= numFrames) throw new ArgumentError("Invalid frame id"); - currentTime = _frames[value].startTime; - } - - /** The default number of frames per second. Individual frames can have different - * durations. If you change the fps, the durations of all frames will be scaled - * relatively to the previous value. */ - public function get fps():Number { return 1.0 / _defaultFrameDuration; } - public function set fps(value:Number):void - { - if (value <= 0) throw new ArgumentError("Invalid fps: " + value); - - var newFrameDuration:Number = 1.0 / value; - var acceleration:Number = newFrameDuration / _defaultFrameDuration; - _currentTime *= acceleration; - _defaultFrameDuration = newFrameDuration; - - for (var i:int=0; ifalse when the end - * is reached. */ - public function get isPlaying():Boolean - { - if (_playing) - return _loop || _currentTime < totalTime; - else - return false; - } - - /** Indicates if a (non-looping) movie has come to its end. */ - public function get isComplete():Boolean - { - return !_loop && _currentTime >= totalTime; - } - } -} - -import flash.media.Sound; -import flash.media.SoundTransform; - -import starling.display.MovieClip; -import starling.textures.Texture; - -class MovieClipFrame -{ - public function MovieClipFrame(texture:Texture, duration:Number=0.1, startTime:Number=0) - { - this.texture = texture; - this.duration = duration; - this.startTime = startTime; - } - - public var texture:Texture; - public var sound:Sound; - public var duration:Number; - public var startTime:Number; - public var action:Function; - - public function playSound(transform:SoundTransform):void - { - if (sound) sound.play(0, 0, transform); - } - - public function executeAction(movie:MovieClip, frameID:int):void - { - if (action != null) - { - var numArgs:int = action.length; - - if (numArgs == 0) action(); - else if (numArgs == 1) action(movie); - else if (numArgs == 2) action(movie, frameID); - else throw new Error("Frame actions support zero, one or two parameters: " + - "movie:MovieClip, frameID:int"); - } - } -} \ No newline at end of file diff --git a/mobile_version/src/starling/display/Quad.as b/mobile_version/src/starling/display/Quad.as deleted file mode 100644 index 5c0f1e00..00000000 --- a/mobile_version/src/starling/display/Quad.as +++ /dev/null @@ -1,209 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= - -package starling.display -{ - import flash.geom.Matrix; - import flash.geom.Matrix3D; - import flash.geom.Point; - import flash.geom.Rectangle; - import flash.geom.Vector3D; - - import starling.rendering.IndexData; - import starling.rendering.VertexData; - import starling.styles.MeshStyle; - import starling.textures.Texture; - import starling.utils.RectangleUtil; - - /** A Quad represents a colored and/or textured rectangle. - * - *

Quads may have a color and a texture. When assigning a texture, the colors of the - * vertices will "tint" the texture, i.e. the vertex color will be multiplied with the color - * of the texture at the same position. That's why the default color of a quad is pure white: - * tinting with white does not change the texture color (that's a multiplication with one).

- * - *

A quad is, by definition, always rectangular. The basic quad class will always contain - * exactly four vertices, arranged like this:

- * - *
-     *  0 - 1
-     *  | / |
-     *  2 - 3
-     *  
- * - *

You can set the color of each vertex individually; and since the colors will smoothly - * fade into each other over the area of the quad, you can use this to create simple linear - * color gradients (e.g. by assigning one color to vertices 0 and 1 and another to vertices - * 2 and 3).

- * - *

However, note that the number of vertices may be different in subclasses. - * Check the property numVertices if you are unsure.

- * - * @see starling.textures.Texture - * @see Image - */ - public class Quad extends Mesh - { - private var _bounds:Rectangle; - - // helper objects - private static var sPoint3D:Vector3D = new Vector3D(); - private static var sMatrix:Matrix = new Matrix(); - private static var sMatrix3D:Matrix3D = new Matrix3D(); - - /** Creates a quad with a certain size and color. */ - public function Quad(width:Number, height:Number, color:uint=0xffffff) - { - _bounds = new Rectangle(0, 0, width, height); - - var vertexData:VertexData = new VertexData(MeshStyle.VERTEX_FORMAT, 4); - var indexData:IndexData = new IndexData(6); - - super(vertexData, indexData); - - if (width == 0.0 || height == 0.0) - throw new ArgumentError("Invalid size: width and height must not be zero"); - - setupVertices(); - this.color = color; - } - - /** Sets up vertex- and index-data according to the current settings. */ - protected function setupVertices():void - { - var posAttr:String = "position"; - var texAttr:String = "texCoords"; - var texture:Texture = style.texture; - var vertexData:VertexData = this.vertexData; - var indexData:IndexData = this.indexData; - - indexData.numIndices = 0; - indexData.addQuad(0, 1, 2, 3); - - if (vertexData.numVertices != 4) - { - vertexData.numVertices = 4; - vertexData.trim(); - } - - if (texture) - { - texture.setupVertexPositions(vertexData, 0, "position", _bounds); - texture.setupTextureCoordinates(vertexData, 0, texAttr); - } - else - { - vertexData.setPoint(0, posAttr, _bounds.left, _bounds.top); - vertexData.setPoint(1, posAttr, _bounds.right, _bounds.top); - vertexData.setPoint(2, posAttr, _bounds.left, _bounds.bottom); - vertexData.setPoint(3, posAttr, _bounds.right, _bounds.bottom); - - vertexData.setPoint(0, texAttr, 0.0, 0.0); - vertexData.setPoint(1, texAttr, 1.0, 0.0); - vertexData.setPoint(2, texAttr, 0.0, 1.0); - vertexData.setPoint(3, texAttr, 1.0, 1.0); - } - - setRequiresRedraw(); - } - - /** @inheritDoc */ - public override function getBounds(targetSpace:DisplayObject, out:Rectangle=null):Rectangle - { - if (out == null) out = new Rectangle(); - - if (targetSpace == this) // optimization - { - out.copyFrom(_bounds); - } - else if (targetSpace == parent && !isRotated) // optimization - { - var scaleX:Number = this.scaleX; - var scaleY:Number = this.scaleY; - - out.setTo( x - pivotX * scaleX, y - pivotY * scaleY, - _bounds.width * scaleX, _bounds.height * scaleY); - - if (scaleX < 0) { out.width *= -1; out.x -= out.width; } - if (scaleY < 0) { out.height *= -1; out.y -= out.height; } - } - else if (is3D && stage) - { - stage.getCameraPosition(targetSpace, sPoint3D); - getTransformationMatrix3D(targetSpace, sMatrix3D); - RectangleUtil.getBoundsProjected(_bounds, sMatrix3D, sPoint3D, out); - } - else - { - getTransformationMatrix(targetSpace, sMatrix); - RectangleUtil.getBounds(_bounds, sMatrix, out); - } - - return out; - } - - /** @inheritDoc */ - override public function hitTest(localPoint:Point):DisplayObject - { - if (!visible || !touchable || !hitTestMask(localPoint)) return null; - else if (_bounds.containsPoint(localPoint)) return this; - else return null; - } - - /** Readjusts the dimensions of the quad. Use this method without any arguments to - * synchronize quad and texture size after assigning a texture with a different size. - * You can also force a certain width and height by passing positive, non-zero - * values for width and height. */ - public function readjustSize(width:Number=-1, height:Number=-1):void - { - if (width <= 0) width = texture ? texture.frameWidth : _bounds.width; - if (height <= 0) height = texture ? texture.frameHeight : _bounds.height; - - if (width != _bounds.width || height != _bounds.height) - { - _bounds.setTo(0, 0, width, height); - setupVertices(); - } - } - - /** Creates a quad from the given texture. - * The quad will have the same size as the texture. */ - public static function fromTexture(texture:Texture):Quad - { - var quad:Quad = new Quad(100, 100); - quad.texture = texture; - quad.readjustSize(); - return quad; - } - - /** The texture that is mapped to the quad (or null, if there is none). - * Per default, it is mapped to the complete quad, i.e. to the complete area between the - * top left and bottom right vertices. This can be changed with the - * setTexCoords-method. - * - *

Note that the size of the quad will not change when you assign a texture, which - * means that the texture might be distorted at first. Call readjustSize to - * synchronize quad and texture size.

- * - *

You could also set the texture via the style.texture property. - * That way, however, the texture frame won't be taken into account. Since only rectangular - * objects can make use of a texture frame, only a property on the Quad class can do that. - *

- */ - override public function set texture(value:Texture):void - { - if (value != texture) - { - super.texture = value; - setupVertices(); - } - } - } -} \ No newline at end of file diff --git a/mobile_version/src/starling/display/Sprite.as b/mobile_version/src/starling/display/Sprite.as deleted file mode 100644 index 2cb45b84..00000000 --- a/mobile_version/src/starling/display/Sprite.as +++ /dev/null @@ -1,27 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= - -package starling.display -{ - /** A Sprite is the most lightweight, non-abstract container class. - * Use it as a simple means of grouping objects together in one coordinate system. - * - * @see DisplayObject - * @see DisplayObjectContainer - */ - public class Sprite extends DisplayObjectContainer - { - /** Creates an empty sprite. */ - public function Sprite() - { - super(); - } - } -} \ No newline at end of file diff --git a/mobile_version/src/starling/display/Sprite3D.as b/mobile_version/src/starling/display/Sprite3D.as deleted file mode 100644 index d8951b03..00000000 --- a/mobile_version/src/starling/display/Sprite3D.as +++ /dev/null @@ -1,372 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= - -package starling.display -{ - import flash.geom.Matrix; - import flash.geom.Matrix3D; - import flash.geom.Point; - import flash.geom.Vector3D; - - import starling.events.Event; - import starling.rendering.Painter; - import starling.utils.MathUtil; - import starling.utils.MatrixUtil; - import starling.utils.rad2deg; - - /** A container that allows you to position objects in three-dimensional space. - * - *

Starling is, at its heart, a 2D engine. However, sometimes, simple 3D effects are - * useful for special effects, e.g. for screen transitions or to turn playing cards - * realistically. This class makes it possible to create such 3D effects.

- * - *

Positioning objects in 3D

- * - *

Just like a normal sprite, you can add and remove children to this container, which - * allows you to group several display objects together. In addition to that, Sprite3D - * adds some interesting properties:

- * - *
    - *
  • z - Moves the sprite closer to / further away from the camera.
  • - *
  • rotationX — Rotates the sprite around the x-axis.
  • - *
  • rotationY — Rotates the sprite around the y-axis.
  • - *
  • scaleZ - Scales the sprite along the z-axis.
  • - *
  • pivotZ - Moves the pivot point along the z-axis.
  • - *
- * - *

With the help of these properties, you can move a sprite and all its children in the - * 3D space. By nesting several Sprite3D containers, it's even possible to construct simple - * volumetric objects (like a cube).

- * - *

Note that Starling does not make any z-tests: visibility is solely established by the - * order of the children, just as with 2D objects.

- * - *

Setting up the camera

- * - *

The camera settings are found directly on the stage. Modify the 'focalLength' or - * 'fieldOfView' properties to change the distance between stage and camera; use the - * 'projectionOffset' to move it to a different position.

- * - *

Limitations

- * - *

On rendering, each Sprite3D requires its own draw call — except if the object does not - * contain any 3D transformations ('z', 'rotationX/Y' and 'pivotZ' are zero). Furthermore, - * it interrupts the render cache, i.e. the cache cannot contain objects within different - * 3D coordinate systems. Flat contents within the Sprite3D will be cached, though.

- * - */ - public class Sprite3D extends DisplayObjectContainer - { - private static const E:Number = 0.00001; - - private var _rotationX:Number; - private var _rotationY:Number; - private var _scaleZ:Number; - private var _pivotZ:Number; - private var _z:Number; - - private var _transformationMatrix:Matrix; - private var _transformationMatrix3D:Matrix3D; - private var _transformationChanged:Boolean; - private var _is2D:Boolean; - - /** Helper objects. */ - private static var sHelperPoint:Vector3D = new Vector3D(); - private static var sHelperPointAlt:Vector3D = new Vector3D(); - private static var sHelperMatrix:Matrix3D = new Matrix3D(); - - /** Creates an empty Sprite3D. */ - public function Sprite3D() - { - _scaleZ = 1.0; - _rotationX = _rotationY = _pivotZ = _z = 0.0; - _transformationMatrix = new Matrix(); - _transformationMatrix3D = new Matrix3D(); - _is2D = true; // meaning: this 3D object contains only 2D content - setIs3D(true); // meaning: this display object supports 3D transformations - - addEventListener(Event.ADDED, onAddedChild); - addEventListener(Event.REMOVED, onRemovedChild); - } - - /** @inheritDoc */ - override public function render(painter:Painter):void - { - if (_is2D) super.render(painter); - else - { - painter.finishMeshBatch(); - painter.pushState(); - painter.state.transformModelviewMatrix3D(transformationMatrix3D); - - super.render(painter); - - painter.finishMeshBatch(); - painter.excludeFromCache(this); - painter.popState(); - } - } - - /** @inheritDoc */ - override public function hitTest(localPoint:Point):DisplayObject - { - if (_is2D) return super.hitTest(localPoint); - else - { - if (!visible || !touchable) return null; - - // We calculate the interception point between the 3D plane that is spawned up - // by this sprite3D and the straight line between the camera and the hit point. - - sHelperMatrix.copyFrom(transformationMatrix3D); - sHelperMatrix.invert(); - - stage.getCameraPosition(this, sHelperPoint); - MatrixUtil.transformCoords3D(sHelperMatrix, localPoint.x, localPoint.y, 0, sHelperPointAlt); - MathUtil.intersectLineWithXYPlane(sHelperPoint, sHelperPointAlt, localPoint); - - return super.hitTest(localPoint); - } - } - - /** @private */ - override public function setRequiresRedraw():void - { - _is2D = _z > -E && _z < E && - _rotationX > -E && _rotationX < E && - _rotationY > -E && _rotationY < E && - _pivotZ > -E && _pivotZ < E; - - super.setRequiresRedraw(); - } - - // helpers - - private function onAddedChild(event:Event):void - { - recursivelySetIs3D(event.target as DisplayObject, true); - } - - private function onRemovedChild(event:Event):void - { - recursivelySetIs3D(event.target as DisplayObject, false); - } - - private function recursivelySetIs3D(object:DisplayObject, value:Boolean):void - { - if (object is Sprite3D) - return; - - if (object is DisplayObjectContainer) - { - var container:DisplayObjectContainer = object as DisplayObjectContainer; - var numChildren:int = container.numChildren; - - for (var i:int=0; iThis class represents the Starling version of the stage. Don't confuse it with its - * Flash equivalent: while the latter contains objects of the type - * flash.display.DisplayObject, the Starling stage contains only objects of the - * type starling.display.DisplayObject. Those classes are not compatible, and - * you cannot exchange one type with the other.

- * - *

A stage object is created automatically by the Starling class. Don't - * create a Stage instance manually.

- * - * Keyboard Events - * - *

In Starling, keyboard events are only dispatched at the stage. Add an event listener - * directly to the stage to be notified of keyboard events.

- * - * Resize Events - * - *

When the Flash player is resized, the stage dispatches a ResizeEvent. The - * event contains properties containing the updated width and height of the Flash player.

- * - * @see starling.events.KeyboardEvent - * @see starling.events.ResizeEvent - * - */ - public class Stage extends DisplayObjectContainer - { - private var _width:int; - private var _height:int; - private var _color:uint; - private var _fieldOfView:Number; - private var _projectionOffset:Point; - private var _cameraPosition:Vector3D; - private var _enterFrameEvent:EnterFrameEvent; - private var _enterFrameListeners:Vector.; - - // helper objects - private static var sMatrix:Matrix = new Matrix(); - private static var sMatrix3D:Matrix3D = new Matrix3D(); - - /** @private */ - public function Stage(width:int, height:int, color:uint=0) - { - _width = width; - _height = height; - _color = color; - _fieldOfView = 1.0; - _projectionOffset = new Point(); - _cameraPosition = new Vector3D(); - _enterFrameEvent = new EnterFrameEvent(Event.ENTER_FRAME, 0.0); - _enterFrameListeners = new []; - } - - /** @inheritDoc */ - public function advanceTime(passedTime:Number):void - { - _enterFrameEvent.reset(Event.ENTER_FRAME, false, passedTime); - broadcastEvent(_enterFrameEvent); - } - - /** Returns the object that is found topmost beneath a point in stage coordinates, or - * the stage itself if nothing else is found. */ - public override function hitTest(localPoint:Point):DisplayObject - { - if (!visible || !touchable) return null; - - // locations outside of the stage area shouldn't be accepted - if (localPoint.x < 0 || localPoint.x > _width || - localPoint.y < 0 || localPoint.y > _height) - return null; - - // if nothing else is hit, the stage returns itself as target - var target:DisplayObject = super.hitTest(localPoint); - return target ? target : this; - } - - /** Draws the complete stage into a BitmapData object. - * - *

If you encounter problems with transparency, start Starling in BASELINE profile - * (or higher). BASELINE_CONSTRAINED might not support transparency on all platforms. - *

- * - * @param destination If you pass null, the object will be created for you. - * If you pass a BitmapData object, it should have the size of the - * back buffer (which is accessible via the respective properties - * on the Starling instance). - * @param transparent If enabled, empty areas will appear transparent; otherwise, they - * will be filled with the stage color. - */ - public function drawToBitmapData(destination:BitmapData=null, - transparent:Boolean=true):BitmapData - { - var painter:Painter = Starling.painter; - var state:RenderState = painter.state; - var context:Context3D = painter.context; - - if (destination == null) - { - var width:int = context.backBufferWidth; - var height:int = context.backBufferHeight; - destination = new BitmapData(width, height, transparent); - } - - painter.pushState(); - state.renderTarget = null; - state.setProjectionMatrix(0, 0, _width, _height, _width, _height, cameraPosition); - - if (transparent) painter.clear(); - else painter.clear(_color, 1); - - render(painter); - painter.finishMeshBatch(); - - context.drawToBitmapData(destination); - context.present(); // required on some platforms to avoid flickering - - painter.popState(); - return destination; - } - - /** Returns the stage bounds (i.e. not the bounds of its contents, but the rectangle - * spawned up by 'stageWidth' and 'stageHeight') in another coordinate system. */ - public function getStageBounds(targetSpace:DisplayObject, out:Rectangle=null):Rectangle - { - if (out == null) out = new Rectangle(); - - out.setTo(0, 0, _width, _height); - getTransformationMatrix(targetSpace, sMatrix); - - return RectangleUtil.getBounds(out, sMatrix, out); - } - - // camera positioning - - /** Returns the position of the camera within the local coordinate system of a certain - * display object. If you do not pass a space, the method returns the global position. - * To change the position of the camera, you can modify the properties 'fieldOfView', - * 'focalDistance' and 'projectionOffset'. - */ - public function getCameraPosition(space:DisplayObject=null, out:Vector3D=null):Vector3D - { - getTransformationMatrix3D(space, sMatrix3D); - - return MatrixUtil.transformCoords3D(sMatrix3D, - _width / 2 + _projectionOffset.x, _height / 2 + _projectionOffset.y, - -focalLength, out); - } - - // enter frame event optimization - - /** @private */ - internal function addEnterFrameListener(listener:DisplayObject):void - { - var index:int = _enterFrameListeners.indexOf(listener); - if (index < 0) _enterFrameListeners[_enterFrameListeners.length] = listener; - } - - /** @private */ - internal function removeEnterFrameListener(listener:DisplayObject):void - { - var index:int = _enterFrameListeners.indexOf(listener); - if (index >= 0) _enterFrameListeners.removeAt(index); - } - - /** @private */ - internal override function getChildEventListeners(object:DisplayObject, eventType:String, - listeners:Vector.):void - { - if (eventType == Event.ENTER_FRAME && object == this) - { - for (var i:int=0, length:int=_enterFrameListeners.length; iviewPort property of the Starling object. */ - public function get stageWidth():int { return _width; } - public function set stageWidth(value:int):void { _width = value; } - - /** The height of the stage coordinate system. Change it to scale its contents relative - * to the viewPort property of the Starling object. */ - public function get stageHeight():int { return _height; } - public function set stageHeight(value:int):void { _height = value; } - - /** The Starling instance this stage belongs to. */ - public function get starling():Starling - { - var instances:Vector. = Starling.all; - var numInstances:int = instances.length; - - for (var i:int=0; iA value close to zero will look similar to an orthographic projection; a value - * close to PI results in a fisheye lens effect. If the field of view is set to 0 or PI, - * nothing is seen on the screen.

- * - * @default 1.0 - */ - public function get fieldOfView():Number { return _fieldOfView; } - public function set fieldOfView(value:Number):void { _fieldOfView = value; } - - /** A vector that moves the camera away from its default position in the center of the - * stage. Use this property to change the center of projection, i.e. the vanishing - * point for 3D display objects.

CAUTION: not a copy, but the actual object!

- */ - public function get projectionOffset():Point { return _projectionOffset; } - public function set projectionOffset(value:Point):void - { - _projectionOffset.setTo(value.x, value.y); - } - - /** The global position of the camera. This property can only be used to find out the - * current position, but not to modify it. For that, use the 'projectionOffset', - * 'fieldOfView' and 'focalLength' properties. If you need the camera position in - * a certain coordinate space, use 'getCameraPosition' instead. - * - *

CAUTION: not a copy, but the actual object!

- */ - public function get cameraPosition():Vector3D - { - return getCameraPosition(null, _cameraPosition); - } - } -} \ No newline at end of file diff --git a/mobile_version/src/starling/errors/AbstractClassError.as b/mobile_version/src/starling/errors/AbstractClassError.as deleted file mode 100644 index a9168935..00000000 --- a/mobile_version/src/starling/errors/AbstractClassError.as +++ /dev/null @@ -1,23 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= - -package starling.errors -{ - /** An AbstractClassError is thrown when you attempt to create an instance of an abstract - * class. */ - public class AbstractClassError extends Error - { - /** Creates a new AbstractClassError object. */ - public function AbstractClassError(message:*="Cannot instantiate abstract class", id:*=0) - { - super(message, id); - } - } -} \ No newline at end of file diff --git a/mobile_version/src/starling/errors/AbstractMethodError.as b/mobile_version/src/starling/errors/AbstractMethodError.as deleted file mode 100644 index 3206babe..00000000 --- a/mobile_version/src/starling/errors/AbstractMethodError.as +++ /dev/null @@ -1,22 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= - -package starling.errors -{ - /** An AbstractMethodError is thrown when you attempt to call an abstract method. */ - public class AbstractMethodError extends Error - { - /** Creates a new AbstractMethodError object. */ - public function AbstractMethodError(message:*="Method needs to be implemented in subclass", id:*=0) - { - super(message, id); - } - } -} \ No newline at end of file diff --git a/mobile_version/src/starling/errors/MissingContextError.as b/mobile_version/src/starling/errors/MissingContextError.as deleted file mode 100644 index 114735ee..00000000 --- a/mobile_version/src/starling/errors/MissingContextError.as +++ /dev/null @@ -1,23 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= - -package starling.errors -{ - /** A MissingContextError is thrown when a Context3D object is required but not (yet) - * available. */ - public class MissingContextError extends Error - { - /** Creates a new MissingContextError object. */ - public function MissingContextError(message:*="Starling context is missing", id:*=0) - { - super(message, id); - } - } -} \ No newline at end of file diff --git a/mobile_version/src/starling/errors/NotSupportedError.as b/mobile_version/src/starling/errors/NotSupportedError.as deleted file mode 100644 index abfacdf6..00000000 --- a/mobile_version/src/starling/errors/NotSupportedError.as +++ /dev/null @@ -1,23 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= - -package starling.errors -{ - /** A NotSupportedError is thrown when you attempt to use a feature that is not supported - * on the current platform. */ - public class NotSupportedError extends Error - { - /** Creates a new NotSupportedError object. */ - public function NotSupportedError(message:* = "", id:* = 0) - { - super(message, id); - } - } -} diff --git a/mobile_version/src/starling/events/EnterFrameEvent.as b/mobile_version/src/starling/events/EnterFrameEvent.as deleted file mode 100644 index de605a0f..00000000 --- a/mobile_version/src/starling/events/EnterFrameEvent.as +++ /dev/null @@ -1,34 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= - -package starling.events -{ - /** An EnterFrameEvent is triggered once per frame and is dispatched to all objects in the - * display tree. - * - * It contains information about the time that has passed since the last frame. That way, you - * can easily make animations that are independent of the frame rate, taking the passed time - * into account. - */ - public class EnterFrameEvent extends Event - { - /** Event type for a display object that is entering a new frame. */ - public static const ENTER_FRAME:String = "enterFrame"; - - /** Creates an enter frame event with the passed time. */ - public function EnterFrameEvent(type:String, passedTime:Number, bubbles:Boolean=false) - { - super(type, bubbles, passedTime); - } - - /** The time that has passed since the last frame (in seconds). */ - public function get passedTime():Number { return data as Number; } - } -} \ No newline at end of file diff --git a/mobile_version/src/starling/events/Event.as b/mobile_version/src/starling/events/Event.as deleted file mode 100644 index 395d22b8..00000000 --- a/mobile_version/src/starling/events/Event.as +++ /dev/null @@ -1,190 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= - -package starling.events -{ - import flash.utils.getQualifiedClassName; - - import starling.core.starling_internal; - import starling.utils.StringUtil; - - use namespace starling_internal; - - /** Event objects are passed as parameters to event listeners when an event occurs. - * This is Starling's version of the Flash Event class. - * - *

EventDispatchers create instances of this class and send them to registered listeners. - * An event object contains information that characterizes an event, most importantly the - * event type and if the event bubbles. The target of an event is the object that - * dispatched it.

- * - *

For some event types, this information is sufficient; other events may need additional - * information to be carried to the listener. In that case, you can subclass "Event" and add - * properties with all the information you require. The "EnterFrameEvent" is an example for - * this practice; it adds a property about the time that has passed since the last frame.

- * - *

Furthermore, the event class contains methods that can stop the event from being - * processed by other listeners - either completely or at the next bubble stage.

- * - * @see EventDispatcher - */ - public class Event - { - /** Event type for a display object that is added to a parent. */ - public static const ADDED:String = "added"; - /** Event type for a display object that is added to the stage */ - public static const ADDED_TO_STAGE:String = "addedToStage"; - /** Event type for a display object that is entering a new frame. */ - public static const ENTER_FRAME:String = "enterFrame"; - /** Event type for a display object that is removed from its parent. */ - public static const REMOVED:String = "removed"; - /** Event type for a display object that is removed from the stage. */ - public static const REMOVED_FROM_STAGE:String = "removedFromStage"; - /** Event type for a triggered button. */ - public static const TRIGGERED:String = "triggered"; - /** Event type for a resized Flash Player. */ - public static const RESIZE:String = "resize"; - /** Event type that may be used whenever something finishes. */ - public static const COMPLETE:String = "complete"; - /** Event type for a (re)created stage3D rendering context. */ - public static const CONTEXT3D_CREATE:String = "context3DCreate"; - /** Event type that is dispatched by the Starling instance directly before rendering. */ - public static const RENDER:String = "render"; - /** Event type that indicates that the root DisplayObject has been created. */ - public static const ROOT_CREATED:String = "rootCreated"; - /** Event type for an animated object that requests to be removed from the juggler. */ - public static const REMOVE_FROM_JUGGLER:String = "removeFromJuggler"; - /** Event type that is dispatched by the AssetManager after a context loss. */ - public static const TEXTURES_RESTORED:String = "texturesRestored"; - /** Event type that is dispatched by the AssetManager when a file/url cannot be loaded. */ - public static const IO_ERROR:String = "ioError"; - /** Event type that is dispatched by the AssetManager when a file/url cannot be loaded. */ - public static const SECURITY_ERROR:String = "securityError"; - /** Event type that is dispatched by the AssetManager when an xml or json file couldn't - * be parsed. */ - public static const PARSE_ERROR:String = "parseError"; - /** Event type that is dispatched by the Starling instance when it encounters a problem - * from which it cannot recover, e.g. a lost device context. */ - public static const FATAL_ERROR:String = "fatalError"; - - /** An event type to be utilized in custom events. Not used by Starling right now. */ - public static const CHANGE:String = "change"; - /** An event type to be utilized in custom events. Not used by Starling right now. */ - public static const CANCEL:String = "cancel"; - /** An event type to be utilized in custom events. Not used by Starling right now. */ - public static const SCROLL:String = "scroll"; - /** An event type to be utilized in custom events. Not used by Starling right now. */ - public static const OPEN:String = "open"; - /** An event type to be utilized in custom events. Not used by Starling right now. */ - public static const CLOSE:String = "close"; - /** An event type to be utilized in custom events. Not used by Starling right now. */ - public static const SELECT:String = "select"; - /** An event type to be utilized in custom events. Not used by Starling right now. */ - public static const READY:String = "ready"; - /** An event type to be utilized in custom events. Not used by Starling right now. */ - public static const UPDATE:String = "update"; - - private static var sEventPool:Vector. = new []; - - private var _target:EventDispatcher; - private var _currentTarget:EventDispatcher; - private var _type:String; - private var _bubbles:Boolean; - private var _stopsPropagation:Boolean; - private var _stopsImmediatePropagation:Boolean; - private var _data:Object; - - /** Creates an event object that can be passed to listeners. */ - public function Event(type:String, bubbles:Boolean=false, data:Object=null) - { - _type = type; - _bubbles = bubbles; - _data = data; - } - - /** Prevents listeners at the next bubble stage from receiving the event. */ - public function stopPropagation():void - { - _stopsPropagation = true; - } - - /** Prevents any other listeners from receiving the event. */ - public function stopImmediatePropagation():void - { - _stopsPropagation = _stopsImmediatePropagation = true; - } - - /** Returns a description of the event, containing type and bubble information. */ - public function toString():String - { - return StringUtil.format("[{0} type=\"{1}\" bubbles={2}]", - getQualifiedClassName(this).split("::").pop(), _type, _bubbles); - } - - /** Indicates if event will bubble. */ - public function get bubbles():Boolean { return _bubbles; } - - /** The object that dispatched the event. */ - public function get target():EventDispatcher { return _target; } - - /** The object the event is currently bubbling at. */ - public function get currentTarget():EventDispatcher { return _currentTarget; } - - /** A string that identifies the event. */ - public function get type():String { return _type; } - - /** Arbitrary data that is attached to the event. */ - public function get data():Object { return _data; } - - // properties for internal use - - /** @private */ - internal function setTarget(value:EventDispatcher):void { _target = value; } - - /** @private */ - internal function setCurrentTarget(value:EventDispatcher):void { _currentTarget = value; } - - /** @private */ - internal function setData(value:Object):void { _data = value; } - - /** @private */ - internal function get stopsPropagation():Boolean { return _stopsPropagation; } - - /** @private */ - internal function get stopsImmediatePropagation():Boolean { return _stopsImmediatePropagation; } - - // event pooling - - /** @private */ - starling_internal static function fromPool(type:String, bubbles:Boolean=false, data:Object=null):Event - { - if (sEventPool.length) return sEventPool.pop().reset(type, bubbles, data); - else return new Event(type, bubbles, data); - } - - /** @private */ - starling_internal static function toPool(event:Event):void - { - event._data = event._target = event._currentTarget = null; - sEventPool[sEventPool.length] = event; // avoiding 'push' - } - - /** @private */ - starling_internal function reset(type:String, bubbles:Boolean=false, data:Object=null):Event - { - _type = type; - _bubbles = bubbles; - _data = data; - _target = _currentTarget = null; - _stopsPropagation = _stopsImmediatePropagation = false; - return this; - } - } -} \ No newline at end of file diff --git a/mobile_version/src/starling/events/EventDispatcher.as b/mobile_version/src/starling/events/EventDispatcher.as deleted file mode 100644 index fad3f714..00000000 --- a/mobile_version/src/starling/events/EventDispatcher.as +++ /dev/null @@ -1,215 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= - -package starling.events -{ - import flash.utils.Dictionary; - - import starling.core.starling_internal; - import starling.display.DisplayObject; - - use namespace starling_internal; - - /** The EventDispatcher class is the base class for all classes that dispatch events. - * This is the Starling version of the Flash class with the same name. - * - *

The event mechanism is a key feature of Starling's architecture. Objects can communicate - * with each other through events. Compared the the Flash event system, Starling's event system - * was simplified. The main difference is that Starling events have no "Capture" phase. - * They are simply dispatched at the target and may optionally bubble up. They cannot move - * in the opposite direction.

- * - *

As in the conventional Flash classes, display objects inherit from EventDispatcher - * and can thus dispatch events. Beware, though, that the Starling event classes are - * not compatible with Flash events: Starling display objects dispatch - * Starling events, which will bubble along Starling display objects - but they cannot - * dispatch Flash events or bubble along Flash display objects.

- * - * @see Event - * @see starling.display.DisplayObject DisplayObject - */ - public class EventDispatcher - { - private var _eventListeners:Dictionary; - - /** Helper object. */ - private static var sBubbleChains:Array = []; - - /** Creates an EventDispatcher. */ - public function EventDispatcher() - { } - - /** Registers an event listener at a certain object. */ - public function addEventListener(type:String, listener:Function):void - { - if (_eventListeners == null) - _eventListeners = new Dictionary(); - - var listeners:Vector. = _eventListeners[type] as Vector.; - if (listeners == null) - _eventListeners[type] = new [listener]; - else if (listeners.indexOf(listener) == -1) // check for duplicates - listeners[listeners.length] = listener; // avoid 'push' - } - - /** Removes an event listener from the object. */ - public function removeEventListener(type:String, listener:Function):void - { - if (_eventListeners) - { - var listeners:Vector. = _eventListeners[type] as Vector.; - var numListeners:int = listeners ? listeners.length : 0; - - if (numListeners > 0) - { - // we must not modify the original vector, but work on a copy. - // (see comment in 'invokeEvent') - - var index:int = listeners.indexOf(listener); - - if (index != -1) - { - var restListeners:Vector. = listeners.slice(0, index); - - for (var i:int=index+1; i = _eventListeners ? - _eventListeners[event.type] as Vector. : null; - var numListeners:int = listeners == null ? 0 : listeners.length; - - if (numListeners) - { - event.setCurrentTarget(this); - - // we can enumerate directly over the vector, because: - // when somebody modifies the list while we're looping, "addEventListener" is not - // problematic, and "removeEventListener" will create a new Vector, anyway. - - for (var i:int=0; i; - var element:DisplayObject = this as DisplayObject; - var length:int = 1; - - if (sBubbleChains.length > 0) { chain = sBubbleChains.pop(); chain[0] = element; } - else chain = new [element]; - - while ((element = element.parent) != null) - chain[int(length++)] = element; - - for (var i:int=0; i = _eventListeners ? _eventListeners[type] : null; - if (listeners == null) return false; - else - { - if (listener != null) return listeners.indexOf(listener) != -1; - else return listeners.length != 0; - } - } - } -} \ No newline at end of file diff --git a/mobile_version/src/starling/events/KeyboardEvent.as b/mobile_version/src/starling/events/KeyboardEvent.as deleted file mode 100644 index 7c388ce9..00000000 --- a/mobile_version/src/starling/events/KeyboardEvent.as +++ /dev/null @@ -1,88 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= - -package starling.events -{ - /** A KeyboardEvent is dispatched in response to user input through a keyboard. - * - *

This is Starling's version of the Flash KeyboardEvent class. It contains the same - * properties as the Flash equivalent.

- * - *

To be notified of keyboard events, add an event listener to any display object that - * is part of your display tree. Starling has no concept of a "Focus" like native Flash.

- * - * @see starling.display.Stage - */ - public class KeyboardEvent extends Event - { - /** Event type for a key that was released. */ - public static const KEY_UP:String = "keyUp"; - - /** Event type for a key that was pressed. */ - public static const KEY_DOWN:String = "keyDown"; - - private var _charCode:uint; - private var _keyCode:uint; - private var _keyLocation:uint; - private var _altKey:Boolean; - private var _ctrlKey:Boolean; - private var _shiftKey:Boolean; - private var _isDefaultPrevented:Boolean; - - /** Creates a new KeyboardEvent. */ - public function KeyboardEvent(type:String, charCode:uint=0, keyCode:uint=0, - keyLocation:uint=0, ctrlKey:Boolean=false, - altKey:Boolean=false, shiftKey:Boolean=false) - { - super(type, false, keyCode); - _charCode = charCode; - _keyCode = keyCode; - _keyLocation = keyLocation; - _ctrlKey = ctrlKey; - _altKey = altKey; - _shiftKey = shiftKey; - } - - // prevent default - - /** Cancels the keyboard event's default behavior. This will be forwarded to the native - * flash KeyboardEvent. */ - public function preventDefault():void - { - _isDefaultPrevented = true; - } - - /** Checks whether the preventDefault() method has been called on the event. */ - public function isDefaultPrevented():Boolean { return _isDefaultPrevented; } - - // properties - - /** Contains the character code of the key. */ - public function get charCode():uint { return _charCode; } - - /** The key code of the key. */ - public function get keyCode():uint { return _keyCode; } - - /** Indicates the location of the key on the keyboard. This is useful for differentiating - * keys that appear more than once on a keyboard. @see Keylocation */ - public function get keyLocation():uint { return _keyLocation; } - - /** Indicates whether the Alt key is active on Windows or Linux; - * indicates whether the Option key is active on Mac OS. */ - public function get altKey():Boolean { return _altKey; } - - /** Indicates whether the Ctrl key is active on Windows or Linux; - * indicates whether either the Ctrl or the Command key is active on Mac OS. */ - public function get ctrlKey():Boolean { return _ctrlKey; } - - /** Indicates whether the Shift key modifier is active (true) or inactive (false). */ - public function get shiftKey():Boolean { return _shiftKey; } - } -} \ No newline at end of file diff --git a/mobile_version/src/starling/events/ResizeEvent.as b/mobile_version/src/starling/events/ResizeEvent.as deleted file mode 100644 index 8f4162b7..00000000 --- a/mobile_version/src/starling/events/ResizeEvent.as +++ /dev/null @@ -1,44 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= - -package starling.events -{ - import flash.geom.Point; - - /** A ResizeEvent is dispatched by the stage when the size of the Flash container changes. - * Use it to update the Starling viewport and the stage size. - * - *

The event contains properties containing the updated width and height of the Flash - * player. If you want to scale the contents of your stage to fill the screen, update the - * Starling.current.viewPort rectangle accordingly. If you want to make use of - * the additional screen estate, update the values of stage.stageWidth and - * stage.stageHeight as well.

- * - * @see starling.display.Stage - * @see starling.core.Starling - */ - public class ResizeEvent extends Event - { - /** Event type for a resized Flash player. */ - public static const RESIZE:String = "resize"; - - /** Creates a new ResizeEvent. */ - public function ResizeEvent(type:String, width:int, height:int, bubbles:Boolean=false) - { - super(type, bubbles, new Point(width, height)); - } - - /** The updated width of the player. */ - public function get width():int { return (data as Point).x; } - - /** The updated height of the player. */ - public function get height():int { return (data as Point).y; } - } -} \ No newline at end of file diff --git a/mobile_version/src/starling/events/Touch.as b/mobile_version/src/starling/events/Touch.as deleted file mode 100644 index f8fd139d..00000000 --- a/mobile_version/src/starling/events/Touch.as +++ /dev/null @@ -1,240 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= - -package starling.events -{ - import flash.geom.Point; - - import starling.display.DisplayObject; - import starling.utils.StringUtil; - - /** A Touch object contains information about the presence or movement of a finger - * or the mouse on the screen. - * - *

You receive objects of this type from a TouchEvent. When such an event is triggered, - * you can query it for all touches that are currently present on the screen. One touch - * object contains information about a single touch; it always transitions through a series - * of TouchPhases. Have a look at the TouchPhase class for more information.

- * - * The position of a touch - * - *

You can get the current and previous position in stage coordinates with the corresponding - * properties. However, you'll want to have the position in a different coordinate system - * most of the time. For this reason, there are methods that convert the current and previous - * touches into the local coordinate system of any object.

- * - * @see TouchEvent - * @see TouchPhase - */ - public class Touch - { - private var _id:int; - private var _globalX:Number; - private var _globalY:Number; - private var _previousGlobalX:Number; - private var _previousGlobalY:Number; - private var _tapCount:int; - private var _phase:String; - private var _target:DisplayObject; - private var _timestamp:Number; - private var _pressure:Number; - private var _width:Number; - private var _height:Number; - private var _cancelled:Boolean; - private var _bubbleChain:Vector.; - - /** Helper object. */ - private static var sHelperPoint:Point = new Point(); - - /** Creates a new Touch object. */ - public function Touch(id:int) - { - _id = id; - _tapCount = 0; - _phase = TouchPhase.HOVER; - _pressure = _width = _height = 1.0; - _bubbleChain = new []; - } - - /** Converts the current location of a touch to the local coordinate system of a display - * object. If you pass an out-point, the result will be stored in this point - * instead of creating a new object.*/ - public function getLocation(space:DisplayObject, out:Point=null):Point - { - sHelperPoint.setTo(_globalX, _globalY); - return space.globalToLocal(sHelperPoint, out); - } - - /** Converts the previous location of a touch to the local coordinate system of a display - * object. If you pass an out-point, the result will be stored in this point - * instead of creating a new object.*/ - public function getPreviousLocation(space:DisplayObject, out:Point=null):Point - { - sHelperPoint.setTo(_previousGlobalX, _previousGlobalY); - return space.globalToLocal(sHelperPoint, out); - } - - /** Returns the movement of the touch between the current and previous location. - * If you pass an out-point, the result will be stored in this point instead - * of creating a new object. */ - public function getMovement(space:DisplayObject, out:Point=null):Point - { - if (out == null) out = new Point(); - getLocation(space, out); - var x:Number = out.x; - var y:Number = out.y; - getPreviousLocation(space, out); - out.setTo(x - out.x, y - out.y); - return out; - } - - /** Indicates if the target or one of its children is touched. */ - public function isTouching(target:DisplayObject):Boolean - { - return _bubbleChain.indexOf(target) != -1; - } - - /** Returns a description of the object. */ - public function toString():String - { - return StringUtil.format("[Touch {0}: globalX={1}, globalY={2}, phase={3}]", - _id, _globalX, _globalY, _phase); - } - - /** Creates a clone of the Touch object. */ - public function clone():Touch - { - var clone:Touch = new Touch(_id); - clone._globalX = _globalX; - clone._globalY = _globalY; - clone._previousGlobalX = _previousGlobalX; - clone._previousGlobalY = _previousGlobalY; - clone._phase = _phase; - clone._tapCount = _tapCount; - clone._timestamp = _timestamp; - clone._pressure = _pressure; - clone._width = _width; - clone._height = _height; - clone._cancelled = _cancelled; - clone.target = _target; - return clone; - } - - // helper methods - - private function updateBubbleChain():void - { - if (_target) - { - var length:int = 1; - var element:DisplayObject = _target; - - _bubbleChain.length = 1; - _bubbleChain[0] = element; - - while ((element = element.parent) != null) - _bubbleChain[int(length++)] = element; - } - else - { - _bubbleChain.length = 0; - } - } - - // properties - - /** The identifier of a touch. '0' for mouse events, an increasing number for touches. */ - public function get id():int { return _id; } - - /** The previous x-position of the touch in stage coordinates. */ - public function get previousGlobalX():Number { return _previousGlobalX; } - - /** The previous y-position of the touch in stage coordinates. */ - public function get previousGlobalY():Number { return _previousGlobalY; } - - /** The x-position of the touch in stage coordinates. If you change this value, - * the previous one will be moved to "previousGlobalX". */ - public function get globalX():Number { return _globalX; } - public function set globalX(value:Number):void - { - _previousGlobalX = _globalX != _globalX ? value : _globalX; // isNaN check - _globalX = value; - } - - /** The y-position of the touch in stage coordinates. If you change this value, - * the previous one will be moved to "previousGlobalY". */ - public function get globalY():Number { return _globalY; } - public function set globalY(value:Number):void - { - _previousGlobalY = _globalY != _globalY ? value : _globalY; // isNaN check - _globalY = value; - } - - /** The number of taps the finger made in a short amount of time. Use this to detect - * double-taps / double-clicks, etc. */ - public function get tapCount():int { return _tapCount; } - public function set tapCount(value:int):void { _tapCount = value; } - - /** The current phase the touch is in. @see TouchPhase */ - public function get phase():String { return _phase; } - public function set phase(value:String):void { _phase = value; } - - /** The display object at which the touch occurred. */ - public function get target():DisplayObject { return _target; } - public function set target(value:DisplayObject):void - { - if (_target != value) - { - _target = value; - updateBubbleChain(); - } - } - - /** The moment the touch occurred (in seconds since application start). */ - public function get timestamp():Number { return _timestamp; } - public function set timestamp(value:Number):void { _timestamp = value; } - - /** A value between 0.0 and 1.0 indicating force of the contact with the device. - * If the device does not support detecting the pressure, the value is 1.0. */ - public function get pressure():Number { return _pressure; } - public function set pressure(value:Number):void { _pressure = value; } - - /** Width of the contact area. - * If the device does not support detecting the pressure, the value is 1.0. */ - public function get width():Number { return _width; } - public function set width(value:Number):void { _width = value; } - - /** Height of the contact area. - * If the device does not support detecting the pressure, the value is 1.0. */ - public function get height():Number { return _height; } - public function set height(value:Number):void { _height = value; } - - /** Indicates if the touch has been cancelled, which may happen when the app moves into - * the background ('Event.DEACTIVATE'). @default false */ - public function get cancelled():Boolean { return _cancelled; } - public function set cancelled(value:Boolean):void { _cancelled = value; } - - // internal methods - - /** @private - * Dispatches a touch event along the current bubble chain (which is updated each time - * a target is set). */ - internal function dispatchEvent(event:TouchEvent):void - { - if (_target) event.dispatch(_bubbleChain); - } - - /** @private */ - internal function get bubbleChain():Vector. - { - return _bubbleChain.concat(); - } - } -} diff --git a/mobile_version/src/starling/events/TouchEvent.as b/mobile_version/src/starling/events/TouchEvent.as deleted file mode 100644 index 613c4071..00000000 --- a/mobile_version/src/starling/events/TouchEvent.as +++ /dev/null @@ -1,218 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= - -package starling.events -{ - import starling.core.starling_internal; - import starling.display.DisplayObject; - - use namespace starling_internal; - - /** A TouchEvent is triggered either by touch or mouse input. - * - *

In Starling, both touch events and mouse events are handled through the same class: - * TouchEvent. To process user input from a touch screen or the mouse, you have to register - * an event listener for events of the type TouchEvent.TOUCH. This is the only - * event type you need to handle; the long list of mouse event types as they are used in - * conventional Flash are mapped to so-called "TouchPhases" instead.

- * - *

The difference between mouse input and touch input is that

- * - *
    - *
  • only one mouse cursor can be present at a given moment and
  • - *
  • only the mouse can "hover" over an object without a pressed button.
  • - *
- * - * Which objects receive touch events? - * - *

In Starling, any display object receives touch events, as long as the - * touchable property of the object and its parents is enabled. There - * is no "InteractiveObject" class in Starling.

- * - * How to work with individual touches - * - *

The event contains a list of all touches that are currently present. Each individual - * touch is stored in an object of type "Touch". Since you are normally only interested in - * the touches that occurred on top of certain objects, you can query the event for touches - * with a specific target:

- * - * var touches:Vector.<Touch> = touchEvent.getTouches(this); - * - *

This will return all touches of "this" or one of its children. When you are not using - * multitouch, you can also access the touch object directly, like this:

- * - * var touch:Touch = touchEvent.getTouch(this); - * - * @see Touch - * @see TouchPhase - */ - public class TouchEvent extends Event - { - /** Event type for touch or mouse input. */ - public static const TOUCH:String = "touch"; - - private var _shiftKey:Boolean; - private var _ctrlKey:Boolean; - private var _timestamp:Number; - private var _visitedObjects:Vector.; - - /** Helper object. */ - private static var sTouches:Vector. = new []; - - /** Creates a new TouchEvent instance. */ - public function TouchEvent(type:String, touches:Vector.=null, shiftKey:Boolean=false, - ctrlKey:Boolean=false, bubbles:Boolean=true) - { - super(type, bubbles, touches); - - _shiftKey = shiftKey; - _ctrlKey = ctrlKey; - _visitedObjects = new []; - - updateTimestamp(touches); - } - - /** @private */ - internal function resetTo(type:String, touches:Vector.=null, shiftKey:Boolean=false, - ctrlKey:Boolean=false, bubbles:Boolean=true):TouchEvent - { - super.reset(type, bubbles, touches); - - _shiftKey = shiftKey; - _ctrlKey = ctrlKey; - _visitedObjects.length = 0; - updateTimestamp(touches); - - return this; - } - - private function updateTimestamp(touches:Vector.):void - { - _timestamp = -1.0; - var numTouches:int = touches ? touches.length : 0; - - for (var i:int=0; i _timestamp) - _timestamp = touches[i].timestamp; - } - - /** Returns a list of touches that originated over a certain target. If you pass an - * out-vector, the touches will be added to this vector instead of creating - * a new object. */ - public function getTouches(target:DisplayObject, phase:String=null, - out:Vector.=null):Vector. - { - if (out == null) out = new []; - var allTouches:Vector. = data as Vector.; - var numTouches:int = allTouches.length; - - for (var i:int=0; i 0) - { - var touch:Touch = null; - - if (id < 0) touch = sTouches[0]; - else - { - for (var i:int=0; i=0; --i) - { - if (sTouches[i].phase != TouchPhase.ENDED) - { - result = true; - break; - } - } - - sTouches.length = 0; - return result; - } - - // custom dispatching - - /** @private - * Dispatches the event along a custom bubble chain. During the lifetime of the event, - * each object is visited only once. */ - internal function dispatch(chain:Vector.):void - { - if (chain && chain.length) - { - var chainLength:int = bubbles ? chain.length : 1; - var previousTarget:EventDispatcher = target; - setTarget(chain[0] as EventDispatcher); - - for (var i:int=0; i { return (data as Vector.).concat(); } - - /** Indicates if the shift key was pressed when the event occurred. */ - public function get shiftKey():Boolean { return _shiftKey; } - - /** Indicates if the ctrl key was pressed when the event occurred. (Mac OS: Cmd or Ctrl) */ - public function get ctrlKey():Boolean { return _ctrlKey; } - } -} \ No newline at end of file diff --git a/mobile_version/src/starling/events/TouchMarker.as b/mobile_version/src/starling/events/TouchMarker.as deleted file mode 100644 index df3ff940..00000000 --- a/mobile_version/src/starling/events/TouchMarker.as +++ /dev/null @@ -1,104 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= - -package starling.events -{ - import flash.display.BitmapData; - import flash.display.Shape; - import flash.geom.Point; - - import starling.core.Starling; - import starling.display.Image; - import starling.display.Sprite; - import starling.textures.Texture; - - /** The TouchMarker is used internally to mark touches created through "simulateMultitouch". */ - internal class TouchMarker extends Sprite - { - private var _center:Point; - private var _texture:Texture; - - public function TouchMarker() - { - _center = new Point(); - _texture = createTexture(); - - for (var i:int=0; i<2; ++i) - { - var marker:Image = new Image(_texture); - marker.pivotX = _texture.width / 2; - marker.pivotY = _texture.height / 2; - marker.touchable = false; - addChild(marker); - } - } - - public override function dispose():void - { - _texture.dispose(); - super.dispose(); - } - - public function moveMarker(x:Number, y:Number, withCenter:Boolean=false):void - { - if (withCenter) - { - _center.x += x - realMarker.x; - _center.y += y - realMarker.y; - } - - realMarker.x = x; - realMarker.y = y; - mockMarker.x = 2*_center.x - x; - mockMarker.y = 2*_center.y - y; - } - - public function moveCenter(x:Number, y:Number):void - { - _center.x = x; - _center.y = y; - moveMarker(realX, realY); // reset mock position - } - - private function createTexture():Texture - { - var scale:Number = Starling.contentScaleFactor; - var radius:Number = 12 * scale; - var width:int = 32 * scale; - var height:int = 32 * scale; - var thickness:Number = 1.5 * scale; - var shape:Shape = new Shape(); - - // draw dark outline - shape.graphics.lineStyle(thickness, 0x0, 0.3); - shape.graphics.drawCircle(width/2, height/2, radius + thickness); - - // draw white inner circle - shape.graphics.beginFill(0xffffff, 0.4); - shape.graphics.lineStyle(thickness, 0xffffff); - shape.graphics.drawCircle(width/2, height/2, radius); - shape.graphics.endFill(); - - var bmpData:BitmapData = new BitmapData(width, height, true, 0x0); - bmpData.draw(shape); - - return Texture.fromBitmapData(bmpData, false, false, scale); - } - - private function get realMarker():Image { return getChildAt(0) as Image; } - private function get mockMarker():Image { return getChildAt(1) as Image; } - - public function get realX():Number { return realMarker.x; } - public function get realY():Number { return realMarker.y; } - - public function get mockX():Number { return mockMarker.x; } - public function get mockY():Number { return mockMarker.y; } - } -} \ No newline at end of file diff --git a/mobile_version/src/starling/events/TouchPhase.as b/mobile_version/src/starling/events/TouchPhase.as deleted file mode 100644 index 2749a8ae..00000000 --- a/mobile_version/src/starling/events/TouchPhase.as +++ /dev/null @@ -1,53 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= - -package starling.events -{ - import starling.errors.AbstractClassError; - - /** A class that provides constant values for the phases of a touch object. - * - *

A touch moves through at least the following phases in its life:

- * - * BEGAN -> MOVED -> ENDED - * - *

Furthermore, a touch can enter a STATIONARY phase. That phase does not - * trigger a touch event itself, and it can only occur in multitouch environments. Picture a - * situation where one finger is moving and the other is stationary. A touch event will - * be dispatched only to the object under the moving finger. In the list of touches - * of that event, you will find the second touch in the stationary phase.

- * - *

Finally, there's the HOVER phase, which is exclusive to mouse input. It is - * the equivalent of a MouseOver event in Flash when the mouse button is - * not pressed.

- */ - public final class TouchPhase - { - /** @private */ - public function TouchPhase() { throw new AbstractClassError(); } - - /** Only available for mouse input: the cursor hovers over an object without a - * pressed button. */ - public static const HOVER:String = "hover"; - - /** The finger touched the screen just now, or the mouse button was pressed. */ - public static const BEGAN:String = "began"; - - /** The finger moves around on the screen, or the mouse is moved while the button is - * pressed. */ - public static const MOVED:String = "moved"; - - /** The finger or mouse (with pressed button) has not moved since the last frame. */ - public static const STATIONARY:String = "stationary"; - - /** The finger was lifted from the screen or from the mouse button. */ - public static const ENDED:String = "ended"; - } -} \ No newline at end of file diff --git a/mobile_version/src/starling/events/TouchProcessor.as b/mobile_version/src/starling/events/TouchProcessor.as deleted file mode 100644 index 76ff3751..00000000 --- a/mobile_version/src/starling/events/TouchProcessor.as +++ /dev/null @@ -1,481 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= - -package starling.events -{ - import flash.geom.Point; - import flash.utils.getDefinitionByName; - - import starling.core.Starling; - import starling.display.DisplayObject; - import starling.display.Stage; - - /** The TouchProcessor is used to convert mouse and touch events of the conventional - * Flash stage to Starling's TouchEvents. - * - *

The Starling instance listens to mouse and touch events on the native stage. The - * attributes of those events are enqueued (right as they are happening) in the - * TouchProcessor.

- * - *

Once per frame, the "advanceTime" method is called. It analyzes the touch queue and - * figures out which touches are active at that moment; the properties of all touch objects - * are updated accordingly.

- * - *

Once the list of touches has been finalized, the "processTouches" method is called - * (that might happen several times in one "advanceTime" execution; no information is - * discarded). It's responsible for dispatching the actual touch events to the Starling - * display tree.

- * - * Subclassing TouchProcessor - * - *

You can extend the TouchProcessor if you need to have more control over touch and - * mouse input. For example, you could filter the touches by overriding the "processTouches" - * method, throwing away any touches you're not interested in and passing the rest to the - * super implementation.

- * - *

To use your custom TouchProcessor, assign it to the "Starling.touchProcessor" - * property.

- * - *

Note that you should not dispatch TouchEvents yourself, since they are - * much more complex to handle than conventional events (e.g. it must be made sure that an - * object receives a TouchEvent only once, even if it's manipulated with several fingers). - * Always use the base implementation of "processTouches" to let them be dispatched. That - * said: you can always dispatch your own custom events, of course.

- */ - public class TouchProcessor - { - private var _stage:Stage; - private var _root:DisplayObject; - private var _elapsedTime:Number; - private var _lastTaps:Vector.; - private var _shiftDown:Boolean = false; - private var _ctrlDown:Boolean = false; - private var _multitapTime:Number = 0.3; - private var _multitapDistance:Number = 25; - private var _touchEvent:TouchEvent; - - private var _touchMarker:TouchMarker; - private var _simulateMultitouch:Boolean; - - /** A vector of arrays with the arguments that were passed to the "enqueue" - * method (the oldest being at the end of the vector). */ - protected var _queue:Vector.; - - /** The list of all currently active touches. */ - protected var _currentTouches:Vector.; - - /** Helper objects. */ - private static var sUpdatedTouches:Vector. = new []; - private static var sHoveringTouchData:Vector. = new []; - private static var sHelperPoint:Point = new Point(); - - /** Creates a new TouchProcessor that will dispatch events to the given stage. */ - public function TouchProcessor(stage:Stage) - { - _root = _stage = stage; - _elapsedTime = 0.0; - _currentTouches = new []; - _queue = new []; - _lastTaps = new []; - _touchEvent = new TouchEvent(TouchEvent.TOUCH); - - _stage.addEventListener(KeyboardEvent.KEY_DOWN, onKey); - _stage.addEventListener(KeyboardEvent.KEY_UP, onKey); - monitorInterruptions(true); - } - - /** Removes all event handlers on the stage and releases any acquired resources. */ - public function dispose():void - { - monitorInterruptions(false); - _stage.removeEventListener(KeyboardEvent.KEY_DOWN, onKey); - _stage.removeEventListener(KeyboardEvent.KEY_UP, onKey); - if (_touchMarker) _touchMarker.dispose(); - } - - /** Analyzes the current touch queue and processes the list of current touches, emptying - * the queue while doing so. This method is called by Starling once per frame. */ - public function advanceTime(passedTime:Number):void - { - var i:int; - var touch:Touch; - - _elapsedTime += passedTime; - sUpdatedTouches.length = 0; - - // remove old taps - if (_lastTaps.length > 0) - { - for (i=_lastTaps.length-1; i>=0; --i) - if (_elapsedTime - _lastTaps[i].timestamp > _multitapTime) - _lastTaps.removeAt(i); - } - - while (_queue.length > 0) - { - // Set touches that were new or moving to phase 'stationary'. - for each (touch in _currentTouches) - if (touch.phase == TouchPhase.BEGAN || touch.phase == TouchPhase.MOVED) - touch.phase = TouchPhase.STATIONARY; - - // analyze new touches, but each ID only once - while (_queue.length > 0 && - !containsTouchWithID(sUpdatedTouches, _queue[_queue.length-1][0])) - { - var touchArgs:Array = _queue.pop(); - touch = createOrUpdateTouch( - touchArgs[0], touchArgs[1], touchArgs[2], touchArgs[3], - touchArgs[4], touchArgs[5], touchArgs[6]); - - sUpdatedTouches[sUpdatedTouches.length] = touch; // avoiding 'push' - } - - // process the current set of touches (i.e. dispatch touch events) - processTouches(sUpdatedTouches, _shiftDown, _ctrlDown); - - // remove ended touches - for (i=_currentTouches.length-1; i>=0; --i) - if (_currentTouches[i].phase == TouchPhase.ENDED) - _currentTouches.removeAt(i); - - sUpdatedTouches.length = 0; - } - } - - /** Dispatches TouchEvents to the display objects that are affected by the list of - * given touches. Called internally by "advanceTime". To calculate updated targets, - * the method will call "hitTest" on the "root" object. - * - * @param touches a list of all touches that have changed just now. - * @param shiftDown indicates if the shift key was down when the touches occurred. - * @param ctrlDown indicates if the ctrl or cmd key was down when the touches occurred. - */ - protected function processTouches(touches:Vector., - shiftDown:Boolean, ctrlDown:Boolean):void - { - var touch:Touch; - sHoveringTouchData.length = 0; - - // the same touch event will be dispatched to all targets; - // the 'dispatch' method makes sure each bubble target is visited only once. - _touchEvent.resetTo(TouchEvent.TOUCH, _currentTouches, shiftDown, ctrlDown); - - // hit test our updated touches - for each (touch in touches) - { - // hovering touches need special handling (see below) - if (touch.phase == TouchPhase.HOVER && touch.target) - sHoveringTouchData[sHoveringTouchData.length] = { - touch: touch, - target: touch.target, - bubbleChain: touch.bubbleChain - }; // avoiding 'push' - - if (touch.phase == TouchPhase.HOVER || touch.phase == TouchPhase.BEGAN) - { - sHelperPoint.setTo(touch.globalX, touch.globalY); - touch.target = _root.hitTest(sHelperPoint); - } - } - - // if the target of a hovering touch changed, we dispatch the event to the previous - // target to notify it that it's no longer being hovered over. - for each (var touchData:Object in sHoveringTouchData) - if (touchData.touch.target != touchData.target) - _touchEvent.dispatch(touchData.bubbleChain); - - // dispatch events for the rest of our updated touches - for each (touch in touches) - touch.dispatchEvent(_touchEvent); - - // clean up any references - _touchEvent.resetTo(TouchEvent.TOUCH); - } - - /** Enqueues a new touch our mouse event with the given properties. */ - public function enqueue(touchID:int, phase:String, globalX:Number, globalY:Number, - pressure:Number=1.0, width:Number=1.0, height:Number=1.0):void - { - _queue.unshift(arguments); - - // multitouch simulation (only with mouse) - if (_ctrlDown && _touchMarker && touchID == 0) - { - _touchMarker.moveMarker(globalX, globalY, _shiftDown); - _queue.unshift([1, phase, _touchMarker.mockX, _touchMarker.mockY]); - } - } - - /** Enqueues an artificial touch that represents the mouse leaving the stage. - * - *

On OS X, we get mouse events from outside the stage; on Windows, we do not. - * This method enqueues an artificial hover point that is just outside the stage. - * That way, objects listening for HOVERs over them will get notified everywhere.

- */ - public function enqueueMouseLeftStage():void - { - var mouse:Touch = getCurrentTouch(0); - if (mouse == null || mouse.phase != TouchPhase.HOVER) return; - - var offset:int = 1; - var exitX:Number = mouse.globalX; - var exitY:Number = mouse.globalY; - var distLeft:Number = mouse.globalX; - var distRight:Number = _stage.stageWidth - distLeft; - var distTop:Number = mouse.globalY; - var distBottom:Number = _stage.stageHeight - distTop; - var minDist:Number = Math.min(distLeft, distRight, distTop, distBottom); - - // the new hover point should be just outside the stage, near the point where - // the mouse point was last to be seen. - - if (minDist == distLeft) exitX = -offset; - else if (minDist == distRight) exitX = _stage.stageWidth + offset; - else if (minDist == distTop) exitY = -offset; - else exitY = _stage.stageHeight + offset; - - enqueue(0, TouchPhase.HOVER, exitX, exitY); - } - - /** Force-end all current touches. Changes the phase of all touches to 'ENDED' and - * immediately dispatches a new TouchEvent (if touches are present). Called automatically - * when the app receives a 'DEACTIVATE' event. */ - public function cancelTouches():void - { - if (_currentTouches.length > 0) - { - // abort touches - for each (var touch:Touch in _currentTouches) - { - if (touch.phase == TouchPhase.BEGAN || touch.phase == TouchPhase.MOVED || - touch.phase == TouchPhase.STATIONARY) - { - touch.phase = TouchPhase.ENDED; - touch.cancelled = true; - } - } - - // dispatch events - processTouches(_currentTouches, _shiftDown, _ctrlDown); - } - - // purge touches - _currentTouches.length = 0; - _queue.length = 0; - } - - private function createOrUpdateTouch(touchID:int, phase:String, - globalX:Number, globalY:Number, - pressure:Number=1.0, - width:Number=1.0, height:Number=1.0):Touch - { - var touch:Touch = getCurrentTouch(touchID); - - if (touch == null) - { - touch = new Touch(touchID); - addCurrentTouch(touch); - } - - touch.globalX = globalX; - touch.globalY = globalY; - touch.phase = phase; - touch.timestamp = _elapsedTime; - touch.pressure = pressure; - touch.width = width; - touch.height = height; - - if (phase == TouchPhase.BEGAN) - updateTapCount(touch); - - return touch; - } - - private function updateTapCount(touch:Touch):void - { - var nearbyTap:Touch = null; - var minSqDist:Number = _multitapDistance * _multitapDistance; - - for each (var tap:Touch in _lastTaps) - { - var sqDist:Number = Math.pow(tap.globalX - touch.globalX, 2) + - Math.pow(tap.globalY - touch.globalY, 2); - if (sqDist <= minSqDist) - { - nearbyTap = tap; - break; - } - } - - if (nearbyTap) - { - touch.tapCount = nearbyTap.tapCount + 1; - _lastTaps.removeAt(_lastTaps.indexOf(nearbyTap)); - } - else - { - touch.tapCount = 1; - } - - _lastTaps[_lastTaps.length] = touch.clone(); // avoiding 'push' - } - - private function addCurrentTouch(touch:Touch):void - { - for (var i:int=_currentTouches.length-1; i>=0; --i) - if (_currentTouches[i].id == touch.id) - _currentTouches.removeAt(i); - - _currentTouches[_currentTouches.length] = touch; // avoiding 'push' - } - - private function getCurrentTouch(touchID:int):Touch - { - for each (var touch:Touch in _currentTouches) - if (touch.id == touchID) return touch; - - return null; - } - - private function containsTouchWithID(touches:Vector., touchID:int):Boolean - { - for each (var touch:Touch in touches) - if (touch.id == touchID) return true; - - return false; - } - - /** Indicates if multitouch simulation should be activated. When the user presses - * ctrl/cmd (and optionally shift), he'll see a second touch cursor that mimics the first. - * That's an easy way to develop and test multitouch when there's only a mouse available. - */ - public function get simulateMultitouch():Boolean { return _simulateMultitouch; } - public function set simulateMultitouch(value:Boolean):void - { - if (simulateMultitouch == value) return; // no change - - _simulateMultitouch = value; - var target:Starling = Starling.current; - - if (value && _touchMarker == null) - { - if (Starling.current.contextValid) - createTouchMarker(); - else - target.addEventListener(Event.CONTEXT3D_CREATE, createTouchMarker); - } - else if (!value && _touchMarker) - { - _touchMarker.removeFromParent(true); - _touchMarker = null; - } - - function createTouchMarker():void - { - target.removeEventListener(Event.CONTEXT3D_CREATE, createTouchMarker); - - if (_touchMarker == null) - { - _touchMarker = new TouchMarker(); - _touchMarker.visible = false; - _stage.addChild(_touchMarker); - } - } - } - - /** The time period (in seconds) in which two touches must occur to be recognized as - * a multitap gesture. */ - public function get multitapTime():Number { return _multitapTime; } - public function set multitapTime(value:Number):void { _multitapTime = value; } - - /** The distance (in points) describing how close two touches must be to each other to - * be recognized as a multitap gesture. */ - public function get multitapDistance():Number { return _multitapDistance; } - public function set multitapDistance(value:Number):void { _multitapDistance = value; } - - /** The base object that will be used for hit testing. Per default, this reference points - * to the stage; however, you can limit touch processing to certain parts of your game - * by assigning a different object. */ - public function get root():DisplayObject { return _root; } - public function set root(value:DisplayObject):void { _root = value; } - - /** The stage object to which the touch events are (per default) dispatched. */ - public function get stage():Stage { return _stage; } - - /** Returns the number of fingers / touch points that are currently on the stage. */ - public function get numCurrentTouches():int { return _currentTouches.length; } - - // keyboard handling - - private function onKey(event:KeyboardEvent):void - { - if (event.keyCode == 17 || event.keyCode == 15) // ctrl or cmd key - { - var wasCtrlDown:Boolean = _ctrlDown; - _ctrlDown = event.type == KeyboardEvent.KEY_DOWN; - - if (_touchMarker && wasCtrlDown != _ctrlDown) - { - _touchMarker.visible = _ctrlDown; - _touchMarker.moveCenter(_stage.stageWidth/2, _stage.stageHeight/2); - - var mouseTouch:Touch = getCurrentTouch(0); - var mockedTouch:Touch = getCurrentTouch(1); - - if (mouseTouch) - _touchMarker.moveMarker(mouseTouch.globalX, mouseTouch.globalY); - - if (wasCtrlDown && mockedTouch && mockedTouch.phase != TouchPhase.ENDED) - { - // end active touch ... - _queue.unshift([1, TouchPhase.ENDED, mockedTouch.globalX, mockedTouch.globalY]); - } - else if (_ctrlDown && mouseTouch) - { - // ... or start new one - if (mouseTouch.phase == TouchPhase.HOVER || mouseTouch.phase == TouchPhase.ENDED) - _queue.unshift([1, TouchPhase.HOVER, _touchMarker.mockX, _touchMarker.mockY]); - else - _queue.unshift([1, TouchPhase.BEGAN, _touchMarker.mockX, _touchMarker.mockY]); - } - } - } - else if (event.keyCode == 16) // shift key - { - _shiftDown = event.type == KeyboardEvent.KEY_DOWN; - } - } - - // interruption handling - - private function monitorInterruptions(enable:Boolean):void - { - // if the application moves into the background or is interrupted (e.g. through - // an incoming phone call), we need to abort all touches. - - try - { - var nativeAppClass:Object = getDefinitionByName("flash.desktop::NativeApplication"); - var nativeApp:Object = nativeAppClass["nativeApplication"]; - - if (enable) - nativeApp.addEventListener("deactivate", onInterruption, false, 0, true); - else - nativeApp.removeEventListener("deactivate", onInterruption); - } - catch (e:Error) {} // we're not running in AIR - } - - private function onInterruption(event:Object):void - { - cancelTouches(); - } - } -} diff --git a/mobile_version/src/starling/filters/BlurFilter.as b/mobile_version/src/starling/filters/BlurFilter.as deleted file mode 100644 index 7900468a..00000000 --- a/mobile_version/src/starling/filters/BlurFilter.as +++ /dev/null @@ -1,305 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= - -package starling.filters -{ - import starling.rendering.FilterEffect; - import starling.rendering.Painter; - import starling.textures.Texture; - - /** The BlurFilter applies a Gaussian blur to an object. The strength of the blur can be - * set for x- and y-axis separately. */ - public class BlurFilter extends FragmentFilter - { - private var _blurX:Number; - private var _blurY:Number; - - /** Create a new BlurFilter. For each blur direction, the number of required passes is - * Math.ceil(blur). - * - *
  • blur = 0.5: 1 pass
  • - *
  • blur = 1.0: 1 pass
  • - *
  • blur = 1.5: 2 passes
  • - *
  • blur = 2.0: 2 passes
  • - *
  • etc.
  • - *
- */ - public function BlurFilter(blurX:Number=1.0, blurY:Number=1.0, resolution:Number=1.0) - { - _blurX = blurX; - _blurY = blurY; - this.resolution = resolution; - } - - /** @private */ - override public function process(painter:Painter, helper:IFilterHelper, - input0:Texture = null, input1:Texture = null, - input2:Texture = null, input3:Texture = null):Texture - { - var effect:BlurEffect = this.effect as BlurEffect; - - if (_blurX == 0 && _blurY == 0) - { - effect.strength = 0; - return super.process(painter, helper, input0); - } - - var blurX:Number = Math.abs(_blurX); - var blurY:Number = Math.abs(_blurY); - var outTexture:Texture = input0; - var inTexture:Texture; - - effect.direction = BlurEffect.HORIZONTAL; - - while (blurX > 0) - { - effect.strength = Math.min(1.0, blurX); - - blurX -= effect.strength; - inTexture = outTexture; - outTexture = super.process(painter, helper, inTexture); - - if (inTexture != input0) helper.putTexture(inTexture); - } - - effect.direction = BlurEffect.VERTICAL; - - while (blurY > 0) - { - effect.strength = Math.min(1.0, blurY); - - blurY -= effect.strength; - inTexture = outTexture; - outTexture = super.process(painter, helper, inTexture); - - if (inTexture != input0) helper.putTexture(inTexture); - } - - return outTexture; - } - - /** @private */ - override protected function createEffect():FilterEffect - { - return new BlurEffect(); - } - - /** @private */ - override public function set resolution(value:Number):void - { - super.resolution = value; - updatePadding(); - } - - /** @private */ - override public function get numPasses():int - { - return (Math.ceil(_blurX) + Math.ceil(_blurY)) || 1; - } - - private function updatePadding():void - { - var paddingX:Number = (_blurX ? Math.ceil(Math.abs(_blurX)) + 3 : 1) / resolution; - var paddingY:Number = (_blurY ? Math.ceil(Math.abs(_blurY)) + 3 : 1) / resolution; - - padding.setTo(paddingX, paddingX, paddingY, paddingY); - } - - /** The blur factor in x-direction. - * The number of required passes will be Math.ceil(value). */ - public function get blurX():Number { return _blurX; } - public function set blurX(value:Number):void - { - _blurX = value; - updatePadding(); - } - - /** The blur factor in y-direction. - * The number of required passes will be Math.ceil(value). */ - public function get blurY():Number { return _blurY; } - public function set blurY(value:Number):void - { - _blurY = value; - updatePadding(); - } - } -} - -import flash.display3D.Context3D; -import flash.display3D.Context3DProgramType; - -import starling.rendering.FilterEffect; -import starling.rendering.Program; -import starling.utils.MathUtil; - -class BlurEffect extends FilterEffect -{ - public static const HORIZONTAL:String = "horizontal"; - public static const VERTICAL:String = "vertical"; - - private static const MAX_SIGMA:Number = 2.0; - - private var _strength:Number; - private var _direction:String; - - private var _offsets:Vector. = new [0, 0, 0, 0]; - private var _weights:Vector. = new [0, 0, 0, 0]; - - // helpers - private var sTmpWeights:Vector. = new Vector.(5, true); - - /** Creates a new BlurEffect. - * - * @param direction horizontal or vertical - * @param strength range 0-1 - */ - public function BlurEffect(direction:String="horizontal", strength:Number=1):void - { - this.strength = strength; - this.direction = direction; - } - - override protected function createProgram():Program - { - if (_strength == 0) return super.createProgram(); - - var vertexShader:String = [ - "m44 op, va0, vc0 ", // 4x4 matrix transform to output space - "mov v0, va1 ", // pos: 0 | - "sub v1, va1, vc4.zwxx", // pos: -2 | - "sub v2, va1, vc4.xyxx", // pos: -1 | --> kernel positions - "add v3, va1, vc4.xyxx", // pos: +1 | (only 1st two values are relevant) - "add v4, va1, vc4.zwxx" // pos: +2 | - ].join("\n"); - - // v0-v4 - kernel position - // fs0 - input texture - // fc0 - weight data - // ft0-4 - pixel color from texture - // ft5 - output color - - var fragmentShader:String = [ - tex("ft0", "v0", 0, texture), // read center pixel - "mul ft5, ft0, fc0.xxxx ", // multiply with center weight - - tex("ft1", "v1", 0, texture), // read pixel -2 - "mul ft1, ft1, fc0.zzzz ", // multiply with weight - "add ft5, ft5, ft1 ", // add to output color - - tex("ft2", "v2", 0, texture), // read pixel -1 - "mul ft2, ft2, fc0.yyyy ", // multiply with weight - "add ft5, ft5, ft2 ", // add to output color - - tex("ft3", "v3", 0, texture), // read pixel +1 - "mul ft3, ft3, fc0.yyyy ", // multiply with weight - "add ft5, ft5, ft3 ", // add to output color - - tex("ft4", "v4", 0, texture), // read pixel +2 - "mul ft4, ft4, fc0.zzzz ", // multiply with weight - "add oc, ft5, ft4 " // add to output color - ].join("\n"); - - return Program.fromSource(vertexShader, fragmentShader); - } - - override protected function beforeDraw(context:Context3D):void - { - super.beforeDraw(context); - - if (_strength) - { - updateParameters(); - - context.setProgramConstantsFromVector(Context3DProgramType.VERTEX, 4, _offsets); - context.setProgramConstantsFromVector(Context3DProgramType.FRAGMENT, 0, _weights); - } - } - - override protected function get programVariantName():uint - { - return super.programVariantName | (_strength ? 1 << 4 : 0); - } - - private function updateParameters():void - { - // algorithm described here: - // http://rastergrid.com/blog/2010/09/efficient-gaussian-blur-with-linear-sampling/ - // - // To run in constrained mode, we can only make 5 texture look-ups in the fragment - // shader. By making use of linear texture sampling, we can produce similar output - // to what would be 9 look-ups. - - var sigma:Number; - var pixelSize:Number; - - if (_direction == HORIZONTAL) - { - sigma = _strength * MAX_SIGMA; - pixelSize = 1.0 / texture.root.width; - } - else - { - sigma = _strength * MAX_SIGMA; - pixelSize = 1.0 / texture.root.height; - } - - const twoSigmaSq:Number = 2 * sigma * sigma; - const multiplier:Number = 1.0 / Math.sqrt(twoSigmaSq * Math.PI); - - // get weights on the exact pixels (sTmpWeights) and calculate sums (_weights) - - for (var i:int=0; i<5; ++i) - sTmpWeights[i] = multiplier * Math.exp(-i*i / twoSigmaSq); - - _weights[0] = sTmpWeights[0]; - _weights[1] = sTmpWeights[1] + sTmpWeights[2]; - _weights[2] = sTmpWeights[3] + sTmpWeights[4]; - - // normalize weights so that sum equals "1.0" - - var weightSum:Number = _weights[0] + 2*_weights[1] + 2*_weights[2]; - var invWeightSum:Number = 1.0 / weightSum; - - _weights[0] *= invWeightSum; - _weights[1] *= invWeightSum; - _weights[2] *= invWeightSum; - - // calculate intermediate offsets - - var offset1:Number = ( pixelSize * sTmpWeights[1] + 2*pixelSize * sTmpWeights[2]) / _weights[1]; - var offset2:Number = (3*pixelSize * sTmpWeights[3] + 4*pixelSize * sTmpWeights[4]) / _weights[2]; - - // depending on pass, we move in x- or y-direction - - if (_direction == HORIZONTAL) - { - _offsets[0] = offset1; - _offsets[1] = 0; - _offsets[2] = offset2; - _offsets[3] = 0; - } - else - { - _offsets[0] = 0; - _offsets[1] = offset1; - _offsets[2] = 0; - _offsets[3] = offset2; - } - } - - public function get direction():String { return _direction; } - public function set direction(value:String):void { _direction = value; } - - public function get strength():Number { return _strength; } - public function set strength(value:Number):void - { - _strength = MathUtil.clamp(value, 0, 1); - } -} \ No newline at end of file diff --git a/mobile_version/src/starling/filters/ColorMatrixFilter.as b/mobile_version/src/starling/filters/ColorMatrixFilter.as deleted file mode 100644 index a9fc550c..00000000 --- a/mobile_version/src/starling/filters/ColorMatrixFilter.as +++ /dev/null @@ -1,318 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= - -package starling.filters -{ - import starling.rendering.FilterEffect; - import starling.utils.Color; - - /** The ColorMatrixFilter class lets you apply a 4x5 matrix transformation to the color - * and alpha values of every pixel in the input image to produce a result with a new set - * of color and alpha values. This allows saturation changes, hue rotation, - * luminance to alpha, and various other effects. - * - *

The class contains several convenience methods for frequently used color - * adjustments. All those methods change the current matrix, which means you can easily - * combine them in one filter:

- * - * - * // create an inverted filter with 50% saturation and 180° hue rotation - * var filter:ColorMatrixFilter = new ColorMatrixFilter(); - * filter.invert(); - * filter.adjustSaturation(-0.5); - * filter.adjustHue(1.0); - * - *

If you want to gradually animate one of the predefined color adjustments, either reset - * the matrix after each step, or use an identical adjustment value for each step; the - * changes will add up.

- */ - public class ColorMatrixFilter extends FragmentFilter - { - // Most of the color transformation math was taken from the excellent ColorMatrix class by - // Mario Klingemann: http://www.quasimondo.com/archives/000565.php -- THANKS!!! - - private static const LUMA_R:Number = 0.299; - private static const LUMA_G:Number = 0.587; - private static const LUMA_B:Number = 0.114; - - // helpers - private static var sMatrix:Vector. = new []; - - /** Creates a new ColorMatrixFilter instance with the specified matrix. - * @param matrix a vector of 20 items arranged as a 4x5 matrix. - */ - public function ColorMatrixFilter(matrix:Vector.=null) - { - if (matrix) colorEffect.matrix = matrix; - } - - /** @private */ - override protected function createEffect():FilterEffect - { - return new ColorMatrixEffect(); - } - - // color manipulation - - /** Inverts the colors of the filtered object. */ - public function invert():void - { - concatValues(-1, 0, 0, 0, 255, - 0, -1, 0, 0, 255, - 0, 0, -1, 0, 255, - 0, 0, 0, 1, 0); - } - - /** Changes the saturation. Typical values are in the range (-1, 1). - * Values above zero will raise, values below zero will reduce the saturation. - * '-1' will produce a grayscale image. */ - public function adjustSaturation(sat:Number):void - { - sat += 1; - - var invSat:Number = 1 - sat; - var invLumR:Number = invSat * LUMA_R; - var invLumG:Number = invSat * LUMA_G; - var invLumB:Number = invSat * LUMA_B; - - concatValues((invLumR + sat), invLumG, invLumB, 0, 0, - invLumR, (invLumG + sat), invLumB, 0, 0, - invLumR, invLumG, (invLumB + sat), 0, 0, - 0, 0, 0, 1, 0); - } - - /** Changes the contrast. Typical values are in the range (-1, 1). - * Values above zero will raise, values below zero will reduce the contrast. */ - public function adjustContrast(value:Number):void - { - var s:Number = value + 1; - var o:Number = 128 * (1 - s); - - concatValues(s, 0, 0, 0, o, - 0, s, 0, 0, o, - 0, 0, s, 0, o, - 0, 0, 0, 1, 0); - } - - /** Changes the brightness. Typical values are in the range (-1, 1). - * Values above zero will make the image brighter, values below zero will make it darker.*/ - public function adjustBrightness(value:Number):void - { - value *= 255; - - concatValues(1, 0, 0, 0, value, - 0, 1, 0, 0, value, - 0, 0, 1, 0, value, - 0, 0, 0, 1, 0); - } - - /** Changes the hue of the image. Typical values are in the range (-1, 1). */ - public function adjustHue(value:Number):void - { - value *= Math.PI; - - var cos:Number = Math.cos(value); - var sin:Number = Math.sin(value); - - concatValues( - ((LUMA_R + (cos * (1 - LUMA_R))) + (sin * -(LUMA_R))), ((LUMA_G + (cos * -(LUMA_G))) + (sin * -(LUMA_G))), ((LUMA_B + (cos * -(LUMA_B))) + (sin * (1 - LUMA_B))), 0, 0, - ((LUMA_R + (cos * -(LUMA_R))) + (sin * 0.143)), ((LUMA_G + (cos * (1 - LUMA_G))) + (sin * 0.14)), ((LUMA_B + (cos * -(LUMA_B))) + (sin * -0.283)), 0, 0, - ((LUMA_R + (cos * -(LUMA_R))) + (sin * -((1 - LUMA_R)))), ((LUMA_G + (cos * -(LUMA_G))) + (sin * LUMA_G)), ((LUMA_B + (cos * (1 - LUMA_B))) + (sin * LUMA_B)), 0, 0, - 0, 0, 0, 1, 0); - } - - /** Tints the image in a certain color, analog to what can be done in Adobe Animate. - * - * @param color the RGB color with which the image should be tinted. - * @param amount the intensity with which tinting should be applied. Range (0, 1). - */ - public function tint(color:uint, amount:Number=1.0):void - { - var r:Number = Color.getRed(color) / 255.0; - var g:Number = Color.getGreen(color) / 255.0; - var b:Number = Color.getBlue(color) / 255.0; - var q:Number = 1 - amount; - - var rA:Number = amount * r; - var gA:Number = amount * g; - var bA:Number = amount * b; - - concatValues( - q + rA * LUMA_R, rA * LUMA_G, rA * LUMA_B, 0, 0, - gA * LUMA_R, q + gA * LUMA_G, gA * LUMA_B, 0, 0, - bA * LUMA_R, bA * LUMA_G, q + bA * LUMA_B, 0, 0, - 0, 0, 0, 1, 0); - } - - // matrix manipulation - - /** Changes the filter matrix back to the identity matrix. */ - public function reset():void - { - matrix = null; - } - - /** Concatenates the current matrix with another one. */ - public function concat(matrix:Vector.):void - { - colorEffect.concat(matrix); - setRequiresRedraw(); - } - - /** Concatenates the current matrix with another one, passing its contents directly. */ - public function concatValues(m0:Number, m1:Number, m2:Number, m3:Number, m4:Number, - m5:Number, m6:Number, m7:Number, m8:Number, m9:Number, - m10:Number, m11:Number, m12:Number, m13:Number, m14:Number, - m15:Number, m16:Number, m17:Number, m18:Number, m19:Number):void - { - sMatrix.length = 0; - sMatrix.push(m0, m1, m2, m3, m4, m5, m6, m7, m8, m9, - m10, m11, m12, m13, m14, m15, m16, m17, m18, m19); - - concat(sMatrix); - } - - /** A vector of 20 items arranged as a 4x5 matrix. */ - public function get matrix():Vector. { return colorEffect.matrix; } - public function set matrix(value:Vector.):void - { - colorEffect.matrix = value; - setRequiresRedraw(); - } - - private function get colorEffect():ColorMatrixEffect - { - return this.effect as ColorMatrixEffect; - } - } -} - -import flash.display3D.Context3D; -import flash.display3D.Context3DProgramType; - -import starling.rendering.FilterEffect; -import starling.rendering.Program; - -class ColorMatrixEffect extends FilterEffect -{ - private var _userMatrix:Vector.; // offset in range 0-255 - private var _shaderMatrix:Vector.; // offset in range 0-1, changed order - - private static const MIN_COLOR:Vector. = new [0, 0, 0, 0.0001]; - private static const IDENTITY:Array = [1,0,0,0,0, 0,1,0,0,0, 0,0,1,0,0, 0,0,0,1,0]; - - // helpers - private static var sMatrix:Vector. = new Vector.(20, true); - - public function ColorMatrixEffect():void - { - _userMatrix = new []; - _shaderMatrix = new []; - - this.matrix = null; - } - - override protected function createProgram():Program - { - var vertexShader:String = FilterEffect.STD_VERTEX_SHADER; - var fragmentShader:String = [ - tex("ft0", "v0", 0, texture), // read texture color - "max ft0, ft0, fc5 ", // avoid division through zero in next step - "div ft0.xyz, ft0.xyz, ft0.www ", // restore original (non-PMA) RGB values - "m44 ft0, ft0, fc0 ", // multiply color with 4x4 matrix - "add ft0, ft0, fc4 ", // add offset - "mul ft0.xyz, ft0.xyz, ft0.www ", // multiply with alpha again (PMA) - "mov oc, ft0 " // copy to output - ].join("\n"); - - return Program.fromSource(vertexShader, fragmentShader); - } - - override protected function beforeDraw(context:Context3D):void - { - super.beforeDraw(context); - - context.setProgramConstantsFromVector(Context3DProgramType.FRAGMENT, 0, _shaderMatrix); - context.setProgramConstantsFromVector(Context3DProgramType.FRAGMENT, 5, MIN_COLOR); - } - - // matrix manipulation - - public function reset():void - { - matrix = null; - } - - /** Concatenates the current matrix with another one. */ - public function concat(matrix:Vector.):void - { - var i:int = 0; - - for (var y:int=0; y<4; ++y) - { - for (var x:int=0; x<5; ++x) - { - sMatrix[i+x] = matrix[i ] * _userMatrix[x ] + - matrix[i + 1] * _userMatrix[x + 5] + - matrix[i + 2] * _userMatrix[x + 10] + - matrix[i + 3] * _userMatrix[x + 15] + - (x == 4 ? matrix[i + 4] : 0); - } - - i += 5; - } - - copyMatrix(sMatrix, _userMatrix); - updateShaderMatrix(); - } - - private function copyMatrix(from:Vector., to:Vector.):void - { - for (var i:int=0; i<20; ++i) - to[i] = from[i]; - } - - private function updateShaderMatrix():void - { - // the shader needs the matrix components in a different order, - // and it needs the offsets in the range 0-1. - - _shaderMatrix.length = 0; - _shaderMatrix.push( - _userMatrix[0 ], _userMatrix[ 1], _userMatrix[ 2], _userMatrix[ 3], - _userMatrix[5 ], _userMatrix[ 6], _userMatrix[ 7], _userMatrix[ 8], - _userMatrix[10], _userMatrix[11], _userMatrix[12], _userMatrix[13], - _userMatrix[15], _userMatrix[16], _userMatrix[17], _userMatrix[18], - _userMatrix[ 4] / 255.0, _userMatrix[9] / 255.0, _userMatrix[14] / 255.0, - _userMatrix[19] / 255.0 - ); - } - - // properties - - public function get matrix():Vector. { return _userMatrix; } - public function set matrix(value:Vector.):void - { - if (value && value.length != 20) - throw new ArgumentError("Invalid matrix length: must be 20"); - - if (value == null) - { - _userMatrix.length = 0; - _userMatrix.push.apply(_userMatrix, IDENTITY); - } - else - { - copyMatrix(value, _userMatrix); - } - - updateShaderMatrix(); - } -} \ No newline at end of file diff --git a/mobile_version/src/starling/filters/CompositeFilter.as b/mobile_version/src/starling/filters/CompositeFilter.as deleted file mode 100644 index 8dd5d7cf..00000000 --- a/mobile_version/src/starling/filters/CompositeFilter.as +++ /dev/null @@ -1,327 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= - -package starling.filters -{ - import flash.geom.Point; - - import starling.rendering.FilterEffect; - import starling.rendering.Painter; - import starling.textures.Texture; - import starling.utils.MathUtil; - - /** The CompositeFilter class allows to combine several layers of textures into one texture. - * It's mainly used as a building block for more complex filters; e.g. the DropShadowFilter - * uses this class to draw the shadow (the result of a BlurFilter) behind an object. - */ - public class CompositeFilter extends FragmentFilter - { - /** Creates a new instance. */ - public function CompositeFilter() - { } - - /** Combines up to four input textures into one new texture, - * adhering to the properties of each layer. */ - override public function process(painter:Painter, helper:IFilterHelper, - input0:Texture = null, input1:Texture = null, - input2:Texture = null, input3:Texture = null):Texture - { - compositeEffect.texture = input0; - compositeEffect.getLayerAt(1).texture = input1; - compositeEffect.getLayerAt(2).texture = input2; - compositeEffect.getLayerAt(3).texture = input3; - - if (input1) input1.setupTextureCoordinates(vertexData, 0, "texCoords1"); - if (input2) input2.setupTextureCoordinates(vertexData, 0, "texCoords2"); - if (input3) input3.setupTextureCoordinates(vertexData, 0, "texCoords3"); - - return super.process(painter, helper, input0, input1, input2, input3); - } - - /** @private */ - override protected function createEffect():FilterEffect - { - return new CompositeEffect(); - } - - /** Returns the position (in points) at which a certain layer will be drawn. */ - public function getOffsetAt(layerID:int, out:Point=null):Point - { - if (out == null) out = new Point(); - - out.x = compositeEffect.getLayerAt(layerID).x; - out.y = compositeEffect.getLayerAt(layerID).y; - - return out; - } - - /** Indicates the position (in points) at which a certain layer will be drawn. */ - public function setOffsetAt(layerID:int, x:Number, y:Number):void - { - compositeEffect.getLayerAt(layerID).x = x; - compositeEffect.getLayerAt(layerID).y = y; - } - - /** Returns the RGB color with which a layer is tinted when it is being drawn. - * @default 0xffffff */ - public function getColorAt(layerID:int):uint - { - return compositeEffect.getLayerAt(layerID).color; - } - - /** Adjusts the RGB color with which a layer is tinted when it is being drawn. - * If replace is enabled, the pixels are not tinted, but instead - * the RGB channels will replace the texture's color entirely. - */ - public function setColorAt(layerID:int, color:uint, replace:Boolean=false):void - { - compositeEffect.getLayerAt(layerID).color = color; - compositeEffect.getLayerAt(layerID).replaceColor = replace; - } - - /** Indicates the alpha value with which the layer is drawn. - * @default 1.0 */ - public function getAlphaAt(layerID:int):Number - { - return compositeEffect.getLayerAt(layerID).alpha; - } - - /** Adjusts the alpha value with which the layer is drawn. */ - public function setAlphaAt(layerID:int, alpha:Number):void - { - compositeEffect.getLayerAt(layerID).alpha = alpha; - } - - private function get compositeEffect():CompositeEffect - { - return this.effect as CompositeEffect; - } - } -} - -import flash.display3D.Context3D; -import flash.display3D.Context3DProgramType; - -import starling.rendering.FilterEffect; -import starling.rendering.Program; -import starling.rendering.VertexDataFormat; -import starling.textures.Texture; -import starling.utils.Color; -import starling.utils.RenderUtil; -import starling.utils.StringUtil; - -class CompositeEffect extends FilterEffect -{ - public static const VERTEX_FORMAT:VertexDataFormat = - FilterEffect.VERTEX_FORMAT.extend( - "texCoords1:float2, texCoords2:float2, texCoords3:float2"); - - private var _layers:Vector.; - - private static var sLayers:Array = []; - private static var sOffset:Vector. = new [0, 0, 0, 0]; - private static var sColor:Vector. = new [0, 0, 0, 0]; - - public function CompositeEffect(numLayers:int=4) - { - if (numLayers < 1 || numLayers > 4) - throw new ArgumentError("number of layers must be between 1 and 4"); - - _layers = new Vector.(numLayers, true); - - for (var i:int=0; i texture coords - vertexShader.push( - StringUtil.format("add v{0}, va{1}, vc{2}", i, i + 1, i + 4) // add offset - ); - - var fragmentShader:Array = [ - "seq ft5, v0, v0" // ft5 -> 1, 1, 1, 1 - ]; - - for (i=0; i texture i color - ); - - if (layer.replaceColor) - fragmentShader.push( - "mul " + fti + ".w, " + fti + ".w, " + fci + ".w", - "sat " + fti + ".w, " + fti + ".w ", // make sure alpha <= 1.0 - "mul " + fti + ".xyz, " + fci + ".xyz, " + fti + ".www" - ); - else - fragmentShader.push( - "mul " + fti + ", " + fti + ", " + fci // fti *= color - ); - - if (i != 0) - { - // "normal" blending: src × ONE + dst × ONE_MINUS_SOURCE_ALPHA - fragmentShader.push( - "sub ft4, ft5, " + fti + ".wwww", // ft4 => 1 - src.alpha - "mul ft0, ft0, ft4", // ft0 => dst * (1 - src.alpha) - "add ft0, ft0, " + fti // ft0 => src + (dst * 1 - src.alpha) - ); - } - } - - fragmentShader.push("mov oc, ft0"); // done! :) - - return Program.fromSource(vertexShader.join("\n"), fragmentShader.join("\n")); - } - else - { - return super.createProgram(); - } - } - - override protected function get programVariantName():uint - { - var bits:uint; - var totalBits:uint = 0; - var layer:CompositeLayer; - var layers:Array = getUsedLayers(sLayers); - var numLayers:int = layers.length; - - for (var i:int=0; iThe filter uses the following formula:

- * dstPixel[x, y] = srcPixel[x + ((componentX(x, y) - 128) * scaleX) / 256, - * y + ((componentY(x, y) - 128) * scaleY) / 256] - * - * - *

Where componentX(x, y) gets the componentX property color value from the - * map texture at (x - mapPoint.x, y - mapPoint.y).

- */ - public class DisplacementMapFilter extends FragmentFilter - { - private var _mapX:Number; - private var _mapY:Number; - - // helpers - private static var sBounds:Rectangle = new Rectangle(); - - /** Creates a new displacement map filter that uses the provided map texture. */ - public function DisplacementMapFilter(mapTexture:Texture, - componentX:uint=0, componentY:uint=0, - scaleX:Number=0.0, scaleY:Number=0.0) - { - _mapX = _mapY = 0; - - this.mapTexture = mapTexture; - this.componentX = componentX; - this.componentY = componentY; - this.scaleX = scaleX; - this.scaleY = scaleY; - } - - /** @private */ - override public function process(painter:Painter, pool:IFilterHelper, - input0:Texture = null, input1:Texture = null, - input2:Texture = null, input3:Texture = null):Texture - { - var offsetX:Number = 0.0, offsetY:Number = 0.0; - var targetBounds:Rectangle = pool.targetBounds; - var stage:Stage = pool.target.stage; - - if (stage && (targetBounds.x < 0 || targetBounds.y < 0)) - { - // 'targetBounds' is actually already intersected with the stage bounds. - // If the target is partially outside the stage at the left or top, we need - // to adjust the map coordinates accordingly. That's what 'offsetX/Y' is for. - - pool.target.getBounds(stage, sBounds); - sBounds.inflate(padding.left, padding.top); - offsetX = sBounds.x - pool.targetBounds.x; - offsetY = sBounds.y - pool.targetBounds.y; - } - - updateVertexData(input0, mapTexture, offsetX, offsetY); - return super.process(painter, pool, input0); - } - - /** @private */ - override protected function createEffect():FilterEffect - { - return new DisplacementMapEffect(); - } - - private function updateVertexData(inputTexture:Texture, mapTexture:Texture, - mapOffsetX:Number=0.0, mapOffsetY:Number=0.0):void - { - // The size of input texture and map texture may be different. We need to calculate - // the right values for the texture coordinates at the filter vertices. - - var mapX:Number = (_mapX + mapOffsetX + padding.left) / mapTexture.width; - var mapY:Number = (_mapY + mapOffsetY + padding.top) / mapTexture.height; - var maxU:Number = inputTexture.width / mapTexture.width; - var maxV:Number = inputTexture.height / mapTexture.height; - - mapTexture.setTexCoords(vertexData, 0, "mapTexCoords", -mapX, -mapY); - mapTexture.setTexCoords(vertexData, 1, "mapTexCoords", -mapX + maxU, -mapY); - mapTexture.setTexCoords(vertexData, 2, "mapTexCoords", -mapX, -mapY + maxV); - mapTexture.setTexCoords(vertexData, 3, "mapTexCoords", -mapX + maxU, -mapY + maxV); - } - - private function updatePadding():void - { - var paddingX:Number = Math.ceil(Math.abs(dispEffect.scaleX) / 2); - var paddingY:Number = Math.ceil(Math.abs(dispEffect.scaleY) / 2); - - padding.setTo(paddingX, paddingX, paddingY, paddingY); - } - - // properties - - /** Describes which color channel to use in the map image to displace the x result. - * Possible values are constants from the BitmapDataChannel class. */ - public function get componentX():uint { return dispEffect.componentX; } - public function set componentX(value:uint):void - { - if (dispEffect.componentX != value) - { - dispEffect.componentX = value; - setRequiresRedraw(); - } - } - - /** Describes which color channel to use in the map image to displace the y result. - * Possible values are constants from the BitmapDataChannel class. */ - public function get componentY():uint { return dispEffect.componentY; } - public function set componentY(value:uint):void - { - if (dispEffect.componentY != value) - { - dispEffect.componentY = value; - setRequiresRedraw(); - } - } - - /** The multiplier used to scale the x displacement result from the map calculation. */ - public function get scaleX():Number { return dispEffect.scaleX; } - public function set scaleX(value:Number):void - { - if (dispEffect.scaleX != value) - { - dispEffect.scaleX = value; - updatePadding(); - } - } - - /** The multiplier used to scale the y displacement result from the map calculation. */ - public function get scaleY():Number { return dispEffect.scaleY; } - public function set scaleY(value:Number):void - { - if (dispEffect.scaleY != value) - { - dispEffect.scaleY = value; - updatePadding(); - } - } - - /** The horizontal offset of the map texture relative to the origin. @default 0 */ - public function get mapX():Number { return _mapX; } - public function set mapX(value:Number):void { _mapX = value; setRequiresRedraw(); } - - /** The vertical offset of the map texture relative to the origin. @default 0 */ - public function get mapY():Number { return _mapY; } - public function set mapY(value:Number):void { _mapY = value; setRequiresRedraw(); } - - /** The texture that will be used to calculate displacement. */ - public function get mapTexture():Texture { return dispEffect.mapTexture; } - public function set mapTexture(value:Texture):void - { - if (dispEffect.mapTexture != value) - { - dispEffect.mapTexture = value; - setRequiresRedraw(); - } - } - - /** Indicates how the pixels of the map texture will be wrapped at the edge. */ - public function get mapRepeat():Boolean { return dispEffect.mapRepeat; } - public function set mapRepeat(value:Boolean):void - { - if (dispEffect.mapRepeat != value) - { - dispEffect.mapRepeat = value; - setRequiresRedraw(); - } - } - - private function get dispEffect():DisplacementMapEffect - { - return this.effect as DisplacementMapEffect; - } - } -} - -import flash.display.BitmapDataChannel; -import flash.display3D.Context3D; -import flash.display3D.Context3DProgramType; -import flash.geom.Matrix3D; - -import starling.core.Starling; -import starling.rendering.FilterEffect; -import starling.rendering.Program; -import starling.rendering.VertexDataFormat; -import starling.textures.Texture; -import starling.utils.RenderUtil; - -class DisplacementMapEffect extends FilterEffect -{ - public static const VERTEX_FORMAT:VertexDataFormat = - FilterEffect.VERTEX_FORMAT.extend("mapTexCoords:float2"); - - private var _mapTexture:Texture; - private var _mapRepeat:Boolean; - private var _componentX:uint; - private var _componentY:uint; - private var _scaleX:Number; - private var _scaleY:Number; - - // helper objects - private static var sOffset:Vector. = new [0.5, 0.5, 0.0, 0.0]; - private static var sMatrix:Matrix3D = new Matrix3D(); - private static var sMatrixData:Vector. = - new [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; - - public function DisplacementMapEffect() - { - _componentX = _componentY = 0; - _scaleX = _scaleY = 0; - } - - override protected function createProgram():Program - { - if (_mapTexture) - { - // vc0-3: mvpMatrix - // va0: vertex position - // va1: input texture coords - // va2: map texture coords - - var vertexShader:String = [ - "m44 op, va0, vc0", // 4x4 matrix transform to output space - "mov v0, va1", // pass input texture coordinates to fragment program - "mov v1, va2" // pass map texture coordinates to fragment program - ].join("\n"); - - // v0: input texCoords - // v1: map texCoords - // fc0: offset (0.5, 0.5) - // fc1-4: matrix - - var fragmentShader:String = [ - tex("ft0", "v1", 1, _mapTexture, false), // read map texture - "sub ft1, ft0, fc0", // subtract 0.5 -> range [-0.5, 0.5] - "mul ft1.xy, ft1.xy, ft0.ww", // zero displacement when alpha == 0 - "m44 ft2, ft1, fc1", // multiply matrix with displacement values - "add ft3, v0, ft2", // add displacement values to texture coords - tex("oc", "ft3", 0, texture) // read input texture at displaced coords - ].join("\n"); - - return Program.fromSource(vertexShader, fragmentShader); - } - else return super.createProgram(); - } - - override protected function beforeDraw(context:Context3D):void - { - super.beforeDraw(context); - - if (_mapTexture) - { - // already set by super class: - // - // vertex constants 0-3: mvpMatrix (3D) - // vertex attribute 0: vertex position (FLOAT_2) - // vertex attribute 1: texture coordinates (FLOAT_2) - // texture 0: input texture - - getMapMatrix(sMatrix); - - vertexFormat.setVertexBufferAt(2, vertexBuffer, "mapTexCoords"); - context.setProgramConstantsFromVector(Context3DProgramType.FRAGMENT, 0, sOffset); - context.setProgramConstantsFromMatrix(Context3DProgramType.FRAGMENT, 1, sMatrix, true); - RenderUtil.setSamplerStateAt(1, _mapTexture.mipMapping, textureSmoothing, _mapRepeat); - context.setTextureAt(1, _mapTexture.base); - } - } - - override protected function afterDraw(context:Context3D):void - { - if (_mapTexture) - { - context.setVertexBufferAt(2, null); - context.setTextureAt(1, null); - } - - super.afterDraw(context); - } - - override public function get vertexFormat():VertexDataFormat - { - return VERTEX_FORMAT; - } - - /** This matrix maps RGBA values of the map texture to UV-offsets in the input texture. */ - private function getMapMatrix(out:Matrix3D):Matrix3D - { - if (out == null) out = new Matrix3D(); - - var columnX:int, columnY:int; - var scale:Number = Starling.contentScaleFactor; - var textureWidth:Number = texture.root.nativeWidth; - var textureHeight:Number = texture.root.nativeHeight; - - for (var i:int=0; i<16; ++i) - sMatrixData[i] = 0; - - if (_componentX == BitmapDataChannel.RED) columnX = 0; - else if (_componentX == BitmapDataChannel.GREEN) columnX = 1; - else if (_componentX == BitmapDataChannel.BLUE) columnX = 2; - else columnX = 3; - - if (_componentY == BitmapDataChannel.RED) columnY = 0; - else if (_componentY == BitmapDataChannel.GREEN) columnY = 1; - else if (_componentY == BitmapDataChannel.BLUE) columnY = 2; - else columnY = 3; - - sMatrixData[int(columnX * 4 )] = _scaleX * scale / textureWidth; - sMatrixData[int(columnY * 4 + 1)] = _scaleY * scale / textureHeight; - - out.copyRawDataFrom(sMatrixData); - - return out; - } - - // properties - - public function get componentX():uint { return _componentX; } - public function set componentX(value:uint):void { _componentX = value; } - - public function get componentY():uint { return _componentY; } - public function set componentY(value:uint):void { _componentY = value; } - - public function get scaleX():Number { return _scaleX; } - public function set scaleX(value:Number):void { _scaleX = value; } - - public function get scaleY():Number { return _scaleY; } - public function set scaleY(value:Number):void { _scaleY = value; } - - public function get mapTexture():Texture { return _mapTexture; } - public function set mapTexture(value:Texture):void { _mapTexture = value; } - - public function get mapRepeat():Boolean { return _mapRepeat; } - public function set mapRepeat(value:Boolean):void { _mapRepeat = value; } -} diff --git a/mobile_version/src/starling/filters/DropShadowFilter.as b/mobile_version/src/starling/filters/DropShadowFilter.as deleted file mode 100644 index ed4ad134..00000000 --- a/mobile_version/src/starling/filters/DropShadowFilter.as +++ /dev/null @@ -1,172 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= - -package starling.filters -{ - import starling.rendering.Painter; - import starling.textures.Texture; - import starling.utils.Padding; - - /** The DropShadowFilter class lets you add a drop shadow to display objects. - * To create the shadow, the class internally uses the BlurFilter. - */ - public class DropShadowFilter extends FragmentFilter - { - private var _blurFilter:BlurFilter; - private var _compositeFilter:CompositeFilter; - private var _distance:Number; - private var _angle:Number; - - /** Creates a new DropShadowFilter instance with the specified parameters. - * - * @param distance the offset distance of the shadow, in points. - * @param angle the angle with which the shadow is offset, in radians. - * @param color the color of the shadow. - * @param alpha the alpha value of the shadow. Values between 0 and 1 modify the - * opacity; values > 1 will make it stronger, i.e. produce a harder edge. - * @param blur the amount of blur with which the shadow is created. Note that high - * values will cause the number of render passes to grow. - * @param resolution the resolution of the filter texture. '1' means full resolution, - * '0.5' half resolution, etc. - */ - public function DropShadowFilter(distance:Number=4.0, angle:Number=0.785, - color:uint=0x0, alpha:Number=0.5, blur:Number=1.0, - resolution:Number=0.5) - { - _compositeFilter = new CompositeFilter(); - _blurFilter = new BlurFilter(blur, blur, resolution); - _distance = distance; - _angle = angle; - - this.color = color; - this.alpha = alpha; - - updatePadding(); - } - - /** @inheritDoc */ - override public function dispose():void - { - _blurFilter.dispose(); - _compositeFilter.dispose(); - - super.dispose(); - } - - /** @private */ - override public function process(painter:Painter, helper:IFilterHelper, - input0:Texture = null, input1:Texture = null, - input2:Texture = null, input3:Texture = null):Texture - { - var shadow:Texture = _blurFilter.process(painter, helper, input0); - var result:Texture = _compositeFilter.process(painter, helper, shadow, input0); - helper.putTexture(shadow); - return result; - } - - /** @private */ - override public function get numPasses():int - { - return _blurFilter.numPasses + _compositeFilter.numPasses; - } - - private function updatePadding():void - { - var offsetX:Number = Math.cos(_angle) * _distance; - var offsetY:Number = Math.sin(_angle) * _distance; - - _compositeFilter.setOffsetAt(0, offsetX, offsetY); - - var blurPadding:Padding = _blurFilter.padding; - var left:Number = blurPadding.left; - var right:Number = blurPadding.right; - var top:Number = blurPadding.top; - var bottom:Number = blurPadding.bottom; - - if (offsetX > 0) right += offsetX; else left -= offsetX; - if (offsetY > 0) bottom += offsetY; else top -= offsetY; - - padding.setTo(left, right, top, bottom); - } - - /** The color of the shadow. @default 0x0 */ - public function get color():uint { return _compositeFilter.getColorAt(0); } - public function set color(value:uint):void - { - if (color != value) - { - _compositeFilter.setColorAt(0, value, true); - setRequiresRedraw(); - } - } - - /** The alpha value of the shadow. Values between 0 and 1 modify the opacity; - * values > 1 will make it stronger, i.e. produce a harder edge. @default 0.5 */ - public function get alpha():Number { return _compositeFilter.getAlphaAt(0); } - public function set alpha(value:Number):void - { - if (alpha != value) - { - _compositeFilter.setAlphaAt(0, value); - setRequiresRedraw(); - } - } - - /** The offset distance for the shadow, in points. @default 4.0 */ - public function get distance():Number { return _distance; } - public function set distance(value:Number):void - { - if (_distance != value) - { - _distance = value; - setRequiresRedraw(); - updatePadding(); - } - } - - /** The angle with which the shadow is offset, in radians. @default Math.PI / 4 */ - public function get angle():Number { return _angle; } - public function set angle(value:Number):void - { - if (_angle != value) - { - _angle = value; - setRequiresRedraw(); - updatePadding(); - } - } - - /** The amount of blur with which the shadow is created. - * The number of required passes will be Math.ceil(value) × 2. - * @default 1.0 */ - public function get blur():Number { return _blurFilter.blurX; } - public function set blur(value:Number):void - { - if (blur != value) - { - _blurFilter.blurX = _blurFilter.blurY = value; - setRequiresRedraw(); - updatePadding(); - } - } - - /** @private */ - override public function get resolution():Number { return _blurFilter.resolution; } - override public function set resolution(value:Number):void - { - if (resolution != value) - { - _blurFilter.resolution = value; - setRequiresRedraw(); - updatePadding(); - } - } - } -} diff --git a/mobile_version/src/starling/filters/FilterChain.as b/mobile_version/src/starling/filters/FilterChain.as deleted file mode 100644 index 07b53f1c..00000000 --- a/mobile_version/src/starling/filters/FilterChain.as +++ /dev/null @@ -1,168 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= - -package starling.filters -{ - import starling.events.Event; - import starling.rendering.Painter; - import starling.textures.Texture; - import starling.utils.Padding; - - /** The FilterChain allows you to combine several filters into one. The filters will be - * processed in the given order, the number of draw calls per filter adding up. - * Just like conventional filters, a chain may be attached to any display object. - */ - public class FilterChain extends FragmentFilter - { - private var _filters:Vector.; - - // helpers - private static var sPadding:Padding = new Padding(); - - /** Creates a new chain with the given filters. */ - public function FilterChain(...args) - { - _filters = new []; - - for (var i:int = 0, len:int = args.length; i < len; ++i) - { - var filter:FragmentFilter = args[i] as FragmentFilter; - if (filter) addFilterAt(filter, i); - else throw new ArgumentError("pass only fragment filters to the constructor"); - } - - updatePadding(); - addEventListener(Event.ENTER_FRAME, onEnterFrame); - } - - /** Disposes the filter chain itself as well as all contained filters. */ - override public function dispose():void - { - for each (var filter:FragmentFilter in _filters) - filter.dispose(); - - _filters.length = 0; - - super.dispose(); - } - - /** @private */ - override protected function setRequiresRedraw():void - { - updatePadding(); - super.setRequiresRedraw(); - } - - /** @private */ - override public function process(painter:Painter, helper:IFilterHelper, - input0:Texture = null, input1:Texture = null, - input2:Texture = null, input3:Texture = null):Texture - { - var numFilters:int = _filters.length; - var outTexture:Texture = input0; - var inTexture:Texture; - - for (var i:int=0; i sPadding.left) sPadding.left = padding.left; - if (padding.right > sPadding.right) sPadding.right = padding.right; - if (padding.top > sPadding.top) sPadding.top = padding.top; - if (padding.bottom > sPadding.bottom) sPadding.bottom = padding.bottom; - } - - this.padding.copyFrom(sPadding); - } - - private function onEnterFrame(event:Event):void - { - var i:int, numFilters:int = _filters.length; - for (i=0; i; - private var _usePotTextures:Boolean; - private var _textureFormat:String; - private var _preferredScale:Number; - private var _scale:Number; - private var _sizeStep:int; - private var _numPasses:int; - private var _projectionMatrix:Matrix3D; - private var _renderTarget:Texture; - private var _targetBounds:Rectangle; - private var _target:DisplayObject; - - // helpers - private var sRegion:Rectangle = new Rectangle(); - - /** Creates a new, empty instance. */ - public function FilterHelper(textureFormat:String="bgra") - { - _usePotTextures = Starling.current.profile == Context3DProfile.BASELINE_CONSTRAINED; - _preferredScale = Starling.contentScaleFactor; - _textureFormat = textureFormat; - _sizeStep = 64; // must be POT! - _pool = new []; - _projectionMatrix = new Matrix3D(); - _targetBounds = new Rectangle(); - - setSize(_sizeStep, _sizeStep); - } - - /** Purges the pool. */ - public function dispose():void - { - purge(); - } - - /** Starts a new round of rendering. If numPasses is greater than zero, each - * getTexture() call will be counted as one pass; the final pass will then - * return null instead of a texture, to indicate that this pass should be - * rendered to the back buffer. - */ - public function start(numPasses:int, drawLastPassToBackBuffer:Boolean):void - { - _numPasses = drawLastPassToBackBuffer ? numPasses : -1; - } - - /** @inheritDoc */ - public function getTexture(resolution:Number=1.0):Texture - { - var texture:Texture; - var subTexture:SubTexture; - - if (_numPasses >= 0) - if (_numPasses-- == 0) return null; - - if (_pool.length) - texture = _pool.pop(); - else - texture = Texture.empty(_nativeWidth / _scale, _nativeHeight / _scale, - true, false, true, _scale, _textureFormat); - - if (!MathUtil.isEquivalent(texture.width, _width, 0.1) || - !MathUtil.isEquivalent(texture.height, _height, 0.1) || - !MathUtil.isEquivalent(texture.scale, _scale * resolution)) - { - sRegion.setTo(0, 0, _width * resolution, _height * resolution); - subTexture = texture as SubTexture; - - if (subTexture) - subTexture.setTo(texture.root, sRegion, true, null, false, resolution); - else - texture = new SubTexture(texture.root, sRegion, true, null, false, resolution); - } - - texture.root.clear(); - return texture; - } - - /** @inheritDoc */ - public function putTexture(texture:Texture):void - { - if (texture) - { - if (texture.root.nativeWidth == _nativeWidth && texture.root.nativeHeight == _nativeHeight) - _pool.insertAt(_pool.length, texture); - else - texture.dispose(); - } - } - - /** Purges the pool and disposes all textures. */ - public function purge():void - { - for (var i:int = 0, len:int = _pool.length; i < len; ++i) - _pool[i].dispose(); - - _pool.length = 0; - } - - /** Updates the size of the returned textures. Small size changes may allow the - * existing textures to be reused; big size changes will automatically dispose - * them. */ - private function setSize(width:Number, height:Number):void - { - var factor:Number; - var newScale:Number = _preferredScale; - var maxNativeSize:int = Texture.maxSize; - var newNativeWidth:int = getNativeSize(width, newScale); - var newNativeHeight:int = getNativeSize(height, newScale); - - if (newNativeWidth > maxNativeSize || newNativeHeight > maxNativeSize) - { - factor = maxNativeSize / Math.max(newNativeWidth, newNativeHeight); - newNativeWidth *= factor; - newNativeHeight *= factor; - newScale *= factor; - } - - if (_nativeWidth != newNativeWidth || _nativeHeight != newNativeHeight || - _scale != newScale) - { - purge(); - - _scale = newScale; - _nativeWidth = newNativeWidth; - _nativeHeight = newNativeHeight; - } - - _width = width; - _height = height; - } - - private function getNativeSize(size:Number, textureScale:Number):int - { - var nativeSize:Number = size * textureScale; - - if (_usePotTextures) - return nativeSize > _sizeStep ? MathUtil.getNextPowerOfTwo(nativeSize) : _sizeStep; - else - return Math.ceil(nativeSize / _sizeStep) * _sizeStep; - } - - /** The projection matrix that was active when the filter started processing. */ - public function get projectionMatrix3D():Matrix3D { return _projectionMatrix; } - public function set projectionMatrix3D(value:Matrix3D):void - { - _projectionMatrix.copyFrom(value); - } - - /** The render target that was active when the filter started processing. */ - public function get renderTarget():Texture { return _renderTarget; } - public function set renderTarget(value:Texture):void - { - _renderTarget = value; - } - - /** @inheritDoc */ - public function get targetBounds():Rectangle { return _targetBounds; } - public function set targetBounds(value:Rectangle):void - { - _targetBounds.copyFrom(value); - setSize(value.width, value.height); - } - - /** @inheritDoc */ - public function get target():DisplayObject { return _target; } - public function set target(value:DisplayObject):void { _target = value; } - - /** The scale factor of the returned textures. */ - public function get textureScale():Number { return _preferredScale; } - public function set textureScale(value:Number):void - { - _preferredScale = value > 0 ? value : Starling.contentScaleFactor; - } - - /** The texture format of the returned textures. @default BGRA */ - public function get textureFormat():String { return _textureFormat; } - public function set textureFormat(value:String):void { _textureFormat = value; } - } -} diff --git a/mobile_version/src/starling/filters/FragmentFilter.as b/mobile_version/src/starling/filters/FragmentFilter.as deleted file mode 100644 index d78cddcb..00000000 --- a/mobile_version/src/starling/filters/FragmentFilter.as +++ /dev/null @@ -1,634 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= - -package starling.filters -{ - import flash.display3D.Context3DTextureFormat; - import flash.errors.IllegalOperationError; - import flash.geom.Matrix3D; - import flash.geom.Rectangle; - - import starling.core.Starling; - import starling.core.starling_internal; - import starling.display.DisplayObject; - import starling.display.Stage; - import starling.events.Event; - import starling.events.EventDispatcher; - import starling.rendering.FilterEffect; - import starling.rendering.IndexData; - import starling.rendering.Painter; - import starling.rendering.VertexData; - import starling.textures.Texture; - import starling.textures.TextureSmoothing; - import starling.utils.MatrixUtil; - import starling.utils.Padding; - import starling.utils.Pool; - import starling.utils.RectangleUtil; - - /** Dispatched when the settings change in a way that requires a redraw. */ - [Event(name="change", type="starling.events.Event")] - - /** Dispatched every frame on filters assigned to display objects connected to the stage. */ - [Event(name="enterFrame", type="starling.events.EnterFrameEvent")] - - /** The FragmentFilter class is the base class for all filter effects in Starling. - * All filters must extend this class. You can attach them to any display object through the - * filter property. - * - *

A fragment filter works in the following way:

- *
    - *
  1. The object to be filtered is rendered into a texture.
  2. - *
  3. That texture is passed to the process method.
  4. - *
  5. This method processes the texture using a FilterEffect subclass - * that processes the input via fragment and vertex shaders to achieve a certain - * effect.
  6. - *
  7. If the filter requires several passes, the process method may execute the - * effect several times, or even make use of other filters in the process.
  8. - *
  9. In the end, a quad with the output texture is added to the batch renderer. - * In the next frame, if the object hasn't changed, the filter is drawn directly - * from the render cache.
  10. - *
  11. Alternatively, the last pass may be drawn directly to the back buffer. That saves - * one draw call, but means that the object may not be drawn from the render cache in - * the next frame. Starling makes an educated guess if that makes sense, but you can - * also force it to do so via the alwaysDrawToBackBuffer property.
  12. - *
- * - *

All of this is set up by the basic FragmentFilter class. Concrete subclasses - * just need to override the protected method createEffect and (optionally) - * process. Multi-pass filters must also override numPasses.

- * - *

Typically, any properties on the filter are just forwarded to an effect instance, - * which is then used automatically by process to render the filter pass. - * For a simple example on how to write a single-pass filter, look at the implementation of - * the ColorMatrixFilter; for a composite filter (i.e. a filter that combines - * several others), look at the GlowFilter. - *

- * - *

Beware that a filter instance may only be used on one object at a time!

- * - *

Animated filters

- * - *

The process method of a filter is only called when it's necessary, i.e. - * when the filter properties or the target display object changes. This means that you cannot - * rely on the method to be called on a regular basis, as needed when creating an animated - * filter class. Instead, you can do so by listening for an ENTER_FRAME-event. - * It is dispatched on the filter once every frame, as long as the filter is assigned to - * a display object that is connected to the stage.

- * - *

Caching

- * - *

Per default, whenever the target display object is changed in any way (i.e. the render - * cache fails), the filter is reprocessed. However, you can manually cache the filter output - * via the method of the same name: this will let the filter redraw the current output texture, - * even if the target object changes later on. That's especially useful if you add a filter - * to an object that changes only rarely, e.g. a TextField or an Image. Keep in mind, though, - * that you have to call cache() again in order for any changes to show up.

- * - * @see starling.rendering.FilterEffect - */ - public class FragmentFilter extends EventDispatcher - { - private var _quad:FilterQuad; - private var _target:DisplayObject; - private var _effect:FilterEffect; - private var _vertexData:VertexData; - private var _indexData:IndexData; - private var _padding:Padding; - private var _helper:FilterHelper; - private var _resolution:Number; - private var _textureFormat:String; - private var _textureSmoothing:String; - private var _alwaysDrawToBackBuffer:Boolean; - private var _cacheRequested:Boolean; - private var _cached:Boolean; - - // helpers - private static var sMatrix3D:Matrix3D; - - /** Creates a new instance. The base class' implementation just draws the unmodified - * input texture. */ - public function FragmentFilter() - { - _resolution = 1.0; - _textureFormat = Context3DTextureFormat.BGRA; - _textureSmoothing = TextureSmoothing.BILINEAR; - - // Handle lost context (using conventional Flash event for weak listener support) - Starling.current.stage3D.addEventListener(Event.CONTEXT3D_CREATE, - onContextCreated, false, 0, true); - } - - /** Disposes all resources that have been created by the filter. */ - public function dispose():void - { - Starling.current.stage3D.removeEventListener(Event.CONTEXT3D_CREATE, onContextCreated); - - if (_helper) _helper.dispose(); - if (_effect) _effect.dispose(); - if (_quad) _quad.dispose(); - - _effect = null; - _quad = null; - } - - private function onContextCreated(event:Object):void - { - setRequiresRedraw(); - } - - /** Renders the filtered target object. Most users will never have to call this manually; - * it's executed automatically in the rendering process of the filtered display object. - */ - public function render(painter:Painter):void - { - if (_target == null) - throw new IllegalOperationError("Cannot render filter without target"); - - if (_target.is3D) - _cached = _cacheRequested = false; - - if (!_cached || _cacheRequested) - { - renderPasses(painter, _cacheRequested); - _cacheRequested = false; - } - else if (_quad.visible) - { - _quad.render(painter); - } - } - - private function renderPasses(painter:Painter, forCache:Boolean):void - { - if (_helper == null) _helper = new FilterHelper(_textureFormat); - if (_quad == null) _quad = new FilterQuad(_textureSmoothing); - else { _helper.putTexture(_quad.texture); _quad.texture = null; } - - var bounds:Rectangle = Pool.getRectangle(); // might be recursive -> no static var - var drawLastPassToBackBuffer:Boolean = false; - var origResolution:Number = _resolution; - var renderSpace:DisplayObject = _target.stage || _target.parent; - var isOnStage:Boolean = renderSpace is Stage; - var stage:Stage = Starling.current.stage; - var stageBounds:Rectangle; - - if (!forCache && (_alwaysDrawToBackBuffer || _target.requiresRedraw)) - { - // If 'requiresRedraw' is true, the object is non-static, and we guess that this - // will be the same in the next frame. So we render directly to the back buffer. - // - // -- That, however, is only possible for full alpha values, because - // (1) 'FilterEffect' can't handle alpha (and that will do the rendering) - // (2) we don't want lower layers (CompositeFilter!) to shine through. - - drawLastPassToBackBuffer = painter.state.alpha == 1.0; - painter.excludeFromCache(_target); - } - - if (_target == Starling.current.root) - { - // full-screen filters use exactly the stage bounds - stage.getStageBounds(_target, bounds); - } - else - { - // Unfortunately, the following bounds calculation yields the wrong result when - // drawing a filter to a RenderTexture using a custom matrix. The 'modelviewMatrix' - // should be used for the bounds calculation, but the API doesn't support this. - // A future version should change this to: "getBounds(modelviewMatrix, bounds)" - - _target.getBounds(renderSpace, bounds); - - if (!forCache && isOnStage) // normally, we don't need anything outside - { - stageBounds = stage.getStageBounds(null, Pool.getRectangle()); - RectangleUtil.intersect(bounds, stageBounds, bounds); - Pool.putRectangle(stageBounds); - } - } - - _quad.visible = !bounds.isEmpty(); - if (!_quad.visible) { Pool.putRectangle(bounds); return; } - - if (_padding) RectangleUtil.extend(bounds, - _padding.left, _padding.right, _padding.top, _padding.bottom); - - // integer bounds for maximum sharpness + to avoid jiggling - bounds.setTo(Math.floor(bounds.x), Math.floor(bounds.y), - Math.ceil(bounds.width), Math.ceil(bounds.height)); - - _helper.textureScale = Starling.contentScaleFactor * _resolution; - _helper.projectionMatrix3D = painter.state.projectionMatrix3D; - _helper.renderTarget = painter.state.renderTarget; - _helper.targetBounds = bounds; - _helper.target = _target; - _helper.start(numPasses, drawLastPassToBackBuffer); - - _quad.setBounds(bounds); - _resolution = 1.0; // applied via '_helper.textureScale' already; - // only 'child'-filters use resolution directly (in 'process') - - var wasCacheEnabled:Boolean = painter.cacheEnabled; - var input:Texture = _helper.getTexture(); - var output:Texture; - - painter.cacheEnabled = false; // -> what follows should not be cached - painter.pushState(); - painter.state.alpha = 1.0; - painter.state.renderTarget = input; - painter.state.setProjectionMatrix(bounds.x, bounds.y, - input.root.width, input.root.height, - stage.stageWidth, stage.stageHeight, stage.cameraPosition); - - _target.render(painter); // -> draw target object into 'input' - - painter.finishMeshBatch(); - painter.state.setModelviewMatricesToIdentity(); - painter.state.clipRect = null; - - output = process(painter, _helper, input); // -> feed 'input' to actual filter code - - painter.popState(); - painter.cacheEnabled = wasCacheEnabled; // -> cache again - - if (output) // indirect rendering - { - painter.pushState(); - - if (_target.is3D) painter.state.setModelviewMatricesToIdentity(); // -> stage coords - else _quad.moveVertices(renderSpace, _target); // -> local coords - - _quad.texture = output; - _quad.render(painter); - - painter.finishMeshBatch(); - painter.popState(); - } - - _helper.target = null; - _helper.putTexture(input); - _resolution = origResolution; - Pool.putRectangle(bounds); - } - - /** Does the actual filter processing. This method will be called with up to four input - * textures and must return a new texture (acquired from the helper) that - * contains the filtered output. To to do this, it configures the FilterEffect - * (provided via createEffect) and calls its render method. - * - *

In a standard filter, only input0 will contain a texture; that's the - * object the filter was applied to, rendered into an appropriately sized texture. - * However, filters may also accept multiple textures; that's useful when you need to - * combine the output of several filters into one. For example, the DropShadowFilter - * uses a BlurFilter to create the shadow and then feeds both input and shadow texture - * into a CompositeFilter.

- * - *

Never create or dispose any textures manually within this method; instead, get - * new textures from the provided helper object, and pass them to the helper when you do - * not need them any longer. Ownership of both input textures and returned texture - * lies at the caller; only temporary textures should be put into the helper.

- */ - public function process(painter:Painter, helper:IFilterHelper, - input0:Texture=null, input1:Texture=null, - input2:Texture=null, input3:Texture=null):Texture - { - var effect:FilterEffect = this.effect; - var output:Texture = helper.getTexture(_resolution); - var projectionMatrix:Matrix3D; - var bounds:Rectangle = null; - var renderTarget:Texture; - - if (output) // render to texture - { - renderTarget = output; - projectionMatrix = MatrixUtil.createPerspectiveProjectionMatrix(0, 0, - output.root.width / _resolution, output.root.height / _resolution, - 0, 0, null, sMatrix3D); - } - else // render to back buffer - { - bounds = helper.targetBounds; - renderTarget = (helper as FilterHelper).renderTarget; - projectionMatrix = (helper as FilterHelper).projectionMatrix3D; - effect.textureSmoothing = _textureSmoothing; - } - - painter.state.renderTarget = renderTarget; - painter.prepareToDraw(); - painter.drawCount += 1; - - input0.setupVertexPositions(vertexData, 0, "position", bounds); - input0.setupTextureCoordinates(vertexData); - - effect.texture = input0; - effect.mvpMatrix3D = projectionMatrix; - effect.uploadVertexData(vertexData); - effect.uploadIndexData(indexData); - effect.render(0, indexData.numTriangles); - - return output; - } - - /** Creates the effect that does the actual, low-level rendering. - * Must be overridden by all subclasses that do any rendering on their own (instead - * of just forwarding processing to other filters). - */ - protected function createEffect():FilterEffect - { - return new FilterEffect(); - } - - /** Caches the filter output into a texture. - * - *

An uncached filter is rendered every frame (except if it can be rendered from the - * global render cache, which happens if the target object does not change its appearance - * or location relative to the stage). A cached filter is only rendered once; the output - * stays unchanged until you call cache again or change the filter settings. - *

- * - *

Beware: you cannot cache filters on 3D objects; if the object the filter is attached - * to is a Sprite3D or has a Sprite3D as (grand-) parent, the request will be silently - * ignored. However, you can cache a 2D object that has 3D children!

- */ - public function cache():void - { - _cached = _cacheRequested = true; - setRequiresRedraw(); - } - - /** Clears the cached output of the filter. After calling this method, the filter will be - * processed once per frame again. */ - public function clearCache():void - { - _cached = _cacheRequested = false; - setRequiresRedraw(); - } - - // enter frame event - - /** @private */ - override public function addEventListener(type:String, listener:Function):void - { - if (type == Event.ENTER_FRAME && _target) - _target.addEventListener(Event.ENTER_FRAME, onEnterFrame); - - super.addEventListener(type, listener); - } - - /** @private */ - override public function removeEventListener(type:String, listener:Function):void - { - if (type == Event.ENTER_FRAME && _target) - _target.removeEventListener(type, onEnterFrame); - - super.removeEventListener(type, listener); - } - - private function onEnterFrame(event:Event):void - { - dispatchEvent(event); - } - - // properties - - /** The effect instance returning the FilterEffect created via createEffect. */ - protected function get effect():FilterEffect - { - if (_effect == null) _effect = createEffect(); - return _effect; - } - - /** The VertexData used to process the effect. Per default, uses the format provided - * by the effect, and contains four vertices enclosing the target object. */ - protected function get vertexData():VertexData - { - if (_vertexData == null) _vertexData = new VertexData(effect.vertexFormat, 4); - return _vertexData; - } - - /** The IndexData used to process the effect. Per default, references a quad (two triangles) - * of four vertices. */ - protected function get indexData():IndexData - { - if (_indexData == null) - { - _indexData = new IndexData(6); - _indexData.addQuad(0, 1, 2, 3); - } - - return _indexData; - } - - /** Call this method when any of the filter's properties changes. - * This will make sure the filter is redrawn in the next frame. */ - protected function setRequiresRedraw():void - { - dispatchEventWith(Event.CHANGE); - if (_target) _target.setRequiresRedraw(); - if (_cached) _cacheRequested = true; - } - - /** Indicates the number of rendering passes required for this filter. - * Subclasses must override this method if the number of passes is not 1. */ - public function get numPasses():int - { - return 1; - } - - /** Called when assigning a target display object. - * Override to plug in class-specific logic. */ - protected function onTargetAssigned(target:DisplayObject):void - { } - - /** Padding can extend the size of the filter texture in all directions. - * That's useful when the filter "grows" the bounds of the object in any direction. */ - public function get padding():Padding - { - if (_padding == null) - { - _padding = new Padding(); - _padding.addEventListener(Event.CHANGE, setRequiresRedraw); - } - - return _padding; - } - - public function set padding(value:Padding):void - { - padding.copyFrom(value); - } - - /** Indicates if the filter is cached (via the cache method). */ - public function get isCached():Boolean { return _cached; } - - /** The resolution of the filter texture. "1" means stage resolution, "0.5" half the stage - * resolution. A lower resolution saves memory and execution time, but results in a lower - * output quality. Values greater than 1 are allowed; such values might make sense for a - * cached filter when it is scaled up. @default 1 - */ - public function get resolution():Number { return _resolution; } - public function set resolution(value:Number):void - { - if (value != _resolution) - { - if (value > 0) _resolution = value; - else throw new ArgumentError("resolution must be > 0"); - setRequiresRedraw(); - } - } - - /** The smoothing mode of the filter texture. @default bilinear */ - public function get textureSmoothing():String { return _textureSmoothing; } - public function set textureSmoothing(value:String):void - { - if (value != _textureSmoothing) - { - _textureSmoothing = value; - if (_quad) _quad.textureSmoothing = value; - setRequiresRedraw(); - } - } - - /** The format of the filter texture. @default BGRA */ - public function get textureFormat():String { return _textureFormat; } - public function set textureFormat(value:String):void - { - if (value != _textureFormat) - { - _textureFormat = value; - if (_helper) _helper.textureFormat = value; - setRequiresRedraw(); - } - } - - /** Indicates if the last filter pass is always drawn directly to the back buffer. - * - *

Per default, the filter tries to automatically render in a smart way: objects that - * are currently moving are rendered to the back buffer, objects that are static are - * rendered into a texture first, which allows the filter to be drawn directly from the - * render cache in the next frame (in case the object remains static).

- * - *

However, this fails when filters are added to an object that does not support the - * render cache, or to a container with such a child (e.g. a Sprite3D object or a masked - * display object). In such a case, enable this property for maximum performance.

- * - * @default false - */ - public function get alwaysDrawToBackBuffer():Boolean { return _alwaysDrawToBackBuffer; } - public function set alwaysDrawToBackBuffer(value:Boolean):void - { - _alwaysDrawToBackBuffer = value; - } - - // internal methods - - /** @private */ - starling_internal function setTarget(target:DisplayObject):void - { - if (target != _target) - { - var prevTarget:DisplayObject = _target; - _target = target; - - if (target == null) - { - if (_helper) _helper.purge(); - if (_effect) _effect.purgeBuffers(); - if (_quad) _quad.disposeTexture(); - } - - if (prevTarget) - { - prevTarget.filter = null; - prevTarget.removeEventListener(Event.ENTER_FRAME, onEnterFrame); - } - - if (target) - { - if (hasEventListener(Event.ENTER_FRAME)) - target.addEventListener(Event.ENTER_FRAME, onEnterFrame); - - onTargetAssigned(target); - } - } - } - } -} - -import flash.geom.Matrix; -import flash.geom.Rectangle; - -import starling.display.DisplayObject; -import starling.display.Mesh; -import starling.rendering.IndexData; -import starling.rendering.VertexData; -import starling.textures.Texture; - -class FilterQuad extends Mesh -{ - private static var sMatrix:Matrix = new Matrix(); - - public function FilterQuad(smoothing:String) - { - var vertexData:VertexData = new VertexData(null, 4); - vertexData.numVertices = 4; - - var indexData:IndexData = new IndexData(6); - indexData.addQuad(0, 1, 2, 3); - - super(vertexData, indexData); - - textureSmoothing = smoothing; - pixelSnapping = false; - } - - override public function dispose():void - { - disposeTexture(); - super.dispose(); - } - - public function disposeTexture():void - { - if (texture) - { - texture.dispose(); - texture = null; - } - } - - public function moveVertices(sourceSpace:DisplayObject, targetSpace:DisplayObject):void - { - if (targetSpace.is3D) - throw new Error("cannot move vertices into 3D space"); - else if (sourceSpace != targetSpace) - { - targetSpace.getTransformationMatrix(sourceSpace, sMatrix).invert(); // ss could be null! - vertexData.transformPoints("position", sMatrix); - } - } - - public function setBounds(bounds:Rectangle):void - { - var vertexData:VertexData = this.vertexData; - var attrName:String = "position"; - - vertexData.setPoint(0, attrName, bounds.x, bounds.y); - vertexData.setPoint(1, attrName, bounds.right, bounds.y); - vertexData.setPoint(2, attrName, bounds.x, bounds.bottom); - vertexData.setPoint(3, attrName, bounds.right, bounds.bottom); - } - - override public function set texture(value:Texture):void - { - super.texture = value; - if (value) value.setupTextureCoordinates(vertexData); - } -} \ No newline at end of file diff --git a/mobile_version/src/starling/filters/GlowFilter.as b/mobile_version/src/starling/filters/GlowFilter.as deleted file mode 100644 index 82929a7a..00000000 --- a/mobile_version/src/starling/filters/GlowFilter.as +++ /dev/null @@ -1,125 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= - -package starling.filters -{ - import starling.rendering.Painter; - import starling.textures.Texture; - - /** The GlowFilter class lets you apply a glow effect to display objects. - * It is similar to the drop shadow filter with the distance and angle properties set to 0. - */ - public class GlowFilter extends FragmentFilter - { - private var _blurFilter:BlurFilter; - private var _compositeFilter:CompositeFilter; - - /** Initializes a new GlowFilter instance with the specified parameters. - * - * @param color the color of the glow - * @param alpha the alpha value of the glow. Values between 0 and 1 modify the - * opacity; values > 1 will make it stronger, i.e. produce a harder edge. - * @param blur the amount of blur used to create the glow. Note that high - * values will cause the number of render passes to grow. - * @param resolution the resolution of the filter texture. '1' means full resolution, - * '0.5' half resolution, etc. - */ - public function GlowFilter(color:uint=0xffff00, alpha:Number=1.0, blur:Number=1.0, - resolution:Number=0.5) - { - _blurFilter = new BlurFilter(blur, blur, resolution); - _compositeFilter = new CompositeFilter(); - _compositeFilter.setColorAt(0, color, true); - _compositeFilter.setAlphaAt(0, alpha); - - updatePadding(); - } - - /** @inheritDoc */ - override public function dispose():void - { - _blurFilter.dispose(); - _compositeFilter.dispose(); - - super.dispose(); - } - - /** @private */ - override public function process(painter:Painter, helper:IFilterHelper, - input0:Texture = null, input1:Texture = null, - input2:Texture = null, input3:Texture = null):Texture - { - var glow:Texture = _blurFilter.process(painter, helper, input0); - var result:Texture = _compositeFilter.process(painter, helper, glow, input0); - helper.putTexture(glow); - return result; - } - - /** @private */ - override public function get numPasses():int - { - return _blurFilter.numPasses + _compositeFilter.numPasses; - } - - private function updatePadding():void - { - padding.copyFrom(_blurFilter.padding); - } - - /** The color of the glow. @default 0xffff00 */ - public function get color():uint { return _compositeFilter.getColorAt(0); } - public function set color(value:uint):void - { - if (color != value) - { - _compositeFilter.setColorAt(0, value, true); - setRequiresRedraw(); - } - } - - /** The alpha value of the glow. Values between 0 and 1 modify the opacity; - * values > 1 will make it stronger, i.e. produce a harder edge. @default 1.0 */ - public function get alpha():Number { return _compositeFilter.getAlphaAt(0); } - public function set alpha(value:Number):void - { - if (alpha != value) - { - _compositeFilter.setAlphaAt(0, value); - setRequiresRedraw(); - } - } - - /** The amount of blur with which the glow is created. - * The number of required passes will be Math.ceil(value) × 2. - * @default 1.0 */ - public function get blur():Number { return _blurFilter.blurX; } - public function set blur(value:Number):void - { - if (blur != value) - { - _blurFilter.blurX = _blurFilter.blurY = value; - setRequiresRedraw(); - updatePadding(); - } - } - - /** @private */ - override public function get resolution():Number { return _blurFilter.resolution; } - override public function set resolution(value:Number):void - { - if (resolution != value) - { - _blurFilter.resolution = value; - setRequiresRedraw(); - updatePadding(); - } - } - } -} diff --git a/mobile_version/src/starling/filters/IFilterHelper.as b/mobile_version/src/starling/filters/IFilterHelper.as deleted file mode 100644 index c1e47de9..00000000 --- a/mobile_version/src/starling/filters/IFilterHelper.as +++ /dev/null @@ -1,49 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= - -package starling.filters -{ - import flash.geom.Rectangle; - - import starling.display.DisplayObject; - import starling.textures.Texture; - - /** An interface describing the methods available on the helper object passed - * to the process call of fragment filters. It provides information about the - * target object and methods to acquire and release pass textures. - * - * @see FragmentFilter#process() - */ - public interface IFilterHelper - { - /** Gets a pass texture from the pool, or creates a new one (cleared and ready to be used - * as render target). Its size is dictated by the bounds of the target display object - * plus padding. - * - *

Beware: each call of this method counts as one render pass. For performance reasons, - * the filter may be configured to render the last pass directly to the back buffer. In - * that case, this method will return null for the last pass! That's the - * sign for the process method to draw to the back buffer. If you receive - * null too soon, the filter class probably didn't correctly override - * numPasses.

- */ - function getTexture(resolution:Number=1.0):Texture; - - /** Puts a texture back into the pool to be reused later (or to be disposed - * with the pool). */ - function putTexture(texture:Texture):void; - - /** The bounds of the target object (plus padding) in stage coordinates. */ - function get targetBounds():Rectangle; - - /** The display object the filter is currently attached to. */ - function get target():DisplayObject; - } -} diff --git a/mobile_version/src/starling/geom/Polygon.as b/mobile_version/src/starling/geom/Polygon.as deleted file mode 100644 index 75362b2e..00000000 --- a/mobile_version/src/starling/geom/Polygon.as +++ /dev/null @@ -1,613 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= - -package starling.geom -{ - import flash.geom.Point; - import flash.utils.getQualifiedClassName; - - import starling.rendering.IndexData; - import starling.rendering.VertexData; - import starling.utils.MathUtil; - import starling.utils.Pool; - - /** A polygon describes a closed two-dimensional shape bounded by a number of straight - * line segments. - * - *

The vertices of a polygon form a closed path (i.e. the last vertex will be connected - * to the first). It is recommended to provide the vertices in clockwise order. - * Self-intersecting paths are not supported and will give wrong results on triangulation, - * area calculation, etc.

- */ - public class Polygon - { - private var _coords:Vector.; - - // Helper object - private static var sRestIndices:Vector. = new []; - - /** Creates a Polygon with the given coordinates. - * @param vertices an array that contains either 'Point' instances or - * alternating 'x' and 'y' coordinates. - */ - public function Polygon(vertices:Array=null) - { - _coords = new []; - addVertices.apply(this, vertices); - } - - /** Creates a clone of this polygon. */ - public function clone():Polygon - { - var clone:Polygon = new Polygon(); - var numCoords:int = _coords.length; - - for (var i:int=0; i 0) - { - if (args[0] is Point) - { - for (i=0; i= 0 && index <= numVertices) - { - _coords[index * 2 ] = x; - _coords[index * 2 + 1] = y; - } - else throw new RangeError("Invalid index: " + index); - } - - /** Returns the coordinates of a certain vertex. */ - public function getVertex(index:int, out:Point=null):Point - { - if (index >= 0 && index < numVertices) - { - out ||= new Point(); - out.setTo(_coords[index * 2], _coords[index * 2 + 1]); - return out; - } - else throw new RangeError("Invalid index: " + index); - } - - /** Figures out if the given coordinates lie within the polygon. */ - public function contains(x:Number, y:Number):Boolean - { - // Algorithm & implementation thankfully taken from: - // -> http://alienryderflex.com/polygon/ - - var i:int, j:int = numVertices - 1; - var oddNodes:uint = 0; - - for (i=0; i= y || jy < y && iy >= y) && (ix <= x || jx <= x)) - oddNodes ^= uint(ix + (y - iy) / (jy - iy) * (jx - ix) < x); - - j = i; - } - - return oddNodes != 0; - } - - /** Figures out if the given point lies within the polygon. */ - public function containsPoint(point:Point):Boolean - { - return contains(point.x, point.y); - } - - /** Calculates a possible representation of the polygon via triangles. The resulting - * IndexData instance will reference the polygon vertices as they are saved in this - * Polygon instance, optionally incremented by the given offset. - * - *

If you pass an indexData object, the new indices will be appended to it. - * Otherwise, a new instance will be created.

*/ - public function triangulate(indexData:IndexData=null, offset:int=0):IndexData - { - // Algorithm "Ear clipping method" described here: - // -> https://en.wikipedia.org/wiki/Polygon_triangulation - // - // Implementation inspired by: - // -> http://polyk.ivank.net - - var numVertices:int = this.numVertices; - var numTriangles:int = this.numTriangles; - var i:int, restIndexPos:int, numRestIndices:int; - - if (indexData == null) indexData = new IndexData(numTriangles * 3); - if (numTriangles == 0) return indexData; - - sRestIndices.length = numVertices; - for (i=0; i 3) - { - // In each step, we look at 3 subsequent vertices. If those vertices spawn up - // a triangle that is convex and does not contain any other vertices, it is an 'ear'. - // We remove those ears until only one remains -> each ear is one of our wanted - // triangles. - - var otherIndex:uint; - var earFound:Boolean = false; - var i0:uint = sRestIndices[ restIndexPos % numRestIndices]; - var i1:uint = sRestIndices[(restIndexPos + 1) % numRestIndices]; - var i2:uint = sRestIndices[(restIndexPos + 2) % numRestIndices]; - - a.setTo(_coords[2 * i0], _coords[2 * i0 + 1]); - b.setTo(_coords[2 * i1], _coords[2 * i1 + 1]); - c.setTo(_coords[2 * i2], _coords[2 * i2 + 1]); - - if (isConvexTriangle(a.x, a.y, b.x, b.y, c.x, c.y)) - { - earFound = true; - for (i = 3; i < numRestIndices; ++i) - { - otherIndex = sRestIndices[(restIndexPos + i) % numRestIndices]; - p.setTo(_coords[2 * otherIndex], _coords[2 * otherIndex + 1]); - - if (MathUtil.isPointInTriangle(p, a, b, c)) - { - earFound = false; - break; - } - } - } - - if (earFound) - { - indexData.addTriangle(i0 + offset, i1 + offset, i2 + offset); - sRestIndices.removeAt((restIndexPos + 1) % numRestIndices); - - numRestIndices--; - restIndexPos = 0; - } - else - { - restIndexPos++; - if (restIndexPos == numRestIndices) break; // no more ears - } - } - - Pool.putPoint(a); - Pool.putPoint(b); - Pool.putPoint(c); - Pool.putPoint(p); - - indexData.addTriangle(sRestIndices[0] + offset, - sRestIndices[1] + offset, - sRestIndices[2] + offset); - return indexData; - } - - /** Copies all vertices to a 'VertexData' instance, beginning at a certain target index. */ - public function copyToVertexData(target:VertexData=null, targetVertexID:int=0, - attrName:String="position"):void - { - var numVertices:int = this.numVertices; - var requiredTargetLength:int = targetVertexID + numVertices; - - if (target.numVertices < requiredTargetLength) - target.numVertices = requiredTargetLength; - - for (var i:int=0; i 0) result += "\n"; - - for (var i:int=0; ib->c is to on the right-hand side of a->b. */ - [Inline] - private static function isConvexTriangle(ax:Number, ay:Number, - bx:Number, by:Number, - cx:Number, cy:Number):Boolean - { - // dot product of [the normal of (a->b)] and (b->c) must be positive - return (ay - by) * (cx - bx) + (bx - ax) * (cy - by) >= 0; - } - - /** Finds out if the vector a->b intersects c->d. */ - private static function areVectorsIntersecting(ax:Number, ay:Number, bx:Number, by:Number, - cx:Number, cy:Number, dx:Number, dy:Number):Boolean - { - if ((ax == bx && ay == by) || (cx == dx && cy == dy)) return false; // length = 0 - - var abx:Number = bx - ax; - var aby:Number = by - ay; - var cdx:Number = dx - cx; - var cdy:Number = dy - cy; - var tDen:Number = cdy * abx - cdx * aby; - - if (tDen == 0.0) return false; // parallel or identical - - var t:Number = (aby * (cx - ax) - abx * (cy - ay)) / tDen; - - if (t < 0 || t > 1) return false; // outside c->d - - var s:Number = aby ? (cy - ay + t * cdy) / aby : - (cx - ax + t * cdx) / abx; - - return s >= 0.0 && s <= 1.0; // inside a->b - } - - // properties - - /** Indicates if the polygon's line segments are not self-intersecting. - * Beware: this is a brute-force implementation with O(n^2). */ - public function get isSimple():Boolean - { - var numCoords:int = _coords.length; - if (numCoords <= 6) return true; - - for (var i:int=0; i= 6) - { - for (var i:int = 0; i < numCoords; i += 2) - { - area += _coords[i ] * _coords[(i+3) % numCoords]; - area -= _coords[i+1] * _coords[(i+2) % numCoords]; - } - } - - return area / 2.0; - } - - /** Returns the total number of vertices spawning up the polygon. Assigning a value - * that's smaller than the current number of vertices will crop the path; a bigger - * value will fill up the path with zeros. */ - public function get numVertices():int - { - return _coords.length / 2; - } - - public function set numVertices(value:int):void - { - var oldLength:int = numVertices; - _coords.length = value * 2; - - if (oldLength < value) - { - for (var i:int=oldLength; i < value; ++i) - _coords[i * 2] = _coords[i * 2 + 1] = 0.0; - } - } - - /** Returns the number of triangles that will be required when triangulating the polygon. */ - public function get numTriangles():int - { - var numVertices:int = this.numVertices; - return numVertices >= 3 ? numVertices - 2 : 0; - } - } -} - -import flash.errors.IllegalOperationError; -import flash.utils.getQualifiedClassName; - -import starling.geom.Polygon; -import starling.rendering.IndexData; - -class ImmutablePolygon extends Polygon -{ - private var _frozen:Boolean; - - public function ImmutablePolygon(vertices:Array) - { - super(vertices); - _frozen = true; - } - - override public function addVertices(...args):void - { - if (_frozen) throw getImmutableError(); - else super.addVertices.apply(this, args); - } - - override public function setVertex(index:int, x:Number, y:Number):void - { - if (_frozen) throw getImmutableError(); - else super.setVertex(index, x, y); - } - - override public function reverse():void - { - if (_frozen) throw getImmutableError(); - else super.reverse(); - } - - override public function set numVertices(value:int):void - { - if (_frozen) throw getImmutableError(); - else super.reverse(); - } - - private function getImmutableError():Error - { - var className:String = getQualifiedClassName(this).split("::").pop(); - var msg:String = className + " cannot be modified. Call 'clone' to create a mutable copy."; - return new IllegalOperationError(msg); - } -} - -class Ellipse extends ImmutablePolygon -{ - private var _x:Number; - private var _y:Number; - private var _radiusX:Number; - private var _radiusY:Number; - - public function Ellipse(x:Number, y:Number, radiusX:Number, radiusY:Number, numSides:int = -1) - { - _x = x; - _y = y; - _radiusX = radiusX; - _radiusY = radiusY; - - super(getVertices(numSides)); - } - - private function getVertices(numSides:int):Array - { - if (numSides < 0) numSides = Math.PI * (_radiusX + _radiusY) / 4.0; - if (numSides < 6) numSides = 6; - - var vertices:Array = []; - var angleDelta:Number = 2 * Math.PI / numSides; - var angle:Number = 0; - - for (var i:int=0; i= _x && x <= _x + _width && - y >= _y && y <= _y + _height; - } - - override public function get area():Number - { - return _width * _height; - } - - override public function get isSimple():Boolean - { - return true; - } - - override public function get isConvex():Boolean - { - return true; - } -} diff --git a/mobile_version/src/starling/rendering/BatchProcessor.as b/mobile_version/src/starling/rendering/BatchProcessor.as deleted file mode 100644 index dc04bd64..00000000 --- a/mobile_version/src/starling/rendering/BatchProcessor.as +++ /dev/null @@ -1,218 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= - -package starling.rendering -{ - import flash.geom.Matrix; - - import starling.display.Mesh; - import starling.display.MeshBatch; - import starling.utils.MeshSubset; - - /** This class manages a list of mesh batches of different types; - * it acts as a "meta" MeshBatch that initiates all rendering. - */ - internal class BatchProcessor - { - private var _batches:Vector.; - private var _batchPool:BatchPool; - private var _currentBatch:MeshBatch; - private var _currentStyleType:Class; - private var _onBatchComplete:Function; - private var _cacheToken:BatchToken; - - // helper objects - private static var sMeshSubset:MeshSubset = new MeshSubset(); - - /** Creates a new batch processor. */ - public function BatchProcessor() - { - _batches = new []; - _batchPool = new BatchPool(); - _cacheToken = new BatchToken(); - } - - /** Disposes all batches (including those in the reusable pool). */ - public function dispose():void - { - for each (var batch:MeshBatch in _batches) - batch.dispose(); - - _batches.length = 0; - _batchPool.purge(); - _currentBatch = null; - _onBatchComplete = null; - } - - /** Adds a mesh to the current batch, or to a new one if the current one does not support - * it. Whenever the batch changes, onBatchComplete is called for the previous - * one. - * - * @param mesh the mesh to add to the current (or new) batch. - * @param state the render state from which to take the current settings for alpha, - * modelview matrix, and blend mode. - * @param subset the subset of the mesh you want to add, or null for - * the complete mesh. - * @param ignoreTransformations when enabled, the mesh's vertices will be added - * without transforming them in any way (no matter the value of the - * state's modelviewMatrix). - */ - public function addMesh(mesh:Mesh, state:RenderState, subset:MeshSubset=null, - ignoreTransformations:Boolean=false):void - { - if (subset == null) - { - subset = sMeshSubset; - subset.vertexID = subset.indexID = 0; - subset.numVertices = mesh.numVertices; - subset.numIndices = mesh.numIndices; - } - else - { - if (subset.numVertices < 0) subset.numVertices = mesh.numVertices - subset.vertexID; - if (subset.numIndices < 0) subset.numIndices = mesh.numIndices - subset.indexID; - } - - if (subset.numVertices > 0) - { - if (_currentBatch == null || !_currentBatch.canAddMesh(mesh, subset.numVertices)) - { - finishBatch(); - - _currentStyleType = mesh.style.type; - _currentBatch = _batchPool.get(_currentStyleType); - _currentBatch.blendMode = state ? state.blendMode : mesh.blendMode; - _cacheToken.setTo(_batches.length); - _batches[_batches.length] = _currentBatch; - } - - var matrix:Matrix = state ? state._modelviewMatrix : null; - var alpha:Number = state ? state._alpha : 1.0; - - _currentBatch.addMesh(mesh, matrix, alpha, subset, ignoreTransformations); - _cacheToken.vertexID += subset.numVertices; - _cacheToken.indexID += subset.numIndices; - } - } - - /** Finishes the current batch, i.e. call the 'onComplete' callback on the batch and - * prepares initialization of a new one. */ - public function finishBatch():void - { - var meshBatch:MeshBatch = _currentBatch; - - if (meshBatch) - { - _currentBatch = null; - _currentStyleType = null; - - if (_onBatchComplete != null) - _onBatchComplete(meshBatch); - } - } - - /** Clears all batches and adds them to a pool so they can be reused later. */ - public function clear():void - { - var numBatches:int = _batches.length; - - for (var i:int=0; i in _batchLists) - { - for (var i:int=0; i = _batchLists[styleType]; - if (batchList == null) - { - batchList = new []; - _batchLists[styleType] = batchList; - } - - if (batchList.length > 0) return batchList.pop(); - else return new MeshBatch(); - } - - public function put(meshBatch:MeshBatch):void - { - var styleType:Class = meshBatch.style.type; - var batchList:Vector. = _batchLists[styleType]; - if (batchList == null) - { - batchList = new []; - _batchLists[styleType] = batchList; - } - - meshBatch.clear(); - batchList[batchList.length] = meshBatch; - } -} diff --git a/mobile_version/src/starling/rendering/BatchToken.as b/mobile_version/src/starling/rendering/BatchToken.as deleted file mode 100644 index f3fd49dc..00000000 --- a/mobile_version/src/starling/rendering/BatchToken.as +++ /dev/null @@ -1,77 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= - -package starling.rendering -{ - import starling.utils.StringUtil; - - /** Points to a location within a list of MeshBatches. - * - *

Starling uses these tokens in its render cache. Each call to - * painter.pushState() or painter.popState() provides a token - * referencing the current location within the cache. In the next frame, if the relevant - * part of the display tree has not changed, these tokens can be used to render directly - * from the cache instead of constructing new MeshBatches.

- * - * @see Painter - */ - public class BatchToken - { - /** The ID of the current MeshBatch. */ - public var batchID:int; - - /** The ID of the next vertex within the current MeshBatch. */ - public var vertexID:int; - - /** The ID of the next index within the current MeshBatch. */ - public var indexID:int; - - /** Creates a new BatchToken. */ - public function BatchToken(batchID:int=0, vertexID:int=0, indexID:int=0) - { - setTo(batchID, vertexID, indexID); - } - - /** Copies the properties from the given token to this instance. */ - public function copyFrom(token:BatchToken):void - { - batchID = token.batchID; - vertexID = token.vertexID; - indexID = token.indexID; - } - - /** Changes all properties at once. */ - public function setTo(batchID:int=0, vertexID:int=0, indexID:int=0):void - { - this.batchID = batchID; - this.vertexID = vertexID; - this.indexID = indexID; - } - - /** Resets all properties to zero. */ - public function reset():void - { - batchID = vertexID = indexID = 0; - } - - /** Indicates if this token contains the same values as the given one. */ - public function equals(other:BatchToken):Boolean - { - return batchID == other.batchID && vertexID == other.vertexID && indexID == other.indexID; - } - - /** Creates a String representation of this instance. */ - public function toString():String - { - return StringUtil.format("[BatchToken batchID={0} vertexID={1} indexID={2}]", - batchID, vertexID, indexID); - } - } -} diff --git a/mobile_version/src/starling/rendering/Effect.as b/mobile_version/src/starling/rendering/Effect.as deleted file mode 100644 index e9125557..00000000 --- a/mobile_version/src/starling/rendering/Effect.as +++ /dev/null @@ -1,381 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= - -package starling.rendering -{ - import flash.display3D.Context3D; - import flash.display3D.Context3DProgramType; - import flash.display3D.IndexBuffer3D; - import flash.display3D.VertexBuffer3D; - import flash.events.Event; - import flash.geom.Matrix3D; - import flash.utils.Dictionary; - import flash.utils.getQualifiedClassName; - - import starling.core.Starling; - import starling.errors.MissingContextError; - import starling.utils.execute; - - /** An effect encapsulates all steps of a Stage3D draw operation. It configures the - * render context and sets up shader programs as well as index- and vertex-buffers, thus - * providing the basic mechanisms of all low-level rendering. - * - *

Using the Effect class

- * - *

Effects are mostly used by the MeshStyle and FragmentFilter - * classes. When you extend those classes, you'll be required to provide a custom effect. - * Setting it up for rendering is done by the base class, though, so you rarely have to - * initiate the rendering yourself. Nevertheless, it's good to know how an effect is doing - * its work.

- * - *

Using an effect always follows steps shown in the example below. You create the - * effect, configure it, upload vertex data and then: draw!

- * - * - * // create effect - * var effect:MeshEffect = new MeshEffect(); - * - * // configure effect - * effect.mvpMatrix3D = painter.state.mvpMatrix3D; - * effect.texture = getHeroTexture(); - * effect.color = 0xf0f0f0; - * - * // upload vertex data - * effect.uploadIndexData(indexData); - * effect.uploadVertexData(vertexData); - * - * // draw! - * effect.render(0, numTriangles); - * - *

Note that the VertexData being uploaded has to be created with the same - * format as the one returned by the effect's vertexFormat property.

- * - *

Extending the Effect class

- * - *

The base Effect-class can only render white triangles, which is not much - * use in itself. However, it is designed to be extended; subclasses can easily implement any - * kinds of shaders.

- * - *

Normally, you won't extend this class directly, but either FilterEffect - * or MeshEffect, depending on your needs (i.e. if you want to create a new - * fragment filter or a new mesh style). Whichever base class you're extending, you should - * override the following methods:

- * - *
    - *
  • createProgram():Program — must create the actual program containing - * vertex- and fragment-shaders. A program will be created only once for each render - * context; this is taken care of by the base class.
  • - *
  • get programVariantName():uint (optional) — override this if your - * effect requires different programs, depending on its settings. The recommended - * way to do this is via a bit-mask that uniquely encodes the current settings.
  • - *
  • get vertexFormat():String (optional) — must return the - * VertexData format that this effect requires for its vertices. If - * the effect does not require any special attributes, you can leave this out.
  • - *
  • beforeDraw(context:Context3D):void — Set up your context by - * configuring program constants and buffer attributes.
  • - *
  • afterDraw(context:Context3D):void — Will be called directly after - * context.drawTriangles(). Clean up any context configuration here.
  • - *
- * - *

Furthermore, you need to add properties that manage the data you require on rendering, - * e.g. the texture(s) that should be used, program constants, etc. I recommend looking at - * the implementations of Starling's FilterEffect and MeshEffect - * classes to see how to approach sub-classing.

- * - * @see FilterEffect - * @see MeshEffect - * @see starling.styles.MeshStyle - * @see starling.filters.FragmentFilter - * @see starling.utils.RenderUtil - */ - public class Effect - { - /** The vertex format expected by uploadVertexData: - * "position:float2" */ - public static const VERTEX_FORMAT:VertexDataFormat = - VertexDataFormat.fromString("position:float2"); - - private var _vertexBuffer:VertexBuffer3D; - private var _vertexBufferSize:int; // in bytes - private var _indexBuffer:IndexBuffer3D; - private var _indexBufferSize:int; // in number of indices - private var _indexBufferUsesQuadLayout:Boolean; - - private var _mvpMatrix3D:Matrix3D; - private var _onRestore:Function; - private var _programBaseName:String; - - // helper objects - private static var sProgramNameCache:Dictionary = new Dictionary(); - - /** Creates a new effect. */ - public function Effect() - { - _mvpMatrix3D = new Matrix3D(); - _programBaseName = getQualifiedClassName(this); - - // Handle lost context (using conventional Flash event for weak listener support) - Starling.current.stage3D.addEventListener(Event.CONTEXT3D_CREATE, - onContextCreated, false, 20, true); - } - - /** Purges the index- and vertex-buffers. */ - public function dispose():void - { - Starling.current.stage3D.removeEventListener(Event.CONTEXT3D_CREATE, onContextCreated); - purgeBuffers(); - } - - private function onContextCreated(event:Event):void - { - purgeBuffers(); - execute(_onRestore, this); - } - - /** Purges one or both of the vertex- and index-buffers. */ - public function purgeBuffers(vertexBuffer:Boolean=true, indexBuffer:Boolean=true):void - { - // We wrap the dispose calls in a try/catch block to work around a stage3D problem. - // Since they are not re-used later, that shouldn't have any evil side effects. - - if (_vertexBuffer && vertexBuffer) - { - try { _vertexBuffer.dispose(); } catch (e:Error) {} - _vertexBuffer = null; - } - - if (_indexBuffer && indexBuffer) - { - try { _indexBuffer.dispose(); } catch (e:Error) {} - _indexBuffer = null; - } - } - - /** Uploads the given index data to the internal index buffer. If the buffer is too - * small, a new one is created automatically. - * - * @param indexData The IndexData instance to upload. - * @param bufferUsage The expected buffer usage. Use one of the constants defined in - * Context3DBufferUsage. Only used when the method call - * causes the creation of a new index buffer. - */ - public function uploadIndexData(indexData:IndexData, - bufferUsage:String="staticDraw"):void - { - var numIndices:int = indexData.numIndices; - var isQuadLayout:Boolean = indexData.useQuadLayout; - var wasQuadLayout:Boolean = _indexBufferUsesQuadLayout; - - if (_indexBuffer) - { - if (numIndices <= _indexBufferSize) - { - if (!isQuadLayout || !wasQuadLayout) - { - indexData.uploadToIndexBuffer(_indexBuffer); - _indexBufferUsesQuadLayout = isQuadLayout && numIndices == _indexBufferSize; - } - } - else - purgeBuffers(false, true); - } - if (_indexBuffer == null) - { - _indexBuffer = indexData.createIndexBuffer(true, bufferUsage); - _indexBufferSize = numIndices; - _indexBufferUsesQuadLayout = isQuadLayout; - } - } - - /** Uploads the given vertex data to the internal vertex buffer. If the buffer is too - * small, a new one is created automatically. - * - * @param vertexData The VertexData instance to upload. - * @param bufferUsage The expected buffer usage. Use one of the constants defined in - * Context3DBufferUsage. Only used when the method call - * causes the creation of a new vertex buffer. - */ - public function uploadVertexData(vertexData:VertexData, - bufferUsage:String="staticDraw"):void - { - if (_vertexBuffer) - { - if (vertexData.size <= _vertexBufferSize) - vertexData.uploadToVertexBuffer(_vertexBuffer); - else - purgeBuffers(true, false); - } - if (_vertexBuffer == null) - { - _vertexBuffer = vertexData.createVertexBuffer(true, bufferUsage); - _vertexBufferSize = vertexData.size; - } - } - - // rendering - - /** Draws the triangles described by the index- and vertex-buffers, or a range of them. - * This calls beforeDraw, context.drawTriangles, and - * afterDraw, in this order. */ - public function render(firstIndex:int=0, numTriangles:int=-1):void - { - if (numTriangles < 0) numTriangles = _indexBufferSize / 3; - if (numTriangles == 0) return; - - var context:Context3D = Starling.context; - if (context == null) throw new MissingContextError(); - - beforeDraw(context); - context.drawTriangles(indexBuffer, firstIndex, numTriangles); - afterDraw(context); - } - - /** This method is called by render, directly before - * context.drawTriangles. It activates the program and sets up - * the context with the following constants and attributes: - * - *
    - *
  • vc0-vc3 — MVP matrix
  • - *
  • va0 — vertex position (xy)
  • - *
- */ - protected function beforeDraw(context:Context3D):void - { - program.activate(context); - vertexFormat.setVertexBufferAt(0, vertexBuffer, "position"); - context.setProgramConstantsFromMatrix(Context3DProgramType.VERTEX, 0, mvpMatrix3D, true); - } - - /** This method is called by render, directly after - * context.drawTriangles. Resets vertex buffer attributes. - */ - protected function afterDraw(context:Context3D):void - { - context.setVertexBufferAt(0, null); - } - - // program management - - /** Creates the program (a combination of vertex- and fragment-shader) used to render - * the effect with the current settings. Override this method in a subclass to create - * your shaders. This method will only be called once; the program is automatically stored - * in the Painter and re-used by all instances of this effect. - * - *

The basic implementation always outputs pure white.

- */ - protected function createProgram():Program - { - var vertexShader:String = [ - "m44 op, va0, vc0", // 4x4 matrix transform to output clipspace - "seq v0, va0, va0" // this is a hack that always produces "1" - ].join("\n"); - - var fragmentShader:String = - "mov oc, v0"; // output color: white - - return Program.fromSource(vertexShader, fragmentShader); - } - - /** Override this method if the effect requires a different program depending on the - * current settings. Ideally, you do this by creating a bit mask encoding all the options. - * This method is called often, so do not allocate any temporary objects when overriding. - * - * @default 0 - */ - protected function get programVariantName():uint - { - return 0; - } - - /** Returns the base name for the program. - * @default the fully qualified class name - */ - protected function get programBaseName():String { return _programBaseName; } - protected function set programBaseName(value:String):void { _programBaseName = value; } - - /** Returns the full name of the program, which is used to register it at the current - * Painter. - * - *

The default implementation efficiently combines the program's base and variant - * names (e.g. LightEffect#42). It shouldn't be necessary to override - * this method.

- */ - protected function get programName():String - { - var baseName:String = this.programBaseName; - var variantName:uint = this.programVariantName; - var nameCache:Dictionary = sProgramNameCache[baseName]; - - if (nameCache == null) - { - nameCache = new Dictionary(); - sProgramNameCache[baseName] = nameCache; - } - - var name:String = nameCache[variantName]; - - if (name == null) - { - if (variantName) name = baseName + "#" + variantName.toString(16); - else name = baseName; - - nameCache[variantName] = name; - } - - return name; - } - - /** Returns the current program, either by creating a new one (via - * createProgram) or by getting it from the Painter. - * Do not override this method! Instead, implement createProgram. */ - protected function get program():Program - { - var name:String = this.programName; - var painter:Painter = Starling.painter; - var program:Program = painter.getProgram(name); - - if (program == null) - { - program = createProgram(); - painter.registerProgram(name, program); - } - - return program; - } - - // properties - - /** The function that you provide here will be called after a context loss. - * Call both "upload..." methods from within the callback to restore any vertex or - * index buffers. The callback will be executed with the effect as its sole parameter. */ - public function get onRestore():Function { return _onRestore; } - public function set onRestore(value:Function):void { _onRestore = value; } - - /** The data format that this effect requires from the VertexData that it renders: - * "position:float2" */ - public function get vertexFormat():VertexDataFormat { return VERTEX_FORMAT; } - - /** The MVP (modelview-projection) matrix transforms vertices into clipspace. */ - public function get mvpMatrix3D():Matrix3D { return _mvpMatrix3D; } - public function set mvpMatrix3D(value:Matrix3D):void { _mvpMatrix3D.copyFrom(value); } - - /** The internally used index buffer used on rendering. */ - protected function get indexBuffer():IndexBuffer3D { return _indexBuffer; } - - /** The current size of the index buffer (in number of indices). */ - protected function get indexBufferSize():int { return _indexBufferSize; } - - /** The internally used vertex buffer used on rendering. */ - protected function get vertexBuffer():VertexBuffer3D { return _vertexBuffer; } - - /** The current size of the vertex buffer (in blocks of 32 bits). */ - protected function get vertexBufferSize():int { return _vertexBufferSize; } - } -} diff --git a/mobile_version/src/starling/rendering/FilterEffect.as b/mobile_version/src/starling/rendering/FilterEffect.as deleted file mode 100644 index f03e0dd7..00000000 --- a/mobile_version/src/starling/rendering/FilterEffect.as +++ /dev/null @@ -1,147 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= - -package starling.rendering -{ - import flash.display3D.Context3D; - - import starling.textures.Texture; - import starling.textures.TextureSmoothing; - import starling.utils.RenderUtil; - - /** An effect drawing a mesh of textured vertices. - * This is the standard effect that is the base for all fragment filters; - * if you want to create your own fragment filters, you will have to extend this class. - * - *

For more information about the usage and creation of effects, please have a look at - * the documentation of the parent class, "Effect".

- * - * @see Effect - * @see MeshEffect - * @see starling.filters.FragmentFilter - */ - public class FilterEffect extends Effect - { - /** The vertex format expected by uploadVertexData: - * "position:float2, texCoords:float2" */ - public static const VERTEX_FORMAT:VertexDataFormat = - Effect.VERTEX_FORMAT.extend("texCoords:float2"); - - /** The AGAL code for the standard vertex shader that most filters will use. - * It simply transforms the vertex coordinates to clip-space and passes the texture - * coordinates to the fragment program (as 'v0'). */ - public static const STD_VERTEX_SHADER:String = - "m44 op, va0, vc0 \n"+ // 4x4 matrix transform to output clip-space - "mov v0, va1"; // pass texture coordinates to fragment program - - private var _texture:Texture; - private var _textureSmoothing:String; - private var _textureRepeat:Boolean; - - /** Creates a new FilterEffect instance. */ - public function FilterEffect() - { - _textureSmoothing = TextureSmoothing.BILINEAR; - } - - /** Override this method if the effect requires a different program depending on the - * current settings. Ideally, you do this by creating a bit mask encoding all the options. - * This method is called often, so do not allocate any temporary objects when overriding. - * - *

Reserve 4 bits for the variant name of the base class.

- */ - override protected function get programVariantName():uint - { - return RenderUtil.getTextureVariantBits(_texture); - } - - /** @private */ - override protected function createProgram():Program - { - if (_texture) - { - var vertexShader:String = STD_VERTEX_SHADER; - var fragmentShader:String = tex("oc", "v0", 0, _texture); - return Program.fromSource(vertexShader, fragmentShader); - } - else - { - return super.createProgram(); - } - } - - /** This method is called by render, directly before - * context.drawTriangles. It activates the program and sets up - * the context with the following constants and attributes: - * - *
    - *
  • vc0-vc3 — MVP matrix
  • - *
  • va0 — vertex position (xy)
  • - *
  • va1 — texture coordinates (uv)
  • - *
  • fs0 — texture
  • - *
- */ - override protected function beforeDraw(context:Context3D):void - { - super.beforeDraw(context); - - if (_texture) - { - var repeat:Boolean = _textureRepeat && _texture.root.isPotTexture; - RenderUtil.setSamplerStateAt(0, _texture.mipMapping, _textureSmoothing, repeat); - context.setTextureAt(0, _texture.base); - vertexFormat.setVertexBufferAt(1, vertexBuffer, "texCoords"); - } - } - - /** This method is called by render, directly after - * context.drawTriangles. Resets texture and vertex buffer attributes. */ - override protected function afterDraw(context:Context3D):void - { - if (_texture) - { - context.setTextureAt(0, null); - context.setVertexBufferAt(1, null); - } - - super.afterDraw(context); - } - - /** Creates an AGAL source string with a tex operation, including an options - * list with the appropriate format flag. This is just a convenience method forwarding - * to the respective RenderUtil method. - * - * @see starling.utils.RenderUtil#createAGALTexOperation() - */ - protected static function tex(resultReg:String, uvReg:String, sampler:int, texture:Texture, - convertToPmaIfRequired:Boolean=true):String - { - return RenderUtil.createAGALTexOperation(resultReg, uvReg, sampler, texture, - convertToPmaIfRequired); - } - - /** The data format that this effect requires from the VertexData that it renders: - * "position:float2, texCoords:float2" */ - override public function get vertexFormat():VertexDataFormat { return VERTEX_FORMAT; } - - /** The texture to be mapped onto the vertices. */ - public function get texture():Texture { return _texture; } - public function set texture(value:Texture):void { _texture = value; } - - /** The smoothing filter that is used for the texture. @default bilinear */ - public function get textureSmoothing():String { return _textureSmoothing; } - public function set textureSmoothing(value:String):void { _textureSmoothing = value; } - - /** Indicates if pixels at the edges will be repeated or clamped. - * Only works for power-of-two textures. @default false */ - public function get textureRepeat():Boolean { return _textureRepeat; } - public function set textureRepeat(value:Boolean):void { _textureRepeat = value; } - } -} diff --git a/mobile_version/src/starling/rendering/IndexData.as b/mobile_version/src/starling/rendering/IndexData.as deleted file mode 100644 index 4319d16e..00000000 --- a/mobile_version/src/starling/rendering/IndexData.as +++ /dev/null @@ -1,552 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= - -package starling.rendering -{ - import flash.display3D.Context3D; - import flash.display3D.IndexBuffer3D; - import flash.errors.EOFError; - import flash.utils.ByteArray; - import flash.utils.Endian; - - import starling.core.Starling; - import starling.errors.MissingContextError; - import starling.utils.StringUtil; - - /** The IndexData class manages a raw list of vertex indices, allowing direct upload - * to Stage3D index buffers. You only have to work with this class if you're writing - * your own rendering code (e.g. if you create custom display objects). - * - *

To render objects with Stage3D, you have to organize vertices and indices in so-called - * vertex- and index-buffers. Vertex buffers store the coordinates of the vertices that make - * up an object; index buffers reference those vertices to determine which vertices spawn - * up triangles. Those buffers reside in graphics memory and can be accessed very - * efficiently by the GPU.

- * - *

Before you can move data into the buffers, you have to set it up in conventional - * memory — that is, in a Vector or a ByteArray. Since it's quite cumbersome to manually - * create and manipulate those data structures, the IndexData and VertexData classes provide - * a simple way to do just that. The data is stored in a ByteArray (one index or vertex after - * the other) that can easily be uploaded to a buffer.

- * - * Basic Quad Layout - * - *

In many cases, the indices we are working with will reference just quads, i.e. - * triangles composing rectangles. That means that many IndexData instances will contain - * similar or identical data — a great opportunity for optimization!

- * - *

If an IndexData instance follows a specific layout, it will be recognized - * automatically and many operations can be executed much faster. In Starling, that - * layout is called "basic quad layout". In order to recognize this specific sequence, - * the indices of each quad have to use the following order:

- * - *
n, n+1, n+2, n+1, n+3, n+2
- * - *

The subsequent quad has to use n+4 as starting value, the next one - * n+8, etc. Here is an example with 3 quads / 6 triangles:

- * - *
0, 1, 2, 1, 3, 2,   4, 5, 6, 5, 7, 6,   8, 9, 10, 9, 11, 10
- * - *

If you are describing quad-like meshes, make sure to always use this layout.

- * - * @see VertexData - */ - public class IndexData - { - /** The number of bytes per index element. */ - private static const INDEX_SIZE:int = 2; - - private var _rawData:ByteArray; - private var _numIndices:int; - private var _initialCapacity:int; - private var _useQuadLayout:Boolean; - - // basic quad layout - private static var sQuadData:ByteArray = new ByteArray(); - private static var sQuadDataNumIndices:uint = 0; - - // helper objects - private static var sVector:Vector. = new []; - private static var sTrimData:ByteArray = new ByteArray(); - - /** Creates an empty IndexData instance with the given capacity (in indices). - * - * @param initialCapacity - * - * The initial capacity affects just the way the internal ByteArray is allocated, not the - * numIndices value, which will always be zero when the constructor returns. - * The reason for this behavior is the peculiar way in which ByteArrays organize their - * memory: - * - *

The first time you set the length of a ByteArray, it will adhere to that: - * a ByteArray with length 20 will take up 20 bytes (plus some overhead). When you change - * it to a smaller length, it will stick to the original value, e.g. with a length of 10 - * it will still take up 20 bytes. However, now comes the weird part: change it to - * anything above the original length, and it will allocate 4096 bytes!

- * - *

Thus, be sure to always make a generous educated guess, depending on the planned - * usage of your IndexData instances.

- */ - public function IndexData(initialCapacity:int=48) - { - _numIndices = 0; - _initialCapacity = initialCapacity; - _useQuadLayout = true; - } - - /** Explicitly frees up the memory used by the ByteArray, thus removing all indices. - * Quad layout will be restored (until adding data violating that layout). */ - public function clear():void - { - if (_rawData) - _rawData.clear(); - - _numIndices = 0; - _useQuadLayout = true; - } - - /** Creates a duplicate of the IndexData object. */ - public function clone():IndexData - { - var clone:IndexData = new IndexData(_numIndices); - - if (!_useQuadLayout) - { - clone.switchToGenericData(); - clone._rawData.writeBytes(_rawData); - } - - clone._numIndices = _numIndices; - return clone; - } - - /** Copies the index data (or a range of it, defined by 'indexID' and 'numIndices') - * of this instance to another IndexData object, starting at a certain target index. - * If the target is not big enough, it will grow to fit all the new indices. - * - *

By passing a non-zero offset, you can raise all copied indices - * by that value in the target object.

- */ - public function copyTo(target:IndexData, targetIndexID:int=0, offset:int=0, - indexID:int=0, numIndices:int=-1):void - { - if (numIndices < 0 || indexID + numIndices > _numIndices) - numIndices = _numIndices - indexID; - - var sourceData:ByteArray, targetData:ByteArray; - var newNumIndices:int = targetIndexID + numIndices; - - if (target._numIndices < newNumIndices) - { - target._numIndices = newNumIndices; - - if (sQuadDataNumIndices < newNumIndices) - ensureQuadDataCapacity(newNumIndices); - } - - if (_useQuadLayout) - { - if (target._useQuadLayout) - { - var keepsQuadLayout:Boolean = true; - var distance:int = targetIndexID - indexID; - var distanceInQuads:int = distance / 6; - var offsetInQuads:int = offset / 4; - - // This code is executed very often. If it turns out that both IndexData - // instances use a quad layout, we don't need to do anything here. - // - // When "distance / 6 == offset / 4 && distance % 6 == 0 && offset % 4 == 0", - // the copy operation preserves the quad layout. In that case, we can exit - // right away. The code below is a little more complex, though, to avoid the - // (surprisingly costly) mod-operations. - - if (distanceInQuads == offsetInQuads && (offset & 3) == 0 && - distanceInQuads * 6 == distance) - { - keepsQuadLayout = true; - } - else if (numIndices > 2) - { - keepsQuadLayout = false; - } - else - { - for (var i:int=0; i offset % 4 == 0 - { - indexID += 6 * offset / 4; - offset = 0; - ensureQuadDataCapacity(indexID + numIndices); - } - } - else - { - if (target._useQuadLayout) - target.switchToGenericData(); - - sourceData = _rawData; - targetData = target._rawData; - } - - targetData.position = targetIndexID * INDEX_SIZE; - - if (offset == 0) - targetData.writeBytes(sourceData, indexID * INDEX_SIZE, numIndices * INDEX_SIZE); - else - { - sourceData.position = indexID * INDEX_SIZE; - - // by reading junks of 32 instead of 16 bits, we can spare half the time - while (numIndices > 1) - { - var indexAB:uint = sourceData.readUnsignedInt(); - var indexA:uint = ((indexAB & 0xffff0000) >> 16) + offset; - var indexB:uint = ((indexAB & 0x0000ffff) ) + offset; - targetData.writeUnsignedInt(indexA << 16 | indexB); - numIndices -= 2; - } - - if (numIndices) - targetData.writeShort(sourceData.readUnsignedShort() + offset); - } - } - - /** Sets an index at the specified position. */ - public function setIndex(indexID:int, index:uint):void - { - if (_numIndices < indexID + 1) - numIndices = indexID + 1; - - if (_useQuadLayout) - { - if (getBasicQuadIndexAt(indexID) == index) return; - else switchToGenericData(); - } - - _rawData.position = indexID * INDEX_SIZE; - _rawData.writeShort(index); - } - - /** Reads the index from the specified position. */ - public function getIndex(indexID:int):int - { - if (_useQuadLayout) - { - if (indexID < _numIndices) - return getBasicQuadIndexAt(indexID); - else - throw new EOFError(); - } - else - { - _rawData.position = indexID * INDEX_SIZE; - return _rawData.readUnsignedShort(); - } - } - - /** Adds an offset to all indices in the specified range. */ - public function offsetIndices(offset:int, indexID:int=0, numIndices:int=-1):void - { - if (numIndices < 0 || indexID + numIndices > _numIndices) - numIndices = _numIndices - indexID; - - var endIndex:int = indexID + numIndices; - - for (var i:int=indexID; i - * a - b - * | / | - * c - d - * - * - *

To make sure the indices will follow the basic quad layout, make sure each - * parameter increments the one before it (e.g. 0, 1, 2, 3).

- */ - public function addQuad(a:uint, b:uint, c:uint, d:uint):void - { - if (_useQuadLayout) - { - if (a == getBasicQuadIndexAt(_numIndices) && - b == a + 1 && c == b + 1 && d == c + 1) - { - _numIndices += 6; - ensureQuadDataCapacity(_numIndices); - return; - } - else switchToGenericData(); - } - - _rawData.position = _numIndices * INDEX_SIZE; - _rawData.writeShort(a); - _rawData.writeShort(b); - _rawData.writeShort(c); - _rawData.writeShort(b); - _rawData.writeShort(d); - _rawData.writeShort(c); - _numIndices += 6; - } - - /** Creates a vector containing all indices. If you pass an existing vector to the method, - * its contents will be overwritten. */ - public function toVector(out:Vector.=null):Vector. - { - if (out == null) out = new Vector.(_numIndices); - else out.length = _numIndices; - - var rawData:ByteArray = _useQuadLayout ? sQuadData : _rawData; - rawData.position = 0; - - for (var i:int=0; i<_numIndices; ++i) - out[i] = rawData.readUnsignedShort(); - - return out; - } - - /** Returns a string representation of the IndexData object, - * including a comma-separated list of all indices. */ - public function toString():String - { - var string:String = StringUtil.format("[IndexData numIndices={0} indices=\"{1}\"]", - _numIndices, toVector(sVector).join()); - - sVector.length = 0; - return string; - } - - // private helpers - - private function switchToGenericData():void - { - if (_useQuadLayout) - { - _useQuadLayout = false; - - if (_rawData == null) - { - _rawData = new ByteArray(); - _rawData.endian = Endian.LITTLE_ENDIAN; - _rawData.length = _initialCapacity * INDEX_SIZE; // -> allocated memory - _rawData.length = _numIndices * INDEX_SIZE; // -> actual length - } - - if (_numIndices) - _rawData.writeBytes(sQuadData, 0, _numIndices * INDEX_SIZE); - } - } - - /** Makes sure that the ByteArray containing the normalized, basic quad data contains at - * least numIndices indices. The array might grow, but it will never be - * made smaller. */ - private function ensureQuadDataCapacity(numIndices:int):void - { - if (sQuadDataNumIndices >= numIndices) return; - - var i:int; - var oldNumQuads:int = sQuadDataNumIndices / 6; - var newNumQuads:int = Math.ceil(numIndices / 6); - - sQuadData.endian = Endian.LITTLE_ENDIAN; - sQuadData.position = sQuadData.length; - sQuadDataNumIndices = newNumQuads * 6; - - for (i = oldNumQuads; i < newNumQuads; ++i) - { - sQuadData.writeShort(4 * i); - sQuadData.writeShort(4 * i + 1); - sQuadData.writeShort(4 * i + 2); - sQuadData.writeShort(4 * i + 1); - sQuadData.writeShort(4 * i + 3); - sQuadData.writeShort(4 * i + 2); - } - } - - /** Returns the index that's expected at this position if following basic quad layout. */ - private static function getBasicQuadIndexAt(indexID:int):int - { - var quadID:int = indexID / 6; - var posInQuad:int = indexID - quadID * 6; // => indexID % 6 - var offset:int; - - if (posInQuad == 0) offset = 0; - else if (posInQuad == 1 || posInQuad == 3) offset = 1; - else if (posInQuad == 2 || posInQuad == 5) offset = 2; - else offset = 3; - - return quadID * 4 + offset; - } - - // IndexBuffer helpers - - /** Creates an index buffer object with the right size to fit the complete data. - * Optionally, the current data is uploaded right away. */ - public function createIndexBuffer(upload:Boolean=false, - bufferUsage:String="staticDraw"):IndexBuffer3D - { - var context:Context3D = Starling.context; - if (context == null) throw new MissingContextError(); - if (_numIndices == 0) return null; - - var buffer:IndexBuffer3D = context.createIndexBuffer(_numIndices, bufferUsage); - - if (upload) uploadToIndexBuffer(buffer); - return buffer; - } - - /** Uploads the complete data (or a section of it) to the given index buffer. */ - public function uploadToIndexBuffer(buffer:IndexBuffer3D, indexID:int=0, numIndices:int=-1):void - { - if (numIndices < 0 || indexID + numIndices > _numIndices) - numIndices = _numIndices - indexID; - - if (numIndices > 0) - buffer.uploadFromByteArray(rawData, 0, indexID, numIndices); - } - - /** Optimizes the ByteArray so that it has exactly the required capacity, without - * wasting any memory. If your IndexData object grows larger than the initial capacity - * you passed to the constructor, call this method to avoid the 4k memory problem. */ - public function trim():void - { - if (_useQuadLayout) return; - - sTrimData.length = _rawData.length; - sTrimData.position = 0; - sTrimData.writeBytes(_rawData); - - _rawData.clear(); - _rawData.length = sTrimData.length; - _rawData.writeBytes(sTrimData); - - sTrimData.clear(); - } - - // properties - - /** The total number of indices. - * - *

If this instance contains only standardized, basic quad indices, resizing - * will automatically fill up with appropriate quad indices. Otherwise, it will fill - * up with zeroes.

- * - *

If you set the number of indices to zero, quad layout will be restored.

*/ - public function get numIndices():int { return _numIndices; } - public function set numIndices(value:int):void - { - if (value != _numIndices) - { - if (_useQuadLayout) ensureQuadDataCapacity(value); - else _rawData.length = value * INDEX_SIZE; - if (value == 0) _useQuadLayout = true; - - _numIndices = value; - } - } - - /** The number of triangles that can be spawned up with the contained indices. - * (In other words: the number of indices divided by three.) */ - public function get numTriangles():int { return _numIndices / 3; } - public function set numTriangles(value:int):void { numIndices = value * 3; } - - /** The number of quads that can be spawned up with the contained indices. - * (In other words: the number of triangles divided by two.) */ - public function get numQuads():int { return _numIndices / 6; } - public function set numQuads(value:int):void { numIndices = value * 6; } - - /** The number of bytes required for each index value. */ - public function get indexSizeInBytes():int { return INDEX_SIZE; } - - /** Indicates if all indices are following the basic quad layout. - * - *

This property is automatically updated if an index is set to a value that violates - * basic quad layout. Once the layout was violated, the instance will always stay that - * way, even if you fix that violating value later. Only calling clear or - * manually enabling the property will restore quad layout.

- * - *

If you enable this property on an instance, all indices will immediately be - * replaced with indices following standard quad layout.

- * - *

Please look at the class documentation for more information about that kind - * of layout, and why it is important.

- * - * @default true - */ - public function get useQuadLayout():Boolean { return _useQuadLayout; } - public function set useQuadLayout(value:Boolean):void - { - if (value != _useQuadLayout) - { - if (value) - { - ensureQuadDataCapacity(_numIndices); - _rawData.length = 0; - _useQuadLayout = true; - } - else switchToGenericData(); - } - } - - /** The raw index data; not a copy! Beware: the referenced ByteArray may change any time. - * Never store a reference to it, and never modify its contents manually. */ - public function get rawData():ByteArray - { - if (_useQuadLayout) return sQuadData; - else return _rawData; - } - } -} diff --git a/mobile_version/src/starling/rendering/MeshEffect.as b/mobile_version/src/starling/rendering/MeshEffect.as deleted file mode 100644 index 69c5989b..00000000 --- a/mobile_version/src/starling/rendering/MeshEffect.as +++ /dev/null @@ -1,145 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= - -package starling.rendering -{ - import flash.display3D.Context3D; - import flash.display3D.Context3DProgramType; - import flash.utils.getQualifiedClassName; - - import starling.utils.RenderUtil; - - /** An effect drawing a mesh of textured, colored vertices. - * This is the standard effect that is the base for all mesh styles; - * if you want to create your own mesh styles, you will have to extend this class. - * - *

For more information about the usage and creation of effects, please have a look at - * the documentation of the root class, "Effect".

- * - * @see Effect - * @see FilterEffect - * @see starling.styles.MeshStyle - */ - public class MeshEffect extends FilterEffect - { - /** The vertex format expected by uploadVertexData: - * "position:float2, texCoords:float2, color:bytes4" */ - public static const VERTEX_FORMAT:VertexDataFormat = - FilterEffect.VERTEX_FORMAT.extend("color:bytes4"); - - private var _alpha:Number; - private var _tinted:Boolean; - private var _optimizeIfNotTinted:Boolean; - - // helper objects - private static var sRenderAlpha:Vector. = new Vector.(4, true); - - /** Creates a new MeshEffect instance. */ - public function MeshEffect() - { - // Non-tinted meshes may be rendered with a simpler fragment shader, which brings - // a huge performance benefit on some low-end hardware. However, I don't want - // subclasses to become any more complicated because of this optimization (they - // probably use much longer shaders, anyway), so I only apply this optimization if - // this is actually the "MeshEffect" class. - - _alpha = 1.0; - _optimizeIfNotTinted = getQualifiedClassName(this) == "starling.rendering::MeshEffect"; - } - - /** @private */ - override protected function get programVariantName():uint - { - var noTinting:uint = uint(_optimizeIfNotTinted && !_tinted && _alpha == 1.0); - return super.programVariantName | (noTinting << 3); - } - - /** @private */ - override protected function createProgram():Program - { - var vertexShader:String, fragmentShader:String; - - if (texture) - { - if (_optimizeIfNotTinted && !_tinted && _alpha == 1.0) - return super.createProgram(); - - vertexShader = - "m44 op, va0, vc0 \n" + // 4x4 matrix transform to output clip-space - "mov v0, va1 \n" + // pass texture coordinates to fragment program - "mul v1, va2, vc4 \n"; // multiply alpha (vc4) with color (va2), pass to fp - - fragmentShader = - tex("ft0", "v0", 0, texture) + - "mul oc, ft0, v1 \n"; // multiply color with texel color - } - else - { - vertexShader = - "m44 op, va0, vc0 \n" + // 4x4 matrix transform to output clipspace - "mul v0, va2, vc4 \n"; // multiply alpha (vc4) with color (va2) - - fragmentShader = - "mov oc, v0 \n"; // output color - } - - return Program.fromSource(vertexShader, fragmentShader); - } - - /** This method is called by render, directly before - * context.drawTriangles. It activates the program and sets up - * the context with the following constants and attributes: - * - *
    - *
  • vc0-vc3 — MVP matrix
  • - *
  • vc4 — alpha value (same value for all components)
  • - *
  • va0 — vertex position (xy)
  • - *
  • va1 — texture coordinates (uv)
  • - *
  • va2 — vertex color (rgba), using premultiplied alpha
  • - *
  • fs0 — texture
  • - *
- */ - override protected function beforeDraw(context:Context3D):void - { - super.beforeDraw(context); - - sRenderAlpha[0] = sRenderAlpha[1] = sRenderAlpha[2] = sRenderAlpha[3] = _alpha; - context.setProgramConstantsFromVector(Context3DProgramType.VERTEX, 4, sRenderAlpha); - - if (_tinted || _alpha != 1.0 || !_optimizeIfNotTinted || texture == null) - vertexFormat.setVertexBufferAt(2, vertexBuffer, "color"); - } - - /** This method is called by render, directly after - * context.drawTriangles. Resets texture and vertex buffer attributes. */ - override protected function afterDraw(context:Context3D):void - { - context.setVertexBufferAt(2, null); - - super.afterDraw(context); - } - - /** The data format that this effect requires from the VertexData that it renders: - * "position:float2, texCoords:float2, color:bytes4" */ - override public function get vertexFormat():VertexDataFormat { return VERTEX_FORMAT; } - - /** The alpha value of the object rendered by the effect. Must be taken into account - * by all subclasses. */ - public function get alpha():Number { return _alpha; } - public function set alpha(value:Number):void { _alpha = value; } - - /** Indicates if the rendered vertices are tinted in any way, i.e. if there are vertices - * that have a different color than fully opaque white. The base MeshEffect - * class uses this information to simplify the fragment shader if possible. May be - * ignored by subclasses. */ - public function get tinted():Boolean { return _tinted; } - public function set tinted(value:Boolean):void { _tinted = value; } - } -} diff --git a/mobile_version/src/starling/rendering/Painter.as b/mobile_version/src/starling/rendering/Painter.as deleted file mode 100644 index 2586e072..00000000 --- a/mobile_version/src/starling/rendering/Painter.as +++ /dev/null @@ -1,909 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= - -package starling.rendering -{ - import flash.display.Stage3D; - import flash.display3D.Context3D; - import flash.display3D.Context3DCompareMode; - import flash.display3D.Context3DStencilAction; - import flash.display3D.Context3DTriangleFace; - import flash.display3D.textures.TextureBase; - import flash.errors.IllegalOperationError; - import flash.geom.Matrix; - import flash.geom.Matrix3D; - import flash.geom.Rectangle; - import flash.geom.Vector3D; - import flash.utils.Dictionary; - - import starling.core.starling_internal; - import starling.display.BlendMode; - import starling.display.DisplayObject; - import starling.display.Mesh; - import starling.display.MeshBatch; - import starling.display.Quad; - import starling.events.Event; - import starling.textures.Texture; - import starling.utils.MathUtil; - import starling.utils.MatrixUtil; - import starling.utils.MeshSubset; - import starling.utils.Pool; - import starling.utils.RectangleUtil; - import starling.utils.RenderUtil; - import starling.utils.SystemUtil; - - use namespace starling_internal; - - /** A class that orchestrates rendering of all Starling display objects. - * - *

A Starling instance contains exactly one 'Painter' instance that should be used for all - * rendering purposes. Each frame, it is passed to the render methods of all rendered display - * objects. To access it outside a render method, call Starling.painter.

- * - *

The painter is responsible for drawing all display objects to the screen. At its - * core, it is a wrapper for many Context3D methods, but that's not all: it also provides - * a convenient state mechanism, supports masking and acts as middleman between display - * objects and renderers.

- * - * The State Stack - * - *

The most important concept of the Painter class is the state stack. A RenderState - * stores a combination of settings that are currently used for rendering, e.g. the current - * projection- and modelview-matrices and context-related settings. It can be accessed - * and manipulated via the state property. Use the methods - * pushState and popState to store a specific state and restore - * it later. That makes it easy to write rendering code that doesn't have any side effects.

- * - * - * painter.pushState(); // save a copy of the current state on the stack - * painter.state.renderTarget = renderTexture; - * painter.state.transformModelviewMatrix(object.transformationMatrix); - * painter.state.alpha = 0.5; - * painter.prepareToDraw(); // apply all state settings at the render context - * drawSomething(); // insert Stage3D rendering code here - * painter.popState(); // restores previous state - * - * @see RenderState - */ - public class Painter - { - // the key for the programs stored in 'sharedData' - private static const PROGRAM_DATA_NAME:String = "starling.rendering.Painter.Programs"; - - // members - - private var _stage3D:Stage3D; - private var _context:Context3D; - private var _shareContext:Boolean; - private var _drawCount:int; - private var _frameID:uint; - private var _pixelSize:Number; - private var _enableErrorChecking:Boolean; - private var _stencilReferenceValues:Dictionary; - private var _clipRectStack:Vector.; - private var _batchCacheExclusions:Vector.; - - private var _batchProcessor:BatchProcessor; - private var _batchProcessorCurr:BatchProcessor; // current processor - private var _batchProcessorPrev:BatchProcessor; // previous processor (cache) - private var _batchProcessorSpec:BatchProcessor; // special processor (no cache) - - private var _actualRenderTarget:TextureBase; - private var _actualCulling:String; - private var _actualBlendMode:String; - - private var _backBufferWidth:Number; - private var _backBufferHeight:Number; - private var _backBufferScaleFactor:Number; - - private var _state:RenderState; - private var _stateStack:Vector.; - private var _stateStackPos:int; - private var _stateStackLength:int; - - // shared data - private static var sSharedData:Dictionary = new Dictionary(); - - // helper objects - private static var sMatrix:Matrix = new Matrix(); - private static var sPoint3D:Vector3D = new Vector3D(); - private static var sMatrix3D:Matrix3D = new Matrix3D(); - private static var sClipRect:Rectangle = new Rectangle(); - private static var sBufferRect:Rectangle = new Rectangle(); - private static var sScissorRect:Rectangle = new Rectangle(); - private static var sMeshSubset:MeshSubset = new MeshSubset(); - - // construction - - /** Creates a new Painter object. Normally, it's not necessary to create any custom - * painters; instead, use the global painter found on the Starling instance. */ - public function Painter(stage3D:Stage3D) - { - _stage3D = stage3D; - _stage3D.addEventListener(Event.CONTEXT3D_CREATE, onContextCreated, false, 40, true); - _context = _stage3D.context3D; - _shareContext = _context && _context.driverInfo != "Disposed"; - _backBufferWidth = _context ? _context.backBufferWidth : 0; - _backBufferHeight = _context ? _context.backBufferHeight : 0; - _backBufferScaleFactor = _pixelSize = 1.0; - _stencilReferenceValues = new Dictionary(true); - _clipRectStack = new []; - - _batchProcessorCurr = new BatchProcessor(); - _batchProcessorCurr.onBatchComplete = drawBatch; - - _batchProcessorPrev = new BatchProcessor(); - _batchProcessorPrev.onBatchComplete = drawBatch; - - _batchProcessorSpec = new BatchProcessor(); - _batchProcessorSpec.onBatchComplete = drawBatch; - - _batchProcessor = _batchProcessorCurr; - _batchCacheExclusions = new Vector.(); - - _state = new RenderState(); - _state.onDrawRequired = finishMeshBatch; - _stateStack = new []; - _stateStackPos = -1; - _stateStackLength = 0; - } - - /** Disposes all mesh batches, programs, and - if it is not being shared - - * the render context. */ - public function dispose():void - { - _batchProcessorCurr.dispose(); - _batchProcessorPrev.dispose(); - _batchProcessorSpec.dispose(); - - if (!_shareContext) - { - _context.dispose(false); - sSharedData = new Dictionary(); - } - } - - // context handling - - /** Requests a context3D object from the stage3D object. - * This is called by Starling internally during the initialization process. - * You normally don't need to call this method yourself. (For a detailed description - * of the parameters, look at the documentation of the method with the same name in the - * "RenderUtil" class.) - * - * @see starling.utils.RenderUtil - */ - public function requestContext3D(renderMode:String, profile:*):void - { - RenderUtil.requestContext3D(_stage3D, renderMode, profile); - } - - private function onContextCreated(event:Object):void - { - _context = _stage3D.context3D; - _context.enableErrorChecking = _enableErrorChecking; - _context.setDepthTest(false, Context3DCompareMode.ALWAYS); - - _actualBlendMode = null; - _actualCulling = null; - } - - /** Sets the viewport dimensions and other attributes of the rendering buffer. - * Starling will call this method internally, so most apps won't need to mess with this. - * - *

Beware: if shareContext is enabled, the method will only update the - * painter's context-related information (like the size of the back buffer), but won't - * make any actual changes to the context.

- * - * @param viewPort the position and size of the area that should be rendered - * into, in pixels. - * @param contentScaleFactor only relevant for Desktop (!) HiDPI screens. If you want - * to support high resolutions, pass the 'contentScaleFactor' - * of the Flash stage; otherwise, '1.0'. - * @param antiAlias from 0 (none) to 16 (very high quality). - * @param enableDepthAndStencil indicates whether the depth and stencil buffers should - * be enabled. Note that on AIR, you also have to enable - * this setting in the app-xml (application descriptor); - * otherwise, this setting will be silently ignored. - */ - public function configureBackBuffer(viewPort:Rectangle, contentScaleFactor:Number, - antiAlias:int, enableDepthAndStencil:Boolean):void - { - if (!_shareContext) - { - enableDepthAndStencil &&= SystemUtil.supportsDepthAndStencil; - - // Changing the stage3D position might move the back buffer to invalid bounds - // temporarily. To avoid problems, we set it to the smallest possible size first. - - if (_context.profile == "baselineConstrained") - _context.configureBackBuffer(32, 32, antiAlias, enableDepthAndStencil); - - // If supporting HiDPI mode would exceed the maximum buffer size - // (can happen e.g in software mode), we stick to the low resolution. - - if (viewPort.width * contentScaleFactor > _context.maxBackBufferWidth || - viewPort.height * contentScaleFactor > _context.maxBackBufferHeight) - { - contentScaleFactor = 1.0; - } - - _stage3D.x = viewPort.x; - _stage3D.y = viewPort.y; - - _context.configureBackBuffer(viewPort.width, viewPort.height, - antiAlias, enableDepthAndStencil, contentScaleFactor != 1.0); - } - - _backBufferWidth = viewPort.width; - _backBufferHeight = viewPort.height; - _backBufferScaleFactor = contentScaleFactor; - } - - // program management - - /** Registers a program under a certain name. - * If the name was already used, the previous program is overwritten. */ - public function registerProgram(name:String, program:Program):void - { - deleteProgram(name); - programs[name] = program; - } - - /** Deletes the program of a certain name. */ - public function deleteProgram(name:String):void - { - var program:Program = getProgram(name); - if (program) - { - program.dispose(); - delete programs[name]; - } - } - - /** Returns the program registered under a certain name, or null if no program with - * this name has been registered. */ - public function getProgram(name:String):Program - { - return programs[name] as Program; - } - - /** Indicates if a program is registered under a certain name. */ - public function hasProgram(name:String):Boolean - { - return name in programs; - } - - // state stack - - /** Pushes the current render state to a stack from which it can be restored later. - * - *

If you pass a BatchToken, it will be updated to point to the current location within - * the render cache. That way, you can later reference this location to render a subset of - * the cache.

- */ - public function pushState(token:BatchToken=null):void - { - _stateStackPos++; - - if (_stateStackLength < _stateStackPos + 1) _stateStack[_stateStackLength++] = new RenderState(); - if (token) _batchProcessor.fillToken(token); - - _stateStack[_stateStackPos].copyFrom(_state); - } - - /** Modifies the current state with a transformation matrix, alpha factor, and blend mode. - * - * @param transformationMatrix Used to transform the current modelviewMatrix. - * @param alphaFactor Multiplied with the current alpha value. - * @param blendMode Replaces the current blend mode; except for "auto", which - * means the current value remains unchanged. - */ - public function setStateTo(transformationMatrix:Matrix, alphaFactor:Number=1.0, - blendMode:String="auto"):void - { - if (transformationMatrix) MatrixUtil.prependMatrix(_state._modelviewMatrix, transformationMatrix); - if (alphaFactor != 1.0) _state._alpha *= alphaFactor; - if (blendMode != BlendMode.AUTO) _state.blendMode = blendMode; - } - - /** Restores the render state that was last pushed to the stack. If this changes - * blend mode, clipping rectangle, render target or culling, the current batch - * will be drawn right away. - * - *

If you pass a BatchToken, it will be updated to point to the current location within - * the render cache. That way, you can later reference this location to render a subset of - * the cache.

- */ - public function popState(token:BatchToken=null):void - { - if (_stateStackPos < 0) - throw new IllegalOperationError("Cannot pop empty state stack"); - - _state.copyFrom(_stateStack[_stateStackPos]); // -> might cause 'finishMeshBatch' - _stateStackPos--; - - if (token) _batchProcessor.fillToken(token); - } - - // masks - - /** Draws a display object into the stencil buffer, incrementing the buffer on each - * used pixel. The stencil reference value is incremented as well; thus, any subsequent - * stencil tests outside of this area will fail. - * - *

If 'mask' is part of the display list, it will be drawn at its conventional stage - * coordinates. Otherwise, it will be drawn with the current modelview matrix.

- * - *

As an optimization, this method might update the clipping rectangle of the render - * state instead of utilizing the stencil buffer. This is possible when the mask object - * is of type starling.display.Quad and is aligned parallel to the stage - * axes.

- * - *

Note that masking breaks the render cache; the masked object must be redrawn anew - * in the next frame. If you pass maskee, the method will automatically - * call excludeFromCache(maskee) for you.

- */ - public function drawMask(mask:DisplayObject, maskee:DisplayObject=null):void - { - if (_context == null) return; - - finishMeshBatch(); - - if (isRectangularMask(mask, maskee, sMatrix)) - { - mask.getBounds(mask, sClipRect); - RectangleUtil.getBounds(sClipRect, sMatrix, sClipRect); - pushClipRect(sClipRect); - } - else - { - _context.setStencilActions(Context3DTriangleFace.FRONT_AND_BACK, - Context3DCompareMode.EQUAL, Context3DStencilAction.INCREMENT_SATURATE); - - renderMask(mask); - stencilReferenceValue++; - - _context.setStencilActions(Context3DTriangleFace.FRONT_AND_BACK, - Context3DCompareMode.EQUAL, Context3DStencilAction.KEEP); - } - - excludeFromCache(maskee); - } - - /** Draws a display object into the stencil buffer, decrementing the - * buffer on each used pixel. This effectively erases the object from the stencil buffer, - * restoring the previous state. The stencil reference value will be decremented. - * - *

Note: if the mask object meets the requirements of using the clipping rectangle, - * it will be assumed that this erase operation undoes the clipping rectangle change - * caused by the corresponding drawMask() call.

- */ - public function eraseMask(mask:DisplayObject, maskee:DisplayObject=null):void - { - if (_context == null) return; - - finishMeshBatch(); - - if (isRectangularMask(mask, maskee, sMatrix)) - { - popClipRect(); - } - else - { - _context.setStencilActions(Context3DTriangleFace.FRONT_AND_BACK, - Context3DCompareMode.EQUAL, Context3DStencilAction.DECREMENT_SATURATE); - - renderMask(mask); - stencilReferenceValue--; - - _context.setStencilActions(Context3DTriangleFace.FRONT_AND_BACK, - Context3DCompareMode.EQUAL, Context3DStencilAction.KEEP); - } - } - - private function renderMask(mask:DisplayObject):void - { - var wasCacheEnabled:Boolean = cacheEnabled; - - pushState(); - cacheEnabled = false; - _state.alpha = 0.0; - - var matrix:Matrix = null; - var matrix3D:Matrix3D = null; - - if (mask.stage) - { - _state.setModelviewMatricesToIdentity(); - - if (mask.is3D) matrix3D = mask.getTransformationMatrix3D(null, sMatrix3D); - else matrix = mask.getTransformationMatrix(null, sMatrix); - } - else - { - if (mask.is3D) matrix3D = mask.transformationMatrix3D; - else matrix = mask.transformationMatrix; - } - - if (matrix3D) _state.transformModelviewMatrix3D(matrix3D); - else _state.transformModelviewMatrix(matrix); - - mask.render(this); - finishMeshBatch(); - - cacheEnabled = wasCacheEnabled; - popState(); - } - - private function pushClipRect(clipRect:Rectangle):void - { - var stack:Vector. = _clipRectStack; - var stackLength:uint = stack.length; - var intersection:Rectangle = Pool.getRectangle(); - - if (stackLength) - RectangleUtil.intersect(stack[stackLength - 1], clipRect, intersection); - else - intersection.copyFrom(clipRect); - - stack[stackLength] = intersection; - _state.clipRect = intersection; - } - - private function popClipRect():void - { - var stack:Vector. = _clipRectStack; - var stackLength:uint = stack.length; - - if (stackLength == 0) - throw new Error("Trying to pop from empty clip rectangle stack"); - - stackLength--; - Pool.putRectangle(stack.pop()); - _state.clipRect = stackLength ? stack[stackLength - 1] : null; - } - - /** Figures out if the mask can be represented by a scissor rectangle; this is possible - * if it's just a simple (untextured) quad that is parallel to the stage axes. The 'out' - * parameter will be filled with the transformation matrix required to move the mask into - * stage coordinates. */ - private function isRectangularMask(mask:DisplayObject, maskee:DisplayObject, out:Matrix):Boolean - { - var quad:Quad = mask as Quad; - var is3D:Boolean = mask.is3D || (maskee && maskee.is3D && mask.stage == null); - - if (quad && !is3D && quad.texture == null) - { - if (mask.stage) mask.getTransformationMatrix(null, out); - else - { - out.copyFrom(mask.transformationMatrix); - out.concat(_state.modelviewMatrix); - } - - return (MathUtil.isEquivalent(out.a, 0) && MathUtil.isEquivalent(out.d, 0)) || - (MathUtil.isEquivalent(out.b, 0) && MathUtil.isEquivalent(out.c, 0)); - } - return false; - } - - // mesh rendering - - /** Adds a mesh to the current batch of unrendered meshes. If the current batch is not - * compatible with the mesh, all previous meshes are rendered at once and the batch - * is cleared. - * - * @param mesh The mesh to batch. - * @param subset The range of vertices to be batched. If null, the complete - * mesh will be used. - */ - public function batchMesh(mesh:Mesh, subset:MeshSubset=null):void - { - _batchProcessor.addMesh(mesh, _state, subset); - } - - /** Finishes the current mesh batch and prepares the next one. */ - public function finishMeshBatch():void - { - _batchProcessor.finishBatch(); - } - - /** Completes all unfinished batches, cleanup procedures. */ - public function finishFrame():void - { - if (_frameID % 99 == 0) _batchProcessorCurr.trim(); // odd number -> alternating processors - if (_frameID % 150 == 0) _batchProcessorSpec.trim(); - - _batchProcessor.finishBatch(); - _batchProcessor = _batchProcessorSpec; // no cache between frames - processCacheExclusions(); - } - - private function processCacheExclusions():void - { - var i:int, length:int = _batchCacheExclusions.length; - for (i=0; istartToken and - * (but not including) endToken. The render cache contains all meshes - * rendered in the previous frame. */ - public function drawFromCache(startToken:BatchToken, endToken:BatchToken):void - { - var meshBatch:MeshBatch; - var subset:MeshSubset = sMeshSubset; - - if (!startToken.equals(endToken)) - { - pushState(); - - for (var i:int = startToken.batchID; i <= endToken.batchID; ++i) - { - meshBatch = _batchProcessorPrev.getBatchAt(i); - subset.setTo(); // resets subset - - if (i == startToken.batchID) - { - subset.vertexID = startToken.vertexID; - subset.indexID = startToken.indexID; - subset.numVertices = meshBatch.numVertices - subset.vertexID; - subset.numIndices = meshBatch.numIndices - subset.indexID; - } - - if (i == endToken.batchID) - { - subset.numVertices = endToken.vertexID - subset.vertexID; - subset.numIndices = endToken.indexID - subset.indexID; - } - - if (subset.numVertices) - { - _state.alpha = 1.0; - _state.blendMode = meshBatch.blendMode; - _batchProcessor.addMesh(meshBatch, _state, subset, true); - } - } - - popState(); - } - } - - /** Prevents the object from being drawn from the render cache in the next frame. - * Different to setRequiresRedraw(), this does not indicate that the object - * has changed in any way, but just that it doesn't support being drawn from cache. - * - *

Note that when a container is excluded from the render cache, its children will - * still be cached! This just means that batching is interrupted at this object when - * the display tree is traversed.

- */ - public function excludeFromCache(object:DisplayObject):void - { - if (object) _batchCacheExclusions[_batchCacheExclusions.length] = object; - } - - private function drawBatch(meshBatch:MeshBatch):void - { - pushState(); - - state.blendMode = meshBatch.blendMode; - state.modelviewMatrix.identity(); - state.alpha = 1.0; - - meshBatch.render(this); - - popState(); - } - - // helper methods - - /** Applies all relevant state settings to at the render context. This includes - * blend mode, render target and clipping rectangle. Always call this method before - * context.drawTriangles(). - */ - public function prepareToDraw():void - { - applyBlendMode(); - applyRenderTarget(); - applyClipRect(); - applyCulling(); - } - - /** Clears the render context with a certain color and alpha value. Since this also - * clears the stencil buffer, the stencil reference value is also reset to '0'. */ - public function clear(rgb:uint=0, alpha:Number=0.0):void - { - applyRenderTarget(); - stencilReferenceValue = 0; - RenderUtil.clear(rgb, alpha); - } - - /** Resets the render target to the back buffer and displays its contents. */ - public function present():void - { - _state.renderTarget = null; - _actualRenderTarget = null; - _context.present(); - } - - private function applyBlendMode():void - { - var blendMode:String = _state.blendMode; - - if (blendMode != _actualBlendMode) - { - BlendMode.get(_state.blendMode).activate(); - _actualBlendMode = blendMode; - } - } - - private function applyCulling():void - { - var culling:String = _state.culling; - - if (culling != _actualCulling) - { - _context.setCulling(culling); - _actualCulling = culling; - } - } - - private function applyRenderTarget():void - { - var target:TextureBase = _state.renderTargetBase; - - if (target != _actualRenderTarget) - { - if (target) - { - var antiAlias:int = _state.renderTargetAntiAlias; - var depthAndStencil:Boolean = _state.renderTargetSupportsDepthAndStencil; - _context.setRenderToTexture(target, depthAndStencil, antiAlias); - } - else - _context.setRenderToBackBuffer(); - - _context.setStencilReferenceValue(stencilReferenceValue); - _actualRenderTarget = target; - } - } - - private function applyClipRect():void - { - var clipRect:Rectangle = _state.clipRect; - - if (clipRect) - { - var width:int, height:int; - var projMatrix:Matrix3D = _state.projectionMatrix3D; - var renderTarget:Texture = _state.renderTarget; - - if (renderTarget) - { - width = renderTarget.root.nativeWidth; - height = renderTarget.root.nativeHeight; - } - else - { - width = _backBufferWidth; - height = _backBufferHeight; - } - - // convert to pixel coordinates (matrix transformation ends up in range [-1, 1]) - MatrixUtil.transformCoords3D(projMatrix, clipRect.x, clipRect.y, 0.0, sPoint3D); - sPoint3D.project(); // eliminate w-coordinate - sClipRect.x = (sPoint3D.x * 0.5 + 0.5) * width; - sClipRect.y = (0.5 - sPoint3D.y * 0.5) * height; - - MatrixUtil.transformCoords3D(projMatrix, clipRect.right, clipRect.bottom, 0.0, sPoint3D); - sPoint3D.project(); // eliminate w-coordinate - sClipRect.right = (sPoint3D.x * 0.5 + 0.5) * width; - sClipRect.bottom = (0.5 - sPoint3D.y * 0.5) * height; - - sBufferRect.setTo(0, 0, width, height); - RectangleUtil.intersect(sClipRect, sBufferRect, sScissorRect); - - // an empty rectangle is not allowed, so we set it to the smallest possible size - if (sScissorRect.width < 1 || sScissorRect.height < 1) - sScissorRect.setTo(0, 0, 1, 1); - - _context.setScissorRectangle(sScissorRect); - } - else - { - _context.setScissorRectangle(null); - } - } - - // properties - - /** Indicates the number of stage3D draw calls. */ - public function get drawCount():int { return _drawCount; } - public function set drawCount(value:int):void { _drawCount = value; } - - /** The current stencil reference value of the active render target. This value - * is typically incremented when drawing a mask and decrementing when erasing it. - * The painter keeps track of one stencil reference value per render target. - * Only change this value if you know what you're doing! - */ - public function get stencilReferenceValue():uint - { - var key:Object = _state.renderTarget ? _state.renderTargetBase : this; - if (key in _stencilReferenceValues) return _stencilReferenceValues[key]; - else return 0; - } - - public function set stencilReferenceValue(value:uint):void - { - var key:Object = _state.renderTarget ? _state.renderTargetBase : this; - _stencilReferenceValues[key] = value; - - if (contextValid) - _context.setStencilReferenceValue(value); - } - - /** Indicates if the render cache is enabled. Normally, this should be left at the default; - * however, some custom rendering logic might require to change this property temporarily. - * Also note that the cache is automatically reactivated each frame, right before the - * render process. - * - * @default true - */ - public function get cacheEnabled():Boolean { return _batchProcessor == _batchProcessorCurr; } - public function set cacheEnabled(value:Boolean):void - { - if (value != cacheEnabled) - { - finishMeshBatch(); - - if (value) _batchProcessor = _batchProcessorCurr; - else _batchProcessor = _batchProcessorSpec; - } - } - - /** The current render state, containing some of the context settings, projection- and - * modelview-matrix, etc. Always returns the same instance, even after calls to "pushState" - * and "popState". - * - *

When you change the current RenderState, and this change is not compatible with - * the current render batch, the batch will be concluded right away. Thus, watch out - * for changes of blend mode, clipping rectangle, render target or culling.

- */ - public function get state():RenderState { return _state; } - - /** The Stage3D instance this painter renders into. */ - public function get stage3D():Stage3D { return _stage3D; } - - /** The Context3D instance this painter renders into. */ - public function get context():Context3D { return _context; } - - /** Returns the index of the current frame if the render cache is enabled; - * otherwise, returns zero. To get the frameID regardless of the render cache, call - * Starling.frameID instead. */ - public function set frameID(value:uint):void { _frameID = value; } - public function get frameID():uint - { - return _batchProcessor == _batchProcessorCurr ? _frameID : 0; - } - - /** The size (in points) that represents one pixel in the back buffer. */ - public function get pixelSize():Number { return _pixelSize; } - public function set pixelSize(value:Number):void { _pixelSize = value; } - - /** Indicates if another Starling instance (or another Stage3D framework altogether) - * uses the same render context. @default false */ - public function get shareContext():Boolean { return _shareContext; } - public function set shareContext(value:Boolean):void { _shareContext = value; } - - /** Indicates if Stage3D render methods will report errors. Activate only when needed, - * as this has a negative impact on performance. @default false */ - public function get enableErrorChecking():Boolean { return _enableErrorChecking; } - public function set enableErrorChecking(value:Boolean):void - { - _enableErrorChecking = value; - if (_context) _context.enableErrorChecking = value; - } - - /** Returns the current width of the back buffer. In most cases, this value is in pixels; - * however, if the app is running on an HiDPI display with an activated - * 'supportHighResolutions' setting, you have to multiply with 'backBufferPixelsPerPoint' - * for the actual pixel count. Alternatively, use the Context3D-property with the - * same name: it will return the exact pixel values. */ - public function get backBufferWidth():int { return _backBufferWidth; } - - /** Returns the current height of the back buffer. In most cases, this value is in pixels; - * however, if the app is running on an HiDPI display with an activated - * 'supportHighResolutions' setting, you have to multiply with 'backBufferPixelsPerPoint' - * for the actual pixel count. Alternatively, use the Context3D-property with the - * same name: it will return the exact pixel values. */ - public function get backBufferHeight():int { return _backBufferHeight; } - - /** The number of pixels per point returned by the 'backBufferWidth/Height' properties. - * Except for desktop HiDPI displays with an activated 'supportHighResolutions' setting, - * this will always return '1'. */ - public function get backBufferScaleFactor():Number { return _backBufferScaleFactor; } - - /** Indicates if the Context3D object is currently valid (i.e. it hasn't been lost or - * disposed). */ - public function get contextValid():Boolean - { - if (_context) - { - const driverInfo:String = _context.driverInfo; - return driverInfo != null && driverInfo != "" && driverInfo != "Disposed"; - } - else return false; - } - - /** The Context3D profile of the current render context, or null - * if the context has not been created yet. */ - public function get profile():String - { - if (_context) return _context.profile; - else return null; - } - - /** A dictionary that can be used to save custom data related to the render context. - * If you need to share data that is bound to the render context (e.g. textures), use - * this dictionary instead of creating a static class variable. That way, the data will - * be available for all Starling instances that use this stage3D / context. */ - public function get sharedData():Dictionary - { - var data:Dictionary = sSharedData[stage3D] as Dictionary; - if (data == null) - { - data = new Dictionary(); - sSharedData[stage3D] = data; - } - return data; - } - - private function get programs():Dictionary - { - var programs:Dictionary = sharedData[PROGRAM_DATA_NAME] as Dictionary; - if (programs == null) - { - programs = new Dictionary(); - sharedData[PROGRAM_DATA_NAME] = programs; - } - return programs; - } - } -} \ No newline at end of file diff --git a/mobile_version/src/starling/rendering/Program.as b/mobile_version/src/starling/rendering/Program.as deleted file mode 100644 index 0f0e0792..00000000 --- a/mobile_version/src/starling/rendering/Program.as +++ /dev/null @@ -1,104 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= - -package starling.rendering -{ - import com.adobe.utils.AGALMiniAssembler; - - import flash.display3D.Context3D; - import flash.display3D.Context3DProgramType; - import flash.display3D.Program3D; - import flash.events.Event; - import flash.utils.ByteArray; - - import starling.core.Starling; - import starling.errors.MissingContextError; - - /** A Program represents a pair of a fragment- and vertex-shader. - * - *

This class is a convenient replacement for Stage3Ds "Program3D" class. Its main - * advantage is that it survives a context loss; furthermore, it makes it simple to - * create a program from AGAL source without having to deal with the assembler.

- * - *

It is recommended to store programs in Starling's "Painter" instance via the methods - * registerProgram and getProgram. That way, your programs may - * be shared among different display objects or even Starling instances.

- * - * @see Painter - */ - public class Program - { - private var _vertexShader:ByteArray; - private var _fragmentShader:ByteArray; - private var _program3D:Program3D; - - private static var sAssembler:AGALMiniAssembler = new AGALMiniAssembler(); - - /** Creates a program from the given AGAL (Adobe Graphics Assembly Language) bytecode. */ - public function Program(vertexShader:ByteArray, fragmentShader:ByteArray) - { - _vertexShader = vertexShader; - _fragmentShader = fragmentShader; - - // Handle lost context (using conventional Flash event for weak listener support) - Starling.current.stage3D.addEventListener(Event.CONTEXT3D_CREATE, - onContextCreated, false, 30, true); - } - - /** Disposes the internal Program3D instance. */ - public function dispose():void - { - Starling.current.stage3D.removeEventListener(Event.CONTEXT3D_CREATE, onContextCreated); - disposeProgram(); - } - - /** Creates a new Program instance from AGAL assembly language. */ - public static function fromSource(vertexShader:String, fragmentShader:String, - agalVersion:uint=1):Program - { - return new Program( - sAssembler.assemble(Context3DProgramType.VERTEX, vertexShader, agalVersion), - sAssembler.assemble(Context3DProgramType.FRAGMENT, fragmentShader, agalVersion)); - } - - /** Activates the program on the given context. If you don't pass a context, the current - * Starling context will be used. */ - public function activate(context:Context3D=null):void - { - if (context == null) - { - context = Starling.context; - if (context == null) throw new MissingContextError(); - } - - if (_program3D == null) - { - _program3D = context.createProgram(); - _program3D.upload(_vertexShader, _fragmentShader); - } - - context.setProgram(_program3D); - } - - private function onContextCreated(event:Event):void - { - disposeProgram(); - } - - private function disposeProgram():void - { - if (_program3D) - { - _program3D.dispose(); - _program3D = null; - } - } - } -} diff --git a/mobile_version/src/starling/rendering/RenderState.as b/mobile_version/src/starling/rendering/RenderState.as deleted file mode 100644 index b09d6dd0..00000000 --- a/mobile_version/src/starling/rendering/RenderState.as +++ /dev/null @@ -1,400 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= - -package starling.rendering -{ - import flash.display3D.Context3DTriangleFace; - import flash.display3D.textures.TextureBase; - import flash.geom.Matrix; - import flash.geom.Matrix3D; - import flash.geom.Rectangle; - import flash.geom.Vector3D; - - import starling.display.BlendMode; - import starling.textures.Texture; - import starling.utils.MathUtil; - import starling.utils.MatrixUtil; - import starling.utils.Pool; - import starling.utils.RectangleUtil; - - /** The RenderState stores a combination of settings that are currently used for rendering. - * This includes modelview and transformation matrices as well as context3D related settings. - * - *

Starling's Painter instance stores a reference to the current RenderState. - * Via a stack mechanism, you can always save a specific state and restore it later. - * That makes it easy to write rendering code that doesn't have any side effects.

- * - *

Beware that any context-related settings are not applied on the context - * right away, but only after calling painter.prepareToDraw(). - * However, the Painter recognizes changes to those settings and will finish the current - * batch right away if necessary.

- * - * Matrix Magic - * - *

On rendering, Starling traverses the display tree, constantly moving from one - * coordinate system to the next. Each display object stores its vertex coordinates - * in its local coordinate system; on rendering, they must be moved to a global, - * 2D coordinate space (the so-called "clip-space"). To handle these calculations, - * the RenderState contains a set of matrices.

- * - *

By multiplying vertex coordinates with the modelviewMatrix, you'll get the - * coordinates in "screen-space", or in other words: in stage coordinates. (Optionally, - * there's also a 3D version of this matrix. It comes into play when you're working with - * Sprite3D containers.)

- * - *

By feeding the result of the previous transformation into the - * projectionMatrix, you'll end up with so-called "clipping coordinates", - * which are in the range [-1, 1] (just as needed by the graphics pipeline). - * If you've got vertices in the 3D space, this matrix will also execute a perspective - * projection.

- * - *

Finally, there's the mvpMatrix, which is short for - * "modelviewProjectionMatrix". This is simply a combination of modelview- and - * projectionMatrix, combining the effects of both. Pass this matrix - * to the vertex shader and all your vertices will automatically end up at the right - * position.

- * - * @see Painter - * @see starling.display.Sprite3D - */ - public class RenderState - { - /** @private */ internal var _alpha:Number; - /** @private */ internal var _blendMode:String; - /** @private */ internal var _modelviewMatrix:Matrix; - - private static const CULLING_VALUES:Vector. = new - [Context3DTriangleFace.NONE, Context3DTriangleFace.FRONT, - Context3DTriangleFace.BACK, Context3DTriangleFace.FRONT_AND_BACK]; - - private var _miscOptions:uint; - private var _clipRect:Rectangle; - private var _renderTarget:Texture; - private var _onDrawRequired:Function; - private var _modelviewMatrix3D:Matrix3D; - private var _projectionMatrix3D:Matrix3D; - private var _projectionMatrix3DRev:uint; - private var _mvpMatrix3D:Matrix3D; - - // helper objects - private static var sMatrix3D:Matrix3D = new Matrix3D(); - private static var sProjectionMatrix3DRev:uint = 0; - - /** Creates a new render state with the default settings. */ - public function RenderState() - { - reset(); - } - - /** Duplicates all properties of another instance on the current instance. */ - public function copyFrom(renderState:RenderState):void - { - if (_onDrawRequired != null) - { - var currentTarget:TextureBase = _renderTarget ? _renderTarget.base : null; - var nextTarget:TextureBase = renderState._renderTarget ? renderState._renderTarget.base : null; - var cullingChanges:Boolean = (_miscOptions & 0xf00) != (renderState._miscOptions & 0xf00); - var clipRectChanges:Boolean = _clipRect || renderState._clipRect ? - !RectangleUtil.compare(_clipRect, renderState._clipRect) : false; - - if (_blendMode != renderState._blendMode || - currentTarget != nextTarget || clipRectChanges || cullingChanges) - { - _onDrawRequired(); - } - } - - _alpha = renderState._alpha; - _blendMode = renderState._blendMode; - _renderTarget = renderState._renderTarget; - _miscOptions = renderState._miscOptions; - _modelviewMatrix.copyFrom(renderState._modelviewMatrix); - - if (_projectionMatrix3DRev != renderState._projectionMatrix3DRev) - { - _projectionMatrix3DRev = renderState._projectionMatrix3DRev; - _projectionMatrix3D.copyFrom(renderState._projectionMatrix3D); - } - - if (_modelviewMatrix3D || renderState._modelviewMatrix3D) - this.modelviewMatrix3D = renderState._modelviewMatrix3D; - - if (_clipRect || renderState._clipRect) - this.clipRect = renderState._clipRect; - } - - /** Resets the RenderState to the default settings. - * (Check each property documentation for its default value.) */ - public function reset():void - { - this.alpha = 1.0; - this.blendMode = BlendMode.NORMAL; - this.culling = Context3DTriangleFace.NONE; - this.modelviewMatrix3D = null; - this.renderTarget = null; - this.clipRect = null; - _projectionMatrix3DRev = 0; - - if (_modelviewMatrix) _modelviewMatrix.identity(); - else _modelviewMatrix = new Matrix(); - - if (_projectionMatrix3D) _projectionMatrix3D.identity(); - else _projectionMatrix3D = new Matrix3D(); - - if (_mvpMatrix3D == null) _mvpMatrix3D = new Matrix3D(); - } - - // matrix methods / properties - - /** Prepends the given matrix to the 2D modelview matrix. */ - public function transformModelviewMatrix(matrix:Matrix):void - { - MatrixUtil.prependMatrix(_modelviewMatrix, matrix); - } - - /** Prepends the given matrix to the 3D modelview matrix. - * The current contents of the 2D modelview matrix is stored in the 3D modelview matrix - * before doing so; the 2D modelview matrix is then reset to the identity matrix. - */ - public function transformModelviewMatrix3D(matrix:Matrix3D):void - { - if (_modelviewMatrix3D == null) - _modelviewMatrix3D = Pool.getMatrix3D(); - - _modelviewMatrix3D.prepend(MatrixUtil.convertTo3D(_modelviewMatrix, sMatrix3D)); - _modelviewMatrix3D.prepend(matrix); - _modelviewMatrix.identity(); - } - - /** Creates a perspective projection matrix suitable for 2D and 3D rendering. - * - *

The first 4 parameters define which area of the stage you want to view (the camera - * will 'zoom' to exactly this region). The final 3 parameters determine the perspective - * in which you're looking at the stage.

- * - *

The stage is always on the rectangle that is spawned up between x- and y-axis (with - * the given size). All objects that are exactly on that rectangle (z equals zero) will be - * rendered in their true size, without any distortion.

- * - *

If you pass only the first 4 parameters, the camera will be set up above the center - * of the stage, with a field of view of 1.0 rad.

- */ - public function setProjectionMatrix(x:Number, y:Number, width:Number, height:Number, - stageWidth:Number=0, stageHeight:Number=0, - cameraPos:Vector3D=null):void - { - _projectionMatrix3DRev = ++sProjectionMatrix3DRev; - MatrixUtil.createPerspectiveProjectionMatrix( - x, y, width, height, stageWidth, stageHeight, cameraPos, _projectionMatrix3D); - } - - /** This method needs to be called whenever projectionMatrix3D was changed - * other than via setProjectionMatrix. - */ - public function setProjectionMatrixChanged():void - { - _projectionMatrix3DRev = ++sProjectionMatrix3DRev; - } - - /** Changes the modelview matrices (2D and, if available, 3D) to identity matrices. - * An object transformed an identity matrix performs no transformation. - */ - public function setModelviewMatricesToIdentity():void - { - _modelviewMatrix.identity(); - if (_modelviewMatrix3D) _modelviewMatrix3D.identity(); - } - - /** Returns the current 2D modelview matrix. - * CAUTION: Use with care! Each call returns the same instance. - * @default identity matrix */ - public function get modelviewMatrix():Matrix { return _modelviewMatrix; } - public function set modelviewMatrix(value:Matrix):void { _modelviewMatrix.copyFrom(value); } - - /** Returns the current 3D modelview matrix, if there have been 3D transformations. - * CAUTION: Use with care! Each call returns the same instance. - * @default null */ - public function get modelviewMatrix3D():Matrix3D { return _modelviewMatrix3D; } - public function set modelviewMatrix3D(value:Matrix3D):void - { - if (value) - { - if (_modelviewMatrix3D == null) _modelviewMatrix3D = Pool.getMatrix3D(false); - _modelviewMatrix3D.copyFrom(value); - } - else if (_modelviewMatrix3D) - { - Pool.putMatrix3D(_modelviewMatrix3D); - _modelviewMatrix3D = null; - } - } - - /** Returns the current projection matrix. You can use the method 'setProjectionMatrix3D' - * to set it up in an intuitive way. - * CAUTION: Use with care! Each call returns the same instance. If you modify the matrix - * in place, you have to call setProjectionMatrixChanged. - * @default identity matrix */ - public function get projectionMatrix3D():Matrix3D { return _projectionMatrix3D; } - public function set projectionMatrix3D(value:Matrix3D):void - { - setProjectionMatrixChanged(); - _projectionMatrix3D.copyFrom(value); - } - - /** Calculates the product of modelview and projection matrix and stores it in a 3D matrix. - * CAUTION: Use with care! Each call returns the same instance. */ - public function get mvpMatrix3D():Matrix3D - { - _mvpMatrix3D.copyFrom(_projectionMatrix3D); - if (_modelviewMatrix3D) _mvpMatrix3D.prepend(_modelviewMatrix3D); - _mvpMatrix3D.prepend(MatrixUtil.convertTo3D(_modelviewMatrix, sMatrix3D)); - return _mvpMatrix3D; - } - - // other methods - - /** Changes the the current render target. - * - * @param target Either a texture or null to render into the back buffer. - * @param enableDepthAndStencil Indicates if depth and stencil testing will be available. - * This parameter affects only texture targets. - * @param antiAlias The anti-aliasing quality (range: 0 - 16). - * This parameter affects only texture targets. Note that at the time - * of this writing, AIR supports anti-aliasing only on Desktop. - */ - public function setRenderTarget(target:Texture, enableDepthAndStencil:Boolean=true, - antiAlias:int=0):void - { - var currentTarget:TextureBase = _renderTarget ? _renderTarget.base : null; - var newTarget:TextureBase = target ? target.base : null; - var newOptions:uint = MathUtil.min(antiAlias, 16) | uint(enableDepthAndStencil) << 4; - var optionsChange:Boolean = newOptions != (_miscOptions & 0xff); - - if (currentTarget != newTarget || optionsChange) - { - if (_onDrawRequired != null) _onDrawRequired(); - - _renderTarget = target; - _miscOptions = (_miscOptions & 0xffffff00) | newOptions; - } - } - - // other properties - - /** The current, cumulated alpha value. Beware that, in a standard 'render' method, - * this already includes the current object! The value is the product of current object's - * alpha value and all its parents. @default 1.0 - */ - public function get alpha():Number { return _alpha; } - public function set alpha(value:Number):void { _alpha = value; } - - /** The blend mode to be used on rendering. A value of "auto" is ignored, since it - * means that the mode should remain unchanged. - * - * @default BlendMode.NORMAL - * @see starling.display.BlendMode - */ - public function get blendMode():String { return _blendMode; } - public function set blendMode(value:String):void - { - if (value != BlendMode.AUTO && _blendMode != value) - { - if (_onDrawRequired != null) _onDrawRequired(); - _blendMode = value; - } - } - - /** The texture that is currently being rendered into, or null - * to render into the back buffer. On assignment, calls setRenderTarget - * with its default parameters. */ - public function get renderTarget():Texture { return _renderTarget; } - public function set renderTarget(value:Texture):void { setRenderTarget(value); } - - /** @private */ - internal function get renderTargetBase():TextureBase - { - return _renderTarget ? _renderTarget.base : null; - } - - /** Sets the triangle culling mode. Allows to exclude triangles from rendering based on - * their orientation relative to the view plane. - * @default Context3DTriangleFace.NONE - */ - public function get culling():String - { - var index:int = (_miscOptions & 0xf00) >> 8; - return CULLING_VALUES[index]; - } - - public function set culling(value:String):void - { - if (this.culling != value) - { - if (_onDrawRequired != null) _onDrawRequired(); - - var index:int = CULLING_VALUES.indexOf(value); - if (index == -1) throw new ArgumentError("Invalid culling mode"); - - _miscOptions = (_miscOptions & 0xfffff0ff) | (index << 8); - } - } - - /** The clipping rectangle can be used to limit rendering in the current render target to - * a certain area. This method expects the rectangle in stage coordinates. To prevent - * any clipping, assign null. - * - * @default null - */ - public function get clipRect():Rectangle { return _clipRect; } - public function set clipRect(value:Rectangle):void - { - if (!RectangleUtil.compare(_clipRect, value)) - { - if (_onDrawRequired != null) _onDrawRequired(); - if (value) - { - if (_clipRect == null) _clipRect = Pool.getRectangle(); - _clipRect.copyFrom(value); - } - else if (_clipRect) - { - Pool.putRectangle(_clipRect); - _clipRect = null; - } - } - } - - /** The anti-alias setting used when setting the current render target - * via setRenderTarget. */ - public function get renderTargetAntiAlias():int - { - return _miscOptions & 0xf; - } - - /** Indicates if the render target (set via setRenderTarget) - * has its depth and stencil buffers enabled. */ - public function get renderTargetSupportsDepthAndStencil():Boolean - { - return (_miscOptions & 0xf0) != 0; - } - - /** Indicates if there have been any 3D transformations. - * Returns true if the 3D modelview matrix contains a value. */ - public function get is3D():Boolean { return _modelviewMatrix3D != null; } - - /** @private - * - * This callback is executed whenever a state change requires a draw operation. - * This is the case if blend mode, render target, culling or clipping rectangle - * are changing. */ - internal function get onDrawRequired():Function { return _onDrawRequired; } - internal function set onDrawRequired(value:Function):void { _onDrawRequired = value; } - } -} diff --git a/mobile_version/src/starling/rendering/VertexData.as b/mobile_version/src/starling/rendering/VertexData.as deleted file mode 100644 index ec2c2f62..00000000 --- a/mobile_version/src/starling/rendering/VertexData.as +++ /dev/null @@ -1,1129 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= - -package starling.rendering -{ - import flash.display3D.Context3D; - import flash.display3D.VertexBuffer3D; - import flash.errors.IllegalOperationError; - import flash.geom.Matrix; - import flash.geom.Matrix3D; - import flash.geom.Point; - import flash.geom.Rectangle; - import flash.geom.Vector3D; - import flash.utils.ByteArray; - import flash.utils.Endian; - - import starling.core.Starling; - import starling.errors.MissingContextError; - import starling.styles.MeshStyle; - import starling.utils.MathUtil; - import starling.utils.MatrixUtil; - import starling.utils.StringUtil; - - /** The VertexData class manages a raw list of vertex information, allowing direct upload - * to Stage3D vertex buffers. You only have to work with this class if you're writing - * your own rendering code (e.g. if you create custom display objects). - * - *

To render objects with Stage3D, you have to organize vertices and indices in so-called - * vertex- and index-buffers. Vertex buffers store the coordinates of the vertices that make - * up an object; index buffers reference those vertices to determine which vertices spawn - * up triangles. Those buffers reside in graphics memory and can be accessed very - * efficiently by the GPU.

- * - *

Before you can move data into the buffers, you have to set it up in conventional - * memory — that is, in a Vector or a ByteArray. Since it's quite cumbersome to manually - * create and manipulate those data structures, the IndexData and VertexData classes provide - * a simple way to do just that. The data is stored sequentially (one vertex or index after - * the other) so that it can easily be uploaded to a buffer.

- * - * Vertex Format - * - *

The VertexData class requires a custom format string on initialization, or an instance - * of the VertexDataFormat class. Here is an example:

- * - * - * vertexData = new VertexData("position:float2, color:bytes4"); - * vertexData.setPoint(0, "position", 320, 480); - * vertexData.setColor(0, "color", 0xff00ff); - * - *

This instance is set up with two attributes: "position" and "color". The keywords - * after the colons depict the format and size of the data that each property uses; in this - * case, we store two floats for the position (for the x- and y-coordinates) and four - * bytes for the color. Please refer to the VertexDataFormat documentation for details.

- * - *

The attribute names are then used to read and write data to the respective positions - * inside a vertex. Furthermore, they come in handy when copying data from one VertexData - * instance to another: attributes with equal name and data format may be transferred between - * different VertexData objects, even when they contain different sets of attributes or have - * a different layout.

- * - * Colors - * - *

Always use the format bytes4 for color data. The color access methods - * expect that format, since it's the most efficient way to store color data. Furthermore, - * you should always include the string "color" (or "Color") in the name of color data; - * that way, it will be recognized as such and will always have its value pre-filled with - * pure white at full opacity.

- * - * Premultiplied Alpha - * - *

Per default, color values are stored with premultiplied alpha values, which - * means that the rgb values were multiplied with the alpha values - * before saving them. You can change this behavior with the premultipliedAlpha - * property.

- * - *

Beware: with premultiplied alpha, the alpha value always affects the resolution of - * the RGB channels. A small alpha value results in a lower accuracy of the other channels, - * and if the alpha value reaches zero, the color information is lost altogether.

- * - * Tinting - * - *

Some low-end hardware is very sensitive when it comes to fragment shader complexity. - * Thus, Starling optimizes shaders for non-tinted meshes. The VertexData class keeps track - * of its tinted-state, at least at a basic level: whenever you change color - * or alpha value of a vertex to something different than white (0xffffff) with - * full alpha (1.0), the tinted property is enabled.

- * - *

However, that value is not entirely accurate: when you restore the color of just a - * range of vertices, or copy just a subset of vertices to another instance, the property - * might wrongfully indicate a tinted mesh. If that's the case, you can either call - * updateTinted() or assign a custom value to the tinted-property. - *

- * - * @see VertexDataFormat - * @see IndexData - */ - public class VertexData - { - private var _rawData:ByteArray; - private var _numVertices:int; - private var _format:VertexDataFormat; - private var _attributes:Vector.; - private var _numAttributes:int; - private var _premultipliedAlpha:Boolean; - private var _tinted:Boolean; - - private var _posOffset:int; // in bytes - private var _colOffset:int; // in bytes - private var _vertexSize:int; // in bytes - - // helper objects - private static var sHelperPoint:Point = new Point(); - private static var sHelperPoint3D:Vector3D = new Vector3D(); - private static var sBytes:ByteArray = new ByteArray(); - - /** Creates an empty VertexData object with the given format and initial capacity. - * - * @param format - * - * Either a VertexDataFormat instance or a String that describes the data format. - * Refer to the VertexDataFormat class for more information. If you don't pass a format, - * the default MeshStyle.VERTEX_FORMAT will be used. - * - * @param initialCapacity - * - * The initial capacity affects just the way the internal ByteArray is allocated, not the - * numIndices value, which will always be zero when the constructor returns. - * The reason for this behavior is the peculiar way in which ByteArrays organize their - * memory: - * - *

The first time you set the length of a ByteArray, it will adhere to that: - * a ByteArray with length 20 will take up 20 bytes (plus some overhead). When you change - * it to a smaller length, it will stick to the original value, e.g. with a length of 10 - * it will still take up 20 bytes. However, now comes the weird part: change it to - * anything above the original length, and it will allocate 4096 bytes!

- * - *

Thus, be sure to always make a generous educated guess, depending on the planned - * usage of your VertexData instances.

- */ - public function VertexData(format:*=null, initialCapacity:int=32) - { - if (format == null) _format = MeshStyle.VERTEX_FORMAT; - else if (format is VertexDataFormat) _format = format; - else if (format is String) _format = VertexDataFormat.fromString(format as String); - else throw new ArgumentError("'format' must be String or VertexDataFormat"); - - _attributes = _format.attributes; - _numAttributes = _attributes.length; - _posOffset = _format.hasAttribute("position") ? _format.getOffset("position") : 0; - _colOffset = _format.hasAttribute("color") ? _format.getOffset("color") : 0; - _vertexSize = _format.vertexSize; - _numVertices = 0; - _premultipliedAlpha = true; - _rawData = new ByteArray(); - _rawData.endian = sBytes.endian = Endian.LITTLE_ENDIAN; - _rawData.length = initialCapacity * _vertexSize; // just for the initial allocation - _rawData.length = 0; // changes length, but not memory! - } - - /** Explicitly frees up the memory used by the ByteArray. */ - public function clear():void - { - _rawData.clear(); - _numVertices = 0; - _tinted = false; - } - - /** Creates a duplicate of the vertex data object. */ - public function clone():VertexData - { - var clone:VertexData = new VertexData(_format, _numVertices); - clone._rawData.writeBytes(_rawData); - clone._numVertices = _numVertices; - clone._premultipliedAlpha = _premultipliedAlpha; - clone._tinted = _tinted; - return clone; - } - - /** Copies the vertex data (or a range of it, defined by 'vertexID' and 'numVertices') - * of this instance to another vertex data object, starting at a certain target index. - * If the target is not big enough, it will be resized to fit all the new vertices. - * - *

If you pass a non-null matrix, the 2D position of each vertex will be transformed - * by that matrix before storing it in the target object. (The position being either an - * attribute with the name "position" or, if such an attribute is not found, the first - * attribute of each vertex. It must consist of two float values containing the x- and - * y-coordinates of the vertex.)

- * - *

Source and target do not need to have the exact same format. Only properties that - * exist in the target will be copied; others will be ignored. If a property with the - * same name but a different format exists in the target, an exception will be raised. - * Beware, though, that the copy-operation becomes much more expensive when the formats - * differ.

- */ - public function copyTo(target:VertexData, targetVertexID:int=0, matrix:Matrix=null, - vertexID:int=0, numVertices:int=-1):void - { - if (numVertices < 0 || vertexID + numVertices > _numVertices) - numVertices = _numVertices - vertexID; - - if (_format === target._format) - { - if (target._numVertices < targetVertexID + numVertices) - target._numVertices = targetVertexID + numVertices; - - target._tinted ||= _tinted; - - // In this case, it's fastest to copy the complete range in one call - // and then overwrite only the transformed positions. - - var targetRawData:ByteArray = target._rawData; - targetRawData.position = targetVertexID * _vertexSize; - targetRawData.writeBytes(_rawData, vertexID * _vertexSize, numVertices * _vertexSize); - - if (matrix) - { - var x:Number, y:Number; - var pos:int = targetVertexID * _vertexSize + _posOffset; - var endPos:int = pos + (numVertices * _vertexSize); - - while (pos < endPos) - { - targetRawData.position = pos; - x = targetRawData.readFloat(); - y = targetRawData.readFloat(); - - targetRawData.position = pos; - targetRawData.writeFloat(matrix.a * x + matrix.c * y + matrix.tx); - targetRawData.writeFloat(matrix.d * y + matrix.b * x + matrix.ty); - - pos += _vertexSize; - } - } - } - else - { - if (target._numVertices < targetVertexID + numVertices) - target.numVertices = targetVertexID + numVertices; // ensure correct alphas! - - for (var i:int=0; i<_numAttributes; ++i) - { - var srcAttr:VertexDataAttribute = _attributes[i]; - var tgtAttr:VertexDataAttribute = target.getAttribute(srcAttr.name); - - if (tgtAttr) // only copy attributes that exist in the target, as well - { - if (srcAttr.offset == _posOffset) - copyAttributeTo_internal(target, targetVertexID, matrix, - srcAttr, tgtAttr, vertexID, numVertices); - else - copyAttributeTo_internal(target, targetVertexID, null, - srcAttr, tgtAttr, vertexID, numVertices); - } - } - } - } - - /** Copies a specific attribute of all contained vertices (or a range of them, defined by - * 'vertexID' and 'numVertices') to another VertexData instance. Beware that both name - * and format of the attribute must be identical in source and target. - * If the target is not big enough, it will be resized to fit all the new vertices. - * - *

If you pass a non-null matrix, the specified attribute will be transformed by - * that matrix before storing it in the target object. It must consist of two float - * values.

- */ - public function copyAttributeTo(target:VertexData, targetVertexID:int, attrName:String, - matrix:Matrix=null, vertexID:int=0, numVertices:int=-1):void - { - var sourceAttribute:VertexDataAttribute = getAttribute(attrName); - var targetAttribute:VertexDataAttribute = target.getAttribute(attrName); - - if (sourceAttribute == null) - throw new ArgumentError("Attribute '" + attrName + "' not found in source data"); - - if (targetAttribute == null) - throw new ArgumentError("Attribute '" + attrName + "' not found in target data"); - - if (sourceAttribute.isColor) - target._tinted ||= _tinted; - - copyAttributeTo_internal(target, targetVertexID, matrix, - sourceAttribute, targetAttribute, vertexID, numVertices); - } - - private function copyAttributeTo_internal( - target:VertexData, targetVertexID:int, matrix:Matrix, - sourceAttribute:VertexDataAttribute, targetAttribute:VertexDataAttribute, - vertexID:int, numVertices:int):void - { - if (sourceAttribute.format != targetAttribute.format) - throw new IllegalOperationError("Attribute formats differ between source and target"); - - if (numVertices < 0 || vertexID + numVertices > _numVertices) - numVertices = _numVertices - vertexID; - - if (target._numVertices < targetVertexID + numVertices) - target._numVertices = targetVertexID + numVertices; - - var i:int, j:int, x:Number, y:Number; - var sourceData:ByteArray = _rawData; - var targetData:ByteArray = target._rawData; - var sourceDelta:int = _vertexSize - sourceAttribute.size; - var targetDelta:int = target._vertexSize - targetAttribute.size; - var attributeSizeIn32Bits:int = sourceAttribute.size / 4; - - sourceData.position = vertexID * _vertexSize + sourceAttribute.offset; - targetData.position = targetVertexID * target._vertexSize + targetAttribute.offset; - - if (matrix) - { - for (i=0; i> 8) & 0xffffff; - } - - /** Writes the RGB color to the specified vertex and attribute (alpha is not changed). */ - public function setColor(vertexID:int, attrName:String, color:uint):void - { - if (_numVertices < vertexID + 1) - numVertices = vertexID + 1; - - var alpha:Number = getAlpha(vertexID, attrName); - colorize(attrName, color, alpha, vertexID, 1); - } - - /** Reads the alpha value from the specified vertex and attribute. */ - public function getAlpha(vertexID:int, attrName:String="color"):Number - { - var offset:int = attrName == "color" ? _colOffset : getAttribute(attrName).offset; - _rawData.position = vertexID * _vertexSize + offset; - var rgba:uint = switchEndian(_rawData.readUnsignedInt()); - return (rgba & 0xff) / 255.0; - } - - /** Writes the given alpha value to the specified vertex and attribute (range 0-1). */ - public function setAlpha(vertexID:int, attrName:String, alpha:Number):void - { - if (_numVertices < vertexID + 1) - numVertices = vertexID + 1; - - var color:uint = getColor(vertexID, attrName); - colorize(attrName, color, alpha, vertexID, 1); - } - - // bounds helpers - - /** Calculates the bounds of the 2D vertex positions identified by the given name. - * The positions may optionally be transformed by a matrix before calculating the bounds. - * If you pass an 'out' Rectangle, the result will be stored in this rectangle - * instead of creating a new object. To use all vertices for the calculation, set - * 'numVertices' to '-1'. */ - public function getBounds(attrName:String="position", matrix:Matrix=null, - vertexID:int=0, numVertices:int=-1, out:Rectangle=null):Rectangle - { - if (out == null) out = new Rectangle(); - if (numVertices < 0 || vertexID + numVertices > _numVertices) - numVertices = _numVertices - vertexID; - - if (numVertices == 0) - { - if (matrix == null) - out.setEmpty(); - else - { - MatrixUtil.transformCoords(matrix, 0, 0, sHelperPoint); - out.setTo(sHelperPoint.x, sHelperPoint.y, 0, 0); - } - } - else - { - var minX:Number = Number.MAX_VALUE, maxX:Number = -Number.MAX_VALUE; - var minY:Number = Number.MAX_VALUE, maxY:Number = -Number.MAX_VALUE; - var offset:int = attrName == "position" ? _posOffset : getAttribute(attrName).offset; - var position:int = vertexID * _vertexSize + offset; - var x:Number, y:Number, i:int; - - if (matrix == null) - { - for (i=0; i x) minX = x; - if (maxX < x) maxX = x; - if (minY > y) minY = y; - if (maxY < y) maxY = y; - } - } - else - { - for (i=0; i sHelperPoint.x) minX = sHelperPoint.x; - if (maxX < sHelperPoint.x) maxX = sHelperPoint.x; - if (minY > sHelperPoint.y) minY = sHelperPoint.y; - if (maxY < sHelperPoint.y) maxY = sHelperPoint.y; - } - } - - out.setTo(minX, minY, maxX - minX, maxY - minY); - } - - return out; - } - - /** Calculates the bounds of the 2D vertex positions identified by the given name, - * projected into the XY-plane of a certain 3D space as they appear from the given - * camera position. Note that 'camPos' is expected in the target coordinate system - * (the same that the XY-plane lies in). - * - *

If you pass an 'out' Rectangle, the result will be stored in this rectangle - * instead of creating a new object. To use all vertices for the calculation, set - * 'numVertices' to '-1'.

*/ - public function getBoundsProjected(attrName:String, matrix:Matrix3D, - camPos:Vector3D, vertexID:int=0, numVertices:int=-1, - out:Rectangle=null):Rectangle - { - if (out == null) out = new Rectangle(); - if (camPos == null) throw new ArgumentError("camPos must not be null"); - if (numVertices < 0 || vertexID + numVertices > _numVertices) - numVertices = _numVertices - vertexID; - - if (numVertices == 0) - { - if (matrix) - MatrixUtil.transformCoords3D(matrix, 0, 0, 0, sHelperPoint3D); - else - sHelperPoint3D.setTo(0, 0, 0); - - MathUtil.intersectLineWithXYPlane(camPos, sHelperPoint3D, sHelperPoint); - out.setTo(sHelperPoint.x, sHelperPoint.y, 0, 0); - } - else - { - var minX:Number = Number.MAX_VALUE, maxX:Number = -Number.MAX_VALUE; - var minY:Number = Number.MAX_VALUE, maxY:Number = -Number.MAX_VALUE; - var offset:int = attrName == "position" ? _posOffset : getAttribute(attrName).offset; - var position:int = vertexID * _vertexSize + offset; - var x:Number, y:Number, i:int; - - for (i=0; i sHelperPoint.x) minX = sHelperPoint.x; - if (maxX < sHelperPoint.x) maxX = sHelperPoint.x; - if (minY > sHelperPoint.y) minY = sHelperPoint.y; - if (maxY < sHelperPoint.y) maxY = sHelperPoint.y; - } - - out.setTo(minX, minY, maxX - minX, maxY - minY); - } - - return out; - } - - /** Indicates if color attributes should be stored premultiplied with the alpha value. - * Changing this value does not modify any existing color data. - * If you want that, use the setPremultipliedAlpha method instead. - * @default true */ - public function get premultipliedAlpha():Boolean { return _premultipliedAlpha; } - public function set premultipliedAlpha(value:Boolean):void - { - setPremultipliedAlpha(value, false); - } - - /** Changes the way alpha and color values are stored. Optionally updates all existing - * vertices. */ - public function setPremultipliedAlpha(value:Boolean, updateData:Boolean):void - { - if (updateData && value != _premultipliedAlpha) - { - for (var i:int=0; i<_numAttributes; ++i) - { - var attribute:VertexDataAttribute = _attributes[i]; - if (attribute.isColor) - { - var pos:int = attribute.offset; - var oldColor:uint; - var newColor:uint; - - for (var j:int=0; j<_numVertices; ++j) - { - _rawData.position = pos; - oldColor = switchEndian(_rawData.readUnsignedInt()); - newColor = value ? premultiplyAlpha(oldColor) : unmultiplyAlpha(oldColor); - - _rawData.position = pos; - _rawData.writeUnsignedInt(switchEndian(newColor)); - - pos += _vertexSize; - } - } - } - } - - _premultipliedAlpha = value; - } - - /** Updates the tinted property from the actual color data. This might make - * sense after copying part of a tinted VertexData instance to another, since not each - * color value is checked in the process. An instance is tinted if any vertices have a - * non-white color or are not fully opaque. */ - public function updateTinted(attrName:String="color"):Boolean - { - var pos:int = attrName == "color" ? _colOffset : getAttribute(attrName).offset; - _tinted = false; - - for (var i:int=0; i<_numVertices; ++i) - { - _rawData.position = pos; - - if (_rawData.readUnsignedInt() != 0xffffffff) - { - _tinted = true; - break; - } - - pos += _vertexSize; - } - - return _tinted; - } - - // modify multiple attributes - - /** Transforms the 2D positions of subsequent vertices by multiplication with a - * transformation matrix. */ - public function transformPoints(attrName:String, matrix:Matrix, - vertexID:int=0, numVertices:int=-1):void - { - if (numVertices < 0 || vertexID + numVertices > _numVertices) - numVertices = _numVertices - vertexID; - - var x:Number, y:Number; - var offset:int = attrName == "position" ? _posOffset : getAttribute(attrName).offset; - var pos:int = vertexID * _vertexSize + offset; - var endPos:int = pos + numVertices * _vertexSize; - - while (pos < endPos) - { - _rawData.position = pos; - x = _rawData.readFloat(); - y = _rawData.readFloat(); - - _rawData.position = pos; - _rawData.writeFloat(matrix.a * x + matrix.c * y + matrix.tx); - _rawData.writeFloat(matrix.d * y + matrix.b * x + matrix.ty); - - pos += _vertexSize; - } - } - - /** Translates the 2D positions of subsequent vertices by a certain offset. */ - public function translatePoints(attrName:String, deltaX:Number, deltaY:Number, - vertexID:int=0, numVertices:int=-1):void - { - if (numVertices < 0 || vertexID + numVertices > _numVertices) - numVertices = _numVertices - vertexID; - - var x:Number, y:Number; - var offset:int = attrName == "position" ? _posOffset : getAttribute(attrName).offset; - var pos:int = vertexID * _vertexSize + offset; - var endPos:int = pos + numVertices * _vertexSize; - - while (pos < endPos) - { - _rawData.position = pos; - x = _rawData.readFloat(); - y = _rawData.readFloat(); - - _rawData.position = pos; - _rawData.writeFloat(x + deltaX); - _rawData.writeFloat(y + deltaY); - - pos += _vertexSize; - } - } - - /** Multiplies the alpha values of subsequent vertices by a certain factor. */ - public function scaleAlphas(attrName:String, factor:Number, - vertexID:int=0, numVertices:int=-1):void - { - if (factor == 1.0) return; - if (numVertices < 0 || vertexID + numVertices > _numVertices) - numVertices = _numVertices - vertexID; - - _tinted = true; // factor must be != 1, so there's definitely tinting. - - var i:int; - var offset:int = attrName == "color" ? _colOffset : getAttribute(attrName).offset; - var colorPos:int = vertexID * _vertexSize + offset; - var alphaPos:int, alpha:Number, rgba:uint; - - for (i=0; i 1.0) alpha = 1.0; - else if (alpha < 0.0) alpha = 0.0; - - if (alpha == 1.0 || !_premultipliedAlpha) - { - _rawData[alphaPos] = int(alpha * 255.0); - } - else - { - _rawData.position = colorPos; - rgba = unmultiplyAlpha(switchEndian(_rawData.readUnsignedInt())); - rgba = (rgba & 0xffffff00) | (int(alpha * 255.0) & 0xff); - rgba = premultiplyAlpha(rgba); - - _rawData.position = colorPos; - _rawData.writeUnsignedInt(switchEndian(rgba)); - } - - colorPos += _vertexSize; - } - } - - /** Writes the given RGB and alpha values to the specified vertices. */ - public function colorize(attrName:String="color", color:uint=0xffffff, alpha:Number=1.0, - vertexID:int=0, numVertices:int=-1):void - { - if (numVertices < 0 || vertexID + numVertices > _numVertices) - numVertices = _numVertices - vertexID; - - var offset:int = attrName == "color" ? _colOffset : getAttribute(attrName).offset; - var pos:int = vertexID * _vertexSize + offset; - var endPos:int = pos + (numVertices * _vertexSize); - - if (alpha > 1.0) alpha = 1.0; - else if (alpha < 0.0) alpha = 0.0; - - var rgba:uint = ((color << 8) & 0xffffff00) | (int(alpha * 255.0) & 0xff); - - if (rgba == 0xffffffff && numVertices == _numVertices) _tinted = false; - else if (rgba != 0xffffffff) _tinted = true; - - if (_premultipliedAlpha && alpha != 1.0) rgba = premultiplyAlpha(rgba); - - _rawData.position = vertexID * _vertexSize + offset; - _rawData.writeUnsignedInt(switchEndian(rgba)); - - while (pos < endPos) - { - _rawData.position = pos; - _rawData.writeUnsignedInt(switchEndian(rgba)); - pos += _vertexSize; - } - } - - // format helpers - - /** Returns the format of a certain vertex attribute, identified by its name. - * Typical values: float1, float2, float3, float4, bytes4. */ - public function getFormat(attrName:String):String - { - return getAttribute(attrName).format; - } - - /** Returns the size of a certain vertex attribute in bytes. */ - public function getSize(attrName:String):int - { - return getAttribute(attrName).size; - } - - /** Returns the size of a certain vertex attribute in 32 bit units. */ - public function getSizeIn32Bits(attrName:String):int - { - return getAttribute(attrName).size / 4; - } - - /** Returns the offset (in bytes) of an attribute within a vertex. */ - public function getOffset(attrName:String):int - { - return getAttribute(attrName).offset; - } - - /** Returns the offset (in 32 bit units) of an attribute within a vertex. */ - public function getOffsetIn32Bits(attrName:String):int - { - return getAttribute(attrName).offset / 4; - } - - /** Indicates if the VertexData instances contains an attribute with the specified name. */ - public function hasAttribute(attrName:String):Boolean - { - return getAttribute(attrName) != null; - } - - // VertexBuffer helpers - - /** Creates a vertex buffer object with the right size to fit the complete data. - * Optionally, the current data is uploaded right away. */ - public function createVertexBuffer(upload:Boolean=false, - bufferUsage:String="staticDraw"):VertexBuffer3D - { - var context:Context3D = Starling.context; - if (context == null) throw new MissingContextError(); - if (_numVertices == 0) return null; - - var buffer:VertexBuffer3D = context.createVertexBuffer( - _numVertices, _vertexSize / 4, bufferUsage); - - if (upload) uploadToVertexBuffer(buffer); - return buffer; - } - - /** Uploads the complete data (or a section of it) to the given vertex buffer. */ - public function uploadToVertexBuffer(buffer:VertexBuffer3D, vertexID:int=0, numVertices:int=-1):void - { - if (numVertices < 0 || vertexID + numVertices > _numVertices) - numVertices = _numVertices - vertexID; - - if (numVertices > 0) - buffer.uploadFromByteArray(_rawData, 0, vertexID, numVertices); - } - - [Inline] - private final function getAttribute(attrName:String):VertexDataAttribute - { - var i:int, attribute:VertexDataAttribute; - - for (i=0; i<_numAttributes; ++i) - { - attribute = _attributes[i]; - if (attribute.name == attrName) return attribute; - } - - return null; - } - - [Inline] - private static function switchEndian(value:uint):uint - { - return ( value & 0xff) << 24 | - ((value >> 8) & 0xff) << 16 | - ((value >> 16) & 0xff) << 8 | - ((value >> 24) & 0xff); - } - - private static function premultiplyAlpha(rgba:uint):uint - { - var alpha:uint = rgba & 0xff; - - if (alpha == 0xff) return rgba; - else - { - var factor:Number = alpha / 255.0; - var r:uint = ((rgba >> 24) & 0xff) * factor; - var g:uint = ((rgba >> 16) & 0xff) * factor; - var b:uint = ((rgba >> 8) & 0xff) * factor; - - return (r & 0xff) << 24 | - (g & 0xff) << 16 | - (b & 0xff) << 8 | alpha; - } - } - - private static function unmultiplyAlpha(rgba:uint):uint - { - var alpha:uint = rgba & 0xff; - - if (alpha == 0xff || alpha == 0x0) return rgba; - else - { - var factor:Number = alpha / 255.0; - var r:uint = ((rgba >> 24) & 0xff) / factor; - var g:uint = ((rgba >> 16) & 0xff) / factor; - var b:uint = ((rgba >> 8) & 0xff) / factor; - - return (r & 0xff) << 24 | - (g & 0xff) << 16 | - (b & 0xff) << 8 | alpha; - } - } - - // properties - - /** The total number of vertices. If you make the object bigger, it will be filled up with - * 1.0 for all alpha values and zero for everything else. */ - public function get numVertices():int { return _numVertices; } - public function set numVertices(value:int):void - { - if (value > _numVertices) - { - var oldLength:int = _numVertices * vertexSize; - var newLength:int = value * _vertexSize; - - if (_rawData.length > oldLength) - { - _rawData.position = oldLength; - while (_rawData.bytesAvailable) _rawData.writeUnsignedInt(0); - } - - if (_rawData.length < newLength) - _rawData.length = newLength; - - for (var i:int=0; i<_numAttributes; ++i) - { - var attribute:VertexDataAttribute = _attributes[i]; - if (attribute.isColor) // initialize color values with "white" and full alpha - { - var pos:int = _numVertices * _vertexSize + attribute.offset; - for (var j:int=_numVertices; jfalse (and the value wasn't modified manually), the result is 100% - * accurate; true represents just an educated guess. To be entirely sure, - * you may call updateTinted(). - */ - public function get tinted():Boolean { return _tinted; } - public function set tinted(value:Boolean):void { _tinted = value; } - - /** The format string that describes the attributes of each vertex. */ - public function get formatString():String - { - return _format.formatString; - } - - /** The size (in bytes) of each vertex. */ - public function get vertexSize():int - { - return _vertexSize; - } - - /** The size (in 32 bit units) of each vertex. */ - public function get vertexSizeIn32Bits():int - { - return _vertexSize / 4; - } - - /** The size (in bytes) of the raw vertex data. */ - public function get size():int - { - return _numVertices * _vertexSize; - } - - /** The size (in 32 bit units) of the raw vertex data. */ - public function get sizeIn32Bits():int - { - return _numVertices * _vertexSize / 4; - } - } -} diff --git a/mobile_version/src/starling/rendering/VertexDataAttribute.as b/mobile_version/src/starling/rendering/VertexDataAttribute.as deleted file mode 100644 index c5a1887c..00000000 --- a/mobile_version/src/starling/rendering/VertexDataAttribute.as +++ /dev/null @@ -1,47 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= - -package starling.rendering -{ - /** Holds the properties of a single attribute in a VertexDataFormat instance. - * The member variables must never be changed; they are only public - * for performance reasons. */ - internal class VertexDataAttribute - { - private static const FORMAT_SIZES:Object = { - "bytes4": 4, - "float1": 4, - "float2": 8, - "float3": 12, - "float4": 16 - }; - - public var name:String; - public var format:String; - public var isColor:Boolean; - public var offset:int; // in bytes - public var size:int; // in bytes - - /** Creates a new instance with the given properties. */ - public function VertexDataAttribute(name:String, format:String, offset:int) - { - if (!(format in FORMAT_SIZES)) - throw new ArgumentError( - "Invalid attribute format: " + format + ". " + - "Use one of the following: 'float1'-'float4', 'bytes4'"); - - this.name = name; - this.format = format; - this.offset = offset; - this.size = FORMAT_SIZES[format]; - this.isColor = name.indexOf("color") != -1 || name.indexOf("Color") != -1 - } - } -} diff --git a/mobile_version/src/starling/rendering/VertexDataFormat.as b/mobile_version/src/starling/rendering/VertexDataFormat.as deleted file mode 100644 index 7c5396a0..00000000 --- a/mobile_version/src/starling/rendering/VertexDataFormat.as +++ /dev/null @@ -1,275 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= - -package starling.rendering -{ - import flash.display3D.VertexBuffer3D; - import flash.utils.Dictionary; - - import starling.core.Starling; - import starling.utils.StringUtil; - - /** Describes the memory layout of VertexData instances, as used for every single vertex. - * - *

The format is set up via a simple String. Here is an example:

- * - * - * format = VertexDataFormat.fromString("position:float2, color:bytes4"); - * - *

This String describes two attributes: "position" and "color". The keywords after - * the colons depict the format and size of the data that each attribute uses; in this - * case, we store two floats for the position (taking up the x- and y-coordinates) and four - * bytes for the color. (The available formats are the same as those defined in the - * Context3DVertexBufferFormat class: - * float1, float2, float3, float4, bytes4.)

- * - *

You cannot create a VertexData instance with its constructor; instead, you must use the - * static fromString-method. The reason for this behavior: the class maintains - * a cache, and a call to fromString will return an existing instance if an - * equivalent format has already been created in the past. That saves processing time and - * memory.

- * - *

VertexDataFormat instances are immutable, i.e. they are solely defined by their format - * string and cannot be changed later.

- * - * @see VertexData - */ - public class VertexDataFormat - { - private var _format:String; - private var _vertexSize:int; - private var _attributes:Vector.; - - // format cache - private static var sFormats:Dictionary = new Dictionary(); - - /** Don't use the constructor, but call VertexDataFormat.fromString instead. - * This allows for efficient format caching. */ - public function VertexDataFormat() - { - _attributes = new Vector.(); - } - - /** Creates a new VertexDataFormat instance from the given String, or returns one from - * the cache (if an equivalent String has already been used before). - * - * @param format - * - * Describes the attributes of each vertex, consisting of a comma-separated - * list of attribute names and their format, e.g.: - * - *
"position:float2, texCoords:float2, color:bytes4"
- * - *

This set of attributes will be allocated for each vertex, and they will be - * stored in exactly the given order.

- * - *
    - *
  • Names are used to access the specific attributes of a vertex. They are - * completely arbitrary.
  • - *
  • The available formats can be found in the Context3DVertexBufferFormat - * class in the flash.display3D package.
  • - *
  • Both names and format strings are case-sensitive.
  • - *
  • Always use bytes4 for color data that you want to access with the - * respective methods.
  • - *
  • Furthermore, the attribute names of colors should include the string "color" - * (or the uppercase variant). If that's the case, the "alpha" channel of the color - * will automatically be initialized with "1.0" when the VertexData object is - * created or resized.
  • - *
- */ - public static function fromString(format:String):VertexDataFormat - { - if (format in sFormats) return sFormats[format]; - else - { - var instance:VertexDataFormat = new VertexDataFormat(); - instance.parseFormat(format); - - var normalizedFormat:String = instance._format; - - if (normalizedFormat in sFormats) - instance = sFormats[normalizedFormat]; - - sFormats[format] = instance; - sFormats[normalizedFormat] = instance; - - return instance; - } - } - - /** Creates a new VertexDataFormat instance by appending the given format string - * to the current instance's format. */ - public function extend(format:String):VertexDataFormat - { - return fromString(_format + ", " + format); - } - - // query methods - - /** Returns the size of a certain vertex attribute in bytes. */ - public function getSize(attrName:String):int - { - return getAttribute(attrName).size; - } - - /** Returns the size of a certain vertex attribute in 32 bit units. */ - public function getSizeIn32Bits(attrName:String):int - { - return getAttribute(attrName).size / 4; - } - - /** Returns the offset (in bytes) of an attribute within a vertex. */ - public function getOffset(attrName:String):int - { - return getAttribute(attrName).offset; - } - - /** Returns the offset (in 32 bit units) of an attribute within a vertex. */ - public function getOffsetIn32Bits(attrName:String):int - { - return getAttribute(attrName).offset / 4; - } - - /** Returns the format of a certain vertex attribute, identified by its name. - * Typical values: float1, float2, float3, float4, bytes4. */ - public function getFormat(attrName:String):String - { - return getAttribute(attrName).format; - } - - /** Returns the name of the attribute at the given position within the vertex format. */ - public function getName(attrIndex:int):String - { - return _attributes[attrIndex].name; - } - - /** Indicates if the format contains an attribute with the given name. */ - public function hasAttribute(attrName:String):Boolean - { - var numAttributes:int = _attributes.length; - - for (var i:int=0; iContext3D-method with the same name, - * automatically replacing attrName with the corresponding values for - * bufferOffset and format. */ - public function setVertexBufferAt(index:int, buffer:VertexBuffer3D, attrName:String):void - { - var attribute:VertexDataAttribute = getAttribute(attrName); - Starling.context.setVertexBufferAt(index, buffer, attribute.offset / 4, attribute.format); - } - - // parsing - - private function parseFormat(format:String):void - { - if (format != null && format != "") - { - _attributes.length = 0; - _format = ""; - - var parts:Array = format.split(","); - var numParts:int = parts.length; - var offset:int = 0; - - for (var i:int=0; i - { - return _attributes; - } - - // properties - - /** Returns the normalized format string. */ - public function get formatString():String - { - return _format; - } - - /** The size (in bytes) of each vertex. */ - public function get vertexSize():int - { - return _vertexSize; - } - - /** The size (in 32 bit units) of each vertex. */ - public function get vertexSizeIn32Bits():int - { - return _vertexSize / 4; - } - - /** The number of attributes per vertex. */ - public function get numAttributes():int - { - return _attributes.length; - } - } -} diff --git a/mobile_version/src/starling/styles/DistanceFieldStyle.as b/mobile_version/src/starling/styles/DistanceFieldStyle.as deleted file mode 100644 index 81353f77..00000000 --- a/mobile_version/src/starling/styles/DistanceFieldStyle.as +++ /dev/null @@ -1,684 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= - -package starling.styles -{ - import flash.geom.Matrix; - - import starling.display.Mesh; - import starling.rendering.MeshEffect; - import starling.rendering.RenderState; - import starling.rendering.VertexData; - import starling.rendering.VertexDataFormat; - import starling.utils.Color; - import starling.utils.MathUtil; - - /** Provides support for signed distance fields to Starling meshes. - * - *

Signed distance field rendering allows bitmap fonts and other single colored shapes to - * be drawn without jagged edges, even at high magnifications. The technique was introduced in - * the SIGGRAPH paper Improved - * Alpha-Tested Magnification for Vector Textures and Special Effects by Valve Software. - *

- * - *

While bitmap fonts are a great solution to render text in a GPU-friendly way, they - * don't scale well. For best results, one has to embed the font in all the sizes used within - * the app. The distance field style solves this issue: instead of providing a standard - * black and white image of the font, it uses a signed distance field texture as - * its input (a texture that encodes, for each pixel, the distance to the closest edge of a - * vector shape). With this data, the shape can be rendered smoothly at almost any scale.

- * - *

Here are some tools that support creation of such distance field textures:

- * - *
    - *
  • Littera - a free online bitmap font - * generator.
  • - *
  • Hiero - a cross platform - * tool.
  • - *
  • BMFont - Windows-only, from - * AngelCode.
  • - *
- * - * Special effects - * - *

Another advantage of this rendering technique: it supports very efficient rendering of - * some popular filter effects, in just one pass, directly on the GPU. You can add an - * outline around the shape, let it glow in an arbitrary color, or add - * a drop shadow.

- * - *

The type of effect currently used is called the 'mode'. - * Meshes with the same mode will be batched together on rendering.

- */ - public class DistanceFieldStyle extends MeshStyle - { - /** The vertex format expected by this style. */ - public static const VERTEX_FORMAT:VertexDataFormat = - MeshStyle.VERTEX_FORMAT.extend( - "basic:bytes4, extended:bytes4, outerColor:bytes4"); - - /** Basic distance field rendering, without additional effects. */ - public static const MODE_BASIC:String = "basic"; - - /** Adds an outline around the edge of the shape. */ - public static const MODE_OUTLINE:String = "outline"; - - /** Adds a smooth glow effect around the shape. */ - public static const MODE_GLOW:String = "glow"; - - /** Adds a drop shadow behind the shape. */ - public static const MODE_SHADOW:String = "shadow"; - - private var _mode:String; - - // basic - private var _threshold:Number; - private var _alpha:Number; - private var _softness:Number; - - // extended - private var _outerThreshold:Number; - private var _outerAlphaEnd:Number; - private var _shadowOffsetX:Number; - private var _shadowOffsetY:Number; - - // outerColor - private var _outerColor:uint; - private var _outerAlphaStart:Number; - - /** Creates a new distance field style. - * - * @param softness adds a soft transition between the inside and the outside. - * This should typically be 1.0 divided by the spread used when - * creating the distance field texture. - * @param threshold the value separating the inside from the outside of the shape. - * Range: 0 - 1. - */ - public function DistanceFieldStyle(softness:Number=0.125, threshold:Number=0.5) - { - _mode = MODE_BASIC; - _threshold = threshold; - _softness = softness; - _alpha = 1.0; - - _outerThreshold = _outerAlphaEnd = 0.0; - _shadowOffsetX = _shadowOffsetY = 0.0; - - _outerColor = 0x0; - _outerAlphaStart = 0.0; - } - - /** @private */ - override public function copyFrom(meshStyle:MeshStyle):void - { - var otherStyle:DistanceFieldStyle = meshStyle as DistanceFieldStyle; - if (otherStyle) - { - _mode = otherStyle._mode; - _threshold = otherStyle._threshold; - _softness = otherStyle._softness; - _alpha = otherStyle._alpha; - - _outerThreshold = otherStyle._outerThreshold; - _outerAlphaEnd = otherStyle._outerAlphaEnd; - _shadowOffsetX = otherStyle._shadowOffsetX; - _shadowOffsetY = otherStyle._shadowOffsetY; - - _outerColor = otherStyle._outerColor; - _outerAlphaStart = otherStyle._outerAlphaStart; - } - - super.copyFrom(meshStyle); - } - - /** @private */ - override public function createEffect():MeshEffect - { - return new DistanceFieldEffect(); - } - - /** @private */ - override public function get vertexFormat():VertexDataFormat - { - return VERTEX_FORMAT; - } - - /** @private */ - override protected function onTargetAssigned(target:Mesh):void - { - updateVertices(); - } - - private function updateVertices():void - { - if (vertexData == null) return; - - // To save space, all settings are stored in 'bytes4' format; this means we write - // values in the range 0-255 into the bytes and receive floats in the range 0-1 in the - // shaders. Since the 'scale' and 'outerOffset' values require a different range, - // they are encoded with a scale factor and/or offset. The color is stored manually - // (not via 'setColor') to avoid PMA processing. - - var numVertices:int = vertexData.numVertices; - var maxScale:int = DistanceFieldEffect.MAX_SCALE; - var maxOuterOffset:int = DistanceFieldEffect.MAX_OUTER_OFFSET; - var encodedOuterOffsetX:Number = (_shadowOffsetX + maxOuterOffset) / (2 * maxOuterOffset); - var encodedOuterOffsetY:Number = (_shadowOffsetY + maxOuterOffset) / (2 * maxOuterOffset); - - var basic:uint = (uint(_threshold * 255) ) | - (uint(_alpha * 255) << 8) | - (uint(_softness / 2.0 * 255) << 16) | - (uint(1.0 / maxScale * 255) << 24); - var extended:uint = (uint(_outerThreshold * 255) ) | - (uint(_outerAlphaEnd * 255) << 8) | - (uint(encodedOuterOffsetX * 255) << 16) | - (uint(encodedOuterOffsetY * 255) << 24); - var outerColor:uint = (Color.getRed(_outerColor) ) | - (Color.getGreen(_outerColor) << 8) | - (Color.getBlue(_outerColor) << 16) | - (uint(_outerAlphaStart * 255) << 24); - - for (var i:int=0; i> 24) & 0xff) / 255.0 * maxScale; - var tgtScale:Number = MathUtil.clamp(srcScale * scale, minScale, maxScale); - var tgtAttr:uint = - (srcAttr & 0x00ffffff) | (uint(tgtScale / maxScale * 255) << 24); - - targetVertexData.setUnsignedInt(targetVertexID + i, "basic", tgtAttr); - } - } - } - } - - /** @private */ - override public function updateEffect(effect:MeshEffect, state:RenderState):void - { - var dfEffect:DistanceFieldEffect = effect as DistanceFieldEffect; - dfEffect.mode = _mode; - - if (state.is3D) dfEffect.scale = 1.0; - else - { - // The softness is adapted automatically with the total scale of the object. - // However, this only works for 2D objects. - - var matrix:Matrix = state.modelviewMatrix; - var scale:Number = Math.sqrt(matrix.a * matrix.a + matrix.c * matrix.c); - dfEffect.scale = scale; - } - - super.updateEffect(effect, state); - } - - /** @private */ - override public function canBatchWith(meshStyle:MeshStyle):Boolean - { - var dfStyle:DistanceFieldStyle = meshStyle as DistanceFieldStyle; - if (dfStyle && super.canBatchWith(meshStyle)) return dfStyle.mode == _mode; - else return false; - } - - // simplified setup - - /** Restores basic render mode, i.e. smooth rendering of the shape. */ - public function setupBasic():void - { - _mode = MODE_BASIC; - - setRequiresRedraw(); - } - - /** Sets up outline rendering mode. The 'width' determines the threshold where the - * outline ends; 'width + threshold' must not exceed '1.0'. - */ - public function setupOutline(width:Number=0.25, color:uint=0x0, alpha:Number=1.0):void - { - _mode = MODE_OUTLINE; - _outerThreshold = MathUtil.clamp(_threshold - width, 0, _threshold); - _outerColor = color; - _outerAlphaStart = _outerAlphaEnd = MathUtil.clamp(alpha, 0, 1); - _shadowOffsetX = _shadowOffsetY = 0.0; - - updateVertices(); - } - - /** Sets up glow rendering mode. The 'blur' determines the threshold where the - * blur ends; 'blur + threshold' must not exceed '1.0'. - */ - public function setupGlow(blur:Number=0.2, color:uint=0xffff00, alpha:Number=0.5):void - { - _mode = MODE_GLOW; - _outerThreshold = MathUtil.clamp(_threshold - blur, 0, _threshold); - _outerColor = color; - _outerAlphaStart = MathUtil.clamp(alpha, 0, 1); - _outerAlphaEnd = 0.0; - _shadowOffsetX = _shadowOffsetY = 0.0; - - updateVertices(); - } - - /** Sets up shadow rendering mode. The 'blur' determines the threshold where the drop - * shadow ends; 'offsetX' and 'offsetY' are expected in points. - * - *

Beware that the style can only act within the limits of the mesh's vertices. - * This means that not all combinations of blur and offset are possible; too high values - * will cause the shadow to be cut off on the sides. Reduce either blur or offset to - * compensate.

- */ - public function setupDropShadow(blur:Number=0.2, offsetX:Number=2, offsetY:Number=2, - color:uint=0x0, alpha:Number=0.5):void - { - const maxOffset:Number = DistanceFieldEffect.MAX_OUTER_OFFSET; - - _mode = MODE_SHADOW; - _outerThreshold = MathUtil.clamp(_threshold - blur, 0, _threshold); - _outerColor = color; - _outerAlphaStart = MathUtil.clamp(alpha, 0, 1); - _outerAlphaEnd = 0.0; - _shadowOffsetX = MathUtil.clamp(offsetX, -maxOffset, maxOffset); - _shadowOffsetY = MathUtil.clamp(offsetY, -maxOffset, maxOffset); - - updateVertices(); - } - - // properties - - /** The current render mode. It's recommended to use one of the 'setup...'-methods to - * change the mode, as those provide useful standard settings, as well. @default basic */ - public function get mode():String { return _mode; } - public function set mode(value:String):void - { - _mode = value; - setRequiresRedraw(); - } - - /** The threshold that will separate the inside from the outside of the shape. On the - * distance field texture, '0' means completely outside, '1' completely inside; the - * actual edge runs along '0.5'. @default 0.5 */ - public function get threshold():Number { return _threshold; } - public function set threshold(value:Number):void - { - value = MathUtil.clamp(value, 0, 1); - - if (_threshold != value) - { - _threshold = value; - updateVertices(); - } - } - - /** Indicates how soft the transition between inside and outside should be rendered. - * A value of '0' will lead to a hard, jagged edge; '1' will be just as blurry as the - * actual distance field texture. The recommend value should be 1.0 / spread - * (you determine the spread when creating the distance field texture). @default 0.125 */ - public function get softness():Number { return _softness; } - public function set softness(value:Number):void - { - value = MathUtil.clamp(value, 0, 1); - - if (_softness != value) - { - _softness = value; - updateVertices(); - } - } - - /** The alpha value with which the inner area (what's rendered in 'basic' mode) is drawn. - * @default 1.0 */ - public function get alpha():Number { return _alpha; } - public function set alpha(value:Number):void - { - value = MathUtil.clamp(value, 0, 1); - - if (_alpha != value) - { - _alpha = value; - updateVertices(); - } - } - - /** The threshold that determines where the outer area (outline, glow, or drop shadow) - * ends. Ignored in 'basic' mode. */ - public function get outerThreshold():Number { return _outerThreshold; } - public function set outerThreshold(value:Number):void - { - value = MathUtil.clamp(value, 0, 1); - - if (_outerThreshold != value) - { - _outerThreshold = value; - updateVertices(); - } - } - - /** The alpha value on the inner side of the outer area's gradient. - * Used for outline, glow, and drop shadow modes. */ - public function get outerAlphaStart():Number { return _outerAlphaStart; } - public function set outerAlphaStart(value:Number):void - { - value = MathUtil.clamp(value, 0, 1); - - if (_outerAlphaStart != value) - { - _outerAlphaStart = value; - updateVertices(); - } - } - - /** The alpha value on the outer side of the outer area's gradient. - * Used for outline, glow, and drop shadow modes. */ - public function get outerAlphaEnd():Number { return _outerAlphaEnd; } - public function set outerAlphaEnd(value:Number):void - { - value = MathUtil.clamp(value, 0, 1); - - if (_outerAlphaEnd != value) - { - _outerAlphaEnd = value; - updateVertices(); - } - } - - /** The color with which the outer area (outline, glow, or drop shadow) will be filled. - * Ignored in 'basic' mode. */ - public function get outerColor():uint { return _outerColor; } - public function set outerColor(value:uint):void - { - if (_outerColor != value) - { - _outerColor = value; - updateVertices(); - } - } - - /** The x-offset of the shadow in points. Note that certain combinations of offset and - * blur value can lead the shadow to be cut off at the edges. Reduce blur or offset to - * counteract. */ - public function get shadowOffsetX():Number { return _shadowOffsetX; } - public function set shadowOffsetX(value:Number):void - { - const max:Number = DistanceFieldEffect.MAX_OUTER_OFFSET; - value = MathUtil.clamp(value, -max, max); - - if (_shadowOffsetX != value) - { - _shadowOffsetX = value; - updateVertices(); - } - } - - /** The y-offset of the shadow in points. Note that certain combinations of offset and - * blur value can lead the shadow to be cut off at the edges. Reduce blur or offset to - * counteract. */ - public function get shadowOffsetY():Number { return _shadowOffsetY; } - public function set shadowOffsetY(value:Number):void - { - const max:Number = DistanceFieldEffect.MAX_OUTER_OFFSET; - value = MathUtil.clamp(value, -max, max); - - if (_shadowOffsetY != value) - { - _shadowOffsetY = value; - updateVertices(); - } - } - } -} - -import flash.display3D.Context3D; -import flash.display3D.Context3DProgramType; - -import starling.rendering.MeshEffect; -import starling.rendering.Program; -import starling.rendering.VertexDataFormat; -import starling.styles.DistanceFieldStyle; -import starling.utils.StringUtil; - -class DistanceFieldEffect extends MeshEffect -{ - public static const VERTEX_FORMAT:VertexDataFormat = DistanceFieldStyle.VERTEX_FORMAT; - public static const MAX_OUTER_OFFSET:int = 8; - public static const MAX_SCALE:int = 8; - - private var _mode:String; - private var _scale:Number; - - private static const sVector:Vector. = new Vector.(4, true); - - public function DistanceFieldEffect() - { - _scale = 1.0; - _mode = DistanceFieldStyle.MODE_BASIC; - } - - override protected function createProgram():Program - { - if (texture) - { - // va0 - position - // va1 - tex coords - // va2 - color - // va3 - basic settings (threshold, alpha, softness, local scale [encoded]) - // va4 - outer settings (outerThreshold, outerAlphaEnd, outerOffsetX/Y) - // va5 - outer color (rgb, outerAlphaStart) - // vc5 - shadow offset multiplier (x, y), max local scale (z), global scale (w) - - var isBasicMode:Boolean = _mode == DistanceFieldStyle.MODE_BASIC; - var isShadowMode:Boolean = _mode == DistanceFieldStyle.MODE_SHADOW; - - /// *** VERTEX SHADER *** - - var vertexShader:Vector. = new [ - "m44 op, va0, vc0", // 4x4 matrix transform to output clip-space - "mov v0, va1 ", // pass texture coordinates to fragment program - "mul v1, va2, vc4", // multiply alpha (vc4) with color (va2), pass to fp - "mov v3, va3 ", - "mov v4, va4 ", - "mov v5, va5 ", - - // update softness to take current scale into account - "mul vt0.x, va3.w, vc5.z", // vt0.x = local scale [decoded] - "mul vt0.x, vt0.x, vc5.w", // vt0.x *= global scale - "div vt0.x, va3.z, vt0.x", // vt0.x = softness / total scale - - // calculate min-max of threshold - "mov vt1, vc4", // initialize vt1 with something (anything) - "sub vt1.x, va3.x, vt0.x", // vt1.x = thresholdMin - "add vt1.y, va3.x, vt0.x" // vt1.y = thresholdMax - ]; - - if (!isBasicMode) - { - vertexShader.push( - // calculate min-max of outer threshold - "sub vt1.z, va4.x, vt0.x", // vt1.z = outerThresholdMin - "add vt1.w, va4.x, vt0.x" // vt1.w = outerThresholdMax - ); - } - - vertexShader.push("sat v6, vt1"); // v6.xyzw = thresholdMin/Max, outerThresholdMin/Max - - if (isShadowMode) - { - vertexShader.push( - // calculate shadow offset - "mul vt0.xy, va4.zw, vc6.zz", // vt0.x/y = outerOffsetX/Y * 2 - "sub vt0.xy, vt0.xy, vc6.yy", // vt0.x/y -= 1 -> range -1, 1 - "mul vt0.xy, vt0.xy, vc5.xy", // vt0.x/y = outerOffsetX/Y in point size - "sub v7, va1, vt0.xyxy", // v7.xy = shadow tex coords - - // on shadows, the inner threshold is further inside than on glow & outline - "sub vt0.z, va3.x, va4.x", // get delta between threshold and outer threshold - "add v7.z, va3.x, vt0.z" // v7.z = inner threshold of shadow - ); - } - - /// *** FRAGMENT SHADER *** - - var fragmentShader:Vector. = new [ - // create basic inner area - tex("ft0", "v0", 0, texture), // ft0 = texture color - "mov ft1, ft0", // ft1 = texture color - step("ft1.w", "v6.x", "v6.y"), // make soft inner mask - "mov ft3, ft1", // store copy of inner mask in ft3 (for outline) - "mul ft1, v1, ft1.wwww" // multiply with color - ]; - - if (isShadowMode) - { - fragmentShader.push( - tex("ft0", "v7", 0, texture), // sample at shadow tex coords - "mov ft5.x, v7.z" // ft5.x = inner threshold of shadow - ); - } - else if (!isBasicMode) - { - fragmentShader.push( - "mov ft5.x, v6.x" // ft5.x = inner threshold of outer area - ); - } - - if (!isBasicMode) - { - fragmentShader.push( - // outer area - "mov ft2, ft0", // ft2 = texture color - step("ft2.w", "v6.z", "v6.w"), // make soft outer mask - "sub ft2.w, ft2.w, ft3.w", // subtract inner area - "sat ft2.w, ft2.w", // but stay within 0-1 - - // add alpha gradient to outer area - "mov ft4, ft0", // ft4 = texture color - step("ft4.w", "v6.z", "ft5.x"), // make soft mask ranging between thresholds - "sub ft6.w, v5.w, v4.y", // ft6.w = alpha range (outerAlphaStart - End) - "mul ft4.w, ft4.w, ft6.w", // ft4.w *= alpha range - "add ft4.w, ft4.w, v4.y", // ft4.w += alpha end - - // colorize outer area - "mul ft2.w, ft2.w, ft4.w", // get final outline alpha at this position - "mul ft2.xyz, v5.xyz, ft2.www" // multiply with outerColor - ); - } - - if (isBasicMode) fragmentShader.push("mov oc, ft1"); - else fragmentShader.push("add oc, ft1, ft2"); - - return Program.fromSource(vertexShader.join("\n"), fragmentShader.join("\n")); - } - else return super.createProgram(); - } - - private static function step(inOutReg:String, minReg:String, maxReg:String, - tmpReg:String="ft6"):String - { - var ops:Vector. = new [ - StringUtil.format("sub {0}, {1}, {2}", tmpReg, maxReg, minReg), // tmpReg = range - StringUtil.format("rcp {0}, {0}", tmpReg), // tmpReg = scale - StringUtil.format("sub {0}, {0}, {1}", inOutReg, minReg), // inOut -= minimum - StringUtil.format("mul {0}, {0}, {1}", inOutReg, tmpReg), // inOut *= scale - StringUtil.format("sat {0}, {0}", inOutReg) // clamp to 0-1 - ]; - - return ops.join("\n"); - } - - override protected function beforeDraw(context:Context3D):void - { - super.beforeDraw(context); - - if (texture) - { - vertexFormat.setVertexBufferAt(3, vertexBuffer, "basic"); - vertexFormat.setVertexBufferAt(4, vertexBuffer, "extended"); - vertexFormat.setVertexBufferAt(5, vertexBuffer, "outerColor"); - - var pixelWidth:Number = 1.0 / (texture.root.nativeWidth / texture.scale); - var pixelHeight:Number = 1.0 / (texture.root.nativeHeight / texture.scale); - - sVector[0] = MAX_OUTER_OFFSET * pixelWidth; - sVector[1] = MAX_OUTER_OFFSET * pixelHeight; - sVector[2] = MAX_SCALE; - sVector[3] = _scale; - - context.setProgramConstantsFromVector(Context3DProgramType.VERTEX, 5, sVector); - - sVector[0] = 0.0; - sVector[1] = 1.0; - sVector[2] = 2.0; - - context.setProgramConstantsFromVector(Context3DProgramType.VERTEX, 6, sVector); - } - } - - override protected function afterDraw(context:Context3D):void - { - if (texture) - { - context.setVertexBufferAt(3, null); - context.setVertexBufferAt(4, null); - context.setVertexBufferAt(5, null); - } - super.afterDraw(context); - } - - override public function get vertexFormat():VertexDataFormat - { - return VERTEX_FORMAT; - } - - override protected function get programVariantName():uint - { - var modeBits:uint; - - switch (_mode) - { - case DistanceFieldStyle.MODE_SHADOW: modeBits = 3; break; - case DistanceFieldStyle.MODE_GLOW: modeBits = 2; break; - case DistanceFieldStyle.MODE_OUTLINE: modeBits = 1; break; - default: modeBits = 0; - } - - return super.programVariantName | (modeBits << 8); - } - - public function get scale():Number { return _scale; } - public function set scale(value:Number):void { _scale = value; } - - public function get mode():String { return _mode; } - public function set mode(value:String):void { _mode = value; } -} diff --git a/mobile_version/src/starling/styles/MeshStyle.as b/mobile_version/src/starling/styles/MeshStyle.as deleted file mode 100644 index 54c477e0..00000000 --- a/mobile_version/src/starling/styles/MeshStyle.as +++ /dev/null @@ -1,436 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= - -package starling.styles -{ - import flash.display3D.textures.TextureBase; - import flash.geom.Matrix; - import flash.geom.Point; - - import starling.core.starling_internal; - import starling.display.Mesh; - import starling.events.Event; - import starling.events.EventDispatcher; - import starling.rendering.*; - import starling.textures.Texture; - import starling.textures.TextureSmoothing; - - /** Dispatched every frame on styles assigned to display objects connected to the stage. */ - [Event(name="enterFrame", type="starling.events.EnterFrameEvent")] - - /** MeshStyles provide a means to completely modify the way a mesh is rendered. - * The base class provides Starling's standard mesh rendering functionality: colored and - * (optionally) textured meshes. Subclasses may add support for additional features like - * color transformations, normal mapping, etc. - * - *

Using styles

- * - *

First, create an instance of the desired style. Configure the style by updating its - * properties, then assign it to the mesh. Here is an example that uses a fictitious - * ColorStyle:

- * - * - * var image:Image = new Image(heroTexture); - * var colorStyle:ColorStyle = new ColorStyle(); - * colorStyle.redOffset = 0.5; - * colorStyle.redMultiplier = 2.0; - * image.style = colorStyle; - * - *

Beware:

- * - *
    - *
  • A style instance may only be used on one object at a time.
  • - *
  • A style might require the use of a specific vertex format; - * when the style is assigned, the mesh is converted to that format.
  • - *
- * - *

Creating your own styles

- * - *

To create custom rendering code in Starling, you need to extend two classes: - * MeshStyle and MeshEffect. While the effect class contains - * the actual AGAL rendering code, the style provides the API that other developers will - * interact with.

- * - *

Subclasses of MeshStyle will add specific properties that configure the - * style's outcome, like the redOffset and redMultiplier properties - * in the sample above. Here's how to properly create such a class:

- * - *
    - *
  • Always provide a constructor that can be called without any arguments.
  • - *
  • Override copyFrom — that's necessary for batching.
  • - *
  • Override createEffect — this method must return the - * MeshEffect that will do the actual Stage3D rendering.
  • - *
  • Override updateEffect — this configures the effect created above - * right before rendering.
  • - *
  • Override canBatchWith if necessary — this method figures out if one - * instance of the style can be batched with another. If they all can, you can leave - * this out.
  • - *
- * - *

If the style requires a custom vertex format, you must also:

- * - *
    - *
  • add a static constant called VERTEX_FORMAT to the class and
  • - *
  • override get vertexFormat and let it return exactly that format.
  • - *
- * - *

When that's done, you can turn to the implementation of your MeshEffect; - * the createEffect-override will return an instance of this class. - * Directly before rendering begins, Starling will then call updateEffect - * to set it up.

- * - * @see MeshEffect - * @see VertexDataFormat - * @see starling.display.Mesh - */ - public class MeshStyle extends EventDispatcher - { - /** The vertex format expected by this style (the same as found in the MeshEffect-class). */ - public static const VERTEX_FORMAT:VertexDataFormat = MeshEffect.VERTEX_FORMAT; - - private var _type:Class; - private var _target:Mesh; - private var _texture:Texture; - private var _textureBase:TextureBase; - private var _textureSmoothing:String; - private var _textureRepeat:Boolean; - private var _vertexData:VertexData; // just a reference to the target's vertex data - private var _indexData:IndexData; // just a reference to the target's index data - - // helper objects - private static var sPoint:Point = new Point(); - - /** Creates a new MeshStyle instance. - * Subclasses must provide a constructor that can be called without any arguments. */ - public function MeshStyle() - { - _textureSmoothing = TextureSmoothing.BILINEAR; - _type = Object(this).constructor as Class; - } - - /** Copies all properties of the given style to the current instance (or a subset, if the - * classes don't match). Must be overridden by all subclasses! - */ - public function copyFrom(meshStyle:MeshStyle):void - { - _texture = meshStyle._texture; - _textureBase = meshStyle._textureBase; - _textureRepeat = meshStyle._textureRepeat; - _textureSmoothing = meshStyle._textureSmoothing; - } - - /** Creates a clone of this instance. The method will work for subclasses automatically, - * no need to override it. */ - public function clone():MeshStyle - { - var clone:MeshStyle = new _type(); - clone.copyFrom(this); - return clone; - } - - /** Creates the effect that does the actual, low-level rendering. - * To be overridden by subclasses! - */ - public function createEffect():MeshEffect - { - return new MeshEffect(); - } - - /** Updates the settings of the given effect to match the current style. - * The given effect will always match the class returned by - * createEffect. - * - *

To be overridden by subclasses!

- */ - public function updateEffect(effect:MeshEffect, state:RenderState):void - { - effect.texture = _texture; - effect.textureRepeat = _textureRepeat; - effect.textureSmoothing = _textureSmoothing; - effect.mvpMatrix3D = state.mvpMatrix3D; - effect.alpha = state.alpha; - effect.tinted = _vertexData.tinted; - } - - /** Indicates if the current instance can be batched with the given style. - * To be overridden by subclasses if default behavior is not sufficient. - * The base implementation just checks if the styles are of the same type - * and if the textures are compatible. - */ - public function canBatchWith(meshStyle:MeshStyle):Boolean - { - if (_type == meshStyle._type) - { - var newTexture:Texture = meshStyle._texture; - - if (_texture == null && newTexture == null) return true; - else if (_texture && newTexture) - return _textureBase == meshStyle._textureBase && - _textureSmoothing == meshStyle._textureSmoothing && - _textureRepeat == meshStyle._textureRepeat; - else return false; - } - else return false; - } - - /** Copies the vertex data of the style's current target to the target of another style. - * If you pass a matrix, all vertices will be transformed during the process. - * - *

This method is used when batching meshes together for rendering. The parameter - * targetStyle will point to the style of a MeshBatch (a - * subclass of Mesh). Subclasses may override this method if they need - * to modify the vertex data in that process.

- */ - public function batchVertexData(targetStyle:MeshStyle, targetVertexID:int=0, - matrix:Matrix=null, vertexID:int=0, numVertices:int=-1):void - { - _vertexData.copyTo(targetStyle._vertexData, targetVertexID, matrix, vertexID, numVertices); - } - - /** Copies the index data of the style's current target to the target of another style. - * The given offset value will be added to all indices during the process. - * - *

This method is used when batching meshes together for rendering. The parameter - * targetStyle will point to the style of a MeshBatch (a - * subclass of Mesh). Subclasses may override this method if they need - * to modify the index data in that process.

- */ - public function batchIndexData(targetStyle:MeshStyle, targetIndexID:int=0, offset:int=0, - indexID:int=0, numIndices:int=-1):void - { - _indexData.copyTo(targetStyle._indexData, targetIndexID, offset, indexID, numIndices); - } - - /** Call this method if the target needs to be redrawn. - * The call is simply forwarded to the target mesh. */ - protected function setRequiresRedraw():void - { - if (_target) _target.setRequiresRedraw(); - } - - /** Call this method when the vertex data changed. - * The call is simply forwarded to the target mesh. */ - protected function setVertexDataChanged():void - { - if (_target) _target.setVertexDataChanged(); - } - - /** Call this method when the index data changed. - * The call is simply forwarded to the target mesh. */ - protected function setIndexDataChanged():void - { - if (_target) _target.setIndexDataChanged(); - } - - /** Called when assigning a target mesh. Override to plug in class-specific logic. */ - protected function onTargetAssigned(target:Mesh):void - { } - - // enter frame event - - override public function addEventListener(type:String, listener:Function):void - { - if (type == Event.ENTER_FRAME && _target) - _target.addEventListener(Event.ENTER_FRAME, onEnterFrame); - - super.addEventListener(type, listener); - } - - override public function removeEventListener(type:String, listener:Function):void - { - if (type == Event.ENTER_FRAME && _target) - _target.removeEventListener(type, onEnterFrame); - - super.removeEventListener(type, listener); - } - - private function onEnterFrame(event:Event):void - { - dispatchEvent(event); - } - - // internal methods - - /** @private */ - starling_internal function setTarget(target:Mesh=null, vertexData:VertexData=null, - indexData:IndexData=null):void - { - if (_target != target) - { - if (_target) _target.removeEventListener(Event.ENTER_FRAME, onEnterFrame); - if (vertexData) vertexData.format = vertexFormat; - - _target = target; - _vertexData = vertexData; - _indexData = indexData; - - if (target) - { - if (hasEventListener(Event.ENTER_FRAME)) - target.addEventListener(Event.ENTER_FRAME, onEnterFrame); - - onTargetAssigned(target); - } - } - } - - // vertex manipulation - - /** The position of the vertex at the specified index, in the mesh's local coordinate - * system. - * - *

Only modify the position of a vertex if you know exactly what you're doing, as - * some classes might not work correctly when their vertices are moved. E.g. the - * Quad class expects its vertices to spawn up a perfectly rectangular - * area; some of its optimized methods won't work correctly if that premise is no longer - * fulfilled or the original bounds change.

- */ - public function getVertexPosition(vertexID:int, out:Point=null):Point - { - return _vertexData.getPoint(vertexID, "position", out); - } - - public function setVertexPosition(vertexID:int, x:Number, y:Number):void - { - _vertexData.setPoint(vertexID, "position", x, y); - setVertexDataChanged(); - } - - /** Returns the alpha value of the vertex at the specified index. */ - public function getVertexAlpha(vertexID:int):Number - { - return _vertexData.getAlpha(vertexID); - } - - /** Sets the alpha value of the vertex at the specified index to a certain value. */ - public function setVertexAlpha(vertexID:int, alpha:Number):void - { - _vertexData.setAlpha(vertexID, "color", alpha); - setVertexDataChanged(); - } - - /** Returns the RGB color of the vertex at the specified index. */ - public function getVertexColor(vertexID:int):uint - { - return _vertexData.getColor(vertexID); - } - - /** Sets the RGB color of the vertex at the specified index to a certain value. */ - public function setVertexColor(vertexID:int, color:uint):void - { - _vertexData.setColor(vertexID, "color", color); - setVertexDataChanged(); - } - - /** Returns the texture coordinates of the vertex at the specified index. */ - public function getTexCoords(vertexID:int, out:Point = null):Point - { - if (_texture) return _texture.getTexCoords(_vertexData, vertexID, "texCoords", out); - else return _vertexData.getPoint(vertexID, "texCoords", out); - } - - /** Sets the texture coordinates of the vertex at the specified index to the given values. */ - public function setTexCoords(vertexID:int, u:Number, v:Number):void - { - if (_texture) _texture.setTexCoords(_vertexData, vertexID, "texCoords", u, v); - else _vertexData.setPoint(vertexID, "texCoords", u, v); - - setVertexDataChanged(); - } - - // properties - - /** Returns a reference to the vertex data of the assigned target (or null - * if there is no target). Beware: the style itself does not own any vertices; - * it is limited to manipulating those of the target mesh. */ - protected function get vertexData():VertexData { return _vertexData; } - - /** Returns a reference to the index data of the assigned target (or null - * if there is no target). Beware: the style itself does not own any indices; - * it is limited to manipulating those of the target mesh. */ - protected function get indexData():IndexData { return _indexData; } - - /** The actual class of this style. */ - public function get type():Class { return _type; } - - /** Changes the color of all vertices to the same value. - * The getter simply returns the color of the first vertex. */ - public function get color():uint - { - if (_vertexData.numVertices > 0) return _vertexData.getColor(0); - else return 0x0; - } - - public function set color(value:uint):void - { - var i:int; - var numVertices:int = _vertexData.numVertices; - - for (i=0; inull, if there is none). */ - public function get texture():Texture { return _texture; } - public function set texture(value:Texture):void - { - if (value != _texture) - { - if (value) - { - var i:int; - var numVertices:int = _vertexData ? _vertexData.numVertices : 0; - - for (i = 0; i < numVertices; ++i) - { - getTexCoords(i, sPoint); - value.setTexCoords(_vertexData, i, "texCoords", sPoint.x, sPoint.y); - } - - setVertexDataChanged(); - } - else setRequiresRedraw(); - - _texture = value; - _textureBase = value ? value.base : null; - } - } - - /** The smoothing filter that is used for the texture. @default bilinear */ - public function get textureSmoothing():String { return _textureSmoothing; } - public function set textureSmoothing(value:String):void - { - if (value != _textureSmoothing) - { - _textureSmoothing = value; - setRequiresRedraw(); - } - } - - /** Indicates if pixels at the edges will be repeated or clamped. - * Only works for power-of-two textures. @default false */ - public function get textureRepeat():Boolean { return _textureRepeat; } - public function set textureRepeat(value:Boolean):void { _textureRepeat = value; } - - /** The target the style is currently assigned to. */ - public function get target():Mesh { return _target; } - } -} diff --git a/mobile_version/src/starling/text/BitmapChar.as b/mobile_version/src/starling/text/BitmapChar.as deleted file mode 100644 index ac639bb3..00000000 --- a/mobile_version/src/starling/text/BitmapChar.as +++ /dev/null @@ -1,86 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= - -package starling.text -{ - import flash.utils.Dictionary; - - import starling.display.Image; - import starling.textures.Texture; - - /** A BitmapChar contains the information about one char of a bitmap font. - * You don't have to use this class directly in most cases. - * The TextField class contains methods that handle bitmap fonts for you. - */ - public class BitmapChar - { - private var _texture:Texture; - private var _charID:int; - private var _xOffset:Number; - private var _yOffset:Number; - private var _xAdvance:Number; - private var _kernings:Dictionary; - - /** Creates a char with a texture and its properties. */ - public function BitmapChar(id:int, texture:Texture, - xOffset:Number, yOffset:Number, xAdvance:Number) - { - _charID = id; - _texture = texture; - _xOffset = xOffset; - _yOffset = yOffset; - _xAdvance = xAdvance; - _kernings = null; - } - - /** Adds kerning information relative to a specific other character ID. */ - public function addKerning(charID:int, amount:Number):void - { - if (_kernings == null) - _kernings = new Dictionary(); - - _kernings[charID] = amount; - } - - /** Retrieve kerning information relative to the given character ID. */ - public function getKerning(charID:int):Number - { - if (_kernings == null || _kernings[charID] == undefined) return 0.0; - else return _kernings[charID]; - } - - /** Creates an image of the char. */ - public function createImage():Image - { - return new Image(_texture); - } - - /** The unicode ID of the char. */ - public function get charID():int { return _charID; } - - /** The number of points to move the char in x direction on character arrangement. */ - public function get xOffset():Number { return _xOffset; } - - /** The number of points to move the char in y direction on character arrangement. */ - public function get yOffset():Number { return _yOffset; } - - /** The number of points the cursor has to be moved to the right for the next char. */ - public function get xAdvance():Number { return _xAdvance; } - - /** The texture of the character. */ - public function get texture():Texture { return _texture; } - - /** The width of the character in points. */ - public function get width():Number { return _texture.width; } - - /** The height of the character in points. */ - public function get height():Number { return _texture.height; } - } -} \ No newline at end of file diff --git a/mobile_version/src/starling/text/BitmapFont.as b/mobile_version/src/starling/text/BitmapFont.as deleted file mode 100644 index 56872d75..00000000 --- a/mobile_version/src/starling/text/BitmapFont.as +++ /dev/null @@ -1,548 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= - -package starling.text -{ - import flash.geom.Rectangle; - import flash.utils.Dictionary; - - import starling.display.Image; - import starling.display.MeshBatch; - import starling.display.Sprite; - import starling.textures.Texture; - import starling.textures.TextureSmoothing; - import starling.utils.Align; - import starling.utils.StringUtil; - - /** The BitmapFont class parses bitmap font files and arranges the glyphs - * in the form of a text. - * - * The class parses the XML format as it is used in the - * AngelCode Bitmap Font Generator or - * the Glyph Designer. - * This is what the file format looks like: - * - *
 
-     *  <font>
-     *    <info face="BranchingMouse" size="40" />
-     *    <common lineHeight="40" />
-     *    <pages>  <!-- currently, only one page is supported -->
-     *      <page id="0" file="texture.png" />
-     *    </pages>
-     *    <chars>
-     *      <char id="32" x="60" y="29" width="1" height="1" xoffset="0" yoffset="27" xadvance="8" />
-     *      <char id="33" x="155" y="144" width="9" height="21" xoffset="0" yoffset="6" xadvance="9" />
-     *    </chars>
-     *    <kernings> <!-- Kerning is optional -->
-     *      <kerning first="83" second="83" amount="-4"/>
-     *    </kernings>
-     *  </font>
-     *  
- * - * Pass an instance of this class to the method registerBitmapFont of the - * TextField class. Then, set the fontName property of the text field to the - * name value of the bitmap font. This will make the text field use the bitmap - * font. - */ - public class BitmapFont implements ITextCompositor - { - /** Use this constant for the fontSize property of the TextField class to - * render the bitmap font in exactly the size it was created. */ - public static const NATIVE_SIZE:int = -1; - - /** The font name of the embedded minimal bitmap font. Use this e.g. for debug output. */ - public static const MINI:String = "mini"; - - private static const CHAR_SPACE:int = 32; - private static const CHAR_TAB:int = 9; - private static const CHAR_NEWLINE:int = 10; - private static const CHAR_CARRIAGE_RETURN:int = 13; - - private var _texture:Texture; - private var _chars:Dictionary; - private var _name:String; - private var _size:Number; - private var _lineHeight:Number; - private var _baseline:Number; - private var _offsetX:Number; - private var _offsetY:Number; - private var _padding:Number; - private var _helperImage:Image; - - // helper objects - private static var sLines:Array = []; - private static var sDefaultOptions:TextOptions = new TextOptions(); - - /** Creates a bitmap font by parsing an XML file and uses the specified texture. - * If you don't pass any data, the "mini" font will be created. */ - public function BitmapFont(texture:Texture=null, fontXml:XML=null) - { - // if no texture is passed in, we create the minimal, embedded font - if (texture == null && fontXml == null) - { - texture = MiniBitmapFont.texture; - fontXml = MiniBitmapFont.xml; - } - else if (texture == null || fontXml == null) - { - throw new ArgumentError("Set both of the 'texture' and 'fontXml' arguments to valid objects or leave both of them null."); - } - - _name = "unknown"; - _lineHeight = _size = _baseline = 14; - _offsetX = _offsetY = _padding = 0.0; - _texture = texture; - _chars = new Dictionary(); - _helperImage = new Image(texture); - - parseFontXml(fontXml); - } - - /** Disposes the texture of the bitmap font. */ - public function dispose():void - { - if (_texture) - _texture.dispose(); - } - - private function parseFontXml(fontXml:XML):void - { - var scale:Number = _texture.scale; - var frame:Rectangle = _texture.frame; - var frameX:Number = frame ? frame.x : 0; - var frameY:Number = frame ? frame.y : 0; - - _name = StringUtil.clean(fontXml.info.@face); - _size = parseFloat(fontXml.info.@size) / scale; - _lineHeight = parseFloat(fontXml.common.@lineHeight) / scale; - _baseline = parseFloat(fontXml.common.@base) / scale; - - if (fontXml.info.@smooth.toString() == "0") - smoothing = TextureSmoothing.NONE; - - if (_size <= 0) - { - trace("[Starling] Warning: invalid font size in '" + _name + "' font."); - _size = (_size == 0.0 ? 16.0 : _size * -1.0); - } - - for each (var charElement:XML in fontXml.chars.char) - { - var id:int = parseInt(charElement.@id); - var xOffset:Number = parseFloat(charElement.@xoffset) / scale; - var yOffset:Number = parseFloat(charElement.@yoffset) / scale; - var xAdvance:Number = parseFloat(charElement.@xadvance) / scale; - - var region:Rectangle = new Rectangle(); - region.x = parseFloat(charElement.@x) / scale + frameX; - region.y = parseFloat(charElement.@y) / scale + frameY; - region.width = parseFloat(charElement.@width) / scale; - region.height = parseFloat(charElement.@height) / scale; - - var texture:Texture = Texture.fromTexture(_texture, region); - var bitmapChar:BitmapChar = new BitmapChar(id, texture, xOffset, yOffset, xAdvance); - addChar(id, bitmapChar); - } - - for each (var kerningElement:XML in fontXml.kernings.kerning) - { - var first:int = parseInt(kerningElement.@first); - var second:int = parseInt(kerningElement.@second); - var amount:Number = parseFloat(kerningElement.@amount) / scale; - if (second in _chars) getChar(second).addKerning(first, amount); - } - } - - /** Returns a single bitmap char with a certain character ID. */ - public function getChar(charID:int):BitmapChar - { - return _chars[charID]; - } - - /** Adds a bitmap char with a certain character ID. */ - public function addChar(charID:int, bitmapChar:BitmapChar):void - { - _chars[charID] = bitmapChar; - } - - /** Returns a vector containing all the character IDs that are contained in this font. */ - public function getCharIDs(out:Vector.=null):Vector. - { - if (out == null) out = new []; - - for(var key:* in _chars) - out[out.length] = int(key); - - return out; - } - - /** Checks whether a provided string can be displayed with the font. */ - public function hasChars(text:String):Boolean - { - if (text == null) return true; - - var charID:int; - var numChars:int = text.length; - - for (var i:int=0; i = arrangeChars(width, height, text, format, options); - var numChars:int = charLocations.length; - var smoothing:String = this.smoothing; - var sprite:Sprite = new Sprite(); - - for (var i:int=0; i = arrangeChars( - width, height, text, format, options); - var numChars:int = charLocations.length; - _helperImage.color = format.color; - - for (var i:int=0; i - { - if (text == null || text.length == 0) return CharLocation.vectorFromPool(); - if (options == null) options = sDefaultOptions; - - var kerning:Boolean = format.kerning; - var leading:Number = format.leading; - var hAlign:String = format.horizontalAlign; - var vAlign:String = format.verticalAlign; - var fontSize:Number = format.size; - var autoScale:Boolean = options.autoScale; - var wordWrap:Boolean = options.wordWrap; - - var finished:Boolean = false; - var charLocation:CharLocation; - var numChars:int; - var containerWidth:Number; - var containerHeight:Number; - var scale:Number; - var i:int, j:int; - - if (fontSize < 0) fontSize *= -_size; - - while (!finished) - { - sLines.length = 0; - scale = fontSize / _size; - containerWidth = (width - 2 * _padding) / scale; - containerHeight = (height - 2 * _padding) / scale; - - if (_lineHeight <= containerHeight) - { - var lastWhiteSpace:int = -1; - var lastCharID:int = -1; - var currentX:Number = 0; - var currentY:Number = 0; - var currentLine:Vector. = CharLocation.vectorFromPool(); - - numChars = text.length; - for (i=0; i containerWidth) - { - if (wordWrap) - { - // when autoscaling, we must not split a word in half -> restart - if (autoScale && lastWhiteSpace == -1) - break; - - // remove characters and add them again to next line - var numCharsToRemove:int = lastWhiteSpace == -1 ? 1 : i - lastWhiteSpace; - - for (j=0; j 3) - fontSize -= 1; - else - finished = true; - } // while (!finished) - - var finalLocations:Vector. = CharLocation.vectorFromPool(); - var numLines:int = sLines.length; - var bottom:Number = currentY + _lineHeight; - var yOffset:int = 0; - - if (vAlign == Align.BOTTOM) yOffset = containerHeight - bottom; - else if (vAlign == Align.CENTER) yOffset = (containerHeight - bottom) / 2; - - for (var lineID:int=0; lineID = sLines[lineID]; - numChars = line.length; - - if (numChars == 0) continue; - - var xOffset:int = 0; - var lastLocation:CharLocation = line[line.length-1]; - var right:Number = lastLocation.x - lastLocation.char.xOffset - + lastLocation.char.xAdvance; - - if (hAlign == Align.RIGHT) xOffset = containerWidth - right; - else if (hAlign == Align.CENTER) xOffset = (containerWidth - right) / 2; - - for (var c:int=0; c 0 && charLocation.char.height > 0) - finalLocations[finalLocations.length] = charLocation; - } - } - - return finalLocations; - } - - /** The name of the font as it was parsed from the font file. */ - public function get name():String { return _name; } - - /** The native size of the font. */ - public function get size():Number { return _size; } - - /** The height of one line in points. */ - public function get lineHeight():Number { return _lineHeight; } - public function set lineHeight(value:Number):void { _lineHeight = value; } - - /** The smoothing filter that is used for the texture. */ - public function get smoothing():String { return _helperImage.textureSmoothing; } - public function set smoothing(value:String):void { _helperImage.textureSmoothing = value; } - - /** The baseline of the font. This property does not affect text rendering; - * it's just an information that may be useful for exact text placement. */ - public function get baseline():Number { return _baseline; } - public function set baseline(value:Number):void { _baseline = value; } - - /** An offset that moves any generated text along the x-axis (in points). - * Useful to make up for incorrect font data. @default 0. */ - public function get offsetX():Number { return _offsetX; } - public function set offsetX(value:Number):void { _offsetX = value; } - - /** An offset that moves any generated text along the y-axis (in points). - * Useful to make up for incorrect font data. @default 0. */ - public function get offsetY():Number { return _offsetY; } - public function set offsetY(value:Number):void { _offsetY = value; } - - /** The width of a "gutter" around the composed text area, in points. - * This can be used to bring the output more in line with standard TrueType rendering: - * Flash always draws them with 2 pixels of padding. @default 0.0 */ - public function get padding():Number { return _padding; } - public function set padding(value:Number):void { _padding = value; } - - /** The underlying texture that contains all the chars. */ - public function get texture():Texture { return _texture; } - } -} - -import starling.text.BitmapChar; - -class CharLocation -{ - public var char:BitmapChar; - public var scale:Number; - public var x:Number; - public var y:Number; - - public function CharLocation(char:BitmapChar) - { - reset(char); - } - - private function reset(char:BitmapChar):CharLocation - { - this.char = char; - return this; - } - - // pooling - - private static var sInstancePool:Vector. = new []; - private static var sVectorPool:Array = []; - - private static var sInstanceLoan:Vector. = new []; - private static var sVectorLoan:Array = []; - - public static function instanceFromPool(char:BitmapChar):CharLocation - { - var instance:CharLocation = sInstancePool.length > 0 ? - sInstancePool.pop() : new CharLocation(char); - - instance.reset(char); - sInstanceLoan[sInstanceLoan.length] = instance; - - return instance; - } - - public static function vectorFromPool():Vector. - { - var vector:Vector. = sVectorPool.length > 0 ? - sVectorPool.pop() : new []; - - vector.length = 0; - sVectorLoan[sVectorLoan.length] = vector; - - return vector; - } - - public static function rechargePool():void - { - var instance:CharLocation; - var vector:Vector.; - - while (sInstanceLoan.length > 0) - { - instance = sInstanceLoan.pop(); - instance.char = null; - sInstancePool[sInstancePool.length] = instance; - } - - while (sVectorLoan.length > 0) - { - vector = sVectorLoan.pop(); - vector.length = 0; - sVectorPool[sVectorPool.length] = vector; - } - } -} diff --git a/mobile_version/src/starling/text/ITextCompositor.as b/mobile_version/src/starling/text/ITextCompositor.as deleted file mode 100644 index e438868b..00000000 --- a/mobile_version/src/starling/text/ITextCompositor.as +++ /dev/null @@ -1,29 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= - -package starling.text -{ - import starling.display.MeshBatch; - - /** A text compositor arranges letters for Starling's TextField. */ - public interface ITextCompositor - { - /** Draws the given text into a MeshBatch, using the supplied format and options. */ - function fillMeshBatch(meshBatch:MeshBatch, width:Number, height:Number, text:String, - format:TextFormat, options:TextOptions=null):void; - - /** Clears the MeshBatch (filled by the same class) and disposes any resources that - * are no longer needed. */ - function clearMeshBatch(meshBatch:MeshBatch):void; - - /** Frees all resources allocated by the compositor. */ - function dispose():void; - } -} diff --git a/mobile_version/src/starling/text/MiniBitmapFont.as b/mobile_version/src/starling/text/MiniBitmapFont.as deleted file mode 100644 index 084faed8..00000000 --- a/mobile_version/src/starling/text/MiniBitmapFont.as +++ /dev/null @@ -1,314 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= - -package starling.text -{ - import flash.display.BitmapData; - import flash.display3D.Context3DTextureFormat; - import flash.geom.Rectangle; - import flash.utils.ByteArray; - - import starling.textures.Texture; - - /** @private - * This class contains constants for the 'MINI' bitmap font. It's done that way to avoid - * a dependency on the 'mx.core' library (which is required for the 'Embed' statement). - * - *

The font is based on "uni05_53.ttf" from Craig Kroeger (http://www.miniml.com) and was - * converted to a Bitmap Font with "GlyphDesigner" from 71squared (http://www.71squared.com). - *

*/ - internal class MiniBitmapFont - { - private static const BITMAP_WIDTH:int = 128; - private static const BITMAP_HEIGHT:int = 64; - private static const BITMAP_DATA:Array = [ - 2027613533, 3413039936, 202148514, 2266925598, 4206886452, 4286853117, 2034947, - 3202703399, 352977282, 2957757964, 3113652880, 2158068882, 1468709156, 2268063717, - 2779310143, 2101025806, 3416509055, 4215794539, 3602168838, 1038056207, 1932393374, - 3182285627, 3086802234, 1741291262, 2017257123, 3395280843, 984074419, 3049693147, - 3986077023, 1055013549, 1806563255, 1754714962, 1577746187, 1124058786, 3888759258, - 2482229043, 2916583666, 3743065328, 866060213, 1695195001, 2401582068, 3113347901, - 2616521596, 1053798161, 2093370968, 4229025683, 560451479, 854767518, 2610241322, - 4279041348, 4181572480, 4031244973, 587139110, 1081376765, 962217926, 783603325, - 3605526425, 4102001916, 289204733, 2635140255, 3453981695, 3487854373, 2132197241, - 3164775074, 4257640328, 770238970, 144664537, 707141570, 2934433071, 871272893, - 512964596, 808491899, 481894297, 3095982481, 3598364156, 1710636358, 2904016319, - 1751040139, 596966466, 1363963692, 465815609, 315567311, 4290666159, 4086022551, - 179721458, 2221734970, 3942224988, 1519355876, 3292323782, 3933427230, 3314199893, - 3736227348, 3846038425, 603088884, 2677349227, 3207069327, 3555275967, 3063054283, - 3064577213, 3412044179, 693642210, 4280513949, 762928717, 1802215333, 3774849674, - 4221155330, 970959395, 557220237, 2107226136, 3509822982, 3403284788, 4265820019, - 898597576, 991077243, 2091615904, 3334716888, 633599866, 4218780109, 2216000376, - 834870947, 2118009742, 1362731961, 236280636, 1274945142, 1458729366, 797960805, - 3289369720, 2103717340, 3946406003, 2676522889, 1624104606, 1156993903, 3186170404, - 2254499071, 1204911924, 1314218830, 3307086392, 2824275959, 3839865679, 2073394964, - 1873329433, 1754205930, 1528429545, 1631106062, 2263272465, 4220497047, 3522893765, - 3641376303, 707451487, 3452496787, 1390653868, 2620555793, 1027328684, 3419683476, - 3662193703, 765701986, 3808279132, 786403271, 3824435837, 713234896, 4261856399, - 3471930731, 3993492879, 1447960461, 1398434593, 1914230187, 2398643285, 4156374464, - 3859339207, 3220700061, 3373248762, 3186030434, 1315917060, 2809852481, 4008553903, - 4105611953, 1599499652, 3513857591, 877854499, 4198259455, 3648560077, 2838035419, - 3255594190, 2465578457, 4263505201, 534904657, 2889261598, 1358214576, 1069250354, - 3870010557, 2628896583, 3448610878, 442343309, 1024736866, 4015119133, 3250867279, - 1513359261, 2442089596, 1944476762, 735490552, 426990058, 4234106111, 1204305707, - 3330995265, 2398649368, 4221048123, 1724669255, 3801115709, 3489328790, 3896402933, - 3696936939, 2836983295, 3656750393, 3349724512, 3810416287, 3654997608, 4284455103, - 2294939563, 4207697932, 642748805, 2476981639, 2319419898, 572956615, 3833238940, - 964924880, 2081600351, 3572458416, 2056247513, 1951368808, 2133449703, 2783728628, - 512866577, 913279200, 1678129016, 3488578991, 3373952929, 2562996951, 3666058925, - 1664169178, 1943591935, 750675303, 154399903, 2571590890, 852654952, 4117307766, - 1971649621, 4180195820, 1222535348, 4283953215, 2880662236, 2717410980, 1175907705, - 1157322027, 505963121, 2631540616, 3661227656, 3591803353, 2624126821, 1948662907, - 3596065103, 1147387734, 256773959, 1173572460, 2361957471, 4210876076, 3080180620, - 3464801210, 3821654259, 1465302035, 2851185457, 3143266144, 3793180414, 3368833103, - 4274670712, 3473819108, 3487569332, 773123355, 1618635668, 2570176190, 2075248691, - 1740805534, 288646743, 1837597401, 603556968, 3182536872, 673184603, 3088757053, - 2897054404, 3192651316, 2885335802, 1057233368, 1118437241, 4182126463, 3110464775, - 3313191614, 2360987274, 735505357, 2992631425, 2360928811, 4187834527, 279183208, - 1586420003, 1174008423, 4062987589, 1162167621, 1162167621, 1162167621, 1162167621, - 1174119799, 787274608 - ]; - - private static const XML_DATA:XML = - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ; - - public static function get texture():Texture - { - var bitmapData:BitmapData = getBitmapData(); - var format:String = Context3DTextureFormat.BGRA_PACKED; - var texture:Texture = Texture.fromBitmapData(bitmapData, false, false, 1, format); - bitmapData.dispose(); - bitmapData = null; - - texture.root.onRestore = function():void - { - bitmapData = getBitmapData(); - texture.root.uploadBitmapData(bitmapData); - bitmapData.dispose(); - bitmapData = null; - }; - - return texture; - } - - private static function getBitmapData():BitmapData - { - var bmpData:BitmapData = new BitmapData(BITMAP_WIDTH, BITMAP_HEIGHT); - var bmpBytes:ByteArray = new ByteArray(); - var numBytes:int = BITMAP_DATA.length; - - for (var i:int=0; iAccess the format property to modify the appearance of the text, like the - * font name and size, a color, the horizontal and vertical alignment, etc. The border property - * is useful during development, because it lets you see the bounds of the TextField.

- * - *

There are several types of fonts that can be displayed:

- * - *
    - *
  • Standard TrueType fonts. This renders the text just like a conventional Flash - * TextField. It is recommended to embed the font, since you cannot be sure which fonts - * are available on the client system, and since this enhances rendering quality. - * Simply pass the font name to the corresponding property.
  • - *
  • Bitmap fonts. If you need speed or fancy font effects, use a bitmap font instead. - * That is a font that has its glyphs rendered to a texture atlas. To use it, first - * register the font with the method registerBitmapFont, and then pass - * the font name to the corresponding property of the text field.
  • - *
  • Custom text compositors. Any class implementing the ITextCompositor - * interface can be used to render text. If the two standard options are not sufficient - * for your needs, such a compositor might do the trick.
  • - *
- * - *

For bitmap fonts, we recommend one of the following tools:

- * - *
    - *
  • Windows: Bitmap Font Generator - * from Angel Code (free). Export the font data as an XML file and the texture as a png - * with white characters on a transparent background (32 bit).
  • - *
  • Mac OS: Glyph Designer from - * 71squared or bmGlyph (both commercial). - * They support Starling natively.
  • - *
  • Cross-Platform: Littera or - * ShoeBox are great tools, as well. - * Both are free to use and were built with Adobe AIR.
  • - *
- * - *

When using a bitmap font, the 'color' property is used to tint the font texture. This - * works by multiplying the RGB values of that property with those of the texture's pixel. - * If your font contains just a single color, export it in plain white and change the 'color' - * property to any value you like (it defaults to zero, which means black). If your font - * contains multiple colors, change the 'color' property to Color.WHITE to get - * the intended result.

- * - * Batching of TextFields - * - *

Normally, TextFields will require exactly one draw call. For TrueType fonts, you cannot - * avoid that; bitmap fonts, however, may be batched if you enable the "batchable" property. - * This makes sense if you have several TextFields with short texts that are rendered one - * after the other (e.g. subsequent children of the same sprite), or if your bitmap font - * texture is in your main texture atlas.

- * - *

The recommendation is to activate "batchable" if it reduces your draw calls (use the - * StatsDisplay to check this) AND if the text fields contain no more than about 15-20 - * characters. For longer texts, the batching would take up more CPU time than what is saved - * by avoiding the draw calls.

- */ - public class TextField extends DisplayObjectContainer - { - // the name of the "sharedData" container with the registered compositors - private static const COMPOSITOR_DATA_NAME:String = "starling.display.TextField.compositors"; - - private var _text:String; - private var _options:TextOptions; - private var _format:TextFormat; - private var _textBounds:Rectangle; - private var _hitArea:Rectangle; - private var _compositor:ITextCompositor; - private var _requiresRecomposition:Boolean; - private var _border:DisplayObjectContainer; - private var _meshBatch:MeshBatch; - private var _style:MeshStyle; - - // helper objects - private static var sMatrix:Matrix = new Matrix(); - private static var sDefaultCompositor:ITextCompositor = new TrueTypeCompositor(); - private static var sDefaultTextureFormat:String = Context3DTextureFormat.BGRA_PACKED; - private var _helperFormat:TextFormat = new TextFormat(); - - /** Create a new text field with the given properties. */ - public function TextField(width:int, height:int, text:String="", format:TextFormat=null) - { - _text = text ? text : ""; - _hitArea = new Rectangle(0, 0, width, height); - _requiresRecomposition = true; - _compositor = sDefaultCompositor; - _options = new TextOptions(); - - _format = format ? format.clone() : new TextFormat(); - _format.addEventListener(Event.CHANGE, setRequiresRecomposition); - - _meshBatch = new MeshBatch(); - _meshBatch.touchable = false; - _meshBatch.pixelSnapping = true; - addChild(_meshBatch); - } - - /** Disposes the underlying texture data. */ - public override function dispose():void - { - _format.removeEventListener(Event.CHANGE, setRequiresRecomposition); - _compositor.clearMeshBatch(_meshBatch); - - super.dispose(); - } - - /** @inheritDoc */ - public override function render(painter:Painter):void - { - if (_requiresRecomposition) recompose(); - super.render(painter); - } - - /** Forces the text contents to be composed right away. - * Normally, it will only do so lazily, i.e. before being rendered. */ - private function recompose():void - { - if (_requiresRecomposition) - { - _compositor.clearMeshBatch(_meshBatch); - - var fontName:String = _format.font; - var compositor:ITextCompositor = getCompositor(fontName); - - if (compositor == null && fontName == BitmapFont.MINI) - { - compositor = new BitmapFont(); - registerCompositor(compositor, fontName); - } - - _compositor = compositor ? compositor : sDefaultCompositor; - - updateText(); - updateBorder(); - - _requiresRecomposition = false; - } - } - - // font and border rendering - - private function updateText():void - { - var width:Number = _hitArea.width; - var height:Number = _hitArea.height; - var format:TextFormat = _helperFormat; - - // By working on a copy of the TextFormat, we make sure that modifications done - // within the 'fillMeshBatch' method do not cause any side effects. - // - // (We cannot use a static variable, because that might lead to problems when - // recreating textures after a context loss.) - - format.copyFrom(_format); - - // Horizontal autoSize does not work for HTML text, since it supports custom alignment. - // What should we do if one line is aligned to the left, another to the right? - - if (isHorizontalAutoSize && !_options.isHtmlText) width = 100000; - if (isVerticalAutoSize) height = 100000; - - _meshBatch.x = _meshBatch.y = 0; - _options.textureScale = Starling.contentScaleFactor; - _options.textureFormat = sDefaultTextureFormat; - _compositor.fillMeshBatch(_meshBatch, width, height, _text, format, _options); - - if (_style) _meshBatch.style = _style; - if (_options.autoSize != TextFieldAutoSize.NONE) - { - _textBounds = _meshBatch.getBounds(_meshBatch, _textBounds); - - if (isHorizontalAutoSize) - { - _meshBatch.x = _textBounds.x = -_textBounds.x; - _hitArea.width = _textBounds.width; - _textBounds.x = 0; - } - - if (isVerticalAutoSize) - { - _meshBatch.y = _textBounds.y = -_textBounds.y; - _hitArea.height = _textBounds.height; - _textBounds.y = 0; - } - } - else - { - // hit area doesn't change, and text bounds can be created on demand - _textBounds = null; - } - } - - private function updateBorder():void - { - if (_border == null) return; - - var width:Number = _hitArea.width; - var height:Number = _hitArea.height; - - var topLine:Quad = _border.getChildAt(0) as Quad; - var rightLine:Quad = _border.getChildAt(1) as Quad; - var bottomLine:Quad = _border.getChildAt(2) as Quad; - var leftLine:Quad = _border.getChildAt(3) as Quad; - - topLine.width = width; topLine.height = 1; - bottomLine.width = width; bottomLine.height = 1; - leftLine.width = 1; leftLine.height = height; - rightLine.width = 1; rightLine.height = height; - rightLine.x = width - 1; - bottomLine.y = height - 1; - topLine.color = rightLine.color = bottomLine.color = leftLine.color = _format.color; - } - - /** Forces the text to be recomposed before rendering it in the upcoming frame. */ - protected function setRequiresRecomposition():void - { - _requiresRecomposition = true; - setRequiresRedraw(); - } - - // properties - - private function get isHorizontalAutoSize():Boolean - { - return _options.autoSize == TextFieldAutoSize.HORIZONTAL || - _options.autoSize == TextFieldAutoSize.BOTH_DIRECTIONS; - } - - private function get isVerticalAutoSize():Boolean - { - return _options.autoSize == TextFieldAutoSize.VERTICAL || - _options.autoSize == TextFieldAutoSize.BOTH_DIRECTIONS; - } - - /** Returns the bounds of the text within the text field. */ - public function get textBounds():Rectangle - { - if (_requiresRecomposition) recompose(); - if (_textBounds == null) _textBounds = _meshBatch.getBounds(this); - return _textBounds.clone(); - } - - /** @inheritDoc */ - public override function getBounds(targetSpace:DisplayObject, out:Rectangle=null):Rectangle - { - if (_requiresRecomposition) recompose(); - getTransformationMatrix(targetSpace, sMatrix); - return RectangleUtil.getBounds(_hitArea, sMatrix, out); - } - - /** @inheritDoc */ - public override function hitTest(localPoint:Point):DisplayObject - { - if (!visible || !touchable || !hitTestMask(localPoint)) return null; - else if (_hitArea.containsPoint(localPoint)) return this; - else return null; - } - - /** @inheritDoc */ - public override function set width(value:Number):void - { - // different to ordinary display objects, changing the size of the text field should - // not change the scaling, but make the texture bigger/smaller, while the size - // of the text/font stays the same (this applies to the height, as well). - - _hitArea.width = value / (scaleX || 1.0); - setRequiresRecomposition(); - } - - /** @inheritDoc */ - public override function set height(value:Number):void - { - _hitArea.height = value / (scaleY || 1.0); - setRequiresRecomposition(); - } - - /** The displayed text. */ - public function get text():String { return _text; } - public function set text(value:String):void - { - if (value == null) value = ""; - if (_text != value) - { - _text = value; - setRequiresRecomposition(); - } - } - - /** The format describes how the text will be rendered, describing the font name and size, - * color, alignment, etc. - * - *

Note that you can edit the font properties directly; there's no need to reassign - * the format for the changes to show up.

- * - * - * var textField:TextField = new TextField(100, 30, "Hello Starling"); - * textField.format.font = "Arial"; - * textField.format.color = Color.RED; - * - * @default Verdana, 12 pt, black, centered - */ - public function get format():TextFormat { return _format; } - public function set format(value:TextFormat):void - { - if (value == null) throw new ArgumentError("format cannot be null"); - _format.copyFrom(value); - } - - /** Draws a border around the edges of the text field. Useful for visual debugging. - * @default false */ - public function get border():Boolean { return _border != null; } - public function set border(value:Boolean):void - { - if (value && _border == null) - { - _border = new Sprite(); - addChild(_border); - - for (var i:int=0; i<4; ++i) - _border.addChild(new Quad(1.0, 1.0)); - - updateBorder(); - } - else if (!value && _border != null) - { - _border.removeFromParent(true); - _border = null; - } - } - - /** Indicates whether the font size is automatically reduced if the complete text does - * not fit into the TextField. @default false */ - public function get autoScale():Boolean { return _options.autoScale; } - public function set autoScale(value:Boolean):void - { - if (_options.autoScale != value) - { - _options.autoScale = value; - setRequiresRecomposition(); - } - } - - /** Specifies the type of auto-sizing the TextField will do. - * Note that any auto-sizing will implicitly deactivate all auto-scaling. - * @default none */ - public function get autoSize():String { return _options.autoSize; } - public function set autoSize(value:String):void - { - if (_options.autoSize != value) - { - _options.autoSize = value; - setRequiresRecomposition(); - } - } - - /** Indicates if the text should be wrapped at word boundaries if it does not fit into - * the TextField otherwise. @default true */ - public function get wordWrap():Boolean { return _options.wordWrap; } - public function set wordWrap(value:Boolean):void - { - if (value != _options.wordWrap) - { - _options.wordWrap = value; - setRequiresRecomposition(); - } - } - - /** Indicates if TextField should be batched on rendering. - * - *

This works only with bitmap fonts, and it makes sense only for TextFields with no - * more than 10-15 characters. Otherwise, the CPU costs will exceed any gains you get - * from avoiding the additional draw call.

- * - * @default false - */ - public function get batchable():Boolean { return _meshBatch.batchable; } - public function set batchable(value:Boolean):void - { - _meshBatch.batchable = value; - } - - /** Indicates if text should be interpreted as HTML code. For a description - * of the supported HTML subset, refer to the classic Flash 'TextField' documentation. - * Clickable hyperlinks and external images are not supported. Only works for - * TrueType fonts! @default false */ - public function get isHtmlText():Boolean { return _options.isHtmlText; } - public function set isHtmlText(value:Boolean):void - { - if (_options.isHtmlText != value) - { - _options.isHtmlText = value; - setRequiresRecomposition(); - } - } - - /** Controls whether or not the instance snaps to the nearest pixel. This can prevent the - * object from looking blurry when it's not exactly aligned with the pixels of the screen. - * @default true */ - public function get pixelSnapping():Boolean { return _meshBatch.pixelSnapping; } - public function set pixelSnapping(value:Boolean):void { _meshBatch.pixelSnapping = value } - - /** The style that is used to render the text's mesh. */ - public function get style():MeshStyle { return _meshBatch.style; } - public function set style(value:MeshStyle):void - { - _meshBatch.style = _style = value; - setRequiresRecomposition(); - } - - /** The Context3D texture format that is used for rendering of all TrueType texts. - * The default provides a good compromise between quality and memory consumption; - * use
Context3DTextureFormat.BGRA
for the highest quality. - * - * @default Context3DTextureFormat.BGRA_PACKED */ - public static function get defaultTextureFormat():String { return sDefaultTextureFormat; } - public static function set defaultTextureFormat(value:String):void - { - sDefaultTextureFormat = value; - } - - /** The default compositor used to arrange the letters of the text. - * If a specific compositor was registered for a font, it takes precedence. - * - * @default TrueTypeCompositor - */ - public static function get defaultCompositor():ITextCompositor { return sDefaultCompositor; } - public static function set defaultCompositor(value:ITextCompositor):void - { - sDefaultCompositor = value; - } - - /** Updates the list of embedded fonts. Call this method when you loaded a TrueType font - * at runtime so that Starling can recognize it as such. */ - public static function updateEmbeddedFonts():void - { - SystemUtil.updateEmbeddedFonts(); - } - - // compositor registration - - /** Makes a text compositor (like a BitmapFont) available to any TextField in - * the current stage3D context. The font is identified by its name (not - * case sensitive). */ - public static function registerCompositor(compositor:ITextCompositor, name:String):void - { - if (name == null) throw new ArgumentError("name must not be null"); - compositors[convertToLowerCase(name)] = compositor; - } - - /** Unregisters the text compositor and, optionally, disposes it. */ - public static function unregisterCompositor(name:String, dispose:Boolean=true):void - { - name = convertToLowerCase(name); - - if (dispose && compositors[name] != undefined) - compositors[name].dispose(); - - delete compositors[name]; - } - - /** Returns a registered text compositor (or null, if the font has not been registered). - * The name is not case sensitive. */ - public static function getCompositor(name:String):ITextCompositor - { - return compositors[convertToLowerCase(name)]; - } - - /** Makes a bitmap font available at any TextField in the current stage3D context. - * The font is identified by its name (not case sensitive). - * Per default, the name property of the bitmap font will be used, but you - * can pass a custom name, as well. @return the name of the font. */ - [Deprecated(replacement="registerCompositor")] - public static function registerBitmapFont(bitmapFont:BitmapFont, name:String=null):String - { - if (name == null) name = bitmapFont.name; - registerCompositor(bitmapFont, name); - return name; - } - - /** Unregisters the bitmap font and, optionally, disposes it. */ - [Deprecated(replacement="unregisterCompositor")] - public static function unregisterBitmapFont(name:String, dispose:Boolean=true):void - { - unregisterCompositor(name, dispose); - } - - /** Returns a registered bitmap font compositor (or null, if no compositor has been - * registered with that name, or if it's not a bitmap font). The name is not case - * sensitive. */ - public static function getBitmapFont(name:String):BitmapFont - { - return getCompositor(name) as BitmapFont; - } - - /** Stores the currently available text compositors. Since compositors will only work - * in one Stage3D context, they are saved in Starling's 'contextData' property. */ - private static function get compositors():Dictionary - { - var compositors:Dictionary = Starling.painter.sharedData[COMPOSITOR_DATA_NAME] as Dictionary; - - if (compositors == null) - { - compositors = new Dictionary(); - Starling.painter.sharedData[COMPOSITOR_DATA_NAME] = compositors; - } - - return compositors; - } - - // optimization for 'toLowerCase' calls - - private static var sStringCache:Dictionary = new Dictionary(); - - private static function convertToLowerCase(string:String):String - { - var result:String = sStringCache[string]; - if (result == null) - { - result = string.toLowerCase(); - sStringCache[string] = result; - } - return result; - } - } -} diff --git a/mobile_version/src/starling/text/TextFieldAutoSize.as b/mobile_version/src/starling/text/TextFieldAutoSize.as deleted file mode 100644 index 268c5696..00000000 --- a/mobile_version/src/starling/text/TextFieldAutoSize.as +++ /dev/null @@ -1,36 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= - -package starling.text -{ - import starling.errors.AbstractClassError; - - /** This class is an enumeration of constant values used in setting the - * autoSize property of the TextField class. */ - public class TextFieldAutoSize - { - /** @private */ - public function TextFieldAutoSize() { throw new AbstractClassError(); } - - /** No auto-sizing will happen. */ - public static const NONE:String = "none"; - - /** The text field will grow/shrink sidewards; no line-breaks will be added. - * The height of the text field remains unchanged. Not supported for HTML text! */ - public static const HORIZONTAL:String = "horizontal"; - - /** The text field will grow/shrink downwards, adding line-breaks when necessary. - * The width of the text field remains unchanged. */ - public static const VERTICAL:String = "vertical"; - - /** The text field will grow to the right and bottom; no line-breaks will be added. */ - public static const BOTH_DIRECTIONS:String = "bothDirections"; - } -} \ No newline at end of file diff --git a/mobile_version/src/starling/text/TextFormat.as b/mobile_version/src/starling/text/TextFormat.as deleted file mode 100644 index 50f28d28..00000000 --- a/mobile_version/src/starling/text/TextFormat.as +++ /dev/null @@ -1,236 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= - -package starling.text -{ - import flash.text.TextFormat; - - import starling.events.Event; - import starling.events.EventDispatcher; - import starling.utils.Align; - - /** Dispatched when any property of the instance changes. */ - [Event(name="change", type="starling.events.Event")] - - /** The TextFormat class represents character formatting information. It is used by the - * TextField and BitmapFont classes to characterize the way the glyphs will be rendered. - * - *

Note that not all properties are used by all font renderers: bitmap fonts ignore - * the "bold", "italic", and "underline" values.

- */ - public class TextFormat extends EventDispatcher - { - private var _font:String; - private var _size:Number; - private var _color:uint; - private var _bold:Boolean; - private var _italic:Boolean; - private var _underline:Boolean; - private var _horizontalAlign:String; - private var _verticalAlign:String; - private var _kerning:Boolean; - private var _leading:Number; - - /** Creates a new TextFormat instance with the given properties. */ - public function TextFormat(font:String="Verdana", size:Number=12, color:uint=0x0, - horizontalAlign:String="center", verticalAlign:String="center") - { - _font = font; - _size = size; - _color = color; - _horizontalAlign = horizontalAlign; - _verticalAlign = verticalAlign; - _kerning = true; - _leading = 0.0; - } - - /** Copies all properties from another TextFormat instance. */ - public function copyFrom(format:starling.text.TextFormat):void - { - _font = format._font; - _size = format._size; - _color = format._color; - _bold = format._bold; - _italic = format._italic; - _underline = format._underline; - _horizontalAlign = format._horizontalAlign; - _verticalAlign = format._verticalAlign; - _kerning = format._kerning; - _leading = format._leading; - - dispatchEventWith(Event.CHANGE); - } - - /** Creates a clone of this instance. */ - public function clone():starling.text.TextFormat - { - var clone:starling.text.TextFormat = new starling.text.TextFormat(); - clone.copyFrom(this); - return clone; - } - - /** Sets the most common properties at once. */ - public function setTo(font:String="Verdana", size:Number=12, color:uint=0x0, - horizontalAlign:String="center", verticalAlign:String="center"):void - { - _font = font; - _size = size; - _color = color; - _horizontalAlign = horizontalAlign; - _verticalAlign = verticalAlign; - - dispatchEventWith(Event.CHANGE); - } - - /** Converts the Starling TextFormat instance to a Flash TextFormat. */ - public function toNativeFormat(out:flash.text.TextFormat=null):flash.text.TextFormat - { - if (out == null) out = new flash.text.TextFormat(); - - out.font = _font; - out.size = _size; - out.color = _color; - out.bold = _bold; - out.italic = _italic; - out.underline = _underline; - out.align = _horizontalAlign; - out.kerning = _kerning; - out.leading = _leading; - - return out; - } - - /** The name of the font. TrueType fonts will be looked up from embedded fonts and - * system fonts; bitmap fonts must be registered at the TextField class first. - * Beware: If you loaded an embedded font at runtime, you must call - * TextField.updateEmbeddedFonts() for Starling to recognize it. - */ - public function get font():String { return _font; } - public function set font(value:String):void - { - if (value != _font) - { - _font = value; - dispatchEventWith(Event.CHANGE); - } - } - - /** The size of the font. For bitmap fonts, use BitmapFont.NATIVE_SIZE for - * the original size. */ - public function get size():Number { return _size; } - public function set size(value:Number):void - { - if (value != _size) - { - _size = value; - dispatchEventWith(Event.CHANGE); - } - } - - /** The color of the text. Note that bitmap fonts should be exported in plain white so - * that tinting works correctly. If your bitmap font contains colors, set this property - * to Color.WHITE to get the desired result. @default black */ - public function get color():uint { return _color; } - public function set color(value:uint):void - { - if (value != _color) - { - _color = value; - dispatchEventWith(Event.CHANGE); - } - } - - /** Indicates whether the text is bold. @default false */ - public function get bold():Boolean { return _bold; } - public function set bold(value:Boolean):void - { - if (value != _bold) - { - _bold = value; - dispatchEventWith(Event.CHANGE); - } - } - - /** Indicates whether the text is italicized. @default false */ - public function get italic():Boolean { return _italic; } - public function set italic(value:Boolean):void - { - if (value != _italic) - { - _italic = value; - dispatchEventWith(Event.CHANGE); - } - } - - /** Indicates whether the text is underlined. @default false */ - public function get underline():Boolean { return _underline; } - public function set underline(value:Boolean):void - { - if (value != _underline) - { - _underline = value; - dispatchEventWith(Event.CHANGE); - } - } - - /** The horizontal alignment of the text. @default center - * @see starling.utils.Align */ - public function get horizontalAlign():String { return _horizontalAlign; } - public function set horizontalAlign(value:String):void - { - if (!Align.isValidHorizontal(value)) - throw new ArgumentError("Invalid horizontal alignment"); - - if (value != _horizontalAlign) - { - _horizontalAlign = value; - dispatchEventWith(Event.CHANGE); - } - } - - /** The vertical alignment of the text. @default center - * @see starling.utils.Align */ - public function get verticalAlign():String { return _verticalAlign; } - public function set verticalAlign(value:String):void - { - if (!Align.isValidVertical(value)) - throw new ArgumentError("Invalid vertical alignment"); - - if (value != _verticalAlign) - { - _verticalAlign = value; - dispatchEventWith(Event.CHANGE); - } - } - - /** Indicates whether kerning is enabled. Kerning adjusts the pixels between certain - * character pairs to improve readability. @default true */ - public function get kerning():Boolean { return _kerning; } - public function set kerning(value:Boolean):void - { - if (value != _kerning) - { - _kerning = value; - dispatchEventWith(Event.CHANGE); - } - } - - /** The amount of vertical space (called 'leading') between lines. @default 0 */ - public function get leading():Number { return _leading; } - public function set leading(value:Number):void - { - if (value != _leading) - { - _leading = value; - dispatchEventWith(Event.CHANGE); - } - } - } -} diff --git a/mobile_version/src/starling/text/TextOptions.as b/mobile_version/src/starling/text/TextOptions.as deleted file mode 100644 index 3b44d1d2..00000000 --- a/mobile_version/src/starling/text/TextOptions.as +++ /dev/null @@ -1,87 +0,0 @@ -/** - * Created by redge on 16.12.15. - */ -package starling.text -{ - import flash.display3D.Context3DTextureFormat; - - import starling.core.Starling; - - /** The TextOptions class contains data that describes how the letters of a text should - * be assembled on text composition. - * - *

Note that not all properties are supported by all text compositors.

- */ - public class TextOptions - { - private var _wordWrap:Boolean; - private var _autoScale:Boolean; - private var _autoSize:String; - private var _isHtmlText:Boolean; - private var _textureScale:Number; - private var _textureFormat:String; - - /** Creates a new TextOptions instance with the given properties. */ - public function TextOptions(wordWrap:Boolean=true, autoScale:Boolean=false) - { - _wordWrap = wordWrap; - _autoScale = autoScale; - _autoSize = TextFieldAutoSize.NONE; - _textureScale = Starling.contentScaleFactor; - _textureFormat = Context3DTextureFormat.BGR_PACKED; - _isHtmlText = false; - } - - /** Copies all properties from another TextOptions instance. */ - public function copyFrom(options:TextOptions):void - { - _wordWrap = options._wordWrap; - _autoScale = options._autoScale; - _autoSize = options._autoSize; - _isHtmlText = options._isHtmlText; - _textureScale = options._textureScale; - _textureFormat = options._textureFormat; - } - - /** Creates a clone of this instance. */ - public function clone():TextOptions - { - var clone:TextOptions = new TextOptions(); - clone.copyFrom(this); - return clone; - } - - /** Indicates if the text should be wrapped at word boundaries if it does not fit into - * the TextField otherwise. @default true */ - public function get wordWrap():Boolean { return _wordWrap; } - public function set wordWrap(value:Boolean):void { _wordWrap = value; } - - /** Specifies the type of auto-sizing set on the TextField. Custom text compositors may - * take this into account, though the basic implementation (done by the TextField itself) - * is often sufficient: it passes a very big size to the fillMeshBatch - * method and then trims the result to the actually used area. @default none */ - public function get autoSize():String { return _autoSize; } - public function set autoSize(value:String):void { _autoSize = value; } - - /** Indicates whether the font size is automatically reduced if the complete text does - * not fit into the TextField. @default false */ - public function get autoScale():Boolean { return _autoScale; } - public function set autoScale(value:Boolean):void { _autoScale = value; } - - /** Indicates if text should be interpreted as HTML code. For a description - * of the supported HTML subset, refer to the classic Flash 'TextField' documentation. - * Beware: Only supported for TrueType fonts. @default false */ - public function get isHtmlText():Boolean { return _isHtmlText; } - public function set isHtmlText(value:Boolean):void { _isHtmlText = value; } - - /** The scale factor of any textures that are created during text composition. - * @default Starling.contentScaleFactor */ - public function get textureScale():Number { return _textureScale; } - public function set textureScale(value:Number):void { _textureScale = value; } - - /** The Context3DTextureFormat of any textures that are created during text composition. - * @default Context3DTextureFormat.BGRA_PACKED */ - public function get textureFormat():String { return _textureFormat; } - public function set textureFormat(value:String):void { _textureFormat = value; } - } -} diff --git a/mobile_version/src/starling/text/TrueTypeCompositor.as b/mobile_version/src/starling/text/TrueTypeCompositor.as deleted file mode 100644 index cf8de3ff..00000000 --- a/mobile_version/src/starling/text/TrueTypeCompositor.as +++ /dev/null @@ -1,187 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= - -package starling.text -{ - import flash.geom.Matrix; - import flash.text.AntiAliasType; - import flash.text.TextField; - - import starling.display.MeshBatch; - import starling.display.Quad; - import starling.textures.Texture; - import starling.utils.Align; - import starling.utils.SystemUtil; - - /** This text compositor uses a Flash TextField to render system- or embedded fonts into - * a texture. - * - *

You typically don't have to instantiate this class. It will be used internally by - * Starling's text fields.

- */ - public class TrueTypeCompositor implements ITextCompositor - { - // helpers - private static var sHelperMatrix:Matrix = new Matrix(); - private static var sHelperQuad:Quad = new Quad(100, 100); - private static var sNativeTextField:flash.text.TextField = new flash.text.TextField(); - private static var sNativeFormat:flash.text.TextFormat = new flash.text.TextFormat(); - - /** Creates a new TrueTypeCompositor instance. */ - public function TrueTypeCompositor() - { } - - /** @inheritDoc */ - public function dispose():void - {} - - /** @inheritDoc */ - public function fillMeshBatch(meshBatch:MeshBatch, width:Number, height:Number, text:String, - format:TextFormat, options:TextOptions=null):void - { - if (text == null || text == "") return; - - var texture:Texture; - var textureFormat:String = options.textureFormat; - var bitmapData:BitmapDataEx = renderText(width, height, text, format, options); - - texture = Texture.fromBitmapData(bitmapData, false, false, bitmapData.scale, textureFormat); - texture.root.onRestore = function():void - { - bitmapData = renderText(width, height, text, format, options); - texture.root.uploadBitmapData(bitmapData); - bitmapData.dispose(); - bitmapData = null; - }; - - bitmapData.dispose(); - bitmapData = null; - - sHelperQuad.texture = texture; - sHelperQuad.readjustSize(); - - if (format.horizontalAlign == Align.LEFT) sHelperQuad.x = 0; - else if (format.horizontalAlign == Align.CENTER) sHelperQuad.x = int((width - texture.width) / 2); - else sHelperQuad.x = width - texture.width; - - if (format.verticalAlign == Align.TOP) sHelperQuad.y = 0; - else if (format.verticalAlign == Align.CENTER) sHelperQuad.y = int((height - texture.height) / 2); - else sHelperQuad.y = height - texture.height; - - meshBatch.addMesh(sHelperQuad); - - sHelperQuad.texture = null; - } - - /** @inheritDoc */ - public function clearMeshBatch(meshBatch:MeshBatch):void - { - meshBatch.clear(); - if (meshBatch.texture) meshBatch.texture.dispose(); - } - - private function renderText(width:Number, height:Number, text:String, - format:TextFormat, options:TextOptions):BitmapDataEx - { - var scaledWidth:Number = width * options.textureScale; - var scaledHeight:Number = height * options.textureScale; - var hAlign:String = format.horizontalAlign; - - format.toNativeFormat(sNativeFormat); - - sNativeFormat.size = Number(sNativeFormat.size) * options.textureScale; - sNativeTextField.embedFonts = SystemUtil.isEmbeddedFont(format.font, format.bold, format.italic); - sNativeTextField.defaultTextFormat = sNativeFormat; - sNativeTextField.width = scaledWidth; - sNativeTextField.height = scaledHeight; - sNativeTextField.antiAliasType = AntiAliasType.ADVANCED; - sNativeTextField.selectable = false; - sNativeTextField.multiline = true; - sNativeTextField.wordWrap = options.wordWrap; - - if (options.isHtmlText) sNativeTextField.htmlText = text; - else sNativeTextField.text = text; - - if (options.autoScale) - autoScaleNativeTextField(sNativeTextField, text, options.isHtmlText); - - var textWidth:Number = sNativeTextField.textWidth; - var textHeight:Number = sNativeTextField.textHeight; - var bitmapWidth:int = Math.ceil(textWidth) + 4; - var bitmapHeight:int = Math.ceil(textHeight) + 4; - var maxTextureSize:int = Texture.maxSize; - var minTextureSize:int = 1; - var offsetX:Number = 0.0; - - // HTML text may have its own alignment -> use the complete width - if (options.isHtmlText) textWidth = bitmapWidth = scaledWidth; - - // check for invalid texture sizes - if (bitmapWidth < minTextureSize) bitmapWidth = 1; - if (bitmapHeight < minTextureSize) bitmapHeight = 1; - if (bitmapHeight > maxTextureSize || bitmapWidth > maxTextureSize) - { - options.textureScale *= maxTextureSize / Math.max(bitmapWidth, bitmapHeight); - return renderText(width, height, text, format, options); - } - else - { - if (!options.isHtmlText) - { - if (hAlign == Align.RIGHT) offsetX = scaledWidth - textWidth - 4; - else if (hAlign == Align.CENTER) offsetX = (scaledWidth - textWidth - 4) / 2.0; - } - - // finally: draw TextField to bitmap data - var bitmapData:BitmapDataEx = new BitmapDataEx(bitmapWidth, bitmapHeight); - sHelperMatrix.setTo(1, 0, 0, 1, -offsetX, 0); - bitmapData.draw(sNativeTextField, sHelperMatrix); - bitmapData.scale = options.textureScale; - sNativeTextField.text = ""; - return bitmapData; - } - } - - private function autoScaleNativeTextField(textField:flash.text.TextField, - text:String, isHtmlText:Boolean):void - { - var textFormat:flash.text.TextFormat = textField.defaultTextFormat; - var maxTextWidth:int = textField.width - 4; - var maxTextHeight:int = textField.height - 4; - var size:Number = Number(textFormat.size); - - while (textField.textWidth > maxTextWidth || textField.textHeight > maxTextHeight) - { - if (size <= 4) break; - - textFormat.size = size--; - textField.defaultTextFormat = textFormat; - - if (isHtmlText) textField.htmlText = text; - else textField.text = text; - } - } - } -} - -import flash.display.BitmapData; - -class BitmapDataEx extends BitmapData -{ - private var _scale:Number = 1.0; - - function BitmapDataEx(width:int, height:int, transparent:Boolean=true, fillColor:uint=0x0) - { - super(width, height, transparent, fillColor); - } - - public function get scale():Number { return _scale; } - public function set scale(value:Number):void { _scale = value; } -} diff --git a/mobile_version/src/starling/textures/AtfData.as b/mobile_version/src/starling/textures/AtfData.as deleted file mode 100644 index bc31b4a9..00000000 --- a/mobile_version/src/starling/textures/AtfData.as +++ /dev/null @@ -1,94 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= - -package starling.textures -{ - import flash.display3D.Context3DTextureFormat; - import flash.utils.ByteArray; - - /** A parser for the ATF data format. */ - public class AtfData - { - private var _format:String; - private var _width:int; - private var _height:int; - private var _numTextures:int; - private var _isCubeMap:Boolean; - private var _data:ByteArray; - - /** Create a new instance by parsing the given byte array. */ - public function AtfData(data:ByteArray) - { - if (!isAtfData(data)) throw new ArgumentError("Invalid ATF data"); - - if (data[6] == 255) data.position = 12; // new file version - else data.position = 6; // old file version - - var format:uint = data.readUnsignedByte(); - switch (format & 0x7f) - { - case 0: - case 1: _format = Context3DTextureFormat.BGRA; break; - case 12: - case 2: - case 3: _format = Context3DTextureFormat.COMPRESSED; break; - case 13: - case 4: - case 5: _format = "compressedAlpha"; break; // explicit string for compatibility - default: throw new Error("Invalid ATF format"); - } - - _width = Math.pow(2, data.readUnsignedByte()); - _height = Math.pow(2, data.readUnsignedByte()); - _numTextures = data.readUnsignedByte(); - _isCubeMap = (format & 0x80) != 0; - _data = data; - - // version 2 of the new file format contains information about - // the "-e" and "-n" parameters of png2atf - - if (data[5] != 0 && data[6] == 255) - { - var emptyMipmaps:Boolean = (data[5] & 0x01) == 1; - var numTextures:int = data[5] >> 1 & 0x7f; - _numTextures = emptyMipmaps ? 1 : numTextures; - } - } - - /** Checks the first 3 bytes of the data for the 'ATF' signature. */ - public static function isAtfData(data:ByteArray):Boolean - { - if (data.length < 3) return false; - else - { - var signature:String = String.fromCharCode(data[0], data[1], data[2]); - return signature == "ATF"; - } - } - - /** The texture format. @see flash.display3D.textures.Context3DTextureFormat */ - public function get format():String { return _format; } - - /** The width of the texture in pixels. */ - public function get width():int { return _width; } - - /** The height of the texture in pixels. */ - public function get height():int { return _height; } - - /** The number of encoded textures. '1' means that there are no mip maps. */ - public function get numTextures():int { return _numTextures; } - - /** Indicates if the ATF data encodes a cube map. Not supported by Starling! */ - public function get isCubeMap():Boolean { return _isCubeMap; } - - /** The actual byte data, including header. */ - public function get data():ByteArray { return _data; } - } -} \ No newline at end of file diff --git a/mobile_version/src/starling/textures/ConcretePotTexture.as b/mobile_version/src/starling/textures/ConcretePotTexture.as deleted file mode 100644 index cfa2435f..00000000 --- a/mobile_version/src/starling/textures/ConcretePotTexture.as +++ /dev/null @@ -1,140 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= - -package starling.textures -{ - import flash.display.BitmapData; - import flash.display3D.textures.TextureBase; - import flash.events.Event; - import flash.geom.Matrix; - import flash.geom.Point; - import flash.geom.Rectangle; - import flash.utils.ByteArray; - - import starling.core.Starling; - import starling.utils.MathUtil; - import starling.utils.execute; - - /** @private - * - * A concrete texture that wraps a Texture base. - * For internal use only. */ - internal class ConcretePotTexture extends ConcreteTexture - { - private var _textureReadyCallback:Function; - - private static var sMatrix:Matrix = new Matrix(); - private static var sRectangle:Rectangle = new Rectangle(); - private static var sOrigin:Point = new Point(); - - /** Creates a new instance with the given parameters. */ - public function ConcretePotTexture(base:flash.display3D.textures.Texture, format:String, - width:int, height:int, mipMapping:Boolean, - premultipliedAlpha:Boolean, - optimizedForRenderTexture:Boolean=false, scale:Number=1) - { - super(base, format, width, height, mipMapping, premultipliedAlpha, - optimizedForRenderTexture, scale); - - if (width != MathUtil.getNextPowerOfTwo(width)) - throw new ArgumentError("width must be a power of two"); - - if (height != MathUtil.getNextPowerOfTwo(height)) - throw new ArgumentError("height must be a power of two"); - } - - /** @inheritDoc */ - override public function dispose():void - { - base.removeEventListener(Event.TEXTURE_READY, onTextureReady); - super.dispose(); - } - - /** @inheritDoc */ - override protected function createBase():TextureBase - { - return Starling.context.createTexture( - nativeWidth, nativeHeight, format, optimizedForRenderTexture); - } - - /** @inheritDoc */ - override public function uploadBitmapData(data:BitmapData):void - { - potBase.uploadFromBitmapData(data); - - var buffer:BitmapData = null; - - if (data.width != nativeWidth || data.height != nativeHeight) - { - buffer = new BitmapData(nativeWidth, nativeHeight, true, 0); - buffer.copyPixels(data, data.rect, sOrigin); - data = buffer; - } - - if (mipMapping && data.width > 1 && data.height > 1) - { - var currentWidth:int = data.width >> 1; - var currentHeight:int = data.height >> 1; - var level:int = 1; - var canvas:BitmapData = new BitmapData(currentWidth, currentHeight, true, 0); - var bounds:Rectangle = sRectangle; - var matrix:Matrix = sMatrix; - matrix.setTo(0.5, 0.0, 0.0, 0.5, 0.0, 0.0); - - while (currentWidth >= 1 || currentHeight >= 1) - { - bounds.setTo(0, 0, currentWidth, currentHeight); - canvas.fillRect(bounds, 0); - canvas.draw(data, matrix, null, null, null, true); - potBase.uploadFromBitmapData(canvas, level++); - matrix.scale(0.5, 0.5); - currentWidth = currentWidth >> 1; - currentHeight = currentHeight >> 1; - } - - canvas.dispose(); - } - - if (buffer) buffer.dispose(); - - setDataUploaded(); - } - - /** @inheritDoc */ - override public function get isPotTexture():Boolean { return true; } - - /** @inheritDoc */ - override public function uploadAtfData(data:ByteArray, offset:int = 0, async:* = null):void - { - var isAsync:Boolean = async is Function || async === true; - - if (async is Function) - { - _textureReadyCallback = async as Function; - base.addEventListener(Event.TEXTURE_READY, onTextureReady); - } - - potBase.uploadCompressedTextureFromByteArray(data, offset, isAsync); - setDataUploaded(); - } - - private function onTextureReady(event:Event):void - { - base.removeEventListener(Event.TEXTURE_READY, onTextureReady); - execute(_textureReadyCallback, this); - _textureReadyCallback = null; - } - - private function get potBase():flash.display3D.textures.Texture - { - return base as flash.display3D.textures.Texture; - } - } -} diff --git a/mobile_version/src/starling/textures/ConcreteRectangleTexture.as b/mobile_version/src/starling/textures/ConcreteRectangleTexture.as deleted file mode 100644 index 658d87a9..00000000 --- a/mobile_version/src/starling/textures/ConcreteRectangleTexture.as +++ /dev/null @@ -1,54 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= - -package starling.textures -{ - import flash.display.BitmapData; - import flash.display3D.textures.RectangleTexture; - import flash.display3D.textures.TextureBase; - - import starling.core.Starling; - - /** @private - * - * A concrete texture that wraps a RectangleTexture base. - * For internal use only. */ - internal class ConcreteRectangleTexture extends ConcreteTexture - { - /** Creates a new instance with the given parameters. */ - public function ConcreteRectangleTexture(base:RectangleTexture, format:String, - width:int, height:int, premultipliedAlpha:Boolean, - optimizedForRenderTexture:Boolean=false, - scale:Number=1) - { - super(base, format, width, height, false, premultipliedAlpha, - optimizedForRenderTexture, scale); - } - - /** @inheritDoc */ - override public function uploadBitmapData(data:BitmapData):void - { - rectangleBase.uploadFromBitmapData(data); - setDataUploaded(); - } - - /** @inheritDoc */ - override protected function createBase():TextureBase - { - return Starling.context.createRectangleTexture( - nativeWidth, nativeHeight, format, optimizedForRenderTexture); - } - - private function get rectangleBase():RectangleTexture - { - return base as RectangleTexture; - } - } -} diff --git a/mobile_version/src/starling/textures/ConcreteTexture.as b/mobile_version/src/starling/textures/ConcreteTexture.as deleted file mode 100644 index a5359443..00000000 --- a/mobile_version/src/starling/textures/ConcreteTexture.as +++ /dev/null @@ -1,269 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= - -package starling.textures -{ - import flash.display.Bitmap; - import flash.display.BitmapData; - import flash.display3D.textures.TextureBase; - import flash.media.Camera; - import flash.net.NetStream; - import flash.system.Capabilities; - import flash.utils.ByteArray; - import flash.utils.getQualifiedClassName; - - import starling.core.Starling; - import starling.core.starling_internal; - import starling.errors.AbstractClassError; - import starling.errors.AbstractMethodError; - import starling.errors.NotSupportedError; - import starling.events.Event; - import starling.rendering.Painter; - import starling.utils.Color; - import starling.utils.execute; - - /** A ConcreteTexture wraps a Stage3D texture object, storing the properties of the texture - * and providing utility methods for data upload, etc. - * - *

This class cannot be instantiated directly; create instances using - * Texture.fromTextureBase instead. However, that's only necessary when - * you need to wrap a TextureBase object in a Starling texture; - * the preferred way of creating textures is to use one of the other - * Texture.from... factory methods in the Texture class.

- * - * @see Texture - */ - public class ConcreteTexture extends Texture - { - private var _base:TextureBase; - private var _format:String; - private var _width:int; - private var _height:int; - private var _mipMapping:Boolean; - private var _premultipliedAlpha:Boolean; - private var _optimizedForRenderTexture:Boolean; - private var _scale:Number; - private var _onRestore:Function; - private var _dataUploaded:Boolean; - - /** @private - * - * Creates a ConcreteTexture object from a TextureBase, storing information about size, - * mip-mapping, and if the channels contain premultiplied alpha values. May only be - * called from subclasses. - * - *

Note that width and height are expected in pixels, - * i.e. they do not take the scale factor into account.

- */ - public function ConcreteTexture(base:TextureBase, format:String, width:int, height:int, - mipMapping:Boolean, premultipliedAlpha:Boolean, - optimizedForRenderTexture:Boolean=false, scale:Number=1) - { - if (Capabilities.isDebugger && - getQualifiedClassName(this) == "starling.textures::ConcreteTexture") - { - throw new AbstractClassError(); - } - - _scale = scale <= 0 ? 1.0 : scale; - _base = base; - _format = format; - _width = width; - _height = height; - _mipMapping = mipMapping; - _premultipliedAlpha = premultipliedAlpha; - _optimizedForRenderTexture = optimizedForRenderTexture; - _onRestore = null; - _dataUploaded = false; - } - - /** Disposes the TextureBase object. */ - public override function dispose():void - { - if (_base) _base.dispose(); - - this.onRestore = null; // removes event listener - super.dispose(); - } - - // texture data upload - - /** Uploads a bitmap to the texture. The existing contents will be replaced. - * If the size of the bitmap does not match the size of the texture, the bitmap will be - * cropped or filled up with transparent pixels */ - public function uploadBitmap(bitmap:Bitmap):void - { - uploadBitmapData(bitmap.bitmapData); - } - - /** Uploads bitmap data to the texture. The existing contents will be replaced. - * If the size of the bitmap does not match the size of the texture, the bitmap will be - * cropped or filled up with transparent pixels */ - public function uploadBitmapData(data:BitmapData):void - { - throw new NotSupportedError(); - } - - /** Uploads ATF data from a ByteArray to the texture. Note that the size of the - * ATF-encoded data must be exactly the same as the original texture size. - * - *

The 'async' parameter may be either a boolean value or a callback function. - * If it's false or null, the texture will be decoded - * synchronously and will be visible right away. If it's true or a function, - * the data will be decoded asynchronously. The texture will remain unchanged until the - * upload is complete, at which time the callback function will be executed. This is the - * expected function definition: function(texture:Texture):void;

- */ - public function uploadAtfData(data:ByteArray, offset:int=0, async:*=null):void - { - throw new NotSupportedError(); - } - - /** Specifies a video stream to be rendered within the texture. */ - public function attachNetStream(netStream:NetStream, onComplete:Function=null):void - { - attachVideo("NetStream", netStream, onComplete); - } - - /** Specifies a video stream from a camera to be rendered within the texture. */ - public function attachCamera(camera:Camera, onComplete:Function=null):void - { - attachVideo("Camera", camera, onComplete); - } - - /** @private */ - internal function attachVideo(type:String, attachment:Object, onComplete:Function=null):void - { - throw new NotSupportedError(); - } - - // texture backup (context loss) - - private function onContextCreated():void - { - _dataUploaded = false; - _base = createBase(); // recreate the underlying texture - execute(_onRestore, this); // restore contents - - // if no texture has been uploaded above, we init the texture with transparent pixels. - if (!_dataUploaded) clear(); - } - - /** Recreates the underlying Stage3D texture object with the same dimensions and attributes - * as the one that was passed to the constructor. You have to upload new data before the - * texture becomes usable again. Beware: this method does not dispose - * the current base. */ - protected function createBase():TextureBase - { - throw new AbstractMethodError(); - } - - /** Recreates the underlying Stage3D texture. May be used to manually restore a texture. - * Beware that new data needs to be uploaded to the texture before it can be used. */ - starling_internal function recreateBase():void - { - _base = createBase(); - } - - /** Clears the texture with a certain color and alpha value. The previous contents of the - * texture is wiped out. */ - public function clear(color:uint=0x0, alpha:Number=0.0):void - { - if (_premultipliedAlpha && alpha < 1.0) - color = Color.rgb(Color.getRed(color) * alpha, - Color.getGreen(color) * alpha, - Color.getBlue(color) * alpha); - - var painter:Painter = Starling.painter; - painter.pushState(); - painter.state.renderTarget = this; - - // we wrap the clear call in a try/catch block as a workaround for a problem of - // FP 11.8 plugin/projector: calling clear on a compressed texture doesn't work there - // (while it *does* work on iOS + Android). - - try { painter.clear(color, alpha); } - catch (e:Error) {} - - painter.popState(); - setDataUploaded(); - } - - /** Notifies the instance that the base texture may now be used for rendering. */ - protected function setDataUploaded():void - { - _dataUploaded = true; - } - - // properties - - /** Indicates if the base texture was optimized for being used in a render texture. */ - public function get optimizedForRenderTexture():Boolean { return _optimizedForRenderTexture; } - - /** Indicates if the base texture is a standard power-of-two dimensioned texture of type - * flash.display3D.textures.Texture. */ - public function get isPotTexture():Boolean { return false; } - - /** The function that you provide here will be called after a context loss. - * On execution, a new base texture will already have been created; however, - * it will be empty. Call one of the "upload..." methods from within the callback - * to restore the actual texture data. - * - * - * var texture:Texture = Texture.fromBitmap(new EmbeddedBitmap()); - * texture.root.onRestore = function():void - * { - * texture.root.uploadFromBitmap(new EmbeddedBitmap()); - * }; - */ - public function get onRestore():Function { return _onRestore; } - public function set onRestore(value:Function):void - { - Starling.current.removeEventListener(Event.CONTEXT3D_CREATE, onContextCreated); - - if (value != null) - { - _onRestore = value; - Starling.current.addEventListener(Event.CONTEXT3D_CREATE, onContextCreated); - } - else _onRestore = null; - } - - /** @inheritDoc */ - public override function get base():TextureBase { return _base; } - - /** @inheritDoc */ - public override function get root():ConcreteTexture { return this; } - - /** @inheritDoc */ - public override function get format():String { return _format; } - - /** @inheritDoc */ - public override function get width():Number { return _width / _scale; } - - /** @inheritDoc */ - public override function get height():Number { return _height / _scale; } - - /** @inheritDoc */ - public override function get nativeWidth():Number { return _width; } - - /** @inheritDoc */ - public override function get nativeHeight():Number { return _height; } - - /** @inheritDoc */ - public override function get scale():Number { return _scale; } - - /** @inheritDoc */ - public override function get mipMapping():Boolean { return _mipMapping; } - - /** @inheritDoc */ - public override function get premultipliedAlpha():Boolean { return _premultipliedAlpha; } - } -} \ No newline at end of file diff --git a/mobile_version/src/starling/textures/ConcreteVideoTexture.as b/mobile_version/src/starling/textures/ConcreteVideoTexture.as deleted file mode 100644 index 1d6d4161..00000000 --- a/mobile_version/src/starling/textures/ConcreteVideoTexture.as +++ /dev/null @@ -1,98 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= - -package starling.textures -{ - import flash.display3D.Context3DTextureFormat; - import flash.display3D.textures.TextureBase; - import flash.display3D.textures.VideoTexture; - import flash.events.Event; - - import starling.core.Starling; - import starling.utils.execute; - - /** @private - * - * A concrete texture that wraps a VideoTexture base. - * For internal use only. */ - internal class ConcreteVideoTexture extends ConcreteTexture - { - private var _textureReadyCallback:Function; - - /** Creates a new instance with the given parameters. - * base must be of type flash.display3D.textures.VideoTexture. - */ - public function ConcreteVideoTexture(base:VideoTexture, scale:Number=1) - { - super(base, Context3DTextureFormat.BGRA, base.videoWidth, base.videoHeight, false, - false, false, scale); - } - - /** @inheritDoc */ - override public function dispose():void - { - base.removeEventListener(Event.TEXTURE_READY, onTextureReady); - super.dispose(); - } - - /** @inheritDoc */ - override protected function createBase():TextureBase - { - return Starling.context.createVideoTexture(); - } - - /** @private */ - override internal function attachVideo(type:String, attachment:Object, - onComplete:Function=null):void - { - _textureReadyCallback = onComplete; - base["attach" + type](attachment); - base.addEventListener(Event.TEXTURE_READY, onTextureReady); - - setDataUploaded(); - } - - private function onTextureReady(event:Event):void - { - base.removeEventListener(Event.TEXTURE_READY, onTextureReady); - execute(_textureReadyCallback, this); - _textureReadyCallback = null; - } - - /** The actual width of the video in pixels. */ - override public function get nativeWidth():Number - { - return videoBase.videoWidth; - } - - /** The actual height of the video in pixels. */ - override public function get nativeHeight():Number - { - return videoBase.videoHeight; - } - - /** @inheritDoc */ - override public function get width():Number - { - return nativeWidth / scale; - } - - /** @inheritDoc */ - override public function get height():Number - { - return nativeHeight / scale; - } - - private function get videoBase():VideoTexture - { - return base as VideoTexture; - } - } -} diff --git a/mobile_version/src/starling/textures/RenderTexture.as b/mobile_version/src/starling/textures/RenderTexture.as deleted file mode 100644 index 7279dc2d..00000000 --- a/mobile_version/src/starling/textures/RenderTexture.as +++ /dev/null @@ -1,336 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= - -package starling.textures -{ - import flash.display3D.textures.TextureBase; - import flash.errors.IllegalOperationError; - import flash.geom.Matrix; - import flash.geom.Rectangle; - import flash.utils.Dictionary; - - import starling.core.Starling; - import starling.display.BlendMode; - import starling.display.DisplayObject; - import starling.display.Image; - import starling.filters.FragmentFilter; - import starling.rendering.Painter; - import starling.rendering.RenderState; - import starling.utils.execute; - - /** A RenderTexture is a dynamic texture onto which you can draw any display object. - * - *

After creating a render texture, just call the drawObject method to render - * an object directly onto the texture. The object will be drawn onto the texture at its current - * position, adhering its current rotation, scale and alpha properties.

- * - *

Drawing is done very efficiently, as it is happening directly in graphics memory. After - * you have drawn objects onto the texture, the performance will be just like that of a normal - * texture — no matter how many objects you have drawn.

- * - *

If you draw lots of objects at once, it is recommended to bundle the drawing calls in - * a block via the drawBundled method, like shown below. That will speed it up - * immensely, allowing you to draw hundreds of objects very quickly.

- * - *
-     *  renderTexture.drawBundled(function():void
-     *  {
-     *     for (var i:int=0; i<numDrawings; ++i)
-     *     {
-     *         image.rotation = (2 * Math.PI / numDrawings) * i;
-     *         renderTexture.draw(image);
-     *     }   
-     *  });
-     *  
- * - *

To erase parts of a render texture, you can use any display object like a "rubber" by - * setting its blending mode to BlendMode.ERASE. To wipe it completely clean, - * use the clear method.

- * - * Persistence - * - *

Older devices may require double buffering to support persistent render textures. Thus, - * you should disable the persistent parameter in the constructor if you only - * need to make one draw operation on the texture. The static useDoubleBuffering - * property allows you to customize if new textures will be created with or without double - * buffering.

- * - * Context Loss - * - *

Unfortunately, render textures are wiped clean when the render context is lost. - * This means that you need to manually recreate all their contents in such a case. - * One way to do that is by using the root.onRestore callback, like here:

- * - * - * renderTexture.root.onRestore = function():void - * { - * var quad:Quad = new Quad(100, 100, 0xff00ff); - * renderTexture.clear(); // required on texture restoration - * renderTexture.draw(quad); - * }); - * - *

For example, a drawing app would need to store information about all draw operations - * when they occur, and then recreate them inside onRestore on a context loss - * (preferably using drawBundled instead).

- * - *

However, there is one problem: when that callback is executed, it's very likely that - * not all of your textures are already available, since they need to be restored, too (and - * that might take a while). You probably loaded your textures with the "AssetManager". - * In that case, you can listen to its TEXTURES_RESTORED event instead:

- * - * - * assetManager.addEventListener(Event.TEXTURES_RESTORED, function():void - * { - * var brush:Image = new Image(assetManager.getTexture("brush")); - * renderTexture.draw(brush); - * }); - * - *

[Note that this time, there is no need to call clear, because that's the - * default behavior of onRestore, anyway — and we didn't modify that.]

- * - */ - public class RenderTexture extends SubTexture - { - private static const USE_DOUBLE_BUFFERING_DATA_NAME:String = - "starling.textures.RenderTexture.useDoubleBuffering"; - - private var _activeTexture:Texture; - private var _bufferTexture:Texture; - private var _helperImage:Image; - private var _drawing:Boolean; - private var _bufferReady:Boolean; - private var _isPersistent:Boolean; - - // helper object - private static var sClipRect:Rectangle = new Rectangle(); - - /** Creates a new RenderTexture with a certain size (in points). If the texture is - * persistent, its contents remains intact after each draw call, allowing you to use the - * texture just like a canvas. If it is not, it will be cleared before each draw call. - * - *

Non-persistent textures can be used more efficiently on older devices; on modern - * hardware, it does not make a difference. For more information, have a look at the - * documentation of the useDoubleBuffering property.

- */ - public function RenderTexture(width:int, height:int, persistent:Boolean=true, - scale:Number=-1, format:String="bgra") - { - _isPersistent = persistent; - _activeTexture = Texture.empty(width, height, true, false, true, scale, format); - _activeTexture.root.onRestore = _activeTexture.root.clear; - - super(_activeTexture, new Rectangle(0, 0, width, height), true, null, false); - - if (persistent && useDoubleBuffering) - { - _bufferTexture = Texture.empty(width, height, true, false, true, scale, format); - _bufferTexture.root.onRestore = _bufferTexture.root.clear; - _helperImage = new Image(_bufferTexture); - _helperImage.textureSmoothing = TextureSmoothing.NONE; // solves some aliasing-issues - } - } - - /** @inheritDoc */ - public override function dispose():void - { - _activeTexture.dispose(); - - if (isDoubleBuffered) - { - _bufferTexture.dispose(); - _helperImage.dispose(); - } - - super.dispose(); - } - - /** Draws an object into the texture. Note that any filters on the object will currently - * be ignored. - * - * @param object The object to draw. - * @param matrix If 'matrix' is null, the object will be drawn adhering its - * properties for position, scale, and rotation. If it is not null, - * the object will be drawn in the orientation depicted by the matrix. - * @param alpha The object's alpha value will be multiplied with this value. - * @param antiAliasing Values range from 0 (no antialiasing) to 4 (best quality). - * Beginning with AIR 22, this feature is supported on all platforms - * (except for software rendering mode). - */ - public function draw(object:DisplayObject, matrix:Matrix=null, alpha:Number=1.0, - antiAliasing:int=0):void - { - if (object == null) return; - - if (_drawing) - render(object, matrix, alpha); - else - renderBundled(render, object, matrix, alpha, antiAliasing); - } - - /** Bundles several calls to draw together in a block. This avoids buffer - * switches and allows you to draw multiple objects into a non-persistent texture. - * Note that the 'antiAliasing' setting provided here overrides those provided in - * individual 'draw' calls. - * - * @param drawingBlock a callback with the form:
function():void;
- * @param antiAliasing Values range from 0 (no antialiasing) to 4 (best quality). - * Beginning with AIR 22, this feature is supported on all platforms - * (except for software rendering mode). - */ - public function drawBundled(drawingBlock:Function, antiAliasing:int=0):void - { - renderBundled(drawingBlock, null, null, 1.0, antiAliasing); - } - - private function render(object:DisplayObject, matrix:Matrix=null, alpha:Number=1.0):void - { - var painter:Painter = Starling.painter; - var state:RenderState = painter.state; - var wasCacheEnabled:Boolean = painter.cacheEnabled; - var filter:FragmentFilter = object.filter; - var mask:DisplayObject = object.mask; - - painter.cacheEnabled = false; - painter.pushState(); - - state.alpha = object.alpha * alpha; - state.setModelviewMatricesToIdentity(); - state.blendMode = object.blendMode == BlendMode.AUTO ? - BlendMode.NORMAL : object.blendMode; - - if (matrix) state.transformModelviewMatrix(matrix); - else state.transformModelviewMatrix(object.transformationMatrix); - - if (mask) painter.drawMask(mask); - - if (filter) filter.render(painter); - else object.render(painter); - - if (mask) painter.eraseMask(mask); - - painter.popState(); - painter.cacheEnabled = wasCacheEnabled; - } - - private function renderBundled(renderBlock:Function, object:DisplayObject=null, - matrix:Matrix=null, alpha:Number=1.0, - antiAliasing:int=0):void - { - var painter:Painter = Starling.painter; - var state:RenderState = painter.state; - - if (!Starling.current.contextValid) return; - - // switch buffers - if (isDoubleBuffered) - { - var tmpTexture:Texture = _activeTexture; - _activeTexture = _bufferTexture; - _bufferTexture = tmpTexture; - _helperImage.texture = _bufferTexture; - } - - painter.pushState(); - - var rootTexture:Texture = _activeTexture.root; - state.setProjectionMatrix(0, 0, rootTexture.width, rootTexture.height, width, height); - - // limit drawing to relevant area - sClipRect.setTo(0, 0, _activeTexture.width, _activeTexture.height); - - state.clipRect = sClipRect; - state.setRenderTarget(_activeTexture, true, antiAliasing); - painter.prepareToDraw(); - - if (isDoubleBuffered || !isPersistent || !_bufferReady) - painter.clear(); - - // draw buffer - if (isDoubleBuffered && _bufferReady) - _helperImage.render(painter); - else - _bufferReady = true; - - try - { - _drawing = true; - execute(renderBlock, object, matrix, alpha); - } - finally - { - _drawing = false; - painter.popState(); - } - } - - /** Clears the render texture with a certain color and alpha value. Call without any - * arguments to restore full transparency. */ - public function clear(color:uint=0, alpha:Number=0.0):void - { - _activeTexture.root.clear(color, alpha); - _bufferReady = true; - } - - // properties - - /** Indicates if the render texture is using double buffering. This might be necessary for - * persistent textures, depending on the runtime version and the value of - * 'forceDoubleBuffering'. */ - private function get isDoubleBuffered():Boolean { return _bufferTexture != null; } - - /** Indicates if the texture is persistent over multiple draw calls. */ - public function get isPersistent():Boolean { return _isPersistent; } - - /** @inheritDoc */ - public override function get base():TextureBase { return _activeTexture.base; } - - /** @inheritDoc */ - public override function get root():ConcreteTexture { return _activeTexture.root; } - - /** Indicates if new persistent textures should use double buffering. Single buffering - * is faster and requires less memory, but is not supported on all hardware. - * - *

By default, applications running with the profile "baseline" or "baselineConstrained" - * will use double buffering; all others use just a single buffer. You can override this - * behavior, though, by assigning a different value at runtime.

- * - * @default true for "baseline" and "baselineConstrained", false otherwise - */ - public static function get useDoubleBuffering():Boolean - { - if (Starling.current) - { - var painter:Painter = Starling.painter; - var sharedData:Dictionary = painter.sharedData; - - if (USE_DOUBLE_BUFFERING_DATA_NAME in sharedData) - { - return sharedData[USE_DOUBLE_BUFFERING_DATA_NAME]; - } - else - { - var profile:String = painter.profile ? painter.profile : "baseline"; - var value:Boolean = profile == "baseline" || profile == "baselineConstrained"; - sharedData[USE_DOUBLE_BUFFERING_DATA_NAME] = value; - return value; - } - } - else return false; - } - - public static function set useDoubleBuffering(value:Boolean):void - { - if (Starling.current == null) - throw new IllegalOperationError("Starling not yet initialized"); - else - Starling.painter.sharedData[USE_DOUBLE_BUFFERING_DATA_NAME] = value; - } - } -} \ No newline at end of file diff --git a/mobile_version/src/starling/textures/SubTexture.as b/mobile_version/src/starling/textures/SubTexture.as deleted file mode 100644 index 8aa3f25d..00000000 --- a/mobile_version/src/starling/textures/SubTexture.as +++ /dev/null @@ -1,183 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= - -package starling.textures -{ - import flash.display3D.textures.TextureBase; - import flash.geom.Matrix; - import flash.geom.Rectangle; - - import starling.core.starling_internal; - - /** A SubTexture represents a section of another texture. This is achieved solely by - * manipulation of texture coordinates, making the class very efficient. - * - *

Note that it is OK to create subtextures of subtextures.

- */ - public class SubTexture extends Texture - { - private var _parent:Texture; - private var _ownsParent:Boolean; - private var _region:Rectangle; - private var _frame:Rectangle; - private var _rotated:Boolean; - private var _width:Number; - private var _height:Number; - private var _scale:Number; - private var _transformationMatrix:Matrix; - private var _transformationMatrixToRoot:Matrix; - - /** Creates a new SubTexture containing the specified region of a parent texture. - * - * @param parent The texture you want to create a SubTexture from. - * @param region The region of the parent texture that the SubTexture will show - * (in points). If null, the complete area of the parent. - * @param ownsParent If true, the parent texture will be disposed - * automatically when the SubTexture is disposed. - * @param frame If the texture was trimmed, the frame rectangle can be used to restore - * the trimmed area. - * @param rotated If true, the SubTexture will show the parent region rotated by - * 90 degrees (CCW). - * @param scaleModifier The scale factor of the SubTexture will be calculated by - * multiplying the parent texture's scale factor with this value. - */ - public function SubTexture(parent:Texture, region:Rectangle=null, - ownsParent:Boolean=false, frame:Rectangle=null, - rotated:Boolean=false, scaleModifier:Number=1) - { - starling_internal::setTo(parent, region, ownsParent, frame, rotated, scaleModifier); - } - - /** @private - * - *

Textures are supposed to be immutable, and Starling uses this assumption for - * optimizations and simplifications all over the place. However, in some situations where - * the texture is not accessible to the outside, this can be overruled in order to avoid - * allocations.

- */ - starling_internal function setTo(parent:Texture, region:Rectangle=null, - ownsParent:Boolean=false, frame:Rectangle=null, - rotated:Boolean=false, scaleModifier:Number=1):void - { - if (_region == null) _region = new Rectangle(); - if (region) _region.copyFrom(region); - else _region.setTo(0, 0, parent.width, parent.height); - - if (frame) - { - if (_frame) _frame.copyFrom(frame); - else _frame = frame.clone(); - } - else _frame = null; - - _parent = parent; - _ownsParent = ownsParent; - _rotated = rotated; - _width = (rotated ? _region.height : _region.width) / scaleModifier; - _height = (rotated ? _region.width : _region.height) / scaleModifier; - _scale = _parent.scale * scaleModifier; - - if (_frame && (_frame.x > 0 || _frame.y > 0 || - _frame.right < _width || _frame.bottom < _height)) - { - trace("[Starling] Warning: frames inside the texture's region are unsupported."); - } - - updateMatrices(); - } - - private function updateMatrices():void - { - if (_transformationMatrix) _transformationMatrix.identity(); - else _transformationMatrix = new Matrix(); - - if (_transformationMatrixToRoot) _transformationMatrixToRoot.identity(); - else _transformationMatrixToRoot = new Matrix(); - - if (_rotated) - { - _transformationMatrix.translate(0, -1); - _transformationMatrix.rotate(Math.PI / 2.0); - } - - _transformationMatrix.scale(_region.width / _parent.width, - _region.height / _parent.height); - _transformationMatrix.translate(_region.x / _parent.width, - _region.y / _parent.height); - - var texture:SubTexture = this; - while (texture) - { - _transformationMatrixToRoot.concat(texture._transformationMatrix); - texture = texture.parent as SubTexture; - } - } - - /** Disposes the parent texture if this texture owns it. */ - public override function dispose():void - { - if (_ownsParent) _parent.dispose(); - super.dispose(); - } - - /** The texture which the SubTexture is based on. */ - public function get parent():Texture { return _parent; } - - /** Indicates if the parent texture is disposed when this object is disposed. */ - public function get ownsParent():Boolean { return _ownsParent; } - - /** If true, the SubTexture will show the parent region rotated by 90 degrees (CCW). */ - public function get rotated():Boolean { return _rotated; } - - /** The region of the parent texture that the SubTexture is showing (in points). - * - *

CAUTION: not a copy, but the actual object! Do not modify!

*/ - public function get region():Rectangle { return _region; } - - /** @inheritDoc */ - public override function get transformationMatrix():Matrix { return _transformationMatrix; } - - /** @inheritDoc */ - public override function get transformationMatrixToRoot():Matrix { return _transformationMatrixToRoot; } - - /** @inheritDoc */ - public override function get base():TextureBase { return _parent.base; } - - /** @inheritDoc */ - public override function get root():ConcreteTexture { return _parent.root; } - - /** @inheritDoc */ - public override function get format():String { return _parent.format; } - - /** @inheritDoc */ - public override function get width():Number { return _width; } - - /** @inheritDoc */ - public override function get height():Number { return _height; } - - /** @inheritDoc */ - public override function get nativeWidth():Number { return _width * _scale; } - - /** @inheritDoc */ - public override function get nativeHeight():Number { return _height * _scale; } - - /** @inheritDoc */ - public override function get mipMapping():Boolean { return _parent.mipMapping; } - - /** @inheritDoc */ - public override function get premultipliedAlpha():Boolean { return _parent.premultipliedAlpha; } - - /** @inheritDoc */ - public override function get scale():Number { return _scale; } - - /** @inheritDoc */ - public override function get frame():Rectangle { return _frame; } - } -} \ No newline at end of file diff --git a/mobile_version/src/starling/textures/Texture.as b/mobile_version/src/starling/textures/Texture.as deleted file mode 100644 index fab68f23..00000000 --- a/mobile_version/src/starling/textures/Texture.as +++ /dev/null @@ -1,753 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= - -package starling.textures -{ - import flash.display.Bitmap; - import flash.display.BitmapData; - import flash.display3D.Context3D; - import flash.display3D.Context3DTextureFormat; - import flash.display3D.textures.RectangleTexture; - import flash.display3D.textures.TextureBase; - import flash.display3D.textures.VideoTexture; - import flash.geom.Matrix; - import flash.geom.Point; - import flash.geom.Rectangle; - import flash.media.Camera; - import flash.net.NetStream; - import flash.system.Capabilities; - import flash.utils.ByteArray; - import flash.utils.getQualifiedClassName; - - import starling.core.Starling; - import starling.errors.AbstractClassError; - import starling.errors.MissingContextError; - import starling.errors.NotSupportedError; - import starling.rendering.VertexData; - import starling.utils.MathUtil; - import starling.utils.MatrixUtil; - import starling.utils.SystemUtil; - - /**

A texture stores the information that represents an image. It cannot be added to the - * display list directly; instead it has to be mapped onto a display object. In Starling, - * the most probably candidate for this job is the Image class.

- * - * Creating a texture - * - *

The Texture class is abstract, i.e. you cannot create instance of this - * class through its constructor. Instead, it offers a variety of factory methods, like - * fromBitmapData or fromEmbeddedAsset.

- * - * Texture Formats - * - *

Since textures can be created from a "BitmapData" object, Starling supports any bitmap - * format that is supported by Flash. And since you can render any Flash display object into - * a BitmapData object, you can use this to display non-Starling content in Starling - e.g. - * Shape objects.

- * - *

Starling also supports ATF textures (Adobe Texture Format), which is a container for - * compressed texture formats that can be rendered very efficiently by the GPU. Refer to - * the Flash documentation for more information about this format.

- * - *

Beginning with AIR 17, you can use Starling textures to show video content (if the - * current platform supports it; see "SystemUtil.supportsVideoTexture"). - * The two factory methods "fromCamera" and "fromNetStream" allow you to make use of - * this feature.

- * - * Mip Mapping - * - *

MipMaps are scaled down versions of a texture. When an image is displayed smaller than - * its natural size, the GPU may display the mip maps instead of the original texture. This - * reduces aliasing and accelerates rendering. It does, however, also need additional memory; - * for that reason, mipmapping is disabled by default.

- * - * Texture Frame - * - *

The frame property of a texture allows you to let a texture appear inside the bounds of - * an image, leaving a transparent border around the texture. The frame rectangle is specified - * in the coordinate system of the texture (not the image):

- * - * - * var frame:Rectangle = new Rectangle(-10, -10, 30, 30); - * var texture:Texture = Texture.fromTexture(anotherTexture, null, frame); - * var image:Image = new Image(texture); - * - *

This code would create an image with a size of 30x30, with the texture placed at - * x=10, y=10 within that image (assuming that 'anotherTexture' has a width and - * height of 10 pixels, it would appear in the middle of the image).

- * - *

The texture atlas makes use of this feature, as it allows to crop transparent edges - * of a texture and making up for the changed size by specifying the original texture frame. - * Tools like TexturePacker use this to - * optimize the atlas.

- * - * Texture Coordinates - * - *

If, on the other hand, you want to show only a part of the texture in an image - * (i.e. to crop the the texture), you can either create a subtexture (with the method - * 'Texture.fromTexture()' and specifying a rectangle for the region), or you can manipulate - * the texture coordinates of the image object. The method image.setTexCoords - * allows you to do that.

- * - * Context Loss - * - *

When the current rendering context is lost (which can happen on all platforms, but is - * especially common on Android and Windows), all texture data is destroyed. However, - * Starling will try to restore the textures. To do that, it will keep the bitmap - * and ATF data in memory - at the price of increased RAM consumption. You can optimize - * this behavior, though, by restoring the texture directly from its source, like in this - * example:

- * - * - * var texture:Texture = Texture.fromBitmap(new EmbeddedBitmap()); - * texture.root.onRestore = function():void - * { - * texture.root.uploadFromBitmap(new EmbeddedBitmap()); - * }; - * - *

The onRestore-method will be called when the context was lost and the - * texture has been recreated (but is still empty). If you use the "AssetManager" class to - * manage your textures, this will be done automatically.

- * - * @see starling.display.Image - * @see starling.utils.AssetManager - * @see starling.utils.SystemUtil - * @see TextureAtlas - */ - public class Texture - { - // helper objects - private static var sDefaultOptions:TextureOptions = new TextureOptions(); - private static var sRectangle:Rectangle = new Rectangle(); - private static var sMatrix:Matrix = new Matrix(); - private static var sPoint:Point = new Point(); - - /** @private */ - public function Texture() - { - if (Capabilities.isDebugger && - getQualifiedClassName(this) == "starling.textures::Texture") - { - throw new AbstractClassError(); - } - } - - /** Disposes the underlying texture data. Note that not all textures need to be disposed: - * SubTextures (created with 'Texture.fromTexture') just reference other textures and - * and do not take up resources themselves; this is also true for textures from an - * atlas. */ - public function dispose():void - { - // override in subclasses - } - - /** Creates a texture from any of the supported data types, using the specified options. - * - * @param data Either an embedded asset class, a Bitmap, BitmapData, or a ByteArray - * with ATF data. - * @param options Specifies options about the texture settings, e.g. the scale factor. - * If left empty, the default options will be used. - */ - public static function fromData(data:Object, options:TextureOptions=null):Texture - { - if (data is Bitmap) data = (data as Bitmap).bitmapData; - if (options == null) options = sDefaultOptions; - - if (data is Class) - { - return fromEmbeddedAsset(data as Class, - options.mipMapping, options.optimizeForRenderToTexture, - options.scale, options.format, options.forcePotTexture); - } - else if (data is BitmapData) - { - return fromBitmapData(data as BitmapData, - options.mipMapping, options.optimizeForRenderToTexture, - options.scale, options.format, options.forcePotTexture); - } - else if (data is ByteArray) - { - return fromAtfData(data as ByteArray, - options.scale, options.mipMapping, options.onReady); - } - else - throw new ArgumentError("Unsupported 'data' type: " + getQualifiedClassName(data)); - } - - /** Creates a texture from a TextureBase object. - * - * @param base a Stage3D texture object created through the current context. - * @param width the width of the texture in pixels (not points!). - * @param height the height of the texture in pixels (not points!). - * @param options specifies options about the texture settings, e.g. the scale factor. - * If left empty, the default options will be used. Note that not all - * options are supported by all texture types. - */ - public static function fromTextureBase(base:TextureBase, width:int, height:int, - options:TextureOptions=null):ConcreteTexture - { - if (options == null) options = sDefaultOptions; - - if (base is flash.display3D.textures.Texture) - { - return new ConcretePotTexture(base as flash.display3D.textures.Texture, - options.format, width, height, options.mipMapping, - options.premultipliedAlpha, options.optimizeForRenderToTexture, - options.scale); - } - else if (base is RectangleTexture) - { - return new ConcreteRectangleTexture(base as RectangleTexture, - options.format, width, height, options.premultipliedAlpha, - options.optimizeForRenderToTexture, options.scale); - } - else if (base is VideoTexture) - { - return new ConcreteVideoTexture(base as VideoTexture, options.scale); - } - else - throw new ArgumentError("Unsupported 'base' type: " + getQualifiedClassName(base)); - } - - /** Creates a texture object from an embedded asset class. Textures created with this - * method will be restored directly from the asset class in case of a context loss, - * which guarantees a very economic memory usage. - * - * @param assetClass must contain either a Bitmap or a ByteArray with ATF data. - * @param mipMapping for Bitmaps, indicates if mipMaps will be created; - * for ATF data, indicates if the contained mipMaps will be used. - * @param optimizeForRenderToTexture indicates if this texture will be used as - * render target. - * @param scale the scale factor of the created texture. - * @param format the context3D texture format to use. Ignored for ATF data. - * @param forcePotTexture indicates if the underlying Stage3D texture should be created - * as the power-of-two based "Texture" class instead of the more memory - * efficient "RectangleTexture". (Only applicable to bitmaps; ATF - * textures are always POT-textures, anyway.) - */ - public static function fromEmbeddedAsset(assetClass:Class, mipMapping:Boolean=false, - optimizeForRenderToTexture:Boolean=false, - scale:Number=1, format:String="bgra", - forcePotTexture:Boolean=false):Texture - { - var texture:Texture; - var asset:Object = new assetClass(); - - if (asset is Bitmap) - { - texture = Texture.fromBitmap(asset as Bitmap, mipMapping, - optimizeForRenderToTexture, scale, format, forcePotTexture); - texture.root.onRestore = function():void - { - texture.root.uploadBitmap(new assetClass()); - }; - } - else if (asset is ByteArray) - { - texture = Texture.fromAtfData(asset as ByteArray, scale, mipMapping, null); - texture.root.onRestore = function():void - { - texture.root.uploadAtfData(new assetClass()); - }; - } - else - { - throw new ArgumentError("Invalid asset type: " + getQualifiedClassName(asset)); - } - - asset = null; // avoid that object stays in memory (through 'onRestore' functions) - return texture; - } - - /** Creates a texture object from a bitmap. - * Beware: you must not dispose the bitmap's data if Starling should handle a lost device - * context alternatively, you can handle restoration yourself via "texture.root.onRestore". - * - * @param bitmap the texture will be created with the bitmap data of this object. - * @param generateMipMaps indicates if mipMaps will be created. - * @param optimizeForRenderToTexture indicates if this texture will be used as - * render target - * @param scale the scale factor of the created texture. This affects the reported - * width and height of the texture object. - * @param format the context3D texture format to use. Pass one of the packed or - * compressed formats to save memory (at the price of reduced image - * quality). - * @param forcePotTexture indicates if the underlying Stage3D texture should be created - * as the power-of-two based "Texture" class instead of the more memory - * efficient "RectangleTexture". - */ - public static function fromBitmap(bitmap:Bitmap, generateMipMaps:Boolean=false, - optimizeForRenderToTexture:Boolean=false, - scale:Number=1, format:String="bgra", - forcePotTexture:Boolean=false):Texture - { - return fromBitmapData(bitmap.bitmapData, generateMipMaps, optimizeForRenderToTexture, - scale, format, forcePotTexture); - } - - /** Creates a texture object from bitmap data. - * Beware: you must not dispose 'data' if Starling should handle a lost device context; - * alternatively, you can handle restoration yourself via "texture.root.onRestore". - * - * @param data the bitmap data to upload to the texture. - * @param generateMipMaps indicates if mipMaps will be created. - * @param optimizeForRenderToTexture indicates if this texture will be used as - * render target - * @param scale the scale factor of the created texture. This affects the reported - * width and height of the texture object. - * @param format the context3D texture format to use. Pass one of the packed or - * compressed formats to save memory (at the price of reduced image - * quality). - * @param forcePotTexture indicates if the underlying Stage3D texture should be created - * as the power-of-two based "Texture" class instead of the more memory - * efficient "RectangleTexture". - */ - public static function fromBitmapData(data:BitmapData, generateMipMaps:Boolean=false, - optimizeForRenderToTexture:Boolean=false, - scale:Number=1, format:String="bgra", - forcePotTexture:Boolean=false):Texture - { - var texture:Texture = Texture.empty(data.width / scale, data.height / scale, true, - generateMipMaps, optimizeForRenderToTexture, scale, - format, forcePotTexture); - - texture.root.uploadBitmapData(data); - texture.root.onRestore = function():void - { - texture.root.uploadBitmapData(data); - }; - - return texture; - } - - /** Creates a texture from ATF data (Adobe Texture Compression). - * Beware: you must not dispose 'data' if Starling should handle a lost device context; - * alternatively, you can handle restoration yourself via "texture.root.onRestore". - * - * @param data the raw data from an ATF file. - * @param scale the scale factor of the created texture. This affects the reported - * width and height of the texture object. - * @param useMipMaps If the ATF data contains mipmaps, this parameter controls if they - * are used; if it does not, this parameter has no effect. - * @param async If you pass a callback function, the texture will be decoded - * asynchronously, which allows a smooth framerate even during the - * loading process. However, don't use the texture before the callback - * has been executed. This is the expected function definition: - * function(texture:Texture):void; - * @param premultipliedAlpha Indicates if the ATF data contains pixels in PMA format. - * This is "false" for most ATF files, but can be customized in some - * tools. - */ - public static function fromAtfData(data:ByteArray, scale:Number=1, useMipMaps:Boolean=true, - async:Function=null, premultipliedAlpha:Boolean=false):Texture - { - var context:Context3D = Starling.context; - if (context == null) throw new MissingContextError(); - - var atfData:AtfData = new AtfData(data); - var nativeTexture:flash.display3D.textures.Texture = context.createTexture( - atfData.width, atfData.height, atfData.format, false); - var concreteTexture:ConcreteTexture = new ConcretePotTexture(nativeTexture, - atfData.format, atfData.width, atfData.height, useMipMaps && atfData.numTextures > 1, - premultipliedAlpha, false, scale); - - concreteTexture.uploadAtfData(data, 0, async); - concreteTexture.onRestore = function():void - { - concreteTexture.uploadAtfData(data, 0); - }; - - return concreteTexture; - } - - /** Creates a video texture from a NetStream. - * - *

Below, you'll find a minimal sample showing how to stream a video from a file. - * Note that ns.play() is called only after creating the texture, and - * outside the onComplete-callback. It's recommended to always make the - * calls in this order; otherwise, playback won't start on some platforms.

- * - * - * var nc:NetConnection = new NetConnection(); - * nc.connect(null); - * - * var ns:NetStream = new NetStream(nc); - * var texture:Texture = Texture.fromNetStream(ns, 1, function():void - * { - * addChild(new Image(texture)); - * }); - * - * var file:File = File.applicationDirectory.resolvePath("bugs-bunny.m4v"); - * ns.play(file.url); - * - * @param stream the NetStream from which the video data is streamed. Beware that 'play' - * should be called only after the method returns, and outside the - * onComplete callback. - * @param scale the scale factor of the created texture. This affects the reported - * width and height of the texture object. - * @param onComplete will be executed when the texture is ready. Contains a parameter - * of type 'Texture'. - */ - public static function fromNetStream(stream:NetStream, scale:Number=1, - onComplete:Function=null):Texture - { - // workaround for bug in NetStream class: - if (stream.client == stream && !("onMetaData" in stream)) - stream.client = { onMetaData: function(md:Object):void {} }; - - return fromVideoAttachment("NetStream", stream, scale, onComplete); - } - - /** Creates a video texture from a camera. Beware that the texture must not be used - * before the 'onComplete' callback has been executed; until then, it will have a size - * of zero pixels. - * - *

Here is a minimal sample showing how to display a camera video:

- * - * - * var camera:Camera = Camera.getCamera(); - * var texture:Texture = Texture.fromCamera(camera, 1, function():void - * { - * addChild(new Image(texture)); - * }); - * - * @param camera the camera from which the video data is streamed. - * @param scale the scale factor of the created texture. This affects the reported - * width and height of the texture object. - * @param onComplete will be executed when the texture is ready. May contain a parameter - * of type 'Texture'. - */ - public static function fromCamera(camera:Camera, scale:Number=1, - onComplete:Function=null):Texture - { - return fromVideoAttachment("Camera", camera, scale, onComplete); - } - - private static function fromVideoAttachment(type:String, attachment:Object, - scale:Number, onComplete:Function):Texture - { - if (!SystemUtil.supportsVideoTexture) - throw new NotSupportedError("Video Textures are not supported on this platform"); - - var context:Context3D = Starling.context; - if (context == null) throw new MissingContextError(); - - var base:VideoTexture = context.createVideoTexture(); - var texture:ConcreteTexture = new ConcreteVideoTexture(base, scale); - texture.attachVideo(type, attachment, onComplete); - texture.onRestore = function():void - { - texture.root.attachVideo(type, attachment); - }; - - return texture; - } - - /** Creates a texture with a certain size and color. - * - * @param width in points; number of pixels depends on scale parameter - * @param height in points; number of pixels depends on scale parameter - * @param color the RGB color the texture will be filled up - * @param alpha the alpha value that will be used for every pixel - * @param optimizeForRenderToTexture indicates if this texture will be used as render target - * @param scale if you omit this parameter, 'Starling.contentScaleFactor' will be used. - * @param format the context3D texture format to use. Pass one of the packed or - * compressed formats to save memory. - * @param forcePotTexture indicates if the underlying Stage3D texture should be created - * as the power-of-two based "Texture" class instead of the more memory - * efficient "RectangleTexture". - */ - public static function fromColor(width:Number, height:Number, - color:uint=0xffffff, alpha:Number=1.0, - optimizeForRenderToTexture:Boolean=false, - scale:Number=-1, format:String="bgra", - forcePotTexture:Boolean=false):Texture - { - var texture:Texture = Texture.empty(width, height, true, false, - optimizeForRenderToTexture, scale, format, forcePotTexture); - texture.root.clear(color, alpha); - texture.root.onRestore = function():void - { - texture.root.clear(color, alpha); - }; - - return texture; - } - - /** Creates an empty texture of a certain size. - * Beware that the texture can only be used after you either upload some color data - * ("texture.root.upload...") or clear the texture ("texture.root.clear()"). - * - * @param width in points; number of pixels depends on scale parameter - * @param height in points; number of pixels depends on scale parameter - * @param premultipliedAlpha the PMA format you will use the texture with. If you will - * use the texture for bitmap data, use "true"; for ATF data, use "false". - * @param mipMapping indicates if mipmaps should be used for this texture. When you upload - * bitmap data, this decides if mipmaps will be created; when you upload ATF - * data, this decides if mipmaps inside the ATF file will be displayed. - * @param optimizeForRenderToTexture indicates if this texture will be used as render target - * @param scale if you omit this parameter, 'Starling.contentScaleFactor' will be used. - * @param format the context3D texture format to use. Pass one of the packed or - * compressed formats to save memory (at the price of reduced image quality). - * @param forcePotTexture indicates if the underlying Stage3D texture should be created - * as the power-of-two based "Texture" class instead of the more memory - * efficient "RectangleTexture". - */ - public static function empty(width:Number, height:Number, premultipliedAlpha:Boolean=true, - mipMapping:Boolean=false, optimizeForRenderToTexture:Boolean=false, - scale:Number=-1, format:String="bgra", - forcePotTexture:Boolean=false):Texture - { - if (scale <= 0) scale = Starling.contentScaleFactor; - - var actualWidth:int, actualHeight:int; - var nativeTexture:TextureBase; - var concreteTexture:ConcreteTexture; - var context:Context3D = Starling.context; - - if (context == null) throw new MissingContextError(); - - var origWidth:Number = width * scale; - var origHeight:Number = height * scale; - var useRectTexture:Boolean = !forcePotTexture && !mipMapping && - Starling.current.profile != "baselineConstrained" && - format.indexOf("compressed") == -1; - - if (useRectTexture) - { - actualWidth = Math.ceil(origWidth - 0.000000001); // avoid floating point errors - actualHeight = Math.ceil(origHeight - 0.000000001); - - nativeTexture = context.createRectangleTexture( - actualWidth, actualHeight, format, optimizeForRenderToTexture); - - concreteTexture = new ConcreteRectangleTexture( - nativeTexture as RectangleTexture, format, actualWidth, actualHeight, - premultipliedAlpha, optimizeForRenderToTexture, scale); - } - else - { - actualWidth = MathUtil.getNextPowerOfTwo(origWidth); - actualHeight = MathUtil.getNextPowerOfTwo(origHeight); - - nativeTexture = context.createTexture( - actualWidth, actualHeight, format, optimizeForRenderToTexture); - - concreteTexture = new ConcretePotTexture( - nativeTexture as flash.display3D.textures.Texture, format, - actualWidth, actualHeight, mipMapping, premultipliedAlpha, - optimizeForRenderToTexture, scale); - } - - concreteTexture.onRestore = concreteTexture.clear; - - if (actualWidth - origWidth < 0.001 && actualHeight - origHeight < 0.001) - return concreteTexture; - else - return new SubTexture(concreteTexture, new Rectangle(0, 0, width, height), true); - } - - /** Creates a texture that contains a region (in pixels) of another texture. The new - * texture will reference the base texture; no data is duplicated. - * - * @param texture The texture you want to create a SubTexture from. - * @param region The region of the parent texture that the SubTexture will show - * (in points). - * @param frame If the texture was trimmed, the frame rectangle can be used to restore - * the trimmed area. - * @param rotated If true, the SubTexture will show the parent region rotated by - * 90 degrees (CCW). - * @param scaleModifier The scale factor of the new texture will be calculated by - * multiplying the parent texture's scale factor with this value. - */ - public static function fromTexture(texture:Texture, region:Rectangle=null, - frame:Rectangle=null, rotated:Boolean=false, - scaleModifier:Number=1.0):Texture - { - return new SubTexture(texture, region, false, frame, rotated, scaleModifier); - } - - /** Sets up a VertexData instance with the correct positions for 4 vertices so that - * the texture can be mapped onto it unscaled. If the texture has a frame, - * the vertices will be offset accordingly. - * - * @param vertexData the VertexData instance to which the positions will be written. - * @param vertexID the start position within the VertexData instance. - * @param attrName the attribute name referencing the vertex positions. - * @param bounds useful only for textures with a frame. This will position the - * vertices at the correct position within the given bounds, - * distorted appropriately. - */ - public function setupVertexPositions(vertexData:VertexData, vertexID:int=0, - attrName:String="position", - bounds:Rectangle=null):void - { - var frame:Rectangle = this.frame; - var width:Number = this.width; - var height:Number = this.height; - - if (frame) - sRectangle.setTo(-frame.x, -frame.y, width, height); - else - sRectangle.setTo(0, 0, width, height); - - vertexData.setPoint(vertexID, attrName, sRectangle.left, sRectangle.top); - vertexData.setPoint(vertexID + 1, attrName, sRectangle.right, sRectangle.top); - vertexData.setPoint(vertexID + 2, attrName, sRectangle.left, sRectangle.bottom); - vertexData.setPoint(vertexID + 3, attrName, sRectangle.right, sRectangle.bottom); - - if (bounds) - { - var scaleX:Number = bounds.width / frameWidth; - var scaleY:Number = bounds.height / frameHeight; - - if (scaleX != 1.0 || scaleY != 1.0 || bounds.x != 0 || bounds.y != 0) - { - sMatrix.identity(); - sMatrix.scale(scaleX, scaleY); - sMatrix.translate(bounds.x, bounds.y); - vertexData.transformPoints(attrName, sMatrix, vertexID, 4); - } - } - } - - /** Sets up a VertexData instance with the correct texture coordinates for - * 4 vertices so that the texture is mapped to the complete quad. - * - * @param vertexData the vertex data to which the texture coordinates will be written. - * @param vertexID the start position within the VertexData instance. - * @param attrName the attribute name referencing the vertex positions. - */ - public function setupTextureCoordinates(vertexData:VertexData, vertexID:int=0, - attrName:String="texCoords"):void - { - setTexCoords(vertexData, vertexID , attrName, 0.0, 0.0); - setTexCoords(vertexData, vertexID + 1, attrName, 1.0, 0.0); - setTexCoords(vertexData, vertexID + 2, attrName, 0.0, 1.0); - setTexCoords(vertexData, vertexID + 3, attrName, 1.0, 1.0); - } - - /** Transforms the given texture coordinates from the local coordinate system - * into the root texture's coordinate system. */ - public function localToGlobal(u:Number, v:Number, out:Point=null):Point - { - if (out == null) out = new Point(); - if (this == root) out.setTo(u, v); - else MatrixUtil.transformCoords(transformationMatrixToRoot, u, v, out); - return out; - } - - /** Transforms the given texture coordinates from the root texture's coordinate system - * to the local coordinate system. */ - public function globalToLocal(u:Number, v:Number, out:Point=null):Point - { - if (out == null) out = new Point(); - if (this == root) out.setTo(u, v); - else - { - sMatrix.identity(); - sMatrix.copyFrom(transformationMatrixToRoot); - sMatrix.invert(); - MatrixUtil.transformCoords(sMatrix, u, v, out); - } - return out; - } - - /** Writes the given texture coordinates to a VertexData instance after transforming - * them into the root texture's coordinate system. That way, the texture coordinates - * can be used directly to sample the texture in the fragment shader. */ - public function setTexCoords(vertexData:VertexData, vertexID:int, attrName:String, - u:Number, v:Number):void - { - localToGlobal(u, v, sPoint); - vertexData.setPoint(vertexID, attrName, sPoint.x, sPoint.y); - } - - /** Reads a pair of texture coordinates from the given VertexData instance and transforms - * them into the current texture's coordinate system. (Remember, the VertexData instance - * will always contain the coordinates in the root texture's coordinate system!) */ - public function getTexCoords(vertexData:VertexData, vertexID:int, - attrName:String="texCoords", out:Point=null):Point - { - if (out == null) out = new Point(); - vertexData.getPoint(vertexID, attrName, out); - return globalToLocal(out.x, out.y, out); - } - - // properties - - /** The texture frame if it has one (see class description), otherwise null. - *

CAUTION: not a copy, but the actual object! Do not modify!

*/ - public function get frame():Rectangle { return null; } - - /** The height of the texture in points, taking into account the frame rectangle - * (if there is one). */ - public function get frameWidth():Number { return frame ? frame.width : width; } - - /** The width of the texture in points, taking into account the frame rectangle - * (if there is one). */ - public function get frameHeight():Number { return frame ? frame.height : height; } - - /** The width of the texture in points. */ - public function get width():Number { return 0; } - - /** The height of the texture in points. */ - public function get height():Number { return 0; } - - /** The width of the texture in pixels (without scale adjustment). */ - public function get nativeWidth():Number { return 0; } - - /** The height of the texture in pixels (without scale adjustment). */ - public function get nativeHeight():Number { return 0; } - - /** The scale factor, which influences width and height properties. */ - public function get scale():Number { return 1.0; } - - /** The Stage3D texture object the texture is based on. */ - public function get base():TextureBase { return null; } - - /** The concrete texture the texture is based on. */ - public function get root():ConcreteTexture { return null; } - - /** The Context3DTextureFormat of the underlying texture data. */ - public function get format():String { return Context3DTextureFormat.BGRA; } - - /** Indicates if the texture contains mip maps. */ - public function get mipMapping():Boolean { return false; } - - /** Indicates if the alpha values are premultiplied into the RGB values. */ - public function get premultipliedAlpha():Boolean { return false; } - - /** The matrix that is used to transform the texture coordinates into the coordinate - * space of the parent texture, if there is one. @default null - * - *

CAUTION: not a copy, but the actual object! Never modify this matrix!

*/ - public function get transformationMatrix():Matrix { return null; } - - /** The matrix that is used to transform the texture coordinates into the coordinate - * space of the root texture, if this instance is not the root. @default null - * - *

CAUTION: not a copy, but the actual object! Never modify this matrix!

*/ - public function get transformationMatrixToRoot():Matrix { return null; } - - /** Returns the maximum size constraint (for both width and height) for textures in the - * current Context3D profile. */ - public static function get maxSize():int - { - var target:Starling = Starling.current; - var profile:String = target ? target.profile : "baseline"; - - if (profile == "baseline" || profile == "baselineConstrained") - return 2048; - else - return 4096; - } - } -} diff --git a/mobile_version/src/starling/textures/TextureAtlas.as b/mobile_version/src/starling/textures/TextureAtlas.as deleted file mode 100644 index c64003da..00000000 --- a/mobile_version/src/starling/textures/TextureAtlas.as +++ /dev/null @@ -1,221 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= - -package starling.textures -{ - import flash.geom.Rectangle; - import flash.utils.Dictionary; - - import starling.utils.StringUtil; - - /** A texture atlas is a collection of many smaller textures in one big image. This class - * is used to access textures from such an atlas. - * - *

Using a texture atlas for your textures solves two problems:

- * - *
    - *
  • Whenever you switch between textures, the batching of image objects is disrupted.
  • - *
  • Any Stage3D texture has to have side lengths that are powers of two. Starling hides - * this limitation from you, but at the cost of additional graphics memory.
  • - *
- * - *

By using a texture atlas, you avoid both texture switches and the power-of-two - * limitation. All textures are within one big "super-texture", and Starling takes care that - * the correct part of this texture is displayed.

- * - *

There are several ways to create a texture atlas. One is to use the atlas generator - * script that is bundled with Starling's sibling, the - * Sparrow framework. It was only tested in Mac OS X, though. A great multi-platform - * alternative is the commercial tool - * Texture Packer.

- * - *

Whatever tool you use, Starling expects the following file format:

- * - * - * <TextureAtlas imagePath='atlas.png'> - * <SubTexture name='texture_1' x='0' y='0' width='50' height='50'/> - * <SubTexture name='texture_2' x='50' y='0' width='20' height='30'/> - * </TextureAtlas> - * - * - * Texture Frame - * - *

If your images have transparent areas at their edges, you can make use of the - * frame property of the Texture class. Trim the texture by removing the - * transparent edges and specify the original texture size like this:

- * - * - * <SubTexture name='trimmed' x='0' y='0' height='10' width='10' - * frameX='-10' frameY='-10' frameWidth='30' frameHeight='30'/> - * - * - * Texture Rotation - * - *

Some atlas generators can optionally rotate individual textures to optimize the texture - * distribution. This is supported via the boolean attribute "rotated". If it is set to - * true for a certain subtexture, this means that the texture on the atlas - * has been rotated by 90 degrees, clockwise. Starling will undo that rotation by rotating - * it counter-clockwise.

- * - *

In this case, the positional coordinates (x, y, width, height) - * are expected to point at the subtexture as it is present on the atlas (in its rotated - * form), while the "frame" properties must describe the texture in its upright form.

- * - */ - public class TextureAtlas - { - private var _atlasTexture:Texture; - private var _subTextures:Dictionary; - private var _subTextureNames:Vector.; - - /** helper objects */ - private static var sNames:Vector. = new []; - - /** Create a texture atlas from a texture by parsing the regions from an XML file. */ - public function TextureAtlas(texture:Texture, atlasXml:XML=null) - { - _subTextures = new Dictionary(); - _atlasTexture = texture; - - if (atlasXml) - parseAtlasXml(atlasXml); - } - - /** Disposes the atlas texture. */ - public function dispose():void - { - _atlasTexture.dispose(); - } - - /** This function is called by the constructor and will parse an XML in Starling's - * default atlas file format. Override this method to create custom parsing logic - * (e.g. to support a different file format). */ - protected function parseAtlasXml(atlasXml:XML):void - { - var scale:Number = _atlasTexture.scale; - var region:Rectangle = new Rectangle(); - var frame:Rectangle = new Rectangle(); - - for each (var subTexture:XML in atlasXml.SubTexture) - { - var name:String = StringUtil.clean(subTexture.@name); - var x:Number = parseFloat(subTexture.@x) / scale; - var y:Number = parseFloat(subTexture.@y) / scale; - var width:Number = parseFloat(subTexture.@width) / scale; - var height:Number = parseFloat(subTexture.@height) / scale; - var frameX:Number = parseFloat(subTexture.@frameX) / scale; - var frameY:Number = parseFloat(subTexture.@frameY) / scale; - var frameWidth:Number = parseFloat(subTexture.@frameWidth) / scale; - var frameHeight:Number = parseFloat(subTexture.@frameHeight) / scale; - var rotated:Boolean = parseBool( subTexture.@rotated); - - region.setTo(x, y, width, height); - frame.setTo(frameX, frameY, frameWidth, frameHeight); - - if (frameWidth > 0 && frameHeight > 0) - addRegion(name, region, frame, rotated); - else - addRegion(name, region, null, rotated); - } - } - - /** Retrieves a SubTexture by name. Returns null if it is not found. */ - public function getTexture(name:String):Texture - { - return _subTextures[name]; - } - - /** Returns all textures that start with a certain string, sorted alphabetically - * (especially useful for "MovieClip"). */ - public function getTextures(prefix:String="", out:Vector.=null):Vector. - { - if (out == null) out = new []; - - for each (var name:String in getNames(prefix, sNames)) - out[out.length] = getTexture(name); // avoid 'push' - - sNames.length = 0; - return out; - } - - /** Returns all texture names that start with a certain string, sorted alphabetically. */ - public function getNames(prefix:String="", out:Vector.=null):Vector. - { - var name:String; - if (out == null) out = new []; - - if (_subTextureNames == null) - { - // optimization: store sorted list of texture names - _subTextureNames = new []; - for (name in _subTextures) _subTextureNames[_subTextureNames.length] = name; - _subTextureNames.sort(Array.CASEINSENSITIVE); - } - - for each (name in _subTextureNames) - if (name.indexOf(prefix) == 0) - out[out.length] = name; - - return out; - } - - /** Returns the region rectangle associated with a specific name, or null - * if no region with that name has been registered. */ - public function getRegion(name:String):Rectangle - { - var subTexture:SubTexture = _subTextures[name]; - return subTexture ? subTexture.region : null; - } - - /** Returns the frame rectangle of a specific region, or null if that region - * has no frame. */ - public function getFrame(name:String):Rectangle - { - var subTexture:SubTexture = _subTextures[name]; - return subTexture ? subTexture.frame : null; - } - - /** If true, the specified region in the atlas is rotated by 90 degrees (clockwise). The - * SubTexture is thus rotated counter-clockwise to cancel out that transformation. */ - public function getRotation(name:String):Boolean - { - var subTexture:SubTexture = _subTextures[name]; - return subTexture ? subTexture.rotated : false; - } - - /** Adds a named region for a SubTexture (described by rectangle with coordinates in - * points) with an optional frame. */ - public function addRegion(name:String, region:Rectangle, frame:Rectangle=null, - rotated:Boolean=false):void - { - _subTextures[name] = new SubTexture(_atlasTexture, region, false, frame, rotated); - _subTextureNames = null; - } - - /** Removes a region with a certain name. */ - public function removeRegion(name:String):void - { - var subTexture:SubTexture = _subTextures[name]; - if (subTexture) subTexture.dispose(); - delete _subTextures[name]; - _subTextureNames = null; - } - - /** The base texture that makes up the atlas. */ - public function get texture():Texture { return _atlasTexture; } - - // utility methods - - private static function parseBool(value:String):Boolean - { - return value.toLowerCase() == "true"; - } - } -} \ No newline at end of file diff --git a/mobile_version/src/starling/textures/TextureOptions.as b/mobile_version/src/starling/textures/TextureOptions.as deleted file mode 100644 index 8fd42fdf..00000000 --- a/mobile_version/src/starling/textures/TextureOptions.as +++ /dev/null @@ -1,100 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= - -package starling.textures -{ - import starling.core.Starling; - - /** The TextureOptions class specifies options for loading textures with the - * Texture.fromData and Texture.fromTextureBase methods. */ - public class TextureOptions - { - private var _scale:Number; - private var _format:String; - private var _mipMapping:Boolean; - private var _optimizeForRenderToTexture:Boolean = false; - private var _premultipliedAlpha:Boolean; - private var _forcePotTexture:Boolean; - private var _onReady:Function = null; - - /** Creates a new instance with the given options. */ - public function TextureOptions(scale:Number=1.0, mipMapping:Boolean=false, - format:String="bgra", premultipliedAlpha:Boolean=true, - forcePotTexture:Boolean=false) - { - _scale = scale; - _format = format; - _mipMapping = mipMapping; - _forcePotTexture = forcePotTexture; - _premultipliedAlpha = premultipliedAlpha; - } - - /** Creates a clone of the TextureOptions object with the exact same properties. */ - public function clone():TextureOptions - { - var clone:TextureOptions = new TextureOptions(_scale, _mipMapping, _format); - clone._optimizeForRenderToTexture = _optimizeForRenderToTexture; - clone._premultipliedAlpha = _premultipliedAlpha; - clone._forcePotTexture = _forcePotTexture; - clone._onReady = _onReady; - return clone; - } - - /** The scale factor, which influences width and height properties. If you pass '-1', - * the current global content scale factor will be used. @default 1.0 */ - public function get scale():Number { return _scale; } - public function set scale(value:Number):void - { - _scale = value > 0 ? value : Starling.contentScaleFactor; - } - - /** The Context3DTextureFormat of the underlying texture data. Only used - * for textures that are created from Bitmaps; the format of ATF files is set when they - * are created. @default BGRA */ - public function get format():String { return _format; } - public function set format(value:String):void { _format = value; } - - /** Indicates if the texture contains mip maps. @default false */ - public function get mipMapping():Boolean { return _mipMapping; } - public function set mipMapping(value:Boolean):void { _mipMapping = value; } - - /** Indicates if the texture will be used as render target. */ - public function get optimizeForRenderToTexture():Boolean { return _optimizeForRenderToTexture; } - public function set optimizeForRenderToTexture(value:Boolean):void { _optimizeForRenderToTexture = value; } - - /** Indicates if the underlying Stage3D texture should be created as the power-of-two based - * Texture class instead of the more memory efficient RectangleTexture. - * That might be useful when you need to render the texture with wrap mode repeat. - * @default false */ - public function get forcePotTexture():Boolean { return _forcePotTexture; } - public function set forcePotTexture(value:Boolean):void { _forcePotTexture = value; } - - /** A callback that is used only for ATF textures; if it is set, the ATF data will be - * decoded asynchronously. The texture can only be used when the callback has been - * executed. This property is ignored for all other texture types (they are ready - * immediately when the 'Texture.from...' method returns, anyway), and it's only used - * by the Texture.fromData factory method. - * - *

This is the expected function definition: - * function(texture:Texture):void;

- * - * @default null - */ - public function get onReady():Function { return _onReady; } - public function set onReady(value:Function):void { _onReady = value; } - - /** Indicates if the alpha values are premultiplied into the RGB values. This is typically - * true for textures created from BitmapData and false for textures created from ATF data. - * This property will only be read by the Texture.fromTextureBase factory - * method. @default true */ - public function get premultipliedAlpha():Boolean { return _premultipliedAlpha; } - public function set premultipliedAlpha(value:Boolean):void { _premultipliedAlpha = value; } - } -} \ No newline at end of file diff --git a/mobile_version/src/starling/textures/TextureSmoothing.as b/mobile_version/src/starling/textures/TextureSmoothing.as deleted file mode 100644 index 18b353db..00000000 --- a/mobile_version/src/starling/textures/TextureSmoothing.as +++ /dev/null @@ -1,36 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= - -package starling.textures -{ - import starling.errors.AbstractClassError; - - /** A class that provides constant values for the possible smoothing algorithms of a texture. */ - public class TextureSmoothing - { - /** @private */ - public function TextureSmoothing() { throw new AbstractClassError(); } - - /** No smoothing, also called "Nearest Neighbor". Pixels will scale up as big rectangles. */ - public static const NONE:String = "none"; - - /** Bilinear filtering. Creates smooth transitions between pixels. */ - public static const BILINEAR:String = "bilinear"; - - /** Trilinear filtering. Highest quality by taking the next mip map level into account. */ - public static const TRILINEAR:String = "trilinear"; - - /** Determines whether a smoothing value is valid. */ - public static function isValid(smoothing:String):Boolean - { - return smoothing == NONE || smoothing == BILINEAR || smoothing == TRILINEAR; - } - } -} \ No newline at end of file diff --git a/mobile_version/src/starling/utils/Align.as b/mobile_version/src/starling/utils/Align.as deleted file mode 100644 index 665fd3c9..00000000 --- a/mobile_version/src/starling/utils/Align.as +++ /dev/null @@ -1,55 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= - -package starling.utils -{ - import starling.errors.AbstractClassError; - - /** A class that provides constant values for horizontal and vertical alignment of objects. */ - public final class Align - { - /** @private */ - public function Align() { throw new AbstractClassError(); } - - /** Horizontal left alignment. */ - public static const LEFT:String = "left"; - - /** Horizontal right alignment. */ - public static const RIGHT:String = "right"; - - /** Vertical top alignment. */ - public static const TOP:String = "top"; - - /** Vertical bottom alignment. */ - public static const BOTTOM:String = "bottom"; - - /** Centered alignment. */ - public static const CENTER:String = "center"; - - /** Indicates whether the given alignment string is valid. */ - public static function isValid(align:String):Boolean - { - return align == LEFT || align == RIGHT || align == CENTER || - align == TOP || align == BOTTOM; - } - - /** Indicates if the given string is a valid horizontal alignment. */ - public static function isValidHorizontal(align:String):Boolean - { - return align == LEFT || align == CENTER || align == RIGHT; - } - - /** Indicates if the given string is a valid vertical alignment. */ - public static function isValidVertical(align:String):Boolean - { - return align == TOP || align == CENTER || align == BOTTOM; - } - } -} \ No newline at end of file diff --git a/mobile_version/src/starling/utils/AssetManager.as b/mobile_version/src/starling/utils/AssetManager.as deleted file mode 100644 index 03636bc2..00000000 --- a/mobile_version/src/starling/utils/AssetManager.as +++ /dev/null @@ -1,1302 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= - -package starling.utils -{ - import flash.display.Bitmap; - import flash.display.Loader; - import flash.display.LoaderInfo; - import flash.events.HTTPStatusEvent; - import flash.events.IOErrorEvent; - import flash.events.ProgressEvent; - import flash.events.SecurityErrorEvent; - import flash.media.Sound; - import flash.media.SoundChannel; - import flash.media.SoundTransform; - import flash.net.FileReference; - import flash.net.URLLoader; - import flash.net.URLLoaderDataFormat; - import flash.net.URLRequest; - import flash.system.ImageDecodingPolicy; - import flash.system.LoaderContext; - import flash.system.System; - import flash.utils.ByteArray; - import flash.utils.Dictionary; - import flash.utils.describeType; - import flash.utils.getQualifiedClassName; - import flash.utils.setTimeout; - - import starling.core.Starling; - import starling.events.Event; - import starling.events.EventDispatcher; - import starling.text.BitmapFont; - import starling.text.TextField; - import starling.textures.AtfData; - import starling.textures.Texture; - import starling.textures.TextureAtlas; - import starling.textures.TextureOptions; - - /** Dispatched when all textures have been restored after a context loss. */ - [Event(name="texturesRestored", type="starling.events.Event")] - - /** Dispatched when an URLLoader fails with an IO_ERROR while processing the queue. - * The 'data' property of the Event contains the URL-String that could not be loaded. */ - [Event(name="ioError", type="starling.events.Event")] - - /** Dispatched when an URLLoader fails with a SECURITY_ERROR while processing the queue. - * The 'data' property of the Event contains the URL-String that could not be loaded. */ - [Event(name="securityError", type="starling.events.Event")] - - /** Dispatched when an XML or JSON file couldn't be parsed. - * The 'data' property of the Event contains the name of the asset that could not be parsed. */ - [Event(name="parseError", type="starling.events.Event")] - - /** The AssetManager handles loading and accessing a variety of asset types. You can - * add assets directly (via the 'add...' methods) or asynchronously via a queue. This allows - * you to deal with assets in a unified way, no matter if they are loaded from a file, - * directory, URL, or from an embedded object. - * - *

The class can deal with the following media types: - *

    - *
  • Textures, either from Bitmaps or ATF data
  • - *
  • Texture atlases
  • - *
  • Bitmap Fonts
  • - *
  • Sounds
  • - *
  • XML data
  • - *
  • JSON data
  • - *
  • ByteArrays
  • - *
- *

- * - *

For more information on how to add assets from different sources, read the documentation - * of the "enqueue()" method.

- * - * Context Loss - * - *

When the stage3D context is lost (and you have enabled 'Starling.handleLostContext'), - * the AssetManager will automatically restore all loaded textures. To save memory, it will - * get them from their original sources. Since this is done asynchronously, your images might - * not reappear all at once, but during a timeframe of several seconds. If you want, you can - * pause your game during that time; the AssetManager dispatches an "Event.TEXTURES_RESTORED" - * event when all textures have been restored.

- * - * Error handling - * - *

Loading of some assets may fail while the queue is being processed. In that case, the - * AssetManager will dispatch events of type "IO_ERROR", "SECURITY_ERROR" or "PARSE_ERROR". - * You can listen to those events and handle the errors manually (e.g., you could enqueue - * them once again and retry, or provide placeholder textures). Queue processing will - * continue even when those events are dispatched.

- * - * Using variable texture formats - * - *

When you enqueue a texture, its properties for "format", "scale", "mipMapping", and - * "repeat" will reflect the settings of the AssetManager at the time they were enqueued. - * This means that you can enqueue a bunch of textures, then change the settings and enqueue - * some more. Like this:

- * - * - * var appDir:File = File.applicationDirectory; - * var assets:AssetManager = new AssetManager(); - * - * assets.textureFormat = Context3DTextureFormat.BGRA; - * assets.enqueue(appDir.resolvePath("textures/32bit")); - * - * assets.textureFormat = Context3DTextureFormat.BGRA_PACKED; - * assets.enqueue(appDir.resolvePath("textures/16bit")); - * - * assets.loadQueue(...); - */ - public class AssetManager extends EventDispatcher - { - // This HTTPStatusEvent is only available in AIR - private static const HTTP_RESPONSE_STATUS:String = "httpResponseStatus"; - - private var _starling:Starling; - private var _numLostTextures:int; - private var _numRestoredTextures:int; - private var _numLoadingQueues:int; - - private var _defaultTextureOptions:TextureOptions; - private var _checkPolicyFile:Boolean; - private var _keepAtlasXmls:Boolean; - private var _keepFontXmls:Boolean; - private var _numConnections:int; - private var _verbose:Boolean; - private var _queue:Array; - - private var _textures:Dictionary; - private var _atlases:Dictionary; - private var _sounds:Dictionary; - private var _xmls:Dictionary; - private var _objects:Dictionary; - private var _byteArrays:Dictionary; - - /** helper objects */ - private static var sNames:Vector. = new []; - - /** Regex for name / extension extraction from URL. */ - private static const NAME_REGEX:RegExp = /([^\?\/\\]+?)(?:\.([\w\-]+))?(?:\?.*)?$/; - - /** Create a new AssetManager. The 'scaleFactor' and 'useMipmaps' parameters define - * how enqueued bitmaps will be converted to textures. */ - public function AssetManager(scaleFactor:Number=1, useMipmaps:Boolean=false) - { - _defaultTextureOptions = new TextureOptions(scaleFactor, useMipmaps); - _textures = new Dictionary(); - _atlases = new Dictionary(); - _sounds = new Dictionary(); - _xmls = new Dictionary(); - _objects = new Dictionary(); - _byteArrays = new Dictionary(); - _numConnections = 3; - _verbose = true; - _queue = []; - } - - /** Disposes all contained textures, XMLs and ByteArrays. - * - *

Beware that all references to the assets will remain intact, even though the assets - * are no longer valid. Call 'purge' if you want to remove all resources and reuse - * the AssetManager later.

- */ - public function dispose():void - { - for each (var texture:Texture in _textures) - texture.dispose(); - - for each (var atlas:TextureAtlas in _atlases) - atlas.dispose(); - - for each (var xml:XML in _xmls) - System.disposeXML(xml); - - for each (var byteArray:ByteArray in _byteArrays) - byteArray.clear(); - } - - // retrieving - - /** Returns a texture with a certain name. The method first looks through the directly - * added textures; if no texture with that name is found, it scans through all - * texture atlases. */ - public function getTexture(name:String):Texture - { - if (name in _textures) return _textures[name]; - else - { - for each (var atlas:TextureAtlas in _atlases) - { - var texture:Texture = atlas.getTexture(name); - if (texture) return texture; - } - return null; - } - } - - /** Returns all textures that start with a certain string, sorted alphabetically - * (especially useful for "MovieClip"). */ - public function getTextures(prefix:String="", out:Vector.=null):Vector. - { - if (out == null) out = new []; - - for each (var name:String in getTextureNames(prefix, sNames)) - out[out.length] = getTexture(name); // avoid 'push' - - sNames.length = 0; - return out; - } - - /** Returns all texture names that start with a certain string, sorted alphabetically. */ - public function getTextureNames(prefix:String="", out:Vector.=null):Vector. - { - out = getDictionaryKeys(_textures, prefix, out); - - for each (var atlas:TextureAtlas in _atlases) - atlas.getNames(prefix, out); - - out.sort(Array.CASEINSENSITIVE); - return out; - } - - /** Returns a texture atlas with a certain name, or null if it's not found. */ - public function getTextureAtlas(name:String):TextureAtlas - { - return _atlases[name] as TextureAtlas; - } - - /** Returns all texture atlas names that start with a certain string, sorted alphabetically. - * If you pass an out-vector, the names will be added to that vector. */ - public function getTextureAtlasNames(prefix:String="", out:Vector.=null):Vector. - { - return getDictionaryKeys(_atlases, prefix, out); - } - - /** Returns a sound with a certain name, or null if it's not found. */ - public function getSound(name:String):Sound - { - return _sounds[name]; - } - - /** Returns all sound names that start with a certain string, sorted alphabetically. - * If you pass an out-vector, the names will be added to that vector. */ - public function getSoundNames(prefix:String="", out:Vector.=null):Vector. - { - return getDictionaryKeys(_sounds, prefix, out); - } - - /** Generates a new SoundChannel object to play back the sound. This method returns a - * SoundChannel object, which you can access to stop the sound and to control volume. */ - public function playSound(name:String, startTime:Number=0, loops:int=0, - transform:SoundTransform=null):SoundChannel - { - if (name in _sounds) - return getSound(name).play(startTime, loops, transform); - else - return null; - } - - /** Returns an XML with a certain name, or null if it's not found. */ - public function getXml(name:String):XML - { - return _xmls[name]; - } - - /** Returns all XML names that start with a certain string, sorted alphabetically. - * If you pass an out-vector, the names will be added to that vector. */ - public function getXmlNames(prefix:String="", out:Vector.=null):Vector. - { - return getDictionaryKeys(_xmls, prefix, out); - } - - /** Returns an object with a certain name, or null if it's not found. Enqueued JSON - * data is parsed and can be accessed with this method. */ - public function getObject(name:String):Object - { - return _objects[name]; - } - - /** Returns all object names that start with a certain string, sorted alphabetically. - * If you pass an out-vector, the names will be added to that vector. */ - public function getObjectNames(prefix:String="", out:Vector.=null):Vector. - { - return getDictionaryKeys(_objects, prefix, out); - } - - /** Returns a byte array with a certain name, or null if it's not found. */ - public function getByteArray(name:String):ByteArray - { - return _byteArrays[name]; - } - - /** Returns all byte array names that start with a certain string, sorted alphabetically. - * If you pass an out-vector, the names will be added to that vector. */ - public function getByteArrayNames(prefix:String="", out:Vector.=null):Vector. - { - return getDictionaryKeys(_byteArrays, prefix, out); - } - - // direct adding - - /** Register a texture under a certain name. It will be available right away. - * If the name was already taken, the existing texture will be disposed and replaced - * by the new one. */ - public function addTexture(name:String, texture:Texture):void - { - log("Adding texture '" + name + "'"); - - if (name in _textures) - { - log("Warning: name was already in use; the previous texture will be replaced."); - _textures[name].dispose(); - } - - _textures[name] = texture; - } - - /** Register a texture atlas under a certain name. It will be available right away. - * If the name was already taken, the existing atlas will be disposed and replaced - * by the new one. */ - public function addTextureAtlas(name:String, atlas:TextureAtlas):void - { - log("Adding texture atlas '" + name + "'"); - - if (name in _atlases) - { - log("Warning: name was already in use; the previous atlas will be replaced."); - _atlases[name].dispose(); - } - - _atlases[name] = atlas; - } - - /** Register a sound under a certain name. It will be available right away. - * If the name was already taken, the existing sound will be replaced by the new one. */ - public function addSound(name:String, sound:Sound):void - { - log("Adding sound '" + name + "'"); - - if (name in _sounds) - log("Warning: name was already in use; the previous sound will be replaced."); - - _sounds[name] = sound; - } - - /** Register an XML object under a certain name. It will be available right away. - * If the name was already taken, the existing XML will be disposed and replaced - * by the new one. */ - public function addXml(name:String, xml:XML):void - { - log("Adding XML '" + name + "'"); - - if (name in _xmls) - { - log("Warning: name was already in use; the previous XML will be replaced."); - System.disposeXML(_xmls[name]); - } - - _xmls[name] = xml; - } - - /** Register an arbitrary object under a certain name. It will be available right away. - * If the name was already taken, the existing object will be replaced by the new one. */ - public function addObject(name:String, object:Object):void - { - log("Adding object '" + name + "'"); - - if (name in _objects) - log("Warning: name was already in use; the previous object will be replaced."); - - _objects[name] = object; - } - - /** Register a byte array under a certain name. It will be available right away. - * If the name was already taken, the existing byte array will be cleared and replaced - * by the new one. */ - public function addByteArray(name:String, byteArray:ByteArray):void - { - log("Adding byte array '" + name + "'"); - - if (name in _byteArrays) - { - log("Warning: name was already in use; the previous byte array will be replaced."); - _byteArrays[name].clear(); - } - - _byteArrays[name] = byteArray; - } - - // removing - - /** Removes a certain texture, optionally disposing it. */ - public function removeTexture(name:String, dispose:Boolean=true):void - { - log("Removing texture '" + name + "'"); - - if (dispose && name in _textures) - _textures[name].dispose(); - - delete _textures[name]; - } - - /** Removes a certain texture atlas, optionally disposing it. */ - public function removeTextureAtlas(name:String, dispose:Boolean=true):void - { - log("Removing texture atlas '" + name + "'"); - - if (dispose && name in _atlases) - _atlases[name].dispose(); - - delete _atlases[name]; - } - - /** Removes a certain sound. */ - public function removeSound(name:String):void - { - log("Removing sound '"+ name + "'"); - delete _sounds[name]; - } - - /** Removes a certain Xml object, optionally disposing it. */ - public function removeXml(name:String, dispose:Boolean=true):void - { - log("Removing xml '"+ name + "'"); - - if (dispose && name in _xmls) - System.disposeXML(_xmls[name]); - - delete _xmls[name]; - } - - /** Removes a certain object. */ - public function removeObject(name:String):void - { - log("Removing object '"+ name + "'"); - delete _objects[name]; - } - - /** Removes a certain byte array, optionally disposing its memory right away. */ - public function removeByteArray(name:String, dispose:Boolean=true):void - { - log("Removing byte array '"+ name + "'"); - - if (dispose && name in _byteArrays) - _byteArrays[name].clear(); - - delete _byteArrays[name]; - } - - /** Empties the queue and aborts any pending load operations. */ - public function purgeQueue():void - { - _queue.length = 0; - dispatchEventWith(Event.CANCEL); - } - - /** Removes assets of all types (disposing them along the way), empties the queue and - * aborts any pending load operations. */ - public function purge():void - { - log("Purging all assets, emptying queue"); - - purgeQueue(); - dispose(); - - _textures = new Dictionary(); - _atlases = new Dictionary(); - _sounds = new Dictionary(); - _xmls = new Dictionary(); - _objects = new Dictionary(); - _byteArrays = new Dictionary(); - } - - // queued adding - - /** Enqueues one or more raw assets; they will only be available after successfully - * executing the "loadQueue" method. This method accepts a variety of different objects: - * - *
    - *
  • Strings or URLRequests containing an URL to a local or remote resource. Supported - * types: png, jpg, gif, atf, mp3, xml, fnt, json, binary.
  • - *
  • Instances of the File class (AIR only) pointing to a directory or a file. - * Directories will be scanned recursively for all supported types.
  • - *
  • Classes that contain static embedded assets.
  • - *
  • If the file extension is not recognized, the data is analyzed to see if - * contains XML or JSON data. If it's neither, it is stored as ByteArray.
  • - *
- * - *

Suitable object names are extracted automatically: A file named "image.png" will be - * accessible under the name "image". When enqueuing embedded assets via a class, - * the variable name of the embedded object will be used as its name. An exception - * are texture atlases: they will have the same name as the actual texture they are - * referencing.

- * - *

XMLs that contain texture atlases or bitmap fonts are processed directly: fonts are - * registered at the TextField class, atlas textures can be acquired with the - * "getTexture()" method. All other XMLs are available via "getXml()".

- * - *

If you pass in JSON data, it will be parsed into an object and will be available via - * "getObject()".

- */ - public function enqueue(...rawAssets):void - { - for each (var rawAsset:Object in rawAssets) - { - if (rawAsset is Array) - { - enqueue.apply(this, rawAsset); - } - else if (rawAsset is Class) - { - var typeXml:XML = describeType(rawAsset); - var childNode:XML; - - if (_verbose) - log("Looking for static embedded assets in '" + - (typeXml.@name).split("::").pop() + "'"); - - for each (childNode in typeXml.constant.(@type == "Class")) - enqueueWithName(rawAsset[childNode.@name], childNode.@name); - - for each (childNode in typeXml.variable.(@type == "Class")) - enqueueWithName(rawAsset[childNode.@name], childNode.@name); - } - else if (getQualifiedClassName(rawAsset) == "flash.filesystem::File") - { - if (!rawAsset["exists"]) - { - log("File or directory not found: '" + rawAsset["url"] + "'"); - } - else if (!rawAsset["isHidden"]) - { - if (rawAsset["isDirectory"]) - enqueue.apply(this, rawAsset["getDirectoryListing"]()); - else - enqueueWithName(rawAsset); - } - } - else if (rawAsset is String || rawAsset is URLRequest) - { - enqueueWithName(rawAsset); - } - else - { - log("Ignoring unsupported asset type: " + getQualifiedClassName(rawAsset)); - } - } - } - - /** Enqueues a single asset with a custom name that can be used to access it later. - * If the asset is a texture, you can also add custom texture options. - * - * @param asset The asset that will be enqueued; accepts the same objects as the - * 'enqueue' method. - * @param name The name under which the asset will be found later. If you pass null or - * omit the parameter, it's attempted to generate a name automatically. - * @param options Custom options that will be used if 'asset' points to texture data. - * @return the name with which the asset was registered. - */ - public function enqueueWithName(asset:Object, name:String=null, - options:TextureOptions=null):String - { - var filename:String = null; - - if (getQualifiedClassName(asset) == "flash.filesystem::File") - { - filename = asset["name"]; - asset = decodeURI(asset["url"]); - } - - if (name == null) name = getName(asset); - if (options == null) options = _defaultTextureOptions.clone(); - else options = options.clone(); - - log("Enqueuing '" + (filename || name) + "'"); - - _queue.push({ - name: name, - asset: asset, - options: options - }); - - return name; - } - - /** Loads all enqueued assets asynchronously. The 'onProgress' function will be called - * with a 'ratio' between '0.0' and '1.0', with '1.0' meaning that it's complete. - * - *

When you call this method, the manager will save a reference to "Starling.current"; - * all textures that are loaded will be accessible only from within this instance. Thus, - * if you are working with more than one Starling instance, be sure to call - * "makeCurrent()" on the appropriate instance before processing the queue.

- * - * @param onProgress function(ratio:Number):void; - */ - public function loadQueue(onProgress:Function):void - { - if (onProgress == null) - throw new ArgumentError("Argument 'onProgress' must not be null"); - - if (_queue.length == 0) - { - onProgress(1.0); - return; - } - - _starling = Starling.current; - - if (_starling == null || _starling.context == null) - throw new Error("The Starling instance needs to be ready before assets can be loaded."); - - const PROGRESS_PART_ASSETS:Number = 0.9; - const PROGRESS_PART_XMLS:Number = 1.0 - PROGRESS_PART_ASSETS; - - var i:int; - var canceled:Boolean = false; - var xmls:Vector. = new []; - var assetInfos:Array = _queue.concat(); - var assetCount:int = _queue.length; - var assetProgress:Array = []; - var assetIndex:int = 0; - - for (i=0; i 0) loadNextQueueElement(); - else processXmls(); - }; - - processRawAsset(assetInfo.name, assetInfo.asset, assetInfo.options, - xmls, onElementProgress, onElementLoaded); - } - - function updateAssetProgress(index:int, progress:Number):void - { - assetProgress[index] = progress; - - var sum:Number = 0.0; - var len:int = assetProgress.length; - - for (i=0; i, - onProgress:Function, onComplete:Function):void - { - var canceled:Boolean = false; - - addEventListener(Event.CANCEL, cancel); - loadRawAsset(rawAsset, progress, process); - - function process(asset:Object):void - { - var texture:Texture; - var bytes:ByteArray; - var object:Object = null; - var xml:XML = null; - - // the 'current' instance might have changed by now - // if we're running in a set-up with multiple instances. - _starling.makeCurrent(); - - if (canceled) - { - // do nothing - } - else if (asset == null) - { - onComplete(); - } - else if (asset is Sound) - { - addSound(name, asset as Sound); - onComplete(); - } - else if (asset is XML) - { - xml = asset as XML; - - if (xml.localName() == "TextureAtlas" || xml.localName() == "font") - xmls.push(xml); - else - addXml(name, xml); - - onComplete(); - } - else if (_starling.context.driverInfo == "Disposed") - { - log("Context lost while processing assets, retrying ..."); - setTimeout(process, 1, asset); - return; // to keep CANCEL event listener intact - } - else if (asset is Bitmap) - { - texture = Texture.fromData(asset, options); - texture.root.onRestore = function():void - { - _numLostTextures++; - loadRawAsset(rawAsset, null, function(asset:Object):void - { - try - { - if (asset == null) throw new Error("Reload failed"); - texture.root.uploadBitmap(asset as Bitmap); - asset.bitmapData.dispose(); - } - catch (e:Error) - { - log("Texture restoration failed for '" + name + "': " + e.message); - } - - _numRestoredTextures++; - Starling.current.stage.setRequiresRedraw(); - - if (_numLostTextures == _numRestoredTextures) - dispatchEventWith(Event.TEXTURES_RESTORED); - }); - }; - - asset.bitmapData.dispose(); - addTexture(name, texture); - onComplete(); - } - else if (asset is ByteArray) - { - bytes = asset as ByteArray; - - if (AtfData.isAtfData(bytes)) - { - options.onReady = prependCallback(options.onReady, function():void - { - addTexture(name, texture); - onComplete(); - }); - - texture = Texture.fromData(bytes, options); - texture.root.onRestore = function():void - { - _numLostTextures++; - loadRawAsset(rawAsset, null, function(asset:Object):void - { - try - { - if (asset == null) throw new Error("Reload failed"); - texture.root.uploadAtfData(asset as ByteArray, 0, false); - asset.clear(); - } - catch (e:Error) - { - log("Texture restoration failed for '" + name + "': " + e.message); - } - - _numRestoredTextures++; - Starling.current.stage.setRequiresRedraw(); - - if (_numLostTextures == _numRestoredTextures) - dispatchEventWith(Event.TEXTURES_RESTORED); - }); - }; - - bytes.clear(); - } - else if (byteArrayStartsWith(bytes, "{") || byteArrayStartsWith(bytes, "[")) - { - try { object = JSON.parse(bytes.readUTFBytes(bytes.length)); } - catch (e:Error) - { - log("Could not parse JSON: " + e.message); - dispatchEventWith(Event.PARSE_ERROR, false, name); - } - - if (object) addObject(name, object); - - bytes.clear(); - onComplete(); - } - else if (byteArrayStartsWith(bytes, "<")) - { - try { xml = new XML(bytes); } - catch (e:Error) - { - log("Could not parse XML: " + e.message); - dispatchEventWith(Event.PARSE_ERROR, false, name); - } - - process(xml); - bytes.clear(); - } - else - { - addByteArray(name, bytes); - onComplete(); - } - } - else - { - addObject(name, asset); - onComplete(); - } - - // avoid that objects stay in memory (through 'onRestore' functions) - asset = null; - bytes = null; - - removeEventListener(Event.CANCEL, cancel); - } - - function progress(ratio:Number):void - { - if (!canceled) onProgress(ratio); - } - - function cancel():void - { - canceled = true; - } - } - - /** This method is called internally for each element of the queue when it is loaded. - * 'rawAsset' is typically either a class (pointing to an embedded asset) or a string - * (containing the path to a file). For texture data, it will also be called after a - * context loss. - * - *

The method has to transform this object into one of the types that the AssetManager - * can work with, e.g. a Bitmap, a Sound, XML data, or a ByteArray. This object needs to - * be passed to the 'onComplete' callback.

- * - *

The calling method will then process this data accordingly (e.g. a Bitmap will be - * transformed into a texture). Unknown types will be available via 'getObject()'.

- * - *

When overriding this method, you can call 'onProgress' with a number between 0 and 1 - * to update the total queue loading progress.

- */ - protected function loadRawAsset(rawAsset:Object, onProgress:Function, onComplete:Function):void - { - var extension:String = null; - var loaderInfo:LoaderInfo = null; - var urlLoader:URLLoader = null; - var urlRequest:URLRequest = null; - var url:String = null; - - if (rawAsset is Class) - { - setTimeout(complete, 1, new rawAsset()); - } - else if (rawAsset is String || rawAsset is URLRequest) - { - urlRequest = rawAsset as URLRequest || new URLRequest(rawAsset as String); - url = urlRequest.url; - extension = getExtensionFromUrl(url); - - urlLoader = new URLLoader(); - urlLoader.dataFormat = URLLoaderDataFormat.BINARY; - urlLoader.addEventListener(IOErrorEvent.IO_ERROR, onIoError); - urlLoader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onSecurityError); - urlLoader.addEventListener(HTTP_RESPONSE_STATUS, onHttpResponseStatus); - urlLoader.addEventListener(ProgressEvent.PROGRESS, onLoadProgress); - urlLoader.addEventListener(Event.COMPLETE, onUrlLoaderComplete); - urlLoader.load(urlRequest); - } - - function onIoError(event:IOErrorEvent):void - { - log("IO error: " + event.text); - dispatchEventWith(Event.IO_ERROR, false, url); - complete(null); - } - - function onSecurityError(event:SecurityErrorEvent):void - { - log("security error: " + event.text); - dispatchEventWith(Event.SECURITY_ERROR, false, url); - complete(null); - } - - function onHttpResponseStatus(event:HTTPStatusEvent):void - { - if (extension == null) - { - var headers:Array = event["responseHeaders"]; - var contentType:String = getHttpHeader(headers, "Content-Type"); - - if (contentType && /(audio|image)\//.exec(contentType)) - extension = contentType.split("/").pop(); - } - } - - function onLoadProgress(event:ProgressEvent):void - { - if (onProgress != null && event.bytesTotal > 0) - onProgress(event.bytesLoaded / event.bytesTotal); - } - - function onUrlLoaderComplete(event:Object):void - { - var bytes:ByteArray = transformData(urlLoader.data as ByteArray, url); - var sound:Sound; - - if (bytes == null) - { - complete(null); - return; - } - - if (extension) - extension = extension.toLowerCase(); - - switch (extension) - { - case "mpeg": - case "mp3": - sound = new Sound(); - sound.loadCompressedDataFromByteArray(bytes, bytes.length); - bytes.clear(); - complete(sound); - break; - case "jpg": - case "jpeg": - case "png": - case "gif": - var loaderContext:LoaderContext = new LoaderContext(_checkPolicyFile); - var loader:Loader = new Loader(); - loaderContext.imageDecodingPolicy = ImageDecodingPolicy.ON_LOAD; - loaderInfo = loader.contentLoaderInfo; - loaderInfo.addEventListener(IOErrorEvent.IO_ERROR, onIoError); - loaderInfo.addEventListener(Event.COMPLETE, onLoaderComplete); - loader.loadBytes(bytes, loaderContext); - break; - default: // any XML / JSON / binary data - complete(bytes); - break; - } - } - - function onLoaderComplete(event:Object):void - { - urlLoader.data.clear(); - complete(event.target.content); - } - - function complete(asset:Object):void - { - // clean up event listeners - - if (urlLoader) - { - urlLoader.removeEventListener(IOErrorEvent.IO_ERROR, onIoError); - urlLoader.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, onSecurityError); - urlLoader.removeEventListener(HTTP_RESPONSE_STATUS, onHttpResponseStatus); - urlLoader.removeEventListener(ProgressEvent.PROGRESS, onLoadProgress); - urlLoader.removeEventListener(Event.COMPLETE, onUrlLoaderComplete); - } - - if (loaderInfo) - { - loaderInfo.removeEventListener(IOErrorEvent.IO_ERROR, onIoError); - loaderInfo.removeEventListener(Event.COMPLETE, onLoaderComplete); - } - - // On mobile, it is not allowed / endorsed to make stage3D calls while the app - // is in the background. Thus, we pause queue processing if that's the case. - - if (SystemUtil.isDesktop) - onComplete(asset); - else - SystemUtil.executeWhenApplicationIsActive(onComplete, asset); - } - } - - // helpers - - /** This method is called by 'enqueue' to determine the name under which an asset will be - * accessible; override it if you need a custom naming scheme. Note that this method won't - * be called for embedded assets. - * - * @param rawAsset either a String, an URLRequest or a FileReference. - */ - protected function getName(rawAsset:Object):String - { - var name:String; - - if (rawAsset is String) name = rawAsset as String; - else if (rawAsset is URLRequest) name = (rawAsset as URLRequest).url; - else if (rawAsset is FileReference) name = (rawAsset as FileReference).name; - - if (name) - { - name = name.replace(/%20/g, " "); // URLs use '%20' for spaces - name = getBasenameFromUrl(name); - - if (name) return name; - else throw new ArgumentError("Could not extract name from String '" + rawAsset + "'"); - } - else - { - name = getQualifiedClassName(rawAsset); - throw new ArgumentError("Cannot extract names for objects of type '" + name + "'"); - } - } - - /** This method is called when raw byte data has been loaded from an URL or a file. - * Override it to process the downloaded data in some way (e.g. decompression) or - * to cache it on disk. - * - *

It's okay to call one (or more) of the 'add...' methods from here. If the binary - * data contains multiple objects, this allows you to process all of them at once. - * Return 'null' to abort processing of the current item.

*/ - protected function transformData(data:ByteArray, url:String):ByteArray - { - return data; - } - - /** This method is called during loading of assets when 'verbose' is activated. Per - * default, it traces 'message' to the console. */ - protected function log(message:String):void - { - if (_verbose) trace("[AssetManager]", message); - } - - private function byteArrayStartsWith(bytes:ByteArray, char:String):Boolean - { - var start:int = 0; - var length:int = bytes.length; - var wanted:int = char.charCodeAt(0); - - // recognize BOMs - - if (length >= 4 && - (bytes[0] == 0x00 && bytes[1] == 0x00 && bytes[2] == 0xfe && bytes[3] == 0xff) || - (bytes[0] == 0xff && bytes[1] == 0xfe && bytes[2] == 0x00 && bytes[3] == 0x00)) - { - start = 4; // UTF-32 - } - else if (length >= 3 && bytes[0] == 0xef && bytes[1] == 0xbb && bytes[2] == 0xbf) - { - start = 3; // UTF-8 - } - else if (length >= 2 && - (bytes[0] == 0xfe && bytes[1] == 0xff) || (bytes[0] == 0xff && bytes[1] == 0xfe)) - { - start = 2; // UTF-16 - } - - // find first meaningful letter - - for (var i:int=start; i=null):Vector. - { - if (out == null) out = new []; - - for (var name:String in dictionary) - if (name.indexOf(prefix) == 0) - out[out.length] = name; // avoid 'push' - - out.sort(Array.CASEINSENSITIVE); - return out; - } - - private function getHttpHeader(headers:Array, headerName:String):String - { - if (headers) - { - for each (var header:Object in headers) - if (header.name == headerName) return header.value; - } - return null; - } - - /** Extracts the base name of a file path or URL, i.e. the file name without extension. */ - protected function getBasenameFromUrl(url:String):String - { - var matches:Array = NAME_REGEX.exec(url); - if (matches && matches.length > 0) return matches[1]; - else return null; - } - - /** Extracts the file extension from an URL. */ - protected function getExtensionFromUrl(url:String):String - { - var matches:Array = NAME_REGEX.exec(url); - if (matches && matches.length > 1) return matches[2]; - else return null; - } - - private function prependCallback(oldCallback:Function, newCallback:Function):Function - { - // TODO: it might make sense to add this (together with "appendCallback") - // as a public utility method ("FunctionUtil"?) - - if (oldCallback == null) return newCallback; - else if (newCallback == null) return oldCallback; - else return function():void - { - newCallback(); - oldCallback(); - }; - } - - // properties - - /** The queue contains one 'Object' for each enqueued asset. Each object has 'asset' - * and 'name' properties, pointing to the raw asset and its name, respectively. */ - protected function get queue():Array { return _queue; } - - /** Returns the number of raw assets that have been enqueued, but not yet loaded. */ - public function get numQueuedAssets():int { return _queue.length; } - - /** When activated, the class will trace information about added/enqueued assets. - * @default true */ - public function get verbose():Boolean { return _verbose; } - public function set verbose(value:Boolean):void { _verbose = value; } - - /** Indicates if a queue is currently being loaded. */ - public function get isLoading():Boolean { return _numLoadingQueues > 0; } - - /** For bitmap textures, this flag indicates if mip maps should be generated when they - * are loaded; for ATF textures, it indicates if mip maps are valid and should be - * used. @default false */ - public function get useMipMaps():Boolean { return _defaultTextureOptions.mipMapping; } - public function set useMipMaps(value:Boolean):void { _defaultTextureOptions.mipMapping = value; } - - /** Textures that are created from Bitmaps or ATF files will have the scale factor - * assigned here. @default 1 */ - public function get scaleFactor():Number { return _defaultTextureOptions.scale; } - public function set scaleFactor(value:Number):void { _defaultTextureOptions.scale = value; } - - /** Textures that are created from Bitmaps will be uploaded to the GPU with the - * Context3DTextureFormat assigned to this property. @default "bgra" */ - public function get textureFormat():String { return _defaultTextureOptions.format; } - public function set textureFormat(value:String):void { _defaultTextureOptions.format = value; } - - /** Indicates if the underlying Stage3D textures should be created as the power-of-two based - * Texture class instead of the more memory efficient RectangleTexture. - * @default false */ - public function get forcePotTextures():Boolean { return _defaultTextureOptions.forcePotTexture; } - public function set forcePotTextures(value:Boolean):void { _defaultTextureOptions.forcePotTexture = value; } - - /** Specifies whether a check should be made for the existence of a URL policy file before - * loading an object from a remote server. More information about this topic can be found - * in the 'flash.system.LoaderContext' documentation. @default false */ - public function get checkPolicyFile():Boolean { return _checkPolicyFile; } - public function set checkPolicyFile(value:Boolean):void { _checkPolicyFile = value; } - - /** Indicates if atlas XML data should be stored for access via the 'getXml' method. - * If true, you can access an XML under the same name as the atlas. - * If false, XMLs will be disposed when the atlas was created. @default false. */ - public function get keepAtlasXmls():Boolean { return _keepAtlasXmls; } - public function set keepAtlasXmls(value:Boolean):void { _keepAtlasXmls = value; } - - /** Indicates if bitmap font XML data should be stored for access via the 'getXml' method. - * If true, you can access an XML under the same name as the bitmap font. - * If false, XMLs will be disposed when the font was created. @default false. */ - public function get keepFontXmls():Boolean { return _keepFontXmls; } - public function set keepFontXmls(value:Boolean):void { _keepFontXmls = value; } - - /** The maximum number of parallel connections that are spawned when loading the queue. - * More connections can reduce loading times, but require more memory. @default 3. */ - public function get numConnections():int { return _numConnections; } - public function set numConnections(value:int):void { _numConnections = value; } - } -} diff --git a/mobile_version/src/starling/utils/Color.as b/mobile_version/src/starling/utils/Color.as deleted file mode 100644 index 55f8a372..00000000 --- a/mobile_version/src/starling/utils/Color.as +++ /dev/null @@ -1,117 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= - -package starling.utils -{ - import starling.errors.AbstractClassError; - - /** A utility class containing predefined colors and methods converting between different - * color representations. */ - public class Color - { - public static const WHITE:uint = 0xffffff; - public static const SILVER:uint = 0xc0c0c0; - public static const GRAY:uint = 0x808080; - public static const BLACK:uint = 0x000000; - public static const RED:uint = 0xff0000; - public static const MAROON:uint = 0x800000; - public static const YELLOW:uint = 0xffff00; - public static const OLIVE:uint = 0x808000; - public static const LIME:uint = 0x00ff00; - public static const GREEN:uint = 0x008000; - public static const AQUA:uint = 0x00ffff; - public static const TEAL:uint = 0x008080; - public static const BLUE:uint = 0x0000ff; - public static const NAVY:uint = 0x000080; - public static const FUCHSIA:uint = 0xff00ff; - public static const PURPLE:uint = 0x800080; - - /** Returns the alpha part of an ARGB color (0 - 255). */ - public static function getAlpha(color:uint):int { return (color >> 24) & 0xff; } - - /** Returns the red part of an (A)RGB color (0 - 255). */ - public static function getRed(color:uint):int { return (color >> 16) & 0xff; } - - /** Returns the green part of an (A)RGB color (0 - 255). */ - public static function getGreen(color:uint):int { return (color >> 8) & 0xff; } - - /** Returns the blue part of an (A)RGB color (0 - 255). */ - public static function getBlue(color:uint):int { return color & 0xff; } - - /** Creates an RGB color, stored in an unsigned integer. Channels are expected - * in the range 0 - 255. */ - public static function rgb(red:int, green:int, blue:int):uint - { - return (red << 16) | (green << 8) | blue; - } - - /** Creates an ARGB color, stored in an unsigned integer. Channels are expected - * in the range 0 - 255. */ - public static function argb(alpha:int, red:int, green:int, blue:int):uint - { - return (alpha << 24) | (red << 16) | (green << 8) | blue; - } - - /** Converts a color to a vector containing the RGBA components (in this order) scaled - * between 0 and 1. */ - public static function toVector(color:uint, out:Vector.=null):Vector. - { - if (out == null) out = new Vector.(4, true); - - out[0] = ((color >> 16) & 0xff) / 255.0; - out[1] = ((color >> 8) & 0xff) / 255.0; - out[2] = ( color & 0xff) / 255.0; - out[3] = ((color >> 24) & 0xff) / 255.0; - - return out; - } - - /** Multiplies all channels of an (A)RGB color with a certain factor. */ - public static function multiply(color:uint, factor:Number):uint - { - var alpha:uint = ((color >> 24) & 0xff) * factor; - var red:uint = ((color >> 16) & 0xff) * factor; - var green:uint = ((color >> 8) & 0xff) * factor; - var blue:uint = ( color & 0xff) * factor; - - if (alpha > 255) alpha = 255; - if (red > 255) red = 255; - if (green > 255) green = 255; - if (blue > 255) blue = 255; - - return argb(alpha, red, green, blue); - } - - /** Calculates a smooth transition between one color to the next. - * ratio is expected between 0 and 1. */ - public static function interpolate(startColor:uint, endColor:uint, ratio:Number):uint - { - var startA:uint = (startColor >> 24) & 0xff; - var startR:uint = (startColor >> 16) & 0xff; - var startG:uint = (startColor >> 8) & 0xff; - var startB:uint = (startColor ) & 0xff; - - var endA:uint = (endColor >> 24) & 0xff; - var endR:uint = (endColor >> 16) & 0xff; - var endG:uint = (endColor >> 8) & 0xff; - var endB:uint = (endColor ) & 0xff; - - var newA:uint = startA + (endA - startA) * ratio; - var newR:uint = startR + (endR - startR) * ratio; - var newG:uint = startG + (endG - startG) * ratio; - var newB:uint = startB + (endB - startB) * ratio; - - return (newA << 24) | (newR << 16) | (newG << 8) | newB; - } - - /** @private */ - public function Color() { throw new AbstractClassError(); } - } -} \ No newline at end of file diff --git a/mobile_version/src/starling/utils/MathUtil.as b/mobile_version/src/starling/utils/MathUtil.as deleted file mode 100644 index 07b5db8d..00000000 --- a/mobile_version/src/starling/utils/MathUtil.as +++ /dev/null @@ -1,124 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= - -package starling.utils -{ - import flash.geom.Point; - import flash.geom.Vector3D; - - import starling.errors.AbstractClassError; - - /** A utility class containing methods you might need for math problems. */ - public class MathUtil - { - private static const TWO_PI:Number = Math.PI * 2.0; - - /** @private */ - public function MathUtil() { throw new AbstractClassError(); } - - /** Calculates the intersection point between the xy-plane and an infinite line - * that is defined by two 3D points in the same coordinate system. */ - public static function intersectLineWithXYPlane(pointA:Vector3D, pointB:Vector3D, - out:Point=null):Point - { - if (out == null) out = new Point(); - - var vectorX:Number = pointB.x - pointA.x; - var vectorY:Number = pointB.y - pointA.y; - var vectorZ:Number = pointB.z - pointA.z; - var lambda:Number = -pointA.z / vectorZ; - - out.x = pointA.x + lambda * vectorX; - out.y = pointA.y + lambda * vectorY; - - return out; - } - - /** Calculates if the point p is inside the triangle a-b-c. */ - public static function isPointInTriangle(p:Point, a:Point, b:Point, c:Point):Boolean - { - // This algorithm is described well in this article: - // http://www.blackpawn.com/texts/pointinpoly/default.html - - var v0x:Number = c.x - a.x; - var v0y:Number = c.y - a.y; - var v1x:Number = b.x - a.x; - var v1y:Number = b.y - a.y; - var v2x:Number = p.x - a.x; - var v2y:Number = p.y - a.y; - - var dot00:Number = v0x * v0x + v0y * v0y; - var dot01:Number = v0x * v1x + v0y * v1y; - var dot02:Number = v0x * v2x + v0y * v2y; - var dot11:Number = v1x * v1x + v1y * v1y; - var dot12:Number = v1x * v2x + v1y * v2y; - - var invDen:Number = 1.0 / (dot00 * dot11 - dot01 * dot01); - var u:Number = (dot11 * dot02 - dot01 * dot12) * invDen; - var v:Number = (dot00 * dot12 - dot01 * dot02) * invDen; - - return (u >= 0) && (v >= 0) && (u + v < 1); - } - - /** Moves a radian angle into the range [-PI, +PI], while keeping the direction intact. */ - public static function normalizeAngle(angle:Number):Number - { - // move to equivalent value in range [0 deg, 360 deg] without a loop - angle = angle % TWO_PI; - - // move to [-180 deg, +180 deg] - if (angle < -Math.PI) angle += TWO_PI; - if (angle > Math.PI) angle -= TWO_PI; - - return angle; - } - - /** Returns the next power of two that is equal to or bigger than the specified number. */ - public static function getNextPowerOfTwo(number:Number):int - { - if (number is int && number > 0 && (number & (number - 1)) == 0) // see: http://goo.gl/D9kPj - return number; - else - { - var result:int = 1; - number -= 0.000000001; // avoid floating point rounding errors - - while (result < number) result <<= 1; - return result; - } - } - - /** Indicates if two float (Number) values are equal, give or take epsilon. */ - public static function isEquivalent(a:Number, b:Number, epsilon:Number=0.0001):Boolean - { - return (a - epsilon < b) && (a + epsilon > b); - } - - /** Returns the larger of the two values. Different to the native Math.max, - * this doesn't create any temporary objects when using the AOT compiler. */ - public static function max(a:Number, b:Number):Number - { - return a > b ? a : b; - } - - /** Returns the smaller of the two values. Different to the native Math.min, - * this doesn't create any temporary objects when using the AOT compiler. */ - public static function min(a:Number, b:Number):Number - { - return a < b ? a : b; - } - - /** Moves value into the range between min and max. */ - public static function clamp(value:Number, min:Number, max:Number):Number - { - return value < min ? min : (value > max ? max : value); - } - } -} \ No newline at end of file diff --git a/mobile_version/src/starling/utils/MatrixUtil.as b/mobile_version/src/starling/utils/MatrixUtil.as deleted file mode 100644 index f83691f1..00000000 --- a/mobile_version/src/starling/utils/MatrixUtil.as +++ /dev/null @@ -1,382 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= - -package starling.utils -{ - import flash.geom.Matrix; - import flash.geom.Matrix3D; - import flash.geom.Point; - import flash.geom.Vector3D; - - import starling.errors.AbstractClassError; - - /** A utility class containing methods related to the Matrix class. */ - public class MatrixUtil - { - // helper objects - private static var sRawData:Vector. = - new [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]; - private static var sRawData2:Vector. = new Vector.(16, true); - private static var sPoint3D:Vector3D = new Vector3D(); - private static var sMatrixData:Vector. = - new [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; - - /** @private */ - public function MatrixUtil() { throw new AbstractClassError(); } - - /** Converts a 2D matrix to a 3D matrix. If you pass an out-matrix, - * the result will be stored in this matrix instead of creating a new object. */ - public static function convertTo3D(matrix:Matrix, out:Matrix3D=null):Matrix3D - { - if (out == null) out = new Matrix3D(); - - sRawData[ 0] = matrix.a; - sRawData[ 1] = matrix.b; - sRawData[ 4] = matrix.c; - sRawData[ 5] = matrix.d; - sRawData[12] = matrix.tx; - sRawData[13] = matrix.ty; - - out.copyRawDataFrom(sRawData); - return out; - } - - /** Converts a 3D matrix to a 2D matrix. Beware that this will work only for a 3D matrix - * describing a pure 2D transformation. */ - public static function convertTo2D(matrix3D:Matrix3D, out:Matrix=null):Matrix - { - if (out == null) out = new Matrix(); - - matrix3D.copyRawDataTo(sRawData2); - out.a = sRawData2[ 0]; - out.b = sRawData2[ 1]; - out.c = sRawData2[ 4]; - out.d = sRawData2[ 5]; - out.tx = sRawData2[12]; - out.ty = sRawData2[13]; - - return out; - } - - /** Determines if the matrix is an identity matrix. */ - public static function isIdentity(matrix:Matrix):Boolean - { - return matrix.a == 1.0 && matrix.b == 0.0 && matrix.c == 0.0 && matrix.d == 1.0 && - matrix.tx == 0.0 && matrix.ty == 0.0; - } - - /** Determines if the 3D matrix is an identity matrix. */ - public static function isIdentity3D(matrix:Matrix3D):Boolean - { - var data:Vector. = sRawData2; - matrix.copyRawDataTo(data); - - return data[ 0] == 1.0 && data[ 1] == 0.0 && data[ 2] == 0.0 && data[ 3] == 0.0 && - data[ 4] == 0.0 && data[ 5] == 1.0 && data[ 6] == 0.0 && data[ 7] == 0.0 && - data[ 8] == 0.0 && data[ 9] == 0.0 && data[10] == 1.0 && data[11] == 0.0 && - data[12] == 0.0 && data[13] == 0.0 && data[14] == 0.0 && data[15] == 1.0; - } - - /** Transform a point with the given matrix. */ - public static function transformPoint(matrix:Matrix, point:Point, - out:Point=null):Point - { - return transformCoords(matrix, point.x, point.y, out); - } - - /** Transforms a 3D point with the given matrix. */ - public static function transformPoint3D(matrix:Matrix3D, point:Vector3D, - out:Vector3D=null):Vector3D - { - return transformCoords3D(matrix, point.x, point.y, point.z, out); - } - - /** Uses a matrix to transform 2D coordinates into a different space. If you pass an - * out-point, the result will be stored in this point instead of creating - * a new object. */ - public static function transformCoords(matrix:Matrix, x:Number, y:Number, - out:Point=null):Point - { - if (out == null) out = new Point(); - - out.x = matrix.a * x + matrix.c * y + matrix.tx; - out.y = matrix.d * y + matrix.b * x + matrix.ty; - - return out; - } - - /** Uses a matrix to transform 3D coordinates into a different space. If you pass a - * 'resultVector', the result will be stored in this vector3D instead of creating a - * new object. */ - public static function transformCoords3D(matrix:Matrix3D, x:Number, y:Number, z:Number, - out:Vector3D=null):Vector3D - { - if (out == null) out = new Vector3D(); - - matrix.copyRawDataTo(sRawData2); - out.x = x * sRawData2[0] + y * sRawData2[4] + z * sRawData2[ 8] + sRawData2[12]; - out.y = x * sRawData2[1] + y * sRawData2[5] + z * sRawData2[ 9] + sRawData2[13]; - out.z = x * sRawData2[2] + y * sRawData2[6] + z * sRawData2[10] + sRawData2[14]; - out.w = x * sRawData2[3] + y * sRawData2[7] + z * sRawData2[11] + sRawData2[15]; - - return out; - } - - /** Appends a skew transformation to a matrix (angles in radians). The skew matrix - * has the following form: - *
-         *  | cos(skewY)  -sin(skewX)  0 |
-         *  | sin(skewY)   cos(skewX)  0 |
-         *  |     0            0       1 |
-         *  
- */ - public static function skew(matrix:Matrix, skewX:Number, skewY:Number):void - { - var sinX:Number = Math.sin(skewX); - var cosX:Number = Math.cos(skewX); - var sinY:Number = Math.sin(skewY); - var cosY:Number = Math.cos(skewY); - - matrix.setTo(matrix.a * cosY - matrix.b * sinX, - matrix.a * sinY + matrix.b * cosX, - matrix.c * cosY - matrix.d * sinX, - matrix.c * sinY + matrix.d * cosX, - matrix.tx * cosY - matrix.ty * sinX, - matrix.tx * sinY + matrix.ty * cosX); - } - - /** Prepends a matrix to 'base' by multiplying it with another matrix. */ - public static function prependMatrix(base:Matrix, prep:Matrix):void - { - base.setTo(base.a * prep.a + base.c * prep.b, - base.b * prep.a + base.d * prep.b, - base.a * prep.c + base.c * prep.d, - base.b * prep.c + base.d * prep.d, - base.tx + base.a * prep.tx + base.c * prep.ty, - base.ty + base.b * prep.tx + base.d * prep.ty); - } - - /** Prepends an incremental translation to a Matrix object. */ - public static function prependTranslation(matrix:Matrix, tx:Number, ty:Number):void - { - matrix.tx += matrix.a * tx + matrix.c * ty; - matrix.ty += matrix.b * tx + matrix.d * ty; - } - - /** Prepends an incremental scale change to a Matrix object. */ - public static function prependScale(matrix:Matrix, sx:Number, sy:Number):void - { - matrix.setTo(matrix.a * sx, matrix.b * sx, - matrix.c * sy, matrix.d * sy, - matrix.tx, matrix.ty); - } - - /** Prepends an incremental rotation to a Matrix object (angle in radians). */ - public static function prependRotation(matrix:Matrix, angle:Number):void - { - var sin:Number = Math.sin(angle); - var cos:Number = Math.cos(angle); - - matrix.setTo(matrix.a * cos + matrix.c * sin, matrix.b * cos + matrix.d * sin, - matrix.c * cos - matrix.a * sin, matrix.d * cos - matrix.b * sin, - matrix.tx, matrix.ty); - } - - /** Prepends a skew transformation to a Matrix object (angles in radians). The skew matrix - * has the following form: - *
-         *  | cos(skewY)  -sin(skewX)  0 |
-         *  | sin(skewY)   cos(skewX)  0 |
-         *  |     0            0       1 |
-         *  
- */ - public static function prependSkew(matrix:Matrix, skewX:Number, skewY:Number):void - { - var sinX:Number = Math.sin(skewX); - var cosX:Number = Math.cos(skewX); - var sinY:Number = Math.sin(skewY); - var cosY:Number = Math.cos(skewY); - - matrix.setTo(matrix.a * cosY + matrix.c * sinY, - matrix.b * cosY + matrix.d * sinY, - matrix.c * cosX - matrix.a * sinX, - matrix.d * cosX - matrix.b * sinX, - matrix.tx, matrix.ty); - } - - /** Converts a Matrix3D instance to a String, which is useful when debugging. Per default, - * the raw data is displayed transposed, so that the columns are displayed vertically. */ - public static function toString3D(matrix:Matrix3D, transpose:Boolean=true, - precision:int=3):String - { - if (transpose) matrix.transpose(); - matrix.copyRawDataTo(sRawData2); - if (transpose) matrix.transpose(); - - return "[Matrix3D rawData=\n" + formatRawData(sRawData2, 4, 4, precision) + "\n]"; - } - - /** Converts a Matrix instance to a String, which is useful when debugging. */ - public static function toString(matrix:Matrix, precision:int=3):String - { - sRawData2[0] = matrix.a; sRawData2[1] = matrix.c; sRawData2[2] = matrix.tx; - sRawData2[3] = matrix.b; sRawData2[4] = matrix.d; sRawData2[5] = matrix.ty; - - return "[Matrix rawData=\n" + formatRawData(sRawData2, 3, 2, precision) + "\n]"; - } - - private static function formatRawData(data:Vector., numCols:int, numRows:int, - precision:int, indent:String=" "):String - { - var result:String = indent; - var numValues:int = numCols * numRows; - var highestValue:Number = 0.0; - var valueString:String; - var value:Number; - - for (var i:int=0; i highestValue) highestValue = value; - } - - var numChars:int = highestValue.toFixed(precision).length + 1; - - for (var y:int=0; y 0 && matrix.b - E < 0 && matrix.c + E > 0 && matrix.c - E < 0) - { - // what we actually want is 'Math.abs(matrix.a)', but squaring - // the value works just as well for our needs & is faster. - - aSq = matrix.a * matrix.a; - dSq = matrix.d * matrix.d; - doSnap = aSq + E > 1 && aSq - E < 1 && dSq + E > 1 && dSq - E < 1; - } - else if (matrix.a + E > 0 && matrix.a - E < 0 && matrix.d + E > 0 && matrix.d - E < 0) - { - bSq = matrix.b * matrix.b; - cSq = matrix.c * matrix.c; - doSnap = bSq + E > 1 && bSq - E < 1 && cSq + E > 1 && cSq - E < 1; - } - - if (doSnap) - { - matrix.tx = Math.round(matrix.tx / pixelSize) * pixelSize; - matrix.ty = Math.round(matrix.ty / pixelSize) * pixelSize; - } - } - - /** Creates a perspective projection matrix suitable for 2D and 3D rendering. - * - *

The first 4 parameters define which area of the stage you want to view (the camera - * will 'zoom' to exactly this region). The final 3 parameters determine the perspective - * in which you're looking at the stage.

- * - *

The stage is always on the rectangle that is spawned up between x- and y-axis (with - * the given size). All objects that are exactly on that rectangle (z equals zero) will be - * rendered in their true size, without any distortion.

- * - *

If you pass only the first 4 parameters, the camera will be set up above the center - * of the stage, with a field of view of 1.0 rad.

- */ - public static function createPerspectiveProjectionMatrix( - x:Number, y:Number, width:Number, height:Number, - stageWidth:Number=0, stageHeight:Number=0, cameraPos:Vector3D=null, - out:Matrix3D=null):Matrix3D - { - if (out == null) out = new Matrix3D(); - if (stageWidth <= 0) stageWidth = width; - if (stageHeight <= 0) stageHeight = height; - if (cameraPos == null) - { - cameraPos = sPoint3D; - cameraPos.setTo( - stageWidth / 2, stageHeight / 2, // -> center of stage - stageWidth / Math.tan(0.5) * 0.5); // -> fieldOfView = 1.0 rad - } - - const focalLength:Number = Math.abs(cameraPos.z); - const offsetX:Number = cameraPos.x - stageWidth / 2; - const offsetY:Number = cameraPos.y - stageHeight / 2; - const far:Number = focalLength * 20; - const near:Number = 1; - const scaleX:Number = stageWidth / width; - const scaleY:Number = stageHeight / height; - - // set up general perspective - sMatrixData[ 0] = 2 * focalLength / stageWidth; // 0,0 - sMatrixData[ 5] = -2 * focalLength / stageHeight; // 1,1 [negative to invert y-axis] - sMatrixData[10] = far / (far - near); // 2,2 - sMatrixData[14] = -far * near / (far - near); // 2,3 - sMatrixData[11] = 1; // 3,2 - - // now zoom in to visible area - sMatrixData[0] *= scaleX; - sMatrixData[5] *= scaleY; - sMatrixData[8] = scaleX - 1 - 2 * scaleX * (x - offsetX) / stageWidth; - sMatrixData[9] = -scaleY + 1 + 2 * scaleY * (y - offsetY) / stageHeight; - - out.copyRawDataFrom(sMatrixData); - out.prependTranslation( - -stageWidth /2.0 - offsetX, - -stageHeight/2.0 - offsetY, - focalLength); - - return out; - } - - /** Creates a orthographic projection matrix suitable for 2D rendering. */ - public static function createOrthographicProjectionMatrix( - x:Number, y:Number, width:Number, height:Number, out:Matrix=null):Matrix - { - if (out == null) out = new Matrix(); - - out.setTo(2.0/width, 0, 0, -2.0/height, - -(2*x + width) / width, (2*y + height) / height); - - return out; - } - } -} \ No newline at end of file diff --git a/mobile_version/src/starling/utils/MeshSubset.as b/mobile_version/src/starling/utils/MeshSubset.as deleted file mode 100644 index 014ef5db..00000000 --- a/mobile_version/src/starling/utils/MeshSubset.as +++ /dev/null @@ -1,46 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= - -package starling.utils -{ - /** A class describing a range of vertices and indices, thus referencing a subset of a Mesh. */ - public class MeshSubset - { - /** The ID of the first vertex. */ - public var vertexID:int; - - /** The total number of vertices. */ - public var numVertices:int; - - /** The ID of the first index. */ - public var indexID:int; - - /** The total number of indices. */ - public var numIndices:int; - - /** Creates a new MeshSubset. */ - public function MeshSubset(vertexID:int=0, numVertices:int=-1, - indexID:int=0, numIndices:int=-1) - { - setTo(vertexID, numVertices, indexID, numIndices); - } - - /** Changes all properties at once. - * Call without any arguments to reference a complete mesh. */ - public function setTo(vertexID:int=0, numVertices:int=-1, - indexID:int=0, numIndices:int=-1):void - { - this.vertexID = vertexID; - this.numVertices = numVertices; - this.indexID = indexID; - this.numIndices = numIndices; - } - } -} diff --git a/mobile_version/src/starling/utils/MeshUtil.as b/mobile_version/src/starling/utils/MeshUtil.as deleted file mode 100644 index 0ba36f97..00000000 --- a/mobile_version/src/starling/utils/MeshUtil.as +++ /dev/null @@ -1,93 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= - -package starling.utils -{ - import flash.geom.Matrix; - import flash.geom.Matrix3D; - import flash.geom.Point; - import flash.geom.Rectangle; - import flash.geom.Vector3D; - - import starling.display.DisplayObject; - import starling.display.Stage; - import starling.errors.AbstractClassError; - import starling.rendering.IndexData; - import starling.rendering.VertexData; - - /** A utility class that helps with tasks that are common when working with meshes. */ - public class MeshUtil - { - // helper objects - private static var sPoint3D:Vector3D = new Vector3D(); - private static var sMatrix:Matrix = new Matrix(); - private static var sMatrix3D:Matrix3D = new Matrix3D(); - - /** @private */ - public function MeshUtil() { throw new AbstractClassError(); } - - /** Determines if a point is inside a mesh that is spawned up by the given - * vertex- and index-data. */ - public static function containsPoint(vertexData:VertexData, indexData:IndexData, - point:Point):Boolean - { - var i:int; - var result:Boolean = false; - var numIndices:int = indexData.numIndices; - var p0:Point = Pool.getPoint(); - var p1:Point = Pool.getPoint(); - var p2:Point = Pool.getPoint(); - - for (i=0; inull to reset all values to zero. */ - public function copyFrom(padding:Padding):void - { - if (padding == null) setTo(0, 0, 0, 0); - else setTo(padding._left, padding._right, padding._top, padding._bottom); - } - - /** Creates a new instance with the exact same values. */ - public function clone():Padding - { - return new Padding(_left, _right, _top, _bottom); - } - - /** The padding on the left side. */ - public function get left():Number { return _left; } - public function set left(value:Number):void - { - if (_left != value) - { - _left = value; - dispatchEventWith(Event.CHANGE); - } - } - - /** The padding on the right side. */ - public function get right():Number { return _right; } - public function set right(value:Number):void - { - if (_right != value) - { - _right = value; - dispatchEventWith(Event.CHANGE); - } - } - - /** The padding towards the top. */ - public function get top():Number { return _top; } - public function set top(value:Number):void - { - if (_top != value) - { - _top = value; - dispatchEventWith(Event.CHANGE); - } - } - - /** The padding towards the bottom. */ - public function get bottom():Number { return _bottom; } - public function set bottom(value:Number):void - { - if (_bottom != value) - { - _bottom = value; - dispatchEventWith(Event.CHANGE); - } - } - } -} diff --git a/mobile_version/src/starling/utils/Pool.as b/mobile_version/src/starling/utils/Pool.as deleted file mode 100644 index 24145716..00000000 --- a/mobile_version/src/starling/utils/Pool.as +++ /dev/null @@ -1,143 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= - -package starling.utils -{ - import flash.geom.Matrix; - import flash.geom.Matrix3D; - import flash.geom.Point; - import flash.geom.Rectangle; - import flash.geom.Vector3D; - - import starling.errors.AbstractClassError; - - /** A simple object pool supporting the most basic utility objects. - * - *

If you want to retrieve an object, but the pool does not contain any more instances, - * it will silently create a new one.

- * - *

It's important that you use the pool in a balanced way, i.e. don't just "get" or "put" - * alone! Always make the calls in pairs; whenever you get an object, be sure to put it back - * later, and the other way round. Otherwise, the pool will empty or (even worse) grow - * in size uncontrolled.

- */ - public class Pool - { - private static var sPoints:Vector. = new []; - private static var sPoints3D:Vector. = new []; - private static var sMatrices:Vector. = new []; - private static var sMatrices3D:Vector. = new []; - private static var sRectangles:Vector. = new []; - - /** @private */ - public function Pool() { throw new AbstractClassError(); } - - /** Retrieves a Point instance from the pool. */ - public static function getPoint(x:Number = 0, y:Number = 0):Point - { - if (sPoints.length == 0) return new Point(x, y); - else - { - var point:Point = sPoints.pop(); - point.x = x; point.y = y; - return point; - } - } - - /** Stores a Point instance in the pool. - * Don't keep any references to the object after moving it to the pool! */ - public static function putPoint(point:Point):void - { - if (point) sPoints[sPoints.length] = point; - } - - /** Retrieves a Vector3D instance from the pool. */ - public static function getPoint3D(x:Number = 0, y:Number = 0, z:Number = 0):Vector3D - { - if (sPoints.length == 0) return new Vector3D(x, y, z); - else - { - var point:Vector3D = sPoints3D.pop(); - point.x = x; point.y = y; point.z = z; - return point; - } - } - - /** Stores a Vector3D instance in the pool. - * Don't keep any references to the object after moving it to the pool! */ - public static function putPoint3D(point:Vector3D):void - { - if (point) sPoints3D[sPoints3D.length] = point; - } - - /** Retrieves a Matrix instance from the pool. */ - public static function getMatrix(a:Number = 1, b:Number = 0, c:Number = 0, d:Number = 1, - tx:Number = 0, ty:Number = 0):Matrix - { - if (sMatrices.length == 0) return new Matrix(a, b, c, d, tx, ty); - else - { - var matrix:Matrix = sMatrices.pop(); - matrix.setTo(a, b, c, d, tx, ty); - return matrix; - } - } - - /** Stores a Matrix instance in the pool. - * Don't keep any references to the object after moving it to the pool! */ - public static function putMatrix(matrix:Matrix):void - { - if (matrix) sMatrices[sMatrices.length] = matrix; - } - - /** Retrieves a Matrix3D instance from the pool. - * - * @param identity If enabled, the matrix will be reset to the identity. - * Otherwise, its contents is undefined. - */ - public static function getMatrix3D(identity:Boolean = true):Matrix3D - { - if (sMatrices3D.length == 0) return new Matrix3D(); - else - { - var matrix:Matrix3D = sMatrices3D.pop(); - if (identity) matrix.identity(); - return matrix; - } - } - - /** Stores a Matrix3D instance in the pool. - * Don't keep any references to the object after moving it to the pool! */ - public static function putMatrix3D(matrix:Matrix3D):void - { - if (matrix) sMatrices3D[sMatrices3D.length] = matrix; - } - - /** Retrieves a Rectangle instance from the pool. */ - public static function getRectangle(x:Number = 0, y:Number = 0, - width:Number = 0, height:Number = 0):Rectangle - { - if (sRectangles.length == 0) return new Rectangle(x, y, width, height); - else - { - var rectangle:Rectangle = sRectangles.pop(); - rectangle.setTo(x, y, width, height); - return rectangle; - } - } - - /** Stores a Rectangle instance in the pool. - * Don't keep any references to the object after moving it to the pool! */ - public static function putRectangle(rectangle:Rectangle):void - { - if (rectangle) sRectangles[sRectangles.length] = rectangle; - } - } -} diff --git a/mobile_version/src/starling/utils/RectangleUtil.as b/mobile_version/src/starling/utils/RectangleUtil.as deleted file mode 100644 index b19505ce..00000000 --- a/mobile_version/src/starling/utils/RectangleUtil.as +++ /dev/null @@ -1,246 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= - -package starling.utils -{ - import flash.geom.Matrix; - import flash.geom.Matrix3D; - import flash.geom.Point; - import flash.geom.Rectangle; - import flash.geom.Vector3D; - - import starling.errors.AbstractClassError; - - /** A utility class containing methods related to the Rectangle class. */ - public class RectangleUtil - { - // helper objects - private static const sPoint:Point = new Point(); - private static const sPoint3D:Vector3D = new Vector3D(); - private static const sPositions:Vector. = - new [new Point(), new Point(), new Point(), new Point()]; - - /** @private */ - public function RectangleUtil() { throw new AbstractClassError(); } - - /** Calculates the intersection between two Rectangles. If the rectangles do not intersect, - * this method returns an empty Rectangle object with its properties set to 0. */ - public static function intersect(rect1:Rectangle, rect2:Rectangle, - out:Rectangle=null):Rectangle - { - if (out == null) out = new Rectangle(); - - var left:Number = rect1.x > rect2.x ? rect1.x : rect2.x; - var right:Number = rect1.right < rect2.right ? rect1.right : rect2.right; - var top:Number = rect1.y > rect2.y ? rect1.y : rect2.y; - var bottom:Number = rect1.bottom < rect2.bottom ? rect1.bottom : rect2.bottom; - - if (left > right || top > bottom) - out.setEmpty(); - else - out.setTo(left, top, right-left, bottom-top); - - return out; - } - - /** Calculates a rectangle with the same aspect ratio as the given 'rectangle', - * centered within 'into'. - * - *

This method is useful for calculating the optimal viewPort for a certain display - * size. You can use different scale modes to specify how the result should be calculated; - * furthermore, you can avoid pixel alignment errors by only allowing whole-number - * multipliers/divisors (e.g. 3, 2, 1, 1/2, 1/3).

- * - * @see starling.utils.ScaleMode - */ - public static function fit(rectangle:Rectangle, into:Rectangle, - scaleMode:String="showAll", pixelPerfect:Boolean=false, - out:Rectangle=null):Rectangle - { - if (!ScaleMode.isValid(scaleMode)) throw new ArgumentError("Invalid scaleMode: " + scaleMode); - if (out == null) out = new Rectangle(); - - var width:Number = rectangle.width; - var height:Number = rectangle.height; - var factorX:Number = into.width / width; - var factorY:Number = into.height / height; - var factor:Number = 1.0; - - if (scaleMode == ScaleMode.SHOW_ALL) - { - factor = factorX < factorY ? factorX : factorY; - if (pixelPerfect) factor = nextSuitableScaleFactor(factor, false); - } - else if (scaleMode == ScaleMode.NO_BORDER) - { - factor = factorX > factorY ? factorX : factorY; - if (pixelPerfect) factor = nextSuitableScaleFactor(factor, true); - } - - width *= factor; - height *= factor; - - out.setTo( - into.x + (into.width - width) / 2, - into.y + (into.height - height) / 2, - width, height); - - return out; - } - - /** Calculates the next whole-number multiplier or divisor, moving either up or down. */ - private static function nextSuitableScaleFactor(factor:Number, up:Boolean):Number - { - var divisor:Number = 1.0; - - if (up) - { - if (factor >= 0.5) return Math.ceil(factor); - else - { - while (1.0 / (divisor + 1) > factor) - ++divisor; - } - } - else - { - if (factor >= 1.0) return Math.floor(factor); - else - { - while (1.0 / divisor > factor) - ++divisor; - } - } - - return 1.0 / divisor; - } - - /** If the rectangle contains negative values for width or height, all coordinates - * are adjusted so that the rectangle describes the same region with positive values. */ - public static function normalize(rect:Rectangle):void - { - if (rect.width < 0) - { - rect.width = -rect.width; - rect.x -= rect.width; - } - - if (rect.height < 0) - { - rect.height = -rect.height; - rect.y -= rect.height; - } - } - - /** Extends the bounds of the rectangle in all four directions. */ - public static function extend(rect:Rectangle, left:Number=0, right:Number=0, - top:Number=0, bottom:Number=0):void - { - rect.x -= left; - rect.y -= top; - rect.width += left + right; - rect.height += top + bottom; - } - - /** Calculates the bounds of a rectangle after transforming it by a matrix. - * If you pass an out-rectangle, the result will be stored in this rectangle - * instead of creating a new object. */ - public static function getBounds(rectangle:Rectangle, matrix:Matrix, - out:Rectangle=null):Rectangle - { - if (out == null) out = new Rectangle(); - - var minX:Number = Number.MAX_VALUE, maxX:Number = -Number.MAX_VALUE; - var minY:Number = Number.MAX_VALUE, maxY:Number = -Number.MAX_VALUE; - var positions:Vector. = getPositions(rectangle, sPositions); - - for (var i:int=0; i<4; ++i) - { - MatrixUtil.transformCoords(matrix, positions[i].x, positions[i].y, sPoint); - - if (minX > sPoint.x) minX = sPoint.x; - if (maxX < sPoint.x) maxX = sPoint.x; - if (minY > sPoint.y) minY = sPoint.y; - if (maxY < sPoint.y) maxY = sPoint.y; - } - - out.setTo(minX, minY, maxX - minX, maxY - minY); - return out; - } - - /** Calculates the bounds of a rectangle projected into the XY-plane of a certain 3D space - * as they appear from the given camera position. Note that 'camPos' is expected in the - * target coordinate system (the same that the XY-plane lies in). - * - *

If you pass an 'out' Rectangle, the result will be stored in this rectangle - * instead of creating a new object.

*/ - public static function getBoundsProjected(rectangle:Rectangle, matrix:Matrix3D, - camPos:Vector3D, out:Rectangle=null):Rectangle - { - if (out == null) out = new Rectangle(); - if (camPos == null) throw new ArgumentError("camPos must not be null"); - - var minX:Number = Number.MAX_VALUE, maxX:Number = -Number.MAX_VALUE; - var minY:Number = Number.MAX_VALUE, maxY:Number = -Number.MAX_VALUE; - var positions:Vector. = getPositions(rectangle, sPositions); - - for (var i:int=0; i<4; ++i) - { - var position:Point = positions[i]; - - if (matrix) - MatrixUtil.transformCoords3D(matrix, position.x, position.y, 0, sPoint3D); - else - sPoint3D.setTo(position.x, position.y, 0); - - MathUtil.intersectLineWithXYPlane(camPos, sPoint3D, sPoint); - - if (minX > sPoint.x) minX = sPoint.x; - if (maxX < sPoint.x) maxX = sPoint.x; - if (minY > sPoint.y) minY = sPoint.y; - if (maxY < sPoint.y) maxY = sPoint.y; - } - - out.setTo(minX, minY, maxX - minX, maxY - minY); - return out; - } - - /** Returns a vector containing the positions of the four edges of the given rectangle. */ - public static function getPositions(rectangle:Rectangle, - out:Vector.=null):Vector. - { - if (out == null) out = new Vector.(4, true); - - for (var i:int=0; i<4; ++i) - if (out[i] == null) out[i] = new Point(); - - out[0].x = rectangle.left; out[0].y = rectangle.top; - out[1].x = rectangle.right; out[1].y = rectangle.top; - out[2].x = rectangle.left; out[2].y = rectangle.bottom; - out[3].x = rectangle.right; out[3].y = rectangle.bottom; - return out; - } - - /** Compares all properties of the given rectangle, returning true only if - * they are equal (with the given accuracy 'e'). */ - public static function compare(r1:Rectangle, r2:Rectangle, e:Number=0.0001):Boolean - { - if (r1 == null) return r2 == null; - else if (r2 == null) return false; - else - { - return r1.x > r2.x - e && r1.x < r2.x + e && - r1.y > r2.y - e && r1.y < r2.y + e && - r1.width > r2.width - e && r1.width < r2.width + e && - r1.height > r2.height - e && r1.height < r2.height + e; - } - } - } -} \ No newline at end of file diff --git a/mobile_version/src/starling/utils/RenderUtil.as b/mobile_version/src/starling/utils/RenderUtil.as deleted file mode 100644 index 019564e4..00000000 --- a/mobile_version/src/starling/utils/RenderUtil.as +++ /dev/null @@ -1,275 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= - -package starling.utils -{ - import flash.display.Stage3D; - import flash.display3D.Context3D; - import flash.display3D.Context3DMipFilter; - import flash.display3D.Context3DRenderMode; - import flash.display3D.Context3DTextureFilter; - import flash.display3D.Context3DTextureFormat; - import flash.display3D.Context3DWrapMode; - import flash.events.ErrorEvent; - import flash.events.Event; - import flash.utils.setTimeout; - - import starling.core.Starling; - import starling.errors.AbstractClassError; - import starling.textures.Texture; - import starling.textures.TextureSmoothing; - - /** A utility class containing methods related to Stage3D and rendering in general. */ - public class RenderUtil - { - /** @private */ - public function RenderUtil() - { - throw new AbstractClassError(); - } - - /** Clears the render context with a certain color and alpha value. */ - public static function clear(rgb:uint=0, alpha:Number=0.0):void - { - Starling.context.clear( - Color.getRed(rgb) / 255.0, - Color.getGreen(rgb) / 255.0, - Color.getBlue(rgb) / 255.0, - alpha); - } - - /** Returns the flags that are required for AGAL texture lookup, - * including the '<' and '>' delimiters. */ - public static function getTextureLookupFlags(format:String, mipMapping:Boolean, - repeat:Boolean=false, - smoothing:String="bilinear"):String - { - // TODO this method can probably be removed - - var options:Array = ["2d", repeat ? "repeat" : "clamp"]; - - if (format == Context3DTextureFormat.COMPRESSED) - options.push("dxt1"); - else if (format == "compressedAlpha") - options.push("dxt5"); - - if (smoothing == TextureSmoothing.NONE) - options.push("nearest", mipMapping ? "mipnearest" : "mipnone"); - else if (smoothing == TextureSmoothing.BILINEAR) - options.push("linear", mipMapping ? "mipnearest" : "mipnone"); - else - options.push("linear", mipMapping ? "miplinear" : "mipnone"); - - return "<" + options.join() + ">"; - } - - /** Returns a bit field uniquely describing texture format and premultiplied alpha, - * so that each required AGAL variant will get its unique ID. This method is most - * useful when overriding the programVariantName method of custom - * effects. - * - * @return a bit field using the 3 least significant bits. - */ - public static function getTextureVariantBits(texture:Texture):uint - { - if (texture == null) return 0; - - var bitField:uint = 0; - var formatBits:uint = 0; - - switch (texture.format) - { - case Context3DTextureFormat.COMPRESSED_ALPHA: - formatBits = 3; break; - case Context3DTextureFormat.COMPRESSED: - formatBits = 2; break; - default: - formatBits = 1; - } - - bitField |= formatBits; - - if (!texture.premultipliedAlpha) - bitField |= 1 << 2; - - return bitField; - } - - /** Calls setSamplerStateAt at the current context, - * converting the given parameters to their low level counterparts. */ - public static function setSamplerStateAt(sampler:int, mipMapping:Boolean, - smoothing:String="bilinear", - repeat:Boolean=false):void - { - var wrap:String = repeat ? Context3DWrapMode.REPEAT : Context3DWrapMode.CLAMP; - var filter:String; - var mipFilter:String; - - if (smoothing == TextureSmoothing.NONE) - { - filter = Context3DTextureFilter.NEAREST; - mipFilter = mipMapping ? Context3DMipFilter.MIPNEAREST : Context3DMipFilter.MIPNONE; - } - else if (smoothing == TextureSmoothing.BILINEAR) - { - filter = Context3DTextureFilter.LINEAR; - mipFilter = mipMapping ? Context3DMipFilter.MIPNEAREST : Context3DMipFilter.MIPNONE; - } - else - { - filter = Context3DTextureFilter.LINEAR; - mipFilter = mipMapping ? Context3DMipFilter.MIPLINEAR : Context3DMipFilter.MIPNONE; - } - - Starling.context.setSamplerStateAt(sampler, wrap, filter, mipFilter); - } - - /** Creates an AGAL source string with a tex operation, including an options - * list with the appropriate format flag. - * - *

Note that values for repeat/clamp, filter and - * mip-filter are not included in the options list, since it's preferred - * to set those values at runtime via setSamplerStateAt.

- * - *

Starling expects every color to have its alpha value premultiplied into - * the RGB channels. Thus, if this method encounters a non-PMA texture, it will - * (per default) convert the color in the result register to PMA mode, resulting - * in an additional mul-operation.

- * - * @param resultReg the register to write the result into. - * @param uvReg the register containing the texture coordinates. - * @param sampler the texture sampler to use. - * @param texture the texture that's active in the given texture sampler. - * @param convertToPmaIfRequired indicates if a non-PMA color should be converted to PMA. - * @param tempReg if 'resultReg' is the output register and PMA conversion is done, - * a temporary register is needed. - * - * @return the AGAL source code, line break(s) included. - */ - public static function createAGALTexOperation( - resultReg:String, uvReg:String, sampler:int, texture:Texture, - convertToPmaIfRequired:Boolean=true, tempReg:String="ft0"):String - { - var format:String = texture.format; - var formatFlag:String; - - switch (format) - { - case Context3DTextureFormat.COMPRESSED: - formatFlag = "dxt1"; break; - case Context3DTextureFormat.COMPRESSED_ALPHA: - formatFlag = "dxt5"; break; - default: - formatFlag = "rgba"; - } - - var needsConversion:Boolean = convertToPmaIfRequired && !texture.premultipliedAlpha; - var texReg:String = needsConversion && resultReg == "oc" ? tempReg : resultReg; - var operation:String = "tex " + texReg + ", " + uvReg + ", fs" + sampler + - " <2d, " + formatFlag + ">\n"; - - if (needsConversion) - { - if (resultReg == "oc") // the output color register cannot use a write mask ... - { - operation += "mul " + texReg + ".xyz, " + texReg + ".xyz, " + texReg + ".www\n"; - operation += "mov " + resultReg + ", " + texReg; - } - else - { - operation += "mul " + resultReg + ".xyz, " + texReg + ".xyz, " + texReg + ".www\n"; - } - } - - return operation; - } - - /** Requests a context3D object from the given Stage3D object. - * - * @param stage3D The stage3D object the context needs to be requested from. - * @param renderMode The 'Context3DRenderMode' to use when requesting the context. - * @param profile If you know exactly which 'Context3DProfile' you want to use, simply - * pass a String with that profile. - * - *

If you are unsure which profiles are supported on the current - * device, you can also pass an Array of profiles; they will be - * tried one after the other (starting at index 0), until a working - * profile is found. If none of the given profiles is supported, - * the Stage3D object will dispatch an ERROR event.

- * - *

You can also pass the String 'auto' to use the best available - * profile automatically. This will try all known Stage3D profiles, - * beginning with the most powerful.

- */ - public static function requestContext3D(stage3D:Stage3D, renderMode:String, profile:*):void - { - var profiles:Array; - var currentProfile:String; - - if (profile == "auto") - profiles = ["standardExtended", "standard", "standardConstrained", - "baselineExtended", "baseline", "baselineConstrained"]; - else if (profile is String) - profiles = [profile as String]; - else if (profile is Array) - profiles = profile as Array; - else - throw new ArgumentError("Profile must be of type 'String' or 'Array'"); - - stage3D.addEventListener(Event.CONTEXT3D_CREATE, onCreated, false, 100); - stage3D.addEventListener(ErrorEvent.ERROR, onError, false, 100); - - requestNextProfile(); - - function requestNextProfile():void - { - currentProfile = profiles.shift(); - - try { execute(stage3D.requestContext3D, renderMode, currentProfile); } - catch (error:Error) - { - if (profiles.length != 0) setTimeout(requestNextProfile, 1); - else throw error; - } - } - - function onCreated(event:Event):void - { - var context:Context3D = stage3D.context3D; - - if (renderMode == Context3DRenderMode.AUTO && profiles.length != 0 && - context.driverInfo.indexOf("Software") != -1) - { - onError(event); - } - else - { - onFinished(); - } - } - - function onError(event:Event):void - { - if (profiles.length != 0) - { - event.stopImmediatePropagation(); - setTimeout(requestNextProfile, 1); - } - else onFinished(); - } - - function onFinished():void - { - stage3D.removeEventListener(Event.CONTEXT3D_CREATE, onCreated); - stage3D.removeEventListener(ErrorEvent.ERROR, onError); - } - } - } -} diff --git a/mobile_version/src/starling/utils/ScaleMode.as b/mobile_version/src/starling/utils/ScaleMode.as deleted file mode 100644 index 0e6034a1..00000000 --- a/mobile_version/src/starling/utils/ScaleMode.as +++ /dev/null @@ -1,30 +0,0 @@ -package starling.utils -{ - import starling.errors.AbstractClassError; - - /** A class that provides constant values for the 'RectangleUtil.fit' method. */ - public class ScaleMode - { - /** @private */ - public function ScaleMode() { throw new AbstractClassError(); } - - /** Specifies that the rectangle is not scaled, but simply centered within the - * specified area. */ - public static const NONE:String = "none"; - - /** Specifies that the rectangle fills the specified area without distortion - * but possibly with some cropping, while maintaining the original aspect ratio. */ - public static const NO_BORDER:String = "noBorder"; - - /** Specifies that the entire rectangle will be scaled to fit into the specified - * area, while maintaining the original aspect ratio. This might leave empty bars at - * either the top and bottom, or left and right. */ - public static const SHOW_ALL:String = "showAll"; - - /** Indicates whether the given scale mode string is valid. */ - public static function isValid(scaleMode:String):Boolean - { - return scaleMode == NONE || scaleMode == NO_BORDER || scaleMode == SHOW_ALL; - } - } -} \ No newline at end of file diff --git a/mobile_version/src/starling/utils/StringUtil.as b/mobile_version/src/starling/utils/StringUtil.as deleted file mode 100644 index fbcdd52c..00000000 --- a/mobile_version/src/starling/utils/StringUtil.as +++ /dev/null @@ -1,95 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= - -package starling.utils -{ - import starling.errors.AbstractClassError; - - /** A utility class with methods related to the String class. */ - public class StringUtil - { - /** @private */ - public function StringUtil() { throw new AbstractClassError(); } - - /** Formats a String in .Net-style, with curly braces ("{0}"). Does not support any - * number formatting options yet. */ - public static function format(format:String, ...args):String - { - // TODO: add number formatting options - - for (var i:int=0; ihere. - * - * @param string The String to clean - * @return The input string, but with a master string only one character larger than it. - * @author Jackson Dunstan, JacksonDunstan.com - */ - public static function clean(string:String):String - { - return ("_" + string).substr(1); - } - - /** Removes all leading white-space and control characters from the given String. - * - *

Beware: this method does not make a proper Unicode white-space check, - * but simply trims all character codes of '0x20' or below.

- */ - public static function trimStart(string:String):String - { - var pos:int; - var length:int = string.length; - - for (pos = 0; pos < length; ++pos) - if (string.charCodeAt(pos) > 0x20) break; - - return string.substring(pos, length); - } - - /** Removes all trailing white-space and control characters from the given String. - * - *

Beware: this method does not make a proper Unicode white-space check, - * but simply trims all character codes of '0x20' or below.

- */ - public static function trimEnd(string:String):String - { - for (var pos:int = string.length - 1; pos >= 0; --pos) - if (string.charCodeAt(pos) > 0x20) break; - - return string.substring(0, pos + 1); - } - - /** Removes all leading and trailing white-space and control characters from the given - * String. - * - *

Beware: this method does not make a proper Unicode white-space check, - * but simply trims all character codes of '0x20' or below.

- */ - public static function trim(string:String):String - { - var startPos:int, endPos:int; - var length:int = string.length; - - for (startPos = 0; startPos < length; ++startPos) - if (string.charCodeAt(startPos) > 0x20) break; - - for (endPos = string.length - 1; endPos >= startPos; --endPos) - if (string.charCodeAt(endPos) > 0x20) break; - - return string.substring(startPos, endPos + 1); - } - } -} diff --git a/mobile_version/src/starling/utils/SystemUtil.as b/mobile_version/src/starling/utils/SystemUtil.as deleted file mode 100644 index 2d81e648..00000000 --- a/mobile_version/src/starling/utils/SystemUtil.as +++ /dev/null @@ -1,197 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= - -package starling.utils -{ - import flash.display3D.Context3D; - import flash.events.Event; - import flash.events.EventDispatcher; - import flash.system.Capabilities; - import flash.text.Font; - import flash.text.FontStyle; - import flash.utils.getDefinitionByName; - - import starling.errors.AbstractClassError; - - /** A utility class with methods related to the current platform and runtime. */ - public class SystemUtil - { - private static var sInitialized:Boolean = false; - private static var sApplicationActive:Boolean = true; - private static var sWaitingCalls:Array = []; - private static var sPlatform:String; - private static var sDesktop:Boolean; - private static var sVersion:String; - private static var sAIR:Boolean; - private static var sEmbeddedFonts:Array = null; - private static var sSupportsDepthAndStencil:Boolean = true; - - /** @private */ - public function SystemUtil() { throw new AbstractClassError(); } - - /** Initializes the ACTIVATE/DEACTIVATE event handlers on the native - * application. This method is automatically called by the Starling constructor. */ - public static function initialize():void - { - if (sInitialized) return; - - sInitialized = true; - sPlatform = Capabilities.version.substr(0, 3); - sVersion = Capabilities.version.substr(4); - sDesktop = /(WIN|MAC|LNX)/.exec(sPlatform) != null; - - try - { - var nativeAppClass:Object = getDefinitionByName("flash.desktop::NativeApplication"); - var nativeApp:EventDispatcher = nativeAppClass["nativeApplication"] as EventDispatcher; - - nativeApp.addEventListener(Event.ACTIVATE, onActivate, false, 0, true); - nativeApp.addEventListener(Event.DEACTIVATE, onDeactivate, false, 0, true); - - var appDescriptor:XML = nativeApp["applicationDescriptor"]; - var ns:Namespace = appDescriptor.namespace(); - var ds:String = appDescriptor.ns::initialWindow.ns::depthAndStencil.toString().toLowerCase(); - - sSupportsDepthAndStencil = (ds == "true"); - sAIR = true; - } - catch (e:Error) - { - sAIR = false; - } - } - - private static function onActivate(event:Object):void - { - sApplicationActive = true; - - for each (var call:Array in sWaitingCalls) - { - try { call[0].apply(null, call[1]); } - catch (e:Error) - { - trace("[Starling] Error in 'executeWhenApplicationIsActive' call:", e.message); - } - } - - sWaitingCalls = []; - } - - private static function onDeactivate(event:Object):void - { - sApplicationActive = false; - } - - /** Executes the given function with its arguments the next time the application is active. - * (If it is active already, the call will be executed right away.) */ - public static function executeWhenApplicationIsActive(call:Function, ...args):void - { - initialize(); - - if (sApplicationActive) call.apply(null, args); - else sWaitingCalls.push([call, args]); - } - - /** Indicates if the application is currently active. On Desktop, this means that it has - * the focus; on mobile, that it is in the foreground. In the Flash Plugin, always - * returns true. */ - public static function get isApplicationActive():Boolean - { - initialize(); - return sApplicationActive; - } - - /** Indicates if the code is executed in an Adobe AIR runtime (true) - * or Flash plugin/projector (false). */ - public static function get isAIR():Boolean - { - initialize(); - return sAIR; - } - - /** Indicates if the code is executed on a Desktop computer with Windows, OS X or Linux - * operating system. If the method returns 'false', it's probably a mobile device - * or a Smart TV. */ - public static function get isDesktop():Boolean - { - initialize(); - return sDesktop; - } - - /** Returns the three-letter platform string of the current system. These are - * the most common platforms: WIN, MAC, LNX, IOS, AND, QNX. Except for the - * last one, which indicates "Blackberry", all should be self-explanatory. */ - public static function get platform():String - { - initialize(); - return sPlatform; - } - - /** Returns the Flash Player/AIR version string. The format of the version number is: - * majorVersion,minorVersion,buildNumber,internalBuildNumber. */ - public static function get version():String - { - initialize(); - return sVersion; - } - - /** Returns the value of the 'initialWindow.depthAndStencil' node of the application - * descriptor, if this in an AIR app; otherwise always true. */ - public static function get supportsDepthAndStencil():Boolean - { - return sSupportsDepthAndStencil; - } - - /** Indicates if Context3D supports video textures. At the time of this writing, - * video textures are only supported on Windows, OS X and iOS, and only in AIR - * applications (not the Flash Player). */ - public static function get supportsVideoTexture():Boolean - { - return Context3D["supportsVideoTexture"]; - } - - /** Updates the list of embedded fonts. To be called when a font is loaded at runtime. */ - public static function updateEmbeddedFonts():void - { - sEmbeddedFonts = null; // will be updated in 'isEmbeddedFont()' - } - - /** Figures out if an embedded font with the specified style is available. - * The fonts are enumerated only once; if you load a font at runtime, be sure to call - * 'updateEmbeddedFonts' before calling this method. - * - * @param fontName the name of the font - * @param bold indicates if the font has a bold style - * @param italic indicates if the font has an italic style - * @param fontType the type of the font (one of the constants defined in the FontType class) - */ - public static function isEmbeddedFont(fontName:String, bold:Boolean=false, italic:Boolean=false, - fontType:String="embedded"):Boolean - { - if (sEmbeddedFonts == null) - sEmbeddedFonts = Font.enumerateFonts(false); - - for each (var font:Font in sEmbeddedFonts) - { - var style:String = font.fontStyle; - var isBold:Boolean = style == FontStyle.BOLD || style == FontStyle.BOLD_ITALIC; - var isItalic:Boolean = style == FontStyle.ITALIC || style == FontStyle.BOLD_ITALIC; - - if (fontName == font.fontName && bold == isBold && italic == isItalic && - fontType == font.fontType) - { - return true; - } - } - - return false; - } - } -} \ No newline at end of file diff --git a/mobile_version/src/starling/utils/deg2rad.as b/mobile_version/src/starling/utils/deg2rad.as deleted file mode 100644 index d14d22b5..00000000 --- a/mobile_version/src/starling/utils/deg2rad.as +++ /dev/null @@ -1,18 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= - -package starling.utils -{ - /** Converts an angle from degrees into radians. */ - public function deg2rad(deg:Number):Number - { - return deg / 180.0 * Math.PI; - } -} \ No newline at end of file diff --git a/mobile_version/src/starling/utils/execute.as b/mobile_version/src/starling/utils/execute.as deleted file mode 100644 index c9f8ea6d..00000000 --- a/mobile_version/src/starling/utils/execute.as +++ /dev/null @@ -1,42 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= - -package starling.utils -{ - /** Executes a function with the specified arguments. If the argument count does not match - * the function, the argument list is cropped / filled up with null values. */ - public function execute(func:Function, ...args):void - { - if (func != null) - { - var i:int; - var maxNumArgs:int = func.length; - - for (i=args.length; i= 1) { tl = 1; tm = 1; } setcol(int(tr * tl), int(tg * tl), int(tb * tl)); - redraw = true; }else if (tm == 2) { tl -= .1; if (tl <= 0.5) { tl = 0.5; active = false; } setcol(int(tr * tl), int(tg * tl), int(tb * tl)); - redraw = true; } if (timer > 0) { timer--; @@ -104,9 +103,5 @@ package { public var tl:Number, tm:int; public var iter:int, max:int; - - //For android - public var ybuffer:int; - public var redraw:Boolean; } } diff --git a/third_party/FAudio b/third_party/FAudio deleted file mode 160000 index 38e9da72..00000000 --- a/third_party/FAudio +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 38e9da7264641c9cc69a80d09082f166d9b8eaf9 diff --git a/third_party/SheenBidi b/third_party/SheenBidi deleted file mode 160000 index 83f77108..00000000 --- a/third_party/SheenBidi +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 83f77108a2873600283f6da4b326a2dca7a3a7a6 diff --git a/third_party/c-hashmap b/third_party/c-hashmap deleted file mode 160000 index dedf70e0..00000000 --- a/third_party/c-hashmap +++ /dev/null @@ -1 +0,0 @@ -Subproject commit dedf70e0a769bc52a17a36da840d96770fc26d12 diff --git a/third_party/lodepng b/third_party/lodepng deleted file mode 160000 index 18964554..00000000 --- a/third_party/lodepng +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 18964554bc769255401942e0e6dfd09f2fab2093 diff --git a/third_party/lodepng/LICENSE.txt b/third_party/lodepng/LICENSE.txt new file mode 100644 index 00000000..a5fb0603 --- /dev/null +++ b/third_party/lodepng/LICENSE.txt @@ -0,0 +1,21 @@ +Copyright (c) 2005-2018 Lode Vandevenne + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source + distribution. + diff --git a/third_party/lodepng/lodepng.c b/third_party/lodepng/lodepng.c new file mode 100644 index 00000000..1130afe5 --- /dev/null +++ b/third_party/lodepng/lodepng.c @@ -0,0 +1,6406 @@ +/* +LodePNG version 20200306 + +Copyright (c) 2005-2020 Lode Vandevenne + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source + distribution. +*/ + +/* +The manual and changelog are in the header file "lodepng.h" +Rename this file to lodepng.cpp to use it for C++, or to lodepng.c to use it for C. +*/ + +#include "lodepng.h" + +#ifdef LODEPNG_COMPILE_DISK +#include /* LONG_MAX */ +#include /* file handling */ +#endif /* LODEPNG_COMPILE_DISK */ + +#ifdef LODEPNG_COMPILE_ALLOCATORS +#include /* allocations */ +#endif /* LODEPNG_COMPILE_ALLOCATORS */ + +#if defined(_MSC_VER) && (_MSC_VER >= 1310) /*Visual Studio: A few warning types are not desired here.*/ +#pragma warning( disable : 4244 ) /*implicit conversions: not warned by gcc -Wall -Wextra and requires too much casts*/ +#pragma warning( disable : 4996 ) /*VS does not like fopen, but fopen_s is not standard C so unusable here*/ +#endif /*_MSC_VER */ + +const char* LODEPNG_VERSION_STRING = "20200306"; + +/* +This source file is built up in the following large parts. The code sections +with the "LODEPNG_COMPILE_" #defines divide this up further in an intermixed way. +-Tools for C and common code for PNG and Zlib +-C Code for Zlib (huffman, deflate, ...) +-C Code for PNG (file format chunks, adam7, PNG filters, color conversions, ...) +-The C++ wrapper around all of the above +*/ + +/* ////////////////////////////////////////////////////////////////////////// */ +/* ////////////////////////////////////////////////////////////////////////// */ +/* // Tools for C, and common code for PNG and Zlib. // */ +/* ////////////////////////////////////////////////////////////////////////// */ +/* ////////////////////////////////////////////////////////////////////////// */ + +/*The malloc, realloc and free functions defined here with "lodepng_" in front +of the name, so that you can easily change them to others related to your +platform if needed. Everything else in the code calls these. Pass +-DLODEPNG_NO_COMPILE_ALLOCATORS to the compiler, or comment out +#define LODEPNG_COMPILE_ALLOCATORS in the header, to disable the ones here and +define them in your own project's source files without needing to change +lodepng source code. Don't forget to remove "static" if you copypaste them +from here.*/ + +#ifdef LODEPNG_COMPILE_ALLOCATORS +static void* lodepng_malloc(size_t size) { +#ifdef LODEPNG_MAX_ALLOC + if(size > LODEPNG_MAX_ALLOC) return 0; +#endif + return malloc(size); +} + +/* NOTE: when realloc returns NULL, it leaves the original memory untouched */ +static void* lodepng_realloc(void* ptr, size_t new_size) { +#ifdef LODEPNG_MAX_ALLOC + if(new_size > LODEPNG_MAX_ALLOC) return 0; +#endif + return realloc(ptr, new_size); +} + +static void lodepng_free(void* ptr) { + free(ptr); +} +#else /*LODEPNG_COMPILE_ALLOCATORS*/ +/* TODO: support giving additional void* payload to the custom allocators */ +void* lodepng_malloc(size_t size); +void* lodepng_realloc(void* ptr, size_t new_size); +void lodepng_free(void* ptr); +#endif /*LODEPNG_COMPILE_ALLOCATORS*/ + +/* convince the compiler to inline a function, for use when this measurably improves performance */ +/* inline is not available in C90, but use it when supported by the compiler */ +#if (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) || (defined(__cplusplus) && (__cplusplus >= 199711L)) +#define LODEPNG_INLINE inline +#else +#define LODEPNG_INLINE /* not available */ +#endif + +/* restrict is not available in C90, but use it when supported by the compiler */ +#if (defined(__GNUC__) && (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1))) ||\ + (defined(_MSC_VER) && (_MSC_VER >= 1400)) || \ + (defined(__WATCOMC__) && (__WATCOMC__ >= 1250) && !defined(__cplusplus)) +#define LODEPNG_RESTRICT __restrict +#else +#define LODEPNG_RESTRICT /* not available */ +#endif + +/* Replacements for C library functions such as memcpy and strlen, to support platforms +where a full C library is not available. The compiler can recognize them and compile +to something as fast. */ + +static void lodepng_memcpy(void* LODEPNG_RESTRICT dst, + const void* LODEPNG_RESTRICT src, size_t size) { + size_t i; + for(i = 0; i < size; i++) ((char*)dst)[i] = ((const char*)src)[i]; +} + +static void lodepng_memset(void* LODEPNG_RESTRICT dst, + int value, size_t num) { + size_t i; + for(i = 0; i < num; i++) ((char*)dst)[i] = (char)value; +} + +/* does not check memory out of bounds, do not use on untrusted data */ +static size_t lodepng_strlen(const char* a) { + const char* orig = a; + /* avoid warning about unused function in case of disabled COMPILE... macros */ + (void)(&lodepng_strlen); + while(*a) a++; + return (size_t)(a - orig); +} + +#define LODEPNG_MAX(a, b) (((a) > (b)) ? (a) : (b)) +#define LODEPNG_MIN(a, b) (((a) < (b)) ? (a) : (b)) +#define LODEPNG_ABS(x) ((x) < 0 ? -(x) : (x)) + +#if defined(LODEPNG_COMPILE_PNG) || defined(LODEPNG_COMPILE_DECODER) +/* Safely check if adding two integers will overflow (no undefined +behavior, compiler removing the code, etc...) and output result. */ +static int lodepng_addofl(size_t a, size_t b, size_t* result) { + *result = a + b; /* Unsigned addition is well defined and safe in C90 */ + return *result < a; +} +#endif /*defined(LODEPNG_COMPILE_PNG) || defined(LODEPNG_COMPILE_DECODER)*/ + +#ifdef LODEPNG_COMPILE_DECODER +/* Safely check if multiplying two integers will overflow (no undefined +behavior, compiler removing the code, etc...) and output result. */ +static int lodepng_mulofl(size_t a, size_t b, size_t* result) { + *result = a * b; /* Unsigned multiplication is well defined and safe in C90 */ + return (a != 0 && *result / a != b); +} + +#ifdef LODEPNG_COMPILE_ZLIB +/* Safely check if a + b > c, even if overflow could happen. */ +static int lodepng_gtofl(size_t a, size_t b, size_t c) { + size_t d; + if(lodepng_addofl(a, b, &d)) return 1; + return d > c; +} +#endif /*LODEPNG_COMPILE_ZLIB*/ +#endif /*LODEPNG_COMPILE_DECODER*/ + + +/* +Often in case of an error a value is assigned to a variable and then it breaks +out of a loop (to go to the cleanup phase of a function). This macro does that. +It makes the error handling code shorter and more readable. + +Example: if(!uivector_resize(&lz77_encoded, datasize)) ERROR_BREAK(83); +*/ +#define CERROR_BREAK(errorvar, code){\ + errorvar = code;\ + break;\ +} + +/*version of CERROR_BREAK that assumes the common case where the error variable is named "error"*/ +#define ERROR_BREAK(code) CERROR_BREAK(error, code) + +/*Set error var to the error code, and return it.*/ +#define CERROR_RETURN_ERROR(errorvar, code){\ + errorvar = code;\ + return code;\ +} + +/*Try the code, if it returns error, also return the error.*/ +#define CERROR_TRY_RETURN(call){\ + unsigned error = call;\ + if(error) return error;\ +} + +/*Set error var to the error code, and return from the void function.*/ +#define CERROR_RETURN(errorvar, code){\ + errorvar = code;\ + return;\ +} + +/* +About uivector, ucvector and string: +-All of them wrap dynamic arrays or text strings in a similar way. +-LodePNG was originally written in C++. The vectors replace the std::vectors that were used in the C++ version. +-The string tools are made to avoid problems with compilers that declare things like strncat as deprecated. +-They're not used in the interface, only internally in this file as static functions. +-As with many other structs in this file, the init and cleanup functions serve as ctor and dtor. +*/ + +#ifdef LODEPNG_COMPILE_ZLIB +#ifdef LODEPNG_COMPILE_ENCODER +/*dynamic vector of unsigned ints*/ +typedef struct uivector { + unsigned* data; + size_t size; /*size in number of unsigned longs*/ + size_t allocsize; /*allocated size in bytes*/ +} uivector; + +static void uivector_cleanup(void* p) { + ((uivector*)p)->size = ((uivector*)p)->allocsize = 0; + lodepng_free(((uivector*)p)->data); + ((uivector*)p)->data = NULL; +} + +/*returns 1 if success, 0 if failure ==> nothing done*/ +static unsigned uivector_resize(uivector* p, size_t size) { + size_t allocsize = size * sizeof(unsigned); + if(allocsize > p->allocsize) { + size_t newsize = allocsize + (p->allocsize >> 1u); + void* data = lodepng_realloc(p->data, newsize); + if(data) { + p->allocsize = newsize; + p->data = (unsigned*)data; + } + else return 0; /*error: not enough memory*/ + } + p->size = size; + return 1; /*success*/ +} + +static void uivector_init(uivector* p) { + p->data = NULL; + p->size = p->allocsize = 0; +} + +/*returns 1 if success, 0 if failure ==> nothing done*/ +static unsigned uivector_push_back(uivector* p, unsigned c) { + if(!uivector_resize(p, p->size + 1)) return 0; + p->data[p->size - 1] = c; + return 1; +} +#endif /*LODEPNG_COMPILE_ENCODER*/ +#endif /*LODEPNG_COMPILE_ZLIB*/ + +/* /////////////////////////////////////////////////////////////////////////// */ + +/*dynamic vector of unsigned chars*/ +typedef struct ucvector { + unsigned char* data; + size_t size; /*used size*/ + size_t allocsize; /*allocated size*/ +} ucvector; + +/*returns 1 if success, 0 if failure ==> nothing done*/ +static unsigned ucvector_resize(ucvector* p, size_t size) { + if(size > p->allocsize) { + size_t newsize = size + (p->allocsize >> 1u); + void* data = lodepng_realloc(p->data, newsize); + if(data) { + p->allocsize = newsize; + p->data = (unsigned char*)data; + } + else return 0; /*error: not enough memory*/ + } + p->size = size; + return 1; /*success*/ +} + +static ucvector ucvector_init(unsigned char* buffer, size_t size) { + ucvector v; + v.data = buffer; + v.allocsize = v.size = size; + return v; +} + +/* ////////////////////////////////////////////////////////////////////////// */ + +#ifdef LODEPNG_COMPILE_PNG +#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS + +/*free string pointer and set it to NULL*/ +static void string_cleanup(char** out) { + lodepng_free(*out); + *out = NULL; +} + +static char* alloc_string_sized(const char* in, size_t insize) { + char* out = (char*)lodepng_malloc(insize + 1); + if(out) { + lodepng_memcpy(out, in, insize); + out[insize] = 0; + } + return out; +} + +/* dynamically allocates a new string with a copy of the null terminated input text */ +static char* alloc_string(const char* in) { + return alloc_string_sized(in, lodepng_strlen(in)); +} +#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ +#endif /*LODEPNG_COMPILE_PNG*/ + +/* ////////////////////////////////////////////////////////////////////////// */ + +#if defined(LODEPNG_COMPILE_DECODER) || defined(LODEPNG_COMPILE_PNG) +static unsigned lodepng_read32bitInt(const unsigned char* buffer) { + return (((unsigned)buffer[0] << 24u) | ((unsigned)buffer[1] << 16u) | + ((unsigned)buffer[2] << 8u) | (unsigned)buffer[3]); +} +#endif /*defined(LODEPNG_COMPILE_DECODER) || defined(LODEPNG_COMPILE_PNG)*/ + +#if defined(LODEPNG_COMPILE_PNG) || defined(LODEPNG_COMPILE_ENCODER) +/*buffer must have at least 4 allocated bytes available*/ +static void lodepng_set32bitInt(unsigned char* buffer, unsigned value) { + buffer[0] = (unsigned char)((value >> 24) & 0xff); + buffer[1] = (unsigned char)((value >> 16) & 0xff); + buffer[2] = (unsigned char)((value >> 8) & 0xff); + buffer[3] = (unsigned char)((value ) & 0xff); +} +#endif /*defined(LODEPNG_COMPILE_PNG) || defined(LODEPNG_COMPILE_ENCODER)*/ + +/* ////////////////////////////////////////////////////////////////////////// */ +/* / File IO / */ +/* ////////////////////////////////////////////////////////////////////////// */ + +#ifdef LODEPNG_COMPILE_DISK + +/* returns negative value on error. This should be pure C compatible, so no fstat. */ +static long lodepng_filesize(const char* filename) { + FILE* file; + long size; + file = fopen(filename, "rb"); + if(!file) return -1; + + if(fseek(file, 0, SEEK_END) != 0) { + fclose(file); + return -1; + } + + size = ftell(file); + /* It may give LONG_MAX as directory size, this is invalid for us. */ + if(size == LONG_MAX) size = -1; + + fclose(file); + return size; +} + +/* load file into buffer that already has the correct allocated size. Returns error code.*/ +static unsigned lodepng_buffer_file(unsigned char* out, size_t size, const char* filename) { + FILE* file; + size_t readsize; + file = fopen(filename, "rb"); + if(!file) return 78; + + readsize = fread(out, 1, size, file); + fclose(file); + + if(readsize != size) return 78; + return 0; +} + +unsigned lodepng_load_file(unsigned char** out, size_t* outsize, const char* filename) { + long size = lodepng_filesize(filename); + if(size < 0) return 78; + *outsize = (size_t)size; + + *out = (unsigned char*)lodepng_malloc((size_t)size); + if(!(*out) && size > 0) return 83; /*the above malloc failed*/ + + return lodepng_buffer_file(*out, (size_t)size, filename); +} + +/*write given buffer to the file, overwriting the file, it doesn't append to it.*/ +unsigned lodepng_save_file(const unsigned char* buffer, size_t buffersize, const char* filename) { + FILE* file; + file = fopen(filename, "wb" ); + if(!file) return 79; + fwrite(buffer, 1, buffersize, file); + fclose(file); + return 0; +} + +#endif /*LODEPNG_COMPILE_DISK*/ + +/* ////////////////////////////////////////////////////////////////////////// */ +/* ////////////////////////////////////////////////////////////////////////// */ +/* // End of common code and tools. Begin of Zlib related code. // */ +/* ////////////////////////////////////////////////////////////////////////// */ +/* ////////////////////////////////////////////////////////////////////////// */ + +#ifdef LODEPNG_COMPILE_ZLIB +#ifdef LODEPNG_COMPILE_ENCODER + +typedef struct { + ucvector* data; + unsigned char bp; /*ok to overflow, indicates bit pos inside byte*/ +} LodePNGBitWriter; + +static void LodePNGBitWriter_init(LodePNGBitWriter* writer, ucvector* data) { + writer->data = data; + writer->bp = 0; +} + +/*TODO: this ignores potential out of memory errors*/ +#define WRITEBIT(writer, bit){\ + /* append new byte */\ + if(((writer->bp) & 7u) == 0) {\ + if(!ucvector_resize(writer->data, writer->data->size + 1)) return;\ + writer->data->data[writer->data->size - 1] = 0;\ + }\ + (writer->data->data[writer->data->size - 1]) |= (bit << ((writer->bp) & 7u));\ + ++writer->bp;\ +} + +/* LSB of value is written first, and LSB of bytes is used first */ +static void writeBits(LodePNGBitWriter* writer, unsigned value, size_t nbits) { + if(nbits == 1) { /* compiler should statically compile this case if nbits == 1 */ + WRITEBIT(writer, value); + } else { + /* TODO: increase output size only once here rather than in each WRITEBIT */ + size_t i; + for(i = 0; i != nbits; ++i) { + WRITEBIT(writer, (unsigned char)((value >> i) & 1)); + } + } +} + +/* This one is to use for adding huffman symbol, the value bits are written MSB first */ +static void writeBitsReversed(LodePNGBitWriter* writer, unsigned value, size_t nbits) { + size_t i; + for(i = 0; i != nbits; ++i) { + /* TODO: increase output size only once here rather than in each WRITEBIT */ + WRITEBIT(writer, (unsigned char)((value >> (nbits - 1u - i)) & 1u)); + } +} +#endif /*LODEPNG_COMPILE_ENCODER*/ + +#ifdef LODEPNG_COMPILE_DECODER + +typedef struct { + const unsigned char* data; + size_t size; /*size of data in bytes*/ + size_t bitsize; /*size of data in bits, end of valid bp values, should be 8*size*/ + size_t bp; + unsigned buffer; /*buffer for reading bits. NOTE: 'unsigned' must support at least 32 bits*/ +} LodePNGBitReader; + +/* data size argument is in bytes. Returns error if size too large causing overflow */ +static unsigned LodePNGBitReader_init(LodePNGBitReader* reader, const unsigned char* data, size_t size) { + size_t temp; + reader->data = data; + reader->size = size; + /* size in bits, return error if overflow (if size_t is 32 bit this supports up to 500MB) */ + if(lodepng_mulofl(size, 8u, &reader->bitsize)) return 105; + /*ensure incremented bp can be compared to bitsize without overflow even when it would be incremented 32 too much and + trying to ensure 32 more bits*/ + if(lodepng_addofl(reader->bitsize, 64u, &temp)) return 105; + reader->bp = 0; + reader->buffer = 0; + return 0; /*ok*/ +} + +/* +ensureBits functions: +Ensures the reader can at least read nbits bits in one or more readBits calls, +safely even if not enough bits are available. +Returns 1 if there are enough bits available, 0 if not. +*/ + +/*See ensureBits documentation above. This one ensures exactly 1 bit */ +/*static unsigned ensureBits1(LodePNGBitReader* reader) { + if(reader->bp >= reader->bitsize) return 0; + reader->buffer = (unsigned)reader->data[reader->bp >> 3u] >> (reader->bp & 7u); + return 1; +}*/ + +/*See ensureBits documentation above. This one ensures up to 9 bits */ +static unsigned ensureBits9(LodePNGBitReader* reader, size_t nbits) { + size_t start = reader->bp >> 3u; + size_t size = reader->size; + if(start + 1u < size) { + reader->buffer = (unsigned)reader->data[start + 0] | ((unsigned)reader->data[start + 1] << 8u); + reader->buffer >>= (reader->bp & 7u); + return 1; + } else { + reader->buffer = 0; + if(start + 0u < size) reader->buffer |= reader->data[start + 0]; + reader->buffer >>= (reader->bp & 7u); + return reader->bp + nbits <= reader->bitsize; + } +} + +/*See ensureBits documentation above. This one ensures up to 17 bits */ +static unsigned ensureBits17(LodePNGBitReader* reader, size_t nbits) { + size_t start = reader->bp >> 3u; + size_t size = reader->size; + if(start + 2u < size) { + reader->buffer = (unsigned)reader->data[start + 0] | ((unsigned)reader->data[start + 1] << 8u) | + ((unsigned)reader->data[start + 2] << 16u); + reader->buffer >>= (reader->bp & 7u); + return 1; + } else { + reader->buffer = 0; + if(start + 0u < size) reader->buffer |= reader->data[start + 0]; + if(start + 1u < size) reader->buffer |= ((unsigned)reader->data[start + 1] << 8u); + reader->buffer >>= (reader->bp & 7u); + return reader->bp + nbits <= reader->bitsize; + } +} + +/*See ensureBits documentation above. This one ensures up to 25 bits */ +static LODEPNG_INLINE unsigned ensureBits25(LodePNGBitReader* reader, size_t nbits) { + size_t start = reader->bp >> 3u; + size_t size = reader->size; + if(start + 3u < size) { + reader->buffer = (unsigned)reader->data[start + 0] | ((unsigned)reader->data[start + 1] << 8u) | + ((unsigned)reader->data[start + 2] << 16u) | ((unsigned)reader->data[start + 3] << 24u); + reader->buffer >>= (reader->bp & 7u); + return 1; + } else { + reader->buffer = 0; + if(start + 0u < size) reader->buffer |= reader->data[start + 0]; + if(start + 1u < size) reader->buffer |= ((unsigned)reader->data[start + 1] << 8u); + if(start + 2u < size) reader->buffer |= ((unsigned)reader->data[start + 2] << 16u); + reader->buffer >>= (reader->bp & 7u); + return reader->bp + nbits <= reader->bitsize; + } +} + +/*See ensureBits documentation above. This one ensures up to 32 bits */ +static LODEPNG_INLINE unsigned ensureBits32(LodePNGBitReader* reader, size_t nbits) { + size_t start = reader->bp >> 3u; + size_t size = reader->size; + if(start + 4u < size) { + reader->buffer = (unsigned)reader->data[start + 0] | ((unsigned)reader->data[start + 1] << 8u) | + ((unsigned)reader->data[start + 2] << 16u) | ((unsigned)reader->data[start + 3] << 24u); + reader->buffer >>= (reader->bp & 7u); + reader->buffer |= (((unsigned)reader->data[start + 4] << 24u) << (8u - (reader->bp & 7u))); + return 1; + } else { + reader->buffer = 0; + if(start + 0u < size) reader->buffer |= reader->data[start + 0]; + if(start + 1u < size) reader->buffer |= ((unsigned)reader->data[start + 1] << 8u); + if(start + 2u < size) reader->buffer |= ((unsigned)reader->data[start + 2] << 16u); + if(start + 3u < size) reader->buffer |= ((unsigned)reader->data[start + 3] << 24u); + reader->buffer >>= (reader->bp & 7u); + return reader->bp + nbits <= reader->bitsize; + } +} + +/* Get bits without advancing the bit pointer. Must have enough bits available with ensureBits. Max nbits is 31. */ +static unsigned peekBits(LodePNGBitReader* reader, size_t nbits) { + /* The shift allows nbits to be only up to 31. */ + return reader->buffer & ((1u << nbits) - 1u); +} + +/* Must have enough bits available with ensureBits */ +static void advanceBits(LodePNGBitReader* reader, size_t nbits) { + reader->buffer >>= nbits; + reader->bp += nbits; +} + +/* Must have enough bits available with ensureBits */ +static unsigned readBits(LodePNGBitReader* reader, size_t nbits) { + unsigned result = peekBits(reader, nbits); + advanceBits(reader, nbits); + return result; +} + +/* Public for testing only. steps and result must have numsteps values. */ +unsigned lode_png_test_bitreader(const unsigned char* data, size_t size, + size_t numsteps, const size_t* steps, unsigned* result) { + size_t i; + LodePNGBitReader reader; + unsigned error = LodePNGBitReader_init(&reader, data, size); + if(error) return 0; + for(i = 0; i < numsteps; i++) { + size_t step = steps[i]; + unsigned ok; + if(step > 25) ok = ensureBits32(&reader, step); + else if(step > 17) ok = ensureBits25(&reader, step); + else if(step > 9) ok = ensureBits17(&reader, step); + else ok = ensureBits9(&reader, step); + if(!ok) return 0; + result[i] = readBits(&reader, step); + } + return 1; +} +#endif /*LODEPNG_COMPILE_DECODER*/ + +static unsigned reverseBits(unsigned bits, unsigned num) { + /*TODO: implement faster lookup table based version when needed*/ + unsigned i, result = 0; + for(i = 0; i < num; i++) result |= ((bits >> (num - i - 1u)) & 1u) << i; + return result; +} + +/* ////////////////////////////////////////////////////////////////////////// */ +/* / Deflate - Huffman / */ +/* ////////////////////////////////////////////////////////////////////////// */ + +#define FIRST_LENGTH_CODE_INDEX 257 +#define LAST_LENGTH_CODE_INDEX 285 +/*256 literals, the end code, some length codes, and 2 unused codes*/ +#define NUM_DEFLATE_CODE_SYMBOLS 288 +/*the distance codes have their own symbols, 30 used, 2 unused*/ +#define NUM_DISTANCE_SYMBOLS 32 +/*the code length codes. 0-15: code lengths, 16: copy previous 3-6 times, 17: 3-10 zeros, 18: 11-138 zeros*/ +#define NUM_CODE_LENGTH_CODES 19 + +/*the base lengths represented by codes 257-285*/ +static const unsigned LENGTHBASE[29] + = {3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, + 67, 83, 99, 115, 131, 163, 195, 227, 258}; + +/*the extra bits used by codes 257-285 (added to base length)*/ +static const unsigned LENGTHEXTRA[29] + = {0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, + 4, 4, 4, 4, 5, 5, 5, 5, 0}; + +/*the base backwards distances (the bits of distance codes appear after length codes and use their own huffman tree)*/ +static const unsigned DISTANCEBASE[30] + = {1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, + 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577}; + +/*the extra bits of backwards distances (added to base)*/ +static const unsigned DISTANCEEXTRA[30] + = {0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, + 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13}; + +/*the order in which "code length alphabet code lengths" are stored as specified by deflate, out of this the huffman +tree of the dynamic huffman tree lengths is generated*/ +static const unsigned CLCL_ORDER[NUM_CODE_LENGTH_CODES] + = {16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15}; + +/* ////////////////////////////////////////////////////////////////////////// */ + +/* +Huffman tree struct, containing multiple representations of the tree +*/ +typedef struct HuffmanTree { + unsigned* codes; /*the huffman codes (bit patterns representing the symbols)*/ + unsigned* lengths; /*the lengths of the huffman codes*/ + unsigned maxbitlen; /*maximum number of bits a single code can get*/ + unsigned numcodes; /*number of symbols in the alphabet = number of codes*/ + /* for reading only */ + unsigned char* table_len; /*length of symbol from lookup table, or max length if secondary lookup needed*/ + unsigned short* table_value; /*value of symbol from lookup table, or pointer to secondary table if needed*/ +} HuffmanTree; + +static void HuffmanTree_init(HuffmanTree* tree) { + tree->codes = 0; + tree->lengths = 0; + tree->table_len = 0; + tree->table_value = 0; +} + +static void HuffmanTree_cleanup(HuffmanTree* tree) { + lodepng_free(tree->codes); + lodepng_free(tree->lengths); + lodepng_free(tree->table_len); + lodepng_free(tree->table_value); +} + +/* amount of bits for first huffman table lookup (aka root bits), see HuffmanTree_makeTable and huffmanDecodeSymbol.*/ +/* values 8u and 9u work the fastest */ +#define FIRSTBITS 9u + +/* a symbol value too big to represent any valid symbol, to indicate reading disallowed huffman bits combination, +which is possible in case of only 0 or 1 present symbols. */ +#define INVALIDSYMBOL 65535u + +/* make table for huffman decoding */ +static unsigned HuffmanTree_makeTable(HuffmanTree* tree) { + static const unsigned headsize = 1u << FIRSTBITS; /*size of the first table*/ + static const unsigned mask = (1u << FIRSTBITS) /*headsize*/ - 1u; + size_t i, numpresent, pointer, size; /*total table size*/ + unsigned* maxlens = (unsigned*)lodepng_malloc(headsize * sizeof(unsigned)); + if(!maxlens) return 83; /*alloc fail*/ + + /* compute maxlens: max total bit length of symbols sharing prefix in the first table*/ + lodepng_memset(maxlens, 0, headsize * sizeof(*maxlens)); + for(i = 0; i < tree->numcodes; i++) { + unsigned symbol = tree->codes[i]; + unsigned l = tree->lengths[i]; + unsigned index; + if(l <= FIRSTBITS) continue; /*symbols that fit in first table don't increase secondary table size*/ + /*get the FIRSTBITS MSBs, the MSBs of the symbol are encoded first. See later comment about the reversing*/ + index = reverseBits(symbol >> (l - FIRSTBITS), FIRSTBITS); + maxlens[index] = LODEPNG_MAX(maxlens[index], l); + } + /* compute total table size: size of first table plus all secondary tables for symbols longer than FIRSTBITS */ + size = headsize; + for(i = 0; i < headsize; ++i) { + unsigned l = maxlens[i]; + if(l > FIRSTBITS) size += (1u << (l - FIRSTBITS)); + } + tree->table_len = (unsigned char*)lodepng_malloc(size * sizeof(*tree->table_len)); + tree->table_value = (unsigned short*)lodepng_malloc(size * sizeof(*tree->table_value)); + if(!tree->table_len || !tree->table_value) { + lodepng_free(maxlens); + /* freeing tree->table values is done at a higher scope */ + return 83; /*alloc fail*/ + } + /*initialize with an invalid length to indicate unused entries*/ + for(i = 0; i < size; ++i) tree->table_len[i] = 16; + + /*fill in the first table for long symbols: max prefix size and pointer to secondary tables*/ + pointer = headsize; + for(i = 0; i < headsize; ++i) { + unsigned l = maxlens[i]; + if(l <= FIRSTBITS) continue; + tree->table_len[i] = l; + tree->table_value[i] = pointer; + pointer += (1u << (l - FIRSTBITS)); + } + lodepng_free(maxlens); + + /*fill in the first table for short symbols, or secondary table for long symbols*/ + numpresent = 0; + for(i = 0; i < tree->numcodes; ++i) { + unsigned l = tree->lengths[i]; + unsigned symbol = tree->codes[i]; /*the huffman bit pattern. i itself is the value.*/ + /*reverse bits, because the huffman bits are given in MSB first order but the bit reader reads LSB first*/ + unsigned reverse = reverseBits(symbol, l); + if(l == 0) continue; + numpresent++; + + if(l <= FIRSTBITS) { + /*short symbol, fully in first table, replicated num times if l < FIRSTBITS*/ + unsigned num = 1u << (FIRSTBITS - l); + unsigned j; + for(j = 0; j < num; ++j) { + /*bit reader will read the l bits of symbol first, the remaining FIRSTBITS - l bits go to the MSB's*/ + unsigned index = reverse | (j << l); + if(tree->table_len[index] != 16) return 55; /*invalid tree: long symbol shares prefix with short symbol*/ + tree->table_len[index] = l; + tree->table_value[index] = i; + } + } else { + /*long symbol, shares prefix with other long symbols in first lookup table, needs second lookup*/ + /*the FIRSTBITS MSBs of the symbol are the first table index*/ + unsigned index = reverse & mask; + unsigned maxlen = tree->table_len[index]; + /*log2 of secondary table length, should be >= l - FIRSTBITS*/ + unsigned tablelen = maxlen - FIRSTBITS; + unsigned start = tree->table_value[index]; /*starting index in secondary table*/ + unsigned num = 1u << (tablelen - (l - FIRSTBITS)); /*amount of entries of this symbol in secondary table*/ + unsigned j; + if(maxlen < l) return 55; /*invalid tree: long symbol shares prefix with short symbol*/ + for(j = 0; j < num; ++j) { + unsigned reverse2 = reverse >> FIRSTBITS; /* l - FIRSTBITS bits */ + unsigned index2 = start + (reverse2 | (j << (l - FIRSTBITS))); + tree->table_len[index2] = l; + tree->table_value[index2] = i; + } + } + } + + if(numpresent < 2) { + /* In case of exactly 1 symbol, in theory the huffman symbol needs 0 bits, + but deflate uses 1 bit instead. In case of 0 symbols, no symbols can + appear at all, but such huffman tree could still exist (e.g. if distance + codes are never used). In both cases, not all symbols of the table will be + filled in. Fill them in with an invalid symbol value so returning them from + huffmanDecodeSymbol will cause error. */ + for(i = 0; i < size; ++i) { + if(tree->table_len[i] == 16) { + /* As length, use a value smaller than FIRSTBITS for the head table, + and a value larger than FIRSTBITS for the secondary table, to ensure + valid behavior for advanceBits when reading this symbol. */ + tree->table_len[i] = (i < headsize) ? 1 : (FIRSTBITS + 1); + tree->table_value[i] = INVALIDSYMBOL; + } + } + } else { + /* A good huffman tree has N * 2 - 1 nodes, of which N - 1 are internal nodes. + If that is not the case (due to too long length codes), the table will not + have been fully used, and this is an error (not all bit combinations can be + decoded): an oversubscribed huffman tree, indicated by error 55. */ + for(i = 0; i < size; ++i) { + if(tree->table_len[i] == 16) return 55; + } + } + + return 0; +} + +/* +Second step for the ...makeFromLengths and ...makeFromFrequencies functions. +numcodes, lengths and maxbitlen must already be filled in correctly. return +value is error. +*/ +static unsigned HuffmanTree_makeFromLengths2(HuffmanTree* tree) { + unsigned* blcount; + unsigned* nextcode; + unsigned error = 0; + unsigned bits, n; + + tree->codes = (unsigned*)lodepng_malloc(tree->numcodes * sizeof(unsigned)); + blcount = (unsigned*)lodepng_malloc((tree->maxbitlen + 1) * sizeof(unsigned)); + nextcode = (unsigned*)lodepng_malloc((tree->maxbitlen + 1) * sizeof(unsigned)); + if(!tree->codes || !blcount || !nextcode) error = 83; /*alloc fail*/ + + if(!error) { + for(n = 0; n != tree->maxbitlen + 1; n++) blcount[n] = nextcode[n] = 0; + /*step 1: count number of instances of each code length*/ + for(bits = 0; bits != tree->numcodes; ++bits) ++blcount[tree->lengths[bits]]; + /*step 2: generate the nextcode values*/ + for(bits = 1; bits <= tree->maxbitlen; ++bits) { + nextcode[bits] = (nextcode[bits - 1] + blcount[bits - 1]) << 1u; + } + /*step 3: generate all the codes*/ + for(n = 0; n != tree->numcodes; ++n) { + if(tree->lengths[n] != 0) { + tree->codes[n] = nextcode[tree->lengths[n]]++; + /*remove superfluous bits from the code*/ + tree->codes[n] &= ((1u << tree->lengths[n]) - 1u); + } + } + } + + lodepng_free(blcount); + lodepng_free(nextcode); + + if(!error) error = HuffmanTree_makeTable(tree); + return error; +} + +/* +given the code lengths (as stored in the PNG file), generate the tree as defined +by Deflate. maxbitlen is the maximum bits that a code in the tree can have. +return value is error. +*/ +static unsigned HuffmanTree_makeFromLengths(HuffmanTree* tree, const unsigned* bitlen, + size_t numcodes, unsigned maxbitlen) { + unsigned i; + tree->lengths = (unsigned*)lodepng_malloc(numcodes * sizeof(unsigned)); + if(!tree->lengths) return 83; /*alloc fail*/ + for(i = 0; i != numcodes; ++i) tree->lengths[i] = bitlen[i]; + tree->numcodes = (unsigned)numcodes; /*number of symbols*/ + tree->maxbitlen = maxbitlen; + return HuffmanTree_makeFromLengths2(tree); +} + +#ifdef LODEPNG_COMPILE_ENCODER + +/*BPM: Boundary Package Merge, see "A Fast and Space-Economical Algorithm for Length-Limited Coding", +Jyrki Katajainen, Alistair Moffat, Andrew Turpin, 1995.*/ + +/*chain node for boundary package merge*/ +typedef struct BPMNode { + int weight; /*the sum of all weights in this chain*/ + unsigned index; /*index of this leaf node (called "count" in the paper)*/ + struct BPMNode* tail; /*the next nodes in this chain (null if last)*/ + int in_use; +} BPMNode; + +/*lists of chains*/ +typedef struct BPMLists { + /*memory pool*/ + unsigned memsize; + BPMNode* memory; + unsigned numfree; + unsigned nextfree; + BPMNode** freelist; + /*two heads of lookahead chains per list*/ + unsigned listsize; + BPMNode** chains0; + BPMNode** chains1; +} BPMLists; + +/*creates a new chain node with the given parameters, from the memory in the lists */ +static BPMNode* bpmnode_create(BPMLists* lists, int weight, unsigned index, BPMNode* tail) { + unsigned i; + BPMNode* result; + + /*memory full, so garbage collect*/ + if(lists->nextfree >= lists->numfree) { + /*mark only those that are in use*/ + for(i = 0; i != lists->memsize; ++i) lists->memory[i].in_use = 0; + for(i = 0; i != lists->listsize; ++i) { + BPMNode* node; + for(node = lists->chains0[i]; node != 0; node = node->tail) node->in_use = 1; + for(node = lists->chains1[i]; node != 0; node = node->tail) node->in_use = 1; + } + /*collect those that are free*/ + lists->numfree = 0; + for(i = 0; i != lists->memsize; ++i) { + if(!lists->memory[i].in_use) lists->freelist[lists->numfree++] = &lists->memory[i]; + } + lists->nextfree = 0; + } + + result = lists->freelist[lists->nextfree++]; + result->weight = weight; + result->index = index; + result->tail = tail; + return result; +} + +/*sort the leaves with stable mergesort*/ +static void bpmnode_sort(BPMNode* leaves, size_t num) { + BPMNode* mem = (BPMNode*)lodepng_malloc(sizeof(*leaves) * num); + size_t width, counter = 0; + for(width = 1; width < num; width *= 2) { + BPMNode* a = (counter & 1) ? mem : leaves; + BPMNode* b = (counter & 1) ? leaves : mem; + size_t p; + for(p = 0; p < num; p += 2 * width) { + size_t q = (p + width > num) ? num : (p + width); + size_t r = (p + 2 * width > num) ? num : (p + 2 * width); + size_t i = p, j = q, k; + for(k = p; k < r; k++) { + if(i < q && (j >= r || a[i].weight <= a[j].weight)) b[k] = a[i++]; + else b[k] = a[j++]; + } + } + counter++; + } + if(counter & 1) lodepng_memcpy(leaves, mem, sizeof(*leaves) * num); + lodepng_free(mem); +} + +/*Boundary Package Merge step, numpresent is the amount of leaves, and c is the current chain.*/ +static void boundaryPM(BPMLists* lists, BPMNode* leaves, size_t numpresent, int c, int num) { + unsigned lastindex = lists->chains1[c]->index; + + if(c == 0) { + if(lastindex >= numpresent) return; + lists->chains0[c] = lists->chains1[c]; + lists->chains1[c] = bpmnode_create(lists, leaves[lastindex].weight, lastindex + 1, 0); + } else { + /*sum of the weights of the head nodes of the previous lookahead chains.*/ + int sum = lists->chains0[c - 1]->weight + lists->chains1[c - 1]->weight; + lists->chains0[c] = lists->chains1[c]; + if(lastindex < numpresent && sum > leaves[lastindex].weight) { + lists->chains1[c] = bpmnode_create(lists, leaves[lastindex].weight, lastindex + 1, lists->chains1[c]->tail); + return; + } + lists->chains1[c] = bpmnode_create(lists, sum, lastindex, lists->chains1[c - 1]); + /*in the end we are only interested in the chain of the last list, so no + need to recurse if we're at the last one (this gives measurable speedup)*/ + if(num + 1 < (int)(2 * numpresent - 2)) { + boundaryPM(lists, leaves, numpresent, c - 1, num); + boundaryPM(lists, leaves, numpresent, c - 1, num); + } + } +} + +unsigned lodepng_huffman_code_lengths(unsigned* lengths, const unsigned* frequencies, + size_t numcodes, unsigned maxbitlen) { + unsigned error = 0; + unsigned i; + size_t numpresent = 0; /*number of symbols with non-zero frequency*/ + BPMNode* leaves; /*the symbols, only those with > 0 frequency*/ + + if(numcodes == 0) return 80; /*error: a tree of 0 symbols is not supposed to be made*/ + if((1u << maxbitlen) < (unsigned)numcodes) return 80; /*error: represent all symbols*/ + + leaves = (BPMNode*)lodepng_malloc(numcodes * sizeof(*leaves)); + if(!leaves) return 83; /*alloc fail*/ + + for(i = 0; i != numcodes; ++i) { + if(frequencies[i] > 0) { + leaves[numpresent].weight = (int)frequencies[i]; + leaves[numpresent].index = i; + ++numpresent; + } + } + + lodepng_memset(lengths, 0, numcodes * sizeof(*lengths)); + + /*ensure at least two present symbols. There should be at least one symbol + according to RFC 1951 section 3.2.7. Some decoders incorrectly require two. To + make these work as well ensure there are at least two symbols. The + Package-Merge code below also doesn't work correctly if there's only one + symbol, it'd give it the theoretical 0 bits but in practice zlib wants 1 bit*/ + if(numpresent == 0) { + lengths[0] = lengths[1] = 1; /*note that for RFC 1951 section 3.2.7, only lengths[0] = 1 is needed*/ + } else if(numpresent == 1) { + lengths[leaves[0].index] = 1; + lengths[leaves[0].index == 0 ? 1 : 0] = 1; + } else { + BPMLists lists; + BPMNode* node; + + bpmnode_sort(leaves, numpresent); + + lists.listsize = maxbitlen; + lists.memsize = 2 * maxbitlen * (maxbitlen + 1); + lists.nextfree = 0; + lists.numfree = lists.memsize; + lists.memory = (BPMNode*)lodepng_malloc(lists.memsize * sizeof(*lists.memory)); + lists.freelist = (BPMNode**)lodepng_malloc(lists.memsize * sizeof(BPMNode*)); + lists.chains0 = (BPMNode**)lodepng_malloc(lists.listsize * sizeof(BPMNode*)); + lists.chains1 = (BPMNode**)lodepng_malloc(lists.listsize * sizeof(BPMNode*)); + if(!lists.memory || !lists.freelist || !lists.chains0 || !lists.chains1) error = 83; /*alloc fail*/ + + if(!error) { + for(i = 0; i != lists.memsize; ++i) lists.freelist[i] = &lists.memory[i]; + + bpmnode_create(&lists, leaves[0].weight, 1, 0); + bpmnode_create(&lists, leaves[1].weight, 2, 0); + + for(i = 0; i != lists.listsize; ++i) { + lists.chains0[i] = &lists.memory[0]; + lists.chains1[i] = &lists.memory[1]; + } + + /*each boundaryPM call adds one chain to the last list, and we need 2 * numpresent - 2 chains.*/ + for(i = 2; i != 2 * numpresent - 2; ++i) boundaryPM(&lists, leaves, numpresent, (int)maxbitlen - 1, (int)i); + + for(node = lists.chains1[maxbitlen - 1]; node; node = node->tail) { + for(i = 0; i != node->index; ++i) ++lengths[leaves[i].index]; + } + } + + lodepng_free(lists.memory); + lodepng_free(lists.freelist); + lodepng_free(lists.chains0); + lodepng_free(lists.chains1); + } + + lodepng_free(leaves); + return error; +} + +/*Create the Huffman tree given the symbol frequencies*/ +static unsigned HuffmanTree_makeFromFrequencies(HuffmanTree* tree, const unsigned* frequencies, + size_t mincodes, size_t numcodes, unsigned maxbitlen) { + unsigned error = 0; + while(!frequencies[numcodes - 1] && numcodes > mincodes) --numcodes; /*trim zeroes*/ + tree->lengths = (unsigned*)lodepng_malloc(numcodes * sizeof(unsigned)); + if(!tree->lengths) return 83; /*alloc fail*/ + tree->maxbitlen = maxbitlen; + tree->numcodes = (unsigned)numcodes; /*number of symbols*/ + + error = lodepng_huffman_code_lengths(tree->lengths, frequencies, numcodes, maxbitlen); + if(!error) error = HuffmanTree_makeFromLengths2(tree); + return error; +} +#endif /*LODEPNG_COMPILE_ENCODER*/ + +/*get the literal and length code tree of a deflated block with fixed tree, as per the deflate specification*/ +static unsigned generateFixedLitLenTree(HuffmanTree* tree) { + unsigned i, error = 0; + unsigned* bitlen = (unsigned*)lodepng_malloc(NUM_DEFLATE_CODE_SYMBOLS * sizeof(unsigned)); + if(!bitlen) return 83; /*alloc fail*/ + + /*288 possible codes: 0-255=literals, 256=endcode, 257-285=lengthcodes, 286-287=unused*/ + for(i = 0; i <= 143; ++i) bitlen[i] = 8; + for(i = 144; i <= 255; ++i) bitlen[i] = 9; + for(i = 256; i <= 279; ++i) bitlen[i] = 7; + for(i = 280; i <= 287; ++i) bitlen[i] = 8; + + error = HuffmanTree_makeFromLengths(tree, bitlen, NUM_DEFLATE_CODE_SYMBOLS, 15); + + lodepng_free(bitlen); + return error; +} + +/*get the distance code tree of a deflated block with fixed tree, as specified in the deflate specification*/ +static unsigned generateFixedDistanceTree(HuffmanTree* tree) { + unsigned i, error = 0; + unsigned* bitlen = (unsigned*)lodepng_malloc(NUM_DISTANCE_SYMBOLS * sizeof(unsigned)); + if(!bitlen) return 83; /*alloc fail*/ + + /*there are 32 distance codes, but 30-31 are unused*/ + for(i = 0; i != NUM_DISTANCE_SYMBOLS; ++i) bitlen[i] = 5; + error = HuffmanTree_makeFromLengths(tree, bitlen, NUM_DISTANCE_SYMBOLS, 15); + + lodepng_free(bitlen); + return error; +} + +#ifdef LODEPNG_COMPILE_DECODER + +/* +returns the code. The bit reader must already have been ensured at least 15 bits +*/ +static unsigned huffmanDecodeSymbol(LodePNGBitReader* reader, const HuffmanTree* codetree) { + unsigned short code = peekBits(reader, FIRSTBITS); + unsigned short l = codetree->table_len[code]; + unsigned short value = codetree->table_value[code]; + if(l <= FIRSTBITS) { + advanceBits(reader, l); + return value; + } else { + unsigned index2; + advanceBits(reader, FIRSTBITS); + index2 = value + peekBits(reader, l - FIRSTBITS); + advanceBits(reader, codetree->table_len[index2] - FIRSTBITS); + return codetree->table_value[index2]; + } +} +#endif /*LODEPNG_COMPILE_DECODER*/ + +#ifdef LODEPNG_COMPILE_DECODER + +/* ////////////////////////////////////////////////////////////////////////// */ +/* / Inflator (Decompressor) / */ +/* ////////////////////////////////////////////////////////////////////////// */ + +/*get the tree of a deflated block with fixed tree, as specified in the deflate specification +Returns error code.*/ +static unsigned getTreeInflateFixed(HuffmanTree* tree_ll, HuffmanTree* tree_d) { + unsigned error = generateFixedLitLenTree(tree_ll); + if(error) return error; + return generateFixedDistanceTree(tree_d); +} + +/*get the tree of a deflated block with dynamic tree, the tree itself is also Huffman compressed with a known tree*/ +static unsigned getTreeInflateDynamic(HuffmanTree* tree_ll, HuffmanTree* tree_d, + LodePNGBitReader* reader) { + /*make sure that length values that aren't filled in will be 0, or a wrong tree will be generated*/ + unsigned error = 0; + unsigned n, HLIT, HDIST, HCLEN, i; + + /*see comments in deflateDynamic for explanation of the context and these variables, it is analogous*/ + unsigned* bitlen_ll = 0; /*lit,len code lengths*/ + unsigned* bitlen_d = 0; /*dist code lengths*/ + /*code length code lengths ("clcl"), the bit lengths of the huffman tree used to compress bitlen_ll and bitlen_d*/ + unsigned* bitlen_cl = 0; + HuffmanTree tree_cl; /*the code tree for code length codes (the huffman tree for compressed huffman trees)*/ + + if(!ensureBits17(reader, 14)) return 49; /*error: the bit pointer is or will go past the memory*/ + + /*number of literal/length codes + 257. Unlike the spec, the value 257 is added to it here already*/ + HLIT = readBits(reader, 5) + 257; + /*number of distance codes. Unlike the spec, the value 1 is added to it here already*/ + HDIST = readBits(reader, 5) + 1; + /*number of code length codes. Unlike the spec, the value 4 is added to it here already*/ + HCLEN = readBits(reader, 4) + 4; + + bitlen_cl = (unsigned*)lodepng_malloc(NUM_CODE_LENGTH_CODES * sizeof(unsigned)); + if(!bitlen_cl) return 83 /*alloc fail*/; + + HuffmanTree_init(&tree_cl); + + while(!error) { + /*read the code length codes out of 3 * (amount of code length codes) bits*/ + if(lodepng_gtofl(reader->bp, HCLEN * 3, reader->bitsize)) { + ERROR_BREAK(50); /*error: the bit pointer is or will go past the memory*/ + } + for(i = 0; i != HCLEN; ++i) { + ensureBits9(reader, 3); /*out of bounds already checked above */ + bitlen_cl[CLCL_ORDER[i]] = readBits(reader, 3); + } + for(i = HCLEN; i != NUM_CODE_LENGTH_CODES; ++i) { + bitlen_cl[CLCL_ORDER[i]] = 0; + } + + error = HuffmanTree_makeFromLengths(&tree_cl, bitlen_cl, NUM_CODE_LENGTH_CODES, 7); + if(error) break; + + /*now we can use this tree to read the lengths for the tree that this function will return*/ + bitlen_ll = (unsigned*)lodepng_malloc(NUM_DEFLATE_CODE_SYMBOLS * sizeof(unsigned)); + bitlen_d = (unsigned*)lodepng_malloc(NUM_DISTANCE_SYMBOLS * sizeof(unsigned)); + if(!bitlen_ll || !bitlen_d) ERROR_BREAK(83 /*alloc fail*/); + lodepng_memset(bitlen_ll, 0, NUM_DEFLATE_CODE_SYMBOLS * sizeof(*bitlen_ll)); + lodepng_memset(bitlen_d, 0, NUM_DISTANCE_SYMBOLS * sizeof(*bitlen_d)); + + /*i is the current symbol we're reading in the part that contains the code lengths of lit/len and dist codes*/ + i = 0; + while(i < HLIT + HDIST) { + unsigned code; + ensureBits25(reader, 22); /* up to 15 bits for huffman code, up to 7 extra bits below*/ + code = huffmanDecodeSymbol(reader, &tree_cl); + if(code <= 15) /*a length code*/ { + if(i < HLIT) bitlen_ll[i] = code; + else bitlen_d[i - HLIT] = code; + ++i; + } else if(code == 16) /*repeat previous*/ { + unsigned replength = 3; /*read in the 2 bits that indicate repeat length (3-6)*/ + unsigned value; /*set value to the previous code*/ + + if(i == 0) ERROR_BREAK(54); /*can't repeat previous if i is 0*/ + + replength += readBits(reader, 2); + + if(i < HLIT + 1) value = bitlen_ll[i - 1]; + else value = bitlen_d[i - HLIT - 1]; + /*repeat this value in the next lengths*/ + for(n = 0; n < replength; ++n) { + if(i >= HLIT + HDIST) ERROR_BREAK(13); /*error: i is larger than the amount of codes*/ + if(i < HLIT) bitlen_ll[i] = value; + else bitlen_d[i - HLIT] = value; + ++i; + } + } else if(code == 17) /*repeat "0" 3-10 times*/ { + unsigned replength = 3; /*read in the bits that indicate repeat length*/ + replength += readBits(reader, 3); + + /*repeat this value in the next lengths*/ + for(n = 0; n < replength; ++n) { + if(i >= HLIT + HDIST) ERROR_BREAK(14); /*error: i is larger than the amount of codes*/ + + if(i < HLIT) bitlen_ll[i] = 0; + else bitlen_d[i - HLIT] = 0; + ++i; + } + } else if(code == 18) /*repeat "0" 11-138 times*/ { + unsigned replength = 11; /*read in the bits that indicate repeat length*/ + replength += readBits(reader, 7); + + /*repeat this value in the next lengths*/ + for(n = 0; n < replength; ++n) { + if(i >= HLIT + HDIST) ERROR_BREAK(15); /*error: i is larger than the amount of codes*/ + + if(i < HLIT) bitlen_ll[i] = 0; + else bitlen_d[i - HLIT] = 0; + ++i; + } + } else /*if(code == INVALIDSYMBOL)*/ { + ERROR_BREAK(16); /*error: tried to read disallowed huffman symbol*/ + } + /*check if any of the ensureBits above went out of bounds*/ + if(reader->bp > reader->bitsize) { + /*return error code 10 or 11 depending on the situation that happened in huffmanDecodeSymbol + (10=no endcode, 11=wrong jump outside of tree)*/ + /* TODO: revise error codes 10,11,50: the above comment is no longer valid */ + ERROR_BREAK(50); /*error, bit pointer jumps past memory*/ + } + } + if(error) break; + + if(bitlen_ll[256] == 0) ERROR_BREAK(64); /*the length of the end code 256 must be larger than 0*/ + + /*now we've finally got HLIT and HDIST, so generate the code trees, and the function is done*/ + error = HuffmanTree_makeFromLengths(tree_ll, bitlen_ll, NUM_DEFLATE_CODE_SYMBOLS, 15); + if(error) break; + error = HuffmanTree_makeFromLengths(tree_d, bitlen_d, NUM_DISTANCE_SYMBOLS, 15); + + break; /*end of error-while*/ + } + + lodepng_free(bitlen_cl); + lodepng_free(bitlen_ll); + lodepng_free(bitlen_d); + HuffmanTree_cleanup(&tree_cl); + + return error; +} + +/*inflate a block with dynamic of fixed Huffman tree. btype must be 1 or 2.*/ +static unsigned inflateHuffmanBlock(ucvector* out, LodePNGBitReader* reader, + unsigned btype) { + unsigned error = 0; + HuffmanTree tree_ll; /*the huffman tree for literal and length codes*/ + HuffmanTree tree_d; /*the huffman tree for distance codes*/ + + HuffmanTree_init(&tree_ll); + HuffmanTree_init(&tree_d); + + if(btype == 1) error = getTreeInflateFixed(&tree_ll, &tree_d); + else /*if(btype == 2)*/ error = getTreeInflateDynamic(&tree_ll, &tree_d, reader); + + while(!error) /*decode all symbols until end reached, breaks at end code*/ { + /*code_ll is literal, length or end code*/ + unsigned code_ll; + ensureBits25(reader, 20); /* up to 15 for the huffman symbol, up to 5 for the length extra bits */ + code_ll = huffmanDecodeSymbol(reader, &tree_ll); + if(code_ll <= 255) /*literal symbol*/ { + if(!ucvector_resize(out, out->size + 1)) ERROR_BREAK(83 /*alloc fail*/); + out->data[out->size - 1] = (unsigned char)code_ll; + } else if(code_ll >= FIRST_LENGTH_CODE_INDEX && code_ll <= LAST_LENGTH_CODE_INDEX) /*length code*/ { + unsigned code_d, distance; + unsigned numextrabits_l, numextrabits_d; /*extra bits for length and distance*/ + size_t start, backward, length; + + /*part 1: get length base*/ + length = LENGTHBASE[code_ll - FIRST_LENGTH_CODE_INDEX]; + + /*part 2: get extra bits and add the value of that to length*/ + numextrabits_l = LENGTHEXTRA[code_ll - FIRST_LENGTH_CODE_INDEX]; + if(numextrabits_l != 0) { + /* bits already ensured above */ + length += readBits(reader, numextrabits_l); + } + + /*part 3: get distance code*/ + ensureBits32(reader, 28); /* up to 15 for the huffman symbol, up to 13 for the extra bits */ + code_d = huffmanDecodeSymbol(reader, &tree_d); + if(code_d > 29) { + if(code_d <= 31) { + ERROR_BREAK(18); /*error: invalid distance code (30-31 are never used)*/ + } else /* if(code_d == INVALIDSYMBOL) */{ + ERROR_BREAK(16); /*error: tried to read disallowed huffman symbol*/ + } + } + distance = DISTANCEBASE[code_d]; + + /*part 4: get extra bits from distance*/ + numextrabits_d = DISTANCEEXTRA[code_d]; + if(numextrabits_d != 0) { + /* bits already ensured above */ + distance += readBits(reader, numextrabits_d); + } + + /*part 5: fill in all the out[n] values based on the length and dist*/ + start = out->size; + if(distance > start) ERROR_BREAK(52); /*too long backward distance*/ + backward = start - distance; + + if(!ucvector_resize(out, out->size + length)) ERROR_BREAK(83 /*alloc fail*/); + if(distance < length) { + size_t forward; + lodepng_memcpy(out->data + start, out->data + backward, distance); + start += distance; + for(forward = distance; forward < length; ++forward) { + out->data[start++] = out->data[backward++]; + } + } else { + lodepng_memcpy(out->data + start, out->data + backward, length); + } + } else if(code_ll == 256) { + break; /*end code, break the loop*/ + } else /*if(code_ll == INVALIDSYMBOL)*/ { + ERROR_BREAK(16); /*error: tried to read disallowed huffman symbol*/ + } + /*check if any of the ensureBits above went out of bounds*/ + if(reader->bp > reader->bitsize) { + /*return error code 10 or 11 depending on the situation that happened in huffmanDecodeSymbol + (10=no endcode, 11=wrong jump outside of tree)*/ + /* TODO: revise error codes 10,11,50: the above comment is no longer valid */ + ERROR_BREAK(51); /*error, bit pointer jumps past memory*/ + } + } + + HuffmanTree_cleanup(&tree_ll); + HuffmanTree_cleanup(&tree_d); + + return error; +} + +static unsigned inflateNoCompression(ucvector* out, LodePNGBitReader* reader, + const LodePNGDecompressSettings* settings) { + size_t bytepos; + size_t size = reader->size; + unsigned LEN, NLEN, error = 0; + + /*go to first boundary of byte*/ + bytepos = (reader->bp + 7u) >> 3u; + + /*read LEN (2 bytes) and NLEN (2 bytes)*/ + if(bytepos + 4 >= size) return 52; /*error, bit pointer will jump past memory*/ + LEN = (unsigned)reader->data[bytepos] + ((unsigned)reader->data[bytepos + 1] << 8u); bytepos += 2; + NLEN = (unsigned)reader->data[bytepos] + ((unsigned)reader->data[bytepos + 1] << 8u); bytepos += 2; + + /*check if 16-bit NLEN is really the one's complement of LEN*/ + if(!settings->ignore_nlen && LEN + NLEN != 65535) { + return 21; /*error: NLEN is not one's complement of LEN*/ + } + + if(!ucvector_resize(out, out->size + LEN)) return 83; /*alloc fail*/ + + /*read the literal data: LEN bytes are now stored in the out buffer*/ + if(bytepos + LEN > size) return 23; /*error: reading outside of in buffer*/ + + lodepng_memcpy(out->data + out->size - LEN, reader->data + bytepos, LEN); + bytepos += LEN; + + reader->bp = bytepos << 3u; + + return error; +} + +static unsigned lodepng_inflatev(ucvector* out, + const unsigned char* in, size_t insize, + const LodePNGDecompressSettings* settings) { + unsigned BFINAL = 0; + LodePNGBitReader reader; + unsigned error = LodePNGBitReader_init(&reader, in, insize); + + if(error) return error; + + while(!BFINAL) { + unsigned BTYPE; + if(!ensureBits9(&reader, 3)) return 52; /*error, bit pointer will jump past memory*/ + BFINAL = readBits(&reader, 1); + BTYPE = readBits(&reader, 2); + + if(BTYPE == 3) return 20; /*error: invalid BTYPE*/ + else if(BTYPE == 0) error = inflateNoCompression(out, &reader, settings); /*no compression*/ + else error = inflateHuffmanBlock(out, &reader, BTYPE); /*compression, BTYPE 01 or 10*/ + + if(error) return error; + } + + return error; +} + +unsigned lodepng_inflate(unsigned char** out, size_t* outsize, + const unsigned char* in, size_t insize, + const LodePNGDecompressSettings* settings) { + ucvector v = ucvector_init(*out, *outsize); + unsigned error = lodepng_inflatev(&v, in, insize, settings); + *out = v.data; + *outsize = v.size; + return error; +} + +static unsigned inflatev(ucvector* out, const unsigned char* in, size_t insize, + const LodePNGDecompressSettings* settings) { + if(settings->custom_inflate) { + unsigned error = settings->custom_inflate(&out->data, &out->size, in, insize, settings); + out->allocsize = out->size; + return error; + } else { + return lodepng_inflatev(out, in, insize, settings); + } +} + +#endif /*LODEPNG_COMPILE_DECODER*/ + +#ifdef LODEPNG_COMPILE_ENCODER + +/* ////////////////////////////////////////////////////////////////////////// */ +/* / Deflator (Compressor) / */ +/* ////////////////////////////////////////////////////////////////////////// */ + +static const size_t MAX_SUPPORTED_DEFLATE_LENGTH = 258; + +/*search the index in the array, that has the largest value smaller than or equal to the given value, +given array must be sorted (if no value is smaller, it returns the size of the given array)*/ +static size_t searchCodeIndex(const unsigned* array, size_t array_size, size_t value) { + /*binary search (only small gain over linear). TODO: use CPU log2 instruction for getting symbols instead*/ + size_t left = 1; + size_t right = array_size - 1; + + while(left <= right) { + size_t mid = (left + right) >> 1; + if(array[mid] >= value) right = mid - 1; + else left = mid + 1; + } + if(left >= array_size || array[left] > value) left--; + return left; +} + +static void addLengthDistance(uivector* values, size_t length, size_t distance) { + /*values in encoded vector are those used by deflate: + 0-255: literal bytes + 256: end + 257-285: length/distance pair (length code, followed by extra length bits, distance code, extra distance bits) + 286-287: invalid*/ + + unsigned length_code = (unsigned)searchCodeIndex(LENGTHBASE, 29, length); + unsigned extra_length = (unsigned)(length - LENGTHBASE[length_code]); + unsigned dist_code = (unsigned)searchCodeIndex(DISTANCEBASE, 30, distance); + unsigned extra_distance = (unsigned)(distance - DISTANCEBASE[dist_code]); + + size_t pos = values->size; + /*TODO: return error when this fails (out of memory)*/ + unsigned ok = uivector_resize(values, values->size + 4); + if(ok) { + values->data[pos + 0] = length_code + FIRST_LENGTH_CODE_INDEX; + values->data[pos + 1] = extra_length; + values->data[pos + 2] = dist_code; + values->data[pos + 3] = extra_distance; + } +} + +/*3 bytes of data get encoded into two bytes. The hash cannot use more than 3 +bytes as input because 3 is the minimum match length for deflate*/ +static const unsigned HASH_NUM_VALUES = 65536; +static const unsigned HASH_BIT_MASK = 65535; /*HASH_NUM_VALUES - 1, but C90 does not like that as initializer*/ + +typedef struct Hash { + int* head; /*hash value to head circular pos - can be outdated if went around window*/ + /*circular pos to prev circular pos*/ + unsigned short* chain; + int* val; /*circular pos to hash value*/ + + /*TODO: do this not only for zeros but for any repeated byte. However for PNG + it's always going to be the zeros that dominate, so not important for PNG*/ + int* headz; /*similar to head, but for chainz*/ + unsigned short* chainz; /*those with same amount of zeros*/ + unsigned short* zeros; /*length of zeros streak, used as a second hash chain*/ +} Hash; + +static unsigned hash_init(Hash* hash, unsigned windowsize) { + unsigned i; + hash->head = (int*)lodepng_malloc(sizeof(int) * HASH_NUM_VALUES); + hash->val = (int*)lodepng_malloc(sizeof(int) * windowsize); + hash->chain = (unsigned short*)lodepng_malloc(sizeof(unsigned short) * windowsize); + + hash->zeros = (unsigned short*)lodepng_malloc(sizeof(unsigned short) * windowsize); + hash->headz = (int*)lodepng_malloc(sizeof(int) * (MAX_SUPPORTED_DEFLATE_LENGTH + 1)); + hash->chainz = (unsigned short*)lodepng_malloc(sizeof(unsigned short) * windowsize); + + if(!hash->head || !hash->chain || !hash->val || !hash->headz|| !hash->chainz || !hash->zeros) { + return 83; /*alloc fail*/ + } + + /*initialize hash table*/ + for(i = 0; i != HASH_NUM_VALUES; ++i) hash->head[i] = -1; + for(i = 0; i != windowsize; ++i) hash->val[i] = -1; + for(i = 0; i != windowsize; ++i) hash->chain[i] = i; /*same value as index indicates uninitialized*/ + + for(i = 0; i <= MAX_SUPPORTED_DEFLATE_LENGTH; ++i) hash->headz[i] = -1; + for(i = 0; i != windowsize; ++i) hash->chainz[i] = i; /*same value as index indicates uninitialized*/ + + return 0; +} + +static void hash_cleanup(Hash* hash) { + lodepng_free(hash->head); + lodepng_free(hash->val); + lodepng_free(hash->chain); + + lodepng_free(hash->zeros); + lodepng_free(hash->headz); + lodepng_free(hash->chainz); +} + + + +static unsigned getHash(const unsigned char* data, size_t size, size_t pos) { + unsigned result = 0; + if(pos + 2 < size) { + /*A simple shift and xor hash is used. Since the data of PNGs is dominated + by zeroes due to the filters, a better hash does not have a significant + effect on speed in traversing the chain, and causes more time spend on + calculating the hash.*/ + result ^= ((unsigned)data[pos + 0] << 0u); + result ^= ((unsigned)data[pos + 1] << 4u); + result ^= ((unsigned)data[pos + 2] << 8u); + } else { + size_t amount, i; + if(pos >= size) return 0; + amount = size - pos; + for(i = 0; i != amount; ++i) result ^= ((unsigned)data[pos + i] << (i * 8u)); + } + return result & HASH_BIT_MASK; +} + +static unsigned countZeros(const unsigned char* data, size_t size, size_t pos) { + const unsigned char* start = data + pos; + const unsigned char* end = start + MAX_SUPPORTED_DEFLATE_LENGTH; + if(end > data + size) end = data + size; + data = start; + while(data != end && *data == 0) ++data; + /*subtracting two addresses returned as 32-bit number (max value is MAX_SUPPORTED_DEFLATE_LENGTH)*/ + return (unsigned)(data - start); +} + +/*wpos = pos & (windowsize - 1)*/ +static void updateHashChain(Hash* hash, size_t wpos, unsigned hashval, unsigned short numzeros) { + hash->val[wpos] = (int)hashval; + if(hash->head[hashval] != -1) hash->chain[wpos] = hash->head[hashval]; + hash->head[hashval] = (int)wpos; + + hash->zeros[wpos] = numzeros; + if(hash->headz[numzeros] != -1) hash->chainz[wpos] = hash->headz[numzeros]; + hash->headz[numzeros] = (int)wpos; +} + +/* +LZ77-encode the data. Return value is error code. The input are raw bytes, the output +is in the form of unsigned integers with codes representing for example literal bytes, or +length/distance pairs. +It uses a hash table technique to let it encode faster. When doing LZ77 encoding, a +sliding window (of windowsize) is used, and all past bytes in that window can be used as +the "dictionary". A brute force search through all possible distances would be slow, and +this hash technique is one out of several ways to speed this up. +*/ +static unsigned encodeLZ77(uivector* out, Hash* hash, + const unsigned char* in, size_t inpos, size_t insize, unsigned windowsize, + unsigned minmatch, unsigned nicematch, unsigned lazymatching) { + size_t pos; + unsigned i, error = 0; + /*for large window lengths, assume the user wants no compression loss. Otherwise, max hash chain length speedup.*/ + unsigned maxchainlength = windowsize >= 8192 ? windowsize : windowsize / 8u; + unsigned maxlazymatch = windowsize >= 8192 ? MAX_SUPPORTED_DEFLATE_LENGTH : 64; + + unsigned usezeros = 1; /*not sure if setting it to false for windowsize < 8192 is better or worse*/ + unsigned numzeros = 0; + + unsigned offset; /*the offset represents the distance in LZ77 terminology*/ + unsigned length; + unsigned lazy = 0; + unsigned lazylength = 0, lazyoffset = 0; + unsigned hashval; + unsigned current_offset, current_length; + unsigned prev_offset; + const unsigned char *lastptr, *foreptr, *backptr; + unsigned hashpos; + + if(windowsize == 0 || windowsize > 32768) return 60; /*error: windowsize smaller/larger than allowed*/ + if((windowsize & (windowsize - 1)) != 0) return 90; /*error: must be power of two*/ + + if(nicematch > MAX_SUPPORTED_DEFLATE_LENGTH) nicematch = MAX_SUPPORTED_DEFLATE_LENGTH; + + for(pos = inpos; pos < insize; ++pos) { + size_t wpos = pos & (windowsize - 1); /*position for in 'circular' hash buffers*/ + unsigned chainlength = 0; + + hashval = getHash(in, insize, pos); + + if(usezeros && hashval == 0) { + if(numzeros == 0) numzeros = countZeros(in, insize, pos); + else if(pos + numzeros > insize || in[pos + numzeros - 1] != 0) --numzeros; + } else { + numzeros = 0; + } + + updateHashChain(hash, wpos, hashval, numzeros); + + /*the length and offset found for the current position*/ + length = 0; + offset = 0; + + hashpos = hash->chain[wpos]; + + lastptr = &in[insize < pos + MAX_SUPPORTED_DEFLATE_LENGTH ? insize : pos + MAX_SUPPORTED_DEFLATE_LENGTH]; + + /*search for the longest string*/ + prev_offset = 0; + for(;;) { + if(chainlength++ >= maxchainlength) break; + current_offset = (unsigned)(hashpos <= wpos ? wpos - hashpos : wpos - hashpos + windowsize); + + if(current_offset < prev_offset) break; /*stop when went completely around the circular buffer*/ + prev_offset = current_offset; + if(current_offset > 0) { + /*test the next characters*/ + foreptr = &in[pos]; + backptr = &in[pos - current_offset]; + + /*common case in PNGs is lots of zeros. Quickly skip over them as a speedup*/ + if(numzeros >= 3) { + unsigned skip = hash->zeros[hashpos]; + if(skip > numzeros) skip = numzeros; + backptr += skip; + foreptr += skip; + } + + while(foreptr != lastptr && *backptr == *foreptr) /*maximum supported length by deflate is max length*/ { + ++backptr; + ++foreptr; + } + current_length = (unsigned)(foreptr - &in[pos]); + + if(current_length > length) { + length = current_length; /*the longest length*/ + offset = current_offset; /*the offset that is related to this longest length*/ + /*jump out once a length of max length is found (speed gain). This also jumps + out if length is MAX_SUPPORTED_DEFLATE_LENGTH*/ + if(current_length >= nicematch) break; + } + } + + if(hashpos == hash->chain[hashpos]) break; + + if(numzeros >= 3 && length > numzeros) { + hashpos = hash->chainz[hashpos]; + if(hash->zeros[hashpos] != numzeros) break; + } else { + hashpos = hash->chain[hashpos]; + /*outdated hash value, happens if particular value was not encountered in whole last window*/ + if(hash->val[hashpos] != (int)hashval) break; + } + } + + if(lazymatching) { + if(!lazy && length >= 3 && length <= maxlazymatch && length < MAX_SUPPORTED_DEFLATE_LENGTH) { + lazy = 1; + lazylength = length; + lazyoffset = offset; + continue; /*try the next byte*/ + } + if(lazy) { + lazy = 0; + if(pos == 0) ERROR_BREAK(81); + if(length > lazylength + 1) { + /*push the previous character as literal*/ + if(!uivector_push_back(out, in[pos - 1])) ERROR_BREAK(83 /*alloc fail*/); + } else { + length = lazylength; + offset = lazyoffset; + hash->head[hashval] = -1; /*the same hashchain update will be done, this ensures no wrong alteration*/ + hash->headz[numzeros] = -1; /*idem*/ + --pos; + } + } + } + if(length >= 3 && offset > windowsize) ERROR_BREAK(86 /*too big (or overflown negative) offset*/); + + /*encode it as length/distance pair or literal value*/ + if(length < 3) /*only lengths of 3 or higher are supported as length/distance pair*/ { + if(!uivector_push_back(out, in[pos])) ERROR_BREAK(83 /*alloc fail*/); + } else if(length < minmatch || (length == 3 && offset > 4096)) { + /*compensate for the fact that longer offsets have more extra bits, a + length of only 3 may be not worth it then*/ + if(!uivector_push_back(out, in[pos])) ERROR_BREAK(83 /*alloc fail*/); + } else { + addLengthDistance(out, length, offset); + for(i = 1; i < length; ++i) { + ++pos; + wpos = pos & (windowsize - 1); + hashval = getHash(in, insize, pos); + if(usezeros && hashval == 0) { + if(numzeros == 0) numzeros = countZeros(in, insize, pos); + else if(pos + numzeros > insize || in[pos + numzeros - 1] != 0) --numzeros; + } else { + numzeros = 0; + } + updateHashChain(hash, wpos, hashval, numzeros); + } + } + } /*end of the loop through each character of input*/ + + return error; +} + +/* /////////////////////////////////////////////////////////////////////////// */ + +static unsigned deflateNoCompression(ucvector* out, const unsigned char* data, size_t datasize) { + /*non compressed deflate block data: 1 bit BFINAL,2 bits BTYPE,(5 bits): it jumps to start of next byte, + 2 bytes LEN, 2 bytes NLEN, LEN bytes literal DATA*/ + + size_t i, numdeflateblocks = (datasize + 65534u) / 65535u; + unsigned datapos = 0; + for(i = 0; i != numdeflateblocks; ++i) { + unsigned BFINAL, BTYPE, LEN, NLEN; + unsigned char firstbyte; + size_t pos = out->size; + + BFINAL = (i == numdeflateblocks - 1); + BTYPE = 0; + + LEN = 65535; + if(datasize - datapos < 65535u) LEN = (unsigned)datasize - datapos; + NLEN = 65535 - LEN; + + if(!ucvector_resize(out, out->size + LEN + 5)) return 83; /*alloc fail*/ + + firstbyte = (unsigned char)(BFINAL + ((BTYPE & 1u) << 1u) + ((BTYPE & 2u) << 1u)); + out->data[pos + 0] = firstbyte; + out->data[pos + 1] = (unsigned char)(LEN & 255); + out->data[pos + 2] = (unsigned char)(LEN >> 8u); + out->data[pos + 3] = (unsigned char)(NLEN & 255); + out->data[pos + 4] = (unsigned char)(NLEN >> 8u); + lodepng_memcpy(out->data + pos + 5, data + datapos, LEN); + datapos += LEN; + } + + return 0; +} + +/* +write the lz77-encoded data, which has lit, len and dist codes, to compressed stream using huffman trees. +tree_ll: the tree for lit and len codes. +tree_d: the tree for distance codes. +*/ +static void writeLZ77data(LodePNGBitWriter* writer, const uivector* lz77_encoded, + const HuffmanTree* tree_ll, const HuffmanTree* tree_d) { + size_t i = 0; + for(i = 0; i != lz77_encoded->size; ++i) { + unsigned val = lz77_encoded->data[i]; + writeBitsReversed(writer, tree_ll->codes[val], tree_ll->lengths[val]); + if(val > 256) /*for a length code, 3 more things have to be added*/ { + unsigned length_index = val - FIRST_LENGTH_CODE_INDEX; + unsigned n_length_extra_bits = LENGTHEXTRA[length_index]; + unsigned length_extra_bits = lz77_encoded->data[++i]; + + unsigned distance_code = lz77_encoded->data[++i]; + + unsigned distance_index = distance_code; + unsigned n_distance_extra_bits = DISTANCEEXTRA[distance_index]; + unsigned distance_extra_bits = lz77_encoded->data[++i]; + + writeBits(writer, length_extra_bits, n_length_extra_bits); + writeBitsReversed(writer, tree_d->codes[distance_code], tree_d->lengths[distance_code]); + writeBits(writer, distance_extra_bits, n_distance_extra_bits); + } + } +} + +/*Deflate for a block of type "dynamic", that is, with freely, optimally, created huffman trees*/ +static unsigned deflateDynamic(LodePNGBitWriter* writer, Hash* hash, + const unsigned char* data, size_t datapos, size_t dataend, + const LodePNGCompressSettings* settings, unsigned final) { + unsigned error = 0; + + /* + A block is compressed as follows: The PNG data is lz77 encoded, resulting in + literal bytes and length/distance pairs. This is then huffman compressed with + two huffman trees. One huffman tree is used for the lit and len values ("ll"), + another huffman tree is used for the dist values ("d"). These two trees are + stored using their code lengths, and to compress even more these code lengths + are also run-length encoded and huffman compressed. This gives a huffman tree + of code lengths "cl". The code lengths used to describe this third tree are + the code length code lengths ("clcl"). + */ + + /*The lz77 encoded data, represented with integers since there will also be length and distance codes in it*/ + uivector lz77_encoded; + HuffmanTree tree_ll; /*tree for lit,len values*/ + HuffmanTree tree_d; /*tree for distance codes*/ + HuffmanTree tree_cl; /*tree for encoding the code lengths representing tree_ll and tree_d*/ + unsigned* frequencies_ll = 0; /*frequency of lit,len codes*/ + unsigned* frequencies_d = 0; /*frequency of dist codes*/ + unsigned* frequencies_cl = 0; /*frequency of code length codes*/ + unsigned* bitlen_lld = 0; /*lit,len,dist code lengths (int bits), literally (without repeat codes).*/ + unsigned* bitlen_lld_e = 0; /*bitlen_lld encoded with repeat codes (this is a rudimentary run length compression)*/ + size_t datasize = dataend - datapos; + + /* + If we could call "bitlen_cl" the the code length code lengths ("clcl"), that is the bit lengths of codes to represent + tree_cl in CLCL_ORDER, then due to the huffman compression of huffman tree representations ("two levels"), there are + some analogies: + bitlen_lld is to tree_cl what data is to tree_ll and tree_d. + bitlen_lld_e is to bitlen_lld what lz77_encoded is to data. + bitlen_cl is to bitlen_lld_e what bitlen_lld is to lz77_encoded. + */ + + unsigned BFINAL = final; + size_t i; + size_t numcodes_ll, numcodes_d, numcodes_lld, numcodes_lld_e, numcodes_cl; + unsigned HLIT, HDIST, HCLEN; + + uivector_init(&lz77_encoded); + HuffmanTree_init(&tree_ll); + HuffmanTree_init(&tree_d); + HuffmanTree_init(&tree_cl); + /* could fit on stack, but >1KB is on the larger side so allocate instead */ + frequencies_ll = (unsigned*)lodepng_malloc(286 * sizeof(*frequencies_ll)); + frequencies_d = (unsigned*)lodepng_malloc(30 * sizeof(*frequencies_d)); + frequencies_cl = (unsigned*)lodepng_malloc(NUM_CODE_LENGTH_CODES * sizeof(*frequencies_cl)); + + if(!frequencies_ll || !frequencies_d || !frequencies_cl) error = 83; /*alloc fail*/ + + /*This while loop never loops due to a break at the end, it is here to + allow breaking out of it to the cleanup phase on error conditions.*/ + while(!error) { + lodepng_memset(frequencies_ll, 0, 286 * sizeof(*frequencies_ll)); + lodepng_memset(frequencies_d, 0, 30 * sizeof(*frequencies_d)); + lodepng_memset(frequencies_cl, 0, NUM_CODE_LENGTH_CODES * sizeof(*frequencies_cl)); + + if(settings->use_lz77) { + error = encodeLZ77(&lz77_encoded, hash, data, datapos, dataend, settings->windowsize, + settings->minmatch, settings->nicematch, settings->lazymatching); + if(error) break; + } else { + if(!uivector_resize(&lz77_encoded, datasize)) ERROR_BREAK(83 /*alloc fail*/); + for(i = datapos; i < dataend; ++i) lz77_encoded.data[i - datapos] = data[i]; /*no LZ77, but still will be Huffman compressed*/ + } + + /*Count the frequencies of lit, len and dist codes*/ + for(i = 0; i != lz77_encoded.size; ++i) { + unsigned symbol = lz77_encoded.data[i]; + ++frequencies_ll[symbol]; + if(symbol > 256) { + unsigned dist = lz77_encoded.data[i + 2]; + ++frequencies_d[dist]; + i += 3; + } + } + frequencies_ll[256] = 1; /*there will be exactly 1 end code, at the end of the block*/ + + /*Make both huffman trees, one for the lit and len codes, one for the dist codes*/ + error = HuffmanTree_makeFromFrequencies(&tree_ll, frequencies_ll, 257, 286, 15); + if(error) break; + /*2, not 1, is chosen for mincodes: some buggy PNG decoders require at least 2 symbols in the dist tree*/ + error = HuffmanTree_makeFromFrequencies(&tree_d, frequencies_d, 2, 30, 15); + if(error) break; + + numcodes_ll = LODEPNG_MIN(tree_ll.numcodes, 286); + numcodes_d = LODEPNG_MIN(tree_d.numcodes, 30); + /*store the code lengths of both generated trees in bitlen_lld*/ + numcodes_lld = numcodes_ll + numcodes_d; + bitlen_lld = (unsigned*)lodepng_malloc(numcodes_lld * sizeof(*bitlen_lld)); + /*numcodes_lld_e never needs more size than bitlen_lld*/ + bitlen_lld_e = (unsigned*)lodepng_malloc(numcodes_lld * sizeof(*bitlen_lld_e)); + if(!bitlen_lld || !bitlen_lld_e) ERROR_BREAK(83); /*alloc fail*/ + numcodes_lld_e = 0; + + for(i = 0; i != numcodes_ll; ++i) bitlen_lld[i] = tree_ll.lengths[i]; + for(i = 0; i != numcodes_d; ++i) bitlen_lld[numcodes_ll + i] = tree_d.lengths[i]; + + /*run-length compress bitlen_ldd into bitlen_lld_e by using repeat codes 16 (copy length 3-6 times), + 17 (3-10 zeroes), 18 (11-138 zeroes)*/ + for(i = 0; i != numcodes_lld; ++i) { + unsigned j = 0; /*amount of repetitions*/ + while(i + j + 1 < numcodes_lld && bitlen_lld[i + j + 1] == bitlen_lld[i]) ++j; + + if(bitlen_lld[i] == 0 && j >= 2) /*repeat code for zeroes*/ { + ++j; /*include the first zero*/ + if(j <= 10) /*repeat code 17 supports max 10 zeroes*/ { + bitlen_lld_e[numcodes_lld_e++] = 17; + bitlen_lld_e[numcodes_lld_e++] = j - 3; + } else /*repeat code 18 supports max 138 zeroes*/ { + if(j > 138) j = 138; + bitlen_lld_e[numcodes_lld_e++] = 18; + bitlen_lld_e[numcodes_lld_e++] = j - 11; + } + i += (j - 1); + } else if(j >= 3) /*repeat code for value other than zero*/ { + size_t k; + unsigned num = j / 6u, rest = j % 6u; + bitlen_lld_e[numcodes_lld_e++] = bitlen_lld[i]; + for(k = 0; k < num; ++k) { + bitlen_lld_e[numcodes_lld_e++] = 16; + bitlen_lld_e[numcodes_lld_e++] = 6 - 3; + } + if(rest >= 3) { + bitlen_lld_e[numcodes_lld_e++] = 16; + bitlen_lld_e[numcodes_lld_e++] = rest - 3; + } + else j -= rest; + i += j; + } else /*too short to benefit from repeat code*/ { + bitlen_lld_e[numcodes_lld_e++] = bitlen_lld[i]; + } + } + + /*generate tree_cl, the huffmantree of huffmantrees*/ + for(i = 0; i != numcodes_lld_e; ++i) { + ++frequencies_cl[bitlen_lld_e[i]]; + /*after a repeat code come the bits that specify the number of repetitions, + those don't need to be in the frequencies_cl calculation*/ + if(bitlen_lld_e[i] >= 16) ++i; + } + + error = HuffmanTree_makeFromFrequencies(&tree_cl, frequencies_cl, + NUM_CODE_LENGTH_CODES, NUM_CODE_LENGTH_CODES, 7); + if(error) break; + + /*compute amount of code-length-code-lengths to output*/ + numcodes_cl = NUM_CODE_LENGTH_CODES; + /*trim zeros at the end (using CLCL_ORDER), but minimum size must be 4 (see HCLEN below)*/ + while(numcodes_cl > 4u && tree_cl.lengths[CLCL_ORDER[numcodes_cl - 1u]] == 0) { + numcodes_cl--; + } + + /* + Write everything into the output + + After the BFINAL and BTYPE, the dynamic block consists out of the following: + - 5 bits HLIT, 5 bits HDIST, 4 bits HCLEN + - (HCLEN+4)*3 bits code lengths of code length alphabet + - HLIT + 257 code lengths of lit/length alphabet (encoded using the code length + alphabet, + possible repetition codes 16, 17, 18) + - HDIST + 1 code lengths of distance alphabet (encoded using the code length + alphabet, + possible repetition codes 16, 17, 18) + - compressed data + - 256 (end code) + */ + + /*Write block type*/ + writeBits(writer, BFINAL, 1); + writeBits(writer, 0, 1); /*first bit of BTYPE "dynamic"*/ + writeBits(writer, 1, 1); /*second bit of BTYPE "dynamic"*/ + + /*write the HLIT, HDIST and HCLEN values*/ + /*all three sizes take trimmed ending zeroes into account, done either by HuffmanTree_makeFromFrequencies + or in the loop for numcodes_cl above, which saves space. */ + HLIT = (unsigned)(numcodes_ll - 257); + HDIST = (unsigned)(numcodes_d - 1); + HCLEN = (unsigned)(numcodes_cl - 4); + writeBits(writer, HLIT, 5); + writeBits(writer, HDIST, 5); + writeBits(writer, HCLEN, 4); + + /*write the code lengths of the code length alphabet ("bitlen_cl")*/ + for(i = 0; i != numcodes_cl; ++i) writeBits(writer, tree_cl.lengths[CLCL_ORDER[i]], 3); + + /*write the lengths of the lit/len AND the dist alphabet*/ + for(i = 0; i != numcodes_lld_e; ++i) { + writeBitsReversed(writer, tree_cl.codes[bitlen_lld_e[i]], tree_cl.lengths[bitlen_lld_e[i]]); + /*extra bits of repeat codes*/ + if(bitlen_lld_e[i] == 16) writeBits(writer, bitlen_lld_e[++i], 2); + else if(bitlen_lld_e[i] == 17) writeBits(writer, bitlen_lld_e[++i], 3); + else if(bitlen_lld_e[i] == 18) writeBits(writer, bitlen_lld_e[++i], 7); + } + + /*write the compressed data symbols*/ + writeLZ77data(writer, &lz77_encoded, &tree_ll, &tree_d); + /*error: the length of the end code 256 must be larger than 0*/ + if(tree_ll.lengths[256] == 0) ERROR_BREAK(64); + + /*write the end code*/ + writeBitsReversed(writer, tree_ll.codes[256], tree_ll.lengths[256]); + + break; /*end of error-while*/ + } + + /*cleanup*/ + uivector_cleanup(&lz77_encoded); + HuffmanTree_cleanup(&tree_ll); + HuffmanTree_cleanup(&tree_d); + HuffmanTree_cleanup(&tree_cl); + lodepng_free(frequencies_ll); + lodepng_free(frequencies_d); + lodepng_free(frequencies_cl); + lodepng_free(bitlen_lld); + lodepng_free(bitlen_lld_e); + + return error; +} + +static unsigned deflateFixed(LodePNGBitWriter* writer, Hash* hash, + const unsigned char* data, + size_t datapos, size_t dataend, + const LodePNGCompressSettings* settings, unsigned final) { + HuffmanTree tree_ll; /*tree for literal values and length codes*/ + HuffmanTree tree_d; /*tree for distance codes*/ + + unsigned BFINAL = final; + unsigned error = 0; + size_t i; + + HuffmanTree_init(&tree_ll); + HuffmanTree_init(&tree_d); + + error = generateFixedLitLenTree(&tree_ll); + if(!error) error = generateFixedDistanceTree(&tree_d); + + if(!error) { + writeBits(writer, BFINAL, 1); + writeBits(writer, 1, 1); /*first bit of BTYPE*/ + writeBits(writer, 0, 1); /*second bit of BTYPE*/ + + if(settings->use_lz77) /*LZ77 encoded*/ { + uivector lz77_encoded; + uivector_init(&lz77_encoded); + error = encodeLZ77(&lz77_encoded, hash, data, datapos, dataend, settings->windowsize, + settings->minmatch, settings->nicematch, settings->lazymatching); + if(!error) writeLZ77data(writer, &lz77_encoded, &tree_ll, &tree_d); + uivector_cleanup(&lz77_encoded); + } else /*no LZ77, but still will be Huffman compressed*/ { + for(i = datapos; i < dataend; ++i) { + writeBitsReversed(writer, tree_ll.codes[data[i]], tree_ll.lengths[data[i]]); + } + } + /*add END code*/ + if(!error) writeBitsReversed(writer,tree_ll.codes[256], tree_ll.lengths[256]); + } + + /*cleanup*/ + HuffmanTree_cleanup(&tree_ll); + HuffmanTree_cleanup(&tree_d); + + return error; +} + +static unsigned lodepng_deflatev(ucvector* out, const unsigned char* in, size_t insize, + const LodePNGCompressSettings* settings) { + unsigned error = 0; + size_t i, blocksize, numdeflateblocks; + Hash hash; + LodePNGBitWriter writer; + + LodePNGBitWriter_init(&writer, out); + + if(settings->btype > 2) return 61; + else if(settings->btype == 0) return deflateNoCompression(out, in, insize); + else if(settings->btype == 1) blocksize = insize; + else /*if(settings->btype == 2)*/ { + /*on PNGs, deflate blocks of 65-262k seem to give most dense encoding*/ + blocksize = insize / 8u + 8; + if(blocksize < 65536) blocksize = 65536; + if(blocksize > 262144) blocksize = 262144; + } + + numdeflateblocks = (insize + blocksize - 1) / blocksize; + if(numdeflateblocks == 0) numdeflateblocks = 1; + + error = hash_init(&hash, settings->windowsize); + + if(!error) { + for(i = 0; i != numdeflateblocks && !error; ++i) { + unsigned final = (i == numdeflateblocks - 1); + size_t start = i * blocksize; + size_t end = start + blocksize; + if(end > insize) end = insize; + + if(settings->btype == 1) error = deflateFixed(&writer, &hash, in, start, end, settings, final); + else if(settings->btype == 2) error = deflateDynamic(&writer, &hash, in, start, end, settings, final); + } + } + + hash_cleanup(&hash); + + return error; +} + +unsigned lodepng_deflate(unsigned char** out, size_t* outsize, + const unsigned char* in, size_t insize, + const LodePNGCompressSettings* settings) { + ucvector v = ucvector_init(*out, *outsize); + unsigned error = lodepng_deflatev(&v, in, insize, settings); + *out = v.data; + *outsize = v.size; + return error; +} + +static unsigned deflate(unsigned char** out, size_t* outsize, + const unsigned char* in, size_t insize, + const LodePNGCompressSettings* settings) { + if(settings->custom_deflate) { + return settings->custom_deflate(out, outsize, in, insize, settings); + } else { + return lodepng_deflate(out, outsize, in, insize, settings); + } +} + +#endif /*LODEPNG_COMPILE_DECODER*/ + +/* ////////////////////////////////////////////////////////////////////////// */ +/* / Adler32 / */ +/* ////////////////////////////////////////////////////////////////////////// */ + +static unsigned update_adler32(unsigned adler, const unsigned char* data, unsigned len) { + unsigned s1 = adler & 0xffffu; + unsigned s2 = (adler >> 16u) & 0xffffu; + + while(len != 0u) { + unsigned i; + /*at least 5552 sums can be done before the sums overflow, saving a lot of module divisions*/ + unsigned amount = len > 5552u ? 5552u : len; + len -= amount; + for(i = 0; i != amount; ++i) { + s1 += (*data++); + s2 += s1; + } + s1 %= 65521u; + s2 %= 65521u; + } + + return (s2 << 16u) | s1; +} + +/*Return the adler32 of the bytes data[0..len-1]*/ +static unsigned adler32(const unsigned char* data, unsigned len) { + return update_adler32(1u, data, len); +} + +/* ////////////////////////////////////////////////////////////////////////// */ +/* / Zlib / */ +/* ////////////////////////////////////////////////////////////////////////// */ + +#ifdef LODEPNG_COMPILE_DECODER + +static unsigned lodepng_zlib_decompressv(ucvector* out, + const unsigned char* in, size_t insize, + const LodePNGDecompressSettings* settings) { + unsigned error = 0; + unsigned CM, CINFO, FDICT; + + if(insize < 2) return 53; /*error, size of zlib data too small*/ + /*read information from zlib header*/ + if((in[0] * 256 + in[1]) % 31 != 0) { + /*error: 256 * in[0] + in[1] must be a multiple of 31, the FCHECK value is supposed to be made that way*/ + return 24; + } + + CM = in[0] & 15; + CINFO = (in[0] >> 4) & 15; + /*FCHECK = in[1] & 31;*/ /*FCHECK is already tested above*/ + FDICT = (in[1] >> 5) & 1; + /*FLEVEL = (in[1] >> 6) & 3;*/ /*FLEVEL is not used here*/ + + if(CM != 8 || CINFO > 7) { + /*error: only compression method 8: inflate with sliding window of 32k is supported by the PNG spec*/ + return 25; + } + if(FDICT != 0) { + /*error: the specification of PNG says about the zlib stream: + "The additional flags shall not specify a preset dictionary."*/ + return 26; + } + + error = inflatev(out, in + 2, insize - 2, settings); + if(error) return error; + + if(!settings->ignore_adler32) { + unsigned ADLER32 = lodepng_read32bitInt(&in[insize - 4]); + unsigned checksum = adler32(out->data, (unsigned)(out->size)); + if(checksum != ADLER32) return 58; /*error, adler checksum not correct, data must be corrupted*/ + } + + return 0; /*no error*/ +} + + +unsigned lodepng_zlib_decompress(unsigned char** out, size_t* outsize, const unsigned char* in, + size_t insize, const LodePNGDecompressSettings* settings) { + ucvector v = ucvector_init(*out, *outsize); + unsigned error = lodepng_zlib_decompressv(&v, in, insize, settings); + *out = v.data; + *outsize = v.size; + return error; +} + +/*expected_size is expected output size, to avoid intermediate allocations. Set to 0 if not known. */ +static unsigned zlib_decompress(unsigned char** out, size_t* outsize, size_t expected_size, + const unsigned char* in, size_t insize, const LodePNGDecompressSettings* settings) { + if(settings->custom_zlib) { + return settings->custom_zlib(out, outsize, in, insize, settings); + } else { + unsigned error; + ucvector v = ucvector_init(*out, *outsize); + if(expected_size) { + /*reserve the memory to avoid intermediate reallocations*/ + ucvector_resize(&v, *outsize + expected_size); + v.size = *outsize; + } + error = lodepng_zlib_decompressv(&v, in, insize, settings); + *out = v.data; + *outsize = v.size; + return error; + } +} + +#endif /*LODEPNG_COMPILE_DECODER*/ + +#ifdef LODEPNG_COMPILE_ENCODER + +unsigned lodepng_zlib_compress(unsigned char** out, size_t* outsize, const unsigned char* in, + size_t insize, const LodePNGCompressSettings* settings) { + size_t i; + unsigned error; + unsigned char* deflatedata = 0; + size_t deflatesize = 0; + + error = deflate(&deflatedata, &deflatesize, in, insize, settings); + + *out = NULL; + *outsize = 0; + if(!error) { + *outsize = deflatesize + 6; + *out = (unsigned char*)lodepng_malloc(*outsize); + if(!*out) error = 83; /*alloc fail*/ + } + + if(!error) { + unsigned ADLER32 = adler32(in, (unsigned)insize); + /*zlib data: 1 byte CMF (CM+CINFO), 1 byte FLG, deflate data, 4 byte ADLER32 checksum of the Decompressed data*/ + unsigned CMF = 120; /*0b01111000: CM 8, CINFO 7. With CINFO 7, any window size up to 32768 can be used.*/ + unsigned FLEVEL = 0; + unsigned FDICT = 0; + unsigned CMFFLG = 256 * CMF + FDICT * 32 + FLEVEL * 64; + unsigned FCHECK = 31 - CMFFLG % 31; + CMFFLG += FCHECK; + + (*out)[0] = (unsigned char)(CMFFLG >> 8); + (*out)[1] = (unsigned char)(CMFFLG & 255); + for(i = 0; i != deflatesize; ++i) (*out)[i + 2] = deflatedata[i]; + lodepng_set32bitInt(&(*out)[*outsize - 4], ADLER32); + } + + lodepng_free(deflatedata); + return error; +} + +/* compress using the default or custom zlib function */ +static unsigned zlib_compress(unsigned char** out, size_t* outsize, const unsigned char* in, + size_t insize, const LodePNGCompressSettings* settings) { + if(settings->custom_zlib) { + return settings->custom_zlib(out, outsize, in, insize, settings); + } else { + return lodepng_zlib_compress(out, outsize, in, insize, settings); + } +} + +#endif /*LODEPNG_COMPILE_ENCODER*/ + +#else /*no LODEPNG_COMPILE_ZLIB*/ + +#ifdef LODEPNG_COMPILE_DECODER +static unsigned zlib_decompress(unsigned char** out, size_t* outsize, size_t expected_size, + const unsigned char* in, size_t insize, const LodePNGDecompressSettings* settings) { + if(!settings->custom_zlib) return 87; /*no custom zlib function provided */ + (void)expected_size; + return settings->custom_zlib(out, outsize, in, insize, settings); +} +#endif /*LODEPNG_COMPILE_DECODER*/ +#ifdef LODEPNG_COMPILE_ENCODER +static unsigned zlib_compress(unsigned char** out, size_t* outsize, const unsigned char* in, + size_t insize, const LodePNGCompressSettings* settings) { + if(!settings->custom_zlib) return 87; /*no custom zlib function provided */ + return settings->custom_zlib(out, outsize, in, insize, settings); +} +#endif /*LODEPNG_COMPILE_ENCODER*/ + +#endif /*LODEPNG_COMPILE_ZLIB*/ + +/* ////////////////////////////////////////////////////////////////////////// */ + +#ifdef LODEPNG_COMPILE_ENCODER + +/*this is a good tradeoff between speed and compression ratio*/ +#define DEFAULT_WINDOWSIZE 2048 + +void lodepng_compress_settings_init(LodePNGCompressSettings* settings) { + /*compress with dynamic huffman tree (not in the mathematical sense, just not the predefined one)*/ + settings->btype = 2; + settings->use_lz77 = 1; + settings->windowsize = DEFAULT_WINDOWSIZE; + settings->minmatch = 3; + settings->nicematch = 128; + settings->lazymatching = 1; + + settings->custom_zlib = 0; + settings->custom_deflate = 0; + settings->custom_context = 0; +} + +const LodePNGCompressSettings lodepng_default_compress_settings = {2, 1, DEFAULT_WINDOWSIZE, 3, 128, 1, 0, 0, 0}; + + +#endif /*LODEPNG_COMPILE_ENCODER*/ + +#ifdef LODEPNG_COMPILE_DECODER + +void lodepng_decompress_settings_init(LodePNGDecompressSettings* settings) { + settings->ignore_adler32 = 0; + settings->ignore_nlen = 0; + + settings->custom_zlib = 0; + settings->custom_inflate = 0; + settings->custom_context = 0; +} + +const LodePNGDecompressSettings lodepng_default_decompress_settings = {0, 0, 0, 0, 0}; + +#endif /*LODEPNG_COMPILE_DECODER*/ + +/* ////////////////////////////////////////////////////////////////////////// */ +/* ////////////////////////////////////////////////////////////////////////// */ +/* // End of Zlib related code. Begin of PNG related code. // */ +/* ////////////////////////////////////////////////////////////////////////// */ +/* ////////////////////////////////////////////////////////////////////////// */ + +#ifdef LODEPNG_COMPILE_PNG + +/* ////////////////////////////////////////////////////////////////////////// */ +/* / CRC32 / */ +/* ////////////////////////////////////////////////////////////////////////// */ + + +#ifndef LODEPNG_NO_COMPILE_CRC +/* CRC polynomial: 0xedb88320 */ +static unsigned lodepng_crc32_table[256] = { + 0u, 1996959894u, 3993919788u, 2567524794u, 124634137u, 1886057615u, 3915621685u, 2657392035u, + 249268274u, 2044508324u, 3772115230u, 2547177864u, 162941995u, 2125561021u, 3887607047u, 2428444049u, + 498536548u, 1789927666u, 4089016648u, 2227061214u, 450548861u, 1843258603u, 4107580753u, 2211677639u, + 325883990u, 1684777152u, 4251122042u, 2321926636u, 335633487u, 1661365465u, 4195302755u, 2366115317u, + 997073096u, 1281953886u, 3579855332u, 2724688242u, 1006888145u, 1258607687u, 3524101629u, 2768942443u, + 901097722u, 1119000684u, 3686517206u, 2898065728u, 853044451u, 1172266101u, 3705015759u, 2882616665u, + 651767980u, 1373503546u, 3369554304u, 3218104598u, 565507253u, 1454621731u, 3485111705u, 3099436303u, + 671266974u, 1594198024u, 3322730930u, 2970347812u, 795835527u, 1483230225u, 3244367275u, 3060149565u, + 1994146192u, 31158534u, 2563907772u, 4023717930u, 1907459465u, 112637215u, 2680153253u, 3904427059u, + 2013776290u, 251722036u, 2517215374u, 3775830040u, 2137656763u, 141376813u, 2439277719u, 3865271297u, + 1802195444u, 476864866u, 2238001368u, 4066508878u, 1812370925u, 453092731u, 2181625025u, 4111451223u, + 1706088902u, 314042704u, 2344532202u, 4240017532u, 1658658271u, 366619977u, 2362670323u, 4224994405u, + 1303535960u, 984961486u, 2747007092u, 3569037538u, 1256170817u, 1037604311u, 2765210733u, 3554079995u, + 1131014506u, 879679996u, 2909243462u, 3663771856u, 1141124467u, 855842277u, 2852801631u, 3708648649u, + 1342533948u, 654459306u, 3188396048u, 3373015174u, 1466479909u, 544179635u, 3110523913u, 3462522015u, + 1591671054u, 702138776u, 2966460450u, 3352799412u, 1504918807u, 783551873u, 3082640443u, 3233442989u, + 3988292384u, 2596254646u, 62317068u, 1957810842u, 3939845945u, 2647816111u, 81470997u, 1943803523u, + 3814918930u, 2489596804u, 225274430u, 2053790376u, 3826175755u, 2466906013u, 167816743u, 2097651377u, + 4027552580u, 2265490386u, 503444072u, 1762050814u, 4150417245u, 2154129355u, 426522225u, 1852507879u, + 4275313526u, 2312317920u, 282753626u, 1742555852u, 4189708143u, 2394877945u, 397917763u, 1622183637u, + 3604390888u, 2714866558u, 953729732u, 1340076626u, 3518719985u, 2797360999u, 1068828381u, 1219638859u, + 3624741850u, 2936675148u, 906185462u, 1090812512u, 3747672003u, 2825379669u, 829329135u, 1181335161u, + 3412177804u, 3160834842u, 628085408u, 1382605366u, 3423369109u, 3138078467u, 570562233u, 1426400815u, + 3317316542u, 2998733608u, 733239954u, 1555261956u, 3268935591u, 3050360625u, 752459403u, 1541320221u, + 2607071920u, 3965973030u, 1969922972u, 40735498u, 2617837225u, 3943577151u, 1913087877u, 83908371u, + 2512341634u, 3803740692u, 2075208622u, 213261112u, 2463272603u, 3855990285u, 2094854071u, 198958881u, + 2262029012u, 4057260610u, 1759359992u, 534414190u, 2176718541u, 4139329115u, 1873836001u, 414664567u, + 2282248934u, 4279200368u, 1711684554u, 285281116u, 2405801727u, 4167216745u, 1634467795u, 376229701u, + 2685067896u, 3608007406u, 1308918612u, 956543938u, 2808555105u, 3495958263u, 1231636301u, 1047427035u, + 2932959818u, 3654703836u, 1088359270u, 936918000u, 2847714899u, 3736837829u, 1202900863u, 817233897u, + 3183342108u, 3401237130u, 1404277552u, 615818150u, 3134207493u, 3453421203u, 1423857449u, 601450431u, + 3009837614u, 3294710456u, 1567103746u, 711928724u, 3020668471u, 3272380065u, 1510334235u, 755167117u +}; + +/*Return the CRC of the bytes buf[0..len-1].*/ +unsigned lodepng_crc32(const unsigned char* data, size_t length) { + unsigned r = 0xffffffffu; + size_t i; + for(i = 0; i < length; ++i) { + r = lodepng_crc32_table[(r ^ data[i]) & 0xffu] ^ (r >> 8u); + } + return r ^ 0xffffffffu; +} +#else /* !LODEPNG_NO_COMPILE_CRC */ +unsigned lodepng_crc32(const unsigned char* data, size_t length); +#endif /* !LODEPNG_NO_COMPILE_CRC */ + +/* ////////////////////////////////////////////////////////////////////////// */ +/* / Reading and writing PNG color channel bits / */ +/* ////////////////////////////////////////////////////////////////////////// */ + +/* The color channel bits of less-than-8-bit pixels are read with the MSB of bytes first, +so LodePNGBitWriter and LodePNGBitReader can't be used for those. */ + +static unsigned char readBitFromReversedStream(size_t* bitpointer, const unsigned char* bitstream) { + unsigned char result = (unsigned char)((bitstream[(*bitpointer) >> 3] >> (7 - ((*bitpointer) & 0x7))) & 1); + ++(*bitpointer); + return result; +} + +/* TODO: make this faster */ +static unsigned readBitsFromReversedStream(size_t* bitpointer, const unsigned char* bitstream, size_t nbits) { + unsigned result = 0; + size_t i; + for(i = 0 ; i < nbits; ++i) { + result <<= 1u; + result |= (unsigned)readBitFromReversedStream(bitpointer, bitstream); + } + return result; +} + +static void setBitOfReversedStream(size_t* bitpointer, unsigned char* bitstream, unsigned char bit) { + /*the current bit in bitstream may be 0 or 1 for this to work*/ + if(bit == 0) bitstream[(*bitpointer) >> 3u] &= (unsigned char)(~(1u << (7u - ((*bitpointer) & 7u)))); + else bitstream[(*bitpointer) >> 3u] |= (1u << (7u - ((*bitpointer) & 7u))); + ++(*bitpointer); +} + +/* ////////////////////////////////////////////////////////////////////////// */ +/* / PNG chunks / */ +/* ////////////////////////////////////////////////////////////////////////// */ + +unsigned lodepng_chunk_length(const unsigned char* chunk) { + return lodepng_read32bitInt(&chunk[0]); +} + +void lodepng_chunk_type(char type[5], const unsigned char* chunk) { + unsigned i; + for(i = 0; i != 4; ++i) type[i] = (char)chunk[4 + i]; + type[4] = 0; /*null termination char*/ +} + +unsigned char lodepng_chunk_type_equals(const unsigned char* chunk, const char* type) { + if(lodepng_strlen(type) != 4) return 0; + return (chunk[4] == type[0] && chunk[5] == type[1] && chunk[6] == type[2] && chunk[7] == type[3]); +} + +unsigned char lodepng_chunk_ancillary(const unsigned char* chunk) { + return((chunk[4] & 32) != 0); +} + +unsigned char lodepng_chunk_private(const unsigned char* chunk) { + return((chunk[6] & 32) != 0); +} + +unsigned char lodepng_chunk_safetocopy(const unsigned char* chunk) { + return((chunk[7] & 32) != 0); +} + +unsigned char* lodepng_chunk_data(unsigned char* chunk) { + return &chunk[8]; +} + +const unsigned char* lodepng_chunk_data_const(const unsigned char* chunk) { + return &chunk[8]; +} + +unsigned lodepng_chunk_check_crc(const unsigned char* chunk) { + unsigned length = lodepng_chunk_length(chunk); + unsigned CRC = lodepng_read32bitInt(&chunk[length + 8]); + /*the CRC is taken of the data and the 4 chunk type letters, not the length*/ + unsigned checksum = lodepng_crc32(&chunk[4], length + 4); + if(CRC != checksum) return 1; + else return 0; +} + +void lodepng_chunk_generate_crc(unsigned char* chunk) { + unsigned length = lodepng_chunk_length(chunk); + unsigned CRC = lodepng_crc32(&chunk[4], length + 4); + lodepng_set32bitInt(chunk + 8 + length, CRC); +} + +unsigned char* lodepng_chunk_next(unsigned char* chunk, unsigned char* end) { + if(chunk >= end || end - chunk < 12) return end; /*too small to contain a chunk*/ + if(chunk[0] == 0x89 && chunk[1] == 0x50 && chunk[2] == 0x4e && chunk[3] == 0x47 + && chunk[4] == 0x0d && chunk[5] == 0x0a && chunk[6] == 0x1a && chunk[7] == 0x0a) { + /* Is PNG magic header at start of PNG file. Jump to first actual chunk. */ + return chunk + 8; + } else { + size_t total_chunk_length; + unsigned char* result; + if(lodepng_addofl(lodepng_chunk_length(chunk), 12, &total_chunk_length)) return end; + result = chunk + total_chunk_length; + if(result < chunk) return end; /*pointer overflow*/ + return result; + } +} + +const unsigned char* lodepng_chunk_next_const(const unsigned char* chunk, const unsigned char* end) { + if(chunk >= end || end - chunk < 12) return end; /*too small to contain a chunk*/ + if(chunk[0] == 0x89 && chunk[1] == 0x50 && chunk[2] == 0x4e && chunk[3] == 0x47 + && chunk[4] == 0x0d && chunk[5] == 0x0a && chunk[6] == 0x1a && chunk[7] == 0x0a) { + /* Is PNG magic header at start of PNG file. Jump to first actual chunk. */ + return chunk + 8; + } else { + size_t total_chunk_length; + const unsigned char* result; + if(lodepng_addofl(lodepng_chunk_length(chunk), 12, &total_chunk_length)) return end; + result = chunk + total_chunk_length; + if(result < chunk) return end; /*pointer overflow*/ + return result; + } +} + +unsigned char* lodepng_chunk_find(unsigned char* chunk, unsigned char* end, const char type[5]) { + for(;;) { + if(chunk >= end || end - chunk < 12) return 0; /* past file end: chunk + 12 > end */ + if(lodepng_chunk_type_equals(chunk, type)) return chunk; + chunk = lodepng_chunk_next(chunk, end); + } +} + +const unsigned char* lodepng_chunk_find_const(const unsigned char* chunk, const unsigned char* end, const char type[5]) { + for(;;) { + if(chunk >= end || end - chunk < 12) return 0; /* past file end: chunk + 12 > end */ + if(lodepng_chunk_type_equals(chunk, type)) return chunk; + chunk = lodepng_chunk_next_const(chunk, end); + } +} + +unsigned lodepng_chunk_append(unsigned char** out, size_t* outsize, const unsigned char* chunk) { + unsigned i; + size_t total_chunk_length, new_length; + unsigned char *chunk_start, *new_buffer; + + if(lodepng_addofl(lodepng_chunk_length(chunk), 12, &total_chunk_length)) return 77; + if(lodepng_addofl(*outsize, total_chunk_length, &new_length)) return 77; + + new_buffer = (unsigned char*)lodepng_realloc(*out, new_length); + if(!new_buffer) return 83; /*alloc fail*/ + (*out) = new_buffer; + (*outsize) = new_length; + chunk_start = &(*out)[new_length - total_chunk_length]; + + for(i = 0; i != total_chunk_length; ++i) chunk_start[i] = chunk[i]; + + return 0; +} + +/*Sets length and name and allocates the space for data and crc but does not +set data or crc yet. Returns the start of the chunk in chunk. The start of +the data is at chunk + 8. To finalize chunk, add the data, then use +lodepng_chunk_generate_crc */ +static unsigned lodepng_chunk_init(unsigned char** chunk, + ucvector* out, + unsigned length, const char* type) { + size_t new_length = out->size; + if(lodepng_addofl(new_length, length, &new_length)) return 77; + if(lodepng_addofl(new_length, 12, &new_length)) return 77; + if(!ucvector_resize(out, new_length)) return 83; /*alloc fail*/ + *chunk = out->data + new_length - length - 12u; + + /*1: length*/ + lodepng_set32bitInt(*chunk, length); + + /*2: chunk name (4 letters)*/ + lodepng_memcpy(*chunk + 4, type, 4); + + return 0; +} + +/* like lodepng_chunk_create but with custom allocsize */ +static unsigned lodepng_chunk_createv(ucvector* out, + unsigned length, const char* type, const unsigned char* data) { + unsigned char* chunk; + CERROR_TRY_RETURN(lodepng_chunk_init(&chunk, out, length, type)); + + /*3: the data*/ + lodepng_memcpy(chunk + 8, data, length); + + /*4: CRC (of the chunkname characters and the data)*/ + lodepng_chunk_generate_crc(chunk); + + return 0; +} + +unsigned lodepng_chunk_create(unsigned char** out, size_t* outsize, + unsigned length, const char* type, const unsigned char* data) { + ucvector v = ucvector_init(*out, *outsize); + unsigned error = lodepng_chunk_createv(&v, length, type, data); + *out = v.data; + *outsize = v.size; + return error; +} + +/* ////////////////////////////////////////////////////////////////////////// */ +/* / Color types, channels, bits / */ +/* ////////////////////////////////////////////////////////////////////////// */ + +/*checks if the colortype is valid and the bitdepth bd is allowed for this colortype. +Return value is a LodePNG error code.*/ +static unsigned checkColorValidity(LodePNGColorType colortype, unsigned bd) { + switch(colortype) { + case LCT_GREY: if(!(bd == 1 || bd == 2 || bd == 4 || bd == 8 || bd == 16)) return 37; break; + case LCT_RGB: if(!( bd == 8 || bd == 16)) return 37; break; + case LCT_PALETTE: if(!(bd == 1 || bd == 2 || bd == 4 || bd == 8 )) return 37; break; + case LCT_GREY_ALPHA: if(!( bd == 8 || bd == 16)) return 37; break; + case LCT_RGBA: if(!( bd == 8 || bd == 16)) return 37; break; + case LCT_MAX_OCTET_VALUE: return 31; /* invalid color type */ + default: return 31; /* invalid color type */ + } + return 0; /*allowed color type / bits combination*/ +} + +static unsigned getNumColorChannels(LodePNGColorType colortype) { + switch(colortype) { + case LCT_GREY: return 1; + case LCT_RGB: return 3; + case LCT_PALETTE: return 1; + case LCT_GREY_ALPHA: return 2; + case LCT_RGBA: return 4; + case LCT_MAX_OCTET_VALUE: return 0; /* invalid color type */ + default: return 0; /*invalid color type*/ + } +} + +static unsigned lodepng_get_bpp_lct(LodePNGColorType colortype, unsigned bitdepth) { + /*bits per pixel is amount of channels * bits per channel*/ + return getNumColorChannels(colortype) * bitdepth; +} + +/* ////////////////////////////////////////////////////////////////////////// */ + +void lodepng_color_mode_init(LodePNGColorMode* info) { + info->key_defined = 0; + info->key_r = info->key_g = info->key_b = 0; + info->colortype = LCT_RGBA; + info->bitdepth = 8; + info->palette = 0; + info->palettesize = 0; +} + +/*allocates palette memory if needed, and initializes all colors to black*/ +static void lodepng_color_mode_alloc_palette(LodePNGColorMode* info) { + size_t i; + /*if the palette is already allocated, it will have size 1024 so no reallocation needed in that case*/ + /*the palette must have room for up to 256 colors with 4 bytes each.*/ + if(!info->palette) info->palette = (unsigned char*)lodepng_malloc(1024); + if(!info->palette) return; /*alloc fail*/ + for(i = 0; i != 256; ++i) { + /*Initialize all unused colors with black, the value used for invalid palette indices. + This is an error according to the PNG spec, but common PNG decoders make it black instead. + That makes color conversion slightly faster due to no error handling needed.*/ + info->palette[i * 4 + 0] = 0; + info->palette[i * 4 + 1] = 0; + info->palette[i * 4 + 2] = 0; + info->palette[i * 4 + 3] = 255; + } +} + +void lodepng_color_mode_cleanup(LodePNGColorMode* info) { + lodepng_palette_clear(info); +} + +unsigned lodepng_color_mode_copy(LodePNGColorMode* dest, const LodePNGColorMode* source) { + lodepng_color_mode_cleanup(dest); + lodepng_memcpy(dest, source, sizeof(LodePNGColorMode)); + if(source->palette) { + dest->palette = (unsigned char*)lodepng_malloc(1024); + if(!dest->palette && source->palettesize) return 83; /*alloc fail*/ + lodepng_memcpy(dest->palette, source->palette, source->palettesize * 4); + } + return 0; +} + +LodePNGColorMode lodepng_color_mode_make(LodePNGColorType colortype, unsigned bitdepth) { + LodePNGColorMode result; + lodepng_color_mode_init(&result); + result.colortype = colortype; + result.bitdepth = bitdepth; + return result; +} + +static int lodepng_color_mode_equal(const LodePNGColorMode* a, const LodePNGColorMode* b) { + size_t i; + if(a->colortype != b->colortype) return 0; + if(a->bitdepth != b->bitdepth) return 0; + if(a->key_defined != b->key_defined) return 0; + if(a->key_defined) { + if(a->key_r != b->key_r) return 0; + if(a->key_g != b->key_g) return 0; + if(a->key_b != b->key_b) return 0; + } + if(a->palettesize != b->palettesize) return 0; + for(i = 0; i != a->palettesize * 4; ++i) { + if(a->palette[i] != b->palette[i]) return 0; + } + return 1; +} + +void lodepng_palette_clear(LodePNGColorMode* info) { + if(info->palette) lodepng_free(info->palette); + info->palette = 0; + info->palettesize = 0; +} + +unsigned lodepng_palette_add(LodePNGColorMode* info, + unsigned char r, unsigned char g, unsigned char b, unsigned char a) { + if(!info->palette) /*allocate palette if empty*/ { + lodepng_color_mode_alloc_palette(info); + if(!info->palette) return 83; /*alloc fail*/ + } + if(info->palettesize >= 256) { + return 108; /*too many palette values*/ + } + info->palette[4 * info->palettesize + 0] = r; + info->palette[4 * info->palettesize + 1] = g; + info->palette[4 * info->palettesize + 2] = b; + info->palette[4 * info->palettesize + 3] = a; + ++info->palettesize; + return 0; +} + +/*calculate bits per pixel out of colortype and bitdepth*/ +unsigned lodepng_get_bpp(const LodePNGColorMode* info) { + return lodepng_get_bpp_lct(info->colortype, info->bitdepth); +} + +unsigned lodepng_get_channels(const LodePNGColorMode* info) { + return getNumColorChannels(info->colortype); +} + +unsigned lodepng_is_greyscale_type(const LodePNGColorMode* info) { + return info->colortype == LCT_GREY || info->colortype == LCT_GREY_ALPHA; +} + +unsigned lodepng_is_alpha_type(const LodePNGColorMode* info) { + return (info->colortype & 4) != 0; /*4 or 6*/ +} + +unsigned lodepng_is_palette_type(const LodePNGColorMode* info) { + return info->colortype == LCT_PALETTE; +} + +unsigned lodepng_has_palette_alpha(const LodePNGColorMode* info) { + size_t i; + for(i = 0; i != info->palettesize; ++i) { + if(info->palette[i * 4 + 3] < 255) return 1; + } + return 0; +} + +unsigned lodepng_can_have_alpha(const LodePNGColorMode* info) { + return info->key_defined + || lodepng_is_alpha_type(info) + || lodepng_has_palette_alpha(info); +} + +static size_t lodepng_get_raw_size_lct(unsigned w, unsigned h, LodePNGColorType colortype, unsigned bitdepth) { + size_t bpp = lodepng_get_bpp_lct(colortype, bitdepth); + size_t n = (size_t)w * (size_t)h; + return ((n / 8u) * bpp) + ((n & 7u) * bpp + 7u) / 8u; +} + +size_t lodepng_get_raw_size(unsigned w, unsigned h, const LodePNGColorMode* color) { + return lodepng_get_raw_size_lct(w, h, color->colortype, color->bitdepth); +} + + +#ifdef LODEPNG_COMPILE_PNG + +/*in an idat chunk, each scanline is a multiple of 8 bits, unlike the lodepng output buffer, +and in addition has one extra byte per line: the filter byte. So this gives a larger +result than lodepng_get_raw_size. Set h to 1 to get the size of 1 row including filter byte. */ +static size_t lodepng_get_raw_size_idat(unsigned w, unsigned h, unsigned bpp) { + /* + 1 for the filter byte, and possibly plus padding bits per line. */ + /* Ignoring casts, the expression is equal to (w * bpp + 7) / 8 + 1, but avoids overflow of w * bpp */ + size_t line = ((size_t)(w / 8u) * bpp) + 1u + ((w & 7u) * bpp + 7u) / 8u; + return (size_t)h * line; +} + +#ifdef LODEPNG_COMPILE_DECODER +/*Safely checks whether size_t overflow can be caused due to amount of pixels. +This check is overcautious rather than precise. If this check indicates no overflow, +you can safely compute in a size_t (but not an unsigned): +-(size_t)w * (size_t)h * 8 +-amount of bytes in IDAT (including filter, padding and Adam7 bytes) +-amount of bytes in raw color model +Returns 1 if overflow possible, 0 if not. +*/ +static int lodepng_pixel_overflow(unsigned w, unsigned h, + const LodePNGColorMode* pngcolor, const LodePNGColorMode* rawcolor) { + size_t bpp = LODEPNG_MAX(lodepng_get_bpp(pngcolor), lodepng_get_bpp(rawcolor)); + size_t numpixels, total; + size_t line; /* bytes per line in worst case */ + + if(lodepng_mulofl((size_t)w, (size_t)h, &numpixels)) return 1; + if(lodepng_mulofl(numpixels, 8, &total)) return 1; /* bit pointer with 8-bit color, or 8 bytes per channel color */ + + /* Bytes per scanline with the expression "(w / 8u) * bpp) + ((w & 7u) * bpp + 7u) / 8u" */ + if(lodepng_mulofl((size_t)(w / 8u), bpp, &line)) return 1; + if(lodepng_addofl(line, ((w & 7u) * bpp + 7u) / 8u, &line)) return 1; + + if(lodepng_addofl(line, 5, &line)) return 1; /* 5 bytes overhead per line: 1 filterbyte, 4 for Adam7 worst case */ + if(lodepng_mulofl(line, h, &total)) return 1; /* Total bytes in worst case */ + + return 0; /* no overflow */ +} +#endif /*LODEPNG_COMPILE_DECODER*/ +#endif /*LODEPNG_COMPILE_PNG*/ + +#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS + +static void LodePNGUnknownChunks_init(LodePNGInfo* info) { + unsigned i; + for(i = 0; i != 3; ++i) info->unknown_chunks_data[i] = 0; + for(i = 0; i != 3; ++i) info->unknown_chunks_size[i] = 0; +} + +static void LodePNGUnknownChunks_cleanup(LodePNGInfo* info) { + unsigned i; + for(i = 0; i != 3; ++i) lodepng_free(info->unknown_chunks_data[i]); +} + +static unsigned LodePNGUnknownChunks_copy(LodePNGInfo* dest, const LodePNGInfo* src) { + unsigned i; + + LodePNGUnknownChunks_cleanup(dest); + + for(i = 0; i != 3; ++i) { + size_t j; + dest->unknown_chunks_size[i] = src->unknown_chunks_size[i]; + dest->unknown_chunks_data[i] = (unsigned char*)lodepng_malloc(src->unknown_chunks_size[i]); + if(!dest->unknown_chunks_data[i] && dest->unknown_chunks_size[i]) return 83; /*alloc fail*/ + for(j = 0; j < src->unknown_chunks_size[i]; ++j) { + dest->unknown_chunks_data[i][j] = src->unknown_chunks_data[i][j]; + } + } + + return 0; +} + +/******************************************************************************/ + +static void LodePNGText_init(LodePNGInfo* info) { + info->text_num = 0; + info->text_keys = NULL; + info->text_strings = NULL; +} + +static void LodePNGText_cleanup(LodePNGInfo* info) { + size_t i; + for(i = 0; i != info->text_num; ++i) { + string_cleanup(&info->text_keys[i]); + string_cleanup(&info->text_strings[i]); + } + lodepng_free(info->text_keys); + lodepng_free(info->text_strings); +} + +static unsigned LodePNGText_copy(LodePNGInfo* dest, const LodePNGInfo* source) { + size_t i = 0; + dest->text_keys = 0; + dest->text_strings = 0; + dest->text_num = 0; + for(i = 0; i != source->text_num; ++i) { + CERROR_TRY_RETURN(lodepng_add_text(dest, source->text_keys[i], source->text_strings[i])); + } + return 0; +} + +static unsigned lodepng_add_text_sized(LodePNGInfo* info, const char* key, const char* str, size_t size) { + char** new_keys = (char**)(lodepng_realloc(info->text_keys, sizeof(char*) * (info->text_num + 1))); + char** new_strings = (char**)(lodepng_realloc(info->text_strings, sizeof(char*) * (info->text_num + 1))); + + if(new_keys) info->text_keys = new_keys; + if(new_strings) info->text_strings = new_strings; + + if(!new_keys || !new_strings) return 83; /*alloc fail*/ + + ++info->text_num; + info->text_keys[info->text_num - 1] = alloc_string(key); + info->text_strings[info->text_num - 1] = alloc_string_sized(str, size); + if(!info->text_keys[info->text_num - 1] || !info->text_strings[info->text_num - 1]) return 83; /*alloc fail*/ + + return 0; +} + +unsigned lodepng_add_text(LodePNGInfo* info, const char* key, const char* str) { + return lodepng_add_text_sized(info, key, str, lodepng_strlen(str)); +} + +void lodepng_clear_text(LodePNGInfo* info) { + LodePNGText_cleanup(info); +} + +/******************************************************************************/ + +static void LodePNGIText_init(LodePNGInfo* info) { + info->itext_num = 0; + info->itext_keys = NULL; + info->itext_langtags = NULL; + info->itext_transkeys = NULL; + info->itext_strings = NULL; +} + +static void LodePNGIText_cleanup(LodePNGInfo* info) { + size_t i; + for(i = 0; i != info->itext_num; ++i) { + string_cleanup(&info->itext_keys[i]); + string_cleanup(&info->itext_langtags[i]); + string_cleanup(&info->itext_transkeys[i]); + string_cleanup(&info->itext_strings[i]); + } + lodepng_free(info->itext_keys); + lodepng_free(info->itext_langtags); + lodepng_free(info->itext_transkeys); + lodepng_free(info->itext_strings); +} + +static unsigned LodePNGIText_copy(LodePNGInfo* dest, const LodePNGInfo* source) { + size_t i = 0; + dest->itext_keys = 0; + dest->itext_langtags = 0; + dest->itext_transkeys = 0; + dest->itext_strings = 0; + dest->itext_num = 0; + for(i = 0; i != source->itext_num; ++i) { + CERROR_TRY_RETURN(lodepng_add_itext(dest, source->itext_keys[i], source->itext_langtags[i], + source->itext_transkeys[i], source->itext_strings[i])); + } + return 0; +} + +void lodepng_clear_itext(LodePNGInfo* info) { + LodePNGIText_cleanup(info); +} + +static unsigned lodepng_add_itext_sized(LodePNGInfo* info, const char* key, const char* langtag, + const char* transkey, const char* str, size_t size) { + char** new_keys = (char**)(lodepng_realloc(info->itext_keys, sizeof(char*) * (info->itext_num + 1))); + char** new_langtags = (char**)(lodepng_realloc(info->itext_langtags, sizeof(char*) * (info->itext_num + 1))); + char** new_transkeys = (char**)(lodepng_realloc(info->itext_transkeys, sizeof(char*) * (info->itext_num + 1))); + char** new_strings = (char**)(lodepng_realloc(info->itext_strings, sizeof(char*) * (info->itext_num + 1))); + + if(new_keys) info->itext_keys = new_keys; + if(new_langtags) info->itext_langtags = new_langtags; + if(new_transkeys) info->itext_transkeys = new_transkeys; + if(new_strings) info->itext_strings = new_strings; + + if(!new_keys || !new_langtags || !new_transkeys || !new_strings) return 83; /*alloc fail*/ + + ++info->itext_num; + + info->itext_keys[info->itext_num - 1] = alloc_string(key); + info->itext_langtags[info->itext_num - 1] = alloc_string(langtag); + info->itext_transkeys[info->itext_num - 1] = alloc_string(transkey); + info->itext_strings[info->itext_num - 1] = alloc_string_sized(str, size); + + return 0; +} + +unsigned lodepng_add_itext(LodePNGInfo* info, const char* key, const char* langtag, + const char* transkey, const char* str) { + return lodepng_add_itext_sized(info, key, langtag, transkey, str, lodepng_strlen(str)); +} + +/* same as set but does not delete */ +static unsigned lodepng_assign_icc(LodePNGInfo* info, const char* name, const unsigned char* profile, unsigned profile_size) { + if(profile_size == 0) return 100; /*invalid ICC profile size*/ + + info->iccp_name = alloc_string(name); + info->iccp_profile = (unsigned char*)lodepng_malloc(profile_size); + + if(!info->iccp_name || !info->iccp_profile) return 83; /*alloc fail*/ + + lodepng_memcpy(info->iccp_profile, profile, profile_size); + info->iccp_profile_size = profile_size; + + return 0; /*ok*/ +} + +unsigned lodepng_set_icc(LodePNGInfo* info, const char* name, const unsigned char* profile, unsigned profile_size) { + if(info->iccp_name) lodepng_clear_icc(info); + info->iccp_defined = 1; + + return lodepng_assign_icc(info, name, profile, profile_size); +} + +void lodepng_clear_icc(LodePNGInfo* info) { + string_cleanup(&info->iccp_name); + lodepng_free(info->iccp_profile); + info->iccp_profile = NULL; + info->iccp_profile_size = 0; + info->iccp_defined = 0; +} +#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ + +void lodepng_info_init(LodePNGInfo* info) { + lodepng_color_mode_init(&info->color); + info->interlace_method = 0; + info->compression_method = 0; + info->filter_method = 0; +#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS + info->background_defined = 0; + info->background_r = info->background_g = info->background_b = 0; + + LodePNGText_init(info); + LodePNGIText_init(info); + + info->time_defined = 0; + info->phys_defined = 0; + + info->gama_defined = 0; + info->chrm_defined = 0; + info->srgb_defined = 0; + info->iccp_defined = 0; + info->iccp_name = NULL; + info->iccp_profile = NULL; + + LodePNGUnknownChunks_init(info); +#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ +} + +void lodepng_info_cleanup(LodePNGInfo* info) { + lodepng_color_mode_cleanup(&info->color); +#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS + LodePNGText_cleanup(info); + LodePNGIText_cleanup(info); + + lodepng_clear_icc(info); + + LodePNGUnknownChunks_cleanup(info); +#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ +} + +unsigned lodepng_info_copy(LodePNGInfo* dest, const LodePNGInfo* source) { + lodepng_info_cleanup(dest); + lodepng_memcpy(dest, source, sizeof(LodePNGInfo)); + lodepng_color_mode_init(&dest->color); + CERROR_TRY_RETURN(lodepng_color_mode_copy(&dest->color, &source->color)); + +#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS + CERROR_TRY_RETURN(LodePNGText_copy(dest, source)); + CERROR_TRY_RETURN(LodePNGIText_copy(dest, source)); + if(source->iccp_defined) { + CERROR_TRY_RETURN(lodepng_assign_icc(dest, source->iccp_name, source->iccp_profile, source->iccp_profile_size)); + } + + LodePNGUnknownChunks_init(dest); + CERROR_TRY_RETURN(LodePNGUnknownChunks_copy(dest, source)); +#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ + return 0; +} + +/* ////////////////////////////////////////////////////////////////////////// */ + +/*index: bitgroup index, bits: bitgroup size(1, 2 or 4), in: bitgroup value, out: octet array to add bits to*/ +static void addColorBits(unsigned char* out, size_t index, unsigned bits, unsigned in) { + unsigned m = bits == 1 ? 7 : bits == 2 ? 3 : 1; /*8 / bits - 1*/ + /*p = the partial index in the byte, e.g. with 4 palettebits it is 0 for first half or 1 for second half*/ + unsigned p = index & m; + in &= (1u << bits) - 1u; /*filter out any other bits of the input value*/ + in = in << (bits * (m - p)); + if(p == 0) out[index * bits / 8u] = in; + else out[index * bits / 8u] |= in; +} + +typedef struct ColorTree ColorTree; + +/* +One node of a color tree +This is the data structure used to count the number of unique colors and to get a palette +index for a color. It's like an octree, but because the alpha channel is used too, each +node has 16 instead of 8 children. +*/ +struct ColorTree { + ColorTree* children[16]; /*up to 16 pointers to ColorTree of next level*/ + int index; /*the payload. Only has a meaningful value if this is in the last level*/ +}; + +static void color_tree_init(ColorTree* tree) { + lodepng_memset(tree->children, 0, 16 * sizeof(*tree->children)); + tree->index = -1; +} + +static void color_tree_cleanup(ColorTree* tree) { + int i; + for(i = 0; i != 16; ++i) { + if(tree->children[i]) { + color_tree_cleanup(tree->children[i]); + lodepng_free(tree->children[i]); + } + } +} + +/*returns -1 if color not present, its index otherwise*/ +static int color_tree_get(ColorTree* tree, unsigned char r, unsigned char g, unsigned char b, unsigned char a) { + int bit = 0; + for(bit = 0; bit < 8; ++bit) { + int i = 8 * ((r >> bit) & 1) + 4 * ((g >> bit) & 1) + 2 * ((b >> bit) & 1) + 1 * ((a >> bit) & 1); + if(!tree->children[i]) return -1; + else tree = tree->children[i]; + } + return tree ? tree->index : -1; +} + +#ifdef LODEPNG_COMPILE_ENCODER +static int color_tree_has(ColorTree* tree, unsigned char r, unsigned char g, unsigned char b, unsigned char a) { + return color_tree_get(tree, r, g, b, a) >= 0; +} +#endif /*LODEPNG_COMPILE_ENCODER*/ + +/*color is not allowed to already exist. +Index should be >= 0 (it's signed to be compatible with using -1 for "doesn't exist") +Returns error code, or 0 if ok*/ +static unsigned color_tree_add(ColorTree* tree, + unsigned char r, unsigned char g, unsigned char b, unsigned char a, unsigned index) { + int bit; + for(bit = 0; bit < 8; ++bit) { + int i = 8 * ((r >> bit) & 1) + 4 * ((g >> bit) & 1) + 2 * ((b >> bit) & 1) + 1 * ((a >> bit) & 1); + if(!tree->children[i]) { + tree->children[i] = (ColorTree*)lodepng_malloc(sizeof(ColorTree)); + if(!tree->children[i]) return 83; /*alloc fail*/ + color_tree_init(tree->children[i]); + } + tree = tree->children[i]; + } + tree->index = (int)index; + return 0; +} + +/*put a pixel, given its RGBA color, into image of any color type*/ +static unsigned rgba8ToPixel(unsigned char* out, size_t i, + const LodePNGColorMode* mode, ColorTree* tree /*for palette*/, + unsigned char r, unsigned char g, unsigned char b, unsigned char a) { + if(mode->colortype == LCT_GREY) { + unsigned char gray = r; /*((unsigned short)r + g + b) / 3u;*/ + if(mode->bitdepth == 8) out[i] = gray; + else if(mode->bitdepth == 16) out[i * 2 + 0] = out[i * 2 + 1] = gray; + else { + /*take the most significant bits of gray*/ + gray = ((unsigned)gray >> (8u - mode->bitdepth)) & ((1u << mode->bitdepth) - 1u); + addColorBits(out, i, mode->bitdepth, gray); + } + } else if(mode->colortype == LCT_RGB) { + if(mode->bitdepth == 8) { + out[i * 3 + 0] = r; + out[i * 3 + 1] = g; + out[i * 3 + 2] = b; + } else { + out[i * 6 + 0] = out[i * 6 + 1] = r; + out[i * 6 + 2] = out[i * 6 + 3] = g; + out[i * 6 + 4] = out[i * 6 + 5] = b; + } + } else if(mode->colortype == LCT_PALETTE) { + int index = color_tree_get(tree, r, g, b, a); + if(index < 0) return 82; /*color not in palette*/ + if(mode->bitdepth == 8) out[i] = index; + else addColorBits(out, i, mode->bitdepth, (unsigned)index); + } else if(mode->colortype == LCT_GREY_ALPHA) { + unsigned char gray = r; /*((unsigned short)r + g + b) / 3u;*/ + if(mode->bitdepth == 8) { + out[i * 2 + 0] = gray; + out[i * 2 + 1] = a; + } else if(mode->bitdepth == 16) { + out[i * 4 + 0] = out[i * 4 + 1] = gray; + out[i * 4 + 2] = out[i * 4 + 3] = a; + } + } else if(mode->colortype == LCT_RGBA) { + if(mode->bitdepth == 8) { + out[i * 4 + 0] = r; + out[i * 4 + 1] = g; + out[i * 4 + 2] = b; + out[i * 4 + 3] = a; + } else { + out[i * 8 + 0] = out[i * 8 + 1] = r; + out[i * 8 + 2] = out[i * 8 + 3] = g; + out[i * 8 + 4] = out[i * 8 + 5] = b; + out[i * 8 + 6] = out[i * 8 + 7] = a; + } + } + + return 0; /*no error*/ +} + +/*put a pixel, given its RGBA16 color, into image of any color 16-bitdepth type*/ +static void rgba16ToPixel(unsigned char* out, size_t i, + const LodePNGColorMode* mode, + unsigned short r, unsigned short g, unsigned short b, unsigned short a) { + if(mode->colortype == LCT_GREY) { + unsigned short gray = r; /*((unsigned)r + g + b) / 3u;*/ + out[i * 2 + 0] = (gray >> 8) & 255; + out[i * 2 + 1] = gray & 255; + } else if(mode->colortype == LCT_RGB) { + out[i * 6 + 0] = (r >> 8) & 255; + out[i * 6 + 1] = r & 255; + out[i * 6 + 2] = (g >> 8) & 255; + out[i * 6 + 3] = g & 255; + out[i * 6 + 4] = (b >> 8) & 255; + out[i * 6 + 5] = b & 255; + } else if(mode->colortype == LCT_GREY_ALPHA) { + unsigned short gray = r; /*((unsigned)r + g + b) / 3u;*/ + out[i * 4 + 0] = (gray >> 8) & 255; + out[i * 4 + 1] = gray & 255; + out[i * 4 + 2] = (a >> 8) & 255; + out[i * 4 + 3] = a & 255; + } else if(mode->colortype == LCT_RGBA) { + out[i * 8 + 0] = (r >> 8) & 255; + out[i * 8 + 1] = r & 255; + out[i * 8 + 2] = (g >> 8) & 255; + out[i * 8 + 3] = g & 255; + out[i * 8 + 4] = (b >> 8) & 255; + out[i * 8 + 5] = b & 255; + out[i * 8 + 6] = (a >> 8) & 255; + out[i * 8 + 7] = a & 255; + } +} + +/*Get RGBA8 color of pixel with index i (y * width + x) from the raw image with given color type.*/ +static void getPixelColorRGBA8(unsigned char* r, unsigned char* g, + unsigned char* b, unsigned char* a, + const unsigned char* in, size_t i, + const LodePNGColorMode* mode) { + if(mode->colortype == LCT_GREY) { + if(mode->bitdepth == 8) { + *r = *g = *b = in[i]; + if(mode->key_defined && *r == mode->key_r) *a = 0; + else *a = 255; + } else if(mode->bitdepth == 16) { + *r = *g = *b = in[i * 2 + 0]; + if(mode->key_defined && 256U * in[i * 2 + 0] + in[i * 2 + 1] == mode->key_r) *a = 0; + else *a = 255; + } else { + unsigned highest = ((1U << mode->bitdepth) - 1U); /*highest possible value for this bit depth*/ + size_t j = i * mode->bitdepth; + unsigned value = readBitsFromReversedStream(&j, in, mode->bitdepth); + *r = *g = *b = (value * 255) / highest; + if(mode->key_defined && value == mode->key_r) *a = 0; + else *a = 255; + } + } else if(mode->colortype == LCT_RGB) { + if(mode->bitdepth == 8) { + *r = in[i * 3 + 0]; *g = in[i * 3 + 1]; *b = in[i * 3 + 2]; + if(mode->key_defined && *r == mode->key_r && *g == mode->key_g && *b == mode->key_b) *a = 0; + else *a = 255; + } else { + *r = in[i * 6 + 0]; + *g = in[i * 6 + 2]; + *b = in[i * 6 + 4]; + if(mode->key_defined && 256U * in[i * 6 + 0] + in[i * 6 + 1] == mode->key_r + && 256U * in[i * 6 + 2] + in[i * 6 + 3] == mode->key_g + && 256U * in[i * 6 + 4] + in[i * 6 + 5] == mode->key_b) *a = 0; + else *a = 255; + } + } else if(mode->colortype == LCT_PALETTE) { + unsigned index; + if(mode->bitdepth == 8) index = in[i]; + else { + size_t j = i * mode->bitdepth; + index = readBitsFromReversedStream(&j, in, mode->bitdepth); + } + /*out of bounds of palette not checked: see lodepng_color_mode_alloc_palette.*/ + *r = mode->palette[index * 4 + 0]; + *g = mode->palette[index * 4 + 1]; + *b = mode->palette[index * 4 + 2]; + *a = mode->palette[index * 4 + 3]; + } else if(mode->colortype == LCT_GREY_ALPHA) { + if(mode->bitdepth == 8) { + *r = *g = *b = in[i * 2 + 0]; + *a = in[i * 2 + 1]; + } else { + *r = *g = *b = in[i * 4 + 0]; + *a = in[i * 4 + 2]; + } + } else if(mode->colortype == LCT_RGBA) { + if(mode->bitdepth == 8) { + *r = in[i * 4 + 0]; + *g = in[i * 4 + 1]; + *b = in[i * 4 + 2]; + *a = in[i * 4 + 3]; + } else { + *r = in[i * 8 + 0]; + *g = in[i * 8 + 2]; + *b = in[i * 8 + 4]; + *a = in[i * 8 + 6]; + } + } +} + +/*Similar to getPixelColorRGBA8, but with all the for loops inside of the color +mode test cases, optimized to convert the colors much faster, when converting +to the common case of RGBA with 8 bit per channel. buffer must be RGBA with +enough memory.*/ +static void getPixelColorsRGBA8(unsigned char* LODEPNG_RESTRICT buffer, size_t numpixels, + const unsigned char* LODEPNG_RESTRICT in, + const LodePNGColorMode* mode) { + unsigned num_channels = 4; + size_t i; + if(mode->colortype == LCT_GREY) { + if(mode->bitdepth == 8) { + for(i = 0; i != numpixels; ++i, buffer += num_channels) { + buffer[0] = buffer[1] = buffer[2] = in[i]; + buffer[3] = 255; + } + if(mode->key_defined) { + buffer -= numpixels * num_channels; + for(i = 0; i != numpixels; ++i, buffer += num_channels) { + if(buffer[0] == mode->key_r) buffer[3] = 0; + } + } + } else if(mode->bitdepth == 16) { + for(i = 0; i != numpixels; ++i, buffer += num_channels) { + buffer[0] = buffer[1] = buffer[2] = in[i * 2]; + buffer[3] = mode->key_defined && 256U * in[i * 2 + 0] + in[i * 2 + 1] == mode->key_r ? 0 : 255; + } + } else { + unsigned highest = ((1U << mode->bitdepth) - 1U); /*highest possible value for this bit depth*/ + size_t j = 0; + for(i = 0; i != numpixels; ++i, buffer += num_channels) { + unsigned value = readBitsFromReversedStream(&j, in, mode->bitdepth); + buffer[0] = buffer[1] = buffer[2] = (value * 255) / highest; + buffer[3] = mode->key_defined && value == mode->key_r ? 0 : 255; + } + } + } else if(mode->colortype == LCT_RGB) { + if(mode->bitdepth == 8) { + for(i = 0; i != numpixels; ++i, buffer += num_channels) { + lodepng_memcpy(buffer, &in[i * 3], 3); + buffer[3] = 255; + } + if(mode->key_defined) { + buffer -= numpixels * num_channels; + for(i = 0; i != numpixels; ++i, buffer += num_channels) { + if(buffer[0] == mode->key_r && buffer[1]== mode->key_g && buffer[2] == mode->key_b) buffer[3] = 0; + } + } + } else { + for(i = 0; i != numpixels; ++i, buffer += num_channels) { + buffer[0] = in[i * 6 + 0]; + buffer[1] = in[i * 6 + 2]; + buffer[2] = in[i * 6 + 4]; + buffer[3] = mode->key_defined + && 256U * in[i * 6 + 0] + in[i * 6 + 1] == mode->key_r + && 256U * in[i * 6 + 2] + in[i * 6 + 3] == mode->key_g + && 256U * in[i * 6 + 4] + in[i * 6 + 5] == mode->key_b ? 0 : 255; + } + } + } else if(mode->colortype == LCT_PALETTE) { + if(mode->bitdepth == 8) { + for(i = 0; i != numpixels; ++i, buffer += num_channels) { + unsigned index = in[i]; + /*out of bounds of palette not checked: see lodepng_color_mode_alloc_palette.*/ + lodepng_memcpy(buffer, &mode->palette[index * 4], 4); + } + } else { + size_t j = 0; + for(i = 0; i != numpixels; ++i, buffer += num_channels) { + unsigned index = readBitsFromReversedStream(&j, in, mode->bitdepth); + /*out of bounds of palette not checked: see lodepng_color_mode_alloc_palette.*/ + lodepng_memcpy(buffer, &mode->palette[index * 4], 4); + } + } + } else if(mode->colortype == LCT_GREY_ALPHA) { + if(mode->bitdepth == 8) { + for(i = 0; i != numpixels; ++i, buffer += num_channels) { + buffer[0] = buffer[1] = buffer[2] = in[i * 2 + 0]; + buffer[3] = in[i * 2 + 1]; + } + } else { + for(i = 0; i != numpixels; ++i, buffer += num_channels) { + buffer[0] = buffer[1] = buffer[2] = in[i * 4 + 0]; + buffer[3] = in[i * 4 + 2]; + } + } + } else if(mode->colortype == LCT_RGBA) { + if(mode->bitdepth == 8) { + lodepng_memcpy(buffer, in, numpixels * 4); + } else { + for(i = 0; i != numpixels; ++i, buffer += num_channels) { + buffer[0] = in[i * 8 + 0]; + buffer[1] = in[i * 8 + 2]; + buffer[2] = in[i * 8 + 4]; + buffer[3] = in[i * 8 + 6]; + } + } + } +} + +/*Similar to getPixelColorsRGBA8, but with 3-channel RGB output.*/ +static void getPixelColorsRGB8(unsigned char* LODEPNG_RESTRICT buffer, size_t numpixels, + const unsigned char* LODEPNG_RESTRICT in, + const LodePNGColorMode* mode) { + const unsigned num_channels = 3; + size_t i; + if(mode->colortype == LCT_GREY) { + if(mode->bitdepth == 8) { + for(i = 0; i != numpixels; ++i, buffer += num_channels) { + buffer[0] = buffer[1] = buffer[2] = in[i]; + } + } else if(mode->bitdepth == 16) { + for(i = 0; i != numpixels; ++i, buffer += num_channels) { + buffer[0] = buffer[1] = buffer[2] = in[i * 2]; + } + } else { + unsigned highest = ((1U << mode->bitdepth) - 1U); /*highest possible value for this bit depth*/ + size_t j = 0; + for(i = 0; i != numpixels; ++i, buffer += num_channels) { + unsigned value = readBitsFromReversedStream(&j, in, mode->bitdepth); + buffer[0] = buffer[1] = buffer[2] = (value * 255) / highest; + } + } + } else if(mode->colortype == LCT_RGB) { + if(mode->bitdepth == 8) { + lodepng_memcpy(buffer, in, numpixels * 3); + } else { + for(i = 0; i != numpixels; ++i, buffer += num_channels) { + buffer[0] = in[i * 6 + 0]; + buffer[1] = in[i * 6 + 2]; + buffer[2] = in[i * 6 + 4]; + } + } + } else if(mode->colortype == LCT_PALETTE) { + if(mode->bitdepth == 8) { + for(i = 0; i != numpixels; ++i, buffer += num_channels) { + unsigned index = in[i]; + /*out of bounds of palette not checked: see lodepng_color_mode_alloc_palette.*/ + lodepng_memcpy(buffer, &mode->palette[index * 4], 3); + } + } else { + size_t j = 0; + for(i = 0; i != numpixels; ++i, buffer += num_channels) { + unsigned index = readBitsFromReversedStream(&j, in, mode->bitdepth); + /*out of bounds of palette not checked: see lodepng_color_mode_alloc_palette.*/ + lodepng_memcpy(buffer, &mode->palette[index * 4], 3); + } + } + } else if(mode->colortype == LCT_GREY_ALPHA) { + if(mode->bitdepth == 8) { + for(i = 0; i != numpixels; ++i, buffer += num_channels) { + buffer[0] = buffer[1] = buffer[2] = in[i * 2 + 0]; + } + } else { + for(i = 0; i != numpixels; ++i, buffer += num_channels) { + buffer[0] = buffer[1] = buffer[2] = in[i * 4 + 0]; + } + } + } else if(mode->colortype == LCT_RGBA) { + if(mode->bitdepth == 8) { + for(i = 0; i != numpixels; ++i, buffer += num_channels) { + lodepng_memcpy(buffer, &in[i * 4], 3); + } + } else { + for(i = 0; i != numpixels; ++i, buffer += num_channels) { + buffer[0] = in[i * 8 + 0]; + buffer[1] = in[i * 8 + 2]; + buffer[2] = in[i * 8 + 4]; + } + } + } +} + +/*Get RGBA16 color of pixel with index i (y * width + x) from the raw image with +given color type, but the given color type must be 16-bit itself.*/ +static void getPixelColorRGBA16(unsigned short* r, unsigned short* g, unsigned short* b, unsigned short* a, + const unsigned char* in, size_t i, const LodePNGColorMode* mode) { + if(mode->colortype == LCT_GREY) { + *r = *g = *b = 256 * in[i * 2 + 0] + in[i * 2 + 1]; + if(mode->key_defined && 256U * in[i * 2 + 0] + in[i * 2 + 1] == mode->key_r) *a = 0; + else *a = 65535; + } else if(mode->colortype == LCT_RGB) { + *r = 256u * in[i * 6 + 0] + in[i * 6 + 1]; + *g = 256u * in[i * 6 + 2] + in[i * 6 + 3]; + *b = 256u * in[i * 6 + 4] + in[i * 6 + 5]; + if(mode->key_defined + && 256u * in[i * 6 + 0] + in[i * 6 + 1] == mode->key_r + && 256u * in[i * 6 + 2] + in[i * 6 + 3] == mode->key_g + && 256u * in[i * 6 + 4] + in[i * 6 + 5] == mode->key_b) *a = 0; + else *a = 65535; + } else if(mode->colortype == LCT_GREY_ALPHA) { + *r = *g = *b = 256u * in[i * 4 + 0] + in[i * 4 + 1]; + *a = 256u * in[i * 4 + 2] + in[i * 4 + 3]; + } else if(mode->colortype == LCT_RGBA) { + *r = 256u * in[i * 8 + 0] + in[i * 8 + 1]; + *g = 256u * in[i * 8 + 2] + in[i * 8 + 3]; + *b = 256u * in[i * 8 + 4] + in[i * 8 + 5]; + *a = 256u * in[i * 8 + 6] + in[i * 8 + 7]; + } +} + +unsigned lodepng_convert(unsigned char* out, const unsigned char* in, + const LodePNGColorMode* mode_out, const LodePNGColorMode* mode_in, + unsigned w, unsigned h) { + size_t i; + ColorTree tree; + size_t numpixels = (size_t)w * (size_t)h; + unsigned error = 0; + + if(mode_in->colortype == LCT_PALETTE && !mode_in->palette) { + return 107; /* error: must provide palette if input mode is palette */ + } + + if(lodepng_color_mode_equal(mode_out, mode_in)) { + size_t numbytes = lodepng_get_raw_size(w, h, mode_in); + lodepng_memcpy(out, in, numbytes); + return 0; + } + + if(mode_out->colortype == LCT_PALETTE) { + size_t palettesize = mode_out->palettesize; + const unsigned char* palette = mode_out->palette; + size_t palsize = (size_t)1u << mode_out->bitdepth; + /*if the user specified output palette but did not give the values, assume + they want the values of the input color type (assuming that one is palette). + Note that we never create a new palette ourselves.*/ + if(palettesize == 0) { + palettesize = mode_in->palettesize; + palette = mode_in->palette; + /*if the input was also palette with same bitdepth, then the color types are also + equal, so copy literally. This to preserve the exact indices that were in the PNG + even in case there are duplicate colors in the palette.*/ + if(mode_in->colortype == LCT_PALETTE && mode_in->bitdepth == mode_out->bitdepth) { + size_t numbytes = lodepng_get_raw_size(w, h, mode_in); + lodepng_memcpy(out, in, numbytes); + return 0; + } + } + if(palettesize < palsize) palsize = palettesize; + color_tree_init(&tree); + for(i = 0; i != palsize; ++i) { + const unsigned char* p = &palette[i * 4]; + error = color_tree_add(&tree, p[0], p[1], p[2], p[3], (unsigned)i); + if(error) break; + } + } + + if(!error) { + if(mode_in->bitdepth == 16 && mode_out->bitdepth == 16) { + for(i = 0; i != numpixels; ++i) { + unsigned short r = 0, g = 0, b = 0, a = 0; + getPixelColorRGBA16(&r, &g, &b, &a, in, i, mode_in); + rgba16ToPixel(out, i, mode_out, r, g, b, a); + } + } else if(mode_out->bitdepth == 8 && mode_out->colortype == LCT_RGBA) { + getPixelColorsRGBA8(out, numpixels, in, mode_in); + } else if(mode_out->bitdepth == 8 && mode_out->colortype == LCT_RGB) { + getPixelColorsRGB8(out, numpixels, in, mode_in); + } else { + unsigned char r = 0, g = 0, b = 0, a = 0; + for(i = 0; i != numpixels; ++i) { + getPixelColorRGBA8(&r, &g, &b, &a, in, i, mode_in); + error = rgba8ToPixel(out, i, mode_out, &tree, r, g, b, a); + if(error) break; + } + } + } + + if(mode_out->colortype == LCT_PALETTE) { + color_tree_cleanup(&tree); + } + + return error; +} + + +/* Converts a single rgb color without alpha from one type to another, color bits truncated to +their bitdepth. In case of single channel (gray or palette), only the r channel is used. Slow +function, do not use to process all pixels of an image. Alpha channel not supported on purpose: +this is for bKGD, supporting alpha may prevent it from finding a color in the palette, from the +specification it looks like bKGD should ignore the alpha values of the palette since it can use +any palette index but doesn't have an alpha channel. Idem with ignoring color key. */ +unsigned lodepng_convert_rgb( + unsigned* r_out, unsigned* g_out, unsigned* b_out, + unsigned r_in, unsigned g_in, unsigned b_in, + const LodePNGColorMode* mode_out, const LodePNGColorMode* mode_in) { + unsigned r = 0, g = 0, b = 0; + unsigned mul = 65535 / ((1u << mode_in->bitdepth) - 1u); /*65535, 21845, 4369, 257, 1*/ + unsigned shift = 16 - mode_out->bitdepth; + + if(mode_in->colortype == LCT_GREY || mode_in->colortype == LCT_GREY_ALPHA) { + r = g = b = r_in * mul; + } else if(mode_in->colortype == LCT_RGB || mode_in->colortype == LCT_RGBA) { + r = r_in * mul; + g = g_in * mul; + b = b_in * mul; + } else if(mode_in->colortype == LCT_PALETTE) { + if(r_in >= mode_in->palettesize) return 82; + r = mode_in->palette[r_in * 4 + 0] * 257u; + g = mode_in->palette[r_in * 4 + 1] * 257u; + b = mode_in->palette[r_in * 4 + 2] * 257u; + } else { + return 31; + } + + /* now convert to output format */ + if(mode_out->colortype == LCT_GREY || mode_out->colortype == LCT_GREY_ALPHA) { + *r_out = r >> shift ; + } else if(mode_out->colortype == LCT_RGB || mode_out->colortype == LCT_RGBA) { + *r_out = r >> shift ; + *g_out = g >> shift ; + *b_out = b >> shift ; + } else if(mode_out->colortype == LCT_PALETTE) { + unsigned i; + /* a 16-bit color cannot be in the palette */ + if((r >> 8) != (r & 255) || (g >> 8) != (g & 255) || (b >> 8) != (b & 255)) return 82; + for(i = 0; i < mode_out->palettesize; i++) { + unsigned j = i * 4; + if((r >> 8) == mode_out->palette[j + 0] && (g >> 8) == mode_out->palette[j + 1] && + (b >> 8) == mode_out->palette[j + 2]) { + *r_out = i; + return 0; + } + } + return 82; + } else { + return 31; + } + + return 0; +} + +#ifdef LODEPNG_COMPILE_ENCODER + +void lodepng_color_stats_init(LodePNGColorStats* stats) { + /*stats*/ + stats->colored = 0; + stats->key = 0; + stats->key_r = stats->key_g = stats->key_b = 0; + stats->alpha = 0; + stats->numcolors = 0; + stats->bits = 1; + stats->numpixels = 0; + /*settings*/ + stats->allow_palette = 1; + stats->allow_greyscale = 1; +} + +/*function used for debug purposes with C++*/ +/*void printColorStats(LodePNGColorStats* p) { + std::cout << "colored: " << (int)p->colored << ", "; + std::cout << "key: " << (int)p->key << ", "; + std::cout << "key_r: " << (int)p->key_r << ", "; + std::cout << "key_g: " << (int)p->key_g << ", "; + std::cout << "key_b: " << (int)p->key_b << ", "; + std::cout << "alpha: " << (int)p->alpha << ", "; + std::cout << "numcolors: " << (int)p->numcolors << ", "; + std::cout << "bits: " << (int)p->bits << std::endl; +}*/ + +/*Returns how many bits needed to represent given value (max 8 bit)*/ +static unsigned getValueRequiredBits(unsigned char value) { + if(value == 0 || value == 255) return 1; + /*The scaling of 2-bit and 4-bit values uses multiples of 85 and 17*/ + if(value % 17 == 0) return value % 85 == 0 ? 2 : 4; + return 8; +} + +/*stats must already have been inited. */ +unsigned lodepng_compute_color_stats(LodePNGColorStats* stats, + const unsigned char* in, unsigned w, unsigned h, + const LodePNGColorMode* mode_in) { + size_t i; + ColorTree tree; + size_t numpixels = (size_t)w * (size_t)h; + unsigned error = 0; + + /* mark things as done already if it would be impossible to have a more expensive case */ + unsigned colored_done = lodepng_is_greyscale_type(mode_in) ? 1 : 0; + unsigned alpha_done = lodepng_can_have_alpha(mode_in) ? 0 : 1; + unsigned numcolors_done = 0; + unsigned bpp = lodepng_get_bpp(mode_in); + unsigned bits_done = (stats->bits == 1 && bpp == 1) ? 1 : 0; + unsigned sixteen = 0; /* whether the input image is 16 bit */ + unsigned maxnumcolors = 257; + if(bpp <= 8) maxnumcolors = LODEPNG_MIN(257, stats->numcolors + (1u << bpp)); + + stats->numpixels += numpixels; + + /*if palette not allowed, no need to compute numcolors*/ + if(!stats->allow_palette) numcolors_done = 1; + + color_tree_init(&tree); + + /*If the stats was already filled in from previous data, fill its palette in tree + and mark things as done already if we know they are the most expensive case already*/ + if(stats->alpha) alpha_done = 1; + if(stats->colored) colored_done = 1; + if(stats->bits == 16) numcolors_done = 1; + if(stats->bits >= bpp) bits_done = 1; + if(stats->numcolors >= maxnumcolors) numcolors_done = 1; + + if(!numcolors_done) { + for(i = 0; i < stats->numcolors; i++) { + const unsigned char* color = &stats->palette[i * 4]; + error = color_tree_add(&tree, color[0], color[1], color[2], color[3], i); + if(error) goto cleanup; + } + } + + /*Check if the 16-bit input is truly 16-bit*/ + if(mode_in->bitdepth == 16 && !sixteen) { + unsigned short r = 0, g = 0, b = 0, a = 0; + for(i = 0; i != numpixels; ++i) { + getPixelColorRGBA16(&r, &g, &b, &a, in, i, mode_in); + if((r & 255) != ((r >> 8) & 255) || (g & 255) != ((g >> 8) & 255) || + (b & 255) != ((b >> 8) & 255) || (a & 255) != ((a >> 8) & 255)) /*first and second byte differ*/ { + stats->bits = 16; + sixteen = 1; + bits_done = 1; + numcolors_done = 1; /*counting colors no longer useful, palette doesn't support 16-bit*/ + break; + } + } + } + + if(sixteen) { + unsigned short r = 0, g = 0, b = 0, a = 0; + + for(i = 0; i != numpixels; ++i) { + getPixelColorRGBA16(&r, &g, &b, &a, in, i, mode_in); + + if(!colored_done && (r != g || r != b)) { + stats->colored = 1; + colored_done = 1; + } + + if(!alpha_done) { + unsigned matchkey = (r == stats->key_r && g == stats->key_g && b == stats->key_b); + if(a != 65535 && (a != 0 || (stats->key && !matchkey))) { + stats->alpha = 1; + stats->key = 0; + alpha_done = 1; + } else if(a == 0 && !stats->alpha && !stats->key) { + stats->key = 1; + stats->key_r = r; + stats->key_g = g; + stats->key_b = b; + } else if(a == 65535 && stats->key && matchkey) { + /* Color key cannot be used if an opaque pixel also has that RGB color. */ + stats->alpha = 1; + stats->key = 0; + alpha_done = 1; + } + } + if(alpha_done && numcolors_done && colored_done && bits_done) break; + } + + if(stats->key && !stats->alpha) { + for(i = 0; i != numpixels; ++i) { + getPixelColorRGBA16(&r, &g, &b, &a, in, i, mode_in); + if(a != 0 && r == stats->key_r && g == stats->key_g && b == stats->key_b) { + /* Color key cannot be used if an opaque pixel also has that RGB color. */ + stats->alpha = 1; + stats->key = 0; + alpha_done = 1; + } + } + } + } else /* < 16-bit */ { + unsigned char r = 0, g = 0, b = 0, a = 0; + for(i = 0; i != numpixels; ++i) { + getPixelColorRGBA8(&r, &g, &b, &a, in, i, mode_in); + + if(!bits_done && stats->bits < 8) { + /*only r is checked, < 8 bits is only relevant for grayscale*/ + unsigned bits = getValueRequiredBits(r); + if(bits > stats->bits) stats->bits = bits; + } + bits_done = (stats->bits >= bpp); + + if(!colored_done && (r != g || r != b)) { + stats->colored = 1; + colored_done = 1; + if(stats->bits < 8) stats->bits = 8; /*PNG has no colored modes with less than 8-bit per channel*/ + } + + if(!alpha_done) { + unsigned matchkey = (r == stats->key_r && g == stats->key_g && b == stats->key_b); + if(a != 255 && (a != 0 || (stats->key && !matchkey))) { + stats->alpha = 1; + stats->key = 0; + alpha_done = 1; + if(stats->bits < 8) stats->bits = 8; /*PNG has no alphachannel modes with less than 8-bit per channel*/ + } else if(a == 0 && !stats->alpha && !stats->key) { + stats->key = 1; + stats->key_r = r; + stats->key_g = g; + stats->key_b = b; + } else if(a == 255 && stats->key && matchkey) { + /* Color key cannot be used if an opaque pixel also has that RGB color. */ + stats->alpha = 1; + stats->key = 0; + alpha_done = 1; + if(stats->bits < 8) stats->bits = 8; /*PNG has no alphachannel modes with less than 8-bit per channel*/ + } + } + + if(!numcolors_done) { + if(!color_tree_has(&tree, r, g, b, a)) { + error = color_tree_add(&tree, r, g, b, a, stats->numcolors); + if(error) goto cleanup; + if(stats->numcolors < 256) { + unsigned char* p = stats->palette; + unsigned n = stats->numcolors; + p[n * 4 + 0] = r; + p[n * 4 + 1] = g; + p[n * 4 + 2] = b; + p[n * 4 + 3] = a; + } + ++stats->numcolors; + numcolors_done = stats->numcolors >= maxnumcolors; + } + } + + if(alpha_done && numcolors_done && colored_done && bits_done) break; + } + + if(stats->key && !stats->alpha) { + for(i = 0; i != numpixels; ++i) { + getPixelColorRGBA8(&r, &g, &b, &a, in, i, mode_in); + if(a != 0 && r == stats->key_r && g == stats->key_g && b == stats->key_b) { + /* Color key cannot be used if an opaque pixel also has that RGB color. */ + stats->alpha = 1; + stats->key = 0; + alpha_done = 1; + if(stats->bits < 8) stats->bits = 8; /*PNG has no alphachannel modes with less than 8-bit per channel*/ + } + } + } + + /*make the stats's key always 16-bit for consistency - repeat each byte twice*/ + stats->key_r += (stats->key_r << 8); + stats->key_g += (stats->key_g << 8); + stats->key_b += (stats->key_b << 8); + } + +cleanup: + color_tree_cleanup(&tree); + return error; +} + +#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS +/*Adds a single color to the color stats. The stats must already have been inited. The color must be given as 16-bit +(with 2 bytes repeating for 8-bit and 65535 for opaque alpha channel). This function is expensive, do not call it for +all pixels of an image but only for a few additional values. */ +static unsigned lodepng_color_stats_add(LodePNGColorStats* stats, + unsigned r, unsigned g, unsigned b, unsigned a) { + unsigned error = 0; + unsigned char image[8]; + LodePNGColorMode mode; + lodepng_color_mode_init(&mode); + image[0] = r >> 8; image[1] = r; image[2] = g >> 8; image[3] = g; + image[4] = b >> 8; image[5] = b; image[6] = a >> 8; image[7] = a; + mode.bitdepth = 16; + mode.colortype = LCT_RGBA; + error = lodepng_compute_color_stats(stats, image, 1, 1, &mode); + lodepng_color_mode_cleanup(&mode); + return error; +} +#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ + +/*Computes a minimal PNG color model that can contain all colors as indicated by the stats. +The stats should be computed with lodepng_compute_color_stats. +mode_in is raw color profile of the image the stats were computed on, to copy palette order from when relevant. +Minimal PNG color model means the color type and bit depth that gives smallest amount of bits in the output image, +e.g. gray if only grayscale pixels, palette if less than 256 colors, color key if only single transparent color, ... +This is used if auto_convert is enabled (it is by default). +*/ +static unsigned auto_choose_color(LodePNGColorMode* mode_out, + const LodePNGColorMode* mode_in, + const LodePNGColorStats* stats) { + unsigned error = 0; + unsigned palettebits; + size_t i, n; + size_t numpixels = stats->numpixels; + unsigned palette_ok, gray_ok; + + unsigned alpha = stats->alpha; + unsigned key = stats->key; + unsigned bits = stats->bits; + + mode_out->key_defined = 0; + + if(key && numpixels <= 16) { + alpha = 1; /*too few pixels to justify tRNS chunk overhead*/ + key = 0; + if(bits < 8) bits = 8; /*PNG has no alphachannel modes with less than 8-bit per channel*/ + } + + gray_ok = !stats->colored; + if(!stats->allow_greyscale) gray_ok = 0; + if(!gray_ok && bits < 8) bits = 8; + + n = stats->numcolors; + palettebits = n <= 2 ? 1 : (n <= 4 ? 2 : (n <= 16 ? 4 : 8)); + palette_ok = n <= 256 && bits <= 8 && n != 0; /*n==0 means likely numcolors wasn't computed*/ + if(numpixels < n * 2) palette_ok = 0; /*don't add palette overhead if image has only a few pixels*/ + if(gray_ok && !alpha && bits <= palettebits) palette_ok = 0; /*gray is less overhead*/ + if(!stats->allow_palette) palette_ok = 0; + + if(palette_ok) { + const unsigned char* p = stats->palette; + lodepng_palette_clear(mode_out); /*remove potential earlier palette*/ + for(i = 0; i != stats->numcolors; ++i) { + error = lodepng_palette_add(mode_out, p[i * 4 + 0], p[i * 4 + 1], p[i * 4 + 2], p[i * 4 + 3]); + if(error) break; + } + + mode_out->colortype = LCT_PALETTE; + mode_out->bitdepth = palettebits; + + if(mode_in->colortype == LCT_PALETTE && mode_in->palettesize >= mode_out->palettesize + && mode_in->bitdepth == mode_out->bitdepth) { + /*If input should have same palette colors, keep original to preserve its order and prevent conversion*/ + lodepng_color_mode_cleanup(mode_out); + lodepng_color_mode_copy(mode_out, mode_in); + } + } else /*8-bit or 16-bit per channel*/ { + mode_out->bitdepth = bits; + mode_out->colortype = alpha ? (gray_ok ? LCT_GREY_ALPHA : LCT_RGBA) + : (gray_ok ? LCT_GREY : LCT_RGB); + if(key) { + unsigned mask = (1u << mode_out->bitdepth) - 1u; /*stats always uses 16-bit, mask converts it*/ + mode_out->key_r = stats->key_r & mask; + mode_out->key_g = stats->key_g & mask; + mode_out->key_b = stats->key_b & mask; + mode_out->key_defined = 1; + } + } + + return error; +} + +#endif /* #ifdef LODEPNG_COMPILE_ENCODER */ + +/* +Paeth predictor, used by PNG filter type 4 +The parameters are of type short, but should come from unsigned chars, the shorts +are only needed to make the paeth calculation correct. +*/ +static unsigned char paethPredictor(short a, short b, short c) { + short pa = LODEPNG_ABS(b - c); + short pb = LODEPNG_ABS(a - c); + short pc = LODEPNG_ABS(a + b - c - c); + /* return input value associated with smallest of pa, pb, pc (with certain priority if equal) */ + if(pb < pa) { a = b; pa = pb; } + return (pc < pa) ? c : a; +} + +/*shared values used by multiple Adam7 related functions*/ + +static const unsigned ADAM7_IX[7] = { 0, 4, 0, 2, 0, 1, 0 }; /*x start values*/ +static const unsigned ADAM7_IY[7] = { 0, 0, 4, 0, 2, 0, 1 }; /*y start values*/ +static const unsigned ADAM7_DX[7] = { 8, 8, 4, 4, 2, 2, 1 }; /*x delta values*/ +static const unsigned ADAM7_DY[7] = { 8, 8, 8, 4, 4, 2, 2 }; /*y delta values*/ + +/* +Outputs various dimensions and positions in the image related to the Adam7 reduced images. +passw: output containing the width of the 7 passes +passh: output containing the height of the 7 passes +filter_passstart: output containing the index of the start and end of each + reduced image with filter bytes +padded_passstart output containing the index of the start and end of each + reduced image when without filter bytes but with padded scanlines +passstart: output containing the index of the start and end of each reduced + image without padding between scanlines, but still padding between the images +w, h: width and height of non-interlaced image +bpp: bits per pixel +"padded" is only relevant if bpp is less than 8 and a scanline or image does not + end at a full byte +*/ +static void Adam7_getpassvalues(unsigned passw[7], unsigned passh[7], size_t filter_passstart[8], + size_t padded_passstart[8], size_t passstart[8], unsigned w, unsigned h, unsigned bpp) { + /*the passstart values have 8 values: the 8th one indicates the byte after the end of the 7th (= last) pass*/ + unsigned i; + + /*calculate width and height in pixels of each pass*/ + for(i = 0; i != 7; ++i) { + passw[i] = (w + ADAM7_DX[i] - ADAM7_IX[i] - 1) / ADAM7_DX[i]; + passh[i] = (h + ADAM7_DY[i] - ADAM7_IY[i] - 1) / ADAM7_DY[i]; + if(passw[i] == 0) passh[i] = 0; + if(passh[i] == 0) passw[i] = 0; + } + + filter_passstart[0] = padded_passstart[0] = passstart[0] = 0; + for(i = 0; i != 7; ++i) { + /*if passw[i] is 0, it's 0 bytes, not 1 (no filtertype-byte)*/ + filter_passstart[i + 1] = filter_passstart[i] + + ((passw[i] && passh[i]) ? passh[i] * (1u + (passw[i] * bpp + 7u) / 8u) : 0); + /*bits padded if needed to fill full byte at end of each scanline*/ + padded_passstart[i + 1] = padded_passstart[i] + passh[i] * ((passw[i] * bpp + 7u) / 8u); + /*only padded at end of reduced image*/ + passstart[i + 1] = passstart[i] + (passh[i] * passw[i] * bpp + 7u) / 8u; + } +} + +#ifdef LODEPNG_COMPILE_DECODER + +/* ////////////////////////////////////////////////////////////////////////// */ +/* / PNG Decoder / */ +/* ////////////////////////////////////////////////////////////////////////// */ + +/*read the information from the header and store it in the LodePNGInfo. return value is error*/ +unsigned lodepng_inspect(unsigned* w, unsigned* h, LodePNGState* state, + const unsigned char* in, size_t insize) { + unsigned width, height; + LodePNGInfo* info = &state->info_png; + if(insize == 0 || in == 0) { + CERROR_RETURN_ERROR(state->error, 48); /*error: the given data is empty*/ + } + if(insize < 33) { + CERROR_RETURN_ERROR(state->error, 27); /*error: the data length is smaller than the length of a PNG header*/ + } + + /*when decoding a new PNG image, make sure all parameters created after previous decoding are reset*/ + /* TODO: remove this. One should use a new LodePNGState for new sessions */ + lodepng_info_cleanup(info); + lodepng_info_init(info); + + if(in[0] != 137 || in[1] != 80 || in[2] != 78 || in[3] != 71 + || in[4] != 13 || in[5] != 10 || in[6] != 26 || in[7] != 10) { + CERROR_RETURN_ERROR(state->error, 28); /*error: the first 8 bytes are not the correct PNG signature*/ + } + if(lodepng_chunk_length(in + 8) != 13) { + CERROR_RETURN_ERROR(state->error, 94); /*error: header size must be 13 bytes*/ + } + if(!lodepng_chunk_type_equals(in + 8, "IHDR")) { + CERROR_RETURN_ERROR(state->error, 29); /*error: it doesn't start with a IHDR chunk!*/ + } + + /*read the values given in the header*/ + width = lodepng_read32bitInt(&in[16]); + height = lodepng_read32bitInt(&in[20]); + /*TODO: remove the undocumented feature that allows to give null pointers to width or height*/ + if(w) *w = width; + if(h) *h = height; + info->color.bitdepth = in[24]; + info->color.colortype = (LodePNGColorType)in[25]; + info->compression_method = in[26]; + info->filter_method = in[27]; + info->interlace_method = in[28]; + + /*errors returned only after the parsing so other values are still output*/ + + /*error: invalid image size*/ + if(width == 0 || height == 0) CERROR_RETURN_ERROR(state->error, 93); + /*error: invalid colortype or bitdepth combination*/ + state->error = checkColorValidity(info->color.colortype, info->color.bitdepth); + if(state->error) return state->error; + /*error: only compression method 0 is allowed in the specification*/ + if(info->compression_method != 0) CERROR_RETURN_ERROR(state->error, 32); + /*error: only filter method 0 is allowed in the specification*/ + if(info->filter_method != 0) CERROR_RETURN_ERROR(state->error, 33); + /*error: only interlace methods 0 and 1 exist in the specification*/ + if(info->interlace_method > 1) CERROR_RETURN_ERROR(state->error, 34); + + if(!state->decoder.ignore_crc) { + unsigned CRC = lodepng_read32bitInt(&in[29]); + unsigned checksum = lodepng_crc32(&in[12], 17); + if(CRC != checksum) { + CERROR_RETURN_ERROR(state->error, 57); /*invalid CRC*/ + } + } + + return state->error; +} + +static unsigned unfilterScanline(unsigned char* recon, const unsigned char* scanline, const unsigned char* precon, + size_t bytewidth, unsigned char filterType, size_t length) { + /* + For PNG filter method 0 + unfilter a PNG image scanline by scanline. when the pixels are smaller than 1 byte, + the filter works byte per byte (bytewidth = 1) + precon is the previous unfiltered scanline, recon the result, scanline the current one + the incoming scanlines do NOT include the filtertype byte, that one is given in the parameter filterType instead + recon and scanline MAY be the same memory address! precon must be disjoint. + */ + + size_t i; + switch(filterType) { + case 0: + for(i = 0; i != length; ++i) recon[i] = scanline[i]; + break; + case 1: + for(i = 0; i != bytewidth; ++i) recon[i] = scanline[i]; + for(i = bytewidth; i < length; ++i) recon[i] = scanline[i] + recon[i - bytewidth]; + break; + case 2: + if(precon) { + for(i = 0; i != length; ++i) recon[i] = scanline[i] + precon[i]; + } else { + for(i = 0; i != length; ++i) recon[i] = scanline[i]; + } + break; + case 3: + if(precon) { + for(i = 0; i != bytewidth; ++i) recon[i] = scanline[i] + (precon[i] >> 1u); + for(i = bytewidth; i < length; ++i) recon[i] = scanline[i] + ((recon[i - bytewidth] + precon[i]) >> 1u); + } else { + for(i = 0; i != bytewidth; ++i) recon[i] = scanline[i]; + for(i = bytewidth; i < length; ++i) recon[i] = scanline[i] + (recon[i - bytewidth] >> 1u); + } + break; + case 4: + if(precon) { + for(i = 0; i != bytewidth; ++i) { + recon[i] = (scanline[i] + precon[i]); /*paethPredictor(0, precon[i], 0) is always precon[i]*/ + } + + /* Unroll independent paths of the paeth predictor. A 6x and 8x version would also be possible but that + adds too much code. Whether this actually speeds anything up at all depends on compiler and settings. */ + if(bytewidth >= 4) { + for(; i + 3 < length; i += 4) { + size_t j = i - bytewidth; + unsigned char s0 = scanline[i + 0], s1 = scanline[i + 1], s2 = scanline[i + 2], s3 = scanline[i + 3]; + unsigned char r0 = recon[j + 0], r1 = recon[j + 1], r2 = recon[j + 2], r3 = recon[j + 3]; + unsigned char p0 = precon[i + 0], p1 = precon[i + 1], p2 = precon[i + 2], p3 = precon[i + 3]; + unsigned char q0 = precon[j + 0], q1 = precon[j + 1], q2 = precon[j + 2], q3 = precon[j + 3]; + recon[i + 0] = s0 + paethPredictor(r0, p0, q0); + recon[i + 1] = s1 + paethPredictor(r1, p1, q1); + recon[i + 2] = s2 + paethPredictor(r2, p2, q2); + recon[i + 3] = s3 + paethPredictor(r3, p3, q3); + } + } else if(bytewidth >= 3) { + for(; i + 2 < length; i += 3) { + size_t j = i - bytewidth; + unsigned char s0 = scanline[i + 0], s1 = scanline[i + 1], s2 = scanline[i + 2]; + unsigned char r0 = recon[j + 0], r1 = recon[j + 1], r2 = recon[j + 2]; + unsigned char p0 = precon[i + 0], p1 = precon[i + 1], p2 = precon[i + 2]; + unsigned char q0 = precon[j + 0], q1 = precon[j + 1], q2 = precon[j + 2]; + recon[i + 0] = s0 + paethPredictor(r0, p0, q0); + recon[i + 1] = s1 + paethPredictor(r1, p1, q1); + recon[i + 2] = s2 + paethPredictor(r2, p2, q2); + } + } else if(bytewidth >= 2) { + for(; i + 1 < length; i += 2) { + size_t j = i - bytewidth; + unsigned char s0 = scanline[i + 0], s1 = scanline[i + 1]; + unsigned char r0 = recon[j + 0], r1 = recon[j + 1]; + unsigned char p0 = precon[i + 0], p1 = precon[i + 1]; + unsigned char q0 = precon[j + 0], q1 = precon[j + 1]; + recon[i + 0] = s0 + paethPredictor(r0, p0, q0); + recon[i + 1] = s1 + paethPredictor(r1, p1, q1); + } + } + + for(; i != length; ++i) { + recon[i] = (scanline[i] + paethPredictor(recon[i - bytewidth], precon[i], precon[i - bytewidth])); + } + } else { + for(i = 0; i != bytewidth; ++i) { + recon[i] = scanline[i]; + } + for(i = bytewidth; i < length; ++i) { + /*paethPredictor(recon[i - bytewidth], 0, 0) is always recon[i - bytewidth]*/ + recon[i] = (scanline[i] + recon[i - bytewidth]); + } + } + break; + default: return 36; /*error: invalid filter type given*/ + } + return 0; +} + +static unsigned unfilter(unsigned char* out, const unsigned char* in, unsigned w, unsigned h, unsigned bpp) { + /* + For PNG filter method 0 + this function unfilters a single image (e.g. without interlacing this is called once, with Adam7 seven times) + out must have enough bytes allocated already, in must have the scanlines + 1 filtertype byte per scanline + w and h are image dimensions or dimensions of reduced image, bpp is bits per pixel + in and out are allowed to be the same memory address (but aren't the same size since in has the extra filter bytes) + */ + + unsigned y; + unsigned char* prevline = 0; + + /*bytewidth is used for filtering, is 1 when bpp < 8, number of bytes per pixel otherwise*/ + size_t bytewidth = (bpp + 7u) / 8u; + /*the width of a scanline in bytes, not including the filter type*/ + size_t linebytes = lodepng_get_raw_size_idat(w, 1, bpp) - 1u; + + for(y = 0; y < h; ++y) { + size_t outindex = linebytes * y; + size_t inindex = (1 + linebytes) * y; /*the extra filterbyte added to each row*/ + unsigned char filterType = in[inindex]; + + CERROR_TRY_RETURN(unfilterScanline(&out[outindex], &in[inindex + 1], prevline, bytewidth, filterType, linebytes)); + + prevline = &out[outindex]; + } + + return 0; +} + +/* +in: Adam7 interlaced image, with no padding bits between scanlines, but between + reduced images so that each reduced image starts at a byte. +out: the same pixels, but re-ordered so that they're now a non-interlaced image with size w*h +bpp: bits per pixel +out has the following size in bits: w * h * bpp. +in is possibly bigger due to padding bits between reduced images. +out must be big enough AND must be 0 everywhere if bpp < 8 in the current implementation +(because that's likely a little bit faster) +NOTE: comments about padding bits are only relevant if bpp < 8 +*/ +static void Adam7_deinterlace(unsigned char* out, const unsigned char* in, unsigned w, unsigned h, unsigned bpp) { + unsigned passw[7], passh[7]; + size_t filter_passstart[8], padded_passstart[8], passstart[8]; + unsigned i; + + Adam7_getpassvalues(passw, passh, filter_passstart, padded_passstart, passstart, w, h, bpp); + + if(bpp >= 8) { + for(i = 0; i != 7; ++i) { + unsigned x, y, b; + size_t bytewidth = bpp / 8u; + for(y = 0; y < passh[i]; ++y) + for(x = 0; x < passw[i]; ++x) { + size_t pixelinstart = passstart[i] + (y * passw[i] + x) * bytewidth; + size_t pixeloutstart = ((ADAM7_IY[i] + (size_t)y * ADAM7_DY[i]) * (size_t)w + + ADAM7_IX[i] + (size_t)x * ADAM7_DX[i]) * bytewidth; + for(b = 0; b < bytewidth; ++b) { + out[pixeloutstart + b] = in[pixelinstart + b]; + } + } + } + } else /*bpp < 8: Adam7 with pixels < 8 bit is a bit trickier: with bit pointers*/ { + for(i = 0; i != 7; ++i) { + unsigned x, y, b; + unsigned ilinebits = bpp * passw[i]; + unsigned olinebits = bpp * w; + size_t obp, ibp; /*bit pointers (for out and in buffer)*/ + for(y = 0; y < passh[i]; ++y) + for(x = 0; x < passw[i]; ++x) { + ibp = (8 * passstart[i]) + (y * ilinebits + x * bpp); + obp = (ADAM7_IY[i] + (size_t)y * ADAM7_DY[i]) * olinebits + (ADAM7_IX[i] + (size_t)x * ADAM7_DX[i]) * bpp; + for(b = 0; b < bpp; ++b) { + unsigned char bit = readBitFromReversedStream(&ibp, in); + setBitOfReversedStream(&obp, out, bit); + } + } + } + } +} + +static void removePaddingBits(unsigned char* out, const unsigned char* in, + size_t olinebits, size_t ilinebits, unsigned h) { + /* + After filtering there are still padding bits if scanlines have non multiple of 8 bit amounts. They need + to be removed (except at last scanline of (Adam7-reduced) image) before working with pure image buffers + for the Adam7 code, the color convert code and the output to the user. + in and out are allowed to be the same buffer, in may also be higher but still overlapping; in must + have >= ilinebits*h bits, out must have >= olinebits*h bits, olinebits must be <= ilinebits + also used to move bits after earlier such operations happened, e.g. in a sequence of reduced images from Adam7 + only useful if (ilinebits - olinebits) is a value in the range 1..7 + */ + unsigned y; + size_t diff = ilinebits - olinebits; + size_t ibp = 0, obp = 0; /*input and output bit pointers*/ + for(y = 0; y < h; ++y) { + size_t x; + for(x = 0; x < olinebits; ++x) { + unsigned char bit = readBitFromReversedStream(&ibp, in); + setBitOfReversedStream(&obp, out, bit); + } + ibp += diff; + } +} + +/*out must be buffer big enough to contain full image, and in must contain the full decompressed data from +the IDAT chunks (with filter index bytes and possible padding bits) +return value is error*/ +static unsigned postProcessScanlines(unsigned char* out, unsigned char* in, + unsigned w, unsigned h, const LodePNGInfo* info_png) { + /* + This function converts the filtered-padded-interlaced data into pure 2D image buffer with the PNG's colortype. + Steps: + *) if no Adam7: 1) unfilter 2) remove padding bits (= possible extra bits per scanline if bpp < 8) + *) if adam7: 1) 7x unfilter 2) 7x remove padding bits 3) Adam7_deinterlace + NOTE: the in buffer will be overwritten with intermediate data! + */ + unsigned bpp = lodepng_get_bpp(&info_png->color); + if(bpp == 0) return 31; /*error: invalid colortype*/ + + if(info_png->interlace_method == 0) { + if(bpp < 8 && w * bpp != ((w * bpp + 7u) / 8u) * 8u) { + CERROR_TRY_RETURN(unfilter(in, in, w, h, bpp)); + removePaddingBits(out, in, w * bpp, ((w * bpp + 7u) / 8u) * 8u, h); + } + /*we can immediately filter into the out buffer, no other steps needed*/ + else CERROR_TRY_RETURN(unfilter(out, in, w, h, bpp)); + } else /*interlace_method is 1 (Adam7)*/ { + unsigned passw[7], passh[7]; size_t filter_passstart[8], padded_passstart[8], passstart[8]; + unsigned i; + + Adam7_getpassvalues(passw, passh, filter_passstart, padded_passstart, passstart, w, h, bpp); + + for(i = 0; i != 7; ++i) { + CERROR_TRY_RETURN(unfilter(&in[padded_passstart[i]], &in[filter_passstart[i]], passw[i], passh[i], bpp)); + /*TODO: possible efficiency improvement: if in this reduced image the bits fit nicely in 1 scanline, + move bytes instead of bits or move not at all*/ + if(bpp < 8) { + /*remove padding bits in scanlines; after this there still may be padding + bits between the different reduced images: each reduced image still starts nicely at a byte*/ + removePaddingBits(&in[passstart[i]], &in[padded_passstart[i]], passw[i] * bpp, + ((passw[i] * bpp + 7u) / 8u) * 8u, passh[i]); + } + } + + Adam7_deinterlace(out, in, w, h, bpp); + } + + return 0; +} + +static unsigned readChunk_PLTE(LodePNGColorMode* color, const unsigned char* data, size_t chunkLength) { + unsigned pos = 0, i; + color->palettesize = chunkLength / 3u; + if(color->palettesize == 0 || color->palettesize > 256) return 38; /*error: palette too small or big*/ + lodepng_color_mode_alloc_palette(color); + if(!color->palette && color->palettesize) { + color->palettesize = 0; + return 83; /*alloc fail*/ + } + + for(i = 0; i != color->palettesize; ++i) { + color->palette[4 * i + 0] = data[pos++]; /*R*/ + color->palette[4 * i + 1] = data[pos++]; /*G*/ + color->palette[4 * i + 2] = data[pos++]; /*B*/ + color->palette[4 * i + 3] = 255; /*alpha*/ + } + + return 0; /* OK */ +} + +static unsigned readChunk_tRNS(LodePNGColorMode* color, const unsigned char* data, size_t chunkLength) { + unsigned i; + if(color->colortype == LCT_PALETTE) { + /*error: more alpha values given than there are palette entries*/ + if(chunkLength > color->palettesize) return 39; + + for(i = 0; i != chunkLength; ++i) color->palette[4 * i + 3] = data[i]; + } else if(color->colortype == LCT_GREY) { + /*error: this chunk must be 2 bytes for grayscale image*/ + if(chunkLength != 2) return 30; + + color->key_defined = 1; + color->key_r = color->key_g = color->key_b = 256u * data[0] + data[1]; + } else if(color->colortype == LCT_RGB) { + /*error: this chunk must be 6 bytes for RGB image*/ + if(chunkLength != 6) return 41; + + color->key_defined = 1; + color->key_r = 256u * data[0] + data[1]; + color->key_g = 256u * data[2] + data[3]; + color->key_b = 256u * data[4] + data[5]; + } + else return 42; /*error: tRNS chunk not allowed for other color models*/ + + return 0; /* OK */ +} + + +#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS +/*background color chunk (bKGD)*/ +static unsigned readChunk_bKGD(LodePNGInfo* info, const unsigned char* data, size_t chunkLength) { + if(info->color.colortype == LCT_PALETTE) { + /*error: this chunk must be 1 byte for indexed color image*/ + if(chunkLength != 1) return 43; + + /*error: invalid palette index, or maybe this chunk appeared before PLTE*/ + if(data[0] >= info->color.palettesize) return 103; + + info->background_defined = 1; + info->background_r = info->background_g = info->background_b = data[0]; + } else if(info->color.colortype == LCT_GREY || info->color.colortype == LCT_GREY_ALPHA) { + /*error: this chunk must be 2 bytes for grayscale image*/ + if(chunkLength != 2) return 44; + + /*the values are truncated to bitdepth in the PNG file*/ + info->background_defined = 1; + info->background_r = info->background_g = info->background_b = 256u * data[0] + data[1]; + } else if(info->color.colortype == LCT_RGB || info->color.colortype == LCT_RGBA) { + /*error: this chunk must be 6 bytes for grayscale image*/ + if(chunkLength != 6) return 45; + + /*the values are truncated to bitdepth in the PNG file*/ + info->background_defined = 1; + info->background_r = 256u * data[0] + data[1]; + info->background_g = 256u * data[2] + data[3]; + info->background_b = 256u * data[4] + data[5]; + } + + return 0; /* OK */ +} + +/*text chunk (tEXt)*/ +static unsigned readChunk_tEXt(LodePNGInfo* info, const unsigned char* data, size_t chunkLength) { + unsigned error = 0; + char *key = 0, *str = 0; + + while(!error) /*not really a while loop, only used to break on error*/ { + unsigned length, string2_begin; + + length = 0; + while(length < chunkLength && data[length] != 0) ++length; + /*even though it's not allowed by the standard, no error is thrown if + there's no null termination char, if the text is empty*/ + if(length < 1 || length > 79) CERROR_BREAK(error, 89); /*keyword too short or long*/ + + key = (char*)lodepng_malloc(length + 1); + if(!key) CERROR_BREAK(error, 83); /*alloc fail*/ + + lodepng_memcpy(key, data, length); + key[length] = 0; + + string2_begin = length + 1; /*skip keyword null terminator*/ + + length = (unsigned)(chunkLength < string2_begin ? 0 : chunkLength - string2_begin); + str = (char*)lodepng_malloc(length + 1); + if(!str) CERROR_BREAK(error, 83); /*alloc fail*/ + + lodepng_memcpy(str, data + string2_begin, length); + str[length] = 0; + + error = lodepng_add_text(info, key, str); + + break; + } + + lodepng_free(key); + lodepng_free(str); + + return error; +} + +/*compressed text chunk (zTXt)*/ +static unsigned readChunk_zTXt(LodePNGInfo* info, const LodePNGDecompressSettings* zlibsettings, + const unsigned char* data, size_t chunkLength) { + unsigned error = 0; + + unsigned length, string2_begin; + char *key = 0; + unsigned char* str = 0; + size_t size = 0; + + while(!error) /*not really a while loop, only used to break on error*/ { + for(length = 0; length < chunkLength && data[length] != 0; ++length) ; + if(length + 2 >= chunkLength) CERROR_BREAK(error, 75); /*no null termination, corrupt?*/ + if(length < 1 || length > 79) CERROR_BREAK(error, 89); /*keyword too short or long*/ + + key = (char*)lodepng_malloc(length + 1); + if(!key) CERROR_BREAK(error, 83); /*alloc fail*/ + + lodepng_memcpy(key, data, length); + key[length] = 0; + + if(data[length + 1] != 0) CERROR_BREAK(error, 72); /*the 0 byte indicating compression must be 0*/ + + string2_begin = length + 2; + if(string2_begin > chunkLength) CERROR_BREAK(error, 75); /*no null termination, corrupt?*/ + + length = (unsigned)chunkLength - string2_begin; + /*will fail if zlib error, e.g. if length is too small*/ + error = zlib_decompress(&str, &size, 0, &data[string2_begin], + length, zlibsettings); + if(error) break; + error = lodepng_add_text_sized(info, key, (char*)str, size); + + break; + } + + lodepng_free(key); + lodepng_free(str); + + return error; +} + +/*international text chunk (iTXt)*/ +static unsigned readChunk_iTXt(LodePNGInfo* info, const LodePNGDecompressSettings* zlibsettings, + const unsigned char* data, size_t chunkLength) { + unsigned error = 0; + unsigned i; + + unsigned length, begin, compressed; + char *key = 0, *langtag = 0, *transkey = 0; + + while(!error) /*not really a while loop, only used to break on error*/ { + /*Quick check if the chunk length isn't too small. Even without check + it'd still fail with other error checks below if it's too short. This just gives a different error code.*/ + if(chunkLength < 5) CERROR_BREAK(error, 30); /*iTXt chunk too short*/ + + /*read the key*/ + for(length = 0; length < chunkLength && data[length] != 0; ++length) ; + if(length + 3 >= chunkLength) CERROR_BREAK(error, 75); /*no null termination char, corrupt?*/ + if(length < 1 || length > 79) CERROR_BREAK(error, 89); /*keyword too short or long*/ + + key = (char*)lodepng_malloc(length + 1); + if(!key) CERROR_BREAK(error, 83); /*alloc fail*/ + + lodepng_memcpy(key, data, length); + key[length] = 0; + + /*read the compression method*/ + compressed = data[length + 1]; + if(data[length + 2] != 0) CERROR_BREAK(error, 72); /*the 0 byte indicating compression must be 0*/ + + /*even though it's not allowed by the standard, no error is thrown if + there's no null termination char, if the text is empty for the next 3 texts*/ + + /*read the langtag*/ + begin = length + 3; + length = 0; + for(i = begin; i < chunkLength && data[i] != 0; ++i) ++length; + + langtag = (char*)lodepng_malloc(length + 1); + if(!langtag) CERROR_BREAK(error, 83); /*alloc fail*/ + + lodepng_memcpy(langtag, data + begin, length); + langtag[length] = 0; + + /*read the transkey*/ + begin += length + 1; + length = 0; + for(i = begin; i < chunkLength && data[i] != 0; ++i) ++length; + + transkey = (char*)lodepng_malloc(length + 1); + if(!transkey) CERROR_BREAK(error, 83); /*alloc fail*/ + + lodepng_memcpy(transkey, data + begin, length); + transkey[length] = 0; + + /*read the actual text*/ + begin += length + 1; + + length = (unsigned)chunkLength < begin ? 0 : (unsigned)chunkLength - begin; + + if(compressed) { + unsigned char* str = 0; + size_t size = 0; + /*will fail if zlib error, e.g. if length is too small*/ + error = zlib_decompress(&str, &size, 0, &data[begin], + length, zlibsettings); + if(!error) error = lodepng_add_itext_sized(info, key, langtag, transkey, (char*)str, size); + lodepng_free(str); + } else { + error = lodepng_add_itext_sized(info, key, langtag, transkey, (char*)(data + begin), length); + } + + break; + } + + lodepng_free(key); + lodepng_free(langtag); + lodepng_free(transkey); + + return error; +} + +static unsigned readChunk_tIME(LodePNGInfo* info, const unsigned char* data, size_t chunkLength) { + if(chunkLength != 7) return 73; /*invalid tIME chunk size*/ + + info->time_defined = 1; + info->time.year = 256u * data[0] + data[1]; + info->time.month = data[2]; + info->time.day = data[3]; + info->time.hour = data[4]; + info->time.minute = data[5]; + info->time.second = data[6]; + + return 0; /* OK */ +} + +static unsigned readChunk_pHYs(LodePNGInfo* info, const unsigned char* data, size_t chunkLength) { + if(chunkLength != 9) return 74; /*invalid pHYs chunk size*/ + + info->phys_defined = 1; + info->phys_x = 16777216u * data[0] + 65536u * data[1] + 256u * data[2] + data[3]; + info->phys_y = 16777216u * data[4] + 65536u * data[5] + 256u * data[6] + data[7]; + info->phys_unit = data[8]; + + return 0; /* OK */ +} + +static unsigned readChunk_gAMA(LodePNGInfo* info, const unsigned char* data, size_t chunkLength) { + if(chunkLength != 4) return 96; /*invalid gAMA chunk size*/ + + info->gama_defined = 1; + info->gama_gamma = 16777216u * data[0] + 65536u * data[1] + 256u * data[2] + data[3]; + + return 0; /* OK */ +} + +static unsigned readChunk_cHRM(LodePNGInfo* info, const unsigned char* data, size_t chunkLength) { + if(chunkLength != 32) return 97; /*invalid cHRM chunk size*/ + + info->chrm_defined = 1; + info->chrm_white_x = 16777216u * data[ 0] + 65536u * data[ 1] + 256u * data[ 2] + data[ 3]; + info->chrm_white_y = 16777216u * data[ 4] + 65536u * data[ 5] + 256u * data[ 6] + data[ 7]; + info->chrm_red_x = 16777216u * data[ 8] + 65536u * data[ 9] + 256u * data[10] + data[11]; + info->chrm_red_y = 16777216u * data[12] + 65536u * data[13] + 256u * data[14] + data[15]; + info->chrm_green_x = 16777216u * data[16] + 65536u * data[17] + 256u * data[18] + data[19]; + info->chrm_green_y = 16777216u * data[20] + 65536u * data[21] + 256u * data[22] + data[23]; + info->chrm_blue_x = 16777216u * data[24] + 65536u * data[25] + 256u * data[26] + data[27]; + info->chrm_blue_y = 16777216u * data[28] + 65536u * data[29] + 256u * data[30] + data[31]; + + return 0; /* OK */ +} + +static unsigned readChunk_sRGB(LodePNGInfo* info, const unsigned char* data, size_t chunkLength) { + if(chunkLength != 1) return 98; /*invalid sRGB chunk size (this one is never ignored)*/ + + info->srgb_defined = 1; + info->srgb_intent = data[0]; + + return 0; /* OK */ +} + +static unsigned readChunk_iCCP(LodePNGInfo* info, const LodePNGDecompressSettings* zlibsettings, + const unsigned char* data, size_t chunkLength) { + unsigned error = 0; + unsigned i; + size_t size = 0; + + unsigned length, string2_begin; + + info->iccp_defined = 1; + if(info->iccp_name) lodepng_clear_icc(info); + + for(length = 0; length < chunkLength && data[length] != 0; ++length) ; + if(length + 2 >= chunkLength) return 75; /*no null termination, corrupt?*/ + if(length < 1 || length > 79) return 89; /*keyword too short or long*/ + + info->iccp_name = (char*)lodepng_malloc(length + 1); + if(!info->iccp_name) return 83; /*alloc fail*/ + + info->iccp_name[length] = 0; + for(i = 0; i != length; ++i) info->iccp_name[i] = (char)data[i]; + + if(data[length + 1] != 0) return 72; /*the 0 byte indicating compression must be 0*/ + + string2_begin = length + 2; + if(string2_begin > chunkLength) return 75; /*no null termination, corrupt?*/ + + length = (unsigned)chunkLength - string2_begin; + error = zlib_decompress(&info->iccp_profile, &size, 0, + &data[string2_begin], + length, zlibsettings); + info->iccp_profile_size = size; + if(!error && !info->iccp_profile_size) error = 100; /*invalid ICC profile size*/ + return error; +} +#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ + +unsigned lodepng_inspect_chunk(LodePNGState* state, size_t pos, + const unsigned char* in, size_t insize) { + const unsigned char* chunk = in + pos; + unsigned chunkLength; + const unsigned char* data; + unsigned unhandled = 0; + unsigned error = 0; + + if(pos + 4 > insize) return 30; + chunkLength = lodepng_chunk_length(chunk); + if(chunkLength > 2147483647) return 63; + data = lodepng_chunk_data_const(chunk); + if(data + chunkLength + 4 > in + insize) return 30; + + if(lodepng_chunk_type_equals(chunk, "PLTE")) { + error = readChunk_PLTE(&state->info_png.color, data, chunkLength); + } else if(lodepng_chunk_type_equals(chunk, "tRNS")) { + error = readChunk_tRNS(&state->info_png.color, data, chunkLength); +#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS + } else if(lodepng_chunk_type_equals(chunk, "bKGD")) { + error = readChunk_bKGD(&state->info_png, data, chunkLength); + } else if(lodepng_chunk_type_equals(chunk, "tEXt")) { + error = readChunk_tEXt(&state->info_png, data, chunkLength); + } else if(lodepng_chunk_type_equals(chunk, "zTXt")) { + error = readChunk_zTXt(&state->info_png, &state->decoder.zlibsettings, data, chunkLength); + } else if(lodepng_chunk_type_equals(chunk, "iTXt")) { + error = readChunk_iTXt(&state->info_png, &state->decoder.zlibsettings, data, chunkLength); + } else if(lodepng_chunk_type_equals(chunk, "tIME")) { + error = readChunk_tIME(&state->info_png, data, chunkLength); + } else if(lodepng_chunk_type_equals(chunk, "pHYs")) { + error = readChunk_pHYs(&state->info_png, data, chunkLength); + } else if(lodepng_chunk_type_equals(chunk, "gAMA")) { + error = readChunk_gAMA(&state->info_png, data, chunkLength); + } else if(lodepng_chunk_type_equals(chunk, "cHRM")) { + error = readChunk_cHRM(&state->info_png, data, chunkLength); + } else if(lodepng_chunk_type_equals(chunk, "sRGB")) { + error = readChunk_sRGB(&state->info_png, data, chunkLength); + } else if(lodepng_chunk_type_equals(chunk, "iCCP")) { + error = readChunk_iCCP(&state->info_png, &state->decoder.zlibsettings, data, chunkLength); +#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ + } else { + /* unhandled chunk is ok (is not an error) */ + unhandled = 1; + } + + if(!error && !unhandled && !state->decoder.ignore_crc) { + if(lodepng_chunk_check_crc(chunk)) return 57; /*invalid CRC*/ + } + + return error; +} + +/*read a PNG, the result will be in the same color type as the PNG (hence "generic")*/ +static void decodeGeneric(unsigned char** out, unsigned* w, unsigned* h, + LodePNGState* state, + const unsigned char* in, size_t insize) { + unsigned char IEND = 0; + const unsigned char* chunk; + unsigned char* idat; /*the data from idat chunks, zlib compressed*/ + size_t idatsize = 0; + unsigned char* scanlines = 0; + size_t scanlines_size = 0, expected_size = 0; + size_t outsize = 0; + + /*for unknown chunk order*/ + unsigned unknown = 0; +#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS + unsigned critical_pos = 1; /*1 = after IHDR, 2 = after PLTE, 3 = after IDAT*/ +#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ + + + /* safe output values in case error happens */ + *out = 0; + *w = *h = 0; + + state->error = lodepng_inspect(w, h, state, in, insize); /*reads header and resets other parameters in state->info_png*/ + if(state->error) return; + + if(lodepng_pixel_overflow(*w, *h, &state->info_png.color, &state->info_raw)) { + CERROR_RETURN(state->error, 92); /*overflow possible due to amount of pixels*/ + } + + /*the input filesize is a safe upper bound for the sum of idat chunks size*/ + idat = (unsigned char*)lodepng_malloc(insize); + if(!idat) CERROR_RETURN(state->error, 83); /*alloc fail*/ + + chunk = &in[33]; /*first byte of the first chunk after the header*/ + + /*loop through the chunks, ignoring unknown chunks and stopping at IEND chunk. + IDAT data is put at the start of the in buffer*/ + while(!IEND && !state->error) { + unsigned chunkLength; + const unsigned char* data; /*the data in the chunk*/ + + /*error: size of the in buffer too small to contain next chunk*/ + if((size_t)((chunk - in) + 12) > insize || chunk < in) { + if(state->decoder.ignore_end) break; /*other errors may still happen though*/ + CERROR_BREAK(state->error, 30); + } + + /*length of the data of the chunk, excluding the length bytes, chunk type and CRC bytes*/ + chunkLength = lodepng_chunk_length(chunk); + /*error: chunk length larger than the max PNG chunk size*/ + if(chunkLength > 2147483647) { + if(state->decoder.ignore_end) break; /*other errors may still happen though*/ + CERROR_BREAK(state->error, 63); + } + + if((size_t)((chunk - in) + chunkLength + 12) > insize || (chunk + chunkLength + 12) < in) { + CERROR_BREAK(state->error, 64); /*error: size of the in buffer too small to contain next chunk*/ + } + + data = lodepng_chunk_data_const(chunk); + + unknown = 0; + + /*IDAT chunk, containing compressed image data*/ + if(lodepng_chunk_type_equals(chunk, "IDAT")) { + size_t newsize; + if(lodepng_addofl(idatsize, chunkLength, &newsize)) CERROR_BREAK(state->error, 95); + if(newsize > insize) CERROR_BREAK(state->error, 95); + lodepng_memcpy(idat + idatsize, data, chunkLength); + idatsize += chunkLength; +#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS + critical_pos = 3; +#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ + } else if(lodepng_chunk_type_equals(chunk, "IEND")) { + /*IEND chunk*/ + IEND = 1; + } else if(lodepng_chunk_type_equals(chunk, "PLTE")) { + /*palette chunk (PLTE)*/ + state->error = readChunk_PLTE(&state->info_png.color, data, chunkLength); + if(state->error) break; +#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS + critical_pos = 2; +#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ + } else if(lodepng_chunk_type_equals(chunk, "tRNS")) { + /*palette transparency chunk (tRNS). Even though this one is an ancillary chunk , it is still compiled + in without 'LODEPNG_COMPILE_ANCILLARY_CHUNKS' because it contains essential color information that + affects the alpha channel of pixels. */ + state->error = readChunk_tRNS(&state->info_png.color, data, chunkLength); + if(state->error) break; +#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS + /*background color chunk (bKGD)*/ + } else if(lodepng_chunk_type_equals(chunk, "bKGD")) { + state->error = readChunk_bKGD(&state->info_png, data, chunkLength); + if(state->error) break; + } else if(lodepng_chunk_type_equals(chunk, "tEXt")) { + /*text chunk (tEXt)*/ + if(state->decoder.read_text_chunks) { + state->error = readChunk_tEXt(&state->info_png, data, chunkLength); + if(state->error) break; + } + } else if(lodepng_chunk_type_equals(chunk, "zTXt")) { + /*compressed text chunk (zTXt)*/ + if(state->decoder.read_text_chunks) { + state->error = readChunk_zTXt(&state->info_png, &state->decoder.zlibsettings, data, chunkLength); + if(state->error) break; + } + } else if(lodepng_chunk_type_equals(chunk, "iTXt")) { + /*international text chunk (iTXt)*/ + if(state->decoder.read_text_chunks) { + state->error = readChunk_iTXt(&state->info_png, &state->decoder.zlibsettings, data, chunkLength); + if(state->error) break; + } + } else if(lodepng_chunk_type_equals(chunk, "tIME")) { + state->error = readChunk_tIME(&state->info_png, data, chunkLength); + if(state->error) break; + } else if(lodepng_chunk_type_equals(chunk, "pHYs")) { + state->error = readChunk_pHYs(&state->info_png, data, chunkLength); + if(state->error) break; + } else if(lodepng_chunk_type_equals(chunk, "gAMA")) { + state->error = readChunk_gAMA(&state->info_png, data, chunkLength); + if(state->error) break; + } else if(lodepng_chunk_type_equals(chunk, "cHRM")) { + state->error = readChunk_cHRM(&state->info_png, data, chunkLength); + if(state->error) break; + } else if(lodepng_chunk_type_equals(chunk, "sRGB")) { + state->error = readChunk_sRGB(&state->info_png, data, chunkLength); + if(state->error) break; + } else if(lodepng_chunk_type_equals(chunk, "iCCP")) { + state->error = readChunk_iCCP(&state->info_png, &state->decoder.zlibsettings, data, chunkLength); + if(state->error) break; +#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ + } else /*it's not an implemented chunk type, so ignore it: skip over the data*/ { + /*error: unknown critical chunk (5th bit of first byte of chunk type is 0)*/ + if(!state->decoder.ignore_critical && !lodepng_chunk_ancillary(chunk)) { + CERROR_BREAK(state->error, 69); + } + + unknown = 1; +#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS + if(state->decoder.remember_unknown_chunks) { + state->error = lodepng_chunk_append(&state->info_png.unknown_chunks_data[critical_pos - 1], + &state->info_png.unknown_chunks_size[critical_pos - 1], chunk); + if(state->error) break; + } +#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ + } + + if(!state->decoder.ignore_crc && !unknown) /*check CRC if wanted, only on known chunk types*/ { + if(lodepng_chunk_check_crc(chunk)) CERROR_BREAK(state->error, 57); /*invalid CRC*/ + } + + if(!IEND) chunk = lodepng_chunk_next_const(chunk, in + insize); + } + + if(state->info_png.color.colortype == LCT_PALETTE && !state->info_png.color.palette) { + state->error = 106; /* error: PNG file must have PLTE chunk if color type is palette */ + } + + if(!state->error) { + /*predict output size, to allocate exact size for output buffer to avoid more dynamic allocation. + If the decompressed size does not match the prediction, the image must be corrupt.*/ + if(state->info_png.interlace_method == 0) { + size_t bpp = lodepng_get_bpp(&state->info_png.color); + expected_size = lodepng_get_raw_size_idat(*w, *h, bpp); + } else { + size_t bpp = lodepng_get_bpp(&state->info_png.color); + /*Adam-7 interlaced: expected size is the sum of the 7 sub-images sizes*/ + expected_size = 0; + expected_size += lodepng_get_raw_size_idat((*w + 7) >> 3, (*h + 7) >> 3, bpp); + if(*w > 4) expected_size += lodepng_get_raw_size_idat((*w + 3) >> 3, (*h + 7) >> 3, bpp); + expected_size += lodepng_get_raw_size_idat((*w + 3) >> 2, (*h + 3) >> 3, bpp); + if(*w > 2) expected_size += lodepng_get_raw_size_idat((*w + 1) >> 2, (*h + 3) >> 2, bpp); + expected_size += lodepng_get_raw_size_idat((*w + 1) >> 1, (*h + 1) >> 2, bpp); + if(*w > 1) expected_size += lodepng_get_raw_size_idat((*w + 0) >> 1, (*h + 1) >> 1, bpp); + expected_size += lodepng_get_raw_size_idat((*w + 0), (*h + 0) >> 1, bpp); + } + + state->error = zlib_decompress(&scanlines, &scanlines_size, expected_size, idat, idatsize, &state->decoder.zlibsettings); + } + if(!state->error && scanlines_size != expected_size) state->error = 91; /*decompressed size doesn't match prediction*/ + lodepng_free(idat); + + if(!state->error) { + outsize = lodepng_get_raw_size(*w, *h, &state->info_png.color); + *out = (unsigned char*)lodepng_malloc(outsize); + if(!*out) state->error = 83; /*alloc fail*/ + } + if(!state->error) { + lodepng_memset(*out, 0, outsize); + state->error = postProcessScanlines(*out, scanlines, *w, *h, &state->info_png); + } + lodepng_free(scanlines); +} + +unsigned lodepng_decode(unsigned char** out, unsigned* w, unsigned* h, + LodePNGState* state, + const unsigned char* in, size_t insize) { + *out = 0; + decodeGeneric(out, w, h, state, in, insize); + if(state->error) return state->error; + if(!state->decoder.color_convert || lodepng_color_mode_equal(&state->info_raw, &state->info_png.color)) { + /*same color type, no copying or converting of data needed*/ + /*store the info_png color settings on the info_raw so that the info_raw still reflects what colortype + the raw image has to the end user*/ + if(!state->decoder.color_convert) { + state->error = lodepng_color_mode_copy(&state->info_raw, &state->info_png.color); + if(state->error) return state->error; + } + } else { /*color conversion needed*/ + unsigned char* data = *out; + size_t outsize; + + /*TODO: check if this works according to the statement in the documentation: "The converter can convert + from grayscale input color type, to 8-bit grayscale or grayscale with alpha"*/ + if(!(state->info_raw.colortype == LCT_RGB || state->info_raw.colortype == LCT_RGBA) + && !(state->info_raw.bitdepth == 8)) { + return 56; /*unsupported color mode conversion*/ + } + + outsize = lodepng_get_raw_size(*w, *h, &state->info_raw); + *out = (unsigned char*)lodepng_malloc(outsize); + if(!(*out)) { + state->error = 83; /*alloc fail*/ + } + else state->error = lodepng_convert(*out, data, &state->info_raw, + &state->info_png.color, *w, *h); + lodepng_free(data); + } + return state->error; +} + +unsigned lodepng_decode_memory(unsigned char** out, unsigned* w, unsigned* h, const unsigned char* in, + size_t insize, LodePNGColorType colortype, unsigned bitdepth) { + unsigned error; + LodePNGState state; + lodepng_state_init(&state); + state.info_raw.colortype = colortype; + state.info_raw.bitdepth = bitdepth; + error = lodepng_decode(out, w, h, &state, in, insize); + lodepng_state_cleanup(&state); + return error; +} + +unsigned lodepng_decode32(unsigned char** out, unsigned* w, unsigned* h, const unsigned char* in, size_t insize) { + return lodepng_decode_memory(out, w, h, in, insize, LCT_RGBA, 8); +} + +unsigned lodepng_decode24(unsigned char** out, unsigned* w, unsigned* h, const unsigned char* in, size_t insize) { + return lodepng_decode_memory(out, w, h, in, insize, LCT_RGB, 8); +} + +#ifdef LODEPNG_COMPILE_DISK +unsigned lodepng_decode_file(unsigned char** out, unsigned* w, unsigned* h, const char* filename, + LodePNGColorType colortype, unsigned bitdepth) { + unsigned char* buffer = 0; + size_t buffersize; + unsigned error; + /* safe output values in case error happens */ + *out = 0; + *w = *h = 0; + error = lodepng_load_file(&buffer, &buffersize, filename); + if(!error) error = lodepng_decode_memory(out, w, h, buffer, buffersize, colortype, bitdepth); + lodepng_free(buffer); + return error; +} + +unsigned lodepng_decode32_file(unsigned char** out, unsigned* w, unsigned* h, const char* filename) { + return lodepng_decode_file(out, w, h, filename, LCT_RGBA, 8); +} + +unsigned lodepng_decode24_file(unsigned char** out, unsigned* w, unsigned* h, const char* filename) { + return lodepng_decode_file(out, w, h, filename, LCT_RGB, 8); +} +#endif /*LODEPNG_COMPILE_DISK*/ + +void lodepng_decoder_settings_init(LodePNGDecoderSettings* settings) { + settings->color_convert = 1; +#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS + settings->read_text_chunks = 1; + settings->remember_unknown_chunks = 0; +#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ + settings->ignore_crc = 0; + settings->ignore_critical = 0; + settings->ignore_end = 0; + lodepng_decompress_settings_init(&settings->zlibsettings); +} + +#endif /*LODEPNG_COMPILE_DECODER*/ + +#if defined(LODEPNG_COMPILE_DECODER) || defined(LODEPNG_COMPILE_ENCODER) + +void lodepng_state_init(LodePNGState* state) { +#ifdef LODEPNG_COMPILE_DECODER + lodepng_decoder_settings_init(&state->decoder); +#endif /*LODEPNG_COMPILE_DECODER*/ +#ifdef LODEPNG_COMPILE_ENCODER + lodepng_encoder_settings_init(&state->encoder); +#endif /*LODEPNG_COMPILE_ENCODER*/ + lodepng_color_mode_init(&state->info_raw); + lodepng_info_init(&state->info_png); + state->error = 1; +} + +void lodepng_state_cleanup(LodePNGState* state) { + lodepng_color_mode_cleanup(&state->info_raw); + lodepng_info_cleanup(&state->info_png); +} + +void lodepng_state_copy(LodePNGState* dest, const LodePNGState* source) { + lodepng_state_cleanup(dest); + *dest = *source; + lodepng_color_mode_init(&dest->info_raw); + lodepng_info_init(&dest->info_png); + dest->error = lodepng_color_mode_copy(&dest->info_raw, &source->info_raw); if(dest->error) return; + dest->error = lodepng_info_copy(&dest->info_png, &source->info_png); if(dest->error) return; +} + +#endif /* defined(LODEPNG_COMPILE_DECODER) || defined(LODEPNG_COMPILE_ENCODER) */ + +#ifdef LODEPNG_COMPILE_ENCODER + +/* ////////////////////////////////////////////////////////////////////////// */ +/* / PNG Encoder / */ +/* ////////////////////////////////////////////////////////////////////////// */ + + +static unsigned writeSignature(ucvector* out) { + size_t pos = out->size; + const unsigned char signature[] = {137, 80, 78, 71, 13, 10, 26, 10}; + /*8 bytes PNG signature, aka the magic bytes*/ + if(!ucvector_resize(out, out->size + 8)) return 83; /*alloc fail*/ + lodepng_memcpy(out->data + pos, signature, 8); + return 0; +} + +static unsigned addChunk_IHDR(ucvector* out, unsigned w, unsigned h, + LodePNGColorType colortype, unsigned bitdepth, unsigned interlace_method) { + unsigned char *chunk, *data; + CERROR_TRY_RETURN(lodepng_chunk_init(&chunk, out, 13, "IHDR")); + data = chunk + 8; + + lodepng_set32bitInt(data + 0, w); /*width*/ + lodepng_set32bitInt(data + 4, h); /*height*/ + data[8] = (unsigned char)bitdepth; /*bit depth*/ + data[9] = (unsigned char)colortype; /*color type*/ + data[10] = 0; /*compression method*/ + data[11] = 0; /*filter method*/ + data[12] = interlace_method; /*interlace method*/ + + lodepng_chunk_generate_crc(chunk); + return 0; +} + +/* only adds the chunk if needed (there is a key or palette with alpha) */ +static unsigned addChunk_PLTE(ucvector* out, const LodePNGColorMode* info) { + unsigned char* chunk; + size_t i, j = 8; + + CERROR_TRY_RETURN(lodepng_chunk_init(&chunk, out, info->palettesize * 3, "PLTE")); + + for(i = 0; i != info->palettesize; ++i) { + /*add all channels except alpha channel*/ + chunk[j++] = info->palette[i * 4 + 0]; + chunk[j++] = info->palette[i * 4 + 1]; + chunk[j++] = info->palette[i * 4 + 2]; + } + + lodepng_chunk_generate_crc(chunk); + return 0; +} + +static unsigned addChunk_tRNS(ucvector* out, const LodePNGColorMode* info) { + unsigned char* chunk = 0; + + if(info->colortype == LCT_PALETTE) { + size_t i, amount = info->palettesize; + /*the tail of palette values that all have 255 as alpha, does not have to be encoded*/ + for(i = info->palettesize; i != 0; --i) { + if(info->palette[4 * (i - 1) + 3] != 255) break; + --amount; + } + if(amount) { + CERROR_TRY_RETURN(lodepng_chunk_init(&chunk, out, amount, "tRNS")); + /*add the alpha channel values from the palette*/ + for(i = 0; i != amount; ++i) chunk[8 + i] = info->palette[4 * i + 3]; + } + } else if(info->colortype == LCT_GREY) { + if(info->key_defined) { + CERROR_TRY_RETURN(lodepng_chunk_init(&chunk, out, 2, "tRNS")); + chunk[8] = (unsigned char)(info->key_r >> 8); + chunk[9] = (unsigned char)(info->key_r & 255); + } + } else if(info->colortype == LCT_RGB) { + if(info->key_defined) { + CERROR_TRY_RETURN(lodepng_chunk_init(&chunk, out, 6, "tRNS")); + chunk[8] = (unsigned char)(info->key_r >> 8); + chunk[9] = (unsigned char)(info->key_r & 255); + chunk[10] = (unsigned char)(info->key_g >> 8); + chunk[11] = (unsigned char)(info->key_g & 255); + chunk[12] = (unsigned char)(info->key_b >> 8); + chunk[13] = (unsigned char)(info->key_b & 255); + } + } + + if(chunk) lodepng_chunk_generate_crc(chunk); + return 0; +} + +static unsigned addChunk_IDAT(ucvector* out, const unsigned char* data, size_t datasize, + LodePNGCompressSettings* zlibsettings) { + unsigned error = 0; + unsigned char* zlib = 0; + size_t zlibsize = 0; + + error = zlib_compress(&zlib, &zlibsize, data, datasize, zlibsettings); + if(!error) { + error = lodepng_chunk_createv(out, zlibsize, "IDAT", zlib); + } + lodepng_free(zlib); + return error; +} + +static unsigned addChunk_IEND(ucvector* out) { + return lodepng_chunk_createv(out, 0, "IEND", 0); +} + +#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS + +static unsigned addChunk_tEXt(ucvector* out, const char* keyword, const char* textstring) { + unsigned char* chunk = 0; + size_t keysize = lodepng_strlen(keyword), textsize = lodepng_strlen(textstring); + size_t size = keysize + 1 + textsize; + if(keysize < 1 || keysize > 79) return 89; /*error: invalid keyword size*/ + CERROR_TRY_RETURN(lodepng_chunk_init(&chunk, out, size, "tEXt")); + lodepng_memcpy(chunk + 8, keyword, keysize); + chunk[8 + keysize] = 0; /*null termination char*/ + lodepng_memcpy(chunk + 9 + keysize, textstring, textsize); + lodepng_chunk_generate_crc(chunk); + return 0; +} + +static unsigned addChunk_zTXt(ucvector* out, const char* keyword, const char* textstring, + LodePNGCompressSettings* zlibsettings) { + unsigned error = 0; + unsigned char* chunk = 0; + unsigned char* compressed = 0; + size_t compressedsize = 0; + size_t textsize = lodepng_strlen(textstring); + size_t keysize = lodepng_strlen(keyword); + if(keysize < 1 || keysize > 79) return 89; /*error: invalid keyword size*/ + + error = zlib_compress(&compressed, &compressedsize, + (const unsigned char*)textstring, textsize, zlibsettings); + if(!error) { + size_t size = keysize + 2 + compressedsize; + error = lodepng_chunk_init(&chunk, out, size, "zTXt"); + } + if(!error) { + lodepng_memcpy(chunk + 8, keyword, keysize); + chunk[8 + keysize] = 0; /*null termination char*/ + chunk[9 + keysize] = 0; /*compression method: 0*/ + lodepng_memcpy(chunk + 10 + keysize, compressed, compressedsize); + lodepng_chunk_generate_crc(chunk); + } + + lodepng_free(compressed); + return error; +} + +static unsigned addChunk_iTXt(ucvector* out, unsigned compress, const char* keyword, const char* langtag, + const char* transkey, const char* textstring, LodePNGCompressSettings* zlibsettings) { + unsigned error = 0; + unsigned char* chunk = 0; + unsigned char* compressed = 0; + size_t compressedsize = 0; + size_t textsize = lodepng_strlen(textstring); + size_t keysize = lodepng_strlen(keyword), langsize = lodepng_strlen(langtag), transsize = lodepng_strlen(transkey); + + if(keysize < 1 || keysize > 79) return 89; /*error: invalid keyword size*/ + + if(compress) { + error = zlib_compress(&compressed, &compressedsize, + (const unsigned char*)textstring, textsize, zlibsettings); + } + if(!error) { + size_t size = keysize + 3 + langsize + 1 + transsize + 1 + (compress ? compressedsize : textsize); + error = lodepng_chunk_init(&chunk, out, size, "iTXt"); + } + if(!error) { + size_t pos = 8; + lodepng_memcpy(chunk + pos, keyword, keysize); + pos += keysize; + chunk[pos++] = 0; /*null termination char*/ + chunk[pos++] = (compress ? 1 : 0); /*compression flag*/ + chunk[pos++] = 0; /*compression method: 0*/ + lodepng_memcpy(chunk + pos, langtag, langsize); + pos += langsize; + chunk[pos++] = 0; /*null termination char*/ + lodepng_memcpy(chunk + pos, transkey, transsize); + pos += transsize; + chunk[pos++] = 0; /*null termination char*/ + if(compress) { + lodepng_memcpy(chunk + pos, compressed, compressedsize); + } else { + lodepng_memcpy(chunk + pos, textstring, textsize); + } + lodepng_chunk_generate_crc(chunk); + } + + lodepng_free(compressed); + return error; +} + +static unsigned addChunk_bKGD(ucvector* out, const LodePNGInfo* info) { + unsigned char* chunk = 0; + if(info->color.colortype == LCT_GREY || info->color.colortype == LCT_GREY_ALPHA) { + CERROR_TRY_RETURN(lodepng_chunk_init(&chunk, out, 2, "bKGD")); + chunk[8] = (unsigned char)(info->background_r >> 8); + chunk[9] = (unsigned char)(info->background_r & 255); + } else if(info->color.colortype == LCT_RGB || info->color.colortype == LCT_RGBA) { + CERROR_TRY_RETURN(lodepng_chunk_init(&chunk, out, 6, "bKGD")); + chunk[8] = (unsigned char)(info->background_r >> 8); + chunk[9] = (unsigned char)(info->background_r & 255); + chunk[10] = (unsigned char)(info->background_g >> 8); + chunk[11] = (unsigned char)(info->background_g & 255); + chunk[12] = (unsigned char)(info->background_b >> 8); + chunk[13] = (unsigned char)(info->background_b & 255); + } else if(info->color.colortype == LCT_PALETTE) { + CERROR_TRY_RETURN(lodepng_chunk_init(&chunk, out, 1, "bKGD")); + chunk[8] = (unsigned char)(info->background_r & 255); /*palette index*/ + } + if(chunk) lodepng_chunk_generate_crc(chunk); + return 0; +} + +static unsigned addChunk_tIME(ucvector* out, const LodePNGTime* time) { + unsigned char* chunk; + CERROR_TRY_RETURN(lodepng_chunk_init(&chunk, out, 7, "tIME")); + chunk[8] = (unsigned char)(time->year >> 8); + chunk[9] = (unsigned char)(time->year & 255); + chunk[10] = (unsigned char)time->month; + chunk[11] = (unsigned char)time->day; + chunk[12] = (unsigned char)time->hour; + chunk[13] = (unsigned char)time->minute; + chunk[14] = (unsigned char)time->second; + lodepng_chunk_generate_crc(chunk); + return 0; +} + +static unsigned addChunk_pHYs(ucvector* out, const LodePNGInfo* info) { + unsigned char* chunk; + CERROR_TRY_RETURN(lodepng_chunk_init(&chunk, out, 9, "pHYs")); + lodepng_set32bitInt(chunk + 8, info->phys_x); + lodepng_set32bitInt(chunk + 12, info->phys_y); + chunk[16] = info->phys_unit; + lodepng_chunk_generate_crc(chunk); + return 0; +} + +static unsigned addChunk_gAMA(ucvector* out, const LodePNGInfo* info) { + unsigned char* chunk; + CERROR_TRY_RETURN(lodepng_chunk_init(&chunk, out, 4, "gAMA")); + lodepng_set32bitInt(chunk + 8, info->gama_gamma); + lodepng_chunk_generate_crc(chunk); + return 0; +} + +static unsigned addChunk_cHRM(ucvector* out, const LodePNGInfo* info) { + unsigned char* chunk; + CERROR_TRY_RETURN(lodepng_chunk_init(&chunk, out, 32, "cHRM")); + lodepng_set32bitInt(chunk + 8, info->chrm_white_x); + lodepng_set32bitInt(chunk + 12, info->chrm_white_y); + lodepng_set32bitInt(chunk + 16, info->chrm_red_x); + lodepng_set32bitInt(chunk + 20, info->chrm_red_y); + lodepng_set32bitInt(chunk + 24, info->chrm_green_x); + lodepng_set32bitInt(chunk + 28, info->chrm_green_y); + lodepng_set32bitInt(chunk + 32, info->chrm_blue_x); + lodepng_set32bitInt(chunk + 36, info->chrm_blue_y); + lodepng_chunk_generate_crc(chunk); + return 0; +} + +static unsigned addChunk_sRGB(ucvector* out, const LodePNGInfo* info) { + unsigned char data = info->srgb_intent; + return lodepng_chunk_createv(out, 1, "sRGB", &data); +} + +static unsigned addChunk_iCCP(ucvector* out, const LodePNGInfo* info, LodePNGCompressSettings* zlibsettings) { + unsigned error = 0; + unsigned char* chunk = 0; + unsigned char* compressed = 0; + size_t compressedsize = 0; + size_t keysize = lodepng_strlen(info->iccp_name); + + if(keysize < 1 || keysize > 79) return 89; /*error: invalid keyword size*/ + error = zlib_compress(&compressed, &compressedsize, + info->iccp_profile, info->iccp_profile_size, zlibsettings); + if(!error) { + size_t size = keysize + 2 + compressedsize; + error = lodepng_chunk_init(&chunk, out, size, "iCCP"); + } + if(!error) { + lodepng_memcpy(chunk + 8, info->iccp_name, keysize); + chunk[8 + keysize] = 0; /*null termination char*/ + chunk[9 + keysize] = 0; /*compression method: 0*/ + lodepng_memcpy(chunk + 10 + keysize, compressed, compressedsize); + lodepng_chunk_generate_crc(chunk); + } + + lodepng_free(compressed); + return error; +} + +#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ + +static void filterScanline(unsigned char* out, const unsigned char* scanline, const unsigned char* prevline, + size_t length, size_t bytewidth, unsigned char filterType) { + size_t i; + switch(filterType) { + case 0: /*None*/ + for(i = 0; i != length; ++i) out[i] = scanline[i]; + break; + case 1: /*Sub*/ + for(i = 0; i != bytewidth; ++i) out[i] = scanline[i]; + for(i = bytewidth; i < length; ++i) out[i] = scanline[i] - scanline[i - bytewidth]; + break; + case 2: /*Up*/ + if(prevline) { + for(i = 0; i != length; ++i) out[i] = scanline[i] - prevline[i]; + } else { + for(i = 0; i != length; ++i) out[i] = scanline[i]; + } + break; + case 3: /*Average*/ + if(prevline) { + for(i = 0; i != bytewidth; ++i) out[i] = scanline[i] - (prevline[i] >> 1); + for(i = bytewidth; i < length; ++i) out[i] = scanline[i] - ((scanline[i - bytewidth] + prevline[i]) >> 1); + } else { + for(i = 0; i != bytewidth; ++i) out[i] = scanline[i]; + for(i = bytewidth; i < length; ++i) out[i] = scanline[i] - (scanline[i - bytewidth] >> 1); + } + break; + case 4: /*Paeth*/ + if(prevline) { + /*paethPredictor(0, prevline[i], 0) is always prevline[i]*/ + for(i = 0; i != bytewidth; ++i) out[i] = (scanline[i] - prevline[i]); + for(i = bytewidth; i < length; ++i) { + out[i] = (scanline[i] - paethPredictor(scanline[i - bytewidth], prevline[i], prevline[i - bytewidth])); + } + } else { + for(i = 0; i != bytewidth; ++i) out[i] = scanline[i]; + /*paethPredictor(scanline[i - bytewidth], 0, 0) is always scanline[i - bytewidth]*/ + for(i = bytewidth; i < length; ++i) out[i] = (scanline[i] - scanline[i - bytewidth]); + } + break; + default: return; /*invalid filter type given*/ + } +} + +/* integer binary logarithm, max return value is 31 */ +static size_t ilog2(size_t i) { + size_t result = 0; + if(i >= 65536) { result += 16; i >>= 16; } + if(i >= 256) { result += 8; i >>= 8; } + if(i >= 16) { result += 4; i >>= 4; } + if(i >= 4) { result += 2; i >>= 2; } + if(i >= 2) { result += 1; /*i >>= 1;*/ } + return result; +} + +/* integer approximation for i * log2(i), helper function for LFS_ENTROPY */ +static size_t ilog2i(size_t i) { + size_t l; + if(i == 0) return 0; + l = ilog2(i); + /* approximate i*log2(i): l is integer logarithm, ((i - (1u << l)) << 1u) + linearly approximates the missing fractional part multiplied by i */ + return i * l + ((i - (1u << l)) << 1u); +} + +static unsigned filter(unsigned char* out, const unsigned char* in, unsigned w, unsigned h, + const LodePNGColorMode* color, const LodePNGEncoderSettings* settings) { + /* + For PNG filter method 0 + out must be a buffer with as size: h + (w * h * bpp + 7u) / 8u, because there are + the scanlines with 1 extra byte per scanline + */ + + unsigned bpp = lodepng_get_bpp(color); + /*the width of a scanline in bytes, not including the filter type*/ + size_t linebytes = lodepng_get_raw_size_idat(w, 1, bpp) - 1u; + + /*bytewidth is used for filtering, is 1 when bpp < 8, number of bytes per pixel otherwise*/ + size_t bytewidth = (bpp + 7u) / 8u; + const unsigned char* prevline = 0; + unsigned x, y; + unsigned error = 0; + LodePNGFilterStrategy strategy = settings->filter_strategy; + + /* + There is a heuristic called the minimum sum of absolute differences heuristic, suggested by the PNG standard: + * If the image type is Palette, or the bit depth is smaller than 8, then do not filter the image (i.e. + use fixed filtering, with the filter None). + * (The other case) If the image type is Grayscale or RGB (with or without Alpha), and the bit depth is + not smaller than 8, then use adaptive filtering heuristic as follows: independently for each row, apply + all five filters and select the filter that produces the smallest sum of absolute values per row. + This heuristic is used if filter strategy is LFS_MINSUM and filter_palette_zero is true. + + If filter_palette_zero is true and filter_strategy is not LFS_MINSUM, the above heuristic is followed, + but for "the other case", whatever strategy filter_strategy is set to instead of the minimum sum + heuristic is used. + */ + if(settings->filter_palette_zero && + (color->colortype == LCT_PALETTE || color->bitdepth < 8)) strategy = LFS_ZERO; + + if(bpp == 0) return 31; /*error: invalid color type*/ + + if(strategy >= LFS_ZERO && strategy <= LFS_FOUR) { + unsigned char type = (unsigned char)strategy; + for(y = 0; y != h; ++y) { + size_t outindex = (1 + linebytes) * y; /*the extra filterbyte added to each row*/ + size_t inindex = linebytes * y; + out[outindex] = type; /*filter type byte*/ + filterScanline(&out[outindex + 1], &in[inindex], prevline, linebytes, bytewidth, type); + prevline = &in[inindex]; + } + } else if(strategy == LFS_MINSUM) { + /*adaptive filtering*/ + unsigned char* attempt[5]; /*five filtering attempts, one for each filter type*/ + size_t smallest = 0; + unsigned char type, bestType = 0; + + for(type = 0; type != 5; ++type) { + attempt[type] = (unsigned char*)lodepng_malloc(linebytes); + if(!attempt[type]) error = 83; /*alloc fail*/ + } + + if(!error) { + for(y = 0; y != h; ++y) { + /*try the 5 filter types*/ + for(type = 0; type != 5; ++type) { + size_t sum = 0; + filterScanline(attempt[type], &in[y * linebytes], prevline, linebytes, bytewidth, type); + + /*calculate the sum of the result*/ + if(type == 0) { + for(x = 0; x != linebytes; ++x) sum += (unsigned char)(attempt[type][x]); + } else { + for(x = 0; x != linebytes; ++x) { + /*For differences, each byte should be treated as signed, values above 127 are negative + (converted to signed char). Filtertype 0 isn't a difference though, so use unsigned there. + This means filtertype 0 is almost never chosen, but that is justified.*/ + unsigned char s = attempt[type][x]; + sum += s < 128 ? s : (255U - s); + } + } + + /*check if this is smallest sum (or if type == 0 it's the first case so always store the values)*/ + if(type == 0 || sum < smallest) { + bestType = type; + smallest = sum; + } + } + + prevline = &in[y * linebytes]; + + /*now fill the out values*/ + out[y * (linebytes + 1)] = bestType; /*the first byte of a scanline will be the filter type*/ + for(x = 0; x != linebytes; ++x) out[y * (linebytes + 1) + 1 + x] = attempt[bestType][x]; + } + } + + for(type = 0; type != 5; ++type) lodepng_free(attempt[type]); + } else if(strategy == LFS_ENTROPY) { + unsigned char* attempt[5]; /*five filtering attempts, one for each filter type*/ + size_t bestSum = 0; + unsigned type, bestType = 0; + unsigned count[256]; + + for(type = 0; type != 5; ++type) { + attempt[type] = (unsigned char*)lodepng_malloc(linebytes); + if(!attempt[type]) error = 83; /*alloc fail*/ + } + + if(!error) { + for(y = 0; y != h; ++y) { + /*try the 5 filter types*/ + for(type = 0; type != 5; ++type) { + size_t sum = 0; + filterScanline(attempt[type], &in[y * linebytes], prevline, linebytes, bytewidth, type); + lodepng_memset(count, 0, 256 * sizeof(*count)); + for(x = 0; x != linebytes; ++x) ++count[attempt[type][x]]; + ++count[type]; /*the filter type itself is part of the scanline*/ + for(x = 0; x != 256; ++x) { + sum += ilog2i(count[x]); + } + /*check if this is smallest sum (or if type == 0 it's the first case so always store the values)*/ + if(type == 0 || sum > bestSum) { + bestType = type; + bestSum = sum; + } + } + + prevline = &in[y * linebytes]; + + /*now fill the out values*/ + out[y * (linebytes + 1)] = bestType; /*the first byte of a scanline will be the filter type*/ + for(x = 0; x != linebytes; ++x) out[y * (linebytes + 1) + 1 + x] = attempt[bestType][x]; + } + } + + for(type = 0; type != 5; ++type) lodepng_free(attempt[type]); + } else if(strategy == LFS_PREDEFINED) { + for(y = 0; y != h; ++y) { + size_t outindex = (1 + linebytes) * y; /*the extra filterbyte added to each row*/ + size_t inindex = linebytes * y; + unsigned char type = settings->predefined_filters[y]; + out[outindex] = type; /*filter type byte*/ + filterScanline(&out[outindex + 1], &in[inindex], prevline, linebytes, bytewidth, type); + prevline = &in[inindex]; + } + } else if(strategy == LFS_BRUTE_FORCE) { + /*brute force filter chooser. + deflate the scanline after every filter attempt to see which one deflates best. + This is very slow and gives only slightly smaller, sometimes even larger, result*/ + size_t size[5]; + unsigned char* attempt[5]; /*five filtering attempts, one for each filter type*/ + size_t smallest = 0; + unsigned type = 0, bestType = 0; + unsigned char* dummy; + LodePNGCompressSettings zlibsettings; + lodepng_memcpy(&zlibsettings, &settings->zlibsettings, sizeof(LodePNGCompressSettings)); + /*use fixed tree on the attempts so that the tree is not adapted to the filtertype on purpose, + to simulate the true case where the tree is the same for the whole image. Sometimes it gives + better result with dynamic tree anyway. Using the fixed tree sometimes gives worse, but in rare + cases better compression. It does make this a bit less slow, so it's worth doing this.*/ + zlibsettings.btype = 1; + /*a custom encoder likely doesn't read the btype setting and is optimized for complete PNG + images only, so disable it*/ + zlibsettings.custom_zlib = 0; + zlibsettings.custom_deflate = 0; + for(type = 0; type != 5; ++type) { + attempt[type] = (unsigned char*)lodepng_malloc(linebytes); + if(!attempt[type]) error = 83; /*alloc fail*/ + } + if(!error) { + for(y = 0; y != h; ++y) /*try the 5 filter types*/ { + for(type = 0; type != 5; ++type) { + unsigned testsize = (unsigned)linebytes; + /*if(testsize > 8) testsize /= 8;*/ /*it already works good enough by testing a part of the row*/ + + filterScanline(attempt[type], &in[y * linebytes], prevline, linebytes, bytewidth, type); + size[type] = 0; + dummy = 0; + zlib_compress(&dummy, &size[type], attempt[type], testsize, &zlibsettings); + lodepng_free(dummy); + /*check if this is smallest size (or if type == 0 it's the first case so always store the values)*/ + if(type == 0 || size[type] < smallest) { + bestType = type; + smallest = size[type]; + } + } + prevline = &in[y * linebytes]; + out[y * (linebytes + 1)] = bestType; /*the first byte of a scanline will be the filter type*/ + for(x = 0; x != linebytes; ++x) out[y * (linebytes + 1) + 1 + x] = attempt[bestType][x]; + } + } + for(type = 0; type != 5; ++type) lodepng_free(attempt[type]); + } + else return 88; /* unknown filter strategy */ + + return error; +} + +static void addPaddingBits(unsigned char* out, const unsigned char* in, + size_t olinebits, size_t ilinebits, unsigned h) { + /*The opposite of the removePaddingBits function + olinebits must be >= ilinebits*/ + unsigned y; + size_t diff = olinebits - ilinebits; + size_t obp = 0, ibp = 0; /*bit pointers*/ + for(y = 0; y != h; ++y) { + size_t x; + for(x = 0; x < ilinebits; ++x) { + unsigned char bit = readBitFromReversedStream(&ibp, in); + setBitOfReversedStream(&obp, out, bit); + } + /*obp += diff; --> no, fill in some value in the padding bits too, to avoid + "Use of uninitialised value of size ###" warning from valgrind*/ + for(x = 0; x != diff; ++x) setBitOfReversedStream(&obp, out, 0); + } +} + +/* +in: non-interlaced image with size w*h +out: the same pixels, but re-ordered according to PNG's Adam7 interlacing, with + no padding bits between scanlines, but between reduced images so that each + reduced image starts at a byte. +bpp: bits per pixel +there are no padding bits, not between scanlines, not between reduced images +in has the following size in bits: w * h * bpp. +out is possibly bigger due to padding bits between reduced images +NOTE: comments about padding bits are only relevant if bpp < 8 +*/ +static void Adam7_interlace(unsigned char* out, const unsigned char* in, unsigned w, unsigned h, unsigned bpp) { + unsigned passw[7], passh[7]; + size_t filter_passstart[8], padded_passstart[8], passstart[8]; + unsigned i; + + Adam7_getpassvalues(passw, passh, filter_passstart, padded_passstart, passstart, w, h, bpp); + + if(bpp >= 8) { + for(i = 0; i != 7; ++i) { + unsigned x, y, b; + size_t bytewidth = bpp / 8u; + for(y = 0; y < passh[i]; ++y) + for(x = 0; x < passw[i]; ++x) { + size_t pixelinstart = ((ADAM7_IY[i] + y * ADAM7_DY[i]) * w + ADAM7_IX[i] + x * ADAM7_DX[i]) * bytewidth; + size_t pixeloutstart = passstart[i] + (y * passw[i] + x) * bytewidth; + for(b = 0; b < bytewidth; ++b) { + out[pixeloutstart + b] = in[pixelinstart + b]; + } + } + } + } else /*bpp < 8: Adam7 with pixels < 8 bit is a bit trickier: with bit pointers*/ { + for(i = 0; i != 7; ++i) { + unsigned x, y, b; + unsigned ilinebits = bpp * passw[i]; + unsigned olinebits = bpp * w; + size_t obp, ibp; /*bit pointers (for out and in buffer)*/ + for(y = 0; y < passh[i]; ++y) + for(x = 0; x < passw[i]; ++x) { + ibp = (ADAM7_IY[i] + y * ADAM7_DY[i]) * olinebits + (ADAM7_IX[i] + x * ADAM7_DX[i]) * bpp; + obp = (8 * passstart[i]) + (y * ilinebits + x * bpp); + for(b = 0; b < bpp; ++b) { + unsigned char bit = readBitFromReversedStream(&ibp, in); + setBitOfReversedStream(&obp, out, bit); + } + } + } + } +} + +/*out must be buffer big enough to contain uncompressed IDAT chunk data, and in must contain the full image. +return value is error**/ +static unsigned preProcessScanlines(unsigned char** out, size_t* outsize, const unsigned char* in, + unsigned w, unsigned h, + const LodePNGInfo* info_png, const LodePNGEncoderSettings* settings) { + /* + This function converts the pure 2D image with the PNG's colortype, into filtered-padded-interlaced data. Steps: + *) if no Adam7: 1) add padding bits (= possible extra bits per scanline if bpp < 8) 2) filter + *) if adam7: 1) Adam7_interlace 2) 7x add padding bits 3) 7x filter + */ + unsigned bpp = lodepng_get_bpp(&info_png->color); + unsigned error = 0; + + if(info_png->interlace_method == 0) { + *outsize = h + (h * ((w * bpp + 7u) / 8u)); /*image size plus an extra byte per scanline + possible padding bits*/ + *out = (unsigned char*)lodepng_malloc(*outsize); + if(!(*out) && (*outsize)) error = 83; /*alloc fail*/ + + if(!error) { + /*non multiple of 8 bits per scanline, padding bits needed per scanline*/ + if(bpp < 8 && w * bpp != ((w * bpp + 7u) / 8u) * 8u) { + unsigned char* padded = (unsigned char*)lodepng_malloc(h * ((w * bpp + 7u) / 8u)); + if(!padded) error = 83; /*alloc fail*/ + if(!error) { + addPaddingBits(padded, in, ((w * bpp + 7u) / 8u) * 8u, w * bpp, h); + error = filter(*out, padded, w, h, &info_png->color, settings); + } + lodepng_free(padded); + } else { + /*we can immediately filter into the out buffer, no other steps needed*/ + error = filter(*out, in, w, h, &info_png->color, settings); + } + } + } else /*interlace_method is 1 (Adam7)*/ { + unsigned passw[7], passh[7]; + size_t filter_passstart[8], padded_passstart[8], passstart[8]; + unsigned char* adam7; + + Adam7_getpassvalues(passw, passh, filter_passstart, padded_passstart, passstart, w, h, bpp); + + *outsize = filter_passstart[7]; /*image size plus an extra byte per scanline + possible padding bits*/ + *out = (unsigned char*)lodepng_malloc(*outsize); + if(!(*out)) error = 83; /*alloc fail*/ + + adam7 = (unsigned char*)lodepng_malloc(passstart[7]); + if(!adam7 && passstart[7]) error = 83; /*alloc fail*/ + + if(!error) { + unsigned i; + + Adam7_interlace(adam7, in, w, h, bpp); + for(i = 0; i != 7; ++i) { + if(bpp < 8) { + unsigned char* padded = (unsigned char*)lodepng_malloc(padded_passstart[i + 1] - padded_passstart[i]); + if(!padded) ERROR_BREAK(83); /*alloc fail*/ + addPaddingBits(padded, &adam7[passstart[i]], + ((passw[i] * bpp + 7u) / 8u) * 8u, passw[i] * bpp, passh[i]); + error = filter(&(*out)[filter_passstart[i]], padded, + passw[i], passh[i], &info_png->color, settings); + lodepng_free(padded); + } else { + error = filter(&(*out)[filter_passstart[i]], &adam7[padded_passstart[i]], + passw[i], passh[i], &info_png->color, settings); + } + + if(error) break; + } + } + + lodepng_free(adam7); + } + + return error; +} + +#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS +static unsigned addUnknownChunks(ucvector* out, unsigned char* data, size_t datasize) { + unsigned char* inchunk = data; + while((size_t)(inchunk - data) < datasize) { + CERROR_TRY_RETURN(lodepng_chunk_append(&out->data, &out->size, inchunk)); + out->allocsize = out->size; /*fix the allocsize again*/ + inchunk = lodepng_chunk_next(inchunk, data + datasize); + } + return 0; +} + +static unsigned isGrayICCProfile(const unsigned char* profile, unsigned size) { + /* + It is a gray profile if bytes 16-19 are "GRAY", rgb profile if bytes 16-19 + are "RGB ". We do not perform any full parsing of the ICC profile here, other + than check those 4 bytes to grayscale profile. Other than that, validity of + the profile is not checked. This is needed only because the PNG specification + requires using a non-gray color model if there is an ICC profile with "RGB " + (sadly limiting compression opportunities if the input data is grayscale RGB + data), and requires using a gray color model if it is "GRAY". + */ + if(size < 20) return 0; + return profile[16] == 'G' && profile[17] == 'R' && profile[18] == 'A' && profile[19] == 'Y'; +} + +static unsigned isRGBICCProfile(const unsigned char* profile, unsigned size) { + /* See comment in isGrayICCProfile*/ + if(size < 20) return 0; + return profile[16] == 'R' && profile[17] == 'G' && profile[18] == 'B' && profile[19] == ' '; +} +#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ + +unsigned lodepng_encode(unsigned char** out, size_t* outsize, + const unsigned char* image, unsigned w, unsigned h, + LodePNGState* state) { + unsigned char* data = 0; /*uncompressed version of the IDAT chunk data*/ + size_t datasize = 0; + ucvector outv = ucvector_init(NULL, 0); + LodePNGInfo info; + const LodePNGInfo* info_png = &state->info_png; + + lodepng_info_init(&info); + + /*provide some proper output values if error will happen*/ + *out = 0; + *outsize = 0; + state->error = 0; + + /*check input values validity*/ + if((info_png->color.colortype == LCT_PALETTE || state->encoder.force_palette) + && (info_png->color.palettesize == 0 || info_png->color.palettesize > 256)) { + state->error = 68; /*invalid palette size, it is only allowed to be 1-256*/ + goto cleanup; + } + if(state->encoder.zlibsettings.btype > 2) { + state->error = 61; /*error: invalid btype*/ + goto cleanup; + } + if(info_png->interlace_method > 1) { + state->error = 71; /*error: invalid interlace mode*/ + goto cleanup; + } + state->error = checkColorValidity(info_png->color.colortype, info_png->color.bitdepth); + if(state->error) goto cleanup; /*error: invalid color type given*/ + state->error = checkColorValidity(state->info_raw.colortype, state->info_raw.bitdepth); + if(state->error) goto cleanup; /*error: invalid color type given*/ + + /* color convert and compute scanline filter types */ + lodepng_info_copy(&info, &state->info_png); + if(state->encoder.auto_convert) { + LodePNGColorStats stats; + lodepng_color_stats_init(&stats); +#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS + if(info_png->iccp_defined && + isGrayICCProfile(info_png->iccp_profile, info_png->iccp_profile_size)) { + /*the PNG specification does not allow to use palette with a GRAY ICC profile, even + if the palette has only gray colors, so disallow it.*/ + stats.allow_palette = 0; + } + if(info_png->iccp_defined && + isRGBICCProfile(info_png->iccp_profile, info_png->iccp_profile_size)) { + /*the PNG specification does not allow to use grayscale color with RGB ICC profile, so disallow gray.*/ + stats.allow_greyscale = 0; + } +#endif /* LODEPNG_COMPILE_ANCILLARY_CHUNKS */ + state->error = lodepng_compute_color_stats(&stats, image, w, h, &state->info_raw); + if(state->error) goto cleanup; +#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS + if(info_png->background_defined) { + /*the background chunk's color must be taken into account as well*/ + unsigned r = 0, g = 0, b = 0; + LodePNGColorMode mode16 = lodepng_color_mode_make(LCT_RGB, 16); + lodepng_convert_rgb(&r, &g, &b, info_png->background_r, info_png->background_g, info_png->background_b, &mode16, &info_png->color); + state->error = lodepng_color_stats_add(&stats, r, g, b, 65535); + if(state->error) goto cleanup; + } +#endif /* LODEPNG_COMPILE_ANCILLARY_CHUNKS */ + state->error = auto_choose_color(&info.color, &state->info_raw, &stats); + if(state->error) goto cleanup; +#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS + /*also convert the background chunk*/ + if(info_png->background_defined) { + if(lodepng_convert_rgb(&info.background_r, &info.background_g, &info.background_b, + info_png->background_r, info_png->background_g, info_png->background_b, &info.color, &info_png->color)) { + state->error = 104; + goto cleanup; + } + } +#endif /* LODEPNG_COMPILE_ANCILLARY_CHUNKS */ + } +#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS + if(info_png->iccp_defined) { + unsigned gray_icc = isGrayICCProfile(info_png->iccp_profile, info_png->iccp_profile_size); + unsigned rgb_icc = isRGBICCProfile(info_png->iccp_profile, info_png->iccp_profile_size); + unsigned gray_png = info.color.colortype == LCT_GREY || info.color.colortype == LCT_GREY_ALPHA; + if(!gray_icc && !rgb_icc) { + state->error = 100; /* Disallowed profile color type for PNG */ + goto cleanup; + } + if(gray_icc != gray_png) { + /*Not allowed to use RGB/RGBA/palette with GRAY ICC profile or vice versa, + or in case of auto_convert, it wasn't possible to find appropriate model*/ + state->error = state->encoder.auto_convert ? 102 : 101; + goto cleanup; + } + } +#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ + if(!lodepng_color_mode_equal(&state->info_raw, &info.color)) { + unsigned char* converted; + size_t size = ((size_t)w * (size_t)h * (size_t)lodepng_get_bpp(&info.color) + 7u) / 8u; + + converted = (unsigned char*)lodepng_malloc(size); + if(!converted && size) state->error = 83; /*alloc fail*/ + if(!state->error) { + state->error = lodepng_convert(converted, image, &info.color, &state->info_raw, w, h); + } + if(!state->error) preProcessScanlines(&data, &datasize, converted, w, h, &info, &state->encoder); + lodepng_free(converted); + if(state->error) goto cleanup; + } + else preProcessScanlines(&data, &datasize, image, w, h, &info, &state->encoder); + + /* output all PNG chunks */ { +#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS + size_t i; +#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ + /*write signature and chunks*/ + state->error = writeSignature(&outv); + if(state->error) goto cleanup; + /*IHDR*/ + state->error = addChunk_IHDR(&outv, w, h, info.color.colortype, info.color.bitdepth, info.interlace_method); + if(state->error) goto cleanup; +#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS + /*unknown chunks between IHDR and PLTE*/ + if(info.unknown_chunks_data[0]) { + state->error = addUnknownChunks(&outv, info.unknown_chunks_data[0], info.unknown_chunks_size[0]); + if(state->error) goto cleanup; + } + /*color profile chunks must come before PLTE */ + if(info.iccp_defined) { + state->error = addChunk_iCCP(&outv, &info, &state->encoder.zlibsettings); + if(state->error) goto cleanup; + } + if(info.srgb_defined) { + state->error = addChunk_sRGB(&outv, &info); + if(state->error) goto cleanup; + } + if(info.gama_defined) { + state->error = addChunk_gAMA(&outv, &info); + if(state->error) goto cleanup; + } + if(info.chrm_defined) { + state->error = addChunk_cHRM(&outv, &info); + if(state->error) goto cleanup; + } +#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ + /*PLTE*/ + if(info.color.colortype == LCT_PALETTE) { + state->error = addChunk_PLTE(&outv, &info.color); + if(state->error) goto cleanup; + } + if(state->encoder.force_palette && (info.color.colortype == LCT_RGB || info.color.colortype == LCT_RGBA)) { + /*force_palette means: write suggested palette for truecolor in PLTE chunk*/ + state->error = addChunk_PLTE(&outv, &info.color); + if(state->error) goto cleanup; + } + /*tRNS (this will only add if when necessary) */ + state->error = addChunk_tRNS(&outv, &info.color); + if(state->error) goto cleanup; +#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS + /*bKGD (must come between PLTE and the IDAt chunks*/ + if(info.background_defined) { + state->error = addChunk_bKGD(&outv, &info); + if(state->error) goto cleanup; + } + /*pHYs (must come before the IDAT chunks)*/ + if(info.phys_defined) { + state->error = addChunk_pHYs(&outv, &info); + if(state->error) goto cleanup; + } + + /*unknown chunks between PLTE and IDAT*/ + if(info.unknown_chunks_data[1]) { + state->error = addUnknownChunks(&outv, info.unknown_chunks_data[1], info.unknown_chunks_size[1]); + if(state->error) goto cleanup; + } +#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ + /*IDAT (multiple IDAT chunks must be consecutive)*/ + state->error = addChunk_IDAT(&outv, data, datasize, &state->encoder.zlibsettings); + if(state->error) goto cleanup; +#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS + /*tIME*/ + if(info.time_defined) { + state->error = addChunk_tIME(&outv, &info.time); + if(state->error) goto cleanup; + } + /*tEXt and/or zTXt*/ + for(i = 0; i != info.text_num; ++i) { + if(lodepng_strlen(info.text_keys[i]) > 79) { + state->error = 66; /*text chunk too large*/ + goto cleanup; + } + if(lodepng_strlen(info.text_keys[i]) < 1) { + state->error = 67; /*text chunk too small*/ + goto cleanup; + } + if(state->encoder.text_compression) { + state->error = addChunk_zTXt(&outv, info.text_keys[i], info.text_strings[i], &state->encoder.zlibsettings); + if(state->error) goto cleanup; + } else { + state->error = addChunk_tEXt(&outv, info.text_keys[i], info.text_strings[i]); + if(state->error) goto cleanup; + } + } + /*LodePNG version id in text chunk*/ + if(state->encoder.add_id) { + unsigned already_added_id_text = 0; + for(i = 0; i != info.text_num; ++i) { + const char* k = info.text_keys[i]; + /* Could use strcmp, but we're not calling or reimplementing this C library function for this use only */ + if(k[0] == 'L' && k[1] == 'o' && k[2] == 'd' && k[3] == 'e' && + k[4] == 'P' && k[5] == 'N' && k[6] == 'G' && k[7] == '\0') { + already_added_id_text = 1; + break; + } + } + if(already_added_id_text == 0) { + state->error = addChunk_tEXt(&outv, "LodePNG", LODEPNG_VERSION_STRING); /*it's shorter as tEXt than as zTXt chunk*/ + if(state->error) goto cleanup; + } + } + /*iTXt*/ + for(i = 0; i != info.itext_num; ++i) { + if(lodepng_strlen(info.itext_keys[i]) > 79) { + state->error = 66; /*text chunk too large*/ + goto cleanup; + } + if(lodepng_strlen(info.itext_keys[i]) < 1) { + state->error = 67; /*text chunk too small*/ + goto cleanup; + } + state->error = addChunk_iTXt( + &outv, state->encoder.text_compression, + info.itext_keys[i], info.itext_langtags[i], info.itext_transkeys[i], info.itext_strings[i], + &state->encoder.zlibsettings); + if(state->error) goto cleanup; + } + + /*unknown chunks between IDAT and IEND*/ + if(info.unknown_chunks_data[2]) { + state->error = addUnknownChunks(&outv, info.unknown_chunks_data[2], info.unknown_chunks_size[2]); + if(state->error) goto cleanup; + } +#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ + state->error = addChunk_IEND(&outv); + if(state->error) goto cleanup; + } + +cleanup: + lodepng_info_cleanup(&info); + lodepng_free(data); + + /*instead of cleaning the vector up, give it to the output*/ + *out = outv.data; + *outsize = outv.size; + + return state->error; +} + +unsigned lodepng_encode_memory(unsigned char** out, size_t* outsize, const unsigned char* image, + unsigned w, unsigned h, LodePNGColorType colortype, unsigned bitdepth) { + unsigned error; + LodePNGState state; + lodepng_state_init(&state); + state.info_raw.colortype = colortype; + state.info_raw.bitdepth = bitdepth; + state.info_png.color.colortype = colortype; + state.info_png.color.bitdepth = bitdepth; + lodepng_encode(out, outsize, image, w, h, &state); + error = state.error; + lodepng_state_cleanup(&state); + return error; +} + +unsigned lodepng_encode32(unsigned char** out, size_t* outsize, const unsigned char* image, unsigned w, unsigned h) { + return lodepng_encode_memory(out, outsize, image, w, h, LCT_RGBA, 8); +} + +unsigned lodepng_encode24(unsigned char** out, size_t* outsize, const unsigned char* image, unsigned w, unsigned h) { + return lodepng_encode_memory(out, outsize, image, w, h, LCT_RGB, 8); +} + +#ifdef LODEPNG_COMPILE_DISK +unsigned lodepng_encode_file(const char* filename, const unsigned char* image, unsigned w, unsigned h, + LodePNGColorType colortype, unsigned bitdepth) { + unsigned char* buffer; + size_t buffersize; + unsigned error = lodepng_encode_memory(&buffer, &buffersize, image, w, h, colortype, bitdepth); + if(!error) error = lodepng_save_file(buffer, buffersize, filename); + lodepng_free(buffer); + return error; +} + +unsigned lodepng_encode32_file(const char* filename, const unsigned char* image, unsigned w, unsigned h) { + return lodepng_encode_file(filename, image, w, h, LCT_RGBA, 8); +} + +unsigned lodepng_encode24_file(const char* filename, const unsigned char* image, unsigned w, unsigned h) { + return lodepng_encode_file(filename, image, w, h, LCT_RGB, 8); +} +#endif /*LODEPNG_COMPILE_DISK*/ + +void lodepng_encoder_settings_init(LodePNGEncoderSettings* settings) { + lodepng_compress_settings_init(&settings->zlibsettings); + settings->filter_palette_zero = 1; + settings->filter_strategy = LFS_MINSUM; + settings->auto_convert = 1; + settings->force_palette = 0; + settings->predefined_filters = 0; +#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS + settings->add_id = 0; + settings->text_compression = 1; +#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ +} + +#endif /*LODEPNG_COMPILE_ENCODER*/ +#endif /*LODEPNG_COMPILE_PNG*/ + +#ifdef LODEPNG_COMPILE_ERROR_TEXT +/* +This returns the description of a numerical error code in English. This is also +the documentation of all the error codes. +*/ +const char* lodepng_error_text(unsigned code) { + switch(code) { + case 0: return "no error, everything went ok"; + case 1: return "nothing done yet"; /*the Encoder/Decoder has done nothing yet, error checking makes no sense yet*/ + case 10: return "end of input memory reached without huffman end code"; /*while huffman decoding*/ + case 11: return "error in code tree made it jump outside of huffman tree"; /*while huffman decoding*/ + case 13: return "problem while processing dynamic deflate block"; + case 14: return "problem while processing dynamic deflate block"; + case 15: return "problem while processing dynamic deflate block"; + /*this error could happen if there are only 0 or 1 symbols present in the huffman code:*/ + case 16: return "invalid code while processing dynamic deflate block"; + case 17: return "end of out buffer memory reached while inflating"; + case 18: return "invalid distance code while inflating"; + case 19: return "end of out buffer memory reached while inflating"; + case 20: return "invalid deflate block BTYPE encountered while decoding"; + case 21: return "NLEN is not ones complement of LEN in a deflate block"; + + /*end of out buffer memory reached while inflating: + This can happen if the inflated deflate data is longer than the amount of bytes required to fill up + all the pixels of the image, given the color depth and image dimensions. Something that doesn't + happen in a normal, well encoded, PNG image.*/ + case 22: return "end of out buffer memory reached while inflating"; + case 23: return "end of in buffer memory reached while inflating"; + case 24: return "invalid FCHECK in zlib header"; + case 25: return "invalid compression method in zlib header"; + case 26: return "FDICT encountered in zlib header while it's not used for PNG"; + case 27: return "PNG file is smaller than a PNG header"; + /*Checks the magic file header, the first 8 bytes of the PNG file*/ + case 28: return "incorrect PNG signature, it's no PNG or corrupted"; + case 29: return "first chunk is not the header chunk"; + case 30: return "chunk length too large, chunk broken off at end of file"; + case 31: return "illegal PNG color type or bpp"; + case 32: return "illegal PNG compression method"; + case 33: return "illegal PNG filter method"; + case 34: return "illegal PNG interlace method"; + case 35: return "chunk length of a chunk is too large or the chunk too small"; + case 36: return "illegal PNG filter type encountered"; + case 37: return "illegal bit depth for this color type given"; + case 38: return "the palette is too small or too big"; /*0, or more than 256 colors*/ + case 39: return "tRNS chunk before PLTE or has more entries than palette size"; + case 40: return "tRNS chunk has wrong size for grayscale image"; + case 41: return "tRNS chunk has wrong size for RGB image"; + case 42: return "tRNS chunk appeared while it was not allowed for this color type"; + case 43: return "bKGD chunk has wrong size for palette image"; + case 44: return "bKGD chunk has wrong size for grayscale image"; + case 45: return "bKGD chunk has wrong size for RGB image"; + case 48: return "empty input buffer given to decoder. Maybe caused by non-existing file?"; + case 49: return "jumped past memory while generating dynamic huffman tree"; + case 50: return "jumped past memory while generating dynamic huffman tree"; + case 51: return "jumped past memory while inflating huffman block"; + case 52: return "jumped past memory while inflating"; + case 53: return "size of zlib data too small"; + case 54: return "repeat symbol in tree while there was no value symbol yet"; + /*jumped past tree while generating huffman tree, this could be when the + tree will have more leaves than symbols after generating it out of the + given lengths. They call this an oversubscribed dynamic bit lengths tree in zlib.*/ + case 55: return "jumped past tree while generating huffman tree"; + case 56: return "given output image colortype or bitdepth not supported for color conversion"; + case 57: return "invalid CRC encountered (checking CRC can be disabled)"; + case 58: return "invalid ADLER32 encountered (checking ADLER32 can be disabled)"; + case 59: return "requested color conversion not supported"; + case 60: return "invalid window size given in the settings of the encoder (must be 0-32768)"; + case 61: return "invalid BTYPE given in the settings of the encoder (only 0, 1 and 2 are allowed)"; + /*LodePNG leaves the choice of RGB to grayscale conversion formula to the user.*/ + case 62: return "conversion from color to grayscale not supported"; + /*(2^31-1)*/ + case 63: return "length of a chunk too long, max allowed for PNG is 2147483647 bytes per chunk"; + /*this would result in the inability of a deflated block to ever contain an end code. It must be at least 1.*/ + case 64: return "the length of the END symbol 256 in the Huffman tree is 0"; + case 66: return "the length of a text chunk keyword given to the encoder is longer than the maximum of 79 bytes"; + case 67: return "the length of a text chunk keyword given to the encoder is smaller than the minimum of 1 byte"; + case 68: return "tried to encode a PLTE chunk with a palette that has less than 1 or more than 256 colors"; + case 69: return "unknown chunk type with 'critical' flag encountered by the decoder"; + case 71: return "invalid interlace mode given to encoder (must be 0 or 1)"; + case 72: return "while decoding, invalid compression method encountering in zTXt or iTXt chunk (it must be 0)"; + case 73: return "invalid tIME chunk size"; + case 74: return "invalid pHYs chunk size"; + /*length could be wrong, or data chopped off*/ + case 75: return "no null termination char found while decoding text chunk"; + case 76: return "iTXt chunk too short to contain required bytes"; + case 77: return "integer overflow in buffer size"; + case 78: return "failed to open file for reading"; /*file doesn't exist or couldn't be opened for reading*/ + case 79: return "failed to open file for writing"; + case 80: return "tried creating a tree of 0 symbols"; + case 81: return "lazy matching at pos 0 is impossible"; + case 82: return "color conversion to palette requested while a color isn't in palette, or index out of bounds"; + case 83: return "memory allocation failed"; + case 84: return "given image too small to contain all pixels to be encoded"; + case 86: return "impossible offset in lz77 encoding (internal bug)"; + case 87: return "must provide custom zlib function pointer if LODEPNG_COMPILE_ZLIB is not defined"; + case 88: return "invalid filter strategy given for LodePNGEncoderSettings.filter_strategy"; + case 89: return "text chunk keyword too short or long: must have size 1-79"; + /*the windowsize in the LodePNGCompressSettings. Requiring POT(==> & instead of %) makes encoding 12% faster.*/ + case 90: return "windowsize must be a power of two"; + case 91: return "invalid decompressed idat size"; + case 92: return "integer overflow due to too many pixels"; + case 93: return "zero width or height is invalid"; + case 94: return "header chunk must have a size of 13 bytes"; + case 95: return "integer overflow with combined idat chunk size"; + case 96: return "invalid gAMA chunk size"; + case 97: return "invalid cHRM chunk size"; + case 98: return "invalid sRGB chunk size"; + case 99: return "invalid sRGB rendering intent"; + case 100: return "invalid ICC profile color type, the PNG specification only allows RGB or GRAY"; + case 101: return "PNG specification does not allow RGB ICC profile on gray color types and vice versa"; + case 102: return "not allowed to set grayscale ICC profile with colored pixels by PNG specification"; + case 103: return "invalid palette index in bKGD chunk. Maybe it came before PLTE chunk?"; + case 104: return "invalid bKGD color while encoding (e.g. palette index out of range)"; + case 105: return "integer overflow of bitsize"; + case 106: return "PNG file must have PLTE chunk if color type is palette"; + case 107: return "color convert from palette mode requested without setting the palette data in it"; + case 108: return "tried to add more than 256 values to a palette"; + } + return "unknown error code"; +} +#endif /*LODEPNG_COMPILE_ERROR_TEXT*/ + +/* ////////////////////////////////////////////////////////////////////////// */ +/* ////////////////////////////////////////////////////////////////////////// */ +/* // C++ Wrapper // */ +/* ////////////////////////////////////////////////////////////////////////// */ +/* ////////////////////////////////////////////////////////////////////////// */ + +#ifdef LODEPNG_COMPILE_CPP +namespace lodepng { + +#ifdef LODEPNG_COMPILE_DISK +unsigned load_file(std::vector& buffer, const std::string& filename) { + long size = lodepng_filesize(filename.c_str()); + if(size < 0) return 78; + buffer.resize((size_t)size); + return size == 0 ? 0 : lodepng_buffer_file(&buffer[0], (size_t)size, filename.c_str()); +} + +/*write given buffer to the file, overwriting the file, it doesn't append to it.*/ +unsigned save_file(const std::vector& buffer, const std::string& filename) { + return lodepng_save_file(buffer.empty() ? 0 : &buffer[0], buffer.size(), filename.c_str()); +} +#endif /* LODEPNG_COMPILE_DISK */ + +#ifdef LODEPNG_COMPILE_ZLIB +#ifdef LODEPNG_COMPILE_DECODER +unsigned decompress(std::vector& out, const unsigned char* in, size_t insize, + const LodePNGDecompressSettings& settings) { + unsigned char* buffer = 0; + size_t buffersize = 0; + unsigned error = zlib_decompress(&buffer, &buffersize, 0, in, insize, &settings); + if(buffer) { + out.insert(out.end(), &buffer[0], &buffer[buffersize]); + lodepng_free(buffer); + } + return error; +} + +unsigned decompress(std::vector& out, const std::vector& in, + const LodePNGDecompressSettings& settings) { + return decompress(out, in.empty() ? 0 : &in[0], in.size(), settings); +} +#endif /* LODEPNG_COMPILE_DECODER */ + +#ifdef LODEPNG_COMPILE_ENCODER +unsigned compress(std::vector& out, const unsigned char* in, size_t insize, + const LodePNGCompressSettings& settings) { + unsigned char* buffer = 0; + size_t buffersize = 0; + unsigned error = zlib_compress(&buffer, &buffersize, in, insize, &settings); + if(buffer) { + out.insert(out.end(), &buffer[0], &buffer[buffersize]); + lodepng_free(buffer); + } + return error; +} + +unsigned compress(std::vector& out, const std::vector& in, + const LodePNGCompressSettings& settings) { + return compress(out, in.empty() ? 0 : &in[0], in.size(), settings); +} +#endif /* LODEPNG_COMPILE_ENCODER */ +#endif /* LODEPNG_COMPILE_ZLIB */ + + +#ifdef LODEPNG_COMPILE_PNG + +State::State() { + lodepng_state_init(this); +} + +State::State(const State& other) { + lodepng_state_init(this); + lodepng_state_copy(this, &other); +} + +State::~State() { + lodepng_state_cleanup(this); +} + +State& State::operator=(const State& other) { + lodepng_state_copy(this, &other); + return *this; +} + +#ifdef LODEPNG_COMPILE_DECODER + +unsigned decode(std::vector& out, unsigned& w, unsigned& h, const unsigned char* in, + size_t insize, LodePNGColorType colortype, unsigned bitdepth) { + unsigned char* buffer = 0; + unsigned error = lodepng_decode_memory(&buffer, &w, &h, in, insize, colortype, bitdepth); + if(buffer && !error) { + State state; + state.info_raw.colortype = colortype; + state.info_raw.bitdepth = bitdepth; + size_t buffersize = lodepng_get_raw_size(w, h, &state.info_raw); + out.insert(out.end(), &buffer[0], &buffer[buffersize]); + } + lodepng_free(buffer); + return error; +} + +unsigned decode(std::vector& out, unsigned& w, unsigned& h, + const std::vector& in, LodePNGColorType colortype, unsigned bitdepth) { + return decode(out, w, h, in.empty() ? 0 : &in[0], (unsigned)in.size(), colortype, bitdepth); +} + +unsigned decode(std::vector& out, unsigned& w, unsigned& h, + State& state, + const unsigned char* in, size_t insize) { + unsigned char* buffer = NULL; + unsigned error = lodepng_decode(&buffer, &w, &h, &state, in, insize); + if(buffer && !error) { + size_t buffersize = lodepng_get_raw_size(w, h, &state.info_raw); + out.insert(out.end(), &buffer[0], &buffer[buffersize]); + } + lodepng_free(buffer); + return error; +} + +unsigned decode(std::vector& out, unsigned& w, unsigned& h, + State& state, + const std::vector& in) { + return decode(out, w, h, state, in.empty() ? 0 : &in[0], in.size()); +} + +#ifdef LODEPNG_COMPILE_DISK +unsigned decode(std::vector& out, unsigned& w, unsigned& h, const std::string& filename, + LodePNGColorType colortype, unsigned bitdepth) { + std::vector buffer; + /* safe output values in case error happens */ + w = h = 0; + unsigned error = load_file(buffer, filename); + if(error) return error; + return decode(out, w, h, buffer, colortype, bitdepth); +} +#endif /* LODEPNG_COMPILE_DECODER */ +#endif /* LODEPNG_COMPILE_DISK */ + +#ifdef LODEPNG_COMPILE_ENCODER +unsigned encode(std::vector& out, const unsigned char* in, unsigned w, unsigned h, + LodePNGColorType colortype, unsigned bitdepth) { + unsigned char* buffer; + size_t buffersize; + unsigned error = lodepng_encode_memory(&buffer, &buffersize, in, w, h, colortype, bitdepth); + if(buffer) { + out.insert(out.end(), &buffer[0], &buffer[buffersize]); + lodepng_free(buffer); + } + return error; +} + +unsigned encode(std::vector& out, + const std::vector& in, unsigned w, unsigned h, + LodePNGColorType colortype, unsigned bitdepth) { + if(lodepng_get_raw_size_lct(w, h, colortype, bitdepth) > in.size()) return 84; + return encode(out, in.empty() ? 0 : &in[0], w, h, colortype, bitdepth); +} + +unsigned encode(std::vector& out, + const unsigned char* in, unsigned w, unsigned h, + State& state) { + unsigned char* buffer; + size_t buffersize; + unsigned error = lodepng_encode(&buffer, &buffersize, in, w, h, &state); + if(buffer) { + out.insert(out.end(), &buffer[0], &buffer[buffersize]); + lodepng_free(buffer); + } + return error; +} + +unsigned encode(std::vector& out, + const std::vector& in, unsigned w, unsigned h, + State& state) { + if(lodepng_get_raw_size(w, h, &state.info_raw) > in.size()) return 84; + return encode(out, in.empty() ? 0 : &in[0], w, h, state); +} + +#ifdef LODEPNG_COMPILE_DISK +unsigned encode(const std::string& filename, + const unsigned char* in, unsigned w, unsigned h, + LodePNGColorType colortype, unsigned bitdepth) { + std::vector buffer; + unsigned error = encode(buffer, in, w, h, colortype, bitdepth); + if(!error) error = save_file(buffer, filename); + return error; +} + +unsigned encode(const std::string& filename, + const std::vector& in, unsigned w, unsigned h, + LodePNGColorType colortype, unsigned bitdepth) { + if(lodepng_get_raw_size_lct(w, h, colortype, bitdepth) > in.size()) return 84; + return encode(filename, in.empty() ? 0 : &in[0], w, h, colortype, bitdepth); +} +#endif /* LODEPNG_COMPILE_DISK */ +#endif /* LODEPNG_COMPILE_ENCODER */ +#endif /* LODEPNG_COMPILE_PNG */ +} /* namespace lodepng */ +#endif /*LODEPNG_COMPILE_CPP*/ diff --git a/third_party/lodepng/lodepng.h b/third_party/lodepng/lodepng.h new file mode 100644 index 00000000..a386459f --- /dev/null +++ b/third_party/lodepng/lodepng.h @@ -0,0 +1,1945 @@ +/* +LodePNG version 20200306 + +Copyright (c) 2005-2020 Lode Vandevenne + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source + distribution. +*/ + +#ifndef LODEPNG_H +#define LODEPNG_H + +#include /*for size_t*/ + +extern const char* LODEPNG_VERSION_STRING; + +/* +The following #defines are used to create code sections. They can be disabled +to disable code sections, which can give faster compile time and smaller binary. +The "NO_COMPILE" defines are designed to be used to pass as defines to the +compiler command to disable them without modifying this header, e.g. +-DLODEPNG_NO_COMPILE_ZLIB for gcc. +In addition to those below, you can also define LODEPNG_NO_COMPILE_CRC to +allow implementing a custom lodepng_crc32. +*/ +/*deflate & zlib. If disabled, you must specify alternative zlib functions in +the custom_zlib field of the compress and decompress settings*/ +#ifndef LODEPNG_NO_COMPILE_ZLIB +#define LODEPNG_COMPILE_ZLIB +#endif + +/*png encoder and png decoder*/ +#ifndef LODEPNG_NO_COMPILE_PNG +#define LODEPNG_COMPILE_PNG +#endif + +/*deflate&zlib decoder and png decoder*/ +#ifndef LODEPNG_NO_COMPILE_DECODER +#define LODEPNG_COMPILE_DECODER +#endif + +/*deflate&zlib encoder and png encoder*/ +#ifndef LODEPNG_NO_COMPILE_ENCODER +#define LODEPNG_COMPILE_ENCODER +#endif + +/*the optional built in harddisk file loading and saving functions*/ +#ifndef LODEPNG_NO_COMPILE_DISK +#define LODEPNG_COMPILE_DISK +#endif + +/*support for chunks other than IHDR, IDAT, PLTE, tRNS, IEND: ancillary and unknown chunks*/ +#ifndef LODEPNG_NO_COMPILE_ANCILLARY_CHUNKS +#define LODEPNG_COMPILE_ANCILLARY_CHUNKS +#endif + +/*ability to convert error numerical codes to English text string*/ +#ifndef LODEPNG_NO_COMPILE_ERROR_TEXT +#define LODEPNG_COMPILE_ERROR_TEXT +#endif + +/*Compile the default allocators (C's free, malloc and realloc). If you disable this, +you can define the functions lodepng_free, lodepng_malloc and lodepng_realloc in your +source files with custom allocators.*/ +#ifndef LODEPNG_NO_COMPILE_ALLOCATORS +#define LODEPNG_COMPILE_ALLOCATORS +#endif + +/*compile the C++ version (you can disable the C++ wrapper here even when compiling for C++)*/ +#ifdef __cplusplus +#ifndef LODEPNG_NO_COMPILE_CPP +#define LODEPNG_COMPILE_CPP +#endif +#endif + +#ifdef LODEPNG_COMPILE_CPP +#include +#include +#endif /*LODEPNG_COMPILE_CPP*/ + +#ifdef LODEPNG_COMPILE_PNG +/*The PNG color types (also used for raw image).*/ +typedef enum LodePNGColorType { + LCT_GREY = 0, /*grayscale: 1,2,4,8,16 bit*/ + LCT_RGB = 2, /*RGB: 8,16 bit*/ + LCT_PALETTE = 3, /*palette: 1,2,4,8 bit*/ + LCT_GREY_ALPHA = 4, /*grayscale with alpha: 8,16 bit*/ + LCT_RGBA = 6, /*RGB with alpha: 8,16 bit*/ + /*LCT_MAX_OCTET_VALUE lets the compiler allow this enum to represent any invalid + byte value from 0 to 255 that could be present in an invalid PNG file header. Do + not use, compare with or set the name LCT_MAX_OCTET_VALUE, instead either use + the valid color type names above, or numeric values like 1 or 7 when checking for + particular disallowed color type byte values, or cast to integer to print it.*/ + LCT_MAX_OCTET_VALUE = 255 +} LodePNGColorType; + +#ifdef LODEPNG_COMPILE_DECODER +/* +Converts PNG data in memory to raw pixel data. +out: Output parameter. Pointer to buffer that will contain the raw pixel data. + After decoding, its size is w * h * (bytes per pixel) bytes larger than + initially. Bytes per pixel depends on colortype and bitdepth. + Must be freed after usage with free(*out). + Note: for 16-bit per channel colors, uses big endian format like PNG does. +w: Output parameter. Pointer to width of pixel data. +h: Output parameter. Pointer to height of pixel data. +in: Memory buffer with the PNG file. +insize: size of the in buffer. +colortype: the desired color type for the raw output image. See explanation on PNG color types. +bitdepth: the desired bit depth for the raw output image. See explanation on PNG color types. +Return value: LodePNG error code (0 means no error). +*/ +unsigned lodepng_decode_memory(unsigned char** out, unsigned* w, unsigned* h, + const unsigned char* in, size_t insize, + LodePNGColorType colortype, unsigned bitdepth); + +/*Same as lodepng_decode_memory, but always decodes to 32-bit RGBA raw image*/ +unsigned lodepng_decode32(unsigned char** out, unsigned* w, unsigned* h, + const unsigned char* in, size_t insize); + +/*Same as lodepng_decode_memory, but always decodes to 24-bit RGB raw image*/ +unsigned lodepng_decode24(unsigned char** out, unsigned* w, unsigned* h, + const unsigned char* in, size_t insize); + +#ifdef LODEPNG_COMPILE_DISK +/* +Load PNG from disk, from file with given name. +Same as the other decode functions, but instead takes a filename as input. +*/ +unsigned lodepng_decode_file(unsigned char** out, unsigned* w, unsigned* h, + const char* filename, + LodePNGColorType colortype, unsigned bitdepth); + +/*Same as lodepng_decode_file, but always decodes to 32-bit RGBA raw image.*/ +unsigned lodepng_decode32_file(unsigned char** out, unsigned* w, unsigned* h, + const char* filename); + +/*Same as lodepng_decode_file, but always decodes to 24-bit RGB raw image.*/ +unsigned lodepng_decode24_file(unsigned char** out, unsigned* w, unsigned* h, + const char* filename); +#endif /*LODEPNG_COMPILE_DISK*/ +#endif /*LODEPNG_COMPILE_DECODER*/ + + +#ifdef LODEPNG_COMPILE_ENCODER +/* +Converts raw pixel data into a PNG image in memory. The colortype and bitdepth + of the output PNG image cannot be chosen, they are automatically determined + by the colortype, bitdepth and content of the input pixel data. + Note: for 16-bit per channel colors, needs big endian format like PNG does. +out: Output parameter. Pointer to buffer that will contain the PNG image data. + Must be freed after usage with free(*out). +outsize: Output parameter. Pointer to the size in bytes of the out buffer. +image: The raw pixel data to encode. The size of this buffer should be + w * h * (bytes per pixel), bytes per pixel depends on colortype and bitdepth. +w: width of the raw pixel data in pixels. +h: height of the raw pixel data in pixels. +colortype: the color type of the raw input image. See explanation on PNG color types. +bitdepth: the bit depth of the raw input image. See explanation on PNG color types. +Return value: LodePNG error code (0 means no error). +*/ +unsigned lodepng_encode_memory(unsigned char** out, size_t* outsize, + const unsigned char* image, unsigned w, unsigned h, + LodePNGColorType colortype, unsigned bitdepth); + +/*Same as lodepng_encode_memory, but always encodes from 32-bit RGBA raw image.*/ +unsigned lodepng_encode32(unsigned char** out, size_t* outsize, + const unsigned char* image, unsigned w, unsigned h); + +/*Same as lodepng_encode_memory, but always encodes from 24-bit RGB raw image.*/ +unsigned lodepng_encode24(unsigned char** out, size_t* outsize, + const unsigned char* image, unsigned w, unsigned h); + +#ifdef LODEPNG_COMPILE_DISK +/* +Converts raw pixel data into a PNG file on disk. +Same as the other encode functions, but instead takes a filename as output. +NOTE: This overwrites existing files without warning! +*/ +unsigned lodepng_encode_file(const char* filename, + const unsigned char* image, unsigned w, unsigned h, + LodePNGColorType colortype, unsigned bitdepth); + +/*Same as lodepng_encode_file, but always encodes from 32-bit RGBA raw image.*/ +unsigned lodepng_encode32_file(const char* filename, + const unsigned char* image, unsigned w, unsigned h); + +/*Same as lodepng_encode_file, but always encodes from 24-bit RGB raw image.*/ +unsigned lodepng_encode24_file(const char* filename, + const unsigned char* image, unsigned w, unsigned h); +#endif /*LODEPNG_COMPILE_DISK*/ +#endif /*LODEPNG_COMPILE_ENCODER*/ + + +#ifdef LODEPNG_COMPILE_CPP +namespace lodepng { +#ifdef LODEPNG_COMPILE_DECODER +/*Same as lodepng_decode_memory, but decodes to an std::vector. The colortype +is the format to output the pixels to. Default is RGBA 8-bit per channel.*/ +unsigned decode(std::vector& out, unsigned& w, unsigned& h, + const unsigned char* in, size_t insize, + LodePNGColorType colortype = LCT_RGBA, unsigned bitdepth = 8); +unsigned decode(std::vector& out, unsigned& w, unsigned& h, + const std::vector& in, + LodePNGColorType colortype = LCT_RGBA, unsigned bitdepth = 8); +#ifdef LODEPNG_COMPILE_DISK +/* +Converts PNG file from disk to raw pixel data in memory. +Same as the other decode functions, but instead takes a filename as input. +*/ +unsigned decode(std::vector& out, unsigned& w, unsigned& h, + const std::string& filename, + LodePNGColorType colortype = LCT_RGBA, unsigned bitdepth = 8); +#endif /* LODEPNG_COMPILE_DISK */ +#endif /* LODEPNG_COMPILE_DECODER */ + +#ifdef LODEPNG_COMPILE_ENCODER +/*Same as lodepng_encode_memory, but encodes to an std::vector. colortype +is that of the raw input data. The output PNG color type will be auto chosen.*/ +unsigned encode(std::vector& out, + const unsigned char* in, unsigned w, unsigned h, + LodePNGColorType colortype = LCT_RGBA, unsigned bitdepth = 8); +unsigned encode(std::vector& out, + const std::vector& in, unsigned w, unsigned h, + LodePNGColorType colortype = LCT_RGBA, unsigned bitdepth = 8); +#ifdef LODEPNG_COMPILE_DISK +/* +Converts 32-bit RGBA raw pixel data into a PNG file on disk. +Same as the other encode functions, but instead takes a filename as output. +NOTE: This overwrites existing files without warning! +*/ +unsigned encode(const std::string& filename, + const unsigned char* in, unsigned w, unsigned h, + LodePNGColorType colortype = LCT_RGBA, unsigned bitdepth = 8); +unsigned encode(const std::string& filename, + const std::vector& in, unsigned w, unsigned h, + LodePNGColorType colortype = LCT_RGBA, unsigned bitdepth = 8); +#endif /* LODEPNG_COMPILE_DISK */ +#endif /* LODEPNG_COMPILE_ENCODER */ +} /* namespace lodepng */ +#endif /*LODEPNG_COMPILE_CPP*/ +#endif /*LODEPNG_COMPILE_PNG*/ + +#ifdef LODEPNG_COMPILE_ERROR_TEXT +/*Returns an English description of the numerical error code.*/ +const char* lodepng_error_text(unsigned code); +#endif /*LODEPNG_COMPILE_ERROR_TEXT*/ + +#ifdef LODEPNG_COMPILE_DECODER +/*Settings for zlib decompression*/ +typedef struct LodePNGDecompressSettings LodePNGDecompressSettings; +struct LodePNGDecompressSettings { + /* Check LodePNGDecoderSettings for more ignorable errors such as ignore_crc */ + unsigned ignore_adler32; /*if 1, continue and don't give an error message if the Adler32 checksum is corrupted*/ + unsigned ignore_nlen; /*ignore complement of len checksum in uncompressed blocks*/ + + /*use custom zlib decoder instead of built in one (default: null)*/ + unsigned (*custom_zlib)(unsigned char**, size_t*, + const unsigned char*, size_t, + const LodePNGDecompressSettings*); + /*use custom deflate decoder instead of built in one (default: null) + if custom_zlib is not null, custom_inflate is ignored (the zlib format uses deflate)*/ + unsigned (*custom_inflate)(unsigned char**, size_t*, + const unsigned char*, size_t, + const LodePNGDecompressSettings*); + + const void* custom_context; /*optional custom settings for custom functions*/ +}; + +extern const LodePNGDecompressSettings lodepng_default_decompress_settings; +void lodepng_decompress_settings_init(LodePNGDecompressSettings* settings); +#endif /*LODEPNG_COMPILE_DECODER*/ + +#ifdef LODEPNG_COMPILE_ENCODER +/* +Settings for zlib compression. Tweaking these settings tweaks the balance +between speed and compression ratio. +*/ +typedef struct LodePNGCompressSettings LodePNGCompressSettings; +struct LodePNGCompressSettings /*deflate = compress*/ { + /*LZ77 related settings*/ + unsigned btype; /*the block type for LZ (0, 1, 2 or 3, see zlib standard). Should be 2 for proper compression.*/ + unsigned use_lz77; /*whether or not to use LZ77. Should be 1 for proper compression.*/ + unsigned windowsize; /*must be a power of two <= 32768. higher compresses more but is slower. Default value: 2048.*/ + unsigned minmatch; /*minimum lz77 length. 3 is normally best, 6 can be better for some PNGs. Default: 0*/ + unsigned nicematch; /*stop searching if >= this length found. Set to 258 for best compression. Default: 128*/ + unsigned lazymatching; /*use lazy matching: better compression but a bit slower. Default: true*/ + + /*use custom zlib encoder instead of built in one (default: null)*/ + unsigned (*custom_zlib)(unsigned char**, size_t*, + const unsigned char*, size_t, + const LodePNGCompressSettings*); + /*use custom deflate encoder instead of built in one (default: null) + if custom_zlib is used, custom_deflate is ignored since only the built in + zlib function will call custom_deflate*/ + unsigned (*custom_deflate)(unsigned char**, size_t*, + const unsigned char*, size_t, + const LodePNGCompressSettings*); + + const void* custom_context; /*optional custom settings for custom functions*/ +}; + +extern const LodePNGCompressSettings lodepng_default_compress_settings; +void lodepng_compress_settings_init(LodePNGCompressSettings* settings); +#endif /*LODEPNG_COMPILE_ENCODER*/ + +#ifdef LODEPNG_COMPILE_PNG +/* +Color mode of an image. Contains all information required to decode the pixel +bits to RGBA colors. This information is the same as used in the PNG file +format, and is used both for PNG and raw image data in LodePNG. +*/ +typedef struct LodePNGColorMode { + /*header (IHDR)*/ + LodePNGColorType colortype; /*color type, see PNG standard or documentation further in this header file*/ + unsigned bitdepth; /*bits per sample, see PNG standard or documentation further in this header file*/ + + /* + palette (PLTE and tRNS) + + Dynamically allocated with the colors of the palette, including alpha. + This field may not be allocated directly, use lodepng_color_mode_init first, + then lodepng_palette_add per color to correctly initialize it (to ensure size + of exactly 1024 bytes). + + The alpha channels must be set as well, set them to 255 for opaque images. + + When decoding, by default you can ignore this palette, since LodePNG already + fills the palette colors in the pixels of the raw RGBA output. + + The palette is only supported for color type 3. + */ + unsigned char* palette; /*palette in RGBARGBA... order. Must be either 0, or when allocated must have 1024 bytes*/ + size_t palettesize; /*palette size in number of colors (amount of used bytes is 4 * palettesize)*/ + + /* + transparent color key (tRNS) + + This color uses the same bit depth as the bitdepth value in this struct, which can be 1-bit to 16-bit. + For grayscale PNGs, r, g and b will all 3 be set to the same. + + When decoding, by default you can ignore this information, since LodePNG sets + pixels with this key to transparent already in the raw RGBA output. + + The color key is only supported for color types 0 and 2. + */ + unsigned key_defined; /*is a transparent color key given? 0 = false, 1 = true*/ + unsigned key_r; /*red/grayscale component of color key*/ + unsigned key_g; /*green component of color key*/ + unsigned key_b; /*blue component of color key*/ +} LodePNGColorMode; + +/*init, cleanup and copy functions to use with this struct*/ +void lodepng_color_mode_init(LodePNGColorMode* info); +void lodepng_color_mode_cleanup(LodePNGColorMode* info); +/*return value is error code (0 means no error)*/ +unsigned lodepng_color_mode_copy(LodePNGColorMode* dest, const LodePNGColorMode* source); +/* Makes a temporary LodePNGColorMode that does not need cleanup (no palette) */ +LodePNGColorMode lodepng_color_mode_make(LodePNGColorType colortype, unsigned bitdepth); + +void lodepng_palette_clear(LodePNGColorMode* info); +/*add 1 color to the palette*/ +unsigned lodepng_palette_add(LodePNGColorMode* info, + unsigned char r, unsigned char g, unsigned char b, unsigned char a); + +/*get the total amount of bits per pixel, based on colortype and bitdepth in the struct*/ +unsigned lodepng_get_bpp(const LodePNGColorMode* info); +/*get the amount of color channels used, based on colortype in the struct. +If a palette is used, it counts as 1 channel.*/ +unsigned lodepng_get_channels(const LodePNGColorMode* info); +/*is it a grayscale type? (only colortype 0 or 4)*/ +unsigned lodepng_is_greyscale_type(const LodePNGColorMode* info); +/*has it got an alpha channel? (only colortype 2 or 6)*/ +unsigned lodepng_is_alpha_type(const LodePNGColorMode* info); +/*has it got a palette? (only colortype 3)*/ +unsigned lodepng_is_palette_type(const LodePNGColorMode* info); +/*only returns true if there is a palette and there is a value in the palette with alpha < 255. +Loops through the palette to check this.*/ +unsigned lodepng_has_palette_alpha(const LodePNGColorMode* info); +/* +Check if the given color info indicates the possibility of having non-opaque pixels in the PNG image. +Returns true if the image can have translucent or invisible pixels (it still be opaque if it doesn't use such pixels). +Returns false if the image can only have opaque pixels. +In detail, it returns true only if it's a color type with alpha, or has a palette with non-opaque values, +or if "key_defined" is true. +*/ +unsigned lodepng_can_have_alpha(const LodePNGColorMode* info); +/*Returns the byte size of a raw image buffer with given width, height and color mode*/ +size_t lodepng_get_raw_size(unsigned w, unsigned h, const LodePNGColorMode* color); + +#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS +/*The information of a Time chunk in PNG.*/ +typedef struct LodePNGTime { + unsigned year; /*2 bytes used (0-65535)*/ + unsigned month; /*1-12*/ + unsigned day; /*1-31*/ + unsigned hour; /*0-23*/ + unsigned minute; /*0-59*/ + unsigned second; /*0-60 (to allow for leap seconds)*/ +} LodePNGTime; +#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ + +/*Information about the PNG image, except pixels, width and height.*/ +typedef struct LodePNGInfo { + /*header (IHDR), palette (PLTE) and transparency (tRNS) chunks*/ + unsigned compression_method;/*compression method of the original file. Always 0.*/ + unsigned filter_method; /*filter method of the original file*/ + unsigned interlace_method; /*interlace method of the original file: 0=none, 1=Adam7*/ + LodePNGColorMode color; /*color type and bits, palette and transparency of the PNG file*/ + +#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS + /* + Suggested background color chunk (bKGD) + + This uses the same color mode and bit depth as the PNG (except no alpha channel), + with values truncated to the bit depth in the unsigned integer. + + For grayscale and palette PNGs, the value is stored in background_r. The values + in background_g and background_b are then unused. + + So when decoding, you may get these in a different color mode than the one you requested + for the raw pixels. + + When encoding with auto_convert, you must use the color model defined in info_png.color for + these values. The encoder normally ignores info_png.color when auto_convert is on, but will + use it to interpret these values (and convert copies of them to its chosen color model). + + When encoding, avoid setting this to an expensive color, such as a non-gray value + when the image is gray, or the compression will be worse since it will be forced to + write the PNG with a more expensive color mode (when auto_convert is on). + + The decoder does not use this background color to edit the color of pixels. This is a + completely optional metadata feature. + */ + unsigned background_defined; /*is a suggested background color given?*/ + unsigned background_r; /*red/gray/palette component of suggested background color*/ + unsigned background_g; /*green component of suggested background color*/ + unsigned background_b; /*blue component of suggested background color*/ + + /* + non-international text chunks (tEXt and zTXt) + + The char** arrays each contain num strings. The actual messages are in + text_strings, while text_keys are keywords that give a short description what + the actual text represents, e.g. Title, Author, Description, or anything else. + + All the string fields below including keys, names and language tags are null terminated. + The PNG specification uses null characters for the keys, names and tags, and forbids null + characters to appear in the main text which is why we can use null termination everywhere here. + + A keyword is minimum 1 character and maximum 79 characters long. It's + discouraged to use a single line length longer than 79 characters for texts. + + Don't allocate these text buffers yourself. Use the init/cleanup functions + correctly and use lodepng_add_text and lodepng_clear_text. + */ + size_t text_num; /*the amount of texts in these char** buffers (there may be more texts in itext)*/ + char** text_keys; /*the keyword of a text chunk (e.g. "Comment")*/ + char** text_strings; /*the actual text*/ + + /* + international text chunks (iTXt) + Similar to the non-international text chunks, but with additional strings + "langtags" and "transkeys". + */ + size_t itext_num; /*the amount of international texts in this PNG*/ + char** itext_keys; /*the English keyword of the text chunk (e.g. "Comment")*/ + char** itext_langtags; /*language tag for this text's language, ISO/IEC 646 string, e.g. ISO 639 language tag*/ + char** itext_transkeys; /*keyword translated to the international language - UTF-8 string*/ + char** itext_strings; /*the actual international text - UTF-8 string*/ + + /*time chunk (tIME)*/ + unsigned time_defined; /*set to 1 to make the encoder generate a tIME chunk*/ + LodePNGTime time; + + /*phys chunk (pHYs)*/ + unsigned phys_defined; /*if 0, there is no pHYs chunk and the values below are undefined, if 1 else there is one*/ + unsigned phys_x; /*pixels per unit in x direction*/ + unsigned phys_y; /*pixels per unit in y direction*/ + unsigned phys_unit; /*may be 0 (unknown unit) or 1 (metre)*/ + + /* + Color profile related chunks: gAMA, cHRM, sRGB, iCPP + + LodePNG does not apply any color conversions on pixels in the encoder or decoder and does not interpret these color + profile values. It merely passes on the information. If you wish to use color profiles and convert colors, please + use these values with a color management library. + + See the PNG, ICC and sRGB specifications for more information about the meaning of these values. + */ + + /* gAMA chunk: optional, overridden by sRGB or iCCP if those are present. */ + unsigned gama_defined; /* Whether a gAMA chunk is present (0 = not present, 1 = present). */ + unsigned gama_gamma; /* Gamma exponent times 100000 */ + + /* cHRM chunk: optional, overridden by sRGB or iCCP if those are present. */ + unsigned chrm_defined; /* Whether a cHRM chunk is present (0 = not present, 1 = present). */ + unsigned chrm_white_x; /* White Point x times 100000 */ + unsigned chrm_white_y; /* White Point y times 100000 */ + unsigned chrm_red_x; /* Red x times 100000 */ + unsigned chrm_red_y; /* Red y times 100000 */ + unsigned chrm_green_x; /* Green x times 100000 */ + unsigned chrm_green_y; /* Green y times 100000 */ + unsigned chrm_blue_x; /* Blue x times 100000 */ + unsigned chrm_blue_y; /* Blue y times 100000 */ + + /* + sRGB chunk: optional. May not appear at the same time as iCCP. + If gAMA is also present gAMA must contain value 45455. + If cHRM is also present cHRM must contain respectively 31270,32900,64000,33000,30000,60000,15000,6000. + */ + unsigned srgb_defined; /* Whether an sRGB chunk is present (0 = not present, 1 = present). */ + unsigned srgb_intent; /* Rendering intent: 0=perceptual, 1=rel. colorimetric, 2=saturation, 3=abs. colorimetric */ + + /* + iCCP chunk: optional. May not appear at the same time as sRGB. + + LodePNG does not parse or use the ICC profile (except its color space header field for an edge case), a + separate library to handle the ICC data (not included in LodePNG) format is needed to use it for color + management and conversions. + + For encoding, if iCCP is present, gAMA and cHRM are recommended to be added as well with values that match the ICC + profile as closely as possible, if you wish to do this you should provide the correct values for gAMA and cHRM and + enable their '_defined' flags since LodePNG will not automatically compute them from the ICC profile. + + For encoding, the ICC profile is required by the PNG specification to be an "RGB" profile for non-gray + PNG color types and a "GRAY" profile for gray PNG color types. If you disable auto_convert, you must ensure + the ICC profile type matches your requested color type, else the encoder gives an error. If auto_convert is + enabled (the default), and the ICC profile is not a good match for the pixel data, this will result in an encoder + error if the pixel data has non-gray pixels for a GRAY profile, or a silent less-optimal compression of the pixel + data if the pixels could be encoded as grayscale but the ICC profile is RGB. + + To avoid this do not set an ICC profile in the image unless there is a good reason for it, and when doing so + make sure you compute it carefully to avoid the above problems. + */ + unsigned iccp_defined; /* Whether an iCCP chunk is present (0 = not present, 1 = present). */ + char* iccp_name; /* Null terminated string with profile name, 1-79 bytes */ + /* + The ICC profile in iccp_profile_size bytes. + Don't allocate this buffer yourself. Use the init/cleanup functions + correctly and use lodepng_set_icc and lodepng_clear_icc. + */ + unsigned char* iccp_profile; + unsigned iccp_profile_size; /* The size of iccp_profile in bytes */ + + /* End of color profile related chunks */ + + + /* + unknown chunks: chunks not known by LodePNG, passed on byte for byte. + + There are 3 buffers, one for each position in the PNG where unknown chunks can appear. + Each buffer contains all unknown chunks for that position consecutively. + The 3 positions are: + 0: between IHDR and PLTE, 1: between PLTE and IDAT, 2: between IDAT and IEND. + + For encoding, do not store critical chunks or known chunks that are enabled with a "_defined" flag + above in here, since the encoder will blindly follow this and could then encode an invalid PNG file + (such as one with two IHDR chunks or the disallowed combination of sRGB with iCCP). But do use + this if you wish to store an ancillary chunk that is not supported by LodePNG (such as sPLT or hIST), + or any non-standard PNG chunk. + + Do not allocate or traverse this data yourself. Use the chunk traversing functions declared + later, such as lodepng_chunk_next and lodepng_chunk_append, to read/write this struct. + */ + unsigned char* unknown_chunks_data[3]; + size_t unknown_chunks_size[3]; /*size in bytes of the unknown chunks, given for protection*/ +#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ +} LodePNGInfo; + +/*init, cleanup and copy functions to use with this struct*/ +void lodepng_info_init(LodePNGInfo* info); +void lodepng_info_cleanup(LodePNGInfo* info); +/*return value is error code (0 means no error)*/ +unsigned lodepng_info_copy(LodePNGInfo* dest, const LodePNGInfo* source); + +#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS +unsigned lodepng_add_text(LodePNGInfo* info, const char* key, const char* str); /*push back both texts at once*/ +void lodepng_clear_text(LodePNGInfo* info); /*use this to clear the texts again after you filled them in*/ + +unsigned lodepng_add_itext(LodePNGInfo* info, const char* key, const char* langtag, + const char* transkey, const char* str); /*push back the 4 texts of 1 chunk at once*/ +void lodepng_clear_itext(LodePNGInfo* info); /*use this to clear the itexts again after you filled them in*/ + +/*replaces if exists*/ +unsigned lodepng_set_icc(LodePNGInfo* info, const char* name, const unsigned char* profile, unsigned profile_size); +void lodepng_clear_icc(LodePNGInfo* info); /*use this to clear the texts again after you filled them in*/ +#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ + +/* +Converts raw buffer from one color type to another color type, based on +LodePNGColorMode structs to describe the input and output color type. +See the reference manual at the end of this header file to see which color conversions are supported. +return value = LodePNG error code (0 if all went ok, an error if the conversion isn't supported) +The out buffer must have size (w * h * bpp + 7) / 8, where bpp is the bits per pixel +of the output color type (lodepng_get_bpp). +For < 8 bpp images, there should not be padding bits at the end of scanlines. +For 16-bit per channel colors, uses big endian format like PNG does. +Return value is LodePNG error code +*/ +unsigned lodepng_convert(unsigned char* out, const unsigned char* in, + const LodePNGColorMode* mode_out, const LodePNGColorMode* mode_in, + unsigned w, unsigned h); + +#ifdef LODEPNG_COMPILE_DECODER +/* +Settings for the decoder. This contains settings for the PNG and the Zlib +decoder, but not the Info settings from the Info structs. +*/ +typedef struct LodePNGDecoderSettings { + LodePNGDecompressSettings zlibsettings; /*in here is the setting to ignore Adler32 checksums*/ + + /* Check LodePNGDecompressSettings for more ignorable errors such as ignore_adler32 */ + unsigned ignore_crc; /*ignore CRC checksums*/ + unsigned ignore_critical; /*ignore unknown critical chunks*/ + unsigned ignore_end; /*ignore issues at end of file if possible (missing IEND chunk, too large chunk, ...)*/ + /* TODO: make a system involving warnings with levels and a strict mode instead. Other potentially recoverable + errors: srgb rendering intent value, size of content of ancillary chunks, more than 79 characters for some + strings, placement/combination rules for ancillary chunks, crc of unknown chunks, allowed characters + in string keys, etc... */ + + unsigned color_convert; /*whether to convert the PNG to the color type you want. Default: yes*/ + +#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS + unsigned read_text_chunks; /*if false but remember_unknown_chunks is true, they're stored in the unknown chunks*/ + /*store all bytes from unknown chunks in the LodePNGInfo (off by default, useful for a png editor)*/ + unsigned remember_unknown_chunks; +#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ +} LodePNGDecoderSettings; + +void lodepng_decoder_settings_init(LodePNGDecoderSettings* settings); +#endif /*LODEPNG_COMPILE_DECODER*/ + +#ifdef LODEPNG_COMPILE_ENCODER +/*automatically use color type with less bits per pixel if losslessly possible. Default: AUTO*/ +typedef enum LodePNGFilterStrategy { + /*every filter at zero*/ + LFS_ZERO = 0, + /*every filter at 1, 2, 3 or 4 (paeth), unlike LFS_ZERO not a good choice, but for testing*/ + LFS_ONE = 1, + LFS_TWO = 2, + LFS_THREE = 3, + LFS_FOUR = 4, + /*Use filter that gives minimum sum, as described in the official PNG filter heuristic.*/ + LFS_MINSUM, + /*Use the filter type that gives smallest Shannon entropy for this scanline. Depending + on the image, this is better or worse than minsum.*/ + LFS_ENTROPY, + /* + Brute-force-search PNG filters by compressing each filter for each scanline. + Experimental, very slow, and only rarely gives better compression than MINSUM. + */ + LFS_BRUTE_FORCE, + /*use predefined_filters buffer: you specify the filter type for each scanline*/ + LFS_PREDEFINED +} LodePNGFilterStrategy; + +/*Gives characteristics about the integer RGBA colors of the image (count, alpha channel usage, bit depth, ...), +which helps decide which color model to use for encoding. +Used internally by default if "auto_convert" is enabled. Public because it's useful for custom algorithms.*/ +typedef struct LodePNGColorStats { + unsigned colored; /*not grayscale*/ + unsigned key; /*image is not opaque and color key is possible instead of full alpha*/ + unsigned short key_r; /*key values, always as 16-bit, in 8-bit case the byte is duplicated, e.g. 65535 means 255*/ + unsigned short key_g; + unsigned short key_b; + unsigned alpha; /*image is not opaque and alpha channel or alpha palette required*/ + unsigned numcolors; /*amount of colors, up to 257. Not valid if bits == 16 or allow_palette is disabled.*/ + unsigned char palette[1024]; /*Remembers up to the first 256 RGBA colors, in no particular order, only valid when numcolors is valid*/ + unsigned bits; /*bits per channel (not for palette). 1,2 or 4 for grayscale only. 16 if 16-bit per channel required.*/ + size_t numpixels; + + /*user settings for computing/using the stats*/ + unsigned allow_palette; /*default 1. if 0, disallow choosing palette colortype in auto_choose_color, and don't count numcolors*/ + unsigned allow_greyscale; /*default 1. if 0, choose RGB or RGBA even if the image only has gray colors*/ +} LodePNGColorStats; + +void lodepng_color_stats_init(LodePNGColorStats* stats); + +/*Get a LodePNGColorStats of the image. The stats must already have been inited. +Returns error code (e.g. alloc fail) or 0 if ok.*/ +unsigned lodepng_compute_color_stats(LodePNGColorStats* stats, + const unsigned char* image, unsigned w, unsigned h, + const LodePNGColorMode* mode_in); + +/*Settings for the encoder.*/ +typedef struct LodePNGEncoderSettings { + LodePNGCompressSettings zlibsettings; /*settings for the zlib encoder, such as window size, ...*/ + + unsigned auto_convert; /*automatically choose output PNG color type. Default: true*/ + + /*If true, follows the official PNG heuristic: if the PNG uses a palette or lower than + 8 bit depth, set all filters to zero. Otherwise use the filter_strategy. Note that to + completely follow the official PNG heuristic, filter_palette_zero must be true and + filter_strategy must be LFS_MINSUM*/ + unsigned filter_palette_zero; + /*Which filter strategy to use when not using zeroes due to filter_palette_zero. + Set filter_palette_zero to 0 to ensure always using your chosen strategy. Default: LFS_MINSUM*/ + LodePNGFilterStrategy filter_strategy; + /*used if filter_strategy is LFS_PREDEFINED. In that case, this must point to a buffer with + the same length as the amount of scanlines in the image, and each value must <= 5. You + have to cleanup this buffer, LodePNG will never free it. Don't forget that filter_palette_zero + must be set to 0 to ensure this is also used on palette or low bitdepth images.*/ + const unsigned char* predefined_filters; + + /*force creating a PLTE chunk if colortype is 2 or 6 (= a suggested palette). + If colortype is 3, PLTE is _always_ created.*/ + unsigned force_palette; +#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS + /*add LodePNG identifier and version as a text chunk, for debugging*/ + unsigned add_id; + /*encode text chunks as zTXt chunks instead of tEXt chunks, and use compression in iTXt chunks*/ + unsigned text_compression; +#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ +} LodePNGEncoderSettings; + +void lodepng_encoder_settings_init(LodePNGEncoderSettings* settings); +#endif /*LODEPNG_COMPILE_ENCODER*/ + + +#if defined(LODEPNG_COMPILE_DECODER) || defined(LODEPNG_COMPILE_ENCODER) +/*The settings, state and information for extended encoding and decoding.*/ +typedef struct LodePNGState { +#ifdef LODEPNG_COMPILE_DECODER + LodePNGDecoderSettings decoder; /*the decoding settings*/ +#endif /*LODEPNG_COMPILE_DECODER*/ +#ifdef LODEPNG_COMPILE_ENCODER + LodePNGEncoderSettings encoder; /*the encoding settings*/ +#endif /*LODEPNG_COMPILE_ENCODER*/ + LodePNGColorMode info_raw; /*specifies the format in which you would like to get the raw pixel buffer*/ + LodePNGInfo info_png; /*info of the PNG image obtained after decoding*/ + unsigned error; +} LodePNGState; + +/*init, cleanup and copy functions to use with this struct*/ +void lodepng_state_init(LodePNGState* state); +void lodepng_state_cleanup(LodePNGState* state); +void lodepng_state_copy(LodePNGState* dest, const LodePNGState* source); +#endif /* defined(LODEPNG_COMPILE_DECODER) || defined(LODEPNG_COMPILE_ENCODER) */ + +#ifdef LODEPNG_COMPILE_DECODER +/* +Same as lodepng_decode_memory, but uses a LodePNGState to allow custom settings and +getting much more information about the PNG image and color mode. +*/ +unsigned lodepng_decode(unsigned char** out, unsigned* w, unsigned* h, + LodePNGState* state, + const unsigned char* in, size_t insize); + +/* +Read the PNG header, but not the actual data. This returns only the information +that is in the IHDR chunk of the PNG, such as width, height and color type. The +information is placed in the info_png field of the LodePNGState. +*/ +unsigned lodepng_inspect(unsigned* w, unsigned* h, + LodePNGState* state, + const unsigned char* in, size_t insize); +#endif /*LODEPNG_COMPILE_DECODER*/ + +/* +Reads one metadata chunk (other than IHDR) of the PNG file and outputs what it +read in the state. Returns error code on failure. +Use lodepng_inspect first with a new state, then e.g. lodepng_chunk_find_const +to find the desired chunk type, and if non null use lodepng_inspect_chunk (with +chunk_pointer - start_of_file as pos). +Supports most metadata chunks from the PNG standard (gAMA, bKGD, tEXt, ...). +Ignores unsupported, unknown, non-metadata or IHDR chunks (without error). +Requirements: &in[pos] must point to start of a chunk, must use regular +lodepng_inspect first since format of most other chunks depends on IHDR, and if +there is a PLTE chunk, that one must be inspected before tRNS or bKGD. +*/ +unsigned lodepng_inspect_chunk(LodePNGState* state, size_t pos, + const unsigned char* in, size_t insize); + +#ifdef LODEPNG_COMPILE_ENCODER +/*This function allocates the out buffer with standard malloc and stores the size in *outsize.*/ +unsigned lodepng_encode(unsigned char** out, size_t* outsize, + const unsigned char* image, unsigned w, unsigned h, + LodePNGState* state); +#endif /*LODEPNG_COMPILE_ENCODER*/ + +/* +The lodepng_chunk functions are normally not needed, except to traverse the +unknown chunks stored in the LodePNGInfo struct, or add new ones to it. +It also allows traversing the chunks of an encoded PNG file yourself. + +The chunk pointer always points to the beginning of the chunk itself, that is +the first byte of the 4 length bytes. + +In the PNG file format, chunks have the following format: +-4 bytes length: length of the data of the chunk in bytes (chunk itself is 12 bytes longer) +-4 bytes chunk type (ASCII a-z,A-Z only, see below) +-length bytes of data (may be 0 bytes if length was 0) +-4 bytes of CRC, computed on chunk name + data + +The first chunk starts at the 8th byte of the PNG file, the entire rest of the file +exists out of concatenated chunks with the above format. + +PNG standard chunk ASCII naming conventions: +-First byte: uppercase = critical, lowercase = ancillary +-Second byte: uppercase = public, lowercase = private +-Third byte: must be uppercase +-Fourth byte: uppercase = unsafe to copy, lowercase = safe to copy +*/ + +/* +Gets the length of the data of the chunk. Total chunk length has 12 bytes more. +There must be at least 4 bytes to read from. If the result value is too large, +it may be corrupt data. +*/ +unsigned lodepng_chunk_length(const unsigned char* chunk); + +/*puts the 4-byte type in null terminated string*/ +void lodepng_chunk_type(char type[5], const unsigned char* chunk); + +/*check if the type is the given type*/ +unsigned char lodepng_chunk_type_equals(const unsigned char* chunk, const char* type); + +/*0: it's one of the critical chunk types, 1: it's an ancillary chunk (see PNG standard)*/ +unsigned char lodepng_chunk_ancillary(const unsigned char* chunk); + +/*0: public, 1: private (see PNG standard)*/ +unsigned char lodepng_chunk_private(const unsigned char* chunk); + +/*0: the chunk is unsafe to copy, 1: the chunk is safe to copy (see PNG standard)*/ +unsigned char lodepng_chunk_safetocopy(const unsigned char* chunk); + +/*get pointer to the data of the chunk, where the input points to the header of the chunk*/ +unsigned char* lodepng_chunk_data(unsigned char* chunk); +const unsigned char* lodepng_chunk_data_const(const unsigned char* chunk); + +/*returns 0 if the crc is correct, 1 if it's incorrect (0 for OK as usual!)*/ +unsigned lodepng_chunk_check_crc(const unsigned char* chunk); + +/*generates the correct CRC from the data and puts it in the last 4 bytes of the chunk*/ +void lodepng_chunk_generate_crc(unsigned char* chunk); + +/* +Iterate to next chunks, allows iterating through all chunks of the PNG file. +Input must be at the beginning of a chunk (result of a previous lodepng_chunk_next call, +or the 8th byte of a PNG file which always has the first chunk), or alternatively may +point to the first byte of the PNG file (which is not a chunk but the magic header, the +function will then skip over it and return the first real chunk). +Will output pointer to the start of the next chunk, or at or beyond end of the file if there +is no more chunk after this or possibly if the chunk is corrupt. +Start this process at the 8th byte of the PNG file. +In a non-corrupt PNG file, the last chunk should have name "IEND". +*/ +unsigned char* lodepng_chunk_next(unsigned char* chunk, unsigned char* end); +const unsigned char* lodepng_chunk_next_const(const unsigned char* chunk, const unsigned char* end); + +/*Finds the first chunk with the given type in the range [chunk, end), or returns NULL if not found.*/ +unsigned char* lodepng_chunk_find(unsigned char* chunk, unsigned char* end, const char type[5]); +const unsigned char* lodepng_chunk_find_const(const unsigned char* chunk, const unsigned char* end, const char type[5]); + +/* +Appends chunk to the data in out. The given chunk should already have its chunk header. +The out variable and outsize are updated to reflect the new reallocated buffer. +Returns error code (0 if it went ok) +*/ +unsigned lodepng_chunk_append(unsigned char** out, size_t* outsize, const unsigned char* chunk); + +/* +Appends new chunk to out. The chunk to append is given by giving its length, type +and data separately. The type is a 4-letter string. +The out variable and outsize are updated to reflect the new reallocated buffer. +Returne error code (0 if it went ok) +*/ +unsigned lodepng_chunk_create(unsigned char** out, size_t* outsize, unsigned length, + const char* type, const unsigned char* data); + + +/*Calculate CRC32 of buffer*/ +unsigned lodepng_crc32(const unsigned char* buf, size_t len); +#endif /*LODEPNG_COMPILE_PNG*/ + + +#ifdef LODEPNG_COMPILE_ZLIB +/* +This zlib part can be used independently to zlib compress and decompress a +buffer. It cannot be used to create gzip files however, and it only supports the +part of zlib that is required for PNG, it does not support dictionaries. +*/ + +#ifdef LODEPNG_COMPILE_DECODER +/*Inflate a buffer. Inflate is the decompression step of deflate. Out buffer must be freed after use.*/ +unsigned lodepng_inflate(unsigned char** out, size_t* outsize, + const unsigned char* in, size_t insize, + const LodePNGDecompressSettings* settings); + +/* +Decompresses Zlib data. Reallocates the out buffer and appends the data. The +data must be according to the zlib specification. +Either, *out must be NULL and *outsize must be 0, or, *out must be a valid +buffer and *outsize its size in bytes. out must be freed by user after usage. +*/ +unsigned lodepng_zlib_decompress(unsigned char** out, size_t* outsize, + const unsigned char* in, size_t insize, + const LodePNGDecompressSettings* settings); +#endif /*LODEPNG_COMPILE_DECODER*/ + +#ifdef LODEPNG_COMPILE_ENCODER +/* +Compresses data with Zlib. Reallocates the out buffer and appends the data. +Zlib adds a small header and trailer around the deflate data. +The data is output in the format of the zlib specification. +Either, *out must be NULL and *outsize must be 0, or, *out must be a valid +buffer and *outsize its size in bytes. out must be freed by user after usage. +*/ +unsigned lodepng_zlib_compress(unsigned char** out, size_t* outsize, + const unsigned char* in, size_t insize, + const LodePNGCompressSettings* settings); + +/* +Find length-limited Huffman code for given frequencies. This function is in the +public interface only for tests, it's used internally by lodepng_deflate. +*/ +unsigned lodepng_huffman_code_lengths(unsigned* lengths, const unsigned* frequencies, + size_t numcodes, unsigned maxbitlen); + +/*Compress a buffer with deflate. See RFC 1951. Out buffer must be freed after use.*/ +unsigned lodepng_deflate(unsigned char** out, size_t* outsize, + const unsigned char* in, size_t insize, + const LodePNGCompressSettings* settings); + +#endif /*LODEPNG_COMPILE_ENCODER*/ +#endif /*LODEPNG_COMPILE_ZLIB*/ + +#ifdef LODEPNG_COMPILE_DISK +/* +Load a file from disk into buffer. The function allocates the out buffer, and +after usage you should free it. +out: output parameter, contains pointer to loaded buffer. +outsize: output parameter, size of the allocated out buffer +filename: the path to the file to load +return value: error code (0 means ok) +*/ +unsigned lodepng_load_file(unsigned char** out, size_t* outsize, const char* filename); + +/* +Save a file from buffer to disk. Warning, if it exists, this function overwrites +the file without warning! +buffer: the buffer to write +buffersize: size of the buffer to write +filename: the path to the file to save to +return value: error code (0 means ok) +*/ +unsigned lodepng_save_file(const unsigned char* buffer, size_t buffersize, const char* filename); +#endif /*LODEPNG_COMPILE_DISK*/ + +#ifdef LODEPNG_COMPILE_CPP +/* The LodePNG C++ wrapper uses std::vectors instead of manually allocated memory buffers. */ +namespace lodepng { +#ifdef LODEPNG_COMPILE_PNG +class State : public LodePNGState { + public: + State(); + State(const State& other); + ~State(); + State& operator=(const State& other); +}; + +#ifdef LODEPNG_COMPILE_DECODER +/* Same as other lodepng::decode, but using a State for more settings and information. */ +unsigned decode(std::vector& out, unsigned& w, unsigned& h, + State& state, + const unsigned char* in, size_t insize); +unsigned decode(std::vector& out, unsigned& w, unsigned& h, + State& state, + const std::vector& in); +#endif /*LODEPNG_COMPILE_DECODER*/ + +#ifdef LODEPNG_COMPILE_ENCODER +/* Same as other lodepng::encode, but using a State for more settings and information. */ +unsigned encode(std::vector& out, + const unsigned char* in, unsigned w, unsigned h, + State& state); +unsigned encode(std::vector& out, + const std::vector& in, unsigned w, unsigned h, + State& state); +#endif /*LODEPNG_COMPILE_ENCODER*/ + +#ifdef LODEPNG_COMPILE_DISK +/* +Load a file from disk into an std::vector. +return value: error code (0 means ok) +*/ +unsigned load_file(std::vector& buffer, const std::string& filename); + +/* +Save the binary data in an std::vector to a file on disk. The file is overwritten +without warning. +*/ +unsigned save_file(const std::vector& buffer, const std::string& filename); +#endif /* LODEPNG_COMPILE_DISK */ +#endif /* LODEPNG_COMPILE_PNG */ + +#ifdef LODEPNG_COMPILE_ZLIB +#ifdef LODEPNG_COMPILE_DECODER +/* Zlib-decompress an unsigned char buffer */ +unsigned decompress(std::vector& out, const unsigned char* in, size_t insize, + const LodePNGDecompressSettings& settings = lodepng_default_decompress_settings); + +/* Zlib-decompress an std::vector */ +unsigned decompress(std::vector& out, const std::vector& in, + const LodePNGDecompressSettings& settings = lodepng_default_decompress_settings); +#endif /* LODEPNG_COMPILE_DECODER */ + +#ifdef LODEPNG_COMPILE_ENCODER +/* Zlib-compress an unsigned char buffer */ +unsigned compress(std::vector& out, const unsigned char* in, size_t insize, + const LodePNGCompressSettings& settings = lodepng_default_compress_settings); + +/* Zlib-compress an std::vector */ +unsigned compress(std::vector& out, const std::vector& in, + const LodePNGCompressSettings& settings = lodepng_default_compress_settings); +#endif /* LODEPNG_COMPILE_ENCODER */ +#endif /* LODEPNG_COMPILE_ZLIB */ +} /* namespace lodepng */ +#endif /*LODEPNG_COMPILE_CPP*/ + +/* +TODO: +[.] test if there are no memory leaks or security exploits - done a lot but needs to be checked often +[.] check compatibility with various compilers - done but needs to be redone for every newer version +[X] converting color to 16-bit per channel types +[X] support color profile chunk types (but never let them touch RGB values by default) +[ ] support all public PNG chunk types (almost done except sBIT, sPLT and hIST) +[ ] make sure encoder generates no chunks with size > (2^31)-1 +[ ] partial decoding (stream processing) +[X] let the "isFullyOpaque" function check color keys and transparent palettes too +[X] better name for the variables "codes", "codesD", "codelengthcodes", "clcl" and "lldl" +[ ] allow treating some errors like warnings, when image is recoverable (e.g. 69, 57, 58) +[ ] make warnings like: oob palette, checksum fail, data after iend, wrong/unknown crit chunk, no null terminator in text, ... +[ ] error messages with line numbers (and version) +[ ] errors in state instead of as return code? +[ ] new errors/warnings like suspiciously big decompressed ztxt or iccp chunk +[ ] let the C++ wrapper catch exceptions coming from the standard library and return LodePNG error codes +[ ] allow user to provide custom color conversion functions, e.g. for premultiplied alpha, padding bits or not, ... +[ ] allow user to give data (void*) to custom allocator +[X] provide alternatives for C library functions not present on some platforms (memcpy, ...) +*/ + +#endif /*LODEPNG_H inclusion guard*/ + +/* +LodePNG Documentation +--------------------- + +0. table of contents +-------------------- + + 1. about + 1.1. supported features + 1.2. features not supported + 2. C and C++ version + 3. security + 4. decoding + 5. encoding + 6. color conversions + 6.1. PNG color types + 6.2. color conversions + 6.3. padding bits + 6.4. A note about 16-bits per channel and endianness + 7. error values + 8. chunks and PNG editing + 9. compiler support + 10. examples + 10.1. decoder C++ example + 10.2. decoder C example + 11. state settings reference + 12. changes + 13. contact information + + +1. about +-------- + +PNG is a file format to store raster images losslessly with good compression, +supporting different color types and alpha channel. + +LodePNG is a PNG codec according to the Portable Network Graphics (PNG) +Specification (Second Edition) - W3C Recommendation 10 November 2003. + +The specifications used are: + +*) Portable Network Graphics (PNG) Specification (Second Edition): + http://www.w3.org/TR/2003/REC-PNG-20031110 +*) RFC 1950 ZLIB Compressed Data Format version 3.3: + http://www.gzip.org/zlib/rfc-zlib.html +*) RFC 1951 DEFLATE Compressed Data Format Specification ver 1.3: + http://www.gzip.org/zlib/rfc-deflate.html + +The most recent version of LodePNG can currently be found at +http://lodev.org/lodepng/ + +LodePNG works both in C (ISO C90) and C++, with a C++ wrapper that adds +extra functionality. + +LodePNG exists out of two files: +-lodepng.h: the header file for both C and C++ +-lodepng.c(pp): give it the name lodepng.c or lodepng.cpp (or .cc) depending on your usage + +If you want to start using LodePNG right away without reading this doc, get the +examples from the LodePNG website to see how to use it in code, or check the +smaller examples in chapter 13 here. + +LodePNG is simple but only supports the basic requirements. To achieve +simplicity, the following design choices were made: There are no dependencies +on any external library. There are functions to decode and encode a PNG with +a single function call, and extended versions of these functions taking a +LodePNGState struct allowing to specify or get more information. By default +the colors of the raw image are always RGB or RGBA, no matter what color type +the PNG file uses. To read and write files, there are simple functions to +convert the files to/from buffers in memory. + +This all makes LodePNG suitable for loading textures in games, demos and small +programs, ... It's less suitable for full fledged image editors, loading PNGs +over network (it requires all the image data to be available before decoding can +begin), life-critical systems, ... + +1.1. supported features +----------------------- + +The following features are supported by the decoder: + +*) decoding of PNGs with any color type, bit depth and interlace mode, to a 24- or 32-bit color raw image, + or the same color type as the PNG +*) encoding of PNGs, from any raw image to 24- or 32-bit color, or the same color type as the raw image +*) Adam7 interlace and deinterlace for any color type +*) loading the image from harddisk or decoding it from a buffer from other sources than harddisk +*) support for alpha channels, including RGBA color model, translucent palettes and color keying +*) zlib decompression (inflate) +*) zlib compression (deflate) +*) CRC32 and ADLER32 checksums +*) colorimetric color profile conversions: currently experimentally available in lodepng_util.cpp only, + plus alternatively ability to pass on chroma/gamma/ICC profile information to other color management system. +*) handling of unknown chunks, allowing making a PNG editor that stores custom and unknown chunks. +*) the following chunks are supported by both encoder and decoder: + IHDR: header information + PLTE: color palette + IDAT: pixel data + IEND: the final chunk + tRNS: transparency for palettized images + tEXt: textual information + zTXt: compressed textual information + iTXt: international textual information + bKGD: suggested background color + pHYs: physical dimensions + tIME: modification time + cHRM: RGB chromaticities + gAMA: RGB gamma correction + iCCP: ICC color profile + sRGB: rendering intent + +1.2. features not supported +--------------------------- + +The following features are _not_ supported: + +*) some features needed to make a conformant PNG-Editor might be still missing. +*) partial loading/stream processing. All data must be available and is processed in one call. +*) The following public chunks are not (yet) supported but treated as unknown chunks by LodePNG: + sBIT + hIST + sPLT + + +2. C and C++ version +-------------------- + +The C version uses buffers allocated with alloc that you need to free() +yourself. You need to use init and cleanup functions for each struct whenever +using a struct from the C version to avoid exploits and memory leaks. + +The C++ version has extra functions with std::vectors in the interface and the +lodepng::State class which is a LodePNGState with constructor and destructor. + +These files work without modification for both C and C++ compilers because all +the additional C++ code is in "#ifdef __cplusplus" blocks that make C-compilers +ignore it, and the C code is made to compile both with strict ISO C90 and C++. + +To use the C++ version, you need to rename the source file to lodepng.cpp +(instead of lodepng.c), and compile it with a C++ compiler. + +To use the C version, you need to rename the source file to lodepng.c (instead +of lodepng.cpp), and compile it with a C compiler. + + +3. Security +----------- + +Even if carefully designed, it's always possible that LodePNG contains possible +exploits. If you discover one, please let me know, and it will be fixed. + +When using LodePNG, care has to be taken with the C version of LodePNG, as well +as the C-style structs when working with C++. The following conventions are used +for all C-style structs: + +-if a struct has a corresponding init function, always call the init function when making a new one +-if a struct has a corresponding cleanup function, call it before the struct disappears to avoid memory leaks +-if a struct has a corresponding copy function, use the copy function instead of "=". + The destination must also be inited already. + + +4. Decoding +----------- + +Decoding converts a PNG compressed image to a raw pixel buffer. + +Most documentation on using the decoder is at its declarations in the header +above. For C, simple decoding can be done with functions such as +lodepng_decode32, and more advanced decoding can be done with the struct +LodePNGState and lodepng_decode. For C++, all decoding can be done with the +various lodepng::decode functions, and lodepng::State can be used for advanced +features. + +When using the LodePNGState, it uses the following fields for decoding: +*) LodePNGInfo info_png: it stores extra information about the PNG (the input) in here +*) LodePNGColorMode info_raw: here you can say what color mode of the raw image (the output) you want to get +*) LodePNGDecoderSettings decoder: you can specify a few extra settings for the decoder to use + +LodePNGInfo info_png +-------------------- + +After decoding, this contains extra information of the PNG image, except the actual +pixels, width and height because these are already gotten directly from the decoder +functions. + +It contains for example the original color type of the PNG image, text comments, +suggested background color, etc... More details about the LodePNGInfo struct are +at its declaration documentation. + +LodePNGColorMode info_raw +------------------------- + +When decoding, here you can specify which color type you want +the resulting raw image to be. If this is different from the colortype of the +PNG, then the decoder will automatically convert the result. This conversion +always works, except if you want it to convert a color PNG to grayscale or to +a palette with missing colors. + +By default, 32-bit color is used for the result. + +LodePNGDecoderSettings decoder +------------------------------ + +The settings can be used to ignore the errors created by invalid CRC and Adler32 +chunks, and to disable the decoding of tEXt chunks. + +There's also a setting color_convert, true by default. If false, no conversion +is done, the resulting data will be as it was in the PNG (after decompression) +and you'll have to puzzle the colors of the pixels together yourself using the +color type information in the LodePNGInfo. + + +5. Encoding +----------- + +Encoding converts a raw pixel buffer to a PNG compressed image. + +Most documentation on using the encoder is at its declarations in the header +above. For C, simple encoding can be done with functions such as +lodepng_encode32, and more advanced decoding can be done with the struct +LodePNGState and lodepng_encode. For C++, all encoding can be done with the +various lodepng::encode functions, and lodepng::State can be used for advanced +features. + +Like the decoder, the encoder can also give errors. However it gives less errors +since the encoder input is trusted, the decoder input (a PNG image that could +be forged by anyone) is not trusted. + +When using the LodePNGState, it uses the following fields for encoding: +*) LodePNGInfo info_png: here you specify how you want the PNG (the output) to be. +*) LodePNGColorMode info_raw: here you say what color type of the raw image (the input) has +*) LodePNGEncoderSettings encoder: you can specify a few settings for the encoder to use + +LodePNGInfo info_png +-------------------- + +When encoding, you use this the opposite way as when decoding: for encoding, +you fill in the values you want the PNG to have before encoding. By default it's +not needed to specify a color type for the PNG since it's automatically chosen, +but it's possible to choose it yourself given the right settings. + +The encoder will not always exactly match the LodePNGInfo struct you give, +it tries as close as possible. Some things are ignored by the encoder. The +encoder uses, for example, the following settings from it when applicable: +colortype and bitdepth, text chunks, time chunk, the color key, the palette, the +background color, the interlace method, unknown chunks, ... + +When encoding to a PNG with colortype 3, the encoder will generate a PLTE chunk. +If the palette contains any colors for which the alpha channel is not 255 (so +there are translucent colors in the palette), it'll add a tRNS chunk. + +LodePNGColorMode info_raw +------------------------- + +You specify the color type of the raw image that you give to the input here, +including a possible transparent color key and palette you happen to be using in +your raw image data. + +By default, 32-bit color is assumed, meaning your input has to be in RGBA +format with 4 bytes (unsigned chars) per pixel. + +LodePNGEncoderSettings encoder +------------------------------ + +The following settings are supported (some are in sub-structs): +*) auto_convert: when this option is enabled, the encoder will +automatically choose the smallest possible color mode (including color key) that +can encode the colors of all pixels without information loss. +*) btype: the block type for LZ77. 0 = uncompressed, 1 = fixed huffman tree, + 2 = dynamic huffman tree (best compression). Should be 2 for proper + compression. +*) use_lz77: whether or not to use LZ77 for compressed block types. Should be + true for proper compression. +*) windowsize: the window size used by the LZ77 encoder (1 - 32768). Has value + 2048 by default, but can be set to 32768 for better, but slow, compression. +*) force_palette: if colortype is 2 or 6, you can make the encoder write a PLTE + chunk if force_palette is true. This can used as suggested palette to convert + to by viewers that don't support more than 256 colors (if those still exist) +*) add_id: add text chunk "Encoder: LodePNG " to the image. +*) text_compression: default 1. If 1, it'll store texts as zTXt instead of tEXt chunks. + zTXt chunks use zlib compression on the text. This gives a smaller result on + large texts but a larger result on small texts (such as a single program name). + It's all tEXt or all zTXt though, there's no separate setting per text yet. + + +6. color conversions +-------------------- + +An important thing to note about LodePNG, is that the color type of the PNG, and +the color type of the raw image, are completely independent. By default, when +you decode a PNG, you get the result as a raw image in the color type you want, +no matter whether the PNG was encoded with a palette, grayscale or RGBA color. +And if you encode an image, by default LodePNG will automatically choose the PNG +color type that gives good compression based on the values of colors and amount +of colors in the image. It can be configured to let you control it instead as +well, though. + +To be able to do this, LodePNG does conversions from one color mode to another. +It can convert from almost any color type to any other color type, except the +following conversions: RGB to grayscale is not supported, and converting to a +palette when the palette doesn't have a required color is not supported. This is +not supported on purpose: this is information loss which requires a color +reduction algorithm that is beyond the scope of a PNG encoder (yes, RGB to gray +is easy, but there are multiple ways if you want to give some channels more +weight). + +By default, when decoding, you get the raw image in 32-bit RGBA or 24-bit RGB +color, no matter what color type the PNG has. And by default when encoding, +LodePNG automatically picks the best color model for the output PNG, and expects +the input image to be 32-bit RGBA or 24-bit RGB. So, unless you want to control +the color format of the images yourself, you can skip this chapter. + +6.1. PNG color types +-------------------- + +A PNG image can have many color types, ranging from 1-bit color to 64-bit color, +as well as palettized color modes. After the zlib decompression and unfiltering +in the PNG image is done, the raw pixel data will have that color type and thus +a certain amount of bits per pixel. If you want the output raw image after +decoding to have another color type, a conversion is done by LodePNG. + +The PNG specification gives the following color types: + +0: grayscale, bit depths 1, 2, 4, 8, 16 +2: RGB, bit depths 8 and 16 +3: palette, bit depths 1, 2, 4 and 8 +4: grayscale with alpha, bit depths 8 and 16 +6: RGBA, bit depths 8 and 16 + +Bit depth is the amount of bits per pixel per color channel. So the total amount +of bits per pixel is: amount of channels * bitdepth. + +6.2. color conversions +---------------------- + +As explained in the sections about the encoder and decoder, you can specify +color types and bit depths in info_png and info_raw to change the default +behaviour. + +If, when decoding, you want the raw image to be something else than the default, +you need to set the color type and bit depth you want in the LodePNGColorMode, +or the parameters colortype and bitdepth of the simple decoding function. + +If, when encoding, you use another color type than the default in the raw input +image, you need to specify its color type and bit depth in the LodePNGColorMode +of the raw image, or use the parameters colortype and bitdepth of the simple +encoding function. + +If, when encoding, you don't want LodePNG to choose the output PNG color type +but control it yourself, you need to set auto_convert in the encoder settings +to false, and specify the color type you want in the LodePNGInfo of the +encoder (including palette: it can generate a palette if auto_convert is true, +otherwise not). + +If the input and output color type differ (whether user chosen or auto chosen), +LodePNG will do a color conversion, which follows the rules below, and may +sometimes result in an error. + +To avoid some confusion: +-the decoder converts from PNG to raw image +-the encoder converts from raw image to PNG +-the colortype and bitdepth in LodePNGColorMode info_raw, are those of the raw image +-the colortype and bitdepth in the color field of LodePNGInfo info_png, are those of the PNG +-when encoding, the color type in LodePNGInfo is ignored if auto_convert + is enabled, it is automatically generated instead +-when decoding, the color type in LodePNGInfo is set by the decoder to that of the original + PNG image, but it can be ignored since the raw image has the color type you requested instead +-if the color type of the LodePNGColorMode and PNG image aren't the same, a conversion + between the color types is done if the color types are supported. If it is not + supported, an error is returned. If the types are the same, no conversion is done. +-even though some conversions aren't supported, LodePNG supports loading PNGs from any + colortype and saving PNGs to any colortype, sometimes it just requires preparing + the raw image correctly before encoding. +-both encoder and decoder use the same color converter. + +The function lodepng_convert does the color conversion. It is available in the +interface but normally isn't needed since the encoder and decoder already call +it. + +Non supported color conversions: +-color to grayscale when non-gray pixels are present: no error is thrown, but +the result will look ugly because only the red channel is taken (it assumes all +three channels are the same in this case so ignores green and blue). The reason +no error is given is to allow converting from three-channel grayscale images to +one-channel even if there are numerical imprecisions. +-anything to palette when the palette does not have an exact match for a from-color +in it: in this case an error is thrown + +Supported color conversions: +-anything to 8-bit RGB, 8-bit RGBA, 16-bit RGB, 16-bit RGBA +-any gray or gray+alpha, to gray or gray+alpha +-anything to a palette, as long as the palette has the requested colors in it +-removing alpha channel +-higher to smaller bitdepth, and vice versa + +If you want no color conversion to be done (e.g. for speed or control): +-In the encoder, you can make it save a PNG with any color type by giving the +raw color mode and LodePNGInfo the same color mode, and setting auto_convert to +false. +-In the decoder, you can make it store the pixel data in the same color type +as the PNG has, by setting the color_convert setting to false. Settings in +info_raw are then ignored. + +6.3. padding bits +----------------- + +In the PNG file format, if a less than 8-bit per pixel color type is used and the scanlines +have a bit amount that isn't a multiple of 8, then padding bits are used so that each +scanline starts at a fresh byte. But that is NOT true for the LodePNG raw input and output. +The raw input image you give to the encoder, and the raw output image you get from the decoder +will NOT have these padding bits, e.g. in the case of a 1-bit image with a width +of 7 pixels, the first pixel of the second scanline will the 8th bit of the first byte, +not the first bit of a new byte. + +6.4. A note about 16-bits per channel and endianness +---------------------------------------------------- + +LodePNG uses unsigned char arrays for 16-bit per channel colors too, just like +for any other color format. The 16-bit values are stored in big endian (most +significant byte first) in these arrays. This is the opposite order of the +little endian used by x86 CPU's. + +LodePNG always uses big endian because the PNG file format does so internally. +Conversions to other formats than PNG uses internally are not supported by +LodePNG on purpose, there are myriads of formats, including endianness of 16-bit +colors, the order in which you store R, G, B and A, and so on. Supporting and +converting to/from all that is outside the scope of LodePNG. + +This may mean that, depending on your use case, you may want to convert the big +endian output of LodePNG to little endian with a for loop. This is certainly not +always needed, many applications and libraries support big endian 16-bit colors +anyway, but it means you cannot simply cast the unsigned char* buffer to an +unsigned short* buffer on x86 CPUs. + + +7. error values +--------------- + +All functions in LodePNG that return an error code, return 0 if everything went +OK, or a non-zero code if there was an error. + +The meaning of the LodePNG error values can be retrieved with the function +lodepng_error_text: given the numerical error code, it returns a description +of the error in English as a string. + +Check the implementation of lodepng_error_text to see the meaning of each code. + + +8. chunks and PNG editing +------------------------- + +If you want to add extra chunks to a PNG you encode, or use LodePNG for a PNG +editor that should follow the rules about handling of unknown chunks, or if your +program is able to read other types of chunks than the ones handled by LodePNG, +then that's possible with the chunk functions of LodePNG. + +A PNG chunk has the following layout: + +4 bytes length +4 bytes type name +length bytes data +4 bytes CRC + +8.1. iterating through chunks +----------------------------- + +If you have a buffer containing the PNG image data, then the first chunk (the +IHDR chunk) starts at byte number 8 of that buffer. The first 8 bytes are the +signature of the PNG and are not part of a chunk. But if you start at byte 8 +then you have a chunk, and can check the following things of it. + +NOTE: none of these functions check for memory buffer boundaries. To avoid +exploits, always make sure the buffer contains all the data of the chunks. +When using lodepng_chunk_next, make sure the returned value is within the +allocated memory. + +unsigned lodepng_chunk_length(const unsigned char* chunk): + +Get the length of the chunk's data. The total chunk length is this length + 12. + +void lodepng_chunk_type(char type[5], const unsigned char* chunk): +unsigned char lodepng_chunk_type_equals(const unsigned char* chunk, const char* type): + +Get the type of the chunk or compare if it's a certain type + +unsigned char lodepng_chunk_critical(const unsigned char* chunk): +unsigned char lodepng_chunk_private(const unsigned char* chunk): +unsigned char lodepng_chunk_safetocopy(const unsigned char* chunk): + +Check if the chunk is critical in the PNG standard (only IHDR, PLTE, IDAT and IEND are). +Check if the chunk is private (public chunks are part of the standard, private ones not). +Check if the chunk is safe to copy. If it's not, then, when modifying data in a critical +chunk, unsafe to copy chunks of the old image may NOT be saved in the new one if your +program doesn't handle that type of unknown chunk. + +unsigned char* lodepng_chunk_data(unsigned char* chunk): +const unsigned char* lodepng_chunk_data_const(const unsigned char* chunk): + +Get a pointer to the start of the data of the chunk. + +unsigned lodepng_chunk_check_crc(const unsigned char* chunk): +void lodepng_chunk_generate_crc(unsigned char* chunk): + +Check if the crc is correct or generate a correct one. + +unsigned char* lodepng_chunk_next(unsigned char* chunk): +const unsigned char* lodepng_chunk_next_const(const unsigned char* chunk): + +Iterate to the next chunk. This works if you have a buffer with consecutive chunks. Note that these +functions do no boundary checking of the allocated data whatsoever, so make sure there is enough +data available in the buffer to be able to go to the next chunk. + +unsigned lodepng_chunk_append(unsigned char** out, size_t* outsize, const unsigned char* chunk): +unsigned lodepng_chunk_create(unsigned char** out, size_t* outsize, unsigned length, + const char* type, const unsigned char* data): + +These functions are used to create new chunks that are appended to the data in *out that has +length *outsize. The append function appends an existing chunk to the new data. The create +function creates a new chunk with the given parameters and appends it. Type is the 4-letter +name of the chunk. + +8.2. chunks in info_png +----------------------- + +The LodePNGInfo struct contains fields with the unknown chunk in it. It has 3 +buffers (each with size) to contain 3 types of unknown chunks: +the ones that come before the PLTE chunk, the ones that come between the PLTE +and the IDAT chunks, and the ones that come after the IDAT chunks. +It's necessary to make the distinction between these 3 cases because the PNG +standard forces to keep the ordering of unknown chunks compared to the critical +chunks, but does not force any other ordering rules. + +info_png.unknown_chunks_data[0] is the chunks before PLTE +info_png.unknown_chunks_data[1] is the chunks after PLTE, before IDAT +info_png.unknown_chunks_data[2] is the chunks after IDAT + +The chunks in these 3 buffers can be iterated through and read by using the same +way described in the previous subchapter. + +When using the decoder to decode a PNG, you can make it store all unknown chunks +if you set the option settings.remember_unknown_chunks to 1. By default, this +option is off (0). + +The encoder will always encode unknown chunks that are stored in the info_png. +If you need it to add a particular chunk that isn't known by LodePNG, you can +use lodepng_chunk_append or lodepng_chunk_create to the chunk data in +info_png.unknown_chunks_data[x]. + +Chunks that are known by LodePNG should not be added in that way. E.g. to make +LodePNG add a bKGD chunk, set background_defined to true and add the correct +parameters there instead. + + +9. compiler support +------------------- + +No libraries other than the current standard C library are needed to compile +LodePNG. For the C++ version, only the standard C++ library is needed on top. +Add the files lodepng.c(pp) and lodepng.h to your project, include +lodepng.h where needed, and your program can read/write PNG files. + +It is compatible with C90 and up, and C++03 and up. + +If performance is important, use optimization when compiling! For both the +encoder and decoder, this makes a large difference. + +Make sure that LodePNG is compiled with the same compiler of the same version +and with the same settings as the rest of the program, or the interfaces with +std::vectors and std::strings in C++ can be incompatible. + +CHAR_BITS must be 8 or higher, because LodePNG uses unsigned chars for octets. + +*) gcc and g++ + +LodePNG is developed in gcc so this compiler is natively supported. It gives no +warnings with compiler options "-Wall -Wextra -pedantic -ansi", with gcc and g++ +version 4.7.1 on Linux, 32-bit and 64-bit. + +*) Clang + +Fully supported and warning-free. + +*) Mingw + +The Mingw compiler (a port of gcc for Windows) should be fully supported by +LodePNG. + +*) Visual Studio and Visual C++ Express Edition + +LodePNG should be warning-free with warning level W4. Two warnings were disabled +with pragmas though: warning 4244 about implicit conversions, and warning 4996 +where it wants to use a non-standard function fopen_s instead of the standard C +fopen. + +Visual Studio may want "stdafx.h" files to be included in each source file and +give an error "unexpected end of file while looking for precompiled header". +This is not standard C++ and will not be added to the stock LodePNG. You can +disable it for lodepng.cpp only by right clicking it, Properties, C/C++, +Precompiled Headers, and set it to Not Using Precompiled Headers there. + +NOTE: Modern versions of VS should be fully supported, but old versions, e.g. +VS6, are not guaranteed to work. + +*) Compilers on Macintosh + +LodePNG has been reported to work both with gcc and LLVM for Macintosh, both for +C and C++. + +*) Other Compilers + +If you encounter problems on any compilers, feel free to let me know and I may +try to fix it if the compiler is modern and standards compliant. + + +10. examples +------------ + +This decoder example shows the most basic usage of LodePNG. More complex +examples can be found on the LodePNG website. + +10.1. decoder C++ example +------------------------- + +#include "lodepng.h" +#include + +int main(int argc, char *argv[]) { + const char* filename = argc > 1 ? argv[1] : "test.png"; + + //load and decode + std::vector image; + unsigned width, height; + unsigned error = lodepng::decode(image, width, height, filename); + + //if there's an error, display it + if(error) std::cout << "decoder error " << error << ": " << lodepng_error_text(error) << std::endl; + + //the pixels are now in the vector "image", 4 bytes per pixel, ordered RGBARGBA..., use it as texture, draw it, ... +} + +10.2. decoder C example +----------------------- + +#include "lodepng.h" + +int main(int argc, char *argv[]) { + unsigned error; + unsigned char* image; + size_t width, height; + const char* filename = argc > 1 ? argv[1] : "test.png"; + + error = lodepng_decode32_file(&image, &width, &height, filename); + + if(error) printf("decoder error %u: %s\n", error, lodepng_error_text(error)); + + / * use image here * / + + free(image); + return 0; +} + +11. state settings reference +---------------------------- + +A quick reference of some settings to set on the LodePNGState + +For decoding: + +state.decoder.zlibsettings.ignore_adler32: ignore ADLER32 checksums +state.decoder.zlibsettings.custom_...: use custom inflate function +state.decoder.ignore_crc: ignore CRC checksums +state.decoder.ignore_critical: ignore unknown critical chunks +state.decoder.ignore_end: ignore missing IEND chunk. May fail if this corruption causes other errors +state.decoder.color_convert: convert internal PNG color to chosen one +state.decoder.read_text_chunks: whether to read in text metadata chunks +state.decoder.remember_unknown_chunks: whether to read in unknown chunks +state.info_raw.colortype: desired color type for decoded image +state.info_raw.bitdepth: desired bit depth for decoded image +state.info_raw....: more color settings, see struct LodePNGColorMode +state.info_png....: no settings for decoder but ouput, see struct LodePNGInfo + +For encoding: + +state.encoder.zlibsettings.btype: disable compression by setting it to 0 +state.encoder.zlibsettings.use_lz77: use LZ77 in compression +state.encoder.zlibsettings.windowsize: tweak LZ77 windowsize +state.encoder.zlibsettings.minmatch: tweak min LZ77 length to match +state.encoder.zlibsettings.nicematch: tweak LZ77 match where to stop searching +state.encoder.zlibsettings.lazymatching: try one more LZ77 matching +state.encoder.zlibsettings.custom_...: use custom deflate function +state.encoder.auto_convert: choose optimal PNG color type, if 0 uses info_png +state.encoder.filter_palette_zero: PNG filter strategy for palette +state.encoder.filter_strategy: PNG filter strategy to encode with +state.encoder.force_palette: add palette even if not encoding to one +state.encoder.add_id: add LodePNG identifier and version as a text chunk +state.encoder.text_compression: use compressed text chunks for metadata +state.info_raw.colortype: color type of raw input image you provide +state.info_raw.bitdepth: bit depth of raw input image you provide +state.info_raw: more color settings, see struct LodePNGColorMode +state.info_png.color.colortype: desired color type if auto_convert is false +state.info_png.color.bitdepth: desired bit depth if auto_convert is false +state.info_png.color....: more color settings, see struct LodePNGColorMode +state.info_png....: more PNG related settings, see struct LodePNGInfo + + +12. changes +----------- + +The version number of LodePNG is the date of the change given in the format +yyyymmdd. + +Some changes aren't backwards compatible. Those are indicated with a (!) +symbol. + +Not all changes are listed here, the commit history in github lists more: +https://github.com/lvandeve/lodepng + +*) 06 mar 2020: simplified some of the dynamic memory allocations. +*) 12 jan 2020: (!) added 'end' argument to lodepng_chunk_next to allow correct + overflow checks. +*) 14 aug 2019: around 25% faster decoding thanks to huffman lookup tables. +*) 15 jun 2019: (!) auto_choose_color API changed (for bugfix: don't use palette + if gray ICC profile) and non-ICC LodePNGColorProfile renamed to + LodePNGColorStats. +*) 30 dec 2018: code style changes only: removed newlines before opening braces. +*) 10 sep 2018: added way to inspect metadata chunks without full decoding. +*) 19 aug 2018: (!) fixed color mode bKGD is encoded with and made it use + palette index in case of palette. +*) 10 aug 2018: (!) added support for gAMA, cHRM, sRGB and iCCP chunks. This + change is backwards compatible unless you relied on unknown_chunks for those. +*) 11 jun 2018: less restrictive check for pixel size integer overflow +*) 14 jan 2018: allow optionally ignoring a few more recoverable errors +*) 17 sep 2017: fix memory leak for some encoder input error cases +*) 27 nov 2016: grey+alpha auto color model detection bugfix +*) 18 apr 2016: Changed qsort to custom stable sort (for platforms w/o qsort). +*) 09 apr 2016: Fixed colorkey usage detection, and better file loading (within + the limits of pure C90). +*) 08 dec 2015: Made load_file function return error if file can't be opened. +*) 24 okt 2015: Bugfix with decoding to palette output. +*) 18 apr 2015: Boundary PM instead of just package-merge for faster encoding. +*) 24 aug 2014: Moved to github +*) 23 aug 2014: Reduced needless memory usage of decoder. +*) 28 jun 2014: Removed fix_png setting, always support palette OOB for + simplicity. Made ColorProfile public. +*) 09 jun 2014: Faster encoder by fixing hash bug and more zeros optimization. +*) 22 dec 2013: Power of two windowsize required for optimization. +*) 15 apr 2013: Fixed bug with LAC_ALPHA and color key. +*) 25 mar 2013: Added an optional feature to ignore some PNG errors (fix_png). +*) 11 mar 2013: (!) Bugfix with custom free. Changed from "my" to "lodepng_" + prefix for the custom allocators and made it possible with a new #define to + use custom ones in your project without needing to change lodepng's code. +*) 28 jan 2013: Bugfix with color key. +*) 27 okt 2012: Tweaks in text chunk keyword length error handling. +*) 8 okt 2012: (!) Added new filter strategy (entropy) and new auto color mode. + (no palette). Better deflate tree encoding. New compression tweak settings. + Faster color conversions while decoding. Some internal cleanups. +*) 23 sep 2012: Reduced warnings in Visual Studio a little bit. +*) 1 sep 2012: (!) Removed #define's for giving custom (de)compression functions + and made it work with function pointers instead. +*) 23 jun 2012: Added more filter strategies. Made it easier to use custom alloc + and free functions and toggle #defines from compiler flags. Small fixes. +*) 6 may 2012: (!) Made plugging in custom zlib/deflate functions more flexible. +*) 22 apr 2012: (!) Made interface more consistent, renaming a lot. Removed + redundant C++ codec classes. Reduced amount of structs. Everything changed, + but it is cleaner now imho and functionality remains the same. Also fixed + several bugs and shrunk the implementation code. Made new samples. +*) 6 nov 2011: (!) By default, the encoder now automatically chooses the best + PNG color model and bit depth, based on the amount and type of colors of the + raw image. For this, autoLeaveOutAlphaChannel replaced by auto_choose_color. +*) 9 okt 2011: simpler hash chain implementation for the encoder. +*) 8 sep 2011: lz77 encoder lazy matching instead of greedy matching. +*) 23 aug 2011: tweaked the zlib compression parameters after benchmarking. + A bug with the PNG filtertype heuristic was fixed, so that it chooses much + better ones (it's quite significant). A setting to do an experimental, slow, + brute force search for PNG filter types is added. +*) 17 aug 2011: (!) changed some C zlib related function names. +*) 16 aug 2011: made the code less wide (max 120 characters per line). +*) 17 apr 2011: code cleanup. Bugfixes. Convert low to 16-bit per sample colors. +*) 21 feb 2011: fixed compiling for C90. Fixed compiling with sections disabled. +*) 11 dec 2010: encoding is made faster, based on suggestion by Peter Eastman + to optimize long sequences of zeros. +*) 13 nov 2010: added LodePNG_InfoColor_hasPaletteAlpha and + LodePNG_InfoColor_canHaveAlpha functions for convenience. +*) 7 nov 2010: added LodePNG_error_text function to get error code description. +*) 30 okt 2010: made decoding slightly faster +*) 26 okt 2010: (!) changed some C function and struct names (more consistent). + Reorganized the documentation and the declaration order in the header. +*) 08 aug 2010: only changed some comments and external samples. +*) 05 jul 2010: fixed bug thanks to warnings in the new gcc version. +*) 14 mar 2010: fixed bug where too much memory was allocated for char buffers. +*) 02 sep 2008: fixed bug where it could create empty tree that linux apps could + read by ignoring the problem but windows apps couldn't. +*) 06 jun 2008: added more error checks for out of memory cases. +*) 26 apr 2008: added a few more checks here and there to ensure more safety. +*) 06 mar 2008: crash with encoding of strings fixed +*) 02 feb 2008: support for international text chunks added (iTXt) +*) 23 jan 2008: small cleanups, and #defines to divide code in sections +*) 20 jan 2008: support for unknown chunks allowing using LodePNG for an editor. +*) 18 jan 2008: support for tIME and pHYs chunks added to encoder and decoder. +*) 17 jan 2008: ability to encode and decode compressed zTXt chunks added + Also various fixes, such as in the deflate and the padding bits code. +*) 13 jan 2008: Added ability to encode Adam7-interlaced images. Improved + filtering code of encoder. +*) 07 jan 2008: (!) changed LodePNG to use ISO C90 instead of C++. A + C++ wrapper around this provides an interface almost identical to before. + Having LodePNG be pure ISO C90 makes it more portable. The C and C++ code + are together in these files but it works both for C and C++ compilers. +*) 29 dec 2007: (!) changed most integer types to unsigned int + other tweaks +*) 30 aug 2007: bug fixed which makes this Borland C++ compatible +*) 09 aug 2007: some VS2005 warnings removed again +*) 21 jul 2007: deflate code placed in new namespace separate from zlib code +*) 08 jun 2007: fixed bug with 2- and 4-bit color, and small interlaced images +*) 04 jun 2007: improved support for Visual Studio 2005: crash with accessing + invalid std::vector element [0] fixed, and level 3 and 4 warnings removed +*) 02 jun 2007: made the encoder add a tag with version by default +*) 27 may 2007: zlib and png code separated (but still in the same file), + simple encoder/decoder functions added for more simple usage cases +*) 19 may 2007: minor fixes, some code cleaning, new error added (error 69), + moved some examples from here to lodepng_examples.cpp +*) 12 may 2007: palette decoding bug fixed +*) 24 apr 2007: changed the license from BSD to the zlib license +*) 11 mar 2007: very simple addition: ability to encode bKGD chunks. +*) 04 mar 2007: (!) tEXt chunk related fixes, and support for encoding + palettized PNG images. Plus little interface change with palette and texts. +*) 03 mar 2007: Made it encode dynamic Huffman shorter with repeat codes. + Fixed a bug where the end code of a block had length 0 in the Huffman tree. +*) 26 feb 2007: Huffman compression with dynamic trees (BTYPE 2) now implemented + and supported by the encoder, resulting in smaller PNGs at the output. +*) 27 jan 2007: Made the Adler-32 test faster so that a timewaste is gone. +*) 24 jan 2007: gave encoder an error interface. Added color conversion from any + greyscale type to 8-bit greyscale with or without alpha. +*) 21 jan 2007: (!) Totally changed the interface. It allows more color types + to convert to and is more uniform. See the manual for how it works now. +*) 07 jan 2007: Some cleanup & fixes, and a few changes over the last days: + encode/decode custom tEXt chunks, separate classes for zlib & deflate, and + at last made the decoder give errors for incorrect Adler32 or Crc. +*) 01 jan 2007: Fixed bug with encoding PNGs with less than 8 bits per channel. +*) 29 dec 2006: Added support for encoding images without alpha channel, and + cleaned out code as well as making certain parts faster. +*) 28 dec 2006: Added "Settings" to the encoder. +*) 26 dec 2006: The encoder now does LZ77 encoding and produces much smaller files now. + Removed some code duplication in the decoder. Fixed little bug in an example. +*) 09 dec 2006: (!) Placed output parameters of public functions as first parameter. + Fixed a bug of the decoder with 16-bit per color. +*) 15 okt 2006: Changed documentation structure +*) 09 okt 2006: Encoder class added. It encodes a valid PNG image from the + given image buffer, however for now it's not compressed. +*) 08 sep 2006: (!) Changed to interface with a Decoder class +*) 30 jul 2006: (!) LodePNG_InfoPng , width and height are now retrieved in different + way. Renamed decodePNG to decodePNGGeneric. +*) 29 jul 2006: (!) Changed the interface: image info is now returned as a + struct of type LodePNG::LodePNG_Info, instead of a vector, which was a bit clumsy. +*) 28 jul 2006: Cleaned the code and added new error checks. + Corrected terminology "deflate" into "inflate". +*) 23 jun 2006: Added SDL example in the documentation in the header, this + example allows easy debugging by displaying the PNG and its transparency. +*) 22 jun 2006: (!) Changed way to obtain error value. Added + loadFile function for convenience. Made decodePNG32 faster. +*) 21 jun 2006: (!) Changed type of info vector to unsigned. + Changed position of palette in info vector. Fixed an important bug that + happened on PNGs with an uncompressed block. +*) 16 jun 2006: Internally changed unsigned into unsigned where + needed, and performed some optimizations. +*) 07 jun 2006: (!) Renamed functions to decodePNG and placed them + in LodePNG namespace. Changed the order of the parameters. Rewrote the + documentation in the header. Renamed files to lodepng.cpp and lodepng.h +*) 22 apr 2006: Optimized and improved some code +*) 07 sep 2005: (!) Changed to std::vector interface +*) 12 aug 2005: Initial release (C++, decoder only) + + +13. contact information +----------------------- + +Feel free to contact me with suggestions, problems, comments, ... concerning +LodePNG. If you encounter a PNG image that doesn't work properly with this +decoder, feel free to send it and I'll use it to find and fix the problem. + +My email address is (puzzle the account and domain together with an @ symbol): +Domain: gmail dot com. +Account: lode dot vandevenne. + + +Copyright (c) 2005-2020 Lode Vandevenne +*/ diff --git a/third_party/physfs b/third_party/physfs deleted file mode 160000 index bfa7997c..00000000 --- a/third_party/physfs +++ /dev/null @@ -1 +0,0 @@ -Subproject commit bfa7997c671957eb0a340ff1cf3c634e6269904a diff --git a/third_party/physfs/LICENSE.txt b/third_party/physfs/LICENSE.txt new file mode 100644 index 00000000..8658ea43 --- /dev/null +++ b/third_party/physfs/LICENSE.txt @@ -0,0 +1,23 @@ + + Copyright (c) 2001-2019 Ryan C. Gordon and others. + + This software is provided 'as-is', without any express or implied warranty. + In no event will the authors be held liable for any damages arising from + the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software in a + product, an acknowledgment in the product documentation would be + appreciated but is not required. + + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source distribution. + + Ryan C. Gordon + diff --git a/third_party/physfs/README.txt b/third_party/physfs/README.txt new file mode 100644 index 00000000..2c24a503 --- /dev/null +++ b/third_party/physfs/README.txt @@ -0,0 +1,9 @@ + +PhysicsFS; a portable, flexible file i/o abstraction. + + https://icculus.org/physfs/ + +Please see the docs directory for documentation. + +Please see LICENSE.txt for licensing information. + diff --git a/third_party/physfs/physfs.c b/third_party/physfs/physfs.c new file mode 100644 index 00000000..fdb1405d --- /dev/null +++ b/third_party/physfs/physfs.c @@ -0,0 +1,3318 @@ +/** + * PhysicsFS; a portable, flexible file i/o abstraction. + * + * Documentation is in physfs.h. It's verbose, honest. :) + * + * Please see the file LICENSE.txt in the source's root directory. + * + * This file written by Ryan C. Gordon. + */ + +#define __PHYSICSFS_INTERNAL__ +#include "physfs_internal.h" + +#if defined(_MSC_VER) +#include + +/* this code came from https://stackoverflow.com/a/8712996 */ +int __PHYSFS_msvc_vsnprintf(char *outBuf, size_t size, const char *format, va_list ap) +{ + int count = -1; + + if (size != 0) + count = _vsnprintf_s(outBuf, size, _TRUNCATE, format, ap); + if (count == -1) + count = _vscprintf(format, ap); + + return count; +} + +int __PHYSFS_msvc_snprintf(char *outBuf, size_t size, const char *format, ...) +{ + int count; + va_list ap; + + va_start(ap, format); + count = __PHYSFS_msvc_vsnprintf(outBuf, size, format, ap); + va_end(ap); + + return count; +} +#endif + + +typedef struct __PHYSFS_DIRHANDLE__ +{ + void *opaque; /* Instance data unique to the archiver. */ + char *dirName; /* Path to archive in platform-dependent notation. */ + char *mountPoint; /* Mountpoint in virtual file tree. */ + const PHYSFS_Archiver *funcs; /* Ptr to archiver info for this handle. */ + struct __PHYSFS_DIRHANDLE__ *next; /* linked list stuff. */ +} DirHandle; + + +typedef struct __PHYSFS_FILEHANDLE__ +{ + PHYSFS_Io *io; /* Instance data unique to the archiver for this file. */ + PHYSFS_uint8 forReading; /* Non-zero if reading, zero if write/append */ + const DirHandle *dirHandle; /* Archiver instance that created this */ + PHYSFS_uint8 *buffer; /* Buffer, if set (NULL otherwise). Don't touch! */ + size_t bufsize; /* Bufsize, if set (0 otherwise). Don't touch! */ + size_t buffill; /* Buffer fill size. Don't touch! */ + size_t bufpos; /* Buffer position. Don't touch! */ + struct __PHYSFS_FILEHANDLE__ *next; /* linked list stuff. */ +} FileHandle; + + +typedef struct __PHYSFS_ERRSTATETYPE__ +{ + void *tid; + PHYSFS_ErrorCode code; + struct __PHYSFS_ERRSTATETYPE__ *next; +} ErrState; + + +/* General PhysicsFS state ... */ +static int initialized = 0; +static ErrState *errorStates = NULL; +static DirHandle *searchPath = NULL; +static DirHandle *writeDir = NULL; +static FileHandle *openWriteList = NULL; +static FileHandle *openReadList = NULL; +static char *baseDir = NULL; +static char *userDir = NULL; +static char *prefDir = NULL; +static int allowSymLinks = 0; +static PHYSFS_Archiver **archivers = NULL; +static PHYSFS_ArchiveInfo **archiveInfo = NULL; +static volatile size_t numArchivers = 0; + +/* mutexes ... */ +static void *errorLock = NULL; /* protects error message list. */ +static void *stateLock = NULL; /* protects other PhysFS static state. */ + +/* allocator ... */ +static int externalAllocator = 0; +PHYSFS_Allocator allocator; + + +#ifdef PHYSFS_NEED_ATOMIC_OP_FALLBACK +static inline int __PHYSFS_atomicAdd(int *ptrval, const int val) +{ + int retval; + __PHYSFS_platformGrabMutex(stateLock); + retval = *ptrval; + *ptrval = retval + val; + __PHYSFS_platformReleaseMutex(stateLock); + return retval; +} /* __PHYSFS_atomicAdd */ + +int __PHYSFS_ATOMIC_INCR(int *ptrval) +{ + return __PHYSFS_atomicAdd(ptrval, 1); +} /* __PHYSFS_ATOMIC_INCR */ + +int __PHYSFS_ATOMIC_DECR(int *ptrval) +{ + return __PHYSFS_atomicAdd(ptrval, -1); +} /* __PHYSFS_ATOMIC_DECR */ +#endif + + + +/* PHYSFS_Io implementation for i/o to physical filesystem... */ + +/* !!! FIXME: maybe refcount the paths in a string pool? */ +typedef struct __PHYSFS_NativeIoInfo +{ + void *handle; + const char *path; + int mode; /* 'r', 'w', or 'a' */ +} NativeIoInfo; + +static PHYSFS_sint64 nativeIo_read(PHYSFS_Io *io, void *buf, PHYSFS_uint64 len) +{ + NativeIoInfo *info = (NativeIoInfo *) io->opaque; + return __PHYSFS_platformRead(info->handle, buf, len); +} /* nativeIo_read */ + +static PHYSFS_sint64 nativeIo_write(PHYSFS_Io *io, const void *buffer, + PHYSFS_uint64 len) +{ + NativeIoInfo *info = (NativeIoInfo *) io->opaque; + return __PHYSFS_platformWrite(info->handle, buffer, len); +} /* nativeIo_write */ + +static int nativeIo_seek(PHYSFS_Io *io, PHYSFS_uint64 offset) +{ + NativeIoInfo *info = (NativeIoInfo *) io->opaque; + return __PHYSFS_platformSeek(info->handle, offset); +} /* nativeIo_seek */ + +static PHYSFS_sint64 nativeIo_tell(PHYSFS_Io *io) +{ + NativeIoInfo *info = (NativeIoInfo *) io->opaque; + return __PHYSFS_platformTell(info->handle); +} /* nativeIo_tell */ + +static PHYSFS_sint64 nativeIo_length(PHYSFS_Io *io) +{ + NativeIoInfo *info = (NativeIoInfo *) io->opaque; + return __PHYSFS_platformFileLength(info->handle); +} /* nativeIo_length */ + +static PHYSFS_Io *nativeIo_duplicate(PHYSFS_Io *io) +{ + NativeIoInfo *info = (NativeIoInfo *) io->opaque; + return __PHYSFS_createNativeIo(info->path, info->mode); +} /* nativeIo_duplicate */ + +static int nativeIo_flush(PHYSFS_Io *io) +{ + NativeIoInfo *info = (NativeIoInfo *) io->opaque; + return __PHYSFS_platformFlush(info->handle); +} /* nativeIo_flush */ + +static void nativeIo_destroy(PHYSFS_Io *io) +{ + NativeIoInfo *info = (NativeIoInfo *) io->opaque; + __PHYSFS_platformClose(info->handle); + allocator.Free((void *) info->path); + allocator.Free(info); + allocator.Free(io); +} /* nativeIo_destroy */ + +static const PHYSFS_Io __PHYSFS_nativeIoInterface = +{ + CURRENT_PHYSFS_IO_API_VERSION, NULL, + nativeIo_read, + nativeIo_write, + nativeIo_seek, + nativeIo_tell, + nativeIo_length, + nativeIo_duplicate, + nativeIo_flush, + nativeIo_destroy +}; + +PHYSFS_Io *__PHYSFS_createNativeIo(const char *path, const int mode) +{ + PHYSFS_Io *io = NULL; + NativeIoInfo *info = NULL; + void *handle = NULL; + char *pathdup = NULL; + + assert((mode == 'r') || (mode == 'w') || (mode == 'a')); + + io = (PHYSFS_Io *) allocator.Malloc(sizeof (PHYSFS_Io)); + GOTO_IF(!io, PHYSFS_ERR_OUT_OF_MEMORY, createNativeIo_failed); + info = (NativeIoInfo *) allocator.Malloc(sizeof (NativeIoInfo)); + GOTO_IF(!info, PHYSFS_ERR_OUT_OF_MEMORY, createNativeIo_failed); + pathdup = (char *) allocator.Malloc(strlen(path) + 1); + GOTO_IF(!pathdup, PHYSFS_ERR_OUT_OF_MEMORY, createNativeIo_failed); + + if (mode == 'r') + handle = __PHYSFS_platformOpenRead(path); + else if (mode == 'w') + handle = __PHYSFS_platformOpenWrite(path); + else if (mode == 'a') + handle = __PHYSFS_platformOpenAppend(path); + + GOTO_IF_ERRPASS(!handle, createNativeIo_failed); + + strcpy(pathdup, path); + info->handle = handle; + info->path = pathdup; + info->mode = mode; + memcpy(io, &__PHYSFS_nativeIoInterface, sizeof (*io)); + io->opaque = info; + return io; + +createNativeIo_failed: + if (handle != NULL) __PHYSFS_platformClose(handle); + if (pathdup != NULL) allocator.Free(pathdup); + if (info != NULL) allocator.Free(info); + if (io != NULL) allocator.Free(io); + return NULL; +} /* __PHYSFS_createNativeIo */ + + +/* PHYSFS_Io implementation for i/o to a memory buffer... */ + +typedef struct __PHYSFS_MemoryIoInfo +{ + const PHYSFS_uint8 *buf; + PHYSFS_uint64 len; + PHYSFS_uint64 pos; + PHYSFS_Io *parent; + int refcount; + void (*destruct)(void *); +} MemoryIoInfo; + +static PHYSFS_sint64 memoryIo_read(PHYSFS_Io *io, void *buf, PHYSFS_uint64 len) +{ + MemoryIoInfo *info = (MemoryIoInfo *) io->opaque; + const PHYSFS_uint64 avail = info->len - info->pos; + assert(avail <= info->len); + + if (avail == 0) + return 0; /* we're at EOF; nothing to do. */ + + if (len > avail) + len = avail; + + memcpy(buf, info->buf + info->pos, (size_t) len); + info->pos += len; + return len; +} /* memoryIo_read */ + +static PHYSFS_sint64 memoryIo_write(PHYSFS_Io *io, const void *buffer, + PHYSFS_uint64 len) +{ + BAIL(PHYSFS_ERR_OPEN_FOR_READING, -1); +} /* memoryIo_write */ + +static int memoryIo_seek(PHYSFS_Io *io, PHYSFS_uint64 offset) +{ + MemoryIoInfo *info = (MemoryIoInfo *) io->opaque; + BAIL_IF(offset > info->len, PHYSFS_ERR_PAST_EOF, 0); + info->pos = offset; + return 1; +} /* memoryIo_seek */ + +static PHYSFS_sint64 memoryIo_tell(PHYSFS_Io *io) +{ + const MemoryIoInfo *info = (MemoryIoInfo *) io->opaque; + return (PHYSFS_sint64) info->pos; +} /* memoryIo_tell */ + +static PHYSFS_sint64 memoryIo_length(PHYSFS_Io *io) +{ + const MemoryIoInfo *info = (MemoryIoInfo *) io->opaque; + return (PHYSFS_sint64) info->len; +} /* memoryIo_length */ + +static PHYSFS_Io *memoryIo_duplicate(PHYSFS_Io *io) +{ + MemoryIoInfo *info = (MemoryIoInfo *) io->opaque; + MemoryIoInfo *newinfo = NULL; + PHYSFS_Io *parent = info->parent; + PHYSFS_Io *retval = NULL; + + /* avoid deep copies. */ + assert((!parent) || (!((MemoryIoInfo *) parent->opaque)->parent) ); + + /* share the buffer between duplicates. */ + if (parent != NULL) /* dup the parent, increment its refcount. */ + return parent->duplicate(parent); + + /* we're the parent. */ + + retval = (PHYSFS_Io *) allocator.Malloc(sizeof (PHYSFS_Io)); + BAIL_IF(!retval, PHYSFS_ERR_OUT_OF_MEMORY, NULL); + newinfo = (MemoryIoInfo *) allocator.Malloc(sizeof (MemoryIoInfo)); + if (!newinfo) + { + allocator.Free(retval); + BAIL(PHYSFS_ERR_OUT_OF_MEMORY, NULL); + } /* if */ + + __PHYSFS_ATOMIC_INCR(&info->refcount); + + memset(newinfo, '\0', sizeof (*info)); + newinfo->buf = info->buf; + newinfo->len = info->len; + newinfo->pos = 0; + newinfo->parent = io; + newinfo->refcount = 0; + newinfo->destruct = NULL; + + memcpy(retval, io, sizeof (*retval)); + retval->opaque = newinfo; + return retval; +} /* memoryIo_duplicate */ + +static int memoryIo_flush(PHYSFS_Io *io) { return 1; /* it's read-only. */ } + +static void memoryIo_destroy(PHYSFS_Io *io) +{ + MemoryIoInfo *info = (MemoryIoInfo *) io->opaque; + PHYSFS_Io *parent = info->parent; + + if (parent != NULL) + { + assert(info->buf == ((MemoryIoInfo *) info->parent->opaque)->buf); + assert(info->len == ((MemoryIoInfo *) info->parent->opaque)->len); + assert(info->refcount == 0); + assert(info->destruct == NULL); + allocator.Free(info); + allocator.Free(io); + parent->destroy(parent); /* decrements refcount. */ + return; + } /* if */ + + /* we _are_ the parent. */ + assert(info->refcount > 0); /* even in a race, we hold a reference. */ + + if (__PHYSFS_ATOMIC_DECR(&info->refcount) == 0) + { + void (*destruct)(void *) = info->destruct; + void *buf = (void *) info->buf; + io->opaque = NULL; /* kill this here in case of race. */ + allocator.Free(info); + allocator.Free(io); + if (destruct != NULL) + destruct(buf); + } /* if */ +} /* memoryIo_destroy */ + + +static const PHYSFS_Io __PHYSFS_memoryIoInterface = +{ + CURRENT_PHYSFS_IO_API_VERSION, NULL, + memoryIo_read, + memoryIo_write, + memoryIo_seek, + memoryIo_tell, + memoryIo_length, + memoryIo_duplicate, + memoryIo_flush, + memoryIo_destroy +}; + +PHYSFS_Io *__PHYSFS_createMemoryIo(const void *buf, PHYSFS_uint64 len, + void (*destruct)(void *)) +{ + PHYSFS_Io *io = NULL; + MemoryIoInfo *info = NULL; + + io = (PHYSFS_Io *) allocator.Malloc(sizeof (PHYSFS_Io)); + GOTO_IF(!io, PHYSFS_ERR_OUT_OF_MEMORY, createMemoryIo_failed); + info = (MemoryIoInfo *) allocator.Malloc(sizeof (MemoryIoInfo)); + GOTO_IF(!info, PHYSFS_ERR_OUT_OF_MEMORY, createMemoryIo_failed); + + memset(info, '\0', sizeof (*info)); + info->buf = (const PHYSFS_uint8 *) buf; + info->len = len; + info->pos = 0; + info->parent = NULL; + info->refcount = 1; + info->destruct = destruct; + + memcpy(io, &__PHYSFS_memoryIoInterface, sizeof (*io)); + io->opaque = info; + return io; + +createMemoryIo_failed: + if (info != NULL) allocator.Free(info); + if (io != NULL) allocator.Free(io); + return NULL; +} /* __PHYSFS_createMemoryIo */ + + +/* PHYSFS_Io implementation for i/o to a PHYSFS_File... */ + +static PHYSFS_sint64 handleIo_read(PHYSFS_Io *io, void *buf, PHYSFS_uint64 len) +{ + return PHYSFS_readBytes((PHYSFS_File *) io->opaque, buf, len); +} /* handleIo_read */ + +static PHYSFS_sint64 handleIo_write(PHYSFS_Io *io, const void *buffer, + PHYSFS_uint64 len) +{ + return PHYSFS_writeBytes((PHYSFS_File *) io->opaque, buffer, len); +} /* handleIo_write */ + +static int handleIo_seek(PHYSFS_Io *io, PHYSFS_uint64 offset) +{ + return PHYSFS_seek((PHYSFS_File *) io->opaque, offset); +} /* handleIo_seek */ + +static PHYSFS_sint64 handleIo_tell(PHYSFS_Io *io) +{ + return PHYSFS_tell((PHYSFS_File *) io->opaque); +} /* handleIo_tell */ + +static PHYSFS_sint64 handleIo_length(PHYSFS_Io *io) +{ + return PHYSFS_fileLength((PHYSFS_File *) io->opaque); +} /* handleIo_length */ + +static PHYSFS_Io *handleIo_duplicate(PHYSFS_Io *io) +{ + /* + * There's no duplicate at the PHYSFS_File level, so we break the + * abstraction. We're allowed to: we're physfs.c! + */ + FileHandle *origfh = (FileHandle *) io->opaque; + FileHandle *newfh = (FileHandle *) allocator.Malloc(sizeof (FileHandle)); + PHYSFS_Io *retval = NULL; + + GOTO_IF(!newfh, PHYSFS_ERR_OUT_OF_MEMORY, handleIo_dupe_failed); + memset(newfh, '\0', sizeof (*newfh)); + + retval = (PHYSFS_Io *) allocator.Malloc(sizeof (PHYSFS_Io)); + GOTO_IF(!retval, PHYSFS_ERR_OUT_OF_MEMORY, handleIo_dupe_failed); + +#if 0 /* we don't buffer the duplicate, at least not at the moment. */ + if (origfh->buffer != NULL) + { + newfh->buffer = (PHYSFS_uint8 *) allocator.Malloc(origfh->bufsize); + if (!newfh->buffer) + GOTO(PHYSFS_ERR_OUT_OF_MEMORY, handleIo_dupe_failed); + newfh->bufsize = origfh->bufsize; + } /* if */ +#endif + + newfh->io = origfh->io->duplicate(origfh->io); + GOTO_IF_ERRPASS(!newfh->io, handleIo_dupe_failed); + + newfh->forReading = origfh->forReading; + newfh->dirHandle = origfh->dirHandle; + + __PHYSFS_platformGrabMutex(stateLock); + if (newfh->forReading) + { + newfh->next = openReadList; + openReadList = newfh; + } /* if */ + else + { + newfh->next = openWriteList; + openWriteList = newfh; + } /* else */ + __PHYSFS_platformReleaseMutex(stateLock); + + memcpy(retval, io, sizeof (PHYSFS_Io)); + retval->opaque = newfh; + return retval; + +handleIo_dupe_failed: + if (newfh) + { + if (newfh->io != NULL) newfh->io->destroy(newfh->io); + if (newfh->buffer != NULL) allocator.Free(newfh->buffer); + allocator.Free(newfh); + } /* if */ + + return NULL; +} /* handleIo_duplicate */ + +static int handleIo_flush(PHYSFS_Io *io) +{ + return PHYSFS_flush((PHYSFS_File *) io->opaque); +} /* handleIo_flush */ + +static void handleIo_destroy(PHYSFS_Io *io) +{ + if (io->opaque != NULL) + PHYSFS_close((PHYSFS_File *) io->opaque); + allocator.Free(io); +} /* handleIo_destroy */ + +static const PHYSFS_Io __PHYSFS_handleIoInterface = +{ + CURRENT_PHYSFS_IO_API_VERSION, NULL, + handleIo_read, + handleIo_write, + handleIo_seek, + handleIo_tell, + handleIo_length, + handleIo_duplicate, + handleIo_flush, + handleIo_destroy +}; + +static PHYSFS_Io *__PHYSFS_createHandleIo(PHYSFS_File *f) +{ + PHYSFS_Io *io = (PHYSFS_Io *) allocator.Malloc(sizeof (PHYSFS_Io)); + BAIL_IF(!io, PHYSFS_ERR_OUT_OF_MEMORY, NULL); + memcpy(io, &__PHYSFS_handleIoInterface, sizeof (*io)); + io->opaque = f; + return io; +} /* __PHYSFS_createHandleIo */ + + +/* functions ... */ + +typedef struct +{ + char **list; + PHYSFS_uint32 size; + PHYSFS_ErrorCode errcode; +} EnumStringListCallbackData; + +static void enumStringListCallback(void *data, const char *str) +{ + void *ptr; + char *newstr; + EnumStringListCallbackData *pecd = (EnumStringListCallbackData *) data; + + if (pecd->errcode) + return; + + ptr = allocator.Realloc(pecd->list, (pecd->size + 2) * sizeof (char *)); + newstr = (char *) allocator.Malloc(strlen(str) + 1); + if (ptr != NULL) + pecd->list = (char **) ptr; + + if ((ptr == NULL) || (newstr == NULL)) + { + pecd->errcode = PHYSFS_ERR_OUT_OF_MEMORY; + pecd->list[pecd->size] = NULL; + PHYSFS_freeList(pecd->list); + return; + } /* if */ + + strcpy(newstr, str); + pecd->list[pecd->size] = newstr; + pecd->size++; +} /* enumStringListCallback */ + + +static char **doEnumStringList(void (*func)(PHYSFS_StringCallback, void *)) +{ + EnumStringListCallbackData ecd; + memset(&ecd, '\0', sizeof (ecd)); + ecd.list = (char **) allocator.Malloc(sizeof (char *)); + BAIL_IF(!ecd.list, PHYSFS_ERR_OUT_OF_MEMORY, NULL); + func(enumStringListCallback, &ecd); + + if (ecd.errcode) + { + PHYSFS_setErrorCode(ecd.errcode); + return NULL; + } /* if */ + + ecd.list[ecd.size] = NULL; + return ecd.list; +} /* doEnumStringList */ + + +static void __PHYSFS_bubble_sort(void *a, size_t lo, size_t hi, + int (*cmpfn)(void *, size_t, size_t), + void (*swapfn)(void *, size_t, size_t)) +{ + size_t i; + int sorted; + + do + { + sorted = 1; + for (i = lo; i < hi; i++) + { + if (cmpfn(a, i, i + 1) > 0) + { + swapfn(a, i, i + 1); + sorted = 0; + } /* if */ + } /* for */ + } while (!sorted); +} /* __PHYSFS_bubble_sort */ + + +static void __PHYSFS_quick_sort(void *a, size_t lo, size_t hi, + int (*cmpfn)(void *, size_t, size_t), + void (*swapfn)(void *, size_t, size_t)) +{ + size_t i; + size_t j; + size_t v; + + if ((hi - lo) <= PHYSFS_QUICKSORT_THRESHOLD) + __PHYSFS_bubble_sort(a, lo, hi, cmpfn, swapfn); + else + { + i = (hi + lo) / 2; + + if (cmpfn(a, lo, i) > 0) swapfn(a, lo, i); + if (cmpfn(a, lo, hi) > 0) swapfn(a, lo, hi); + if (cmpfn(a, i, hi) > 0) swapfn(a, i, hi); + + j = hi - 1; + swapfn(a, i, j); + i = lo; + v = j; + while (1) + { + while(cmpfn(a, ++i, v) < 0) { /* do nothing */ } + while(cmpfn(a, --j, v) > 0) { /* do nothing */ } + if (j < i) + break; + swapfn(a, i, j); + } /* while */ + if (i != (hi-1)) + swapfn(a, i, hi-1); + __PHYSFS_quick_sort(a, lo, j, cmpfn, swapfn); + __PHYSFS_quick_sort(a, i+1, hi, cmpfn, swapfn); + } /* else */ +} /* __PHYSFS_quick_sort */ + + +void __PHYSFS_sort(void *entries, size_t max, + int (*cmpfn)(void *, size_t, size_t), + void (*swapfn)(void *, size_t, size_t)) +{ + /* + * Quicksort w/ Bubblesort fallback algorithm inspired by code from here: + * https://www.cs.ubc.ca/spider/harrison/Java/sorting-demo.html + */ + if (max > 0) + __PHYSFS_quick_sort(entries, 0, max - 1, cmpfn, swapfn); +} /* __PHYSFS_sort */ + + +static ErrState *findErrorForCurrentThread(void) +{ + ErrState *i; + void *tid; + + if (errorLock != NULL) + __PHYSFS_platformGrabMutex(errorLock); + + if (errorStates != NULL) + { + tid = __PHYSFS_platformGetThreadID(); + + for (i = errorStates; i != NULL; i = i->next) + { + if (i->tid == tid) + { + if (errorLock != NULL) + __PHYSFS_platformReleaseMutex(errorLock); + return i; + } /* if */ + } /* for */ + } /* if */ + + if (errorLock != NULL) + __PHYSFS_platformReleaseMutex(errorLock); + + return NULL; /* no error available. */ +} /* findErrorForCurrentThread */ + + +/* this doesn't reset the error state. */ +static inline PHYSFS_ErrorCode currentErrorCode(void) +{ + const ErrState *err = findErrorForCurrentThread(); + return err ? err->code : PHYSFS_ERR_OK; +} /* currentErrorCode */ + + +PHYSFS_ErrorCode PHYSFS_getLastErrorCode(void) +{ + ErrState *err = findErrorForCurrentThread(); + const PHYSFS_ErrorCode retval = (err) ? err->code : PHYSFS_ERR_OK; + if (err) + err->code = PHYSFS_ERR_OK; + return retval; +} /* PHYSFS_getLastErrorCode */ + + +PHYSFS_DECL const char *PHYSFS_getErrorByCode(PHYSFS_ErrorCode code) +{ + switch (code) + { + case PHYSFS_ERR_OK: return "no error"; + case PHYSFS_ERR_OTHER_ERROR: return "unknown error"; + case PHYSFS_ERR_OUT_OF_MEMORY: return "out of memory"; + case PHYSFS_ERR_NOT_INITIALIZED: return "not initialized"; + case PHYSFS_ERR_IS_INITIALIZED: return "already initialized"; + case PHYSFS_ERR_ARGV0_IS_NULL: return "argv[0] is NULL"; + case PHYSFS_ERR_UNSUPPORTED: return "unsupported"; + case PHYSFS_ERR_PAST_EOF: return "past end of file"; + case PHYSFS_ERR_FILES_STILL_OPEN: return "files still open"; + case PHYSFS_ERR_INVALID_ARGUMENT: return "invalid argument"; + case PHYSFS_ERR_NOT_MOUNTED: return "not mounted"; + case PHYSFS_ERR_NOT_FOUND: return "not found"; + case PHYSFS_ERR_SYMLINK_FORBIDDEN: return "symlinks are forbidden"; + case PHYSFS_ERR_NO_WRITE_DIR: return "write directory is not set"; + case PHYSFS_ERR_OPEN_FOR_READING: return "file open for reading"; + case PHYSFS_ERR_OPEN_FOR_WRITING: return "file open for writing"; + case PHYSFS_ERR_NOT_A_FILE: return "not a file"; + case PHYSFS_ERR_READ_ONLY: return "read-only filesystem"; + case PHYSFS_ERR_CORRUPT: return "corrupted"; + case PHYSFS_ERR_SYMLINK_LOOP: return "infinite symbolic link loop"; + case PHYSFS_ERR_IO: return "i/o error"; + case PHYSFS_ERR_PERMISSION: return "permission denied"; + case PHYSFS_ERR_NO_SPACE: return "no space available for writing"; + case PHYSFS_ERR_BAD_FILENAME: return "filename is illegal or insecure"; + case PHYSFS_ERR_BUSY: return "tried to modify a file the OS needs"; + case PHYSFS_ERR_DIR_NOT_EMPTY: return "directory isn't empty"; + case PHYSFS_ERR_OS_ERROR: return "OS reported an error"; + case PHYSFS_ERR_DUPLICATE: return "duplicate resource"; + case PHYSFS_ERR_BAD_PASSWORD: return "bad password"; + case PHYSFS_ERR_APP_CALLBACK: return "app callback reported error"; + } /* switch */ + + return NULL; /* don't know this error code. */ +} /* PHYSFS_getErrorByCode */ + + +void PHYSFS_setErrorCode(PHYSFS_ErrorCode errcode) +{ + ErrState *err; + + if (!errcode) + return; + + err = findErrorForCurrentThread(); + if (err == NULL) + { + err = (ErrState *) allocator.Malloc(sizeof (ErrState)); + if (err == NULL) + return; /* uhh...? */ + + memset(err, '\0', sizeof (ErrState)); + err->tid = __PHYSFS_platformGetThreadID(); + + if (errorLock != NULL) + __PHYSFS_platformGrabMutex(errorLock); + + err->next = errorStates; + errorStates = err; + + if (errorLock != NULL) + __PHYSFS_platformReleaseMutex(errorLock); + } /* if */ + + err->code = errcode; +} /* PHYSFS_setErrorCode */ + + +const char *PHYSFS_getLastError(void) +{ + const PHYSFS_ErrorCode err = PHYSFS_getLastErrorCode(); + return (err) ? PHYSFS_getErrorByCode(err) : NULL; +} /* PHYSFS_getLastError */ + + +/* MAKE SURE that errorLock is held before calling this! */ +static void freeErrorStates(void) +{ + ErrState *i; + ErrState *next; + + for (i = errorStates; i != NULL; i = next) + { + next = i->next; + allocator.Free(i); + } /* for */ + + errorStates = NULL; +} /* freeErrorStates */ + + +void PHYSFS_getLinkedVersion(PHYSFS_Version *ver) +{ + if (ver != NULL) + { + ver->major = PHYSFS_VER_MAJOR; + ver->minor = PHYSFS_VER_MINOR; + ver->patch = PHYSFS_VER_PATCH; + } /* if */ +} /* PHYSFS_getLinkedVersion */ + + +static const char *find_filename_extension(const char *fname) +{ + const char *retval = NULL; + if (fname != NULL) + { + const char *p = strchr(fname, '.'); + retval = p; + + while (p != NULL) + { + p = strchr(p + 1, '.'); + if (p != NULL) + retval = p; + } /* while */ + + if (retval != NULL) + retval++; /* skip '.' */ + } /* if */ + + return retval; +} /* find_filename_extension */ + + +static DirHandle *tryOpenDir(PHYSFS_Io *io, const PHYSFS_Archiver *funcs, + const char *d, int forWriting, int *_claimed) +{ + DirHandle *retval = NULL; + void *opaque = NULL; + + if (io != NULL) + BAIL_IF_ERRPASS(!io->seek(io, 0), NULL); + + opaque = funcs->openArchive(io, d, forWriting, _claimed); + if (opaque != NULL) + { + retval = (DirHandle *) allocator.Malloc(sizeof (DirHandle)); + if (retval == NULL) + funcs->closeArchive(opaque); + else + { + memset(retval, '\0', sizeof (DirHandle)); + retval->mountPoint = NULL; + retval->funcs = funcs; + retval->opaque = opaque; + } /* else */ + } /* if */ + + return retval; +} /* tryOpenDir */ + + +static DirHandle *openDirectory(PHYSFS_Io *io, const char *d, int forWriting) +{ + DirHandle *retval = NULL; + PHYSFS_Archiver **i; + const char *ext; + int created_io = 0; + int claimed = 0; + PHYSFS_ErrorCode errcode; + + assert((io != NULL) || (d != NULL)); + + if (io == NULL) + { + /* file doesn't exist, etc? Just fail out. */ + PHYSFS_Stat statbuf; + BAIL_IF_ERRPASS(!__PHYSFS_platformStat(d, &statbuf, 1), NULL); + + /* DIR gets first shot (unlike the rest, it doesn't deal with files). */ + if (statbuf.filetype == PHYSFS_FILETYPE_DIRECTORY) + { + retval = tryOpenDir(io, &__PHYSFS_Archiver_DIR, d, forWriting, &claimed); + if (retval || claimed) + return retval; + } /* if */ + + io = __PHYSFS_createNativeIo(d, forWriting ? 'w' : 'r'); + BAIL_IF_ERRPASS(!io, NULL); + created_io = 1; + } /* if */ + + ext = find_filename_extension(d); + if (ext != NULL) + { + /* Look for archivers with matching file extensions first... */ + for (i = archivers; (*i != NULL) && (retval == NULL) && !claimed; i++) + { + if (PHYSFS_utf8stricmp(ext, (*i)->info.extension) == 0) + retval = tryOpenDir(io, *i, d, forWriting, &claimed); + } /* for */ + + /* failing an exact file extension match, try all the others... */ + for (i = archivers; (*i != NULL) && (retval == NULL) && !claimed; i++) + { + if (PHYSFS_utf8stricmp(ext, (*i)->info.extension) != 0) + retval = tryOpenDir(io, *i, d, forWriting, &claimed); + } /* for */ + } /* if */ + + else /* no extension? Try them all. */ + { + for (i = archivers; (*i != NULL) && (retval == NULL) && !claimed; i++) + retval = tryOpenDir(io, *i, d, forWriting, &claimed); + } /* else */ + + errcode = currentErrorCode(); + + if ((!retval) && (created_io)) + io->destroy(io); + + BAIL_IF(!retval, claimed ? errcode : PHYSFS_ERR_UNSUPPORTED, NULL); + return retval; +} /* openDirectory */ + + +/* + * Make a platform-independent path string sane. Doesn't actually check the + * file hierarchy, it just cleans up the string. + * (dst) must be a buffer at least as big as (src), as this is where the + * cleaned up string is deposited. + * If there are illegal bits in the path (".." entries, etc) then we + * return zero and (dst) is undefined. Non-zero if the path was sanitized. + */ +static int sanitizePlatformIndependentPath(const char *src, char *dst) +{ + char *prev; + char ch; + + while (*src == '/') /* skip initial '/' chars... */ + src++; + + /* Make sure the entire string isn't "." or ".." */ + if ((strcmp(src, ".") == 0) || (strcmp(src, "..") == 0)) + BAIL(PHYSFS_ERR_BAD_FILENAME, 0); + + prev = dst; + do + { + ch = *(src++); + + if ((ch == ':') || (ch == '\\')) /* illegal chars in a physfs path. */ + BAIL(PHYSFS_ERR_BAD_FILENAME, 0); + + if (ch == '/') /* path separator. */ + { + *dst = '\0'; /* "." and ".." are illegal pathnames. */ + if ((strcmp(prev, ".") == 0) || (strcmp(prev, "..") == 0)) + BAIL(PHYSFS_ERR_BAD_FILENAME, 0); + + while (*src == '/') /* chop out doubles... */ + src++; + + if (*src == '\0') /* ends with a pathsep? */ + break; /* we're done, don't add final pathsep to dst. */ + + prev = dst + 1; + } /* if */ + + *(dst++) = ch; + } while (ch != '\0'); + + return 1; +} /* sanitizePlatformIndependentPath */ + + +/* + * Figure out if (fname) is part of (h)'s mountpoint. (fname) must be an + * output from sanitizePlatformIndependentPath(), so that it is in a known + * state. + * + * This only finds legitimate segments of a mountpoint. If the mountpoint is + * "/a/b/c" and (fname) is "/a/b/c", "/", or "/a/b/c/d", then the results are + * all zero. "/a/b" will succeed, though. + */ +static int partOfMountPoint(DirHandle *h, char *fname) +{ + int rc; + size_t len, mntpntlen; + + if (h->mountPoint == NULL) + return 0; + else if (*fname == '\0') + return 1; + + len = strlen(fname); + mntpntlen = strlen(h->mountPoint); + if (len > mntpntlen) /* can't be a subset of mountpoint. */ + return 0; + + /* if true, must be not a match or a complete match, but not a subset. */ + if ((len + 1) == mntpntlen) + return 0; + + rc = strncmp(fname, h->mountPoint, len); /* !!! FIXME: case insensitive? */ + if (rc != 0) + return 0; /* not a match. */ + + /* make sure /a/b matches /a/b/ and not /a/bc ... */ + return h->mountPoint[len] == '/'; +} /* partOfMountPoint */ + + +static DirHandle *createDirHandle(PHYSFS_Io *io, const char *newDir, + const char *mountPoint, int forWriting) +{ + DirHandle *dirHandle = NULL; + char *tmpmntpnt = NULL; + + assert(newDir != NULL); /* should have caught this higher up. */ + + if (mountPoint != NULL) + { + const size_t len = strlen(mountPoint) + 1; + tmpmntpnt = (char *) __PHYSFS_smallAlloc(len); + GOTO_IF(!tmpmntpnt, PHYSFS_ERR_OUT_OF_MEMORY, badDirHandle); + if (!sanitizePlatformIndependentPath(mountPoint, tmpmntpnt)) + goto badDirHandle; + mountPoint = tmpmntpnt; /* sanitized version. */ + } /* if */ + + dirHandle = openDirectory(io, newDir, forWriting); + GOTO_IF_ERRPASS(!dirHandle, badDirHandle); + + dirHandle->dirName = (char *) allocator.Malloc(strlen(newDir) + 1); + GOTO_IF(!dirHandle->dirName, PHYSFS_ERR_OUT_OF_MEMORY, badDirHandle); + strcpy(dirHandle->dirName, newDir); + + if ((mountPoint != NULL) && (*mountPoint != '\0')) + { + dirHandle->mountPoint = (char *)allocator.Malloc(strlen(mountPoint)+2); + if (!dirHandle->mountPoint) + GOTO(PHYSFS_ERR_OUT_OF_MEMORY, badDirHandle); + strcpy(dirHandle->mountPoint, mountPoint); + strcat(dirHandle->mountPoint, "/"); + } /* if */ + + __PHYSFS_smallFree(tmpmntpnt); + return dirHandle; + +badDirHandle: + if (dirHandle != NULL) + { + dirHandle->funcs->closeArchive(dirHandle->opaque); + allocator.Free(dirHandle->dirName); + allocator.Free(dirHandle->mountPoint); + allocator.Free(dirHandle); + } /* if */ + + __PHYSFS_smallFree(tmpmntpnt); + return NULL; +} /* createDirHandle */ + + +/* MAKE SURE you've got the stateLock held before calling this! */ +static int freeDirHandle(DirHandle *dh, FileHandle *openList) +{ + FileHandle *i; + + if (dh == NULL) + return 1; + + for (i = openList; i != NULL; i = i->next) + BAIL_IF(i->dirHandle == dh, PHYSFS_ERR_FILES_STILL_OPEN, 0); + + dh->funcs->closeArchive(dh->opaque); + allocator.Free(dh->dirName); + allocator.Free(dh->mountPoint); + allocator.Free(dh); + return 1; +} /* freeDirHandle */ + + +static char *calculateBaseDir(const char *argv0) +{ + const char dirsep = __PHYSFS_platformDirSeparator; + char *retval = NULL; + char *ptr = NULL; + + /* Give the platform layer first shot at this. */ + retval = __PHYSFS_platformCalcBaseDir(argv0); + if (retval != NULL) + return retval; + + /* We need argv0 to go on. */ + BAIL_IF(argv0 == NULL, PHYSFS_ERR_ARGV0_IS_NULL, NULL); + + ptr = strrchr(argv0, dirsep); + if (ptr != NULL) + { + const size_t size = ((size_t) (ptr - argv0)) + 1; + retval = (char *) allocator.Malloc(size + 1); + BAIL_IF(!retval, PHYSFS_ERR_OUT_OF_MEMORY, NULL); + memcpy(retval, argv0, size); + retval[size] = '\0'; + return retval; + } /* if */ + + /* argv0 wasn't helpful. */ + BAIL(PHYSFS_ERR_INVALID_ARGUMENT, NULL); +} /* calculateBaseDir */ + + +static int initializeMutexes(void) +{ + errorLock = __PHYSFS_platformCreateMutex(); + if (errorLock == NULL) + goto initializeMutexes_failed; + + stateLock = __PHYSFS_platformCreateMutex(); + if (stateLock == NULL) + goto initializeMutexes_failed; + + return 1; /* success. */ + +initializeMutexes_failed: + if (errorLock != NULL) + __PHYSFS_platformDestroyMutex(errorLock); + + if (stateLock != NULL) + __PHYSFS_platformDestroyMutex(stateLock); + + errorLock = stateLock = NULL; + return 0; /* failed. */ +} /* initializeMutexes */ + + +static int doRegisterArchiver(const PHYSFS_Archiver *_archiver); + +static int initStaticArchivers(void) +{ + #define REGISTER_STATIC_ARCHIVER(arc) { \ + if (!doRegisterArchiver(&__PHYSFS_Archiver_##arc)) { \ + return 0; \ + } \ + } + + #if PHYSFS_SUPPORTS_ZIP + REGISTER_STATIC_ARCHIVER(ZIP); + #endif + #if PHYSFS_SUPPORTS_7Z + SZIP_global_init(); + REGISTER_STATIC_ARCHIVER(7Z); + #endif + #if PHYSFS_SUPPORTS_GRP + REGISTER_STATIC_ARCHIVER(GRP); + #endif + #if PHYSFS_SUPPORTS_QPAK + REGISTER_STATIC_ARCHIVER(QPAK); + #endif + #if PHYSFS_SUPPORTS_HOG + REGISTER_STATIC_ARCHIVER(HOG); + #endif + #if PHYSFS_SUPPORTS_MVL + REGISTER_STATIC_ARCHIVER(MVL); + #endif + #if PHYSFS_SUPPORTS_WAD + REGISTER_STATIC_ARCHIVER(WAD); + #endif + #if PHYSFS_SUPPORTS_SLB + REGISTER_STATIC_ARCHIVER(SLB); + #endif + #if PHYSFS_SUPPORTS_ISO9660 + REGISTER_STATIC_ARCHIVER(ISO9660); + #endif + #if PHYSFS_SUPPORTS_VDF + REGISTER_STATIC_ARCHIVER(VDF) + #endif + + #undef REGISTER_STATIC_ARCHIVER + + return 1; +} /* initStaticArchivers */ + + +static void setDefaultAllocator(void); +static int doDeinit(void); + +int PHYSFS_init(const char *argv0) +{ + BAIL_IF(initialized, PHYSFS_ERR_IS_INITIALIZED, 0); + + if (!externalAllocator) + setDefaultAllocator(); + + if ((allocator.Init != NULL) && (!allocator.Init())) return 0; + + if (!__PHYSFS_platformInit()) + { + if (allocator.Deinit != NULL) allocator.Deinit(); + return 0; + } /* if */ + + /* everything below here can be cleaned up safely by doDeinit(). */ + + if (!initializeMutexes()) goto initFailed; + + baseDir = calculateBaseDir(argv0); + if (!baseDir) goto initFailed; + + userDir = __PHYSFS_platformCalcUserDir(); + if (!userDir) goto initFailed; + + /* Platform layer is required to append a dirsep. */ + assert(baseDir[strlen(baseDir) - 1] == __PHYSFS_platformDirSeparator); + assert(userDir[strlen(userDir) - 1] == __PHYSFS_platformDirSeparator); + + if (!initStaticArchivers()) goto initFailed; + + initialized = 1; + + /* This makes sure that the error subsystem is initialized. */ + PHYSFS_setErrorCode(PHYSFS_getLastErrorCode()); + + return 1; + +initFailed: + doDeinit(); + return 0; +} /* PHYSFS_init */ + + +/* MAKE SURE you hold stateLock before calling this! */ +static int closeFileHandleList(FileHandle **list) +{ + FileHandle *i; + FileHandle *next = NULL; + + for (i = *list; i != NULL; i = next) + { + PHYSFS_Io *io = i->io; + next = i->next; + + if (io->flush && !io->flush(io)) + { + *list = i; + return 0; + } /* if */ + + io->destroy(io); + allocator.Free(i); + } /* for */ + + *list = NULL; + return 1; +} /* closeFileHandleList */ + + +/* MAKE SURE you hold the stateLock before calling this! */ +static void freeSearchPath(void) +{ + DirHandle *i; + DirHandle *next = NULL; + + closeFileHandleList(&openReadList); + + if (searchPath != NULL) + { + for (i = searchPath; i != NULL; i = next) + { + next = i->next; + freeDirHandle(i, openReadList); + } /* for */ + searchPath = NULL; + } /* if */ +} /* freeSearchPath */ + + +/* MAKE SURE you hold stateLock before calling this! */ +static int archiverInUse(const PHYSFS_Archiver *arc, const DirHandle *list) +{ + const DirHandle *i; + for (i = list; i != NULL; i = i->next) + { + if (i->funcs == arc) + return 1; + } /* for */ + + return 0; /* not in use */ +} /* archiverInUse */ + + +/* MAKE SURE you hold stateLock before calling this! */ +static int doDeregisterArchiver(const size_t idx) +{ + const size_t len = (numArchivers - idx) * sizeof (void *); + PHYSFS_ArchiveInfo *info = archiveInfo[idx]; + PHYSFS_Archiver *arc = archivers[idx]; + + /* make sure nothing is still using this archiver */ + if (archiverInUse(arc, searchPath) || archiverInUse(arc, writeDir)) + BAIL(PHYSFS_ERR_FILES_STILL_OPEN, 0); + + allocator.Free((void *) info->extension); + allocator.Free((void *) info->description); + allocator.Free((void *) info->author); + allocator.Free((void *) info->url); + allocator.Free((void *) arc); + + memmove(&archiveInfo[idx], &archiveInfo[idx+1], len); + memmove(&archivers[idx], &archivers[idx+1], len); + + assert(numArchivers > 0); + numArchivers--; + + return 1; +} /* doDeregisterArchiver */ + + +/* Does NOT hold the state lock; we're shutting down. */ +static void freeArchivers(void) +{ + while (numArchivers > 0) + { + if (!doDeregisterArchiver(numArchivers - 1)) + assert(!"nothing should be mounted during shutdown."); + } /* while */ + + allocator.Free(archivers); + allocator.Free(archiveInfo); + archivers = NULL; + archiveInfo = NULL; +} /* freeArchivers */ + + +static int doDeinit(void) +{ + closeFileHandleList(&openWriteList); + BAIL_IF(!PHYSFS_setWriteDir(NULL), PHYSFS_ERR_FILES_STILL_OPEN, 0); + + freeSearchPath(); + freeArchivers(); + freeErrorStates(); + + if (baseDir != NULL) + { + allocator.Free(baseDir); + baseDir = NULL; + } /* if */ + + if (userDir != NULL) + { + allocator.Free(userDir); + userDir = NULL; + } /* if */ + + if (prefDir != NULL) + { + allocator.Free(prefDir); + prefDir = NULL; + } /* if */ + + if (archiveInfo != NULL) + { + allocator.Free(archiveInfo); + archiveInfo = NULL; + } /* if */ + + if (archivers != NULL) + { + allocator.Free(archivers); + archivers = NULL; + } /* if */ + + allowSymLinks = 0; + initialized = 0; + + if (errorLock) __PHYSFS_platformDestroyMutex(errorLock); + if (stateLock) __PHYSFS_platformDestroyMutex(stateLock); + + if (allocator.Deinit != NULL) + allocator.Deinit(); + + errorLock = stateLock = NULL; + + __PHYSFS_platformDeinit(); + + return 1; +} /* doDeinit */ + + +int PHYSFS_deinit(void) +{ + BAIL_IF(!initialized, PHYSFS_ERR_NOT_INITIALIZED, 0); + return doDeinit(); +} /* PHYSFS_deinit */ + + +int PHYSFS_isInit(void) +{ + return initialized; +} /* PHYSFS_isInit */ + + +char *__PHYSFS_strdup(const char *str) +{ + char *retval = (char *) allocator.Malloc(strlen(str) + 1); + if (retval) + strcpy(retval, str); + return retval; +} /* __PHYSFS_strdup */ + + +PHYSFS_uint32 __PHYSFS_hashString(const char *str, size_t len) +{ + PHYSFS_uint32 hash = 5381; + while (len--) + hash = ((hash << 5) + hash) ^ *(str++); + return hash; +} /* __PHYSFS_hashString */ + + +/* MAKE SURE you hold stateLock before calling this! */ +static int doRegisterArchiver(const PHYSFS_Archiver *_archiver) +{ + const PHYSFS_uint32 maxver = CURRENT_PHYSFS_ARCHIVER_API_VERSION; + const size_t len = (numArchivers + 2) * sizeof (void *); + PHYSFS_Archiver *archiver = NULL; + PHYSFS_ArchiveInfo *info = NULL; + const char *ext = NULL; + void *ptr = NULL; + size_t i; + + BAIL_IF(!_archiver, PHYSFS_ERR_INVALID_ARGUMENT, 0); + BAIL_IF(_archiver->version > maxver, PHYSFS_ERR_UNSUPPORTED, 0); + BAIL_IF(!_archiver->info.extension, PHYSFS_ERR_INVALID_ARGUMENT, 0); + BAIL_IF(!_archiver->info.description, PHYSFS_ERR_INVALID_ARGUMENT, 0); + BAIL_IF(!_archiver->info.author, PHYSFS_ERR_INVALID_ARGUMENT, 0); + BAIL_IF(!_archiver->info.url, PHYSFS_ERR_INVALID_ARGUMENT, 0); + BAIL_IF(!_archiver->openArchive, PHYSFS_ERR_INVALID_ARGUMENT, 0); + BAIL_IF(!_archiver->enumerate, PHYSFS_ERR_INVALID_ARGUMENT, 0); + BAIL_IF(!_archiver->openRead, PHYSFS_ERR_INVALID_ARGUMENT, 0); + BAIL_IF(!_archiver->openWrite, PHYSFS_ERR_INVALID_ARGUMENT, 0); + BAIL_IF(!_archiver->openAppend, PHYSFS_ERR_INVALID_ARGUMENT, 0); + BAIL_IF(!_archiver->remove, PHYSFS_ERR_INVALID_ARGUMENT, 0); + BAIL_IF(!_archiver->mkdir, PHYSFS_ERR_INVALID_ARGUMENT, 0); + BAIL_IF(!_archiver->closeArchive, PHYSFS_ERR_INVALID_ARGUMENT, 0); + BAIL_IF(!_archiver->stat, PHYSFS_ERR_INVALID_ARGUMENT, 0); + + ext = _archiver->info.extension; + for (i = 0; i < numArchivers; i++) + { + if (PHYSFS_utf8stricmp(archiveInfo[i]->extension, ext) == 0) + BAIL(PHYSFS_ERR_DUPLICATE, 0); + } /* for */ + + /* make a copy of the data. */ + archiver = (PHYSFS_Archiver *) allocator.Malloc(sizeof (*archiver)); + GOTO_IF(!archiver, PHYSFS_ERR_OUT_OF_MEMORY, regfailed); + + /* Must copy sizeof (OLD_VERSION_OF_STRUCT) when version changes! */ + memcpy(archiver, _archiver, sizeof (*archiver)); + + info = (PHYSFS_ArchiveInfo *) &archiver->info; + memset(info, '\0', sizeof (*info)); /* NULL in case an alloc fails. */ + #define CPYSTR(item) \ + info->item = __PHYSFS_strdup(_archiver->info.item); \ + GOTO_IF(!info->item, PHYSFS_ERR_OUT_OF_MEMORY, regfailed); + CPYSTR(extension); + CPYSTR(description); + CPYSTR(author); + CPYSTR(url); + info->supportsSymlinks = _archiver->info.supportsSymlinks; + #undef CPYSTR + + ptr = allocator.Realloc(archiveInfo, len); + GOTO_IF(!ptr, PHYSFS_ERR_OUT_OF_MEMORY, regfailed); + archiveInfo = (PHYSFS_ArchiveInfo **) ptr; + + ptr = allocator.Realloc(archivers, len); + GOTO_IF(!ptr, PHYSFS_ERR_OUT_OF_MEMORY, regfailed); + archivers = (PHYSFS_Archiver **) ptr; + + archiveInfo[numArchivers] = info; + archiveInfo[numArchivers + 1] = NULL; + + archivers[numArchivers] = archiver; + archivers[numArchivers + 1] = NULL; + + numArchivers++; + + return 1; + +regfailed: + if (info != NULL) + { + allocator.Free((void *) info->extension); + allocator.Free((void *) info->description); + allocator.Free((void *) info->author); + allocator.Free((void *) info->url); + } /* if */ + allocator.Free(archiver); + + return 0; +} /* doRegisterArchiver */ + + +int PHYSFS_registerArchiver(const PHYSFS_Archiver *archiver) +{ + int retval; + BAIL_IF(!initialized, PHYSFS_ERR_NOT_INITIALIZED, 0); + __PHYSFS_platformGrabMutex(stateLock); + retval = doRegisterArchiver(archiver); + __PHYSFS_platformReleaseMutex(stateLock); + return retval; +} /* PHYSFS_registerArchiver */ + + +int PHYSFS_deregisterArchiver(const char *ext) +{ + size_t i; + + BAIL_IF(!initialized, PHYSFS_ERR_NOT_INITIALIZED, 0); + BAIL_IF(!ext, PHYSFS_ERR_INVALID_ARGUMENT, 0); + + __PHYSFS_platformGrabMutex(stateLock); + for (i = 0; i < numArchivers; i++) + { + if (PHYSFS_utf8stricmp(archiveInfo[i]->extension, ext) == 0) + { + const int retval = doDeregisterArchiver(i); + __PHYSFS_platformReleaseMutex(stateLock); + return retval; + } /* if */ + } /* for */ + __PHYSFS_platformReleaseMutex(stateLock); + + BAIL(PHYSFS_ERR_NOT_FOUND, 0); +} /* PHYSFS_deregisterArchiver */ + + +const PHYSFS_ArchiveInfo **PHYSFS_supportedArchiveTypes(void) +{ + BAIL_IF(!initialized, PHYSFS_ERR_NOT_INITIALIZED, NULL); + return (const PHYSFS_ArchiveInfo **) archiveInfo; +} /* PHYSFS_supportedArchiveTypes */ + + +void PHYSFS_freeList(void *list) +{ + void **i; + if (list != NULL) + { + for (i = (void **) list; *i != NULL; i++) + allocator.Free(*i); + + allocator.Free(list); + } /* if */ +} /* PHYSFS_freeList */ + + +const char *PHYSFS_getDirSeparator(void) +{ + static char retval[2] = { __PHYSFS_platformDirSeparator, '\0' }; + return retval; +} /* PHYSFS_getDirSeparator */ + + +char **PHYSFS_getCdRomDirs(void) +{ + return doEnumStringList(__PHYSFS_platformDetectAvailableCDs); +} /* PHYSFS_getCdRomDirs */ + + +void PHYSFS_getCdRomDirsCallback(PHYSFS_StringCallback callback, void *data) +{ + __PHYSFS_platformDetectAvailableCDs(callback, data); +} /* PHYSFS_getCdRomDirsCallback */ + + +const char *PHYSFS_getPrefDir(const char *org, const char *app) +{ + const char dirsep = __PHYSFS_platformDirSeparator; + PHYSFS_Stat statbuf; + char *ptr = NULL; + char *endstr = NULL; + + BAIL_IF(!initialized, PHYSFS_ERR_NOT_INITIALIZED, 0); + BAIL_IF(!org, PHYSFS_ERR_INVALID_ARGUMENT, NULL); + BAIL_IF(*org == '\0', PHYSFS_ERR_INVALID_ARGUMENT, NULL); + BAIL_IF(!app, PHYSFS_ERR_INVALID_ARGUMENT, NULL); + BAIL_IF(*app == '\0', PHYSFS_ERR_INVALID_ARGUMENT, NULL); + + allocator.Free(prefDir); + prefDir = __PHYSFS_platformCalcPrefDir(org, app); + BAIL_IF_ERRPASS(!prefDir, NULL); + + assert(strlen(prefDir) > 0); + endstr = prefDir + (strlen(prefDir) - 1); + assert(*endstr == dirsep); + *endstr = '\0'; /* mask out the final dirsep for now. */ + + if (!__PHYSFS_platformStat(prefDir, &statbuf, 1)) + { + for (ptr = strchr(prefDir, dirsep); ptr; ptr = strchr(ptr+1, dirsep)) + { + *ptr = '\0'; + __PHYSFS_platformMkDir(prefDir); + *ptr = dirsep; + } /* for */ + + if (!__PHYSFS_platformMkDir(prefDir)) + { + allocator.Free(prefDir); + prefDir = NULL; + } /* if */ + } /* if */ + + *endstr = dirsep; /* readd the final dirsep. */ + + return prefDir; +} /* PHYSFS_getPrefDir */ + + +const char *PHYSFS_getBaseDir(void) +{ + return baseDir; /* this is calculated in PHYSFS_init()... */ +} /* PHYSFS_getBaseDir */ + + +const char *__PHYSFS_getUserDir(void) /* not deprecated internal version. */ +{ + return userDir; /* this is calculated in PHYSFS_init()... */ +} /* __PHYSFS_getUserDir */ + + +const char *PHYSFS_getUserDir(void) +{ + return __PHYSFS_getUserDir(); +} /* PHYSFS_getUserDir */ + + +const char *PHYSFS_getWriteDir(void) +{ + const char *retval = NULL; + + __PHYSFS_platformGrabMutex(stateLock); + if (writeDir != NULL) + retval = writeDir->dirName; + __PHYSFS_platformReleaseMutex(stateLock); + + return retval; +} /* PHYSFS_getWriteDir */ + + +int PHYSFS_setWriteDir(const char *newDir) +{ + int retval = 1; + + __PHYSFS_platformGrabMutex(stateLock); + + if (writeDir != NULL) + { + BAIL_IF_MUTEX_ERRPASS(!freeDirHandle(writeDir, openWriteList), + stateLock, 0); + writeDir = NULL; + } /* if */ + + if (newDir != NULL) + { + writeDir = createDirHandle(NULL, newDir, NULL, 1); + retval = (writeDir != NULL); + } /* if */ + + __PHYSFS_platformReleaseMutex(stateLock); + + return retval; +} /* PHYSFS_setWriteDir */ + + +static int doMount(PHYSFS_Io *io, const char *fname, + const char *mountPoint, int appendToPath) +{ + DirHandle *dh; + DirHandle *prev = NULL; + DirHandle *i; + + BAIL_IF(!fname, PHYSFS_ERR_INVALID_ARGUMENT, 0); + + if (mountPoint == NULL) + mountPoint = "/"; + + __PHYSFS_platformGrabMutex(stateLock); + + for (i = searchPath; i != NULL; i = i->next) + { + /* already in search path? */ + if ((i->dirName != NULL) && (strcmp(fname, i->dirName) == 0)) + BAIL_MUTEX_ERRPASS(stateLock, 1); + prev = i; + } /* for */ + + dh = createDirHandle(io, fname, mountPoint, 0); + BAIL_IF_MUTEX_ERRPASS(!dh, stateLock, 0); + + if (appendToPath) + { + if (prev == NULL) + searchPath = dh; + else + prev->next = dh; + } /* if */ + else + { + dh->next = searchPath; + searchPath = dh; + } /* else */ + + __PHYSFS_platformReleaseMutex(stateLock); + return 1; +} /* doMount */ + + +int PHYSFS_mountIo(PHYSFS_Io *io, const char *fname, + const char *mountPoint, int appendToPath) +{ + BAIL_IF(!io, PHYSFS_ERR_INVALID_ARGUMENT, 0); + BAIL_IF(!fname, PHYSFS_ERR_INVALID_ARGUMENT, 0); + BAIL_IF(io->version != 0, PHYSFS_ERR_UNSUPPORTED, 0); + return doMount(io, fname, mountPoint, appendToPath); +} /* PHYSFS_mountIo */ + + +int PHYSFS_mountMemory(const void *buf, PHYSFS_uint64 len, void (*del)(void *), + const char *fname, const char *mountPoint, + int appendToPath) +{ + int retval = 0; + PHYSFS_Io *io = NULL; + + BAIL_IF(!buf, PHYSFS_ERR_INVALID_ARGUMENT, 0); + BAIL_IF(!fname, PHYSFS_ERR_INVALID_ARGUMENT, 0); + + io = __PHYSFS_createMemoryIo(buf, len, del); + BAIL_IF_ERRPASS(!io, 0); + retval = doMount(io, fname, mountPoint, appendToPath); + if (!retval) + { + /* docs say not to call (del) in case of failure, so cheat. */ + MemoryIoInfo *info = (MemoryIoInfo *) io->opaque; + info->destruct = NULL; + io->destroy(io); + } /* if */ + + return retval; +} /* PHYSFS_mountMemory */ + + +int PHYSFS_mountHandle(PHYSFS_File *file, const char *fname, + const char *mountPoint, int appendToPath) +{ + int retval = 0; + PHYSFS_Io *io = NULL; + + BAIL_IF(!file, PHYSFS_ERR_INVALID_ARGUMENT, 0); + BAIL_IF(!fname, PHYSFS_ERR_INVALID_ARGUMENT, 0); + + io = __PHYSFS_createHandleIo(file); + BAIL_IF_ERRPASS(!io, 0); + retval = doMount(io, fname, mountPoint, appendToPath); + if (!retval) + { + /* docs say not to destruct in case of failure, so cheat. */ + io->opaque = NULL; + io->destroy(io); + } /* if */ + + return retval; +} /* PHYSFS_mountHandle */ + + +int PHYSFS_mount(const char *newDir, const char *mountPoint, int appendToPath) +{ + BAIL_IF(!newDir, PHYSFS_ERR_INVALID_ARGUMENT, 0); + return doMount(NULL, newDir, mountPoint, appendToPath); +} /* PHYSFS_mount */ + + +int PHYSFS_addToSearchPath(const char *newDir, int appendToPath) +{ + return PHYSFS_mount(newDir, NULL, appendToPath); +} /* PHYSFS_addToSearchPath */ + + +int PHYSFS_removeFromSearchPath(const char *oldDir) +{ + return PHYSFS_unmount(oldDir); +} /* PHYSFS_removeFromSearchPath */ + + +int PHYSFS_unmount(const char *oldDir) +{ + DirHandle *i; + DirHandle *prev = NULL; + DirHandle *next = NULL; + + BAIL_IF(oldDir == NULL, PHYSFS_ERR_INVALID_ARGUMENT, 0); + + __PHYSFS_platformGrabMutex(stateLock); + for (i = searchPath; i != NULL; i = i->next) + { + if (strcmp(i->dirName, oldDir) == 0) + { + next = i->next; + BAIL_IF_MUTEX_ERRPASS(!freeDirHandle(i, openReadList), + stateLock, 0); + + if (prev == NULL) + searchPath = next; + else + prev->next = next; + + BAIL_MUTEX_ERRPASS(stateLock, 1); + } /* if */ + prev = i; + } /* for */ + + BAIL_MUTEX(PHYSFS_ERR_NOT_MOUNTED, stateLock, 0); +} /* PHYSFS_unmount */ + + +char **PHYSFS_getSearchPath(void) +{ + return doEnumStringList(PHYSFS_getSearchPathCallback); +} /* PHYSFS_getSearchPath */ + + +const char *PHYSFS_getMountPoint(const char *dir) +{ + DirHandle *i; + __PHYSFS_platformGrabMutex(stateLock); + for (i = searchPath; i != NULL; i = i->next) + { + if (strcmp(i->dirName, dir) == 0) + { + const char *retval = ((i->mountPoint) ? i->mountPoint : "/"); + __PHYSFS_platformReleaseMutex(stateLock); + return retval; + } /* if */ + } /* for */ + __PHYSFS_platformReleaseMutex(stateLock); + + BAIL(PHYSFS_ERR_NOT_MOUNTED, NULL); +} /* PHYSFS_getMountPoint */ + + +void PHYSFS_getSearchPathCallback(PHYSFS_StringCallback callback, void *data) +{ + DirHandle *i; + + __PHYSFS_platformGrabMutex(stateLock); + + for (i = searchPath; i != NULL; i = i->next) + callback(data, i->dirName); + + __PHYSFS_platformReleaseMutex(stateLock); +} /* PHYSFS_getSearchPathCallback */ + + +typedef struct setSaneCfgEnumData +{ + const char *archiveExt; + size_t archiveExtLen; + int archivesFirst; + PHYSFS_ErrorCode errcode; +} setSaneCfgEnumData; + +static PHYSFS_EnumerateCallbackResult setSaneCfgEnumCallback(void *_data, + const char *dir, const char *f) +{ + setSaneCfgEnumData *data = (setSaneCfgEnumData *) _data; + const size_t extlen = data->archiveExtLen; + const size_t l = strlen(f); + const char *ext; + + if ((l > extlen) && (f[l - extlen - 1] == '.')) + { + ext = f + (l - extlen); + if (PHYSFS_utf8stricmp(ext, data->archiveExt) == 0) + { + const char dirsep = __PHYSFS_platformDirSeparator; + const char *d = PHYSFS_getRealDir(f); + const size_t allocsize = strlen(d) + l + 2; + char *str = (char *) __PHYSFS_smallAlloc(allocsize); + if (str == NULL) + data->errcode = PHYSFS_ERR_OUT_OF_MEMORY; + else + { + snprintf(str, allocsize, "%s%c%s", d, dirsep, f); + if (!PHYSFS_mount(str, NULL, data->archivesFirst == 0)) + data->errcode = currentErrorCode(); + __PHYSFS_smallFree(str); + } /* else */ + } /* if */ + } /* if */ + + /* !!! FIXME: if we want to abort on errors... */ + /*return (data->errcode != PHYSFS_ERR_OK) ? PHYSFS_ENUM_ERROR : PHYSFS_ENUM_OK;*/ + + return PHYSFS_ENUM_OK; /* keep going */ +} /* setSaneCfgEnumCallback */ + + +int PHYSFS_setSaneConfig(const char *organization, const char *appName, + const char *archiveExt, int includeCdRoms, + int archivesFirst) +{ + const char *basedir; + const char *prefdir; + + BAIL_IF(!initialized, PHYSFS_ERR_NOT_INITIALIZED, 0); + + prefdir = PHYSFS_getPrefDir(organization, appName); + BAIL_IF_ERRPASS(!prefdir, 0); + + basedir = PHYSFS_getBaseDir(); + BAIL_IF_ERRPASS(!basedir, 0); + + BAIL_IF(!PHYSFS_setWriteDir(prefdir), PHYSFS_ERR_NO_WRITE_DIR, 0); + + /* !!! FIXME: these can fail and we should report that... */ + + /* Put write dir first in search path... */ + PHYSFS_mount(prefdir, NULL, 0); + + /* Put base path on search path... */ + PHYSFS_mount(basedir, NULL, 1); + + /* handle CD-ROMs... */ + if (includeCdRoms) + { + char **cds = PHYSFS_getCdRomDirs(); + char **i; + for (i = cds; *i != NULL; i++) + PHYSFS_mount(*i, NULL, 1); + PHYSFS_freeList(cds); + } /* if */ + + /* Root out archives, and add them to search path... */ + if (archiveExt != NULL) + { + setSaneCfgEnumData data; + memset(&data, '\0', sizeof (data)); + data.archiveExt = archiveExt; + data.archiveExtLen = strlen(archiveExt); + data.archivesFirst = archivesFirst; + data.errcode = PHYSFS_ERR_OK; + if (!PHYSFS_enumerate("/", setSaneCfgEnumCallback, &data)) + { + /* !!! FIXME: use this if we're reporting errors. + PHYSFS_ErrorCode errcode = currentErrorCode(); + if (errcode == PHYSFS_ERR_APP_CALLBACK) + errcode = data->errcode; */ + } /* if */ + } /* if */ + + return 1; +} /* PHYSFS_setSaneConfig */ + + +void PHYSFS_permitSymbolicLinks(int allow) +{ + allowSymLinks = allow; +} /* PHYSFS_permitSymbolicLinks */ + + +int PHYSFS_symbolicLinksPermitted(void) +{ + return allowSymLinks; +} /* PHYSFS_symbolicLinksPermitted */ + + +/* + * Verify that (fname) (in platform-independent notation), in relation + * to (h) is secure. That means that each element of fname is checked + * for symlinks (if they aren't permitted). This also allows for quick + * rejection of files that exist outside an archive's mountpoint. + * + * With some exceptions (like PHYSFS_mkdir(), which builds multiple subdirs + * at a time), you should always pass zero for "allowMissing" for efficiency. + * + * (fname) must point to an output from sanitizePlatformIndependentPath(), + * since it will make sure that path names are in the right format for + * passing certain checks. It will also do checks for "insecure" pathnames + * like ".." which should be done once instead of once per archive. This also + * gives us license to treat (fname) as scratch space in this function. + * + * Returns non-zero if string is safe, zero if there's a security issue. + * PHYSFS_getLastError() will specify what was wrong. (*fname) will be + * updated to point past any mount point elements so it is prepared to + * be used with the archiver directly. + */ +static int verifyPath(DirHandle *h, char **_fname, int allowMissing) +{ + char *fname = *_fname; + int retval = 1; + char *start; + char *end; + + if (*fname == '\0') /* quick rejection. */ + return 1; + + /* !!! FIXME: This codeblock sucks. */ + if (h->mountPoint != NULL) /* NULL mountpoint means "/". */ + { + size_t mntpntlen = strlen(h->mountPoint); + size_t len = strlen(fname); + assert(mntpntlen > 1); /* root mount points should be NULL. */ + /* not under the mountpoint, so skip this archive. */ + BAIL_IF(len < mntpntlen-1, PHYSFS_ERR_NOT_FOUND, 0); + /* !!! FIXME: Case insensitive? */ + retval = strncmp(h->mountPoint, fname, mntpntlen-1); + BAIL_IF(retval != 0, PHYSFS_ERR_NOT_FOUND, 0); + if (len > mntpntlen-1) /* corner case... */ + BAIL_IF(fname[mntpntlen-1]!='/', PHYSFS_ERR_NOT_FOUND, 0); + fname += mntpntlen-1; /* move to start of actual archive path. */ + if (*fname == '/') + fname++; + *_fname = fname; /* skip mountpoint for later use. */ + retval = 1; /* may be reset, below. */ + } /* if */ + + start = fname; + if (!allowSymLinks) + { + while (1) + { + PHYSFS_Stat statbuf; + int rc = 0; + end = strchr(start, '/'); + + if (end != NULL) *end = '\0'; + rc = h->funcs->stat(h->opaque, fname, &statbuf); + if (rc) + rc = (statbuf.filetype == PHYSFS_FILETYPE_SYMLINK); + else if (currentErrorCode() == PHYSFS_ERR_NOT_FOUND) + retval = 0; + + if (end != NULL) *end = '/'; + + /* insecure path (has a disallowed symlink in it)? */ + BAIL_IF(rc, PHYSFS_ERR_SYMLINK_FORBIDDEN, 0); + + /* break out early if path element is missing. */ + if (!retval) + { + /* + * We need to clear it if it's the last element of the path, + * since this might be a non-existant file we're opening + * for writing... + */ + if ((end == NULL) || (allowMissing)) + retval = 1; + break; + } /* if */ + + if (end == NULL) + break; + + start = end + 1; + } /* while */ + } /* if */ + + return retval; +} /* verifyPath */ + + +static int doMkdir(const char *_dname, char *dname) +{ + DirHandle *h; + char *start; + char *end; + int retval = 0; + int exists = 1; /* force existance check on first path element. */ + + BAIL_IF_ERRPASS(!sanitizePlatformIndependentPath(_dname, dname), 0); + + __PHYSFS_platformGrabMutex(stateLock); + BAIL_IF_MUTEX(!writeDir, PHYSFS_ERR_NO_WRITE_DIR, stateLock, 0); + h = writeDir; + BAIL_IF_MUTEX_ERRPASS(!verifyPath(h, &dname, 1), stateLock, 0); + + start = dname; + while (1) + { + end = strchr(start, '/'); + if (end != NULL) + *end = '\0'; + + /* only check for existance if all parent dirs existed, too... */ + if (exists) + { + PHYSFS_Stat statbuf; + const int rc = h->funcs->stat(h->opaque, dname, &statbuf); + if ((!rc) && (currentErrorCode() == PHYSFS_ERR_NOT_FOUND)) + exists = 0; + retval = ((rc) && (statbuf.filetype == PHYSFS_FILETYPE_DIRECTORY)); + } /* if */ + + if (!exists) + retval = h->funcs->mkdir(h->opaque, dname); + + if (!retval) + break; + + if (end == NULL) + break; + + *end = '/'; + start = end + 1; + } /* while */ + + __PHYSFS_platformReleaseMutex(stateLock); + return retval; +} /* doMkdir */ + + +int PHYSFS_mkdir(const char *_dname) +{ + int retval = 0; + char *dname; + size_t len; + + BAIL_IF(!_dname, PHYSFS_ERR_INVALID_ARGUMENT, 0); + len = strlen(_dname) + 1; + dname = (char *) __PHYSFS_smallAlloc(len); + BAIL_IF(!dname, PHYSFS_ERR_OUT_OF_MEMORY, 0); + retval = doMkdir(_dname, dname); + __PHYSFS_smallFree(dname); + return retval; +} /* PHYSFS_mkdir */ + + +static int doDelete(const char *_fname, char *fname) +{ + int retval; + DirHandle *h; + BAIL_IF_ERRPASS(!sanitizePlatformIndependentPath(_fname, fname), 0); + + __PHYSFS_platformGrabMutex(stateLock); + + BAIL_IF_MUTEX(!writeDir, PHYSFS_ERR_NO_WRITE_DIR, stateLock, 0); + h = writeDir; + BAIL_IF_MUTEX_ERRPASS(!verifyPath(h, &fname, 0), stateLock, 0); + retval = h->funcs->remove(h->opaque, fname); + + __PHYSFS_platformReleaseMutex(stateLock); + return retval; +} /* doDelete */ + + +int PHYSFS_delete(const char *_fname) +{ + int retval; + char *fname; + size_t len; + + BAIL_IF(!_fname, PHYSFS_ERR_INVALID_ARGUMENT, 0); + len = strlen(_fname) + 1; + fname = (char *) __PHYSFS_smallAlloc(len); + BAIL_IF(!fname, PHYSFS_ERR_OUT_OF_MEMORY, 0); + retval = doDelete(_fname, fname); + __PHYSFS_smallFree(fname); + return retval; +} /* PHYSFS_delete */ + + +static DirHandle *getRealDirHandle(const char *_fname) +{ + DirHandle *retval = NULL; + char *fname = NULL; + size_t len; + + BAIL_IF(!_fname, PHYSFS_ERR_INVALID_ARGUMENT, NULL); + len = strlen(_fname) + 1; + fname = __PHYSFS_smallAlloc(len); + BAIL_IF(!fname, PHYSFS_ERR_OUT_OF_MEMORY, NULL); + if (sanitizePlatformIndependentPath(_fname, fname)) + { + DirHandle *i; + __PHYSFS_platformGrabMutex(stateLock); + for (i = searchPath; i != NULL; i = i->next) + { + char *arcfname = fname; + if (partOfMountPoint(i, arcfname)) + { + retval = i; + break; + } /* if */ + else if (verifyPath(i, &arcfname, 0)) + { + PHYSFS_Stat statbuf; + if (i->funcs->stat(i->opaque, arcfname, &statbuf)) + { + retval = i; + break; + } /* if */ + } /* if */ + } /* for */ + __PHYSFS_platformReleaseMutex(stateLock); + } /* if */ + + __PHYSFS_smallFree(fname); + return retval; +} /* getRealDirHandle */ + +const char *PHYSFS_getRealDir(const char *fname) +{ + DirHandle *dh = getRealDirHandle(fname); + return dh ? dh->dirName : NULL; +} /* PHYSFS_getRealDir */ + + +static int locateInStringList(const char *str, + char **list, + PHYSFS_uint32 *pos) +{ + PHYSFS_uint32 len = *pos; + PHYSFS_uint32 half_len; + PHYSFS_uint32 lo = 0; + PHYSFS_uint32 middle; + int cmp; + + while (len > 0) + { + half_len = len >> 1; + middle = lo + half_len; + cmp = strcmp(list[middle], str); + + if (cmp == 0) /* it's in the list already. */ + return 1; + else if (cmp > 0) + len = half_len; + else + { + lo = middle + 1; + len -= half_len + 1; + } /* else */ + } /* while */ + + *pos = lo; + return 0; +} /* locateInStringList */ + + +static PHYSFS_EnumerateCallbackResult enumFilesCallback(void *data, + const char *origdir, const char *str) +{ + PHYSFS_uint32 pos; + void *ptr; + char *newstr; + EnumStringListCallbackData *pecd = (EnumStringListCallbackData *) data; + + /* + * See if file is in the list already, and if not, insert it in there + * alphabetically... + */ + pos = pecd->size; + if (locateInStringList(str, pecd->list, &pos)) + return PHYSFS_ENUM_OK; /* already in the list, but keep going. */ + + ptr = allocator.Realloc(pecd->list, (pecd->size + 2) * sizeof (char *)); + newstr = (char *) allocator.Malloc(strlen(str) + 1); + if (ptr != NULL) + pecd->list = (char **) ptr; + + if ((ptr == NULL) || (newstr == NULL)) + { + if (newstr) + allocator.Free(newstr); + + pecd->errcode = PHYSFS_ERR_OUT_OF_MEMORY; + return PHYSFS_ENUM_ERROR; /* better luck next time. */ + } /* if */ + + strcpy(newstr, str); + + if (pos != pecd->size) + { + memmove(&pecd->list[pos+1], &pecd->list[pos], + sizeof (char *) * ((pecd->size) - pos)); + } /* if */ + + pecd->list[pos] = newstr; + pecd->size++; + + return PHYSFS_ENUM_OK; +} /* enumFilesCallback */ + + +char **PHYSFS_enumerateFiles(const char *path) +{ + EnumStringListCallbackData ecd; + memset(&ecd, '\0', sizeof (ecd)); + ecd.list = (char **) allocator.Malloc(sizeof (char *)); + BAIL_IF(!ecd.list, PHYSFS_ERR_OUT_OF_MEMORY, NULL); + if (!PHYSFS_enumerate(path, enumFilesCallback, &ecd)) + { + const PHYSFS_ErrorCode errcode = currentErrorCode(); + PHYSFS_uint32 i; + for (i = 0; i < ecd.size; i++) + allocator.Free(ecd.list[i]); + allocator.Free(ecd.list); + BAIL_IF(errcode == PHYSFS_ERR_APP_CALLBACK, ecd.errcode, NULL); + return NULL; + } /* if */ + + ecd.list[ecd.size] = NULL; + return ecd.list; +} /* PHYSFS_enumerateFiles */ + + +/* + * Broke out to seperate function so we can use stack allocation gratuitously. + */ +static PHYSFS_EnumerateCallbackResult enumerateFromMountPoint(DirHandle *i, + const char *arcfname, + PHYSFS_EnumerateCallback callback, + const char *_fname, void *data) +{ + PHYSFS_EnumerateCallbackResult retval; + const size_t len = strlen(arcfname); + char *ptr = NULL; + char *end = NULL; + const size_t slen = strlen(i->mountPoint) + 1; + char *mountPoint = (char *) __PHYSFS_smallAlloc(slen); + + BAIL_IF(!mountPoint, PHYSFS_ERR_OUT_OF_MEMORY, PHYSFS_ENUM_ERROR); + + strcpy(mountPoint, i->mountPoint); + ptr = mountPoint + ((len) ? len + 1 : 0); + end = strchr(ptr, '/'); + assert(end); /* should always find a terminating '/'. */ + *end = '\0'; + retval = callback(data, _fname, ptr); + __PHYSFS_smallFree(mountPoint); + + BAIL_IF(retval == PHYSFS_ENUM_ERROR, PHYSFS_ERR_APP_CALLBACK, retval); + return retval; +} /* enumerateFromMountPoint */ + + +typedef struct SymlinkFilterData +{ + PHYSFS_EnumerateCallback callback; + void *callbackData; + DirHandle *dirhandle; + const char *arcfname; + PHYSFS_ErrorCode errcode; +} SymlinkFilterData; + +static PHYSFS_EnumerateCallbackResult enumCallbackFilterSymLinks(void *_data, + const char *origdir, const char *fname) +{ + SymlinkFilterData *data = (SymlinkFilterData *) _data; + const DirHandle *dh = data->dirhandle; + const char *arcfname = data->arcfname; + PHYSFS_Stat statbuf; + const char *trimmedDir = (*arcfname == '/') ? (arcfname + 1) : arcfname; + const size_t slen = strlen(trimmedDir) + strlen(fname) + 2; + char *path = (char *) __PHYSFS_smallAlloc(slen); + PHYSFS_EnumerateCallbackResult retval = PHYSFS_ENUM_OK; + + if (path == NULL) + { + data->errcode = PHYSFS_ERR_OUT_OF_MEMORY; + return PHYSFS_ENUM_ERROR; + } /* if */ + + snprintf(path, slen, "%s%s%s", trimmedDir, *trimmedDir ? "/" : "", fname); + + if (!dh->funcs->stat(dh->opaque, path, &statbuf)) + { + data->errcode = currentErrorCode(); + retval = PHYSFS_ENUM_ERROR; + } /* if */ + else + { + /* Pass it on to the application if it's not a symlink. */ + if (statbuf.filetype != PHYSFS_FILETYPE_SYMLINK) + { + retval = data->callback(data->callbackData, origdir, fname); + if (retval == PHYSFS_ENUM_ERROR) + data->errcode = PHYSFS_ERR_APP_CALLBACK; + } /* if */ + } /* else */ + + __PHYSFS_smallFree(path); + + return retval; +} /* enumCallbackFilterSymLinks */ + + +int PHYSFS_enumerate(const char *_fn, PHYSFS_EnumerateCallback cb, void *data) +{ + PHYSFS_EnumerateCallbackResult retval = PHYSFS_ENUM_OK; + size_t len; + char *fname; + + BAIL_IF(!_fn, PHYSFS_ERR_INVALID_ARGUMENT, 0); + BAIL_IF(!cb, PHYSFS_ERR_INVALID_ARGUMENT, 0); + + len = strlen(_fn) + 1; + fname = (char *) __PHYSFS_smallAlloc(len); + BAIL_IF(!fname, PHYSFS_ERR_OUT_OF_MEMORY, 0); + + if (!sanitizePlatformIndependentPath(_fn, fname)) + retval = PHYSFS_ENUM_STOP; + else + { + DirHandle *i; + SymlinkFilterData filterdata; + + __PHYSFS_platformGrabMutex(stateLock); + + if (!allowSymLinks) + { + memset(&filterdata, '\0', sizeof (filterdata)); + filterdata.callback = cb; + filterdata.callbackData = data; + } /* if */ + + for (i = searchPath; (retval == PHYSFS_ENUM_OK) && i; i = i->next) + { + char *arcfname = fname; + + if (partOfMountPoint(i, arcfname)) + retval = enumerateFromMountPoint(i, arcfname, cb, _fn, data); + + else if (verifyPath(i, &arcfname, 0)) + { + PHYSFS_Stat statbuf; + if (!i->funcs->stat(i->opaque, arcfname, &statbuf)) + { + if (currentErrorCode() == PHYSFS_ERR_NOT_FOUND) + continue; /* no such dir in this archive, skip it. */ + } /* if */ + + if (statbuf.filetype != PHYSFS_FILETYPE_DIRECTORY) + continue; /* not a directory in this archive, skip it. */ + + else if ((!allowSymLinks) && (i->funcs->info.supportsSymlinks)) + { + filterdata.dirhandle = i; + filterdata.arcfname = arcfname; + filterdata.errcode = PHYSFS_ERR_OK; + retval = i->funcs->enumerate(i->opaque, arcfname, + enumCallbackFilterSymLinks, + _fn, &filterdata); + if (retval == PHYSFS_ENUM_ERROR) + { + if (currentErrorCode() == PHYSFS_ERR_APP_CALLBACK) + PHYSFS_setErrorCode(filterdata.errcode); + } /* if */ + } /* else if */ + else + { + retval = i->funcs->enumerate(i->opaque, arcfname, + cb, _fn, data); + } /* else */ + } /* else if */ + } /* for */ + + __PHYSFS_platformReleaseMutex(stateLock); + } /* if */ + + __PHYSFS_smallFree(fname); + + return (retval == PHYSFS_ENUM_ERROR) ? 0 : 1; +} /* PHYSFS_enumerate */ + + +typedef struct +{ + PHYSFS_EnumFilesCallback callback; + void *data; +} LegacyEnumFilesCallbackData; + +static PHYSFS_EnumerateCallbackResult enumFilesCallbackAlwaysSucceed(void *d, + const char *origdir, const char *fname) +{ + LegacyEnumFilesCallbackData *cbdata = (LegacyEnumFilesCallbackData *) d; + cbdata->callback(cbdata->data, origdir, fname); + return PHYSFS_ENUM_OK; +} /* enumFilesCallbackAlwaysSucceed */ + +void PHYSFS_enumerateFilesCallback(const char *fname, + PHYSFS_EnumFilesCallback callback, + void *data) +{ + LegacyEnumFilesCallbackData cbdata; + cbdata.callback = callback; + cbdata.data = data; + (void) PHYSFS_enumerate(fname, enumFilesCallbackAlwaysSucceed, &cbdata); +} /* PHYSFS_enumerateFilesCallback */ + + +int PHYSFS_exists(const char *fname) +{ + return (getRealDirHandle(fname) != NULL); +} /* PHYSFS_exists */ + + +PHYSFS_sint64 PHYSFS_getLastModTime(const char *fname) +{ + PHYSFS_Stat statbuf; + BAIL_IF_ERRPASS(!PHYSFS_stat(fname, &statbuf), -1); + return statbuf.modtime; +} /* PHYSFS_getLastModTime */ + + +int PHYSFS_isDirectory(const char *fname) +{ + PHYSFS_Stat statbuf; + BAIL_IF_ERRPASS(!PHYSFS_stat(fname, &statbuf), 0); + return (statbuf.filetype == PHYSFS_FILETYPE_DIRECTORY); +} /* PHYSFS_isDirectory */ + + +int PHYSFS_isSymbolicLink(const char *fname) +{ + PHYSFS_Stat statbuf; + BAIL_IF_ERRPASS(!PHYSFS_stat(fname, &statbuf), 0); + return (statbuf.filetype == PHYSFS_FILETYPE_SYMLINK); +} /* PHYSFS_isSymbolicLink */ + + +static PHYSFS_File *doOpenWrite(const char *_fname, int appending) +{ + FileHandle *fh = NULL; + size_t len; + char *fname; + + BAIL_IF(!_fname, PHYSFS_ERR_INVALID_ARGUMENT, 0); + len = strlen(_fname) + 1; + fname = (char *) __PHYSFS_smallAlloc(len); + BAIL_IF(!fname, PHYSFS_ERR_OUT_OF_MEMORY, 0); + + if (sanitizePlatformIndependentPath(_fname, fname)) + { + PHYSFS_Io *io = NULL; + DirHandle *h = NULL; + const PHYSFS_Archiver *f; + + __PHYSFS_platformGrabMutex(stateLock); + + GOTO_IF(!writeDir, PHYSFS_ERR_NO_WRITE_DIR, doOpenWriteEnd); + + h = writeDir; + GOTO_IF_ERRPASS(!verifyPath(h, &fname, 0), doOpenWriteEnd); + + f = h->funcs; + if (appending) + io = f->openAppend(h->opaque, fname); + else + io = f->openWrite(h->opaque, fname); + + GOTO_IF_ERRPASS(!io, doOpenWriteEnd); + + fh = (FileHandle *) allocator.Malloc(sizeof (FileHandle)); + if (fh == NULL) + { + io->destroy(io); + GOTO(PHYSFS_ERR_OUT_OF_MEMORY, doOpenWriteEnd); + } /* if */ + else + { + memset(fh, '\0', sizeof (FileHandle)); + fh->io = io; + fh->dirHandle = h; + fh->next = openWriteList; + openWriteList = fh; + } /* else */ + + doOpenWriteEnd: + __PHYSFS_platformReleaseMutex(stateLock); + } /* if */ + + __PHYSFS_smallFree(fname); + return ((PHYSFS_File *) fh); +} /* doOpenWrite */ + + +PHYSFS_File *PHYSFS_openWrite(const char *filename) +{ + return doOpenWrite(filename, 0); +} /* PHYSFS_openWrite */ + + +PHYSFS_File *PHYSFS_openAppend(const char *filename) +{ + return doOpenWrite(filename, 1); +} /* PHYSFS_openAppend */ + + +PHYSFS_File *PHYSFS_openRead(const char *_fname) +{ + FileHandle *fh = NULL; + char *fname; + size_t len; + + BAIL_IF(!_fname, PHYSFS_ERR_INVALID_ARGUMENT, 0); + len = strlen(_fname) + 1; + fname = (char *) __PHYSFS_smallAlloc(len); + BAIL_IF(!fname, PHYSFS_ERR_OUT_OF_MEMORY, 0); + + if (sanitizePlatformIndependentPath(_fname, fname)) + { + DirHandle *i = NULL; + PHYSFS_Io *io = NULL; + + __PHYSFS_platformGrabMutex(stateLock); + + GOTO_IF(!searchPath, PHYSFS_ERR_NOT_FOUND, openReadEnd); + + for (i = searchPath; i != NULL; i = i->next) + { + char *arcfname = fname; + if (verifyPath(i, &arcfname, 0)) + { + io = i->funcs->openRead(i->opaque, arcfname); + if (io) + break; + } /* if */ + } /* for */ + + GOTO_IF_ERRPASS(!io, openReadEnd); + + fh = (FileHandle *) allocator.Malloc(sizeof (FileHandle)); + if (fh == NULL) + { + io->destroy(io); + GOTO(PHYSFS_ERR_OUT_OF_MEMORY, openReadEnd); + } /* if */ + + memset(fh, '\0', sizeof (FileHandle)); + fh->io = io; + fh->forReading = 1; + fh->dirHandle = i; + fh->next = openReadList; + openReadList = fh; + + openReadEnd: + __PHYSFS_platformReleaseMutex(stateLock); + } /* if */ + + __PHYSFS_smallFree(fname); + return ((PHYSFS_File *) fh); +} /* PHYSFS_openRead */ + + +static int closeHandleInOpenList(FileHandle **list, FileHandle *handle) +{ + FileHandle *prev = NULL; + FileHandle *i; + + for (i = *list; i != NULL; i = i->next) + { + if (i == handle) /* handle is in this list? */ + { + PHYSFS_Io *io = handle->io; + PHYSFS_uint8 *tmp = handle->buffer; + + /* send our buffer to io... */ + if (!handle->forReading) + { + if (!PHYSFS_flush((PHYSFS_File *) handle)) + return -1; + + /* ...then have io send it to the disk... */ + else if (io->flush && !io->flush(io)) + return -1; + } /* if */ + + /* ...then close the underlying file. */ + io->destroy(io); + + if (tmp != NULL) /* free any associated buffer. */ + allocator.Free(tmp); + + if (prev == NULL) + *list = handle->next; + else + prev->next = handle->next; + + allocator.Free(handle); + return 1; + } /* if */ + prev = i; + } /* for */ + + return 0; +} /* closeHandleInOpenList */ + + +int PHYSFS_close(PHYSFS_File *_handle) +{ + FileHandle *handle = (FileHandle *) _handle; + int rc; + + __PHYSFS_platformGrabMutex(stateLock); + + /* -1 == close failure. 0 == not found. 1 == success. */ + rc = closeHandleInOpenList(&openReadList, handle); + BAIL_IF_MUTEX_ERRPASS(rc == -1, stateLock, 0); + if (!rc) + { + rc = closeHandleInOpenList(&openWriteList, handle); + BAIL_IF_MUTEX_ERRPASS(rc == -1, stateLock, 0); + } /* if */ + + __PHYSFS_platformReleaseMutex(stateLock); + BAIL_IF(!rc, PHYSFS_ERR_INVALID_ARGUMENT, 0); + return 1; +} /* PHYSFS_close */ + + +static PHYSFS_sint64 doBufferedRead(FileHandle *fh, void *_buffer, size_t len) +{ + PHYSFS_uint8 *buffer = (PHYSFS_uint8 *) _buffer; + PHYSFS_sint64 retval = 0; + + while (len > 0) + { + const size_t avail = fh->buffill - fh->bufpos; + if (avail > 0) /* data available in the buffer. */ + { + const size_t cpy = (len < avail) ? len : avail; + memcpy(buffer, fh->buffer + fh->bufpos, cpy); + assert(len >= cpy); + buffer += cpy; + len -= cpy; + fh->bufpos += cpy; + retval += cpy; + } /* if */ + + else /* buffer is empty, refill it. */ + { + PHYSFS_Io *io = fh->io; + const PHYSFS_sint64 rc = io->read(io, fh->buffer, fh->bufsize); + fh->bufpos = 0; + if (rc > 0) + fh->buffill = (size_t) rc; + else + { + fh->buffill = 0; + if (retval == 0) /* report already-read data, or failure. */ + retval = rc; + break; + } /* else */ + } /* else */ + } /* while */ + + return retval; +} /* doBufferedRead */ + + +PHYSFS_sint64 PHYSFS_read(PHYSFS_File *handle, void *buffer, + PHYSFS_uint32 size, PHYSFS_uint32 count) +{ + const PHYSFS_uint64 len = ((PHYSFS_uint64) size) * ((PHYSFS_uint64) count); + const PHYSFS_sint64 retval = PHYSFS_readBytes(handle, buffer, len); + return ( (retval <= 0) ? retval : (retval / ((PHYSFS_sint64) size)) ); +} /* PHYSFS_read */ + + +PHYSFS_sint64 PHYSFS_readBytes(PHYSFS_File *handle, void *buffer, + PHYSFS_uint64 _len) +{ + const size_t len = (size_t) _len; + FileHandle *fh = (FileHandle *) handle; + +#ifdef PHYSFS_NO_64BIT_SUPPORT + const PHYSFS_uint64 maxlen = __PHYSFS_UI64(0x7FFFFFFF); +#else + const PHYSFS_uint64 maxlen = __PHYSFS_UI64(0x7FFFFFFFFFFFFFFF); +#endif + + if (!__PHYSFS_ui64FitsAddressSpace(_len)) + BAIL(PHYSFS_ERR_INVALID_ARGUMENT, -1); + + BAIL_IF(_len > maxlen, PHYSFS_ERR_INVALID_ARGUMENT, -1); + BAIL_IF(!fh->forReading, PHYSFS_ERR_OPEN_FOR_WRITING, -1); + BAIL_IF_ERRPASS(len == 0, 0); + if (fh->buffer) + return doBufferedRead(fh, buffer, len); + + return fh->io->read(fh->io, buffer, len); +} /* PHYSFS_readBytes */ + + +static PHYSFS_sint64 doBufferedWrite(PHYSFS_File *handle, const void *buffer, + const size_t len) +{ + FileHandle *fh = (FileHandle *) handle; + + /* whole thing fits in the buffer? */ + if ((fh->buffill + len) < fh->bufsize) + { + memcpy(fh->buffer + fh->buffill, buffer, len); + fh->buffill += len; + return (PHYSFS_sint64) len; + } /* if */ + + /* would overflow buffer. Flush and then write the new objects, too. */ + BAIL_IF_ERRPASS(!PHYSFS_flush(handle), -1); + return fh->io->write(fh->io, buffer, len); +} /* doBufferedWrite */ + + +PHYSFS_sint64 PHYSFS_write(PHYSFS_File *handle, const void *buffer, + PHYSFS_uint32 size, PHYSFS_uint32 count) +{ + const PHYSFS_uint64 len = ((PHYSFS_uint64) size) * ((PHYSFS_uint64) count); + const PHYSFS_sint64 retval = PHYSFS_writeBytes(handle, buffer, len); + return ( (retval <= 0) ? retval : (retval / ((PHYSFS_sint64) size)) ); +} /* PHYSFS_write */ + + +PHYSFS_sint64 PHYSFS_writeBytes(PHYSFS_File *handle, const void *buffer, + PHYSFS_uint64 _len) +{ + const size_t len = (size_t) _len; + FileHandle *fh = (FileHandle *) handle; + +#ifdef PHYSFS_NO_64BIT_SUPPORT + const PHYSFS_uint64 maxlen = __PHYSFS_UI64(0x7FFFFFFF); +#else + const PHYSFS_uint64 maxlen = __PHYSFS_UI64(0x7FFFFFFFFFFFFFFF); +#endif + + if (!__PHYSFS_ui64FitsAddressSpace(_len)) + BAIL(PHYSFS_ERR_INVALID_ARGUMENT, -1); + + BAIL_IF(_len > maxlen, PHYSFS_ERR_INVALID_ARGUMENT, -1); + BAIL_IF(fh->forReading, PHYSFS_ERR_OPEN_FOR_READING, -1); + BAIL_IF_ERRPASS(len == 0, 0); + if (fh->buffer) + return doBufferedWrite(handle, buffer, len); + + return fh->io->write(fh->io, buffer, len); +} /* PHYSFS_write */ + + +int PHYSFS_eof(PHYSFS_File *handle) +{ + FileHandle *fh = (FileHandle *) handle; + + if (!fh->forReading) /* never EOF on files opened for write/append. */ + return 0; + + /* can't be eof if buffer isn't empty */ + if (fh->bufpos == fh->buffill) + { + /* check the Io. */ + PHYSFS_Io *io = fh->io; + const PHYSFS_sint64 pos = io->tell(io); + const PHYSFS_sint64 len = io->length(io); + if ((pos < 0) || (len < 0)) + return 0; /* beats me. */ + return (pos >= len); + } /* if */ + + return 0; +} /* PHYSFS_eof */ + + +PHYSFS_sint64 PHYSFS_tell(PHYSFS_File *handle) +{ + FileHandle *fh = (FileHandle *) handle; + const PHYSFS_sint64 pos = fh->io->tell(fh->io); + const PHYSFS_sint64 retval = fh->forReading ? + (pos - fh->buffill) + fh->bufpos : + (pos + fh->buffill); + return retval; +} /* PHYSFS_tell */ + + +int PHYSFS_seek(PHYSFS_File *handle, PHYSFS_uint64 pos) +{ + FileHandle *fh = (FileHandle *) handle; + BAIL_IF_ERRPASS(!PHYSFS_flush(handle), 0); + + if (fh->buffer && fh->forReading) + { + /* avoid throwing away our precious buffer if seeking within it. */ + PHYSFS_sint64 offset = pos - PHYSFS_tell(handle); + if ( /* seeking within the already-buffered range? */ + /* forward? */ + ((offset >= 0) && (((size_t)offset) <= fh->buffill-fh->bufpos)) || + /* backward? */ + ((offset < 0) && (((size_t) -offset) <= fh->bufpos)) ) + { + fh->bufpos = (size_t) (((PHYSFS_sint64) fh->bufpos) + offset); + return 1; /* successful seek */ + } /* if */ + } /* if */ + + /* we have to fall back to a 'raw' seek. */ + fh->buffill = fh->bufpos = 0; + return fh->io->seek(fh->io, pos); +} /* PHYSFS_seek */ + + +PHYSFS_sint64 PHYSFS_fileLength(PHYSFS_File *handle) +{ + PHYSFS_Io *io = ((FileHandle *) handle)->io; + return io->length(io); +} /* PHYSFS_filelength */ + + +int PHYSFS_setBuffer(PHYSFS_File *handle, PHYSFS_uint64 _bufsize) +{ + FileHandle *fh = (FileHandle *) handle; + const size_t bufsize = (size_t) _bufsize; + + if (!__PHYSFS_ui64FitsAddressSpace(_bufsize)) + BAIL(PHYSFS_ERR_INVALID_ARGUMENT, 0); + + BAIL_IF_ERRPASS(!PHYSFS_flush(handle), 0); + + /* + * For reads, we need to move the file pointer to where it would be + * if we weren't buffering, so that the next read will get the + * right chunk of stuff from the file. PHYSFS_flush() handles writes. + */ + if ((fh->forReading) && (fh->buffill != fh->bufpos)) + { + PHYSFS_uint64 pos; + const PHYSFS_sint64 curpos = fh->io->tell(fh->io); + BAIL_IF_ERRPASS(curpos == -1, 0); + pos = ((curpos - fh->buffill) + fh->bufpos); + BAIL_IF_ERRPASS(!fh->io->seek(fh->io, pos), 0); + } /* if */ + + if (bufsize == 0) /* delete existing buffer. */ + { + if (fh->buffer) + { + allocator.Free(fh->buffer); + fh->buffer = NULL; + } /* if */ + } /* if */ + + else + { + PHYSFS_uint8 *newbuf; + newbuf = (PHYSFS_uint8 *) allocator.Realloc(fh->buffer, bufsize); + BAIL_IF(!newbuf, PHYSFS_ERR_OUT_OF_MEMORY, 0); + fh->buffer = newbuf; + } /* else */ + + fh->bufsize = bufsize; + fh->buffill = fh->bufpos = 0; + return 1; +} /* PHYSFS_setBuffer */ + + +int PHYSFS_flush(PHYSFS_File *handle) +{ + FileHandle *fh = (FileHandle *) handle; + PHYSFS_Io *io; + PHYSFS_sint64 rc; + + if ((fh->forReading) || (fh->bufpos == fh->buffill)) + return 1; /* open for read or buffer empty are successful no-ops. */ + + /* dump buffer to disk. */ + io = fh->io; + rc = io->write(io, fh->buffer + fh->bufpos, fh->buffill - fh->bufpos); + BAIL_IF_ERRPASS(rc <= 0, 0); + fh->bufpos = fh->buffill = 0; + return 1; +} /* PHYSFS_flush */ + + +int PHYSFS_stat(const char *_fname, PHYSFS_Stat *stat) +{ + int retval = 0; + char *fname; + size_t len; + + BAIL_IF(!_fname, PHYSFS_ERR_INVALID_ARGUMENT, 0); + BAIL_IF(!stat, PHYSFS_ERR_INVALID_ARGUMENT, 0); + len = strlen(_fname) + 1; + fname = (char *) __PHYSFS_smallAlloc(len); + BAIL_IF(!fname, PHYSFS_ERR_OUT_OF_MEMORY, 0); + + /* set some sane defaults... */ + stat->filesize = -1; + stat->modtime = -1; + stat->createtime = -1; + stat->accesstime = -1; + stat->filetype = PHYSFS_FILETYPE_OTHER; + stat->readonly = 1; + + if (sanitizePlatformIndependentPath(_fname, fname)) + { + if (*fname == '\0') + { + stat->filetype = PHYSFS_FILETYPE_DIRECTORY; + stat->readonly = !writeDir; /* Writeable if we have a writeDir */ + retval = 1; + } /* if */ + else + { + DirHandle *i; + int exists = 0; + __PHYSFS_platformGrabMutex(stateLock); + for (i = searchPath; ((i != NULL) && (!exists)); i = i->next) + { + char *arcfname = fname; + exists = partOfMountPoint(i, arcfname); + if (exists) + { + stat->filetype = PHYSFS_FILETYPE_DIRECTORY; + stat->readonly = 1; + retval = 1; + } /* if */ + else if (verifyPath(i, &arcfname, 0)) + { + retval = i->funcs->stat(i->opaque, arcfname, stat); + if ((retval) || (currentErrorCode() != PHYSFS_ERR_NOT_FOUND)) + exists = 1; + } /* else if */ + } /* for */ + __PHYSFS_platformReleaseMutex(stateLock); + } /* else */ + } /* if */ + + __PHYSFS_smallFree(fname); + return retval; +} /* PHYSFS_stat */ + + +int __PHYSFS_readAll(PHYSFS_Io *io, void *buf, const size_t _len) +{ + const PHYSFS_uint64 len = (PHYSFS_uint64) _len; + return (io->read(io, buf, len) == len); +} /* __PHYSFS_readAll */ + + +void *__PHYSFS_initSmallAlloc(void *ptr, const size_t len) +{ + void *useHeap = ((ptr == NULL) ? ((void *) 1) : ((void *) 0)); + if (useHeap) /* too large for stack allocation or alloca() failed. */ + ptr = allocator.Malloc(len+sizeof (void *)); + + if (ptr != NULL) + { + void **retval = (void **) ptr; + /*printf("%s alloc'd (%lld) bytes at (%p).\n", + useHeap ? "heap" : "stack", (long long) len, ptr);*/ + *retval = useHeap; + return retval + 1; + } /* if */ + + return NULL; /* allocation failed. */ +} /* __PHYSFS_initSmallAlloc */ + + +void __PHYSFS_smallFree(void *ptr) +{ + if (ptr != NULL) + { + void **block = ((void **) ptr) - 1; + const int useHeap = (*block != NULL); + if (useHeap) + allocator.Free(block); + /*printf("%s free'd (%p).\n", useHeap ? "heap" : "stack", block);*/ + } /* if */ +} /* __PHYSFS_smallFree */ + + +int PHYSFS_setAllocator(const PHYSFS_Allocator *a) +{ + BAIL_IF(initialized, PHYSFS_ERR_IS_INITIALIZED, 0); + externalAllocator = (a != NULL); + if (externalAllocator) + memcpy(&allocator, a, sizeof (PHYSFS_Allocator)); + + return 1; +} /* PHYSFS_setAllocator */ + + +const PHYSFS_Allocator *PHYSFS_getAllocator(void) +{ + BAIL_IF(!initialized, PHYSFS_ERR_NOT_INITIALIZED, NULL); + return &allocator; +} /* PHYSFS_getAllocator */ + + +static void *mallocAllocatorMalloc(PHYSFS_uint64 s) +{ + if (!__PHYSFS_ui64FitsAddressSpace(s)) + BAIL(PHYSFS_ERR_OUT_OF_MEMORY, NULL); + #undef malloc + return malloc((size_t) s); +} /* mallocAllocatorMalloc */ + + +static void *mallocAllocatorRealloc(void *ptr, PHYSFS_uint64 s) +{ + if (!__PHYSFS_ui64FitsAddressSpace(s)) + BAIL(PHYSFS_ERR_OUT_OF_MEMORY, NULL); + #undef realloc + return realloc(ptr, (size_t) s); +} /* mallocAllocatorRealloc */ + + +static void mallocAllocatorFree(void *ptr) +{ + #undef free + free(ptr); +} /* mallocAllocatorFree */ + + +static void setDefaultAllocator(void) +{ + assert(!externalAllocator); + allocator.Init = NULL; + allocator.Deinit = NULL; + allocator.Malloc = mallocAllocatorMalloc; + allocator.Realloc = mallocAllocatorRealloc; + allocator.Free = mallocAllocatorFree; +} /* setDefaultAllocator */ + + +int __PHYSFS_DirTreeInit(__PHYSFS_DirTree *dt, const size_t entrylen) +{ + static char rootpath[2] = { '/', '\0' }; + size_t alloclen; + + assert(entrylen >= sizeof (__PHYSFS_DirTreeEntry)); + + memset(dt, '\0', sizeof (*dt)); + + dt->root = (__PHYSFS_DirTreeEntry *) allocator.Malloc(entrylen); + BAIL_IF(!dt->root, PHYSFS_ERR_OUT_OF_MEMORY, 0); + memset(dt->root, '\0', entrylen); + dt->root->name = rootpath; + dt->root->isdir = 1; + dt->hashBuckets = 64; + if (!dt->hashBuckets) + dt->hashBuckets = 1; + dt->entrylen = entrylen; + + alloclen = dt->hashBuckets * sizeof (__PHYSFS_DirTreeEntry *); + dt->hash = (__PHYSFS_DirTreeEntry **) allocator.Malloc(alloclen); + BAIL_IF(!dt->hash, PHYSFS_ERR_OUT_OF_MEMORY, 0); + memset(dt->hash, '\0', alloclen); + + return 1; +} /* __PHYSFS_DirTreeInit */ + + +static inline PHYSFS_uint32 hashPathName(__PHYSFS_DirTree *dt, const char *name) +{ + return __PHYSFS_hashString(name, strlen(name)) % dt->hashBuckets; +} /* hashPathName */ + + +/* Fill in missing parent directories. */ +static __PHYSFS_DirTreeEntry *addAncestors(__PHYSFS_DirTree *dt, char *name) +{ + __PHYSFS_DirTreeEntry *retval = dt->root; + char *sep = strrchr(name, '/'); + + if (sep) + { + *sep = '\0'; /* chop off last piece. */ + retval = (__PHYSFS_DirTreeEntry *) __PHYSFS_DirTreeFind(dt, name); + + if (retval != NULL) + { + *sep = '/'; + BAIL_IF(!retval->isdir, PHYSFS_ERR_CORRUPT, NULL); + return retval; /* already hashed. */ + } /* if */ + + /* okay, this is a new dir. Build and hash us. */ + retval = (__PHYSFS_DirTreeEntry*)__PHYSFS_DirTreeAdd(dt, name, 1); + *sep = '/'; + } /* if */ + + return retval; +} /* addAncestors */ + + +void *__PHYSFS_DirTreeAdd(__PHYSFS_DirTree *dt, char *name, const int isdir) +{ + __PHYSFS_DirTreeEntry *retval = __PHYSFS_DirTreeFind(dt, name); + if (!retval) + { + const size_t alloclen = strlen(name) + 1 + dt->entrylen; + PHYSFS_uint32 hashval; + __PHYSFS_DirTreeEntry *parent = addAncestors(dt, name); + BAIL_IF_ERRPASS(!parent, NULL); + assert(dt->entrylen >= sizeof (__PHYSFS_DirTreeEntry)); + retval = (__PHYSFS_DirTreeEntry *) allocator.Malloc(alloclen); + BAIL_IF(!retval, PHYSFS_ERR_OUT_OF_MEMORY, NULL); + memset(retval, '\0', dt->entrylen); + retval->name = ((char *) retval) + dt->entrylen; + strcpy(retval->name, name); + hashval = hashPathName(dt, name); + retval->hashnext = dt->hash[hashval]; + dt->hash[hashval] = retval; + retval->sibling = parent->children; + retval->isdir = isdir; + parent->children = retval; + } /* if */ + + return retval; +} /* __PHYSFS_DirTreeAdd */ + + +/* Find the __PHYSFS_DirTreeEntry for a path in platform-independent notation. */ +void *__PHYSFS_DirTreeFind(__PHYSFS_DirTree *dt, const char *path) +{ + PHYSFS_uint32 hashval; + __PHYSFS_DirTreeEntry *prev = NULL; + __PHYSFS_DirTreeEntry *retval; + + if (*path == '\0') + return dt->root; + + hashval = hashPathName(dt, path); + for (retval = dt->hash[hashval]; retval; retval = retval->hashnext) + { + if (strcmp(retval->name, path) == 0) + { + if (prev != NULL) /* move this to the front of the list */ + { + prev->hashnext = retval->hashnext; + retval->hashnext = dt->hash[hashval]; + dt->hash[hashval] = retval; + } /* if */ + + return retval; + } /* if */ + + prev = retval; + } /* for */ + + BAIL(PHYSFS_ERR_NOT_FOUND, NULL); +} /* __PHYSFS_DirTreeFind */ + +PHYSFS_EnumerateCallbackResult __PHYSFS_DirTreeEnumerate(void *opaque, + const char *dname, PHYSFS_EnumerateCallback cb, + const char *origdir, void *callbackdata) +{ + PHYSFS_EnumerateCallbackResult retval = PHYSFS_ENUM_OK; + __PHYSFS_DirTree *tree = (__PHYSFS_DirTree *) opaque; + const __PHYSFS_DirTreeEntry *entry = __PHYSFS_DirTreeFind(tree, dname); + BAIL_IF(!entry, PHYSFS_ERR_NOT_FOUND, PHYSFS_ENUM_ERROR); + + entry = entry->children; + + while (entry && (retval == PHYSFS_ENUM_OK)) + { + const char *name = entry->name; + const char *ptr = strrchr(name, '/'); + retval = cb(callbackdata, origdir, ptr ? ptr + 1 : name); + BAIL_IF(retval == PHYSFS_ENUM_ERROR, PHYSFS_ERR_APP_CALLBACK, retval); + entry = entry->sibling; + } /* while */ + + return retval; +} /* __PHYSFS_DirTreeEnumerate */ + + +void __PHYSFS_DirTreeDeinit(__PHYSFS_DirTree *dt) +{ + if (!dt) + return; + + if (dt->root) + { + assert(dt->root->sibling == NULL); + assert(dt->hash || (dt->root->children == NULL)); + allocator.Free(dt->root); + } /* if */ + + if (dt->hash) + { + size_t i; + for (i = 0; i < dt->hashBuckets; i++) + { + __PHYSFS_DirTreeEntry *entry; + __PHYSFS_DirTreeEntry *next; + for (entry = dt->hash[i]; entry; entry = next) + { + next = entry->hashnext; + allocator.Free(entry); + } /* for */ + } /* for */ + allocator.Free(dt->hash); + } /* if */ +} /* __PHYSFS_DirTreeDeinit */ + +/* end of physfs.c ... */ + diff --git a/third_party/physfs/physfs.h b/third_party/physfs/physfs.h new file mode 100644 index 00000000..10855505 --- /dev/null +++ b/third_party/physfs/physfs.h @@ -0,0 +1,3854 @@ +/** + * \file physfs.h + * + * Main header file for PhysicsFS. + */ + +/** + * \mainpage PhysicsFS + * + * The latest version of PhysicsFS can be found at: + * https://icculus.org/physfs/ + * + * PhysicsFS; a portable, flexible file i/o abstraction. + * + * This API gives you access to a system file system in ways superior to the + * stdio or system i/o calls. The brief benefits: + * + * - It's portable. + * - It's safe. No file access is permitted outside the specified dirs. + * - It's flexible. Archives (.ZIP files) can be used transparently as + * directory structures. + * + * With PhysicsFS, you have a single writing directory and multiple + * directories (the "search path") for reading. You can think of this as a + * filesystem within a filesystem. If (on Windows) you were to set the + * writing directory to "C:\MyGame\MyWritingDirectory", then no PHYSFS calls + * could touch anything above this directory, including the "C:\MyGame" and + * "C:\" directories. This prevents an application's internal scripting + * language from piddling over c:\\config.sys, for example. If you'd rather + * give PHYSFS full access to the system's REAL file system, set the writing + * dir to "C:\", but that's generally A Bad Thing for several reasons. + * + * Drive letters are hidden in PhysicsFS once you set up your initial paths. + * The search path creates a single, hierarchical directory structure. + * Not only does this lend itself well to general abstraction with archives, + * it also gives better support to operating systems like MacOS and Unix. + * Generally speaking, you shouldn't ever hardcode a drive letter; not only + * does this hurt portability to non-Microsoft OSes, but it limits your win32 + * users to a single drive, too. Use the PhysicsFS abstraction functions and + * allow user-defined configuration options, too. When opening a file, you + * specify it like it was on a Unix filesystem: if you want to write to + * "C:\MyGame\MyConfigFiles\game.cfg", then you might set the write dir to + * "C:\MyGame" and then open "MyConfigFiles/game.cfg". This gives an + * abstraction across all platforms. Specifying a file in this way is termed + * "platform-independent notation" in this documentation. Specifying a + * a filename in a form such as "C:\mydir\myfile" or + * "MacOS hard drive:My Directory:My File" is termed "platform-dependent + * notation". The only time you use platform-dependent notation is when + * setting up your write directory and search path; after that, all file + * access into those directories are done with platform-independent notation. + * + * All files opened for writing are opened in relation to the write directory, + * which is the root of the writable filesystem. When opening a file for + * reading, PhysicsFS goes through the search path. This is NOT the + * same thing as the PATH environment variable. An application using + * PhysicsFS specifies directories to be searched which may be actual + * directories, or archive files that contain files and subdirectories of + * their own. See the end of these docs for currently supported archive + * formats. + * + * Once the search path is defined, you may open files for reading. If you've + * got the following search path defined (to use a win32 example again): + * + * - C:\\mygame + * - C:\\mygame\\myuserfiles + * - D:\\mygamescdromdatafiles + * - C:\\mygame\\installeddatafiles.zip + * + * Then a call to PHYSFS_openRead("textfiles/myfile.txt") (note the directory + * separator, lack of drive letter, and lack of dir separator at the start of + * the string; this is platform-independent notation) will check for + * C:\\mygame\\textfiles\\myfile.txt, then + * C:\\mygame\\myuserfiles\\textfiles\\myfile.txt, then + * D:\\mygamescdromdatafiles\\textfiles\\myfile.txt, then, finally, for + * textfiles\\myfile.txt inside of C:\\mygame\\installeddatafiles.zip. + * Remember that most archive types and platform filesystems store their + * filenames in a case-sensitive manner, so you should be careful to specify + * it correctly. + * + * Files opened through PhysicsFS may NOT contain "." or ".." or ":" as dir + * elements. Not only are these meaningless on MacOS Classic and/or Unix, + * they are a security hole. Also, symbolic links (which can be found in + * some archive types and directly in the filesystem on Unix platforms) are + * NOT followed until you call PHYSFS_permitSymbolicLinks(). That's left to + * your own discretion, as following a symlink can allow for access outside + * the write dir and search paths. For portability, there is no mechanism for + * creating new symlinks in PhysicsFS. + * + * The write dir is not included in the search path unless you specifically + * add it. While you CAN change the write dir as many times as you like, + * you should probably set it once and stick to it. Remember that your + * program will not have permission to write in every directory on Unix and + * NT systems. + * + * All files are opened in binary mode; there is no endline conversion for + * textfiles. Other than that, PhysicsFS has some convenience functions for + * platform-independence. There is a function to tell you the current + * platform's dir separator ("\\" on windows, "/" on Unix, ":" on MacOS), + * which is needed only to set up your search/write paths. There is a + * function to tell you what CD-ROM drives contain accessible discs, and a + * function to recommend a good search path, etc. + * + * A recommended order for the search path is the write dir, then the base dir, + * then the cdrom dir, then any archives discovered. Quake 3 does something + * like this, but moves the archives to the start of the search path. Build + * Engine games, like Duke Nukem 3D and Blood, place the archives last, and + * use the base dir for both searching and writing. There is a helper + * function (PHYSFS_setSaneConfig()) that puts together a basic configuration + * for you, based on a few parameters. Also see the comments on + * PHYSFS_getBaseDir(), and PHYSFS_getPrefDir() for info on what those + * are and how they can help you determine an optimal search path. + * + * PhysicsFS 2.0 adds the concept of "mounting" archives to arbitrary points + * in the search path. If a zipfile contains "maps/level.map" and you mount + * that archive at "mods/mymod", then you would have to open + * "mods/mymod/maps/level.map" to access the file, even though "mods/mymod" + * isn't actually specified in the .zip file. Unlike the Unix mentality of + * mounting a filesystem, "mods/mymod" doesn't actually have to exist when + * mounting the zipfile. It's a "virtual" directory. The mounting mechanism + * allows the developer to seperate archives in the tree and avoid trampling + * over files when added new archives, such as including mod support in a + * game...keeping external content on a tight leash in this manner can be of + * utmost importance to some applications. + * + * PhysicsFS is mostly thread safe. The errors returned by + * PHYSFS_getLastErrorCode() are unique by thread, and library-state-setting + * functions are mutex'd. For efficiency, individual file accesses are + * not locked, so you can not safely read/write/seek/close/etc the same + * file from two threads at the same time. Other race conditions are bugs + * that should be reported/patched. + * + * While you CAN use stdio/syscall file access in a program that has PHYSFS_* + * calls, doing so is not recommended, and you can not directly use system + * filehandles with PhysicsFS and vice versa (but as of PhysicsFS 2.1, you + * can wrap them in a PHYSFS_Io interface yourself if you wanted to). + * + * Note that archives need not be named as such: if you have a ZIP file and + * rename it with a .PKG extension, the file will still be recognized as a + * ZIP archive by PhysicsFS; the file's contents are used to determine its + * type where possible. + * + * Currently supported archive types: + * - .ZIP (pkZip/WinZip/Info-ZIP compatible) + * - .7Z (7zip archives) + * - .ISO (ISO9660 files, CD-ROM images) + * - .GRP (Build Engine groupfile archives) + * - .PAK (Quake I/II archive format) + * - .HOG (Descent I/II HOG file archives) + * - .MVL (Descent II movielib archives) + * - .WAD (DOOM engine archives) + * - .VDF (Gothic I/II engine archives) + * - .SLB (Independence War archives) + * + * String policy for PhysicsFS 2.0 and later: + * + * PhysicsFS 1.0 could only deal with null-terminated ASCII strings. All high + * ASCII chars resulted in undefined behaviour, and there was no Unicode + * support at all. PhysicsFS 2.0 supports Unicode without breaking binary + * compatibility with the 1.0 API by using UTF-8 encoding of all strings + * passed in and out of the library. + * + * All strings passed through PhysicsFS are in null-terminated UTF-8 format. + * This means that if all you care about is English (ASCII characters <= 127) + * then you just use regular C strings. If you care about Unicode (and you + * should!) then you need to figure out what your platform wants, needs, and + * offers. If you are on Windows before Win2000 and build with Unicode + * support, your TCHAR strings are two bytes per character (this is called + * "UCS-2 encoding"). Any modern Windows uses UTF-16, which is two bytes + * per character for most characters, but some characters are four. You + * should convert them to UTF-8 before handing them to PhysicsFS with + * PHYSFS_utf8FromUtf16(), which handles both UTF-16 and UCS-2. If you're + * using Unix or Mac OS X, your wchar_t strings are four bytes per character + * ("UCS-4 encoding", sometimes called "UTF-32"). Use PHYSFS_utf8FromUcs4(). + * Mac OS X can give you UTF-8 directly from a CFString or NSString, and many + * Unixes generally give you C strings in UTF-8 format everywhere. If you + * have a single-byte high ASCII charset, like so-many European "codepages" + * you may be out of luck. We'll convert from "Latin1" to UTF-8 only, and + * never back to Latin1. If you're above ASCII 127, all bets are off: move + * to Unicode or use your platform's facilities. Passing a C string with + * high-ASCII data that isn't UTF-8 encoded will NOT do what you expect! + * + * Naturally, there's also PHYSFS_utf8ToUcs2(), PHYSFS_utf8ToUtf16(), and + * PHYSFS_utf8ToUcs4() to get data back into a format you like. Behind the + * scenes, PhysicsFS will use Unicode where possible: the UTF-8 strings on + * Windows will be converted and used with the multibyte Windows APIs, for + * example. + * + * PhysicsFS offers basic encoding conversion support, but not a whole string + * library. Get your stuff into whatever format you can work with. + * + * Most platforms supported by PhysicsFS 2.1 and later fully support Unicode. + * Some older platforms have been dropped (Windows 95, Mac OS 9). Some, like + * OS/2, might be able to convert to a local codepage or will just fail to + * open/create the file. Modern OSes (macOS, Linux, Windows, etc) should all + * be fine. + * + * Many game-specific archivers are seriously unprepared for Unicode (the + * Descent HOG/MVL and Build Engine GRP archivers, for example, only offer a + * DOS 8.3 filename, for example). Nothing can be done for these, but they + * tend to be legacy formats for existing content that was all ASCII (and + * thus, valid UTF-8) anyhow. Other formats, like .ZIP, don't explicitly + * offer Unicode support, but unofficially expect filenames to be UTF-8 + * encoded, and thus Just Work. Most everything does the right thing without + * bothering you, but it's good to be aware of these nuances in case they + * don't. + * + * + * Other stuff: + * + * Please see the file LICENSE.txt in the source's root directory for + * licensing and redistribution rights. + * + * Please see the file CREDITS.txt in the source's "docs" directory for + * a more or less complete list of who's responsible for this. + * + * \author Ryan C. Gordon. + */ + +#ifndef _INCLUDE_PHYSFS_H_ +#define _INCLUDE_PHYSFS_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#if defined(PHYSFS_DECL) +/* do nothing. */ +#elif defined(_MSC_VER) +#define PHYSFS_DECL __declspec(dllexport) +#elif defined(__SUNPRO_C) +#define PHYSFS_DECL __global +#elif ((__GNUC__ >= 3) && (!defined(__EMX__)) && (!defined(sun))) +#define PHYSFS_DECL __attribute__((visibility("default"))) +#else +#define PHYSFS_DECL +#endif + +#if defined(PHYSFS_DEPRECATED) +/* do nothing. */ +#elif (__GNUC__ >= 4) /* technically, this arrived in gcc 3.1, but oh well. */ +#define PHYSFS_DEPRECATED __attribute__((deprecated)) +#else +#define PHYSFS_DEPRECATED +#endif + +#if 0 /* !!! FIXME: look into this later. */ +#if defined(PHYSFS_CALL) +/* do nothing. */ +#elif defined(__WIN32__) && !defined(__GNUC__) +#define PHYSFS_CALL __cdecl +#elif defined(__OS2__) || defined(OS2) /* should work across all compilers. */ +#define PHYSFS_CALL _System +#else +#define PHYSFS_CALL +#endif +#endif + +/** + * \typedef PHYSFS_uint8 + * \brief An unsigned, 8-bit integer type. + */ +typedef unsigned char PHYSFS_uint8; + +/** + * \typedef PHYSFS_sint8 + * \brief A signed, 8-bit integer type. + */ +typedef signed char PHYSFS_sint8; + +/** + * \typedef PHYSFS_uint16 + * \brief An unsigned, 16-bit integer type. + */ +typedef unsigned short PHYSFS_uint16; + +/** + * \typedef PHYSFS_sint16 + * \brief A signed, 16-bit integer type. + */ +typedef signed short PHYSFS_sint16; + +/** + * \typedef PHYSFS_uint32 + * \brief An unsigned, 32-bit integer type. + */ +typedef unsigned int PHYSFS_uint32; + +/** + * \typedef PHYSFS_sint32 + * \brief A signed, 32-bit integer type. + */ +typedef signed int PHYSFS_sint32; + +/** + * \typedef PHYSFS_uint64 + * \brief An unsigned, 64-bit integer type. + * \warning on platforms without any sort of 64-bit datatype, this is + * equivalent to PHYSFS_uint32! + */ + +/** + * \typedef PHYSFS_sint64 + * \brief A signed, 64-bit integer type. + * \warning on platforms without any sort of 64-bit datatype, this is + * equivalent to PHYSFS_sint32! + */ + + +#if (defined PHYSFS_NO_64BIT_SUPPORT) /* oh well. */ +typedef PHYSFS_uint32 PHYSFS_uint64; +typedef PHYSFS_sint32 PHYSFS_sint64; +#elif (defined _MSC_VER) +typedef signed __int64 PHYSFS_sint64; +typedef unsigned __int64 PHYSFS_uint64; +#else +typedef unsigned long long PHYSFS_uint64; +typedef signed long long PHYSFS_sint64; +#endif + + +#ifndef DOXYGEN_SHOULD_IGNORE_THIS +/* Make sure the types really have the right sizes */ +#define PHYSFS_COMPILE_TIME_ASSERT(name, x) \ + typedef int PHYSFS_compile_time_assert_##name[(x) * 2 - 1] + +PHYSFS_COMPILE_TIME_ASSERT(uint8IsOneByte, sizeof(PHYSFS_uint8) == 1); +PHYSFS_COMPILE_TIME_ASSERT(sint8IsOneByte, sizeof(PHYSFS_sint8) == 1); +PHYSFS_COMPILE_TIME_ASSERT(uint16IsTwoBytes, sizeof(PHYSFS_uint16) == 2); +PHYSFS_COMPILE_TIME_ASSERT(sint16IsTwoBytes, sizeof(PHYSFS_sint16) == 2); +PHYSFS_COMPILE_TIME_ASSERT(uint32IsFourBytes, sizeof(PHYSFS_uint32) == 4); +PHYSFS_COMPILE_TIME_ASSERT(sint32IsFourBytes, sizeof(PHYSFS_sint32) == 4); + +#ifndef PHYSFS_NO_64BIT_SUPPORT +PHYSFS_COMPILE_TIME_ASSERT(uint64IsEightBytes, sizeof(PHYSFS_uint64) == 8); +PHYSFS_COMPILE_TIME_ASSERT(sint64IsEightBytes, sizeof(PHYSFS_sint64) == 8); +#endif + +#undef PHYSFS_COMPILE_TIME_ASSERT + +#endif /* DOXYGEN_SHOULD_IGNORE_THIS */ + + +/** + * \struct PHYSFS_File + * \brief A PhysicsFS file handle. + * + * You get a pointer to one of these when you open a file for reading, + * writing, or appending via PhysicsFS. + * + * As you can see from the lack of meaningful fields, you should treat this + * as opaque data. Don't try to manipulate the file handle, just pass the + * pointer you got, unmolested, to various PhysicsFS APIs. + * + * \sa PHYSFS_openRead + * \sa PHYSFS_openWrite + * \sa PHYSFS_openAppend + * \sa PHYSFS_close + * \sa PHYSFS_read + * \sa PHYSFS_write + * \sa PHYSFS_seek + * \sa PHYSFS_tell + * \sa PHYSFS_eof + * \sa PHYSFS_setBuffer + * \sa PHYSFS_flush + */ +typedef struct PHYSFS_File +{ + void *opaque; /**< That's all you get. Don't touch. */ +} PHYSFS_File; + + +/** + * \def PHYSFS_file + * \brief 1.0 API compatibility define. + * + * PHYSFS_file is identical to PHYSFS_File. This #define is here for backwards + * compatibility with the 1.0 API, which had an inconsistent capitalization + * convention in this case. New code should use PHYSFS_File, as this #define + * may go away someday. + * + * \sa PHYSFS_File + */ +#define PHYSFS_file PHYSFS_File + + +/** + * \struct PHYSFS_ArchiveInfo + * \brief Information on various PhysicsFS-supported archives. + * + * This structure gives you details on what sort of archives are supported + * by this implementation of PhysicsFS. Archives tend to be things like + * ZIP files and such. + * + * \warning Not all binaries are created equal! PhysicsFS can be built with + * or without support for various archives. You can check with + * PHYSFS_supportedArchiveTypes() to see if your archive type is + * supported. + * + * \sa PHYSFS_supportedArchiveTypes + * \sa PHYSFS_registerArchiver + * \sa PHYSFS_deregisterArchiver + */ +typedef struct PHYSFS_ArchiveInfo +{ + const char *extension; /**< Archive file extension: "ZIP", for example. */ + const char *description; /**< Human-readable archive description. */ + const char *author; /**< Person who did support for this archive. */ + const char *url; /**< URL related to this archive */ + int supportsSymlinks; /**< non-zero if archive offers symbolic links. */ +} PHYSFS_ArchiveInfo; + + +/** + * \struct PHYSFS_Version + * \brief Information the version of PhysicsFS in use. + * + * Represents the library's version as three levels: major revision + * (increments with massive changes, additions, and enhancements), + * minor revision (increments with backwards-compatible changes to the + * major revision), and patchlevel (increments with fixes to the minor + * revision). + * + * \sa PHYSFS_VERSION + * \sa PHYSFS_getLinkedVersion + */ +typedef struct PHYSFS_Version +{ + PHYSFS_uint8 major; /**< major revision */ + PHYSFS_uint8 minor; /**< minor revision */ + PHYSFS_uint8 patch; /**< patchlevel */ +} PHYSFS_Version; + + +#ifndef DOXYGEN_SHOULD_IGNORE_THIS +#define PHYSFS_VER_MAJOR 3 +#define PHYSFS_VER_MINOR 0 +#define PHYSFS_VER_PATCH 2 +#endif /* DOXYGEN_SHOULD_IGNORE_THIS */ + + +/* PhysicsFS state stuff ... */ + +/** + * \def PHYSFS_VERSION(x) + * \brief Macro to determine PhysicsFS version program was compiled against. + * + * This macro fills in a PHYSFS_Version structure with the version of the + * library you compiled against. This is determined by what header the + * compiler uses. Note that if you dynamically linked the library, you might + * have a slightly newer or older version at runtime. That version can be + * determined with PHYSFS_getLinkedVersion(), which, unlike PHYSFS_VERSION, + * is not a macro. + * + * \param x A pointer to a PHYSFS_Version struct to initialize. + * + * \sa PHYSFS_Version + * \sa PHYSFS_getLinkedVersion + */ +#define PHYSFS_VERSION(x) \ +{ \ + (x)->major = PHYSFS_VER_MAJOR; \ + (x)->minor = PHYSFS_VER_MINOR; \ + (x)->patch = PHYSFS_VER_PATCH; \ +} + + +/** + * \fn void PHYSFS_getLinkedVersion(PHYSFS_Version *ver) + * \brief Get the version of PhysicsFS that is linked against your program. + * + * If you are using a shared library (DLL) version of PhysFS, then it is + * possible that it will be different than the version you compiled against. + * + * This is a real function; the macro PHYSFS_VERSION tells you what version + * of PhysFS you compiled against: + * + * \code + * PHYSFS_Version compiled; + * PHYSFS_Version linked; + * + * PHYSFS_VERSION(&compiled); + * PHYSFS_getLinkedVersion(&linked); + * printf("We compiled against PhysFS version %d.%d.%d ...\n", + * compiled.major, compiled.minor, compiled.patch); + * printf("But we linked against PhysFS version %d.%d.%d.\n", + * linked.major, linked.minor, linked.patch); + * \endcode + * + * This function may be called safely at any time, even before PHYSFS_init(). + * + * \sa PHYSFS_VERSION + */ +PHYSFS_DECL void PHYSFS_getLinkedVersion(PHYSFS_Version *ver); + + +/** + * \fn int PHYSFS_init(const char *argv0) + * \brief Initialize the PhysicsFS library. + * + * This must be called before any other PhysicsFS function. + * + * This should be called prior to any attempts to change your process's + * current working directory. + * + * \param argv0 the argv[0] string passed to your program's mainline. + * This may be NULL on most platforms (such as ones without a + * standard main() function), but you should always try to pass + * something in here. Unix-like systems such as Linux _need_ to + * pass argv[0] from main() in here. + * \return nonzero on success, zero on error. Specifics of the error can be + * gleaned from PHYSFS_getLastError(). + * + * \sa PHYSFS_deinit + * \sa PHYSFS_isInit + */ +PHYSFS_DECL int PHYSFS_init(const char *argv0); + + +/** + * \fn int PHYSFS_deinit(void) + * \brief Deinitialize the PhysicsFS library. + * + * This closes any files opened via PhysicsFS, blanks the search/write paths, + * frees memory, and invalidates all of your file handles. + * + * Note that this call can FAIL if there's a file open for writing that + * refuses to close (for example, the underlying operating system was + * buffering writes to network filesystem, and the fileserver has crashed, + * or a hard drive has failed, etc). It is usually best to close all write + * handles yourself before calling this function, so that you can gracefully + * handle a specific failure. + * + * Once successfully deinitialized, PHYSFS_init() can be called again to + * restart the subsystem. All default API states are restored at this + * point, with the exception of any custom allocator you might have + * specified, which survives between initializations. + * + * \return nonzero on success, zero on error. Specifics of the error can be + * gleaned from PHYSFS_getLastError(). If failure, state of PhysFS is + * undefined, and probably badly screwed up. + * + * \sa PHYSFS_init + * \sa PHYSFS_isInit + */ +PHYSFS_DECL int PHYSFS_deinit(void); + + +/** + * \fn const PHYSFS_ArchiveInfo **PHYSFS_supportedArchiveTypes(void) + * \brief Get a list of supported archive types. + * + * Get a list of archive types supported by this implementation of PhysicFS. + * These are the file formats usable for search path entries. This is for + * informational purposes only. Note that the extension listed is merely + * convention: if we list "ZIP", you can open a PkZip-compatible archive + * with an extension of "XYZ", if you like. + * + * The returned value is an array of pointers to PHYSFS_ArchiveInfo structures, + * with a NULL entry to signify the end of the list: + * + * \code + * PHYSFS_ArchiveInfo **i; + * + * for (i = PHYSFS_supportedArchiveTypes(); *i != NULL; i++) + * { + * printf("Supported archive: [%s], which is [%s].\n", + * (*i)->extension, (*i)->description); + * } + * \endcode + * + * The return values are pointers to internal memory, and should + * be considered READ ONLY, and never freed. The returned values are + * valid until the next call to PHYSFS_deinit(), PHYSFS_registerArchiver(), + * or PHYSFS_deregisterArchiver(). + * + * \return READ ONLY Null-terminated array of READ ONLY structures. + * + * \sa PHYSFS_registerArchiver + * \sa PHYSFS_deregisterArchiver + */ +PHYSFS_DECL const PHYSFS_ArchiveInfo **PHYSFS_supportedArchiveTypes(void); + + +/** + * \fn void PHYSFS_freeList(void *listVar) + * \brief Deallocate resources of lists returned by PhysicsFS. + * + * Certain PhysicsFS functions return lists of information that are + * dynamically allocated. Use this function to free those resources. + * + * It is safe to pass a NULL here, but doing so will cause a crash in versions + * before PhysicsFS 2.1.0. + * + * \param listVar List of information specified as freeable by this function. + * Passing NULL is safe; it is a valid no-op. + * + * \sa PHYSFS_getCdRomDirs + * \sa PHYSFS_enumerateFiles + * \sa PHYSFS_getSearchPath + */ +PHYSFS_DECL void PHYSFS_freeList(void *listVar); + + +/** + * \fn const char *PHYSFS_getLastError(void) + * \brief Get human-readable error information. + * + * \deprecated Use PHYSFS_getLastErrorCode() and PHYSFS_getErrorByCode() instead. + * + * \warning As of PhysicsFS 2.1, this function has been nerfed. + * Before PhysicsFS 2.1, this function was the only way to get + * error details beyond a given function's basic return value. + * This was meant to be a human-readable string in one of several + * languages, and was not useful for application parsing. This was + * a problem, because the developer and not the user chose the + * language at compile time, and the PhysicsFS maintainers had + * to (poorly) maintain a significant amount of localization work. + * The app couldn't parse the strings, even if they counted on a + * specific language, since some were dynamically generated. + * In 2.1 and later, this always returns a static string in + * English; you may use it as a key string for your own + * localizations if you like, as we'll promise not to change + * existing error strings. Also, if your application wants to + * look at specific errors, we now offer a better option: + * use PHYSFS_getLastErrorCode() instead. + * + * Get the last PhysicsFS error message as a human-readable, null-terminated + * string. This will return NULL if there's been no error since the last call + * to this function. The pointer returned by this call points to an internal + * buffer. Each thread has a unique error state associated with it, but each + * time a new error message is set, it will overwrite the previous one + * associated with that thread. It is safe to call this function at anytime, + * even before PHYSFS_init(). + * + * PHYSFS_getLastError() and PHYSFS_getLastErrorCode() both reset the same + * thread-specific error state. Calling one will wipe out the other's + * data. If you need both, call PHYSFS_getLastErrorCode(), then pass that + * value to PHYSFS_getErrorByCode(). + * + * As of PhysicsFS 2.1, this function only presents text in the English + * language, but the strings are static, so you can use them as keys into + * your own localization dictionary. These strings are meant to be passed on + * directly to the user. + * + * Generally, applications should only concern themselves with whether a + * given function failed; however, if your code require more specifics, you + * should use PHYSFS_getLastErrorCode() instead of this function. + * + * \return READ ONLY string of last error message. + * + * \sa PHYSFS_getLastErrorCode + * \sa PHYSFS_getErrorByCode + */ +PHYSFS_DECL const char *PHYSFS_getLastError(void) PHYSFS_DEPRECATED; + + +/** + * \fn const char *PHYSFS_getDirSeparator(void) + * \brief Get platform-dependent dir separator string. + * + * This returns "\\" on win32, "/" on Unix, and ":" on MacOS. It may be more + * than one character, depending on the platform, and your code should take + * that into account. Note that this is only useful for setting up the + * search/write paths, since access into those dirs always use '/' + * (platform-independent notation) to separate directories. This is also + * handy for getting platform-independent access when using stdio calls. + * + * \return READ ONLY null-terminated string of platform's dir separator. + */ +PHYSFS_DECL const char *PHYSFS_getDirSeparator(void); + + +/** + * \fn void PHYSFS_permitSymbolicLinks(int allow) + * \brief Enable or disable following of symbolic links. + * + * Some physical filesystems and archives contain files that are just pointers + * to other files. On the physical filesystem, opening such a link will + * (transparently) open the file that is pointed to. + * + * By default, PhysicsFS will check if a file is really a symlink during open + * calls and fail if it is. Otherwise, the link could take you outside the + * write and search paths, and compromise security. + * + * If you want to take that risk, call this function with a non-zero parameter. + * Note that this is more for sandboxing a program's scripting language, in + * case untrusted scripts try to compromise the system. Generally speaking, + * a user could very well have a legitimate reason to set up a symlink, so + * unless you feel there's a specific danger in allowing them, you should + * permit them. + * + * Symlinks are only explicitly checked when dealing with filenames + * in platform-independent notation. That is, when setting up your + * search and write paths, etc, symlinks are never checked for. + * + * Please note that PHYSFS_stat() will always check the path specified; if + * that path is a symlink, it will not be followed in any case. If symlinks + * aren't permitted through this function, PHYSFS_stat() ignores them, and + * would treat the query as if the path didn't exist at all. + * + * Symbolic link permission can be enabled or disabled at any time after + * you've called PHYSFS_init(), and is disabled by default. + * + * \param allow nonzero to permit symlinks, zero to deny linking. + * + * \sa PHYSFS_symbolicLinksPermitted + */ +PHYSFS_DECL void PHYSFS_permitSymbolicLinks(int allow); + + +/** + * \fn char **PHYSFS_getCdRomDirs(void) + * \brief Get an array of paths to available CD-ROM drives. + * + * The dirs returned are platform-dependent ("D:\" on Win32, "/cdrom" or + * whatnot on Unix). Dirs are only returned if there is a disc ready and + * accessible in the drive. So if you've got two drives (D: and E:), and only + * E: has a disc in it, then that's all you get. If the user inserts a disc + * in D: and you call this function again, you get both drives. If, on a + * Unix box, the user unmounts a disc and remounts it elsewhere, the next + * call to this function will reflect that change. + * + * This function refers to "CD-ROM" media, but it really means "inserted disc + * media," such as DVD-ROM, HD-DVD, CDRW, and Blu-Ray discs. It looks for + * filesystems, and as such won't report an audio CD, unless there's a + * mounted filesystem track on it. + * + * The returned value is an array of strings, with a NULL entry to signify the + * end of the list: + * + * \code + * char **cds = PHYSFS_getCdRomDirs(); + * char **i; + * + * for (i = cds; *i != NULL; i++) + * printf("cdrom dir [%s] is available.\n", *i); + * + * PHYSFS_freeList(cds); + * \endcode + * + * This call may block while drives spin up. Be forewarned. + * + * When you are done with the returned information, you may dispose of the + * resources by calling PHYSFS_freeList() with the returned pointer. + * + * \return Null-terminated array of null-terminated strings. + * + * \sa PHYSFS_getCdRomDirsCallback + */ +PHYSFS_DECL char **PHYSFS_getCdRomDirs(void); + + +/** + * \fn const char *PHYSFS_getBaseDir(void) + * \brief Get the path where the application resides. + * + * Helper function. + * + * Get the "base dir". This is the directory where the application was run + * from, which is probably the installation directory, and may or may not + * be the process's current working directory. + * + * You should probably use the base dir in your search path. + * + * \return READ ONLY string of base dir in platform-dependent notation. + * + * \sa PHYSFS_getPrefDir + */ +PHYSFS_DECL const char *PHYSFS_getBaseDir(void); + + +/** + * \fn const char *PHYSFS_getUserDir(void) + * \brief Get the path where user's home directory resides. + * + * \deprecated As of PhysicsFS 2.1, you probably want PHYSFS_getPrefDir(). + * + * Helper function. + * + * Get the "user dir". This is meant to be a suggestion of where a specific + * user of the system can store files. On Unix, this is her home directory. + * On systems with no concept of multiple home directories (MacOS, win95), + * this will default to something like "C:\mybasedir\users\username" + * where "username" will either be the login name, or "default" if the + * platform doesn't support multiple users, either. + * + * \return READ ONLY string of user dir in platform-dependent notation. + * + * \sa PHYSFS_getBaseDir + * \sa PHYSFS_getPrefDir + */ +PHYSFS_DECL const char *PHYSFS_getUserDir(void) PHYSFS_DEPRECATED; + + +/** + * \fn const char *PHYSFS_getWriteDir(void) + * \brief Get path where PhysicsFS will allow file writing. + * + * Get the current write dir. The default write dir is NULL. + * + * \return READ ONLY string of write dir in platform-dependent notation, + * OR NULL IF NO WRITE PATH IS CURRENTLY SET. + * + * \sa PHYSFS_setWriteDir + */ +PHYSFS_DECL const char *PHYSFS_getWriteDir(void); + + +/** + * \fn int PHYSFS_setWriteDir(const char *newDir) + * \brief Tell PhysicsFS where it may write files. + * + * Set a new write dir. This will override the previous setting. + * + * This call will fail (and fail to change the write dir) if the current + * write dir still has files open in it. + * + * \param newDir The new directory to be the root of the write dir, + * specified in platform-dependent notation. Setting to NULL + * disables the write dir, so no files can be opened for + * writing via PhysicsFS. + * \return non-zero on success, zero on failure. All attempts to open a file + * for writing via PhysicsFS will fail until this call succeeds. + * Use PHYSFS_getLastErrorCode() to obtain the specific error. + * + * \sa PHYSFS_getWriteDir + */ +PHYSFS_DECL int PHYSFS_setWriteDir(const char *newDir); + + +/** + * \fn int PHYSFS_addToSearchPath(const char *newDir, int appendToPath) + * \brief Add an archive or directory to the search path. + * + * \deprecated As of PhysicsFS 2.0, use PHYSFS_mount() instead. This + * function just wraps it anyhow. + * + * This function is equivalent to: + * + * \code + * PHYSFS_mount(newDir, NULL, appendToPath); + * \endcode + * + * You must use this and not PHYSFS_mount if binary compatibility with + * PhysicsFS 1.0 is important (which it may not be for many people). + * + * \sa PHYSFS_mount + * \sa PHYSFS_removeFromSearchPath + * \sa PHYSFS_getSearchPath + */ +PHYSFS_DECL int PHYSFS_addToSearchPath(const char *newDir, int appendToPath) + PHYSFS_DEPRECATED; + +/** + * \fn int PHYSFS_removeFromSearchPath(const char *oldDir) + * \brief Remove a directory or archive from the search path. + * + * \deprecated As of PhysicsFS 2.1, use PHYSFS_unmount() instead. This + * function just wraps it anyhow. There's no functional difference + * except the vocabulary changed from "adding to the search path" + * to "mounting" when that functionality was extended, and thus + * the preferred way to accomplish this function's work is now + * called "unmounting." + * + * This function is equivalent to: + * + * \code + * PHYSFS_unmount(oldDir); + * \endcode + * + * You must use this and not PHYSFS_unmount if binary compatibility with + * PhysicsFS 1.0 is important (which it may not be for many people). + * + * \sa PHYSFS_addToSearchPath + * \sa PHYSFS_getSearchPath + * \sa PHYSFS_unmount + */ +PHYSFS_DECL int PHYSFS_removeFromSearchPath(const char *oldDir) + PHYSFS_DEPRECATED; + + +/** + * \fn char **PHYSFS_getSearchPath(void) + * \brief Get the current search path. + * + * The default search path is an empty list. + * + * The returned value is an array of strings, with a NULL entry to signify the + * end of the list: + * + * \code + * char **i; + * + * for (i = PHYSFS_getSearchPath(); *i != NULL; i++) + * printf("[%s] is in the search path.\n", *i); + * \endcode + * + * When you are done with the returned information, you may dispose of the + * resources by calling PHYSFS_freeList() with the returned pointer. + * + * \return Null-terminated array of null-terminated strings. NULL if there + * was a problem (read: OUT OF MEMORY). + * + * \sa PHYSFS_getSearchPathCallback + * \sa PHYSFS_addToSearchPath + * \sa PHYSFS_removeFromSearchPath + */ +PHYSFS_DECL char **PHYSFS_getSearchPath(void); + + +/** + * \fn int PHYSFS_setSaneConfig(const char *organization, const char *appName, const char *archiveExt, int includeCdRoms, int archivesFirst) + * \brief Set up sane, default paths. + * + * Helper function. + * + * The write dir will be set to the pref dir returned by + * \code PHYSFS_getPrefDir(organization, appName) \endcode, which is + * created if it doesn't exist. + * + * The above is sufficient to make sure your program's configuration directory + * is separated from other clutter, and platform-independent. + * + * The search path will be: + * + * - The Write Dir (created if it doesn't exist) + * - The Base Dir (PHYSFS_getBaseDir()) + * - All found CD-ROM dirs (optionally) + * + * These directories are then searched for files ending with the extension + * (archiveExt), which, if they are valid and supported archives, will also + * be added to the search path. If you specified "PKG" for (archiveExt), and + * there's a file named data.PKG in the base dir, it'll be checked. Archives + * can either be appended or prepended to the search path in alphabetical + * order, regardless of which directories they were found in. All archives + * are mounted in the root of the virtual file system ("/"). + * + * All of this can be accomplished from the application, but this just does it + * all for you. Feel free to add more to the search path manually, too. + * + * \param organization Name of your company/group/etc to be used as a + * dirname, so keep it small, and no-frills. + * + * \param appName Program-specific name of your program, to separate it + * from other programs using PhysicsFS. + * + * \param archiveExt File extension used by your program to specify an + * archive. For example, Quake 3 uses "pk3", even though + * they are just zipfiles. Specify NULL to not dig out + * archives automatically. Do not specify the '.' char; + * If you want to look for ZIP files, specify "ZIP" and + * not ".ZIP" ... the archive search is case-insensitive. + * + * \param includeCdRoms Non-zero to include CD-ROMs in the search path, and + * (if (archiveExt) != NULL) search them for archives. + * This may cause a significant amount of blocking + * while discs are accessed, and if there are no discs + * in the drive (or even not mounted on Unix systems), + * then they may not be made available anyhow. You may + * want to specify zero and handle the disc setup + * yourself. + * + * \param archivesFirst Non-zero to prepend the archives to the search path. + * Zero to append them. Ignored if !(archiveExt). + * + * \return nonzero on success, zero on error. Use PHYSFS_getLastErrorCode() + * to obtain the specific error. + */ +PHYSFS_DECL int PHYSFS_setSaneConfig(const char *organization, + const char *appName, + const char *archiveExt, + int includeCdRoms, + int archivesFirst); + + +/* Directory management stuff ... */ + +/** + * \fn int PHYSFS_mkdir(const char *dirName) + * \brief Create a directory. + * + * This is specified in platform-independent notation in relation to the + * write dir. All missing parent directories are also created if they + * don't exist. + * + * So if you've got the write dir set to "C:\mygame\writedir" and call + * PHYSFS_mkdir("downloads/maps") then the directories + * "C:\mygame\writedir\downloads" and "C:\mygame\writedir\downloads\maps" + * will be created if possible. If the creation of "maps" fails after we + * have successfully created "downloads", then the function leaves the + * created directory behind and reports failure. + * + * \param dirName New dir to create. + * \return nonzero on success, zero on error. Use + * PHYSFS_getLastErrorCode() to obtain the specific error. + * + * \sa PHYSFS_delete + */ +PHYSFS_DECL int PHYSFS_mkdir(const char *dirName); + + +/** + * \fn int PHYSFS_delete(const char *filename) + * \brief Delete a file or directory. + * + * (filename) is specified in platform-independent notation in relation to the + * write dir. + * + * A directory must be empty before this call can delete it. + * + * Deleting a symlink will remove the link, not what it points to, regardless + * of whether you "permitSymLinks" or not. + * + * So if you've got the write dir set to "C:\mygame\writedir" and call + * PHYSFS_delete("downloads/maps/level1.map") then the file + * "C:\mygame\writedir\downloads\maps\level1.map" is removed from the + * physical filesystem, if it exists and the operating system permits the + * deletion. + * + * Note that on Unix systems, deleting a file may be successful, but the + * actual file won't be removed until all processes that have an open + * filehandle to it (including your program) close their handles. + * + * Chances are, the bits that make up the file still exist, they are just + * made available to be written over at a later point. Don't consider this + * a security method or anything. :) + * + * \param filename Filename to delete. + * \return nonzero on success, zero on error. Use PHYSFS_getLastErrorCode() + * to obtain the specific error. + */ +PHYSFS_DECL int PHYSFS_delete(const char *filename); + + +/** + * \fn const char *PHYSFS_getRealDir(const char *filename) + * \brief Figure out where in the search path a file resides. + * + * The file is specified in platform-independent notation. The returned + * filename will be the element of the search path where the file was found, + * which may be a directory, or an archive. Even if there are multiple + * matches in different parts of the search path, only the first one found + * is used, just like when opening a file. + * + * So, if you look for "maps/level1.map", and C:\\mygame is in your search + * path and C:\\mygame\\maps\\level1.map exists, then "C:\mygame" is returned. + * + * If a any part of a match is a symbolic link, and you've not explicitly + * permitted symlinks, then it will be ignored, and the search for a match + * will continue. + * + * If you specify a fake directory that only exists as a mount point, it'll + * be associated with the first archive mounted there, even though that + * directory isn't necessarily contained in a real archive. + * + * \warning This will return NULL if there is no real directory associated + * with (filename). Specifically, PHYSFS_mountIo(), + * PHYSFS_mountMemory(), and PHYSFS_mountHandle() will return NULL + * even if the filename is found in the search path. Plan accordingly. + * + * \param filename file to look for. + * \return READ ONLY string of element of search path containing the + * the file in question. NULL if not found. + */ +PHYSFS_DECL const char *PHYSFS_getRealDir(const char *filename); + + +/** + * \fn char **PHYSFS_enumerateFiles(const char *dir) + * \brief Get a file listing of a search path's directory. + * + * \warning In PhysicsFS versions prior to 2.1, this function would return + * as many items as it could in the face of a failure condition + * (out of memory, disk i/o error, etc). Since this meant apps + * couldn't distinguish between complete success and partial failure, + * and since the function could always return NULL to report + * catastrophic failures anyway, in PhysicsFS 2.1 this function's + * policy changed: it will either return a list of complete results + * or it will return NULL for any failure of any kind, so we can + * guarantee that the enumeration ran to completion and has no gaps + * in its results. + * + * Matching directories are interpolated. That is, if "C:\mydir" is in the + * search path and contains a directory "savegames" that contains "x.sav", + * "y.sav", and "z.sav", and there is also a "C:\userdir" in the search path + * that has a "savegames" subdirectory with "w.sav", then the following code: + * + * \code + * char **rc = PHYSFS_enumerateFiles("savegames"); + * char **i; + * + * for (i = rc; *i != NULL; i++) + * printf(" * We've got [%s].\n", *i); + * + * PHYSFS_freeList(rc); + * \endcode + * + * \...will print: + * + * \verbatim + * We've got [x.sav]. + * We've got [y.sav]. + * We've got [z.sav]. + * We've got [w.sav].\endverbatim + * + * Feel free to sort the list however you like. However, the returned data + * will always contain no duplicates, and will be always sorted in alphabetic + * (rather: case-sensitive Unicode) order for you. + * + * Don't forget to call PHYSFS_freeList() with the return value from this + * function when you are done with it. + * + * \param dir directory in platform-independent notation to enumerate. + * \return Null-terminated array of null-terminated strings, or NULL for + * failure cases. + * + * \sa PHYSFS_enumerate + */ +PHYSFS_DECL char **PHYSFS_enumerateFiles(const char *dir); + + +/** + * \fn int PHYSFS_exists(const char *fname) + * \brief Determine if a file exists in the search path. + * + * Reports true if there is an entry anywhere in the search path by the + * name of (fname). + * + * Note that entries that are symlinks are ignored if + * PHYSFS_permitSymbolicLinks(1) hasn't been called, so you + * might end up further down in the search path than expected. + * + * \param fname filename in platform-independent notation. + * \return non-zero if filename exists. zero otherwise. + */ +PHYSFS_DECL int PHYSFS_exists(const char *fname); + + +/** + * \fn int PHYSFS_isDirectory(const char *fname) + * \brief Determine if a file in the search path is really a directory. + * + * \deprecated As of PhysicsFS 2.1, use PHYSFS_stat() instead. This + * function just wraps it anyhow. + * + * Determine if the first occurence of (fname) in the search path is + * really a directory entry. + * + * Note that entries that are symlinks are ignored if + * PHYSFS_permitSymbolicLinks(1) hasn't been called, so you + * might end up further down in the search path than expected. + * + * \param fname filename in platform-independent notation. + * \return non-zero if filename exists and is a directory. zero otherwise. + * + * \sa PHYSFS_stat + * \sa PHYSFS_exists + */ +PHYSFS_DECL int PHYSFS_isDirectory(const char *fname) PHYSFS_DEPRECATED; + + +/** + * \fn int PHYSFS_isSymbolicLink(const char *fname) + * \brief Determine if a file in the search path is really a symbolic link. + * + * \deprecated As of PhysicsFS 2.1, use PHYSFS_stat() instead. This + * function just wraps it anyhow. + * + * Determine if the first occurence of (fname) in the search path is + * really a symbolic link. + * + * Note that entries that are symlinks are ignored if + * PHYSFS_permitSymbolicLinks(1) hasn't been called, and as such, + * this function will always return 0 in that case. + * + * \param fname filename in platform-independent notation. + * \return non-zero if filename exists and is a symlink. zero otherwise. + * + * \sa PHYSFS_stat + * \sa PHYSFS_exists + */ +PHYSFS_DECL int PHYSFS_isSymbolicLink(const char *fname) PHYSFS_DEPRECATED; + + +/** + * \fn PHYSFS_sint64 PHYSFS_getLastModTime(const char *filename) + * \brief Get the last modification time of a file. + * + * \deprecated As of PhysicsFS 2.1, use PHYSFS_stat() instead. This + * function just wraps it anyhow. + * + * The modtime is returned as a number of seconds since the Unix epoch + * (midnight, Jan 1, 1970). The exact derivation and accuracy of this time + * depends on the particular archiver. If there is no reasonable way to + * obtain this information for a particular archiver, or there was some sort + * of error, this function returns (-1). + * + * You must use this and not PHYSFS_stat() if binary compatibility with + * PhysicsFS 2.0 is important (which it may not be for many people). + * + * \param filename filename to check, in platform-independent notation. + * \return last modified time of the file. -1 if it can't be determined. + * + * \sa PHYSFS_stat + */ +PHYSFS_DECL PHYSFS_sint64 PHYSFS_getLastModTime(const char *filename) + PHYSFS_DEPRECATED; + + +/* i/o stuff... */ + +/** + * \fn PHYSFS_File *PHYSFS_openWrite(const char *filename) + * \brief Open a file for writing. + * + * Open a file for writing, in platform-independent notation and in relation + * to the write dir as the root of the writable filesystem. The specified + * file is created if it doesn't exist. If it does exist, it is truncated to + * zero bytes, and the writing offset is set to the start. + * + * Note that entries that are symlinks are ignored if + * PHYSFS_permitSymbolicLinks(1) hasn't been called, and opening a + * symlink with this function will fail in such a case. + * + * \param filename File to open. + * \return A valid PhysicsFS filehandle on success, NULL on error. Use + * PHYSFS_getLastErrorCode() to obtain the specific error. + * + * \sa PHYSFS_openRead + * \sa PHYSFS_openAppend + * \sa PHYSFS_write + * \sa PHYSFS_close + */ +PHYSFS_DECL PHYSFS_File *PHYSFS_openWrite(const char *filename); + + +/** + * \fn PHYSFS_File *PHYSFS_openAppend(const char *filename) + * \brief Open a file for appending. + * + * Open a file for writing, in platform-independent notation and in relation + * to the write dir as the root of the writable filesystem. The specified + * file is created if it doesn't exist. If it does exist, the writing offset + * is set to the end of the file, so the first write will be the byte after + * the end. + * + * Note that entries that are symlinks are ignored if + * PHYSFS_permitSymbolicLinks(1) hasn't been called, and opening a + * symlink with this function will fail in such a case. + * + * \param filename File to open. + * \return A valid PhysicsFS filehandle on success, NULL on error. Use + * PHYSFS_getLastErrorCode() to obtain the specific error. + * + * \sa PHYSFS_openRead + * \sa PHYSFS_openWrite + * \sa PHYSFS_write + * \sa PHYSFS_close + */ +PHYSFS_DECL PHYSFS_File *PHYSFS_openAppend(const char *filename); + + +/** + * \fn PHYSFS_File *PHYSFS_openRead(const char *filename) + * \brief Open a file for reading. + * + * Open a file for reading, in platform-independent notation. The search path + * is checked one at a time until a matching file is found, in which case an + * abstract filehandle is associated with it, and reading may be done. + * The reading offset is set to the first byte of the file. + * + * Note that entries that are symlinks are ignored if + * PHYSFS_permitSymbolicLinks(1) hasn't been called, and opening a + * symlink with this function will fail in such a case. + * + * \param filename File to open. + * \return A valid PhysicsFS filehandle on success, NULL on error. + * Use PHYSFS_getLastErrorCode() to obtain the specific error. + * + * \sa PHYSFS_openWrite + * \sa PHYSFS_openAppend + * \sa PHYSFS_read + * \sa PHYSFS_close + */ +PHYSFS_DECL PHYSFS_File *PHYSFS_openRead(const char *filename); + + +/** + * \fn int PHYSFS_close(PHYSFS_File *handle) + * \brief Close a PhysicsFS filehandle. + * + * This call is capable of failing if the operating system was buffering + * writes to the physical media, and, now forced to write those changes to + * physical media, can not store the data for some reason. In such a case, + * the filehandle stays open. A well-written program should ALWAYS check the + * return value from the close call in addition to every writing call! + * + * \param handle handle returned from PHYSFS_open*(). + * \return nonzero on success, zero on error. Use PHYSFS_getLastErrorCode() + * to obtain the specific error. + * + * \sa PHYSFS_openRead + * \sa PHYSFS_openWrite + * \sa PHYSFS_openAppend + */ +PHYSFS_DECL int PHYSFS_close(PHYSFS_File *handle); + + +/** + * \fn PHYSFS_sint64 PHYSFS_read(PHYSFS_File *handle, void *buffer, PHYSFS_uint32 objSize, PHYSFS_uint32 objCount) + * \brief Read data from a PhysicsFS filehandle + * + * The file must be opened for reading. + * + * \deprecated As of PhysicsFS 2.1, use PHYSFS_readBytes() instead. This + * function just wraps it anyhow. This function never clarified + * what would happen if you managed to read a partial object, so + * working at the byte level makes this cleaner for everyone, + * especially now that PHYSFS_Io interfaces can be supplied by the + * application. + * + * \param handle handle returned from PHYSFS_openRead(). + * \param buffer buffer to store read data into. + * \param objSize size in bytes of objects being read from (handle). + * \param objCount number of (objSize) objects to read from (handle). + * \return number of objects read. PHYSFS_getLastErrorCode() can shed light + * on the reason this might be < (objCount), as can PHYSFS_eof(). + * -1 if complete failure. + * + * \sa PHYSFS_readBytes + * \sa PHYSFS_eof + */ +PHYSFS_DECL PHYSFS_sint64 PHYSFS_read(PHYSFS_File *handle, + void *buffer, + PHYSFS_uint32 objSize, + PHYSFS_uint32 objCount) + PHYSFS_DEPRECATED; + +/** + * \fn PHYSFS_sint64 PHYSFS_write(PHYSFS_File *handle, const void *buffer, PHYSFS_uint32 objSize, PHYSFS_uint32 objCount) + * \brief Write data to a PhysicsFS filehandle + * + * The file must be opened for writing. + * + * \deprecated As of PhysicsFS 2.1, use PHYSFS_writeBytes() instead. This + * function just wraps it anyhow. This function never clarified + * what would happen if you managed to write a partial object, so + * working at the byte level makes this cleaner for everyone, + * especially now that PHYSFS_Io interfaces can be supplied by the + * application. + * + * \param handle retval from PHYSFS_openWrite() or PHYSFS_openAppend(). + * \param buffer buffer of bytes to write to (handle). + * \param objSize size in bytes of objects being written to (handle). + * \param objCount number of (objSize) objects to write to (handle). + * \return number of objects written. PHYSFS_getLastErrorCode() can shed + * light on the reason this might be < (objCount). -1 if complete + * failure. + * + * \sa PHYSFS_writeBytes + */ +PHYSFS_DECL PHYSFS_sint64 PHYSFS_write(PHYSFS_File *handle, + const void *buffer, + PHYSFS_uint32 objSize, + PHYSFS_uint32 objCount) + PHYSFS_DEPRECATED; + + +/* File position stuff... */ + +/** + * \fn int PHYSFS_eof(PHYSFS_File *handle) + * \brief Check for end-of-file state on a PhysicsFS filehandle. + * + * Determine if the end of file has been reached in a PhysicsFS filehandle. + * + * \param handle handle returned from PHYSFS_openRead(). + * \return nonzero if EOF, zero if not. + * + * \sa PHYSFS_read + * \sa PHYSFS_tell + */ +PHYSFS_DECL int PHYSFS_eof(PHYSFS_File *handle); + + +/** + * \fn PHYSFS_sint64 PHYSFS_tell(PHYSFS_File *handle) + * \brief Determine current position within a PhysicsFS filehandle. + * + * \param handle handle returned from PHYSFS_open*(). + * \return offset in bytes from start of file. -1 if error occurred. + * Use PHYSFS_getLastErrorCode() to obtain the specific error. + * + * \sa PHYSFS_seek + */ +PHYSFS_DECL PHYSFS_sint64 PHYSFS_tell(PHYSFS_File *handle); + + +/** + * \fn int PHYSFS_seek(PHYSFS_File *handle, PHYSFS_uint64 pos) + * \brief Seek to a new position within a PhysicsFS filehandle. + * + * The next read or write will occur at that place. Seeking past the + * beginning or end of the file is not allowed, and causes an error. + * + * \param handle handle returned from PHYSFS_open*(). + * \param pos number of bytes from start of file to seek to. + * \return nonzero on success, zero on error. Use PHYSFS_getLastErrorCode() + * to obtain the specific error. + * + * \sa PHYSFS_tell + */ +PHYSFS_DECL int PHYSFS_seek(PHYSFS_File *handle, PHYSFS_uint64 pos); + + +/** + * \fn PHYSFS_sint64 PHYSFS_fileLength(PHYSFS_File *handle) + * \brief Get total length of a file in bytes. + * + * Note that if another process/thread is writing to this file at the same + * time, then the information this function supplies could be incorrect + * before you get it. Use with caution, or better yet, don't use at all. + * + * \param handle handle returned from PHYSFS_open*(). + * \return size in bytes of the file. -1 if can't be determined. + * + * \sa PHYSFS_tell + * \sa PHYSFS_seek + */ +PHYSFS_DECL PHYSFS_sint64 PHYSFS_fileLength(PHYSFS_File *handle); + + +/* Buffering stuff... */ + +/** + * \fn int PHYSFS_setBuffer(PHYSFS_File *handle, PHYSFS_uint64 bufsize) + * \brief Set up buffering for a PhysicsFS file handle. + * + * Define an i/o buffer for a file handle. A memory block of (bufsize) bytes + * will be allocated and associated with (handle). + * + * For files opened for reading, up to (bufsize) bytes are read from (handle) + * and stored in the internal buffer. Calls to PHYSFS_read() will pull + * from this buffer until it is empty, and then refill it for more reading. + * Note that compressed files, like ZIP archives, will decompress while + * buffering, so this can be handy for offsetting CPU-intensive operations. + * The buffer isn't filled until you do your next read. + * + * For files opened for writing, data will be buffered to memory until the + * buffer is full or the buffer is flushed. Closing a handle implicitly + * causes a flush...check your return values! + * + * Seeking, etc transparently accounts for buffering. + * + * You can resize an existing buffer by calling this function more than once + * on the same file. Setting the buffer size to zero will free an existing + * buffer. + * + * PhysicsFS file handles are unbuffered by default. + * + * Please check the return value of this function! Failures can include + * not being able to seek backwards in a read-only file when removing the + * buffer, not being able to allocate the buffer, and not being able to + * flush the buffer to disk, among other unexpected problems. + * + * \param handle handle returned from PHYSFS_open*(). + * \param bufsize size, in bytes, of buffer to allocate. + * \return nonzero if successful, zero on error. + * + * \sa PHYSFS_flush + * \sa PHYSFS_read + * \sa PHYSFS_write + * \sa PHYSFS_close + */ +PHYSFS_DECL int PHYSFS_setBuffer(PHYSFS_File *handle, PHYSFS_uint64 bufsize); + + +/** + * \fn int PHYSFS_flush(PHYSFS_File *handle) + * \brief Flush a buffered PhysicsFS file handle. + * + * For buffered files opened for writing, this will put the current contents + * of the buffer to disk and flag the buffer as empty if possible. + * + * For buffered files opened for reading or unbuffered files, this is a safe + * no-op, and will report success. + * + * \param handle handle returned from PHYSFS_open*(). + * \return nonzero if successful, zero on error. + * + * \sa PHYSFS_setBuffer + * \sa PHYSFS_close + */ +PHYSFS_DECL int PHYSFS_flush(PHYSFS_File *handle); + + +/* Byteorder stuff... */ + +/** + * \fn PHYSFS_sint16 PHYSFS_swapSLE16(PHYSFS_sint16 val) + * \brief Swap littleendian signed 16 to platform's native byte order. + * + * Take a 16-bit signed value in littleendian format and convert it to + * the platform's native byte order. + * + * \param val value to convert + * \return converted value. + */ +PHYSFS_DECL PHYSFS_sint16 PHYSFS_swapSLE16(PHYSFS_sint16 val); + + +/** + * \fn PHYSFS_uint16 PHYSFS_swapULE16(PHYSFS_uint16 val) + * \brief Swap littleendian unsigned 16 to platform's native byte order. + * + * Take a 16-bit unsigned value in littleendian format and convert it to + * the platform's native byte order. + * + * \param val value to convert + * \return converted value. + */ +PHYSFS_DECL PHYSFS_uint16 PHYSFS_swapULE16(PHYSFS_uint16 val); + +/** + * \fn PHYSFS_sint32 PHYSFS_swapSLE32(PHYSFS_sint32 val) + * \brief Swap littleendian signed 32 to platform's native byte order. + * + * Take a 32-bit signed value in littleendian format and convert it to + * the platform's native byte order. + * + * \param val value to convert + * \return converted value. + */ +PHYSFS_DECL PHYSFS_sint32 PHYSFS_swapSLE32(PHYSFS_sint32 val); + + +/** + * \fn PHYSFS_uint32 PHYSFS_swapULE32(PHYSFS_uint32 val) + * \brief Swap littleendian unsigned 32 to platform's native byte order. + * + * Take a 32-bit unsigned value in littleendian format and convert it to + * the platform's native byte order. + * + * \param val value to convert + * \return converted value. + */ +PHYSFS_DECL PHYSFS_uint32 PHYSFS_swapULE32(PHYSFS_uint32 val); + +/** + * \fn PHYSFS_sint64 PHYSFS_swapSLE64(PHYSFS_sint64 val) + * \brief Swap littleendian signed 64 to platform's native byte order. + * + * Take a 64-bit signed value in littleendian format and convert it to + * the platform's native byte order. + * + * \param val value to convert + * \return converted value. + * + * \warning Remember, PHYSFS_sint64 is only 32 bits on platforms without + * any sort of 64-bit support. + */ +PHYSFS_DECL PHYSFS_sint64 PHYSFS_swapSLE64(PHYSFS_sint64 val); + + +/** + * \fn PHYSFS_uint64 PHYSFS_swapULE64(PHYSFS_uint64 val) + * \brief Swap littleendian unsigned 64 to platform's native byte order. + * + * Take a 64-bit unsigned value in littleendian format and convert it to + * the platform's native byte order. + * + * \param val value to convert + * \return converted value. + * + * \warning Remember, PHYSFS_uint64 is only 32 bits on platforms without + * any sort of 64-bit support. + */ +PHYSFS_DECL PHYSFS_uint64 PHYSFS_swapULE64(PHYSFS_uint64 val); + + +/** + * \fn PHYSFS_sint16 PHYSFS_swapSBE16(PHYSFS_sint16 val) + * \brief Swap bigendian signed 16 to platform's native byte order. + * + * Take a 16-bit signed value in bigendian format and convert it to + * the platform's native byte order. + * + * \param val value to convert + * \return converted value. + */ +PHYSFS_DECL PHYSFS_sint16 PHYSFS_swapSBE16(PHYSFS_sint16 val); + + +/** + * \fn PHYSFS_uint16 PHYSFS_swapUBE16(PHYSFS_uint16 val) + * \brief Swap bigendian unsigned 16 to platform's native byte order. + * + * Take a 16-bit unsigned value in bigendian format and convert it to + * the platform's native byte order. + * + * \param val value to convert + * \return converted value. + */ +PHYSFS_DECL PHYSFS_uint16 PHYSFS_swapUBE16(PHYSFS_uint16 val); + +/** + * \fn PHYSFS_sint32 PHYSFS_swapSBE32(PHYSFS_sint32 val) + * \brief Swap bigendian signed 32 to platform's native byte order. + * + * Take a 32-bit signed value in bigendian format and convert it to + * the platform's native byte order. + * + * \param val value to convert + * \return converted value. + */ +PHYSFS_DECL PHYSFS_sint32 PHYSFS_swapSBE32(PHYSFS_sint32 val); + + +/** + * \fn PHYSFS_uint32 PHYSFS_swapUBE32(PHYSFS_uint32 val) + * \brief Swap bigendian unsigned 32 to platform's native byte order. + * + * Take a 32-bit unsigned value in bigendian format and convert it to + * the platform's native byte order. + * + * \param val value to convert + * \return converted value. + */ +PHYSFS_DECL PHYSFS_uint32 PHYSFS_swapUBE32(PHYSFS_uint32 val); + + +/** + * \fn PHYSFS_sint64 PHYSFS_swapSBE64(PHYSFS_sint64 val) + * \brief Swap bigendian signed 64 to platform's native byte order. + * + * Take a 64-bit signed value in bigendian format and convert it to + * the platform's native byte order. + * + * \param val value to convert + * \return converted value. + * + * \warning Remember, PHYSFS_sint64 is only 32 bits on platforms without + * any sort of 64-bit support. + */ +PHYSFS_DECL PHYSFS_sint64 PHYSFS_swapSBE64(PHYSFS_sint64 val); + + +/** + * \fn PHYSFS_uint64 PHYSFS_swapUBE64(PHYSFS_uint64 val) + * \brief Swap bigendian unsigned 64 to platform's native byte order. + * + * Take a 64-bit unsigned value in bigendian format and convert it to + * the platform's native byte order. + * + * \param val value to convert + * \return converted value. + * + * \warning Remember, PHYSFS_uint64 is only 32 bits on platforms without + * any sort of 64-bit support. + */ +PHYSFS_DECL PHYSFS_uint64 PHYSFS_swapUBE64(PHYSFS_uint64 val); + + +/** + * \fn int PHYSFS_readSLE16(PHYSFS_File *file, PHYSFS_sint16 *val) + * \brief Read and convert a signed 16-bit littleendian value. + * + * Convenience function. Read a signed 16-bit littleendian value from a + * file and convert it to the platform's native byte order. + * + * \param file PhysicsFS file handle from which to read. + * \param val pointer to where value should be stored. + * \return zero on failure, non-zero on success. If successful, (*val) will + * store the result. On failure, you can find out what went wrong + * from PHYSFS_getLastErrorCode(). + */ +PHYSFS_DECL int PHYSFS_readSLE16(PHYSFS_File *file, PHYSFS_sint16 *val); + + +/** + * \fn int PHYSFS_readULE16(PHYSFS_File *file, PHYSFS_uint16 *val) + * \brief Read and convert an unsigned 16-bit littleendian value. + * + * Convenience function. Read an unsigned 16-bit littleendian value from a + * file and convert it to the platform's native byte order. + * + * \param file PhysicsFS file handle from which to read. + * \param val pointer to where value should be stored. + * \return zero on failure, non-zero on success. If successful, (*val) will + * store the result. On failure, you can find out what went wrong + * from PHYSFS_getLastErrorCode(). + * + */ +PHYSFS_DECL int PHYSFS_readULE16(PHYSFS_File *file, PHYSFS_uint16 *val); + + +/** + * \fn int PHYSFS_readSBE16(PHYSFS_File *file, PHYSFS_sint16 *val) + * \brief Read and convert a signed 16-bit bigendian value. + * + * Convenience function. Read a signed 16-bit bigendian value from a + * file and convert it to the platform's native byte order. + * + * \param file PhysicsFS file handle from which to read. + * \param val pointer to where value should be stored. + * \return zero on failure, non-zero on success. If successful, (*val) will + * store the result. On failure, you can find out what went wrong + * from PHYSFS_getLastErrorCode(). + */ +PHYSFS_DECL int PHYSFS_readSBE16(PHYSFS_File *file, PHYSFS_sint16 *val); + + +/** + * \fn int PHYSFS_readUBE16(PHYSFS_File *file, PHYSFS_uint16 *val) + * \brief Read and convert an unsigned 16-bit bigendian value. + * + * Convenience function. Read an unsigned 16-bit bigendian value from a + * file and convert it to the platform's native byte order. + * + * \param file PhysicsFS file handle from which to read. + * \param val pointer to where value should be stored. + * \return zero on failure, non-zero on success. If successful, (*val) will + * store the result. On failure, you can find out what went wrong + * from PHYSFS_getLastErrorCode(). + * + */ +PHYSFS_DECL int PHYSFS_readUBE16(PHYSFS_File *file, PHYSFS_uint16 *val); + + +/** + * \fn int PHYSFS_readSLE32(PHYSFS_File *file, PHYSFS_sint32 *val) + * \brief Read and convert a signed 32-bit littleendian value. + * + * Convenience function. Read a signed 32-bit littleendian value from a + * file and convert it to the platform's native byte order. + * + * \param file PhysicsFS file handle from which to read. + * \param val pointer to where value should be stored. + * \return zero on failure, non-zero on success. If successful, (*val) will + * store the result. On failure, you can find out what went wrong + * from PHYSFS_getLastErrorCode(). + */ +PHYSFS_DECL int PHYSFS_readSLE32(PHYSFS_File *file, PHYSFS_sint32 *val); + + +/** + * \fn int PHYSFS_readULE32(PHYSFS_File *file, PHYSFS_uint32 *val) + * \brief Read and convert an unsigned 32-bit littleendian value. + * + * Convenience function. Read an unsigned 32-bit littleendian value from a + * file and convert it to the platform's native byte order. + * + * \param file PhysicsFS file handle from which to read. + * \param val pointer to where value should be stored. + * \return zero on failure, non-zero on success. If successful, (*val) will + * store the result. On failure, you can find out what went wrong + * from PHYSFS_getLastErrorCode(). + * + */ +PHYSFS_DECL int PHYSFS_readULE32(PHYSFS_File *file, PHYSFS_uint32 *val); + + +/** + * \fn int PHYSFS_readSBE32(PHYSFS_File *file, PHYSFS_sint32 *val) + * \brief Read and convert a signed 32-bit bigendian value. + * + * Convenience function. Read a signed 32-bit bigendian value from a + * file and convert it to the platform's native byte order. + * + * \param file PhysicsFS file handle from which to read. + * \param val pointer to where value should be stored. + * \return zero on failure, non-zero on success. If successful, (*val) will + * store the result. On failure, you can find out what went wrong + * from PHYSFS_getLastErrorCode(). + */ +PHYSFS_DECL int PHYSFS_readSBE32(PHYSFS_File *file, PHYSFS_sint32 *val); + + +/** + * \fn int PHYSFS_readUBE32(PHYSFS_File *file, PHYSFS_uint32 *val) + * \brief Read and convert an unsigned 32-bit bigendian value. + * + * Convenience function. Read an unsigned 32-bit bigendian value from a + * file and convert it to the platform's native byte order. + * + * \param file PhysicsFS file handle from which to read. + * \param val pointer to where value should be stored. + * \return zero on failure, non-zero on success. If successful, (*val) will + * store the result. On failure, you can find out what went wrong + * from PHYSFS_getLastErrorCode(). + * + */ +PHYSFS_DECL int PHYSFS_readUBE32(PHYSFS_File *file, PHYSFS_uint32 *val); + + +/** + * \fn int PHYSFS_readSLE64(PHYSFS_File *file, PHYSFS_sint64 *val) + * \brief Read and convert a signed 64-bit littleendian value. + * + * Convenience function. Read a signed 64-bit littleendian value from a + * file and convert it to the platform's native byte order. + * + * \param file PhysicsFS file handle from which to read. + * \param val pointer to where value should be stored. + * \return zero on failure, non-zero on success. If successful, (*val) will + * store the result. On failure, you can find out what went wrong + * from PHYSFS_getLastErrorCode(). + * + * \warning Remember, PHYSFS_sint64 is only 32 bits on platforms without + * any sort of 64-bit support. + */ +PHYSFS_DECL int PHYSFS_readSLE64(PHYSFS_File *file, PHYSFS_sint64 *val); + + +/** + * \fn int PHYSFS_readULE64(PHYSFS_File *file, PHYSFS_uint64 *val) + * \brief Read and convert an unsigned 64-bit littleendian value. + * + * Convenience function. Read an unsigned 64-bit littleendian value from a + * file and convert it to the platform's native byte order. + * + * \param file PhysicsFS file handle from which to read. + * \param val pointer to where value should be stored. + * \return zero on failure, non-zero on success. If successful, (*val) will + * store the result. On failure, you can find out what went wrong + * from PHYSFS_getLastErrorCode(). + * + * \warning Remember, PHYSFS_uint64 is only 32 bits on platforms without + * any sort of 64-bit support. + */ +PHYSFS_DECL int PHYSFS_readULE64(PHYSFS_File *file, PHYSFS_uint64 *val); + + +/** + * \fn int PHYSFS_readSBE64(PHYSFS_File *file, PHYSFS_sint64 *val) + * \brief Read and convert a signed 64-bit bigendian value. + * + * Convenience function. Read a signed 64-bit bigendian value from a + * file and convert it to the platform's native byte order. + * + * \param file PhysicsFS file handle from which to read. + * \param val pointer to where value should be stored. + * \return zero on failure, non-zero on success. If successful, (*val) will + * store the result. On failure, you can find out what went wrong + * from PHYSFS_getLastErrorCode(). + * + * \warning Remember, PHYSFS_sint64 is only 32 bits on platforms without + * any sort of 64-bit support. + */ +PHYSFS_DECL int PHYSFS_readSBE64(PHYSFS_File *file, PHYSFS_sint64 *val); + + +/** + * \fn int PHYSFS_readUBE64(PHYSFS_File *file, PHYSFS_uint64 *val) + * \brief Read and convert an unsigned 64-bit bigendian value. + * + * Convenience function. Read an unsigned 64-bit bigendian value from a + * file and convert it to the platform's native byte order. + * + * \param file PhysicsFS file handle from which to read. + * \param val pointer to where value should be stored. + * \return zero on failure, non-zero on success. If successful, (*val) will + * store the result. On failure, you can find out what went wrong + * from PHYSFS_getLastErrorCode(). + * + * \warning Remember, PHYSFS_uint64 is only 32 bits on platforms without + * any sort of 64-bit support. + */ +PHYSFS_DECL int PHYSFS_readUBE64(PHYSFS_File *file, PHYSFS_uint64 *val); + + +/** + * \fn int PHYSFS_writeSLE16(PHYSFS_File *file, PHYSFS_sint16 val) + * \brief Convert and write a signed 16-bit littleendian value. + * + * Convenience function. Convert a signed 16-bit value from the platform's + * native byte order to littleendian and write it to a file. + * + * \param file PhysicsFS file handle to which to write. + * \param val Value to convert and write. + * \return zero on failure, non-zero on success. On failure, you can + * find out what went wrong from PHYSFS_getLastErrorCode(). + */ +PHYSFS_DECL int PHYSFS_writeSLE16(PHYSFS_File *file, PHYSFS_sint16 val); + + +/** + * \fn int PHYSFS_writeULE16(PHYSFS_File *file, PHYSFS_uint16 val) + * \brief Convert and write an unsigned 16-bit littleendian value. + * + * Convenience function. Convert an unsigned 16-bit value from the platform's + * native byte order to littleendian and write it to a file. + * + * \param file PhysicsFS file handle to which to write. + * \param val Value to convert and write. + * \return zero on failure, non-zero on success. On failure, you can + * find out what went wrong from PHYSFS_getLastErrorCode(). + */ +PHYSFS_DECL int PHYSFS_writeULE16(PHYSFS_File *file, PHYSFS_uint16 val); + + +/** + * \fn int PHYSFS_writeSBE16(PHYSFS_File *file, PHYSFS_sint16 val) + * \brief Convert and write a signed 16-bit bigendian value. + * + * Convenience function. Convert a signed 16-bit value from the platform's + * native byte order to bigendian and write it to a file. + * + * \param file PhysicsFS file handle to which to write. + * \param val Value to convert and write. + * \return zero on failure, non-zero on success. On failure, you can + * find out what went wrong from PHYSFS_getLastErrorCode(). + */ +PHYSFS_DECL int PHYSFS_writeSBE16(PHYSFS_File *file, PHYSFS_sint16 val); + + +/** + * \fn int PHYSFS_writeUBE16(PHYSFS_File *file, PHYSFS_uint16 val) + * \brief Convert and write an unsigned 16-bit bigendian value. + * + * Convenience function. Convert an unsigned 16-bit value from the platform's + * native byte order to bigendian and write it to a file. + * + * \param file PhysicsFS file handle to which to write. + * \param val Value to convert and write. + * \return zero on failure, non-zero on success. On failure, you can + * find out what went wrong from PHYSFS_getLastErrorCode(). + */ +PHYSFS_DECL int PHYSFS_writeUBE16(PHYSFS_File *file, PHYSFS_uint16 val); + + +/** + * \fn int PHYSFS_writeSLE32(PHYSFS_File *file, PHYSFS_sint32 val) + * \brief Convert and write a signed 32-bit littleendian value. + * + * Convenience function. Convert a signed 32-bit value from the platform's + * native byte order to littleendian and write it to a file. + * + * \param file PhysicsFS file handle to which to write. + * \param val Value to convert and write. + * \return zero on failure, non-zero on success. On failure, you can + * find out what went wrong from PHYSFS_getLastErrorCode(). + */ +PHYSFS_DECL int PHYSFS_writeSLE32(PHYSFS_File *file, PHYSFS_sint32 val); + + +/** + * \fn int PHYSFS_writeULE32(PHYSFS_File *file, PHYSFS_uint32 val) + * \brief Convert and write an unsigned 32-bit littleendian value. + * + * Convenience function. Convert an unsigned 32-bit value from the platform's + * native byte order to littleendian and write it to a file. + * + * \param file PhysicsFS file handle to which to write. + * \param val Value to convert and write. + * \return zero on failure, non-zero on success. On failure, you can + * find out what went wrong from PHYSFS_getLastErrorCode(). + */ +PHYSFS_DECL int PHYSFS_writeULE32(PHYSFS_File *file, PHYSFS_uint32 val); + + +/** + * \fn int PHYSFS_writeSBE32(PHYSFS_File *file, PHYSFS_sint32 val) + * \brief Convert and write a signed 32-bit bigendian value. + * + * Convenience function. Convert a signed 32-bit value from the platform's + * native byte order to bigendian and write it to a file. + * + * \param file PhysicsFS file handle to which to write. + * \param val Value to convert and write. + * \return zero on failure, non-zero on success. On failure, you can + * find out what went wrong from PHYSFS_getLastErrorCode(). + */ +PHYSFS_DECL int PHYSFS_writeSBE32(PHYSFS_File *file, PHYSFS_sint32 val); + + +/** + * \fn int PHYSFS_writeUBE32(PHYSFS_File *file, PHYSFS_uint32 val) + * \brief Convert and write an unsigned 32-bit bigendian value. + * + * Convenience function. Convert an unsigned 32-bit value from the platform's + * native byte order to bigendian and write it to a file. + * + * \param file PhysicsFS file handle to which to write. + * \param val Value to convert and write. + * \return zero on failure, non-zero on success. On failure, you can + * find out what went wrong from PHYSFS_getLastErrorCode(). + */ +PHYSFS_DECL int PHYSFS_writeUBE32(PHYSFS_File *file, PHYSFS_uint32 val); + + +/** + * \fn int PHYSFS_writeSLE64(PHYSFS_File *file, PHYSFS_sint64 val) + * \brief Convert and write a signed 64-bit littleendian value. + * + * Convenience function. Convert a signed 64-bit value from the platform's + * native byte order to littleendian and write it to a file. + * + * \param file PhysicsFS file handle to which to write. + * \param val Value to convert and write. + * \return zero on failure, non-zero on success. On failure, you can + * find out what went wrong from PHYSFS_getLastErrorCode(). + * + * \warning Remember, PHYSFS_sint64 is only 32 bits on platforms without + * any sort of 64-bit support. + */ +PHYSFS_DECL int PHYSFS_writeSLE64(PHYSFS_File *file, PHYSFS_sint64 val); + + +/** + * \fn int PHYSFS_writeULE64(PHYSFS_File *file, PHYSFS_uint64 val) + * \brief Convert and write an unsigned 64-bit littleendian value. + * + * Convenience function. Convert an unsigned 64-bit value from the platform's + * native byte order to littleendian and write it to a file. + * + * \param file PhysicsFS file handle to which to write. + * \param val Value to convert and write. + * \return zero on failure, non-zero on success. On failure, you can + * find out what went wrong from PHYSFS_getLastErrorCode(). + * + * \warning Remember, PHYSFS_uint64 is only 32 bits on platforms without + * any sort of 64-bit support. + */ +PHYSFS_DECL int PHYSFS_writeULE64(PHYSFS_File *file, PHYSFS_uint64 val); + + +/** + * \fn int PHYSFS_writeSBE64(PHYSFS_File *file, PHYSFS_sint64 val) + * \brief Convert and write a signed 64-bit bigending value. + * + * Convenience function. Convert a signed 64-bit value from the platform's + * native byte order to bigendian and write it to a file. + * + * \param file PhysicsFS file handle to which to write. + * \param val Value to convert and write. + * \return zero on failure, non-zero on success. On failure, you can + * find out what went wrong from PHYSFS_getLastErrorCode(). + * + * \warning Remember, PHYSFS_sint64 is only 32 bits on platforms without + * any sort of 64-bit support. + */ +PHYSFS_DECL int PHYSFS_writeSBE64(PHYSFS_File *file, PHYSFS_sint64 val); + + +/** + * \fn int PHYSFS_writeUBE64(PHYSFS_File *file, PHYSFS_uint64 val) + * \brief Convert and write an unsigned 64-bit bigendian value. + * + * Convenience function. Convert an unsigned 64-bit value from the platform's + * native byte order to bigendian and write it to a file. + * + * \param file PhysicsFS file handle to which to write. + * \param val Value to convert and write. + * \return zero on failure, non-zero on success. On failure, you can + * find out what went wrong from PHYSFS_getLastErrorCode(). + * + * \warning Remember, PHYSFS_uint64 is only 32 bits on platforms without + * any sort of 64-bit support. + */ +PHYSFS_DECL int PHYSFS_writeUBE64(PHYSFS_File *file, PHYSFS_uint64 val); + + +/* Everything above this line is part of the PhysicsFS 1.0 API. */ + +/** + * \fn int PHYSFS_isInit(void) + * \brief Determine if the PhysicsFS library is initialized. + * + * Once PHYSFS_init() returns successfully, this will return non-zero. + * Before a successful PHYSFS_init() and after PHYSFS_deinit() returns + * successfully, this will return zero. This function is safe to call at + * any time. + * + * \return non-zero if library is initialized, zero if library is not. + * + * \sa PHYSFS_init + * \sa PHYSFS_deinit + */ +PHYSFS_DECL int PHYSFS_isInit(void); + + +/** + * \fn int PHYSFS_symbolicLinksPermitted(void) + * \brief Determine if the symbolic links are permitted. + * + * This reports the setting from the last call to PHYSFS_permitSymbolicLinks(). + * If PHYSFS_permitSymbolicLinks() hasn't been called since the library was + * last initialized, symbolic links are implicitly disabled. + * + * \return non-zero if symlinks are permitted, zero if not. + * + * \sa PHYSFS_permitSymbolicLinks + */ +PHYSFS_DECL int PHYSFS_symbolicLinksPermitted(void); + + +/** + * \struct PHYSFS_Allocator + * \brief PhysicsFS allocation function pointers. + * + * (This is for limited, hardcore use. If you don't immediately see a need + * for it, you can probably ignore this forever.) + * + * You create one of these structures for use with PHYSFS_setAllocator. + * Allocators are assumed to be reentrant by the caller; please mutex + * accordingly. + * + * Allocations are always discussed in 64-bits, for future expansion...we're + * on the cusp of a 64-bit transition, and we'll probably be allocating 6 + * gigabytes like it's nothing sooner or later, and I don't want to change + * this again at that point. If you're on a 32-bit platform and have to + * downcast, it's okay to return NULL if the allocation is greater than + * 4 gigabytes, since you'd have to do so anyhow. + * + * \sa PHYSFS_setAllocator + */ +typedef struct PHYSFS_Allocator +{ + int (*Init)(void); /**< Initialize. Can be NULL. Zero on failure. */ + void (*Deinit)(void); /**< Deinitialize your allocator. Can be NULL. */ + void *(*Malloc)(PHYSFS_uint64); /**< Allocate like malloc(). */ + void *(*Realloc)(void *, PHYSFS_uint64); /**< Reallocate like realloc(). */ + void (*Free)(void *); /**< Free memory from Malloc or Realloc. */ +} PHYSFS_Allocator; + + +/** + * \fn int PHYSFS_setAllocator(const PHYSFS_Allocator *allocator) + * \brief Hook your own allocation routines into PhysicsFS. + * + * (This is for limited, hardcore use. If you don't immediately see a need + * for it, you can probably ignore this forever.) + * + * By default, PhysicsFS will use whatever is reasonable for a platform + * to manage dynamic memory (usually ANSI C malloc/realloc/free, but + * some platforms might use something else), but in some uncommon cases, the + * app might want more control over the library's memory management. This + * lets you redirect PhysicsFS to use your own allocation routines instead. + * You can only call this function before PHYSFS_init(); if the library is + * initialized, it'll reject your efforts to change the allocator mid-stream. + * You may call this function after PHYSFS_deinit() if you are willing to + * shut down the library and restart it with a new allocator; this is a safe + * and supported operation. The allocator remains intact between deinit/init + * calls. If you want to return to the platform's default allocator, pass a + * NULL in here. + * + * If you aren't immediately sure what to do with this function, you can + * safely ignore it altogether. + * + * \param allocator Structure containing your allocator's entry points. + * \return zero on failure, non-zero on success. This call only fails + * when used between PHYSFS_init() and PHYSFS_deinit() calls. + */ +PHYSFS_DECL int PHYSFS_setAllocator(const PHYSFS_Allocator *allocator); + + +/** + * \fn int PHYSFS_mount(const char *newDir, const char *mountPoint, int appendToPath) + * \brief Add an archive or directory to the search path. + * + * If this is a duplicate, the entry is not added again, even though the + * function succeeds. You may not add the same archive to two different + * mountpoints: duplicate checking is done against the archive and not the + * mountpoint. + * + * When you mount an archive, it is added to a virtual file system...all files + * in all of the archives are interpolated into a single hierachical file + * tree. Two archives mounted at the same place (or an archive with files + * overlapping another mountpoint) may have overlapping files: in such a case, + * the file earliest in the search path is selected, and the other files are + * inaccessible to the application. This allows archives to be used to + * override previous revisions; you can use the mounting mechanism to place + * archives at a specific point in the file tree and prevent overlap; this + * is useful for downloadable mods that might trample over application data + * or each other, for example. + * + * The mountpoint does not need to exist prior to mounting, which is different + * than those familiar with the Unix concept of "mounting" may expect. + * As well, more than one archive can be mounted to the same mountpoint, or + * mountpoints and archive contents can overlap...the interpolation mechanism + * still functions as usual. + * + * Specifying a symbolic link to an archive or directory is allowed here, + * regardless of the state of PHYSFS_permitSymbolicLinks(). That function + * only deals with symlinks inside the mounted directory or archive. + * + * \param newDir directory or archive to add to the path, in + * platform-dependent notation. + * \param mountPoint Location in the interpolated tree that this archive + * will be "mounted", in platform-independent notation. + * NULL or "" is equivalent to "/". + * \param appendToPath nonzero to append to search path, zero to prepend. + * \return nonzero if added to path, zero on failure (bogus archive, dir + * missing, etc). Use PHYSFS_getLastErrorCode() to obtain + * the specific error. + * + * \sa PHYSFS_removeFromSearchPath + * \sa PHYSFS_getSearchPath + * \sa PHYSFS_getMountPoint + * \sa PHYSFS_mountIo + */ +PHYSFS_DECL int PHYSFS_mount(const char *newDir, + const char *mountPoint, + int appendToPath); + +/** + * \fn int PHYSFS_getMountPoint(const char *dir) + * \brief Determine a mounted archive's mountpoint. + * + * You give this function the name of an archive or dir you successfully + * added to the search path, and it reports the location in the interpolated + * tree where it is mounted. Files mounted with a NULL mountpoint or through + * PHYSFS_addToSearchPath() will report "/". The return value is READ ONLY + * and valid until the archive is removed from the search path. + * + * \param dir directory or archive previously added to the path, in + * platform-dependent notation. This must match the string + * used when adding, even if your string would also reference + * the same file with a different string of characters. + * \return READ-ONLY string of mount point if added to path, NULL on failure + * (bogus archive, etc). Use PHYSFS_getLastErrorCode() to obtain the + * specific error. + * + * \sa PHYSFS_removeFromSearchPath + * \sa PHYSFS_getSearchPath + * \sa PHYSFS_getMountPoint + */ +PHYSFS_DECL const char *PHYSFS_getMountPoint(const char *dir); + + +/** + * \typedef PHYSFS_StringCallback + * \brief Function signature for callbacks that report strings. + * + * These are used to report a list of strings to an original caller, one + * string per callback. All strings are UTF-8 encoded. Functions should not + * try to modify or free the string's memory. + * + * These callbacks are used, starting in PhysicsFS 1.1, as an alternative to + * functions that would return lists that need to be cleaned up with + * PHYSFS_freeList(). The callback means that the library doesn't need to + * allocate an entire list and all the strings up front. + * + * Be aware that promises data ordering in the list versions are not + * necessarily so in the callback versions. Check the documentation on + * specific APIs, but strings may not be sorted as you expect. + * + * \param data User-defined data pointer, passed through from the API + * that eventually called the callback. + * \param str The string data about which the callback is meant to inform. + * + * \sa PHYSFS_getCdRomDirsCallback + * \sa PHYSFS_getSearchPathCallback + */ +typedef void (*PHYSFS_StringCallback)(void *data, const char *str); + + +/** + * \typedef PHYSFS_EnumFilesCallback + * \brief Function signature for callbacks that enumerate files. + * + * \warning As of PhysicsFS 2.1, Use PHYSFS_EnumerateCallback with + * PHYSFS_enumerate() instead; it gives you more control over the process. + * + * These are used to report a list of directory entries to an original caller, + * one file/dir/symlink per callback. All strings are UTF-8 encoded. + * Functions should not try to modify or free any string's memory. + * + * These callbacks are used, starting in PhysicsFS 1.1, as an alternative to + * functions that would return lists that need to be cleaned up with + * PHYSFS_freeList(). The callback means that the library doesn't need to + * allocate an entire list and all the strings up front. + * + * Be aware that promised data ordering in the list versions are not + * necessarily so in the callback versions. Check the documentation on + * specific APIs, but strings may not be sorted as you expect and you might + * get duplicate strings. + * + * \param data User-defined data pointer, passed through from the API + * that eventually called the callback. + * \param origdir A string containing the full path, in platform-independent + * notation, of the directory containing this file. In most + * cases, this is the directory on which you requested + * enumeration, passed in the callback for your convenience. + * \param fname The filename that is being enumerated. It may not be in + * alphabetical order compared to other callbacks that have + * fired, and it will not contain the full path. You can + * recreate the fullpath with $origdir/$fname ... The file + * can be a subdirectory, a file, a symlink, etc. + * + * \sa PHYSFS_enumerateFilesCallback + */ +typedef void (*PHYSFS_EnumFilesCallback)(void *data, const char *origdir, + const char *fname); + + +/** + * \fn void PHYSFS_getCdRomDirsCallback(PHYSFS_StringCallback c, void *d) + * \brief Enumerate CD-ROM directories, using an application-defined callback. + * + * Internally, PHYSFS_getCdRomDirs() just calls this function and then builds + * a list before returning to the application, so functionality is identical + * except for how the information is represented to the application. + * + * Unlike PHYSFS_getCdRomDirs(), this function does not return an array. + * Rather, it calls a function specified by the application once per + * detected disc: + * + * \code + * + * static void foundDisc(void *data, const char *cddir) + * { + * printf("cdrom dir [%s] is available.\n", cddir); + * } + * + * // ... + * PHYSFS_getCdRomDirsCallback(foundDisc, NULL); + * \endcode + * + * This call may block while drives spin up. Be forewarned. + * + * \param c Callback function to notify about detected drives. + * \param d Application-defined data passed to callback. Can be NULL. + * + * \sa PHYSFS_StringCallback + * \sa PHYSFS_getCdRomDirs + */ +PHYSFS_DECL void PHYSFS_getCdRomDirsCallback(PHYSFS_StringCallback c, void *d); + + +/** + * \fn void PHYSFS_getSearchPathCallback(PHYSFS_StringCallback c, void *d) + * \brief Enumerate the search path, using an application-defined callback. + * + * Internally, PHYSFS_getSearchPath() just calls this function and then builds + * a list before returning to the application, so functionality is identical + * except for how the information is represented to the application. + * + * Unlike PHYSFS_getSearchPath(), this function does not return an array. + * Rather, it calls a function specified by the application once per + * element of the search path: + * + * \code + * + * static void printSearchPath(void *data, const char *pathItem) + * { + * printf("[%s] is in the search path.\n", pathItem); + * } + * + * // ... + * PHYSFS_getSearchPathCallback(printSearchPath, NULL); + * \endcode + * + * Elements of the search path are reported in order search priority, so the + * first archive/dir that would be examined when looking for a file is the + * first element passed through the callback. + * + * \param c Callback function to notify about search path elements. + * \param d Application-defined data passed to callback. Can be NULL. + * + * \sa PHYSFS_StringCallback + * \sa PHYSFS_getSearchPath + */ +PHYSFS_DECL void PHYSFS_getSearchPathCallback(PHYSFS_StringCallback c, void *d); + + +/** + * \fn void PHYSFS_enumerateFilesCallback(const char *dir, PHYSFS_EnumFilesCallback c, void *d) + * \brief Get a file listing of a search path's directory, using an application-defined callback. + * + * \deprecated As of PhysicsFS 2.1, use PHYSFS_enumerate() instead. This + * function has no way to report errors (or to have the callback signal an + * error or request a stop), so if data will be lost, your callback has no + * way to direct the process, and your calling app has no way to know. + * + * As of PhysicsFS 2.1, this function just wraps PHYSFS_enumerate() and + * ignores errors. Consider using PHYSFS_enumerate() or + * PHYSFS_enumerateFiles() instead. + * + * \sa PHYSFS_enumerate + * \sa PHYSFS_enumerateFiles + * \sa PHYSFS_EnumFilesCallback + */ +PHYSFS_DECL void PHYSFS_enumerateFilesCallback(const char *dir, + PHYSFS_EnumFilesCallback c, + void *d) PHYSFS_DEPRECATED; + +/** + * \fn void PHYSFS_utf8FromUcs4(const PHYSFS_uint32 *src, char *dst, PHYSFS_uint64 len) + * \brief Convert a UCS-4 string to a UTF-8 string. + * + * \warning This function will not report an error if there are invalid UCS-4 + * values in the source string. It will replace them with a '?' + * character and continue on. + * + * UCS-4 (aka UTF-32) strings are 32-bits per character: \c wchar_t on Unix. + * + * To ensure that the destination buffer is large enough for the conversion, + * please allocate a buffer that is the same size as the source buffer. UTF-8 + * never uses more than 32-bits per character, so while it may shrink a UCS-4 + * string, it will never expand it. + * + * Strings that don't fit in the destination buffer will be truncated, but + * will always be null-terminated and never have an incomplete UTF-8 + * sequence at the end. If the buffer length is 0, this function does nothing. + * + * \param src Null-terminated source string in UCS-4 format. + * \param dst Buffer to store converted UTF-8 string. + * \param len Size, in bytes, of destination buffer. + */ +PHYSFS_DECL void PHYSFS_utf8FromUcs4(const PHYSFS_uint32 *src, char *dst, + PHYSFS_uint64 len); + +/** + * \fn void PHYSFS_utf8ToUcs4(const char *src, PHYSFS_uint32 *dst, PHYSFS_uint64 len) + * \brief Convert a UTF-8 string to a UCS-4 string. + * + * \warning This function will not report an error if there are invalid UTF-8 + * sequences in the source string. It will replace them with a '?' + * character and continue on. + * + * UCS-4 (aka UTF-32) strings are 32-bits per character: \c wchar_t on Unix. + * + * To ensure that the destination buffer is large enough for the conversion, + * please allocate a buffer that is four times the size of the source buffer. + * UTF-8 uses from one to four bytes per character, but UCS-4 always uses + * four, so an entirely low-ASCII string will quadruple in size! + * + * Strings that don't fit in the destination buffer will be truncated, but + * will always be null-terminated and never have an incomplete UCS-4 + * sequence at the end. If the buffer length is 0, this function does nothing. + * + * \param src Null-terminated source string in UTF-8 format. + * \param dst Buffer to store converted UCS-4 string. + * \param len Size, in bytes, of destination buffer. + */ +PHYSFS_DECL void PHYSFS_utf8ToUcs4(const char *src, PHYSFS_uint32 *dst, + PHYSFS_uint64 len); + +/** + * \fn void PHYSFS_utf8FromUcs2(const PHYSFS_uint16 *src, char *dst, PHYSFS_uint64 len) + * \brief Convert a UCS-2 string to a UTF-8 string. + * + * \warning you almost certainly should use PHYSFS_utf8FromUtf16(), which + * became available in PhysicsFS 2.1, unless you know what you're doing. + * + * \warning This function will not report an error if there are invalid UCS-2 + * values in the source string. It will replace them with a '?' + * character and continue on. + * + * UCS-2 strings are 16-bits per character: \c TCHAR on Windows, when building + * with Unicode support. Please note that modern versions of Windows use + * UTF-16, which is an extended form of UCS-2, and not UCS-2 itself. You + * almost certainly want PHYSFS_utf8FromUtf16() instead. + * + * To ensure that the destination buffer is large enough for the conversion, + * please allocate a buffer that is double the size of the source buffer. + * UTF-8 never uses more than 32-bits per character, so while it may shrink + * a UCS-2 string, it may also expand it. + * + * Strings that don't fit in the destination buffer will be truncated, but + * will always be null-terminated and never have an incomplete UTF-8 + * sequence at the end. If the buffer length is 0, this function does nothing. + * + * \param src Null-terminated source string in UCS-2 format. + * \param dst Buffer to store converted UTF-8 string. + * \param len Size, in bytes, of destination buffer. + * + * \sa PHYSFS_utf8FromUtf16 + */ +PHYSFS_DECL void PHYSFS_utf8FromUcs2(const PHYSFS_uint16 *src, char *dst, + PHYSFS_uint64 len); + +/** + * \fn PHYSFS_utf8ToUcs2(const char *src, PHYSFS_uint16 *dst, PHYSFS_uint64 len) + * \brief Convert a UTF-8 string to a UCS-2 string. + * + * \warning you almost certainly should use PHYSFS_utf8ToUtf16(), which + * became available in PhysicsFS 2.1, unless you know what you're doing. + * + * \warning This function will not report an error if there are invalid UTF-8 + * sequences in the source string. It will replace them with a '?' + * character and continue on. + * + * UCS-2 strings are 16-bits per character: \c TCHAR on Windows, when building + * with Unicode support. Please note that modern versions of Windows use + * UTF-16, which is an extended form of UCS-2, and not UCS-2 itself. You + * almost certainly want PHYSFS_utf8ToUtf16() instead, but you need to + * understand how that changes things, too. + * + * To ensure that the destination buffer is large enough for the conversion, + * please allocate a buffer that is double the size of the source buffer. + * UTF-8 uses from one to four bytes per character, but UCS-2 always uses + * two, so an entirely low-ASCII string will double in size! + * + * Strings that don't fit in the destination buffer will be truncated, but + * will always be null-terminated and never have an incomplete UCS-2 + * sequence at the end. If the buffer length is 0, this function does nothing. + * + * \param src Null-terminated source string in UTF-8 format. + * \param dst Buffer to store converted UCS-2 string. + * \param len Size, in bytes, of destination buffer. + * + * \sa PHYSFS_utf8ToUtf16 + */ +PHYSFS_DECL void PHYSFS_utf8ToUcs2(const char *src, PHYSFS_uint16 *dst, + PHYSFS_uint64 len); + +/** + * \fn void PHYSFS_utf8FromLatin1(const char *src, char *dst, PHYSFS_uint64 len) + * \brief Convert a UTF-8 string to a Latin1 string. + * + * Latin1 strings are 8-bits per character: a popular "high ASCII" encoding. + * + * To ensure that the destination buffer is large enough for the conversion, + * please allocate a buffer that is double the size of the source buffer. + * UTF-8 expands latin1 codepoints over 127 from 1 to 2 bytes, so the string + * may grow in some cases. + * + * Strings that don't fit in the destination buffer will be truncated, but + * will always be null-terminated and never have an incomplete UTF-8 + * sequence at the end. If the buffer length is 0, this function does nothing. + * + * Please note that we do not supply a UTF-8 to Latin1 converter, since Latin1 + * can't express most Unicode codepoints. It's a legacy encoding; you should + * be converting away from it at all times. + * + * \param src Null-terminated source string in Latin1 format. + * \param dst Buffer to store converted UTF-8 string. + * \param len Size, in bytes, of destination buffer. + */ +PHYSFS_DECL void PHYSFS_utf8FromLatin1(const char *src, char *dst, + PHYSFS_uint64 len); + +/* Everything above this line is part of the PhysicsFS 2.0 API. */ + +/** + * \fn int PHYSFS_caseFold(const PHYSFS_uint32 from, PHYSFS_uint32 *to) + * \brief "Fold" a Unicode codepoint to a lowercase equivalent. + * + * (This is for limited, hardcore use. If you don't immediately see a need + * for it, you can probably ignore this forever.) + * + * This will convert a Unicode codepoint into its lowercase equivalent. + * Bogus codepoints and codepoints without a lowercase equivalent will + * be returned unconverted. + * + * Note that you might get multiple codepoints in return! The German Eszett, + * for example, will fold down to two lowercase latin 's' codepoints. The + * theory is that if you fold two strings, one with an Eszett and one with + * "SS" down, they will match. + * + * \warning Anyone that is a student of Unicode knows about the "Turkish I" + * problem. This API does not handle it. Assume this one letter + * in all of Unicode will definitely fold sort of incorrectly. If + * you don't know what this is about, you can probably ignore this + * problem for most of the planet, but perfection is impossible. + * + * \param from The codepoint to fold. + * \param to Buffer to store the folded codepoint values into. This should + * point to space for at least 3 PHYSFS_uint32 slots. + * \return The number of codepoints the folding produced. Between 1 and 3. + */ +PHYSFS_DECL int PHYSFS_caseFold(const PHYSFS_uint32 from, PHYSFS_uint32 *to); + + +/** + * \fn int PHYSFS_utf8stricmp(const char *str1, const char *str2) + * \brief Case-insensitive compare of two UTF-8 strings. + * + * This is a strcasecmp/stricmp replacement that expects both strings + * to be in UTF-8 encoding. It will do "case folding" to decide if the + * Unicode codepoints in the strings match. + * + * If both strings are exclusively low-ASCII characters, this will do the + * right thing, as that is also valid UTF-8. If there are any high-ASCII + * chars, this will not do what you expect! + * + * It will report which string is "greater than" the other, but be aware that + * this doesn't necessarily mean anything: 'a' may be "less than" 'b', but + * a Japanese kuten has no meaningful alphabetically relationship to + * a Greek lambda, but being able to assign a reliable "value" makes sorting + * algorithms possible, if not entirely sane. Most cases should treat the + * return value as "equal" or "not equal". + * + * Like stricmp, this expects both strings to be NULL-terminated. + * + * \param str1 First string to compare. + * \param str2 Second string to compare. + * \return -1 if str1 is "less than" str2, 1 if "greater than", 0 if equal. + */ +PHYSFS_DECL int PHYSFS_utf8stricmp(const char *str1, const char *str2); + +/** + * \fn int PHYSFS_utf16stricmp(const PHYSFS_uint16 *str1, const PHYSFS_uint16 *str2) + * \brief Case-insensitive compare of two UTF-16 strings. + * + * This is a strcasecmp/stricmp replacement that expects both strings + * to be in UTF-16 encoding. It will do "case folding" to decide if the + * Unicode codepoints in the strings match. + * + * It will report which string is "greater than" the other, but be aware that + * this doesn't necessarily mean anything: 'a' may be "less than" 'b', but + * a Japanese kuten has no meaningful alphabetically relationship to + * a Greek lambda, but being able to assign a reliable "value" makes sorting + * algorithms possible, if not entirely sane. Most cases should treat the + * return value as "equal" or "not equal". + * + * Like stricmp, this expects both strings to be NULL-terminated. + * + * \param str1 First string to compare. + * \param str2 Second string to compare. + * \return -1 if str1 is "less than" str2, 1 if "greater than", 0 if equal. + */ +PHYSFS_DECL int PHYSFS_utf16stricmp(const PHYSFS_uint16 *str1, + const PHYSFS_uint16 *str2); + +/** + * \fn int PHYSFS_ucs4stricmp(const PHYSFS_uint32 *str1, const PHYSFS_uint32 *str2) + * \brief Case-insensitive compare of two UCS-4 strings. + * + * This is a strcasecmp/stricmp replacement that expects both strings + * to be in UCS-4 (aka UTF-32) encoding. It will do "case folding" to decide + * if the Unicode codepoints in the strings match. + * + * It will report which string is "greater than" the other, but be aware that + * this doesn't necessarily mean anything: 'a' may be "less than" 'b', but + * a Japanese kuten has no meaningful alphabetically relationship to + * a Greek lambda, but being able to assign a reliable "value" makes sorting + * algorithms possible, if not entirely sane. Most cases should treat the + * return value as "equal" or "not equal". + * + * Like stricmp, this expects both strings to be NULL-terminated. + * + * \param str1 First string to compare. + * \param str2 Second string to compare. + * \return -1 if str1 is "less than" str2, 1 if "greater than", 0 if equal. + */ +PHYSFS_DECL int PHYSFS_ucs4stricmp(const PHYSFS_uint32 *str1, + const PHYSFS_uint32 *str2); + + +/** + * \typedef PHYSFS_EnumerateCallback + * \brief Possible return values from PHYSFS_EnumerateCallback. + * + * These values dictate if an enumeration callback should continue to fire, + * or stop (and why it is stopping). + * + * \sa PHYSFS_EnumerateCallback + * \sa PHYSFS_enumerate + */ +typedef enum PHYSFS_EnumerateCallbackResult +{ + PHYSFS_ENUM_ERROR = -1, /**< Stop enumerating, report error to app. */ + PHYSFS_ENUM_STOP = 0, /**< Stop enumerating, report success to app. */ + PHYSFS_ENUM_OK = 1 /**< Keep enumerating, no problems */ +} PHYSFS_EnumerateCallbackResult; + +/** + * \typedef PHYSFS_EnumerateCallback + * \brief Function signature for callbacks that enumerate and return results. + * + * This is the same thing as PHYSFS_EnumFilesCallback from PhysicsFS 2.0, + * except it can return a result from the callback: namely: if you're looking + * for something specific, once you find it, you can tell PhysicsFS to stop + * enumerating further. This is used with PHYSFS_enumerate(), which we + * hopefully got right this time. :) + * + * \param data User-defined data pointer, passed through from the API + * that eventually called the callback. + * \param origdir A string containing the full path, in platform-independent + * notation, of the directory containing this file. In most + * cases, this is the directory on which you requested + * enumeration, passed in the callback for your convenience. + * \param fname The filename that is being enumerated. It may not be in + * alphabetical order compared to other callbacks that have + * fired, and it will not contain the full path. You can + * recreate the fullpath with $origdir/$fname ... The file + * can be a subdirectory, a file, a symlink, etc. + * \return A value from PHYSFS_EnumerateCallbackResult. + * All other values are (currently) undefined; don't use them. + * + * \sa PHYSFS_enumerate + * \sa PHYSFS_EnumerateCallbackResult + */ +typedef PHYSFS_EnumerateCallbackResult (*PHYSFS_EnumerateCallback)(void *data, + const char *origdir, const char *fname); + +/** + * \fn int PHYSFS_enumerate(const char *dir, PHYSFS_EnumerateCallback c, void *d) + * \brief Get a file listing of a search path's directory, using an application-defined callback, with errors reported. + * + * Internally, PHYSFS_enumerateFiles() just calls this function and then builds + * a list before returning to the application, so functionality is identical + * except for how the information is represented to the application. + * + * Unlike PHYSFS_enumerateFiles(), this function does not return an array. + * Rather, it calls a function specified by the application once per + * element of the search path: + * + * \code + * + * static int printDir(void *data, const char *origdir, const char *fname) + * { + * printf(" * We've got [%s] in [%s].\n", fname, origdir); + * return 1; // give me more data, please. + * } + * + * // ... + * PHYSFS_enumerate("/some/path", printDir, NULL); + * \endcode + * + * Items sent to the callback are not guaranteed to be in any order whatsoever. + * There is no sorting done at this level, and if you need that, you should + * probably use PHYSFS_enumerateFiles() instead, which guarantees + * alphabetical sorting. This form reports whatever is discovered in each + * archive before moving on to the next. Even within one archive, we can't + * guarantee what order it will discover data. Any sorting you find in + * these callbacks is just pure luck. Do not rely on it. As this walks + * the entire list of archives, you may receive duplicate filenames. + * + * This API and the callbacks themselves are capable of reporting errors. + * Prior to this API, callbacks had to accept every enumerated item, even if + * they were only looking for a specific thing and wanted to stop after that, + * or had a serious error and couldn't alert anyone. Furthermore, if + * PhysicsFS itself had a problem (disk error or whatnot), it couldn't report + * it to the calling app, it would just have to skip items or stop + * enumerating outright, and the caller wouldn't know it had lost some data + * along the way. + * + * Now the caller can be sure it got a complete data set, and its callback has + * control if it wants enumeration to stop early. See the documentation for + * PHYSFS_EnumerateCallback for details on how your callback should behave. + * + * \param dir Directory, in platform-independent notation, to enumerate. + * \param c Callback function to notify about search path elements. + * \param d Application-defined data passed to callback. Can be NULL. + * \return non-zero on success, zero on failure. Use + * PHYSFS_getLastErrorCode() to obtain the specific error. If the + * callback returns PHYSFS_ENUM_STOP to stop early, this will be + * considered success. Callbacks returning PHYSFS_ENUM_ERROR will + * make this function return zero and set the error code to + * PHYSFS_ERR_APP_CALLBACK. + * + * \sa PHYSFS_EnumerateCallback + * \sa PHYSFS_enumerateFiles + */ +PHYSFS_DECL int PHYSFS_enumerate(const char *dir, PHYSFS_EnumerateCallback c, + void *d); + + +/** + * \fn int PHYSFS_unmount(const char *oldDir) + * \brief Remove a directory or archive from the search path. + * + * This is functionally equivalent to PHYSFS_removeFromSearchPath(), but that + * function is deprecated to keep the vocabulary paired with PHYSFS_mount(). + * + * This must be a (case-sensitive) match to a dir or archive already in the + * search path, specified in platform-dependent notation. + * + * This call will fail (and fail to remove from the path) if the element still + * has files open in it. + * + * \warning This function wants the path to the archive or directory that was + * mounted (the same string used for the "newDir" argument of + * PHYSFS_addToSearchPath or any of the mount functions), not the + * path where it is mounted in the tree (the "mountPoint" argument + * to any of the mount functions). + * + * \param oldDir dir/archive to remove. + * \return nonzero on success, zero on failure. Use + * PHYSFS_getLastErrorCode() to obtain the specific error. + * + * \sa PHYSFS_getSearchPath + * \sa PHYSFS_mount + */ +PHYSFS_DECL int PHYSFS_unmount(const char *oldDir); + + +/** + * \fn const PHYSFS_Allocator *PHYSFS_getAllocator(void) + * \brief Discover the current allocator. + * + * (This is for limited, hardcore use. If you don't immediately see a need + * for it, you can probably ignore this forever.) + * + * This function exposes the function pointers that make up the currently used + * allocator. This can be useful for apps that want to access PhysicsFS's + * internal, default allocation routines, as well as for external code that + * wants to share the same allocator, even if the application specified their + * own. + * + * This call is only valid between PHYSFS_init() and PHYSFS_deinit() calls; + * it will return NULL if the library isn't initialized. As we can't + * guarantee the state of the internal allocators unless the library is + * initialized, you shouldn't use any allocator returned here after a call + * to PHYSFS_deinit(). + * + * Do not call the returned allocator's Init() or Deinit() methods under any + * circumstances. + * + * If you aren't immediately sure what to do with this function, you can + * safely ignore it altogether. + * + * \return Current allocator, as set by PHYSFS_setAllocator(), or PhysicsFS's + * internal, default allocator if no application defined allocator + * is currently set. Will return NULL if the library is not + * initialized. + * + * \sa PHYSFS_Allocator + * \sa PHYSFS_setAllocator + */ +PHYSFS_DECL const PHYSFS_Allocator *PHYSFS_getAllocator(void); + + +/** + * \enum PHYSFS_FileType + * \brief Type of a File + * + * Possible types of a file. + * + * \sa PHYSFS_stat + */ +typedef enum PHYSFS_FileType +{ + PHYSFS_FILETYPE_REGULAR, /**< a normal file */ + PHYSFS_FILETYPE_DIRECTORY, /**< a directory */ + PHYSFS_FILETYPE_SYMLINK, /**< a symlink */ + PHYSFS_FILETYPE_OTHER /**< something completely different like a device */ +} PHYSFS_FileType; + +/** + * \struct PHYSFS_Stat + * \brief Meta data for a file or directory + * + * Container for various meta data about a file in the virtual file system. + * PHYSFS_stat() uses this structure for returning the information. The time + * data will be either the number of seconds since the Unix epoch (midnight, + * Jan 1, 1970), or -1 if the information isn't available or applicable. + * The (filesize) field is measured in bytes. + * The (readonly) field tells you whether the archive thinks a file is + * not writable, but tends to be only an estimate (for example, your write + * dir might overlap with a .zip file, meaning you _can_ successfully open + * that path for writing, as it gets created elsewhere. + * + * \sa PHYSFS_stat + * \sa PHYSFS_FileType + */ +typedef struct PHYSFS_Stat +{ + PHYSFS_sint64 filesize; /**< size in bytes, -1 for non-files and unknown */ + PHYSFS_sint64 modtime; /**< last modification time */ + PHYSFS_sint64 createtime; /**< like modtime, but for file creation time */ + PHYSFS_sint64 accesstime; /**< like modtime, but for file access time */ + PHYSFS_FileType filetype; /**< File? Directory? Symlink? */ + int readonly; /**< non-zero if read only, zero if writable. */ +} PHYSFS_Stat; + +/** + * \fn int PHYSFS_stat(const char *fname, PHYSFS_Stat *stat) + * \brief Get various information about a directory or a file. + * + * Obtain various information about a file or directory from the meta data. + * + * This function will never follow symbolic links. If you haven't enabled + * symlinks with PHYSFS_permitSymbolicLinks(), stat'ing a symlink will be + * treated like stat'ing a non-existant file. If symlinks are enabled, + * stat'ing a symlink will give you information on the link itself and not + * what it points to. + * + * \param fname filename to check, in platform-indepedent notation. + * \param stat pointer to structure to fill in with data about (fname). + * \return non-zero on success, zero on failure. On failure, (stat)'s + * contents are undefined. + * + * \sa PHYSFS_Stat + */ +PHYSFS_DECL int PHYSFS_stat(const char *fname, PHYSFS_Stat *stat); + + +/** + * \fn void PHYSFS_utf8FromUtf16(const PHYSFS_uint16 *src, char *dst, PHYSFS_uint64 len) + * \brief Convert a UTF-16 string to a UTF-8 string. + * + * \warning This function will not report an error if there are invalid UTF-16 + * sequences in the source string. It will replace them with a '?' + * character and continue on. + * + * UTF-16 strings are 16-bits per character (except some chars, which are + * 32-bits): \c TCHAR on Windows, when building with Unicode support. Modern + * Windows releases use UTF-16. Windows releases before 2000 used TCHAR, but + * only handled UCS-2. UTF-16 _is_ UCS-2, except for the characters that + * are 4 bytes, which aren't representable in UCS-2 at all anyhow. If you + * aren't sure, you should be using UTF-16 at this point on Windows. + * + * To ensure that the destination buffer is large enough for the conversion, + * please allocate a buffer that is double the size of the source buffer. + * UTF-8 never uses more than 32-bits per character, so while it may shrink + * a UTF-16 string, it may also expand it. + * + * Strings that don't fit in the destination buffer will be truncated, but + * will always be null-terminated and never have an incomplete UTF-8 + * sequence at the end. If the buffer length is 0, this function does nothing. + * + * \param src Null-terminated source string in UTF-16 format. + * \param dst Buffer to store converted UTF-8 string. + * \param len Size, in bytes, of destination buffer. + */ +PHYSFS_DECL void PHYSFS_utf8FromUtf16(const PHYSFS_uint16 *src, char *dst, + PHYSFS_uint64 len); + +/** + * \fn PHYSFS_utf8ToUtf16(const char *src, PHYSFS_uint16 *dst, PHYSFS_uint64 len) + * \brief Convert a UTF-8 string to a UTF-16 string. + * + * \warning This function will not report an error if there are invalid UTF-8 + * sequences in the source string. It will replace them with a '?' + * character and continue on. + * + * UTF-16 strings are 16-bits per character (except some chars, which are + * 32-bits): \c TCHAR on Windows, when building with Unicode support. Modern + * Windows releases use UTF-16. Windows releases before 2000 used TCHAR, but + * only handled UCS-2. UTF-16 _is_ UCS-2, except for the characters that + * are 4 bytes, which aren't representable in UCS-2 at all anyhow. If you + * aren't sure, you should be using UTF-16 at this point on Windows. + * + * To ensure that the destination buffer is large enough for the conversion, + * please allocate a buffer that is double the size of the source buffer. + * UTF-8 uses from one to four bytes per character, but UTF-16 always uses + * two to four, so an entirely low-ASCII string will double in size! The + * UTF-16 characters that would take four bytes also take four bytes in UTF-8, + * so you don't need to allocate 4x the space just in case: double will do. + * + * Strings that don't fit in the destination buffer will be truncated, but + * will always be null-terminated and never have an incomplete UTF-16 + * surrogate pair at the end. If the buffer length is 0, this function does + * nothing. + * + * \param src Null-terminated source string in UTF-8 format. + * \param dst Buffer to store converted UTF-16 string. + * \param len Size, in bytes, of destination buffer. + * + * \sa PHYSFS_utf8ToUtf16 + */ +PHYSFS_DECL void PHYSFS_utf8ToUtf16(const char *src, PHYSFS_uint16 *dst, + PHYSFS_uint64 len); + + +/** + * \fn PHYSFS_sint64 PHYSFS_readBytes(PHYSFS_File *handle, void *buffer, PHYSFS_uint64 len) + * \brief Read bytes from a PhysicsFS filehandle + * + * The file must be opened for reading. + * + * \param handle handle returned from PHYSFS_openRead(). + * \param buffer buffer of at least (len) bytes to store read data into. + * \param len number of bytes being read from (handle). + * \return number of bytes read. This may be less than (len); this does not + * signify an error, necessarily (a short read may mean EOF). + * PHYSFS_getLastErrorCode() can shed light on the reason this might + * be < (len), as can PHYSFS_eof(). -1 if complete failure. + * + * \sa PHYSFS_eof + */ +PHYSFS_DECL PHYSFS_sint64 PHYSFS_readBytes(PHYSFS_File *handle, void *buffer, + PHYSFS_uint64 len); + +/** + * \fn PHYSFS_sint64 PHYSFS_writeBytes(PHYSFS_File *handle, const void *buffer, PHYSFS_uint64 len) + * \brief Write data to a PhysicsFS filehandle + * + * The file must be opened for writing. + * + * Please note that while (len) is an unsigned 64-bit integer, you are limited + * to 63 bits (9223372036854775807 bytes), so we can return a negative value + * on error. If length is greater than 0x7FFFFFFFFFFFFFFF, this function will + * immediately fail. For systems without a 64-bit datatype, you are limited + * to 31 bits (0x7FFFFFFF, or 2147483647 bytes). We trust most things won't + * need to do multiple gigabytes of i/o in one call anyhow, but why limit + * things? + * + * \param handle retval from PHYSFS_openWrite() or PHYSFS_openAppend(). + * \param buffer buffer of (len) bytes to write to (handle). + * \param len number of bytes being written to (handle). + * \return number of bytes written. This may be less than (len); in the case + * of an error, the system may try to write as many bytes as possible, + * so an incomplete write might occur. PHYSFS_getLastErrorCode() can + * shed light on the reason this might be < (len). -1 if complete + * failure. + */ +PHYSFS_DECL PHYSFS_sint64 PHYSFS_writeBytes(PHYSFS_File *handle, + const void *buffer, + PHYSFS_uint64 len); + + +/** + * \struct PHYSFS_Io + * \brief An abstract i/o interface. + * + * \warning This is advanced, hardcore stuff. You don't need this unless you + * really know what you're doing. Most apps will not need this. + * + * Historically, PhysicsFS provided access to the physical filesystem and + * archives within that filesystem. However, sometimes you need more power + * than this. Perhaps you need to provide an archive that is entirely + * contained in RAM, or you need to bridge some other file i/o API to + * PhysicsFS, or you need to translate the bits (perhaps you have a + * a standard .zip file that's encrypted, and you need to decrypt on the fly + * for the unsuspecting zip archiver). + * + * A PHYSFS_Io is the interface that Archivers use to get archive data. + * Historically, this has mapped to file i/o to the physical filesystem, but + * as of PhysicsFS 2.1, applications can provide their own i/o implementations + * at runtime. + * + * This interface isn't necessarily a good universal fit for i/o. There are a + * few requirements of note: + * + * - They only do blocking i/o (at least, for now). + * - They need to be able to duplicate. If you have a file handle from + * fopen(), you need to be able to create a unique clone of it (so we + * have two handles to the same file that can both seek/read/etc without + * stepping on each other). + * - They need to know the size of their entire data set. + * - They need to be able to seek and rewind on demand. + * + * ...in short, you're probably not going to write an HTTP implementation. + * + * Thread safety: PHYSFS_Io implementations are not guaranteed to be thread + * safe in themselves. Under the hood where PhysicsFS uses them, the library + * provides its own locks. If you plan to use them directly from separate + * threads, you should either use mutexes to protect them, or don't use the + * same PHYSFS_Io from two threads at the same time. + * + * \sa PHYSFS_mountIo + */ +typedef struct PHYSFS_Io +{ + /** + * \brief Binary compatibility information. + * + * This must be set to zero at this time. Future versions of this + * struct will increment this field, so we know what a given + * implementation supports. We'll presumably keep supporting older + * versions as we offer new features, though. + */ + PHYSFS_uint32 version; + + /** + * \brief Instance data for this struct. + * + * Each instance has a pointer associated with it that can be used to + * store anything it likes. This pointer is per-instance of the stream, + * so presumably it will change when calling duplicate(). This can be + * deallocated during the destroy() method. + */ + void *opaque; + + /** + * \brief Read more data. + * + * Read (len) bytes from the interface, at the current i/o position, and + * store them in (buffer). The current i/o position should move ahead + * by the number of bytes successfully read. + * + * You don't have to implement this; set it to NULL if not implemented. + * This will only be used if the file is opened for reading. If set to + * NULL, a default implementation that immediately reports failure will + * be used. + * + * \param io The i/o instance to read from. + * \param buf The buffer to store data into. It must be at least + * (len) bytes long and can't be NULL. + * \param len The number of bytes to read from the interface. + * \return number of bytes read from file, 0 on EOF, -1 if complete + * failure. + */ + PHYSFS_sint64 (*read)(struct PHYSFS_Io *io, void *buf, PHYSFS_uint64 len); + + /** + * \brief Write more data. + * + * Write (len) bytes from (buffer) to the interface at the current i/o + * position. The current i/o position should move ahead by the number of + * bytes successfully written. + * + * You don't have to implement this; set it to NULL if not implemented. + * This will only be used if the file is opened for writing. If set to + * NULL, a default implementation that immediately reports failure will + * be used. + * + * You are allowed to buffer; a write can succeed here and then later + * fail when flushing. Note that PHYSFS_setBuffer() may be operating a + * level above your i/o, so you should usually not implement your + * own buffering routines. + * + * \param io The i/o instance to write to. + * \param buffer The buffer to read data from. It must be at least + * (len) bytes long and can't be NULL. + * \param len The number of bytes to read from (buffer). + * \return number of bytes written to file, -1 if complete failure. + */ + PHYSFS_sint64 (*write)(struct PHYSFS_Io *io, const void *buffer, + PHYSFS_uint64 len); + + /** + * \brief Move i/o position to a given byte offset from start. + * + * This method moves the i/o position, so the next read/write will + * be of the byte at (offset) offset. Seeks past the end of file should + * be treated as an error condition. + * + * \param io The i/o instance to seek. + * \param offset The new byte offset for the i/o position. + * \return non-zero on success, zero on error. + */ + int (*seek)(struct PHYSFS_Io *io, PHYSFS_uint64 offset); + + /** + * \brief Report current i/o position. + * + * Return bytes offset, or -1 if you aren't able to determine. A failure + * will almost certainly be fatal to further use of this stream, so you + * may not leave this unimplemented. + * + * \param io The i/o instance to query. + * \return The current byte offset for the i/o position, -1 if unknown. + */ + PHYSFS_sint64 (*tell)(struct PHYSFS_Io *io); + + /** + * \brief Determine size of the i/o instance's dataset. + * + * Return number of bytes available in the file, or -1 if you + * aren't able to determine. A failure will almost certainly be fatal + * to further use of this stream, so you may not leave this unimplemented. + * + * \param io The i/o instance to query. + * \return Total size, in bytes, of the dataset. + */ + PHYSFS_sint64 (*length)(struct PHYSFS_Io *io); + + /** + * \brief Duplicate this i/o instance. + * + * This needs to result in a full copy of this PHYSFS_Io, that can live + * completely independently. The copy needs to be able to perform all + * its operations without altering the original, including either object + * being destroyed separately (so, for example: they can't share a file + * handle; they each need their own). + * + * If you can't duplicate a handle, it's legal to return NULL, but you + * almost certainly need this functionality if you want to use this to + * PHYSFS_Io to back an archive. + * + * \param io The i/o instance to duplicate. + * \return A new value for a stream's (opaque) field, or NULL on error. + */ + struct PHYSFS_Io *(*duplicate)(struct PHYSFS_Io *io); + + /** + * \brief Flush resources to media, or wherever. + * + * This is the chance to report failure for writes that had claimed + * success earlier, but still had a chance to actually fail. This method + * can be NULL if flushing isn't necessary. + * + * This function may be called before destroy(), as it can report failure + * and destroy() can not. It may be called at other times, too. + * + * \param io The i/o instance to flush. + * \return Zero on error, non-zero on success. + */ + int (*flush)(struct PHYSFS_Io *io); + + /** + * \brief Cleanup and deallocate i/o instance. + * + * Free associated resources, including (opaque) if applicable. + * + * This function must always succeed: as such, it returns void. The + * system may call your flush() method before this. You may report + * failure there if necessary. This method may still be called if + * flush() fails, in which case you'll have to abandon unflushed data + * and other failing conditions and clean up. + * + * Once this method is called for a given instance, the system will assume + * it is unsafe to touch that instance again and will discard any + * references to it. + * + * \param s The i/o instance to destroy. + */ + void (*destroy)(struct PHYSFS_Io *io); +} PHYSFS_Io; + + +/** + * \fn int PHYSFS_mountIo(PHYSFS_Io *io, const char *newDir, const char *mountPoint, int appendToPath) + * \brief Add an archive, built on a PHYSFS_Io, to the search path. + * + * \warning Unless you have some special, low-level need, you should be using + * PHYSFS_mount() instead of this. + * + * This function operates just like PHYSFS_mount(), but takes a PHYSFS_Io + * instead of a pathname. Behind the scenes, PHYSFS_mount() calls this + * function with a physical-filesystem-based PHYSFS_Io. + * + * (newDir) must be a unique string to identify this archive. It is used + * to optimize archiver selection (if you name it XXXXX.zip, we might try + * the ZIP archiver first, for example, or directly choose an archiver that + * can only trust the data is valid by filename extension). It doesn't + * need to refer to a real file at all. If the filename extension isn't + * helpful, the system will try every archiver until one works or none + * of them do. This filename must be unique, as the system won't allow you + * to have two archives with the same name. + * + * (io) must remain until the archive is unmounted. When the archive is + * unmounted, the system will call (io)->destroy(io), which will give you + * a chance to free your resources. + * + * If this function fails, (io)->destroy(io) is not called. + * + * \param io i/o instance for archive to add to the path. + * \param newDir Filename that can represent this stream. + * \param mountPoint Location in the interpolated tree that this archive + * will be "mounted", in platform-independent notation. + * NULL or "" is equivalent to "/". + * \param appendToPath nonzero to append to search path, zero to prepend. + * \return nonzero if added to path, zero on failure (bogus archive, stream + * i/o issue, etc). Use PHYSFS_getLastErrorCode() to obtain + * the specific error. + * + * \sa PHYSFS_unmount + * \sa PHYSFS_getSearchPath + * \sa PHYSFS_getMountPoint + */ +PHYSFS_DECL int PHYSFS_mountIo(PHYSFS_Io *io, const char *newDir, + const char *mountPoint, int appendToPath); + + +/** + * \fn int PHYSFS_mountMemory(const void *buf, PHYSFS_uint64 len, void (*del)(void *), const char *newDir, const char *mountPoint, int appendToPath) + * \brief Add an archive, contained in a memory buffer, to the search path. + * + * \warning Unless you have some special, low-level need, you should be using + * PHYSFS_mount() instead of this. + * + * This function operates just like PHYSFS_mount(), but takes a memory buffer + * instead of a pathname. This buffer contains all the data of the archive, + * and is used instead of a real file in the physical filesystem. + * + * (newDir) must be a unique string to identify this archive. It is used + * to optimize archiver selection (if you name it XXXXX.zip, we might try + * the ZIP archiver first, for example, or directly choose an archiver that + * can only trust the data is valid by filename extension). It doesn't + * need to refer to a real file at all. If the filename extension isn't + * helpful, the system will try every archiver until one works or none + * of them do. This filename must be unique, as the system won't allow you + * to have two archives with the same name. + * + * (ptr) must remain until the archive is unmounted. When the archive is + * unmounted, the system will call (del)(ptr), which will notify you that + * the system is done with the buffer, and give you a chance to free your + * resources. (del) can be NULL, in which case the system will make no + * attempt to free the buffer. + * + * If this function fails, (del) is not called. + * + * \param buf Address of the memory buffer containing the archive data. + * \param len Size of memory buffer, in bytes. + * \param del A callback that triggers upon unmount. Can be NULL. + * \param newDir Filename that can represent this stream. + * \param mountPoint Location in the interpolated tree that this archive + * will be "mounted", in platform-independent notation. + * NULL or "" is equivalent to "/". + * \param appendToPath nonzero to append to search path, zero to prepend. + * \return nonzero if added to path, zero on failure (bogus archive, etc). + * Use PHYSFS_getLastErrorCode() to obtain the specific error. + * + * \sa PHYSFS_unmount + * \sa PHYSFS_getSearchPath + * \sa PHYSFS_getMountPoint + */ +PHYSFS_DECL int PHYSFS_mountMemory(const void *buf, PHYSFS_uint64 len, + void (*del)(void *), const char *newDir, + const char *mountPoint, int appendToPath); + + +/** + * \fn int PHYSFS_mountHandle(PHYSFS_File *file, const char *newDir, const char *mountPoint, int appendToPath) + * \brief Add an archive, contained in a PHYSFS_File handle, to the search path. + * + * \warning Unless you have some special, low-level need, you should be using + * PHYSFS_mount() instead of this. + * + * \warning Archives-in-archives may be very slow! While a PHYSFS_File can + * seek even when the data is compressed, it may do so by rewinding + * to the start and decompressing everything before the seek point. + * Normal archive usage may do a lot of seeking behind the scenes. + * As such, you might find normal archive usage extremely painful + * if mounted this way. Plan accordingly: if you, say, have a + * self-extracting .zip file, and want to mount something in it, + * compress the contents of the inner archive and make sure the outer + * .zip file doesn't compress the inner archive too. + * + * This function operates just like PHYSFS_mount(), but takes a PHYSFS_File + * handle instead of a pathname. This handle contains all the data of the + * archive, and is used instead of a real file in the physical filesystem. + * The PHYSFS_File may be backed by a real file in the physical filesystem, + * but isn't necessarily. The most popular use for this is likely to mount + * archives stored inside other archives. + * + * (newDir) must be a unique string to identify this archive. It is used + * to optimize archiver selection (if you name it XXXXX.zip, we might try + * the ZIP archiver first, for example, or directly choose an archiver that + * can only trust the data is valid by filename extension). It doesn't + * need to refer to a real file at all. If the filename extension isn't + * helpful, the system will try every archiver until one works or none + * of them do. This filename must be unique, as the system won't allow you + * to have two archives with the same name. + * + * (file) must remain until the archive is unmounted. When the archive is + * unmounted, the system will call PHYSFS_close(file). If you need this + * handle to survive, you will have to wrap this in a PHYSFS_Io and use + * PHYSFS_mountIo() instead. + * + * If this function fails, PHYSFS_close(file) is not called. + * + * \param file The PHYSFS_File handle containing archive data. + * \param newDir Filename that can represent this stream. + * \param mountPoint Location in the interpolated tree that this archive + * will be "mounted", in platform-independent notation. + * NULL or "" is equivalent to "/". + * \param appendToPath nonzero to append to search path, zero to prepend. + * \return nonzero if added to path, zero on failure (bogus archive, etc). + * Use PHYSFS_getLastErrorCode() to obtain the specific error. + * + * \sa PHYSFS_unmount + * \sa PHYSFS_getSearchPath + * \sa PHYSFS_getMountPoint + */ +PHYSFS_DECL int PHYSFS_mountHandle(PHYSFS_File *file, const char *newDir, + const char *mountPoint, int appendToPath); + + +/** + * \enum PHYSFS_ErrorCode + * \brief Values that represent specific causes of failure. + * + * Most of the time, you should only concern yourself with whether a given + * operation failed or not, but there may be occasions where you plan to + * handle a specific failure case gracefully, so we provide specific error + * codes. + * + * Most of these errors are a little vague, and most aren't things you can + * fix...if there's a permission error, for example, all you can really do + * is pass that information on to the user and let them figure out how to + * handle it. In most these cases, your program should only care that it + * failed to accomplish its goals, and not care specifically why. + * + * \sa PHYSFS_getLastErrorCode + * \sa PHYSFS_getErrorByCode + */ +typedef enum PHYSFS_ErrorCode +{ + PHYSFS_ERR_OK, /**< Success; no error. */ + PHYSFS_ERR_OTHER_ERROR, /**< Error not otherwise covered here. */ + PHYSFS_ERR_OUT_OF_MEMORY, /**< Memory allocation failed. */ + PHYSFS_ERR_NOT_INITIALIZED, /**< PhysicsFS is not initialized. */ + PHYSFS_ERR_IS_INITIALIZED, /**< PhysicsFS is already initialized. */ + PHYSFS_ERR_ARGV0_IS_NULL, /**< Needed argv[0], but it is NULL. */ + PHYSFS_ERR_UNSUPPORTED, /**< Operation or feature unsupported. */ + PHYSFS_ERR_PAST_EOF, /**< Attempted to access past end of file. */ + PHYSFS_ERR_FILES_STILL_OPEN, /**< Files still open. */ + PHYSFS_ERR_INVALID_ARGUMENT, /**< Bad parameter passed to an function. */ + PHYSFS_ERR_NOT_MOUNTED, /**< Requested archive/dir not mounted. */ + PHYSFS_ERR_NOT_FOUND, /**< File (or whatever) not found. */ + PHYSFS_ERR_SYMLINK_FORBIDDEN,/**< Symlink seen when not permitted. */ + PHYSFS_ERR_NO_WRITE_DIR, /**< No write dir has been specified. */ + PHYSFS_ERR_OPEN_FOR_READING, /**< Wrote to a file opened for reading. */ + PHYSFS_ERR_OPEN_FOR_WRITING, /**< Read from a file opened for writing. */ + PHYSFS_ERR_NOT_A_FILE, /**< Needed a file, got a directory (etc). */ + PHYSFS_ERR_READ_ONLY, /**< Wrote to a read-only filesystem. */ + PHYSFS_ERR_CORRUPT, /**< Corrupted data encountered. */ + PHYSFS_ERR_SYMLINK_LOOP, /**< Infinite symbolic link loop. */ + PHYSFS_ERR_IO, /**< i/o error (hardware failure, etc). */ + PHYSFS_ERR_PERMISSION, /**< Permission denied. */ + PHYSFS_ERR_NO_SPACE, /**< No space (disk full, over quota, etc) */ + PHYSFS_ERR_BAD_FILENAME, /**< Filename is bogus/insecure. */ + PHYSFS_ERR_BUSY, /**< Tried to modify a file the OS needs. */ + PHYSFS_ERR_DIR_NOT_EMPTY, /**< Tried to delete dir with files in it. */ + PHYSFS_ERR_OS_ERROR, /**< Unspecified OS-level error. */ + PHYSFS_ERR_DUPLICATE, /**< Duplicate entry. */ + PHYSFS_ERR_BAD_PASSWORD, /**< Bad password. */ + PHYSFS_ERR_APP_CALLBACK /**< Application callback reported error. */ +} PHYSFS_ErrorCode; + + +/** + * \fn PHYSFS_ErrorCode PHYSFS_getLastErrorCode(void) + * \brief Get machine-readable error information. + * + * Get the last PhysicsFS error message as an integer value. This will return + * PHYSFS_ERR_OK if there's been no error since the last call to this + * function. Each thread has a unique error state associated with it, but + * each time a new error message is set, it will overwrite the previous one + * associated with that thread. It is safe to call this function at anytime, + * even before PHYSFS_init(). + * + * PHYSFS_getLastError() and PHYSFS_getLastErrorCode() both reset the same + * thread-specific error state. Calling one will wipe out the other's + * data. If you need both, call PHYSFS_getLastErrorCode(), then pass that + * value to PHYSFS_getErrorByCode(). + * + * Generally, applications should only concern themselves with whether a + * given function failed; however, if you require more specifics, you can + * try this function to glean information, if there's some specific problem + * you're expecting and plan to handle. But with most things that involve + * file systems, the best course of action is usually to give up, report the + * problem to the user, and let them figure out what should be done about it. + * For that, you might prefer PHYSFS_getErrorByCode() instead. + * + * \return Enumeration value that represents last reported error. + * + * \sa PHYSFS_getErrorByCode + */ +PHYSFS_DECL PHYSFS_ErrorCode PHYSFS_getLastErrorCode(void); + + +/** + * \fn const char *PHYSFS_getErrorByCode(PHYSFS_ErrorCode code) + * \brief Get human-readable description string for a given error code. + * + * Get a static string, in UTF-8 format, that represents an English + * description of a given error code. + * + * This string is guaranteed to never change (although we may add new strings + * for new error codes in later versions of PhysicsFS), so you can use it + * for keying a localization dictionary. + * + * It is safe to call this function at anytime, even before PHYSFS_init(). + * + * These strings are meant to be passed on directly to the user. + * Generally, applications should only concern themselves with whether a + * given function failed, but not care about the specifics much. + * + * Do not attempt to free the returned strings; they are read-only and you + * don't own their memory pages. + * + * \param code Error code to convert to a string. + * \return READ ONLY string of requested error message, NULL if this + * is not a valid PhysicsFS error code. Always check for NULL if + * you might be looking up an error code that didn't exist in an + * earlier version of PhysicsFS. + * + * \sa PHYSFS_getLastErrorCode + */ +PHYSFS_DECL const char *PHYSFS_getErrorByCode(PHYSFS_ErrorCode code); + +/** + * \fn void PHYSFS_setErrorCode(PHYSFS_ErrorCode code) + * \brief Set the current thread's error code. + * + * This lets you set the value that will be returned by the next call to + * PHYSFS_getLastErrorCode(). This will replace any existing error code, + * whether set by your application or internally by PhysicsFS. + * + * Error codes are stored per-thread; what you set here will not be + * accessible to another thread. + * + * Any call into PhysicsFS may change the current error code, so any code you + * set here is somewhat fragile, and thus you shouldn't build any serious + * error reporting framework on this function. The primary goal of this + * function is to allow PHYSFS_Io implementations to set the error state, + * which generally will be passed back to your application when PhysicsFS + * makes a PHYSFS_Io call that fails internally. + * + * This function doesn't care if the error code is a value known to PhysicsFS + * or not (but PHYSFS_getErrorByCode() will return NULL for unknown values). + * The value will be reported unmolested by PHYSFS_getLastErrorCode(). + * + * \param code Error code to become the current thread's new error state. + * + * \sa PHYSFS_getLastErrorCode + * \sa PHYSFS_getErrorByCode + */ +PHYSFS_DECL void PHYSFS_setErrorCode(PHYSFS_ErrorCode code); + + +/** + * \fn const char *PHYSFS_getPrefDir(const char *org, const char *app) + * \brief Get the user-and-app-specific path where files can be written. + * + * Helper function. + * + * Get the "pref dir". This is meant to be where users can write personal + * files (preferences and save games, etc) that are specific to your + * application. This directory is unique per user, per application. + * + * This function will decide the appropriate location in the native filesystem, + * create the directory if necessary, and return a string in + * platform-dependent notation, suitable for passing to PHYSFS_setWriteDir(). + * + * On Windows, this might look like: + * "C:\\Users\\bob\\AppData\\Roaming\\My Company\\My Program Name" + * + * On Linux, this might look like: + * "/home/bob/.local/share/My Program Name" + * + * On Mac OS X, this might look like: + * "/Users/bob/Library/Application Support/My Program Name" + * + * (etc.) + * + * You should probably use the pref dir for your write dir, and also put it + * near the beginning of your search path. Older versions of PhysicsFS + * offered only PHYSFS_getUserDir() and left you to figure out where the + * files should go under that tree. This finds the correct location + * for whatever platform, which not only changes between operating systems, + * but also versions of the same operating system. + * + * You specify the name of your organization (if it's not a real organization, + * your name or an Internet domain you own might do) and the name of your + * application. These should be proper names. + * + * Both the (org) and (app) strings may become part of a directory name, so + * please follow these rules: + * + * - Try to use the same org string (including case-sensitivity) for + * all your applications that use this function. + * - Always use a unique app string for each one, and make sure it never + * changes for an app once you've decided on it. + * - Unicode characters are legal, as long as it's UTF-8 encoded, but... + * - ...only use letters, numbers, and spaces. Avoid punctuation like + * "Game Name 2: Bad Guy's Revenge!" ... "Game Name 2" is sufficient. + * + * The pointer returned by this function remains valid until you call this + * function again, or call PHYSFS_deinit(). This is not necessarily a fast + * call, though, so you should call this once at startup and copy the string + * if you need it. + * + * You should assume the path returned by this function is the only safe + * place to write files (and that PHYSFS_getUserDir() and PHYSFS_getBaseDir(), + * while they might be writable, or even parents of the returned path, aren't + * where you should be writing things). + * + * \param org The name of your organization. + * \param app The name of your application. + * \return READ ONLY string of user dir in platform-dependent notation. NULL + * if there's a problem (creating directory failed, etc). + * + * \sa PHYSFS_getBaseDir + * \sa PHYSFS_getUserDir + */ +PHYSFS_DECL const char *PHYSFS_getPrefDir(const char *org, const char *app); + + +/** + * \struct PHYSFS_Archiver + * \brief Abstract interface to provide support for user-defined archives. + * + * \warning This is advanced, hardcore stuff. You don't need this unless you + * really know what you're doing. Most apps will not need this. + * + * Historically, PhysicsFS provided a means to mount various archive file + * formats, and physical directories in the native filesystem. However, + * applications have been limited to the file formats provided by the + * library. This interface allows an application to provide their own + * archive file types. + * + * Conceptually, a PHYSFS_Archiver provides directory entries, while + * PHYSFS_Io provides data streams for those directory entries. The most + * obvious use of PHYSFS_Archiver is to provide support for an archive + * file type that isn't provided by PhysicsFS directly: perhaps some + * proprietary format that only your application needs to understand. + * + * Internally, all the built-in archive support uses this interface, so the + * best examples for building a PHYSFS_Archiver is the source code to + * PhysicsFS itself. + * + * An archiver is added to the system with PHYSFS_registerArchiver(), and then + * it will be available for use automatically with PHYSFS_mount(); if a + * given archive can be handled with your archiver, it will be given control + * as appropriate. + * + * These methods deal with dir handles. You have one instance of your + * archiver, and it generates a unique, opaque handle for each opened + * archive in its openArchive() method. Since the lifetime of an Archiver + * (not an archive) is generally the entire lifetime of the process, and it's + * assumed to be a singleton, we do not provide any instance data for the + * archiver itself; the app can just use some static variables if necessary. + * + * Symlinks should always be followed (except in stat()); PhysicsFS will + * use the stat() method to check for symlinks and make a judgement on + * whether to continue to call other methods based on that. + * + * Archivers, when necessary, should set the PhysicsFS error state with + * PHYSFS_setErrorCode() before returning. PhysicsFS will pass these errors + * back to the application unmolested in most cases. + * + * Thread safety: PHYSFS_Archiver implementations are not guaranteed to be + * thread safe in themselves. PhysicsFS provides thread safety when it calls + * into a given archiver inside the library, but it does not promise that + * using the same PHYSFS_File from two threads at once is thread-safe; as + * such, your PHYSFS_Archiver can assume that locking is handled for you + * so long as the PHYSFS_Io you return from PHYSFS_open* doesn't change any + * of your Archiver state, as the PHYSFS_Io won't be as aggressively + * protected. + * + * \sa PHYSFS_registerArchiver + * \sa PHYSFS_deregisterArchiver + * \sa PHYSFS_supportedArchiveTypes + */ +typedef struct PHYSFS_Archiver +{ + /** + * \brief Binary compatibility information. + * + * This must be set to zero at this time. Future versions of this + * struct will increment this field, so we know what a given + * implementation supports. We'll presumably keep supporting older + * versions as we offer new features, though. + */ + PHYSFS_uint32 version; + + /** + * \brief Basic info about this archiver. + * + * This is used to identify your archive, and is returned in + * PHYSFS_supportedArchiveTypes(). + */ + PHYSFS_ArchiveInfo info; + + /** + * \brief Open an archive provided by (io). + * + * This is where resources are allocated and data is parsed when mounting + * an archive. + * (name) is a filename associated with (io), but doesn't necessarily + * map to anything, let alone a real filename. This possibly- + * meaningless name is in platform-dependent notation. + * (forWrite) is non-zero if this is to be used for + * the write directory, and zero if this is to be used for an + * element of the search path. + * (claimed) should be set to 1 if this is definitely an archive your + * archiver implementation can handle, even if it fails. We use to + * decide if we should stop trying other archivers if you fail to open + * it. For example: the .zip archiver will set this to 1 for something + * that's got a .zip file signature, even if it failed because the file + * was also truncated. No sense in trying other archivers here, we + * already tried to handle it with the appropriate implementation!. + * Return NULL on failure and set (claimed) appropriately. If no archiver + * opened the archive or set (claimed), PHYSFS_mount() will report + * PHYSFS_ERR_UNSUPPORTED. Otherwise, it will report the error from the + * archiver that claimed the data through (claimed). + * Return non-NULL on success. The pointer returned will be + * passed as the "opaque" parameter for later calls. + */ + void *(*openArchive)(PHYSFS_Io *io, const char *name, + int forWrite, int *claimed); + + /** + * \brief List all files in (dirname). + * + * Each file is passed to (cb), where a copy is made if appropriate, so + * you can dispose of it upon return from the callback. (dirname) is in + * platform-independent notation. + * If you have a failure, call PHYSFS_SetErrorCode() with whatever code + * seem appropriate and return PHYSFS_ENUM_ERROR. + * If the callback returns PHYSFS_ENUM_ERROR, please call + * PHYSFS_SetErrorCode(PHYSFS_ERR_APP_CALLBACK) and then return + * PHYSFS_ENUM_ERROR as well. Don't call the callback again in any + * circumstances. + * If the callback returns PHYSFS_ENUM_STOP, stop enumerating and return + * PHYSFS_ENUM_STOP as well. Don't call the callback again in any + * circumstances. Don't set an error code in this case. + * Callbacks are only supposed to return a value from + * PHYSFS_EnumerateCallbackResult. Any other result has undefined + * behavior. + * As long as the callback returned PHYSFS_ENUM_OK and you haven't + * experienced any errors of your own, keep enumerating until you're done + * and then return PHYSFS_ENUM_OK without setting an error code. + * + * \warning PHYSFS_enumerate returns zero or non-zero (success or failure), + * so be aware this function pointer returns different values! + */ + PHYSFS_EnumerateCallbackResult (*enumerate)(void *opaque, + const char *dirname, PHYSFS_EnumerateCallback cb, + const char *origdir, void *callbackdata); + + /** + * \brief Open a file in this archive for reading. + * + * This filename, (fnm), is in platform-independent notation. + * Fail if the file does not exist. + * Returns NULL on failure, and calls PHYSFS_setErrorCode(). + * Returns non-NULL on success. The pointer returned will be + * passed as the "opaque" parameter for later file calls. + */ + PHYSFS_Io *(*openRead)(void *opaque, const char *fnm); + + /** + * \brief Open a file in this archive for writing. + * + * If the file does not exist, it should be created. If it exists, + * it should be truncated to zero bytes. The writing offset should + * be the start of the file. + * If the archive is read-only, this operation should fail. + * This filename is in platform-independent notation. + * Returns NULL on failure, and calls PHYSFS_setErrorCode(). + * Returns non-NULL on success. The pointer returned will be + * passed as the "opaque" parameter for later file calls. + */ + PHYSFS_Io *(*openWrite)(void *opaque, const char *filename); + + /** + * \brief Open a file in this archive for appending. + * + * If the file does not exist, it should be created. The writing + * offset should be the end of the file. + * If the archive is read-only, this operation should fail. + * This filename is in platform-independent notation. + * Returns NULL on failure, and calls PHYSFS_setErrorCode(). + * Returns non-NULL on success. The pointer returned will be + * passed as the "opaque" parameter for later file calls. + */ + PHYSFS_Io *(*openAppend)(void *opaque, const char *filename); + + /** + * \brief Delete a file or directory in the archive. + * + * This same call is used for both files and directories; there is not a + * separate rmdir() call. Directories are only meant to be removed if + * they are empty. + * If the archive is read-only, this operation should fail. + * + * Return non-zero on success, zero on failure. + * This filename is in platform-independent notation. + * On failure, call PHYSFS_setErrorCode(). + */ + int (*remove)(void *opaque, const char *filename); + + /** + * \brief Create a directory in the archive. + * + * If the application is trying to make multiple dirs, PhysicsFS + * will split them up into multiple calls before passing them to + * your driver. + * If the archive is read-only, this operation should fail. + * Return non-zero on success, zero on failure. + * This filename is in platform-independent notation. + * On failure, call PHYSFS_setErrorCode(). + */ + int (*mkdir)(void *opaque, const char *filename); + + /** + * \brief Obtain basic file metadata. + * + * On success, fill in all the fields in (stat), using + * reasonable defaults for fields that apply to your archive. + * + * Returns non-zero on success, zero on failure. + * This filename is in platform-independent notation. + * On failure, call PHYSFS_setErrorCode(). + */ + int (*stat)(void *opaque, const char *fn, PHYSFS_Stat *stat); + + /** + * \brief Destruct a previously-opened archive. + * + * Close this archive, and free any associated memory, + * including the original PHYSFS_Io and (opaque) itself, if + * applicable. Implementation can assume that it won't be called if + * there are still files open from this archive. + */ + void (*closeArchive)(void *opaque); +} PHYSFS_Archiver; + +/** + * \fn int PHYSFS_registerArchiver(const PHYSFS_Archiver *archiver) + * \brief Add a new archiver to the system. + * + * \warning This is advanced, hardcore stuff. You don't need this unless you + * really know what you're doing. Most apps will not need this. + * + * If you want to provide your own archiver (for example, a custom archive + * file format, or some virtual thing you want to make look like a filesystem + * that you can access through the usual PhysicsFS APIs), this is where you + * start. Once an archiver is successfully registered, then you can use + * PHYSFS_mount() to add archives that your archiver supports to the + * search path, or perhaps use it as the write dir. Internally, PhysicsFS + * uses this function to register its own built-in archivers, like .zip + * support, etc. + * + * You may not have two archivers that handle the same extension. If you are + * going to have a clash, you can deregister the other archiver (including + * built-in ones) with PHYSFS_deregisterArchiver(). + * + * The data in (archiver) is copied; you may free this pointer when this + * function returns. + * + * Once this function returns successfully, PhysicsFS will be able to support + * archives of this type until you deregister the archiver again. + * + * \param archiver The archiver to register. + * \return Zero on error, non-zero on success. + * + * \sa PHYSFS_Archiver + * \sa PHYSFS_deregisterArchiver + */ +PHYSFS_DECL int PHYSFS_registerArchiver(const PHYSFS_Archiver *archiver); + +/** + * \fn int PHYSFS_deregisterArchiver(const char *ext) + * \brief Remove an archiver from the system. + * + * If for some reason, you only need your previously-registered archiver to + * live for a portion of your app's lifetime, you can remove it from the + * system once you're done with it through this function. + * + * This fails if there are any archives still open that use this archiver. + * + * This function can also remove internally-supplied archivers, like .zip + * support or whatnot. This could be useful in some situations, like + * disabling support for them outright or overriding them with your own + * implementation. Once an internal archiver is disabled like this, + * PhysicsFS provides no mechanism to recover them, short of calling + * PHYSFS_deinit() and PHYSFS_init() again. + * + * PHYSFS_deinit() will automatically deregister all archivers, so you don't + * need to explicitly deregister yours if you otherwise shut down cleanly. + * + * \param ext Filename extension that the archiver handles. + * \return Zero on error, non-zero on success. + * + * \sa PHYSFS_Archiver + * \sa PHYSFS_registerArchiver + */ +PHYSFS_DECL int PHYSFS_deregisterArchiver(const char *ext); + + +/* Everything above this line is part of the PhysicsFS 2.1 API. */ + +#ifdef __cplusplus +} +#endif + +#endif /* !defined _INCLUDE_PHYSFS_H_ */ + +/* end of physfs.h ... */ + diff --git a/third_party/physfs/physfs_archiver_dir.c b/third_party/physfs/physfs_archiver_dir.c new file mode 100644 index 00000000..61c0da3f --- /dev/null +++ b/third_party/physfs/physfs_archiver_dir.c @@ -0,0 +1,196 @@ +/* + * Standard directory I/O support routines for PhysicsFS. + * + * Please see the file LICENSE.txt in the source's root directory. + * + * This file written by Ryan C. Gordon. + */ + +#define __PHYSICSFS_INTERNAL__ +#include "physfs_internal.h" + +/* There's no PHYSFS_Io interface here. Use __PHYSFS_createNativeIo(). */ + + + +static char *cvtToDependent(const char *prepend, const char *path, + char *buf, const size_t buflen) +{ + BAIL_IF(buf == NULL, PHYSFS_ERR_OUT_OF_MEMORY, NULL); + snprintf(buf, buflen, "%s%s", prepend ? prepend : "", path); + + #if !__PHYSFS_STANDARD_DIRSEP + assert(__PHYSFS_platformDirSeparator != '/'); + { + char *p; + for (p = strchr(buf, '/'); p != NULL; p = strchr(p + 1, '/')) + *p = __PHYSFS_platformDirSeparator; + } /* if */ + #endif + + return buf; +} /* cvtToDependent */ + + +#define CVT_TO_DEPENDENT(buf, pre, dir) { \ + const size_t len = ((pre) ? strlen((char *) pre) : 0) + strlen(dir) + 1; \ + buf = cvtToDependent((char*)pre,dir,(char*)__PHYSFS_smallAlloc(len),len); \ +} + + + +static void *DIR_openArchive(PHYSFS_Io *io, const char *name, + int forWriting, int *claimed) +{ + PHYSFS_Stat st; + const char dirsep = __PHYSFS_platformDirSeparator; + char *retval = NULL; + const size_t namelen = strlen(name); + const size_t seplen = 1; + + assert(io == NULL); /* shouldn't create an Io for these. */ + BAIL_IF_ERRPASS(!__PHYSFS_platformStat(name, &st, 1), NULL); + + if (st.filetype != PHYSFS_FILETYPE_DIRECTORY) + BAIL(PHYSFS_ERR_UNSUPPORTED, NULL); + + *claimed = 1; + retval = allocator.Malloc(namelen + seplen + 1); + BAIL_IF(retval == NULL, PHYSFS_ERR_OUT_OF_MEMORY, NULL); + + strcpy(retval, name); + + /* make sure there's a dir separator at the end of the string */ + if (retval[namelen - 1] != dirsep) + { + retval[namelen] = dirsep; + retval[namelen + 1] = '\0'; + } /* if */ + + return retval; +} /* DIR_openArchive */ + + +static PHYSFS_EnumerateCallbackResult DIR_enumerate(void *opaque, + const char *dname, PHYSFS_EnumerateCallback cb, + const char *origdir, void *callbackdata) +{ + char *d; + PHYSFS_EnumerateCallbackResult retval; + CVT_TO_DEPENDENT(d, opaque, dname); + BAIL_IF_ERRPASS(!d, PHYSFS_ENUM_ERROR); + retval = __PHYSFS_platformEnumerate(d, cb, origdir, callbackdata); + __PHYSFS_smallFree(d); + return retval; +} /* DIR_enumerate */ + + +static PHYSFS_Io *doOpen(void *opaque, const char *name, const int mode) +{ + PHYSFS_Io *io = NULL; + char *f = NULL; + + CVT_TO_DEPENDENT(f, opaque, name); + BAIL_IF_ERRPASS(!f, NULL); + + io = __PHYSFS_createNativeIo(f, mode); + if (io == NULL) + { + const PHYSFS_ErrorCode err = PHYSFS_getLastErrorCode(); + PHYSFS_Stat statbuf; + __PHYSFS_platformStat(f, &statbuf, 0); /* !!! FIXME: why are we stating here? */ + PHYSFS_setErrorCode(err); + } /* if */ + + __PHYSFS_smallFree(f); + + return io; +} /* doOpen */ + + +static PHYSFS_Io *DIR_openRead(void *opaque, const char *filename) +{ + return doOpen(opaque, filename, 'r'); +} /* DIR_openRead */ + + +static PHYSFS_Io *DIR_openWrite(void *opaque, const char *filename) +{ + return doOpen(opaque, filename, 'w'); +} /* DIR_openWrite */ + + +static PHYSFS_Io *DIR_openAppend(void *opaque, const char *filename) +{ + return doOpen(opaque, filename, 'a'); +} /* DIR_openAppend */ + + +static int DIR_remove(void *opaque, const char *name) +{ + int retval; + char *f; + + CVT_TO_DEPENDENT(f, opaque, name); + BAIL_IF_ERRPASS(!f, 0); + retval = __PHYSFS_platformDelete(f); + __PHYSFS_smallFree(f); + return retval; +} /* DIR_remove */ + + +static int DIR_mkdir(void *opaque, const char *name) +{ + int retval; + char *f; + + CVT_TO_DEPENDENT(f, opaque, name); + BAIL_IF_ERRPASS(!f, 0); + retval = __PHYSFS_platformMkDir(f); + __PHYSFS_smallFree(f); + return retval; +} /* DIR_mkdir */ + + +static void DIR_closeArchive(void *opaque) +{ + allocator.Free(opaque); +} /* DIR_closeArchive */ + + +static int DIR_stat(void *opaque, const char *name, PHYSFS_Stat *stat) +{ + int retval = 0; + char *d; + + CVT_TO_DEPENDENT(d, opaque, name); + BAIL_IF_ERRPASS(!d, 0); + retval = __PHYSFS_platformStat(d, stat, 0); + __PHYSFS_smallFree(d); + return retval; +} /* DIR_stat */ + + +const PHYSFS_Archiver __PHYSFS_Archiver_DIR = +{ + CURRENT_PHYSFS_ARCHIVER_API_VERSION, + { + "", + "Non-archive, direct filesystem I/O", + "Ryan C. Gordon ", + "https://icculus.org/physfs/", + 1, /* supportsSymlinks */ + }, + DIR_openArchive, + DIR_enumerate, + DIR_openRead, + DIR_openWrite, + DIR_openAppend, + DIR_remove, + DIR_mkdir, + DIR_stat, + DIR_closeArchive +}; + +/* end of physfs_archiver_dir.c ... */ + diff --git a/third_party/physfs/physfs_archiver_unpacked.c b/third_party/physfs/physfs_archiver_unpacked.c new file mode 100644 index 00000000..575efef3 --- /dev/null +++ b/third_party/physfs/physfs_archiver_unpacked.c @@ -0,0 +1,305 @@ +/* + * High-level PhysicsFS archiver for simple unpacked file formats. + * + * This is a framework that basic archivers build on top of. It's for simple + * formats that can just hand back a list of files and the offsets of their + * uncompressed data. There are an alarming number of formats like this. + * + * RULES: Archive entries must be uncompressed. Dirs and files allowed, but no + * symlinks, etc. We can relax some of these rules as necessary. + * + * Please see the file LICENSE.txt in the source's root directory. + * + * This file written by Ryan C. Gordon. + */ + +#define __PHYSICSFS_INTERNAL__ +#include "physfs_internal.h" + +typedef struct +{ + __PHYSFS_DirTree tree; + PHYSFS_Io *io; +} UNPKinfo; + +typedef struct +{ + __PHYSFS_DirTreeEntry tree; + PHYSFS_uint64 startPos; + PHYSFS_uint64 size; + PHYSFS_sint64 ctime; + PHYSFS_sint64 mtime; +} UNPKentry; + +typedef struct +{ + PHYSFS_Io *io; + UNPKentry *entry; + PHYSFS_uint32 curPos; +} UNPKfileinfo; + + +void UNPK_closeArchive(void *opaque) +{ + UNPKinfo *info = ((UNPKinfo *) opaque); + if (info) + { + __PHYSFS_DirTreeDeinit(&info->tree); + + if (info->io) + info->io->destroy(info->io); + + allocator.Free(info); + } /* if */ +} /* UNPK_closeArchive */ + +void UNPK_abandonArchive(void *opaque) +{ + UNPKinfo *info = ((UNPKinfo *) opaque); + if (info) + { + info->io = NULL; + UNPK_closeArchive(info); + } /* if */ +} /* UNPK_abandonArchive */ + +static PHYSFS_sint64 UNPK_read(PHYSFS_Io *io, void *buffer, PHYSFS_uint64 len) +{ + UNPKfileinfo *finfo = (UNPKfileinfo *) io->opaque; + const UNPKentry *entry = finfo->entry; + const PHYSFS_uint64 bytesLeft = (PHYSFS_uint64)(entry->size-finfo->curPos); + PHYSFS_sint64 rc; + + if (bytesLeft < len) + len = bytesLeft; + + rc = finfo->io->read(finfo->io, buffer, len); + if (rc > 0) + finfo->curPos += (PHYSFS_uint32) rc; + + return rc; +} /* UNPK_read */ + + +static PHYSFS_sint64 UNPK_write(PHYSFS_Io *io, const void *b, PHYSFS_uint64 len) +{ + BAIL(PHYSFS_ERR_READ_ONLY, -1); +} /* UNPK_write */ + + +static PHYSFS_sint64 UNPK_tell(PHYSFS_Io *io) +{ + return ((UNPKfileinfo *) io->opaque)->curPos; +} /* UNPK_tell */ + + +static int UNPK_seek(PHYSFS_Io *io, PHYSFS_uint64 offset) +{ + UNPKfileinfo *finfo = (UNPKfileinfo *) io->opaque; + const UNPKentry *entry = finfo->entry; + int rc; + + BAIL_IF(offset >= entry->size, PHYSFS_ERR_PAST_EOF, 0); + rc = finfo->io->seek(finfo->io, entry->startPos + offset); + if (rc) + finfo->curPos = (PHYSFS_uint32) offset; + + return rc; +} /* UNPK_seek */ + + +static PHYSFS_sint64 UNPK_length(PHYSFS_Io *io) +{ + const UNPKfileinfo *finfo = (UNPKfileinfo *) io->opaque; + return ((PHYSFS_sint64) finfo->entry->size); +} /* UNPK_length */ + + +static PHYSFS_Io *UNPK_duplicate(PHYSFS_Io *_io) +{ + UNPKfileinfo *origfinfo = (UNPKfileinfo *) _io->opaque; + PHYSFS_Io *io = NULL; + PHYSFS_Io *retval = (PHYSFS_Io *) allocator.Malloc(sizeof (PHYSFS_Io)); + UNPKfileinfo *finfo = (UNPKfileinfo *) allocator.Malloc(sizeof (UNPKfileinfo)); + GOTO_IF(!retval, PHYSFS_ERR_OUT_OF_MEMORY, UNPK_duplicate_failed); + GOTO_IF(!finfo, PHYSFS_ERR_OUT_OF_MEMORY, UNPK_duplicate_failed); + + io = origfinfo->io->duplicate(origfinfo->io); + if (!io) goto UNPK_duplicate_failed; + finfo->io = io; + finfo->entry = origfinfo->entry; + finfo->curPos = 0; + memcpy(retval, _io, sizeof (PHYSFS_Io)); + retval->opaque = finfo; + return retval; + +UNPK_duplicate_failed: + if (finfo != NULL) allocator.Free(finfo); + if (retval != NULL) allocator.Free(retval); + if (io != NULL) io->destroy(io); + return NULL; +} /* UNPK_duplicate */ + +static int UNPK_flush(PHYSFS_Io *io) { return 1; /* no write support. */ } + +static void UNPK_destroy(PHYSFS_Io *io) +{ + UNPKfileinfo *finfo = (UNPKfileinfo *) io->opaque; + finfo->io->destroy(finfo->io); + allocator.Free(finfo); + allocator.Free(io); +} /* UNPK_destroy */ + + +static const PHYSFS_Io UNPK_Io = +{ + CURRENT_PHYSFS_IO_API_VERSION, NULL, + UNPK_read, + UNPK_write, + UNPK_seek, + UNPK_tell, + UNPK_length, + UNPK_duplicate, + UNPK_flush, + UNPK_destroy +}; + + +static inline UNPKentry *findEntry(UNPKinfo *info, const char *path) +{ + return (UNPKentry *) __PHYSFS_DirTreeFind(&info->tree, path); +} /* findEntry */ + + +PHYSFS_Io *UNPK_openRead(void *opaque, const char *name) +{ + PHYSFS_Io *retval = NULL; + UNPKinfo *info = (UNPKinfo *) opaque; + UNPKfileinfo *finfo = NULL; + UNPKentry *entry = findEntry(info, name); + + BAIL_IF_ERRPASS(!entry, NULL); + BAIL_IF(entry->tree.isdir, PHYSFS_ERR_NOT_A_FILE, NULL); + + retval = (PHYSFS_Io *) allocator.Malloc(sizeof (PHYSFS_Io)); + GOTO_IF(!retval, PHYSFS_ERR_OUT_OF_MEMORY, UNPK_openRead_failed); + + finfo = (UNPKfileinfo *) allocator.Malloc(sizeof (UNPKfileinfo)); + GOTO_IF(!finfo, PHYSFS_ERR_OUT_OF_MEMORY, UNPK_openRead_failed); + + finfo->io = info->io->duplicate(info->io); + GOTO_IF_ERRPASS(!finfo->io, UNPK_openRead_failed); + + if (!finfo->io->seek(finfo->io, entry->startPos)) + goto UNPK_openRead_failed; + + finfo->curPos = 0; + finfo->entry = entry; + + memcpy(retval, &UNPK_Io, sizeof (*retval)); + retval->opaque = finfo; + return retval; + +UNPK_openRead_failed: + if (finfo != NULL) + { + if (finfo->io != NULL) + finfo->io->destroy(finfo->io); + allocator.Free(finfo); + } /* if */ + + if (retval != NULL) + allocator.Free(retval); + + return NULL; +} /* UNPK_openRead */ + + +PHYSFS_Io *UNPK_openWrite(void *opaque, const char *name) +{ + BAIL(PHYSFS_ERR_READ_ONLY, NULL); +} /* UNPK_openWrite */ + + +PHYSFS_Io *UNPK_openAppend(void *opaque, const char *name) +{ + BAIL(PHYSFS_ERR_READ_ONLY, NULL); +} /* UNPK_openAppend */ + + +int UNPK_remove(void *opaque, const char *name) +{ + BAIL(PHYSFS_ERR_READ_ONLY, 0); +} /* UNPK_remove */ + + +int UNPK_mkdir(void *opaque, const char *name) +{ + BAIL(PHYSFS_ERR_READ_ONLY, 0); +} /* UNPK_mkdir */ + + +int UNPK_stat(void *opaque, const char *path, PHYSFS_Stat *stat) +{ + UNPKinfo *info = (UNPKinfo *) opaque; + const UNPKentry *entry = findEntry(info, path); + + BAIL_IF_ERRPASS(!entry, 0); + + if (entry->tree.isdir) + { + stat->filetype = PHYSFS_FILETYPE_DIRECTORY; + stat->filesize = 0; + } /* if */ + else + { + stat->filetype = PHYSFS_FILETYPE_REGULAR; + stat->filesize = entry->size; + } /* else */ + + stat->modtime = entry->mtime; + stat->createtime = entry->ctime; + stat->accesstime = -1; + stat->readonly = 1; + + return 1; +} /* UNPK_stat */ + + +void *UNPK_addEntry(void *opaque, char *name, const int isdir, + const PHYSFS_sint64 ctime, const PHYSFS_sint64 mtime, + const PHYSFS_uint64 pos, const PHYSFS_uint64 len) +{ + UNPKinfo *info = (UNPKinfo *) opaque; + UNPKentry *entry; + + entry = (UNPKentry *) __PHYSFS_DirTreeAdd(&info->tree, name, isdir); + BAIL_IF_ERRPASS(!entry, NULL); + + entry->startPos = isdir ? 0 : pos; + entry->size = isdir ? 0 : len; + entry->ctime = ctime; + entry->mtime = mtime; + + return entry; +} /* UNPK_addEntry */ + + +void *UNPK_openArchive(PHYSFS_Io *io) +{ + UNPKinfo *info = (UNPKinfo *) allocator.Malloc(sizeof (UNPKinfo)); + BAIL_IF(!info, PHYSFS_ERR_OUT_OF_MEMORY, NULL); + + if (!__PHYSFS_DirTreeInit(&info->tree, sizeof (UNPKentry))) + { + allocator.Free(info); + return NULL; + } /* if */ + + info->io = io; + + return info; +} /* UNPK_openArchive */ + +/* end of physfs_archiver_unpacked.c ... */ + diff --git a/third_party/physfs/physfs_archiver_zip.c b/third_party/physfs/physfs_archiver_zip.c new file mode 100644 index 00000000..9972628f --- /dev/null +++ b/third_party/physfs/physfs_archiver_zip.c @@ -0,0 +1,1710 @@ +/* + * ZIP support routines for PhysicsFS. + * + * Please see the file LICENSE.txt in the source's root directory. + * + * This file written by Ryan C. Gordon, with some peeking at "unzip.c" + * by Gilles Vollant. + */ + +#define __PHYSICSFS_INTERNAL__ +#include "physfs_internal.h" + +#if PHYSFS_SUPPORTS_ZIP + +#include +#include + +#include "physfs_miniz.h" + +/* + * A buffer of ZIP_READBUFSIZE is allocated for each compressed file opened, + * and is freed when you close the file; compressed data is read into + * this buffer, and then is decompressed into the buffer passed to + * PHYSFS_read(). + * + * Uncompressed entries in a zipfile do not allocate this buffer; they just + * read data directly into the buffer passed to PHYSFS_read(). + * + * Depending on your speed and memory requirements, you should tweak this + * value. + */ +#define ZIP_READBUFSIZE (16 * 1024) + + +/* + * Entries are "unresolved" until they are first opened. At that time, + * local file headers parsed/validated, data offsets will be updated to look + * at the actual file data instead of the header, and symlinks will be + * followed and optimized. This means that we don't seek and read around the + * archive until forced to do so, and after the first time, we had to do + * less reading and parsing, which is very CD-ROM friendly. + */ +typedef enum +{ + ZIP_UNRESOLVED_FILE, + ZIP_UNRESOLVED_SYMLINK, + ZIP_RESOLVING, + ZIP_RESOLVED, + ZIP_DIRECTORY, + ZIP_BROKEN_FILE, + ZIP_BROKEN_SYMLINK +} ZipResolveType; + + +/* + * One ZIPentry is kept for each file in an open ZIP archive. + */ +typedef struct _ZIPentry +{ + __PHYSFS_DirTreeEntry tree; /* manages directory tree */ + struct _ZIPentry *symlink; /* NULL or file we symlink to */ + ZipResolveType resolved; /* Have we resolved file/symlink? */ + PHYSFS_uint64 offset; /* offset of data in archive */ + PHYSFS_uint16 version; /* version made by */ + PHYSFS_uint16 version_needed; /* version needed to extract */ + PHYSFS_uint16 general_bits; /* general purpose bits */ + PHYSFS_uint16 compression_method; /* compression method */ + PHYSFS_uint32 crc; /* crc-32 */ + PHYSFS_uint64 compressed_size; /* compressed size */ + PHYSFS_uint64 uncompressed_size; /* uncompressed size */ + PHYSFS_sint64 last_mod_time; /* last file mod time */ + PHYSFS_uint32 dos_mod_time; /* original MS-DOS style mod time */ +} ZIPentry; + +/* + * One ZIPinfo is kept for each open ZIP archive. + */ +typedef struct +{ + __PHYSFS_DirTree tree; /* manages directory tree. */ + PHYSFS_Io *io; /* the i/o interface for this archive. */ + int zip64; /* non-zero if this is a Zip64 archive. */ + int has_crypto; /* non-zero if any entry uses encryption. */ +} ZIPinfo; + +/* + * One ZIPfileinfo is kept for each open file in a ZIP archive. + */ +typedef struct +{ + ZIPentry *entry; /* Info on file. */ + PHYSFS_Io *io; /* physical file handle. */ + PHYSFS_uint32 compressed_position; /* offset in compressed data. */ + PHYSFS_uint32 uncompressed_position; /* tell() position. */ + PHYSFS_uint8 *buffer; /* decompression buffer. */ + PHYSFS_uint32 crypto_keys[3]; /* for "traditional" crypto. */ + PHYSFS_uint32 initial_crypto_keys[3]; /* for "traditional" crypto. */ + z_stream stream; /* zlib stream state. */ +} ZIPfileinfo; + + +/* Magic numbers... */ +#define ZIP_LOCAL_FILE_SIG 0x04034b50 +#define ZIP_CENTRAL_DIR_SIG 0x02014b50 +#define ZIP_END_OF_CENTRAL_DIR_SIG 0x06054b50 +#define ZIP64_END_OF_CENTRAL_DIR_SIG 0x06064b50 +#define ZIP64_END_OF_CENTRAL_DIRECTORY_LOCATOR_SIG 0x07064b50 +#define ZIP64_EXTENDED_INFO_EXTRA_FIELD_SIG 0x0001 + +/* compression methods... */ +#define COMPMETH_NONE 0 +/* ...and others... */ + + +#define UNIX_FILETYPE_MASK 0170000 +#define UNIX_FILETYPE_SYMLINK 0120000 + +#define ZIP_GENERAL_BITS_TRADITIONAL_CRYPTO (1 << 0) +#define ZIP_GENERAL_BITS_IGNORE_LOCAL_HEADER (1 << 3) + +/* support for "traditional" PKWARE encryption. */ +static int zip_entry_is_tradional_crypto(const ZIPentry *entry) +{ + return (entry->general_bits & ZIP_GENERAL_BITS_TRADITIONAL_CRYPTO) != 0; +} /* zip_entry_is_traditional_crypto */ + +static int zip_entry_ignore_local_header(const ZIPentry *entry) +{ + return (entry->general_bits & ZIP_GENERAL_BITS_IGNORE_LOCAL_HEADER) != 0; +} /* zip_entry_is_traditional_crypto */ + +static PHYSFS_uint32 zip_crypto_crc32(const PHYSFS_uint32 crc, const PHYSFS_uint8 val) +{ + int i; + PHYSFS_uint32 xorval = (crc ^ ((PHYSFS_uint32) val)) & 0xFF; + for (i = 0; i < 8; i++) + xorval = ((xorval & 1) ? (0xEDB88320 ^ (xorval >> 1)) : (xorval >> 1)); + return xorval ^ (crc >> 8); +} /* zip_crc32 */ + +static void zip_update_crypto_keys(PHYSFS_uint32 *keys, const PHYSFS_uint8 val) +{ + keys[0] = zip_crypto_crc32(keys[0], val); + keys[1] = keys[1] + (keys[0] & 0x000000FF); + keys[1] = (keys[1] * 134775813) + 1; + keys[2] = zip_crypto_crc32(keys[2], (PHYSFS_uint8) ((keys[1] >> 24) & 0xFF)); +} /* zip_update_crypto_keys */ + +static PHYSFS_uint8 zip_decrypt_byte(const PHYSFS_uint32 *keys) +{ + const PHYSFS_uint16 tmp = keys[2] | 2; + return (PHYSFS_uint8) ((tmp * (tmp ^ 1)) >> 8); +} /* zip_decrypt_byte */ + +static PHYSFS_sint64 zip_read_decrypt(ZIPfileinfo *finfo, void *buf, PHYSFS_uint64 len) +{ + PHYSFS_Io *io = finfo->io; + const PHYSFS_sint64 br = io->read(io, buf, len); + + /* Decompression the new data if necessary. */ + if (zip_entry_is_tradional_crypto(finfo->entry) && (br > 0)) + { + PHYSFS_uint32 *keys = finfo->crypto_keys; + PHYSFS_uint8 *ptr = (PHYSFS_uint8 *) buf; + PHYSFS_sint64 i; + for (i = 0; i < br; i++, ptr++) + { + const PHYSFS_uint8 ch = *ptr ^ zip_decrypt_byte(keys); + zip_update_crypto_keys(keys, ch); + *ptr = ch; + } /* for */ + } /* if */ + + return br; +} /* zip_read_decrypt */ + +static int zip_prep_crypto_keys(ZIPfileinfo *finfo, const PHYSFS_uint8 *crypto_header, const PHYSFS_uint8 *password) +{ + /* It doesn't appear to be documented in PKWare's APPNOTE.TXT, but you + need to use a different byte in the header to verify the password + if general purpose bit 3 is set. Discovered this from Info-Zip. + That's what the (verifier) value is doing, below. */ + + PHYSFS_uint32 *keys = finfo->crypto_keys; + const ZIPentry *entry = finfo->entry; + const int usedate = zip_entry_ignore_local_header(entry); + const PHYSFS_uint8 verifier = (PHYSFS_uint8) ((usedate ? (entry->dos_mod_time >> 8) : (entry->crc >> 24)) & 0xFF); + PHYSFS_uint8 finalbyte = 0; + int i = 0; + + /* initialize vector with defaults, then password, then header. */ + keys[0] = 305419896; + keys[1] = 591751049; + keys[2] = 878082192; + + while (*password) + zip_update_crypto_keys(keys, *(password++)); + + for (i = 0; i < 12; i++) + { + const PHYSFS_uint8 c = crypto_header[i] ^ zip_decrypt_byte(keys); + zip_update_crypto_keys(keys, c); + finalbyte = c; + } /* for */ + + /* you have a 1/256 chance of passing this test incorrectly. :/ */ + if (finalbyte != verifier) + BAIL(PHYSFS_ERR_BAD_PASSWORD, 0); + + /* save the initial vector for seeking purposes. Not secure!! */ + memcpy(finfo->initial_crypto_keys, finfo->crypto_keys, 12); + return 1; +} /* zip_prep_crypto_keys */ + + +/* + * Bridge physfs allocation functions to zlib's format... + */ +static voidpf zlibPhysfsAlloc(voidpf opaque, uInt items, uInt size) +{ + return ((PHYSFS_Allocator *) opaque)->Malloc(items * size); +} /* zlibPhysfsAlloc */ + +/* + * Bridge physfs allocation functions to zlib's format... + */ +static void zlibPhysfsFree(voidpf opaque, voidpf address) +{ + ((PHYSFS_Allocator *) opaque)->Free(address); +} /* zlibPhysfsFree */ + + +/* + * Construct a new z_stream to a sane state. + */ +static void initializeZStream(z_stream *pstr) +{ + memset(pstr, '\0', sizeof (z_stream)); + pstr->zalloc = zlibPhysfsAlloc; + pstr->zfree = zlibPhysfsFree; + pstr->opaque = &allocator; +} /* initializeZStream */ + + +static PHYSFS_ErrorCode zlib_error_code(int rc) +{ + switch (rc) + { + case Z_OK: return PHYSFS_ERR_OK; /* not an error. */ + case Z_STREAM_END: return PHYSFS_ERR_OK; /* not an error. */ + case Z_ERRNO: return PHYSFS_ERR_IO; + case Z_MEM_ERROR: return PHYSFS_ERR_OUT_OF_MEMORY; + default: return PHYSFS_ERR_CORRUPT; + } /* switch */ +} /* zlib_error_string */ + + +/* + * Wrap all zlib calls in this, so the physfs error state is set appropriately. + */ +static int zlib_err(const int rc) +{ + PHYSFS_setErrorCode(zlib_error_code(rc)); + return rc; +} /* zlib_err */ + +/* + * Read an unsigned 64-bit int and swap to native byte order. + */ +static int readui64(PHYSFS_Io *io, PHYSFS_uint64 *val) +{ + PHYSFS_uint64 v; + BAIL_IF_ERRPASS(!__PHYSFS_readAll(io, &v, sizeof (v)), 0); + *val = PHYSFS_swapULE64(v); + return 1; +} /* readui64 */ + +/* + * Read an unsigned 32-bit int and swap to native byte order. + */ +static int readui32(PHYSFS_Io *io, PHYSFS_uint32 *val) +{ + PHYSFS_uint32 v; + BAIL_IF_ERRPASS(!__PHYSFS_readAll(io, &v, sizeof (v)), 0); + *val = PHYSFS_swapULE32(v); + return 1; +} /* readui32 */ + + +/* + * Read an unsigned 16-bit int and swap to native byte order. + */ +static int readui16(PHYSFS_Io *io, PHYSFS_uint16 *val) +{ + PHYSFS_uint16 v; + BAIL_IF_ERRPASS(!__PHYSFS_readAll(io, &v, sizeof (v)), 0); + *val = PHYSFS_swapULE16(v); + return 1; +} /* readui16 */ + + +static PHYSFS_sint64 ZIP_read(PHYSFS_Io *_io, void *buf, PHYSFS_uint64 len) +{ + ZIPfileinfo *finfo = (ZIPfileinfo *) _io->opaque; + ZIPentry *entry = finfo->entry; + PHYSFS_sint64 retval = 0; + PHYSFS_sint64 maxread = (PHYSFS_sint64) len; + PHYSFS_sint64 avail = entry->uncompressed_size - + finfo->uncompressed_position; + + if (avail < maxread) + maxread = avail; + + BAIL_IF_ERRPASS(maxread == 0, 0); /* quick rejection. */ + + if (entry->compression_method == COMPMETH_NONE) + retval = zip_read_decrypt(finfo, buf, maxread); + else + { + finfo->stream.next_out = buf; + finfo->stream.avail_out = (uInt) maxread; + + while (retval < maxread) + { + const PHYSFS_uint32 before = (PHYSFS_uint32) finfo->stream.total_out; + int rc; + + if (finfo->stream.avail_in == 0) + { + PHYSFS_sint64 br; + + br = entry->compressed_size - finfo->compressed_position; + if (br > 0) + { + if (br > ZIP_READBUFSIZE) + br = ZIP_READBUFSIZE; + + br = zip_read_decrypt(finfo, finfo->buffer, (PHYSFS_uint64) br); + if (br <= 0) + break; + + finfo->compressed_position += (PHYSFS_uint32) br; + finfo->stream.next_in = finfo->buffer; + finfo->stream.avail_in = (unsigned int) br; + } /* if */ + } /* if */ + + rc = zlib_err(inflate(&finfo->stream, Z_SYNC_FLUSH)); + retval += (finfo->stream.total_out - before); + + if (rc != Z_OK) + break; + } /* while */ + } /* else */ + + if (retval > 0) + finfo->uncompressed_position += (PHYSFS_uint32) retval; + + return retval; +} /* ZIP_read */ + + +static PHYSFS_sint64 ZIP_write(PHYSFS_Io *io, const void *b, PHYSFS_uint64 len) +{ + BAIL(PHYSFS_ERR_READ_ONLY, -1); +} /* ZIP_write */ + + +static PHYSFS_sint64 ZIP_tell(PHYSFS_Io *io) +{ + return ((ZIPfileinfo *) io->opaque)->uncompressed_position; +} /* ZIP_tell */ + + +static int ZIP_seek(PHYSFS_Io *_io, PHYSFS_uint64 offset) +{ + ZIPfileinfo *finfo = (ZIPfileinfo *) _io->opaque; + ZIPentry *entry = finfo->entry; + PHYSFS_Io *io = finfo->io; + const int encrypted = zip_entry_is_tradional_crypto(entry); + + BAIL_IF(offset > entry->uncompressed_size, PHYSFS_ERR_PAST_EOF, 0); + + if (!encrypted && (entry->compression_method == COMPMETH_NONE)) + { + PHYSFS_sint64 newpos = offset + entry->offset; + BAIL_IF_ERRPASS(!io->seek(io, newpos), 0); + finfo->uncompressed_position = (PHYSFS_uint32) offset; + } /* if */ + + else + { + /* + * If seeking backwards, we need to redecode the file + * from the start and throw away the compressed bits until we hit + * the offset we need. If seeking forward, we still need to + * decode, but we don't rewind first. + */ + if (offset < finfo->uncompressed_position) + { + /* we do a copy so state is sane if inflateInit2() fails. */ + z_stream str; + initializeZStream(&str); + if (zlib_err(inflateInit2(&str, -MAX_WBITS)) != Z_OK) + return 0; + + if (!io->seek(io, entry->offset + (encrypted ? 12 : 0))) + return 0; + + inflateEnd(&finfo->stream); + memcpy(&finfo->stream, &str, sizeof (z_stream)); + finfo->uncompressed_position = finfo->compressed_position = 0; + + if (encrypted) + memcpy(finfo->crypto_keys, finfo->initial_crypto_keys, 12); + } /* if */ + + while (finfo->uncompressed_position != offset) + { + PHYSFS_uint8 buf[512]; + PHYSFS_uint32 maxread; + + maxread = (PHYSFS_uint32) (offset - finfo->uncompressed_position); + if (maxread > sizeof (buf)) + maxread = sizeof (buf); + + if (ZIP_read(_io, buf, maxread) != maxread) + return 0; + } /* while */ + } /* else */ + + return 1; +} /* ZIP_seek */ + + +static PHYSFS_sint64 ZIP_length(PHYSFS_Io *io) +{ + const ZIPfileinfo *finfo = (ZIPfileinfo *) io->opaque; + return (PHYSFS_sint64) finfo->entry->uncompressed_size; +} /* ZIP_length */ + + +static PHYSFS_Io *zip_get_io(PHYSFS_Io *io, ZIPinfo *inf, ZIPentry *entry); + +static PHYSFS_Io *ZIP_duplicate(PHYSFS_Io *io) +{ + ZIPfileinfo *origfinfo = (ZIPfileinfo *) io->opaque; + PHYSFS_Io *retval = (PHYSFS_Io *) allocator.Malloc(sizeof (PHYSFS_Io)); + ZIPfileinfo *finfo = (ZIPfileinfo *) allocator.Malloc(sizeof (ZIPfileinfo)); + GOTO_IF(!retval, PHYSFS_ERR_OUT_OF_MEMORY, failed); + GOTO_IF(!finfo, PHYSFS_ERR_OUT_OF_MEMORY, failed); + memset(finfo, '\0', sizeof (*finfo)); + + finfo->entry = origfinfo->entry; + finfo->io = zip_get_io(origfinfo->io, NULL, finfo->entry); + GOTO_IF_ERRPASS(!finfo->io, failed); + + initializeZStream(&finfo->stream); + if (finfo->entry->compression_method != COMPMETH_NONE) + { + finfo->buffer = (PHYSFS_uint8 *) allocator.Malloc(ZIP_READBUFSIZE); + GOTO_IF(!finfo->buffer, PHYSFS_ERR_OUT_OF_MEMORY, failed); + if (zlib_err(inflateInit2(&finfo->stream, -MAX_WBITS)) != Z_OK) + goto failed; + } /* if */ + + memcpy(retval, io, sizeof (PHYSFS_Io)); + retval->opaque = finfo; + return retval; + +failed: + if (finfo != NULL) + { + if (finfo->io != NULL) + finfo->io->destroy(finfo->io); + + if (finfo->buffer != NULL) + { + allocator.Free(finfo->buffer); + inflateEnd(&finfo->stream); + } /* if */ + + allocator.Free(finfo); + } /* if */ + + if (retval != NULL) + allocator.Free(retval); + + return NULL; +} /* ZIP_duplicate */ + +static int ZIP_flush(PHYSFS_Io *io) { return 1; /* no write support. */ } + +static void ZIP_destroy(PHYSFS_Io *io) +{ + ZIPfileinfo *finfo = (ZIPfileinfo *) io->opaque; + finfo->io->destroy(finfo->io); + + if (finfo->entry->compression_method != COMPMETH_NONE) + inflateEnd(&finfo->stream); + + if (finfo->buffer != NULL) + allocator.Free(finfo->buffer); + + allocator.Free(finfo); + allocator.Free(io); +} /* ZIP_destroy */ + + +static const PHYSFS_Io ZIP_Io = +{ + CURRENT_PHYSFS_IO_API_VERSION, NULL, + ZIP_read, + ZIP_write, + ZIP_seek, + ZIP_tell, + ZIP_length, + ZIP_duplicate, + ZIP_flush, + ZIP_destroy +}; + + + +static PHYSFS_sint64 zip_find_end_of_central_dir(PHYSFS_Io *io, PHYSFS_sint64 *len) +{ + PHYSFS_uint8 buf[256]; + PHYSFS_uint8 extra[4] = { 0, 0, 0, 0 }; + PHYSFS_sint32 i = 0; + PHYSFS_sint64 filelen; + PHYSFS_sint64 filepos; + PHYSFS_sint32 maxread; + PHYSFS_sint32 totalread = 0; + int found = 0; + + filelen = io->length(io); + BAIL_IF_ERRPASS(filelen == -1, -1); + + /* + * Jump to the end of the file and start reading backwards. + * The last thing in the file is the zipfile comment, which is variable + * length, and the field that specifies its size is before it in the + * file (argh!)...this means that we need to scan backwards until we + * hit the end-of-central-dir signature. We can then sanity check that + * the comment was as big as it should be to make sure we're in the + * right place. The comment length field is 16 bits, so we can stop + * searching for that signature after a little more than 64k at most, + * and call it a corrupted zipfile. + */ + + if (sizeof (buf) < filelen) + { + filepos = filelen - sizeof (buf); + maxread = sizeof (buf); + } /* if */ + else + { + filepos = 0; + maxread = (PHYSFS_uint32) filelen; + } /* else */ + + while ((totalread < filelen) && (totalread < 65557)) + { + BAIL_IF_ERRPASS(!io->seek(io, filepos), -1); + + /* make sure we catch a signature between buffers. */ + if (totalread != 0) + { + if (!__PHYSFS_readAll(io, buf, maxread - 4)) + return -1; + memcpy(&buf[maxread - 4], &extra, sizeof (extra)); + totalread += maxread - 4; + } /* if */ + else + { + if (!__PHYSFS_readAll(io, buf, maxread)) + return -1; + totalread += maxread; + } /* else */ + + memcpy(&extra, buf, sizeof (extra)); + + for (i = maxread - 4; i > 0; i--) + { + if ((buf[i + 0] == 0x50) && + (buf[i + 1] == 0x4B) && + (buf[i + 2] == 0x05) && + (buf[i + 3] == 0x06) ) + { + found = 1; /* that's the signature! */ + break; + } /* if */ + } /* for */ + + if (found) + break; + + filepos -= (maxread - 4); + if (filepos < 0) + filepos = 0; + } /* while */ + + BAIL_IF(!found, PHYSFS_ERR_UNSUPPORTED, -1); + + if (len != NULL) + *len = filelen; + + return (filepos + i); +} /* zip_find_end_of_central_dir */ + + +static int isZip(PHYSFS_Io *io) +{ + PHYSFS_uint32 sig = 0; + int retval = 0; + + /* + * The first thing in a zip file might be the signature of the + * first local file record, so it makes for a quick determination. + */ + if (readui32(io, &sig)) + { + retval = (sig == ZIP_LOCAL_FILE_SIG); + if (!retval) + { + /* + * No sig...might be a ZIP with data at the start + * (a self-extracting executable, etc), so we'll have to do + * it the hard way... + */ + retval = (zip_find_end_of_central_dir(io, NULL) != -1); + } /* if */ + } /* if */ + + return retval; +} /* isZip */ + + +/* Convert paths from old, buggy DOS zippers... */ +static void zip_convert_dos_path(const PHYSFS_uint16 entryversion, char *path) +{ + const PHYSFS_uint8 hosttype = (PHYSFS_uint8) ((entryversion >> 8) & 0xFF); + if (hosttype == 0) /* FS_FAT_ */ + { + while (*path) + { + if (*path == '\\') + *path = '/'; + path++; + } /* while */ + } /* if */ +} /* zip_convert_dos_path */ + + +static void zip_expand_symlink_path(char *path) +{ + char *ptr = path; + char *prevptr = path; + + while (1) + { + ptr = strchr(ptr, '/'); + if (ptr == NULL) + break; + + if (*(ptr + 1) == '.') + { + if (*(ptr + 2) == '/') + { + /* current dir in middle of string: ditch it. */ + memmove(ptr, ptr + 2, strlen(ptr + 2) + 1); + } /* else if */ + + else if (*(ptr + 2) == '\0') + { + /* current dir at end of string: ditch it. */ + *ptr = '\0'; + } /* else if */ + + else if (*(ptr + 2) == '.') + { + if (*(ptr + 3) == '/') + { + /* parent dir in middle: move back one, if possible. */ + memmove(prevptr, ptr + 4, strlen(ptr + 4) + 1); + ptr = prevptr; + while (prevptr != path) + { + prevptr--; + if (*prevptr == '/') + { + prevptr++; + break; + } /* if */ + } /* while */ + } /* if */ + + if (*(ptr + 3) == '\0') + { + /* parent dir at end: move back one, if possible. */ + *prevptr = '\0'; + } /* if */ + } /* if */ + } /* if */ + else + { + prevptr = ptr; + ptr++; + } /* else */ + } /* while */ +} /* zip_expand_symlink_path */ + + +static inline ZIPentry *zip_find_entry(ZIPinfo *info, const char *path) +{ + return (ZIPentry *) __PHYSFS_DirTreeFind(&info->tree, path); +} /* zip_find_entry */ + +/* (forward reference: zip_follow_symlink and zip_resolve call each other.) */ +static int zip_resolve(PHYSFS_Io *io, ZIPinfo *info, ZIPentry *entry); + +/* + * Look for the entry named by (path). If it exists, resolve it, and return + * a pointer to that entry. If it's another symlink, keep resolving until you + * hit a real file and then return a pointer to the final non-symlink entry. + * If there's a problem, return NULL. + */ +static ZIPentry *zip_follow_symlink(PHYSFS_Io *io, ZIPinfo *info, char *path) +{ + ZIPentry *entry; + + zip_expand_symlink_path(path); + entry = zip_find_entry(info, path); + if (entry != NULL) + { + if (!zip_resolve(io, info, entry)) /* recursive! */ + entry = NULL; + else + { + if (entry->symlink != NULL) + entry = entry->symlink; + } /* else */ + } /* if */ + + return entry; +} /* zip_follow_symlink */ + + +static int zip_resolve_symlink(PHYSFS_Io *io, ZIPinfo *info, ZIPentry *entry) +{ + const size_t size = (size_t) entry->uncompressed_size; + char *path = NULL; + int rc = 0; + + /* + * We've already parsed the local file header of the symlink at this + * point. Now we need to read the actual link from the file data and + * follow it. + */ + + BAIL_IF_ERRPASS(!io->seek(io, entry->offset), 0); + + path = (char *) __PHYSFS_smallAlloc(size + 1); + BAIL_IF(!path, PHYSFS_ERR_OUT_OF_MEMORY, 0); + + if (entry->compression_method == COMPMETH_NONE) + rc = __PHYSFS_readAll(io, path, size); + + else /* symlink target path is compressed... */ + { + z_stream stream; + const size_t complen = (size_t) entry->compressed_size; + PHYSFS_uint8 *compressed = (PHYSFS_uint8*) __PHYSFS_smallAlloc(complen); + if (compressed != NULL) + { + if (__PHYSFS_readAll(io, compressed, complen)) + { + initializeZStream(&stream); + stream.next_in = compressed; + stream.avail_in = (unsigned int) complen; + stream.next_out = (unsigned char *) path; + stream.avail_out = (unsigned int) size; + if (zlib_err(inflateInit2(&stream, -MAX_WBITS)) == Z_OK) + { + rc = zlib_err(inflate(&stream, Z_FINISH)); + inflateEnd(&stream); + + /* both are acceptable outcomes... */ + rc = ((rc == Z_OK) || (rc == Z_STREAM_END)); + } /* if */ + } /* if */ + __PHYSFS_smallFree(compressed); + } /* if */ + } /* else */ + + if (rc) + { + path[entry->uncompressed_size] = '\0'; /* null-terminate it. */ + zip_convert_dos_path(entry->version, path); + entry->symlink = zip_follow_symlink(io, info, path); + } /* else */ + + __PHYSFS_smallFree(path); + + return (entry->symlink != NULL); +} /* zip_resolve_symlink */ + + +/* + * Parse the local file header of an entry, and update entry->offset. + */ +static int zip_parse_local(PHYSFS_Io *io, ZIPentry *entry) +{ + PHYSFS_uint32 ui32; + PHYSFS_uint16 ui16; + PHYSFS_uint16 fnamelen; + PHYSFS_uint16 extralen; + + /* + * crc and (un)compressed_size are always zero if this is a "JAR" + * archive created with Sun's Java tools, apparently. We only + * consider this archive corrupted if those entries don't match and + * aren't zero. That seems to work well. + * We also ignore a mismatch if the value is 0xFFFFFFFF here, since it's + * possible that's a Zip64 thing. + */ + + /* !!! FIXME: apparently these are zero if general purpose bit 3 is set, + !!! FIXME: which is probably true for Jar files, fwiw, but we don't + !!! FIXME: care about these values anyhow. */ + + BAIL_IF_ERRPASS(!io->seek(io, entry->offset), 0); + BAIL_IF_ERRPASS(!readui32(io, &ui32), 0); + BAIL_IF(ui32 != ZIP_LOCAL_FILE_SIG, PHYSFS_ERR_CORRUPT, 0); + BAIL_IF_ERRPASS(!readui16(io, &ui16), 0); + BAIL_IF(ui16 != entry->version_needed, PHYSFS_ERR_CORRUPT, 0); + BAIL_IF_ERRPASS(!readui16(io, &ui16), 0); /* general bits. */ + BAIL_IF_ERRPASS(!readui16(io, &ui16), 0); + BAIL_IF(ui16 != entry->compression_method, PHYSFS_ERR_CORRUPT, 0); + BAIL_IF_ERRPASS(!readui32(io, &ui32), 0); /* date/time */ + BAIL_IF_ERRPASS(!readui32(io, &ui32), 0); + BAIL_IF(ui32 && (ui32 != entry->crc), PHYSFS_ERR_CORRUPT, 0); + + BAIL_IF_ERRPASS(!readui32(io, &ui32), 0); + BAIL_IF(ui32 && (ui32 != 0xFFFFFFFF) && + (ui32 != entry->compressed_size), PHYSFS_ERR_CORRUPT, 0); + + BAIL_IF_ERRPASS(!readui32(io, &ui32), 0); + BAIL_IF(ui32 && (ui32 != 0xFFFFFFFF) && + (ui32 != entry->uncompressed_size), PHYSFS_ERR_CORRUPT, 0); + + BAIL_IF_ERRPASS(!readui16(io, &fnamelen), 0); + BAIL_IF_ERRPASS(!readui16(io, &extralen), 0); + + entry->offset += fnamelen + extralen + 30; + return 1; +} /* zip_parse_local */ + + +static int zip_resolve(PHYSFS_Io *io, ZIPinfo *info, ZIPentry *entry) +{ + int retval = 1; + const ZipResolveType resolve_type = entry->resolved; + + if (resolve_type == ZIP_DIRECTORY) + return 1; /* we're good. */ + + /* Don't bother if we've failed to resolve this entry before. */ + BAIL_IF(resolve_type == ZIP_BROKEN_FILE, PHYSFS_ERR_CORRUPT, 0); + BAIL_IF(resolve_type == ZIP_BROKEN_SYMLINK, PHYSFS_ERR_CORRUPT, 0); + + /* uhoh...infinite symlink loop! */ + BAIL_IF(resolve_type == ZIP_RESOLVING, PHYSFS_ERR_SYMLINK_LOOP, 0); + + /* + * We fix up the offset to point to the actual data on the + * first open, since we don't want to seek across the whole file on + * archive open (can be SLOW on large, CD-stored files), but we + * need to check the local file header...not just for corruption, + * but since it stores offset info the central directory does not. + */ + if (resolve_type != ZIP_RESOLVED) + { + if (entry->tree.isdir) /* an ancestor dir that DirTree filled in? */ + { + entry->resolved = ZIP_DIRECTORY; + return 1; + } /* if */ + + retval = zip_parse_local(io, entry); + if (retval) + { + /* + * If it's a symlink, find the original file. This will cause + * resolution of other entries (other symlinks and, eventually, + * the real file) if all goes well. + */ + if (resolve_type == ZIP_UNRESOLVED_SYMLINK) + retval = zip_resolve_symlink(io, info, entry); + } /* if */ + + if (resolve_type == ZIP_UNRESOLVED_SYMLINK) + entry->resolved = ((retval) ? ZIP_RESOLVED : ZIP_BROKEN_SYMLINK); + else if (resolve_type == ZIP_UNRESOLVED_FILE) + entry->resolved = ((retval) ? ZIP_RESOLVED : ZIP_BROKEN_FILE); + } /* if */ + + return retval; +} /* zip_resolve */ + + +static int zip_entry_is_symlink(const ZIPentry *entry) +{ + return ((entry->resolved == ZIP_UNRESOLVED_SYMLINK) || + (entry->resolved == ZIP_BROKEN_SYMLINK) || + (entry->symlink)); +} /* zip_entry_is_symlink */ + + +static int zip_version_does_symlinks(PHYSFS_uint32 version) +{ + int retval = 0; + PHYSFS_uint8 hosttype = (PHYSFS_uint8) ((version >> 8) & 0xFF); + + switch (hosttype) + { + /* + * These are the platforms that can NOT build an archive with + * symlinks, according to the Info-ZIP project. + */ + case 0: /* FS_FAT_ */ + case 1: /* AMIGA_ */ + case 2: /* VMS_ */ + case 4: /* VM_CSM_ */ + case 6: /* FS_HPFS_ */ + case 11: /* FS_NTFS_ */ + case 14: /* FS_VFAT_ */ + case 13: /* ACORN_ */ + case 15: /* MVS_ */ + case 18: /* THEOS_ */ + break; /* do nothing. */ + + default: /* assume the rest to be unix-like. */ + retval = 1; + break; + } /* switch */ + + return retval; +} /* zip_version_does_symlinks */ + + +static inline int zip_has_symlink_attr(const ZIPentry *entry, + const PHYSFS_uint32 extern_attr) +{ + PHYSFS_uint16 xattr = ((extern_attr >> 16) & 0xFFFF); + return ( (zip_version_does_symlinks(entry->version)) && + (entry->uncompressed_size > 0) && + ((xattr & UNIX_FILETYPE_MASK) == UNIX_FILETYPE_SYMLINK) ); +} /* zip_has_symlink_attr */ + + +static PHYSFS_sint64 zip_dos_time_to_physfs_time(PHYSFS_uint32 dostime) +{ + PHYSFS_uint32 dosdate; + struct tm unixtime; + memset(&unixtime, '\0', sizeof (unixtime)); + + dosdate = (PHYSFS_uint32) ((dostime >> 16) & 0xFFFF); + dostime &= 0xFFFF; + + /* dissect date */ + unixtime.tm_year = ((dosdate >> 9) & 0x7F) + 80; + unixtime.tm_mon = ((dosdate >> 5) & 0x0F) - 1; + unixtime.tm_mday = ((dosdate ) & 0x1F); + + /* dissect time */ + unixtime.tm_hour = ((dostime >> 11) & 0x1F); + unixtime.tm_min = ((dostime >> 5) & 0x3F); + unixtime.tm_sec = ((dostime << 1) & 0x3E); + + /* let mktime calculate daylight savings time. */ + unixtime.tm_isdst = -1; + + return ((PHYSFS_sint64) mktime(&unixtime)); +} /* zip_dos_time_to_physfs_time */ + + +static ZIPentry *zip_load_entry(ZIPinfo *info, const int zip64, + const PHYSFS_uint64 ofs_fixup) +{ + PHYSFS_Io *io = info->io; + ZIPentry entry; + ZIPentry *retval = NULL; + PHYSFS_uint16 fnamelen, extralen, commentlen; + PHYSFS_uint32 external_attr; + PHYSFS_uint32 starting_disk; + PHYSFS_uint64 offset; + PHYSFS_uint16 ui16; + PHYSFS_uint32 ui32; + PHYSFS_sint64 si64; + char *name = NULL; + int isdir = 0; + + /* sanity check with central directory signature... */ + BAIL_IF_ERRPASS(!readui32(io, &ui32), NULL); + BAIL_IF(ui32 != ZIP_CENTRAL_DIR_SIG, PHYSFS_ERR_CORRUPT, NULL); + + memset(&entry, '\0', sizeof (entry)); + + /* Get the pertinent parts of the record... */ + BAIL_IF_ERRPASS(!readui16(io, &entry.version), NULL); + BAIL_IF_ERRPASS(!readui16(io, &entry.version_needed), NULL); + BAIL_IF_ERRPASS(!readui16(io, &entry.general_bits), NULL); /* general bits */ + BAIL_IF_ERRPASS(!readui16(io, &entry.compression_method), NULL); + BAIL_IF_ERRPASS(!readui32(io, &entry.dos_mod_time), NULL); + entry.last_mod_time = zip_dos_time_to_physfs_time(entry.dos_mod_time); + BAIL_IF_ERRPASS(!readui32(io, &entry.crc), NULL); + BAIL_IF_ERRPASS(!readui32(io, &ui32), NULL); + entry.compressed_size = (PHYSFS_uint64) ui32; + BAIL_IF_ERRPASS(!readui32(io, &ui32), NULL); + entry.uncompressed_size = (PHYSFS_uint64) ui32; + BAIL_IF_ERRPASS(!readui16(io, &fnamelen), NULL); + BAIL_IF_ERRPASS(!readui16(io, &extralen), NULL); + BAIL_IF_ERRPASS(!readui16(io, &commentlen), NULL); + BAIL_IF_ERRPASS(!readui16(io, &ui16), NULL); + starting_disk = (PHYSFS_uint32) ui16; + BAIL_IF_ERRPASS(!readui16(io, &ui16), NULL); /* internal file attribs */ + BAIL_IF_ERRPASS(!readui32(io, &external_attr), NULL); + BAIL_IF_ERRPASS(!readui32(io, &ui32), NULL); + offset = (PHYSFS_uint64) ui32; + + name = (char *) __PHYSFS_smallAlloc(fnamelen + 1); + BAIL_IF(!name, PHYSFS_ERR_OUT_OF_MEMORY, NULL); + if (!__PHYSFS_readAll(io, name, fnamelen)) + { + __PHYSFS_smallFree(name); + return NULL; + } /* if */ + + if (name[fnamelen - 1] == '/') + { + name[fnamelen - 1] = '\0'; + isdir = 1; + } /* if */ + name[fnamelen] = '\0'; /* null-terminate the filename. */ + + zip_convert_dos_path(entry.version, name); + + retval = (ZIPentry *) __PHYSFS_DirTreeAdd(&info->tree, name, isdir); + __PHYSFS_smallFree(name); + + BAIL_IF(!retval, PHYSFS_ERR_OUT_OF_MEMORY, NULL); + + /* It's okay to BAIL without freeing retval, because it's stored in the + __PHYSFS_DirTree and will be freed later anyhow. */ + BAIL_IF(retval->last_mod_time != 0, PHYSFS_ERR_CORRUPT, NULL); /* dupe? */ + + /* Move the data we already read into place in the official object. */ + memcpy(((PHYSFS_uint8 *) retval) + sizeof (__PHYSFS_DirTreeEntry), + ((PHYSFS_uint8 *) &entry) + sizeof (__PHYSFS_DirTreeEntry), + sizeof (*retval) - sizeof (__PHYSFS_DirTreeEntry)); + + retval->symlink = NULL; /* will be resolved later, if necessary. */ + + if (isdir) + retval->resolved = ZIP_DIRECTORY; + else + { + retval->resolved = (zip_has_symlink_attr(retval, external_attr)) ? + ZIP_UNRESOLVED_SYMLINK : ZIP_UNRESOLVED_FILE; + } /* else */ + + si64 = io->tell(io); + BAIL_IF_ERRPASS(si64 == -1, NULL); + + /* If the actual sizes didn't fit in 32-bits, look for the Zip64 + extended information extra field... */ + if ( (zip64) && + ((offset == 0xFFFFFFFF) || + (starting_disk == 0xFFFFFFFF) || + (retval->compressed_size == 0xFFFFFFFF) || + (retval->uncompressed_size == 0xFFFFFFFF)) ) + { + int found = 0; + PHYSFS_uint16 sig = 0; + PHYSFS_uint16 len = 0; + while (extralen > 4) + { + BAIL_IF_ERRPASS(!readui16(io, &sig), NULL); + BAIL_IF_ERRPASS(!readui16(io, &len), NULL); + + si64 += 4 + len; + extralen -= 4 + len; + if (sig != ZIP64_EXTENDED_INFO_EXTRA_FIELD_SIG) + { + BAIL_IF_ERRPASS(!io->seek(io, si64), NULL); + continue; + } /* if */ + + found = 1; + break; + } /* while */ + + BAIL_IF(!found, PHYSFS_ERR_CORRUPT, NULL); + + if (retval->uncompressed_size == 0xFFFFFFFF) + { + BAIL_IF(len < 8, PHYSFS_ERR_CORRUPT, NULL); + BAIL_IF_ERRPASS(!readui64(io, &retval->uncompressed_size), NULL); + len -= 8; + } /* if */ + + if (retval->compressed_size == 0xFFFFFFFF) + { + BAIL_IF(len < 8, PHYSFS_ERR_CORRUPT, NULL); + BAIL_IF_ERRPASS(!readui64(io, &retval->compressed_size), NULL); + len -= 8; + } /* if */ + + if (offset == 0xFFFFFFFF) + { + BAIL_IF(len < 8, PHYSFS_ERR_CORRUPT, NULL); + BAIL_IF_ERRPASS(!readui64(io, &offset), NULL); + len -= 8; + } /* if */ + + if (starting_disk == 0xFFFFFFFF) + { + BAIL_IF(len < 8, PHYSFS_ERR_CORRUPT, NULL); + BAIL_IF_ERRPASS(!readui32(io, &starting_disk), NULL); + len -= 4; + } /* if */ + + BAIL_IF(len != 0, PHYSFS_ERR_CORRUPT, NULL); + } /* if */ + + BAIL_IF(starting_disk != 0, PHYSFS_ERR_CORRUPT, NULL); + + retval->offset = offset + ofs_fixup; + + /* seek to the start of the next entry in the central directory... */ + BAIL_IF_ERRPASS(!io->seek(io, si64 + extralen + commentlen), NULL); + + return retval; /* success. */ +} /* zip_load_entry */ + + +/* This leaves things allocated on error; the caller will clean up the mess. */ +static int zip_load_entries(ZIPinfo *info, + const PHYSFS_uint64 data_ofs, + const PHYSFS_uint64 central_ofs, + const PHYSFS_uint64 entry_count) +{ + PHYSFS_Io *io = info->io; + const int zip64 = info->zip64; + PHYSFS_uint64 i; + + BAIL_IF_ERRPASS(!io->seek(io, central_ofs), 0); + + for (i = 0; i < entry_count; i++) + { + ZIPentry *entry = zip_load_entry(info, zip64, data_ofs); + BAIL_IF_ERRPASS(!entry, 0); + if (zip_entry_is_tradional_crypto(entry)) + info->has_crypto = 1; + } /* for */ + + return 1; +} /* zip_load_entries */ + + +static PHYSFS_sint64 zip64_find_end_of_central_dir(PHYSFS_Io *io, + PHYSFS_sint64 _pos, + PHYSFS_uint64 offset) +{ + /* + * Naturally, the offset is useless to us; it is the offset from the + * start of file, which is meaningless if we've appended this .zip to + * a self-extracting .exe. We need to find this on our own. It should + * be directly before the locator record, but the record in question, + * like the original end-of-central-directory record, ends with a + * variable-length field. Unlike the original, which has to store the + * size of that variable-length field in a 16-bit int and thus has to be + * within 64k, the new one gets 64-bits. + * + * Fortunately, the only currently-specified record for that variable + * length block is some weird proprietary thing that deals with EBCDIC + * and tape backups or something. So we don't seek far. + */ + + PHYSFS_uint32 ui32; + const PHYSFS_uint64 pos = (PHYSFS_uint64) _pos; + + assert(_pos > 0); + + /* Try offset specified in the Zip64 end of central directory locator. */ + /* This works if the entire PHYSFS_Io is the zip file. */ + BAIL_IF_ERRPASS(!io->seek(io, offset), -1); + BAIL_IF_ERRPASS(!readui32(io, &ui32), -1); + if (ui32 == ZIP64_END_OF_CENTRAL_DIR_SIG) + return offset; + + /* Try 56 bytes before the Zip64 end of central directory locator. */ + /* This works if the record isn't variable length and is version 1. */ + if (pos > 56) + { + BAIL_IF_ERRPASS(!io->seek(io, pos-56), -1); + BAIL_IF_ERRPASS(!readui32(io, &ui32), -1); + if (ui32 == ZIP64_END_OF_CENTRAL_DIR_SIG) + return pos-56; + } /* if */ + + /* Try 84 bytes before the Zip64 end of central directory locator. */ + /* This works if the record isn't variable length and is version 2. */ + if (pos > 84) + { + BAIL_IF_ERRPASS(!io->seek(io, pos-84), -1); + BAIL_IF_ERRPASS(!readui32(io, &ui32), -1); + if (ui32 == ZIP64_END_OF_CENTRAL_DIR_SIG) + return pos-84; + } /* if */ + + /* Ok, brute force: we know it's between (offset) and (pos) somewhere. */ + /* Just try moving back at most 256k. Oh well. */ + if ((offset < pos) && (pos > 4)) + { + const size_t maxbuflen = 256 * 1024; + size_t len = (size_t) (pos - offset); + PHYSFS_uint8 *buf = NULL; + PHYSFS_sint32 i; + + if (len > maxbuflen) + len = maxbuflen; + + buf = (PHYSFS_uint8 *) __PHYSFS_smallAlloc(len); + BAIL_IF(!buf, PHYSFS_ERR_OUT_OF_MEMORY, -1); + + if (!io->seek(io, pos - len) || !__PHYSFS_readAll(io, buf, len)) + { + __PHYSFS_smallFree(buf); + return -1; /* error was set elsewhere. */ + } /* if */ + + for (i = (PHYSFS_sint32) (len - 4); i >= 0; i--) + { + if ( (buf[i] == 0x50) && (buf[i+1] == 0x4b) && + (buf[i+2] == 0x06) && (buf[i+3] == 0x06) ) + { + __PHYSFS_smallFree(buf); + return pos - ((PHYSFS_sint64) (len - i)); + } /* if */ + } /* for */ + + __PHYSFS_smallFree(buf); + } /* if */ + + BAIL(PHYSFS_ERR_CORRUPT, -1); /* didn't find it. */ +} /* zip64_find_end_of_central_dir */ + + +static int zip64_parse_end_of_central_dir(ZIPinfo *info, + PHYSFS_uint64 *data_start, + PHYSFS_uint64 *dir_ofs, + PHYSFS_uint64 *entry_count, + PHYSFS_sint64 pos) +{ + PHYSFS_Io *io = info->io; + PHYSFS_uint64 ui64; + PHYSFS_uint32 ui32; + PHYSFS_uint16 ui16; + + /* We should be positioned right past the locator signature. */ + + if ((pos < 0) || (!io->seek(io, pos))) + return 0; + + BAIL_IF_ERRPASS(!readui32(io, &ui32), 0); + if (ui32 != ZIP64_END_OF_CENTRAL_DIRECTORY_LOCATOR_SIG) + return -1; /* it's not a Zip64 archive. Not an error, though! */ + + info->zip64 = 1; + + /* number of the disk with the start of the central directory. */ + BAIL_IF_ERRPASS(!readui32(io, &ui32), 0); + BAIL_IF(ui32 != 0, PHYSFS_ERR_CORRUPT, 0); + + /* offset of Zip64 end of central directory record. */ + BAIL_IF_ERRPASS(!readui64(io, &ui64), 0); + + /* total number of disks */ + BAIL_IF_ERRPASS(!readui32(io, &ui32), 0); + BAIL_IF(ui32 != 1, PHYSFS_ERR_CORRUPT, 0); + + pos = zip64_find_end_of_central_dir(io, pos, ui64); + if (pos < 0) + return 0; /* oh well. */ + + /* + * For self-extracting archives, etc, there's crapola in the file + * before the zipfile records; we calculate how much data there is + * prepended by determining how far the zip64-end-of-central-directory + * offset is from where it is supposed to be...the difference in bytes + * is how much arbitrary data is at the start of the physical file. + */ + assert(((PHYSFS_uint64) pos) >= ui64); + *data_start = ((PHYSFS_uint64) pos) - ui64; + + BAIL_IF_ERRPASS(!io->seek(io, pos), 0); + + /* check signature again, just in case. */ + BAIL_IF_ERRPASS(!readui32(io, &ui32), 0); + BAIL_IF(ui32 != ZIP64_END_OF_CENTRAL_DIR_SIG, PHYSFS_ERR_CORRUPT, 0); + + /* size of Zip64 end of central directory record. */ + BAIL_IF_ERRPASS(!readui64(io, &ui64), 0); + + /* version made by. */ + BAIL_IF_ERRPASS(!readui16(io, &ui16), 0); + + /* version needed to extract. */ + BAIL_IF_ERRPASS(!readui16(io, &ui16), 0); + + /* number of this disk. */ + BAIL_IF_ERRPASS(!readui32(io, &ui32), 0); + BAIL_IF(ui32 != 0, PHYSFS_ERR_CORRUPT, 0); + + /* number of disk with start of central directory record. */ + BAIL_IF_ERRPASS(!readui32(io, &ui32), 0); + BAIL_IF(ui32 != 0, PHYSFS_ERR_CORRUPT, 0); + + /* total number of entries in the central dir on this disk */ + BAIL_IF_ERRPASS(!readui64(io, &ui64), 0); + + /* total number of entries in the central dir */ + BAIL_IF_ERRPASS(!readui64(io, entry_count), 0); + BAIL_IF(ui64 != *entry_count, PHYSFS_ERR_CORRUPT, 0); + + /* size of the central directory */ + BAIL_IF_ERRPASS(!readui64(io, &ui64), 0); + + /* offset of central directory */ + BAIL_IF_ERRPASS(!readui64(io, dir_ofs), 0); + + /* Since we know the difference, fix up the central dir offset... */ + *dir_ofs += *data_start; + + /* + * There are more fields here, for encryption and feature-specific things, + * but we don't care about any of them at the moment. + */ + + return 1; /* made it. */ +} /* zip64_parse_end_of_central_dir */ + + +static int zip_parse_end_of_central_dir(ZIPinfo *info, + PHYSFS_uint64 *data_start, + PHYSFS_uint64 *dir_ofs, + PHYSFS_uint64 *entry_count) +{ + PHYSFS_Io *io = info->io; + PHYSFS_uint16 entryCount16; + PHYSFS_uint32 offset32; + PHYSFS_uint32 ui32; + PHYSFS_uint16 ui16; + PHYSFS_sint64 len; + PHYSFS_sint64 pos; + int rc; + + /* find the end-of-central-dir record, and seek to it. */ + pos = zip_find_end_of_central_dir(io, &len); + BAIL_IF_ERRPASS(pos == -1, 0); + BAIL_IF_ERRPASS(!io->seek(io, pos), 0); + + /* check signature again, just in case. */ + BAIL_IF_ERRPASS(!readui32(io, &ui32), 0); + BAIL_IF(ui32 != ZIP_END_OF_CENTRAL_DIR_SIG, PHYSFS_ERR_CORRUPT, 0); + + /* Seek back to see if "Zip64 end of central directory locator" exists. */ + /* this record is 20 bytes before end-of-central-dir */ + rc = zip64_parse_end_of_central_dir(info, data_start, dir_ofs, + entry_count, pos - 20); + + /* Error or success? Bounce out of here. Keep going if not zip64. */ + if ((rc == 0) || (rc == 1)) + return rc; + + assert(rc == -1); /* no error, just not a Zip64 archive. */ + + /* Not Zip64? Seek back to where we were and keep processing. */ + BAIL_IF_ERRPASS(!io->seek(io, pos + 4), 0); + + /* number of this disk */ + BAIL_IF_ERRPASS(!readui16(io, &ui16), 0); + BAIL_IF(ui16 != 0, PHYSFS_ERR_CORRUPT, 0); + + /* number of the disk with the start of the central directory */ + BAIL_IF_ERRPASS(!readui16(io, &ui16), 0); + BAIL_IF(ui16 != 0, PHYSFS_ERR_CORRUPT, 0); + + /* total number of entries in the central dir on this disk */ + BAIL_IF_ERRPASS(!readui16(io, &ui16), 0); + + /* total number of entries in the central dir */ + BAIL_IF_ERRPASS(!readui16(io, &entryCount16), 0); + BAIL_IF(ui16 != entryCount16, PHYSFS_ERR_CORRUPT, 0); + + *entry_count = entryCount16; + + /* size of the central directory */ + BAIL_IF_ERRPASS(!readui32(io, &ui32), 0); + + /* offset of central directory */ + BAIL_IF_ERRPASS(!readui32(io, &offset32), 0); + *dir_ofs = (PHYSFS_uint64) offset32; + BAIL_IF(((PHYSFS_uint64) pos) < (*dir_ofs + ui32), PHYSFS_ERR_CORRUPT, 0); + + /* + * For self-extracting archives, etc, there's crapola in the file + * before the zipfile records; we calculate how much data there is + * prepended by determining how far the central directory offset is + * from where it is supposed to be (start of end-of-central-dir minus + * sizeof central dir)...the difference in bytes is how much arbitrary + * data is at the start of the physical file. + */ + *data_start = (PHYSFS_uint64) (pos - (*dir_ofs + ui32)); + + /* Now that we know the difference, fix up the central dir offset... */ + *dir_ofs += *data_start; + + /* zipfile comment length */ + BAIL_IF_ERRPASS(!readui16(io, &ui16), 0); + + /* + * Make sure that the comment length matches to the end of file... + * If it doesn't, we're either in the wrong part of the file, or the + * file is corrupted, but we give up either way. + */ + BAIL_IF((pos + 22 + ui16) != len, PHYSFS_ERR_CORRUPT, 0); + + return 1; /* made it. */ +} /* zip_parse_end_of_central_dir */ + + +static void ZIP_closeArchive(void *opaque) +{ + ZIPinfo *info = (ZIPinfo *) (opaque); + + if (!info) + return; + + if (info->io) + info->io->destroy(info->io); + + __PHYSFS_DirTreeDeinit(&info->tree); + + allocator.Free(info); +} /* ZIP_closeArchive */ + + +static void *ZIP_openArchive(PHYSFS_Io *io, const char *name, + int forWriting, int *claimed) +{ + ZIPinfo *info = NULL; + ZIPentry *root = NULL; + PHYSFS_uint64 dstart = 0; /* data start */ + PHYSFS_uint64 cdir_ofs; /* central dir offset */ + PHYSFS_uint64 count; + + assert(io != NULL); /* shouldn't ever happen. */ + + BAIL_IF(forWriting, PHYSFS_ERR_READ_ONLY, NULL); + BAIL_IF_ERRPASS(!isZip(io), NULL); + + *claimed = 1; + + info = (ZIPinfo *) allocator.Malloc(sizeof (ZIPinfo)); + BAIL_IF(!info, PHYSFS_ERR_OUT_OF_MEMORY, NULL); + memset(info, '\0', sizeof (ZIPinfo)); + + info->io = io; + + if (!zip_parse_end_of_central_dir(info, &dstart, &cdir_ofs, &count)) + goto ZIP_openarchive_failed; + else if (!__PHYSFS_DirTreeInit(&info->tree, sizeof (ZIPentry))) + goto ZIP_openarchive_failed; + + root = (ZIPentry *) info->tree.root; + root->resolved = ZIP_DIRECTORY; + + if (!zip_load_entries(info, dstart, cdir_ofs, count)) + goto ZIP_openarchive_failed; + + assert(info->tree.root->sibling == NULL); + return info; + +ZIP_openarchive_failed: + info->io = NULL; /* don't let ZIP_closeArchive destroy (io). */ + ZIP_closeArchive(info); + return NULL; +} /* ZIP_openArchive */ + + +static PHYSFS_Io *zip_get_io(PHYSFS_Io *io, ZIPinfo *inf, ZIPentry *entry) +{ + int success; + PHYSFS_Io *retval = io->duplicate(io); + BAIL_IF_ERRPASS(!retval, NULL); + + assert(!entry->tree.isdir); /* should have been checked before calling. */ + + /* (inf) can be NULL if we already resolved. */ + success = (inf == NULL) || zip_resolve(retval, inf, entry); + if (success) + { + PHYSFS_sint64 offset; + offset = ((entry->symlink) ? entry->symlink->offset : entry->offset); + success = retval->seek(retval, offset); + } /* if */ + + if (!success) + { + retval->destroy(retval); + retval = NULL; + } /* if */ + + return retval; +} /* zip_get_io */ + + +static PHYSFS_Io *ZIP_openRead(void *opaque, const char *filename) +{ + PHYSFS_Io *retval = NULL; + ZIPinfo *info = (ZIPinfo *) opaque; + ZIPentry *entry = zip_find_entry(info, filename); + ZIPfileinfo *finfo = NULL; + PHYSFS_Io *io = NULL; + PHYSFS_uint8 *password = NULL; + + /* if not found, see if maybe "$PASSWORD" is appended. */ + if ((!entry) && (info->has_crypto)) + { + const char *ptr = strrchr(filename, '$'); + if (ptr != NULL) + { + const size_t len = (size_t) (ptr - filename); + char *str = (char *) __PHYSFS_smallAlloc(len + 1); + BAIL_IF(!str, PHYSFS_ERR_OUT_OF_MEMORY, NULL); + memcpy(str, filename, len); + str[len] = '\0'; + entry = zip_find_entry(info, str); + __PHYSFS_smallFree(str); + password = (PHYSFS_uint8 *) (ptr + 1); + } /* if */ + } /* if */ + + BAIL_IF_ERRPASS(!entry, NULL); + + BAIL_IF_ERRPASS(!zip_resolve(info->io, info, entry), NULL); + + BAIL_IF(entry->tree.isdir, PHYSFS_ERR_NOT_A_FILE, NULL); + + retval = (PHYSFS_Io *) allocator.Malloc(sizeof (PHYSFS_Io)); + GOTO_IF(!retval, PHYSFS_ERR_OUT_OF_MEMORY, ZIP_openRead_failed); + + finfo = (ZIPfileinfo *) allocator.Malloc(sizeof (ZIPfileinfo)); + GOTO_IF(!finfo, PHYSFS_ERR_OUT_OF_MEMORY, ZIP_openRead_failed); + memset(finfo, '\0', sizeof (ZIPfileinfo)); + + io = zip_get_io(info->io, info, entry); + GOTO_IF_ERRPASS(!io, ZIP_openRead_failed); + finfo->io = io; + finfo->entry = ((entry->symlink != NULL) ? entry->symlink : entry); + initializeZStream(&finfo->stream); + + if (finfo->entry->compression_method != COMPMETH_NONE) + { + finfo->buffer = (PHYSFS_uint8 *) allocator.Malloc(ZIP_READBUFSIZE); + if (!finfo->buffer) + GOTO(PHYSFS_ERR_OUT_OF_MEMORY, ZIP_openRead_failed); + else if (zlib_err(inflateInit2(&finfo->stream, -MAX_WBITS)) != Z_OK) + goto ZIP_openRead_failed; + } /* if */ + + if (!zip_entry_is_tradional_crypto(entry)) + GOTO_IF(password != NULL, PHYSFS_ERR_BAD_PASSWORD, ZIP_openRead_failed); + else + { + PHYSFS_uint8 crypto_header[12]; + GOTO_IF(password == NULL, PHYSFS_ERR_BAD_PASSWORD, ZIP_openRead_failed); + if (io->read(io, crypto_header, 12) != 12) + goto ZIP_openRead_failed; + else if (!zip_prep_crypto_keys(finfo, crypto_header, password)) + goto ZIP_openRead_failed; + } /* if */ + + memcpy(retval, &ZIP_Io, sizeof (PHYSFS_Io)); + retval->opaque = finfo; + + return retval; + +ZIP_openRead_failed: + if (finfo != NULL) + { + if (finfo->io != NULL) + finfo->io->destroy(finfo->io); + + if (finfo->buffer != NULL) + { + allocator.Free(finfo->buffer); + inflateEnd(&finfo->stream); + } /* if */ + + allocator.Free(finfo); + } /* if */ + + if (retval != NULL) + allocator.Free(retval); + + return NULL; +} /* ZIP_openRead */ + + +static PHYSFS_Io *ZIP_openWrite(void *opaque, const char *filename) +{ + BAIL(PHYSFS_ERR_READ_ONLY, NULL); +} /* ZIP_openWrite */ + + +static PHYSFS_Io *ZIP_openAppend(void *opaque, const char *filename) +{ + BAIL(PHYSFS_ERR_READ_ONLY, NULL); +} /* ZIP_openAppend */ + + +static int ZIP_remove(void *opaque, const char *name) +{ + BAIL(PHYSFS_ERR_READ_ONLY, 0); +} /* ZIP_remove */ + + +static int ZIP_mkdir(void *opaque, const char *name) +{ + BAIL(PHYSFS_ERR_READ_ONLY, 0); +} /* ZIP_mkdir */ + + +static int ZIP_stat(void *opaque, const char *filename, PHYSFS_Stat *stat) +{ + ZIPinfo *info = (ZIPinfo *) opaque; + ZIPentry *entry = zip_find_entry(info, filename); + + if (entry == NULL) + return 0; + + else if (!zip_resolve(info->io, info, entry)) + return 0; + + else if (entry->resolved == ZIP_DIRECTORY) + { + stat->filesize = 0; + stat->filetype = PHYSFS_FILETYPE_DIRECTORY; + } /* if */ + + else if (zip_entry_is_symlink(entry)) + { + stat->filesize = 0; + stat->filetype = PHYSFS_FILETYPE_SYMLINK; + } /* else if */ + + else + { + stat->filesize = (PHYSFS_sint64) entry->uncompressed_size; + stat->filetype = PHYSFS_FILETYPE_REGULAR; + } /* else */ + + stat->modtime = ((entry) ? entry->last_mod_time : 0); + stat->createtime = stat->modtime; + stat->accesstime = -1; + stat->readonly = 1; /* .zip files are always read only */ + + return 1; +} /* ZIP_stat */ + + +const PHYSFS_Archiver __PHYSFS_Archiver_ZIP = +{ + CURRENT_PHYSFS_ARCHIVER_API_VERSION, + { + "ZIP", + "PkZip/WinZip/Info-Zip compatible", + "Ryan C. Gordon ", + "https://icculus.org/physfs/", + 1, /* supportsSymlinks */ + }, + ZIP_openArchive, + __PHYSFS_DirTreeEnumerate, + ZIP_openRead, + ZIP_openWrite, + ZIP_openAppend, + ZIP_remove, + ZIP_mkdir, + ZIP_stat, + ZIP_closeArchive +}; + +#endif /* defined PHYSFS_SUPPORTS_ZIP */ + +/* end of physfs_archiver_zip.c ... */ + diff --git a/third_party/physfs/physfs_byteorder.c b/third_party/physfs/physfs_byteorder.c new file mode 100644 index 00000000..b2d3a2cf --- /dev/null +++ b/third_party/physfs/physfs_byteorder.c @@ -0,0 +1,137 @@ +/** + * PhysicsFS; a portable, flexible file i/o abstraction. + * + * Documentation is in physfs.h. It's verbose, honest. :) + * + * Please see the file LICENSE.txt in the source's root directory. + * + * This file written by Ryan C. Gordon. + */ + +#define __PHYSICSFS_INTERNAL__ +#include "physfs_internal.h" + +#ifndef PHYSFS_Swap16 +static inline PHYSFS_uint16 PHYSFS_Swap16(PHYSFS_uint16 D) +{ + return ((D<<8)|(D>>8)); +} +#endif +#ifndef PHYSFS_Swap32 +static inline PHYSFS_uint32 PHYSFS_Swap32(PHYSFS_uint32 D) +{ + return ((D<<24)|((D<<8)&0x00FF0000)|((D>>8)&0x0000FF00)|(D>>24)); +} +#endif +#ifndef PHYSFS_NO_64BIT_SUPPORT +#ifndef PHYSFS_Swap64 +static inline PHYSFS_uint64 PHYSFS_Swap64(PHYSFS_uint64 val) { + PHYSFS_uint32 hi, lo; + + /* Separate into high and low 32-bit values and swap them */ + lo = (PHYSFS_uint32)(val&0xFFFFFFFF); + val >>= 32; + hi = (PHYSFS_uint32)(val&0xFFFFFFFF); + val = PHYSFS_Swap32(lo); + val <<= 32; + val |= PHYSFS_Swap32(hi); + return val; +} +#endif +#else +#ifndef PHYSFS_Swap64 +/* This is mainly to keep compilers from complaining in PHYSFS code. + If there is no real 64-bit datatype, then compilers will complain about + the fake 64-bit datatype that PHYSFS provides when it compiles user code. +*/ +#define PHYSFS_Swap64(X) (X) +#endif +#endif /* PHYSFS_NO_64BIT_SUPPORT */ + + +/* Byteswap item from the specified endianness to the native endianness */ +#if PHYSFS_BYTEORDER == PHYSFS_LIL_ENDIAN +PHYSFS_uint16 PHYSFS_swapULE16(PHYSFS_uint16 x) { return x; } +PHYSFS_sint16 PHYSFS_swapSLE16(PHYSFS_sint16 x) { return x; } +PHYSFS_uint32 PHYSFS_swapULE32(PHYSFS_uint32 x) { return x; } +PHYSFS_sint32 PHYSFS_swapSLE32(PHYSFS_sint32 x) { return x; } +PHYSFS_uint64 PHYSFS_swapULE64(PHYSFS_uint64 x) { return x; } +PHYSFS_sint64 PHYSFS_swapSLE64(PHYSFS_sint64 x) { return x; } + +PHYSFS_uint16 PHYSFS_swapUBE16(PHYSFS_uint16 x) { return PHYSFS_Swap16(x); } +PHYSFS_sint16 PHYSFS_swapSBE16(PHYSFS_sint16 x) { return PHYSFS_Swap16(x); } +PHYSFS_uint32 PHYSFS_swapUBE32(PHYSFS_uint32 x) { return PHYSFS_Swap32(x); } +PHYSFS_sint32 PHYSFS_swapSBE32(PHYSFS_sint32 x) { return PHYSFS_Swap32(x); } +PHYSFS_uint64 PHYSFS_swapUBE64(PHYSFS_uint64 x) { return PHYSFS_Swap64(x); } +PHYSFS_sint64 PHYSFS_swapSBE64(PHYSFS_sint64 x) { return PHYSFS_Swap64(x); } +#else +PHYSFS_uint16 PHYSFS_swapULE16(PHYSFS_uint16 x) { return PHYSFS_Swap16(x); } +PHYSFS_sint16 PHYSFS_swapSLE16(PHYSFS_sint16 x) { return PHYSFS_Swap16(x); } +PHYSFS_uint32 PHYSFS_swapULE32(PHYSFS_uint32 x) { return PHYSFS_Swap32(x); } +PHYSFS_sint32 PHYSFS_swapSLE32(PHYSFS_sint32 x) { return PHYSFS_Swap32(x); } +PHYSFS_uint64 PHYSFS_swapULE64(PHYSFS_uint64 x) { return PHYSFS_Swap64(x); } +PHYSFS_sint64 PHYSFS_swapSLE64(PHYSFS_sint64 x) { return PHYSFS_Swap64(x); } + +PHYSFS_uint16 PHYSFS_swapUBE16(PHYSFS_uint16 x) { return x; } +PHYSFS_sint16 PHYSFS_swapSBE16(PHYSFS_sint16 x) { return x; } +PHYSFS_uint32 PHYSFS_swapUBE32(PHYSFS_uint32 x) { return x; } +PHYSFS_sint32 PHYSFS_swapSBE32(PHYSFS_sint32 x) { return x; } +PHYSFS_uint64 PHYSFS_swapUBE64(PHYSFS_uint64 x) { return x; } +PHYSFS_sint64 PHYSFS_swapSBE64(PHYSFS_sint64 x) { return x; } +#endif + +static inline int readAll(PHYSFS_File *file, void *val, const size_t len) +{ + return (PHYSFS_readBytes(file, val, len) == len); +} /* readAll */ + +#define PHYSFS_BYTEORDER_READ(datatype, swaptype) \ + int PHYSFS_read##swaptype(PHYSFS_File *file, PHYSFS_##datatype *val) { \ + PHYSFS_##datatype in; \ + BAIL_IF(val == NULL, PHYSFS_ERR_INVALID_ARGUMENT, 0); \ + BAIL_IF_ERRPASS(!readAll(file, &in, sizeof (in)), 0); \ + *val = PHYSFS_swap##swaptype(in); \ + return 1; \ + } + +PHYSFS_BYTEORDER_READ(sint16, SLE16) +PHYSFS_BYTEORDER_READ(uint16, ULE16) +PHYSFS_BYTEORDER_READ(sint16, SBE16) +PHYSFS_BYTEORDER_READ(uint16, UBE16) +PHYSFS_BYTEORDER_READ(sint32, SLE32) +PHYSFS_BYTEORDER_READ(uint32, ULE32) +PHYSFS_BYTEORDER_READ(sint32, SBE32) +PHYSFS_BYTEORDER_READ(uint32, UBE32) +PHYSFS_BYTEORDER_READ(sint64, SLE64) +PHYSFS_BYTEORDER_READ(uint64, ULE64) +PHYSFS_BYTEORDER_READ(sint64, SBE64) +PHYSFS_BYTEORDER_READ(uint64, UBE64) + + +static inline int writeAll(PHYSFS_File *f, const void *val, const size_t len) +{ + return (PHYSFS_writeBytes(f, val, len) == len); +} /* writeAll */ + +#define PHYSFS_BYTEORDER_WRITE(datatype, swaptype) \ + int PHYSFS_write##swaptype(PHYSFS_File *file, PHYSFS_##datatype val) { \ + const PHYSFS_##datatype out = PHYSFS_swap##swaptype(val); \ + BAIL_IF_ERRPASS(!writeAll(file, &out, sizeof (out)), 0); \ + return 1; \ + } + +PHYSFS_BYTEORDER_WRITE(sint16, SLE16) +PHYSFS_BYTEORDER_WRITE(uint16, ULE16) +PHYSFS_BYTEORDER_WRITE(sint16, SBE16) +PHYSFS_BYTEORDER_WRITE(uint16, UBE16) +PHYSFS_BYTEORDER_WRITE(sint32, SLE32) +PHYSFS_BYTEORDER_WRITE(uint32, ULE32) +PHYSFS_BYTEORDER_WRITE(sint32, SBE32) +PHYSFS_BYTEORDER_WRITE(uint32, UBE32) +PHYSFS_BYTEORDER_WRITE(sint64, SLE64) +PHYSFS_BYTEORDER_WRITE(uint64, ULE64) +PHYSFS_BYTEORDER_WRITE(sint64, SBE64) +PHYSFS_BYTEORDER_WRITE(uint64, UBE64) + +/* end of physfs_byteorder.c ... */ + diff --git a/third_party/physfs/physfs_casefolding.h b/third_party/physfs/physfs_casefolding.h new file mode 100644 index 00000000..bb6ac189 --- /dev/null +++ b/third_party/physfs/physfs_casefolding.h @@ -0,0 +1,2572 @@ +/* + * This file is part of PhysicsFS (https://icculus.org/physfs/) + * + * This data generated by physfs/extras/makecasefoldhashtable.pl ... + * Do not manually edit this file! + * + * Please see the file LICENSE.txt in the source's root directory. + */ + +#ifndef _INCLUDE_PHYSFS_CASEFOLDING_H_ +#define _INCLUDE_PHYSFS_CASEFOLDING_H_ + +#ifndef __PHYSICSFS_INTERNAL__ +#error Do not include this header from your applications. +#endif + +/* We build three simple hashmaps here: one that maps Unicode codepoints to +a one, two, or three lowercase codepoints. To retrieve this info: look at +case_fold_hashX, where X is 1, 2, or 3. Most foldable codepoints fold to one, +a few dozen fold to two, and a handful fold to three. If the codepoint isn't +in any of these hashes, it doesn't fold (no separate upper and lowercase). + +Almost all these codepoints fit into 16 bits, so we hash them as such to save +memory. If a codepoint is > 0xFFFF, we have separate hashes for them, +since there are (currently) only about 120 of them and (currently) all of them +map to a single lowercase codepoint. */ + +typedef struct CaseFoldMapping1_32 +{ + PHYSFS_uint32 from; + PHYSFS_uint32 to0; +} CaseFoldMapping1_32; + +typedef struct CaseFoldMapping1_16 +{ + PHYSFS_uint16 from; + PHYSFS_uint16 to0; +} CaseFoldMapping1_16; + +typedef struct CaseFoldMapping2_16 +{ + PHYSFS_uint16 from; + PHYSFS_uint16 to0; + PHYSFS_uint16 to1; +} CaseFoldMapping2_16; + +typedef struct CaseFoldMapping3_16 +{ + PHYSFS_uint16 from; + PHYSFS_uint16 to0; + PHYSFS_uint16 to1; + PHYSFS_uint16 to2; +} CaseFoldMapping3_16; + +typedef struct CaseFoldHashBucket1_16 +{ + const CaseFoldMapping1_16 *list; + const PHYSFS_uint8 count; +} CaseFoldHashBucket1_16; + +typedef struct CaseFoldHashBucket1_32 +{ + const CaseFoldMapping1_32 *list; + const PHYSFS_uint8 count; +} CaseFoldHashBucket1_32; + +typedef struct CaseFoldHashBucket2_16 +{ + const CaseFoldMapping2_16 *list; + const PHYSFS_uint8 count; +} CaseFoldHashBucket2_16; + +typedef struct CaseFoldHashBucket3_16 +{ + const CaseFoldMapping3_16 *list; + const PHYSFS_uint8 count; +} CaseFoldHashBucket3_16; + +static const CaseFoldMapping1_16 case_fold1_16_000[] = { + { 0x0202, 0x0203 }, + { 0x0404, 0x0454 }, + { 0x1E1E, 0x1E1F }, + { 0x2C2C, 0x2C5C }, + { 0xABAB, 0x13DB } +}; + +static const CaseFoldMapping1_16 case_fold1_16_001[] = { + { 0x0100, 0x0101 }, + { 0x0405, 0x0455 }, + { 0x0504, 0x0505 }, + { 0x2C2D, 0x2C5D }, + { 0xA7A6, 0xA7A7 }, + { 0xABAA, 0x13DA } +}; + +static const CaseFoldMapping1_16 case_fold1_16_002[] = { + { 0x0200, 0x0201 }, + { 0x0406, 0x0456 }, + { 0x1E1C, 0x1E1D }, + { 0x1F1D, 0x1F15 }, + { 0x2C2E, 0x2C5E }, + { 0xABA9, 0x13D9 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_003[] = { + { 0x0102, 0x0103 }, + { 0x0407, 0x0457 }, + { 0x0506, 0x0507 }, + { 0x1F1C, 0x1F14 }, + { 0xA7A4, 0xA7A5 }, + { 0xABA8, 0x13D8 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_004[] = { + { 0x0206, 0x0207 }, + { 0x0400, 0x0450 }, + { 0x1E1A, 0x1E1B }, + { 0x1F1B, 0x1F13 }, + { 0x2C28, 0x2C58 }, + { 0xABAF, 0x13DF } +}; + +static const CaseFoldMapping1_16 case_fold1_16_005[] = { + { 0x0104, 0x0105 }, + { 0x0401, 0x0451 }, + { 0x0500, 0x0501 }, + { 0x1F1A, 0x1F12 }, + { 0x2C29, 0x2C59 }, + { 0xA7A2, 0xA7A3 }, + { 0xABAE, 0x13DE } +}; + +static const CaseFoldMapping1_16 case_fold1_16_006[] = { + { 0x0204, 0x0205 }, + { 0x0402, 0x0452 }, + { 0x1E18, 0x1E19 }, + { 0x1F19, 0x1F11 }, + { 0x2C2A, 0x2C5A }, + { 0xABAD, 0x13DD } +}; + +static const CaseFoldMapping1_16 case_fold1_16_007[] = { + { 0x0106, 0x0107 }, + { 0x0403, 0x0453 }, + { 0x0502, 0x0503 }, + { 0x1F18, 0x1F10 }, + { 0x2126, 0x03C9 }, + { 0x2C2B, 0x2C5B }, + { 0xA7A0, 0xA7A1 }, + { 0xABAC, 0x13DC } +}; + +static const CaseFoldMapping1_16 case_fold1_16_008[] = { + { 0x020A, 0x020B }, + { 0x040C, 0x045C }, + { 0x1E16, 0x1E17 }, + { 0x2C24, 0x2C54 }, + { 0xABA3, 0x13D3 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_009[] = { + { 0x0108, 0x0109 }, + { 0x040D, 0x045D }, + { 0x050C, 0x050D }, + { 0x2C25, 0x2C55 }, + { 0xABA2, 0x13D2 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_010[] = { + { 0x0208, 0x0209 }, + { 0x040E, 0x045E }, + { 0x1E14, 0x1E15 }, + { 0x212B, 0x00E5 }, + { 0x2C26, 0x2C56 }, + { 0xA7AD, 0x026C }, + { 0xABA1, 0x13D1 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_011[] = { + { 0x010A, 0x010B }, + { 0x040F, 0x045F }, + { 0x050E, 0x050F }, + { 0x212A, 0x006B }, + { 0x2C27, 0x2C57 }, + { 0xA7AC, 0x0261 }, + { 0xABA0, 0x13D0 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_012[] = { + { 0x020E, 0x020F }, + { 0x0408, 0x0458 }, + { 0x1E12, 0x1E13 }, + { 0x2C20, 0x2C50 }, + { 0xA7AB, 0x025C }, + { 0xABA7, 0x13D7 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_013[] = { + { 0x010C, 0x010D }, + { 0x0409, 0x0459 }, + { 0x0508, 0x0509 }, + { 0x2C21, 0x2C51 }, + { 0xA7AA, 0x0266 }, + { 0xABA6, 0x13D6 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_014[] = { + { 0x020C, 0x020D }, + { 0x040A, 0x045A }, + { 0x1E10, 0x1E11 }, + { 0x2C22, 0x2C52 }, + { 0xABA5, 0x13D5 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_015[] = { + { 0x010E, 0x010F }, + { 0x040B, 0x045B }, + { 0x050A, 0x050B }, + { 0x2C23, 0x2C53 }, + { 0xA7A8, 0xA7A9 }, + { 0xABA4, 0x13D4 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_016[] = { + { 0x0212, 0x0213 }, + { 0x0414, 0x0434 }, + { 0x1E0E, 0x1E0F }, + { 0x1F0F, 0x1F07 }, + { 0xABBB, 0x13EB } +}; + +static const CaseFoldMapping1_16 case_fold1_16_017[] = { + { 0x0110, 0x0111 }, + { 0x0415, 0x0435 }, + { 0x0514, 0x0515 }, + { 0x1F0E, 0x1F06 }, + { 0xA7B6, 0xA7B7 }, + { 0xABBA, 0x13EA } +}; + +static const CaseFoldMapping1_16 case_fold1_16_018[] = { + { 0x0210, 0x0211 }, + { 0x0416, 0x0436 }, + { 0x1E0C, 0x1E0D }, + { 0x1F0D, 0x1F05 }, + { 0xABB9, 0x13E9 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_019[] = { + { 0x0112, 0x0113 }, + { 0x0417, 0x0437 }, + { 0x0516, 0x0517 }, + { 0x1F0C, 0x1F04 }, + { 0x2132, 0x214E }, + { 0xA7B4, 0xA7B5 }, + { 0xABB8, 0x13E8 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_020[] = { + { 0x0216, 0x0217 }, + { 0x0410, 0x0430 }, + { 0x1E0A, 0x1E0B }, + { 0x1F0B, 0x1F03 }, + { 0xA7B3, 0xAB53 }, + { 0xABBF, 0x13EF } +}; + +static const CaseFoldMapping1_16 case_fold1_16_021[] = { + { 0x0114, 0x0115 }, + { 0x0411, 0x0431 }, + { 0x0510, 0x0511 }, + { 0x1F0A, 0x1F02 }, + { 0xA7B2, 0x029D }, + { 0xABBE, 0x13EE } +}; + +static const CaseFoldMapping1_16 case_fold1_16_022[] = { + { 0x0214, 0x0215 }, + { 0x0412, 0x0432 }, + { 0x1E08, 0x1E09 }, + { 0x1F09, 0x1F01 }, + { 0xA7B1, 0x0287 }, + { 0xABBD, 0x13ED } +}; + +static const CaseFoldMapping1_16 case_fold1_16_023[] = { + { 0x0116, 0x0117 }, + { 0x0413, 0x0433 }, + { 0x0512, 0x0513 }, + { 0x1F08, 0x1F00 }, + { 0xA7B0, 0x029E }, + { 0xABBC, 0x13EC } +}; + +static const CaseFoldMapping1_16 case_fold1_16_024[] = { + { 0x021A, 0x021B }, + { 0x041C, 0x043C }, + { 0x1E06, 0x1E07 }, + { 0xABB3, 0x13E3 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_025[] = { + { 0x0118, 0x0119 }, + { 0x041D, 0x043D }, + { 0x051C, 0x051D }, + { 0xABB2, 0x13E2 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_026[] = { + { 0x0218, 0x0219 }, + { 0x041E, 0x043E }, + { 0x1E04, 0x1E05 }, + { 0xABB1, 0x13E1 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_027[] = { + { 0x011A, 0x011B }, + { 0x041F, 0x043F }, + { 0x051E, 0x051F }, + { 0xABB0, 0x13E0 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_028[] = { + { 0x021E, 0x021F }, + { 0x0418, 0x0438 }, + { 0x1E02, 0x1E03 }, + { 0xABB7, 0x13E7 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_029[] = { + { 0x011C, 0x011D }, + { 0x0419, 0x0439 }, + { 0x0518, 0x0519 }, + { 0xABB6, 0x13E6 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_030[] = { + { 0x021C, 0x021D }, + { 0x041A, 0x043A }, + { 0x1E00, 0x1E01 }, + { 0xABB5, 0x13E5 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_031[] = { + { 0x011E, 0x011F }, + { 0x041B, 0x043B }, + { 0x051A, 0x051B }, + { 0xABB4, 0x13E4 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_032[] = { + { 0x0222, 0x0223 }, + { 0x0424, 0x0444 }, + { 0x1E3E, 0x1E3F }, + { 0x1F3F, 0x1F37 }, + { 0x2C0C, 0x2C3C }, + { 0xA686, 0xA687 }, + { 0xAB8B, 0x13BB } +}; + +static const CaseFoldMapping1_16 case_fold1_16_033[] = { + { 0x0120, 0x0121 }, + { 0x0425, 0x0445 }, + { 0x0524, 0x0525 }, + { 0x1F3E, 0x1F36 }, + { 0x2C0D, 0x2C3D }, + { 0xA786, 0xA787 }, + { 0xAB8A, 0x13BA } +}; + +static const CaseFoldMapping1_16 case_fold1_16_034[] = { + { 0x0220, 0x019E }, + { 0x0426, 0x0446 }, + { 0x1E3C, 0x1E3D }, + { 0x1F3D, 0x1F35 }, + { 0x2C0E, 0x2C3E }, + { 0xA684, 0xA685 }, + { 0xAB89, 0x13B9 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_035[] = { + { 0x0122, 0x0123 }, + { 0x0427, 0x0447 }, + { 0x0526, 0x0527 }, + { 0x1F3C, 0x1F34 }, + { 0x2C0F, 0x2C3F }, + { 0xA784, 0xA785 }, + { 0xAB88, 0x13B8 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_036[] = { + { 0x0226, 0x0227 }, + { 0x0420, 0x0440 }, + { 0x1E3A, 0x1E3B }, + { 0x1F3B, 0x1F33 }, + { 0x2C08, 0x2C38 }, + { 0xA682, 0xA683 }, + { 0xAB8F, 0x13BF } +}; + +static const CaseFoldMapping1_16 case_fold1_16_037[] = { + { 0x0124, 0x0125 }, + { 0x0421, 0x0441 }, + { 0x0520, 0x0521 }, + { 0x1F3A, 0x1F32 }, + { 0x2C09, 0x2C39 }, + { 0xA782, 0xA783 }, + { 0xAB8E, 0x13BE } +}; + +static const CaseFoldMapping1_16 case_fold1_16_038[] = { + { 0x0224, 0x0225 }, + { 0x0422, 0x0442 }, + { 0x1E38, 0x1E39 }, + { 0x1F39, 0x1F31 }, + { 0x2C0A, 0x2C3A }, + { 0xA680, 0xA681 }, + { 0xAB8D, 0x13BD } +}; + +static const CaseFoldMapping1_16 case_fold1_16_039[] = { + { 0x0126, 0x0127 }, + { 0x0423, 0x0443 }, + { 0x0522, 0x0523 }, + { 0x1F38, 0x1F30 }, + { 0x2C0B, 0x2C3B }, + { 0xA780, 0xA781 }, + { 0xAB8C, 0x13BC } +}; + +static const CaseFoldMapping1_16 case_fold1_16_040[] = { + { 0x022A, 0x022B }, + { 0x042C, 0x044C }, + { 0x1E36, 0x1E37 }, + { 0x2C04, 0x2C34 }, + { 0xA68E, 0xA68F }, + { 0xAB83, 0x13B3 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_041[] = { + { 0x0128, 0x0129 }, + { 0x042D, 0x044D }, + { 0x052C, 0x052D }, + { 0x2C05, 0x2C35 }, + { 0xAB82, 0x13B2 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_042[] = { + { 0x0228, 0x0229 }, + { 0x042E, 0x044E }, + { 0x1E34, 0x1E35 }, + { 0x2C06, 0x2C36 }, + { 0xA68C, 0xA68D }, + { 0xA78D, 0x0265 }, + { 0xAB81, 0x13B1 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_043[] = { + { 0x012A, 0x012B }, + { 0x042F, 0x044F }, + { 0x052E, 0x052F }, + { 0x2C07, 0x2C37 }, + { 0xAB80, 0x13B0 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_044[] = { + { 0x022E, 0x022F }, + { 0x0428, 0x0448 }, + { 0x1E32, 0x1E33 }, + { 0x2C00, 0x2C30 }, + { 0xA68A, 0xA68B }, + { 0xA78B, 0xA78C }, + { 0xAB87, 0x13B7 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_045[] = { + { 0x012C, 0x012D }, + { 0x0429, 0x0449 }, + { 0x0528, 0x0529 }, + { 0x2C01, 0x2C31 }, + { 0xAB86, 0x13B6 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_046[] = { + { 0x022C, 0x022D }, + { 0x042A, 0x044A }, + { 0x1E30, 0x1E31 }, + { 0x2C02, 0x2C32 }, + { 0xA688, 0xA689 }, + { 0xAB85, 0x13B5 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_047[] = { + { 0x012E, 0x012F }, + { 0x042B, 0x044B }, + { 0x052A, 0x052B }, + { 0x2C03, 0x2C33 }, + { 0xAB84, 0x13B4 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_048[] = { + { 0x0232, 0x0233 }, + { 0x0535, 0x0565 }, + { 0x1E2E, 0x1E2F }, + { 0x1F2F, 0x1F27 }, + { 0x2C1C, 0x2C4C }, + { 0xA696, 0xA697 }, + { 0xAB9B, 0x13CB } +}; + +static const CaseFoldMapping1_16 case_fold1_16_049[] = { + { 0x0534, 0x0564 }, + { 0x1F2E, 0x1F26 }, + { 0x2C1D, 0x2C4D }, + { 0xA796, 0xA797 }, + { 0xAB9A, 0x13CA } +}; + +static const CaseFoldMapping1_16 case_fold1_16_050[] = { + { 0x0230, 0x0231 }, + { 0x0537, 0x0567 }, + { 0x1E2C, 0x1E2D }, + { 0x1F2D, 0x1F25 }, + { 0x2C1E, 0x2C4E }, + { 0xA694, 0xA695 }, + { 0xAB99, 0x13C9 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_051[] = { + { 0x0132, 0x0133 }, + { 0x0536, 0x0566 }, + { 0x1F2C, 0x1F24 }, + { 0x2C1F, 0x2C4F }, + { 0xAB98, 0x13C8 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_052[] = { + { 0x0531, 0x0561 }, + { 0x1E2A, 0x1E2B }, + { 0x1F2B, 0x1F23 }, + { 0x2C18, 0x2C48 }, + { 0xA692, 0xA693 }, + { 0xAB9F, 0x13CF } +}; + +static const CaseFoldMapping1_16 case_fold1_16_053[] = { + { 0x0134, 0x0135 }, + { 0x1F2A, 0x1F22 }, + { 0x2C19, 0x2C49 }, + { 0xA792, 0xA793 }, + { 0xAB9E, 0x13CE } +}; + +static const CaseFoldMapping1_16 case_fold1_16_054[] = { + { 0x0533, 0x0563 }, + { 0x1E28, 0x1E29 }, + { 0x1F29, 0x1F21 }, + { 0x2C1A, 0x2C4A }, + { 0xA690, 0xA691 }, + { 0xAB9D, 0x13CD } +}; + +static const CaseFoldMapping1_16 case_fold1_16_055[] = { + { 0x0136, 0x0137 }, + { 0x0532, 0x0562 }, + { 0x1F28, 0x1F20 }, + { 0x2C1B, 0x2C4B }, + { 0xA790, 0xA791 }, + { 0xAB9C, 0x13CC } +}; + +static const CaseFoldMapping1_16 case_fold1_16_056[] = { + { 0x0139, 0x013A }, + { 0x023A, 0x2C65 }, + { 0x053D, 0x056D }, + { 0x1E26, 0x1E27 }, + { 0x2C14, 0x2C44 }, + { 0xAB93, 0x13C3 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_057[] = { + { 0x023B, 0x023C }, + { 0x053C, 0x056C }, + { 0x2C15, 0x2C45 }, + { 0xA79E, 0xA79F }, + { 0xAB92, 0x13C2 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_058[] = { + { 0x013B, 0x013C }, + { 0x053F, 0x056F }, + { 0x1E24, 0x1E25 }, + { 0x2C16, 0x2C46 }, + { 0xAB91, 0x13C1 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_059[] = { + { 0x053E, 0x056E }, + { 0x2C17, 0x2C47 }, + { 0xA79C, 0xA79D }, + { 0xAB90, 0x13C0 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_060[] = { + { 0x013D, 0x013E }, + { 0x023E, 0x2C66 }, + { 0x0539, 0x0569 }, + { 0x1E22, 0x1E23 }, + { 0x2C10, 0x2C40 }, + { 0xA69A, 0xA69B }, + { 0xAB97, 0x13C7 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_061[] = { + { 0x0538, 0x0568 }, + { 0x2C11, 0x2C41 }, + { 0xA79A, 0xA79B }, + { 0xAB96, 0x13C6 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_062[] = { + { 0x013F, 0x0140 }, + { 0x053B, 0x056B }, + { 0x1E20, 0x1E21 }, + { 0x2C12, 0x2C42 }, + { 0xA698, 0xA699 }, + { 0xAB95, 0x13C5 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_063[] = { + { 0x023D, 0x019A }, + { 0x053A, 0x056A }, + { 0x2C13, 0x2C43 }, + { 0xA798, 0xA799 }, + { 0xAB94, 0x13C4 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_064[] = { + { 0x0141, 0x0142 }, + { 0x0545, 0x0575 }, + { 0x1E5E, 0x1E5F }, + { 0x1F5F, 0x1F57 }, + { 0x2161, 0x2171 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_065[] = { + { 0x0041, 0x0061 }, + { 0x0243, 0x0180 }, + { 0x0544, 0x0574 }, + { 0x2160, 0x2170 }, + { 0x2C6D, 0x0251 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_066[] = { + { 0x0042, 0x0062 }, + { 0x0143, 0x0144 }, + { 0x0547, 0x0577 }, + { 0x1E5C, 0x1E5D }, + { 0x1F5D, 0x1F55 }, + { 0x2163, 0x2173 }, + { 0x2C6E, 0x0271 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_067[] = { + { 0x0043, 0x0063 }, + { 0x0241, 0x0242 }, + { 0x0546, 0x0576 }, + { 0x2162, 0x2172 }, + { 0x2C6F, 0x0250 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_068[] = { + { 0x0044, 0x0064 }, + { 0x0145, 0x0146 }, + { 0x0246, 0x0247 }, + { 0x0541, 0x0571 }, + { 0x1E5A, 0x1E5B }, + { 0x1F5B, 0x1F53 }, + { 0x2165, 0x2175 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_069[] = { + { 0x0045, 0x0065 }, + { 0x0540, 0x0570 }, + { 0x2164, 0x2174 }, + { 0x2C69, 0x2C6A } +}; + +static const CaseFoldMapping1_16 case_fold1_16_070[] = { + { 0x0046, 0x0066 }, + { 0x0147, 0x0148 }, + { 0x0244, 0x0289 }, + { 0x0345, 0x03B9 }, + { 0x0543, 0x0573 }, + { 0x1E58, 0x1E59 }, + { 0x1F59, 0x1F51 }, + { 0x2167, 0x2177 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_071[] = { + { 0x0047, 0x0067 }, + { 0x0245, 0x028C }, + { 0x0542, 0x0572 }, + { 0x2166, 0x2176 }, + { 0x2C6B, 0x2C6C } +}; + +static const CaseFoldMapping1_16 case_fold1_16_072[] = { + { 0x0048, 0x0068 }, + { 0x024A, 0x024B }, + { 0x054D, 0x057D }, + { 0x1E56, 0x1E57 }, + { 0x2169, 0x2179 }, + { 0x2C64, 0x027D } +}; + +static const CaseFoldMapping1_16 case_fold1_16_073[] = { + { 0x0049, 0x0069 }, + { 0x054C, 0x057C }, + { 0x2168, 0x2178 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_074[] = { + { 0x004A, 0x006A }, + { 0x0248, 0x0249 }, + { 0x054F, 0x057F }, + { 0x1E54, 0x1E55 }, + { 0x216B, 0x217B } +}; + +static const CaseFoldMapping1_16 case_fold1_16_075[] = { + { 0x004B, 0x006B }, + { 0x014A, 0x014B }, + { 0x054E, 0x057E }, + { 0x216A, 0x217A }, + { 0x2C67, 0x2C68 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_076[] = { + { 0x004C, 0x006C }, + { 0x024E, 0x024F }, + { 0x0549, 0x0579 }, + { 0x1E52, 0x1E53 }, + { 0x216D, 0x217D }, + { 0x2C60, 0x2C61 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_077[] = { + { 0x004D, 0x006D }, + { 0x014C, 0x014D }, + { 0x0548, 0x0578 }, + { 0x216C, 0x217C } +}; + +static const CaseFoldMapping1_16 case_fold1_16_078[] = { + { 0x004E, 0x006E }, + { 0x024C, 0x024D }, + { 0x054B, 0x057B }, + { 0x1E50, 0x1E51 }, + { 0x216F, 0x217F }, + { 0x2C62, 0x026B } +}; + +static const CaseFoldMapping1_16 case_fold1_16_079[] = { + { 0x004F, 0x006F }, + { 0x014E, 0x014F }, + { 0x054A, 0x057A }, + { 0x216E, 0x217E }, + { 0x2C63, 0x1D7D } +}; + +static const CaseFoldMapping1_16 case_fold1_16_080[] = { + { 0x0050, 0x0070 }, + { 0x0555, 0x0585 }, + { 0x1E4E, 0x1E4F } +}; + +static const CaseFoldMapping1_16 case_fold1_16_081[] = { + { 0x0051, 0x0071 }, + { 0x0150, 0x0151 }, + { 0x0554, 0x0584 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_082[] = { + { 0x0052, 0x0072 }, + { 0x1E4C, 0x1E4D }, + { 0x1F4D, 0x1F45 }, + { 0x2C7E, 0x023F } +}; + +static const CaseFoldMapping1_16 case_fold1_16_083[] = { + { 0x0053, 0x0073 }, + { 0x0152, 0x0153 }, + { 0x0556, 0x0586 }, + { 0x1F4C, 0x1F44 }, + { 0x2C7F, 0x0240 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_084[] = { + { 0x0054, 0x0074 }, + { 0x0551, 0x0581 }, + { 0x1E4A, 0x1E4B }, + { 0x1F4B, 0x1F43 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_085[] = { + { 0x0055, 0x0075 }, + { 0x0154, 0x0155 }, + { 0x0550, 0x0580 }, + { 0x1F4A, 0x1F42 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_086[] = { + { 0x0056, 0x0076 }, + { 0x0553, 0x0583 }, + { 0x1E48, 0x1E49 }, + { 0x1F49, 0x1F41 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_087[] = { + { 0x0057, 0x0077 }, + { 0x0156, 0x0157 }, + { 0x0552, 0x0582 }, + { 0x1F48, 0x1F40 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_088[] = { + { 0x0058, 0x0078 }, + { 0x1E46, 0x1E47 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_089[] = { + { 0x0059, 0x0079 }, + { 0x0158, 0x0159 }, + { 0x2C75, 0x2C76 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_090[] = { + { 0x005A, 0x007A }, + { 0x1E44, 0x1E45 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_091[] = { + { 0x015A, 0x015B } +}; + +static const CaseFoldMapping1_16 case_fold1_16_092[] = { + { 0x1E42, 0x1E43 }, + { 0x2C70, 0x0252 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_093[] = { + { 0x015C, 0x015D } +}; + +static const CaseFoldMapping1_16 case_fold1_16_094[] = { + { 0x1E40, 0x1E41 }, + { 0x2C72, 0x2C73 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_095[] = { + { 0x015E, 0x015F } +}; + +static const CaseFoldMapping1_16 case_fold1_16_096[] = { + { 0x0464, 0x0465 }, + { 0x1E7E, 0x1E7F } +}; + +static const CaseFoldMapping1_16 case_fold1_16_097[] = { + { 0x0160, 0x0161 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_098[] = { + { 0x0466, 0x0467 }, + { 0x1E7C, 0x1E7D } +}; + +static const CaseFoldMapping1_16 case_fold1_16_099[] = { + { 0x0162, 0x0163 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_100[] = { + { 0x0460, 0x0461 }, + { 0x1E7A, 0x1E7B } +}; + +static const CaseFoldMapping1_16 case_fold1_16_101[] = { + { 0x0164, 0x0165 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_102[] = { + { 0x0462, 0x0463 }, + { 0x1E78, 0x1E79 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_103[] = { + { 0x0166, 0x0167 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_104[] = { + { 0x046C, 0x046D }, + { 0x1E76, 0x1E77 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_105[] = { + { 0x0168, 0x0169 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_106[] = { + { 0x046E, 0x046F }, + { 0x1E74, 0x1E75 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_107[] = { + { 0x016A, 0x016B } +}; + +static const CaseFoldMapping1_16 case_fold1_16_108[] = { + { 0x0468, 0x0469 }, + { 0x1E72, 0x1E73 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_109[] = { + { 0x016C, 0x016D } +}; + +static const CaseFoldMapping1_16 case_fold1_16_110[] = { + { 0x046A, 0x046B }, + { 0x1E70, 0x1E71 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_111[] = { + { 0x016E, 0x016F } +}; + +static const CaseFoldMapping1_16 case_fold1_16_112[] = { + { 0x0474, 0x0475 }, + { 0x1E6E, 0x1E6F }, + { 0x1F6F, 0x1F67 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_113[] = { + { 0x0170, 0x0171 }, + { 0x0372, 0x0373 }, + { 0x1F6E, 0x1F66 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_114[] = { + { 0x0476, 0x0477 }, + { 0x1E6C, 0x1E6D }, + { 0x1F6D, 0x1F65 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_115[] = { + { 0x0172, 0x0173 }, + { 0x0370, 0x0371 }, + { 0x1F6C, 0x1F64 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_116[] = { + { 0x0470, 0x0471 }, + { 0x1E6A, 0x1E6B }, + { 0x1F6B, 0x1F63 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_117[] = { + { 0x0174, 0x0175 }, + { 0x0376, 0x0377 }, + { 0x1F6A, 0x1F62 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_118[] = { + { 0x0472, 0x0473 }, + { 0x1E68, 0x1E69 }, + { 0x1F69, 0x1F61 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_119[] = { + { 0x0176, 0x0177 }, + { 0x1F68, 0x1F60 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_120[] = { + { 0x0179, 0x017A }, + { 0x047C, 0x047D }, + { 0x1E66, 0x1E67 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_121[] = { + { 0x0178, 0x00FF } +}; + +static const CaseFoldMapping1_16 case_fold1_16_122[] = { + { 0x017B, 0x017C }, + { 0x047E, 0x047F }, + { 0x1E64, 0x1E65 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_124[] = { + { 0x017D, 0x017E }, + { 0x037F, 0x03F3 }, + { 0x0478, 0x0479 }, + { 0x1E62, 0x1E63 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_126[] = { + { 0x017F, 0x0073 }, + { 0x047A, 0x047B }, + { 0x1E60, 0x1E61 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_128[] = { + { 0x0181, 0x0253 }, + { 0x2CAC, 0x2CAD } +}; + +static const CaseFoldMapping1_16 case_fold1_16_129[] = { + { 0xA726, 0xA727 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_130[] = { + { 0x2CAE, 0x2CAF } +}; + +static const CaseFoldMapping1_16 case_fold1_16_131[] = { + { 0x0182, 0x0183 }, + { 0xA724, 0xA725 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_132[] = { + { 0x0480, 0x0481 }, + { 0x2CA8, 0x2CA9 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_133[] = { + { 0x0184, 0x0185 }, + { 0x0386, 0x03AC }, + { 0x1E9B, 0x1E61 }, + { 0xA722, 0xA723 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_134[] = { + { 0x0187, 0x0188 }, + { 0x2CAA, 0x2CAB } +}; + +static const CaseFoldMapping1_16 case_fold1_16_135[] = { + { 0x0186, 0x0254 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_136[] = { + { 0x0189, 0x0256 }, + { 0x048C, 0x048D }, + { 0x2CA4, 0x2CA5 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_137[] = { + { 0x038A, 0x03AF }, + { 0xA72E, 0xA72F } +}; + +static const CaseFoldMapping1_16 case_fold1_16_138[] = { + { 0x018B, 0x018C }, + { 0x0389, 0x03AE }, + { 0x048E, 0x048F }, + { 0x1E94, 0x1E95 }, + { 0x2CA6, 0x2CA7 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_139[] = { + { 0x018A, 0x0257 }, + { 0x0388, 0x03AD }, + { 0xA72C, 0xA72D } +}; + +static const CaseFoldMapping1_16 case_fold1_16_140[] = { + { 0x038F, 0x03CE }, + { 0x1E92, 0x1E93 }, + { 0x2CA0, 0x2CA1 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_141[] = { + { 0x038E, 0x03CD }, + { 0xA72A, 0xA72B } +}; + +static const CaseFoldMapping1_16 case_fold1_16_142[] = { + { 0x018F, 0x0259 }, + { 0x048A, 0x048B }, + { 0x1E90, 0x1E91 }, + { 0x2CA2, 0x2CA3 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_143[] = { + { 0x018E, 0x01DD }, + { 0x038C, 0x03CC }, + { 0xA728, 0xA729 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_144[] = { + { 0x0191, 0x0192 }, + { 0x0393, 0x03B3 }, + { 0x0494, 0x0495 }, + { 0x1E8E, 0x1E8F }, + { 0x2CBC, 0x2CBD } +}; + +static const CaseFoldMapping1_16 case_fold1_16_145[] = { + { 0x0190, 0x025B }, + { 0x0392, 0x03B2 }, + { 0xA736, 0xA737 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_146[] = { + { 0x0193, 0x0260 }, + { 0x0391, 0x03B1 }, + { 0x0496, 0x0497 }, + { 0x1E8C, 0x1E8D }, + { 0x24B6, 0x24D0 }, + { 0x2CBE, 0x2CBF } +}; + +static const CaseFoldMapping1_16 case_fold1_16_147[] = { + { 0x24B7, 0x24D1 }, + { 0xA734, 0xA735 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_148[] = { + { 0x0397, 0x03B7 }, + { 0x0490, 0x0491 }, + { 0x1E8A, 0x1E8B }, + { 0x2CB8, 0x2CB9 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_149[] = { + { 0x0194, 0x0263 }, + { 0x0396, 0x03B6 }, + { 0xA732, 0xA733 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_150[] = { + { 0x0197, 0x0268 }, + { 0x0395, 0x03B5 }, + { 0x0492, 0x0493 }, + { 0x1E88, 0x1E89 }, + { 0x2CBA, 0x2CBB } +}; + +static const CaseFoldMapping1_16 case_fold1_16_151[] = { + { 0x0196, 0x0269 }, + { 0x0394, 0x03B4 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_152[] = { + { 0x039B, 0x03BB }, + { 0x049C, 0x049D }, + { 0x1E86, 0x1E87 }, + { 0x24BC, 0x24D6 }, + { 0x2CB4, 0x2CB5 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_153[] = { + { 0x0198, 0x0199 }, + { 0x039A, 0x03BA }, + { 0x24BD, 0x24D7 }, + { 0xA73E, 0xA73F } +}; + +static const CaseFoldMapping1_16 case_fold1_16_154[] = { + { 0x0399, 0x03B9 }, + { 0x049E, 0x049F }, + { 0x1E84, 0x1E85 }, + { 0x24BE, 0x24D8 }, + { 0x2CB6, 0x2CB7 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_155[] = { + { 0x0398, 0x03B8 }, + { 0x24BF, 0x24D9 }, + { 0xA73C, 0xA73D } +}; + +static const CaseFoldMapping1_16 case_fold1_16_156[] = { + { 0x019D, 0x0272 }, + { 0x039F, 0x03BF }, + { 0x0498, 0x0499 }, + { 0x1E82, 0x1E83 }, + { 0x24B8, 0x24D2 }, + { 0x2CB0, 0x2CB1 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_157[] = { + { 0x019C, 0x026F }, + { 0x039E, 0x03BE }, + { 0x24B9, 0x24D3 }, + { 0xA73A, 0xA73B } +}; + +static const CaseFoldMapping1_16 case_fold1_16_158[] = { + { 0x019F, 0x0275 }, + { 0x039D, 0x03BD }, + { 0x049A, 0x049B }, + { 0x1E80, 0x1E81 }, + { 0x24BA, 0x24D4 }, + { 0x2CB2, 0x2CB3 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_159[] = { + { 0x039C, 0x03BC }, + { 0x24BB, 0x24D5 }, + { 0xA738, 0xA739 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_160[] = { + { 0x03A3, 0x03C3 }, + { 0x04A4, 0x04A5 }, + { 0x10B0, 0x2D10 }, + { 0x1EBE, 0x1EBF }, + { 0x2C8C, 0x2C8D } +}; + +static const CaseFoldMapping1_16 case_fold1_16_161[] = { + { 0x01A0, 0x01A1 }, + { 0x10B1, 0x2D11 }, + { 0x1FBE, 0x03B9 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_162[] = { + { 0x03A1, 0x03C1 }, + { 0x04A6, 0x04A7 }, + { 0x10B2, 0x2D12 }, + { 0x1EBC, 0x1EBD }, + { 0x2183, 0x2184 }, + { 0x2C8E, 0x2C8F } +}; + +static const CaseFoldMapping1_16 case_fold1_16_163[] = { + { 0x01A2, 0x01A3 }, + { 0x03A0, 0x03C0 }, + { 0x10B3, 0x2D13 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_164[] = { + { 0x03A7, 0x03C7 }, + { 0x04A0, 0x04A1 }, + { 0x10B4, 0x2D14 }, + { 0x1EBA, 0x1EBB }, + { 0x1FBB, 0x1F71 }, + { 0x2C88, 0x2C89 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_165[] = { + { 0x01A4, 0x01A5 }, + { 0x03A6, 0x03C6 }, + { 0x10B5, 0x2D15 }, + { 0x1FBA, 0x1F70 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_166[] = { + { 0x01A7, 0x01A8 }, + { 0x03A5, 0x03C5 }, + { 0x04A2, 0x04A3 }, + { 0x10B6, 0x2D16 }, + { 0x1EB8, 0x1EB9 }, + { 0x1FB9, 0x1FB1 }, + { 0x2C8A, 0x2C8B } +}; + +static const CaseFoldMapping1_16 case_fold1_16_167[] = { + { 0x01A6, 0x0280 }, + { 0x03A4, 0x03C4 }, + { 0x10B7, 0x2D17 }, + { 0x1FB8, 0x1FB0 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_168[] = { + { 0x01A9, 0x0283 }, + { 0x03AB, 0x03CB }, + { 0x04AC, 0x04AD }, + { 0x10B8, 0x2D18 }, + { 0x1EB6, 0x1EB7 }, + { 0x2C84, 0x2C85 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_169[] = { + { 0x03AA, 0x03CA }, + { 0x10B9, 0x2D19 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_170[] = { + { 0x03A9, 0x03C9 }, + { 0x04AE, 0x04AF }, + { 0x10BA, 0x2D1A }, + { 0x1EB4, 0x1EB5 }, + { 0x2C86, 0x2C87 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_171[] = { + { 0x03A8, 0x03C8 }, + { 0x10BB, 0x2D1B } +}; + +static const CaseFoldMapping1_16 case_fold1_16_172[] = { + { 0x04A8, 0x04A9 }, + { 0x10BC, 0x2D1C }, + { 0x1EB2, 0x1EB3 }, + { 0x2C80, 0x2C81 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_173[] = { + { 0x01AC, 0x01AD }, + { 0x10BD, 0x2D1D } +}; + +static const CaseFoldMapping1_16 case_fold1_16_174[] = { + { 0x01AF, 0x01B0 }, + { 0x04AA, 0x04AB }, + { 0x10BE, 0x2D1E }, + { 0x1EB0, 0x1EB1 }, + { 0x2C82, 0x2C83 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_175[] = { + { 0x01AE, 0x0288 }, + { 0x10BF, 0x2D1F } +}; + +static const CaseFoldMapping1_16 case_fold1_16_176[] = { + { 0x01B1, 0x028A }, + { 0x04B4, 0x04B5 }, + { 0x10A0, 0x2D00 }, + { 0x1EAE, 0x1EAF }, + { 0x2C9C, 0x2C9D } +}; + +static const CaseFoldMapping1_16 case_fold1_16_177[] = { + { 0x10A1, 0x2D01 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_178[] = { + { 0x01B3, 0x01B4 }, + { 0x04B6, 0x04B7 }, + { 0x10A2, 0x2D02 }, + { 0x1EAC, 0x1EAD }, + { 0x2C9E, 0x2C9F } +}; + +static const CaseFoldMapping1_16 case_fold1_16_179[] = { + { 0x01B2, 0x028B }, + { 0x10A3, 0x2D03 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_180[] = { + { 0x01B5, 0x01B6 }, + { 0x04B0, 0x04B1 }, + { 0x10A4, 0x2D04 }, + { 0x1EAA, 0x1EAB }, + { 0x2C98, 0x2C99 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_181[] = { + { 0x00B5, 0x03BC }, + { 0x10A5, 0x2D05 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_182[] = { + { 0x01B7, 0x0292 }, + { 0x04B2, 0x04B3 }, + { 0x10A6, 0x2D06 }, + { 0x1EA8, 0x1EA9 }, + { 0x2C9A, 0x2C9B } +}; + +static const CaseFoldMapping1_16 case_fold1_16_183[] = { + { 0x10A7, 0x2D07 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_184[] = { + { 0x04BC, 0x04BD }, + { 0x10A8, 0x2D08 }, + { 0x1EA6, 0x1EA7 }, + { 0x2C94, 0x2C95 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_185[] = { + { 0x01B8, 0x01B9 }, + { 0x10A9, 0x2D09 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_186[] = { + { 0x04BE, 0x04BF }, + { 0x10AA, 0x2D0A }, + { 0x1EA4, 0x1EA5 }, + { 0x2C96, 0x2C97 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_187[] = { + { 0x10AB, 0x2D0B } +}; + +static const CaseFoldMapping1_16 case_fold1_16_188[] = { + { 0x04B8, 0x04B9 }, + { 0x10AC, 0x2D0C }, + { 0x1EA2, 0x1EA3 }, + { 0x2C90, 0x2C91 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_189[] = { + { 0x01BC, 0x01BD }, + { 0x10AD, 0x2D0D } +}; + +static const CaseFoldMapping1_16 case_fold1_16_190[] = { + { 0x04BA, 0x04BB }, + { 0x10AE, 0x2D0E }, + { 0x1EA0, 0x1EA1 }, + { 0x2C92, 0x2C93 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_191[] = { + { 0x10AF, 0x2D0F } +}; + +static const CaseFoldMapping1_16 case_fold1_16_192[] = { + { 0x00C0, 0x00E0 }, + { 0x1EDE, 0x1EDF }, + { 0xA666, 0xA667 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_193[] = { + { 0x00C1, 0x00E1 }, + { 0x03C2, 0x03C3 }, + { 0x04C5, 0x04C6 }, + { 0x2CED, 0x2CEE }, + { 0xA766, 0xA767 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_194[] = { + { 0x00C2, 0x00E2 }, + { 0x1EDC, 0x1EDD }, + { 0xA664, 0xA665 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_195[] = { + { 0x00C3, 0x00E3 }, + { 0x04C7, 0x04C8 }, + { 0xA764, 0xA765 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_196[] = { + { 0x00C4, 0x00E4 }, + { 0x01C5, 0x01C6 }, + { 0x04C0, 0x04CF }, + { 0x1EDA, 0x1EDB }, + { 0x1FDB, 0x1F77 }, + { 0xA662, 0xA663 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_197[] = { + { 0x00C5, 0x00E5 }, + { 0x01C4, 0x01C6 }, + { 0x04C1, 0x04C2 }, + { 0x1FDA, 0x1F76 }, + { 0xA762, 0xA763 }, + { 0xFF3A, 0xFF5A } +}; + +static const CaseFoldMapping1_16 case_fold1_16_198[] = { + { 0x00C6, 0x00E6 }, + { 0x01C7, 0x01C9 }, + { 0x1ED8, 0x1ED9 }, + { 0x1FD9, 0x1FD1 }, + { 0xA660, 0xA661 }, + { 0xFF39, 0xFF59 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_199[] = { + { 0x00C7, 0x00E7 }, + { 0x04C3, 0x04C4 }, + { 0x1FD8, 0x1FD0 }, + { 0x2CEB, 0x2CEC }, + { 0xA760, 0xA761 }, + { 0xFF38, 0xFF58 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_200[] = { + { 0x00C8, 0x00E8 }, + { 0x1ED6, 0x1ED7 }, + { 0xFF37, 0xFF57 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_201[] = { + { 0x00C9, 0x00E9 }, + { 0x01C8, 0x01C9 }, + { 0x04CD, 0x04CE }, + { 0xA76E, 0xA76F }, + { 0xFF36, 0xFF56 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_202[] = { + { 0x00CA, 0x00EA }, + { 0x01CB, 0x01CC }, + { 0x1ED4, 0x1ED5 }, + { 0xA66C, 0xA66D }, + { 0xFF35, 0xFF55 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_203[] = { + { 0x00CB, 0x00EB }, + { 0x01CA, 0x01CC }, + { 0xA76C, 0xA76D }, + { 0xFF34, 0xFF54 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_204[] = { + { 0x00CC, 0x00EC }, + { 0x01CD, 0x01CE }, + { 0x03CF, 0x03D7 }, + { 0x1ED2, 0x1ED3 }, + { 0x2CE0, 0x2CE1 }, + { 0xA66A, 0xA66B }, + { 0xFF33, 0xFF53 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_205[] = { + { 0x00CD, 0x00ED }, + { 0x04C9, 0x04CA }, + { 0xA76A, 0xA76B }, + { 0xFF32, 0xFF52 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_206[] = { + { 0x00CE, 0x00EE }, + { 0x01CF, 0x01D0 }, + { 0x1ED0, 0x1ED1 }, + { 0x2CE2, 0x2CE3 }, + { 0xA668, 0xA669 }, + { 0xFF31, 0xFF51 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_207[] = { + { 0x00CF, 0x00EF }, + { 0x04CB, 0x04CC }, + { 0xA768, 0xA769 }, + { 0xFF30, 0xFF50 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_208[] = { + { 0x00D0, 0x00F0 }, + { 0x01D1, 0x01D2 }, + { 0x04D4, 0x04D5 }, + { 0x10C0, 0x2D20 }, + { 0x1ECE, 0x1ECF }, + { 0xAB7B, 0x13AB }, + { 0xFF2F, 0xFF4F } +}; + +static const CaseFoldMapping1_16 case_fold1_16_209[] = { + { 0x00D1, 0x00F1 }, + { 0x10C1, 0x2D21 }, + { 0xAB7A, 0x13AA }, + { 0xFF2E, 0xFF4E } +}; + +static const CaseFoldMapping1_16 case_fold1_16_210[] = { + { 0x00D2, 0x00F2 }, + { 0x01D3, 0x01D4 }, + { 0x03D1, 0x03B8 }, + { 0x04D6, 0x04D7 }, + { 0x10C2, 0x2D22 }, + { 0x1ECC, 0x1ECD }, + { 0xAB79, 0x13A9 }, + { 0xFF2D, 0xFF4D } +}; + +static const CaseFoldMapping1_16 case_fold1_16_211[] = { + { 0x00D3, 0x00F3 }, + { 0x03D0, 0x03B2 }, + { 0x10C3, 0x2D23 }, + { 0xAB78, 0x13A8 }, + { 0xFF2C, 0xFF4C } +}; + +static const CaseFoldMapping1_16 case_fold1_16_212[] = { + { 0x00D4, 0x00F4 }, + { 0x01D5, 0x01D6 }, + { 0x04D0, 0x04D1 }, + { 0x10C4, 0x2D24 }, + { 0x1ECA, 0x1ECB }, + { 0x1FCB, 0x1F75 }, + { 0xAB7F, 0x13AF }, + { 0xFF2B, 0xFF4B } +}; + +static const CaseFoldMapping1_16 case_fold1_16_213[] = { + { 0x00D5, 0x00F5 }, + { 0x03D6, 0x03C0 }, + { 0x10C5, 0x2D25 }, + { 0x1FCA, 0x1F74 }, + { 0xAB7E, 0x13AE }, + { 0xFF2A, 0xFF4A } +}; + +static const CaseFoldMapping1_16 case_fold1_16_214[] = { + { 0x00D6, 0x00F6 }, + { 0x01D7, 0x01D8 }, + { 0x03D5, 0x03C6 }, + { 0x04D2, 0x04D3 }, + { 0x1EC8, 0x1EC9 }, + { 0x1FC9, 0x1F73 }, + { 0xAB7D, 0x13AD }, + { 0xFF29, 0xFF49 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_215[] = { + { 0x10C7, 0x2D27 }, + { 0x1FC8, 0x1F72 }, + { 0xAB7C, 0x13AC }, + { 0xFF28, 0xFF48 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_216[] = { + { 0x00D8, 0x00F8 }, + { 0x01D9, 0x01DA }, + { 0x04DC, 0x04DD }, + { 0x1EC6, 0x1EC7 }, + { 0xAB73, 0x13A3 }, + { 0xFF27, 0xFF47 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_217[] = { + { 0x00D9, 0x00F9 }, + { 0x03DA, 0x03DB }, + { 0xA77E, 0xA77F }, + { 0xAB72, 0x13A2 }, + { 0xFF26, 0xFF46 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_218[] = { + { 0x00DA, 0x00FA }, + { 0x01DB, 0x01DC }, + { 0x04DE, 0x04DF }, + { 0x1EC4, 0x1EC5 }, + { 0xA77D, 0x1D79 }, + { 0xAB71, 0x13A1 }, + { 0xFF25, 0xFF45 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_219[] = { + { 0x00DB, 0x00FB }, + { 0x03D8, 0x03D9 }, + { 0xAB70, 0x13A0 }, + { 0xFF24, 0xFF44 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_220[] = { + { 0x00DC, 0x00FC }, + { 0x04D8, 0x04D9 }, + { 0x1EC2, 0x1EC3 }, + { 0xA77B, 0xA77C }, + { 0xAB77, 0x13A7 }, + { 0xFF23, 0xFF43 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_221[] = { + { 0x00DD, 0x00FD }, + { 0x03DE, 0x03DF }, + { 0x10CD, 0x2D2D }, + { 0xAB76, 0x13A6 }, + { 0xFF22, 0xFF42 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_222[] = { + { 0x00DE, 0x00FE }, + { 0x04DA, 0x04DB }, + { 0x1EC0, 0x1EC1 }, + { 0x2CF2, 0x2CF3 }, + { 0xA779, 0xA77A }, + { 0xAB75, 0x13A5 }, + { 0xFF21, 0xFF41 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_223[] = { + { 0x01DE, 0x01DF }, + { 0x03DC, 0x03DD }, + { 0xAB74, 0x13A4 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_224[] = { + { 0x04E4, 0x04E5 }, + { 0x1EFE, 0x1EFF }, + { 0x24C4, 0x24DE }, + { 0x2CCC, 0x2CCD }, + { 0xA646, 0xA647 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_225[] = { + { 0x01E0, 0x01E1 }, + { 0x03E2, 0x03E3 }, + { 0x24C5, 0x24DF }, + { 0xA746, 0xA747 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_226[] = { + { 0x04E6, 0x04E7 }, + { 0x1EFC, 0x1EFD }, + { 0x24C6, 0x24E0 }, + { 0x2CCE, 0x2CCF }, + { 0xA644, 0xA645 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_227[] = { + { 0x01E2, 0x01E3 }, + { 0x03E0, 0x03E1 }, + { 0x24C7, 0x24E1 }, + { 0xA744, 0xA745 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_228[] = { + { 0x04E0, 0x04E1 }, + { 0x1EFA, 0x1EFB }, + { 0x1FFB, 0x1F7D }, + { 0x24C0, 0x24DA }, + { 0x2CC8, 0x2CC9 }, + { 0xA642, 0xA643 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_229[] = { + { 0x01E4, 0x01E5 }, + { 0x03E6, 0x03E7 }, + { 0x1FFA, 0x1F7C }, + { 0x24C1, 0x24DB }, + { 0xA742, 0xA743 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_230[] = { + { 0x04E2, 0x04E3 }, + { 0x1EF8, 0x1EF9 }, + { 0x1FF9, 0x1F79 }, + { 0x24C2, 0x24DC }, + { 0x2CCA, 0x2CCB }, + { 0xA640, 0xA641 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_231[] = { + { 0x01E6, 0x01E7 }, + { 0x03E4, 0x03E5 }, + { 0x1FF8, 0x1F78 }, + { 0x24C3, 0x24DD }, + { 0xA740, 0xA741 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_232[] = { + { 0x04EC, 0x04ED }, + { 0x13FB, 0x13F3 }, + { 0x1EF6, 0x1EF7 }, + { 0x24CC, 0x24E6 }, + { 0x2CC4, 0x2CC5 }, + { 0xA64E, 0xA64F } +}; + +static const CaseFoldMapping1_16 case_fold1_16_233[] = { + { 0x01E8, 0x01E9 }, + { 0x03EA, 0x03EB }, + { 0x13FA, 0x13F2 }, + { 0x24CD, 0x24E7 }, + { 0xA74E, 0xA74F } +}; + +static const CaseFoldMapping1_16 case_fold1_16_234[] = { + { 0x04EE, 0x04EF }, + { 0x13F9, 0x13F1 }, + { 0x1EF4, 0x1EF5 }, + { 0x24CE, 0x24E8 }, + { 0x2CC6, 0x2CC7 }, + { 0xA64C, 0xA64D } +}; + +static const CaseFoldMapping1_16 case_fold1_16_235[] = { + { 0x01EA, 0x01EB }, + { 0x03E8, 0x03E9 }, + { 0x13F8, 0x13F0 }, + { 0x24CF, 0x24E9 }, + { 0xA74C, 0xA74D } +}; + +static const CaseFoldMapping1_16 case_fold1_16_236[] = { + { 0x04E8, 0x04E9 }, + { 0x1EF2, 0x1EF3 }, + { 0x24C8, 0x24E2 }, + { 0x2CC0, 0x2CC1 }, + { 0xA64A, 0xA64B } +}; + +static const CaseFoldMapping1_16 case_fold1_16_237[] = { + { 0x01EC, 0x01ED }, + { 0x03EE, 0x03EF }, + { 0x24C9, 0x24E3 }, + { 0xA74A, 0xA74B } +}; + +static const CaseFoldMapping1_16 case_fold1_16_238[] = { + { 0x04EA, 0x04EB }, + { 0x13FD, 0x13F5 }, + { 0x1EF0, 0x1EF1 }, + { 0x24CA, 0x24E4 }, + { 0x2CC2, 0x2CC3 }, + { 0xA648, 0xA649 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_239[] = { + { 0x01EE, 0x01EF }, + { 0x03EC, 0x03ED }, + { 0x13FC, 0x13F4 }, + { 0x24CB, 0x24E5 }, + { 0xA748, 0xA749 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_240[] = { + { 0x01F1, 0x01F3 }, + { 0x04F4, 0x04F5 }, + { 0x1EEE, 0x1EEF }, + { 0x2CDC, 0x2CDD }, + { 0xA656, 0xA657 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_241[] = { + { 0xA756, 0xA757 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_242[] = { + { 0x03F1, 0x03C1 }, + { 0x04F6, 0x04F7 }, + { 0x1EEC, 0x1EED }, + { 0x2CDE, 0x2CDF }, + { 0xA654, 0xA655 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_243[] = { + { 0x01F2, 0x01F3 }, + { 0x03F0, 0x03BA }, + { 0x1FEC, 0x1FE5 }, + { 0xA754, 0xA755 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_244[] = { + { 0x03F7, 0x03F8 }, + { 0x04F0, 0x04F1 }, + { 0x1EEA, 0x1EEB }, + { 0x1FEB, 0x1F7B }, + { 0x2CD8, 0x2CD9 }, + { 0xA652, 0xA653 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_245[] = { + { 0x01F4, 0x01F5 }, + { 0x1FEA, 0x1F7A }, + { 0xA752, 0xA753 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_246[] = { + { 0x01F7, 0x01BF }, + { 0x03F5, 0x03B5 }, + { 0x04F2, 0x04F3 }, + { 0x1EE8, 0x1EE9 }, + { 0x1FE9, 0x1FE1 }, + { 0x2CDA, 0x2CDB }, + { 0xA650, 0xA651 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_247[] = { + { 0x01F6, 0x0195 }, + { 0x03F4, 0x03B8 }, + { 0x1FE8, 0x1FE0 }, + { 0xA750, 0xA751 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_248[] = { + { 0x04FC, 0x04FD }, + { 0x1EE6, 0x1EE7 }, + { 0x2CD4, 0x2CD5 }, + { 0xA65E, 0xA65F } +}; + +static const CaseFoldMapping1_16 case_fold1_16_249[] = { + { 0x01F8, 0x01F9 }, + { 0x03FA, 0x03FB }, + { 0xA75E, 0xA75F } +}; + +static const CaseFoldMapping1_16 case_fold1_16_250[] = { + { 0x03F9, 0x03F2 }, + { 0x04FE, 0x04FF }, + { 0x1EE4, 0x1EE5 }, + { 0x2CD6, 0x2CD7 }, + { 0xA65C, 0xA65D } +}; + +static const CaseFoldMapping1_16 case_fold1_16_251[] = { + { 0x01FA, 0x01FB }, + { 0xA75C, 0xA75D } +}; + +static const CaseFoldMapping1_16 case_fold1_16_252[] = { + { 0x03FF, 0x037D }, + { 0x04F8, 0x04F9 }, + { 0x1EE2, 0x1EE3 }, + { 0x2CD0, 0x2CD1 }, + { 0xA65A, 0xA65B } +}; + +static const CaseFoldMapping1_16 case_fold1_16_253[] = { + { 0x01FC, 0x01FD }, + { 0x03FE, 0x037C }, + { 0xA75A, 0xA75B } +}; + +static const CaseFoldMapping1_16 case_fold1_16_254[] = { + { 0x03FD, 0x037B }, + { 0x04FA, 0x04FB }, + { 0x1EE0, 0x1EE1 }, + { 0x2CD2, 0x2CD3 }, + { 0xA658, 0xA659 } +}; + +static const CaseFoldMapping1_16 case_fold1_16_255[] = { + { 0x01FE, 0x01FF }, + { 0xA758, 0xA759 } +}; + +static const CaseFoldMapping1_32 case_fold1_32_000[] = { + { 0x10404, 0x1042C }, + { 0x10414, 0x1043C }, + { 0x10424, 0x1044C }, + { 0x10C8C, 0x10CCC }, + { 0x10C9C, 0x10CDC }, + { 0x10CAC, 0x10CEC }, + { 0x118A8, 0x118C8 }, + { 0x118B8, 0x118D8 } +}; + +static const CaseFoldMapping1_32 case_fold1_32_001[] = { + { 0x10405, 0x1042D }, + { 0x10415, 0x1043D }, + { 0x10425, 0x1044D }, + { 0x10C8D, 0x10CCD }, + { 0x10C9D, 0x10CDD }, + { 0x10CAD, 0x10CED }, + { 0x118A9, 0x118C9 }, + { 0x118B9, 0x118D9 } +}; + +static const CaseFoldMapping1_32 case_fold1_32_002[] = { + { 0x10406, 0x1042E }, + { 0x10416, 0x1043E }, + { 0x10426, 0x1044E }, + { 0x10C8E, 0x10CCE }, + { 0x10C9E, 0x10CDE }, + { 0x10CAE, 0x10CEE }, + { 0x118AA, 0x118CA }, + { 0x118BA, 0x118DA } +}; + +static const CaseFoldMapping1_32 case_fold1_32_003[] = { + { 0x10407, 0x1042F }, + { 0x10417, 0x1043F }, + { 0x10427, 0x1044F }, + { 0x10C8F, 0x10CCF }, + { 0x10C9F, 0x10CDF }, + { 0x10CAF, 0x10CEF }, + { 0x118AB, 0x118CB }, + { 0x118BB, 0x118DB } +}; + +static const CaseFoldMapping1_32 case_fold1_32_004[] = { + { 0x10400, 0x10428 }, + { 0x10410, 0x10438 }, + { 0x10420, 0x10448 }, + { 0x10C88, 0x10CC8 }, + { 0x10C98, 0x10CD8 }, + { 0x10CA8, 0x10CE8 }, + { 0x118AC, 0x118CC }, + { 0x118BC, 0x118DC } +}; + +static const CaseFoldMapping1_32 case_fold1_32_005[] = { + { 0x10401, 0x10429 }, + { 0x10411, 0x10439 }, + { 0x10421, 0x10449 }, + { 0x10C89, 0x10CC9 }, + { 0x10C99, 0x10CD9 }, + { 0x10CA9, 0x10CE9 }, + { 0x118AD, 0x118CD }, + { 0x118BD, 0x118DD } +}; + +static const CaseFoldMapping1_32 case_fold1_32_006[] = { + { 0x10402, 0x1042A }, + { 0x10412, 0x1043A }, + { 0x10422, 0x1044A }, + { 0x10C8A, 0x10CCA }, + { 0x10C9A, 0x10CDA }, + { 0x10CAA, 0x10CEA }, + { 0x118AE, 0x118CE }, + { 0x118BE, 0x118DE } +}; + +static const CaseFoldMapping1_32 case_fold1_32_007[] = { + { 0x10403, 0x1042B }, + { 0x10413, 0x1043B }, + { 0x10423, 0x1044B }, + { 0x10C8B, 0x10CCB }, + { 0x10C9B, 0x10CDB }, + { 0x10CAB, 0x10CEB }, + { 0x118AF, 0x118CF }, + { 0x118BF, 0x118DF } +}; + +static const CaseFoldMapping1_32 case_fold1_32_008[] = { + { 0x1040C, 0x10434 }, + { 0x1041C, 0x10444 }, + { 0x10C84, 0x10CC4 }, + { 0x10C94, 0x10CD4 }, + { 0x10CA4, 0x10CE4 }, + { 0x118A0, 0x118C0 }, + { 0x118B0, 0x118D0 } +}; + +static const CaseFoldMapping1_32 case_fold1_32_009[] = { + { 0x1040D, 0x10435 }, + { 0x1041D, 0x10445 }, + { 0x10C85, 0x10CC5 }, + { 0x10C95, 0x10CD5 }, + { 0x10CA5, 0x10CE5 }, + { 0x118A1, 0x118C1 }, + { 0x118B1, 0x118D1 } +}; + +static const CaseFoldMapping1_32 case_fold1_32_010[] = { + { 0x1040E, 0x10436 }, + { 0x1041E, 0x10446 }, + { 0x10C86, 0x10CC6 }, + { 0x10C96, 0x10CD6 }, + { 0x10CA6, 0x10CE6 }, + { 0x118A2, 0x118C2 }, + { 0x118B2, 0x118D2 } +}; + +static const CaseFoldMapping1_32 case_fold1_32_011[] = { + { 0x1040F, 0x10437 }, + { 0x1041F, 0x10447 }, + { 0x10C87, 0x10CC7 }, + { 0x10C97, 0x10CD7 }, + { 0x10CA7, 0x10CE7 }, + { 0x118A3, 0x118C3 }, + { 0x118B3, 0x118D3 } +}; + +static const CaseFoldMapping1_32 case_fold1_32_012[] = { + { 0x10408, 0x10430 }, + { 0x10418, 0x10440 }, + { 0x10C80, 0x10CC0 }, + { 0x10C90, 0x10CD0 }, + { 0x10CA0, 0x10CE0 }, + { 0x10CB0, 0x10CF0 }, + { 0x118A4, 0x118C4 }, + { 0x118B4, 0x118D4 } +}; + +static const CaseFoldMapping1_32 case_fold1_32_013[] = { + { 0x10409, 0x10431 }, + { 0x10419, 0x10441 }, + { 0x10C81, 0x10CC1 }, + { 0x10C91, 0x10CD1 }, + { 0x10CA1, 0x10CE1 }, + { 0x10CB1, 0x10CF1 }, + { 0x118A5, 0x118C5 }, + { 0x118B5, 0x118D5 } +}; + +static const CaseFoldMapping1_32 case_fold1_32_014[] = { + { 0x1040A, 0x10432 }, + { 0x1041A, 0x10442 }, + { 0x10C82, 0x10CC2 }, + { 0x10C92, 0x10CD2 }, + { 0x10CA2, 0x10CE2 }, + { 0x10CB2, 0x10CF2 }, + { 0x118A6, 0x118C6 }, + { 0x118B6, 0x118D6 } +}; + +static const CaseFoldMapping1_32 case_fold1_32_015[] = { + { 0x1040B, 0x10433 }, + { 0x1041B, 0x10443 }, + { 0x10C83, 0x10CC3 }, + { 0x10C93, 0x10CD3 }, + { 0x10CA3, 0x10CE3 }, + { 0x118A7, 0x118C7 }, + { 0x118B7, 0x118D7 } +}; + +static const CaseFoldMapping2_16 case_fold2_16_000[] = { + { 0x1E9E, 0x0073, 0x0073 }, + { 0x1F8F, 0x1F07, 0x03B9 }, + { 0x1F9F, 0x1F27, 0x03B9 }, + { 0x1FAF, 0x1F67, 0x03B9 } +}; + +static const CaseFoldMapping2_16 case_fold2_16_001[] = { + { 0x0130, 0x0069, 0x0307 }, + { 0x01F0, 0x006A, 0x030C }, + { 0x1F8E, 0x1F06, 0x03B9 }, + { 0x1F9E, 0x1F26, 0x03B9 }, + { 0x1FAE, 0x1F66, 0x03B9 } +}; + +static const CaseFoldMapping2_16 case_fold2_16_002[] = { + { 0x0587, 0x0565, 0x0582 }, + { 0x1F8D, 0x1F05, 0x03B9 }, + { 0x1F9D, 0x1F25, 0x03B9 }, + { 0x1FAD, 0x1F65, 0x03B9 } +}; + +static const CaseFoldMapping2_16 case_fold2_16_003[] = { + { 0x1F8C, 0x1F04, 0x03B9 }, + { 0x1F9C, 0x1F24, 0x03B9 }, + { 0x1FAC, 0x1F64, 0x03B9 }, + { 0x1FBC, 0x03B1, 0x03B9 }, + { 0x1FCC, 0x03B7, 0x03B9 }, + { 0x1FFC, 0x03C9, 0x03B9 } +}; + +static const CaseFoldMapping2_16 case_fold2_16_004[] = { + { 0x1E9A, 0x0061, 0x02BE }, + { 0x1F8B, 0x1F03, 0x03B9 }, + { 0x1F9B, 0x1F23, 0x03B9 }, + { 0x1FAB, 0x1F63, 0x03B9 } +}; + +static const CaseFoldMapping2_16 case_fold2_16_005[] = { + { 0x1F8A, 0x1F02, 0x03B9 }, + { 0x1F9A, 0x1F22, 0x03B9 }, + { 0x1FAA, 0x1F62, 0x03B9 } +}; + +static const CaseFoldMapping2_16 case_fold2_16_006[] = { + { 0x1E98, 0x0077, 0x030A }, + { 0x1F89, 0x1F01, 0x03B9 }, + { 0x1F99, 0x1F21, 0x03B9 }, + { 0x1FA9, 0x1F61, 0x03B9 } +}; + +static const CaseFoldMapping2_16 case_fold2_16_007[] = { + { 0x1E99, 0x0079, 0x030A }, + { 0x1F88, 0x1F00, 0x03B9 }, + { 0x1F98, 0x1F20, 0x03B9 }, + { 0x1FA8, 0x1F60, 0x03B9 } +}; + +static const CaseFoldMapping2_16 case_fold2_16_008[] = { + { 0x0149, 0x02BC, 0x006E }, + { 0x1E96, 0x0068, 0x0331 }, + { 0x1F87, 0x1F07, 0x03B9 }, + { 0x1F97, 0x1F27, 0x03B9 }, + { 0x1FA7, 0x1F67, 0x03B9 }, + { 0xFB13, 0x0574, 0x0576 } +}; + +static const CaseFoldMapping2_16 case_fold2_16_009[] = { + { 0x1E97, 0x0074, 0x0308 }, + { 0x1F86, 0x1F06, 0x03B9 }, + { 0x1F96, 0x1F26, 0x03B9 }, + { 0x1FA6, 0x1F66, 0x03B9 }, + { 0x1FB6, 0x03B1, 0x0342 }, + { 0x1FC6, 0x03B7, 0x0342 }, + { 0x1FD6, 0x03B9, 0x0342 }, + { 0x1FE6, 0x03C5, 0x0342 }, + { 0x1FF6, 0x03C9, 0x0342 }, + { 0xFB02, 0x0066, 0x006C } +}; + +static const CaseFoldMapping2_16 case_fold2_16_010[] = { + { 0x1F85, 0x1F05, 0x03B9 }, + { 0x1F95, 0x1F25, 0x03B9 }, + { 0x1FA5, 0x1F65, 0x03B9 }, + { 0xFB01, 0x0066, 0x0069 } +}; + +static const CaseFoldMapping2_16 case_fold2_16_011[] = { + { 0x1F84, 0x1F04, 0x03B9 }, + { 0x1F94, 0x1F24, 0x03B9 }, + { 0x1FA4, 0x1F64, 0x03B9 }, + { 0x1FB4, 0x03AC, 0x03B9 }, + { 0x1FC4, 0x03AE, 0x03B9 }, + { 0x1FE4, 0x03C1, 0x0313 }, + { 0x1FF4, 0x03CE, 0x03B9 }, + { 0xFB00, 0x0066, 0x0066 } +}; + +static const CaseFoldMapping2_16 case_fold2_16_012[] = { + { 0x1F83, 0x1F03, 0x03B9 }, + { 0x1F93, 0x1F23, 0x03B9 }, + { 0x1FA3, 0x1F63, 0x03B9 }, + { 0x1FB3, 0x03B1, 0x03B9 }, + { 0x1FC3, 0x03B7, 0x03B9 }, + { 0x1FF3, 0x03C9, 0x03B9 }, + { 0xFB17, 0x0574, 0x056D } +}; + +static const CaseFoldMapping2_16 case_fold2_16_013[] = { + { 0x1F82, 0x1F02, 0x03B9 }, + { 0x1F92, 0x1F22, 0x03B9 }, + { 0x1FA2, 0x1F62, 0x03B9 }, + { 0x1FB2, 0x1F70, 0x03B9 }, + { 0x1FC2, 0x1F74, 0x03B9 }, + { 0x1FF2, 0x1F7C, 0x03B9 }, + { 0xFB06, 0x0073, 0x0074 }, + { 0xFB16, 0x057E, 0x0576 } +}; + +static const CaseFoldMapping2_16 case_fold2_16_014[] = { + { 0x1F81, 0x1F01, 0x03B9 }, + { 0x1F91, 0x1F21, 0x03B9 }, + { 0x1FA1, 0x1F61, 0x03B9 }, + { 0xFB05, 0x0073, 0x0074 }, + { 0xFB15, 0x0574, 0x056B } +}; + +static const CaseFoldMapping2_16 case_fold2_16_015[] = { + { 0x00DF, 0x0073, 0x0073 }, + { 0x1F50, 0x03C5, 0x0313 }, + { 0x1F80, 0x1F00, 0x03B9 }, + { 0x1F90, 0x1F20, 0x03B9 }, + { 0x1FA0, 0x1F60, 0x03B9 }, + { 0xFB14, 0x0574, 0x0565 } +}; + +static const CaseFoldMapping3_16 case_fold3_16_000[] = { + { 0x1FB7, 0x03B1, 0x0342, 0x03B9 }, + { 0x1FC7, 0x03B7, 0x0342, 0x03B9 }, + { 0x1FD3, 0x03B9, 0x0308, 0x0301 }, + { 0x1FD7, 0x03B9, 0x0308, 0x0342 }, + { 0x1FE3, 0x03C5, 0x0308, 0x0301 }, + { 0x1FE7, 0x03C5, 0x0308, 0x0342 }, + { 0x1FF7, 0x03C9, 0x0342, 0x03B9 }, + { 0xFB03, 0x0066, 0x0066, 0x0069 } +}; + +static const CaseFoldMapping3_16 case_fold3_16_001[] = { + { 0x1F52, 0x03C5, 0x0313, 0x0300 }, + { 0x1F56, 0x03C5, 0x0313, 0x0342 }, + { 0x1FD2, 0x03B9, 0x0308, 0x0300 }, + { 0x1FE2, 0x03C5, 0x0308, 0x0300 } +}; + +static const CaseFoldMapping3_16 case_fold3_16_003[] = { + { 0x0390, 0x03B9, 0x0308, 0x0301 }, + { 0x03B0, 0x03C5, 0x0308, 0x0301 }, + { 0x1F54, 0x03C5, 0x0313, 0x0301 }, + { 0xFB04, 0x0066, 0x0066, 0x006C } +}; + +static const CaseFoldHashBucket1_16 case_fold_hash1_16[] = { + { case_fold1_16_000, __PHYSFS_ARRAYLEN(case_fold1_16_000) }, + { case_fold1_16_001, __PHYSFS_ARRAYLEN(case_fold1_16_001) }, + { case_fold1_16_002, __PHYSFS_ARRAYLEN(case_fold1_16_002) }, + { case_fold1_16_003, __PHYSFS_ARRAYLEN(case_fold1_16_003) }, + { case_fold1_16_004, __PHYSFS_ARRAYLEN(case_fold1_16_004) }, + { case_fold1_16_005, __PHYSFS_ARRAYLEN(case_fold1_16_005) }, + { case_fold1_16_006, __PHYSFS_ARRAYLEN(case_fold1_16_006) }, + { case_fold1_16_007, __PHYSFS_ARRAYLEN(case_fold1_16_007) }, + { case_fold1_16_008, __PHYSFS_ARRAYLEN(case_fold1_16_008) }, + { case_fold1_16_009, __PHYSFS_ARRAYLEN(case_fold1_16_009) }, + { case_fold1_16_010, __PHYSFS_ARRAYLEN(case_fold1_16_010) }, + { case_fold1_16_011, __PHYSFS_ARRAYLEN(case_fold1_16_011) }, + { case_fold1_16_012, __PHYSFS_ARRAYLEN(case_fold1_16_012) }, + { case_fold1_16_013, __PHYSFS_ARRAYLEN(case_fold1_16_013) }, + { case_fold1_16_014, __PHYSFS_ARRAYLEN(case_fold1_16_014) }, + { case_fold1_16_015, __PHYSFS_ARRAYLEN(case_fold1_16_015) }, + { case_fold1_16_016, __PHYSFS_ARRAYLEN(case_fold1_16_016) }, + { case_fold1_16_017, __PHYSFS_ARRAYLEN(case_fold1_16_017) }, + { case_fold1_16_018, __PHYSFS_ARRAYLEN(case_fold1_16_018) }, + { case_fold1_16_019, __PHYSFS_ARRAYLEN(case_fold1_16_019) }, + { case_fold1_16_020, __PHYSFS_ARRAYLEN(case_fold1_16_020) }, + { case_fold1_16_021, __PHYSFS_ARRAYLEN(case_fold1_16_021) }, + { case_fold1_16_022, __PHYSFS_ARRAYLEN(case_fold1_16_022) }, + { case_fold1_16_023, __PHYSFS_ARRAYLEN(case_fold1_16_023) }, + { case_fold1_16_024, __PHYSFS_ARRAYLEN(case_fold1_16_024) }, + { case_fold1_16_025, __PHYSFS_ARRAYLEN(case_fold1_16_025) }, + { case_fold1_16_026, __PHYSFS_ARRAYLEN(case_fold1_16_026) }, + { case_fold1_16_027, __PHYSFS_ARRAYLEN(case_fold1_16_027) }, + { case_fold1_16_028, __PHYSFS_ARRAYLEN(case_fold1_16_028) }, + { case_fold1_16_029, __PHYSFS_ARRAYLEN(case_fold1_16_029) }, + { case_fold1_16_030, __PHYSFS_ARRAYLEN(case_fold1_16_030) }, + { case_fold1_16_031, __PHYSFS_ARRAYLEN(case_fold1_16_031) }, + { case_fold1_16_032, __PHYSFS_ARRAYLEN(case_fold1_16_032) }, + { case_fold1_16_033, __PHYSFS_ARRAYLEN(case_fold1_16_033) }, + { case_fold1_16_034, __PHYSFS_ARRAYLEN(case_fold1_16_034) }, + { case_fold1_16_035, __PHYSFS_ARRAYLEN(case_fold1_16_035) }, + { case_fold1_16_036, __PHYSFS_ARRAYLEN(case_fold1_16_036) }, + { case_fold1_16_037, __PHYSFS_ARRAYLEN(case_fold1_16_037) }, + { case_fold1_16_038, __PHYSFS_ARRAYLEN(case_fold1_16_038) }, + { case_fold1_16_039, __PHYSFS_ARRAYLEN(case_fold1_16_039) }, + { case_fold1_16_040, __PHYSFS_ARRAYLEN(case_fold1_16_040) }, + { case_fold1_16_041, __PHYSFS_ARRAYLEN(case_fold1_16_041) }, + { case_fold1_16_042, __PHYSFS_ARRAYLEN(case_fold1_16_042) }, + { case_fold1_16_043, __PHYSFS_ARRAYLEN(case_fold1_16_043) }, + { case_fold1_16_044, __PHYSFS_ARRAYLEN(case_fold1_16_044) }, + { case_fold1_16_045, __PHYSFS_ARRAYLEN(case_fold1_16_045) }, + { case_fold1_16_046, __PHYSFS_ARRAYLEN(case_fold1_16_046) }, + { case_fold1_16_047, __PHYSFS_ARRAYLEN(case_fold1_16_047) }, + { case_fold1_16_048, __PHYSFS_ARRAYLEN(case_fold1_16_048) }, + { case_fold1_16_049, __PHYSFS_ARRAYLEN(case_fold1_16_049) }, + { case_fold1_16_050, __PHYSFS_ARRAYLEN(case_fold1_16_050) }, + { case_fold1_16_051, __PHYSFS_ARRAYLEN(case_fold1_16_051) }, + { case_fold1_16_052, __PHYSFS_ARRAYLEN(case_fold1_16_052) }, + { case_fold1_16_053, __PHYSFS_ARRAYLEN(case_fold1_16_053) }, + { case_fold1_16_054, __PHYSFS_ARRAYLEN(case_fold1_16_054) }, + { case_fold1_16_055, __PHYSFS_ARRAYLEN(case_fold1_16_055) }, + { case_fold1_16_056, __PHYSFS_ARRAYLEN(case_fold1_16_056) }, + { case_fold1_16_057, __PHYSFS_ARRAYLEN(case_fold1_16_057) }, + { case_fold1_16_058, __PHYSFS_ARRAYLEN(case_fold1_16_058) }, + { case_fold1_16_059, __PHYSFS_ARRAYLEN(case_fold1_16_059) }, + { case_fold1_16_060, __PHYSFS_ARRAYLEN(case_fold1_16_060) }, + { case_fold1_16_061, __PHYSFS_ARRAYLEN(case_fold1_16_061) }, + { case_fold1_16_062, __PHYSFS_ARRAYLEN(case_fold1_16_062) }, + { case_fold1_16_063, __PHYSFS_ARRAYLEN(case_fold1_16_063) }, + { case_fold1_16_064, __PHYSFS_ARRAYLEN(case_fold1_16_064) }, + { case_fold1_16_065, __PHYSFS_ARRAYLEN(case_fold1_16_065) }, + { case_fold1_16_066, __PHYSFS_ARRAYLEN(case_fold1_16_066) }, + { case_fold1_16_067, __PHYSFS_ARRAYLEN(case_fold1_16_067) }, + { case_fold1_16_068, __PHYSFS_ARRAYLEN(case_fold1_16_068) }, + { case_fold1_16_069, __PHYSFS_ARRAYLEN(case_fold1_16_069) }, + { case_fold1_16_070, __PHYSFS_ARRAYLEN(case_fold1_16_070) }, + { case_fold1_16_071, __PHYSFS_ARRAYLEN(case_fold1_16_071) }, + { case_fold1_16_072, __PHYSFS_ARRAYLEN(case_fold1_16_072) }, + { case_fold1_16_073, __PHYSFS_ARRAYLEN(case_fold1_16_073) }, + { case_fold1_16_074, __PHYSFS_ARRAYLEN(case_fold1_16_074) }, + { case_fold1_16_075, __PHYSFS_ARRAYLEN(case_fold1_16_075) }, + { case_fold1_16_076, __PHYSFS_ARRAYLEN(case_fold1_16_076) }, + { case_fold1_16_077, __PHYSFS_ARRAYLEN(case_fold1_16_077) }, + { case_fold1_16_078, __PHYSFS_ARRAYLEN(case_fold1_16_078) }, + { case_fold1_16_079, __PHYSFS_ARRAYLEN(case_fold1_16_079) }, + { case_fold1_16_080, __PHYSFS_ARRAYLEN(case_fold1_16_080) }, + { case_fold1_16_081, __PHYSFS_ARRAYLEN(case_fold1_16_081) }, + { case_fold1_16_082, __PHYSFS_ARRAYLEN(case_fold1_16_082) }, + { case_fold1_16_083, __PHYSFS_ARRAYLEN(case_fold1_16_083) }, + { case_fold1_16_084, __PHYSFS_ARRAYLEN(case_fold1_16_084) }, + { case_fold1_16_085, __PHYSFS_ARRAYLEN(case_fold1_16_085) }, + { case_fold1_16_086, __PHYSFS_ARRAYLEN(case_fold1_16_086) }, + { case_fold1_16_087, __PHYSFS_ARRAYLEN(case_fold1_16_087) }, + { case_fold1_16_088, __PHYSFS_ARRAYLEN(case_fold1_16_088) }, + { case_fold1_16_089, __PHYSFS_ARRAYLEN(case_fold1_16_089) }, + { case_fold1_16_090, __PHYSFS_ARRAYLEN(case_fold1_16_090) }, + { case_fold1_16_091, __PHYSFS_ARRAYLEN(case_fold1_16_091) }, + { case_fold1_16_092, __PHYSFS_ARRAYLEN(case_fold1_16_092) }, + { case_fold1_16_093, __PHYSFS_ARRAYLEN(case_fold1_16_093) }, + { case_fold1_16_094, __PHYSFS_ARRAYLEN(case_fold1_16_094) }, + { case_fold1_16_095, __PHYSFS_ARRAYLEN(case_fold1_16_095) }, + { case_fold1_16_096, __PHYSFS_ARRAYLEN(case_fold1_16_096) }, + { case_fold1_16_097, __PHYSFS_ARRAYLEN(case_fold1_16_097) }, + { case_fold1_16_098, __PHYSFS_ARRAYLEN(case_fold1_16_098) }, + { case_fold1_16_099, __PHYSFS_ARRAYLEN(case_fold1_16_099) }, + { case_fold1_16_100, __PHYSFS_ARRAYLEN(case_fold1_16_100) }, + { case_fold1_16_101, __PHYSFS_ARRAYLEN(case_fold1_16_101) }, + { case_fold1_16_102, __PHYSFS_ARRAYLEN(case_fold1_16_102) }, + { case_fold1_16_103, __PHYSFS_ARRAYLEN(case_fold1_16_103) }, + { case_fold1_16_104, __PHYSFS_ARRAYLEN(case_fold1_16_104) }, + { case_fold1_16_105, __PHYSFS_ARRAYLEN(case_fold1_16_105) }, + { case_fold1_16_106, __PHYSFS_ARRAYLEN(case_fold1_16_106) }, + { case_fold1_16_107, __PHYSFS_ARRAYLEN(case_fold1_16_107) }, + { case_fold1_16_108, __PHYSFS_ARRAYLEN(case_fold1_16_108) }, + { case_fold1_16_109, __PHYSFS_ARRAYLEN(case_fold1_16_109) }, + { case_fold1_16_110, __PHYSFS_ARRAYLEN(case_fold1_16_110) }, + { case_fold1_16_111, __PHYSFS_ARRAYLEN(case_fold1_16_111) }, + { case_fold1_16_112, __PHYSFS_ARRAYLEN(case_fold1_16_112) }, + { case_fold1_16_113, __PHYSFS_ARRAYLEN(case_fold1_16_113) }, + { case_fold1_16_114, __PHYSFS_ARRAYLEN(case_fold1_16_114) }, + { case_fold1_16_115, __PHYSFS_ARRAYLEN(case_fold1_16_115) }, + { case_fold1_16_116, __PHYSFS_ARRAYLEN(case_fold1_16_116) }, + { case_fold1_16_117, __PHYSFS_ARRAYLEN(case_fold1_16_117) }, + { case_fold1_16_118, __PHYSFS_ARRAYLEN(case_fold1_16_118) }, + { case_fold1_16_119, __PHYSFS_ARRAYLEN(case_fold1_16_119) }, + { case_fold1_16_120, __PHYSFS_ARRAYLEN(case_fold1_16_120) }, + { case_fold1_16_121, __PHYSFS_ARRAYLEN(case_fold1_16_121) }, + { case_fold1_16_122, __PHYSFS_ARRAYLEN(case_fold1_16_122) }, + { NULL, 0 }, + { case_fold1_16_124, __PHYSFS_ARRAYLEN(case_fold1_16_124) }, + { NULL, 0 }, + { case_fold1_16_126, __PHYSFS_ARRAYLEN(case_fold1_16_126) }, + { NULL, 0 }, + { case_fold1_16_128, __PHYSFS_ARRAYLEN(case_fold1_16_128) }, + { case_fold1_16_129, __PHYSFS_ARRAYLEN(case_fold1_16_129) }, + { case_fold1_16_130, __PHYSFS_ARRAYLEN(case_fold1_16_130) }, + { case_fold1_16_131, __PHYSFS_ARRAYLEN(case_fold1_16_131) }, + { case_fold1_16_132, __PHYSFS_ARRAYLEN(case_fold1_16_132) }, + { case_fold1_16_133, __PHYSFS_ARRAYLEN(case_fold1_16_133) }, + { case_fold1_16_134, __PHYSFS_ARRAYLEN(case_fold1_16_134) }, + { case_fold1_16_135, __PHYSFS_ARRAYLEN(case_fold1_16_135) }, + { case_fold1_16_136, __PHYSFS_ARRAYLEN(case_fold1_16_136) }, + { case_fold1_16_137, __PHYSFS_ARRAYLEN(case_fold1_16_137) }, + { case_fold1_16_138, __PHYSFS_ARRAYLEN(case_fold1_16_138) }, + { case_fold1_16_139, __PHYSFS_ARRAYLEN(case_fold1_16_139) }, + { case_fold1_16_140, __PHYSFS_ARRAYLEN(case_fold1_16_140) }, + { case_fold1_16_141, __PHYSFS_ARRAYLEN(case_fold1_16_141) }, + { case_fold1_16_142, __PHYSFS_ARRAYLEN(case_fold1_16_142) }, + { case_fold1_16_143, __PHYSFS_ARRAYLEN(case_fold1_16_143) }, + { case_fold1_16_144, __PHYSFS_ARRAYLEN(case_fold1_16_144) }, + { case_fold1_16_145, __PHYSFS_ARRAYLEN(case_fold1_16_145) }, + { case_fold1_16_146, __PHYSFS_ARRAYLEN(case_fold1_16_146) }, + { case_fold1_16_147, __PHYSFS_ARRAYLEN(case_fold1_16_147) }, + { case_fold1_16_148, __PHYSFS_ARRAYLEN(case_fold1_16_148) }, + { case_fold1_16_149, __PHYSFS_ARRAYLEN(case_fold1_16_149) }, + { case_fold1_16_150, __PHYSFS_ARRAYLEN(case_fold1_16_150) }, + { case_fold1_16_151, __PHYSFS_ARRAYLEN(case_fold1_16_151) }, + { case_fold1_16_152, __PHYSFS_ARRAYLEN(case_fold1_16_152) }, + { case_fold1_16_153, __PHYSFS_ARRAYLEN(case_fold1_16_153) }, + { case_fold1_16_154, __PHYSFS_ARRAYLEN(case_fold1_16_154) }, + { case_fold1_16_155, __PHYSFS_ARRAYLEN(case_fold1_16_155) }, + { case_fold1_16_156, __PHYSFS_ARRAYLEN(case_fold1_16_156) }, + { case_fold1_16_157, __PHYSFS_ARRAYLEN(case_fold1_16_157) }, + { case_fold1_16_158, __PHYSFS_ARRAYLEN(case_fold1_16_158) }, + { case_fold1_16_159, __PHYSFS_ARRAYLEN(case_fold1_16_159) }, + { case_fold1_16_160, __PHYSFS_ARRAYLEN(case_fold1_16_160) }, + { case_fold1_16_161, __PHYSFS_ARRAYLEN(case_fold1_16_161) }, + { case_fold1_16_162, __PHYSFS_ARRAYLEN(case_fold1_16_162) }, + { case_fold1_16_163, __PHYSFS_ARRAYLEN(case_fold1_16_163) }, + { case_fold1_16_164, __PHYSFS_ARRAYLEN(case_fold1_16_164) }, + { case_fold1_16_165, __PHYSFS_ARRAYLEN(case_fold1_16_165) }, + { case_fold1_16_166, __PHYSFS_ARRAYLEN(case_fold1_16_166) }, + { case_fold1_16_167, __PHYSFS_ARRAYLEN(case_fold1_16_167) }, + { case_fold1_16_168, __PHYSFS_ARRAYLEN(case_fold1_16_168) }, + { case_fold1_16_169, __PHYSFS_ARRAYLEN(case_fold1_16_169) }, + { case_fold1_16_170, __PHYSFS_ARRAYLEN(case_fold1_16_170) }, + { case_fold1_16_171, __PHYSFS_ARRAYLEN(case_fold1_16_171) }, + { case_fold1_16_172, __PHYSFS_ARRAYLEN(case_fold1_16_172) }, + { case_fold1_16_173, __PHYSFS_ARRAYLEN(case_fold1_16_173) }, + { case_fold1_16_174, __PHYSFS_ARRAYLEN(case_fold1_16_174) }, + { case_fold1_16_175, __PHYSFS_ARRAYLEN(case_fold1_16_175) }, + { case_fold1_16_176, __PHYSFS_ARRAYLEN(case_fold1_16_176) }, + { case_fold1_16_177, __PHYSFS_ARRAYLEN(case_fold1_16_177) }, + { case_fold1_16_178, __PHYSFS_ARRAYLEN(case_fold1_16_178) }, + { case_fold1_16_179, __PHYSFS_ARRAYLEN(case_fold1_16_179) }, + { case_fold1_16_180, __PHYSFS_ARRAYLEN(case_fold1_16_180) }, + { case_fold1_16_181, __PHYSFS_ARRAYLEN(case_fold1_16_181) }, + { case_fold1_16_182, __PHYSFS_ARRAYLEN(case_fold1_16_182) }, + { case_fold1_16_183, __PHYSFS_ARRAYLEN(case_fold1_16_183) }, + { case_fold1_16_184, __PHYSFS_ARRAYLEN(case_fold1_16_184) }, + { case_fold1_16_185, __PHYSFS_ARRAYLEN(case_fold1_16_185) }, + { case_fold1_16_186, __PHYSFS_ARRAYLEN(case_fold1_16_186) }, + { case_fold1_16_187, __PHYSFS_ARRAYLEN(case_fold1_16_187) }, + { case_fold1_16_188, __PHYSFS_ARRAYLEN(case_fold1_16_188) }, + { case_fold1_16_189, __PHYSFS_ARRAYLEN(case_fold1_16_189) }, + { case_fold1_16_190, __PHYSFS_ARRAYLEN(case_fold1_16_190) }, + { case_fold1_16_191, __PHYSFS_ARRAYLEN(case_fold1_16_191) }, + { case_fold1_16_192, __PHYSFS_ARRAYLEN(case_fold1_16_192) }, + { case_fold1_16_193, __PHYSFS_ARRAYLEN(case_fold1_16_193) }, + { case_fold1_16_194, __PHYSFS_ARRAYLEN(case_fold1_16_194) }, + { case_fold1_16_195, __PHYSFS_ARRAYLEN(case_fold1_16_195) }, + { case_fold1_16_196, __PHYSFS_ARRAYLEN(case_fold1_16_196) }, + { case_fold1_16_197, __PHYSFS_ARRAYLEN(case_fold1_16_197) }, + { case_fold1_16_198, __PHYSFS_ARRAYLEN(case_fold1_16_198) }, + { case_fold1_16_199, __PHYSFS_ARRAYLEN(case_fold1_16_199) }, + { case_fold1_16_200, __PHYSFS_ARRAYLEN(case_fold1_16_200) }, + { case_fold1_16_201, __PHYSFS_ARRAYLEN(case_fold1_16_201) }, + { case_fold1_16_202, __PHYSFS_ARRAYLEN(case_fold1_16_202) }, + { case_fold1_16_203, __PHYSFS_ARRAYLEN(case_fold1_16_203) }, + { case_fold1_16_204, __PHYSFS_ARRAYLEN(case_fold1_16_204) }, + { case_fold1_16_205, __PHYSFS_ARRAYLEN(case_fold1_16_205) }, + { case_fold1_16_206, __PHYSFS_ARRAYLEN(case_fold1_16_206) }, + { case_fold1_16_207, __PHYSFS_ARRAYLEN(case_fold1_16_207) }, + { case_fold1_16_208, __PHYSFS_ARRAYLEN(case_fold1_16_208) }, + { case_fold1_16_209, __PHYSFS_ARRAYLEN(case_fold1_16_209) }, + { case_fold1_16_210, __PHYSFS_ARRAYLEN(case_fold1_16_210) }, + { case_fold1_16_211, __PHYSFS_ARRAYLEN(case_fold1_16_211) }, + { case_fold1_16_212, __PHYSFS_ARRAYLEN(case_fold1_16_212) }, + { case_fold1_16_213, __PHYSFS_ARRAYLEN(case_fold1_16_213) }, + { case_fold1_16_214, __PHYSFS_ARRAYLEN(case_fold1_16_214) }, + { case_fold1_16_215, __PHYSFS_ARRAYLEN(case_fold1_16_215) }, + { case_fold1_16_216, __PHYSFS_ARRAYLEN(case_fold1_16_216) }, + { case_fold1_16_217, __PHYSFS_ARRAYLEN(case_fold1_16_217) }, + { case_fold1_16_218, __PHYSFS_ARRAYLEN(case_fold1_16_218) }, + { case_fold1_16_219, __PHYSFS_ARRAYLEN(case_fold1_16_219) }, + { case_fold1_16_220, __PHYSFS_ARRAYLEN(case_fold1_16_220) }, + { case_fold1_16_221, __PHYSFS_ARRAYLEN(case_fold1_16_221) }, + { case_fold1_16_222, __PHYSFS_ARRAYLEN(case_fold1_16_222) }, + { case_fold1_16_223, __PHYSFS_ARRAYLEN(case_fold1_16_223) }, + { case_fold1_16_224, __PHYSFS_ARRAYLEN(case_fold1_16_224) }, + { case_fold1_16_225, __PHYSFS_ARRAYLEN(case_fold1_16_225) }, + { case_fold1_16_226, __PHYSFS_ARRAYLEN(case_fold1_16_226) }, + { case_fold1_16_227, __PHYSFS_ARRAYLEN(case_fold1_16_227) }, + { case_fold1_16_228, __PHYSFS_ARRAYLEN(case_fold1_16_228) }, + { case_fold1_16_229, __PHYSFS_ARRAYLEN(case_fold1_16_229) }, + { case_fold1_16_230, __PHYSFS_ARRAYLEN(case_fold1_16_230) }, + { case_fold1_16_231, __PHYSFS_ARRAYLEN(case_fold1_16_231) }, + { case_fold1_16_232, __PHYSFS_ARRAYLEN(case_fold1_16_232) }, + { case_fold1_16_233, __PHYSFS_ARRAYLEN(case_fold1_16_233) }, + { case_fold1_16_234, __PHYSFS_ARRAYLEN(case_fold1_16_234) }, + { case_fold1_16_235, __PHYSFS_ARRAYLEN(case_fold1_16_235) }, + { case_fold1_16_236, __PHYSFS_ARRAYLEN(case_fold1_16_236) }, + { case_fold1_16_237, __PHYSFS_ARRAYLEN(case_fold1_16_237) }, + { case_fold1_16_238, __PHYSFS_ARRAYLEN(case_fold1_16_238) }, + { case_fold1_16_239, __PHYSFS_ARRAYLEN(case_fold1_16_239) }, + { case_fold1_16_240, __PHYSFS_ARRAYLEN(case_fold1_16_240) }, + { case_fold1_16_241, __PHYSFS_ARRAYLEN(case_fold1_16_241) }, + { case_fold1_16_242, __PHYSFS_ARRAYLEN(case_fold1_16_242) }, + { case_fold1_16_243, __PHYSFS_ARRAYLEN(case_fold1_16_243) }, + { case_fold1_16_244, __PHYSFS_ARRAYLEN(case_fold1_16_244) }, + { case_fold1_16_245, __PHYSFS_ARRAYLEN(case_fold1_16_245) }, + { case_fold1_16_246, __PHYSFS_ARRAYLEN(case_fold1_16_246) }, + { case_fold1_16_247, __PHYSFS_ARRAYLEN(case_fold1_16_247) }, + { case_fold1_16_248, __PHYSFS_ARRAYLEN(case_fold1_16_248) }, + { case_fold1_16_249, __PHYSFS_ARRAYLEN(case_fold1_16_249) }, + { case_fold1_16_250, __PHYSFS_ARRAYLEN(case_fold1_16_250) }, + { case_fold1_16_251, __PHYSFS_ARRAYLEN(case_fold1_16_251) }, + { case_fold1_16_252, __PHYSFS_ARRAYLEN(case_fold1_16_252) }, + { case_fold1_16_253, __PHYSFS_ARRAYLEN(case_fold1_16_253) }, + { case_fold1_16_254, __PHYSFS_ARRAYLEN(case_fold1_16_254) }, + { case_fold1_16_255, __PHYSFS_ARRAYLEN(case_fold1_16_255) }, +}; + +static const CaseFoldHashBucket1_32 case_fold_hash1_32[] = { + { case_fold1_32_000, __PHYSFS_ARRAYLEN(case_fold1_32_000) }, + { case_fold1_32_001, __PHYSFS_ARRAYLEN(case_fold1_32_001) }, + { case_fold1_32_002, __PHYSFS_ARRAYLEN(case_fold1_32_002) }, + { case_fold1_32_003, __PHYSFS_ARRAYLEN(case_fold1_32_003) }, + { case_fold1_32_004, __PHYSFS_ARRAYLEN(case_fold1_32_004) }, + { case_fold1_32_005, __PHYSFS_ARRAYLEN(case_fold1_32_005) }, + { case_fold1_32_006, __PHYSFS_ARRAYLEN(case_fold1_32_006) }, + { case_fold1_32_007, __PHYSFS_ARRAYLEN(case_fold1_32_007) }, + { case_fold1_32_008, __PHYSFS_ARRAYLEN(case_fold1_32_008) }, + { case_fold1_32_009, __PHYSFS_ARRAYLEN(case_fold1_32_009) }, + { case_fold1_32_010, __PHYSFS_ARRAYLEN(case_fold1_32_010) }, + { case_fold1_32_011, __PHYSFS_ARRAYLEN(case_fold1_32_011) }, + { case_fold1_32_012, __PHYSFS_ARRAYLEN(case_fold1_32_012) }, + { case_fold1_32_013, __PHYSFS_ARRAYLEN(case_fold1_32_013) }, + { case_fold1_32_014, __PHYSFS_ARRAYLEN(case_fold1_32_014) }, + { case_fold1_32_015, __PHYSFS_ARRAYLEN(case_fold1_32_015) }, +}; + +static const CaseFoldHashBucket2_16 case_fold_hash2_16[] = { + { case_fold2_16_000, __PHYSFS_ARRAYLEN(case_fold2_16_000) }, + { case_fold2_16_001, __PHYSFS_ARRAYLEN(case_fold2_16_001) }, + { case_fold2_16_002, __PHYSFS_ARRAYLEN(case_fold2_16_002) }, + { case_fold2_16_003, __PHYSFS_ARRAYLEN(case_fold2_16_003) }, + { case_fold2_16_004, __PHYSFS_ARRAYLEN(case_fold2_16_004) }, + { case_fold2_16_005, __PHYSFS_ARRAYLEN(case_fold2_16_005) }, + { case_fold2_16_006, __PHYSFS_ARRAYLEN(case_fold2_16_006) }, + { case_fold2_16_007, __PHYSFS_ARRAYLEN(case_fold2_16_007) }, + { case_fold2_16_008, __PHYSFS_ARRAYLEN(case_fold2_16_008) }, + { case_fold2_16_009, __PHYSFS_ARRAYLEN(case_fold2_16_009) }, + { case_fold2_16_010, __PHYSFS_ARRAYLEN(case_fold2_16_010) }, + { case_fold2_16_011, __PHYSFS_ARRAYLEN(case_fold2_16_011) }, + { case_fold2_16_012, __PHYSFS_ARRAYLEN(case_fold2_16_012) }, + { case_fold2_16_013, __PHYSFS_ARRAYLEN(case_fold2_16_013) }, + { case_fold2_16_014, __PHYSFS_ARRAYLEN(case_fold2_16_014) }, + { case_fold2_16_015, __PHYSFS_ARRAYLEN(case_fold2_16_015) }, +}; + +static const CaseFoldHashBucket3_16 case_fold_hash3_16[] = { + { case_fold3_16_000, __PHYSFS_ARRAYLEN(case_fold3_16_000) }, + { case_fold3_16_001, __PHYSFS_ARRAYLEN(case_fold3_16_001) }, + { NULL, 0 }, + { case_fold3_16_003, __PHYSFS_ARRAYLEN(case_fold3_16_003) }, +}; + + +#endif /* _INCLUDE_PHYSFS_CASEFOLDING_H_ */ + +/* end of physfs_casefolding.h ... */ + diff --git a/third_party/physfs/physfs_internal.h b/third_party/physfs/physfs_internal.h new file mode 100644 index 00000000..29126234 --- /dev/null +++ b/third_party/physfs/physfs_internal.h @@ -0,0 +1,729 @@ +/* + * Internal function/structure declaration. Do NOT include in your + * application. + * + * Please see the file LICENSE.txt in the source's root directory. + * + * This file written by Ryan C. Gordon. + */ + +#ifndef _INCLUDE_PHYSFS_INTERNAL_H_ +#define _INCLUDE_PHYSFS_INTERNAL_H_ + +#ifndef __PHYSICSFS_INTERNAL__ +#error Do not include this header from your applications. +#endif + +/* Turn off MSVC warnings that are aggressively anti-portability. */ +#if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_WARNINGS) +#define _CRT_SECURE_NO_WARNINGS 1 +#endif + +#include "physfs.h" + +/* The holy trinity. */ +#include +#include +#include + +#include "physfs_platforms.h" + +#include + +#define __PHYSFS_COMPILE_TIME_ASSERT(name, x) \ + typedef int __PHYSFS_compile_time_assert_##name[(x) * 2 - 1] + +/* !!! FIXME: remove this when revamping stack allocation code... */ +#if defined(_MSC_VER) || defined(__MINGW32__) || defined(__WATCOMC__) +#include +#endif + +#ifdef PHYSFS_PLATFORM_SOLARIS +#include +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef __GNUC__ +#define PHYSFS_MINIMUM_GCC_VERSION(major, minor) \ + ( ((__GNUC__ << 16) + __GNUC_MINOR__) >= (((major) << 16) + (minor)) ) +#else +#define PHYSFS_MINIMUM_GCC_VERSION(major, minor) (0) +#endif + +#ifdef __cplusplus + /* C++ always has a real inline keyword. */ +#elif (defined macintosh) && !(defined __MWERKS__) +# define inline +#elif (defined _MSC_VER) +# define inline __inline +#endif + +#if defined(PHYSFS_PLATFORM_LINUX) && !defined(_FILE_OFFSET_BITS) +#define _FILE_OFFSET_BITS 64 +#endif + +/* All public APIs need to be in physfs.h with a PHYSFS_DECL. + All file-private symbols need to be marked "static". + Everything shared between PhysicsFS sources needs to be in this + file between the visibility pragma blocks. */ +#if PHYSFS_MINIMUM_GCC_VERSION(4,0) || defined(__clang__) +#define PHYSFS_HAVE_PRAGMA_VISIBILITY 1 +#endif + +#if PHYSFS_HAVE_PRAGMA_VISIBILITY +#pragma GCC visibility push(hidden) +#endif + +/* These are the build-in archivers. We list them all as "extern" here without + #ifdefs to keep it tidy, but obviously you need to make sure these are + wrapped in PHYSFS_SUPPORTS_* checks before actually referencing them. */ +extern const PHYSFS_Archiver __PHYSFS_Archiver_DIR; +extern const PHYSFS_Archiver __PHYSFS_Archiver_ZIP; +extern const PHYSFS_Archiver __PHYSFS_Archiver_7Z; +extern const PHYSFS_Archiver __PHYSFS_Archiver_GRP; +extern const PHYSFS_Archiver __PHYSFS_Archiver_QPAK; +extern const PHYSFS_Archiver __PHYSFS_Archiver_HOG; +extern const PHYSFS_Archiver __PHYSFS_Archiver_MVL; +extern const PHYSFS_Archiver __PHYSFS_Archiver_WAD; +extern const PHYSFS_Archiver __PHYSFS_Archiver_SLB; +extern const PHYSFS_Archiver __PHYSFS_Archiver_ISO9660; +extern const PHYSFS_Archiver __PHYSFS_Archiver_VDF; + +/* a real C99-compliant snprintf() is in Visual Studio 2015, + but just use this everywhere for binary compatibility. */ +#if defined(_MSC_VER) +int __PHYSFS_msvc_vsnprintf(char *outBuf, size_t size, const char *format, va_list ap); +int __PHYSFS_msvc_snprintf(char *outBuf, size_t size, const char *format, ...); +#define vsnprintf __PHYSFS_msvc_vsnprintf +#define snprintf __PHYSFS_msvc_snprintf +#endif + +/* Some simple wrappers around WinRT C++ interfaces we can call from C. */ +#ifdef PHYSFS_PLATFORM_WINRT +const void *__PHYSFS_winrtCalcBaseDir(void); +const void *__PHYSFS_winrtCalcPrefDir(void); +#endif + +/* atomic operations. */ +#if defined(_MSC_VER) && (_MSC_VER >= 1500) +#include +__PHYSFS_COMPILE_TIME_ASSERT(LongEqualsInt, sizeof (int) == sizeof (long)); +#define __PHYSFS_ATOMIC_INCR(ptrval) _InterlockedIncrement((long*)(ptrval)) +#define __PHYSFS_ATOMIC_DECR(ptrval) _InterlockedDecrement((long*)(ptrval)) +#elif defined(__clang__) || (defined(__GNUC__) && (((__GNUC__ * 10000) + (__GNUC_MINOR__ * 100)) >= 40100)) +#define __PHYSFS_ATOMIC_INCR(ptrval) __sync_fetch_and_add(ptrval, 1) +#define __PHYSFS_ATOMIC_DECR(ptrval) __sync_fetch_and_add(ptrval, -1) +#else +#define PHYSFS_NEED_ATOMIC_OP_FALLBACK 1 +int __PHYSFS_ATOMIC_INCR(int *ptrval); +int __PHYSFS_ATOMIC_DECR(int *ptrval); +#endif + + +/* + * Interface for small allocations. If you need a little scratch space for + * a throwaway buffer or string, use this. It will make small allocations + * on the stack if possible, and use allocator.Malloc() if they are too + * large. This helps reduce malloc pressure. + * There are some rules, though: + * NEVER return a pointer from this, as stack-allocated buffers go away + * when your function returns. + * NEVER allocate in a loop, as stack-allocated pointers will pile up. Call + * a function that uses smallAlloc from your loop, so the allocation can + * free each time. + * NEVER call smallAlloc with any complex expression (it's a macro that WILL + * have side effects...it references the argument multiple times). Use a + * variable or a literal. + * NEVER free a pointer from this with anything but smallFree. It will not + * be a valid pointer to the allocator, regardless of where the memory came + * from. + * NEVER realloc a pointer from this. + * NEVER forget to use smallFree: it may not be a pointer from the stack. + * NEVER forget to check for NULL...allocation can fail here, of course! + */ +#define __PHYSFS_SMALLALLOCTHRESHOLD 256 +void *__PHYSFS_initSmallAlloc(void *ptr, const size_t len); + +#define __PHYSFS_smallAlloc(bytes) ( \ + __PHYSFS_initSmallAlloc( \ + (((bytes) < __PHYSFS_SMALLALLOCTHRESHOLD) ? \ + alloca((size_t)((bytes)+sizeof(void*))) : NULL), (bytes)) \ +) + +void __PHYSFS_smallFree(void *ptr); + + +/* Use the allocation hooks. */ +#define malloc(x) Do not use malloc() directly. +#define realloc(x, y) Do not use realloc() directly. +#define free(x) Do not use free() directly. +/* !!! FIXME: add alloca check here. */ + + +/* by default, enable things, so builds can opt out of a few things they + want to avoid. But you can build with this #defined to 0 if you would + like to turn off everything except a handful of things you opt into. */ +#ifndef PHYSFS_SUPPORTS_DEFAULT +#define PHYSFS_SUPPORTS_DEFAULT 1 +#endif + + +#ifndef PHYSFS_SUPPORTS_ZIP +#define PHYSFS_SUPPORTS_ZIP PHYSFS_SUPPORTS_DEFAULT +#endif +#ifndef PHYSFS_SUPPORTS_7Z +#define PHYSFS_SUPPORTS_7Z PHYSFS_SUPPORTS_DEFAULT +#endif +#ifndef PHYSFS_SUPPORTS_GRP +#define PHYSFS_SUPPORTS_GRP PHYSFS_SUPPORTS_DEFAULT +#endif +#ifndef PHYSFS_SUPPORTS_HOG +#define PHYSFS_SUPPORTS_HOG PHYSFS_SUPPORTS_DEFAULT +#endif +#ifndef PHYSFS_SUPPORTS_MVL +#define PHYSFS_SUPPORTS_MVL PHYSFS_SUPPORTS_DEFAULT +#endif +#ifndef PHYSFS_SUPPORTS_WAD +#define PHYSFS_SUPPORTS_WAD PHYSFS_SUPPORTS_DEFAULT +#endif +#ifndef PHYSFS_SUPPORTS_QPAK +#define PHYSFS_SUPPORTS_QPAK PHYSFS_SUPPORTS_DEFAULT +#endif +#ifndef PHYSFS_SUPPORTS_SLB +#define PHYSFS_SUPPORTS_SLB PHYSFS_SUPPORTS_DEFAULT +#endif +#ifndef PHYSFS_SUPPORTS_ISO9660 +#define PHYSFS_SUPPORTS_ISO9660 PHYSFS_SUPPORTS_DEFAULT +#endif +#ifndef PHYSFS_SUPPORTS_VDF +#define PHYSFS_SUPPORTS_VDF PHYSFS_SUPPORTS_DEFAULT +#endif + +#if PHYSFS_SUPPORTS_7Z +/* 7zip support needs a global init function called at startup (no deinit). */ +extern void SZIP_global_init(void); +#endif + +/* The latest supported PHYSFS_Io::version value. */ +#define CURRENT_PHYSFS_IO_API_VERSION 0 + +/* The latest supported PHYSFS_Archiver::version value. */ +#define CURRENT_PHYSFS_ARCHIVER_API_VERSION 0 + +/* This byteorder stuff was lifted from SDL. https://www.libsdl.org/ */ +#define PHYSFS_LIL_ENDIAN 1234 +#define PHYSFS_BIG_ENDIAN 4321 + +#ifdef __linux__ +#include +#define PHYSFS_BYTEORDER __BYTE_ORDER +#else /* __linux__ */ +#if defined(__hppa__) || \ + defined(__m68k__) || defined(mc68000) || defined(_M_M68K) || \ + (defined(__MIPS__) && defined(__MISPEB__)) || \ + defined(__ppc__) || defined(__POWERPC__) || defined(_M_PPC) || \ + defined(__sparc__) +#define PHYSFS_BYTEORDER PHYSFS_BIG_ENDIAN +#else +#define PHYSFS_BYTEORDER PHYSFS_LIL_ENDIAN +#endif +#endif /* __linux__ */ + + +/* + * When sorting the entries in an archive, we use a modified QuickSort. + * When there are less then PHYSFS_QUICKSORT_THRESHOLD entries left to sort, + * we switch over to a BubbleSort for the remainder. Tweak to taste. + * + * You can override this setting by defining PHYSFS_QUICKSORT_THRESHOLD + * before #including "physfs_internal.h". + */ +#ifndef PHYSFS_QUICKSORT_THRESHOLD +#define PHYSFS_QUICKSORT_THRESHOLD 4 +#endif + +/* + * Sort an array (or whatever) of (max) elements. This uses a mixture of + * a QuickSort and BubbleSort internally. + * (cmpfn) is used to determine ordering, and (swapfn) does the actual + * swapping of elements in the list. + */ +void __PHYSFS_sort(void *entries, size_t max, + int (*cmpfn)(void *, size_t, size_t), + void (*swapfn)(void *, size_t, size_t)); + +/* These get used all over for lessening code clutter. */ +/* "ERRPASS" means "something else just set the error state for us" and is + just to make it clear where the responsibility for the error state lays. */ +#define BAIL(e, r) do { if (e) PHYSFS_setErrorCode(e); return r; } while (0) +#define BAIL_ERRPASS(r) do { return r; } while (0) +#define BAIL_IF(c, e, r) do { if (c) { if (e) PHYSFS_setErrorCode(e); return r; } } while (0) +#define BAIL_IF_ERRPASS(c, r) do { if (c) { return r; } } while (0) +#define BAIL_MUTEX(e, m, r) do { if (e) PHYSFS_setErrorCode(e); __PHYSFS_platformReleaseMutex(m); return r; } while (0) +#define BAIL_MUTEX_ERRPASS(m, r) do { __PHYSFS_platformReleaseMutex(m); return r; } while (0) +#define BAIL_IF_MUTEX(c, e, m, r) do { if (c) { if (e) PHYSFS_setErrorCode(e); __PHYSFS_platformReleaseMutex(m); return r; } } while (0) +#define BAIL_IF_MUTEX_ERRPASS(c, m, r) do { if (c) { __PHYSFS_platformReleaseMutex(m); return r; } } while (0) +#define GOTO(e, g) do { if (e) PHYSFS_setErrorCode(e); goto g; } while (0) +#define GOTO_ERRPASS(g) do { goto g; } while (0) +#define GOTO_IF(c, e, g) do { if (c) { if (e) PHYSFS_setErrorCode(e); goto g; } } while (0) +#define GOTO_IF_ERRPASS(c, g) do { if (c) { goto g; } } while (0) +#define GOTO_MUTEX(e, m, g) do { if (e) PHYSFS_setErrorCode(e); __PHYSFS_platformReleaseMutex(m); goto g; } while (0) +#define GOTO_MUTEX_ERRPASS(m, g) do { __PHYSFS_platformReleaseMutex(m); goto g; } while (0) +#define GOTO_IF_MUTEX(c, e, m, g) do { if (c) { if (e) PHYSFS_setErrorCode(e); __PHYSFS_platformReleaseMutex(m); goto g; } } while (0) +#define GOTO_IF_MUTEX_ERRPASS(c, m, g) do { if (c) { __PHYSFS_platformReleaseMutex(m); goto g; } } while (0) + +#define __PHYSFS_ARRAYLEN(x) ( (sizeof (x)) / (sizeof (x[0])) ) + +#ifdef PHYSFS_NO_64BIT_SUPPORT +#define __PHYSFS_SI64(x) ((PHYSFS_sint64) (x)) +#define __PHYSFS_UI64(x) ((PHYSFS_uint64) (x)) +#elif (defined __GNUC__) +#define __PHYSFS_SI64(x) x##LL +#define __PHYSFS_UI64(x) x##ULL +#elif (defined _MSC_VER) +#define __PHYSFS_SI64(x) x##i64 +#define __PHYSFS_UI64(x) x##ui64 +#else +#define __PHYSFS_SI64(x) ((PHYSFS_sint64) (x)) +#define __PHYSFS_UI64(x) ((PHYSFS_uint64) (x)) +#endif + + +/* + * Check if a ui64 will fit in the platform's address space. + * The initial sizeof check will optimize this macro out entirely on + * 64-bit (and larger?!) platforms, and the other condition will + * return zero or non-zero if the variable will fit in the platform's + * size_t, suitable to pass to malloc. This is kinda messy, but effective. + */ +#define __PHYSFS_ui64FitsAddressSpace(s) ( \ + (sizeof (PHYSFS_uint64) <= sizeof (size_t)) || \ + ((s) < (__PHYSFS_UI64(0xFFFFFFFFFFFFFFFF) >> (64-(sizeof(size_t)*8)))) \ +) + +/* + * Like strdup(), but uses the current PhysicsFS allocator. + */ +char *__PHYSFS_strdup(const char *str); + +/* + * Give a hash value for a C string (uses djb's xor hashing algorithm). + */ +PHYSFS_uint32 __PHYSFS_hashString(const char *str, size_t len); + + +/* + * The current allocator. Not valid before PHYSFS_init is called! + */ +extern PHYSFS_Allocator __PHYSFS_AllocatorHooks; + +/* convenience macro to make this less cumbersome internally... */ +#define allocator __PHYSFS_AllocatorHooks + +/* + * Create a PHYSFS_Io for a file in the physical filesystem. + * This path is in platform-dependent notation. (mode) must be 'r', 'w', or + * 'a' for Read, Write, or Append. + */ +PHYSFS_Io *__PHYSFS_createNativeIo(const char *path, const int mode); + +/* + * Create a PHYSFS_Io for a buffer of memory (READ-ONLY). If you already + * have one of these, just use its duplicate() method, and it'll increment + * its refcount without allocating a copy of the buffer. + */ +PHYSFS_Io *__PHYSFS_createMemoryIo(const void *buf, PHYSFS_uint64 len, + void (*destruct)(void *)); + + +/* + * Read (len) bytes from (io) into (buf). Returns non-zero on success, + * zero on i/o error. Literally: "return (io->read(io, buf, len) == len);" + */ +int __PHYSFS_readAll(PHYSFS_Io *io, void *buf, const size_t len); + + +/* These are shared between some archivers. */ + +void UNPK_abandonArchive(void *opaque); +void UNPK_closeArchive(void *opaque); +void *UNPK_openArchive(PHYSFS_Io *io); +void *UNPK_addEntry(void *opaque, char *name, const int isdir, + const PHYSFS_sint64 ctime, const PHYSFS_sint64 mtime, + const PHYSFS_uint64 pos, const PHYSFS_uint64 len); +PHYSFS_Io *UNPK_openRead(void *opaque, const char *name); +PHYSFS_Io *UNPK_openWrite(void *opaque, const char *name); +PHYSFS_Io *UNPK_openAppend(void *opaque, const char *name); +int UNPK_remove(void *opaque, const char *name); +int UNPK_mkdir(void *opaque, const char *name); +int UNPK_stat(void *opaque, const char *fn, PHYSFS_Stat *st); +#define UNPK_enumerate __PHYSFS_DirTreeEnumerate + + + +/* Optional API many archivers use this to manage their directory tree. */ +/* !!! FIXME: document this better. */ + +typedef struct __PHYSFS_DirTreeEntry +{ + char *name; /* Full path in archive. */ + struct __PHYSFS_DirTreeEntry *hashnext; /* next item in hash bucket. */ + struct __PHYSFS_DirTreeEntry *children; /* linked list of kids, if dir. */ + struct __PHYSFS_DirTreeEntry *sibling; /* next item in same dir. */ + int isdir; +} __PHYSFS_DirTreeEntry; + +typedef struct __PHYSFS_DirTree +{ + __PHYSFS_DirTreeEntry *root; /* root of directory tree. */ + __PHYSFS_DirTreeEntry **hash; /* all entries hashed for fast lookup. */ + size_t hashBuckets; /* number of buckets in hash. */ + size_t entrylen; /* size in bytes of entries (including subclass). */ +} __PHYSFS_DirTree; + + +int __PHYSFS_DirTreeInit(__PHYSFS_DirTree *dt, const size_t entrylen); +void *__PHYSFS_DirTreeAdd(__PHYSFS_DirTree *dt, char *name, const int isdir); +void *__PHYSFS_DirTreeFind(__PHYSFS_DirTree *dt, const char *path); +PHYSFS_EnumerateCallbackResult __PHYSFS_DirTreeEnumerate(void *opaque, + const char *dname, PHYSFS_EnumerateCallback cb, + const char *origdir, void *callbackdata); +void __PHYSFS_DirTreeDeinit(__PHYSFS_DirTree *dt); + + + +/*--------------------------------------------------------------------------*/ +/*--------------------------------------------------------------------------*/ +/*------------ ----------------*/ +/*------------ You MUST implement the following functions ----------------*/ +/*------------ if porting to a new platform. ----------------*/ +/*------------ (see platform/unix.c for an example) ----------------*/ +/*------------ ----------------*/ +/*--------------------------------------------------------------------------*/ +/*--------------------------------------------------------------------------*/ + + +/* + * The dir separator; '/' on unix, '\\' on win32, ":" on MacOS, etc... + * Obviously, this isn't a function. If you need more than one char for this, + * you'll need to pull some old pieces of PhysicsFS out of revision control. + */ +#if defined(PHYSFS_PLATFORM_WINDOWS) || defined(PHYSFS_PLATFORM_OS2) +#define __PHYSFS_platformDirSeparator '\\' +#else +#define __PHYSFS_STANDARD_DIRSEP 1 +#define __PHYSFS_platformDirSeparator '/' +#endif + +/* + * Initialize the platform. This is called when PHYSFS_init() is called from + * the application. + * + * Return zero if there was a catastrophic failure (which prevents you from + * functioning at all), and non-zero otherwise. + */ +int __PHYSFS_platformInit(void); + + +/* + * Deinitialize the platform. This is called when PHYSFS_deinit() is called + * from the application. You can use this to clean up anything you've + * allocated in your platform driver. + */ +void __PHYSFS_platformDeinit(void); + + +/* + * Open a file for reading. (filename) is in platform-dependent notation. The + * file pointer should be positioned on the first byte of the file. + * + * The return value will be some platform-specific datatype that is opaque to + * the caller; it could be a (FILE *) under Unix, or a (HANDLE *) under win32. + * + * The same file can be opened for read multiple times, and each should have + * a unique file handle; this is frequently employed to prevent race + * conditions in the archivers. + * + * Call PHYSFS_setErrorCode() and return (NULL) if the file can't be opened. + */ +void *__PHYSFS_platformOpenRead(const char *filename); + + +/* + * Open a file for writing. (filename) is in platform-dependent notation. If + * the file exists, it should be truncated to zero bytes, and if it doesn't + * exist, it should be created as a zero-byte file. The file pointer should + * be positioned on the first byte of the file. + * + * The return value will be some platform-specific datatype that is opaque to + * the caller; it could be a (FILE *) under Unix, or a (HANDLE *) under win32, + * etc. + * + * Opening a file for write multiple times has undefined results. + * + * Call PHYSFS_setErrorCode() and return (NULL) if the file can't be opened. + */ +void *__PHYSFS_platformOpenWrite(const char *filename); + + +/* + * Open a file for appending. (filename) is in platform-dependent notation. If + * the file exists, the file pointer should be place just past the end of the + * file, so that the first write will be one byte after the current end of + * the file. If the file doesn't exist, it should be created as a zero-byte + * file. The file pointer should be positioned on the first byte of the file. + * + * The return value will be some platform-specific datatype that is opaque to + * the caller; it could be a (FILE *) under Unix, or a (HANDLE *) under win32, + * etc. + * + * Opening a file for append multiple times has undefined results. + * + * Call PHYSFS_setErrorCode() and return (NULL) if the file can't be opened. + */ +void *__PHYSFS_platformOpenAppend(const char *filename); + +/* + * Read more data from a platform-specific file handle. (opaque) should be + * cast to whatever data type your platform uses. Read a maximum of (len) + * 8-bit bytes to the area pointed to by (buf). If there isn't enough data + * available, return the number of bytes read, and position the file pointer + * immediately after those bytes. + * On success, return (len) and position the file pointer immediately past + * the end of the last read byte. Return (-1) if there is a catastrophic + * error, and call PHYSFS_setErrorCode() to describe the problem; the file + * pointer should not move in such a case. A partial read is success; only + * return (-1) on total failure; presumably, the next read call after a + * partial read will fail as such. + */ +PHYSFS_sint64 __PHYSFS_platformRead(void *opaque, void *buf, PHYSFS_uint64 len); + +/* + * Write more data to a platform-specific file handle. (opaque) should be + * cast to whatever data type your platform uses. Write a maximum of (len) + * 8-bit bytes from the area pointed to by (buffer). If there is a problem, + * return the number of bytes written, and position the file pointer + * immediately after those bytes. Return (-1) if there is a catastrophic + * error, and call PHYSFS_setErrorCode() to describe the problem; the file + * pointer should not move in such a case. A partial write is success; only + * return (-1) on total failure; presumably, the next write call after a + * partial write will fail as such. + */ +PHYSFS_sint64 __PHYSFS_platformWrite(void *opaque, const void *buffer, + PHYSFS_uint64 len); + +/* + * Set the file pointer to a new position. (opaque) should be cast to + * whatever data type your platform uses. (pos) specifies the number + * of 8-bit bytes to seek to from the start of the file. Seeking past the + * end of the file is an error condition, and you should check for it. + * + * Not all file types can seek; this is to be expected by the caller. + * + * On error, call PHYSFS_setErrorCode() and return zero. On success, return + * a non-zero value. + */ +int __PHYSFS_platformSeek(void *opaque, PHYSFS_uint64 pos); + + +/* + * Get the file pointer's position, in an 8-bit byte offset from the start of + * the file. (opaque) should be cast to whatever data type your platform + * uses. + * + * Not all file types can "tell"; this is to be expected by the caller. + * + * On error, call PHYSFS_setErrorCode() and return -1. On success, return >= 0. + */ +PHYSFS_sint64 __PHYSFS_platformTell(void *opaque); + + +/* + * Determine the current size of a file, in 8-bit bytes, from an open file. + * + * The caller expects that this information may not be available for all + * file types on all platforms. + * + * Return -1 if you can't do it, and call PHYSFS_setErrorCode(). Otherwise, + * return the file length in 8-bit bytes. + */ +PHYSFS_sint64 __PHYSFS_platformFileLength(void *handle); + + +/* + * Read filesystem metadata for a specific path. + * + * This needs to fill in all the fields of (stat). For fields that might not + * mean anything on a platform (access time, perhaps), choose a reasonable + * default. if (follow), we want to follow symlinks and stat what they + * link to and not the link itself. + * + * Return zero on failure, non-zero on success. + */ +int __PHYSFS_platformStat(const char *fn, PHYSFS_Stat *stat, const int follow); + +/* + * Flush any pending writes to disk. (opaque) should be cast to whatever data + * type your platform uses. Be sure to check for errors; the caller expects + * that this function can fail if there was a flushing error, etc. + * + * Return zero on failure, non-zero on success. + */ +int __PHYSFS_platformFlush(void *opaque); + +/* + * Close file and deallocate resources. (opaque) should be cast to whatever + * data type your platform uses. This should close the file in any scenario: + * flushing is a separate function call, and this function should never fail. + * + * You should clean up all resources associated with (opaque); the pointer + * will be considered invalid after this call. + */ +void __PHYSFS_platformClose(void *opaque); + +/* + * Platform implementation of PHYSFS_getCdRomDirsCallback()... + * CD directories are discovered and reported to the callback one at a time. + * Pointers passed to the callback are assumed to be invalid to the + * application after the callback returns, so you can free them or whatever. + * Callback does not assume results will be sorted in any meaningful way. + */ +void __PHYSFS_platformDetectAvailableCDs(PHYSFS_StringCallback cb, void *data); + +/* + * Calculate the base dir, if your platform needs special consideration. + * Just return NULL if the standard routines will suffice. (see + * calculateBaseDir() in physfs.c ...) + * Your string must end with a dir separator if you don't return NULL. + * Caller will allocator.Free() the retval if it's not NULL. + */ +char *__PHYSFS_platformCalcBaseDir(const char *argv0); + +/* + * Get the platform-specific user dir. + * As of PhysicsFS 2.1, returning NULL means fatal error. + * Your string must end with a dir separator if you don't return NULL. + * Caller will allocator.Free() the retval if it's not NULL. + */ +char *__PHYSFS_platformCalcUserDir(void); + + +/* This is the cached version from PHYSFS_init(). This is a fast call. */ +const char *__PHYSFS_getUserDir(void); /* not deprecated internal version. */ + + +/* + * Get the platform-specific pref dir. + * Returning NULL means fatal error. + * Your string must end with a dir separator if you don't return NULL. + * Caller will allocator.Free() the retval if it's not NULL. + * Caller will make missing directories if necessary; this just reports + * the final path. + */ +char *__PHYSFS_platformCalcPrefDir(const char *org, const char *app); + + +/* + * Return a pointer that uniquely identifies the current thread. + * On a platform without threading, (0x1) will suffice. These numbers are + * arbitrary; the only requirement is that no two threads have the same + * pointer. + */ +void *__PHYSFS_platformGetThreadID(void); + + +/* + * Enumerate a directory of files. This follows the rules for the + * PHYSFS_Archiver::enumerate() method, except that the (dirName) that is + * passed to this function is converted to platform-DEPENDENT notation by + * the caller. The PHYSFS_Archiver version uses platform-independent + * notation. Note that ".", "..", and other meta-entries should always + * be ignored. + */ +PHYSFS_EnumerateCallbackResult __PHYSFS_platformEnumerate(const char *dirname, + PHYSFS_EnumerateCallback callback, + const char *origdir, void *callbackdata); + +/* + * Make a directory in the actual filesystem. (path) is specified in + * platform-dependent notation. On error, return zero and set the error + * message. Return non-zero on success. + */ +int __PHYSFS_platformMkDir(const char *path); + + +/* + * Remove a file or directory entry in the actual filesystem. (path) is + * specified in platform-dependent notation. Note that this deletes files + * _and_ directories, so you might need to do some determination. + * Non-empty directories should report an error and not delete themselves + * or their contents. + * + * Deleting a symlink should remove the link, not what it points to. + * + * On error, return zero and set the error message. Return non-zero on success. + */ +int __PHYSFS_platformDelete(const char *path); + + +/* + * Create a platform-specific mutex. This can be whatever datatype your + * platform uses for mutexes, but it is cast to a (void *) for abstractness. + * + * Return (NULL) if you couldn't create one. Systems without threads can + * return any arbitrary non-NULL value. + */ +void *__PHYSFS_platformCreateMutex(void); + +/* + * Destroy a platform-specific mutex, and clean up any resources associated + * with it. (mutex) is a value previously returned by + * __PHYSFS_platformCreateMutex(). This can be a no-op on single-threaded + * platforms. + */ +void __PHYSFS_platformDestroyMutex(void *mutex); + +/* + * Grab possession of a platform-specific mutex. Mutexes should be recursive; + * that is, the same thread should be able to call this function multiple + * times in a row without causing a deadlock. This function should block + * until a thread can gain possession of the mutex. + * + * Return non-zero if the mutex was grabbed, zero if there was an + * unrecoverable problem grabbing it (this should not be a matter of + * timing out! We're talking major system errors; block until the mutex + * is available otherwise.) + * + * _DO NOT_ call PHYSFS_setErrorCode() in here! Since setErrorCode calls this + * function, you'll cause an infinite recursion. This means you can't + * use the BAIL_*MACRO* macros, either. + */ +int __PHYSFS_platformGrabMutex(void *mutex); + +/* + * Relinquish possession of the mutex when this method has been called + * once for each time that platformGrabMutex was called. Once possession has + * been released, the next thread in line to grab the mutex (if any) may + * proceed. + * + * _DO NOT_ call PHYSFS_setErrorCode() in here! Since setErrorCode calls this + * function, you'll cause an infinite recursion. This means you can't + * use the BAIL_*MACRO* macros, either. + */ +void __PHYSFS_platformReleaseMutex(void *mutex); + +#if PHYSFS_HAVE_PRAGMA_VISIBILITY +#pragma GCC visibility pop +#endif + +#ifdef __cplusplus +} +#endif + +#endif + +/* end of physfs_internal.h ... */ + diff --git a/third_party/physfs/physfs_miniz.h b/third_party/physfs/physfs_miniz.h new file mode 100644 index 00000000..30d6f4cc --- /dev/null +++ b/third_party/physfs/physfs_miniz.h @@ -0,0 +1,701 @@ +/* tinfl.c v1.11 - public domain inflate with zlib header parsing/adler32 checking (inflate-only subset of miniz.c) + See "unlicense" statement at the end of this file. + Rich Geldreich , last updated May 20, 2011 + Implements RFC 1950: https://www.ietf.org/rfc/rfc1950.txt and RFC 1951: https://www.ietf.org/rfc/rfc1951.txt + + The entire decompressor coroutine is implemented in tinfl_decompress(). The other functions are optional high-level helpers. +*/ +#ifndef TINFL_HEADER_INCLUDED +#define TINFL_HEADER_INCLUDED + +typedef PHYSFS_uint8 mz_uint8; +typedef PHYSFS_sint16 mz_int16; +typedef PHYSFS_uint16 mz_uint16; +typedef PHYSFS_uint32 mz_uint32; +typedef unsigned int mz_uint; +typedef PHYSFS_uint64 mz_uint64; + +/* For more compatibility with zlib, miniz.c uses unsigned long for some parameters/struct members. */ +typedef unsigned long mz_ulong; + +/* Heap allocation callbacks. */ +typedef void *(*mz_alloc_func)(void *opaque, unsigned int items, unsigned int size); +typedef void (*mz_free_func)(void *opaque, void *address); + +#if defined(_M_IX86) || defined(_M_X64) +/* Set MINIZ_USE_UNALIGNED_LOADS_AND_STORES to 1 if integer loads and stores to unaligned addresses are acceptable on the target platform (slightly faster). */ +#define MINIZ_USE_UNALIGNED_LOADS_AND_STORES 1 +/* Set MINIZ_LITTLE_ENDIAN to 1 if the processor is little endian. */ +#define MINIZ_LITTLE_ENDIAN 1 +#endif + +#if defined(_WIN64) || defined(__MINGW64__) || defined(_LP64) || defined(__LP64__) +/* Set MINIZ_HAS_64BIT_REGISTERS to 1 if the processor has 64-bit general purpose registers (enables 64-bit bitbuffer in inflator) */ +#define MINIZ_HAS_64BIT_REGISTERS 1 +#endif + +/* Works around MSVC's spammy "warning C4127: conditional expression is constant" message. */ +#ifdef _MSC_VER +#define MZ_MACRO_END while (0, 0) +#else +#define MZ_MACRO_END while (0) +#endif + +/* Decompression flags. */ +enum +{ + TINFL_FLAG_PARSE_ZLIB_HEADER = 1, + TINFL_FLAG_HAS_MORE_INPUT = 2, + TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF = 4, + TINFL_FLAG_COMPUTE_ADLER32 = 8 +}; + +struct tinfl_decompressor_tag; typedef struct tinfl_decompressor_tag tinfl_decompressor; + +/* Max size of LZ dictionary. */ +#define TINFL_LZ_DICT_SIZE 32768 + +/* Return status. */ +typedef enum +{ + TINFL_STATUS_BAD_PARAM = -3, + TINFL_STATUS_ADLER32_MISMATCH = -2, + TINFL_STATUS_FAILED = -1, + TINFL_STATUS_DONE = 0, + TINFL_STATUS_NEEDS_MORE_INPUT = 1, + TINFL_STATUS_HAS_MORE_OUTPUT = 2 +} tinfl_status; + +/* Initializes the decompressor to its initial state. */ +#define tinfl_init(r) do { (r)->m_state = 0; } MZ_MACRO_END +#define tinfl_get_adler32(r) (r)->m_check_adler32 + +/* Main low-level decompressor coroutine function. This is the only function actually needed for decompression. All the other functions are just high-level helpers for improved usability. */ +/* This is a universal API, i.e. it can be used as a building block to build any desired higher level decompression API. In the limit case, it can be called once per every byte input or output. */ +static tinfl_status tinfl_decompress(tinfl_decompressor *r, const mz_uint8 *pIn_buf_next, size_t *pIn_buf_size, mz_uint8 *pOut_buf_start, mz_uint8 *pOut_buf_next, size_t *pOut_buf_size, const mz_uint32 decomp_flags); + +/* Internal/private bits follow. */ +enum +{ + TINFL_MAX_HUFF_TABLES = 3, TINFL_MAX_HUFF_SYMBOLS_0 = 288, TINFL_MAX_HUFF_SYMBOLS_1 = 32, TINFL_MAX_HUFF_SYMBOLS_2 = 19, + TINFL_FAST_LOOKUP_BITS = 10, TINFL_FAST_LOOKUP_SIZE = 1 << TINFL_FAST_LOOKUP_BITS +}; + +typedef struct +{ + mz_uint8 m_code_size[TINFL_MAX_HUFF_SYMBOLS_0]; + mz_int16 m_look_up[TINFL_FAST_LOOKUP_SIZE], m_tree[TINFL_MAX_HUFF_SYMBOLS_0 * 2]; +} tinfl_huff_table; + +#if MINIZ_HAS_64BIT_REGISTERS + #define TINFL_USE_64BIT_BITBUF 1 +#endif + +#if TINFL_USE_64BIT_BITBUF + typedef mz_uint64 tinfl_bit_buf_t; + #define TINFL_BITBUF_SIZE (64) +#else + typedef mz_uint32 tinfl_bit_buf_t; + #define TINFL_BITBUF_SIZE (32) +#endif + +struct tinfl_decompressor_tag +{ + mz_uint32 m_state, m_num_bits, m_zhdr0, m_zhdr1, m_z_adler32, m_final, m_type, m_check_adler32, m_dist, m_counter, m_num_extra, m_table_sizes[TINFL_MAX_HUFF_TABLES]; + tinfl_bit_buf_t m_bit_buf; + size_t m_dist_from_out_buf_start; + tinfl_huff_table m_tables[TINFL_MAX_HUFF_TABLES]; + mz_uint8 m_raw_header[4], m_len_codes[TINFL_MAX_HUFF_SYMBOLS_0 + TINFL_MAX_HUFF_SYMBOLS_1 + 137]; +}; + +#endif /* #ifdef TINFL_HEADER_INCLUDED */ + +/* ------------------- End of Header: Implementation follows. (If you only want the header, define MINIZ_HEADER_FILE_ONLY.) */ + +#ifndef TINFL_HEADER_FILE_ONLY + +#define MZ_MAX(a,b) (((a)>(b))?(a):(b)) +#define MZ_MIN(a,b) (((a)<(b))?(a):(b)) +#define MZ_CLEAR_OBJ(obj) memset(&(obj), 0, sizeof(obj)) + +#if MINIZ_USE_UNALIGNED_LOADS_AND_STORES && MINIZ_LITTLE_ENDIAN + #define MZ_READ_LE16(p) *((const mz_uint16 *)(p)) + #define MZ_READ_LE32(p) *((const mz_uint32 *)(p)) +#else + #define MZ_READ_LE16(p) ((mz_uint32)(((const mz_uint8 *)(p))[0]) | ((mz_uint32)(((const mz_uint8 *)(p))[1]) << 8U)) + #define MZ_READ_LE32(p) ((mz_uint32)(((const mz_uint8 *)(p))[0]) | ((mz_uint32)(((const mz_uint8 *)(p))[1]) << 8U) | ((mz_uint32)(((const mz_uint8 *)(p))[2]) << 16U) | ((mz_uint32)(((const mz_uint8 *)(p))[3]) << 24U)) +#endif + +#define TINFL_MEMCPY(d, s, l) memcpy(d, s, l) +#define TINFL_MEMSET(p, c, l) memset(p, c, l) + +#define TINFL_CR_BEGIN switch(r->m_state) { case 0: +#define TINFL_CR_RETURN(state_index, result) do { status = result; r->m_state = state_index; goto common_exit; case state_index:; } MZ_MACRO_END +#define TINFL_CR_RETURN_FOREVER(state_index, result) do { for ( ; ; ) { TINFL_CR_RETURN(state_index, result); } } MZ_MACRO_END +#define TINFL_CR_FINISH } + +/* TODO: If the caller has indicated that there's no more input, and we attempt to read beyond the input buf, then something is wrong with the input because the inflator never */ +/* reads ahead more than it needs to. Currently TINFL_GET_BYTE() pads the end of the stream with 0's in this scenario. */ +#define TINFL_GET_BYTE(state_index, c) do { \ + if (pIn_buf_cur >= pIn_buf_end) { \ + for ( ; ; ) { \ + if (decomp_flags & TINFL_FLAG_HAS_MORE_INPUT) { \ + TINFL_CR_RETURN(state_index, TINFL_STATUS_NEEDS_MORE_INPUT); \ + if (pIn_buf_cur < pIn_buf_end) { \ + c = *pIn_buf_cur++; \ + break; \ + } \ + } else { \ + c = 0; \ + break; \ + } \ + } \ + } else c = *pIn_buf_cur++; } MZ_MACRO_END + +#define TINFL_NEED_BITS(state_index, n) do { mz_uint c; TINFL_GET_BYTE(state_index, c); bit_buf |= (((tinfl_bit_buf_t)c) << num_bits); num_bits += 8; } while (num_bits < (mz_uint)(n)) +#define TINFL_SKIP_BITS(state_index, n) do { if (num_bits < (mz_uint)(n)) { TINFL_NEED_BITS(state_index, n); } bit_buf >>= (n); num_bits -= (n); } MZ_MACRO_END +#define TINFL_GET_BITS(state_index, b, n) do { if (num_bits < (mz_uint)(n)) { TINFL_NEED_BITS(state_index, n); } b = bit_buf & ((1 << (n)) - 1); bit_buf >>= (n); num_bits -= (n); } MZ_MACRO_END + +/* TINFL_HUFF_BITBUF_FILL() is only used rarely, when the number of bytes remaining in the input buffer falls below 2. */ +/* It reads just enough bytes from the input stream that are needed to decode the next Huffman code (and absolutely no more). It works by trying to fully decode a */ +/* Huffman code by using whatever bits are currently present in the bit buffer. If this fails, it reads another byte, and tries again until it succeeds or until the */ +/* bit buffer contains >=15 bits (deflate's max. Huffman code size). */ +#define TINFL_HUFF_BITBUF_FILL(state_index, pHuff) \ + do { \ + temp = (pHuff)->m_look_up[bit_buf & (TINFL_FAST_LOOKUP_SIZE - 1)]; \ + if (temp >= 0) { \ + code_len = temp >> 9; \ + if ((code_len) && (num_bits >= code_len)) \ + break; \ + } else if (num_bits > TINFL_FAST_LOOKUP_BITS) { \ + code_len = TINFL_FAST_LOOKUP_BITS; \ + do { \ + temp = (pHuff)->m_tree[~temp + ((bit_buf >> code_len++) & 1)]; \ + } while ((temp < 0) && (num_bits >= (code_len + 1))); if (temp >= 0) break; \ + } TINFL_GET_BYTE(state_index, c); bit_buf |= (((tinfl_bit_buf_t)c) << num_bits); num_bits += 8; \ + } while (num_bits < 15); + +/* TINFL_HUFF_DECODE() decodes the next Huffman coded symbol. It's more complex than you would initially expect because the zlib API expects the decompressor to never read */ +/* beyond the final byte of the deflate stream. (In other words, when this macro wants to read another byte from the input, it REALLY needs another byte in order to fully */ +/* decode the next Huffman code.) Handling this properly is particularly important on raw deflate (non-zlib) streams, which aren't followed by a byte aligned adler-32. */ +/* The slow path is only executed at the very end of the input buffer. */ +#define TINFL_HUFF_DECODE(state_index, sym, pHuff) do { \ + int temp; mz_uint code_len, c; \ + if (num_bits < 15) { \ + if ((pIn_buf_end - pIn_buf_cur) < 2) { \ + TINFL_HUFF_BITBUF_FILL(state_index, pHuff); \ + } else { \ + bit_buf |= (((tinfl_bit_buf_t)pIn_buf_cur[0]) << num_bits) | (((tinfl_bit_buf_t)pIn_buf_cur[1]) << (num_bits + 8)); pIn_buf_cur += 2; num_bits += 16; \ + } \ + } \ + if ((temp = (pHuff)->m_look_up[bit_buf & (TINFL_FAST_LOOKUP_SIZE - 1)]) >= 0) \ + code_len = temp >> 9, temp &= 511; \ + else { \ + code_len = TINFL_FAST_LOOKUP_BITS; do { temp = (pHuff)->m_tree[~temp + ((bit_buf >> code_len++) & 1)]; } while (temp < 0); \ + } sym = temp; bit_buf >>= code_len; num_bits -= code_len; } MZ_MACRO_END + +static tinfl_status tinfl_decompress(tinfl_decompressor *r, const mz_uint8 *pIn_buf_next, size_t *pIn_buf_size, mz_uint8 *pOut_buf_start, mz_uint8 *pOut_buf_next, size_t *pOut_buf_size, const mz_uint32 decomp_flags) +{ + static const int s_length_base[31] = { 3,4,5,6,7,8,9,10,11,13, 15,17,19,23,27,31,35,43,51,59, 67,83,99,115,131,163,195,227,258,0,0 }; + static const int s_length_extra[31]= { 0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0 }; + static const int s_dist_base[32] = { 1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193, 257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0}; + static const int s_dist_extra[32] = { 0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13}; + static const mz_uint8 s_length_dezigzag[19] = { 16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15 }; + static const int s_min_table_sizes[3] = { 257, 1, 4 }; + + tinfl_status status = TINFL_STATUS_FAILED; mz_uint32 num_bits, dist, counter, num_extra; tinfl_bit_buf_t bit_buf; + const mz_uint8 *pIn_buf_cur = pIn_buf_next, *const pIn_buf_end = pIn_buf_next + *pIn_buf_size; + mz_uint8 *pOut_buf_cur = pOut_buf_next, *const pOut_buf_end = pOut_buf_next + *pOut_buf_size; + size_t out_buf_size_mask = (decomp_flags & TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF) ? (size_t)-1 : ((pOut_buf_next - pOut_buf_start) + *pOut_buf_size) - 1, dist_from_out_buf_start; + + /* Ensure the output buffer's size is a power of 2, unless the output buffer is large enough to hold the entire output file (in which case it doesn't matter). */ + if (((out_buf_size_mask + 1) & out_buf_size_mask) || (pOut_buf_next < pOut_buf_start)) { *pIn_buf_size = *pOut_buf_size = 0; return TINFL_STATUS_BAD_PARAM; } + + num_bits = r->m_num_bits; bit_buf = r->m_bit_buf; dist = r->m_dist; counter = r->m_counter; num_extra = r->m_num_extra; dist_from_out_buf_start = r->m_dist_from_out_buf_start; + TINFL_CR_BEGIN + + bit_buf = num_bits = dist = counter = num_extra = r->m_zhdr0 = r->m_zhdr1 = 0; r->m_z_adler32 = r->m_check_adler32 = 1; + if (decomp_flags & TINFL_FLAG_PARSE_ZLIB_HEADER) + { + TINFL_GET_BYTE(1, r->m_zhdr0); TINFL_GET_BYTE(2, r->m_zhdr1); + counter = (((r->m_zhdr0 * 256 + r->m_zhdr1) % 31 != 0) || (r->m_zhdr1 & 32) || ((r->m_zhdr0 & 15) != 8)); + if (!(decomp_flags & TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF)) counter |= (((1U << (8U + (r->m_zhdr0 >> 4))) > 32768U) || ((out_buf_size_mask + 1) < (size_t)(1U << (8U + (r->m_zhdr0 >> 4))))); + if (counter) { TINFL_CR_RETURN_FOREVER(36, TINFL_STATUS_FAILED); } + } + + do + { + TINFL_GET_BITS(3, r->m_final, 3); r->m_type = r->m_final >> 1; + if (r->m_type == 0) + { + TINFL_SKIP_BITS(5, num_bits & 7); + for (counter = 0; counter < 4; ++counter) { if (num_bits) TINFL_GET_BITS(6, r->m_raw_header[counter], 8); else TINFL_GET_BYTE(7, r->m_raw_header[counter]); } + if ((counter = (r->m_raw_header[0] | (r->m_raw_header[1] << 8))) != (mz_uint)(0xFFFF ^ (r->m_raw_header[2] | (r->m_raw_header[3] << 8)))) { TINFL_CR_RETURN_FOREVER(39, TINFL_STATUS_FAILED); } + while ((counter) && (num_bits)) + { + TINFL_GET_BITS(51, dist, 8); + while (pOut_buf_cur >= pOut_buf_end) { TINFL_CR_RETURN(52, TINFL_STATUS_HAS_MORE_OUTPUT); } + *pOut_buf_cur++ = (mz_uint8)dist; + counter--; + } + while (counter) + { + size_t n; while (pOut_buf_cur >= pOut_buf_end) { TINFL_CR_RETURN(9, TINFL_STATUS_HAS_MORE_OUTPUT); } + while (pIn_buf_cur >= pIn_buf_end) + { + if (decomp_flags & TINFL_FLAG_HAS_MORE_INPUT) + { + TINFL_CR_RETURN(38, TINFL_STATUS_NEEDS_MORE_INPUT); + } + else + { + TINFL_CR_RETURN_FOREVER(40, TINFL_STATUS_FAILED); + } + } + n = MZ_MIN(MZ_MIN((size_t)(pOut_buf_end - pOut_buf_cur), (size_t)(pIn_buf_end - pIn_buf_cur)), counter); + TINFL_MEMCPY(pOut_buf_cur, pIn_buf_cur, n); pIn_buf_cur += n; pOut_buf_cur += n; counter -= (mz_uint)n; + } + } + else if (r->m_type == 3) + { + TINFL_CR_RETURN_FOREVER(10, TINFL_STATUS_FAILED); + } + else + { + if (r->m_type == 1) + { + mz_uint8 *p = r->m_tables[0].m_code_size; mz_uint i; + r->m_table_sizes[0] = 288; r->m_table_sizes[1] = 32; TINFL_MEMSET(r->m_tables[1].m_code_size, 5, 32); + for ( i = 0; i <= 143; ++i) *p++ = 8; + for ( ; i <= 255; ++i) *p++ = 9; + for ( ; i <= 279; ++i) *p++ = 7; + for ( ; i <= 287; ++i) *p++ = 8; + } + else + { + for (counter = 0; counter < 3; counter++) { TINFL_GET_BITS(11, r->m_table_sizes[counter], "\05\05\04"[counter]); r->m_table_sizes[counter] += s_min_table_sizes[counter]; } + MZ_CLEAR_OBJ(r->m_tables[2].m_code_size); for (counter = 0; counter < r->m_table_sizes[2]; counter++) { mz_uint s; TINFL_GET_BITS(14, s, 3); r->m_tables[2].m_code_size[s_length_dezigzag[counter]] = (mz_uint8)s; } + r->m_table_sizes[2] = 19; + } + for ( ; (int)r->m_type >= 0; r->m_type--) + { + int tree_next, tree_cur; tinfl_huff_table *pTable; + mz_uint i, j, used_syms, total, sym_index, next_code[17], total_syms[16]; pTable = &r->m_tables[r->m_type]; MZ_CLEAR_OBJ(total_syms); MZ_CLEAR_OBJ(pTable->m_look_up); MZ_CLEAR_OBJ(pTable->m_tree); + for (i = 0; i < r->m_table_sizes[r->m_type]; ++i) total_syms[pTable->m_code_size[i]]++; + used_syms = 0, total = 0; next_code[0] = next_code[1] = 0; + for (i = 1; i <= 15; ++i) { used_syms += total_syms[i]; next_code[i + 1] = (total = ((total + total_syms[i]) << 1)); } + if ((65536 != total) && (used_syms > 1)) + { + TINFL_CR_RETURN_FOREVER(35, TINFL_STATUS_FAILED); + } + for (tree_next = -1, sym_index = 0; sym_index < r->m_table_sizes[r->m_type]; ++sym_index) + { + mz_uint rev_code = 0, l, cur_code, code_size = pTable->m_code_size[sym_index]; if (!code_size) continue; + cur_code = next_code[code_size]++; for (l = code_size; l > 0; l--, cur_code >>= 1) rev_code = (rev_code << 1) | (cur_code & 1); + if (code_size <= TINFL_FAST_LOOKUP_BITS) { mz_int16 k = (mz_int16)((code_size << 9) | sym_index); while (rev_code < TINFL_FAST_LOOKUP_SIZE) { pTable->m_look_up[rev_code] = k; rev_code += (1 << code_size); } continue; } + if (0 == (tree_cur = pTable->m_look_up[rev_code & (TINFL_FAST_LOOKUP_SIZE - 1)])) { pTable->m_look_up[rev_code & (TINFL_FAST_LOOKUP_SIZE - 1)] = (mz_int16)tree_next; tree_cur = tree_next; tree_next -= 2; } + rev_code >>= (TINFL_FAST_LOOKUP_BITS - 1); + for (j = code_size; j > (TINFL_FAST_LOOKUP_BITS + 1); j--) + { + tree_cur -= ((rev_code >>= 1) & 1); + if (!pTable->m_tree[-tree_cur - 1]) { pTable->m_tree[-tree_cur - 1] = (mz_int16)tree_next; tree_cur = tree_next; tree_next -= 2; } else tree_cur = pTable->m_tree[-tree_cur - 1]; + } + tree_cur -= ((rev_code >>= 1) & 1); pTable->m_tree[-tree_cur - 1] = (mz_int16)sym_index; + } + if (r->m_type == 2) + { + for (counter = 0; counter < (r->m_table_sizes[0] + r->m_table_sizes[1]); ) + { + mz_uint s; TINFL_HUFF_DECODE(16, dist, &r->m_tables[2]); if (dist < 16) { r->m_len_codes[counter++] = (mz_uint8)dist; continue; } + if ((dist == 16) && (!counter)) + { + TINFL_CR_RETURN_FOREVER(17, TINFL_STATUS_FAILED); + } + num_extra = "\02\03\07"[dist - 16]; TINFL_GET_BITS(18, s, num_extra); s += "\03\03\013"[dist - 16]; + TINFL_MEMSET(r->m_len_codes + counter, (dist == 16) ? r->m_len_codes[counter - 1] : 0, s); counter += s; + } + if ((r->m_table_sizes[0] + r->m_table_sizes[1]) != counter) + { + TINFL_CR_RETURN_FOREVER(21, TINFL_STATUS_FAILED); + } + TINFL_MEMCPY(r->m_tables[0].m_code_size, r->m_len_codes, r->m_table_sizes[0]); TINFL_MEMCPY(r->m_tables[1].m_code_size, r->m_len_codes + r->m_table_sizes[0], r->m_table_sizes[1]); + } + } + for ( ; ; ) + { + mz_uint8 *pSrc; + for ( ; ; ) + { + if (((pIn_buf_end - pIn_buf_cur) < 4) || ((pOut_buf_end - pOut_buf_cur) < 2)) + { + TINFL_HUFF_DECODE(23, counter, &r->m_tables[0]); + if (counter >= 256) + break; + while (pOut_buf_cur >= pOut_buf_end) { TINFL_CR_RETURN(24, TINFL_STATUS_HAS_MORE_OUTPUT); } + *pOut_buf_cur++ = (mz_uint8)counter; + } + else + { + int sym2; mz_uint code_len; +#if TINFL_USE_64BIT_BITBUF + if (num_bits < 30) { bit_buf |= (((tinfl_bit_buf_t)MZ_READ_LE32(pIn_buf_cur)) << num_bits); pIn_buf_cur += 4; num_bits += 32; } +#else + if (num_bits < 15) { bit_buf |= (((tinfl_bit_buf_t)MZ_READ_LE16(pIn_buf_cur)) << num_bits); pIn_buf_cur += 2; num_bits += 16; } +#endif + if ((sym2 = r->m_tables[0].m_look_up[bit_buf & (TINFL_FAST_LOOKUP_SIZE - 1)]) >= 0) + code_len = sym2 >> 9; + else + { + code_len = TINFL_FAST_LOOKUP_BITS; do { sym2 = r->m_tables[0].m_tree[~sym2 + ((bit_buf >> code_len++) & 1)]; } while (sym2 < 0); + } + counter = sym2; bit_buf >>= code_len; num_bits -= code_len; + if (counter & 256) + break; + +#if !TINFL_USE_64BIT_BITBUF + if (num_bits < 15) { bit_buf |= (((tinfl_bit_buf_t)MZ_READ_LE16(pIn_buf_cur)) << num_bits); pIn_buf_cur += 2; num_bits += 16; } +#endif + if ((sym2 = r->m_tables[0].m_look_up[bit_buf & (TINFL_FAST_LOOKUP_SIZE - 1)]) >= 0) + code_len = sym2 >> 9; + else + { + code_len = TINFL_FAST_LOOKUP_BITS; do { sym2 = r->m_tables[0].m_tree[~sym2 + ((bit_buf >> code_len++) & 1)]; } while (sym2 < 0); + } + bit_buf >>= code_len; num_bits -= code_len; + + pOut_buf_cur[0] = (mz_uint8)counter; + if (sym2 & 256) + { + pOut_buf_cur++; + counter = sym2; + break; + } + pOut_buf_cur[1] = (mz_uint8)sym2; + pOut_buf_cur += 2; + } + } + if ((counter &= 511) == 256) break; + + num_extra = s_length_extra[counter - 257]; counter = s_length_base[counter - 257]; + if (num_extra) { mz_uint extra_bits; TINFL_GET_BITS(25, extra_bits, num_extra); counter += extra_bits; } + + TINFL_HUFF_DECODE(26, dist, &r->m_tables[1]); + num_extra = s_dist_extra[dist]; dist = s_dist_base[dist]; + if (num_extra) { mz_uint extra_bits; TINFL_GET_BITS(27, extra_bits, num_extra); dist += extra_bits; } + + dist_from_out_buf_start = pOut_buf_cur - pOut_buf_start; + if ((dist > dist_from_out_buf_start) && (decomp_flags & TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF)) + { + TINFL_CR_RETURN_FOREVER(37, TINFL_STATUS_FAILED); + } + + pSrc = pOut_buf_start + ((dist_from_out_buf_start - dist) & out_buf_size_mask); + + if ((MZ_MAX(pOut_buf_cur, pSrc) + counter) > pOut_buf_end) + { + while (counter--) + { + while (pOut_buf_cur >= pOut_buf_end) { TINFL_CR_RETURN(53, TINFL_STATUS_HAS_MORE_OUTPUT); } + *pOut_buf_cur++ = pOut_buf_start[(dist_from_out_buf_start++ - dist) & out_buf_size_mask]; + } + continue; + } +#if MINIZ_USE_UNALIGNED_LOADS_AND_STORES + else if ((counter >= 9) && (counter <= dist)) + { + const mz_uint8 *pSrc_end = pSrc + (counter & ~7); + do + { + ((mz_uint32 *)pOut_buf_cur)[0] = ((const mz_uint32 *)pSrc)[0]; + ((mz_uint32 *)pOut_buf_cur)[1] = ((const mz_uint32 *)pSrc)[1]; + pOut_buf_cur += 8; + } while ((pSrc += 8) < pSrc_end); + if ((counter &= 7) < 3) + { + if (counter) + { + pOut_buf_cur[0] = pSrc[0]; + if (counter > 1) + pOut_buf_cur[1] = pSrc[1]; + pOut_buf_cur += counter; + } + continue; + } + } +#endif + do + { + pOut_buf_cur[0] = pSrc[0]; + pOut_buf_cur[1] = pSrc[1]; + pOut_buf_cur[2] = pSrc[2]; + pOut_buf_cur += 3; pSrc += 3; + } while ((int)(counter -= 3) > 2); + if ((int)counter > 0) + { + pOut_buf_cur[0] = pSrc[0]; + if ((int)counter > 1) + pOut_buf_cur[1] = pSrc[1]; + pOut_buf_cur += counter; + } + } + } + } while (!(r->m_final & 1)); + if (decomp_flags & TINFL_FLAG_PARSE_ZLIB_HEADER) + { + TINFL_SKIP_BITS(32, num_bits & 7); for (counter = 0; counter < 4; ++counter) { mz_uint s; if (num_bits) TINFL_GET_BITS(41, s, 8); else TINFL_GET_BYTE(42, s); r->m_z_adler32 = (r->m_z_adler32 << 8) | s; } + } + TINFL_CR_RETURN_FOREVER(34, TINFL_STATUS_DONE); + TINFL_CR_FINISH + +common_exit: + r->m_num_bits = num_bits; r->m_bit_buf = bit_buf; r->m_dist = dist; r->m_counter = counter; r->m_num_extra = num_extra; r->m_dist_from_out_buf_start = dist_from_out_buf_start; + *pIn_buf_size = pIn_buf_cur - pIn_buf_next; *pOut_buf_size = pOut_buf_cur - pOut_buf_next; + if ((decomp_flags & (TINFL_FLAG_PARSE_ZLIB_HEADER | TINFL_FLAG_COMPUTE_ADLER32)) && (status >= 0)) + { + const mz_uint8 *ptr = pOut_buf_next; size_t buf_len = *pOut_buf_size; + mz_uint32 i, s1 = r->m_check_adler32 & 0xffff, s2 = r->m_check_adler32 >> 16; size_t block_len = buf_len % 5552; + while (buf_len) + { + for (i = 0; i + 7 < block_len; i += 8, ptr += 8) + { + s1 += ptr[0], s2 += s1; s1 += ptr[1], s2 += s1; s1 += ptr[2], s2 += s1; s1 += ptr[3], s2 += s1; + s1 += ptr[4], s2 += s1; s1 += ptr[5], s2 += s1; s1 += ptr[6], s2 += s1; s1 += ptr[7], s2 += s1; + } + for ( ; i < block_len; ++i) s1 += *ptr++, s2 += s1; + s1 %= 65521U, s2 %= 65521U; buf_len -= block_len; block_len = 5552; + } + r->m_check_adler32 = (s2 << 16) + s1; if ((status == TINFL_STATUS_DONE) && (decomp_flags & TINFL_FLAG_PARSE_ZLIB_HEADER) && (r->m_check_adler32 != r->m_z_adler32)) status = TINFL_STATUS_ADLER32_MISMATCH; + } + return status; +} + +/* Flush values. For typical usage you only need MZ_NO_FLUSH and MZ_FINISH. The other stuff is for advanced use. */ +enum { MZ_NO_FLUSH = 0, MZ_PARTIAL_FLUSH = 1, MZ_SYNC_FLUSH = 2, MZ_FULL_FLUSH = 3, MZ_FINISH = 4, MZ_BLOCK = 5 }; + +/* Return status codes. MZ_PARAM_ERROR is non-standard. */ +enum { MZ_OK = 0, MZ_STREAM_END = 1, MZ_NEED_DICT = 2, MZ_ERRNO = -1, MZ_STREAM_ERROR = -2, MZ_DATA_ERROR = -3, MZ_MEM_ERROR = -4, MZ_BUF_ERROR = -5, MZ_VERSION_ERROR = -6, MZ_PARAM_ERROR = -10000 }; + +/* Compression levels. */ +enum { MZ_NO_COMPRESSION = 0, MZ_BEST_SPEED = 1, MZ_BEST_COMPRESSION = 9, MZ_DEFAULT_COMPRESSION = -1 }; + +/* Window bits */ +#define MZ_DEFAULT_WINDOW_BITS 15 + +struct mz_internal_state; + +/* Compression/decompression stream struct. */ +typedef struct mz_stream_s +{ + const unsigned char *next_in; /* pointer to next byte to read */ + unsigned int avail_in; /* number of bytes available at next_in */ + mz_ulong total_in; /* total number of bytes consumed so far */ + + unsigned char *next_out; /* pointer to next byte to write */ + unsigned int avail_out; /* number of bytes that can be written to next_out */ + mz_ulong total_out; /* total number of bytes produced so far */ + + char *msg; /* error msg (unused) */ + struct mz_internal_state *state; /* internal state, allocated by zalloc/zfree */ + + mz_alloc_func zalloc; /* optional heap allocation function (defaults to malloc) */ + mz_free_func zfree; /* optional heap free function (defaults to free) */ + void *opaque; /* heap alloc function user pointer */ + + int data_type; /* data_type (unused) */ + mz_ulong adler; /* adler32 of the source or uncompressed data */ + mz_ulong reserved; /* not used */ +} mz_stream; + +typedef mz_stream *mz_streamp; + + +typedef struct +{ + tinfl_decompressor m_decomp; + mz_uint m_dict_ofs, m_dict_avail, m_first_call, m_has_flushed; int m_window_bits; + mz_uint8 m_dict[TINFL_LZ_DICT_SIZE]; + tinfl_status m_last_status; +} inflate_state; + +static int mz_inflateInit2(mz_streamp pStream, int window_bits) +{ + inflate_state *pDecomp; + if (!pStream) return MZ_STREAM_ERROR; + if ((window_bits != MZ_DEFAULT_WINDOW_BITS) && (-window_bits != MZ_DEFAULT_WINDOW_BITS)) return MZ_PARAM_ERROR; + + pStream->data_type = 0; + pStream->adler = 0; + pStream->msg = NULL; + pStream->total_in = 0; + pStream->total_out = 0; + pStream->reserved = 0; + /* if (!pStream->zalloc) pStream->zalloc = def_alloc_func; */ + /* if (!pStream->zfree) pStream->zfree = def_free_func; */ + + pDecomp = (inflate_state*)pStream->zalloc(pStream->opaque, 1, sizeof(inflate_state)); + if (!pDecomp) return MZ_MEM_ERROR; + + pStream->state = (struct mz_internal_state *)pDecomp; + + tinfl_init(&pDecomp->m_decomp); + pDecomp->m_dict_ofs = 0; + pDecomp->m_dict_avail = 0; + pDecomp->m_last_status = TINFL_STATUS_NEEDS_MORE_INPUT; + pDecomp->m_first_call = 1; + pDecomp->m_has_flushed = 0; + pDecomp->m_window_bits = window_bits; + + return MZ_OK; +} + +static int mz_inflate(mz_streamp pStream, int flush) +{ + inflate_state* pState; + mz_uint n, first_call, decomp_flags = TINFL_FLAG_COMPUTE_ADLER32; + size_t in_bytes, out_bytes, orig_avail_in; + tinfl_status status; + + if ((!pStream) || (!pStream->state)) return MZ_STREAM_ERROR; + if (flush == MZ_PARTIAL_FLUSH) flush = MZ_SYNC_FLUSH; + if ((flush) && (flush != MZ_SYNC_FLUSH) && (flush != MZ_FINISH)) return MZ_STREAM_ERROR; + + pState = (inflate_state*)pStream->state; + if (pState->m_window_bits > 0) decomp_flags |= TINFL_FLAG_PARSE_ZLIB_HEADER; + orig_avail_in = pStream->avail_in; + + first_call = pState->m_first_call; pState->m_first_call = 0; + if (pState->m_last_status < 0) return MZ_DATA_ERROR; + + if (pState->m_has_flushed && (flush != MZ_FINISH)) return MZ_STREAM_ERROR; + pState->m_has_flushed |= (flush == MZ_FINISH); + + if ((flush == MZ_FINISH) && (first_call)) + { + /* MZ_FINISH on the first call implies that the input and output buffers are large enough to hold the entire compressed/decompressed file. */ + decomp_flags |= TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF; + in_bytes = pStream->avail_in; out_bytes = pStream->avail_out; + status = tinfl_decompress(&pState->m_decomp, pStream->next_in, &in_bytes, pStream->next_out, pStream->next_out, &out_bytes, decomp_flags); + pState->m_last_status = status; + pStream->next_in += (mz_uint)in_bytes; pStream->avail_in -= (mz_uint)in_bytes; pStream->total_in += (mz_uint)in_bytes; + pStream->adler = tinfl_get_adler32(&pState->m_decomp); + pStream->next_out += (mz_uint)out_bytes; pStream->avail_out -= (mz_uint)out_bytes; pStream->total_out += (mz_uint)out_bytes; + + if (status < 0) + return MZ_DATA_ERROR; + else if (status != TINFL_STATUS_DONE) + { + pState->m_last_status = TINFL_STATUS_FAILED; + return MZ_BUF_ERROR; + } + return MZ_STREAM_END; + } + /* flush != MZ_FINISH then we must assume there's more input. */ + if (flush != MZ_FINISH) decomp_flags |= TINFL_FLAG_HAS_MORE_INPUT; + + if (pState->m_dict_avail) + { + n = MZ_MIN(pState->m_dict_avail, pStream->avail_out); + memcpy(pStream->next_out, pState->m_dict + pState->m_dict_ofs, n); + pStream->next_out += n; pStream->avail_out -= n; pStream->total_out += n; + pState->m_dict_avail -= n; pState->m_dict_ofs = (pState->m_dict_ofs + n) & (TINFL_LZ_DICT_SIZE - 1); + return ((pState->m_last_status == TINFL_STATUS_DONE) && (!pState->m_dict_avail)) ? MZ_STREAM_END : MZ_OK; + } + + for ( ; ; ) + { + in_bytes = pStream->avail_in; + out_bytes = TINFL_LZ_DICT_SIZE - pState->m_dict_ofs; + + status = tinfl_decompress(&pState->m_decomp, pStream->next_in, &in_bytes, pState->m_dict, pState->m_dict + pState->m_dict_ofs, &out_bytes, decomp_flags); + pState->m_last_status = status; + + pStream->next_in += (mz_uint)in_bytes; pStream->avail_in -= (mz_uint)in_bytes; + pStream->total_in += (mz_uint)in_bytes; pStream->adler = tinfl_get_adler32(&pState->m_decomp); + + pState->m_dict_avail = (mz_uint)out_bytes; + + n = MZ_MIN(pState->m_dict_avail, pStream->avail_out); + memcpy(pStream->next_out, pState->m_dict + pState->m_dict_ofs, n); + pStream->next_out += n; pStream->avail_out -= n; pStream->total_out += n; + pState->m_dict_avail -= n; pState->m_dict_ofs = (pState->m_dict_ofs + n) & (TINFL_LZ_DICT_SIZE - 1); + + if (status < 0) + return MZ_DATA_ERROR; /* Stream is corrupted (there could be some uncompressed data left in the output dictionary - oh well). */ + else if ((status == TINFL_STATUS_NEEDS_MORE_INPUT) && (!orig_avail_in)) + return MZ_BUF_ERROR; /* Signal caller that we can't make forward progress without supplying more input or by setting flush to MZ_FINISH. */ + else if (flush == MZ_FINISH) + { + /* The output buffer MUST be large to hold the remaining uncompressed data when flush==MZ_FINISH. */ + if (status == TINFL_STATUS_DONE) + return pState->m_dict_avail ? MZ_BUF_ERROR : MZ_STREAM_END; + /* status here must be TINFL_STATUS_HAS_MORE_OUTPUT, which means there's at least 1 more byte on the way. If there's no more room left in the output buffer then something is wrong. */ + else if (!pStream->avail_out) + return MZ_BUF_ERROR; + } + else if ((status == TINFL_STATUS_DONE) || (!pStream->avail_in) || (!pStream->avail_out) || (pState->m_dict_avail)) + break; + } + + return ((status == TINFL_STATUS_DONE) && (!pState->m_dict_avail)) ? MZ_STREAM_END : MZ_OK; +} + +static int mz_inflateEnd(mz_streamp pStream) +{ + if (!pStream) + return MZ_STREAM_ERROR; + if (pStream->state) + { + pStream->zfree(pStream->opaque, pStream->state); + pStream->state = NULL; + } + return MZ_OK; +} + +/* make this a drop-in replacement for zlib... */ + #define voidpf void* + #define uInt unsigned int + #define z_stream mz_stream + #define inflateInit2 mz_inflateInit2 + #define inflate mz_inflate + #define inflateEnd mz_inflateEnd + #define Z_SYNC_FLUSH MZ_SYNC_FLUSH + #define Z_FINISH MZ_FINISH + #define Z_OK MZ_OK + #define Z_STREAM_END MZ_STREAM_END + #define Z_NEED_DICT MZ_NEED_DICT + #define Z_ERRNO MZ_ERRNO + #define Z_STREAM_ERROR MZ_STREAM_ERROR + #define Z_DATA_ERROR MZ_DATA_ERROR + #define Z_MEM_ERROR MZ_MEM_ERROR + #define Z_BUF_ERROR MZ_BUF_ERROR + #define Z_VERSION_ERROR MZ_VERSION_ERROR + #define MAX_WBITS 15 + +#endif /* #ifndef TINFL_HEADER_FILE_ONLY */ + +/* + This is free and unencumbered software released into the public domain. + + Anyone is free to copy, modify, publish, use, compile, sell, or + distribute this software, either in source code form or as a compiled + binary, for any purpose, commercial or non-commercial, and by any + means. + + In jurisdictions that recognize copyright laws, the author or authors + of this software dedicate any and all copyright interest in the + software to the public domain. We make this dedication for the benefit + of the public at large and to the detriment of our heirs and + successors. We intend this dedication to be an overt act of + relinquishment in perpetuity of all present and future rights to this + software under copyright law. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR + OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + OTHER DEALINGS IN THE SOFTWARE. + + For more information, please refer to +*/ diff --git a/third_party/physfs/physfs_platform_apple.m b/third_party/physfs/physfs_platform_apple.m new file mode 100644 index 00000000..e6207f5b --- /dev/null +++ b/third_party/physfs/physfs_platform_apple.m @@ -0,0 +1,188 @@ +/* + * Apple platform (macOS, iOS, watchOS, etc) support routines for PhysicsFS. + * + * Please see the file LICENSE.txt in the source's root directory. + * + * This file written by Ryan C. Gordon. + */ + +#define __PHYSICSFS_INTERNAL__ +#include "physfs_platforms.h" + +#ifdef PHYSFS_PLATFORM_APPLE + +#include + +#include "physfs_internal.h" + +int __PHYSFS_platformInit(void) +{ + return 1; /* success. */ +} /* __PHYSFS_platformInit */ + + +void __PHYSFS_platformDeinit(void) +{ + /* no-op */ +} /* __PHYSFS_platformDeinit */ + + +char *__PHYSFS_platformCalcBaseDir(const char *argv0) +{ + @autoreleasepool + { + NSString *path = [[NSBundle mainBundle] bundlePath]; + BAIL_IF(!path, PHYSFS_ERR_OS_ERROR, NULL); + size_t len = [path lengthOfBytesUsingEncoding:NSUTF8StringEncoding]; + char *retval = (char *) allocator.Malloc(len + 2); + BAIL_IF(!retval, PHYSFS_ERR_OUT_OF_MEMORY, NULL); + [path getCString:retval maxLength:len+1 encoding:NSUTF8StringEncoding]; + retval[len] = '/'; + retval[len+1] = '\0'; + return retval; /* whew. */ + } /* @autoreleasepool */ +} /* __PHYSFS_platformCalcBaseDir */ + + +char *__PHYSFS_platformCalcPrefDir(const char *org, const char *app) +{ + @autoreleasepool + { + NSArray *paths = NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, TRUE); + BAIL_IF(!paths, PHYSFS_ERR_OS_ERROR, NULL); + NSString *path = (NSString *) [paths objectAtIndex:0]; + BAIL_IF(!path, PHYSFS_ERR_OS_ERROR, NULL); + size_t len = [path lengthOfBytesUsingEncoding:NSUTF8StringEncoding]; + const size_t applen = strlen(app); + char *retval = (char *) allocator.Malloc(len + applen + 3); + BAIL_IF(!retval, PHYSFS_ERR_OUT_OF_MEMORY, NULL); + [path getCString:retval maxLength:len+1 encoding:NSUTF8StringEncoding]; + snprintf(retval + len, applen + 3, "/%s/", app); + return retval; /* whew. */ + } /* @autoreleasepool */ +} /* __PHYSFS_platformCalcPrefDir */ + + +/* CD-ROM detection code... */ + +/* + * Code based on sample from Apple Developer Connection: + * https://developer.apple.com/samplecode/Sample_Code/Devices_and_Hardware/Disks/VolumeToBSDNode/VolumeToBSDNode.c.htm + */ + +#if !defined(PHYSFS_NO_CDROM_SUPPORT) + +#include +#include +#include +#include +#include + +static int darwinIsWholeMedia(io_service_t service) +{ + int retval = 0; + CFTypeRef wholeMedia; + + if (!IOObjectConformsTo(service, kIOMediaClass)) + return 0; + + wholeMedia = IORegistryEntryCreateCFProperty(service, + CFSTR(kIOMediaWholeKey), + NULL, 0); + if (wholeMedia == NULL) + return 0; + + retval = CFBooleanGetValue(wholeMedia); + CFRelease(wholeMedia); + + return retval; +} /* darwinIsWholeMedia */ + + +static int darwinIsMountedDisc(char *bsdName, mach_port_t masterPort) +{ + int retval = 0; + CFMutableDictionaryRef matchingDict; + kern_return_t rc; + io_iterator_t iter; + io_service_t service; + + if ((matchingDict = IOBSDNameMatching(masterPort, 0, bsdName)) == NULL) + return 0; + + rc = IOServiceGetMatchingServices(masterPort, matchingDict, &iter); + if ((rc != KERN_SUCCESS) || (!iter)) + return 0; + + service = IOIteratorNext(iter); + IOObjectRelease(iter); + if (!service) + return 0; + + rc = IORegistryEntryCreateIterator(service, kIOServicePlane, + kIORegistryIterateRecursively | kIORegistryIterateParents, &iter); + + if (!iter) + return 0; + + if (rc != KERN_SUCCESS) + { + IOObjectRelease(iter); + return 0; + } /* if */ + + IOObjectRetain(service); /* add an extra object reference... */ + + do + { + if (darwinIsWholeMedia(service)) + { + if ( (IOObjectConformsTo(service, kIOCDMediaClass)) || + (IOObjectConformsTo(service, kIODVDMediaClass)) ) + { + retval = 1; + } /* if */ + } /* if */ + IOObjectRelease(service); + } while ((service = IOIteratorNext(iter)) && (!retval)); + + IOObjectRelease(iter); + IOObjectRelease(service); + + return retval; +} /* darwinIsMountedDisc */ + +#endif /* !defined(PHYSFS_NO_CDROM_SUPPORT) */ + + +void __PHYSFS_platformDetectAvailableCDs(PHYSFS_StringCallback cb, void *data) +{ +#if !defined(PHYSFS_NO_CDROM_SUPPORT) + const char *devPrefix = "/dev/"; + const int prefixLen = strlen(devPrefix); + mach_port_t masterPort = 0; + struct statfs *mntbufp; + int i, mounts; + + if (IOMasterPort(MACH_PORT_NULL, &masterPort) != KERN_SUCCESS) + BAIL(PHYSFS_ERR_OS_ERROR, ) /*return void*/; + + mounts = getmntinfo(&mntbufp, MNT_WAIT); /* NOT THREAD SAFE! */ + for (i = 0; i < mounts; i++) + { + char *dev = mntbufp[i].f_mntfromname; + char *mnt = mntbufp[i].f_mntonname; + if (strncmp(dev, devPrefix, prefixLen) != 0) /* a virtual device? */ + continue; + + dev += prefixLen; + if (darwinIsMountedDisc(dev, masterPort)) + cb(data, mnt); + } /* for */ +#endif /* !defined(PHYSFS_NO_CDROM_SUPPORT) */ +} /* __PHYSFS_platformDetectAvailableCDs */ + +#endif /* PHYSFS_PLATFORM_APPLE */ + +/* end of physfs_platform_apple.m ... */ + diff --git a/third_party/physfs/physfs_platform_haiku.cpp b/third_party/physfs/physfs_platform_haiku.cpp new file mode 100644 index 00000000..fcf8ebde --- /dev/null +++ b/third_party/physfs/physfs_platform_haiku.cpp @@ -0,0 +1,186 @@ +/* + * Haiku platform-dependent support routines for PhysicsFS. + * + * Please see the file LICENSE.txt in the source's root directory. + * + * This file written by Ryan C. Gordon. + */ + +#define __PHYSICSFS_INTERNAL__ +#include "physfs_platforms.h" + +#ifdef PHYSFS_PLATFORM_HAIKU + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "physfs_internal.h" + +int __PHYSFS_platformInit(void) +{ + return 1; /* always succeed. */ +} /* __PHYSFS_platformInit */ + + +void __PHYSFS_platformDeinit(void) +{ + /* no-op */ +} /* __PHYSFS_platformDeinit */ + + +static char *getMountPoint(const char *devname, char *buf, size_t bufsize) +{ + BVolumeRoster mounts; + BVolume vol; + + mounts.Rewind(); + while (mounts.GetNextVolume(&vol) == B_NO_ERROR) + { + fs_info fsinfo; + fs_stat_dev(vol.Device(), &fsinfo); + if (strcmp(devname, fsinfo.device_name) == 0) + { + BDirectory directory; + BEntry entry; + BPath path; + const char *str; + + if ( (vol.GetRootDirectory(&directory) < B_OK) || + (directory.GetEntry(&entry) < B_OK) || + (entry.GetPath(&path) < B_OK) || + ( (str = path.Path()) == NULL) ) + return NULL; + + strncpy(buf, str, bufsize-1); + buf[bufsize-1] = '\0'; + return buf; + } /* if */ + } /* while */ + + return NULL; +} /* getMountPoint */ + + + /* + * This function is lifted from Simple Directmedia Layer (SDL): + * https://www.libsdl.org/ ... this is zlib-licensed code, too. + */ +static void tryDir(const char *d, PHYSFS_StringCallback callback, void *data) +{ + BDirectory dir; + dir.SetTo(d); + if (dir.InitCheck() != B_NO_ERROR) + return; + + dir.Rewind(); + BEntry entry; + while (dir.GetNextEntry(&entry) >= 0) + { + BPath path; + const char *name; + entry_ref e; + + if (entry.GetPath(&path) != B_NO_ERROR) + continue; + + name = path.Path(); + + if (entry.GetRef(&e) != B_NO_ERROR) + continue; + + if (entry.IsDirectory()) + { + if (strcmp(e.name, "floppy") != 0) + tryDir(name, callback, data); + continue; + } /* if */ + + const int devfd = open(name, O_RDONLY); + if (devfd < 0) + continue; + + device_geometry g; + const int rc = ioctl(devfd, B_GET_GEOMETRY, &g, sizeof (g)); + close(devfd); + if (rc < 0) + continue; + + if (g.device_type != B_CD) + continue; + + char mntpnt[B_FILE_NAME_LENGTH]; + if (getMountPoint(name, mntpnt, sizeof (mntpnt))) + callback(data, mntpnt); + } /* while */ +} /* tryDir */ + + +void __PHYSFS_platformDetectAvailableCDs(PHYSFS_StringCallback cb, void *data) +{ + tryDir("/dev/disk", cb, data); +} /* __PHYSFS_platformDetectAvailableCDs */ + + +static team_id getTeamID(void) +{ + thread_info info; + thread_id tid = find_thread(NULL); + get_thread_info(tid, &info); + return info.team; +} /* getTeamID */ + + +char *__PHYSFS_platformCalcBaseDir(const char *argv0) +{ + image_info info; + int32 cookie = 0; + + while (get_next_image_info(0, &cookie, &info) == B_OK) + { + if (info.type == B_APP_IMAGE) + break; + } /* while */ + + BEntry entry(info.name, true); + BPath path; + status_t rc = entry.GetPath(&path); /* (path) now has binary's path. */ + assert(rc == B_OK); + rc = path.GetParent(&path); /* chop filename, keep directory. */ + assert(rc == B_OK); + const char *str = path.Path(); + assert(str != NULL); + const size_t len = strlen(str); + char *retval = (char *) allocator.Malloc(len + 2); + BAIL_IF(!retval, PHYSFS_ERR_OUT_OF_MEMORY, NULL); + strcpy(retval, str); + retval[len] = '/'; + retval[len+1] = '\0'; + return retval; +} /* __PHYSFS_platformCalcBaseDir */ + + +char *__PHYSFS_platformCalcPrefDir(const char *org, const char *app) +{ + const char *userdir = __PHYSFS_getUserDir(); + const char *append = "config/settings/"; + const size_t len = strlen(userdir) + strlen(append) + strlen(app) + 2; + char *retval = (char *) allocator.Malloc(len); + BAIL_IF(!retval, PHYSFS_ERR_OUT_OF_MEMORY, NULL); + snprintf(retval, len, "%s%s%s/", userdir, append, app); + return retval; +} /* __PHYSFS_platformCalcPrefDir */ + +#endif /* PHYSFS_PLATFORM_HAIKU */ + +/* end of physfs_platform_haiku.cpp ... */ + diff --git a/third_party/physfs/physfs_platform_posix.c b/third_party/physfs/physfs_platform_posix.c new file mode 100644 index 00000000..fa2159cd --- /dev/null +++ b/third_party/physfs/physfs_platform_posix.c @@ -0,0 +1,417 @@ +/* + * Posix-esque support routines for PhysicsFS. + * + * Please see the file LICENSE.txt in the source's root directory. + * + * This file written by Ryan C. Gordon. + */ + +/* !!! FIXME: check for EINTR? */ + +#define __PHYSICSFS_INTERNAL__ +#include "physfs_platforms.h" + +#ifdef PHYSFS_PLATFORM_POSIX + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "physfs_internal.h" + + +static PHYSFS_ErrorCode errcodeFromErrnoError(const int err) +{ + switch (err) + { + case 0: return PHYSFS_ERR_OK; + case EACCES: return PHYSFS_ERR_PERMISSION; + case EPERM: return PHYSFS_ERR_PERMISSION; + case EDQUOT: return PHYSFS_ERR_NO_SPACE; + case EIO: return PHYSFS_ERR_IO; + case ELOOP: return PHYSFS_ERR_SYMLINK_LOOP; + case EMLINK: return PHYSFS_ERR_NO_SPACE; + case ENAMETOOLONG: return PHYSFS_ERR_BAD_FILENAME; + case ENOENT: return PHYSFS_ERR_NOT_FOUND; + case ENOSPC: return PHYSFS_ERR_NO_SPACE; + case ENOTDIR: return PHYSFS_ERR_NOT_FOUND; + case EISDIR: return PHYSFS_ERR_NOT_A_FILE; + case EROFS: return PHYSFS_ERR_READ_ONLY; + case ETXTBSY: return PHYSFS_ERR_BUSY; + case EBUSY: return PHYSFS_ERR_BUSY; + case ENOMEM: return PHYSFS_ERR_OUT_OF_MEMORY; + case ENOTEMPTY: return PHYSFS_ERR_DIR_NOT_EMPTY; + default: return PHYSFS_ERR_OS_ERROR; + } /* switch */ +} /* errcodeFromErrnoError */ + + +static inline PHYSFS_ErrorCode errcodeFromErrno(void) +{ + return errcodeFromErrnoError(errno); +} /* errcodeFromErrno */ + + +static char *getUserDirByUID(void) +{ + uid_t uid = getuid(); + struct passwd *pw; + char *retval = NULL; + + pw = getpwuid(uid); + if ((pw != NULL) && (pw->pw_dir != NULL) && (*pw->pw_dir != '\0')) + { + const size_t dlen = strlen(pw->pw_dir); + const size_t add_dirsep = (pw->pw_dir[dlen-1] != '/') ? 1 : 0; + retval = (char *) allocator.Malloc(dlen + 1 + add_dirsep); + if (retval != NULL) + { + strcpy(retval, pw->pw_dir); + if (add_dirsep) + { + retval[dlen] = '/'; + retval[dlen+1] = '\0'; + } /* if */ + } /* if */ + } /* if */ + + return retval; +} /* getUserDirByUID */ + + +char *__PHYSFS_platformCalcUserDir(void) +{ + char *retval = NULL; + char *envr = getenv("HOME"); + + /* if the environment variable was set, make sure it's really a dir. */ + if (envr != NULL) + { + struct stat statbuf; + if ((stat(envr, &statbuf) != -1) && (S_ISDIR(statbuf.st_mode))) + { + const size_t envrlen = strlen(envr); + const size_t add_dirsep = (envr[envrlen-1] != '/') ? 1 : 0; + retval = allocator.Malloc(envrlen + 1 + add_dirsep); + if (retval) + { + strcpy(retval, envr); + if (add_dirsep) + { + retval[envrlen] = '/'; + retval[envrlen+1] = '\0'; + } /* if */ + } /* if */ + } /* if */ + } /* if */ + + if (retval == NULL) + retval = getUserDirByUID(); + + return retval; +} /* __PHYSFS_platformCalcUserDir */ + + +PHYSFS_EnumerateCallbackResult __PHYSFS_platformEnumerate(const char *dirname, + PHYSFS_EnumerateCallback callback, + const char *origdir, void *callbackdata) +{ + DIR *dir; + struct dirent *ent; + PHYSFS_EnumerateCallbackResult retval = PHYSFS_ENUM_OK; + + dir = opendir(dirname); + BAIL_IF(dir == NULL, errcodeFromErrno(), PHYSFS_ENUM_ERROR); + + while ((retval == PHYSFS_ENUM_OK) && ((ent = readdir(dir)) != NULL)) + { + const char *name = ent->d_name; + if (name[0] == '.') /* ignore "." and ".." */ + { + if ((name[1] == '\0') || ((name[1] == '.') && (name[2] == '\0'))) + continue; + } /* if */ + + retval = callback(callbackdata, origdir, name); + if (retval == PHYSFS_ENUM_ERROR) + PHYSFS_setErrorCode(PHYSFS_ERR_APP_CALLBACK); + } /* while */ + + closedir(dir); + + return retval; +} /* __PHYSFS_platformEnumerate */ + + +int __PHYSFS_platformMkDir(const char *path) +{ + const int rc = mkdir(path, S_IRWXU); + BAIL_IF(rc == -1, errcodeFromErrno(), 0); + return 1; +} /* __PHYSFS_platformMkDir */ + + +static void *doOpen(const char *filename, int mode) +{ + const int appending = (mode & O_APPEND); + int fd; + int *retval; + errno = 0; + + /* O_APPEND doesn't actually behave as we'd like. */ + mode &= ~O_APPEND; + + fd = open(filename, mode, S_IRUSR | S_IWUSR); + BAIL_IF(fd < 0, errcodeFromErrno(), NULL); + + if (appending) + { + if (lseek(fd, 0, SEEK_END) < 0) + { + const int err = errno; + close(fd); + BAIL(errcodeFromErrnoError(err), NULL); + } /* if */ + } /* if */ + + retval = (int *) allocator.Malloc(sizeof (int)); + if (!retval) + { + close(fd); + BAIL(PHYSFS_ERR_OUT_OF_MEMORY, NULL); + } /* if */ + + *retval = fd; + return ((void *) retval); +} /* doOpen */ + + +void *__PHYSFS_platformOpenRead(const char *filename) +{ + return doOpen(filename, O_RDONLY); +} /* __PHYSFS_platformOpenRead */ + + +void *__PHYSFS_platformOpenWrite(const char *filename) +{ + return doOpen(filename, O_WRONLY | O_CREAT | O_TRUNC); +} /* __PHYSFS_platformOpenWrite */ + + +void *__PHYSFS_platformOpenAppend(const char *filename) +{ + return doOpen(filename, O_WRONLY | O_CREAT | O_APPEND); +} /* __PHYSFS_platformOpenAppend */ + + +PHYSFS_sint64 __PHYSFS_platformRead(void *opaque, void *buffer, + PHYSFS_uint64 len) +{ + const int fd = *((int *) opaque); + ssize_t rc = 0; + + if (!__PHYSFS_ui64FitsAddressSpace(len)) + BAIL(PHYSFS_ERR_INVALID_ARGUMENT, -1); + + rc = read(fd, buffer, (size_t) len); + BAIL_IF(rc == -1, errcodeFromErrno(), -1); + assert(rc >= 0); + assert(rc <= len); + return (PHYSFS_sint64) rc; +} /* __PHYSFS_platformRead */ + + +PHYSFS_sint64 __PHYSFS_platformWrite(void *opaque, const void *buffer, + PHYSFS_uint64 len) +{ + const int fd = *((int *) opaque); + ssize_t rc = 0; + + if (!__PHYSFS_ui64FitsAddressSpace(len)) + BAIL(PHYSFS_ERR_INVALID_ARGUMENT, -1); + + rc = write(fd, (void *) buffer, (size_t) len); + BAIL_IF(rc == -1, errcodeFromErrno(), rc); + assert(rc >= 0); + assert(rc <= len); + return (PHYSFS_sint64) rc; +} /* __PHYSFS_platformWrite */ + + +int __PHYSFS_platformSeek(void *opaque, PHYSFS_uint64 pos) +{ + const int fd = *((int *) opaque); + const off_t rc = lseek(fd, (off_t) pos, SEEK_SET); + BAIL_IF(rc == -1, errcodeFromErrno(), 0); + return 1; +} /* __PHYSFS_platformSeek */ + + +PHYSFS_sint64 __PHYSFS_platformTell(void *opaque) +{ + const int fd = *((int *) opaque); + PHYSFS_sint64 retval; + retval = (PHYSFS_sint64) lseek(fd, 0, SEEK_CUR); + BAIL_IF(retval == -1, errcodeFromErrno(), -1); + return retval; +} /* __PHYSFS_platformTell */ + + +PHYSFS_sint64 __PHYSFS_platformFileLength(void *opaque) +{ + const int fd = *((int *) opaque); + struct stat statbuf; + BAIL_IF(fstat(fd, &statbuf) == -1, errcodeFromErrno(), -1); + return ((PHYSFS_sint64) statbuf.st_size); +} /* __PHYSFS_platformFileLength */ + + +int __PHYSFS_platformFlush(void *opaque) +{ + const int fd = *((int *) opaque); + if ((fcntl(fd, F_GETFL) & O_ACCMODE) != O_RDONLY) + BAIL_IF(fsync(fd) == -1, errcodeFromErrno(), 0); + return 1; +} /* __PHYSFS_platformFlush */ + + +void __PHYSFS_platformClose(void *opaque) +{ + const int fd = *((int *) opaque); + (void) close(fd); /* we don't check this. You should have used flush! */ + allocator.Free(opaque); +} /* __PHYSFS_platformClose */ + + +int __PHYSFS_platformDelete(const char *path) +{ + BAIL_IF(remove(path) == -1, errcodeFromErrno(), 0); + return 1; +} /* __PHYSFS_platformDelete */ + + +int __PHYSFS_platformStat(const char *fname, PHYSFS_Stat *st, const int follow) +{ + struct stat statbuf; + const int rc = follow ? stat(fname, &statbuf) : lstat(fname, &statbuf); + BAIL_IF(rc == -1, errcodeFromErrno(), 0); + + if (S_ISREG(statbuf.st_mode)) + { + st->filetype = PHYSFS_FILETYPE_REGULAR; + st->filesize = statbuf.st_size; + } /* if */ + + else if(S_ISDIR(statbuf.st_mode)) + { + st->filetype = PHYSFS_FILETYPE_DIRECTORY; + st->filesize = 0; + } /* else if */ + + else if(S_ISLNK(statbuf.st_mode)) + { + st->filetype = PHYSFS_FILETYPE_SYMLINK; + st->filesize = 0; + } /* else if */ + + else + { + st->filetype = PHYSFS_FILETYPE_OTHER; + st->filesize = statbuf.st_size; + } /* else */ + + st->modtime = statbuf.st_mtime; + st->createtime = statbuf.st_ctime; + st->accesstime = statbuf.st_atime; + + st->readonly = (access(fname, W_OK) == -1); + return 1; +} /* __PHYSFS_platformStat */ + + +typedef struct +{ + pthread_mutex_t mutex; + pthread_t owner; + PHYSFS_uint32 count; +} PthreadMutex; + + +void *__PHYSFS_platformGetThreadID(void) +{ + return ( (void *) ((size_t) pthread_self()) ); +} /* __PHYSFS_platformGetThreadID */ + + +void *__PHYSFS_platformCreateMutex(void) +{ + int rc; + PthreadMutex *m = (PthreadMutex *) allocator.Malloc(sizeof (PthreadMutex)); + BAIL_IF(!m, PHYSFS_ERR_OUT_OF_MEMORY, NULL); + rc = pthread_mutex_init(&m->mutex, NULL); + if (rc != 0) + { + allocator.Free(m); + BAIL(PHYSFS_ERR_OS_ERROR, NULL); + } /* if */ + + m->count = 0; + m->owner = (pthread_t) 0xDEADBEEF; + return ((void *) m); +} /* __PHYSFS_platformCreateMutex */ + + +void __PHYSFS_platformDestroyMutex(void *mutex) +{ + PthreadMutex *m = (PthreadMutex *) mutex; + + /* Destroying a locked mutex is a bug, but we'll try to be helpful. */ + if ((m->owner == pthread_self()) && (m->count > 0)) + pthread_mutex_unlock(&m->mutex); + + pthread_mutex_destroy(&m->mutex); + allocator.Free(m); +} /* __PHYSFS_platformDestroyMutex */ + + +int __PHYSFS_platformGrabMutex(void *mutex) +{ + PthreadMutex *m = (PthreadMutex *) mutex; + pthread_t tid = pthread_self(); + if (m->owner != tid) + { + if (pthread_mutex_lock(&m->mutex) != 0) + return 0; + m->owner = tid; + } /* if */ + + m->count++; + return 1; +} /* __PHYSFS_platformGrabMutex */ + + +void __PHYSFS_platformReleaseMutex(void *mutex) +{ + PthreadMutex *m = (PthreadMutex *) mutex; + assert(m->owner == pthread_self()); /* catch programming errors. */ + assert(m->count > 0); /* catch programming errors. */ + if (m->owner == pthread_self()) + { + if (--m->count == 0) + { + m->owner = (pthread_t) 0xDEADBEEF; + pthread_mutex_unlock(&m->mutex); + } /* if */ + } /* if */ +} /* __PHYSFS_platformReleaseMutex */ + +#endif /* PHYSFS_PLATFORM_POSIX */ + +/* end of physfs_platform_posix.c ... */ + diff --git a/third_party/physfs/physfs_platform_unix.c b/third_party/physfs/physfs_platform_unix.c new file mode 100644 index 00000000..10d93a7e --- /dev/null +++ b/third_party/physfs/physfs_platform_unix.c @@ -0,0 +1,367 @@ +/* + * Unix support routines for PhysicsFS. + * + * Please see the file LICENSE.txt in the source's root directory. + * + * This file written by Ryan C. Gordon. + */ + +#define __PHYSICSFS_INTERNAL__ +#include "physfs_platforms.h" + +#ifdef PHYSFS_PLATFORM_UNIX + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#if PHYSFS_NO_CDROM_SUPPORT +#elif PHYSFS_PLATFORM_LINUX +# define PHYSFS_HAVE_MNTENT_H 1 +#elif defined __CYGWIN__ +# define PHYSFS_HAVE_MNTENT_H 1 +#elif PHYSFS_PLATFORM_SOLARIS +# define PHYSFS_HAVE_SYS_MNTTAB_H 1 +#elif PHYSFS_PLATFORM_BSD +# define PHYSFS_HAVE_SYS_UCRED_H 1 +#else +# warning No CD-ROM support included. Either define your platform here, +# warning or define PHYSFS_NO_CDROM_SUPPORT=1 to confirm this is intentional. +#endif + +#ifdef PHYSFS_HAVE_SYS_UCRED_H +# ifdef PHYSFS_HAVE_MNTENT_H +# undef PHYSFS_HAVE_MNTENT_H /* don't do both... */ +# endif +# include +# include +#endif + +#ifdef PHYSFS_HAVE_MNTENT_H +#include +#endif + +#ifdef PHYSFS_HAVE_SYS_MNTTAB_H +#include +#endif + +#ifdef PHYSFS_PLATFORM_FREEBSD +#include +#endif + + +#include "physfs_internal.h" + +int __PHYSFS_platformInit(void) +{ + return 1; /* always succeed. */ +} /* __PHYSFS_platformInit */ + + +void __PHYSFS_platformDeinit(void) +{ + /* no-op */ +} /* __PHYSFS_platformDeinit */ + + +void __PHYSFS_platformDetectAvailableCDs(PHYSFS_StringCallback cb, void *data) +{ +#if (defined PHYSFS_NO_CDROM_SUPPORT) + /* no-op. */ + +#elif (defined PHYSFS_HAVE_SYS_UCRED_H) + int i; + struct statfs *mntbufp = NULL; + int mounts = getmntinfo(&mntbufp, MNT_NOWAIT); + + for (i = 0; i < mounts; i++) + { + int add_it = 0; + + if (strcmp(mntbufp[i].f_fstypename, "iso9660") == 0) + add_it = 1; + else if (strcmp( mntbufp[i].f_fstypename, "cd9660") == 0) + add_it = 1; + + /* add other mount types here */ + + if (add_it) + cb(data, mntbufp[i].f_mntonname); + } /* for */ + +#elif (defined PHYSFS_HAVE_MNTENT_H) + FILE *mounts = NULL; + struct mntent *ent = NULL; + + mounts = setmntent("/etc/mtab", "r"); + BAIL_IF(mounts == NULL, PHYSFS_ERR_IO, /*return void*/); + + while ( (ent = getmntent(mounts)) != NULL ) + { + int add_it = 0; + if (strcmp(ent->mnt_type, "iso9660") == 0) + add_it = 1; + else if (strcmp(ent->mnt_type, "udf") == 0) + add_it = 1; + + /* !!! FIXME: these might pick up floppy drives, right? */ + else if (strcmp(ent->mnt_type, "auto") == 0) + add_it = 1; + else if (strcmp(ent->mnt_type, "supermount") == 0) + add_it = 1; + + /* add other mount types here */ + + if (add_it) + cb(data, ent->mnt_dir); + } /* while */ + + endmntent(mounts); + +#elif (defined PHYSFS_HAVE_SYS_MNTTAB_H) + FILE *mounts = fopen(MNTTAB, "r"); + struct mnttab ent; + + BAIL_IF(mounts == NULL, PHYSFS_ERR_IO, /*return void*/); + while (getmntent(mounts, &ent) == 0) + { + int add_it = 0; + if (strcmp(ent.mnt_fstype, "hsfs") == 0) + add_it = 1; + + /* add other mount types here */ + + if (add_it) + cb(data, ent.mnt_mountp); + } /* while */ + + fclose(mounts); +#endif +} /* __PHYSFS_platformDetectAvailableCDs */ + + +/* + * See where program (bin) resides in the $PATH specified by (envr). + * returns a copy of the first element in envr that contains it, or NULL + * if it doesn't exist or there were other problems. PHYSFS_SetError() is + * called if we have a problem. + * + * (envr) will be scribbled over, and you are expected to allocator.Free() the + * return value when you're done with it. + */ +static char *findBinaryInPath(const char *bin, char *envr) +{ + size_t alloc_size = 0; + char *exe = NULL; + char *start = envr; + char *ptr; + + assert(bin != NULL); + assert(envr != NULL); + + do + { + size_t size; + size_t binlen; + + ptr = strchr(start, ':'); /* find next $PATH separator. */ + if (ptr) + *ptr = '\0'; + + binlen = strlen(bin); + size = strlen(start) + binlen + 2; + if (size >= alloc_size) + { + char *x = (char *) allocator.Realloc(exe, size); + if (!x) + { + if (exe != NULL) + allocator.Free(exe); + BAIL(PHYSFS_ERR_OUT_OF_MEMORY, NULL); + } /* if */ + + alloc_size = size; + exe = x; + } /* if */ + + /* build full binary path... */ + strcpy(exe, start); + if ((exe[0] == '\0') || (exe[strlen(exe) - 1] != '/')) + strcat(exe, "/"); + strcat(exe, bin); + + if (access(exe, X_OK) == 0) /* Exists as executable? We're done. */ + { + exe[(size - binlen) - 1] = '\0'; /* chop off filename, leave '/' */ + return exe; + } /* if */ + + start = ptr + 1; /* start points to beginning of next element. */ + } while (ptr != NULL); + + if (exe != NULL) + allocator.Free(exe); + + return NULL; /* doesn't exist in path. */ +} /* findBinaryInPath */ + + +static char *readSymLink(const char *path) +{ + ssize_t len = 64; + ssize_t rc = -1; + char *retval = NULL; + + while (1) + { + char *ptr = (char *) allocator.Realloc(retval, (size_t) len); + if (ptr == NULL) + break; /* out of memory. */ + retval = ptr; + + rc = readlink(path, retval, len); + if (rc == -1) + break; /* not a symlink, i/o error, etc. */ + + else if (rc < len) + { + retval[rc] = '\0'; /* readlink doesn't null-terminate. */ + return retval; /* we're good to go. */ + } /* else if */ + + len *= 2; /* grow buffer, try again. */ + } /* while */ + + if (retval != NULL) + allocator.Free(retval); + return NULL; +} /* readSymLink */ + + +char *__PHYSFS_platformCalcBaseDir(const char *argv0) +{ + char *retval = NULL; + const char *envr = NULL; + + /* Try to avoid using argv0 unless forced to. Try system-specific stuff. */ + + #if defined(PHYSFS_PLATFORM_FREEBSD) + { + char fullpath[PATH_MAX]; + size_t buflen = sizeof (fullpath); + int mib[4] = { CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1 }; + if (sysctl(mib, 4, fullpath, &buflen, NULL, 0) != -1) + retval = __PHYSFS_strdup(fullpath); + } + #elif defined(PHYSFS_PLATFORM_SOLARIS) + { + const char *path = getexecname(); + if ((path != NULL) && (path[0] == '/')) /* must be absolute path... */ + retval = __PHYSFS_strdup(path); + } + #endif + + /* If there's a Linux-like /proc filesystem, you can get the full path to + * the current process from a symlink in there. + */ + + if (!retval && (access("/proc", F_OK) == 0)) + { + retval = readSymLink("/proc/self/exe"); + if (!retval) retval = readSymLink("/proc/curproc/file"); + if (!retval) retval = readSymLink("/proc/curproc/exe"); + if (retval == NULL) + { + /* older kernels don't have /proc/self ... try PID version... */ + const unsigned long long pid = (unsigned long long) getpid(); + char path[64]; + const int rc = (int) snprintf(path,sizeof(path),"/proc/%llu/exe",pid); + if ( (rc > 0) && (rc < sizeof(path)) ) + retval = readSymLink(path); + } /* if */ + } /* if */ + + if (retval != NULL) /* chop off filename. */ + { + char *ptr = strrchr(retval, '/'); + if (ptr != NULL) + *(ptr+1) = '\0'; + else /* shouldn't happen, but just in case... */ + { + allocator.Free(retval); + retval = NULL; + } /* else */ + } /* if */ + + /* No /proc/self/exe, etc, but we have an argv[0] we can parse? */ + if ((retval == NULL) && (argv0 != NULL)) + { + /* fast path: default behaviour can handle this. */ + if (strchr(argv0, '/') != NULL) + return NULL; /* higher level parses out real path from argv0. */ + + /* If there's no dirsep on argv0, then look through $PATH for it. */ + envr = getenv("PATH"); + if (envr != NULL) + { + char *path = (char *) __PHYSFS_smallAlloc(strlen(envr) + 1); + BAIL_IF(!path, PHYSFS_ERR_OUT_OF_MEMORY, NULL); + strcpy(path, envr); + retval = findBinaryInPath(argv0, path); + __PHYSFS_smallFree(path); + } /* if */ + } /* if */ + + if (retval != NULL) + { + /* try to shrink buffer... */ + char *ptr = (char *) allocator.Realloc(retval, strlen(retval) + 1); + if (ptr != NULL) + retval = ptr; /* oh well if it failed. */ + } /* if */ + + return retval; +} /* __PHYSFS_platformCalcBaseDir */ + + +char *__PHYSFS_platformCalcPrefDir(const char *org, const char *app) +{ + /* + * We use XDG's base directory spec, even if you're not on Linux. + * This isn't strictly correct, but the results are relatively sane + * in any case. + * + * https://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html + */ + const char *envr = getenv("XDG_DATA_HOME"); + const char *append = "/"; + char *retval = NULL; + size_t len = 0; + + if (!envr) + { + /* You end up with "$HOME/.local/share/Game Name 2" */ + envr = __PHYSFS_getUserDir(); + BAIL_IF_ERRPASS(!envr, NULL); /* oh well. */ + append = ".local/share/"; + } /* if */ + + len = strlen(envr) + strlen(append) + strlen(app) + 2; + retval = (char *) allocator.Malloc(len); + BAIL_IF(!retval, PHYSFS_ERR_OUT_OF_MEMORY, NULL); + snprintf(retval, len, "%s%s%s/", envr, append, app); + return retval; +} /* __PHYSFS_platformCalcPrefDir */ + +#endif /* PHYSFS_PLATFORM_UNIX */ + +/* end of physfs_platform_unix.c ... */ + diff --git a/third_party/physfs/physfs_platform_windows.c b/third_party/physfs/physfs_platform_windows.c new file mode 100644 index 00000000..c92e98d0 --- /dev/null +++ b/third_party/physfs/physfs_platform_windows.c @@ -0,0 +1,1028 @@ +/* + * Windows support routines for PhysicsFS. + * + * Please see the file LICENSE.txt in the source's root directory. + * + * This file written by Ryan C. Gordon, and made sane by Gregory S. Read. + */ + +#define __PHYSICSFS_INTERNAL__ +#include "physfs_platforms.h" + +#ifdef PHYSFS_PLATFORM_WINDOWS + +/* Forcibly disable UNICODE macro, since we manage this ourselves. */ +#ifdef UNICODE +#undef UNICODE +#endif + +#if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_WARNINGS) +#define _CRT_SECURE_NO_WARNINGS 1 +#endif + +#define WIN32_LEAN_AND_MEAN 1 +#include + +#ifndef PHYSFS_PLATFORM_WINRT +#include +#include +#endif + +#if !defined(PHYSFS_NO_CDROM_SUPPORT) +#include +#endif + +#include +#include +#include + +#ifdef allocator /* apparently Windows 10 SDK conflicts here. */ +#undef allocator +#endif + +#include "physfs_internal.h" + +/* + * Users without the platform SDK don't have this defined. The original docs + * for SetFilePointer() just said to compare with 0xFFFFFFFF, so this should + * work as desired. + */ +#define PHYSFS_INVALID_SET_FILE_POINTER 0xFFFFFFFF + +/* just in case... */ +#define PHYSFS_INVALID_FILE_ATTRIBUTES 0xFFFFFFFF + +/* Not defined before the Vista SDK. */ +#define PHYSFS_FILE_ATTRIBUTE_REPARSE_POINT 0x400 +#define PHYSFS_IO_REPARSE_TAG_SYMLINK 0xA000000C + + +#define UTF8_TO_UNICODE_STACK(w_assignto, str) { \ + if (str == NULL) \ + w_assignto = NULL; \ + else { \ + const size_t len = (PHYSFS_uint64) ((strlen(str) + 1) * 2); \ + w_assignto = (WCHAR *) __PHYSFS_smallAlloc(len); \ + if (w_assignto != NULL) \ + PHYSFS_utf8ToUtf16(str, (PHYSFS_uint16 *) w_assignto, len); \ + } \ +} \ + +/* Note this counts WCHARs, not codepoints! */ +static PHYSFS_uint64 wStrLen(const WCHAR *wstr) +{ + PHYSFS_uint64 len = 0; + while (*(wstr++)) + len++; + return len; +} /* wStrLen */ + +static char *unicodeToUtf8Heap(const WCHAR *w_str) +{ + char *retval = NULL; + if (w_str != NULL) + { + void *ptr = NULL; + const PHYSFS_uint64 len = (wStrLen(w_str) * 4) + 1; + retval = allocator.Malloc(len); + BAIL_IF(!retval, PHYSFS_ERR_OUT_OF_MEMORY, NULL); + PHYSFS_utf8FromUtf16((const PHYSFS_uint16 *) w_str, retval, len); + ptr = allocator.Realloc(retval, strlen(retval) + 1); /* shrink. */ + if (ptr != NULL) + retval = (char *) ptr; + } /* if */ + return retval; +} /* unicodeToUtf8Heap */ + + +/* Some older APIs aren't in WinRT (only the "Ex" version, etc). + Since non-WinRT might not have the "Ex" version, we tapdance to use + the perfectly-fine-and-available-even-on-Win95 API on non-WinRT targets. */ + +static inline HANDLE winFindFirstFileW(const WCHAR *path, LPWIN32_FIND_DATAW d) +{ + #ifdef PHYSFS_PLATFORM_WINRT + return FindFirstFileExW(path, FindExInfoStandard, d, + FindExSearchNameMatch, NULL, 0); + #else + return FindFirstFileW(path, d); + #endif +} /* winFindFirstFileW */ + +static inline BOOL winInitializeCriticalSection(LPCRITICAL_SECTION lpcs) +{ + #ifdef PHYSFS_PLATFORM_WINRT + return InitializeCriticalSectionEx(lpcs, 2000, 0); + #else + InitializeCriticalSection(lpcs); + return TRUE; + #endif +} /* winInitializeCriticalSection */ + +static inline HANDLE winCreateFileW(const WCHAR *wfname, const DWORD mode, + const DWORD creation) +{ + const DWORD share = FILE_SHARE_READ | FILE_SHARE_WRITE; + #ifdef PHYSFS_PLATFORM_WINRT + return CreateFile2(wfname, mode, share, creation, NULL); + #else + return CreateFileW(wfname, mode, share, NULL, creation, + FILE_ATTRIBUTE_NORMAL, NULL); + #endif +} /* winCreateFileW */ + +static BOOL winSetFilePointer(HANDLE h, const PHYSFS_sint64 pos, + PHYSFS_sint64 *_newpos, const DWORD whence) +{ + #ifdef PHYSFS_PLATFORM_WINRT + LARGE_INTEGER lipos; + LARGE_INTEGER linewpos; + BOOL rc; + lipos.QuadPart = (LONGLONG) pos; + rc = SetFilePointerEx(h, lipos, &linewpos, whence); + if (_newpos) + *_newpos = (PHYSFS_sint64) linewpos.QuadPart; + return rc; + #else + const LONG low = (LONG) (pos & 0xFFFFFFFF); + LONG high = (LONG) ((pos >> 32) & 0xFFFFFFFF); + const DWORD rc = SetFilePointer(h, low, &high, whence); + /* 0xFFFFFFFF could be valid, so you have to check GetLastError too! */ + if (_newpos) + *_newpos = ((PHYSFS_sint64) rc) | (((PHYSFS_sint64) high) << 32); + if ((rc == PHYSFS_INVALID_SET_FILE_POINTER) && (GetLastError() != NO_ERROR)) + return FALSE; + return TRUE; + #endif +} /* winSetFilePointer */ + +static PHYSFS_sint64 winGetFileSize(HANDLE h) +{ + #ifdef PHYSFS_PLATFORM_WINRT + FILE_STANDARD_INFO info; + const BOOL rc = GetFileInformationByHandleEx(h, FileStandardInfo, + &info, sizeof (info)); + return rc ? (PHYSFS_sint64) info.EndOfFile.QuadPart : -1; + #else + DWORD high = 0; + const DWORD rc = GetFileSize(h, &high); + if ((rc == PHYSFS_INVALID_SET_FILE_POINTER) && (GetLastError() != NO_ERROR)) + return -1; + return (PHYSFS_sint64) ((((PHYSFS_uint64) high) << 32) | rc); + #endif +} /* winGetFileSize */ + + +static PHYSFS_ErrorCode errcodeFromWinApiError(const DWORD err) +{ + /* + * win32 error codes are sort of a tricky thing; Microsoft intentionally + * doesn't list which ones a given API might trigger, there are several + * with overlapping and unclear meanings...and there's 16 thousand of + * them in Windows 7. It looks like the ones we care about are in the + * first 500, but I can't say this list is perfect; we might miss + * important values or misinterpret others. + * + * Don't treat this list as anything other than a work in progress. + */ + switch (err) + { + case ERROR_SUCCESS: return PHYSFS_ERR_OK; + case ERROR_ACCESS_DENIED: return PHYSFS_ERR_PERMISSION; + case ERROR_NETWORK_ACCESS_DENIED: return PHYSFS_ERR_PERMISSION; + case ERROR_NOT_READY: return PHYSFS_ERR_IO; + case ERROR_CRC: return PHYSFS_ERR_IO; + case ERROR_SEEK: return PHYSFS_ERR_IO; + case ERROR_SECTOR_NOT_FOUND: return PHYSFS_ERR_IO; + case ERROR_NOT_DOS_DISK: return PHYSFS_ERR_IO; + case ERROR_WRITE_FAULT: return PHYSFS_ERR_IO; + case ERROR_READ_FAULT: return PHYSFS_ERR_IO; + case ERROR_DEV_NOT_EXIST: return PHYSFS_ERR_IO; + case ERROR_BUFFER_OVERFLOW: return PHYSFS_ERR_BAD_FILENAME; + case ERROR_INVALID_NAME: return PHYSFS_ERR_BAD_FILENAME; + case ERROR_BAD_PATHNAME: return PHYSFS_ERR_BAD_FILENAME; + case ERROR_DIRECTORY: return PHYSFS_ERR_BAD_FILENAME; + case ERROR_FILE_NOT_FOUND: return PHYSFS_ERR_NOT_FOUND; + case ERROR_PATH_NOT_FOUND: return PHYSFS_ERR_NOT_FOUND; + case ERROR_DELETE_PENDING: return PHYSFS_ERR_NOT_FOUND; + case ERROR_INVALID_DRIVE: return PHYSFS_ERR_NOT_FOUND; + case ERROR_HANDLE_DISK_FULL: return PHYSFS_ERR_NO_SPACE; + case ERROR_DISK_FULL: return PHYSFS_ERR_NO_SPACE; + case ERROR_WRITE_PROTECT: return PHYSFS_ERR_READ_ONLY; + case ERROR_LOCK_VIOLATION: return PHYSFS_ERR_BUSY; + case ERROR_SHARING_VIOLATION: return PHYSFS_ERR_BUSY; + case ERROR_CURRENT_DIRECTORY: return PHYSFS_ERR_BUSY; + case ERROR_DRIVE_LOCKED: return PHYSFS_ERR_BUSY; + case ERROR_PATH_BUSY: return PHYSFS_ERR_BUSY; + case ERROR_BUSY: return PHYSFS_ERR_BUSY; + case ERROR_NOT_ENOUGH_MEMORY: return PHYSFS_ERR_OUT_OF_MEMORY; + case ERROR_OUTOFMEMORY: return PHYSFS_ERR_OUT_OF_MEMORY; + case ERROR_DIR_NOT_EMPTY: return PHYSFS_ERR_DIR_NOT_EMPTY; + default: return PHYSFS_ERR_OS_ERROR; + } /* switch */ +} /* errcodeFromWinApiError */ + +static inline PHYSFS_ErrorCode errcodeFromWinApi(void) +{ + return errcodeFromWinApiError(GetLastError()); +} /* errcodeFromWinApi */ + + +#if defined(PHYSFS_NO_CDROM_SUPPORT) +#define detectAvailableCDs(cb, data) +#define deinitCDThread() +#else +static HANDLE detectCDThreadHandle = NULL; +static HWND detectCDHwnd = NULL; +static volatile DWORD drivesWithMediaBitmap = 0; + +typedef BOOL (WINAPI *fnSTEM)(DWORD, LPDWORD b); + +static DWORD pollDiscDrives(void) +{ + /* Try to use SetThreadErrorMode(), which showed up in Windows 7. */ + HANDLE lib = LoadLibraryA("kernel32.dll"); + fnSTEM stem = NULL; + char drive[4] = { 'x', ':', '\\', '\0' }; + DWORD oldErrorMode = 0; + DWORD drives = 0; + DWORD i; + + if (lib) + stem = (fnSTEM) GetProcAddress(lib, "SetThreadErrorMode"); + + if (stem) + stem(SEM_FAILCRITICALERRORS, &oldErrorMode); + else + oldErrorMode = SetErrorMode(SEM_FAILCRITICALERRORS); + + /* Do detection. This may block if a disc is spinning up. */ + for (i = 'A'; i <= 'Z'; i++) + { + DWORD tmp = 0; + drive[0] = (char) i; + if (GetDriveTypeA(drive) != DRIVE_CDROM) + continue; + + /* If this function succeeds, there's media in the drive */ + if (GetVolumeInformationA(drive, NULL, 0, NULL, NULL, &tmp, NULL, 0)) + drives |= (1 << (i - 'A')); + } /* for */ + + if (stem) + stem(oldErrorMode, NULL); + else + SetErrorMode(oldErrorMode); + + if (lib) + FreeLibrary(lib); + + return drives; +} /* pollDiscDrives */ + + +static LRESULT CALLBACK detectCDWndProc(HWND hwnd, UINT msg, + WPARAM wp, LPARAM lparam) +{ + PDEV_BROADCAST_HDR lpdb = (PDEV_BROADCAST_HDR) lparam; + PDEV_BROADCAST_VOLUME lpdbv = (PDEV_BROADCAST_VOLUME) lparam; + const int removed = (wp == DBT_DEVICEREMOVECOMPLETE); + + if (msg == WM_DESTROY) + return 0; + else if ((msg != WM_DEVICECHANGE) || + ((wp != DBT_DEVICEARRIVAL) && (wp != DBT_DEVICEREMOVECOMPLETE)) || + (lpdb->dbch_devicetype != DBT_DEVTYP_VOLUME) || + ((lpdbv->dbcv_flags & DBTF_MEDIA) == 0)) + { + return DefWindowProcW(hwnd, msg, wp, lparam); + } /* else if */ + + if (removed) + drivesWithMediaBitmap &= ~lpdbv->dbcv_unitmask; + else + drivesWithMediaBitmap |= lpdbv->dbcv_unitmask; + + return TRUE; +} /* detectCDWndProc */ + + +static DWORD WINAPI detectCDThread(LPVOID arg) +{ + HANDLE initialDiscDetectionComplete = *((HANDLE *) arg); + const char *classname = "PhysicsFSDetectCDCatcher"; + const char *winname = "PhysicsFSDetectCDMsgWindow"; + HINSTANCE hInstance = GetModuleHandleW(NULL); + ATOM class_atom = 0; + WNDCLASSEXA wce; + MSG msg; + + memset(&wce, '\0', sizeof (wce)); + wce.cbSize = sizeof (wce); + wce.lpfnWndProc = detectCDWndProc; + wce.lpszClassName = classname; + wce.hInstance = hInstance; + class_atom = RegisterClassExA(&wce); + if (class_atom == 0) + { + SetEvent(initialDiscDetectionComplete); /* let main thread go on. */ + return 0; + } /* if */ + + detectCDHwnd = CreateWindowExA(0, classname, winname, WS_OVERLAPPEDWINDOW, + CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, + CW_USEDEFAULT, HWND_DESKTOP, NULL, hInstance, NULL); + + if (detectCDHwnd == NULL) + { + SetEvent(initialDiscDetectionComplete); /* let main thread go on. */ + UnregisterClassA(classname, hInstance); + return 0; + } /* if */ + + /* We'll get events when discs come and go from now on. */ + + /* Do initial detection, possibly blocking awhile... */ + drivesWithMediaBitmap = pollDiscDrives(); + + SetEvent(initialDiscDetectionComplete); /* let main thread go on. */ + + do + { + const BOOL rc = GetMessageW(&msg, detectCDHwnd, 0, 0); + if ((rc == 0) || (rc == -1)) + break; /* don't care if WM_QUIT or error break this loop. */ + TranslateMessage(&msg); + DispatchMessageW(&msg); + } while (1); + + /* we've been asked to quit. */ + DestroyWindow(detectCDHwnd); + UnregisterClassA(classname, hInstance); + return 0; +} /* detectCDThread */ + +static void detectAvailableCDs(PHYSFS_StringCallback cb, void *data) +{ + char drive_str[4] = { 'x', ':', '\\', '\0' }; + DWORD drives = 0; + DWORD i; + + /* + * If you poll a drive while a user is inserting a disc, the OS will + * block this thread until the drive has spun up. So we swallow the risk + * once for initial detection, and spin a thread that will get device + * events thereafter, for apps that use this interface to poll for + * disc insertion. + */ + if (!detectCDThreadHandle) + { + HANDLE initialDetectDone = CreateEvent(NULL, TRUE, FALSE, NULL); + if (!initialDetectDone) + return; /* oh well. */ + + detectCDThreadHandle = CreateThread(NULL, 0, detectCDThread, + &initialDetectDone, 0, NULL); + if (detectCDThreadHandle) + WaitForSingleObject(initialDetectDone, INFINITE); + CloseHandle(initialDetectDone); + + if (!detectCDThreadHandle) + return; /* oh well. */ + } /* if */ + + drives = drivesWithMediaBitmap; /* whatever the thread has seen, we take. */ + for (i = 'A'; i <= 'Z'; i++) + { + if (drives & (1 << (i - 'A'))) + { + drive_str[0] = (char) i; + cb(data, drive_str); + } /* if */ + } /* for */ +} /* detectAvailableCDs */ + +static void deinitCDThread(void) +{ + if (detectCDThreadHandle) + { + if (detectCDHwnd) + PostMessageW(detectCDHwnd, WM_QUIT, 0, 0); + CloseHandle(detectCDThreadHandle); + detectCDThreadHandle = NULL; + drivesWithMediaBitmap = 0; + } /* if */ +} /* deinitCDThread */ +#endif + + +void __PHYSFS_platformDetectAvailableCDs(PHYSFS_StringCallback cb, void *data) +{ + detectAvailableCDs(cb, data); +} /* __PHYSFS_platformDetectAvailableCDs */ + +#ifdef PHYSFS_PLATFORM_WINRT +static char *calcDirAppendSep(const WCHAR *wdir) +{ + size_t len; + void *ptr; + char *retval; + BAIL_IF(!wdir, errcodeFromWinApi(), NULL); + retval = unicodeToUtf8Heap(wdir); + BAIL_IF_ERRPASS(!retval, NULL); + len = strlen(retval); + ptr = allocator.Realloc(retval, len + 2); + if (!ptr) + { + allocator.Free(retval); + BAIL(PHYSFS_ERR_OUT_OF_MEMORY, NULL); + } /* if */ + retval = (char *) ptr; + retval[len] = '\\'; + retval[len+1] = '\0'; + return retval; +} /* calcDirAppendSep */ +#endif + +char *__PHYSFS_platformCalcBaseDir(const char *argv0) +{ +#ifdef PHYSFS_PLATFORM_WINRT + return calcDirAppendSep((const WCHAR *) __PHYSFS_winrtCalcBaseDir()); +#else + char *retval = NULL; + DWORD buflen = 64; + LPWSTR modpath = NULL; + + while (1) + { + DWORD rc; + void *ptr; + + if ( (ptr = allocator.Realloc(modpath, buflen*sizeof(WCHAR))) == NULL ) + { + allocator.Free(modpath); + BAIL(PHYSFS_ERR_OUT_OF_MEMORY, NULL); + } /* if */ + modpath = (LPWSTR) ptr; + + rc = GetModuleFileNameW(NULL, modpath, buflen); + if (rc == 0) + { + allocator.Free(modpath); + BAIL(errcodeFromWinApi(), NULL); + } /* if */ + + if (rc < buflen) + { + buflen = rc; + break; + } /* if */ + + buflen *= 2; + } /* while */ + + if (buflen > 0) /* just in case... */ + { + WCHAR *ptr = (modpath + buflen) - 1; + while (ptr != modpath) + { + if (*ptr == '\\') + break; + ptr--; + } /* while */ + + if ((ptr == modpath) && (*ptr != '\\')) + PHYSFS_setErrorCode(PHYSFS_ERR_OTHER_ERROR); /* oh well. */ + else + { + *(ptr+1) = '\0'; /* chop off filename. */ + retval = unicodeToUtf8Heap(modpath); + } /* else */ + } /* else */ + allocator.Free(modpath); + + return retval; /* w00t. */ +#endif +} /* __PHYSFS_platformCalcBaseDir */ + + +char *__PHYSFS_platformCalcPrefDir(const char *org, const char *app) +{ +#ifdef PHYSFS_PLATFORM_WINRT + return calcDirAppendSep((const WCHAR *) __PHYSFS_winrtCalcPrefDir()); +#else + /* + * Vista and later has a new API for this, but SHGetFolderPath works there, + * and apparently just wraps the new API. This is the new way to do it: + * + * SHGetKnownFolderPath(FOLDERID_RoamingAppData, KF_FLAG_CREATE, + * NULL, &wszPath); + */ + + WCHAR path[MAX_PATH]; + char *utf8 = NULL; + size_t len = 0; + char *retval = NULL; + + if (!SUCCEEDED(SHGetFolderPathW(NULL, CSIDL_APPDATA | CSIDL_FLAG_CREATE, + NULL, 0, path))) + BAIL(PHYSFS_ERR_OS_ERROR, NULL); + + utf8 = unicodeToUtf8Heap(path); + BAIL_IF_ERRPASS(!utf8, NULL); + len = strlen(utf8) + strlen(org) + strlen(app) + 4; + retval = allocator.Malloc(len); + if (!retval) + { + allocator.Free(utf8); + BAIL(PHYSFS_ERR_OUT_OF_MEMORY, NULL); + } /* if */ + + snprintf(retval, len, "%s\\%s\\%s\\", utf8, org, app); + allocator.Free(utf8); + return retval; +#endif +} /* __PHYSFS_platformCalcPrefDir */ + + +char *__PHYSFS_platformCalcUserDir(void) +{ +#ifdef PHYSFS_PLATFORM_WINRT + return calcDirAppendSep((const WCHAR *) __PHYSFS_winrtCalcPrefDir()); +#else + typedef BOOL (WINAPI *fnGetUserProfDirW)(HANDLE, LPWSTR, LPDWORD); + fnGetUserProfDirW pGetDir = NULL; + HANDLE lib = NULL; + HANDLE accessToken = NULL; /* Security handle to process */ + char *retval = NULL; + + lib = LoadLibraryA("userenv.dll"); + BAIL_IF(!lib, errcodeFromWinApi(), NULL); + pGetDir=(fnGetUserProfDirW) GetProcAddress(lib,"GetUserProfileDirectoryW"); + GOTO_IF(!pGetDir, errcodeFromWinApi(), done); + + if (!OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &accessToken)) + GOTO(errcodeFromWinApi(), done); + else + { + DWORD psize = 0; + LPWSTR wstr = NULL; + BOOL rc = 0; + + /* + * Should fail. Will write the size of the profile path in + * psize. Also note that the second parameter can't be + * NULL or the function fails on Windows XP, but has to be NULL on + * Windows 10 or it will fail. :( + */ + rc = pGetDir(accessToken, NULL, &psize); + GOTO_IF(rc, PHYSFS_ERR_OS_ERROR, done); /* should have failed! */ + + if (psize == 0) /* probably on Windows XP, try a different way. */ + { + WCHAR x = 0; + rc = pGetDir(accessToken, &x, &psize); + GOTO_IF(rc, PHYSFS_ERR_OS_ERROR, done); /* should have failed! */ + GOTO_IF(!psize, PHYSFS_ERR_OS_ERROR, done); /* Uhoh... */ + } /* if */ + + /* Allocate memory for the profile directory */ + wstr = (LPWSTR) __PHYSFS_smallAlloc((psize + 1) * sizeof (WCHAR)); + if (wstr != NULL) + { + if (pGetDir(accessToken, wstr, &psize)) + { + /* Make sure it ends in a dirsep. We allocated +1 for this. */ + if (wstr[psize - 2] != '\\') + { + wstr[psize - 1] = '\\'; + wstr[psize - 0] = '\0'; + } /* if */ + retval = unicodeToUtf8Heap(wstr); + } /* if */ + __PHYSFS_smallFree(wstr); + } /* if */ + } /* if */ + +done: + if (accessToken) + CloseHandle(accessToken); + FreeLibrary(lib); + return retval; /* We made it: hit the showers. */ +#endif +} /* __PHYSFS_platformCalcUserDir */ + + +int __PHYSFS_platformInit(void) +{ + return 1; /* It's all good */ +} /* __PHYSFS_platformInit */ + + +void __PHYSFS_platformDeinit(void) +{ + deinitCDThread(); +} /* __PHYSFS_platformDeinit */ + + +void *__PHYSFS_platformGetThreadID(void) +{ + return ( (void *) ((size_t) GetCurrentThreadId()) ); +} /* __PHYSFS_platformGetThreadID */ + + +PHYSFS_EnumerateCallbackResult __PHYSFS_platformEnumerate(const char *dirname, + PHYSFS_EnumerateCallback callback, + const char *origdir, void *callbackdata) +{ + PHYSFS_EnumerateCallbackResult retval = PHYSFS_ENUM_OK; + HANDLE dir = INVALID_HANDLE_VALUE; + WIN32_FIND_DATAW entw; + size_t len = strlen(dirname); + char *searchPath = NULL; + WCHAR *wSearchPath = NULL; + + /* Allocate a new string for path, maybe '\\', "*", and NULL terminator */ + searchPath = (char *) __PHYSFS_smallAlloc(len + 3); + BAIL_IF(!searchPath, PHYSFS_ERR_OUT_OF_MEMORY, PHYSFS_ENUM_ERROR); + + /* Copy current dirname */ + strcpy(searchPath, dirname); + + /* if there's no '\\' at the end of the path, stick one in there. */ + if (searchPath[len - 1] != '\\') + { + searchPath[len++] = '\\'; + searchPath[len] = '\0'; + } /* if */ + + /* Append the "*" to the end of the string */ + strcat(searchPath, "*"); + + UTF8_TO_UNICODE_STACK(wSearchPath, searchPath); + __PHYSFS_smallFree(searchPath); + BAIL_IF_ERRPASS(!wSearchPath, PHYSFS_ENUM_ERROR); + + dir = winFindFirstFileW(wSearchPath, &entw); + __PHYSFS_smallFree(wSearchPath); + BAIL_IF(dir==INVALID_HANDLE_VALUE, errcodeFromWinApi(), PHYSFS_ENUM_ERROR); + + do + { + const WCHAR *fn = entw.cFileName; + char *utf8; + + if (fn[0] == '.') /* ignore "." and ".." */ + { + if ((fn[1] == '\0') || ((fn[1] == '.') && (fn[2] == '\0'))) + continue; + } /* if */ + + utf8 = unicodeToUtf8Heap(fn); + if (utf8 == NULL) + retval = -1; + else + { + retval = callback(callbackdata, origdir, utf8); + allocator.Free(utf8); + if (retval == PHYSFS_ENUM_ERROR) + PHYSFS_setErrorCode(PHYSFS_ERR_APP_CALLBACK); + } /* else */ + } while ((retval == PHYSFS_ENUM_OK) && (FindNextFileW(dir, &entw) != 0)); + + FindClose(dir); + + return retval; +} /* __PHYSFS_platformEnumerate */ + + +int __PHYSFS_platformMkDir(const char *path) +{ + WCHAR *wpath; + DWORD rc; + UTF8_TO_UNICODE_STACK(wpath, path); + rc = CreateDirectoryW(wpath, NULL); + __PHYSFS_smallFree(wpath); + BAIL_IF(rc == 0, errcodeFromWinApi(), 0); + return 1; +} /* __PHYSFS_platformMkDir */ + + +static HANDLE doOpen(const char *fname, DWORD mode, DWORD creation) +{ + HANDLE fileh; + WCHAR *wfname; + + UTF8_TO_UNICODE_STACK(wfname, fname); + BAIL_IF(!wfname, PHYSFS_ERR_OUT_OF_MEMORY, NULL); + + fileh = winCreateFileW(wfname, mode, creation); + __PHYSFS_smallFree(wfname); + + if (fileh == INVALID_HANDLE_VALUE) + BAIL(errcodeFromWinApi(), INVALID_HANDLE_VALUE); + + return fileh; +} /* doOpen */ + + +void *__PHYSFS_platformOpenRead(const char *filename) +{ + HANDLE h = doOpen(filename, GENERIC_READ, OPEN_EXISTING); + return (h == INVALID_HANDLE_VALUE) ? NULL : (void *) h; +} /* __PHYSFS_platformOpenRead */ + + +void *__PHYSFS_platformOpenWrite(const char *filename) +{ + HANDLE h = doOpen(filename, GENERIC_WRITE, CREATE_ALWAYS); + return (h == INVALID_HANDLE_VALUE) ? NULL : (void *) h; +} /* __PHYSFS_platformOpenWrite */ + + +void *__PHYSFS_platformOpenAppend(const char *filename) +{ + HANDLE h = doOpen(filename, GENERIC_WRITE, OPEN_ALWAYS); + BAIL_IF_ERRPASS(h == INVALID_HANDLE_VALUE, NULL); + + if (!winSetFilePointer(h, 0, NULL, FILE_END)) + { + const PHYSFS_ErrorCode err = errcodeFromWinApi(); + CloseHandle(h); + BAIL(err, NULL); + } /* if */ + + return (void *) h; +} /* __PHYSFS_platformOpenAppend */ + + +PHYSFS_sint64 __PHYSFS_platformRead(void *opaque, void *buf, PHYSFS_uint64 len) +{ + HANDLE h = (HANDLE) opaque; + PHYSFS_sint64 totalRead = 0; + + if (!__PHYSFS_ui64FitsAddressSpace(len)) + BAIL(PHYSFS_ERR_INVALID_ARGUMENT, -1); + + while (len > 0) + { + const DWORD thislen = (len > 0xFFFFFFFF) ? 0xFFFFFFFF : (DWORD) len; + DWORD numRead = 0; + if (!ReadFile(h, buf, thislen, &numRead, NULL)) + BAIL(errcodeFromWinApi(), -1); + len -= (PHYSFS_uint64) numRead; + totalRead += (PHYSFS_sint64) numRead; + if (numRead != thislen) + break; + } /* while */ + + return totalRead; +} /* __PHYSFS_platformRead */ + + +PHYSFS_sint64 __PHYSFS_platformWrite(void *opaque, const void *buffer, + PHYSFS_uint64 len) +{ + HANDLE h = (HANDLE) opaque; + PHYSFS_sint64 totalWritten = 0; + + if (!__PHYSFS_ui64FitsAddressSpace(len)) + BAIL(PHYSFS_ERR_INVALID_ARGUMENT, -1); + + while (len > 0) + { + const DWORD thislen = (len > 0xFFFFFFFF) ? 0xFFFFFFFF : (DWORD) len; + DWORD numWritten = 0; + if (!WriteFile(h, buffer, thislen, &numWritten, NULL)) + BAIL(errcodeFromWinApi(), -1); + len -= (PHYSFS_uint64) numWritten; + totalWritten += (PHYSFS_sint64) numWritten; + if (numWritten != thislen) + break; + } /* while */ + + return totalWritten; +} /* __PHYSFS_platformWrite */ + + +int __PHYSFS_platformSeek(void *opaque, PHYSFS_uint64 pos) +{ + HANDLE h = (HANDLE) opaque; + const PHYSFS_sint64 spos = (PHYSFS_sint64) pos; + BAIL_IF(!winSetFilePointer(h,spos,NULL,FILE_BEGIN), errcodeFromWinApi(), 0); + return 1; /* No error occured */ +} /* __PHYSFS_platformSeek */ + + +PHYSFS_sint64 __PHYSFS_platformTell(void *opaque) +{ + HANDLE h = (HANDLE) opaque; + PHYSFS_sint64 pos = 0; + BAIL_IF(!winSetFilePointer(h,0,&pos,FILE_CURRENT), errcodeFromWinApi(), -1); + return pos; +} /* __PHYSFS_platformTell */ + + +PHYSFS_sint64 __PHYSFS_platformFileLength(void *opaque) +{ + HANDLE h = (HANDLE) opaque; + const PHYSFS_sint64 retval = winGetFileSize(h); + BAIL_IF(retval < 0, errcodeFromWinApi(), -1); + return retval; +} /* __PHYSFS_platformFileLength */ + + +int __PHYSFS_platformFlush(void *opaque) +{ + HANDLE h = (HANDLE) opaque; + BAIL_IF(!FlushFileBuffers(h), errcodeFromWinApi(), 0); + return 1; +} /* __PHYSFS_platformFlush */ + + +void __PHYSFS_platformClose(void *opaque) +{ + HANDLE h = (HANDLE) opaque; + (void) CloseHandle(h); /* ignore errors. You should have flushed! */ +} /* __PHYSFS_platformClose */ + + +static int doPlatformDelete(LPWSTR wpath) +{ + WIN32_FILE_ATTRIBUTE_DATA info; + if (!GetFileAttributesExW(wpath, GetFileExInfoStandard, &info)) + BAIL(errcodeFromWinApi(), 0); + else + { + const int isdir = (info.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY); + const BOOL rc = isdir ? RemoveDirectoryW(wpath) : DeleteFileW(wpath); + BAIL_IF(!rc, errcodeFromWinApi(), 0); + } /* else */ + return 1; /* if you made it here, it worked. */ +} /* doPlatformDelete */ + + +int __PHYSFS_platformDelete(const char *path) +{ + int retval = 0; + LPWSTR wpath = NULL; + UTF8_TO_UNICODE_STACK(wpath, path); + BAIL_IF(!wpath, PHYSFS_ERR_OUT_OF_MEMORY, 0); + retval = doPlatformDelete(wpath); + __PHYSFS_smallFree(wpath); + return retval; +} /* __PHYSFS_platformDelete */ + + +void *__PHYSFS_platformCreateMutex(void) +{ + LPCRITICAL_SECTION lpcs; + lpcs = (LPCRITICAL_SECTION) allocator.Malloc(sizeof (CRITICAL_SECTION)); + BAIL_IF(!lpcs, PHYSFS_ERR_OUT_OF_MEMORY, NULL); + + if (!winInitializeCriticalSection(lpcs)) + { + allocator.Free(lpcs); + BAIL(errcodeFromWinApi(), NULL); + } /* if */ + + return lpcs; +} /* __PHYSFS_platformCreateMutex */ + + +void __PHYSFS_platformDestroyMutex(void *mutex) +{ + DeleteCriticalSection((LPCRITICAL_SECTION) mutex); + allocator.Free(mutex); +} /* __PHYSFS_platformDestroyMutex */ + + +int __PHYSFS_platformGrabMutex(void *mutex) +{ + EnterCriticalSection((LPCRITICAL_SECTION) mutex); + return 1; +} /* __PHYSFS_platformGrabMutex */ + + +void __PHYSFS_platformReleaseMutex(void *mutex) +{ + LeaveCriticalSection((LPCRITICAL_SECTION) mutex); +} /* __PHYSFS_platformReleaseMutex */ + + +static PHYSFS_sint64 FileTimeToPhysfsTime(const FILETIME *ft) +{ + SYSTEMTIME st_utc; + SYSTEMTIME st_localtz; + TIME_ZONE_INFORMATION tzi; + DWORD tzid; + PHYSFS_sint64 retval; + struct tm tm; + BOOL rc; + + BAIL_IF(!FileTimeToSystemTime(ft, &st_utc), errcodeFromWinApi(), -1); + tzid = GetTimeZoneInformation(&tzi); + BAIL_IF(tzid == TIME_ZONE_ID_INVALID, errcodeFromWinApi(), -1); + rc = SystemTimeToTzSpecificLocalTime(&tzi, &st_utc, &st_localtz); + BAIL_IF(!rc, errcodeFromWinApi(), -1); + + /* Convert to a format that mktime() can grok... */ + tm.tm_sec = st_localtz.wSecond; + tm.tm_min = st_localtz.wMinute; + tm.tm_hour = st_localtz.wHour; + tm.tm_mday = st_localtz.wDay; + tm.tm_mon = st_localtz.wMonth - 1; + tm.tm_year = st_localtz.wYear - 1900; + tm.tm_wday = -1 /*st_localtz.wDayOfWeek*/; + tm.tm_yday = -1; + tm.tm_isdst = -1; + + /* Convert to a format PhysicsFS can grok... */ + retval = (PHYSFS_sint64) mktime(&tm); + BAIL_IF(retval == -1, PHYSFS_ERR_OS_ERROR, -1); + return retval; +} /* FileTimeToPhysfsTime */ + + +/* check for symlinks. These exist in NTFS 3.1 (WinXP), even though + they aren't really available to userspace before Vista. I wonder + what would happen if you put an NTFS disk with a symlink on it + into an XP machine, though; would this flag get set? + NTFS symlinks are a form of "reparse point" (junction, volume mount, + etc), so if the REPARSE_POINT attribute is set, check for the symlink + tag thereafter. This assumes you already read in the file attributes. */ +static int isSymlink(const WCHAR *wpath, const DWORD attr) +{ + WIN32_FIND_DATAW w32dw; + HANDLE h; + + if ((attr & PHYSFS_FILE_ATTRIBUTE_REPARSE_POINT) == 0) + return 0; /* not a reparse point? Definitely not a symlink. */ + + h = winFindFirstFileW(wpath, &w32dw); + if (h == INVALID_HANDLE_VALUE) + return 0; /* ...maybe the file just vanished...? */ + + FindClose(h); + return (w32dw.dwReserved0 == PHYSFS_IO_REPARSE_TAG_SYMLINK); +} /* isSymlink */ + + +int __PHYSFS_platformStat(const char *filename, PHYSFS_Stat *st, const int follow) +{ + WIN32_FILE_ATTRIBUTE_DATA winstat; + WCHAR *wstr = NULL; + DWORD err = 0; + BOOL rc = 0; + int issymlink = 0; + + UTF8_TO_UNICODE_STACK(wstr, filename); + BAIL_IF(!wstr, PHYSFS_ERR_OUT_OF_MEMORY, 0); + rc = GetFileAttributesExW(wstr, GetFileExInfoStandard, &winstat); + + if (!rc) + err = GetLastError(); + else /* check for symlink while wstr is still available */ + issymlink = !follow && isSymlink(wstr, winstat.dwFileAttributes); + + __PHYSFS_smallFree(wstr); + BAIL_IF(!rc, errcodeFromWinApiError(err), 0); + + st->modtime = FileTimeToPhysfsTime(&winstat.ftLastWriteTime); + st->accesstime = FileTimeToPhysfsTime(&winstat.ftLastAccessTime); + st->createtime = FileTimeToPhysfsTime(&winstat.ftCreationTime); + + if (issymlink) + { + st->filetype = PHYSFS_FILETYPE_SYMLINK; + st->filesize = 0; + } /* if */ + + else if (winstat.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) + { + st->filetype = PHYSFS_FILETYPE_DIRECTORY; + st->filesize = 0; + } /* else if */ + + else if (winstat.dwFileAttributes & (FILE_ATTRIBUTE_OFFLINE | FILE_ATTRIBUTE_DEVICE)) + { + st->filetype = PHYSFS_FILETYPE_OTHER; + st->filesize = (((PHYSFS_uint64) winstat.nFileSizeHigh) << 32) | winstat.nFileSizeLow; + } /* else if */ + + else + { + st->filetype = PHYSFS_FILETYPE_REGULAR; + st->filesize = (((PHYSFS_uint64) winstat.nFileSizeHigh) << 32) | winstat.nFileSizeLow; + } /* else */ + + st->readonly = ((winstat.dwFileAttributes & FILE_ATTRIBUTE_READONLY) != 0); + + return 1; +} /* __PHYSFS_platformStat */ + +#endif /* PHYSFS_PLATFORM_WINDOWS */ + +/* end of physfs_platform_windows.c ... */ + + diff --git a/third_party/physfs/physfs_platforms.h b/third_party/physfs/physfs_platforms.h new file mode 100644 index 00000000..d4e4bfdc --- /dev/null +++ b/third_party/physfs/physfs_platforms.h @@ -0,0 +1,80 @@ +#ifndef _INCL_PHYSFS_PLATFORMS +#define _INCL_PHYSFS_PLATFORMS + +#ifndef __PHYSICSFS_INTERNAL__ +#error Do not include this header from your applications. +#endif + +/* + * These only define the platforms to determine which files in the platforms + * directory should be compiled. For example, technically BeOS can be called + * a "unix" system, but since it doesn't use unix.c, we don't define + * PHYSFS_PLATFORM_UNIX on that system. + */ + +#if (defined __HAIKU__) +# define PHYSFS_PLATFORM_HAIKU 1 +# define PHYSFS_PLATFORM_POSIX 1 +#elif ((defined __BEOS__) || (defined __beos__)) +# error BeOS support was dropped since PhysicsFS 2.1. Sorry. Try Haiku! +#elif (defined _WIN32_WCE) || (defined _WIN64_WCE) +# error PocketPC support was dropped since PhysicsFS 2.1. Sorry. Try WinRT! +#elif (defined(_MSC_VER) && (_MSC_VER >= 1700) && !_USING_V110_SDK71_) /* _MSC_VER==1700 for MSVC 2012 */ +# include +# define PHYSFS_PLATFORM_WINDOWS 1 +# if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) +# define PHYSFS_NO_CDROM_SUPPORT 1 +# define PHYSFS_PLATFORM_WINRT 1 +# endif +#elif (((defined _WIN32) || (defined _WIN64)) && (!defined __CYGWIN__)) +# define PHYSFS_PLATFORM_WINDOWS 1 +#elif defined(__OS2__) || defined(OS2) +# define PHYSFS_PLATFORM_OS2 1 +#elif ((defined __MACH__) && (defined __APPLE__)) +/* To check if iOS or not, we need to include this file */ +# include +# if ((TARGET_IPHONE_SIMULATOR) || (TARGET_OS_IPHONE)) +# define PHYSFS_NO_CDROM_SUPPORT 1 +# endif +# define PHYSFS_PLATFORM_APPLE 1 +# define PHYSFS_PLATFORM_POSIX 1 +#elif defined(macintosh) +# error Classic Mac OS support was dropped from PhysicsFS 2.0. Move to OS X. +#elif defined(ANDROID) +# define PHYSFS_PLATFORM_LINUX 1 +# define PHYSFS_PLATFORM_UNIX 1 +# define PHYSFS_PLATFORM_POSIX 1 +# define PHYSFS_NO_CDROM_SUPPORT 1 +#elif defined(__linux) +# define PHYSFS_PLATFORM_LINUX 1 +# define PHYSFS_PLATFORM_UNIX 1 +# define PHYSFS_PLATFORM_POSIX 1 +#elif defined(__sun) || defined(sun) +# define PHYSFS_PLATFORM_SOLARIS 1 +# define PHYSFS_PLATFORM_UNIX 1 +# define PHYSFS_PLATFORM_POSIX 1 +#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__) +# define PHYSFS_PLATFORM_FREEBSD 1 +# define PHYSFS_PLATFORM_BSD 1 +# define PHYSFS_PLATFORM_UNIX 1 +# define PHYSFS_PLATFORM_POSIX 1 +#elif defined(__NetBSD__) || defined(__OpenBSD__) || defined(__bsdi__) +# define PHYSFS_PLATFORM_BSD 1 +# define PHYSFS_PLATFORM_UNIX 1 +# define PHYSFS_PLATFORM_POSIX 1 +#elif defined(__EMSCRIPTEN__) +# define PHYSFS_NO_CDROM_SUPPORT 1 +# define PHYSFS_PLATFORM_UNIX 1 +# define PHYSFS_PLATFORM_POSIX 1 +#elif defined(__QNX__) +# define PHYSFS_PLATFORM_QNX 1 +# define PHYSFS_PLATFORM_POSIX 1 +#elif defined(unix) || defined(__unix__) +# define PHYSFS_PLATFORM_UNIX 1 +# define PHYSFS_PLATFORM_POSIX 1 +#else +# error Unknown platform. +#endif + +#endif /* include-once blocker. */ + diff --git a/third_party/physfs/physfs_unicode.c b/third_party/physfs/physfs_unicode.c new file mode 100644 index 00000000..0e006022 --- /dev/null +++ b/third_party/physfs/physfs_unicode.c @@ -0,0 +1,567 @@ +#define __PHYSICSFS_INTERNAL__ +#include "physfs_internal.h" + +#include "physfs_casefolding.h" + + +/* + * From rfc3629, the UTF-8 spec: + * https://www.ietf.org/rfc/rfc3629.txt + * + * Char. number range | UTF-8 octet sequence + * (hexadecimal) | (binary) + * --------------------+--------------------------------------------- + * 0000 0000-0000 007F | 0xxxxxxx + * 0000 0080-0000 07FF | 110xxxxx 10xxxxxx + * 0000 0800-0000 FFFF | 1110xxxx 10xxxxxx 10xxxxxx + * 0001 0000-0010 FFFF | 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx + */ + + +/* + * This may not be the best value, but it's one that isn't represented + * in Unicode (0x10FFFF is the largest codepoint value). We return this + * value from utf8codepoint() if there's bogus bits in the + * stream. utf8codepoint() will turn this value into something + * reasonable (like a question mark), for text that wants to try to recover, + * whereas utf8valid() will use the value to determine if a string has bad + * bits. + */ +#define UNICODE_BOGUS_CHAR_VALUE 0xFFFFFFFF + +/* + * This is the codepoint we currently return when there was bogus bits in a + * UTF-8 string. May not fly in Asian locales? + */ +#define UNICODE_BOGUS_CHAR_CODEPOINT '?' + +static PHYSFS_uint32 utf8codepoint(const char **_str) +{ + const char *str = *_str; + PHYSFS_uint32 retval = 0; + PHYSFS_uint32 octet = (PHYSFS_uint32) ((PHYSFS_uint8) *str); + PHYSFS_uint32 octet2, octet3, octet4; + + if (octet == 0) /* null terminator, end of string. */ + return 0; + + else if (octet < 128) /* one octet char: 0 to 127 */ + { + (*_str)++; /* skip to next possible start of codepoint. */ + return octet; + } /* else if */ + + else if ((octet > 127) && (octet < 192)) /* bad (starts with 10xxxxxx). */ + { + /* + * Apparently each of these is supposed to be flagged as a bogus + * char, instead of just resyncing to the next valid codepoint. + */ + (*_str)++; /* skip to next possible start of codepoint. */ + return UNICODE_BOGUS_CHAR_VALUE; + } /* else if */ + + else if (octet < 224) /* two octets */ + { + (*_str)++; /* advance at least one byte in case of an error */ + octet -= (128+64); + octet2 = (PHYSFS_uint32) ((PHYSFS_uint8) *(++str)); + if ((octet2 & (128+64)) != 128) /* Format isn't 10xxxxxx? */ + return UNICODE_BOGUS_CHAR_VALUE; + + *_str += 1; /* skip to next possible start of codepoint. */ + retval = ((octet << 6) | (octet2 - 128)); + if ((retval >= 0x80) && (retval <= 0x7FF)) + return retval; + } /* else if */ + + else if (octet < 240) /* three octets */ + { + (*_str)++; /* advance at least one byte in case of an error */ + octet -= (128+64+32); + octet2 = (PHYSFS_uint32) ((PHYSFS_uint8) *(++str)); + if ((octet2 & (128+64)) != 128) /* Format isn't 10xxxxxx? */ + return UNICODE_BOGUS_CHAR_VALUE; + + octet3 = (PHYSFS_uint32) ((PHYSFS_uint8) *(++str)); + if ((octet3 & (128+64)) != 128) /* Format isn't 10xxxxxx? */ + return UNICODE_BOGUS_CHAR_VALUE; + + *_str += 2; /* skip to next possible start of codepoint. */ + retval = ( ((octet << 12)) | ((octet2-128) << 6) | ((octet3-128)) ); + + /* There are seven "UTF-16 surrogates" that are illegal in UTF-8. */ + switch (retval) + { + case 0xD800: + case 0xDB7F: + case 0xDB80: + case 0xDBFF: + case 0xDC00: + case 0xDF80: + case 0xDFFF: + return UNICODE_BOGUS_CHAR_VALUE; + } /* switch */ + + /* 0xFFFE and 0xFFFF are illegal, too, so we check them at the edge. */ + if ((retval >= 0x800) && (retval <= 0xFFFD)) + return retval; + } /* else if */ + + else if (octet < 248) /* four octets */ + { + (*_str)++; /* advance at least one byte in case of an error */ + octet -= (128+64+32+16); + octet2 = (PHYSFS_uint32) ((PHYSFS_uint8) *(++str)); + if ((octet2 & (128+64)) != 128) /* Format isn't 10xxxxxx? */ + return UNICODE_BOGUS_CHAR_VALUE; + + octet3 = (PHYSFS_uint32) ((PHYSFS_uint8) *(++str)); + if ((octet3 & (128+64)) != 128) /* Format isn't 10xxxxxx? */ + return UNICODE_BOGUS_CHAR_VALUE; + + octet4 = (PHYSFS_uint32) ((PHYSFS_uint8) *(++str)); + if ((octet4 & (128+64)) != 128) /* Format isn't 10xxxxxx? */ + return UNICODE_BOGUS_CHAR_VALUE; + + *_str += 3; /* skip to next possible start of codepoint. */ + retval = ( ((octet << 18)) | ((octet2 - 128) << 12) | + ((octet3 - 128) << 6) | ((octet4 - 128)) ); + if ((retval >= 0x10000) && (retval <= 0x10FFFF)) + return retval; + } /* else if */ + + /* + * Five and six octet sequences became illegal in rfc3629. + * We throw the codepoint away, but parse them to make sure we move + * ahead the right number of bytes and don't overflow the buffer. + */ + + else if (octet < 252) /* five octets */ + { + (*_str)++; /* advance at least one byte in case of an error */ + octet = (PHYSFS_uint32) ((PHYSFS_uint8) *(++str)); + if ((octet & (128+64)) != 128) /* Format isn't 10xxxxxx? */ + return UNICODE_BOGUS_CHAR_VALUE; + + octet = (PHYSFS_uint32) ((PHYSFS_uint8) *(++str)); + if ((octet & (128+64)) != 128) /* Format isn't 10xxxxxx? */ + return UNICODE_BOGUS_CHAR_VALUE; + + octet = (PHYSFS_uint32) ((PHYSFS_uint8) *(++str)); + if ((octet & (128+64)) != 128) /* Format isn't 10xxxxxx? */ + return UNICODE_BOGUS_CHAR_VALUE; + + octet = (PHYSFS_uint32) ((PHYSFS_uint8) *(++str)); + if ((octet & (128+64)) != 128) /* Format isn't 10xxxxxx? */ + return UNICODE_BOGUS_CHAR_VALUE; + + *_str += 4; /* skip to next possible start of codepoint. */ + return UNICODE_BOGUS_CHAR_VALUE; + } /* else if */ + + else /* six octets */ + { + (*_str)++; /* advance at least one byte in case of an error */ + octet = (PHYSFS_uint32) ((PHYSFS_uint8) *(++str)); + if ((octet & (128+64)) != 128) /* Format isn't 10xxxxxx? */ + return UNICODE_BOGUS_CHAR_VALUE; + + octet = (PHYSFS_uint32) ((PHYSFS_uint8) *(++str)); + if ((octet & (128+64)) != 128) /* Format isn't 10xxxxxx? */ + return UNICODE_BOGUS_CHAR_VALUE; + + octet = (PHYSFS_uint32) ((PHYSFS_uint8) *(++str)); + if ((octet & (128+64)) != 128) /* Format isn't 10xxxxxx? */ + return UNICODE_BOGUS_CHAR_VALUE; + + octet = (PHYSFS_uint32) ((PHYSFS_uint8) *(++str)); + if ((octet & (128+64)) != 128) /* Format isn't 10xxxxxx? */ + return UNICODE_BOGUS_CHAR_VALUE; + + octet = (PHYSFS_uint32) ((PHYSFS_uint8) *(++str)); + if ((octet & (128+64)) != 128) /* Format isn't 10xxxxxx? */ + return UNICODE_BOGUS_CHAR_VALUE; + + *_str += 6; /* skip to next possible start of codepoint. */ + return UNICODE_BOGUS_CHAR_VALUE; + } /* else if */ + + return UNICODE_BOGUS_CHAR_VALUE; +} /* utf8codepoint */ + +static PHYSFS_uint32 utf16codepoint(const PHYSFS_uint16 **_str) +{ + const PHYSFS_uint16 *src = *_str; + PHYSFS_uint32 cp = (PHYSFS_uint32) *(src++); + + if (cp == 0) /* null terminator, end of string. */ + return 0; + /* Orphaned second half of surrogate pair? */ + else if ((cp >= 0xDC00) && (cp <= 0xDFFF)) + cp = UNICODE_BOGUS_CHAR_CODEPOINT; + else if ((cp >= 0xD800) && (cp <= 0xDBFF)) /* start surrogate pair! */ + { + const PHYSFS_uint32 pair = (PHYSFS_uint32) *src; + if (pair == 0) + cp = UNICODE_BOGUS_CHAR_CODEPOINT; + else if ((pair < 0xDC00) || (pair > 0xDFFF)) + cp = UNICODE_BOGUS_CHAR_CODEPOINT; + else + { + src++; /* eat the other surrogate. */ + cp = (((cp - 0xD800) << 10) | (pair - 0xDC00)); + } /* else */ + } /* else if */ + + *_str = src; + return cp; +} /* utf16codepoint */ + +static PHYSFS_uint32 utf32codepoint(const PHYSFS_uint32 **_str) +{ + const PHYSFS_uint32 *src = *_str; + PHYSFS_uint32 cp = *(src++); + + if (cp == 0) /* null terminator, end of string. */ + return 0; + else if (cp > 0x10FFF) + cp = UNICODE_BOGUS_CHAR_CODEPOINT; + + *_str = src; + return cp; +} /* utf32codepoint */ + + +void PHYSFS_utf8ToUcs4(const char *src, PHYSFS_uint32 *dst, PHYSFS_uint64 len) +{ + len -= sizeof (PHYSFS_uint32); /* save room for null char. */ + while (len >= sizeof (PHYSFS_uint32)) + { + PHYSFS_uint32 cp = utf8codepoint(&src); + if (cp == 0) + break; + else if (cp == UNICODE_BOGUS_CHAR_VALUE) + cp = UNICODE_BOGUS_CHAR_CODEPOINT; + *(dst++) = cp; + len -= sizeof (PHYSFS_uint32); + } /* while */ + + *dst = 0; +} /* PHYSFS_utf8ToUcs4 */ + + +void PHYSFS_utf8ToUcs2(const char *src, PHYSFS_uint16 *dst, PHYSFS_uint64 len) +{ + len -= sizeof (PHYSFS_uint16); /* save room for null char. */ + while (len >= sizeof (PHYSFS_uint16)) + { + PHYSFS_uint32 cp = utf8codepoint(&src); + if (cp == 0) + break; + else if (cp == UNICODE_BOGUS_CHAR_VALUE) + cp = UNICODE_BOGUS_CHAR_CODEPOINT; + + if (cp > 0xFFFF) /* UTF-16 surrogates (bogus chars in UCS-2) */ + cp = UNICODE_BOGUS_CHAR_CODEPOINT; + + *(dst++) = cp; + len -= sizeof (PHYSFS_uint16); + } /* while */ + + *dst = 0; +} /* PHYSFS_utf8ToUcs2 */ + + +void PHYSFS_utf8ToUtf16(const char *src, PHYSFS_uint16 *dst, PHYSFS_uint64 len) +{ + len -= sizeof (PHYSFS_uint16); /* save room for null char. */ + while (len >= sizeof (PHYSFS_uint16)) + { + PHYSFS_uint32 cp = utf8codepoint(&src); + if (cp == 0) + break; + else if (cp == UNICODE_BOGUS_CHAR_VALUE) + cp = UNICODE_BOGUS_CHAR_CODEPOINT; + + if (cp > 0xFFFF) /* encode as surrogate pair */ + { + if (len < (sizeof (PHYSFS_uint16) * 2)) + break; /* not enough room for the pair, stop now. */ + + cp -= 0x10000; /* Make this a 20-bit value */ + + *(dst++) = 0xD800 + ((cp >> 10) & 0x3FF); + len -= sizeof (PHYSFS_uint16); + + cp = 0xDC00 + (cp & 0x3FF); + } /* if */ + + *(dst++) = cp; + len -= sizeof (PHYSFS_uint16); + } /* while */ + + *dst = 0; +} /* PHYSFS_utf8ToUtf16 */ + +static void utf8fromcodepoint(PHYSFS_uint32 cp, char **_dst, PHYSFS_uint64 *_len) +{ + char *dst = *_dst; + PHYSFS_uint64 len = *_len; + + if (len == 0) + return; + + if (cp > 0x10FFFF) + cp = UNICODE_BOGUS_CHAR_CODEPOINT; + else if ((cp == 0xFFFE) || (cp == 0xFFFF)) /* illegal values. */ + cp = UNICODE_BOGUS_CHAR_CODEPOINT; + else + { + /* There are seven "UTF-16 surrogates" that are illegal in UTF-8. */ + switch (cp) + { + case 0xD800: + case 0xDB7F: + case 0xDB80: + case 0xDBFF: + case 0xDC00: + case 0xDF80: + case 0xDFFF: + cp = UNICODE_BOGUS_CHAR_CODEPOINT; + } /* switch */ + } /* else */ + + /* Do the encoding... */ + if (cp < 0x80) + { + *(dst++) = (char) cp; + len--; + } /* if */ + + else if (cp < 0x800) + { + if (len < 2) + len = 0; + else + { + *(dst++) = (char) ((cp >> 6) | 128 | 64); + *(dst++) = (char) (cp & 0x3F) | 128; + len -= 2; + } /* else */ + } /* else if */ + + else if (cp < 0x10000) + { + if (len < 3) + len = 0; + else + { + *(dst++) = (char) ((cp >> 12) | 128 | 64 | 32); + *(dst++) = (char) ((cp >> 6) & 0x3F) | 128; + *(dst++) = (char) (cp & 0x3F) | 128; + len -= 3; + } /* else */ + } /* else if */ + + else + { + if (len < 4) + len = 0; + else + { + *(dst++) = (char) ((cp >> 18) | 128 | 64 | 32 | 16); + *(dst++) = (char) ((cp >> 12) & 0x3F) | 128; + *(dst++) = (char) ((cp >> 6) & 0x3F) | 128; + *(dst++) = (char) (cp & 0x3F) | 128; + len -= 4; + } /* else if */ + } /* else */ + + *_dst = dst; + *_len = len; +} /* utf8fromcodepoint */ + +#define UTF8FROMTYPE(typ, src, dst, len) \ + if (len == 0) return; \ + len--; \ + while (len) \ + { \ + const PHYSFS_uint32 cp = (PHYSFS_uint32) ((typ) (*(src++))); \ + if (cp == 0) break; \ + utf8fromcodepoint(cp, &dst, &len); \ + } \ + *dst = '\0'; \ + +void PHYSFS_utf8FromUcs4(const PHYSFS_uint32 *src, char *dst, PHYSFS_uint64 len) +{ + UTF8FROMTYPE(PHYSFS_uint32, src, dst, len); +} /* PHYSFS_utf8FromUcs4 */ + +void PHYSFS_utf8FromUcs2(const PHYSFS_uint16 *src, char *dst, PHYSFS_uint64 len) +{ + UTF8FROMTYPE(PHYSFS_uint64, src, dst, len); +} /* PHYSFS_utf8FromUcs2 */ + +/* latin1 maps to unicode codepoints directly, we just utf-8 encode it. */ +void PHYSFS_utf8FromLatin1(const char *src, char *dst, PHYSFS_uint64 len) +{ + UTF8FROMTYPE(PHYSFS_uint8, src, dst, len); +} /* PHYSFS_utf8FromLatin1 */ + +#undef UTF8FROMTYPE + + +void PHYSFS_utf8FromUtf16(const PHYSFS_uint16 *src, char *dst, PHYSFS_uint64 len) +{ + if (len == 0) + return; + + len--; + while (len) + { + const PHYSFS_uint32 cp = utf16codepoint(&src); + if (!cp) + break; + utf8fromcodepoint(cp, &dst, &len); + } /* while */ + + *dst = '\0'; +} /* PHYSFS_utf8FromUtf16 */ + + +int PHYSFS_caseFold(const PHYSFS_uint32 from, PHYSFS_uint32 *to) +{ + int i; + + if (from < 128) /* low-ASCII, easy! */ + { + if ((from >= 'A') && (from <= 'Z')) + *to = from - ('A' - 'a'); + else + *to = from; + return 1; + } /* if */ + + else if (from <= 0xFFFF) + { + const PHYSFS_uint8 hash = ((from ^ (from >> 8)) & 0xFF); + const PHYSFS_uint16 from16 = (PHYSFS_uint16) from; + + { + const CaseFoldHashBucket1_16 *bucket = &case_fold_hash1_16[hash]; + const int count = (int) bucket->count; + for (i = 0; i < count; i++) + { + const CaseFoldMapping1_16 *mapping = &bucket->list[i]; + if (mapping->from == from16) + { + *to = mapping->to0; + return 1; + } /* if */ + } /* for */ + } + + { + const CaseFoldHashBucket2_16 *bucket = &case_fold_hash2_16[hash & 15]; + const int count = (int) bucket->count; + for (i = 0; i < count; i++) + { + const CaseFoldMapping2_16 *mapping = &bucket->list[i]; + if (mapping->from == from16) + { + to[0] = mapping->to0; + to[1] = mapping->to1; + return 2; + } /* if */ + } /* for */ + } + + { + const CaseFoldHashBucket3_16 *bucket = &case_fold_hash3_16[hash & 3]; + const int count = (int) bucket->count; + for (i = 0; i < count; i++) + { + const CaseFoldMapping3_16 *mapping = &bucket->list[i]; + if (mapping->from == from16) + { + to[0] = mapping->to0; + to[1] = mapping->to1; + to[2] = mapping->to2; + return 3; + } /* if */ + } /* for */ + } + } /* else if */ + + else /* codepoint that doesn't fit in 16 bits. */ + { + const PHYSFS_uint8 hash = ((from ^ (from >> 8)) & 0xFF); + const CaseFoldHashBucket1_32 *bucket = &case_fold_hash1_32[hash & 15]; + const int count = (int) bucket->count; + for (i = 0; i < count; i++) + { + const CaseFoldMapping1_32 *mapping = &bucket->list[i]; + if (mapping->from == from) + { + *to = mapping->to0; + return 1; + } /* if */ + } /* for */ + } /* else */ + + + /* Not found...there's no remapping for this codepoint. */ + *to = from; + return 1; +} /* PHYSFS_caseFold */ + + +#define UTFSTRICMP(bits) \ + PHYSFS_uint32 folded1[3], folded2[3]; \ + int head1 = 0, tail1 = 0, head2 = 0, tail2 = 0; \ + while (1) { \ + PHYSFS_uint32 cp1, cp2; \ + if (head1 != tail1) { \ + cp1 = folded1[tail1++]; \ + } else { \ + head1 = PHYSFS_caseFold(utf##bits##codepoint(&str1), folded1); \ + cp1 = folded1[0]; \ + tail1 = 1; \ + } \ + if (head2 != tail2) { \ + cp2 = folded2[tail2++]; \ + } else { \ + head2 = PHYSFS_caseFold(utf##bits##codepoint(&str2), folded2); \ + cp2 = folded2[0]; \ + tail2 = 1; \ + } \ + if (cp1 < cp2) { \ + return -1; \ + } else if (cp1 > cp2) { \ + return 1; \ + } else if (cp1 == 0) { \ + break; /* complete match. */ \ + } \ + } \ + return 0 + +int PHYSFS_utf8stricmp(const char *str1, const char *str2) +{ + UTFSTRICMP(8); +} /* PHYSFS_utf8stricmp */ + +int PHYSFS_utf16stricmp(const PHYSFS_uint16 *str1, const PHYSFS_uint16 *str2) +{ + UTFSTRICMP(16); +} /* PHYSFS_utf16stricmp */ + +int PHYSFS_ucs4stricmp(const PHYSFS_uint32 *str1, const PHYSFS_uint32 *str2) +{ + UTFSTRICMP(32); +} /* PHYSFS_ucs4stricmp */ + +#undef UTFSTRICMP + +/* end of physfs_unicode.c ... */ + diff --git a/third_party/tinyxml2 b/third_party/tinyxml2 deleted file mode 160000 index e45d9d16..00000000 --- a/third_party/tinyxml2 +++ /dev/null @@ -1 +0,0 @@ -Subproject commit e45d9d16d430a3f5d3eee9fe40d5e194e1e5e63a diff --git a/third_party/tinyxml2/LICENSE.txt b/third_party/tinyxml2/LICENSE.txt new file mode 100644 index 00000000..85a6a36f --- /dev/null +++ b/third_party/tinyxml2/LICENSE.txt @@ -0,0 +1,18 @@ +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any +damages arising from the use of this software. + +Permission is granted to anyone to use this software for any +purpose, including commercial applications, and to alter it and +redistribute it freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must +not claim that you wrote the original software. If you use this +software in a product, an acknowledgment in the product documentation +would be appreciated but is not required. + +2. Altered source versions must be plainly marked as such, and +must not be misrepresented as being the original software. + +3. This notice may not be removed or altered from any source +distribution. diff --git a/third_party/tinyxml2/readme.md b/third_party/tinyxml2/readme.md new file mode 100644 index 00000000..e9933aa5 --- /dev/null +++ b/third_party/tinyxml2/readme.md @@ -0,0 +1,335 @@ +TinyXML-2 +========= + +[![TravisCI Status](https://travis-ci.org/leethomason/tinyxml2.svg?branch=master)](https://travis-ci.org/leethomason/tinyxml2) [![AppVeyor Status](https://ci.appveyor.com/api/projects/status/github/leethomason/tinyxml2?branch=master&svg=true)](https://ci.appveyor.com/project/leethomason/tinyxml2) + +![TinyXML-2 Logo](http://www.grinninglizard.com/tinyxml2/TinyXML2_small.png) + +TinyXML-2 is a simple, small, efficient, C++ XML parser that can be +easily integrated into other programs. + +The master is hosted on github: +https://github.com/leethomason/tinyxml2 + +The online HTML version of these docs: +http://leethomason.github.io/tinyxml2/ + +Examples are in the "related pages" tab of the HTML docs. + +What it does. +------------- + +In brief, TinyXML-2 parses an XML document, and builds from that a +Document Object Model (DOM) that can be read, modified, and saved. + +XML stands for "eXtensible Markup Language." It is a general purpose +human and machine readable markup language to describe arbitrary data. +All those random file formats created to store application data can +all be replaced with XML. One parser for everything. + +http://en.wikipedia.org/wiki/XML + +There are different ways to access and interact with XML data. +TinyXML-2 uses a Document Object Model (DOM), meaning the XML data is parsed +into a C++ objects that can be browsed and manipulated, and then +written to disk or another output stream. You can also construct an XML document +from scratch with C++ objects and write this to disk or another output +stream. You can even use TinyXML-2 to stream XML programmatically from +code without creating a document first. + +TinyXML-2 is designed to be easy and fast to learn. It is one header and +one cpp file. Simply add these to your project and off you go. +There is an example file - xmltest.cpp - to get you started. + +TinyXML-2 is released under the ZLib license, +so you can use it in open source or commercial code. The details +of the license are at the top of every source file. + +TinyXML-2 attempts to be a flexible parser, but with truly correct and +compliant XML output. TinyXML-2 should compile on any reasonably C++ +compliant system. It does not rely on exceptions, RTTI, or the STL. + +What it doesn't do. +------------------- + +TinyXML-2 doesn't parse or use DTDs (Document Type Definitions) or XSLs +(eXtensible Stylesheet Language.) There are other parsers out there +that are much more fully featured. But they are generally bigger and +more difficult to use. If you are working with +browsers or have more complete XML needs, TinyXML-2 is not the parser for you. + +TinyXML-1 vs. TinyXML-2 +----------------------- + +TinyXML-2 is now the focus of all development, well tested, and your +best choice between the two APIs. At this point, unless you are maintaining +legacy code, you should choose TinyXML-2. + +TinyXML-2 uses a similar API to TinyXML-1 and the same +rich test cases. But the implementation of the parser is completely re-written +to make it more appropriate for use in a game. It uses less memory, is faster, +and uses far fewer memory allocations. + +TinyXML-2 has no requirement or support for STL. By returning `const char*` +TinyXML-2 can be much more efficient with memory usage. (TinyXML-1 did support +and use STL, but consumed much more memory for the DOM representation.) + +Features +-------- + +### Code Page + +TinyXML-2 uses UTF-8 exclusively when interpreting XML. All XML is assumed to +be UTF-8. + +Filenames for loading / saving are passed unchanged to the underlying OS. + +### Memory Model + +An XMLDocument is a C++ object like any other, that can be on the stack, or +new'd and deleted on the heap. + +However, any sub-node of the Document, XMLElement, XMLText, etc, can only +be created by calling the appropriate XMLDocument::NewElement, NewText, etc. +method. Although you have pointers to these objects, they are still owned +by the Document. When the Document is deleted, so are all the nodes it contains. + +### White Space + +#### Whitespace Preservation (default) + +Microsoft has an excellent article on white space: http://msdn.microsoft.com/en-us/library/ms256097.aspx + +By default, TinyXML-2 preserves white space in a (hopefully) sane way that is almost compliant with the +spec. (TinyXML-1 used a completely different model, much more similar to 'collapse', below.) + +As a first step, all newlines / carriage-returns / line-feeds are normalized to a +line-feed character, as required by the XML spec. + +White space in text is preserved. For example: + + Hello, World + +The leading space before the "Hello" and the double space after the comma are +preserved. Line-feeds are preserved, as in this example: + + Hello again, + World + +However, white space between elements is **not** preserved. Although not strictly +compliant, tracking and reporting inter-element space is awkward, and not normally +valuable. TinyXML-2 sees these as the same XML: + + + 1 + 2 + 3 + + + 123 + +#### Whitespace Collapse + +For some applications, it is preferable to collapse whitespace. Collapsing +whitespace gives you "HTML-like" behavior, which is sometimes more suitable +for hand typed documents. + +TinyXML-2 supports this with the 'whitespace' parameter to the XMLDocument constructor. +(The default is to preserve whitespace, as described above.) + +However, you may also use COLLAPSE_WHITESPACE, which will: + +* Remove leading and trailing whitespace +* Convert newlines and line-feeds into a space character +* Collapse a run of any number of space characters into a single space character + +Note that (currently) there is a performance impact for using COLLAPSE_WHITESPACE. +It essentially causes the XML to be parsed twice. + +#### Error Reporting + +TinyXML-2 reports the line number of any errors in an XML document that +cannot be parsed correctly. In addition, all nodes (elements, declarations, +text, comments etc.) and attributes have a line number recorded as they are parsed. +This allows an application that performs additional validation of the parsed +XML document (e.g. application-implemented DTD validation) to report +line number information for error messages. + +### Entities + +TinyXML-2 recognizes the pre-defined "character entities", meaning special +characters. Namely: + + & & + < < + > > + " " + ' ' + +These are recognized when the XML document is read, and translated to their +UTF-8 equivalents. For instance, text with the XML of: + + Far & Away + +will have the Value() of "Far & Away" when queried from the XMLText object, +and will be written back to the XML stream/file as an ampersand. + +Additionally, any character can be specified by its Unicode code point: +The syntax ` ` or ` ` are both to the non-breaking space character. +This is called a 'numeric character reference'. Any numeric character reference +that isn't one of the special entities above, will be read, but written as a +regular code point. The output is correct, but the entity syntax isn't preserved. + +### Printing + +#### Print to file +You can directly use the convenience function: + + XMLDocument doc; + ... + doc.SaveFile( "foo.xml" ); + +Or the XMLPrinter class: + + XMLPrinter printer( fp ); + doc.Print( &printer ); + +#### Print to memory +Printing to memory is supported by the XMLPrinter. + + XMLPrinter printer; + doc.Print( &printer ); + // printer.CStr() has a const char* to the XML + +#### Print without an XMLDocument + +When loading, an XML parser is very useful. However, sometimes +when saving, it just gets in the way. The code is often set up +for streaming, and constructing the DOM is just overhead. + +The Printer supports the streaming case. The following code +prints out a trivially simple XML file without ever creating +an XML document. + + XMLPrinter printer( fp ); + printer.OpenElement( "foo" ); + printer.PushAttribute( "foo", "bar" ); + printer.CloseElement(); + +Examples +-------- + +#### Load and parse an XML file. + + /* ------ Example 1: Load and parse an XML file. ---- */ + { + XMLDocument doc; + doc.LoadFile( "dream.xml" ); + } + +#### Lookup information. + + /* ------ Example 2: Lookup information. ---- */ + { + XMLDocument doc; + doc.LoadFile( "dream.xml" ); + + // Structure of the XML file: + // - Element "PLAY" the root Element, which is the + // FirstChildElement of the Document + // - - Element "TITLE" child of the root PLAY Element + // - - - Text child of the TITLE Element + + // Navigate to the title, using the convenience function, + // with a dangerous lack of error checking. + const char* title = doc.FirstChildElement( "PLAY" )->FirstChildElement( "TITLE" )->GetText(); + printf( "Name of play (1): %s\n", title ); + + // Text is just another Node to TinyXML-2. The more + // general way to get to the XMLText: + XMLText* textNode = doc.FirstChildElement( "PLAY" )->FirstChildElement( "TITLE" )->FirstChild()->ToText(); + title = textNode->Value(); + printf( "Name of play (2): %s\n", title ); + } + +Using and Installing +-------------------- + +There are 2 files in TinyXML-2: +* tinyxml2.cpp +* tinyxml2.h + +And additionally a test file: +* xmltest.cpp + +Simply compile and run. There is a visual studio 2019 project included, a simple Makefile, +an Xcode project, a Code::Blocks project, and a cmake CMakeLists.txt included to help you. +The top of tinyxml.h even has a simple g++ command line if you are using Unix/Linux/BSD and +don't want to use a build system. + +Building TinyXML-2 - Using vcpkg +-------------------------------- + +You can download and install TinyXML-2 using the [vcpkg](https://github.com/Microsoft/vcpkg) dependency manager: + + git clone https://github.com/Microsoft/vcpkg.git + cd vcpkg + ./bootstrap-vcpkg.sh + ./vcpkg integrate install + ./vcpkg install tinyxml2 + +The TinyXML-2 port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please [create an issue or pull request](https://github.com/Microsoft/vcpkg) on the vcpkg repository. + +Versioning +---------- + +TinyXML-2 uses semantic versioning. http://semver.org/ Releases are now tagged in github. + +Note that the major version will (probably) change fairly rapidly. API changes are fairly +common. + +Documentation +------------- + +The documentation is built with Doxygen, using the 'dox' +configuration file. + +License +------- + +TinyXML-2 is released under the zlib license: + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any +damages arising from the use of this software. + +Permission is granted to anyone to use this software for any +purpose, including commercial applications, and to alter it and +redistribute it freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must +not claim that you wrote the original software. If you use this +software in a product, an acknowledgment in the product documentation +would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and +must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source +distribution. + +Contributors +------------ + +Thanks very much to everyone who sends suggestions, bugs, ideas, and +encouragement. It all helps, and makes this project fun. + +The original TinyXML-1 has many contributors, who all deserve thanks +in shaping what is a very successful library. Extra thanks to Yves +Berquin and Andrew Ellerton who were key contributors. + +TinyXML-2 grew from that effort. Lee Thomason is the original author +of TinyXML-2 (and TinyXML-1) but TinyXML-2 has been and is being improved +by many contributors. + +Thanks to John Mackay at http://john.mackay.rosalilastudio.com for the TinyXML-2 logo! + + diff --git a/third_party/tinyxml2/tinyxml2.cpp b/third_party/tinyxml2/tinyxml2.cpp new file mode 100644 index 00000000..1606ce0a --- /dev/null +++ b/third_party/tinyxml2/tinyxml2.cpp @@ -0,0 +1,2955 @@ +/* +Original code by Lee Thomason (www.grinninglizard.com) + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any +damages arising from the use of this software. + +Permission is granted to anyone to use this software for any +purpose, including commercial applications, and to alter it and +redistribute it freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must +not claim that you wrote the original software. If you use this +software in a product, an acknowledgment in the product documentation +would be appreciated but is not required. + +2. Altered source versions must be plainly marked as such, and +must not be misrepresented as being the original software. + +3. This notice may not be removed or altered from any source +distribution. +*/ + +#include "tinyxml2.h" + +#include // yes, this one new style header, is in the Android SDK. +#if defined(ANDROID_NDK) || defined(__BORLANDC__) || defined(__QNXNTO__) +# include +# include +#else +# include +# include +#endif + +#if defined(_MSC_VER) && (_MSC_VER >= 1400 ) && (!defined WINCE) + // Microsoft Visual Studio, version 2005 and higher. Not WinCE. + /*int _snprintf_s( + char *buffer, + size_t sizeOfBuffer, + size_t count, + const char *format [, + argument] ... + );*/ + static inline int TIXML_SNPRINTF( char* buffer, size_t size, const char* format, ... ) + { + va_list va; + va_start( va, format ); + const int result = vsnprintf_s( buffer, size, _TRUNCATE, format, va ); + va_end( va ); + return result; + } + + static inline int TIXML_VSNPRINTF( char* buffer, size_t size, const char* format, va_list va ) + { + const int result = vsnprintf_s( buffer, size, _TRUNCATE, format, va ); + return result; + } + + #define TIXML_VSCPRINTF _vscprintf + #define TIXML_SSCANF sscanf_s +#elif defined _MSC_VER + // Microsoft Visual Studio 2003 and earlier or WinCE + #define TIXML_SNPRINTF _snprintf + #define TIXML_VSNPRINTF _vsnprintf + #define TIXML_SSCANF sscanf + #if (_MSC_VER < 1400 ) && (!defined WINCE) + // Microsoft Visual Studio 2003 and not WinCE. + #define TIXML_VSCPRINTF _vscprintf // VS2003's C runtime has this, but VC6 C runtime or WinCE SDK doesn't have. + #else + // Microsoft Visual Studio 2003 and earlier or WinCE. + static inline int TIXML_VSCPRINTF( const char* format, va_list va ) + { + int len = 512; + for (;;) { + len = len*2; + char* str = new char[len](); + const int required = _vsnprintf(str, len, format, va); + delete[] str; + if ( required != -1 ) { + TIXMLASSERT( required >= 0 ); + len = required; + break; + } + } + TIXMLASSERT( len >= 0 ); + return len; + } + #endif +#else + // GCC version 3 and higher + //#warning( "Using sn* functions." ) + #define TIXML_SNPRINTF snprintf + #define TIXML_VSNPRINTF vsnprintf + static inline int TIXML_VSCPRINTF( const char* format, va_list va ) + { + int len = vsnprintf( 0, 0, format, va ); + TIXMLASSERT( len >= 0 ); + return len; + } + #define TIXML_SSCANF sscanf +#endif + +#if defined(_WIN64) + #define TIXML_FSEEK _fseeki64 + #define TIXML_FTELL _ftelli64 +#elif defined(__APPLE__) || (__FreeBSD__) || (__OpenBSD__) + #define TIXML_FSEEK fseeko + #define TIXML_FTELL ftello +#elif defined(__unix__) && defined(__x86_64__) + #define TIXML_FSEEK fseeko64 + #define TIXML_FTELL ftello64 +#else + #define TIXML_FSEEK fseek + #define TIXML_FTELL ftell +#endif + + +static const char LINE_FEED = static_cast(0x0a); // all line endings are normalized to LF +static const char LF = LINE_FEED; +static const char CARRIAGE_RETURN = static_cast(0x0d); // CR gets filtered out +static const char CR = CARRIAGE_RETURN; +static const char SINGLE_QUOTE = '\''; +static const char DOUBLE_QUOTE = '\"'; + +// Bunch of unicode info at: +// http://www.unicode.org/faq/utf_bom.html +// ef bb bf (Microsoft "lead bytes") - designates UTF-8 + +static const unsigned char TIXML_UTF_LEAD_0 = 0xefU; +static const unsigned char TIXML_UTF_LEAD_1 = 0xbbU; +static const unsigned char TIXML_UTF_LEAD_2 = 0xbfU; + +namespace tinyxml2 +{ + +struct Entity { + const char* pattern; + int length; + char value; +}; + +static const int NUM_ENTITIES = 5; +static const Entity entities[NUM_ENTITIES] = { + { "quot", 4, DOUBLE_QUOTE }, + { "amp", 3, '&' }, + { "apos", 4, SINGLE_QUOTE }, + { "lt", 2, '<' }, + { "gt", 2, '>' } +}; + + +StrPair::~StrPair() +{ + Reset(); +} + + +void StrPair::TransferTo( StrPair* other ) +{ + if ( this == other ) { + return; + } + // This in effect implements the assignment operator by "moving" + // ownership (as in auto_ptr). + + TIXMLASSERT( other != 0 ); + TIXMLASSERT( other->_flags == 0 ); + TIXMLASSERT( other->_start == 0 ); + TIXMLASSERT( other->_end == 0 ); + + other->Reset(); + + other->_flags = _flags; + other->_start = _start; + other->_end = _end; + + _flags = 0; + _start = 0; + _end = 0; +} + + +void StrPair::Reset() +{ + if ( _flags & NEEDS_DELETE ) { + delete [] _start; + } + _flags = 0; + _start = 0; + _end = 0; +} + + +void StrPair::SetStr( const char* str, int flags ) +{ + TIXMLASSERT( str ); + Reset(); + size_t len = strlen( str ); + TIXMLASSERT( _start == 0 ); + _start = new char[ len+1 ]; + memcpy( _start, str, len+1 ); + _end = _start + len; + _flags = flags | NEEDS_DELETE; +} + + +char* StrPair::ParseText( char* p, const char* endTag, int strFlags, int* curLineNumPtr ) +{ + TIXMLASSERT( p ); + TIXMLASSERT( endTag && *endTag ); + TIXMLASSERT(curLineNumPtr); + + char* start = p; + const char endChar = *endTag; + size_t length = strlen( endTag ); + + // Inner loop of text parsing. + while ( *p ) { + if ( *p == endChar && strncmp( p, endTag, length ) == 0 ) { + Set( start, p, strFlags ); + return p + length; + } else if (*p == '\n') { + ++(*curLineNumPtr); + } + ++p; + TIXMLASSERT( p ); + } + return 0; +} + + +char* StrPair::ParseName( char* p ) +{ + if ( !p || !(*p) ) { + return 0; + } + if ( !XMLUtil::IsNameStartChar( *p ) ) { + return 0; + } + + char* const start = p; + ++p; + while ( *p && XMLUtil::IsNameChar( *p ) ) { + ++p; + } + + Set( start, p, 0 ); + return p; +} + + +void StrPair::CollapseWhitespace() +{ + // Adjusting _start would cause undefined behavior on delete[] + TIXMLASSERT( ( _flags & NEEDS_DELETE ) == 0 ); + // Trim leading space. + _start = XMLUtil::SkipWhiteSpace( _start, 0 ); + + if ( *_start ) { + const char* p = _start; // the read pointer + char* q = _start; // the write pointer + + while( *p ) { + if ( XMLUtil::IsWhiteSpace( *p )) { + p = XMLUtil::SkipWhiteSpace( p, 0 ); + if ( *p == 0 ) { + break; // don't write to q; this trims the trailing space. + } + *q = ' '; + ++q; + } + *q = *p; + ++q; + ++p; + } + *q = 0; + } +} + + +const char* StrPair::GetStr() +{ + TIXMLASSERT( _start ); + TIXMLASSERT( _end ); + if ( _flags & NEEDS_FLUSH ) { + *_end = 0; + _flags ^= NEEDS_FLUSH; + + if ( _flags ) { + const char* p = _start; // the read pointer + char* q = _start; // the write pointer + + while( p < _end ) { + if ( (_flags & NEEDS_NEWLINE_NORMALIZATION) && *p == CR ) { + // CR-LF pair becomes LF + // CR alone becomes LF + // LF-CR becomes LF + if ( *(p+1) == LF ) { + p += 2; + } + else { + ++p; + } + *q = LF; + ++q; + } + else if ( (_flags & NEEDS_NEWLINE_NORMALIZATION) && *p == LF ) { + if ( *(p+1) == CR ) { + p += 2; + } + else { + ++p; + } + *q = LF; + ++q; + } + else if ( (_flags & NEEDS_ENTITY_PROCESSING) && *p == '&' ) { + // Entities handled by tinyXML2: + // - special entities in the entity table [in/out] + // - numeric character reference [in] + // 中 or 中 + + if ( *(p+1) == '#' ) { + const int buflen = 10; + char buf[buflen] = { 0 }; + int len = 0; + const char* adjusted = const_cast( XMLUtil::GetCharacterRef( p, buf, &len ) ); + if ( adjusted == 0 ) { + *q = *p; + ++p; + ++q; + } + else { + TIXMLASSERT( 0 <= len && len <= buflen ); + TIXMLASSERT( q + len <= adjusted ); + p = adjusted; + memcpy( q, buf, len ); + q += len; + } + } + else { + bool entityFound = false; + for( int i = 0; i < NUM_ENTITIES; ++i ) { + const Entity& entity = entities[i]; + if ( strncmp( p + 1, entity.pattern, entity.length ) == 0 + && *( p + entity.length + 1 ) == ';' ) { + // Found an entity - convert. + *q = entity.value; + ++q; + p += entity.length + 2; + entityFound = true; + break; + } + } + if ( !entityFound ) { + // fixme: treat as error? + ++p; + ++q; + } + } + } + else { + *q = *p; + ++p; + ++q; + } + } + *q = 0; + } + // The loop below has plenty going on, and this + // is a less useful mode. Break it out. + if ( _flags & NEEDS_WHITESPACE_COLLAPSING ) { + CollapseWhitespace(); + } + _flags = (_flags & NEEDS_DELETE); + } + TIXMLASSERT( _start ); + return _start; +} + + + + +// --------- XMLUtil ----------- // + +const char* XMLUtil::writeBoolTrue = "true"; +const char* XMLUtil::writeBoolFalse = "false"; + +void XMLUtil::SetBoolSerialization(const char* writeTrue, const char* writeFalse) +{ + static const char* defTrue = "true"; + static const char* defFalse = "false"; + + writeBoolTrue = (writeTrue) ? writeTrue : defTrue; + writeBoolFalse = (writeFalse) ? writeFalse : defFalse; +} + + +const char* XMLUtil::ReadBOM( const char* p, bool* bom ) +{ + TIXMLASSERT( p ); + TIXMLASSERT( bom ); + *bom = false; + const unsigned char* pu = reinterpret_cast(p); + // Check for BOM: + if ( *(pu+0) == TIXML_UTF_LEAD_0 + && *(pu+1) == TIXML_UTF_LEAD_1 + && *(pu+2) == TIXML_UTF_LEAD_2 ) { + *bom = true; + p += 3; + } + TIXMLASSERT( p ); + return p; +} + + +void XMLUtil::ConvertUTF32ToUTF8( unsigned long input, char* output, int* length ) +{ + const unsigned long BYTE_MASK = 0xBF; + const unsigned long BYTE_MARK = 0x80; + const unsigned long FIRST_BYTE_MARK[7] = { 0x00, 0x00, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC }; + + if (input < 0x80) { + *length = 1; + } + else if ( input < 0x800 ) { + *length = 2; + } + else if ( input < 0x10000 ) { + *length = 3; + } + else if ( input < 0x200000 ) { + *length = 4; + } + else { + *length = 0; // This code won't convert this correctly anyway. + return; + } + + output += *length; + + // Scary scary fall throughs are annotated with carefully designed comments + // to suppress compiler warnings such as -Wimplicit-fallthrough in gcc + switch (*length) { + case 4: + --output; + *output = static_cast((input | BYTE_MARK) & BYTE_MASK); + input >>= 6; + //fall through + case 3: + --output; + *output = static_cast((input | BYTE_MARK) & BYTE_MASK); + input >>= 6; + //fall through + case 2: + --output; + *output = static_cast((input | BYTE_MARK) & BYTE_MASK); + input >>= 6; + //fall through + case 1: + --output; + *output = static_cast(input | FIRST_BYTE_MARK[*length]); + break; + default: + TIXMLASSERT( false ); + } +} + + +const char* XMLUtil::GetCharacterRef( const char* p, char* value, int* length ) +{ + // Presume an entity, and pull it out. + *length = 0; + + if ( *(p+1) == '#' && *(p+2) ) { + unsigned long ucs = 0; + TIXMLASSERT( sizeof( ucs ) >= 4 ); + ptrdiff_t delta = 0; + unsigned mult = 1; + static const char SEMICOLON = ';'; + + if ( *(p+2) == 'x' ) { + // Hexadecimal. + const char* q = p+3; + if ( !(*q) ) { + return 0; + } + + q = strchr( q, SEMICOLON ); + + if ( !q ) { + return 0; + } + TIXMLASSERT( *q == SEMICOLON ); + + delta = q-p; + --q; + + while ( *q != 'x' ) { + unsigned int digit = 0; + + if ( *q >= '0' && *q <= '9' ) { + digit = *q - '0'; + } + else if ( *q >= 'a' && *q <= 'f' ) { + digit = *q - 'a' + 10; + } + else if ( *q >= 'A' && *q <= 'F' ) { + digit = *q - 'A' + 10; + } + else { + return 0; + } + TIXMLASSERT( digit < 16 ); + TIXMLASSERT( digit == 0 || mult <= UINT_MAX / digit ); + const unsigned int digitScaled = mult * digit; + TIXMLASSERT( ucs <= ULONG_MAX - digitScaled ); + ucs += digitScaled; + TIXMLASSERT( mult <= UINT_MAX / 16 ); + mult *= 16; + --q; + } + } + else { + // Decimal. + const char* q = p+2; + if ( !(*q) ) { + return 0; + } + + q = strchr( q, SEMICOLON ); + + if ( !q ) { + return 0; + } + TIXMLASSERT( *q == SEMICOLON ); + + delta = q-p; + --q; + + while ( *q != '#' ) { + if ( *q >= '0' && *q <= '9' ) { + const unsigned int digit = *q - '0'; + TIXMLASSERT( digit < 10 ); + TIXMLASSERT( digit == 0 || mult <= UINT_MAX / digit ); + const unsigned int digitScaled = mult * digit; + TIXMLASSERT( ucs <= ULONG_MAX - digitScaled ); + ucs += digitScaled; + } + else { + return 0; + } + TIXMLASSERT( mult <= UINT_MAX / 10 ); + mult *= 10; + --q; + } + } + // convert the UCS to UTF-8 + ConvertUTF32ToUTF8( ucs, value, length ); + return p + delta + 1; + } + return p+1; +} + + +void XMLUtil::ToStr( int v, char* buffer, int bufferSize ) +{ + TIXML_SNPRINTF( buffer, bufferSize, "%d", v ); +} + + +void XMLUtil::ToStr( unsigned v, char* buffer, int bufferSize ) +{ + TIXML_SNPRINTF( buffer, bufferSize, "%u", v ); +} + + +void XMLUtil::ToStr( bool v, char* buffer, int bufferSize ) +{ + TIXML_SNPRINTF( buffer, bufferSize, "%s", v ? writeBoolTrue : writeBoolFalse); +} + +/* + ToStr() of a number is a very tricky topic. + https://github.com/leethomason/tinyxml2/issues/106 +*/ +void XMLUtil::ToStr( float v, char* buffer, int bufferSize ) +{ + TIXML_SNPRINTF( buffer, bufferSize, "%.8g", v ); +} + + +void XMLUtil::ToStr( double v, char* buffer, int bufferSize ) +{ + TIXML_SNPRINTF( buffer, bufferSize, "%.17g", v ); +} + + +void XMLUtil::ToStr( int64_t v, char* buffer, int bufferSize ) +{ + // horrible syntax trick to make the compiler happy about %lld + TIXML_SNPRINTF(buffer, bufferSize, "%lld", static_cast(v)); +} + +void XMLUtil::ToStr( uint64_t v, char* buffer, int bufferSize ) +{ + // horrible syntax trick to make the compiler happy about %llu + TIXML_SNPRINTF(buffer, bufferSize, "%llu", (long long)v); +} + +bool XMLUtil::ToInt( const char* str, int* value ) +{ + if ( TIXML_SSCANF( str, "%d", value ) == 1 ) { + return true; + } + return false; +} + +bool XMLUtil::ToUnsigned( const char* str, unsigned *value ) +{ + if ( TIXML_SSCANF( str, "%u", value ) == 1 ) { + return true; + } + return false; +} + +bool XMLUtil::ToBool( const char* str, bool* value ) +{ + int ival = 0; + if ( ToInt( str, &ival )) { + *value = (ival==0) ? false : true; + return true; + } + static const char* TRUE_VALS[] = { "true", "True", "TRUE", 0 }; + static const char* FALSE_VALS[] = { "false", "False", "FALSE", 0 }; + + for (int i = 0; TRUE_VALS[i]; ++i) { + if (StringEqual(str, TRUE_VALS[i])) { + *value = true; + return true; + } + } + for (int i = 0; FALSE_VALS[i]; ++i) { + if (StringEqual(str, FALSE_VALS[i])) { + *value = false; + return true; + } + } + return false; +} + + +bool XMLUtil::ToFloat( const char* str, float* value ) +{ + if ( TIXML_SSCANF( str, "%f", value ) == 1 ) { + return true; + } + return false; +} + + +bool XMLUtil::ToDouble( const char* str, double* value ) +{ + if ( TIXML_SSCANF( str, "%lf", value ) == 1 ) { + return true; + } + return false; +} + + +bool XMLUtil::ToInt64(const char* str, int64_t* value) +{ + long long v = 0; // horrible syntax trick to make the compiler happy about %lld + if (TIXML_SSCANF(str, "%lld", &v) == 1) { + *value = static_cast(v); + return true; + } + return false; +} + + +bool XMLUtil::ToUnsigned64(const char* str, uint64_t* value) { + unsigned long long v = 0; // horrible syntax trick to make the compiler happy about %llu + if(TIXML_SSCANF(str, "%llu", &v) == 1) { + *value = (uint64_t)v; + return true; + } + return false; +} + + +char* XMLDocument::Identify( char* p, XMLNode** node ) +{ + TIXMLASSERT( node ); + TIXMLASSERT( p ); + char* const start = p; + int const startLine = _parseCurLineNum; + p = XMLUtil::SkipWhiteSpace( p, &_parseCurLineNum ); + if( !*p ) { + *node = 0; + TIXMLASSERT( p ); + return p; + } + + // These strings define the matching patterns: + static const char* xmlHeader = { "( _commentPool ); + returnNode->_parseLineNum = _parseCurLineNum; + p += xmlHeaderLen; + } + else if ( XMLUtil::StringEqual( p, commentHeader, commentHeaderLen ) ) { + returnNode = CreateUnlinkedNode( _commentPool ); + returnNode->_parseLineNum = _parseCurLineNum; + p += commentHeaderLen; + } + else if ( XMLUtil::StringEqual( p, cdataHeader, cdataHeaderLen ) ) { + XMLText* text = CreateUnlinkedNode( _textPool ); + returnNode = text; + returnNode->_parseLineNum = _parseCurLineNum; + p += cdataHeaderLen; + text->SetCData( true ); + } + else if ( XMLUtil::StringEqual( p, dtdHeader, dtdHeaderLen ) ) { + returnNode = CreateUnlinkedNode( _commentPool ); + returnNode->_parseLineNum = _parseCurLineNum; + p += dtdHeaderLen; + } + else if ( XMLUtil::StringEqual( p, elementHeader, elementHeaderLen ) ) { + returnNode = CreateUnlinkedNode( _elementPool ); + returnNode->_parseLineNum = _parseCurLineNum; + p += elementHeaderLen; + } + else { + returnNode = CreateUnlinkedNode( _textPool ); + returnNode->_parseLineNum = _parseCurLineNum; // Report line of first non-whitespace character + p = start; // Back it up, all the text counts. + _parseCurLineNum = startLine; + } + + TIXMLASSERT( returnNode ); + TIXMLASSERT( p ); + *node = returnNode; + return p; +} + + +bool XMLDocument::Accept( XMLVisitor* visitor ) const +{ + TIXMLASSERT( visitor ); + if ( visitor->VisitEnter( *this ) ) { + for ( const XMLNode* node=FirstChild(); node; node=node->NextSibling() ) { + if ( !node->Accept( visitor ) ) { + break; + } + } + } + return visitor->VisitExit( *this ); +} + + +// --------- XMLNode ----------- // + +XMLNode::XMLNode( XMLDocument* doc ) : + _document( doc ), + _parent( 0 ), + _value(), + _parseLineNum( 0 ), + _firstChild( 0 ), _lastChild( 0 ), + _prev( 0 ), _next( 0 ), + _userData( 0 ), + _memPool( 0 ) +{ +} + + +XMLNode::~XMLNode() +{ + DeleteChildren(); + if ( _parent ) { + _parent->Unlink( this ); + } +} + +const char* XMLNode::Value() const +{ + // Edge case: XMLDocuments don't have a Value. Return null. + if ( this->ToDocument() ) + return 0; + return _value.GetStr(); +} + +void XMLNode::SetValue( const char* str, bool staticMem ) +{ + if ( staticMem ) { + _value.SetInternedStr( str ); + } + else { + _value.SetStr( str ); + } +} + +XMLNode* XMLNode::DeepClone(XMLDocument* target) const +{ + XMLNode* clone = this->ShallowClone(target); + if (!clone) return 0; + + for (const XMLNode* child = this->FirstChild(); child; child = child->NextSibling()) { + XMLNode* childClone = child->DeepClone(target); + TIXMLASSERT(childClone); + clone->InsertEndChild(childClone); + } + return clone; +} + +void XMLNode::DeleteChildren() +{ + while( _firstChild ) { + TIXMLASSERT( _lastChild ); + DeleteChild( _firstChild ); + } + _firstChild = _lastChild = 0; +} + + +void XMLNode::Unlink( XMLNode* child ) +{ + TIXMLASSERT( child ); + TIXMLASSERT( child->_document == _document ); + TIXMLASSERT( child->_parent == this ); + if ( child == _firstChild ) { + _firstChild = _firstChild->_next; + } + if ( child == _lastChild ) { + _lastChild = _lastChild->_prev; + } + + if ( child->_prev ) { + child->_prev->_next = child->_next; + } + if ( child->_next ) { + child->_next->_prev = child->_prev; + } + child->_next = 0; + child->_prev = 0; + child->_parent = 0; +} + + +void XMLNode::DeleteChild( XMLNode* node ) +{ + TIXMLASSERT( node ); + TIXMLASSERT( node->_document == _document ); + TIXMLASSERT( node->_parent == this ); + Unlink( node ); + TIXMLASSERT(node->_prev == 0); + TIXMLASSERT(node->_next == 0); + TIXMLASSERT(node->_parent == 0); + DeleteNode( node ); +} + + +XMLNode* XMLNode::InsertEndChild( XMLNode* addThis ) +{ + TIXMLASSERT( addThis ); + if ( addThis->_document != _document ) { + TIXMLASSERT( false ); + return 0; + } + InsertChildPreamble( addThis ); + + if ( _lastChild ) { + TIXMLASSERT( _firstChild ); + TIXMLASSERT( _lastChild->_next == 0 ); + _lastChild->_next = addThis; + addThis->_prev = _lastChild; + _lastChild = addThis; + + addThis->_next = 0; + } + else { + TIXMLASSERT( _firstChild == 0 ); + _firstChild = _lastChild = addThis; + + addThis->_prev = 0; + addThis->_next = 0; + } + addThis->_parent = this; + return addThis; +} + + +XMLNode* XMLNode::InsertFirstChild( XMLNode* addThis ) +{ + TIXMLASSERT( addThis ); + if ( addThis->_document != _document ) { + TIXMLASSERT( false ); + return 0; + } + InsertChildPreamble( addThis ); + + if ( _firstChild ) { + TIXMLASSERT( _lastChild ); + TIXMLASSERT( _firstChild->_prev == 0 ); + + _firstChild->_prev = addThis; + addThis->_next = _firstChild; + _firstChild = addThis; + + addThis->_prev = 0; + } + else { + TIXMLASSERT( _lastChild == 0 ); + _firstChild = _lastChild = addThis; + + addThis->_prev = 0; + addThis->_next = 0; + } + addThis->_parent = this; + return addThis; +} + + +XMLNode* XMLNode::InsertAfterChild( XMLNode* afterThis, XMLNode* addThis ) +{ + TIXMLASSERT( addThis ); + if ( addThis->_document != _document ) { + TIXMLASSERT( false ); + return 0; + } + + TIXMLASSERT( afterThis ); + + if ( afterThis->_parent != this ) { + TIXMLASSERT( false ); + return 0; + } + if ( afterThis == addThis ) { + // Current state: BeforeThis -> AddThis -> OneAfterAddThis + // Now AddThis must disappear from it's location and then + // reappear between BeforeThis and OneAfterAddThis. + // So just leave it where it is. + return addThis; + } + + if ( afterThis->_next == 0 ) { + // The last node or the only node. + return InsertEndChild( addThis ); + } + InsertChildPreamble( addThis ); + addThis->_prev = afterThis; + addThis->_next = afterThis->_next; + afterThis->_next->_prev = addThis; + afterThis->_next = addThis; + addThis->_parent = this; + return addThis; +} + + + + +const XMLElement* XMLNode::FirstChildElement( const char* name ) const +{ + for( const XMLNode* node = _firstChild; node; node = node->_next ) { + const XMLElement* element = node->ToElementWithName( name ); + if ( element ) { + return element; + } + } + return 0; +} + + +const XMLElement* XMLNode::LastChildElement( const char* name ) const +{ + for( const XMLNode* node = _lastChild; node; node = node->_prev ) { + const XMLElement* element = node->ToElementWithName( name ); + if ( element ) { + return element; + } + } + return 0; +} + + +const XMLElement* XMLNode::NextSiblingElement( const char* name ) const +{ + for( const XMLNode* node = _next; node; node = node->_next ) { + const XMLElement* element = node->ToElementWithName( name ); + if ( element ) { + return element; + } + } + return 0; +} + + +const XMLElement* XMLNode::PreviousSiblingElement( const char* name ) const +{ + for( const XMLNode* node = _prev; node; node = node->_prev ) { + const XMLElement* element = node->ToElementWithName( name ); + if ( element ) { + return element; + } + } + return 0; +} + + +char* XMLNode::ParseDeep( char* p, StrPair* parentEndTag, int* curLineNumPtr ) +{ + // This is a recursive method, but thinking about it "at the current level" + // it is a pretty simple flat list: + // + // + // + // With a special case: + // + // + // + // + // Where the closing element (/foo) *must* be the next thing after the opening + // element, and the names must match. BUT the tricky bit is that the closing + // element will be read by the child. + // + // 'endTag' is the end tag for this node, it is returned by a call to a child. + // 'parentEnd' is the end tag for the parent, which is filled in and returned. + + XMLDocument::DepthTracker tracker(_document); + if (_document->Error()) + return 0; + + while( p && *p ) { + XMLNode* node = 0; + + p = _document->Identify( p, &node ); + TIXMLASSERT( p ); + if ( node == 0 ) { + break; + } + + const int initialLineNum = node->_parseLineNum; + + StrPair endTag; + p = node->ParseDeep( p, &endTag, curLineNumPtr ); + if ( !p ) { + DeleteNode( node ); + if ( !_document->Error() ) { + _document->SetError( XML_ERROR_PARSING, initialLineNum, 0); + } + break; + } + + const XMLDeclaration* const decl = node->ToDeclaration(); + if ( decl ) { + // Declarations are only allowed at document level + // + // Multiple declarations are allowed but all declarations + // must occur before anything else. + // + // Optimized due to a security test case. If the first node is + // a declaration, and the last node is a declaration, then only + // declarations have so far been added. + bool wellLocated = false; + + if (ToDocument()) { + if (FirstChild()) { + wellLocated = + FirstChild() && + FirstChild()->ToDeclaration() && + LastChild() && + LastChild()->ToDeclaration(); + } + else { + wellLocated = true; + } + } + if ( !wellLocated ) { + _document->SetError( XML_ERROR_PARSING_DECLARATION, initialLineNum, "XMLDeclaration value=%s", decl->Value()); + DeleteNode( node ); + break; + } + } + + XMLElement* ele = node->ToElement(); + if ( ele ) { + // We read the end tag. Return it to the parent. + if ( ele->ClosingType() == XMLElement::CLOSING ) { + if ( parentEndTag ) { + ele->_value.TransferTo( parentEndTag ); + } + node->_memPool->SetTracked(); // created and then immediately deleted. + DeleteNode( node ); + return p; + } + + // Handle an end tag returned to this level. + // And handle a bunch of annoying errors. + bool mismatch = false; + if ( endTag.Empty() ) { + if ( ele->ClosingType() == XMLElement::OPEN ) { + mismatch = true; + } + } + else { + if ( ele->ClosingType() != XMLElement::OPEN ) { + mismatch = true; + } + else if ( !XMLUtil::StringEqual( endTag.GetStr(), ele->Name() ) ) { + mismatch = true; + } + } + if ( mismatch ) { + _document->SetError( XML_ERROR_MISMATCHED_ELEMENT, initialLineNum, "XMLElement name=%s", ele->Name()); + DeleteNode( node ); + break; + } + } + InsertEndChild( node ); + } + return 0; +} + +/*static*/ void XMLNode::DeleteNode( XMLNode* node ) +{ + if ( node == 0 ) { + return; + } + TIXMLASSERT(node->_document); + if (!node->ToDocument()) { + node->_document->MarkInUse(node); + } + + MemPool* pool = node->_memPool; + node->~XMLNode(); + pool->Free( node ); +} + +void XMLNode::InsertChildPreamble( XMLNode* insertThis ) const +{ + TIXMLASSERT( insertThis ); + TIXMLASSERT( insertThis->_document == _document ); + + if (insertThis->_parent) { + insertThis->_parent->Unlink( insertThis ); + } + else { + insertThis->_document->MarkInUse(insertThis); + insertThis->_memPool->SetTracked(); + } +} + +const XMLElement* XMLNode::ToElementWithName( const char* name ) const +{ + const XMLElement* element = this->ToElement(); + if ( element == 0 ) { + return 0; + } + if ( name == 0 ) { + return element; + } + if ( XMLUtil::StringEqual( element->Name(), name ) ) { + return element; + } + return 0; +} + +// --------- XMLText ---------- // +char* XMLText::ParseDeep( char* p, StrPair*, int* curLineNumPtr ) +{ + if ( this->CData() ) { + p = _value.ParseText( p, "]]>", StrPair::NEEDS_NEWLINE_NORMALIZATION, curLineNumPtr ); + if ( !p ) { + _document->SetError( XML_ERROR_PARSING_CDATA, _parseLineNum, 0 ); + } + return p; + } + else { + int flags = _document->ProcessEntities() ? StrPair::TEXT_ELEMENT : StrPair::TEXT_ELEMENT_LEAVE_ENTITIES; + if ( _document->WhitespaceMode() == COLLAPSE_WHITESPACE ) { + flags |= StrPair::NEEDS_WHITESPACE_COLLAPSING; + } + + p = _value.ParseText( p, "<", flags, curLineNumPtr ); + if ( p && *p ) { + return p-1; + } + if ( !p ) { + _document->SetError( XML_ERROR_PARSING_TEXT, _parseLineNum, 0 ); + } + } + return 0; +} + + +XMLNode* XMLText::ShallowClone( XMLDocument* doc ) const +{ + if ( !doc ) { + doc = _document; + } + XMLText* text = doc->NewText( Value() ); // fixme: this will always allocate memory. Intern? + text->SetCData( this->CData() ); + return text; +} + + +bool XMLText::ShallowEqual( const XMLNode* compare ) const +{ + TIXMLASSERT( compare ); + const XMLText* text = compare->ToText(); + return ( text && XMLUtil::StringEqual( text->Value(), Value() ) ); +} + + +bool XMLText::Accept( XMLVisitor* visitor ) const +{ + TIXMLASSERT( visitor ); + return visitor->Visit( *this ); +} + + +// --------- XMLComment ---------- // + +XMLComment::XMLComment( XMLDocument* doc ) : XMLNode( doc ) +{ +} + + +XMLComment::~XMLComment() +{ +} + + +char* XMLComment::ParseDeep( char* p, StrPair*, int* curLineNumPtr ) +{ + // Comment parses as text. + p = _value.ParseText( p, "-->", StrPair::COMMENT, curLineNumPtr ); + if ( p == 0 ) { + _document->SetError( XML_ERROR_PARSING_COMMENT, _parseLineNum, 0 ); + } + return p; +} + + +XMLNode* XMLComment::ShallowClone( XMLDocument* doc ) const +{ + if ( !doc ) { + doc = _document; + } + XMLComment* comment = doc->NewComment( Value() ); // fixme: this will always allocate memory. Intern? + return comment; +} + + +bool XMLComment::ShallowEqual( const XMLNode* compare ) const +{ + TIXMLASSERT( compare ); + const XMLComment* comment = compare->ToComment(); + return ( comment && XMLUtil::StringEqual( comment->Value(), Value() )); +} + + +bool XMLComment::Accept( XMLVisitor* visitor ) const +{ + TIXMLASSERT( visitor ); + return visitor->Visit( *this ); +} + + +// --------- XMLDeclaration ---------- // + +XMLDeclaration::XMLDeclaration( XMLDocument* doc ) : XMLNode( doc ) +{ +} + + +XMLDeclaration::~XMLDeclaration() +{ + //printf( "~XMLDeclaration\n" ); +} + + +char* XMLDeclaration::ParseDeep( char* p, StrPair*, int* curLineNumPtr ) +{ + // Declaration parses as text. + p = _value.ParseText( p, "?>", StrPair::NEEDS_NEWLINE_NORMALIZATION, curLineNumPtr ); + if ( p == 0 ) { + _document->SetError( XML_ERROR_PARSING_DECLARATION, _parseLineNum, 0 ); + } + return p; +} + + +XMLNode* XMLDeclaration::ShallowClone( XMLDocument* doc ) const +{ + if ( !doc ) { + doc = _document; + } + XMLDeclaration* dec = doc->NewDeclaration( Value() ); // fixme: this will always allocate memory. Intern? + return dec; +} + + +bool XMLDeclaration::ShallowEqual( const XMLNode* compare ) const +{ + TIXMLASSERT( compare ); + const XMLDeclaration* declaration = compare->ToDeclaration(); + return ( declaration && XMLUtil::StringEqual( declaration->Value(), Value() )); +} + + + +bool XMLDeclaration::Accept( XMLVisitor* visitor ) const +{ + TIXMLASSERT( visitor ); + return visitor->Visit( *this ); +} + +// --------- XMLUnknown ---------- // + +XMLUnknown::XMLUnknown( XMLDocument* doc ) : XMLNode( doc ) +{ +} + + +XMLUnknown::~XMLUnknown() +{ +} + + +char* XMLUnknown::ParseDeep( char* p, StrPair*, int* curLineNumPtr ) +{ + // Unknown parses as text. + p = _value.ParseText( p, ">", StrPair::NEEDS_NEWLINE_NORMALIZATION, curLineNumPtr ); + if ( !p ) { + _document->SetError( XML_ERROR_PARSING_UNKNOWN, _parseLineNum, 0 ); + } + return p; +} + + +XMLNode* XMLUnknown::ShallowClone( XMLDocument* doc ) const +{ + if ( !doc ) { + doc = _document; + } + XMLUnknown* text = doc->NewUnknown( Value() ); // fixme: this will always allocate memory. Intern? + return text; +} + + +bool XMLUnknown::ShallowEqual( const XMLNode* compare ) const +{ + TIXMLASSERT( compare ); + const XMLUnknown* unknown = compare->ToUnknown(); + return ( unknown && XMLUtil::StringEqual( unknown->Value(), Value() )); +} + + +bool XMLUnknown::Accept( XMLVisitor* visitor ) const +{ + TIXMLASSERT( visitor ); + return visitor->Visit( *this ); +} + +// --------- XMLAttribute ---------- // + +const char* XMLAttribute::Name() const +{ + return _name.GetStr(); +} + +const char* XMLAttribute::Value() const +{ + return _value.GetStr(); +} + +char* XMLAttribute::ParseDeep( char* p, bool processEntities, int* curLineNumPtr ) +{ + // Parse using the name rules: bug fix, was using ParseText before + p = _name.ParseName( p ); + if ( !p || !*p ) { + return 0; + } + + // Skip white space before = + p = XMLUtil::SkipWhiteSpace( p, curLineNumPtr ); + if ( *p != '=' ) { + return 0; + } + + ++p; // move up to opening quote + p = XMLUtil::SkipWhiteSpace( p, curLineNumPtr ); + if ( *p != '\"' && *p != '\'' ) { + return 0; + } + + const char endTag[2] = { *p, 0 }; + ++p; // move past opening quote + + p = _value.ParseText( p, endTag, processEntities ? StrPair::ATTRIBUTE_VALUE : StrPair::ATTRIBUTE_VALUE_LEAVE_ENTITIES, curLineNumPtr ); + return p; +} + + +void XMLAttribute::SetName( const char* n ) +{ + _name.SetStr( n ); +} + + +XMLError XMLAttribute::QueryIntValue( int* value ) const +{ + if ( XMLUtil::ToInt( Value(), value )) { + return XML_SUCCESS; + } + return XML_WRONG_ATTRIBUTE_TYPE; +} + + +XMLError XMLAttribute::QueryUnsignedValue( unsigned int* value ) const +{ + if ( XMLUtil::ToUnsigned( Value(), value )) { + return XML_SUCCESS; + } + return XML_WRONG_ATTRIBUTE_TYPE; +} + + +XMLError XMLAttribute::QueryInt64Value(int64_t* value) const +{ + if (XMLUtil::ToInt64(Value(), value)) { + return XML_SUCCESS; + } + return XML_WRONG_ATTRIBUTE_TYPE; +} + + +XMLError XMLAttribute::QueryUnsigned64Value(uint64_t* value) const +{ + if(XMLUtil::ToUnsigned64(Value(), value)) { + return XML_SUCCESS; + } + return XML_WRONG_ATTRIBUTE_TYPE; +} + + +XMLError XMLAttribute::QueryBoolValue( bool* value ) const +{ + if ( XMLUtil::ToBool( Value(), value )) { + return XML_SUCCESS; + } + return XML_WRONG_ATTRIBUTE_TYPE; +} + + +XMLError XMLAttribute::QueryFloatValue( float* value ) const +{ + if ( XMLUtil::ToFloat( Value(), value )) { + return XML_SUCCESS; + } + return XML_WRONG_ATTRIBUTE_TYPE; +} + + +XMLError XMLAttribute::QueryDoubleValue( double* value ) const +{ + if ( XMLUtil::ToDouble( Value(), value )) { + return XML_SUCCESS; + } + return XML_WRONG_ATTRIBUTE_TYPE; +} + + +void XMLAttribute::SetAttribute( const char* v ) +{ + _value.SetStr( v ); +} + + +void XMLAttribute::SetAttribute( int v ) +{ + char buf[BUF_SIZE]; + XMLUtil::ToStr( v, buf, BUF_SIZE ); + _value.SetStr( buf ); +} + + +void XMLAttribute::SetAttribute( unsigned v ) +{ + char buf[BUF_SIZE]; + XMLUtil::ToStr( v, buf, BUF_SIZE ); + _value.SetStr( buf ); +} + + +void XMLAttribute::SetAttribute(int64_t v) +{ + char buf[BUF_SIZE]; + XMLUtil::ToStr(v, buf, BUF_SIZE); + _value.SetStr(buf); +} + +void XMLAttribute::SetAttribute(uint64_t v) +{ + char buf[BUF_SIZE]; + XMLUtil::ToStr(v, buf, BUF_SIZE); + _value.SetStr(buf); +} + + +void XMLAttribute::SetAttribute( bool v ) +{ + char buf[BUF_SIZE]; + XMLUtil::ToStr( v, buf, BUF_SIZE ); + _value.SetStr( buf ); +} + +void XMLAttribute::SetAttribute( double v ) +{ + char buf[BUF_SIZE]; + XMLUtil::ToStr( v, buf, BUF_SIZE ); + _value.SetStr( buf ); +} + +void XMLAttribute::SetAttribute( float v ) +{ + char buf[BUF_SIZE]; + XMLUtil::ToStr( v, buf, BUF_SIZE ); + _value.SetStr( buf ); +} + + +// --------- XMLElement ---------- // +XMLElement::XMLElement( XMLDocument* doc ) : XMLNode( doc ), + _closingType( OPEN ), + _rootAttribute( 0 ) +{ +} + + +XMLElement::~XMLElement() +{ + while( _rootAttribute ) { + XMLAttribute* next = _rootAttribute->_next; + DeleteAttribute( _rootAttribute ); + _rootAttribute = next; + } +} + + +const XMLAttribute* XMLElement::FindAttribute( const char* name ) const +{ + for( XMLAttribute* a = _rootAttribute; a; a = a->_next ) { + if ( XMLUtil::StringEqual( a->Name(), name ) ) { + return a; + } + } + return 0; +} + + +const char* XMLElement::Attribute( const char* name, const char* value ) const +{ + const XMLAttribute* a = FindAttribute( name ); + if ( !a ) { + return 0; + } + if ( !value || XMLUtil::StringEqual( a->Value(), value )) { + return a->Value(); + } + return 0; +} + +int XMLElement::IntAttribute(const char* name, int defaultValue) const +{ + int i = defaultValue; + QueryIntAttribute(name, &i); + return i; +} + +unsigned XMLElement::UnsignedAttribute(const char* name, unsigned defaultValue) const +{ + unsigned i = defaultValue; + QueryUnsignedAttribute(name, &i); + return i; +} + +int64_t XMLElement::Int64Attribute(const char* name, int64_t defaultValue) const +{ + int64_t i = defaultValue; + QueryInt64Attribute(name, &i); + return i; +} + +uint64_t XMLElement::Unsigned64Attribute(const char* name, uint64_t defaultValue) const +{ + uint64_t i = defaultValue; + QueryUnsigned64Attribute(name, &i); + return i; +} + +bool XMLElement::BoolAttribute(const char* name, bool defaultValue) const +{ + bool b = defaultValue; + QueryBoolAttribute(name, &b); + return b; +} + +double XMLElement::DoubleAttribute(const char* name, double defaultValue) const +{ + double d = defaultValue; + QueryDoubleAttribute(name, &d); + return d; +} + +float XMLElement::FloatAttribute(const char* name, float defaultValue) const +{ + float f = defaultValue; + QueryFloatAttribute(name, &f); + return f; +} + +const char* XMLElement::GetText() const +{ + if ( FirstChild() && FirstChild()->ToText() ) { + return FirstChild()->Value(); + } + return 0; +} + + +void XMLElement::SetText( const char* inText ) +{ + if ( FirstChild() && FirstChild()->ToText() ) + FirstChild()->SetValue( inText ); + else { + XMLText* theText = GetDocument()->NewText( inText ); + InsertFirstChild( theText ); + } +} + + +void XMLElement::SetText( int v ) +{ + char buf[BUF_SIZE]; + XMLUtil::ToStr( v, buf, BUF_SIZE ); + SetText( buf ); +} + + +void XMLElement::SetText( unsigned v ) +{ + char buf[BUF_SIZE]; + XMLUtil::ToStr( v, buf, BUF_SIZE ); + SetText( buf ); +} + + +void XMLElement::SetText(int64_t v) +{ + char buf[BUF_SIZE]; + XMLUtil::ToStr(v, buf, BUF_SIZE); + SetText(buf); +} + +void XMLElement::SetText(uint64_t v) { + char buf[BUF_SIZE]; + XMLUtil::ToStr(v, buf, BUF_SIZE); + SetText(buf); +} + + +void XMLElement::SetText( bool v ) +{ + char buf[BUF_SIZE]; + XMLUtil::ToStr( v, buf, BUF_SIZE ); + SetText( buf ); +} + + +void XMLElement::SetText( float v ) +{ + char buf[BUF_SIZE]; + XMLUtil::ToStr( v, buf, BUF_SIZE ); + SetText( buf ); +} + + +void XMLElement::SetText( double v ) +{ + char buf[BUF_SIZE]; + XMLUtil::ToStr( v, buf, BUF_SIZE ); + SetText( buf ); +} + + +XMLError XMLElement::QueryIntText( int* ival ) const +{ + if ( FirstChild() && FirstChild()->ToText() ) { + const char* t = FirstChild()->Value(); + if ( XMLUtil::ToInt( t, ival ) ) { + return XML_SUCCESS; + } + return XML_CAN_NOT_CONVERT_TEXT; + } + return XML_NO_TEXT_NODE; +} + + +XMLError XMLElement::QueryUnsignedText( unsigned* uval ) const +{ + if ( FirstChild() && FirstChild()->ToText() ) { + const char* t = FirstChild()->Value(); + if ( XMLUtil::ToUnsigned( t, uval ) ) { + return XML_SUCCESS; + } + return XML_CAN_NOT_CONVERT_TEXT; + } + return XML_NO_TEXT_NODE; +} + + +XMLError XMLElement::QueryInt64Text(int64_t* ival) const +{ + if (FirstChild() && FirstChild()->ToText()) { + const char* t = FirstChild()->Value(); + if (XMLUtil::ToInt64(t, ival)) { + return XML_SUCCESS; + } + return XML_CAN_NOT_CONVERT_TEXT; + } + return XML_NO_TEXT_NODE; +} + + +XMLError XMLElement::QueryUnsigned64Text(uint64_t* ival) const +{ + if(FirstChild() && FirstChild()->ToText()) { + const char* t = FirstChild()->Value(); + if(XMLUtil::ToUnsigned64(t, ival)) { + return XML_SUCCESS; + } + return XML_CAN_NOT_CONVERT_TEXT; + } + return XML_NO_TEXT_NODE; +} + + +XMLError XMLElement::QueryBoolText( bool* bval ) const +{ + if ( FirstChild() && FirstChild()->ToText() ) { + const char* t = FirstChild()->Value(); + if ( XMLUtil::ToBool( t, bval ) ) { + return XML_SUCCESS; + } + return XML_CAN_NOT_CONVERT_TEXT; + } + return XML_NO_TEXT_NODE; +} + + +XMLError XMLElement::QueryDoubleText( double* dval ) const +{ + if ( FirstChild() && FirstChild()->ToText() ) { + const char* t = FirstChild()->Value(); + if ( XMLUtil::ToDouble( t, dval ) ) { + return XML_SUCCESS; + } + return XML_CAN_NOT_CONVERT_TEXT; + } + return XML_NO_TEXT_NODE; +} + + +XMLError XMLElement::QueryFloatText( float* fval ) const +{ + if ( FirstChild() && FirstChild()->ToText() ) { + const char* t = FirstChild()->Value(); + if ( XMLUtil::ToFloat( t, fval ) ) { + return XML_SUCCESS; + } + return XML_CAN_NOT_CONVERT_TEXT; + } + return XML_NO_TEXT_NODE; +} + +int XMLElement::IntText(int defaultValue) const +{ + int i = defaultValue; + QueryIntText(&i); + return i; +} + +unsigned XMLElement::UnsignedText(unsigned defaultValue) const +{ + unsigned i = defaultValue; + QueryUnsignedText(&i); + return i; +} + +int64_t XMLElement::Int64Text(int64_t defaultValue) const +{ + int64_t i = defaultValue; + QueryInt64Text(&i); + return i; +} + +uint64_t XMLElement::Unsigned64Text(uint64_t defaultValue) const +{ + uint64_t i = defaultValue; + QueryUnsigned64Text(&i); + return i; +} + +bool XMLElement::BoolText(bool defaultValue) const +{ + bool b = defaultValue; + QueryBoolText(&b); + return b; +} + +double XMLElement::DoubleText(double defaultValue) const +{ + double d = defaultValue; + QueryDoubleText(&d); + return d; +} + +float XMLElement::FloatText(float defaultValue) const +{ + float f = defaultValue; + QueryFloatText(&f); + return f; +} + + +XMLAttribute* XMLElement::FindOrCreateAttribute( const char* name ) +{ + XMLAttribute* last = 0; + XMLAttribute* attrib = 0; + for( attrib = _rootAttribute; + attrib; + last = attrib, attrib = attrib->_next ) { + if ( XMLUtil::StringEqual( attrib->Name(), name ) ) { + break; + } + } + if ( !attrib ) { + attrib = CreateAttribute(); + TIXMLASSERT( attrib ); + if ( last ) { + TIXMLASSERT( last->_next == 0 ); + last->_next = attrib; + } + else { + TIXMLASSERT( _rootAttribute == 0 ); + _rootAttribute = attrib; + } + attrib->SetName( name ); + } + return attrib; +} + + +void XMLElement::DeleteAttribute( const char* name ) +{ + XMLAttribute* prev = 0; + for( XMLAttribute* a=_rootAttribute; a; a=a->_next ) { + if ( XMLUtil::StringEqual( name, a->Name() ) ) { + if ( prev ) { + prev->_next = a->_next; + } + else { + _rootAttribute = a->_next; + } + DeleteAttribute( a ); + break; + } + prev = a; + } +} + + +char* XMLElement::ParseAttributes( char* p, int* curLineNumPtr ) +{ + XMLAttribute* prevAttribute = 0; + + // Read the attributes. + while( p ) { + p = XMLUtil::SkipWhiteSpace( p, curLineNumPtr ); + if ( !(*p) ) { + _document->SetError( XML_ERROR_PARSING_ELEMENT, _parseLineNum, "XMLElement name=%s", Name() ); + return 0; + } + + // attribute. + if (XMLUtil::IsNameStartChar( *p ) ) { + XMLAttribute* attrib = CreateAttribute(); + TIXMLASSERT( attrib ); + attrib->_parseLineNum = _document->_parseCurLineNum; + + const int attrLineNum = attrib->_parseLineNum; + + p = attrib->ParseDeep( p, _document->ProcessEntities(), curLineNumPtr ); + if ( !p || Attribute( attrib->Name() ) ) { + DeleteAttribute( attrib ); + _document->SetError( XML_ERROR_PARSING_ATTRIBUTE, attrLineNum, "XMLElement name=%s", Name() ); + return 0; + } + // There is a minor bug here: if the attribute in the source xml + // document is duplicated, it will not be detected and the + // attribute will be doubly added. However, tracking the 'prevAttribute' + // avoids re-scanning the attribute list. Preferring performance for + // now, may reconsider in the future. + if ( prevAttribute ) { + TIXMLASSERT( prevAttribute->_next == 0 ); + prevAttribute->_next = attrib; + } + else { + TIXMLASSERT( _rootAttribute == 0 ); + _rootAttribute = attrib; + } + prevAttribute = attrib; + } + // end of the tag + else if ( *p == '>' ) { + ++p; + break; + } + // end of the tag + else if ( *p == '/' && *(p+1) == '>' ) { + _closingType = CLOSED; + return p+2; // done; sealed element. + } + else { + _document->SetError( XML_ERROR_PARSING_ELEMENT, _parseLineNum, 0 ); + return 0; + } + } + return p; +} + +void XMLElement::DeleteAttribute( XMLAttribute* attribute ) +{ + if ( attribute == 0 ) { + return; + } + MemPool* pool = attribute->_memPool; + attribute->~XMLAttribute(); + pool->Free( attribute ); +} + +XMLAttribute* XMLElement::CreateAttribute() +{ + TIXMLASSERT( sizeof( XMLAttribute ) == _document->_attributePool.ItemSize() ); + XMLAttribute* attrib = new (_document->_attributePool.Alloc() ) XMLAttribute(); + TIXMLASSERT( attrib ); + attrib->_memPool = &_document->_attributePool; + attrib->_memPool->SetTracked(); + return attrib; +} + + +XMLElement* XMLElement::InsertNewChildElement(const char* name) +{ + XMLElement* node = _document->NewElement(name); + return InsertEndChild(node) ? node : 0; +} + +XMLComment* XMLElement::InsertNewComment(const char* comment) +{ + XMLComment* node = _document->NewComment(comment); + return InsertEndChild(node) ? node : 0; +} + +XMLText* XMLElement::InsertNewText(const char* text) +{ + XMLText* node = _document->NewText(text); + return InsertEndChild(node) ? node : 0; +} + +XMLDeclaration* XMLElement::InsertNewDeclaration(const char* text) +{ + XMLDeclaration* node = _document->NewDeclaration(text); + return InsertEndChild(node) ? node : 0; +} + +XMLUnknown* XMLElement::InsertNewUnknown(const char* text) +{ + XMLUnknown* node = _document->NewUnknown(text); + return InsertEndChild(node) ? node : 0; +} + + + +// +// +// foobar +// +char* XMLElement::ParseDeep( char* p, StrPair* parentEndTag, int* curLineNumPtr ) +{ + // Read the element name. + p = XMLUtil::SkipWhiteSpace( p, curLineNumPtr ); + + // The closing element is the form. It is + // parsed just like a regular element then deleted from + // the DOM. + if ( *p == '/' ) { + _closingType = CLOSING; + ++p; + } + + p = _value.ParseName( p ); + if ( _value.Empty() ) { + return 0; + } + + p = ParseAttributes( p, curLineNumPtr ); + if ( !p || !*p || _closingType != OPEN ) { + return p; + } + + p = XMLNode::ParseDeep( p, parentEndTag, curLineNumPtr ); + return p; +} + + + +XMLNode* XMLElement::ShallowClone( XMLDocument* doc ) const +{ + if ( !doc ) { + doc = _document; + } + XMLElement* element = doc->NewElement( Value() ); // fixme: this will always allocate memory. Intern? + for( const XMLAttribute* a=FirstAttribute(); a; a=a->Next() ) { + element->SetAttribute( a->Name(), a->Value() ); // fixme: this will always allocate memory. Intern? + } + return element; +} + + +bool XMLElement::ShallowEqual( const XMLNode* compare ) const +{ + TIXMLASSERT( compare ); + const XMLElement* other = compare->ToElement(); + if ( other && XMLUtil::StringEqual( other->Name(), Name() )) { + + const XMLAttribute* a=FirstAttribute(); + const XMLAttribute* b=other->FirstAttribute(); + + while ( a && b ) { + if ( !XMLUtil::StringEqual( a->Value(), b->Value() ) ) { + return false; + } + a = a->Next(); + b = b->Next(); + } + if ( a || b ) { + // different count + return false; + } + return true; + } + return false; +} + + +bool XMLElement::Accept( XMLVisitor* visitor ) const +{ + TIXMLASSERT( visitor ); + if ( visitor->VisitEnter( *this, _rootAttribute ) ) { + for ( const XMLNode* node=FirstChild(); node; node=node->NextSibling() ) { + if ( !node->Accept( visitor ) ) { + break; + } + } + } + return visitor->VisitExit( *this ); +} + + +// --------- XMLDocument ----------- // + +// Warning: List must match 'enum XMLError' +const char* XMLDocument::_errorNames[XML_ERROR_COUNT] = { + "XML_SUCCESS", + "XML_NO_ATTRIBUTE", + "XML_WRONG_ATTRIBUTE_TYPE", + "XML_ERROR_FILE_NOT_FOUND", + "XML_ERROR_FILE_COULD_NOT_BE_OPENED", + "XML_ERROR_FILE_READ_ERROR", + "XML_ERROR_PARSING_ELEMENT", + "XML_ERROR_PARSING_ATTRIBUTE", + "XML_ERROR_PARSING_TEXT", + "XML_ERROR_PARSING_CDATA", + "XML_ERROR_PARSING_COMMENT", + "XML_ERROR_PARSING_DECLARATION", + "XML_ERROR_PARSING_UNKNOWN", + "XML_ERROR_EMPTY_DOCUMENT", + "XML_ERROR_MISMATCHED_ELEMENT", + "XML_ERROR_PARSING", + "XML_CAN_NOT_CONVERT_TEXT", + "XML_NO_TEXT_NODE", + "XML_ELEMENT_DEPTH_EXCEEDED" +}; + + +XMLDocument::XMLDocument( bool processEntities, Whitespace whitespaceMode ) : + XMLNode( 0 ), + _writeBOM( false ), + _processEntities( processEntities ), + _errorID(XML_SUCCESS), + _whitespaceMode( whitespaceMode ), + _errorStr(), + _errorLineNum( 0 ), + _charBuffer( 0 ), + _parseCurLineNum( 0 ), + _parsingDepth(0), + _unlinked(), + _elementPool(), + _attributePool(), + _textPool(), + _commentPool() +{ + // avoid VC++ C4355 warning about 'this' in initializer list (C4355 is off by default in VS2012+) + _document = this; +} + + +XMLDocument::~XMLDocument() +{ + Clear(); +} + + +void XMLDocument::MarkInUse(const XMLNode* const node) +{ + TIXMLASSERT(node); + TIXMLASSERT(node->_parent == 0); + + for (int i = 0; i < _unlinked.Size(); ++i) { + if (node == _unlinked[i]) { + _unlinked.SwapRemove(i); + break; + } + } +} + +void XMLDocument::Clear() +{ + DeleteChildren(); + while( _unlinked.Size()) { + DeleteNode(_unlinked[0]); // Will remove from _unlinked as part of delete. + } + +#ifdef TINYXML2_DEBUG + const bool hadError = Error(); +#endif + ClearError(); + + delete [] _charBuffer; + _charBuffer = 0; + _parsingDepth = 0; + +#if 0 + _textPool.Trace( "text" ); + _elementPool.Trace( "element" ); + _commentPool.Trace( "comment" ); + _attributePool.Trace( "attribute" ); +#endif + +#ifdef TINYXML2_DEBUG + if ( !hadError ) { + TIXMLASSERT( _elementPool.CurrentAllocs() == _elementPool.Untracked() ); + TIXMLASSERT( _attributePool.CurrentAllocs() == _attributePool.Untracked() ); + TIXMLASSERT( _textPool.CurrentAllocs() == _textPool.Untracked() ); + TIXMLASSERT( _commentPool.CurrentAllocs() == _commentPool.Untracked() ); + } +#endif +} + + +void XMLDocument::DeepCopy(XMLDocument* target) const +{ + TIXMLASSERT(target); + if (target == this) { + return; // technically success - a no-op. + } + + target->Clear(); + for (const XMLNode* node = this->FirstChild(); node; node = node->NextSibling()) { + target->InsertEndChild(node->DeepClone(target)); + } +} + +XMLElement* XMLDocument::NewElement( const char* name ) +{ + XMLElement* ele = CreateUnlinkedNode( _elementPool ); + ele->SetName( name ); + return ele; +} + + +XMLComment* XMLDocument::NewComment( const char* str ) +{ + XMLComment* comment = CreateUnlinkedNode( _commentPool ); + comment->SetValue( str ); + return comment; +} + + +XMLText* XMLDocument::NewText( const char* str ) +{ + XMLText* text = CreateUnlinkedNode( _textPool ); + text->SetValue( str ); + return text; +} + + +XMLDeclaration* XMLDocument::NewDeclaration( const char* str ) +{ + XMLDeclaration* dec = CreateUnlinkedNode( _commentPool ); + dec->SetValue( str ? str : "xml version=\"1.0\" encoding=\"UTF-8\"" ); + return dec; +} + + +XMLUnknown* XMLDocument::NewUnknown( const char* str ) +{ + XMLUnknown* unk = CreateUnlinkedNode( _commentPool ); + unk->SetValue( str ); + return unk; +} + +static FILE* callfopen( const char* filepath, const char* mode ) +{ + TIXMLASSERT( filepath ); + TIXMLASSERT( mode ); +#if defined(_MSC_VER) && (_MSC_VER >= 1400 ) && (!defined WINCE) + FILE* fp = 0; + const errno_t err = fopen_s( &fp, filepath, mode ); + if ( err ) { + return 0; + } +#else + FILE* fp = fopen( filepath, mode ); +#endif + return fp; +} + +void XMLDocument::DeleteNode( XMLNode* node ) { + TIXMLASSERT( node ); + TIXMLASSERT(node->_document == this ); + if (node->_parent) { + node->_parent->DeleteChild( node ); + } + else { + // Isn't in the tree. + // Use the parent delete. + // Also, we need to mark it tracked: we 'know' + // it was never used. + node->_memPool->SetTracked(); + // Call the static XMLNode version: + XMLNode::DeleteNode(node); + } +} + + +XMLError XMLDocument::LoadFile( const char* filename ) +{ + if ( !filename ) { + TIXMLASSERT( false ); + SetError( XML_ERROR_FILE_COULD_NOT_BE_OPENED, 0, "filename=" ); + return _errorID; + } + + Clear(); + FILE* fp = callfopen( filename, "rb" ); + if ( !fp ) { + SetError( XML_ERROR_FILE_NOT_FOUND, 0, "filename=%s", filename ); + return _errorID; + } + LoadFile( fp ); + fclose( fp ); + return _errorID; +} + +XMLError XMLDocument::LoadFile( FILE* fp ) +{ + Clear(); + + TIXML_FSEEK( fp, 0, SEEK_SET ); + if ( fgetc( fp ) == EOF && ferror( fp ) != 0 ) { + SetError( XML_ERROR_FILE_READ_ERROR, 0, 0 ); + return _errorID; + } + + TIXML_FSEEK( fp, 0, SEEK_END ); + + unsigned long long filelength; + { + const long long fileLengthSigned = TIXML_FTELL( fp ); + TIXML_FSEEK( fp, 0, SEEK_SET ); + if ( fileLengthSigned == -1L ) { + SetError( XML_ERROR_FILE_READ_ERROR, 0, 0 ); + return _errorID; + } + TIXMLASSERT( fileLengthSigned >= 0 ); + filelength = static_cast(fileLengthSigned); + } + + const size_t maxSizeT = static_cast(-1); + // We'll do the comparison as an unsigned long long, because that's guaranteed to be at + // least 8 bytes, even on a 32-bit platform. + if ( filelength >= static_cast(maxSizeT) ) { + // Cannot handle files which won't fit in buffer together with null terminator + SetError( XML_ERROR_FILE_READ_ERROR, 0, 0 ); + return _errorID; + } + + if ( filelength == 0 ) { + SetError( XML_ERROR_EMPTY_DOCUMENT, 0, 0 ); + return _errorID; + } + + const size_t size = static_cast(filelength); + TIXMLASSERT( _charBuffer == 0 ); + _charBuffer = new char[size+1]; + const size_t read = fread( _charBuffer, 1, size, fp ); + if ( read != size ) { + SetError( XML_ERROR_FILE_READ_ERROR, 0, 0 ); + return _errorID; + } + + _charBuffer[size] = 0; + + Parse(); + return _errorID; +} + + +XMLError XMLDocument::SaveFile( const char* filename, bool compact ) +{ + if ( !filename ) { + TIXMLASSERT( false ); + SetError( XML_ERROR_FILE_COULD_NOT_BE_OPENED, 0, "filename=" ); + return _errorID; + } + + FILE* fp = callfopen( filename, "w" ); + if ( !fp ) { + SetError( XML_ERROR_FILE_COULD_NOT_BE_OPENED, 0, "filename=%s", filename ); + return _errorID; + } + SaveFile(fp, compact); + fclose( fp ); + return _errorID; +} + + +XMLError XMLDocument::SaveFile( FILE* fp, bool compact ) +{ + // Clear any error from the last save, otherwise it will get reported + // for *this* call. + ClearError(); + XMLPrinter stream( fp, compact ); + Print( &stream ); + return _errorID; +} + + +XMLError XMLDocument::Parse( const char* p, size_t len ) +{ + Clear(); + + if ( len == 0 || !p || !*p ) { + SetError( XML_ERROR_EMPTY_DOCUMENT, 0, 0 ); + return _errorID; + } + if ( len == static_cast(-1) ) { + len = strlen( p ); + } + TIXMLASSERT( _charBuffer == 0 ); + _charBuffer = new char[ len+1 ]; + memcpy( _charBuffer, p, len ); + _charBuffer[len] = 0; + + Parse(); + if ( Error() ) { + // clean up now essentially dangling memory. + // and the parse fail can put objects in the + // pools that are dead and inaccessible. + DeleteChildren(); + _elementPool.Clear(); + _attributePool.Clear(); + _textPool.Clear(); + _commentPool.Clear(); + } + return _errorID; +} + + +void XMLDocument::Print( XMLPrinter* streamer ) const +{ + if ( streamer ) { + Accept( streamer ); + } + else { + XMLPrinter stdoutStreamer( stdout ); + Accept( &stdoutStreamer ); + } +} + + +void XMLDocument::SetError( XMLError error, int lineNum, const char* format, ... ) +{ + TIXMLASSERT( error >= 0 && error < XML_ERROR_COUNT ); + _errorID = error; + _errorLineNum = lineNum; + _errorStr.Reset(); + + const size_t BUFFER_SIZE = 1000; + char* buffer = new char[BUFFER_SIZE]; + + TIXMLASSERT(sizeof(error) <= sizeof(int)); + TIXML_SNPRINTF(buffer, BUFFER_SIZE, "Error=%s ErrorID=%d (0x%x) Line number=%d", ErrorIDToName(error), int(error), int(error), lineNum); + + if (format) { + size_t len = strlen(buffer); + TIXML_SNPRINTF(buffer + len, BUFFER_SIZE - len, ": "); + len = strlen(buffer); + + va_list va; + va_start(va, format); + TIXML_VSNPRINTF(buffer + len, BUFFER_SIZE - len, format, va); + va_end(va); + } + _errorStr.SetStr(buffer); + delete[] buffer; +} + + +/*static*/ const char* XMLDocument::ErrorIDToName(XMLError errorID) +{ + TIXMLASSERT( errorID >= 0 && errorID < XML_ERROR_COUNT ); + const char* errorName = _errorNames[errorID]; + TIXMLASSERT( errorName && errorName[0] ); + return errorName; +} + +const char* XMLDocument::ErrorStr() const +{ + return _errorStr.Empty() ? "" : _errorStr.GetStr(); +} + + +void XMLDocument::PrintError() const +{ + printf("%s\n", ErrorStr()); +} + +const char* XMLDocument::ErrorName() const +{ + return ErrorIDToName(_errorID); +} + +void XMLDocument::Parse() +{ + TIXMLASSERT( NoChildren() ); // Clear() must have been called previously + TIXMLASSERT( _charBuffer ); + _parseCurLineNum = 1; + _parseLineNum = 1; + char* p = _charBuffer; + p = XMLUtil::SkipWhiteSpace( p, &_parseCurLineNum ); + p = const_cast( XMLUtil::ReadBOM( p, &_writeBOM ) ); + if ( !*p ) { + SetError( XML_ERROR_EMPTY_DOCUMENT, 0, 0 ); + return; + } + ParseDeep(p, 0, &_parseCurLineNum ); +} + +void XMLDocument::PushDepth() +{ + _parsingDepth++; + if (_parsingDepth == TINYXML2_MAX_ELEMENT_DEPTH) { + SetError(XML_ELEMENT_DEPTH_EXCEEDED, _parseCurLineNum, "Element nesting is too deep." ); + } +} + +void XMLDocument::PopDepth() +{ + TIXMLASSERT(_parsingDepth > 0); + --_parsingDepth; +} + +XMLPrinter::XMLPrinter( FILE* file, bool compact, int depth ) : + _elementJustOpened( false ), + _stack(), + _firstElement( true ), + _fp( file ), + _depth( depth ), + _textDepth( -1 ), + _processEntities( true ), + _compactMode( compact ), + _buffer() +{ + for( int i=0; i(entityValue); + TIXMLASSERT( flagIndex < ENTITY_RANGE ); + _entityFlag[flagIndex] = true; + } + _restrictedEntityFlag[static_cast('&')] = true; + _restrictedEntityFlag[static_cast('<')] = true; + _restrictedEntityFlag[static_cast('>')] = true; // not required, but consistency is nice + _buffer.Push( 0 ); +} + + +void XMLPrinter::Print( const char* format, ... ) +{ + va_list va; + va_start( va, format ); + + if ( _fp ) { + vfprintf( _fp, format, va ); + } + else { + const int len = TIXML_VSCPRINTF( format, va ); + // Close out and re-start the va-args + va_end( va ); + TIXMLASSERT( len >= 0 ); + va_start( va, format ); + TIXMLASSERT( _buffer.Size() > 0 && _buffer[_buffer.Size() - 1] == 0 ); + char* p = _buffer.PushArr( len ) - 1; // back up over the null terminator. + TIXML_VSNPRINTF( p, len+1, format, va ); + } + va_end( va ); +} + + +void XMLPrinter::Write( const char* data, size_t size ) +{ + if ( _fp ) { + fwrite ( data , sizeof(char), size, _fp); + } + else { + char* p = _buffer.PushArr( static_cast(size) ) - 1; // back up over the null terminator. + memcpy( p, data, size ); + p[size] = 0; + } +} + + +void XMLPrinter::Putc( char ch ) +{ + if ( _fp ) { + fputc ( ch, _fp); + } + else { + char* p = _buffer.PushArr( sizeof(char) ) - 1; // back up over the null terminator. + p[0] = ch; + p[1] = 0; + } +} + + +void XMLPrinter::PrintSpace( int depth ) +{ + for( int i=0; i 0 && *q < ENTITY_RANGE ) { + // Check for entities. If one is found, flush + // the stream up until the entity, write the + // entity, and keep looking. + if ( flag[static_cast(*q)] ) { + while ( p < q ) { + const size_t delta = q - p; + const int toPrint = ( INT_MAX < delta ) ? INT_MAX : static_cast(delta); + Write( p, toPrint ); + p += toPrint; + } + bool entityPatternPrinted = false; + for( int i=0; i(delta); + Write( p, toPrint ); + } + } + else { + Write( p ); + } +} + + +void XMLPrinter::PushHeader( bool writeBOM, bool writeDec ) +{ + if ( writeBOM ) { + static const unsigned char bom[] = { TIXML_UTF_LEAD_0, TIXML_UTF_LEAD_1, TIXML_UTF_LEAD_2, 0 }; + Write( reinterpret_cast< const char* >( bom ) ); + } + if ( writeDec ) { + PushDeclaration( "xml version=\"1.0\"" ); + } +} + + +void XMLPrinter::OpenElement( const char* name, bool compactMode ) +{ + SealElementIfJustOpened(); + _stack.Push( name ); + + if ( _textDepth < 0 && !_firstElement && !compactMode ) { + Putc( '\n' ); + PrintSpace( _depth ); + } + + Write ( "<" ); + Write ( name ); + + _elementJustOpened = true; + _firstElement = false; + ++_depth; +} + + +void XMLPrinter::PushAttribute( const char* name, const char* value ) +{ + TIXMLASSERT( _elementJustOpened ); + Putc ( ' ' ); + Write( name ); + Write( "=\"" ); + PrintString( value, false ); + Putc ( '\"' ); +} + + +void XMLPrinter::PushAttribute( const char* name, int v ) +{ + char buf[BUF_SIZE]; + XMLUtil::ToStr( v, buf, BUF_SIZE ); + PushAttribute( name, buf ); +} + + +void XMLPrinter::PushAttribute( const char* name, unsigned v ) +{ + char buf[BUF_SIZE]; + XMLUtil::ToStr( v, buf, BUF_SIZE ); + PushAttribute( name, buf ); +} + + +void XMLPrinter::PushAttribute(const char* name, int64_t v) +{ + char buf[BUF_SIZE]; + XMLUtil::ToStr(v, buf, BUF_SIZE); + PushAttribute(name, buf); +} + + +void XMLPrinter::PushAttribute(const char* name, uint64_t v) +{ + char buf[BUF_SIZE]; + XMLUtil::ToStr(v, buf, BUF_SIZE); + PushAttribute(name, buf); +} + + +void XMLPrinter::PushAttribute( const char* name, bool v ) +{ + char buf[BUF_SIZE]; + XMLUtil::ToStr( v, buf, BUF_SIZE ); + PushAttribute( name, buf ); +} + + +void XMLPrinter::PushAttribute( const char* name, double v ) +{ + char buf[BUF_SIZE]; + XMLUtil::ToStr( v, buf, BUF_SIZE ); + PushAttribute( name, buf ); +} + + +void XMLPrinter::CloseElement( bool compactMode ) +{ + --_depth; + const char* name = _stack.Pop(); + + if ( _elementJustOpened ) { + Write( "/>" ); + } + else { + if ( _textDepth < 0 && !compactMode) { + Putc( '\n' ); + PrintSpace( _depth ); + } + Write ( "" ); + } + + if ( _textDepth == _depth ) { + _textDepth = -1; + } + if ( _depth == 0 && !compactMode) { + Putc( '\n' ); + } + _elementJustOpened = false; +} + + +void XMLPrinter::SealElementIfJustOpened() +{ + if ( !_elementJustOpened ) { + return; + } + _elementJustOpened = false; + Putc( '>' ); +} + + +void XMLPrinter::PushText( const char* text, bool cdata ) +{ + _textDepth = _depth-1; + + SealElementIfJustOpened(); + if ( cdata ) { + Write( "" ); + } + else { + PrintString( text, true ); + } +} + + +void XMLPrinter::PushText( int64_t value ) +{ + char buf[BUF_SIZE]; + XMLUtil::ToStr( value, buf, BUF_SIZE ); + PushText( buf, false ); +} + + +void XMLPrinter::PushText( uint64_t value ) +{ + char buf[BUF_SIZE]; + XMLUtil::ToStr(value, buf, BUF_SIZE); + PushText(buf, false); +} + + +void XMLPrinter::PushText( int value ) +{ + char buf[BUF_SIZE]; + XMLUtil::ToStr( value, buf, BUF_SIZE ); + PushText( buf, false ); +} + + +void XMLPrinter::PushText( unsigned value ) +{ + char buf[BUF_SIZE]; + XMLUtil::ToStr( value, buf, BUF_SIZE ); + PushText( buf, false ); +} + + +void XMLPrinter::PushText( bool value ) +{ + char buf[BUF_SIZE]; + XMLUtil::ToStr( value, buf, BUF_SIZE ); + PushText( buf, false ); +} + + +void XMLPrinter::PushText( float value ) +{ + char buf[BUF_SIZE]; + XMLUtil::ToStr( value, buf, BUF_SIZE ); + PushText( buf, false ); +} + + +void XMLPrinter::PushText( double value ) +{ + char buf[BUF_SIZE]; + XMLUtil::ToStr( value, buf, BUF_SIZE ); + PushText( buf, false ); +} + + +void XMLPrinter::PushComment( const char* comment ) +{ + SealElementIfJustOpened(); + if ( _textDepth < 0 && !_firstElement && !_compactMode) { + Putc( '\n' ); + PrintSpace( _depth ); + } + _firstElement = false; + + Write( "" ); +} + + +void XMLPrinter::PushDeclaration( const char* value ) +{ + SealElementIfJustOpened(); + if ( _textDepth < 0 && !_firstElement && !_compactMode) { + Putc( '\n' ); + PrintSpace( _depth ); + } + _firstElement = false; + + Write( "" ); +} + + +void XMLPrinter::PushUnknown( const char* value ) +{ + SealElementIfJustOpened(); + if ( _textDepth < 0 && !_firstElement && !_compactMode) { + Putc( '\n' ); + PrintSpace( _depth ); + } + _firstElement = false; + + Write( "' ); +} + + +bool XMLPrinter::VisitEnter( const XMLDocument& doc ) +{ + _processEntities = doc.ProcessEntities(); + if ( doc.HasBOM() ) { + PushHeader( true, false ); + } + return true; +} + + +bool XMLPrinter::VisitEnter( const XMLElement& element, const XMLAttribute* attribute ) +{ + const XMLElement* parentElem = 0; + if ( element.Parent() ) { + parentElem = element.Parent()->ToElement(); + } + const bool compactMode = parentElem ? CompactMode( *parentElem ) : _compactMode; + OpenElement( element.Name(), compactMode ); + while ( attribute ) { + PushAttribute( attribute->Name(), attribute->Value() ); + attribute = attribute->Next(); + } + return true; +} + + +bool XMLPrinter::VisitExit( const XMLElement& element ) +{ + CloseElement( CompactMode(element) ); + return true; +} + + +bool XMLPrinter::Visit( const XMLText& text ) +{ + PushText( text.Value(), text.CData() ); + return true; +} + + +bool XMLPrinter::Visit( const XMLComment& comment ) +{ + PushComment( comment.Value() ); + return true; +} + +bool XMLPrinter::Visit( const XMLDeclaration& declaration ) +{ + PushDeclaration( declaration.Value() ); + return true; +} + + +bool XMLPrinter::Visit( const XMLUnknown& unknown ) +{ + PushUnknown( unknown.Value() ); + return true; +} + +} // namespace tinyxml2 diff --git a/third_party/tinyxml2/tinyxml2.h b/third_party/tinyxml2/tinyxml2.h new file mode 100644 index 00000000..1beadaa5 --- /dev/null +++ b/third_party/tinyxml2/tinyxml2.h @@ -0,0 +1,2365 @@ +/* +Original code by Lee Thomason (www.grinninglizard.com) + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any +damages arising from the use of this software. + +Permission is granted to anyone to use this software for any +purpose, including commercial applications, and to alter it and +redistribute it freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must +not claim that you wrote the original software. If you use this +software in a product, an acknowledgment in the product documentation +would be appreciated but is not required. + +2. Altered source versions must be plainly marked as such, and +must not be misrepresented as being the original software. + +3. This notice may not be removed or altered from any source +distribution. +*/ + +#ifndef TINYXML2_INCLUDED +#define TINYXML2_INCLUDED + +#if defined(ANDROID_NDK) || defined(__BORLANDC__) || defined(__QNXNTO__) +# include +# include +# include +# include +# include +# if defined(__PS3__) +# include +# endif +#else +# include +# include +# include +# include +# include +#endif +#include + +/* + TODO: intern strings instead of allocation. +*/ +/* + gcc: + g++ -Wall -DTINYXML2_DEBUG tinyxml2.cpp xmltest.cpp -o gccxmltest.exe + + Formatting, Artistic Style: + AStyle.exe --style=1tbs --indent-switches --break-closing-brackets --indent-preprocessor tinyxml2.cpp tinyxml2.h +*/ + +#if defined( _DEBUG ) || defined (__DEBUG__) +# ifndef TINYXML2_DEBUG +# define TINYXML2_DEBUG +# endif +#endif + +#ifdef _MSC_VER +# pragma warning(push) +# pragma warning(disable: 4251) +#endif + +#ifdef _WIN32 +# ifdef TINYXML2_EXPORT +# define TINYXML2_LIB __declspec(dllexport) +# elif defined(TINYXML2_IMPORT) +# define TINYXML2_LIB __declspec(dllimport) +# else +# define TINYXML2_LIB +# endif +#elif __GNUC__ >= 4 +# define TINYXML2_LIB __attribute__((visibility("default"))) +#else +# define TINYXML2_LIB +#endif + + +#if defined(TINYXML2_DEBUG) +# if defined(_MSC_VER) +# // "(void)0," is for suppressing C4127 warning in "assert(false)", "assert(true)" and the like +# define TIXMLASSERT( x ) if ( !((void)0,(x))) { __debugbreak(); } +# elif defined (ANDROID_NDK) +# include +# define TIXMLASSERT( x ) if ( !(x)) { __android_log_assert( "assert", "grinliz", "ASSERT in '%s' at %d.", __FILE__, __LINE__ ); } +# else +# include +# define TIXMLASSERT assert +# endif +#else +# define TIXMLASSERT( x ) {} +#endif + + +/* Versioning, past 1.0.14: + http://semver.org/ +*/ +static const int TIXML2_MAJOR_VERSION = 8; +static const int TIXML2_MINOR_VERSION = 0; +static const int TIXML2_PATCH_VERSION = 0; + +#define TINYXML2_MAJOR_VERSION 8 +#define TINYXML2_MINOR_VERSION 0 +#define TINYXML2_PATCH_VERSION 0 + +// A fixed element depth limit is problematic. There needs to be a +// limit to avoid a stack overflow. However, that limit varies per +// system, and the capacity of the stack. On the other hand, it's a trivial +// attack that can result from ill, malicious, or even correctly formed XML, +// so there needs to be a limit in place. +static const int TINYXML2_MAX_ELEMENT_DEPTH = 100; + +namespace tinyxml2 +{ +class XMLDocument; +class XMLElement; +class XMLAttribute; +class XMLComment; +class XMLText; +class XMLDeclaration; +class XMLUnknown; +class XMLPrinter; + +/* + A class that wraps strings. Normally stores the start and end + pointers into the XML file itself, and will apply normalization + and entity translation if actually read. Can also store (and memory + manage) a traditional char[] + + Isn't clear why TINYXML2_LIB is needed; but seems to fix #719 +*/ +class TINYXML2_LIB StrPair +{ +public: + enum { + NEEDS_ENTITY_PROCESSING = 0x01, + NEEDS_NEWLINE_NORMALIZATION = 0x02, + NEEDS_WHITESPACE_COLLAPSING = 0x04, + + TEXT_ELEMENT = NEEDS_ENTITY_PROCESSING | NEEDS_NEWLINE_NORMALIZATION, + TEXT_ELEMENT_LEAVE_ENTITIES = NEEDS_NEWLINE_NORMALIZATION, + ATTRIBUTE_NAME = 0, + ATTRIBUTE_VALUE = NEEDS_ENTITY_PROCESSING | NEEDS_NEWLINE_NORMALIZATION, + ATTRIBUTE_VALUE_LEAVE_ENTITIES = NEEDS_NEWLINE_NORMALIZATION, + COMMENT = NEEDS_NEWLINE_NORMALIZATION + }; + + StrPair() : _flags( 0 ), _start( 0 ), _end( 0 ) {} + ~StrPair(); + + void Set( char* start, char* end, int flags ) { + TIXMLASSERT( start ); + TIXMLASSERT( end ); + Reset(); + _start = start; + _end = end; + _flags = flags | NEEDS_FLUSH; + } + + const char* GetStr(); + + bool Empty() const { + return _start == _end; + } + + void SetInternedStr( const char* str ) { + Reset(); + _start = const_cast(str); + } + + void SetStr( const char* str, int flags=0 ); + + char* ParseText( char* in, const char* endTag, int strFlags, int* curLineNumPtr ); + char* ParseName( char* in ); + + void TransferTo( StrPair* other ); + void Reset(); + +private: + void CollapseWhitespace(); + + enum { + NEEDS_FLUSH = 0x100, + NEEDS_DELETE = 0x200 + }; + + int _flags; + char* _start; + char* _end; + + StrPair( const StrPair& other ); // not supported + void operator=( const StrPair& other ); // not supported, use TransferTo() +}; + + +/* + A dynamic array of Plain Old Data. Doesn't support constructors, etc. + Has a small initial memory pool, so that low or no usage will not + cause a call to new/delete +*/ +template +class DynArray +{ +public: + DynArray() : + _mem( _pool ), + _allocated( INITIAL_SIZE ), + _size( 0 ) + { + } + + ~DynArray() { + if ( _mem != _pool ) { + delete [] _mem; + } + } + + void Clear() { + _size = 0; + } + + void Push( T t ) { + TIXMLASSERT( _size < INT_MAX ); + EnsureCapacity( _size+1 ); + _mem[_size] = t; + ++_size; + } + + T* PushArr( int count ) { + TIXMLASSERT( count >= 0 ); + TIXMLASSERT( _size <= INT_MAX - count ); + EnsureCapacity( _size+count ); + T* ret = &_mem[_size]; + _size += count; + return ret; + } + + T Pop() { + TIXMLASSERT( _size > 0 ); + --_size; + return _mem[_size]; + } + + void PopArr( int count ) { + TIXMLASSERT( _size >= count ); + _size -= count; + } + + bool Empty() const { + return _size == 0; + } + + T& operator[](int i) { + TIXMLASSERT( i>= 0 && i < _size ); + return _mem[i]; + } + + const T& operator[](int i) const { + TIXMLASSERT( i>= 0 && i < _size ); + return _mem[i]; + } + + const T& PeekTop() const { + TIXMLASSERT( _size > 0 ); + return _mem[ _size - 1]; + } + + int Size() const { + TIXMLASSERT( _size >= 0 ); + return _size; + } + + int Capacity() const { + TIXMLASSERT( _allocated >= INITIAL_SIZE ); + return _allocated; + } + + void SwapRemove(int i) { + TIXMLASSERT(i >= 0 && i < _size); + TIXMLASSERT(_size > 0); + _mem[i] = _mem[_size - 1]; + --_size; + } + + const T* Mem() const { + TIXMLASSERT( _mem ); + return _mem; + } + + T* Mem() { + TIXMLASSERT( _mem ); + return _mem; + } + +private: + DynArray( const DynArray& ); // not supported + void operator=( const DynArray& ); // not supported + + void EnsureCapacity( int cap ) { + TIXMLASSERT( cap > 0 ); + if ( cap > _allocated ) { + TIXMLASSERT( cap <= INT_MAX / 2 ); + const int newAllocated = cap * 2; + T* newMem = new T[newAllocated]; + TIXMLASSERT( newAllocated >= _size ); + memcpy( newMem, _mem, sizeof(T)*_size ); // warning: not using constructors, only works for PODs + if ( _mem != _pool ) { + delete [] _mem; + } + _mem = newMem; + _allocated = newAllocated; + } + } + + T* _mem; + T _pool[INITIAL_SIZE]; + int _allocated; // objects allocated + int _size; // number objects in use +}; + + +/* + Parent virtual class of a pool for fast allocation + and deallocation of objects. +*/ +class MemPool +{ +public: + MemPool() {} + virtual ~MemPool() {} + + virtual int ItemSize() const = 0; + virtual void* Alloc() = 0; + virtual void Free( void* ) = 0; + virtual void SetTracked() = 0; +}; + + +/* + Template child class to create pools of the correct type. +*/ +template< int ITEM_SIZE > +class MemPoolT : public MemPool +{ +public: + MemPoolT() : _blockPtrs(), _root(0), _currentAllocs(0), _nAllocs(0), _maxAllocs(0), _nUntracked(0) {} + ~MemPoolT() { + MemPoolT< ITEM_SIZE >::Clear(); + } + + void Clear() { + // Delete the blocks. + while( !_blockPtrs.Empty()) { + Block* lastBlock = _blockPtrs.Pop(); + delete lastBlock; + } + _root = 0; + _currentAllocs = 0; + _nAllocs = 0; + _maxAllocs = 0; + _nUntracked = 0; + } + + virtual int ItemSize() const { + return ITEM_SIZE; + } + int CurrentAllocs() const { + return _currentAllocs; + } + + virtual void* Alloc() { + if ( !_root ) { + // Need a new block. + Block* block = new Block(); + _blockPtrs.Push( block ); + + Item* blockItems = block->items; + for( int i = 0; i < ITEMS_PER_BLOCK - 1; ++i ) { + blockItems[i].next = &(blockItems[i + 1]); + } + blockItems[ITEMS_PER_BLOCK - 1].next = 0; + _root = blockItems; + } + Item* const result = _root; + TIXMLASSERT( result != 0 ); + _root = _root->next; + + ++_currentAllocs; + if ( _currentAllocs > _maxAllocs ) { + _maxAllocs = _currentAllocs; + } + ++_nAllocs; + ++_nUntracked; + return result; + } + + virtual void Free( void* mem ) { + if ( !mem ) { + return; + } + --_currentAllocs; + Item* item = static_cast( mem ); +#ifdef TINYXML2_DEBUG + memset( item, 0xfe, sizeof( *item ) ); +#endif + item->next = _root; + _root = item; + } + void Trace( const char* name ) { + printf( "Mempool %s watermark=%d [%dk] current=%d size=%d nAlloc=%d blocks=%d\n", + name, _maxAllocs, _maxAllocs * ITEM_SIZE / 1024, _currentAllocs, + ITEM_SIZE, _nAllocs, _blockPtrs.Size() ); + } + + void SetTracked() { + --_nUntracked; + } + + int Untracked() const { + return _nUntracked; + } + + // This number is perf sensitive. 4k seems like a good tradeoff on my machine. + // The test file is large, 170k. + // Release: VS2010 gcc(no opt) + // 1k: 4000 + // 2k: 4000 + // 4k: 3900 21000 + // 16k: 5200 + // 32k: 4300 + // 64k: 4000 21000 + // Declared public because some compilers do not accept to use ITEMS_PER_BLOCK + // in private part if ITEMS_PER_BLOCK is private + enum { ITEMS_PER_BLOCK = (4 * 1024) / ITEM_SIZE }; + +private: + MemPoolT( const MemPoolT& ); // not supported + void operator=( const MemPoolT& ); // not supported + + union Item { + Item* next; + char itemData[ITEM_SIZE]; + }; + struct Block { + Item items[ITEMS_PER_BLOCK]; + }; + DynArray< Block*, 10 > _blockPtrs; + Item* _root; + + int _currentAllocs; + int _nAllocs; + int _maxAllocs; + int _nUntracked; +}; + + + +/** + Implements the interface to the "Visitor pattern" (see the Accept() method.) + If you call the Accept() method, it requires being passed a XMLVisitor + class to handle callbacks. For nodes that contain other nodes (Document, Element) + you will get called with a VisitEnter/VisitExit pair. Nodes that are always leafs + are simply called with Visit(). + + If you return 'true' from a Visit method, recursive parsing will continue. If you return + false, no children of this node or its siblings will be visited. + + All flavors of Visit methods have a default implementation that returns 'true' (continue + visiting). You need to only override methods that are interesting to you. + + Generally Accept() is called on the XMLDocument, although all nodes support visiting. + + You should never change the document from a callback. + + @sa XMLNode::Accept() +*/ +class TINYXML2_LIB XMLVisitor +{ +public: + virtual ~XMLVisitor() {} + + /// Visit a document. + virtual bool VisitEnter( const XMLDocument& /*doc*/ ) { + return true; + } + /// Visit a document. + virtual bool VisitExit( const XMLDocument& /*doc*/ ) { + return true; + } + + /// Visit an element. + virtual bool VisitEnter( const XMLElement& /*element*/, const XMLAttribute* /*firstAttribute*/ ) { + return true; + } + /// Visit an element. + virtual bool VisitExit( const XMLElement& /*element*/ ) { + return true; + } + + /// Visit a declaration. + virtual bool Visit( const XMLDeclaration& /*declaration*/ ) { + return true; + } + /// Visit a text node. + virtual bool Visit( const XMLText& /*text*/ ) { + return true; + } + /// Visit a comment node. + virtual bool Visit( const XMLComment& /*comment*/ ) { + return true; + } + /// Visit an unknown node. + virtual bool Visit( const XMLUnknown& /*unknown*/ ) { + return true; + } +}; + +// WARNING: must match XMLDocument::_errorNames[] +enum XMLError { + XML_SUCCESS = 0, + XML_NO_ATTRIBUTE, + XML_WRONG_ATTRIBUTE_TYPE, + XML_ERROR_FILE_NOT_FOUND, + XML_ERROR_FILE_COULD_NOT_BE_OPENED, + XML_ERROR_FILE_READ_ERROR, + XML_ERROR_PARSING_ELEMENT, + XML_ERROR_PARSING_ATTRIBUTE, + XML_ERROR_PARSING_TEXT, + XML_ERROR_PARSING_CDATA, + XML_ERROR_PARSING_COMMENT, + XML_ERROR_PARSING_DECLARATION, + XML_ERROR_PARSING_UNKNOWN, + XML_ERROR_EMPTY_DOCUMENT, + XML_ERROR_MISMATCHED_ELEMENT, + XML_ERROR_PARSING, + XML_CAN_NOT_CONVERT_TEXT, + XML_NO_TEXT_NODE, + XML_ELEMENT_DEPTH_EXCEEDED, + + XML_ERROR_COUNT +}; + + +/* + Utility functionality. +*/ +class TINYXML2_LIB XMLUtil +{ +public: + static const char* SkipWhiteSpace( const char* p, int* curLineNumPtr ) { + TIXMLASSERT( p ); + + while( IsWhiteSpace(*p) ) { + if (curLineNumPtr && *p == '\n') { + ++(*curLineNumPtr); + } + ++p; + } + TIXMLASSERT( p ); + return p; + } + static char* SkipWhiteSpace( char* const p, int* curLineNumPtr ) { + return const_cast( SkipWhiteSpace( const_cast(p), curLineNumPtr ) ); + } + + // Anything in the high order range of UTF-8 is assumed to not be whitespace. This isn't + // correct, but simple, and usually works. + static bool IsWhiteSpace( char p ) { + return !IsUTF8Continuation(p) && isspace( static_cast(p) ); + } + + inline static bool IsNameStartChar( unsigned char ch ) { + if ( ch >= 128 ) { + // This is a heuristic guess in attempt to not implement Unicode-aware isalpha() + return true; + } + if ( isalpha( ch ) ) { + return true; + } + return ch == ':' || ch == '_'; + } + + inline static bool IsNameChar( unsigned char ch ) { + return IsNameStartChar( ch ) + || isdigit( ch ) + || ch == '.' + || ch == '-'; + } + + inline static bool StringEqual( const char* p, const char* q, int nChar=INT_MAX ) { + if ( p == q ) { + return true; + } + TIXMLASSERT( p ); + TIXMLASSERT( q ); + TIXMLASSERT( nChar >= 0 ); + return strncmp( p, q, nChar ) == 0; + } + + inline static bool IsUTF8Continuation( const char p ) { + return ( p & 0x80 ) != 0; + } + + static const char* ReadBOM( const char* p, bool* hasBOM ); + // p is the starting location, + // the UTF-8 value of the entity will be placed in value, and length filled in. + static const char* GetCharacterRef( const char* p, char* value, int* length ); + static void ConvertUTF32ToUTF8( unsigned long input, char* output, int* length ); + + // converts primitive types to strings + static void ToStr( int v, char* buffer, int bufferSize ); + static void ToStr( unsigned v, char* buffer, int bufferSize ); + static void ToStr( bool v, char* buffer, int bufferSize ); + static void ToStr( float v, char* buffer, int bufferSize ); + static void ToStr( double v, char* buffer, int bufferSize ); + static void ToStr(int64_t v, char* buffer, int bufferSize); + static void ToStr(uint64_t v, char* buffer, int bufferSize); + + // converts strings to primitive types + static bool ToInt( const char* str, int* value ); + static bool ToUnsigned( const char* str, unsigned* value ); + static bool ToBool( const char* str, bool* value ); + static bool ToFloat( const char* str, float* value ); + static bool ToDouble( const char* str, double* value ); + static bool ToInt64(const char* str, int64_t* value); + static bool ToUnsigned64(const char* str, uint64_t* value); + // Changes what is serialized for a boolean value. + // Default to "true" and "false". Shouldn't be changed + // unless you have a special testing or compatibility need. + // Be careful: static, global, & not thread safe. + // Be sure to set static const memory as parameters. + static void SetBoolSerialization(const char* writeTrue, const char* writeFalse); + +private: + static const char* writeBoolTrue; + static const char* writeBoolFalse; +}; + + +/** XMLNode is a base class for every object that is in the + XML Document Object Model (DOM), except XMLAttributes. + Nodes have siblings, a parent, and children which can + be navigated. A node is always in a XMLDocument. + The type of a XMLNode can be queried, and it can + be cast to its more defined type. + + A XMLDocument allocates memory for all its Nodes. + When the XMLDocument gets deleted, all its Nodes + will also be deleted. + + @verbatim + A Document can contain: Element (container or leaf) + Comment (leaf) + Unknown (leaf) + Declaration( leaf ) + + An Element can contain: Element (container or leaf) + Text (leaf) + Attributes (not on tree) + Comment (leaf) + Unknown (leaf) + + @endverbatim +*/ +class TINYXML2_LIB XMLNode +{ + friend class XMLDocument; + friend class XMLElement; +public: + + /// Get the XMLDocument that owns this XMLNode. + const XMLDocument* GetDocument() const { + TIXMLASSERT( _document ); + return _document; + } + /// Get the XMLDocument that owns this XMLNode. + XMLDocument* GetDocument() { + TIXMLASSERT( _document ); + return _document; + } + + /// Safely cast to an Element, or null. + virtual XMLElement* ToElement() { + return 0; + } + /// Safely cast to Text, or null. + virtual XMLText* ToText() { + return 0; + } + /// Safely cast to a Comment, or null. + virtual XMLComment* ToComment() { + return 0; + } + /// Safely cast to a Document, or null. + virtual XMLDocument* ToDocument() { + return 0; + } + /// Safely cast to a Declaration, or null. + virtual XMLDeclaration* ToDeclaration() { + return 0; + } + /// Safely cast to an Unknown, or null. + virtual XMLUnknown* ToUnknown() { + return 0; + } + + virtual const XMLElement* ToElement() const { + return 0; + } + virtual const XMLText* ToText() const { + return 0; + } + virtual const XMLComment* ToComment() const { + return 0; + } + virtual const XMLDocument* ToDocument() const { + return 0; + } + virtual const XMLDeclaration* ToDeclaration() const { + return 0; + } + virtual const XMLUnknown* ToUnknown() const { + return 0; + } + + /** The meaning of 'value' changes for the specific type. + @verbatim + Document: empty (NULL is returned, not an empty string) + Element: name of the element + Comment: the comment text + Unknown: the tag contents + Text: the text string + @endverbatim + */ + const char* Value() const; + + /** Set the Value of an XML node. + @sa Value() + */ + void SetValue( const char* val, bool staticMem=false ); + + /// Gets the line number the node is in, if the document was parsed from a file. + int GetLineNum() const { return _parseLineNum; } + + /// Get the parent of this node on the DOM. + const XMLNode* Parent() const { + return _parent; + } + + XMLNode* Parent() { + return _parent; + } + + /// Returns true if this node has no children. + bool NoChildren() const { + return !_firstChild; + } + + /// Get the first child node, or null if none exists. + const XMLNode* FirstChild() const { + return _firstChild; + } + + XMLNode* FirstChild() { + return _firstChild; + } + + /** Get the first child element, or optionally the first child + element with the specified name. + */ + const XMLElement* FirstChildElement( const char* name = 0 ) const; + + XMLElement* FirstChildElement( const char* name = 0 ) { + return const_cast(const_cast(this)->FirstChildElement( name )); + } + + /// Get the last child node, or null if none exists. + const XMLNode* LastChild() const { + return _lastChild; + } + + XMLNode* LastChild() { + return _lastChild; + } + + /** Get the last child element or optionally the last child + element with the specified name. + */ + const XMLElement* LastChildElement( const char* name = 0 ) const; + + XMLElement* LastChildElement( const char* name = 0 ) { + return const_cast(const_cast(this)->LastChildElement(name) ); + } + + /// Get the previous (left) sibling node of this node. + const XMLNode* PreviousSibling() const { + return _prev; + } + + XMLNode* PreviousSibling() { + return _prev; + } + + /// Get the previous (left) sibling element of this node, with an optionally supplied name. + const XMLElement* PreviousSiblingElement( const char* name = 0 ) const ; + + XMLElement* PreviousSiblingElement( const char* name = 0 ) { + return const_cast(const_cast(this)->PreviousSiblingElement( name ) ); + } + + /// Get the next (right) sibling node of this node. + const XMLNode* NextSibling() const { + return _next; + } + + XMLNode* NextSibling() { + return _next; + } + + /// Get the next (right) sibling element of this node, with an optionally supplied name. + const XMLElement* NextSiblingElement( const char* name = 0 ) const; + + XMLElement* NextSiblingElement( const char* name = 0 ) { + return const_cast(const_cast(this)->NextSiblingElement( name ) ); + } + + /** + Add a child node as the last (right) child. + If the child node is already part of the document, + it is moved from its old location to the new location. + Returns the addThis argument or 0 if the node does not + belong to the same document. + */ + XMLNode* InsertEndChild( XMLNode* addThis ); + + XMLNode* LinkEndChild( XMLNode* addThis ) { + return InsertEndChild( addThis ); + } + /** + Add a child node as the first (left) child. + If the child node is already part of the document, + it is moved from its old location to the new location. + Returns the addThis argument or 0 if the node does not + belong to the same document. + */ + XMLNode* InsertFirstChild( XMLNode* addThis ); + /** + Add a node after the specified child node. + If the child node is already part of the document, + it is moved from its old location to the new location. + Returns the addThis argument or 0 if the afterThis node + is not a child of this node, or if the node does not + belong to the same document. + */ + XMLNode* InsertAfterChild( XMLNode* afterThis, XMLNode* addThis ); + + /** + Delete all the children of this node. + */ + void DeleteChildren(); + + /** + Delete a child of this node. + */ + void DeleteChild( XMLNode* node ); + + /** + Make a copy of this node, but not its children. + You may pass in a Document pointer that will be + the owner of the new Node. If the 'document' is + null, then the node returned will be allocated + from the current Document. (this->GetDocument()) + + Note: if called on a XMLDocument, this will return null. + */ + virtual XMLNode* ShallowClone( XMLDocument* document ) const = 0; + + /** + Make a copy of this node and all its children. + + If the 'target' is null, then the nodes will + be allocated in the current document. If 'target' + is specified, the memory will be allocated is the + specified XMLDocument. + + NOTE: This is probably not the correct tool to + copy a document, since XMLDocuments can have multiple + top level XMLNodes. You probably want to use + XMLDocument::DeepCopy() + */ + XMLNode* DeepClone( XMLDocument* target ) const; + + /** + Test if 2 nodes are the same, but don't test children. + The 2 nodes do not need to be in the same Document. + + Note: if called on a XMLDocument, this will return false. + */ + virtual bool ShallowEqual( const XMLNode* compare ) const = 0; + + /** Accept a hierarchical visit of the nodes in the TinyXML-2 DOM. Every node in the + XML tree will be conditionally visited and the host will be called back + via the XMLVisitor interface. + + This is essentially a SAX interface for TinyXML-2. (Note however it doesn't re-parse + the XML for the callbacks, so the performance of TinyXML-2 is unchanged by using this + interface versus any other.) + + The interface has been based on ideas from: + + - http://www.saxproject.org/ + - http://c2.com/cgi/wiki?HierarchicalVisitorPattern + + Which are both good references for "visiting". + + An example of using Accept(): + @verbatim + XMLPrinter printer; + tinyxmlDoc.Accept( &printer ); + const char* xmlcstr = printer.CStr(); + @endverbatim + */ + virtual bool Accept( XMLVisitor* visitor ) const = 0; + + /** + Set user data into the XMLNode. TinyXML-2 in + no way processes or interprets user data. + It is initially 0. + */ + void SetUserData(void* userData) { _userData = userData; } + + /** + Get user data set into the XMLNode. TinyXML-2 in + no way processes or interprets user data. + It is initially 0. + */ + void* GetUserData() const { return _userData; } + +protected: + explicit XMLNode( XMLDocument* ); + virtual ~XMLNode(); + + virtual char* ParseDeep( char* p, StrPair* parentEndTag, int* curLineNumPtr); + + XMLDocument* _document; + XMLNode* _parent; + mutable StrPair _value; + int _parseLineNum; + + XMLNode* _firstChild; + XMLNode* _lastChild; + + XMLNode* _prev; + XMLNode* _next; + + void* _userData; + +private: + MemPool* _memPool; + void Unlink( XMLNode* child ); + static void DeleteNode( XMLNode* node ); + void InsertChildPreamble( XMLNode* insertThis ) const; + const XMLElement* ToElementWithName( const char* name ) const; + + XMLNode( const XMLNode& ); // not supported + XMLNode& operator=( const XMLNode& ); // not supported +}; + + +/** XML text. + + Note that a text node can have child element nodes, for example: + @verbatim + This is bold + @endverbatim + + A text node can have 2 ways to output the next. "normal" output + and CDATA. It will default to the mode it was parsed from the XML file and + you generally want to leave it alone, but you can change the output mode with + SetCData() and query it with CData(). +*/ +class TINYXML2_LIB XMLText : public XMLNode +{ + friend class XMLDocument; +public: + virtual bool Accept( XMLVisitor* visitor ) const; + + virtual XMLText* ToText() { + return this; + } + virtual const XMLText* ToText() const { + return this; + } + + /// Declare whether this should be CDATA or standard text. + void SetCData( bool isCData ) { + _isCData = isCData; + } + /// Returns true if this is a CDATA text element. + bool CData() const { + return _isCData; + } + + virtual XMLNode* ShallowClone( XMLDocument* document ) const; + virtual bool ShallowEqual( const XMLNode* compare ) const; + +protected: + explicit XMLText( XMLDocument* doc ) : XMLNode( doc ), _isCData( false ) {} + virtual ~XMLText() {} + + char* ParseDeep( char* p, StrPair* parentEndTag, int* curLineNumPtr ); + +private: + bool _isCData; + + XMLText( const XMLText& ); // not supported + XMLText& operator=( const XMLText& ); // not supported +}; + + +/** An XML Comment. */ +class TINYXML2_LIB XMLComment : public XMLNode +{ + friend class XMLDocument; +public: + virtual XMLComment* ToComment() { + return this; + } + virtual const XMLComment* ToComment() const { + return this; + } + + virtual bool Accept( XMLVisitor* visitor ) const; + + virtual XMLNode* ShallowClone( XMLDocument* document ) const; + virtual bool ShallowEqual( const XMLNode* compare ) const; + +protected: + explicit XMLComment( XMLDocument* doc ); + virtual ~XMLComment(); + + char* ParseDeep( char* p, StrPair* parentEndTag, int* curLineNumPtr); + +private: + XMLComment( const XMLComment& ); // not supported + XMLComment& operator=( const XMLComment& ); // not supported +}; + + +/** In correct XML the declaration is the first entry in the file. + @verbatim + + @endverbatim + + TinyXML-2 will happily read or write files without a declaration, + however. + + The text of the declaration isn't interpreted. It is parsed + and written as a string. +*/ +class TINYXML2_LIB XMLDeclaration : public XMLNode +{ + friend class XMLDocument; +public: + virtual XMLDeclaration* ToDeclaration() { + return this; + } + virtual const XMLDeclaration* ToDeclaration() const { + return this; + } + + virtual bool Accept( XMLVisitor* visitor ) const; + + virtual XMLNode* ShallowClone( XMLDocument* document ) const; + virtual bool ShallowEqual( const XMLNode* compare ) const; + +protected: + explicit XMLDeclaration( XMLDocument* doc ); + virtual ~XMLDeclaration(); + + char* ParseDeep( char* p, StrPair* parentEndTag, int* curLineNumPtr ); + +private: + XMLDeclaration( const XMLDeclaration& ); // not supported + XMLDeclaration& operator=( const XMLDeclaration& ); // not supported +}; + + +/** Any tag that TinyXML-2 doesn't recognize is saved as an + unknown. It is a tag of text, but should not be modified. + It will be written back to the XML, unchanged, when the file + is saved. + + DTD tags get thrown into XMLUnknowns. +*/ +class TINYXML2_LIB XMLUnknown : public XMLNode +{ + friend class XMLDocument; +public: + virtual XMLUnknown* ToUnknown() { + return this; + } + virtual const XMLUnknown* ToUnknown() const { + return this; + } + + virtual bool Accept( XMLVisitor* visitor ) const; + + virtual XMLNode* ShallowClone( XMLDocument* document ) const; + virtual bool ShallowEqual( const XMLNode* compare ) const; + +protected: + explicit XMLUnknown( XMLDocument* doc ); + virtual ~XMLUnknown(); + + char* ParseDeep( char* p, StrPair* parentEndTag, int* curLineNumPtr ); + +private: + XMLUnknown( const XMLUnknown& ); // not supported + XMLUnknown& operator=( const XMLUnknown& ); // not supported +}; + + + +/** An attribute is a name-value pair. Elements have an arbitrary + number of attributes, each with a unique name. + + @note The attributes are not XMLNodes. You may only query the + Next() attribute in a list. +*/ +class TINYXML2_LIB XMLAttribute +{ + friend class XMLElement; +public: + /// The name of the attribute. + const char* Name() const; + + /// The value of the attribute. + const char* Value() const; + + /// Gets the line number the attribute is in, if the document was parsed from a file. + int GetLineNum() const { return _parseLineNum; } + + /// The next attribute in the list. + const XMLAttribute* Next() const { + return _next; + } + + /** IntValue interprets the attribute as an integer, and returns the value. + If the value isn't an integer, 0 will be returned. There is no error checking; + use QueryIntValue() if you need error checking. + */ + int IntValue() const { + int i = 0; + QueryIntValue(&i); + return i; + } + + int64_t Int64Value() const { + int64_t i = 0; + QueryInt64Value(&i); + return i; + } + + uint64_t Unsigned64Value() const { + uint64_t i = 0; + QueryUnsigned64Value(&i); + return i; + } + + /// Query as an unsigned integer. See IntValue() + unsigned UnsignedValue() const { + unsigned i=0; + QueryUnsignedValue( &i ); + return i; + } + /// Query as a boolean. See IntValue() + bool BoolValue() const { + bool b=false; + QueryBoolValue( &b ); + return b; + } + /// Query as a double. See IntValue() + double DoubleValue() const { + double d=0; + QueryDoubleValue( &d ); + return d; + } + /// Query as a float. See IntValue() + float FloatValue() const { + float f=0; + QueryFloatValue( &f ); + return f; + } + + /** QueryIntValue interprets the attribute as an integer, and returns the value + in the provided parameter. The function will return XML_SUCCESS on success, + and XML_WRONG_ATTRIBUTE_TYPE if the conversion is not successful. + */ + XMLError QueryIntValue( int* value ) const; + /// See QueryIntValue + XMLError QueryUnsignedValue( unsigned int* value ) const; + /// See QueryIntValue + XMLError QueryInt64Value(int64_t* value) const; + /// See QueryIntValue + XMLError QueryUnsigned64Value(uint64_t* value) const; + /// See QueryIntValue + XMLError QueryBoolValue( bool* value ) const; + /// See QueryIntValue + XMLError QueryDoubleValue( double* value ) const; + /// See QueryIntValue + XMLError QueryFloatValue( float* value ) const; + + /// Set the attribute to a string value. + void SetAttribute( const char* value ); + /// Set the attribute to value. + void SetAttribute( int value ); + /// Set the attribute to value. + void SetAttribute( unsigned value ); + /// Set the attribute to value. + void SetAttribute(int64_t value); + /// Set the attribute to value. + void SetAttribute(uint64_t value); + /// Set the attribute to value. + void SetAttribute( bool value ); + /// Set the attribute to value. + void SetAttribute( double value ); + /// Set the attribute to value. + void SetAttribute( float value ); + +private: + enum { BUF_SIZE = 200 }; + + XMLAttribute() : _name(), _value(),_parseLineNum( 0 ), _next( 0 ), _memPool( 0 ) {} + virtual ~XMLAttribute() {} + + XMLAttribute( const XMLAttribute& ); // not supported + void operator=( const XMLAttribute& ); // not supported + void SetName( const char* name ); + + char* ParseDeep( char* p, bool processEntities, int* curLineNumPtr ); + + mutable StrPair _name; + mutable StrPair _value; + int _parseLineNum; + XMLAttribute* _next; + MemPool* _memPool; +}; + + +/** The element is a container class. It has a value, the element name, + and can contain other elements, text, comments, and unknowns. + Elements also contain an arbitrary number of attributes. +*/ +class TINYXML2_LIB XMLElement : public XMLNode +{ + friend class XMLDocument; +public: + /// Get the name of an element (which is the Value() of the node.) + const char* Name() const { + return Value(); + } + /// Set the name of the element. + void SetName( const char* str, bool staticMem=false ) { + SetValue( str, staticMem ); + } + + virtual XMLElement* ToElement() { + return this; + } + virtual const XMLElement* ToElement() const { + return this; + } + virtual bool Accept( XMLVisitor* visitor ) const; + + /** Given an attribute name, Attribute() returns the value + for the attribute of that name, or null if none + exists. For example: + + @verbatim + const char* value = ele->Attribute( "foo" ); + @endverbatim + + The 'value' parameter is normally null. However, if specified, + the attribute will only be returned if the 'name' and 'value' + match. This allow you to write code: + + @verbatim + if ( ele->Attribute( "foo", "bar" ) ) callFooIsBar(); + @endverbatim + + rather than: + @verbatim + if ( ele->Attribute( "foo" ) ) { + if ( strcmp( ele->Attribute( "foo" ), "bar" ) == 0 ) callFooIsBar(); + } + @endverbatim + */ + const char* Attribute( const char* name, const char* value=0 ) const; + + /** Given an attribute name, IntAttribute() returns the value + of the attribute interpreted as an integer. The default + value will be returned if the attribute isn't present, + or if there is an error. (For a method with error + checking, see QueryIntAttribute()). + */ + int IntAttribute(const char* name, int defaultValue = 0) const; + /// See IntAttribute() + unsigned UnsignedAttribute(const char* name, unsigned defaultValue = 0) const; + /// See IntAttribute() + int64_t Int64Attribute(const char* name, int64_t defaultValue = 0) const; + /// See IntAttribute() + uint64_t Unsigned64Attribute(const char* name, uint64_t defaultValue = 0) const; + /// See IntAttribute() + bool BoolAttribute(const char* name, bool defaultValue = false) const; + /// See IntAttribute() + double DoubleAttribute(const char* name, double defaultValue = 0) const; + /// See IntAttribute() + float FloatAttribute(const char* name, float defaultValue = 0) const; + + /** Given an attribute name, QueryIntAttribute() returns + XML_SUCCESS, XML_WRONG_ATTRIBUTE_TYPE if the conversion + can't be performed, or XML_NO_ATTRIBUTE if the attribute + doesn't exist. If successful, the result of the conversion + will be written to 'value'. If not successful, nothing will + be written to 'value'. This allows you to provide default + value: + + @verbatim + int value = 10; + QueryIntAttribute( "foo", &value ); // if "foo" isn't found, value will still be 10 + @endverbatim + */ + XMLError QueryIntAttribute( const char* name, int* value ) const { + const XMLAttribute* a = FindAttribute( name ); + if ( !a ) { + return XML_NO_ATTRIBUTE; + } + return a->QueryIntValue( value ); + } + + /// See QueryIntAttribute() + XMLError QueryUnsignedAttribute( const char* name, unsigned int* value ) const { + const XMLAttribute* a = FindAttribute( name ); + if ( !a ) { + return XML_NO_ATTRIBUTE; + } + return a->QueryUnsignedValue( value ); + } + + /// See QueryIntAttribute() + XMLError QueryInt64Attribute(const char* name, int64_t* value) const { + const XMLAttribute* a = FindAttribute(name); + if (!a) { + return XML_NO_ATTRIBUTE; + } + return a->QueryInt64Value(value); + } + + /// See QueryIntAttribute() + XMLError QueryUnsigned64Attribute(const char* name, uint64_t* value) const { + const XMLAttribute* a = FindAttribute(name); + if(!a) { + return XML_NO_ATTRIBUTE; + } + return a->QueryUnsigned64Value(value); + } + + /// See QueryIntAttribute() + XMLError QueryBoolAttribute( const char* name, bool* value ) const { + const XMLAttribute* a = FindAttribute( name ); + if ( !a ) { + return XML_NO_ATTRIBUTE; + } + return a->QueryBoolValue( value ); + } + /// See QueryIntAttribute() + XMLError QueryDoubleAttribute( const char* name, double* value ) const { + const XMLAttribute* a = FindAttribute( name ); + if ( !a ) { + return XML_NO_ATTRIBUTE; + } + return a->QueryDoubleValue( value ); + } + /// See QueryIntAttribute() + XMLError QueryFloatAttribute( const char* name, float* value ) const { + const XMLAttribute* a = FindAttribute( name ); + if ( !a ) { + return XML_NO_ATTRIBUTE; + } + return a->QueryFloatValue( value ); + } + + /// See QueryIntAttribute() + XMLError QueryStringAttribute(const char* name, const char** value) const { + const XMLAttribute* a = FindAttribute(name); + if (!a) { + return XML_NO_ATTRIBUTE; + } + *value = a->Value(); + return XML_SUCCESS; + } + + + + /** Given an attribute name, QueryAttribute() returns + XML_SUCCESS, XML_WRONG_ATTRIBUTE_TYPE if the conversion + can't be performed, or XML_NO_ATTRIBUTE if the attribute + doesn't exist. It is overloaded for the primitive types, + and is a generally more convenient replacement of + QueryIntAttribute() and related functions. + + If successful, the result of the conversion + will be written to 'value'. If not successful, nothing will + be written to 'value'. This allows you to provide default + value: + + @verbatim + int value = 10; + QueryAttribute( "foo", &value ); // if "foo" isn't found, value will still be 10 + @endverbatim + */ + XMLError QueryAttribute( const char* name, int* value ) const { + return QueryIntAttribute( name, value ); + } + + XMLError QueryAttribute( const char* name, unsigned int* value ) const { + return QueryUnsignedAttribute( name, value ); + } + + XMLError QueryAttribute(const char* name, int64_t* value) const { + return QueryInt64Attribute(name, value); + } + + XMLError QueryAttribute(const char* name, uint64_t* value) const { + return QueryUnsigned64Attribute(name, value); + } + + XMLError QueryAttribute( const char* name, bool* value ) const { + return QueryBoolAttribute( name, value ); + } + + XMLError QueryAttribute( const char* name, double* value ) const { + return QueryDoubleAttribute( name, value ); + } + + XMLError QueryAttribute( const char* name, float* value ) const { + return QueryFloatAttribute( name, value ); + } + + /// Sets the named attribute to value. + void SetAttribute( const char* name, const char* value ) { + XMLAttribute* a = FindOrCreateAttribute( name ); + a->SetAttribute( value ); + } + /// Sets the named attribute to value. + void SetAttribute( const char* name, int value ) { + XMLAttribute* a = FindOrCreateAttribute( name ); + a->SetAttribute( value ); + } + /// Sets the named attribute to value. + void SetAttribute( const char* name, unsigned value ) { + XMLAttribute* a = FindOrCreateAttribute( name ); + a->SetAttribute( value ); + } + + /// Sets the named attribute to value. + void SetAttribute(const char* name, int64_t value) { + XMLAttribute* a = FindOrCreateAttribute(name); + a->SetAttribute(value); + } + + /// Sets the named attribute to value. + void SetAttribute(const char* name, uint64_t value) { + XMLAttribute* a = FindOrCreateAttribute(name); + a->SetAttribute(value); + } + + /// Sets the named attribute to value. + void SetAttribute( const char* name, bool value ) { + XMLAttribute* a = FindOrCreateAttribute( name ); + a->SetAttribute( value ); + } + /// Sets the named attribute to value. + void SetAttribute( const char* name, double value ) { + XMLAttribute* a = FindOrCreateAttribute( name ); + a->SetAttribute( value ); + } + /// Sets the named attribute to value. + void SetAttribute( const char* name, float value ) { + XMLAttribute* a = FindOrCreateAttribute( name ); + a->SetAttribute( value ); + } + + /** + Delete an attribute. + */ + void DeleteAttribute( const char* name ); + + /// Return the first attribute in the list. + const XMLAttribute* FirstAttribute() const { + return _rootAttribute; + } + /// Query a specific attribute in the list. + const XMLAttribute* FindAttribute( const char* name ) const; + + /** Convenience function for easy access to the text inside an element. Although easy + and concise, GetText() is limited compared to getting the XMLText child + and accessing it directly. + + If the first child of 'this' is a XMLText, the GetText() + returns the character string of the Text node, else null is returned. + + This is a convenient method for getting the text of simple contained text: + @verbatim + This is text + const char* str = fooElement->GetText(); + @endverbatim + + 'str' will be a pointer to "This is text". + + Note that this function can be misleading. If the element foo was created from + this XML: + @verbatim + This is text + @endverbatim + + then the value of str would be null. The first child node isn't a text node, it is + another element. From this XML: + @verbatim + This is text + @endverbatim + GetText() will return "This is ". + */ + const char* GetText() const; + + /** Convenience function for easy access to the text inside an element. Although easy + and concise, SetText() is limited compared to creating an XMLText child + and mutating it directly. + + If the first child of 'this' is a XMLText, SetText() sets its value to + the given string, otherwise it will create a first child that is an XMLText. + + This is a convenient method for setting the text of simple contained text: + @verbatim + This is text + fooElement->SetText( "Hullaballoo!" ); + Hullaballoo! + @endverbatim + + Note that this function can be misleading. If the element foo was created from + this XML: + @verbatim + This is text + @endverbatim + + then it will not change "This is text", but rather prefix it with a text element: + @verbatim + Hullaballoo!This is text + @endverbatim + + For this XML: + @verbatim + + @endverbatim + SetText() will generate + @verbatim + Hullaballoo! + @endverbatim + */ + void SetText( const char* inText ); + /// Convenience method for setting text inside an element. See SetText() for important limitations. + void SetText( int value ); + /// Convenience method for setting text inside an element. See SetText() for important limitations. + void SetText( unsigned value ); + /// Convenience method for setting text inside an element. See SetText() for important limitations. + void SetText(int64_t value); + /// Convenience method for setting text inside an element. See SetText() for important limitations. + void SetText(uint64_t value); + /// Convenience method for setting text inside an element. See SetText() for important limitations. + void SetText( bool value ); + /// Convenience method for setting text inside an element. See SetText() for important limitations. + void SetText( double value ); + /// Convenience method for setting text inside an element. See SetText() for important limitations. + void SetText( float value ); + + /** + Convenience method to query the value of a child text node. This is probably best + shown by example. Given you have a document is this form: + @verbatim + + 1 + 1.4 + + @endverbatim + + The QueryIntText() and similar functions provide a safe and easier way to get to the + "value" of x and y. + + @verbatim + int x = 0; + float y = 0; // types of x and y are contrived for example + const XMLElement* xElement = pointElement->FirstChildElement( "x" ); + const XMLElement* yElement = pointElement->FirstChildElement( "y" ); + xElement->QueryIntText( &x ); + yElement->QueryFloatText( &y ); + @endverbatim + + @returns XML_SUCCESS (0) on success, XML_CAN_NOT_CONVERT_TEXT if the text cannot be converted + to the requested type, and XML_NO_TEXT_NODE if there is no child text to query. + + */ + XMLError QueryIntText( int* ival ) const; + /// See QueryIntText() + XMLError QueryUnsignedText( unsigned* uval ) const; + /// See QueryIntText() + XMLError QueryInt64Text(int64_t* uval) const; + /// See QueryIntText() + XMLError QueryUnsigned64Text(uint64_t* uval) const; + /// See QueryIntText() + XMLError QueryBoolText( bool* bval ) const; + /// See QueryIntText() + XMLError QueryDoubleText( double* dval ) const; + /// See QueryIntText() + XMLError QueryFloatText( float* fval ) const; + + int IntText(int defaultValue = 0) const; + + /// See QueryIntText() + unsigned UnsignedText(unsigned defaultValue = 0) const; + /// See QueryIntText() + int64_t Int64Text(int64_t defaultValue = 0) const; + /// See QueryIntText() + uint64_t Unsigned64Text(uint64_t defaultValue = 0) const; + /// See QueryIntText() + bool BoolText(bool defaultValue = false) const; + /// See QueryIntText() + double DoubleText(double defaultValue = 0) const; + /// See QueryIntText() + float FloatText(float defaultValue = 0) const; + + /** + Convenience method to create a new XMLElement and add it as last (right) + child of this node. Returns the created and inserted element. + */ + XMLElement* InsertNewChildElement(const char* name); + /// See InsertNewChildElement() + XMLComment* InsertNewComment(const char* comment); + /// See InsertNewChildElement() + XMLText* InsertNewText(const char* text); + /// See InsertNewChildElement() + XMLDeclaration* InsertNewDeclaration(const char* text); + /// See InsertNewChildElement() + XMLUnknown* InsertNewUnknown(const char* text); + + + // internal: + enum ElementClosingType { + OPEN, // + CLOSED, // + CLOSING // + }; + ElementClosingType ClosingType() const { + return _closingType; + } + virtual XMLNode* ShallowClone( XMLDocument* document ) const; + virtual bool ShallowEqual( const XMLNode* compare ) const; + +protected: + char* ParseDeep( char* p, StrPair* parentEndTag, int* curLineNumPtr ); + +private: + XMLElement( XMLDocument* doc ); + virtual ~XMLElement(); + XMLElement( const XMLElement& ); // not supported + void operator=( const XMLElement& ); // not supported + + XMLAttribute* FindOrCreateAttribute( const char* name ); + char* ParseAttributes( char* p, int* curLineNumPtr ); + static void DeleteAttribute( XMLAttribute* attribute ); + XMLAttribute* CreateAttribute(); + + enum { BUF_SIZE = 200 }; + ElementClosingType _closingType; + // The attribute list is ordered; there is no 'lastAttribute' + // because the list needs to be scanned for dupes before adding + // a new attribute. + XMLAttribute* _rootAttribute; +}; + + +enum Whitespace { + PRESERVE_WHITESPACE, + COLLAPSE_WHITESPACE +}; + + +/** A Document binds together all the functionality. + It can be saved, loaded, and printed to the screen. + All Nodes are connected and allocated to a Document. + If the Document is deleted, all its Nodes are also deleted. +*/ +class TINYXML2_LIB XMLDocument : public XMLNode +{ + friend class XMLElement; + // Gives access to SetError and Push/PopDepth, but over-access for everything else. + // Wishing C++ had "internal" scope. + friend class XMLNode; + friend class XMLText; + friend class XMLComment; + friend class XMLDeclaration; + friend class XMLUnknown; +public: + /// constructor + XMLDocument( bool processEntities = true, Whitespace whitespaceMode = PRESERVE_WHITESPACE ); + ~XMLDocument(); + + virtual XMLDocument* ToDocument() { + TIXMLASSERT( this == _document ); + return this; + } + virtual const XMLDocument* ToDocument() const { + TIXMLASSERT( this == _document ); + return this; + } + + /** + Parse an XML file from a character string. + Returns XML_SUCCESS (0) on success, or + an errorID. + + You may optionally pass in the 'nBytes', which is + the number of bytes which will be parsed. If not + specified, TinyXML-2 will assume 'xml' points to a + null terminated string. + */ + XMLError Parse( const char* xml, size_t nBytes=static_cast(-1) ); + + /** + Load an XML file from disk. + Returns XML_SUCCESS (0) on success, or + an errorID. + */ + XMLError LoadFile( const char* filename ); + + /** + Load an XML file from disk. You are responsible + for providing and closing the FILE*. + + NOTE: The file should be opened as binary ("rb") + not text in order for TinyXML-2 to correctly + do newline normalization. + + Returns XML_SUCCESS (0) on success, or + an errorID. + */ + XMLError LoadFile( FILE* ); + + /** + Save the XML file to disk. + Returns XML_SUCCESS (0) on success, or + an errorID. + */ + XMLError SaveFile( const char* filename, bool compact = false ); + + /** + Save the XML file to disk. You are responsible + for providing and closing the FILE*. + + Returns XML_SUCCESS (0) on success, or + an errorID. + */ + XMLError SaveFile( FILE* fp, bool compact = false ); + + bool ProcessEntities() const { + return _processEntities; + } + Whitespace WhitespaceMode() const { + return _whitespaceMode; + } + + /** + Returns true if this document has a leading Byte Order Mark of UTF8. + */ + bool HasBOM() const { + return _writeBOM; + } + /** Sets whether to write the BOM when writing the file. + */ + void SetBOM( bool useBOM ) { + _writeBOM = useBOM; + } + + /** Return the root element of DOM. Equivalent to FirstChildElement(). + To get the first node, use FirstChild(). + */ + XMLElement* RootElement() { + return FirstChildElement(); + } + const XMLElement* RootElement() const { + return FirstChildElement(); + } + + /** Print the Document. If the Printer is not provided, it will + print to stdout. If you provide Printer, this can print to a file: + @verbatim + XMLPrinter printer( fp ); + doc.Print( &printer ); + @endverbatim + + Or you can use a printer to print to memory: + @verbatim + XMLPrinter printer; + doc.Print( &printer ); + // printer.CStr() has a const char* to the XML + @endverbatim + */ + void Print( XMLPrinter* streamer=0 ) const; + virtual bool Accept( XMLVisitor* visitor ) const; + + /** + Create a new Element associated with + this Document. The memory for the Element + is managed by the Document. + */ + XMLElement* NewElement( const char* name ); + /** + Create a new Comment associated with + this Document. The memory for the Comment + is managed by the Document. + */ + XMLComment* NewComment( const char* comment ); + /** + Create a new Text associated with + this Document. The memory for the Text + is managed by the Document. + */ + XMLText* NewText( const char* text ); + /** + Create a new Declaration associated with + this Document. The memory for the object + is managed by the Document. + + If the 'text' param is null, the standard + declaration is used.: + @verbatim + + @endverbatim + */ + XMLDeclaration* NewDeclaration( const char* text=0 ); + /** + Create a new Unknown associated with + this Document. The memory for the object + is managed by the Document. + */ + XMLUnknown* NewUnknown( const char* text ); + + /** + Delete a node associated with this document. + It will be unlinked from the DOM. + */ + void DeleteNode( XMLNode* node ); + + void ClearError() { + SetError(XML_SUCCESS, 0, 0); + } + + /// Return true if there was an error parsing the document. + bool Error() const { + return _errorID != XML_SUCCESS; + } + /// Return the errorID. + XMLError ErrorID() const { + return _errorID; + } + const char* ErrorName() const; + static const char* ErrorIDToName(XMLError errorID); + + /** Returns a "long form" error description. A hopefully helpful + diagnostic with location, line number, and/or additional info. + */ + const char* ErrorStr() const; + + /// A (trivial) utility function that prints the ErrorStr() to stdout. + void PrintError() const; + + /// Return the line where the error occurred, or zero if unknown. + int ErrorLineNum() const + { + return _errorLineNum; + } + + /// Clear the document, resetting it to the initial state. + void Clear(); + + /** + Copies this document to a target document. + The target will be completely cleared before the copy. + If you want to copy a sub-tree, see XMLNode::DeepClone(). + + NOTE: that the 'target' must be non-null. + */ + void DeepCopy(XMLDocument* target) const; + + // internal + char* Identify( char* p, XMLNode** node ); + + // internal + void MarkInUse(const XMLNode* const); + + virtual XMLNode* ShallowClone( XMLDocument* /*document*/ ) const { + return 0; + } + virtual bool ShallowEqual( const XMLNode* /*compare*/ ) const { + return false; + } + +private: + XMLDocument( const XMLDocument& ); // not supported + void operator=( const XMLDocument& ); // not supported + + bool _writeBOM; + bool _processEntities; + XMLError _errorID; + Whitespace _whitespaceMode; + mutable StrPair _errorStr; + int _errorLineNum; + char* _charBuffer; + int _parseCurLineNum; + int _parsingDepth; + // Memory tracking does add some overhead. + // However, the code assumes that you don't + // have a bunch of unlinked nodes around. + // Therefore it takes less memory to track + // in the document vs. a linked list in the XMLNode, + // and the performance is the same. + DynArray _unlinked; + + MemPoolT< sizeof(XMLElement) > _elementPool; + MemPoolT< sizeof(XMLAttribute) > _attributePool; + MemPoolT< sizeof(XMLText) > _textPool; + MemPoolT< sizeof(XMLComment) > _commentPool; + + static const char* _errorNames[XML_ERROR_COUNT]; + + void Parse(); + + void SetError( XMLError error, int lineNum, const char* format, ... ); + + // Something of an obvious security hole, once it was discovered. + // Either an ill-formed XML or an excessively deep one can overflow + // the stack. Track stack depth, and error out if needed. + class DepthTracker { + public: + explicit DepthTracker(XMLDocument * document) { + this->_document = document; + document->PushDepth(); + } + ~DepthTracker() { + _document->PopDepth(); + } + private: + XMLDocument * _document; + }; + void PushDepth(); + void PopDepth(); + + template + NodeType* CreateUnlinkedNode( MemPoolT& pool ); +}; + +template +inline NodeType* XMLDocument::CreateUnlinkedNode( MemPoolT& pool ) +{ + TIXMLASSERT( sizeof( NodeType ) == PoolElementSize ); + TIXMLASSERT( sizeof( NodeType ) == pool.ItemSize() ); + NodeType* returnNode = new (pool.Alloc()) NodeType( this ); + TIXMLASSERT( returnNode ); + returnNode->_memPool = &pool; + + _unlinked.Push(returnNode); + return returnNode; +} + +/** + A XMLHandle is a class that wraps a node pointer with null checks; this is + an incredibly useful thing. Note that XMLHandle is not part of the TinyXML-2 + DOM structure. It is a separate utility class. + + Take an example: + @verbatim + + + + + + + @endverbatim + + Assuming you want the value of "attributeB" in the 2nd "Child" element, it's very + easy to write a *lot* of code that looks like: + + @verbatim + XMLElement* root = document.FirstChildElement( "Document" ); + if ( root ) + { + XMLElement* element = root->FirstChildElement( "Element" ); + if ( element ) + { + XMLElement* child = element->FirstChildElement( "Child" ); + if ( child ) + { + XMLElement* child2 = child->NextSiblingElement( "Child" ); + if ( child2 ) + { + // Finally do something useful. + @endverbatim + + And that doesn't even cover "else" cases. XMLHandle addresses the verbosity + of such code. A XMLHandle checks for null pointers so it is perfectly safe + and correct to use: + + @verbatim + XMLHandle docHandle( &document ); + XMLElement* child2 = docHandle.FirstChildElement( "Document" ).FirstChildElement( "Element" ).FirstChildElement().NextSiblingElement(); + if ( child2 ) + { + // do something useful + @endverbatim + + Which is MUCH more concise and useful. + + It is also safe to copy handles - internally they are nothing more than node pointers. + @verbatim + XMLHandle handleCopy = handle; + @endverbatim + + See also XMLConstHandle, which is the same as XMLHandle, but operates on const objects. +*/ +class TINYXML2_LIB XMLHandle +{ +public: + /// Create a handle from any node (at any depth of the tree.) This can be a null pointer. + explicit XMLHandle( XMLNode* node ) : _node( node ) { + } + /// Create a handle from a node. + explicit XMLHandle( XMLNode& node ) : _node( &node ) { + } + /// Copy constructor + XMLHandle( const XMLHandle& ref ) : _node( ref._node ) { + } + /// Assignment + XMLHandle& operator=( const XMLHandle& ref ) { + _node = ref._node; + return *this; + } + + /// Get the first child of this handle. + XMLHandle FirstChild() { + return XMLHandle( _node ? _node->FirstChild() : 0 ); + } + /// Get the first child element of this handle. + XMLHandle FirstChildElement( const char* name = 0 ) { + return XMLHandle( _node ? _node->FirstChildElement( name ) : 0 ); + } + /// Get the last child of this handle. + XMLHandle LastChild() { + return XMLHandle( _node ? _node->LastChild() : 0 ); + } + /// Get the last child element of this handle. + XMLHandle LastChildElement( const char* name = 0 ) { + return XMLHandle( _node ? _node->LastChildElement( name ) : 0 ); + } + /// Get the previous sibling of this handle. + XMLHandle PreviousSibling() { + return XMLHandle( _node ? _node->PreviousSibling() : 0 ); + } + /// Get the previous sibling element of this handle. + XMLHandle PreviousSiblingElement( const char* name = 0 ) { + return XMLHandle( _node ? _node->PreviousSiblingElement( name ) : 0 ); + } + /// Get the next sibling of this handle. + XMLHandle NextSibling() { + return XMLHandle( _node ? _node->NextSibling() : 0 ); + } + /// Get the next sibling element of this handle. + XMLHandle NextSiblingElement( const char* name = 0 ) { + return XMLHandle( _node ? _node->NextSiblingElement( name ) : 0 ); + } + + /// Safe cast to XMLNode. This can return null. + XMLNode* ToNode() { + return _node; + } + /// Safe cast to XMLElement. This can return null. + XMLElement* ToElement() { + return ( _node ? _node->ToElement() : 0 ); + } + /// Safe cast to XMLText. This can return null. + XMLText* ToText() { + return ( _node ? _node->ToText() : 0 ); + } + /// Safe cast to XMLUnknown. This can return null. + XMLUnknown* ToUnknown() { + return ( _node ? _node->ToUnknown() : 0 ); + } + /// Safe cast to XMLDeclaration. This can return null. + XMLDeclaration* ToDeclaration() { + return ( _node ? _node->ToDeclaration() : 0 ); + } + +private: + XMLNode* _node; +}; + + +/** + A variant of the XMLHandle class for working with const XMLNodes and Documents. It is the + same in all regards, except for the 'const' qualifiers. See XMLHandle for API. +*/ +class TINYXML2_LIB XMLConstHandle +{ +public: + explicit XMLConstHandle( const XMLNode* node ) : _node( node ) { + } + explicit XMLConstHandle( const XMLNode& node ) : _node( &node ) { + } + XMLConstHandle( const XMLConstHandle& ref ) : _node( ref._node ) { + } + + XMLConstHandle& operator=( const XMLConstHandle& ref ) { + _node = ref._node; + return *this; + } + + const XMLConstHandle FirstChild() const { + return XMLConstHandle( _node ? _node->FirstChild() : 0 ); + } + const XMLConstHandle FirstChildElement( const char* name = 0 ) const { + return XMLConstHandle( _node ? _node->FirstChildElement( name ) : 0 ); + } + const XMLConstHandle LastChild() const { + return XMLConstHandle( _node ? _node->LastChild() : 0 ); + } + const XMLConstHandle LastChildElement( const char* name = 0 ) const { + return XMLConstHandle( _node ? _node->LastChildElement( name ) : 0 ); + } + const XMLConstHandle PreviousSibling() const { + return XMLConstHandle( _node ? _node->PreviousSibling() : 0 ); + } + const XMLConstHandle PreviousSiblingElement( const char* name = 0 ) const { + return XMLConstHandle( _node ? _node->PreviousSiblingElement( name ) : 0 ); + } + const XMLConstHandle NextSibling() const { + return XMLConstHandle( _node ? _node->NextSibling() : 0 ); + } + const XMLConstHandle NextSiblingElement( const char* name = 0 ) const { + return XMLConstHandle( _node ? _node->NextSiblingElement( name ) : 0 ); + } + + + const XMLNode* ToNode() const { + return _node; + } + const XMLElement* ToElement() const { + return ( _node ? _node->ToElement() : 0 ); + } + const XMLText* ToText() const { + return ( _node ? _node->ToText() : 0 ); + } + const XMLUnknown* ToUnknown() const { + return ( _node ? _node->ToUnknown() : 0 ); + } + const XMLDeclaration* ToDeclaration() const { + return ( _node ? _node->ToDeclaration() : 0 ); + } + +private: + const XMLNode* _node; +}; + + +/** + Printing functionality. The XMLPrinter gives you more + options than the XMLDocument::Print() method. + + It can: + -# Print to memory. + -# Print to a file you provide. + -# Print XML without a XMLDocument. + + Print to Memory + + @verbatim + XMLPrinter printer; + doc.Print( &printer ); + SomeFunction( printer.CStr() ); + @endverbatim + + Print to a File + + You provide the file pointer. + @verbatim + XMLPrinter printer( fp ); + doc.Print( &printer ); + @endverbatim + + Print without a XMLDocument + + When loading, an XML parser is very useful. However, sometimes + when saving, it just gets in the way. The code is often set up + for streaming, and constructing the DOM is just overhead. + + The Printer supports the streaming case. The following code + prints out a trivially simple XML file without ever creating + an XML document. + + @verbatim + XMLPrinter printer( fp ); + printer.OpenElement( "foo" ); + printer.PushAttribute( "foo", "bar" ); + printer.CloseElement(); + @endverbatim +*/ +class TINYXML2_LIB XMLPrinter : public XMLVisitor +{ +public: + /** Construct the printer. If the FILE* is specified, + this will print to the FILE. Else it will print + to memory, and the result is available in CStr(). + If 'compact' is set to true, then output is created + with only required whitespace and newlines. + */ + XMLPrinter( FILE* file=0, bool compact = false, int depth = 0 ); + virtual ~XMLPrinter() {} + + /** If streaming, write the BOM and declaration. */ + void PushHeader( bool writeBOM, bool writeDeclaration ); + /** If streaming, start writing an element. + The element must be closed with CloseElement() + */ + void OpenElement( const char* name, bool compactMode=false ); + /// If streaming, add an attribute to an open element. + void PushAttribute( const char* name, const char* value ); + void PushAttribute( const char* name, int value ); + void PushAttribute( const char* name, unsigned value ); + void PushAttribute( const char* name, int64_t value ); + void PushAttribute( const char* name, uint64_t value ); + void PushAttribute( const char* name, bool value ); + void PushAttribute( const char* name, double value ); + /// If streaming, close the Element. + virtual void CloseElement( bool compactMode=false ); + + /// Add a text node. + void PushText( const char* text, bool cdata=false ); + /// Add a text node from an integer. + void PushText( int value ); + /// Add a text node from an unsigned. + void PushText( unsigned value ); + /// Add a text node from a signed 64bit integer. + void PushText( int64_t value ); + /// Add a text node from an unsigned 64bit integer. + void PushText( uint64_t value ); + /// Add a text node from a bool. + void PushText( bool value ); + /// Add a text node from a float. + void PushText( float value ); + /// Add a text node from a double. + void PushText( double value ); + + /// Add a comment + void PushComment( const char* comment ); + + void PushDeclaration( const char* value ); + void PushUnknown( const char* value ); + + virtual bool VisitEnter( const XMLDocument& /*doc*/ ); + virtual bool VisitExit( const XMLDocument& /*doc*/ ) { + return true; + } + + virtual bool VisitEnter( const XMLElement& element, const XMLAttribute* attribute ); + virtual bool VisitExit( const XMLElement& element ); + + virtual bool Visit( const XMLText& text ); + virtual bool Visit( const XMLComment& comment ); + virtual bool Visit( const XMLDeclaration& declaration ); + virtual bool Visit( const XMLUnknown& unknown ); + + /** + If in print to memory mode, return a pointer to + the XML file in memory. + */ + const char* CStr() const { + return _buffer.Mem(); + } + /** + If in print to memory mode, return the size + of the XML file in memory. (Note the size returned + includes the terminating null.) + */ + int CStrSize() const { + return _buffer.Size(); + } + /** + If in print to memory mode, reset the buffer to the + beginning. + */ + void ClearBuffer( bool resetToFirstElement = true ) { + _buffer.Clear(); + _buffer.Push(0); + _firstElement = resetToFirstElement; + } + +protected: + virtual bool CompactMode( const XMLElement& ) { return _compactMode; } + + /** Prints out the space before an element. You may override to change + the space and tabs used. A PrintSpace() override should call Print(). + */ + virtual void PrintSpace( int depth ); + void Print( const char* format, ... ); + void Write( const char* data, size_t size ); + inline void Write( const char* data ) { Write( data, strlen( data ) ); } + void Putc( char ch ); + + void SealElementIfJustOpened(); + bool _elementJustOpened; + DynArray< const char*, 10 > _stack; + +private: + void PrintString( const char*, bool restrictedEntitySet ); // prints out, after detecting entities. + + bool _firstElement; + FILE* _fp; + int _depth; + int _textDepth; + bool _processEntities; + bool _compactMode; + + enum { + ENTITY_RANGE = 64, + BUF_SIZE = 200 + }; + bool _entityFlag[ENTITY_RANGE]; + bool _restrictedEntityFlag[ENTITY_RANGE]; + + DynArray< char, 20 > _buffer; + + // Prohibit cloning, intentionally not implemented + XMLPrinter( const XMLPrinter& ); + XMLPrinter& operator=( const XMLPrinter& ); +}; + + +} // tinyxml2 + +#if defined(_MSC_VER) +# pragma warning(pop) +#endif + +#endif // TINYXML2_INCLUDED diff --git a/third_party/utfcpp/LICENSE b/third_party/utfcpp/LICENSE new file mode 100644 index 00000000..36b7cd93 --- /dev/null +++ b/third_party/utfcpp/LICENSE @@ -0,0 +1,23 @@ +Boost Software License - Version 1.0 - August 17th, 2003 + +Permission is hereby granted, free of charge, to any person or organization +obtaining a copy of the software and accompanying documentation covered by +this license (the "Software") to use, reproduce, display, distribute, +execute, and transmit the Software, and to prepare derivative works of the +Software, and to permit third-parties to whom the Software is furnished to +do so, all subject to the following: + +The copyright notices in the Software and this entire statement, including +the above license grant, this restriction and the following disclaimer, +must be included in all copies of the Software, in whole or in part, and +all derivative works of the Software, unless such copies or derivative +works are solely in the form of machine-executable object code generated by +a source language processor. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT +SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE +FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. diff --git a/third_party/utfcpp/source/utf8/core.h b/third_party/utfcpp/source/utf8/core.h new file mode 100644 index 00000000..244e8923 --- /dev/null +++ b/third_party/utfcpp/source/utf8/core.h @@ -0,0 +1,338 @@ +// Copyright 2006 Nemanja Trifunovic + +/* +Permission is hereby granted, free of charge, to any person or organization +obtaining a copy of the software and accompanying documentation covered by +this license (the "Software") to use, reproduce, display, distribute, +execute, and transmit the Software, and to prepare derivative works of the +Software, and to permit third-parties to whom the Software is furnished to +do so, all subject to the following: + +The copyright notices in the Software and this entire statement, including +the above license grant, this restriction and the following disclaimer, +must be included in all copies of the Software, in whole or in part, and +all derivative works of the Software, unless such copies or derivative +works are solely in the form of machine-executable object code generated by +a source language processor. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT +SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE +FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +*/ + + +#ifndef UTF8_FOR_CPP_CORE_H_2675DCD0_9480_4c0c_B92A_CC14C027B731 +#define UTF8_FOR_CPP_CORE_H_2675DCD0_9480_4c0c_B92A_CC14C027B731 + +#include + +// Determine the C++ standard version. +// If the user defines UTF_CPP_CPLUSPLUS, use that. +// Otherwise, trust the unreliable predefined macro __cplusplus + +#if !defined UTF_CPP_CPLUSPLUS + #define UTF_CPP_CPLUSPLUS __cplusplus +#endif + +#if UTF_CPP_CPLUSPLUS >= 201103L // C++ 11 or later + #define OVERRIDE override + #define NOEXCEPT noexcept +#else // C++ 98/03 + #define OVERRIDE + #define NOEXCEPT throw() +#endif // C++ 11 or later + + +namespace utf8 +{ + // The typedefs for 8-bit, 16-bit and 32-bit unsigned integers + // You may need to change them to match your system. + // These typedefs have the same names as ones from cstdint, or boost/cstdint + typedef unsigned char uint8_t; + typedef unsigned short uint16_t; + typedef unsigned int uint32_t; + +// Helper code - not intended to be directly called by the library users. May be changed at any time +namespace internal +{ + // Unicode constants + // Leading (high) surrogates: 0xd800 - 0xdbff + // Trailing (low) surrogates: 0xdc00 - 0xdfff + const uint16_t LEAD_SURROGATE_MIN = 0xd800u; + const uint16_t LEAD_SURROGATE_MAX = 0xdbffu; + const uint16_t TRAIL_SURROGATE_MIN = 0xdc00u; + const uint16_t TRAIL_SURROGATE_MAX = 0xdfffu; + const uint16_t LEAD_OFFSET = 0xd7c0u; // LEAD_SURROGATE_MIN - (0x10000 >> 10) + const uint32_t SURROGATE_OFFSET = 0xfca02400u; // 0x10000u - (LEAD_SURROGATE_MIN << 10) - TRAIL_SURROGATE_MIN + + // Maximum valid value for a Unicode code point + const uint32_t CODE_POINT_MAX = 0x0010ffffu; + + template + inline uint8_t mask8(octet_type oc) + { + return static_cast(0xff & oc); + } + template + inline uint16_t mask16(u16_type oc) + { + return static_cast(0xffff & oc); + } + template + inline bool is_trail(octet_type oc) + { + return ((utf8::internal::mask8(oc) >> 6) == 0x2); + } + + template + inline bool is_lead_surrogate(u16 cp) + { + return (cp >= LEAD_SURROGATE_MIN && cp <= LEAD_SURROGATE_MAX); + } + + template + inline bool is_trail_surrogate(u16 cp) + { + return (cp >= TRAIL_SURROGATE_MIN && cp <= TRAIL_SURROGATE_MAX); + } + + template + inline bool is_surrogate(u16 cp) + { + return (cp >= LEAD_SURROGATE_MIN && cp <= TRAIL_SURROGATE_MAX); + } + + template + inline bool is_code_point_valid(u32 cp) + { + return (cp <= CODE_POINT_MAX && !utf8::internal::is_surrogate(cp)); + } + + template + inline typename std::iterator_traits::difference_type + sequence_length(octet_iterator lead_it) + { + uint8_t lead = utf8::internal::mask8(*lead_it); + if (lead < 0x80) + return 1; + else if ((lead >> 5) == 0x6) + return 2; + else if ((lead >> 4) == 0xe) + return 3; + else if ((lead >> 3) == 0x1e) + return 4; + else + return 0; + } + + template + inline bool is_overlong_sequence(uint32_t cp, octet_difference_type length) + { + if (cp < 0x80) { + if (length != 1) + return true; + } + else if (cp < 0x800) { + if (length != 2) + return true; + } + else if (cp < 0x10000) { + if (length != 3) + return true; + } + + return false; + } + + enum utf_error {UTF8_OK, NOT_ENOUGH_ROOM, INVALID_LEAD, INCOMPLETE_SEQUENCE, OVERLONG_SEQUENCE, INVALID_CODE_POINT}; + + /// Helper for get_sequence_x + template + utf_error increase_safely(octet_iterator& it, octet_iterator end) + { + if (++it == end) + return NOT_ENOUGH_ROOM; + + if (!utf8::internal::is_trail(*it)) + return INCOMPLETE_SEQUENCE; + + return UTF8_OK; + } + + #define UTF8_CPP_INCREASE_AND_RETURN_ON_ERROR(IT, END) {utf_error ret = increase_safely(IT, END); if (ret != UTF8_OK) return ret;} + + /// get_sequence_x functions decode utf-8 sequences of the length x + template + utf_error get_sequence_1(octet_iterator& it, octet_iterator end, uint32_t& code_point) + { + if (it == end) + return NOT_ENOUGH_ROOM; + + code_point = utf8::internal::mask8(*it); + + return UTF8_OK; + } + + template + utf_error get_sequence_2(octet_iterator& it, octet_iterator end, uint32_t& code_point) + { + if (it == end) + return NOT_ENOUGH_ROOM; + + code_point = utf8::internal::mask8(*it); + + UTF8_CPP_INCREASE_AND_RETURN_ON_ERROR(it, end) + + code_point = ((code_point << 6) & 0x7ff) + ((*it) & 0x3f); + + return UTF8_OK; + } + + template + utf_error get_sequence_3(octet_iterator& it, octet_iterator end, uint32_t& code_point) + { + if (it == end) + return NOT_ENOUGH_ROOM; + + code_point = utf8::internal::mask8(*it); + + UTF8_CPP_INCREASE_AND_RETURN_ON_ERROR(it, end) + + code_point = ((code_point << 12) & 0xffff) + ((utf8::internal::mask8(*it) << 6) & 0xfff); + + UTF8_CPP_INCREASE_AND_RETURN_ON_ERROR(it, end) + + code_point += (*it) & 0x3f; + + return UTF8_OK; + } + + template + utf_error get_sequence_4(octet_iterator& it, octet_iterator end, uint32_t& code_point) + { + if (it == end) + return NOT_ENOUGH_ROOM; + + code_point = utf8::internal::mask8(*it); + + UTF8_CPP_INCREASE_AND_RETURN_ON_ERROR(it, end) + + code_point = ((code_point << 18) & 0x1fffff) + ((utf8::internal::mask8(*it) << 12) & 0x3ffff); + + UTF8_CPP_INCREASE_AND_RETURN_ON_ERROR(it, end) + + code_point += (utf8::internal::mask8(*it) << 6) & 0xfff; + + UTF8_CPP_INCREASE_AND_RETURN_ON_ERROR(it, end) + + code_point += (*it) & 0x3f; + + return UTF8_OK; + } + + #undef UTF8_CPP_INCREASE_AND_RETURN_ON_ERROR + + template + utf_error validate_next(octet_iterator& it, octet_iterator end, uint32_t& code_point) + { + if (it == end) + return NOT_ENOUGH_ROOM; + + // Save the original value of it so we can go back in case of failure + // Of course, it does not make much sense with i.e. stream iterators + octet_iterator original_it = it; + + uint32_t cp = 0; + // Determine the sequence length based on the lead octet + typedef typename std::iterator_traits::difference_type octet_difference_type; + const octet_difference_type length = utf8::internal::sequence_length(it); + + // Get trail octets and calculate the code point + utf_error err = UTF8_OK; + switch (length) { + case 0: + return INVALID_LEAD; + case 1: + err = utf8::internal::get_sequence_1(it, end, cp); + break; + case 2: + err = utf8::internal::get_sequence_2(it, end, cp); + break; + case 3: + err = utf8::internal::get_sequence_3(it, end, cp); + break; + case 4: + err = utf8::internal::get_sequence_4(it, end, cp); + break; + } + + if (err == UTF8_OK) { + // Decoding succeeded. Now, security checks... + if (utf8::internal::is_code_point_valid(cp)) { + if (!utf8::internal::is_overlong_sequence(cp, length)){ + // Passed! Return here. + code_point = cp; + ++it; + return UTF8_OK; + } + else + err = OVERLONG_SEQUENCE; + } + else + err = INVALID_CODE_POINT; + } + + // Failure branch - restore the original value of the iterator + it = original_it; + return err; + } + + template + inline utf_error validate_next(octet_iterator& it, octet_iterator end) { + uint32_t ignored; + return utf8::internal::validate_next(it, end, ignored); + } + +} // namespace internal + + /// The library API - functions intended to be called by the users + + // Byte order mark + const uint8_t bom[] = {0xef, 0xbb, 0xbf}; + + template + octet_iterator find_invalid(octet_iterator start, octet_iterator end) + { + octet_iterator result = start; + while (result != end) { + utf8::internal::utf_error err_code = utf8::internal::validate_next(result, end); + if (err_code != internal::UTF8_OK) + return result; + } + return result; + } + + template + inline bool is_valid(octet_iterator start, octet_iterator end) + { + return (utf8::find_invalid(start, end) == end); + } + + template + inline bool starts_with_bom (octet_iterator it, octet_iterator end) + { + return ( + ((it != end) && (utf8::internal::mask8(*it++)) == bom[0]) && + ((it != end) && (utf8::internal::mask8(*it++)) == bom[1]) && + ((it != end) && (utf8::internal::mask8(*it)) == bom[2]) + ); + } +} // namespace utf8 + +#endif // header guard + + diff --git a/third_party/utfcpp/source/utf8/unchecked.h b/third_party/utfcpp/source/utf8/unchecked.h new file mode 100644 index 00000000..0e1b51cc --- /dev/null +++ b/third_party/utfcpp/source/utf8/unchecked.h @@ -0,0 +1,274 @@ +// Copyright 2006 Nemanja Trifunovic + +/* +Permission is hereby granted, free of charge, to any person or organization +obtaining a copy of the software and accompanying documentation covered by +this license (the "Software") to use, reproduce, display, distribute, +execute, and transmit the Software, and to prepare derivative works of the +Software, and to permit third-parties to whom the Software is furnished to +do so, all subject to the following: + +The copyright notices in the Software and this entire statement, including +the above license grant, this restriction and the following disclaimer, +must be included in all copies of the Software, in whole or in part, and +all derivative works of the Software, unless such copies or derivative +works are solely in the form of machine-executable object code generated by +a source language processor. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT +SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE +FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +*/ + + +#ifndef UTF8_FOR_CPP_UNCHECKED_H_2675DCD0_9480_4c0c_B92A_CC14C027B731 +#define UTF8_FOR_CPP_UNCHECKED_H_2675DCD0_9480_4c0c_B92A_CC14C027B731 + +#include "core.h" + +namespace utf8 +{ + namespace unchecked + { + template + octet_iterator append(uint32_t cp, octet_iterator result) + { + if (cp < 0x80) // one octet + *(result++) = static_cast(cp); + else if (cp < 0x800) { // two octets + *(result++) = static_cast((cp >> 6) | 0xc0); + *(result++) = static_cast((cp & 0x3f) | 0x80); + } + else if (cp < 0x10000) { // three octets + *(result++) = static_cast((cp >> 12) | 0xe0); + *(result++) = static_cast(((cp >> 6) & 0x3f) | 0x80); + *(result++) = static_cast((cp & 0x3f) | 0x80); + } + else { // four octets + *(result++) = static_cast((cp >> 18) | 0xf0); + *(result++) = static_cast(((cp >> 12) & 0x3f)| 0x80); + *(result++) = static_cast(((cp >> 6) & 0x3f) | 0x80); + *(result++) = static_cast((cp & 0x3f) | 0x80); + } + return result; + } + + template + output_iterator replace_invalid(octet_iterator start, octet_iterator end, output_iterator out, uint32_t replacement) + { + while (start != end) { + octet_iterator sequence_start = start; + internal::utf_error err_code = utf8::internal::validate_next(start, end); + switch (err_code) { + case internal::UTF8_OK : + for (octet_iterator it = sequence_start; it != start; ++it) + *out++ = *it; + break; + case internal::NOT_ENOUGH_ROOM: + out = utf8::unchecked::append (replacement, out); + start = end; + break; + case internal::INVALID_LEAD: + out = utf8::unchecked::append (replacement, out); + ++start; + break; + case internal::INCOMPLETE_SEQUENCE: + case internal::OVERLONG_SEQUENCE: + case internal::INVALID_CODE_POINT: + out = utf8::unchecked::append (replacement, out); + ++start; + // just one replacement mark for the sequence + while (start != end && utf8::internal::is_trail(*start)) + ++start; + break; + } + } + return out; + } + + template + inline output_iterator replace_invalid(octet_iterator start, octet_iterator end, output_iterator out) + { + static const uint32_t replacement_marker = utf8::internal::mask16(0xfffd); + return utf8::unchecked::replace_invalid(start, end, out, replacement_marker); + } + + template + uint32_t next(octet_iterator& it) + { + uint32_t cp = utf8::internal::mask8(*it); + typename std::iterator_traits::difference_type length = utf8::internal::sequence_length(it); + switch (length) { + case 1: + break; + case 2: + it++; + cp = ((cp << 6) & 0x7ff) + ((*it) & 0x3f); + break; + case 3: + ++it; + cp = ((cp << 12) & 0xffff) + ((utf8::internal::mask8(*it) << 6) & 0xfff); + ++it; + cp += (*it) & 0x3f; + break; + case 4: + ++it; + cp = ((cp << 18) & 0x1fffff) + ((utf8::internal::mask8(*it) << 12) & 0x3ffff); + ++it; + cp += (utf8::internal::mask8(*it) << 6) & 0xfff; + ++it; + cp += (*it) & 0x3f; + break; + } + ++it; + return cp; + } + + template + uint32_t peek_next(octet_iterator it) + { + return utf8::unchecked::next(it); + } + + template + uint32_t prior(octet_iterator& it) + { + while (utf8::internal::is_trail(*(--it))) ; + octet_iterator temp = it; + return utf8::unchecked::next(temp); + } + + template + void advance (octet_iterator& it, distance_type n) + { + const distance_type zero(0); + if (n < zero) { + // backward + for (distance_type i = n; i < zero; ++i) + utf8::unchecked::prior(it); + } else { + // forward + for (distance_type i = zero; i < n; ++i) + utf8::unchecked::next(it); + } + } + + template + typename std::iterator_traits::difference_type + distance (octet_iterator first, octet_iterator last) + { + typename std::iterator_traits::difference_type dist; + for (dist = 0; first < last; ++dist) + utf8::unchecked::next(first); + return dist; + } + + template + octet_iterator utf16to8 (u16bit_iterator start, u16bit_iterator end, octet_iterator result) + { + while (start != end) { + uint32_t cp = utf8::internal::mask16(*start++); + // Take care of surrogate pairs first + if (utf8::internal::is_lead_surrogate(cp)) { + uint32_t trail_surrogate = utf8::internal::mask16(*start++); + cp = (cp << 10) + trail_surrogate + internal::SURROGATE_OFFSET; + } + result = utf8::unchecked::append(cp, result); + } + return result; + } + + template + u16bit_iterator utf8to16 (octet_iterator start, octet_iterator end, u16bit_iterator result) + { + while (start < end) { + uint32_t cp = utf8::unchecked::next(start); + if (cp > 0xffff) { //make a surrogate pair + *result++ = static_cast((cp >> 10) + internal::LEAD_OFFSET); + *result++ = static_cast((cp & 0x3ff) + internal::TRAIL_SURROGATE_MIN); + } + else + *result++ = static_cast(cp); + } + return result; + } + + template + octet_iterator utf32to8 (u32bit_iterator start, u32bit_iterator end, octet_iterator result) + { + while (start != end) + result = utf8::unchecked::append(*(start++), result); + + return result; + } + + template + u32bit_iterator utf8to32 (octet_iterator start, octet_iterator end, u32bit_iterator result) + { + while (start < end) + (*result++) = utf8::unchecked::next(start); + + return result; + } + + // The iterator class + template + class iterator { + octet_iterator it; + public: + typedef uint32_t value_type; + typedef uint32_t* pointer; + typedef uint32_t& reference; + typedef std::ptrdiff_t difference_type; + typedef std::bidirectional_iterator_tag iterator_category; + iterator () {} + explicit iterator (const octet_iterator& octet_it): it(octet_it) {} + // the default "big three" are OK + octet_iterator base () const { return it; } + uint32_t operator * () const + { + octet_iterator temp = it; + return utf8::unchecked::next(temp); + } + bool operator == (const iterator& rhs) const + { + return (it == rhs.it); + } + bool operator != (const iterator& rhs) const + { + return !(operator == (rhs)); + } + iterator& operator ++ () + { + ::std::advance(it, utf8::internal::sequence_length(it)); + return *this; + } + iterator operator ++ (int) + { + iterator temp = *this; + ::std::advance(it, utf8::internal::sequence_length(it)); + return temp; + } + iterator& operator -- () + { + utf8::unchecked::prior(it); + return *this; + } + iterator operator -- (int) + { + iterator temp = *this; + utf8::unchecked::prior(it); + return temp; + } + }; // class iterator + + } // namespace utf8::unchecked +} // namespace utf8 + + +#endif // header guard + diff --git a/tools/readme.MD b/tools/readme.MD index c53db8a6..56244930 100644 --- a/tools/readme.MD +++ b/tools/readme.MD @@ -1,7 +1,7 @@ This folder contains the source code to small, custom level editing tools that I used when originally creating VVVVVV! They're included here for the sake of completeness. -These are the tools that exported levels as source code for use in the game. The different versions were quick copy and paste forks for different areas in the game - they're mostly the same, but some versions had slight changes made for situations unique to those areas. +These are the tool that exported levels as source code for use in the game. The different versions were quick copy and paste forks for different areas in the game - they're mostly the same, but some versions had slight changes made for situations unique to those areas. These tools were never meant to be used by anybody else, and I don't recommend wasting too much time with them. If you're interested in further development with VVVVVV, a more promising and future facing direction to explore is the built in level editor and the external .vvvvvv level file format, originally added in 2011 for the C++ port. -If you do want to compile them, you'll need Allegro v4.3 and probably a lot of patience and trial and error to figure out how they all work. Good luck! +If you do want to compile them, you'll need Allegro v4.3 and probably a lot of patience and trial and error to figure out how they all work. Good luck! \ No newline at end of file